mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-20 03:36:23 +00:00
22a52ec4b8
Also cleaned up error handling and boot parsing edge cases
26 lines
556 B
Bash
Executable File
26 lines
556 B
Bash
Executable File
#!/bin/sh
|
|
# Boot from a local disk installation
|
|
|
|
. /etc/functions
|
|
. /etc/config
|
|
|
|
# Confirm we have a good TOTP unseal
|
|
if ! confirm_totp ; then
|
|
recovery 'Failed to unseal TOTP'
|
|
fi
|
|
|
|
if [ ! "$totp_confirm" = "y" ]; then
|
|
recovery "Failed to confirm validity of TOTP"
|
|
fi
|
|
|
|
# Mount local disk
|
|
if ! grep -q /boot /proc/mounts ; then
|
|
mount -o ro "$CONFIG_BOOT_DEV" /boot \
|
|
|| recovery "$CONFIG_BOOT_DEV: Unable to mount /boot"
|
|
fi
|
|
|
|
# Attempt to pull verified config from device
|
|
kexec-select-boot -b /boot/ -c "grub.cfg"
|
|
|
|
recovery "Something failed during boot"
|