efi: generate /386/efiboot.fat for generating efi bootable cd images (see -E option of mk9660)

This commit is contained in:
cinap_lenrek 2014-10-31 20:07:54 +01:00
parent c7a5345aa6
commit 634c55543a
2 changed files with 30 additions and 14 deletions

View file

@ -1,6 +1,6 @@
.TH 9BOOT 8 .TH 9BOOT 8
.SH NAME .SH NAME
9bootfat, 9bootiso, 9bootpxe, bootia32.efi, bootx64.efi \- PC bootloader for FAT, ISO and PXE network booting 9bootfat, 9bootiso, 9bootpxe, bootia32.efi, bootx64.efi, efiboot.fat \- PC bootloader for FAT, ISO and PXE network booting
.SH SYNOPSIS .SH SYNOPSIS
Started by PC BIOS or chainloaded by partition bootsector Started by PC BIOS or chainloaded by partition bootsector
.SH DESCRIPTION .SH DESCRIPTION
@ -118,6 +118,7 @@ BIOS booting.
.br .br
.B /386/bootx64.efi .B /386/bootx64.efi
.br .br
.B /386/efiboot.fat
.SH SOURCE .SH SOURCE
.BR /sys/src/boot/pc .BR /sys/src/boot/pc
.br .br

View file

@ -1,4 +1,4 @@
TARG=bootia32.efi bootx64.efi TARG=bootia32.efi bootx64.efi efiboot.fat
HFILES=fns.h mem.h HFILES=fns.h mem.h
IMAGEBASE=0x8000 IMAGEBASE=0x8000
CFLAGS=-FTVw CFLAGS=-FTVw
@ -7,8 +7,7 @@ PEFLAGS=$CFLAGS '-DIMAGEBASE='$IMAGEBASE
all:V: $TARG all:V: $TARG
install:V: $TARG install:V: $TARG
cp bootia32.efi /386 cp $prereq /386
cp bootx64.efi /386
bootia32.efi: pe32.8 efi.8 fs.8 pxe.8 iso.8 sub.8 bootia32.efi: pe32.8 efi.8 fs.8 pxe.8 iso.8 sub.8
8l -l -H3 -T$IMAGEBASE -o $target $prereq 8l -l -H3 -T$IMAGEBASE -o $target $prereq
@ -58,6 +57,32 @@ sub.6: sub.c
%.6: $HFILES %.6: $HFILES
efiboot.fat:D: bootia32.efi bootx64.efi
s = $target.$pid
rm -f $target
dd -if /dev/zero -of $target -bs 1024 -count 1024
disk/format -xd -t hard $target
dossrv -f $target $s
mount -c /srv/$s /n/esp
mkdir /n/esp/efi
mkdir /n/esp/efi/boot
cp bootia32.efi /n/esp/efi/boot
cp bootx64.efi /n/esp/efi/boot
unmount /n/esp
rm /srv/$s
test.iso:D: efiboot.fat
rm -fr tmp
mkdir tmp
mkdir tmp/cfg
mkdir tmp/386
cp efiboot.fat tmp/386
cp /386/9bootiso tmp/386
cp /386/9pcf tmp/386
echo 'bootfile=/386/9pcf' >tmp/cfg/plan9.ini
disk/mk9660 -B 386/9bootiso -E 386/efiboot.fat -p <{echo +} -s tmp $target
rm -r tmp
test.fat:D: bootia32.efi bootx64.efi test.fat:D: bootia32.efi bootx64.efi
s = $target.$pid s = $target.$pid
@ -75,16 +100,6 @@ test.fat:D: bootia32.efi bootx64.efi
unmount /n/esp unmount /n/esp
rm /srv/$s rm /srv/$s
test.iso:D: test.fat
rm -fr tmp
mkdir tmp
cp test.fat tmp
mkdir tmp/cfg
mkdir tmp/386
cp /386/9pcf tmp/386
echo 'bootfile=/386/9pcf' >tmp/cfg/plan9.ini
disk/mk9660 -E test.fat -p <{echo +} -s tmp $target
rm -r tmp
clean:V: clean:V:
rm -f *.[68] *.out $TARG test.* rm -f *.[68] *.out $TARG test.*