diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index b1cbcab73a..044c657b8f 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -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 @@ -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 @@ -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 diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index baaec240a8..c30f6e5e2f 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -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 @@ -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() { @@ -328,25 +328,79 @@ _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' @@ -354,48 +408,6 @@ _EOF_ 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' @@ -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)" @@ -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 @@ -605,7 +621,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|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 @@ -613,8 +629,7 @@ setenv rootuuid "true"' /boot/boot.cmd 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.conf/dps_27/lighttpd.tasmoadmin.3.conf b/.conf/dps_27/lighttpd.tasmoadmin.3.conf new file mode 100644 index 0000000000..f69c58c72a --- /dev/null +++ b/.conf/dps_27/lighttpd.tasmoadmin.3.conf @@ -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") + } +} diff --git a/.conf/dps_27/lighttpd.tasmoadmin.conf b/.conf/dps_27/lighttpd.tasmoadmin.conf index b63f338d83..97e7fc2f39 100644 --- a/.conf/dps_27/lighttpd.tasmoadmin.conf +++ b/.conf/dps_27/lighttpd.tasmoadmin.conf @@ -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", diff --git a/.conf/dps_27/nginx.tasmoadmin.3.conf b/.conf/dps_27/nginx.tasmoadmin.3.conf new file mode 100644 index 0000000000..4de7963cbd --- /dev/null +++ b/.conf/dps_27/nginx.tasmoadmin.3.conf @@ -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; + } +} diff --git a/.conf/dps_27/nginx.tasmoadmin.conf b/.conf/dps_27/nginx.tasmoadmin.conf index 62fca0f85d..d501014b27 100644 --- a/.conf/dps_27/nginx.tasmoadmin.conf +++ b/.conf/dps_27/nginx.tasmoadmin.conf @@ -1,6 +1,9 @@ +# Location: /etc/nginx/sites-dietpi/dietpi-tasmoadmin.conf +# Based on: https://github.com/TasmoAdmin/TasmoAdmin/blob/v2.4.2/.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 @@ -8,7 +11,7 @@ location ^~ /tasmoadmin { deny all; } - location ~* \.php$ { + location ~ \.php$ { fastcgi_pass php; fastcgi_read_timeout 900; fastcgi_split_path_info ^(.+\.php)(/.+)$; @@ -17,10 +20,10 @@ location ^~ /tasmoadmin { include fastcgi_params; } - location ~* \.(css|js|gif||jpe?g|png|json|cache\.json)$ { + location ~ \.(css|js|gif||jpe?g|png|json|cache\.json)$ { } - # TasmoAdmin URL rewrites required for sync clients + # TasmoAdmin URL rewrites location /tasmoadmin { rewrite ^/tasmoadmin/login$ /tasmoadmin/login.php last; rewrite ^/tasmoadmin/logout$ /tasmoadmin/login.php?logout=logout last; diff --git a/.github/workflows/amiberry.yml b/.github/workflows/amiberry.yml index 85d240b65b..5ff035d2f1 100644 --- a/.github/workflows/amiberry.yml +++ b/.github/workflows/amiberry.yml @@ -19,15 +19,17 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.inputs.plat }}-${{ github.event.inputs.dist }} cancel-in-progress: true permissions: {} +defaults: + run: + shell: sh + working-directory: /dev/shm jobs: prep: outputs: plat: ${{ steps.plat.outputs.plat }} dist: ${{ steps.dist.outputs.dist }} + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 - defaults: - run: - shell: sh steps: - id: plat run: | @@ -59,11 +61,7 @@ jobs: - { plat: rpi4, dist: trixie } fail-fast: false name: "Build: ${{ matrix.plat }} - ${{ matrix.dist }}" - # https://github.com/actions/virtual-environments runs-on: ubuntu-22.04 - defaults: - run: - working-directory: /dev/shm steps: - name: Build run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/Amiberry/container_build.bash")" -- -p '${{ matrix.plat }}' -d '${{ matrix.dist }}' diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index 980f5847e2..0eb5b6e43f 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -9,14 +9,16 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.inputs.buildargs }} cancel-in-progress: true permissions: {} +defaults: + run: + working-directory: /dev/shm + shell: sh jobs: prep: outputs: buildargs: ${{ steps.buildargs.outputs.buildargs }} + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 - defaults: - run: - shell: sh steps: - id: buildargs run: | @@ -72,14 +74,14 @@ jobs: '"-m 75 -a 1 -d 5", "-m 75 -a 2 -d 5", "-m 75 -a 3 -d 5", "-m 75 -a 10 -d 5", '\ '"-m 75 -a 1 -d 6", "-m 75 -a 2 -d 6", "-m 75 -a 3 -d 6", "-m 75 -a 10 -d 6", '\ '"-m 75 -a 1 -d 7", "-m 75 -a 2 -d 7", "-m 75 -a 3 -d 7", "-m 75 -a 10 -d 7", '\ - '"-m 75 -a 2 -d 8", "-m 75 -a 3 -d 8", "-m 75 -a 10 -d 8", '\ - '"-m 75 -a 11 -d 8", '\ + '"-m 75 -a 2 -d 8", "-m 75 -a 3 -d 8", "-m 75 -a 10 -d 8", "-m 75 -a 11 -d 8", '\ '"-m 76 -d 6", "-m 76 -d 7", "-m 76 -d 8", '\ '"-m 77 -d 6", "-m 77 -d 7", "-m 77 -d 8", '\ '"-m 78 -d 6", "-m 78 -d 7", "-m 78 -d 8", '\ '"-m 79 -d 6", "-m 79 -d 7", "-m 79 -d 8", '\ '"-m 80 -d 6", "-m 80 -d 7", "-m 80 -d 8", '\ - '"-m 81 -d 8"]' >> "$GITHUB_OUTPUT" + '"-m 81 -d 8", '\ + '"-m 82 -d 6", "-m 82 -d 7", "-m 82 -d 8"]' >> "$GITHUB_OUTPUT" elif [ "${{ github.event.inputs.buildargs }}" = 'quartz64' ] then echo buildargs=[\ @@ -102,12 +104,7 @@ jobs: buildargs: ${{ fromJson(needs.prep.outputs.buildargs) }} fail-fast: false name: "Build: ${{ matrix.buildargs }}" - # https://github.com/actions/virtual-environments runs-on: ubuntu-22.04 - defaults: - run: - shell: sh - working-directory: /dev/shm steps: - name: Generate upload script run: | diff --git a/.github/workflows/dietpi-software.yml b/.github/workflows/dietpi-software.yml index cbeb91d94f..3bec4daac7 100644 --- a/.github/workflows/dietpi-software.yml +++ b/.github/workflows/dietpi-software.yml @@ -35,7 +35,7 @@ defaults: shell: sh jobs: prep: - # https://github.com/actions/virtual-environments + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 steps: - id: arch diff --git a/.github/workflows/gmediarender.yml b/.github/workflows/gmediarender.yml index eb4eb4fa4c..d05feb9db5 100644 --- a/.github/workflows/gmediarender.yml +++ b/.github/workflows/gmediarender.yml @@ -27,6 +27,7 @@ jobs: outputs: arch: ${{ steps.arch.outputs.arch }} dist: ${{ steps.dist.outputs.dist }} + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 steps: - id: arch diff --git a/.github/workflows/gogs.yml b/.github/workflows/gogs.yml index 6ddb05674d..881a7bd95d 100644 --- a/.github/workflows/gogs.yml +++ b/.github/workflows/gogs.yml @@ -17,6 +17,7 @@ jobs: outputs: arch: ${{ steps.arch.outputs.arch }} dist: ${{ steps.dist.outputs.dist }} + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 defaults: run: @@ -51,7 +52,6 @@ jobs: - { arch: 1, dist: 8 } fail-fast: false name: "Build: ${{ matrix.arch }} - ${{ matrix.dist }}" - # https://github.com/actions/virtual-environments runs-on: ubuntu-22.04 defaults: run: diff --git a/.github/workflows/quartz64.yml b/.github/workflows/quartz64.yml index 4363e6a73f..49aa85a11b 100644 --- a/.github/workflows/quartz64.yml +++ b/.github/workflows/quartz64.yml @@ -4,14 +4,14 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: {} +defaults: + run: + shell: sh + working-directory: /dev/shm jobs: build: - # https://github.com/actions/virtual-environments + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 - defaults: - run: - shell: sh - working-directory: /dev/shm env: uboot_branch: 'v2022.07-dietpi' CROSS_COMPILE: 'aarch64-linux-gnu-' diff --git a/.github/workflows/raspberrypi-sys-mods.yml b/.github/workflows/raspberrypi-sys-mods.yml index 69d886374f..3caabdff27 100644 --- a/.github/workflows/raspberrypi-sys-mods.yml +++ b/.github/workflows/raspberrypi-sys-mods.yml @@ -4,14 +4,14 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: {} +defaults: + run: + shell: sh + working-directory: /dev/shm jobs: build: - # https://github.com/actions/virtual-environments + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 - defaults: - run: - shell: sh - working-directory: /dev/shm steps: - name: Build package run: sudo bash -c "$(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/${GITHUB_REF#refs/heads/}/.build/software/raspberrypi-sys-mods/build.bash")" diff --git a/.github/workflows/shairport-sync.yml b/.github/workflows/shairport-sync.yml index e544bc4f26..5ab8fa4f1f 100644 --- a/.github/workflows/shairport-sync.yml +++ b/.github/workflows/shairport-sync.yml @@ -27,6 +27,7 @@ jobs: outputs: arch: ${{ steps.arch.outputs.arch }} dist: ${{ steps.dist.outputs.dist }} + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 steps: - id: arch @@ -58,7 +59,6 @@ jobs: - { arch: armv6l, dist: trixie } fail-fast: false name: "Build: ${{ matrix.arch }} - ${{ matrix.dist }}" - # https://github.com/actions/virtual-environments runs-on: ubuntu-22.04 steps: - name: Build diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 2dd6ff8639..a18e8c5d4a 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -5,14 +5,14 @@ concurrency: cancel-in-progress: true permissions: contents: read +defaults: + run: + shell: sh jobs: shellcheck: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login # https://github.com/actions/runner-images runs-on: ubuntu-22.04 - defaults: - run: - shell: sh steps: - name: Setup tmpfs run: sudo mount -t tmpfs -o "noatime,lazytime,uid=$(id -u)" tmpfs "$GITHUB_WORKSPACE" diff --git a/.github/workflows/squeezelite.yml b/.github/workflows/squeezelite.yml index 8b571546a7..fabdcd5ed0 100644 --- a/.github/workflows/squeezelite.yml +++ b/.github/workflows/squeezelite.yml @@ -27,6 +27,7 @@ jobs: outputs: arch: ${{ steps.arch.outputs.arch }} dist: ${{ steps.dist.outputs.dist }} + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 steps: - id: arch diff --git a/.github/workflows/vaultwarden.yml b/.github/workflows/vaultwarden.yml index 8863db8011..c4681256ff 100644 --- a/.github/workflows/vaultwarden.yml +++ b/.github/workflows/vaultwarden.yml @@ -27,6 +27,7 @@ jobs: outputs: arch: ${{ steps.arch.outputs.arch }} dist: ${{ steps.dist.outputs.dist }} + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 steps: - id: arch diff --git a/.github/workflows/ympd.yml b/.github/workflows/ympd.yml index 8782101da8..dcdf2aec10 100644 --- a/.github/workflows/ympd.yml +++ b/.github/workflows/ympd.yml @@ -27,6 +27,7 @@ jobs: outputs: arch: ${{ steps.arch.outputs.arch }} dist: ${{ steps.dist.outputs.dist }} + # https://github.com/actions/runner-images runs-on: ubuntu-22.04 steps: - id: arch diff --git a/.meta/dietpi-bookworm-upgrade b/.meta/dietpi-bookworm-upgrade index 3ae609719f..38879aaebf 100755 --- a/.meta/dietpi-bookworm-upgrade +++ b/.meta/dietpi-bookworm-upgrade @@ -3,7 +3,7 @@ # Import DietPi-Globals --------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals readonly G_PROGRAM_NAME='dietpi-bookworm-upgrade' -(( $G_DISTRO == 6 )) || { G_DIETPI-NOTIFY 1 'You must run a Debian Bullseye system to run this script!'; exit 1; } +[[ $G_DISTRO == [67] ]] || { G_DIETPI-NOTIFY 1 'You must run a Debian Bullseye system to run this script!'; exit 1; } G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_INIT @@ -50,9 +50,13 @@ G_CHECK_KERNEL || { G_WHIP_YESNO '[ INFO ] Reboot required G_DIETPI-NOTIFY 2 'Updating DietPi to latest version' /boot/dietpi/dietpi-update 1 +mapfile -t apackages < <(apt-mark showhold) +[[ ${apackages[0]} ]] && G_EXEC_DESC='Unholding all packages' G_EXEC apt-mark unhold "${apackages[@]}" +unset -v apackages + G_DIETPI-NOTIFY 2 'Migrating package lists to Bookworm suite' G_EXEC sed -i -e 's/bullseye/bookworm/g' -e 's/ non-free$/ non-free non-free-firmware/' /etc/apt/sources.list -[[ $(find /etc/apt/sources.list/*.list 2> /dev/null) ]] && G_EXEC sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list +[[ $(find /etc/apt/sources.list.d/*.list 2> /dev/null) ]] && G_EXEC sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list [[ -f '/etc/apt/sources.list.d/dietpi-mympd.list' ]] && G_EXEC sed -i 's/Debian_11/Debian_Testing/' /etc/apt/sources.list.d/dietpi-mympd.list G_DIETPI-NOTIFY 2 'Reverting some package lists to Bullseye which have no Bookworm suite (yet)' diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 9b913ce29b..707baaa300 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -82,9 +82,10 @@ shopt -s extglob [76]='NanoPi R5S/R5C' [77]='ROCK 3A' [78]='ROCK 5B' - [79]='NanoPi R6S/R6C' + [79]='NanoPi 6 series' [80]='Orange Pi 5' [81]='StarFive VisionFive 2' + [82]='Orange Pi 5 Plus' ) ## Benchmark data arrays: aBENCH_XX[$HW_MODEL,${aBENCH_XX_INDEX[$HW_MODEL]}] @@ -681,8 +682,14 @@ shopt -s extglob done aSOFTWARE_NAME8_20[211]='Homebridge' + aSOFTWARE_NAME8_21=() + for i in "${!aSOFTWARE_NAME8_20[@]}" + do + aSOFTWARE_NAME8_21[i]=${aSOFTWARE_NAME8_20[i]} + done + # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs - for i in "${aSOFTWARE_NAME8_20[@]}" + for i in "${aSOFTWARE_NAME8_21[@]}" do aSOFTWARE[$i]=0 done diff --git a/.update/patches b/.update/patches index aa891af01c..87e1d367ea 100755 --- a/.update/patches +++ b/.update/patches @@ -1423,6 +1423,34 @@ Patch_8_20() [[ -f '/etc/apt/apt.conf.d/dietpi-ffmpeg' ]] && G_EXEC rm /etc/apt/apt.conf.d/dietpi-ffmpeg } +Patch_8_21() +{ + # Remove obsolete sysctl config + [[ -f '/etc/sysctl.d/dietpi.conf' ]] && G_EXEC rm /etc/sysctl.d/dietpi.conf + + # Orange Pi 5: Update U-Boot to enable NVMe boot + if (( $G_HW_MODEL == 80 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-u-boot-orangepi5-legacy 2> /dev/null)" lt-nl 23.08.0 + then + G_DIETPI-NOTIFY 2 'Updating Orange Pi 5 U-Boot package ...' + G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/linux-u-boot-orangepi5-legacy.deb' + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb + G_EXEC rm package.deb + fi + + # Orange Pi 5/ROCK 5B: Update kernel to Linux 5.10.160 as Armbian didn't update their repos for half a year. The "legacy-rockchip-rk3588" and "legacy-rk35xx" kernel families have been merged below the second name: https://github.com/armbian/build/pull/5362 + if [[ $G_HW_MODEL =~ ^(78|80)$ ]] && { dpkg-query -s 'linux-image-legacy-rockchip-rk3588' &> /dev/null || dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-legacy-rk35xx 2> /dev/null)" lt-nl 23.08.0; } + then + G_DIETPI-NOTIFY 2 'Updating RK3588 kernel package ...' + G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/linux-image-legacy-rk35xx.deb' + G_EXEC curl -sSfo package2.deb 'https://dietpi.com/downloads/binaries/linux-dtb-legacy-rk35xx.deb' + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb package2.deb + G_EXEC rm package.deb package2.deb + (( $G_HW_MODEL == 80 )) && G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3588' /boot/dietpiEnv.txt && G_CONFIG_INJECT 'fdtfile=' 'fdtfile=' /boot/dietpiEnv.txt + dpkg-query -s 'linux-image-legacy-rockchip-rk3588' &> /dev/null && G_EXEC apt-mark auto linux-image-legacy-rockchip-rk3588 + dpkg-query -s 'linux-dtb-legacy-rockchip-rk3588' &> /dev/null && G_EXEC apt-mark auto linux-dtb-legacy-rockchip-rk3588 + fi +} + # v6.35 => v7 migration if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 )) then diff --git a/.update/version b/.update/version index 0f65dc1891..25bd0ba512 100644 --- a/.update/version +++ b/.update/version @@ -2,8 +2,8 @@ # shellcheck disable=SC2034 # Available DietPi version G_REMOTE_VERSION_CORE=8 -G_REMOTE_VERSION_SUB=20 -G_REMOTE_VERSION_RC=1 +G_REMOTE_VERSION_SUB=21 +G_REMOTE_VERSION_RC=0 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=14 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a06520dc88..67e4e8218c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,28 @@ +v8.21 +(2023-08-26) + +New images: +- Orange Pi 5 Plus | Support for the Orange Pi 5 Plus SBC has been added to DietPi with hardware ID 82. Images will be provided on our download page: https://dietpi.com/#download + +Enhancements: +- Orange Pi 5/ROCK 5B | An update of the kernel to Linux 5.10.160 will be applied automatically as part of the DietPi update. +- DietPi-Config | When applying WiFi hotspot settings, manually changed IP addresses in /etc/network/interfaces will now be preserved. +- DietPi-Config | WiFi Hotspot: Toggles for enabling 802.11n/WiFi 4, 802.11ac/WiFi 5 and 5 GHz WiFi respectively have been added to the menu. +- DietPi-Software | WiFi Hotspot: We added new dietpi.txt settings "SOFTWARE_WIFI_HOTSPOT_WIFI4", "SOFTWARE_WIFI_HOTSPOT_WIFI5" and "SOFTWARE_WIFI_HOTSPOT_5G" to have 802.11n/WiFi 4, 802.11ac/WiFi 5 and 5 GHz support respectively enabled on install. + +Bug fixes: +- DietPi-Globals | G_GET_NET: Resolved an issue where the default route was not detected correctly if learned via OPSF or other routing protocols which change the output field numbers of the "ip route" command. Many thanks to @owendelong for reporting this issue: https://github.com/MichaIng/DietPi/issues/6561 +- DietPi-Installer | Resolved an issue where building images for ARMv7 hardware was not possible on a ARMv8 host. Offered/accepted ARM hardware IDs are now based on the userland/OS architecture of the image instead of the CPU/kernel architecture returned via "uname -m". Many thanks to @dirkhh for reporting this issue: https://github.com/MichaIng/DietPi/discussions/6541 +- DietPi-Set_swapfile | Resolved an issue on Bookworm systems where zram swap space was not enabled automatically on boot due to missing syscall permissions, and the swappiness was not changed as intended. Many thanks to @magicfoxt-magicfox for reporting this issue: https://github.com/MichaIng/DietPi/issues/6511 +- DietPi-LetsEncrypt | Resolved a v8.20 regression where Lighttpd did not start after applying or renewing the certificate due to a syntax error. Many thanks to @JappeHallunken for fixing this issue: https://github.com/MichaIng/DietPi/pull/6517 +- DietPi-Config | Resolved an issue where /etc/network/interfaces was created with missing key values if lines were previously manually removed. Defaults are now applied in this case. Many thanks to @huettenwirt for reporting this issue: https://dietpi.com/forum/t/ifup-error-due-to-faulty-etc-network-interfaces/17605 +- DietPi-Config | Resolved an issue where the DHCP server failed to start after applying WiFi hotspot settings. +- DietPi-Software | TasmoAdmin: Resolved an issue on Bookworm systems with Nginx and Lighttpd webserver where login and logout did not work anymore as the rewrite directives pointed to a file which does not exist anymore since TasmoAdmin v3. Many thanks to @TBirth for reporting this issue: https://dietpi.com/forum/t/tasmoadmin-not-found-after-visiting-login-page/17632 + +As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/XXXX + +----------------------------------------------------------------------------------------------------------- + v8.20 (2023-07-29) @@ -20,7 +45,7 @@ Bug fixes: - DietPi-Dashboard | Resolved an issue where an attacker could have caused a Denial-of-Service via parallel unanswered TLS handshakes (CVE-2023-38505). The update to the dashboard v0.6.2, which solves the issue, will be applied automatically as part of the DietPi update: https://github.com/ravenclaw900/DietPi-Dashboard/security/advisories/GHSA-3jr4-9rxf-fr44 - DietPi-LetsEncrypt | Resolved a DietPi v8.19 regression where applying the HTTPS certificate for Lighttpd fails. Many thanks to @midniteca for reporting this issue: https://github.com/MichaIng/DietPi/issues/6460 - DietPi-Config | Resolved an issue where enabling Bluetooth on SBCs with Armbian firmware failed, because of a conflict between armbian-firmware and bluez-firmware packages. bluez-firmware will not be tried to be installed anymore if armbian-firmware is. Many thanks to @innovodev for reporting this issue: https://dietpi.com/forum/t/upgrading-dietpi-from-bullseye-to-bookworm/15963/16 -- DietPi-Software | Lighttpd: Resolved a DietPi v8.19 regression where the installation of Pi-hole, ownCloud, Nextcloud, Pydio and WikiMedia failed if Lighttpd was selected as webserver and HTTPS not yet enabled via dietpi-letsencrypt. Many thanks to @bruno-briner for reporting this issue: https://github.com/MichaIng/DietPi/issues/6455 +- DietPi-Software | Lighttpd: Resolved a DietPi v8.19 regression where the installation of Pi-hole, ownCloud, Nextcloud, Pydio and MediaWiki failed if Lighttpd was selected as webserver and HTTPS not yet enabled via dietpi-letsencrypt. Many thanks to @bruno-briner for reporting this issue: https://github.com/MichaIng/DietPi/issues/6455 - DietPi-Software | PaperMC: Resolved an issue where the install failed when selecting the Geyser and Floodgate plugins, as the download URL changed. Many thanks to @NatureHog for reporting and fixing this issue: https://github.com/MichaIng/DietPi/issues/6471 - DietPi-Software | vaultwarden: Worked around an issue where since Bookworm the service could have failed to start if DietPi userdata were moved to an external drive. The update, which includes a bump to latest vaultwarden v1.29.1 and web vault v2023.5.0 will be applied automatically as part of the DietPi update. Many thanks to @huidbui25 for reporting this issue: https://dietpi.com/forum/t/automount-option-in-fstab-prevents-automatically-mounting-a-partition-in-due-time-on-bookworm/17463 diff --git a/dietpi.txt b/dietpi.txt index 97fe651022..2e573dfa17 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -256,7 +256,16 @@ SOFTWARE_NEXTCLOUD_DATADIR=/mnt/dietpi_userdata/nextcloud_data SOFTWARE_WIFI_HOTSPOT_SSID=DietPi-HotSpot # - Key requires a minimum of 8 characters SOFTWARE_WIFI_HOTSPOT_KEY=dietpihotspot +# - 2.4 GHz WiFi channel, not effective if 5 GHz frequency is enabled SOFTWARE_WIFI_HOTSPOT_CHANNEL=3 +# - 802.11n/WiFi 4, 802.11ac/WiFi 5 and 5 GHz support: Note that your WiFi adapter must support it! +# - WiFi 5 support implicitly switches to 5 GHz frequency. +# - 5 GHz frequency implicitly enables WiFi 4 support if neither WiFi 4 nor 5 is enabled. +SOFTWARE_WIFI_HOTSPOT_WIFI4=0 +SOFTWARE_WIFI_HOTSPOT_WIFI5=0 +SOFTWARE_WIFI_HOTSPOT_5G=0 +# - A full list of supported 5 GHz WiFi channels per region can be found e.g. on Wikipedia: https://en.wikipedia.org/wiki/List_of_WLAN_channels#5_GHz_(802.11a/h/n/ac/ax) +SOFTWARE_WIFI_HOTSPOT_5G_CHANNEL=36 # X.org # - DPI 96(default) 120(+25%) 144(+50%) 168(+75%) 192(+100%) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index fcdba237f3..1d524f75b4 100755 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -244,7 +244,7 @@ However, this check is a rough estimation in reasonable time, thus it could be m UUID_ROOT=$(findmnt -Ufnro UUID -M /) PARTUUID_ROOT=$(findmnt -Ufnro PARTUUID -M /) - # If the current rootfs' UUID or PARTUUID can be found in the the backups fstab, it can be assumed that it was created from the same drives. + # If the current rootfs' UUID or PARTUUID can be found in the backups fstab, it can be assumed that it was created from the same drives. grep -q "^UUID=${UUID_ROOT}[[:blank:]]" "$FP_TARGET/$DATA/etc/fstab" || grep -q "^PARTUUID=${PARTUUID_ROOT}[[:blank:]]" "$FP_TARGET/$DATA/etc/fstab" && return 0 UPDATE_UUIDs=1 @@ -316,7 +316,7 @@ However, this check is a rough estimation in reasonable time, thus it could be m # - x86_64 if (( $UPDATE_GRUB == 1 )) then - G_EXEC update-grub + G_EXEC_OUTPUT=1 G_EXEC update-grub command -v update-tirfs > /dev/null && G_EXEC update-tirfs && return command -v dracut > /dev/null && G_EXEC dracut --force && return command -v update-initramfs > /dev/null && G_EXEC update-initramfs -u diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 676151d6f1..d5267d5be5 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1805,9 +1805,9 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will [[ -f /sys/class/net/$input/statistics/rx_bytes && -f /sys/class/net/$input/statistics/tx_bytes ]] || return - NET_RX_BYTE=$(<"/sys/class/net/$input/statistics/rx_bytes") + read -r NET_RX_BYTE < "/sys/class/net/$input/statistics/rx_bytes" disable_error=1 G_CHECK_VALIDINT "$NET_RX_BYTE" 1 && NET_RX_MB="$(( $NET_RX_BYTE / 1024 / 1024 )) MiB" - NET_TX_BYTE=$(<"/sys/class/net/$input/statistics/tx_bytes") + read -r NET_TX_BYTE < "/sys/class/net/$input/statistics/tx_bytes" disable_error=1 G_CHECK_VALIDINT "$NET_TX_BYTE" 1 && NET_TX_MB="$(( $NET_TX_BYTE / 1024 / 1024 )) MiB" } @@ -1872,10 +1872,7 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will Network_Restart() { # Stop WiFi hotspot - local aservices=() - systemctl -q is-active hostapd && aservices+=('hostapd') - systemctl -q is-active isc-dhcp-server && aservices+=('isc-dhcp-server') - [[ ${aservices[0]} ]] && G_EXEC systemctl stop "${aservices[@]}" + (( $WIFI_HOTSPOT )) && G_EXEC systemctl stop isc-dhcp-server hostapd # Enable/Disable WiFi modules /boot/dietpi/func/dietpi-set_hardware wifimodules $(( ! $WIFI_DISABLED )) @@ -1898,10 +1895,13 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will # Manually bring up adapters (( $ETH_DISABLED )) || ifup --force "$ETH_DEV_IFACE" - (( $WIFI_DISABLED )) || ! grep -q '^network=' /etc/wpa_supplicant/wpa_supplicant.conf || ifup --force "$WIFI_DEV_IFACE" + if (( ! $WIFI_DISABLED )) + then + (( $WIFI_HOTSPOT )) || grep -q '^network=' /etc/wpa_supplicant/wpa_supplicant.conf && ifup --force "$WIFI_DEV_IFACE" + fi # Start WiFi hotspot - [[ ${aservices[0]} ]] && G_EXEC systemctl start "${aservices[@]}" + (( $WIFI_HOTSPOT )) && G_EXEC systemctl start hostapd isc-dhcp-server # Add a little delay to ensure all network device data are updated (eg: SSID current takes a little longer) G_DIETPI-NOTIFY 2 'Reloading networking data, please wait...' @@ -1983,8 +1983,8 @@ _EOF_ cat << _EOF_ >> /etc/network/interfaces iface $WIFI_DEV_IFACE inet static -address 192.168.42.1 -netmask 255.255.255.0 +address $WIFI_IP_STATIC +netmask $WIFI_MASK_STATIC #gateway 192.168.0.1 #dns-nameservers 9.9.9.9 149.112.112.112 pre-up iw dev $WIFI_DEV_IFACE set power_save off @@ -2161,10 +2161,14 @@ NB: All Ethernet connections will be temporarily dropped!' && Network_ApplyChang { # Reset ETH_IP_STATIC=$(mawk '$1=="address"{print $2;exit}' /etc/network/interfaces) + [[ $ETH_IP_STATIC ]] || ETH_IP_STATIC='192.168.0.100' ETH_GATEWAY_STATIC=$(mawk '$1=="gateway"{print $2;exit}' /etc/network/interfaces) + [[ $ETH_GATEWAY_STATIC ]] || ETH_GATEWAY_STATIC='192.168.0.1' ETH_MASK_STATIC=$(mawk '$1=="netmask"{print $2;exit}' /etc/network/interfaces) + [[ $ETH_MASK_STATIC ]] || ETH_MASK_STATIC='255.255.255.0' ETH_DNS_STATIC=$(mawk '$1=="dns-nameservers"{print $2,$3;exit}' /etc/network/interfaces) [[ $ETH_DNS_STATIC ]] || ETH_DNS_STATIC=$(mawk '$1=="nameserver"{print $2}' ORS=' ' /etc/resolv.conf) + [[ $ETH_DNS_STATIC ]] || ETH_DNS_STATIC='9.9.9.9 149.112.112.112' # Remove trailing space in case of single nameserver, due to mawk '{print $2,$3}' respectively ORS=' ' ETH_DNS_STATIC=${ETH_DNS_STATIC%[[:blank:]]} ETH_DEV_IFACE=$(G_GET_NET -q -t eth iface) || ETH_DEV_IFACE='eth0' @@ -2178,10 +2182,14 @@ NB: All Ethernet connections will be temporarily dropped!' && Network_ApplyChang ETH_MODE_TARGET=$ETH_MODE WIFI_IP_STATIC=$(mawk '$1=="address"{print $2}' /etc/network/interfaces | mawk 'NR==2') + [[ $WIFI_IP_STATIC ]] || WIFI_IP_STATIC='192.168.0.100' WIFI_GATEWAY_STATIC=$(mawk '$1=="gateway"{print $2}' /etc/network/interfaces | mawk 'NR==2') + [[ $WIFI_GATEWAY_STATIC ]] || WIFI_GATEWAY_STATIC='192.168.0.1' WIFI_MASK_STATIC=$(mawk '$1=="netmask"{print $2}' /etc/network/interfaces | mawk 'NR==2') + [[ $WIFI_MASK_STATIC ]] || WIFI_MASK_STATIC='255.255.255.0' WIFI_DNS_STATIC=$(mawk '$1=="dns-nameservers"{print $2,$3}' /etc/network/interfaces | mawk 'NR==2') [[ $WIFI_DNS_STATIC ]] || WIFI_DNS_STATIC=$(mawk '$1=="nameserver"{print $2}' ORS=' ' /etc/resolv.conf) + [[ $WIFI_DNS_STATIC ]] || WIFI_DNS_STATIC='9.9.9.9 149.112.112.112' # Remove trailing space in case of single nameserver, due to mawk '{print $2,$3}' respectively ORS=' ' WIFI_DNS_STATIC=${WIFI_DNS_STATIC%[[:blank:]]} WIFI_DEV_IFACE=$(G_GET_NET -q -t wlan iface) || WIFI_DEV_IFACE='wlan0' @@ -2562,12 +2570,12 @@ This is mainly aimed at PINE A64 which may have a hardware issue that causes uns } HOTSPOT_SSID= - HOTSPOT_CHANNEL= HOTSPOT_KEY= - - WiFi_Monitor_Disable(){ G_EXEC systemctl disable --now dietpi-wifi-monitor; } - - WiFi_Monitor_Enable(){ G_EXEC systemctl enable --now dietpi-wifi-monitor; } + HOTSPOT_CHANNEL= + HOTSPOT_WIFI4=0 + HOTSPOT_WIFI5=0 + HOTSPOT_5G=0 + HOTSPOT_5G_CHANNEL= # TARGETMENUID=10 Menu_NetworkAdapters_Wifi() @@ -2578,86 +2586,81 @@ This is mainly aimed at PINE A64 which may have a hardware issue that causes uns G_WHIP_MENU_ARRAY=('' '●─ Basic Options ') - # WiFi Hotspot Menu - if (( $WIFI_HOTSPOT )); then - - # Load current details into global vars, once. - if [[ ! $HOTSPOT_SSID ]]; then + # WiFi Hotspot menu + if (( $WIFI_HOTSPOT )) + then + # Status and toggle + local hotspot_active_state=0 hotspot_active_state_text='[Off] | Select to turn on hotspot' + systemctl -q is-active hostapd && hotspot_active_state=1 hotspot_active_state_text='[On] | Select to turn off hotspot' description_text+='Status : Online' || description_text+='Status : Offline' + # Load details into global vars, once + if [[ ! $HOTSPOT_SSID ]] + then HOTSPOT_SSID=$(sed -n '/^[[:blank:]]*ssid=/{s/^[^=]*=//p;q}' /etc/hostapd/hostapd.conf) - HOTSPOT_CHANNEL=$(sed -n '/^[[:blank:]]*channel=/{s/^[^=]*=//p;q}' /etc/hostapd/hostapd.conf) HOTSPOT_KEY=$(sed -n '/^[[:blank:]]*wpa_passphrase=/{s/^[^=]*=//p;q}' /etc/hostapd/hostapd.conf) - + HOTSPOT_WIFI4=$(grep -cm1 '^[[:blank:]]*ieee80211n=1$' /etc/hostapd/hostapd.conf) + HOTSPOT_WIFI5=$(grep -cm1 '^[[:blank:]]*ieee80211ac=1$' /etc/hostapd/hostapd.conf) + HOTSPOT_5G=$(grep -cm1 '^[[:blank:]]*hw_mode=a$' /etc/hostapd/hostapd.conf) + if (( $HOTSPOT_5G )) + then + HOTSPOT_5G_CHANNEL=$(sed -n '/^[[:blank:]]*channel=/{s/^[^=]*=//p;q}' /etc/hostapd/hostapd.conf) + else + HOTSPOT_CHANNEL=$(sed -n '/^[[:blank:]]*channel=/{s/^[^=]*=//p;q}' /etc/hostapd/hostapd.conf) + fi fi - # N enabled? - local hotspot_n_enabled=0 - local hotspot_n_text='Disabled' - if grep -q '^ieee80211n=1' /etc/hostapd/hostapd.conf; then - - hotspot_n_enabled=1 - hotspot_n_text='Enabled' - + # WiFi 4 and WiFi 5 support status text + local hotspot_n_text='Off' hotspot_ac_text='Off' hotspot_freq_text='2.4' hotspot_channel_text + (( $HOTSPOT_WIFI4 )) && hotspot_n_text='On' + (( $HOTSPOT_WIFI5 )) && hotspot_ac_text='On' + if (( $HOTSPOT_5G )) + then + hotspot_freq_text='5' + [[ $HOTSPOT_5G_CHANNEL ]] || HOTSPOT_5G_CHANNEL=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_5G_CHANNEL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + [[ $HOTSPOT_5G_CHANNEL ]] || HOTSPOT_5G_CHANNEL=36 + hotspot_channel_text=$HOTSPOT_5G_CHANNEL + else + [[ $HOTSPOT_CHANNEL ]] || HOTSPOT_CHANNEL=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_CHANNEL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + [[ $HOTSPOT_CHANNEL ]] || HOTSPOT_CHANNEL=3 + hotspot_channel_text=$HOTSPOT_CHANNEL fi - # Toggle - local hotspot_active_state=$(systemctl is-active hostapd | grep -cim1 '^active' ) - local hotspot_status_text='Status : Offline' - local hotspot_active_state_text='[Disabled] | Select to turn on hotspot' - if (( $hotspot_active_state )); then - - hotspot_status_text+='Status : Online' - hotspot_active_state_text='[Enabled] | Select to turn off hotspot' - - fi + G_WHIP_MENU_ARRAY+=( + 'SSID' ": [$HOTSPOT_SSID]" + 'Key' ": [$HOTSPOT_KEY]" + 'Channel' ": [$hotspot_channel_text]" + '802.11n' ": [$hotspot_n_text] WiFi 4 support" + '802.11ac' ": [$hotspot_ac_text] WiFi 5 support" + 'Frequency' ": [$hotspot_freq_text GHz]" + ) - G_WHIP_MENU_ARRAY+=('SSID' ": [$HOTSPOT_SSID]") - G_WHIP_MENU_ARRAY+=('Channel' ": [$HOTSPOT_CHANNEL]") - G_WHIP_MENU_ARRAY+=('Key' ": [$HOTSPOT_KEY]") - G_WHIP_MENU_ARRAY+=('802.11 N' ": [$hotspot_n_text]") + # WiFi menu + else + description_text+="SSID : $WIFI_SSID_CURRENT | $WIFI_BITRATE Mbit | Strength: $WIFI_SIGNALSTRENGTH\nAddress : IP = $WIFI_IP | Mask = $WIFI_MASK | Gateway = $WIFI_GATEWAY | DNS = $DNS_CURRENT" - description_text+=$hotspot_status_text + G_WHIP_MENU_ARRAY+=('Scan' ': Scan and configure SSID') - # WiFi Menu - else + # Auto Reconnect / WiFi monitor + local wifi_auto_reconnect_text='Off' + systemctl -q is-active dietpi-wifi-monitor && WIFI_AUTO_RECONNECT_ACTIVE=1 wifi_auto_reconnect_text='On' || WIFI_AUTO_RECONNECT_ACTIVE=0 + (( $WIFI_CONNECTED || $WIFI_AUTO_RECONNECT_ACTIVE )) && G_WHIP_MENU_ARRAY+=('Auto Reconnect' ": [$wifi_auto_reconnect_text]") # Mode local mode_text='DHCP' (( $WIFI_MODE_TARGET )) || mode_text='STATIC' - - G_WHIP_MENU_ARRAY+=('Scan' ': Scan and configure SSID') - - if (( $WIFI_CONNECTED )) || systemctl -q is-active dietpi-wifi-monitor; then - - local wifi_auto_reconnect_text='Off' - WIFI_AUTO_RECONNECT_ACTIVE=0 - if systemctl -q is-active dietpi-wifi-monitor; then - - WIFI_AUTO_RECONNECT_ACTIVE=1 - wifi_auto_reconnect_text='On' - - fi - - G_WHIP_MENU_ARRAY+=('Auto Reconnect' ": [$wifi_auto_reconnect_text]") - - fi - - G_WHIP_MENU_ARRAY+=('' '●─ DHCP/STATIC IP ') - G_WHIP_MENU_ARRAY+=('Change Mode' ": [$mode_text]") + G_WHIP_MENU_ARRAY+=( + '' '●─ DHCP/STATIC IP ' + 'Change Mode' ": [$mode_text]" + ) # Show static options - if (( $WIFI_MODE_TARGET == 0 )); then - - G_WHIP_MENU_ARRAY+=('Copy' ': Copy current address to "Static"') - G_WHIP_MENU_ARRAY+=('Static IP' ": [$WIFI_IP_STATIC]") - G_WHIP_MENU_ARRAY+=('Static Mask' ": [$WIFI_MASK_STATIC]") - G_WHIP_MENU_ARRAY+=('Static Gateway' ": [$WIFI_GATEWAY_STATIC]") - G_WHIP_MENU_ARRAY+=('Static DNS' ": [$WIFI_DNS_STATIC]") - - fi - - description_text+="SSID : $WIFI_SSID_CURRENT | $WIFI_BITRATE Mbit | Strength: $WIFI_SIGNALSTRENGTH\nAddress : IP = $WIFI_IP | Mask = $WIFI_MASK | Gateway = $WIFI_GATEWAY | DNS = $DNS_CURRENT" - + (( $WIFI_MODE_TARGET == 0 )) && G_WHIP_MENU_ARRAY+=( + 'Copy' ': Copy current address to "Static"' + 'Static IP' ": [$WIFI_IP_STATIC]" + 'Static Mask' ": [$WIFI_MASK_STATIC]" + 'Static Gateway' ": [$WIFI_GATEWAY_STATIC]" + 'Static DNS' ": [$WIFI_DNS_STATIC]" + ) fi # Country code @@ -2677,8 +2680,10 @@ This is mainly aimed at PINE A64 which may have a hardware issue that causes uns G_WHIP_MENU_ARRAY+=('Disable' ': Disable WiFi adapter') fi - G_WHIP_MENU_ARRAY+=('' '●─ Apply ') - G_WHIP_MENU_ARRAY+=('Apply' ': Save all changes and restart networking') + G_WHIP_MENU_ARRAY+=( + '' '●─ Apply ' + 'Apply' ': Save all changes and restart networking' + ) G_WHIP_DEFAULT_ITEM=$WHIP_SELECTION_PREVIOUS G_WHIP_MENU "$description_text" || { Back_or_Exit 8; return 0; } # Network Options: Adapters @@ -2689,48 +2694,68 @@ This is mainly aimed at PINE A64 which may have a hardware issue that causes uns 'Auto Reconnect') - if (( $WIFI_AUTO_RECONNECT_ACTIVE )); then - - WiFi_Monitor_Disable - + if (( $WIFI_AUTO_RECONNECT_ACTIVE )) + then + G_EXEC systemctl disable --now dietpi-wifi-monitor else - - WiFi_Monitor_Enable - + G_EXEC systemctl enable --now dietpi-wifi-monitor fi ;; 'Key') G_WHIP_DEFAULT_ITEM=$HOTSPOT_KEY - G_WHIP_INPUTBOX 'Please enter a key/password for the WiFi hotspot\n - NB: Minimum of 8 characters' && HOTSPOT_KEY=$G_WHIP_RETURNED_VALUE + G_WHIP_INPUTBOX 'Please enter a key/password with a minimum of 8 characters for your WiFi hotspot:' && HOTSPOT_KEY=$G_WHIP_RETURNED_VALUE ;; 'SSID') G_WHIP_DEFAULT_ITEM=$HOTSPOT_SSID - G_WHIP_INPUTBOX 'Please enter a SSID for the WiFi hotspot' && HOTSPOT_SSID=$G_WHIP_RETURNED_VALUE + G_WHIP_INPUTBOX 'Please enter an SSID for your WiFi hotspot:' && HOTSPOT_SSID=$G_WHIP_RETURNED_VALUE ;; 'Channel') - # 2.4ghz only atm - local channel_mhz=2412 channel_min=1 channel_max=13 - G_WHIP_MENU_ARRAY=() - for ((i=$channel_min; i<=$channel_max; i++)) - do - G_WHIP_MENU_ARRAY+=("$i" ": $channel_mhz MHz") - ((channel_mhz+=5)) - done + if (( $HOTSPOT_5G )) + then + G_WHIP_DEFAULT_ITEM=$HOTSPOT_5G_CHANNEL + G_WHIP_MENU 'Please enter a 5 GHz WiFi channel for your hotspot. +\nA full list of supported 5 GHz WiFi channels per region can be found e.g. on Wikipedia: https://en.wikipedia.org/wiki/List_of_WLAN_channels#5_GHz_(802.11a/h/n/ac/ax)' && HOTSPOT_5G_CHANNEL=$G_WHIP_RETURNED_VALUE + else + local channel_mhz=2412 channel_min=1 channel_max=13 + G_WHIP_MENU_ARRAY=() + for ((i=$channel_min; i<=$channel_max; i++)) + do + G_WHIP_MENU_ARRAY+=("$i" ": $channel_mhz MHz") + ((channel_mhz+=5)) + done - G_WHIP_DEFAULT_ITEM=$HOTSPOT_CHANNEL - G_WHIP_MENU 'Please select a WiFi channel for the hotspot.' && HOTSPOT_CHANNEL=$G_WHIP_RETURNED_VALUE + G_WHIP_DEFAULT_ITEM=$HOTSPOT_CHANNEL + G_WHIP_MENU 'Please select a 2.4 GHz WiFi channel for your hotspot:' && HOTSPOT_CHANNEL=$G_WHIP_RETURNED_VALUE + fi ;; - '802.11 N') + '802.11n') - (( $hotspot_n_enabled )) && hotspot_n_enabled=0 || hotspot_n_enabled=1 - G_CONFIG_INJECT 'ieee80211n=' "ieee80211n=$hotspot_n_enabled" /etc/hostapd/hostapd.conf + HOTSPOT_WIFI4=$(( ! $HOTSPOT_WIFI4 )) + # 5 GHz requires at least WiFi 4 + (( $HOTSPOT_WIFI4 || $HOTSPOT_WIFI5 )) || HOTSPOT_5G=0 + ;; + + '802.11ac') + + HOTSPOT_WIFI5=$(( ! $HOTSPOT_WIFI5 )) + # WiFi 5 implies 5 GHz + (( $HOTSPOT_WIFI5 )) && HOTSPOT_5G=1 + # 5 GHz requires at least WiFi 4 + (( $HOTSPOT_WIFI4 || $HOTSPOT_WIFI5 )) || HOTSPOT_5G=0 + ;; + + 'Frequency') + + HOTSPOT_5G=$(( ! $HOTSPOT_5G )) + # 5 GHz requires at least WiFi 4 + (( $HOTSPOT_5G && ! $HOTSPOT_WIFI5 )) && HOTSPOT_WIFI4=1 ;; 'Country') Change_WifiCountryCode;; @@ -2739,7 +2764,7 @@ This is mainly aimed at PINE A64 which may have a hardware issue that causes uns G_WHIP_YESNO 'Would you like to disable the WiFi adapter?\n - (NOTICE) All WiFi connections will be dropped.' || return WIFI_DISABLED=1 - WiFi_Monitor_Disable + G_EXEC systemctl disable --now dietpi-wifi-monitor Network_ApplyChanges Back_or_Exit 8 # Network Options: Adapters ;; @@ -2758,13 +2783,32 @@ This is mainly aimed at PINE A64 which may have a hardware issue that causes uns then # Update dietpi.txt G_CONFIG_INJECT 'SOFTWARE_WIFI_HOTSPOT_SSID=' "SOFTWARE_WIFI_HOTSPOT_SSID=$HOTSPOT_SSID" /boot/dietpi.txt + GCI_PASSWORD=1 G_CONFIG_INJECT 'SOFTWARE_WIFI_HOTSPOT_KEY=' "SOFTWARE_WIFI_HOTSPOT_KEY=$HOTSPOT_KEY" /boot/dietpi.txt G_CONFIG_INJECT 'SOFTWARE_WIFI_HOTSPOT_CHANNEL=' "SOFTWARE_WIFI_HOTSPOT_CHANNEL=$HOTSPOT_CHANNEL" /boot/dietpi.txt - G_CONFIG_INJECT 'SOFTWARE_WIFI_HOTSPOT_KEY=' "SOFTWARE_WIFI_HOTSPOT_KEY=$HOTSPOT_KEY" /boot/dietpi.txt + G_CONFIG_INJECT 'SOFTWARE_WIFI_HOTSPOT_WIFI4=' "SOFTWARE_WIFI_HOTSPOT_WIFI4=$HOTSPOT_WIFI4" /boot/dietpi.txt + G_CONFIG_INJECT 'SOFTWARE_WIFI_HOTSPOT_WIFI5=' "SOFTWARE_WIFI_HOTSPOT_WIFI5=$HOTSPOT_WIFI5" /boot/dietpi.txt + G_CONFIG_INJECT 'SOFTWARE_WIFI_HOTSPOT_5G=' "SOFTWARE_WIFI_HOTSPOT_5G=$HOTSPOT_5G" /boot/dietpi.txt + G_CONFIG_INJECT 'SOFTWARE_WIFI_HOTSPOT_5G_CHANNEL=' "SOFTWARE_WIFI_HOTSPOT_5G_CHANNEL=$HOTSPOT_5G_CHANNEL" /boot/dietpi.txt # Update hostapd.conf G_CONFIG_INJECT 'ssid=' "ssid=$HOTSPOT_SSID" /etc/hostapd/hostapd.conf - G_CONFIG_INJECT 'channel=' "channel=$HOTSPOT_CHANNEL" /etc/hostapd/hostapd.conf G_CONFIG_INJECT 'wpa_passphrase=' "wpa_passphrase=$HOTSPOT_KEY" /etc/hostapd/hostapd.conf + G_CONFIG_INJECT 'ieee80211n=' "ieee80211n=$HOTSPOT_WIFI4" /etc/hostapd/hostapd.conf + G_CONFIG_INJECT 'ieee80211ac=' "ieee80211ac=$HOTSPOT_WIFI5" /etc/hostapd/hostapd.conf + if (( $HOTSPOT_WIFI4 || $HOTSPOT_WIFI5 )) + then + G_CONFIG_INJECT 'wmm_enabled=' 'wmm_enabled=1' /etc/hostapd/hostapd.conf + else + G_CONFIG_INJECT 'wmm_enabled=' 'wmm_enabled=0' /etc/hostapd/hostapd.conf + fi + if (( $HOTSPOT_5G )) + then + G_CONFIG_INJECT 'hw_mode=' 'hw_mode=a' /etc/hostapd/hostapd.conf + G_CONFIG_INJECT 'channel=' "channel=$HOTSPOT_5G_CHANNEL" /etc/hostapd/hostapd.conf + else + G_CONFIG_INJECT 'hw_mode=' 'hw_mode=g' /etc/hostapd/hostapd.conf + G_CONFIG_INJECT 'channel=' "channel=$HOTSPOT_CHANNEL" /etc/hostapd/hostapd.conf + fi # Apply/Restart network Network_ApplyChanges @@ -2794,7 +2838,6 @@ This is mainly aimed at PINE A64 which may have a hardware issue that causes uns ;; *) :;; - esac } diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 2a880a717c..46b42713dc 100755 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -131,8 +131,7 @@ server.modules += ( "mod_openssl" ) # Intermediate configuration, tweak to your needs ssl.openssl.ssl-conf-cmd = ( "MinProtocol" => "TLSv1.2", - "Options" => "-SessionTicket", - "Options" => "-ServerPreference", + "Options" => "-ServerPreference,-SessionTicket", "CipherString" => "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305" ) } @@ -149,8 +148,7 @@ server.modules += ( "mod_openssl" ) # Intermediate configuration, tweak to your needs ssl.openssl.ssl-conf-cmd = ( "MinProtocol" => "TLSv1.2", - "Options" => "-SessionTicket", - "Options" => "-ServerPreference", + "Options" => "-ServerPreference,-SessionTicket", "CipherString" => "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305" ) } @@ -159,7 +157,7 @@ _EOF_ if (( $G_DISTRO > 5 )) then G_AG_CHECK_INSTALL_PREREQ lighttpd-mod-openssl - G_EXEC sed -i 's/, "Options" => "-SessionTicket"//' /etc/lighttpd/conf-available/50-dietpi-https.conf + G_EXEC sed -i 's/,-SessionTicket//' /etc/lighttpd/conf-available/50-dietpi-https.conf fi [[ -f '/etc/lighttpd/conf-enabled/50-dietpi-https.conf' ]] || G_EXEC lighty-enable-mod dietpi-https diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9482f41103..69bbf3efe8 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -350,6 +350,8 @@ Available commands: aSOFTWARE_DEPS[$software_id]='128' # - RISC-V: No package: https://download.opensuse.org/repositories/home:/jcorporation/Debian_Unstable/ aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 + # - ARMv6 Bookworm/Trixie: No Bookworm or testing suite available and Bullseye package depends on libflac8 + (( $G_HW_ARCH == 1 && $G_DISTRO > 6 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,$G_DISTRO]=0 #------------------ software_id=119 aSOFTWARE_NAME[$software_id]='CAVA' @@ -868,15 +870,6 @@ Available commands: aSOFTWARE_DESC[$software_id]='Fast, efficient and secure command-line backup program' aSOFTWARE_CATX[$software_id]=4 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/cloud/#restic' - #------------------ - software_id=210 - aSOFTWARE_NAME[$software_id]='MediaWiki' - aSOFTWARE_DESC[$software_id]='A collaboration and documentation platform' - aSOFTWARE_CATX[$software_id]=4 - aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/cloud/#mediawiki' - aSOFTWARE_DEPS[$software_id]='88 89 webserver' - # - Buster: For MediaWiki, at least PHP 7.4.3 is required. https://www.mediawiki.org/wiki/Manual:Installation_requirements#PHP - aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 # Gaming & Emulation #-------------------------------------------------------------------------------- @@ -1050,6 +1043,15 @@ Available commands: aSOFTWARE_CATX[$software_id]=6 aSOFTWARE_DEPS[$software_id]='17' aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/social/#microblogpub' + #------------------ + software_id=210 + aSOFTWARE_NAME[$software_id]='MediaWiki' + aSOFTWARE_DESC[$software_id]='A collaboration and documentation platform' + aSOFTWARE_CATX[$software_id]=6 + aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/social/#mediawiki' + aSOFTWARE_DEPS[$software_id]='88 89 webserver' + # - Buster: For MediaWiki, at least PHP 7.4.3 is required: https://www.mediawiki.org/wiki/Manual:Installation_requirements#PHP + aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 # Camera & Surveillance #-------------------------------------------------------------------------------- @@ -3563,6 +3565,8 @@ _EOF_ if To_Install 85 nginx # Nginx then local apackages=('nginx-light') + # From Bookworm on, the "nginx" package does not include any extra modules while "nginx-light" pulls in "nginx" and additionall the "echo" module. + (( $G_DISTRO > 6 )) && apackages=('nginx') # Install Certbot module, if Certbot was already installed (( ${aSOFTWARE_INSTALL_STATE[92]} == 2 )) && apackages+=('python3-certbot-nginx') G_AGI "${apackages[@]}" @@ -5018,16 +5022,12 @@ The install script will now exit. After applying one of the the above, rerun die local distro='Debian_' (( $G_RASPBIAN )) && distro='Raspbian_' - if (( $G_DISTRO == 5 )) - then - distro+='10' - - elif [[ $G_DISTRO == 6 || $distro == 'Raspbian_' ]] # No Testing suite available for Raspbian, use Bullseye package on Raspbian Bookworm - then - distro+='11' - else - distro+='Testing' - fi + case $G_DISTRO in + 5) distro+='10';; + 6) distro+='11';; + 7) distro+='12';; + *) distro+='Testing';; + esac # APT key local url="https://download.opensuse.org/repositories/home:/jcorporation/$distro/Release.key" @@ -6580,7 +6580,7 @@ _EOF_ esac # Download - local fallback_url="https://github.com/fatedier/frp/releases/download/v0.51.2/frp_0.51.2_linux_$arch.tar.gz" + local fallback_url="https://github.com/fatedier/frp/releases/download/v0.51.3/frp_0.51.3_linux_$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/fatedier/frp/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/frp_[0-9.]*_linux_$arch\.tar\.gz\"/{print \$4}")" G_EXEC cd frp_* @@ -7500,7 +7500,7 @@ _EOF_ then Download_Install 'https://github.com/gotson/komga/releases/download/v0.165.0/komga-0.165.0.jar' /mnt/dietpi_userdata/komga/komga.jar else - local fallback_url='https://github.com/gotson/komga/releases/download/v1.2.1/komga-1.2.1.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/v1.3.1/komga-1.3.1.jar' Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/"browser_download_url": .*\/komga-[^"\/]*\.jar"/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar fi @@ -7927,29 +7927,62 @@ address 192.168.42.1 netmask 255.255.255.0 #gateway 192.168.0.1 #dns-nameservers 9.9.9.9 149.112.112.112 -wireless-power off +pre-up iw dev $wifi_iface set power_save off +post-down iw dev "$wifi_iface set power_save on # iptables NAT rules up iptables-restore < /etc/iptables.ipv4.nat up ip6tables-restore < /etc/iptables.ipv6.nat _EOF_ - # Assign static IP for wlan now - G_EXEC ip a add 192.168.42.1 dev "$wifi_iface" + # Remove wireless-power setting if not supported by adapter/firmware + # shellcheck disable=SC2015 + iw dev "$wifi_iface" set power_save on 2> /dev/null && iw dev "$wifi_iface" set power_save off 2> /dev/null || G_EXEC sed -i '/ iw dev .* set power_save /d' /etc/network/interfaces - # Create access point config + # Access point config + # - Parse dietpi.txt + local ssid=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_SSID=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + local key=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_KEY=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + local wifi4=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_WIFI4=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + local wifi5=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_WIFI5=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + local freq5=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_5G=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + # - Sanity checks + [[ $wifi4 == [01] ]] || wifi4=0 + [[ $wifi5 == [01] ]] || wifi5=0 + [[ $freq5 == [01] ]] || freq5=0 + # - WiFi 5 implies 5 GHz and 5 GHz requires at least WiFi 4 + (( $wifi5 )) && freq5=1 + (( $freq5 && ! $wifi5 )) && wifi4=1 + # - Enable WMM with QoS if WiFi 4 or 5 is enabled + local wmm_enabled=0 + (( $wifi4 || $wifi5 )) && wmm_enabled=1 + # - Apply mode channel based on frequency + local mode='g' + if (( $freq5 )) + then + mode='a' + local channel=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_5G_CHANNEL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + disable_error=1 G_CHECK_VALIDINT "$channel" 32 177 || channel=36 + else + local channel=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_CHANNEL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + disable_error=1 G_CHECK_VALIDINT "$channel" 1 13 || channel=3 + fi + # - Create config G_BACKUP_FP /etc/hostapd/hostapd.conf cat << _EOF_ > /etc/hostapd/hostapd.conf interface=$wifi_iface driver=nl80211 -ssid=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_SSID=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) +ssid=${ssid:-DietPi-HotSpot} country_code=00 -hw_mode=g -channel=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_CHANNEL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) +hw_mode=$mode +channel=$channel +ieee80211n=$wifi4 +ieee80211ac=$wifi5 +wmm_enabled=$wmm_enabled macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 -wpa_passphrase=$(sed -n '/^[[:blank:]]*SOFTWARE_WIFI_HOTSPOT_KEY=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) +wpa_passphrase=${key:-dietpihotspot} wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP @@ -7959,9 +7992,6 @@ _EOF_ # Set WiFi country code /boot/dietpi/func/dietpi-set_hardware wificountrycode - # RPi3/4 onboard WiFi: Enable Wi-Fi 4 support - [[ $G_HW_MODEL == [34] ]] && G_CONFIG_INJECT 'ieee80211n=' 'ieee80211n=1' /etc/hostapd/hostapd.conf - # Enable access point config G_EXEC eval 'echo '\''DAEMON_CONF="/etc/hostapd/hostapd.conf"'\'' > /etc/default/hostapd' @@ -7978,6 +8008,9 @@ _EOF_ # Save iptables rules, applied via /etc/network/interfaces iptables-save > /etc/iptables.ipv4.nat ip6tables-save > /etc/iptables.ipv6.nat + + # Bring up interface now + G_EXEC_NOHALT=1 G_EXEC ifup "$wifi_iface" fi if To_Install 61 tor # Tor Hotspot @@ -8626,7 +8659,7 @@ _EOF_ # Install ruTorrent: Web UI for rTorrent # - Grab current version local version=$(curl -sSfL 'https://api.github.com/repos/Novik/ruTorrent/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}') - [[ $version ]] || { version='v4.1.7'; G_DIETPI-NOTIFY 1 "Automatic latest ruTorrent version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + [[ $version ]] || { version='v4.2.2'; G_DIETPI-NOTIFY 1 "Automatic latest ruTorrent version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } Download_Install "https://github.com/Novik/ruTorrent/archive/$version.tar.gz" # - Reinstall freshly with preserved configs and 3rd party plugins @@ -9017,7 +9050,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.23.6/syncthing-linux-$arch-v1.23.6.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.23.7/syncthing-linux-$arch-v1.23.7.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/syncthing/syncthing/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/syncthing-linux-$arch-[^\"\/]*\.tar\.gz\"/{print \$4}")" G_EXEC mv syncthing-* /opt/syncthing fi @@ -9629,7 +9662,7 @@ _EOF_ # ARMv7 else local url=$(curl -sSfL 'https://api.github.com/repos/Radarr/Radarr/releases/latest' | mawk -F\" '/"browser_download_url": .*linux-core-arm\.tar\.gz"/{print $4}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v4.6.4.7568/Radarr.master.4.6.4.7568.linux-core-arm.tar.gz' + local fallback_url='https://github.com/Radarr/Radarr/releases/download/v4.7.5.7809/Radarr.master.4.7.5.7809.linux-core-arm.tar.gz' fi # ARMv8 @@ -9736,7 +9769,7 @@ _EOF_ # ARMv7 else local url=$(curl -sSfL 'https://api.github.com/repos/Lidarr/Lidarr/releases/latest' | mawk -F\" '/"browser_download_url": .*linux-core-arm\.tar\.gz"/{print $4}') - local fallback_url='https://github.com/Lidarr/Lidarr/releases/download/v1.2.6.3313/Lidarr.master.1.2.6.3313.linux-core-arm.tar.gz' + local fallback_url='https://github.com/Lidarr/Lidarr/releases/download/v1.3.5.3530/Lidarr.master.1.3.5.3530.linux-core-arm.tar.gz' fi # ARMv8 @@ -10170,7 +10203,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.2.4.1999/Readarr.develop.0.2.4.1999.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.3.2171/Readarr.develop.0.3.3.2171.linux-core-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Readarr/Readarr/releases' | mawk -F\" "/\"browser_download_url\": .*linux-core-$arch\.tar\.gz\"/{print \$4}" | head -1)" G_EXEC mv Readarr /opt/readarr fi @@ -11044,7 +11077,7 @@ _EOF_ # Download local version=$(curl -sSfL 'https://api.github.com/repos/ptitSeb/box86/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}') - [[ $version ]] || { version='v0.3.0'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + [[ $version ]] || { version='v0.3.2'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } Download_Install "https://github.com/ptitSeb/box86/archive/$version.tar.gz" # Build for targets: https://github.com/ptitSeb/box86/blob/master/CMakeLists.txt @@ -11089,7 +11122,7 @@ _EOF_ # Download local version=$(curl -sSfL 'https://api.github.com/repos/ptitSeb/box64/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}') - [[ $version ]] || { version='v0.2.2'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + [[ $version ]] || { version='v0.2.4'; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } Download_Install "https://github.com/ptitSeb/box64/archive/$version.tar.gz" # Build for targets: https://github.com/ptitSeb/box64/blob/main/CMakeLists.txt @@ -11119,9 +11152,9 @@ _EOF_ elif (( $G_HW_CPUID == 11 )) then G_EXEC cmake .. -DRK3588=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo - # - Others + # - Generic ARMv8 else - G_EXEC cmake .. -DARM_DYNAREC=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo + G_EXEC cmake .. -DARM64=1 -DNOGIT=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo fi G_EXEC_OUTPUT=1 G_EXEC make CFLAGS='-g0 -O3' "-j$(nproc)" G_EXEC strip --remove-section=.comment --remove-section=.note box64 @@ -11178,8 +11211,10 @@ _EOF_ if To_Install 27 # TasmoAdmin then - # Install required PHP modules - aDEPS=("php$PHP_VERSION-curl" "php$PHP_VERSION-zip") # https://github.com/reloxx13/TasmoAdmin#linux + # Install required PHP modules: https://github.com/TasmoAdmin/TasmoAdmin/wiki/Guide-for-Debian-Server-10-(Buster) + aDEPS=("php$PHP_VERSION-curl" "php$PHP_VERSION-zip") + (( $G_DISTRO > 5 )) && aDEPS+=("php$PHP_VERSION-mbstring" "php$PHP_VERSION-xml") + local adeps=("${aDEPS[@]#*-}") # Reinstall: Skip download and install, advice to use internal updater from web UI if [[ -d '/var/www/tasmoadmin' ]] @@ -11209,9 +11244,13 @@ _EOF_ fi # Webserver config + # - Config file Version + local version= + (( $G_DISTRO > 6 )) && version='.3' if (( ${aSOFTWARE_INSTALL_STATE[83]} > 0 )) then G_DIETPI-NOTIFY 2 'Apache webserver found, enabling TasmoAdmin specific configuration.' + G_EXEC a2enmod setenvif rewrite authz_core authn_core authn_file local tasmoadmin_conf='/etc/apache2/sites-available/dietpi-tasmoadmin.conf' if [[ -f $tasmoadmin_conf ]] then @@ -11219,8 +11258,7 @@ _EOF_ G_WHIP_MSG "Existing TasmoAdmin Apache configuration found, will preserve the old one and save the new one for review and comparison to: $tasmoadmin_conf" fi dps_index=$software_id Download_Install 'apache.tasmoadmin.conf' "$tasmoadmin_conf" - a2enmod setenvif rewrite authz_core authn_core authn_file 1> /dev/null - a2ensite dietpi-tasmoadmin 1> /dev/null + G_EXEC a2ensite dietpi-tasmoadmin elif (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )) then @@ -11231,7 +11269,7 @@ _EOF_ tasmoadmin_conf+='.dietpi-new' G_WHIP_MSG "Existing TasmoAdmin Lighttpd configuration found, will preserve the old one and save the new one for review and comparison to: $tasmoadmin_conf" fi - dps_index=$software_id Download_Install 'lighttpd.tasmoadmin.conf' "$tasmoadmin_conf" + dps_index=$software_id Download_Install "lighttpd.tasmoadmin$version.conf" "$tasmoadmin_conf" G_EXEC_POST_FUNC(){ [[ $exit_code == 2 ]] && exit_code=0; } # Do not fail if modules are enabled already G_EXEC lighty-enable-mod rewrite dietpi-tasmoadmin @@ -11244,8 +11282,11 @@ _EOF_ owncloud_conf+='.dietpi-new' G_WHIP_MSG "Existing TasmoAdmin Nginx configuration found, will preserve the old one and save the new one for review and comparison to: $tasmoadmin_conf" fi - dps_index=$software_id Download_Install 'nginx.tasmoadmin.conf' "$tasmoadmin_conf" + dps_index=$software_id Download_Install "nginx.tasmoadmin$version.conf" "$tasmoadmin_conf" fi + + # Enable required PHP modules + G_EXEC phpenmod "${adeps[@]}" fi if To_Install 206 openhab # openHAB @@ -11764,10 +11805,11 @@ _EOF_ 1) local arch='armv6';; 2) local arch='armv7';; 3) local arch='arm64';; + 11) local arch='riscv64';; *) local arch='amd64';; esac - local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.24.0/linux-$arch-filebrowser.tar.gz" + local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.24.2/linux-$arch-filebrowser.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/filebrowser/filebrowser/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/linux-$arch-filebrowser\.tar\.gz\"/{print \$4}")" ./filebrowser/ # Reinstall diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 30f87c61d4..2c82abc6a6 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -58,8 +58,8 @@ [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=8 - [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=20 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=21 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch @@ -982,7 +982,7 @@ Press any key to continue...' G_WHIP_DEFAULT_ITEM=${acommand[*]} if G_WHIP_INPUTBOX 'Please enter/alter the command to be executed. \nNB: Please only use this solution if you know for sure that it will not cause follow up issues from the originating script. It will e.g. allow you to continue a certain software install, but if you edit the download link, the originating script might expect files which are not present. -\nUse this work caution!'; then +\nUse this with caution!'; then G_DIETPI-NOTIFY 2 "Executing alternative command: ${G_WHIP_RETURNED_VALUE//\\/\\\\}" $G_WHIP_RETURNED_VALUE @@ -1289,8 +1289,8 @@ Press any key to continue...' if [[ $command == 'gateway' || ! $iface ]] then local gateway - [[ $fam != '-6' ]] && read -r gateway if < <(ip r l 0/0 ${iface:+dev "$iface"} | mawk '{print $3,$5;exit}') - [[ ! $gateway && $fam != '-4' ]] && read -r gateway if < <(ip -6 r l ::/0 ${iface:+dev "$iface"} | mawk '{print $3,$5;exit}') + [[ $fam != '-6' ]] && read -r gateway if < <(ip r l 0/0 ${iface:+dev "$iface"} | mawk '{for(i=0;i /etc/modules-load.d/dietpi-zram-swap.conf" || return 1 - G_EXEC_NOHALT=1 G_EXEC eval "echo 'SUBSYSTEM==\"block\", KERNEL==\"zram0\", ACTION==\"add\", ATTR{disksize}=\"${SWAP_SIZE}M\", RUN+=\"chmod 0600 /dev/zram0\", RUN+=\"/sbin/mkswap /dev/zram0\", RUN+=\"/sbin/swapon /dev/zram0\"' > /etc/udev/rules.d/98-dietpi-zram-swap.rules" || return 1 - G_EXEC_NOHALT=1 G_EXEC eval "echo 'swappiness=50' > /etc/sysctl.d/98-dietpi-zram-swap.conf" || return 1 + G_EXEC_NOHALT=1 G_EXEC eval 'echo '\''zram'\'' > /etc/modules-load.d/dietpi-zram-swap.conf' || return 1 + G_EXEC_NOHALT=1 G_EXEC eval "echo 'SUBSYSTEM==\"block\", KERNEL==\"zram0\", ACTION==\"add\", ATTR{disksize}==\"0\", ATTR{disksize}=\"${SWAP_SIZE}M\", RUN+=\"/bin/chmod 0600 /dev/zram0\", RUN+=\"/sbin/mkswap /dev/zram0\", RUN+=\"/sbin/swapon /dev/zram0\"' > /etc/udev/rules.d/98-dietpi-zram-swap.rules" || return 1 + G_EXEC_NOHALT=1 G_EXEC eval 'echo '\''vm.swappiness=50'\'' > /etc/sysctl.d/98-dietpi-zram-swap.conf' || return 1 + # Bookworm: Permit udev to run swapon: https://github.com/MichaIng/DietPi/issues/6511 + G_EXEC_NOHALT=1 G_EXEC mkdir -p /etc/systemd/system/systemd-udevd.service.d + G_EXEC_NOHALT=1 G_EXEC eval 'echo -e '\''[Service]\nSystemCallFilter=@swap'\'' > /etc/systemd/system/systemd-udevd.service.d/dietpi-zram.conf' return 0 # Swap file pre-allocation: Try faster and less write-intense fallocate first and dd as fallback diff --git a/rootfs/etc/sysctl.d/dietpi.conf b/rootfs/etc/sysctl.d/97-dietpi.conf similarity index 100% rename from rootfs/etc/sysctl.d/dietpi.conf rename to rootfs/etc/sysctl.d/97-dietpi.conf