Skip to content

Commit

Permalink
v9.8
Browse files Browse the repository at this point in the history
- Images | Add initial support for Orange Pi 5 Max and NanoPi M6, not as officially supported yet, but to allow building test images with stable DietPi code.
  • Loading branch information
MichaIng committed Oct 17, 2024
1 parent 5d8f5a5 commit a4d273d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 13 deletions.
14 changes: 8 additions & 6 deletions .build/images/dietpi-build
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,26 @@ case $HW_MODEL in
73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=1100;;
74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=1148;;
75) iname='Container' HW_ARCH=${HW_ARCH:-10} root_size=575;;
'76.1') iname='NanoPiR5S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
'76.2') iname='NanoPiR5C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
'76.1') iname='NanoPiR5S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
'76.2') iname='NanoPiR5C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
'79.1') iname='NanoPiR6S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
'79.2') iname='NanoPiR6C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
'79.3') iname='NanoPCT6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
81) iname='VisionFive2' HW_ARCH=11 root_size=639;;
82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
83) iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=1148;;
84) iname='Star64' HW_ARCH=11 root_size=639;;
85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=1100;;
87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
88) iname='OrangePiZero2W' HW_ARCH=3 partition_start=4 root_size=1148;;
89) iname='OrangePi3LTS' HW_ARCH=3 partition_start=4 root_size=1000;;
90) iname='RadxaZERO3' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;;
90) iname='RadxaZERO3' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
91) iname='OrangePi5Max' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
92) iname='NanoPiM6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;;
*) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed, aborting..."; exit 1;;
esac

Expand Down
14 changes: 9 additions & 5 deletions .build/images/dietpi-installer
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ _EOF_
'79.1' ': NanoPi R6S'
'79.2' ': NanoPi R6C'
'79.3' ': NanoPC T6'
'92' ': NanoPi M6'
'72.1' ': ROCK 4 (all other variants)'
'72.2' ': ROCK 4 SE'
'72.3' ': ROCK 4C Plus'
Expand All @@ -429,6 +430,7 @@ _EOF_
'89' ': Orange Pi 3 LTS'
'80' ': Orange Pi 5'
'82' ': Orange Pi 5 Plus'
'91' ': Orange Pi 5 Max'
'83' ': Orange Pi Zero 3'
'88' ': Orange Pi Zero 2W'
'86' ': ASUS Tinker Board 2'
Expand Down Expand Up @@ -669,7 +671,7 @@ 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|76|77|78|79|80|82|85|86|87|90)$ ]]
elif [[ $G_HW_MODEL =~ ^(42|43|46|47|55|56|58|68|72|73|76|77|78|79|80|82|85|86|87|90|91|92)$ ]]
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
Expand Down Expand Up @@ -702,14 +704,14 @@ setenv rootuuid "true"' /boot/boot.cmd
# Overlay prefix
case $G_HW_MODEL in
73) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3308' /boot/dietpiEnv.txt;;
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.
78|79|80|82|85|91|92) 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
# Console args
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|79|80|82|85) G_EXEC sed --follow-symlinks -i 's/ttyAML0,115200/ttyFIQ0,1500000/' /boot/dietpiEnv.txt;; # RK3588
78|79|80|82|85|91|92) 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

Expand Down Expand Up @@ -1140,6 +1142,8 @@ _EOF_
88) model='orangepizero2w' kernel='sunxi64';;
89) model='orangepi3-lts' kernel='sunxi64';;
90) model='radxa-zero3' kernel='rk35xx' branch='legacy';;
91) model='orangepi5-max' kernel='rk35xx' branch='vendor';;
92) model='nanopi-m6' kernel='rk35xx' branch='vendor';;
*) :;;
esac

Expand Down Expand Up @@ -1961,8 +1965,8 @@ _EOF_'
then
/boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS1

# Rockchip vendor: ROCK 5B, NanoPi 6, Orange Pi 5, Orange Pi 5 Plus, ROCK 5A, Radxa ZERO 3
elif [[ $G_HW_MODEL =~ ^(78|79|80|82|85|90)$ ]]
# Rockchip vendor/legacy: ROCK 5B, NanoPi 6, Orange Pi 5, Orange Pi 5 Plus, ROCK 5A, Radxa ZERO 3
elif [[ $G_HW_MODEL =~ ^(78|79|80|82|85|90|91|92)$ ]]
then
/boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyFIQ0

Expand Down
2 changes: 2 additions & 0 deletions .meta/dietpi-survey_report
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ shopt -s extglob
[88]='Orange Pi Zero 2W'
[89]='Orange Pi 3 LTS'
[90]='Radxa ZERO 3'
[91]='Orange Pi 5 Max'
[92]='NanoPi M6'
)

## Benchmark data arrays: aBENCH_XX[$HW_MODEL,${aBENCH_XX_INDEX[$HW_MODEL]}]
Expand Down
14 changes: 13 additions & 1 deletion dietpi/func/dietpi-obtain_hw_model
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# - Generates /boot/dietpi/.hw_model
# - Called from /boot/dietpi/preboot, called by /etc/systemd/system/dietpi-preboot.service
#
# G_HW_MODEL 92 NanoPi M6
# G_HW_MODEL 91 Orange Pi 5 Max
# G_HW_MODEL 90 Radxa ZERO 3
# G_HW_MODEL 89 Orange Pi 3 LTS
# G_HW_MODEL 88 Orange Pi Zero 2W
Expand Down Expand Up @@ -366,7 +368,17 @@

G_HW_MODEL=$(mawk 'NR==1' "$FP_G_HW_MODEL_IDENTIFIER")

if (( $G_HW_MODEL == 90 )); then
if (( $G_HW_MODEL == 92 )); then

G_HW_MODEL_NAME='NanoPi M6'
G_HW_CPUID=11

elif (( $G_HW_MODEL == 91 )); then

G_HW_MODEL_NAME='Orange Pi 5 Max'
G_HW_CPUID=11

elif (( $G_HW_MODEL == 90 )); then

G_HW_MODEL_NAME='Radxa ZERO 3'
G_HW_CPUID=9
Expand Down
2 changes: 1 addition & 1 deletion dietpi/func/dietpi-set_hardware
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,7 @@ Do you want to continue and disable the serial login console?' || return 1
elif (( $DIETPIENV || $G_HW_MODEL == 49 || $G_HW_MODEL == 76 || $G_HW_MODEL == 79 ))
then
local baudrate='115200'
if [[ $G_HW_MODEL =~ ^(42|43|46|47|49|55|56|58|68|72|76|77|78|79|80|82|85|87|90)$ && $INPUT_ADDITIONAL =~ ^('ttyS2'|'ttyFIQ0')$ ]] || [[ $G_HW_MODEL == 73 && $INPUT_ADDITIONAL == 'ttyS'[012] ]]
if [[ $G_HW_MODEL =~ ^(42|43|46|47|49|55|56|58|68|72|76|77|78|79|80|82|85|87|90|91|92)$ && $INPUT_ADDITIONAL =~ ^('ttyS2'|'ttyFIQ0')$ ]] || [[ $G_HW_MODEL == 73 && $INPUT_ADDITIONAL == 'ttyS'[012] ]]
then
baudrate='1500000'
[[ -d /etc/systemd/system/serial-getty@$INPUT_ADDITIONAL.service.d ]] || G_EXEC mkdir "/etc/systemd/system/serial-getty@$INPUT_ADDITIONAL.service.d"
Expand Down
2 changes: 2 additions & 0 deletions dietpi/func/dietpi-set_software
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ $FP_SCRIPT rpi_kernel_choice <empty> Supported on Debian Bookworm or newer on R
88) all_components='orangepizero2w';;
89) all_components='orangepi3lts';;
90) all_components='radxazero3';;
91) all_components='orangepi5max';;
92) all_components='nanopim6';;
*) :;;
esac
G_EXEC eval "echo 'deb https://dietpi.com/apt $G_DISTRO_NAME $components' > /etc/apt/sources.list.d/dietpi.list"
Expand Down

0 comments on commit a4d273d

Please sign in to comment.