-
-
Notifications
You must be signed in to change notification settings - Fork 506
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
2 changed files
with
24 additions
and
59 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 |
---|---|---|
|
@@ -614,7 +614,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 | ||
|
@@ -655,14 +655,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 | ||
|
@@ -679,7 +679,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 | ||
|
||
|
@@ -1083,14 +1083,16 @@ _EOF_ | |
72) model='rockpi-4b' kernel='rockchip64';; | ||
73) model='rockpi-s' kernel='rockchip64';; | ||
74) model='radxa-zero';; | ||
76) model='nanopi-r5s' kernel='rockchip64';; | ||
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 | ||
|
@@ -1138,10 +1140,17 @@ _EOF_ | |
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[@]}" | ||
(( $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.de "${uboot[@]}" | ||
G_EXEC rm package1.deb package2.deb package3.deb "${uboot[@]}" | ||
|
||
elif (( $G_HW_MODEL == 76 )) | ||
then | ||
G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb" | ||
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb | ||
G_EXEC rm package.deb | ||
fi | ||
# Orange Pi Zero 3 1.5G RAM variant: Install original Orange Pi bootloader | ||
if (( $G_HW_MODEL == 83 )) && (( $HW_VARIANT == 2 )) | ||
|
@@ -1281,22 +1290,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 | ||
|
@@ -1725,7 +1718,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 | ||
|
@@ -1968,8 +1960,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 | ||
|
||
|
@@ -1983,8 +1975,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 | ||
|
||
|