Re: modifying initrd.img

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Daniel,

I'm not an expert on this or anything, but I had a similar question a few months ago and someone from the kickstart list was kind enough to help me.
Here are the steps I have been using to mount and alter the initrd.img.  I did this because I wanted to use two ks.cfg files.  I hope you find this
helpful.

Rebecca



Instructions for altering the initrd.img

Grab the boot.img from the images directory, rename and copy to /tmp
cp /home/kickstart/images/boot.img /tmp/custom.img

Mount the image
mount -o loop /tmp/custom.img /mnt/image

Copy the RAM disk image to /tmp
cp /mnt/image/initrd.img /tmp

Uncompress RAM disk to get an ext2 filesystem
gzip -dc /tmp/initrd.img > /tmp/initrd.ext2

Mount the expanded image
mount -o loop /tmp/initrd.ext2 /mnt/initrd

Copy your ks.cfg files to the mounted image
cp /home/kickstart/ks.cfg /mnt/initrd

This is an important step if the floppy is full. The ext2 partition has junk left over from the removed files. It will not compress and
fit on the floppy without zeroing unused bits to improve compression ratio. You will get an error that says "No Space Left on Device" -- just continue
 on.
You will always receive that error
touch /mnt/initrd/zerofile
cat /dev/zero > /mnt/initrd/zerofile
rm -f /mnt/initrd/zerofile

Unmount the ext2 filesystem
umount /tmp/initrd.ext2

Recompress the RAM disk
gzip /tmp/initrd.ext2

Remove the old RAM disk from the boot image
rm -f /mnt/image/initrd.img

Copy the new RAM disk to the boot image
mv /tmp/initrd.ext2.gz /mnt/image/initrd.img

Remove unneeded *.msg files from /mnt/image -- this isn't necessary, it just gives you more room on the disk

Copy your syslinux.cfg and boot.msg files to the mounted image
cp /home/kickstart/images/boot.msg /mnt/image
cp /home/kickstart/images/syslinux.cfg /mnt/image

Unmount the image
umount /mnt/image

custom.img is located in /tmp. This is the file that will need to be copied to a floppy in order to create a kickstart floppy.






Daniel Shahin <dshahin@xxxxxxxxxxxxx>@redhat.com on 06/22/2001 02:59:28 PM

Please respond to kickstart-list@xxxxxxxxxx

Sent by:  kickstart-list-admin@xxxxxxxxxx


To:   kickstart-list@xxxxxxxxxx
cc:

Subject:  modifying initrd.img


does anyone know how to modify the initrd.img file.  I'd really like to
pick this apart, and be able to customize the mini-distro, to add other
tools, if possible.  Does anyone have any experience doing this?  Any
pointers?

thanks in advance,

dshahin



_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/kickstart-list







[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux