mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-25 23:51:08 +00:00
efd662c63a
Supports booting from USB media using either the root device or a signed ISO as the boot device. Boot options are parsed with quick/dirty shell scripts to infer kexec params. Closes #195 and begins to address #196
28 lines
544 B
Bash
Executable File
28 lines
544 B
Bash
Executable File
#!/bin/sh
|
|
# Boot from signed ISO
|
|
|
|
. /etc/functions
|
|
. /etc/config
|
|
|
|
ISO="$1"
|
|
|
|
echo '+++ Verifying ISO'
|
|
# Verify the signature on the hashes
|
|
ISOSIG="$ISO.sig"
|
|
if ! [ -r "$ISOSIG" ]; then
|
|
ISOSIG="$ISO.asc"
|
|
fi
|
|
|
|
gpgv "$ISOSIG" "$ISO" \
|
|
|| recovery 'ISO signature failed'
|
|
|
|
echo '+++ Mounting ISO and booting'
|
|
mount -t iso9660 -o loop $ISO /boot
|
|
|
|
ISO_FILE=${ISO:7}
|
|
DEV=$CONFIG_USB_BOOT_DEV
|
|
DEV_UUID=`blkid $DEV | tail -1 | tr " " "\n" | grep UUID | cut -d\" -f2`
|
|
ADD="fromiso=/dev/disk/by-uuid/$DEV_UUID/$ISO_FILE"
|
|
|
|
/bin/usb-select-boot /boot "$ADD"
|