Skip to content

Commit

Permalink
Beta v8.21.0 (#6563)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaIng committed Aug 20, 2023
2 parents 1e099f3 + 11b076d commit 1463d3f
Show file tree
Hide file tree
Showing 33 changed files with 540 additions and 301 deletions.
5 changes: 3 additions & 2 deletions .build/images/dietpi-build
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ case $HW_MODEL in
79) iname='NanoPi6' HW_ARCH=3 root_size=752;; # Special case: Skips image file, partitioning and filesystem generation, but runs debootstrap only!
80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;;
81) iname='VisionFive2' HW_ARCH=11 root_size=639;;
82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;;
*) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed, aborting..."; exit 1;;
esac

Expand Down Expand Up @@ -155,7 +156,7 @@ case $DISTRO in
[[ $HW_ARCH == 11 ]] && distro='sid' # RISC-V architecture is available on Debian Sid/unstable only
# Raise root size where required
case $HW_MODEL in
1[256]|49.[123]|54|61|7[4569]) ((root_size+=128));;
1[256]|49.[123]|54|61|7[4569]|8[02]) ((root_size+=128));;
21) ((root_size+=448));;
*) :;;
esac
Expand Down Expand Up @@ -215,7 +216,7 @@ then
case $keyring in
*'raspbian'*) url='https://archive.raspbian.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2_all.deb';;
*'debian-ports'*) url='https://deb.debian.org/debian/pool/main/d/debian-ports-archive-keyring/debian-ports-archive-keyring_2023.02.01~deb11u1_all.deb';;
*) url='https://deb.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2023.3_all.deb';;
*) url='https://deb.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2023.4_all.deb';;
esac
G_EXEC curl -sSf "$url" -o /tmp/keyring.deb
G_EXEC_OUTPUT=1 G_EXEC dpkg -i /tmp/keyring.deb
Expand Down
189 changes: 107 additions & 82 deletions .build/images/dietpi-installer
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# - PREIMAGE_INFO='Some GNU/Linux'
# - HW_MODEL=0 (must match one of the supported IDs below)
# - WIFI_REQUIRED=0 [01]
# - DISTRO_TARGET=6 [67] (Bullseye: 6, Bookworm: 7, Trixie: 8)
# - DISTRO_TARGET=7 [678] (Bullseye: 6, Bookworm: 7, Trixie: 8)
#------------------------------------------------------------------------------------------------

# Core globals
Expand Down Expand Up @@ -228,7 +228,7 @@ _EOF_
exit 1
fi
fi
G_DIETPI-NOTIFY 2 "Detected target CPU architecture: $G_HW_ARCH_NAME (ID: $G_HW_ARCH)"
G_DIETPI-NOTIFY 2 "Detected host CPU architecture: $G_HW_ARCH_NAME (ID: $G_HW_ARCH)"

Main()
{
Expand Down Expand Up @@ -328,74 +328,86 @@ _EOF_
G_WHIP_DEFAULT_ITEM=0
case $G_HW_ARCH in
1) G_WHIP_MENU_ARRAY=('0' ': Raspberry Pi (all models)');;
2) G_WHIP_MENU_ARRAY=(
'0' ': Raspberry Pi 2 - 4'
'' '●─ ARMv7 '
'10' ': Odroid C1'
'11' ': Odroid XU3/XU4/MC1/HC1/HC2'
'13' ': Odroid U3'
'70' ': Sparky SBC'
'52' ': ASUS Tinker Board'
'59' ': ZeroPi'
'60' ': NanoPi NEO'
'64' ': NanoPi NEO Air'
'63' ': NanoPi M1'
'66' ': NanoPi M1 Plus'
'48' ': NanoPi R1'
'61' ': NanoPi M2/T2/Fire2'
'25' ': Generic Allwinner H3'
'' '●─ ARMv8 '
);;
3) G_WHIP_MENU_ARRAY=('0' ': Raspberry Pi 2 (v1.2) - 4');;
2|3)
userland_arch=$(dpkg --print-architecture)
G_DIETPI-NOTIFY 2 "Detected target userland/OS architecture: $userland_arch"
if [[ $userland_arch == 'armhf' ]]
then
G_WHIP_MENU_ARRAY=(
'0' ': Raspberry Pi 2 - 4'
'10' ': Odroid C1'
'11' ': Odroid XU3/XU4/MC1/HC1/HC2'
'13' ': Odroid U3'
'70' ': Sparky SBC'
'52' ': ASUS Tinker Board'
'59' ': ZeroPi'
'60' ': NanoPi NEO'
'64' ': NanoPi NEO Air'
'63' ': NanoPi M1'
'66' ': NanoPi M1 Plus'
'48' ': NanoPi R1'
'61' ': NanoPi M2/T2/Fire2'
'25' ': Generic Allwinner H3'
)

elif [[ $userland_arch == 'arm64' ]]
then
G_WHIP_MENU_ARRAY=(
'0' ': Raspberry Pi 2 (v1.2) - 4'
'12' ': Odroid C2'
'15' ': Odroid N2'
'16' ': Odroid C4/HC4'
'40' ': PINE A64'
'45' ': PINE H64'
'43' ': ROCK64'
'42' ': ROCKPro64'
'44' ': Pinebook'
'46' ': Pinebook Pro'
'49.1' ': Quartz64 Model A'
'49.2' ': Quartz64 Model B'
'49.3' ': SOQuartz'
'65.1' ': NanoPi NEO2'
'65.2' ': NanoPi NEO2 Black'
'56' ': NanoPi NEO3'
'57' ': NanoPi NEO Plus2'
'62.1' ': NanoPi M3/T3'
'62.2' ': NanoPi Fire3'
'68.1' ': NanoPi M4'
'68.2' ': NanoPC T4'
'68.3' ': NanoPi NEO4'
'58' ': NanoPi M4V2'
'67' ': NanoPi K1 Plus'
'54' ': NanoPi K2'
'55' ': NanoPi R2S'
'47' ': NanoPi R4S'
'76' ': NanoPi R5S/R5C'
'79' ': NanoPi 6 series'
'72' ': ROCK 4'
'73' ': ROCK Pi S'
'74' ': Radxa Zero'
'77' ': ROCK 3A'
'78' ': ROCK 5B'
'80' ': Orange Pi 5'
'82' ': Orange Pi 5 Plus'
'23' ': Generic Rockchip RK3328'
'24' ': Generic Rockchip RK3399'
'26' ': Generic Allwinner H5'
'27' ': Generic Allwinner H6'
'28' ': Generic Amlogic S905'
'29' ': Generic Amlogic S922X'
)
else
G_DIETPI-NOTIFY 1 "Unsupported userland/OS architecture: \"$userland_arch\". Aborting...\n"
exit 1
fi
;;
10) G_WHIP_DEFAULT_ITEM=21 G_WHIP_MENU_ARRAY=(
'20' ': Virtual machine'
'21' ': Native PC'
);;
11) G_WHIP_DEFAULT_ITEM=81 G_WHIP_MENU_ARRAY=('81' ': StarFive VisionFive 2');;
*) :;;
esac
[[ $G_HW_ARCH == [23] ]] && G_WHIP_MENU_ARRAY+=(
'12' ': Odroid C2'
'15' ': Odroid N2'
'16' ': Odroid C4/HC4'
'40' ': PINE A64'
'45' ': PINE H64'
'43' ': ROCK64'
'42' ': ROCKPro64'
'44' ': Pinebook'
'46' ': Pinebook Pro'
'49.1' ': Quartz64 Model A'
'49.2' ': Quartz64 Model B'
'49.3' ': SOQuartz'
'65.1' ': NanoPi NEO2'
'65.2' ': NanoPi NEO2 Black'
'56' ': NanoPi NEO3'
'57' ': NanoPi NEO Plus2'
'62.1' ': NanoPi M3/T3'
'62.2' ': NanoPi Fire3'
'68.1' ': NanoPi M4'
'68.2' ': NanoPC T4'
'68.3' ': NanoPi NEO4'
'58' ': NanoPi M4V2'
'67' ': NanoPi K1 Plus'
'54' ': NanoPi K2'
'55' ': NanoPi R2S'
'47' ': NanoPi R4S'
'76' ': NanoPi R5S/R5C'
'79' ': NanoPi 6 series'
'72' ': ROCK 4'
'73' ': ROCK Pi S'
'74' ': Radxa Zero'
'77' ': ROCK 3A'
'78' ': ROCK 5B'
'80' ': Orange Pi 5'
'23' ': Generic Rockchip RK3328'
'24' ': Generic Rockchip RK3399'
'26' ': Generic Allwinner H5'
'27' ': Generic Allwinner H6'
'28' ': Generic Amlogic S905'
'29' ': Generic Amlogic S922X'
)
G_WHIP_MENU_ARRAY+=(
'' '●─ Other '
'75' ': Container image'
Expand Down Expand Up @@ -521,8 +533,12 @@ _EOF_
elif (( $DISTRO_TARGET == 6 ))
then
DISTRO_TARGET_NAME='bullseye'
else

elif (( $DISTRO_TARGET == 7 ))
then
DISTRO_TARGET_NAME='bookworm'
else
DISTRO_TARGET_NAME='trixie'
fi

G_DIETPI-NOTIFY 2 "Selected Debian version: $DISTRO_TARGET_NAME (ID: $DISTRO_TARGET)"
Expand Down Expand Up @@ -564,7 +580,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 -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)$ ]]
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)$ ]]
then
armbian_repo=1
G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/boot.cmd" /boot/boot.cmd
Expand Down Expand Up @@ -605,16 +621,15 @@ 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)$ ]]
elif [[ $G_HW_MODEL =~ ^(42|43|46|47|55|56|58|68|72|73|77|78|80|82)$ ]]
then
G_EXEC sed -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;;
77) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk35xx' /boot/dietpiEnv.txt;;
78) 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.
80) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rockchip-rk3588' /boot/dietpiEnv.txt;;
78|80|82) 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
Expand All @@ -624,13 +639,12 @@ setenv rootuuid "true"' /boot/boot.cmd
73) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3308-rock-pi-s.dtb' /boot/dietpiEnv.txt;; # U-Boot does not pass any ${fdtfile}
77) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3568-rock-3a.dtb' /boot/dietpiEnv.txt;;
78) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588-rock-5b.dtb' /boot/dietpiEnv.txt;;
80) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588s-orangepi-5.dtb' /boot/dietpiEnv.txt;;
*) :;;
esac
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) G_EXEC sed -i 's/ttyAML0,115200/ttyFIQ0,1500000/' /boot/dietpiEnv.txt;;
78|80|82) G_EXEC sed -i 's/ttyAML0,115200/ttyFIQ0,1500000/' /boot/dietpiEnv.txt;;
*) G_EXEC sed -i 's/ttyAML0,115200/ttyS2,1500000/' /boot/dietpiEnv.txt;;
esac

Expand Down Expand Up @@ -882,7 +896,7 @@ _EOF_
)

# Entropy daemon: Use modern rng-tools5 on all devices where it has been proven to work, else haveged: https://github.com/MichaIng/DietPi/issues/2806
if [[ $G_HW_MODEL -lt 10 || $G_HW_MODEL =~ ^(14|15|16|24|29|42|46|58|68|72|74|76|78|79|80|81)$ ]] # RPi, S922X, Odroid C4, RK3399 - 47 NanoPi R4S, Radxa Zero, NanoPi R5S/R5C, ROCK 5B, NanoPi 6, Orange Pi 5, VisionFive 2
if [[ $G_HW_MODEL -lt 10 || $G_HW_MODEL =~ ^(14|15|16|24|29|42|46|58|68|72|74|76|78|79|80|81|82)$ ]] # RPi, S922X, Odroid C4, RK3399 - 47 NanoPi R4S, Radxa Zero, NanoPi R5S/R5C, ROCK 5B, NanoPi 6, Orange Pi 5, VisionFive 2, Orange Pi 5 Plus
then
aPACKAGES_REQUIRED_INSTALL+=('rng-tools5')
else
Expand Down Expand Up @@ -1014,17 +1028,19 @@ _EOF_
73) model='rockpi-s' kernel='rockchip64' dietpi_com=1;;
74) model='radxa-zero';;
77) model='rock-3a' kernel='rk35xx' branch='edge';;
78) model='rock-5b' kernel='rockchip-rk3588' branch='legacy';;
80) model='orangepi5' kernel='rockchip-rk3588' branch='legacy';;
78) model='rock-5b' kernel='rk35xx' branch='legacy';;
80) model='orangepi5' kernel='rk35xx' branch='legacy';;
82) model='orangepi5-plus' kernel='rk35xx' branch='legacy';;
*) :;;
esac
# Download and pre-install U-Boot hosted on dietpi.com where it has not been ported (and probably never will) to the Armbian Bookworm repo.
if (( $dietpi_com && $G_DISTRO > 6 || $G_HW_MODEL == 62 ))
# Download and pre-install U-Boot hosted on dietpi.com where it has not been ported (and probably never will) to the Armbian Bookworm repo or where it provides a too old version
if (( $dietpi_com && $G_DISTRO > 6 || $G_HW_MODEL == 62 || $G_HW_MODEL == 80 || $G_HW_MODEL == 82 ))
then
G_EXEC curl -sSfO "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb"
G_EXEC_OUTPUT=1 G_EXEC dpkg -i "linux-u-boot-$model-$branch.deb"
G_EXEC rm "linux-u-boot-$model-$branch.deb"
G_EXEC curl -sSfo 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

# NanoPi R2S/NEO3
if [[ $G_HW_MODEL =~ ^(55|56)$ ]]
then
Expand All @@ -1038,9 +1054,17 @@ blacklist rockchip_vdec
_EOF_
fi
# Install initramfs-tools first to have an initramfs generated on kernel install, and configure it to use zstd if supported for better compression and faster decompression
[[ $kernel == 'rockchip64' || $kernel == 'rockchip-rk3588' || $kernel == 'meson64' || $kernel == 'sunxi64' || $kernel == 'sunxi' ]] && zstd=('zstd')
[[ $kernel == 'rockchip64' || $kernel == 'rk35xx' || $kernel == 'meson64' || $kernel == 'sunxi64' || $kernel == 'sunxi' ]] && zstd=('zstd')
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 =~ ^(78|80|82)$ ]]
then
G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb"
G_EXEC curl -sSfo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb"
G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb package2.deb
G_EXEC rm package.deb package2.deb
fi
G_AGI linux-{image,dtb}-"$branch-$kernel" "linux-u-boot-$model-$branch"
# Cleanup
[[ $G_HW_MODEL != 10 && -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage
Expand Down Expand Up @@ -1774,8 +1798,8 @@ _EOF_'
then
/boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS1

# NanoPi R5S/R5C, ROCK 5B, NanoPi 6, Orange Pi 5
elif [[ $G_HW_MODEL =~ ^(76|78|79|80)$ ]]
# NanoPi R5S/R5C, ROCK 5B, NanoPi 6, Orange Pi 5, Orange Pi 5 Plus
elif [[ $G_HW_MODEL =~ ^(76|78|79|80|82)$ ]]
then
/boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyFIQ0

Expand Down Expand Up @@ -1910,7 +1934,7 @@ _EOF_
# For backwards compatibility with software compiled against older libraspberrypi0, create symlinks from old to new filenames
if (( $G_HW_ARCH < 3 ))
then
G_DIETPI-NOTIFY 2 'Applying workaround for compiled against older libraspberrypi0'
G_DIETPI-NOTIFY 2 'Applying workaround for software compiled against older libraspberrypi0'
G_EXEC cd /usr/lib/arm-linux-gnueabihf
while read -r line
do
Expand All @@ -1919,6 +1943,7 @@ _EOF_
G_EXEC ln -sf "$line" "${line%.0}"

done < <(dpkg -L 'libraspberrypi0' | grep '^/usr/lib/arm-linux-gnueabihf/.*\.so.0$')
G_EXEC cd "/tmp/$G_PROGRAM_NAME"
fi

# NanoPi M3/T3/Fire3
Expand Down
14 changes: 14 additions & 0 deletions .conf/dps_27/lighttpd.tasmoadmin.3.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$HTTP["url"] =~ "^/tasmoadmin($|/)" {
# Deny direct access to .htaccess and data directory
$HTTP["url"] =~ "^/tasmoadmin/(\.|data)" {
# Allow direct access to firmwares
$HTTP["url"] !~ "^/tasmoadmin/data/firmwares" {
url.access-deny = ("")
}
}

# TasmoAdmin URL rewrites
else $HTTP["url"] !~ "^/tasmoadmin/index\.php($|/)" {
url.rewrite-if-not-file = ("^/tasmoadmin/(.*)$" => "/tasmoadmin/index.php?$1")
}
}
2 changes: 1 addition & 1 deletion .conf/dps_27/lighttpd.tasmoadmin.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $HTTP["url"] =~ "^/tasmoadmin($|/)" {
}
}

# TasmoAdmin URL rewrites required for sync clients
# TasmoAdmin URL rewrites
url.rewrite-if-not-file = (
"^/tasmoadmin/doAjax$" => "/tasmoadmin/index.php?doAjax=doAjax",
"^/tasmoadmin/doAjaxAll$" => "/tasmoadmin/index.php?doAjaxAll=doAjaxAll",
Expand Down
30 changes: 30 additions & 0 deletions .conf/dps_27/nginx.tasmoadmin.3.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Location: /etc/nginx/sites-dietpi/dietpi-tasmoadmin.conf
# Based on: https://github.com/TasmoAdmin/TasmoAdmin/blob/master/.docker/rootfs/etc/nginx/nginx.conf
location ^~ /tasmoadmin {
# Allow direct access to firmwares
location ^~ /tasmoadmin/data/firmwares {
add_header Access-Control-Allow-Origin *;
}

# Deny direct access to .htaccess and data directory
location ~ ^/tasmoadmin/(?:\.|data) {
deny all;
}

location ~ ^/tasmoadmin/index\.php(/|$) {
fastcgi_pass php;
fastcgi_read_timeout 900;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}

location ~ \.(css|js|gif||jpe?g|png|json|cache\.json)$ {
}

location /tasmoadmin {
try_files $uri $uri/ /tasmoadmin/index.php$is_args$args;
}
}

0 comments on commit 1463d3f

Please sign in to comment.