From b5ab9c2e17e63e26678708b5fce45c750624681b Mon Sep 17 00:00:00 2001 From: jmatthew Date: Fri, 15 Dec 2023 06:03:00 +0000 Subject: [PATCH] For amd64 cdXX.iso and installXX.iso, create an EFI system partition image containing the EFI boot loaders and install it as an El Torito boot image, making the install CDs bootable in EFI mode. "looks great" deraadt@ ok mlarkin@ --- distrib/amd64/iso/Makefile | 19 +++++++++++++++---- distrib/amd64/ramdisk_cd/Makefile | 19 +++++++++++++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/distrib/amd64/iso/Makefile b/distrib/amd64/iso/Makefile index 42dd33dcfaa..a4cc5dd600e 100644 --- a/distrib/amd64/iso/Makefile +++ b/distrib/amd64/iso/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.46 2023/04/24 17:07:33 krw Exp $ +# $OpenBSD: Makefile,v 1.47 2023/12/15 06:03:00 jmatthew Exp $ FS= install${OSrev}.img FSSIZE= 1359872 @@ -18,6 +18,8 @@ XBASE= ${RELXDIR}/xbase${OSrev}.tgz ${RELXDIR}/xfont${OSrev}.tgz \ ${RELXDIR}/xshare${OSrev}.tgz ${RELXDIR}/xserv${OSrev}.tgz EFIBOOT?= ${DESTDIR}/usr/mdec/BOOTX64.EFI ${DESTDIR}/usr/mdec/BOOTIA32.EFI +EFICDBOOT= eficdboot +EFICDBOOTSIZE= 350K MSDOSSIZE= 960 TOTALSIZE!= expr ${FSSIZE} + ${MSDOSSIZE} @@ -55,7 +57,14 @@ ${FS}: ${BASE} ${XBASE} bsd.rd vnconfig -u `cat vnd` rm -f vnd -${CDROM}: ${BASE} ${XBASE} +${EFICDBOOT}: ${EFIBOOT} + rm -rf ${.OBJDIR}/eficdboot-dir + mkdir -p ${.OBJDIR}/eficdboot-dir/efi/boot + cp ${EFIBOOT} ${.OBJDIR}/eficdboot-dir/efi/boot + makefs -t msdos -o create_size=${EFICDBOOTSIZE} ${EFICDBOOT} \ + ${.OBJDIR}/eficdboot-dir + +${CDROM}: ${BASE} ${XBASE} ${EFICDBOOT} rm -rf ${.OBJDIR}/cd-dir mkdir -p ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE} mkdir -p ${.OBJDIR}/cd-dir/etc @@ -70,6 +79,7 @@ ${CDROM}: ${BASE} ${XBASE} cp -p ${RELDIR}/cdbr ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE} cp -p ${RELDIR}/cdboot ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE}/cdboot + cp -p ${.OBJDIR}/${EFICDBOOT} ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE} mkhybrid -a -R -T -L -l -d -D -N -o ${.OBJDIR}/${CDROM} \ -A "OpenBSD ${OSREV} ${MACHINE} Install CD" \ @@ -77,14 +87,15 @@ ${CDROM}: ${BASE} ${XBASE} -p "Theo de Raadt " \ -V "OpenBSD/${MACHINE} ${OSREV} Install CD" \ -b ${OSREV}/${MACHINE}/cdbr -c ${OSREV}/${MACHINE}/boot.catalog \ + -e ${OSREV}/${MACHINE}/${EFICDBOOT} \ ${.OBJDIR}/cd-dir install: cp ${CDROM} ${FS} ${RELDIR}/ clean cleandir: - rm -f ${CDROM} ${FS} - rm -rf cd-dir + rm -f ${CDROM} ${FS} ${EFICDBOOT} + rm -rf cd-dir eficdboot-dir bsd.rd: ${BSDRD} cp ${BSDRD} bsd.rd diff --git a/distrib/amd64/ramdisk_cd/Makefile b/distrib/amd64/ramdisk_cd/Makefile index 72c9105bc23..2d496508407 100644 --- a/distrib/amd64/ramdisk_cd/Makefile +++ b/distrib/amd64/ramdisk_cd/Makefile @@ -1,7 +1,9 @@ -# $OpenBSD: Makefile,v 1.38 2023/04/28 08:45:25 krw Exp $ +# $OpenBSD: Makefile,v 1.39 2023/12/15 06:03:00 jmatthew Exp $ FS= miniroot${OSrev}.img FSSIZE= 11392 +EFICDBOOT= eficdboot +EFICDBOOTSIZE= 350K CDROM= cd${OSrev}.iso MOUNT_POINT= /mnt MTREE= ${UTILS}/mtree.conf @@ -37,7 +39,14 @@ ${FS}: bsd.gz vnconfig -u `cat vnd` rm -f vnd -${CDROM}: bsd.rd +${EFICDBOOT}: ${EFIBOOT} + rm -rf ${.OBJDIR}/eficdboot-dir + mkdir -p ${.OBJDIR}/eficdboot-dir/efi/boot + cp ${EFIBOOT} ${.OBJDIR}/eficdboot-dir/efi/boot + makefs -t msdos -o create_size=${EFICDBOOTSIZE} ${EFICDBOOT} \ + ${.OBJDIR}/eficdboot-dir + +${CDROM}: bsd.rd ${EFICDBOOT} rm -rf ${.OBJDIR}/cd-dir mkdir -p ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE} mkdir -p ${.OBJDIR}/cd-dir/etc @@ -45,12 +54,14 @@ ${CDROM}: bsd.rd cp ${.OBJDIR}/bsd.rd ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE} cp ${DESTDIR}/usr/mdec/cdbr ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE} cp ${DESTDIR}/usr/mdec/cdboot ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE}/cdboot + cp ${.OBJDIR}/${EFICDBOOT} ${.OBJDIR}/cd-dir/${OSREV}/${MACHINE} mkhybrid -a -R -T -L -l -d -D -N -o ${.OBJDIR}/${CDROM} \ -A "OpenBSD ${OSREV} ${MACHINE} bootonly CD" \ -P "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" \ -p "Theo de Raadt " \ -V "OpenBSD/${MACHINE} ${OSREV} boot-only CD" \ -b ${OSREV}/${MACHINE}/cdbr -c ${OSREV}/${MACHINE}/boot.catalog \ + -e ${OSREV}/${MACHINE}/${EFICDBOOT} \ ${.OBJDIR}/cd-dir MRDISKTYPE= rdrootb @@ -108,7 +119,7 @@ clean cleandir: *.o *.lo *.c bsd bsd.rd bsd.gz bsd.strip floppy*.img \ lib*.a lib*.olist instbin.map boot instbin.conf ${FS} rm -rf mr.fs.d - rm -f ${CDROM} - rm -rf cd-dir + rm -f ${CDROM} ${EFICDBOOT} + rm -rf cd-dir eficdboot-dir .include -- 2.20.1