heads/initrd/bin/generic-init
Francis Lam 22a52ec4b8
Added TPM secret management to generic boot
Also cleaned up error handling and boot parsing edge cases
2017-07-12 00:17:45 -04:00

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"