2016-04-18 13:07:22 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# args
|
|
|
|
dir="$1"
|
|
|
|
|
|
|
|
# cfg
|
|
|
|
shell="$dir/Shell.efi"
|
|
|
|
enroll="$dir/EnrollDefaultKeys.efi"
|
2018-03-08 10:38:21 +00:00
|
|
|
root="$dir/image"
|
2016-04-18 13:07:22 +00:00
|
|
|
vfat="$dir/shell.img"
|
|
|
|
iso="$dir/UefiShell.iso"
|
|
|
|
|
2018-03-08 10:38:21 +00:00
|
|
|
# create non-partitioned (1.44 MB floppy disk) FAT image
|
|
|
|
mkdir "$root"
|
|
|
|
mkdir "$root"/efi
|
|
|
|
mkdir "$root"/efi/boot
|
|
|
|
cp "$shell" "$root"/efi/boot/bootx64.efi
|
|
|
|
cp "$enroll" "$root"
|
|
|
|
qemu-img convert --image-opts \
|
|
|
|
driver=vvfat,floppy=on,fat-type=12,label=UEFI_SHELL,dir="$root/" \
|
|
|
|
$vfat
|
2016-04-18 13:07:22 +00:00
|
|
|
|
|
|
|
# build ISO with FAT image file as El Torito EFI boot image
|
|
|
|
genisoimage -input-charset ASCII -J -rational-rock \
|
|
|
|
-efi-boot "${vfat##*/}" -no-emul-boot -o "$iso" -- "$vfat"
|
2018-03-08 10:38:21 +00:00
|
|
|
rm -rf "$root/" "$vfat"
|