Curtin does not regenerate initramfs for CentOS
Bug #1915573 reported by
Lee Trager
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
New
|
Undecided
|
Unassigned |
Bug Description
When Curtin installs Ubuntu it installs a kernel from the archive which generates an initramfs. This initramfs includes all the kernel modules needed to boot the target hardware. When CentOS is installed the kernel and initramfs are already in the image. Since the CentOS image is generated in KVM the initramfs has minimal kernel modules. Field has experienced a case where missing kernel modules in CentOS's initramfs caused deployment failures. Replacing the initramfs with an initramfs generated on the hardware fixed the issue.
Curtin should rebuild CentOS's initramfs on deployment.
Changed in curtin: | |
status: | Incomplete → New |
To post a comment you must log in.
Thanks Lee, the description is correct. This issue can be easily reproduced by installing the MAAS Centos8 image provided in the latest streams to any piece of hardware that has a fancy disk , such as nvme or perhaps even a raid. You will find that the OS will hang shortly after mounting and booting from /sysroot.
There will be no errors/warnings etc.
The workaround was to install centos8 on the same hardware using the centos installer, copy the kernel modules to the mass installed disk image and regenerate the initram fs.
To reproduce this:
-- Deploy the maas centos8 image to a disk.
-- Upon boot the operating system will hang after mounting /sysroot with no apparent warnings or errors.
-- Upon restarting boot into single user mode ( append , `rd.break` kernel param upon booting.) kernel- <version> /net/*. ko drivers or drivers/ platform/ *.ko, usr/*.ko, etc.....
-- Remount sysroot rw, $mount -o remount,rw /sysroot
-- observe there are no logs or warnings anyhere on the disk. Most of the kernel modules installed are a minimal set, usually found in qemu. You will not have a wide variety of /lib/modules/
To fix this.
-- Install centos8 using there manual installer or netboot it via a mirror. <kernel> to /lib/modules on the maas deployed disk.
-- Ensure you install it to a NEW disk partition, do not erase the maas deployed image.
after the system comes up, copy the /lib/modules/
#mount the root disk partition> /mnt/maasdisk
$mkdir /mnt/maasdisk
$mount </dev/device/
#mount the efi partition parititon> /mnt/maasdisk/ boot/efi/
$mount </dev/device/
#bind mount sys and dev
$mount --rbind /sys /mnt/maasdisk/sys
$mount --rbind /dev /mnt/maasdisk/dev
$mount -t proc /proc /mnt/maasdisk/proc
#for good measure ensure the kernels on the host machine and maas disk image are the same and copy the modules from the host machine to the maas disk image. lib/modules/ <kernel- modules> -> <kernel- modules. old> lib/modules/
$mv /mnt/maasdisk/
$cp -R /lib/modules/* /mnt/maasdisk/
#chroot into maasdisk
$chroot /mnt/maasdisk
#rebuild initramfs
$dracut --regenerate-all --force
#verify the maas disk image now boots
Success!
-- copy the maas disk image /lib/modules and initrd to the custom maas image created via packer-maas.
$ tar -xvf maas.tar.img
# replace the initrd and /lib/modules with the ones used to repair maas disk image, tar the conents back and upload to maas.
$tar -Sczpf $OUTPUT --selinux -C <maas_img_dir> . 8-custom' title='CentOS 8 Cus 'amd64/ generic' filetype='tgz' content@ =centos8. tar.gz
$ maas $PROFILE boot-resources create name='centos/
tom' architecture=