Add initial support for UEFI/GPT installs to install script. Original
authorkrw <krw@openbsd.org>
Wed, 7 Oct 2015 18:02:06 +0000 (18:02 +0000)
committerkrw <krw@openbsd.org>
Wed, 7 Oct 2015 18:02:06 +0000 (18:02 +0000)
diff from rpe@.

ok deraadt@ yasuoka@

distrib/amd64/common/install.md
distrib/amd64/ramdisk_cd/list.local

index bf6e8d7..92e9360 100644 (file)
@@ -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
index 2e60155..79982af 100644 (file)
@@ -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