From 0c4ca99f5d7475e0708810d634e2fe3b49eff435 Mon Sep 17 00:00:00 2001 From: kn Date: Mon, 3 Apr 2023 10:51:50 +0000 Subject: [PATCH] Stop writing pine64 firmware to disk pine64 happens to be the first board "we ran on", as kettenis explains, and this code tries to handle the situation of installing to the same disk the installer booted from. Similar boards like the Pinebook Pro don't get special treatment and work; INSTALL.arm64 already explains how to flash required firmware onto disks or install media -- Allwinner SoCs like the pine64 included. Spotted through md_installboot() dd'ing blobs onto the root disk, which does not fly with root on softraid and is in the way of arm64 getting support for guided disk encryption. Suggested by kettenis patrick Feedback jsg patrick OK patrick --- distrib/arm64/iso/Makefile | 4 +--- distrib/arm64/ramdisk/Makefile | 4 +--- distrib/arm64/ramdisk/install.md | 7 +------ distrib/arm64/ramdisk/list | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/distrib/arm64/iso/Makefile b/distrib/arm64/iso/Makefile index 89ee96295e6..33012158033 100644 --- a/distrib/arm64/iso/Makefile +++ b/distrib/arm64/iso/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2023/02/10 15:54:33 krw Exp $ +# $OpenBSD: Makefile,v 1.5 2023/04/03 10:51:50 kn Exp $ FS= install${OSrev}.img FSSIZE= 1032192 @@ -65,8 +65,6 @@ ${FS}: ${BASE} ${XBASE} cp /usr/mdec/BOOTAA64.EFI ${MOUNT_POINT}/efi/boot/bootaa64.efi echo bootaa64.efi > ${MOUNT_POINT}/efi/boot/startup.nsh echo 'arm_64bit=1\nenable_uart=1\ndtoverlay=disable-bt\nkernel=u-boot.bin' > ${MOUNT_POINT}/config.txt - dd if=${PUBOOT}/pine64_plus/u-boot-sunxi-with-spl.bin \ - of=/dev/r`cat vnd`c bs=1024 seek=8 conv=sync umount ${MOUNT_POINT} newfs -O 1 -m 0 -o space -i 524288 -c ${FSSIZE} /dev/r`cat vnd`a diff --git a/distrib/arm64/ramdisk/Makefile b/distrib/arm64/ramdisk/Makefile index eb549af67da..1b8206438a6 100644 --- a/distrib/arm64/ramdisk/Makefile +++ b/distrib/arm64/ramdisk/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.25 2023/02/10 15:54:33 krw Exp $ +# $OpenBSD: Makefile,v 1.26 2023/04/03 10:51:50 kn Exp $ FS= miniroot${OSrev}.img FSSIZE= 88064 @@ -61,8 +61,6 @@ ${FS}: bsd.rd cp /usr/mdec/BOOTAA64.EFI ${MOUNT_POINT}/efi/boot/bootaa64.efi echo bootaa64.efi > ${MOUNT_POINT}/efi/boot/startup.nsh echo 'arm_64bit=1\nenable_uart=1\ndtoverlay=disable-bt\nkernel=u-boot.bin' > ${MOUNT_POINT}/config.txt - dd if=${PUBOOT}/pine64_plus/u-boot-sunxi-with-spl.bin \ - of=/dev/r`cat vnd`c bs=1024 seek=8 conv=sync umount ${MOUNT_POINT} newfs -O 1 -m 0 -o space -i 524288 -c ${FSSIZE} /dev/r`cat vnd`a mount /dev/`cat vnd`a ${MOUNT_POINT} diff --git a/distrib/arm64/ramdisk/install.md b/distrib/arm64/ramdisk/install.md index c899261376b..0650822ece7 100644 --- a/distrib/arm64/ramdisk/install.md +++ b/distrib/arm64/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.41 2023/03/29 16:20:17 kn Exp $ +# $OpenBSD: install.md,v 1.42 2023/04/03 10:51:50 kn Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -40,7 +40,6 @@ md_installboot() { case $(sysctl -n machdep.compatible) in apple,*) _plat=apple;; - pine64,pine64*(+)) _plat=pine64;; raspberrypi,*) _plat=rpi;; esac @@ -59,10 +58,6 @@ md_installboot() { [[ -d $_dir ]] && pax -rw $_dir /mnt/etc/firmware done) ;; - pine64) - dd if=$_mdec/u-boot-sunxi-with-spl.bin of=/dev/r${_disk}c \ - bs=1024 seek=8 status=none - ;; rpi) mount ${MOUNT_ARGS_msdos} /dev/${_disk}i /mnt/mnt cp $_mdec/{bootcode.bin,start*.elf,fixup*.dat,*.dtb} /mnt/mnt/ diff --git a/distrib/arm64/ramdisk/list b/distrib/arm64/ramdisk/list index 27a4f0ef1e2..d8971aa9f7a 100644 --- a/distrib/arm64/ramdisk/list +++ b/distrib/arm64/ramdisk/list @@ -1,4 +1,4 @@ -# $OpenBSD: list,v 1.20 2023/01/28 18:40:53 phessler Exp $ +# $OpenBSD: list,v 1.21 2023/04/03 10:51:50 kn Exp $ SRCDIRS distrib/special @@ -116,9 +116,6 @@ COPY /usr/local/share/raspberrypi-firmware/boot/fixup4.dat usr/mdec/rpi/fixup4.d COPY /usr/local/share/raspberrypi-firmware/boot/overlays/disable-bt.dtbo usr/mdec/rpi/disable-bt.dtbo COPY /usr/local/share/u-boot/rpi_arm64/u-boot.bin usr/mdec/rpi/u-boot.bin -MKDIR usr/mdec/pine64 -COPY /usr/local/share/u-boot/pine64_plus/u-boot-sunxi-with-spl.bin usr/mdec/pine64/u-boot-sunxi-with-spl.bin - # copy the MAKEDEV script and make some devices SCRIPT ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV SPECIAL cd dev; sh MAKEDEV ramdisk -- 2.20.1