Simplify apple firmware copying
authorkn <kn@openbsd.org>
Sun, 26 Mar 2023 19:25:16 +0000 (19:25 +0000)
committerkn <kn@openbsd.org>
Sun, 26 Mar 2023 19:25:16 +0000 (19:25 +0000)
Less duplicate code, easier to add new firmware.

OK afresh1

distrib/arm64/ramdisk/install.md

index 742907f..46c747f 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: install.md,v 1.37 2023/03/25 18:29:37 kn Exp $
+#      $OpenBSD: install.md,v 1.38 2023/03/26 19:25:16 kn Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -55,14 +55,9 @@ md_installboot() {
 
        case $_plat in
        apple)
-               if [[ -d /etc/firmware/apple ]]; then
-                       (cd /etc/firmware
-                               pax -rw apple /mnt/etc/firmware)
-               fi
-               if [[ -d /etc/firmware/apple-bwfm ]]; then
-                       (cd /etc/firmware
-                               pax -rw apple-bwfm /mnt/etc/firmware)
-               fi
+               (cd /etc/firmware; for _dir in apple{,-bwfm}; do
+                       [[ -d $_dir ]] && pax -rw $_dir /mnt/etc/firmware
+               done)
                ;;
        pine64)
                dd if=$_mdec/u-boot-sunxi-with-spl.bin of=${_disk}c \