Jelajahi Sumber

fix stage2 kernel cmdline + add more error handling for boot config in stage1

Noah Vogt 1 tahun lalu
induk
melakukan
94aa2c9689
3 mengubah file dengan 4 tambahan dan 4 penghapusan
  1. 2 2
      chroot.sh
  2. 1 1
      stage1.sh
  3. 1 1
      stage2.sh

+ 2 - 2
chroot.sh

@@ -48,13 +48,13 @@ sbctl bundle -s \
 
 sbctl create-keys
 sbctl generate-bundles --sign
-sbctl enroll-keys -m
+sbctl enroll-keys -m || error_exit "Error: Could not enroll secure boot keys to UEFI."
 
 efibootmgr --create \
     --disk /dev/"$DRIVE" \
     --part 1 \
     --label "videopc signed efi bundle" \
-    --loader /EFI/Linux/ArchBundle.efi
+    --loader /EFI/Linux/ArchBundle.efi || error_exit "Error: Could not create efi boot entry."
 
 mkinitcpio -P
 

+ 1 - 1
stage1.sh

@@ -64,6 +64,6 @@ mv videopc_api_key videopc_rtmp_key /mnt/etc
 echo "videopc" > /mnt/etc/hostname
 
 cp chroot.sh stage2.sh /mnt
-arch-chroot /mnt bash chroot.sh
+arch-chroot /mnt bash chroot.sh || exit 1
 
 systemctl reboot --firmware

+ 1 - 1
stage2.sh

@@ -43,7 +43,7 @@ sed -i 's/block encrypt/block sd-encrypt/' /etc/mkinitcpio.conf
 sed -i 's/base udev/base systemd/' /etc/mkinitcpio.conf
 sed -i 's/keyboard keymap consolefont/keyboard sd-vconsole/' /etc/mkinitcpio.conf
 
-sed -i "s/cryptdevice=$drive2_uuid:cryptroot/rd.luks.name=$drive2_uuid=cryptroot/" /etc/kernel/cmdline
+sed -i "s/cryptdevice=UUID=$drive2_uuid:cryptroot/rd.luks.name=$drive2_uuid=cryptroot/" /etc/kernel/cmdline
 
 mkinitcpio -P || error_exit "Error: Failed to update mkinitcpio"