-# $OpenBSD: install.md,v 1.49 2024/04/17 04:36:39 kn Exp $
+# $OpenBSD: install.md,v 1.50 2024/05/12 19:47:14 kn Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
KEEP_EFI_SYS=false
md_installboot() {
- local _disk=$1 _chunks _bootdisk _mdec _plat
+ local _disk=$1 _reason=$2 _rerun=false _chunks _bootdisk _mdec _plat
case ${COMPATIBLE} in
- apple,*) _plat=apple;;
+ apple,*) _plat=apple
+ [[ $_reason == apple-boot ]] && _rerun=true;;
raspberrypi,*) _plat=rpi;;
esac
exit
fi
+ $_rerun && return
+
# Apply some final tweaks on selected platforms
_mdec=/usr/mdec/$_plat
esac
}
+md_fw() {
+ md_installboot "$@"
+}
+
md_prep_fdisk() {
local _disk=$1 _d _type=MBR
#!/bin/ksh
-# $OpenBSD: install.sub,v 1.1263 2024/03/15 17:31:21 kn Exp $
+# $OpenBSD: install.sub,v 1.1264 2024/05/12 19:47:14 kn Exp $
#
# Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback
# Copyright (c) 2015, Robert Peichaer <rpe@openbsd.org>
fi
__EOT
- [ -x /mnt/usr/sbin/fw_update ] && DESTDIR=/mnt /mnt/usr/sbin/fw_update
+ if [[ -x /mnt/usr/sbin/fw_update ]]; then
+ DESTDIR=/mnt /mnt/usr/sbin/fw_update
+ # Rerun installboot(8) to pick up just fetched boot firmware.
+ typeset -f md_fw >/dev/null && md_fw $ROOTDISK apple-boot
+ fi
if [[ -f $_kernel_dir.tgz ]]; then
echo -n "Relinking to create unique kernel..."
# md_consoleinfo() - set CDEV, CTTY, CSPEED, CPROM
#
# The following functions can be provided if required:
+# md_fw() - device specific firmware quirks
# md_prep_fdisk() - put a partition table on the disk
#
# The following variables can be provided if required: