Operating Systems > Linux and UNIX
Well, I'm stupid..
voidmain:
The initrd.img? I love Linux for these sorts of cool filesystem tricks, along with mounting ISO files directly without having to burn them. I don't know if you've played with mounting images on loop devices but it's extremely cool. I have several ISO images of CDs on my server and I mount them on a loop device and then Samba share them. It's like having 30 CD-ROM drives on my machine.
# mount /iso/win2000.iso /loop/win2000 -o loop
or the entry in /etc/fstab would be something like:
/iso/win2000.iso /loop/win2000 iso9660 user,exec,ro,loop 0 0
And of course you can copy or change anything in that mounted filesystem before writing it to CD. Whenever someone wants a CD I just cdrecord one of the images to a blank disk and hand it over.
And I like manipulating the initrd.img in a similar matter but like you say that file *is* compressed so:
# zcat /boot/initrd.img > /images/initrd.dat
# mount /images/initrd.dat /mnt/initrd -o loop
add kernel modules etc under /mnt/initrd and/or change the boot scripts then:
# umount /mnt/initrd
# gzip -cd < /images/initrd.dat > /boot/initrd.img
Fun stuff...
[ March 01, 2002: Message edited by: VoidMain ]
Calum:
is there some tutorial that can explain more initrd.img stuff to me please?
also, i hadn't heard of zcat before, i'll have to find out what that is...
voidmain:
zcat is just a link to gzip but when it is executed as zcat it uncompresses a gzipped file to STDOUT (to your screen if you don't redirect or pipe the output). It's exactly the same as doing a "gunzip -c". gunzip, gzip, and zcat are actually all the same file (do an "ls -i /bin/zcat", an "ls -i /bin/gzip" and an "ls -i /bin/gunzip" and you will see they all are the same inode).
The "initrd" man page has a good overview of the purpose of it (man initrd).
[ November 25, 2002: Message edited by: void main ]
Calum:
thank you!
you raise a point i have just recently found out about and am still perplexed by! if you link to an application, how does it know what parameters to invoke? i mean this zcat link, how does bzip know?
another example is joe. you can invoke joe with jmacs, jpico or jword, and it will emulate the three different editors accordingly, but if they are all just links, how does it know?
Another example is BusyBox, how does it know which of about 60 links to it wants it to do what?
i know i am asking a lot of dumb newbie questions today, so sorry!
voidmain:
[edit]ignore this[/edit]
[ November 25, 2002: Message edited by: void main ]
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version