You are not logged in.
I want to know what's going on once the initramfs is loaded. How can I observe and inspect what the initramfs-linux.img disk image does during boot?
The basic steps of the GRUB logic aren't too hard to follow but once it loads the kernel and chooses a root it's just an opaque logic wall to me. Where does it pick up? And what causes it to eventually change the root volume?
Is there a way to boot into it and start a shell rather than continuing as usual and mounting the final root volume?
Offline
Offline
How can I observe and inspect what the initramfs-linux.img disk image does during boot?
You can see what is in it with `cpio -t </boot/initramfs-linux.img` it's just a compressed (usually) root partition archive.
Where does it pick up? And what causes it to eventually change the root volume?
It picks up where the boot loader leaves off ... kind of. "it" is not a thing, as noted above, it's just a minimal root file system. This file system should include a /bin/init.
Is there a way to boot into it and start a shell rather than continuing as usual and mounting the final root volume?
Kernel parameters `break=premount` or just list a bad/absent real root in your bootloader.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
The kernel extracts the initramfs and executes /init and everything else spins off from there. Usually /init is a shell script and the shell (and other command line tools) are provided by an all-in-one binary (busybox).
This might also give you some ideas): https://wiki.gentoo.org/wiki/Custom_Initramfs
Generated initramfs usually have a more complicated structure as they have to deal with all sorts of situations.
Offline