Last active
September 11, 2021 10:39
-
-
Save moritzbuhl/4c83582e71b5654c1a20a01bf6959e84 to your computer and use it in GitHub Desktop.
OpenBSD Installation on the Rock Pi S
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Jonathan helped me installing OpenBSD on a Rock Pi S this is how. | |
# Thank you jonathan! | |
# I haven't tested this again. | |
set -eu | |
if [ -z ${1:-} ] || [ ${1#sd} -lt 1 ] | |
then | |
echo "Usage: $0 [sdcard]" | |
echo "E.g. $0 sd1 to download and install required files on sd1" | |
exit 1 | |
fi | |
URLS="https://ftp.hostserver.de/pub/OpenBSD/snapshots/arm64/miniroot68.img | |
https://mild.embarrassm.net/~jonathan/rockpis/idbloader.img | |
https://mild.embarrassm.net/~jonathan/rockpis/uboot.img | |
https://mild.embarrassm.net/~jonathan/rockpis/trust.img | |
https://mild.embarrassm.net/~jonathan/rockpis/rk3308-rock-pi-s.dtb" | |
if [ "$(id -u)" -ne 0 ] | |
then | |
for URL in "$URLS" | |
do | |
ftp $URL | |
done | |
doas sh $0 $1 | |
else | |
dd if=miniroot68.img of=/dev/${DEV}c bs=1m | |
dd if=idbloader.img of=/dev/${DEV}c seek=64 | |
dd if=uboot.img of=/dev/${DEV}c seek=16384 | |
dd if=trust.img of=/dev/${DEV}c seek=24576 | |
mount /dev/${DEV}i /mnt | |
cp rk3308-rock-pi-s.dtb /mnt | |
umount /mnt | |
fdisk -e ${DEV} <<- EOT >/dev/null | |
reinit gpt | |
e 3 | |
A6 | |
40960 | |
26624 | |
e 0 | |
EF | |
32768 | |
8192 | |
w | |
q | |
EOT | |
exit 0 | |
fi | |
echo "Now type the following at at the u-boot prompt: | |
fatload mmc 0:1 ${fdt_addr_r} rk3308-rock-pi-s.dtb | |
fatload mmc 0:1 ${kernel_addr_r} efi/boot/bootaa64.efi | |
bootefi ${kernel_addr_r} ${fdt_addr_r} | |
After that installation with the defaults just works | |
but you will need to copy the dtb to the FAT partition again." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment