From b3e68d715a4a9e6d00fa71f4e4681a334a10229a Mon Sep 17 00:00:00 2001 From: John McQuah Date: Fri, 5 Aug 2022 21:18:04 -0400 Subject: [PATCH] Appendix: small changes to the discussion of initramfs --- crux-wiki/Handbook3-7-Appendix | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/crux-wiki/Handbook3-7-Appendix b/crux-wiki/Handbook3-7-Appendix index d981984..a029cf2 100644 --- a/crux-wiki/Handbook3-7-Appendix +++ b/crux-wiki/Handbook3-7-Appendix @@ -200,26 +200,30 @@ $ cp /usr/src/linux-5.15.55/arch/x86/boot/bzImage vmlinuz-5.15.55.efi $ efibootmgr -c -d /dev/sda -L 'Linux 5.15.55' -l '\BOOT\vmlinuz-5.15.55.efi' -u 'root=/dev/sda2' -* For maximum portability, you can also identify the root filesystem using its -partition UUID. Run @@ls /dev/disk/by-partuuid/@@ to discover the UUID of the +-> For maximum portability, you can also identify the root filesystem using its +partition UUID. Run @@ls -l /dev/disk/by-partuuid/@@ to discover the UUID of the known partitions, and then modify the @@efibootmgr@@ arguments to use the identifier of the root partition. '''Note: this option is more fragile than specifying the root partition using its device node, because of the delay in -scanning all partitions to construct the list of their UUIDs.''' +scanning all partitions to construct the list of their UUIDs. If you encounter +an error when booting your CRUX system this way, you will have to use the +installation media (or another rescue disk) to recreate the EFI boot entry with +device node instead, or with an additional boot option that gives the kernel more +time to enumerate the partitions.''' $ efibootmgr -c -d /dev/sda -L 'Linux 5.15.55' -l '\BOOT\vmlinuz-5.15.55.efi' -u 'root=PARTUUID=c3259ad5-...' * Finally, change the boot order so that the newly-created boot entry is the first one tried. Start by finding the number assigned to the newly-created -entry, and then use that number to specify the desired boot order. +entry, and then use that number to specify the desired boot order. EXAMPLE: [@ $ efibootmgr BootCurrent: 0000 Timeout: 1 seconds BootOrder: 0000,0001 -Boot0000* Linux 5.15.26 HD(1,GPT,d5a44413-5bea-b24c-b4b7-76b32d5d2ed4,0x800,0x64000)/File(\BOOT\vmlinuz-5.15.26.efi)72006f006f0074... -Boot0001* Linux 5.15.55 HD(1,GPT,d5a44413-5bea-b24c-b4b7-76b32d5d2ed4,0x800,0x64000)/File(\BOOT\vmlinuz-5.15.55.efi)72006f006f0074... +Boot0000* Linux 5.15.26 HD(1,GPT,d5a44413-...,0x800,0x64000)/File(\BOOT\vmlinuz-5.15.26.efi)72006f006f0074... +Boot0001* Linux 5.15.55 HD(1,GPT,d5a44413-...,0x800,0x64000)/File(\BOOT\vmlinuz-5.15.55.efi)72006f006f0074... $ efibootmgr -o 0001,0000 @] @@ -233,7 +237,7 @@ modules to initialize other hardware) is that the root filesystem is not a physical volume, but rather a logical volume inside an encryption layer like LUKS. To handle this situation, you will need to go beyond the kernel building process outlined above, and also create a compressed filesystem image (called an -''initramfs'') that contains the lvm and cryptsetup packages (and the drivers +''initramfs'') that contains the lvm2 and cryptsetup packages (and the drivers for usb input devices, if you chose not to compile them into the kernel). Creating such an initramfs was once an intricate procedure, but tools like '''dracut''' make it much simpler these days. @@ -248,9 +252,8 @@ section of the appendix just points to a separate document, where an [[https://gitlab.com/SiFuh/Documentation/-/blob/master/CRUX-3.6-Encrypted.txt | outline for installing CRUX with full-disk encryption]] is given from beginning to end. Even if full-disk encryption is not your desired endpoint and you just want to learn more about highly-modular kernel configs, -the creation of an initramfs is best viewed in the context of the overall -installation procedure, after having successfully built some less-modular -kernels yourself. Studying the upstream documentation for any unfamiliar command -in the linked outline (eg., %fn%cryptsetup%%, %fn%pvcreate%%, or %fn%dracut%%) -is an excellent way to distinguish the functions performed by the various -components. +the need for an initramfs is easier to motivate by considering a specific use +case like full-disk encryption. Studying the upstream documentation for any +unfamiliar command in the linked outline (eg., %fn%cryptsetup%%, %fn%pvcreate%%, +or %fn%dracut%%) is an excellent way to distinguish the functions performed by +the various components.