From f5266f03a63d8c9d295386795c030801b6ada0a8 Mon Sep 17 00:00:00 2001 From: kn Date: Tue, 4 Apr 2023 08:31:35 +0000 Subject: [PATCH] Make root on softraid installations boot out of the box on Raspberry Pis Various files are put onto a pi's ESP, assuming root disk means boot disk, which is not true for root on softraid(4). Wrap the code in a loop over chunks (if any) or the single disk as before, just like installboot(8) does. OK mbuhl --- distrib/arm64/ramdisk/install.md | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/distrib/arm64/ramdisk/install.md b/distrib/arm64/ramdisk/install.md index 0650822ece7..e4a8a67c7f5 100644 --- a/distrib/arm64/ramdisk/install.md +++ b/distrib/arm64/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.42 2023/04/03 10:51:50 kn Exp $ +# $OpenBSD: install.md,v 1.43 2023/04/04 08:31:35 kn Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ NCPU=$(sysctl -n hw.ncpufound) MOUNT_ARGS_msdos="-o-l" md_installboot() { - local _disk=$1 _mdec _plat + local _disk=$1 _chunks _bootdisk _mdec _plat case $(sysctl -n machdep.compatible) in apple,*) _plat=apple;; @@ -59,19 +59,22 @@ md_installboot() { done) ;; rpi) - mount ${MOUNT_ARGS_msdos} /dev/${_disk}i /mnt/mnt - cp $_mdec/{bootcode.bin,start*.elf,fixup*.dat,*.dtb} /mnt/mnt/ - cp $_mdec/u-boot.bin /mnt/mnt/ - mkdir -p /mnt/mnt/overlays - cp $_mdec/disable-bt.dtbo /mnt/mnt/overlays - if [[ ! -f /mnt/mnt/config.txt ]]; then - cat > /mnt/mnt/config.txt<<-__EOT - arm_64bit=1 - enable_uart=1 - dtoverlay=disable-bt - kernel=u-boot.bin - __EOT - fi + _chunks=$(get_softraid_chunks) + for _bootdisk in ${_chunks:-$_disk}; do + mount ${MOUNT_ARGS_msdos} /dev/${_bootdisk}i /mnt/mnt + cp $_mdec/{bootcode.bin,start*.elf,fixup*.dat,*.dtb} /mnt/mnt/ + cp $_mdec/u-boot.bin /mnt/mnt/ + mkdir -p /mnt/mnt/overlays + cp $_mdec/disable-bt.dtbo /mnt/mnt/overlays + if [[ ! -f /mnt/mnt/config.txt ]]; then + cat > /mnt/mnt/config.txt<<-__EOT + arm_64bit=1 + enable_uart=1 + dtoverlay=disable-bt + kernel=u-boot.bin + __EOT + fi + done umount /mnt/mnt ;; esac -- 2.20.1