Re: Changing initrd contents and grub

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

 



Richard Michael wrote:
Hello list,

I've changed my RAID and LVM configuration and need to modify the
respective commands in the /init of my initrd.

I made those changes by decompressing and extracting the cpio archive,
editting the init script (add a couple lines for mdadm, changed the
activated volume group name), rebuilt a cpio archive (using the correct
"-c"/"-H newc" SVR4 format) and fed it back through gzip (max
compression), then I just moved aside the old initrd, replacing it with
my new one:

mkdir /boot/tmp
cd !$
gzip -dc ../initrd-<version> | cpio -id
vi init
find . -depth -print | cpio -oc | gzip -9 > ../initrd-<version>.new cd ..
mv initrd-<version> initrd-<version>.orig
mv initrd-<version>.new initrd-<version>

The kernel now panics (paraphrase) "can't find /init".

It does not do this if I restore the original initrd.

I have not changed the name of the initrd, filenames match grub.conf and
grub's boot menu, etc.  I have done this type of modification
successfully in the past, but only changing a single character in /init.

Just a thought here, since I have also tried this several times with limited success:

The whole point of mkinitrd is to avoid these 'by hand' operations.

After you make your changes, run mkinitrd to generate a new initrd. It will pick up changes in /etc/modprobe.conf and /etc/fstab and try to do the right thing. Besides that, mkinitrd will accept arguments that allow additional drivers to be loaded, with arguments if needed, as well as many other options.

I am pretty sure that a modern mkinitrd will make almost all need for manual edits of an initrd image unnecessary.

Good luck!

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux