From 9d05dede5acad9bfc3215e92de1af84328b4972a Mon Sep 17 00:00:00 2001 From: krw Date: Wed, 7 Oct 2015 18:02:06 +0000 Subject: [PATCH] Add initial support for UEFI/GPT installs to install script. Original diff from rpe@. ok deraadt@ yasuoka@ --- distrib/amd64/common/install.md | 21 ++++++++++++++++++--- distrib/amd64/ramdisk_cd/list.local | 4 +++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/distrib/amd64/common/install.md b/distrib/amd64/common/install.md index bf6e8d72877..92e93604cdc 100644 --- a/distrib/amd64/common/install.md +++ b/distrib/amd64/common/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.41 2015/06/02 19:54:06 rpe Exp $ +# $OpenBSD: install.md,v 1.42 2015/10/07 18:02:06 krw Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -36,6 +36,10 @@ MDXAPERTURE=2 MDXDM=y NCPU=$(sysctl -n hw.ncpufound) +if dmesg | grep -q 'efifb0 at mainbus0'; then + MDEFI=y +fi + ((NCPU > 1)) && { DEFAULTSETS="bsd bsd.rd bsd.mp"; SANESETS="bsd bsd.mp"; } md_installboot() { @@ -51,16 +55,20 @@ md_prep_fdisk() { while :; do _d=whole + + [[ $MDEFI == y && $_disk == $ROOTDISK ]] && + _q=", whole disk (G)PT," + if fdisk $_disk | grep -q 'Signature: 0xAA55'; then fdisk $_disk if fdisk $_disk | grep -q '^..: A6 '; then - _q=", use the (O)penBSD area," + _q="$_q, use the (O)penBSD area," _d=OpenBSD fi else echo "MBR has invalid signature; not showing it." fi - ask "Use (W)hole disk$_q or (E)dit the MBR?" "$_d" + ask "Use (W)hole disk MBR$_q or (E)dit the MBR?" "$_d" case $resp in w*|W*) echo -n "Setting OpenBSD MBR partition to whole $_disk..." @@ -72,6 +80,13 @@ quit __EOT echo "done." return ;; + g*|G*) + [[ $MDEFI == y && $_disk == $ROOTDISK ]] || continue + + echo -n "Setting OpenBSD GPT partition to whole $_disk..." + fdisk -i -g -b 960 -y $_disk >/dev/null + echo "done." + return ;; e*|E*) # Manually configure the MBR. cat <<__EOT diff --git a/distrib/amd64/ramdisk_cd/list.local b/distrib/amd64/ramdisk_cd/list.local index 2e60155782c..79982afebca 100644 --- a/distrib/amd64/ramdisk_cd/list.local +++ b/distrib/amd64/ramdisk_cd/list.local @@ -1,4 +1,4 @@ -# $OpenBSD: list.local,v 1.25 2014/12/03 20:11:19 florian Exp $ +# $OpenBSD: list.local,v 1.26 2015/10/07 18:02:06 krw Exp $ # add local links; use bin/sh since instbin has already been unlinked LINK instbin sbin/ping6 @@ -9,6 +9,8 @@ LINK instbin sbin/bioctl LINK instbin sbin/mount_ext2fs LINK instbin sbin/mount_msdos LINK instbin sbin/mount_udf +LINK instbin sbin/newfs_msdos +LINK instbin sbin/fsck_msdos COPY ${DESTDIR}/etc/firmware/kue etc/firmware/kue -- 2.20.1