Open macpijan opened 3 years ago
@macpijan Where is the grub.cfg in this case? I wondering if https://github.com/osresearch/heads/commit/a0753473510ec598f9db86cfb610cf61156ca5cb is the cause or what should be improved here.
Of course, the grub.cfg file you show here contains ($drive1)/ that should be dodged by the parser, but since there is now two parsers (nitrd/bin/kexec-parse-bls nitrd/bin/kexec-parse-boot) I wonder which path you NixOS is taking (I guess its bls). Both are taking /boot (mountpoint where kernel is found) as argument prior of doing the parsing.
https://github.com/osresearch/heads/blob/a0753473510ec598f9db86cfb610cf61156ca5cb/initrd/bin/kexec-parse-bls https://github.com/osresearch/heads/blob/a0753473510ec598f9db86cfb610cf61156ca5cb/initrd/bin/kexec-parse-boot
Guix and Nix don't have a /boot partition from what I read by default?
@tlaurion
Where is the grub.cfg in this case?
/boot/grub/grub.cfg
Guix and Nix don't have a /boot partition from what I read by default?
Yes, the official installation manual instructs to install everything (boot and rootfs) in one partition. At least when using MBR. When using GPT, they instruct to create a separate EFI partition. This is bad for several reasons. One of them is heads is trying to check hashes of all of the files in rootfs in such scenario (and they change at each boot obviously).
Nevertheless, I have a separate /boot partition at /dev/sda1 and rootfs on /dev/sda2 (LVM on /dev/sda2 actually, but it does not matter) - which is also required to setup rootfs encryption.
@macpijan
Quick but sufficient hack:
test='kernel ($drive1)//kernels/65f9va1ql6x2vy23x4nqw0x18jz3a3x8-linux-5.10.45-bzImage init=/nix/store/0jpc6ilx8xikwrmcgbqsvakl1inbpbxj-nixos-system-nixos-21.05.1187.8112fbe212f/init loglevel=4'
echo $test | sed "s/([^)]*)\///g"
kernel /kernels/65f9va1ql6x2vy23x4nqw0x18jz3a3x8-linux-5.10.45-bzImage init=/nix/store/0jpc6ilx8xikwrmcgbqsvakl1inbpbxj-nixos-system-nixos-21.05.1187.8112fbe212f/init loglevel=4
test='initrd ($drive1)//kernels/2jaca9jz9qcr08vlbvgnjn2kz3cbp1yf-initrd-linux-5.10.45-initrd'
echo $test | sed "s/([^)]*)\///g"
initrd /kernels/2jaca9jz9qcr08vlbvgnjn2kz3cbp1yf-initrd-linux-5.10.45-initrd
diff --git a/initrd/bin/kexec-parse-boot b/initrd/bin/kexec-parse-boot
index d54d6285..6976b41a 100755
--- a/initrd/bin/kexec-parse-boot
+++ b/initrd/bin/kexec-parse-boot
@@ -94,11 +94,11 @@ grub_entry() {
modules="$modules|module $path"
;;
linux*)
- kernel=`echo $trimcmd | cut -d\ -f2`
+ kernel=`echo $trimcmd | sed "s/([^)]*)\///g" | cut -d\ -f2`
append=`echo $trimcmd | cut -d\ -f3-`
;;
initrd*)
- initrd="$val"
+ initrd=$(echo "$val" | sed "s/([^)]*)\///g" )
;;
esac
}
Have something better?
NixOS does not boot after installation (the installer boots fine). The kexec command line is not created correctly.
The original grub.cfg file:
The
kexec_default.1.txt
created by heads:I can boot with
kexec-boot
using following entry: