Blame build-iso.sh

Gerd Hoffmann 46ac25
#!/bin/sh
Gerd Hoffmann 46ac25
Jiri Kucera 50204b
set -ex
Jiri Kucera 50204b
Gerd Hoffmann 46ac25
# args
Gerd Hoffmann 46ac25
dir="$1"
Gerd Hoffmann 46ac25
Gerd Hoffmann 46ac25
# cfg
Gerd Hoffmann 46ac25
shell="$dir/Shell.efi"
Gerd Hoffmann 46ac25
enroll="$dir/EnrollDefaultKeys.efi"
Paolo Bonzini 6ea72c
root="$dir/image"
Gerd Hoffmann 46ac25
vfat="$dir/shell.img"
Gerd Hoffmann 46ac25
iso="$dir/UefiShell.iso"
Gerd Hoffmann 46ac25
Paolo Bonzini 6ea72c
# create non-partitioned (1.44 MB floppy disk) FAT image
Paolo Bonzini 6ea72c
mkdir "$root"
Paolo Bonzini 6ea72c
mkdir "$root"/efi
Paolo Bonzini 6ea72c
mkdir "$root"/efi/boot
Paolo Bonzini 6ea72c
cp "$shell" "$root"/efi/boot/bootx64.efi
Paolo Bonzini 6ea72c
cp "$enroll" "$root"
Paolo Bonzini 6ea72c
qemu-img convert --image-opts \
Paolo Bonzini 6ea72c
	driver=vvfat,floppy=on,fat-type=12,label=UEFI_SHELL,dir="$root/" \
Paolo Bonzini 6ea72c
	$vfat
Gerd Hoffmann 46ac25
Gerd Hoffmann 46ac25
# build ISO with FAT image file as El Torito EFI boot image
Jiri Kucera 50204b
mkisofs -input-charset ASCII -J -rational-rock \
Jiri Kucera 50204b
	-e "${vfat##*/}" -no-emul-boot -o "$iso" "$vfat"
Paolo Bonzini 6ea72c
rm -rf "$root/" "$vfat"