-
-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Nano Pi R5S/R5C and 6 series | Move to Armbian kernel and bootloader builds
- Loading branch information
Showing
3 changed files
with
43 additions
and
74 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -405,7 +405,8 @@ _EOF_ | |
'54' ': NanoPi K2' | ||
'55' ': NanoPi R2S' | ||
'47' ': NanoPi R4S' | ||
'76' ': NanoPi R5S/R5C' | ||
'76.1' ': NanoPi R5S' | ||
'76.2' ': NanoPi R5C' | ||
'79' ': NanoPi 6 series' | ||
'72.1' ': ROCK 4 (all other variants)' | ||
'72.2' ': ROCK 4 SE' | ||
|
@@ -615,7 +616,7 @@ _EOF_ | |
G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/99-dietpi-uboot" /etc/initramfs/post-update.d/99-dietpi-uboot | ||
G_EXEC sed --follow-symlinks -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot | ||
|
||
elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|77|78|80|82|83|85|86|87)$ ]] | ||
elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|76|77|78|79|80|82|83|85|86|87)$ ]] | ||
then | ||
armbian_repo=1 | ||
G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/boot.cmd" /boot/boot.cmd | ||
|
@@ -656,14 +657,14 @@ setenv rootuuid "true"' /boot/boot.cmd | |
(( $G_HW_MODEL == 15 )) && G_EXEC eval 'echo '\''meson_rng'\'' > /etc/modules-load.d/dietpi-hwrng.conf' | ||
|
||
# Rockchip 64-bit (configs work with Amlogic OOTB) | ||
elif [[ $G_HW_MODEL =~ ^(42|43|46|47|55|56|58|68|72|73|77|78|80|82|85|86|87)$ ]] | ||
elif [[ $G_HW_MODEL =~ ^(42|43|46|47|55|56|58|68|72|73|76|77|78|79|80|82|85|86|87)$ ]] | ||
then | ||
G_EXEC sed --follow-symlinks -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd | ||
G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x9000000"' /boot/boot.cmd | ||
G_CONFIG_INJECT 'overlay_path=' 'overlay_path=rockchip' /boot/dietpiEnv.txt | ||
case $G_HW_MODEL in | ||
73) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3308' /boot/dietpiEnv.txt;; | ||
78|80|82|85) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3588' /boot/dietpiEnv.txt;; # ToDo: There are multiple other prefixes used in the kernel package, "rock-5b", "rock-5ab", "rockchip" (for fixup), so the boot.cmd need heavy adjustments (eliminate the prefix entirely) to work with all overlays. | ||
78|79|80|82|85) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3588' /boot/dietpiEnv.txt;; # ToDo: There are multiple other prefixes used in the kernel package, "rock-5b", "rock-5ab", "rockchip" (for fixup), so the boot.cmd need heavy adjustments (eliminate the prefix entirely) to work with all overlays. | ||
*) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rockchip' /boot/dietpiEnv.txt;; | ||
esac | ||
case $G_HW_MODEL in | ||
|
@@ -681,7 +682,7 @@ setenv rootuuid "true"' /boot/boot.cmd | |
case $G_HW_MODEL in | ||
73) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS0,1500000' /boot/dietpiEnv.txt;; # headless | ||
47|55|56) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS2,1500000' /boot/dietpiEnv.txt;; # headless | ||
78|80|82) G_EXEC sed --follow-symlinks -i 's/ttyAML0,115200/ttyFIQ0,1500000/' /boot/dietpiEnv.txt;; | ||
78|79|80|82|85) G_EXEC sed --follow-symlinks -i 's/ttyAML0,115200/ttyFIQ0,1500000/' /boot/dietpiEnv.txt;; # RK3588 | ||
*) G_EXEC sed --follow-symlinks -i 's/ttyAML0,115200/ttyS2,1500000/' /boot/dietpiEnv.txt;; | ||
esac | ||
|
||
|
@@ -1089,14 +1090,20 @@ _EOF_ | |
esac;; | ||
73) model='rockpi-s' kernel='rockchip64';; | ||
74) model='radxa-zero';; | ||
76) kernel='rockchip64';; | ||
case $HW_VARIANT in | ||
2) model='nanopi-r5c';; | ||
*) model='nanopi-r5s';; | ||
esac;; | ||
77) model='rock-3a' kernel='rockchip64';; | ||
78) model='rock-5b' kernel='rk35xx' branch='legacy';; | ||
79) model='nanopi-r6s' kernel='rk35xx' branch='legacy';; | ||
80) model='orangepi5' kernel='rk35xx' branch='legacy';; | ||
82) model='orangepi5-plus' kernel='rk35xx' branch='legacy';; | ||
83) model='orangepizero3' kernel='sunxi64';; | ||
85) model='rock-5a' kernel='rk35xx' branch='legacy';; | ||
86) model='tinkerboard-2' kernel='rockchip64';; | ||
87) model='orangepi3b' kernel='rockchip64'; branch='edge';; | ||
87) model='orangepi3b' kernel='rockchip64' branch='edge';; | ||
*) :;; | ||
esac | ||
# Download and pre-install U-Boot hosted on dietpi.com where it has not been ported to the Armbian Bookworm repo or has been removed completely | ||
|
@@ -1140,14 +1147,15 @@ _EOF_ | |
G_AGI initramfs-tools u-boot-tools armbian-firmware "${zstd[@]}" | ||
[[ ${zstd[0]} ]] && G_CONFIG_INJECT 'COMPRESS=' 'COMPRESS=zstd' /etc/initramfs-tools/initramfs.conf | ||
# Download and pre-install kernel hosted on dietpi.com where the Armbian APT repo provides a too old version | ||
if (( ( $G_HW_MODEL == 72 && ${HW_VARIANT:-1} == 2 ) || $G_HW_MODEL == 83 )) | ||
if [[ ( $G_HW_MODEL == 72 && $HW_VARIANT == 2 ) || $G_HW_MODEL =~ ^(76|83)$ ]] | ||
then | ||
G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" | ||
G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" | ||
G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb 'https://dietpi.com/downloads/binaries/armbian-firmware.deb' | ||
local uboot=() | ||
(( $HW_VARIANT == 1 )) && { G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb"; uboot=('package3.deb'); } | ||
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb "${uboot[@]}" | ||
G_EXEC rm package1.deb package2.deb "${uboot[@]}" | ||
[[ ( $G_HW_MODEL =~ ^(72|76)$ && $HW_VARIANT == 2 ) || ( $G_HW_MODEL == 83 && $HW_VARIANT == 1 ) ]] && { G_EXEC_OUTPUT=1 G_EXEC curl -fo package4.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb"; uboot=('package4.deb'); } | ||
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb package3.deb "${uboot[@]}" | ||
G_EXEC rm package1.deb package2.deb package3.deb "${uboot[@]}" | ||
fi | ||
# Orange Pi Zero 3 1.5G RAM variant: Install original Orange Pi bootloader | ||
if (( $G_HW_MODEL == 83 )) && (( $HW_VARIANT == 2 )) | ||
|
@@ -1286,22 +1294,6 @@ _EOF_ | |
G_EXEC rm package.deb | ||
aPACKAGES_REQUIRED_INSTALL+=("firmware-$variant") | ||
|
||
# NanoPi R5S/R5C | ||
elif (( $G_HW_MODEL == 76 )) && { [[ ! $(find /lib/modules -mindepth 1 -maxdepth 1 -type d) ]] || dpkg-query -s 'firmware-nanopi5' &> /dev/null; } | ||
then | ||
G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/firmware-nanopi5.deb' | ||
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb | ||
G_EXEC rm package.deb | ||
aPACKAGES_REQUIRED_INSTALL+=('firmware-nanopi5') | ||
|
||
# NanoPi 6 | ||
elif (( $G_HW_MODEL == 79 )) && { [[ ! $(find /lib/modules -mindepth 1 -maxdepth 1 -type d) ]] || dpkg-query -s 'firmware-nanopi6' &> /dev/null; } | ||
then | ||
G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/firmware-nanopi6.deb' | ||
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb | ||
G_EXEC rm package.deb | ||
aPACKAGES_REQUIRED_INSTALL+=('firmware-nanopi6') | ||
|
||
# NanoPi M2/T2/Fire2 Linux 4.4: Requires dedicated boot partition, starting at 4 MiB for U-Boot, with ext4 filesystem | ||
elif [[ $G_HW_MODEL == 61 && $(findmnt -Ufnro FSTYPE -M /boot) == 'ext4' ]] && (( $(sfdisk -qlo Start "$BOOT_DEVICE" | mawk 'NR==2') >= 8192 )) | ||
then | ||
|
@@ -1730,7 +1722,6 @@ _EOF_ | |
|
||
# - FriendlyELEC | ||
[[ -f 'usr/bin/lcd2usb_print' ]] && G_EXEC rm /usr/bin/lcd2usb_print | ||
(( $G_HW_MODEL == 76 )) && G_EXEC rm -Rf /data /sdcard /udisk /oem /userdata /system /vendor /mnt/{sdcard,external_sd,usb_storage,udisk} /etc/systemd/system/{boot-complete.target.requires,ctrl-alt-del.target,[email protected],[email protected],[email protected]} | ||
[[ -f '/usr/local/bin/cputemp.sh' ]] && G_EXEC rm /usr/local/bin/cputemp.sh | ||
[[ -f '/usr/local/bin/drm-hotplug.sh' ]] && G_EXEC rm /usr/local/bin/drm-hotplug.sh | ||
[[ -f '/usr/local/bin/setup-net-smp.sh' ]] && G_EXEC rm /usr/local/bin/setup-net-smp.sh | ||
|
@@ -1973,8 +1964,8 @@ _EOF_' | |
/boot/dietpi/func/dietpi-set_hardware serialconsole enable ttySAC0 | ||
/boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyGS0 | ||
|
||
# ROCKPro64, ROCK64, Pinebook Pro, NanoPi R4S, Quartz64, ASUS Tinker Board, NanoPi R2S, NanoPi NEO3, NanoPi M4V2, NanoPi M4/T4/NEO4, ROCK 4, ROCK 3A, ASUS Tinker Board 2 | ||
elif [[ $G_HW_MODEL =~ ^(42|43|46|47|49|52|55|56|58|68|72|77|86|87)$ ]] | ||
# ROCKPro64, ROCK64, Pinebook Pro, NanoPi R4S, Quartz64, ASUS Tinker Board, NanoPi R2S, NanoPi NEO3, NanoPi M4V2, NanoPi M4/T4/NEO4, ROCK 4, NanoPi R5S/R5C, ROCK 3A, ASUS Tinker Board 2, Orange Pi 3B | ||
elif [[ $G_HW_MODEL =~ ^(42|43|46|47|49|52|55|56|58|68|72|76|77|86|87)$ ]] | ||
then | ||
/boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS2 | ||
|
||
|
@@ -1988,8 +1979,8 @@ _EOF_' | |
then | ||
/boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS1 | ||
|
||
# NanoPi R5S/R5C, ROCK 5B, NanoPi 6, Orange Pi 5, Orange Pi 5 Plus, ROCK 5A | ||
elif [[ $G_HW_MODEL =~ ^(76|78|79|80|82|85)$ ]] | ||
# RK3588: ROCK 5B, NanoPi 6, Orange Pi 5, Orange Pi 5 Plus, ROCK 5A | ||
elif [[ $G_HW_MODEL =~ ^(78|79|80|82|85)$ ]] | ||
then | ||
/boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyFIQ0 | ||
|
||
|
@@ -2160,15 +2151,24 @@ _EOF_ | |
SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" | ||
SUBSYSTEM=="leds", KERNEL=="lan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" | ||
_EOF_ | ||
# NanoPi R5S/R5C: In case, will be updated for R5C on first boot | ||
elif (( $G_HW_MODEL == 76 )) | ||
# NanoPi R5S | ||
elif [[ $G_HW_MODEL == 76 && $HW_VARIANT == 1 ]] | ||
then | ||
G_DIETPI-NOTIFY 2 'Enabling NanoPi R5S/R5C Ethernet LEDs' | ||
G_DIETPI-NOTIFY 2 'Enabling NanoPi R5S Ethernet LEDs' | ||
G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' | ||
cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules | ||
SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" | ||
SUBSYSTEM=="leds", KERNEL=="lan1_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" | ||
SUBSYSTEM=="leds", KERNEL=="lan2_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth2", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth2", RUN+="/bin/ip l s down dev eth2" | ||
SUBSYSTEM=="leds", KERNEL=="green:lan-1", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" | ||
SUBSYSTEM=="leds", KERNEL=="green:lan-2", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" | ||
SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth2", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth2", RUN+="/bin/ip l s down dev eth2" | ||
_EOF_ | ||
# NanoPi R5C | ||
elif [[ $G_HW_MODEL == 76 && $HW_VARIANT == 2 ]] | ||
then | ||
G_DIETPI-NOTIFY 2 'Enabling NanoPi R5C Ethernet LEDs' | ||
G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' | ||
cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules | ||
SUBSYSTEM=="leds", KERNEL=="green:lan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" | ||
SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" | ||
_EOF_ | ||
# NanoPi 6: These match for R6S and in case will be updated for R6C or NanoPC T6 on first boot, based on /proc/device-tree/model. | ||
elif (( $G_HW_MODEL == 79 )) | ||
|
This file contains 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