I've been building my own kernel (4.19.37) and have no issues during build (make
) or install (make install_modules
+make install
). Everything seems to go fine until I execute grub2-mkconfig -o /boot/grub2/grub.cfg
. When executing this command, grub finds both my existing and new vmlinuz-*
kernels in /boot/
as well as their corresponding initramfs-*.img
. However, at that point the system hangs indefinitely (> several hours). Ctrl+C
does not seem to stop it and I must reboot. I have looked into this issue and all I have found that could be a problem is the probing of removal disks for bootable OS's, which I have eliminated by both removing them and by adding GRUB_DISABLE_OS_PROBER=true
to /etc/default/grub
per this SE post. Neither has helped.
Upon reboot, I end up at the grub>
command line, presumably because the grub2-mkconfig
never finished and corrupted the grub configuration file. Here I can load both the old and new kernel without any issue, as well as initramfs, but when I execute boot I get a kernel panic:
end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
Naturally, it is my assumption that there is something wrong with my initramfs-4.19.37.img
that was created by my build process. As an experiment, I tested if I could load the new kernel, but use the old initramfs (4.19.10), and indeed it does boot into emergency mode
. I however cannot do the opposite, old kernel with new initramfs. So something is fishy with my new initramfs image.
Getting smarter, my last experiment was mounting the old and new initramfs image with mount
. They both mount successfully with no errors, and seem to have identical file structures. I have also compared both my new and old .config
files for the kernel builds, and the differences are trivial.
A few other notes/observations:
- In the image above, you can see
List of all partions:
produces nothing, so I am wondering if there is an issue with the file system type? My hard drive isxfs
, what is the file system for theinitramfs
? CPIO? - At the
grub>
command line,ls /
produces what I expect to see in/boot
. It contains all myvmlinuz-*
andinitramfs-*.img
files - My file system is
xfs
- I've tried various other kernel versions with same results
- I have twice had successful builds and installs, once was the existing kernel (4.19.10), it was an upgrade, and a second time with the same kernel with a
low-latency
pre-emption model. I can't for the life of me figure out what I did differently then.
So the final question(s) are - What's wrong with the initramfs
form these builds? What else can I do to validate it's integrity? Are there any .config
changes I should make when building the kernel for the xfs
file system?
Disclaimer: So this actually an continuation of [this question][3], but I've simplified the problem a bit. Some background info there might be relevant.