Copy Apple touchpad firmware on machines that need it.
authorkettenis <kettenis@openbsd.org>
Sat, 3 Sep 2022 08:37:36 +0000 (08:37 +0000)
committerkettenis <kettenis@openbsd.org>
Sat, 3 Sep 2022 08:37:36 +0000 (08:37 +0000)
ok kn@, deraadt@

distrib/arm64/ramdisk/install.md

index cd16085..f7a308a 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: install.md,v 1.32 2022/08/07 03:22:29 deraadt Exp $
+#      $OpenBSD: install.md,v 1.33 2022/09/03 08:37:36 kettenis Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -55,6 +55,10 @@ 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)
@@ -211,12 +215,16 @@ md_consoleinfo() {
        _fw=$(dmesgtail | sed -n '\!^bwfm0: failed!{s!^.*/\(.*\),.*$!\1!p;q;}')
        case $(sysctl -n machdep.compatible) in
        apple,*)
+               _fw2=$(sysctl -n machdep.compatible | sed 's/.*apple,//')
                make_dev sd0
                if mount -o ro /dev/sd0l /mnt2 2>/dev/null; then
-                       rm -rf /usr/mdec/rpi /etc/firmware/brcm /etc/firmware/apple-bwfm
+                       rm -rf /usr/mdec/rpi /etc/firmware/apple
+                       rm -rf /etc/firmware/brcm /etc/firmware/apple-bwfm
                        if [[ -s /mnt2/vendorfw/firmware.tar ]]; then
                                tar -x -C /etc/firmware \
                                    -f /mnt2/vendorfw/firmware.tar "*$_fw*"
+                               tar -x -C /etc/firmware \
+                                   -f /mnt2/vendorfw/firmware.tar "*$_fw2*"
                                mv /etc/firmware/brcm /etc/firmware/apple-bwfm
                        fi
                        umount /mnt2