[Fedora-livecd-list] Custom initrd

Jeremy Katz katzj at redhat.com
Sat Aug 15 02:45:47 UTC 2009


On Saturday, August 15 2009, Mads Kiilerich said:
> I have figured out that livecd-creator through imgcreate creates a  
> /etc/sysconfig/mkinitrd. When rpms runs mkinitrd from their %post script  
> then it will exec mkliveinitrd and use the configured module list.  
> AFAICS livecd-creator then picks up the initrd from /boot, and the end  
> result after having written the iso to usb with livecd-iso-to-disk is  
> that it ends up in /syslinux/initrd0.img.

Correct

> But if I overwrite the /boot/initrd* in %post like this:
>     /sbin/mkinitrd -f /boot/initrd-$(rpm -q kernel --qf  
> '%{version}-%{release}.%{arch}\n').img $(rpm -q kernel --qf  
> '%{version}-%{release}.%{arch}\n')
> then it won't be used.
>
> What am I doing wrong? When is the initrd picked up? What is the code flow?

%post runs after we've set up the boot loader bits.  Otherwise, it
%wouldn't be the last thing run.  So if you want to do this, you have to
do something like we did for Fedora 8 on the initial move of initramfs
stuff into mkinitrd proper.  See commit
11dbd0bb5ba4b845e80109e990e4e780ca402218

Also note that all of this is subject to some amount of change in Fedora
12 with the move to using dracut instead of mkinitrd

Jeremy




More information about the livecd mailing list