summaryrefslogtreecommitdiff
path: root/distrib/amd64/common
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2015-09-06 19:35:20 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2015-09-06 19:35:20 +0000
commit48d517b705b0554dfe8c69ee57c54c6ea4ccbaec (patch)
treef1341f89643e58e41a7319eceda1f5b3666a4250 /distrib/amd64/common
parent5fa114819e69ca671a1377211d235573364d3203 (diff)
Use the new fdisk -b functionality to put an EFI system partition on the
minirootXX.fs image and put the new UEFI bootloader on there. Stop relying on /etc/disktab for the partition layout. Instead use a suitable template and let disklabel(8) allocate all remaining free space to the 'a' partition. ok deraadt@
Diffstat (limited to 'distrib/amd64/common')
-rw-r--r--distrib/amd64/common/Makefile.inc16
1 files changed, 14 insertions, 2 deletions
diff --git a/distrib/amd64/common/Makefile.inc b/distrib/amd64/common/Makefile.inc
index 340103b9663..46f50dec193 100644
--- a/distrib/amd64/common/Makefile.inc
+++ b/distrib/amd64/common/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.26 2014/03/29 17:31:40 deraadt Exp $
+# $OpenBSD: Makefile.inc,v 1.27 2015/09/06 19:35:19 kettenis Exp $
TOP= ${.CURDIR}/..
@@ -18,9 +18,12 @@ VND?= vnd0
VND_DEV= /dev/${VND}a
VND_RDEV= /dev/r${VND}a
VND_CRDEV= /dev/r${VND}c
+VND_IDEV= /dev/${VND}i
+VND_IRDEV= /dev/r${VND}i
PID!= echo $$$$
REALIMAGE!= echo /var/tmp/image.${PID}
BOOT?= ${DESTDIR}/usr/mdec/boot
+EFIBOOT?= ${DESTDIR}/usr/mdec/BOOTX64.EFI
FLOPPYSIZE?= 2880
FLOPPYTYPE?= floppy3
@@ -30,9 +33,18 @@ ${FS}: bsd.gz
dd if=/dev/zero of=${REALIMAGE} bs=512 count=${FLOPPYSIZE}
vnconfig -v -c ${VND} ${REALIMAGE}
.ifdef LBA
- fdisk -yi -l ${FLOPPYSIZE} -f ${DESTDIR}/usr/mdec/mbr ${VND}
+ fdisk -yi -l ${FLOPPYSIZE} -b 960 -f ${DESTDIR}/usr/mdec/mbr ${VND}
.endif
+.ifdef TEMPLATE
+ disklabel -wAT ${TEMPLATE} ${VND}
+ newfs -t msdos ${VND_IRDEV}
+ mount ${VND_IDEV} ${MOUNT_POINT}
+ mkdir -p ${MOUNT_POINT}/efi/boot
+ cp ${EFIBOOT} ${MOUNT_POINT}/efi/boot
+ umount ${MOUNT_POINT}
+.else
disklabel -w ${VND} ${FLOPPYTYPE}
+.endif
newfs -m 0 -o space -i 524288 -c ${FLOPPYSIZE} ${VND_RDEV}
mount ${VND_DEV} ${MOUNT_POINT}
cp ${BOOT} ${.OBJDIR}/boot