summaryrefslogtreecommitdiff
path: root/scripts/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/install.sh')
-rwxr-xr-xscripts/install.sh75
1 files changed, 59 insertions, 16 deletions
diff --git a/scripts/install.sh b/scripts/install.sh
index 60c2475a2..867a4154f 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#-
-# Copyright © 2010-2022
+# Copyright © 2010-2023
# Waldemar Brodkorb <wbx@openadk.org>
# Thorsten Glaser <tg@mirbsd.org>
#
@@ -155,7 +155,7 @@ tgt=$2
src=$3
case $target {
-(banana-pro|orange-pi0|pcengines-apu|phytec-imx6|phytec-wega|raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|solidrun-imx6|solidrun-clearfog|default) ;;
+(atmel-ngw100|banana-pro|banana-pro-zero|orange-pi0|pcengines-apu|phytec-imx6|phytec-wega|raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|raspberry-pi5|rockpi4-plus|solidrun-imx6|solidrun-clearfog|imgtec-ci20|default) ;;
(*)
print -u2 "Unknown target '$target', exiting"
exit 1 ;;
@@ -178,7 +178,7 @@ case $ostype {
basedev=$tgt
rootpart=${basedev}s1
datapart=${basedev}s2
- if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = phytec-wega ]]; then
+ if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = raspberry-pi5 || $target = phytec-wega ]]; then
bootpart=${basedev}s1
rootpart=${basedev}s2
datapart=${basedev}s3
@@ -221,7 +221,13 @@ case $ostype {
;;
(Linux)
basedev=$tgt
- partitionsep=""
+
+ if [[ "$tgt" == *"nvme0n1"* ]] || [[ "$tgt" == *"mmcblk"* ]]; then
+ partitionsep="p"
+ else
+ partitionsep=""
+ fi
+
if [[ $basedev = /dev/loop* ]]; then
(( quiet )) || print "${tgt} is a loop device"
partitionsep=p
@@ -229,7 +235,7 @@ case $ostype {
rootpart=${basedev}${partitionsep}1
datapart=${basedev}${partitionsep}2
- if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 ]]; then
+ if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = raspberry-pi5 ]]; then
bootpart=${basedev}${partitionsep}1
rootpart=${basedev}${partitionsep}2
datapart=${basedev}${partitionsep}3
@@ -294,7 +300,7 @@ syspartno=0
# data - flexible (parameter)
# system - everything else
-if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = phytec-wega ]]; then
+if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = raspberry-pi5 || $target = phytec-wega ]]; then
syspartno=1
bootfssz=100
if (( grub )); then
@@ -351,7 +357,7 @@ fi
#(( partofs = ((coreendsec / secs) + 1) * secs ))
# we just use 2048 all the time, since some loaders are longer
partofs=2048
-if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = phytec-wega ]]; then
+if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = raspberry-pi5 || $target = phytec-wega || $target = rockpi4-plus ]]; then
(( spartofs = partofs + (100 * 2048) ))
else
spartofs=$partofs
@@ -462,7 +468,7 @@ if (( datafssz )); then
dd of="$T/firsttrack" conv=notrunc bs=1 seek=$((0x1CE)) 2>/dev/null
fi
-if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = phytec-wega ]]; then
+if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = raspberry-pi5 || $target = phytec-wega ]]; then
# move system and data partition from #0/#1 to #1/#2
dd if="$T/firsttrack" bs=1 skip=$((0x1BE)) count=32 of="$T/x" 2>/dev/null
dd of="$T/firsttrack" conv=notrunc bs=1 seek=$((0x1CE)) if="$T/x" 2>/dev/null
@@ -545,7 +551,15 @@ fi
fwdir=$(dirname "$src")
case $target {
-(banana-pro|orange-pi0)
+(rockpi4-plus)
+ dd if="$fwdir/idbloader.img" of="$tgt" bs=512 seek=64 > /dev/null 2>&1
+ dd if="$fwdir/u-boot.itb" of="$tgt" bs=512 seek=16384 > /dev/null 2>&1
+ ;;
+(imgtec-ci20)
+ dd if="$fwdir/u-boot-spl.bin" of="$tgt" obs=512 seek=1 > /dev/null 2>&1
+ dd if="$fwdir/u-boot-dtb.img" of="$tgt" obs=1k seek=14 > /dev/null 2>&1
+ ;;
+(banana-pro|banana-pro-zero|orange-pi0)
dd if="$fwdir/u-boot-sunxi-with-spl.bin" of="$tgt" bs=1024 seek=8 > /dev/null 2>&1
;;
(solidrun-clearfog)
@@ -555,7 +569,7 @@ case $target {
dd if="$fwdir/SPL" of="$tgt" bs=1024 seek=1 > /dev/null 2>&1
dd if="$fwdir/u-boot.img" of="$tgt" bs=1024 seek=69 > /dev/null 2>&1
;;
-(raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64)
+(raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|raspberry-pi5)
(( noformat )) || create_fs "$bootpart" ADKBOOT vfat
;;
(phytec-wega)
@@ -563,8 +577,15 @@ case $target {
;;
}
-(( noformat )) || create_fs "$rootpart" ADKROOT ext4
-(( noformat )) || tune_fs "$rootpart"
+case $target {
+(atmel-ngw100)
+ (( noformat )) || create_fs "$rootpart" ADKROOT ext2
+ (( noformat )) || tune_fs "$rootpart"
+ ;;
+(*)
+ (( noformat )) || create_fs "$rootpart" ADKROOT ext4
+ (( noformat )) || tune_fs "$rootpart"
+}
(( quiet )) || print Extracting installation archive...
mount_fs "$rootpart" "$R" ext4
@@ -575,10 +596,10 @@ if (( datafssz )); then
((keep)) || create_fs "$datapart" ADKDATA ext4
((keep)) || tune_fs "$datapart"
case $target {
- (raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|phytec-wega)
+ (raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|raspberry-pi5|phytec-wega)
echo "/dev/mmcblk0p3 /data ext4 rw 0 0" >> "$R"/etc/fstab
;;
- (banana-pro|orange-pi0|solidrun-clearfog)
+ (banana-pro|orange-pi0|solidrun-clearfog|rockpi4-plus)
echo "/dev/mmcblk0p2 /data ext4 rw 0 0" >> "$R"/etc/fstab
;;
(solidrun-imx6|phytec-imx6)
@@ -597,7 +618,7 @@ fi
(( quiet )) || print Finishing up with bootloader and kernel ...
case $target {
-(raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64)
+(raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|raspberry-pi5)
mount_fs "$bootpart" "$B" vfat
for x in "$R"/boot/*; do
[[ -e "$x" ]] && mv -f "$R"/boot/* "$B/"
@@ -611,7 +632,11 @@ case $target {
mkdir "$B/"overlays
for x in "$fwdir"/overlays/*.dtbo; do
y=$(basename ${x} .dtbo)
- [[ -e "$x" ]] && cp "$fwdir"/overlays/${y}.dtbo "$B/"overlays/${y}.dtb
+ [[ -e "$x" ]] && cp "$fwdir"/overlays/${y}.dtbo "$B/"overlays/${y}.dtbo
+ done
+ for x in "$fwdir"/overlays/*.dtb; do
+ y=$(basename ${x} .dtb)
+ [[ -e "$x" ]] && cp "$fwdir"/overlays/${y}.dtb "$B/"overlays/${y}.dtb
done
umount_fs "$B"
;;
@@ -627,6 +652,15 @@ case $target {
done
umount_fs "$B"
;;
+(rockpi4-plus)
+ for x in "$fwdir"/*.dtb; do
+ [[ -e "$x" ]] && cp "$fwdir"/*.dtb "$R/boot/"
+ break
+ done
+ mkimage -A arm64 -O linux -T script -C none -a 0 -e 0 \
+ -n "RockPI4-Plus" \
+ -d $fwdir/boot.script.rockpi4 $R/boot/boot.scr.uimg
+ ;;
(solidrun-clearfog)
for x in "$fwdir"/*.dtb; do
[[ -e "$x" ]] && cp "$fwdir"/*.dtb "$R/boot/"
@@ -672,6 +706,15 @@ case $target {
-n "BananaPro" \
-d $fwdir/boot.script.bpi $R/boot/boot.scr.uimg
;;
+(banana-pro-zero)
+ for x in "$fwdir"/*.dtb; do
+ [[ -e "$x" ]] && cp "$fwdir"/*.dtb "$R/boot/"
+ break
+ done
+ mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+ -n "BananaProZero" \
+ -d $fwdir/boot.script.bpizero $R/boot/boot.scr.uimg
+ ;;
}
cd "$R"