diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2023-04-04 08:31:36 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2023-04-04 08:31:36 +0000 |
commit | c918d567aa8afdace13663f3f0cb806a46124a4e (patch) | |
tree | f334ec113b362be45069426631cc0561f0dc391b /distrib/arm64/ramdisk | |
parent | f9b751553e81f25c797d0b036db657ed52776c09 (diff) |
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
Diffstat (limited to 'distrib/arm64/ramdisk')
-rw-r--r-- | distrib/arm64/ramdisk/install.md | 33 |
1 files 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 |