From 2c44fa09df034f7abe5c596beada12474f8ecf30 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 10 Jun 2024 16:41:16 +0200 Subject: [PATCH 01/66] v9.6 - DietPi-Software | Ampache: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c723ca8201..4f5b75893e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7541,7 +7541,7 @@ _EOF_ local json=() [[ $PHP_VERSION == 8* ]] || aDEPS+=("php$PHP_VERSION-json") json=('json') - local fallback_url="https://github.com/ampache/ampache/releases/download/6.4.0/ampache-6.4.0_all_php$PHP_VERSION.zip" + local fallback_url="https://github.com/ampache/ampache/releases/download/6.5.0/ampache-6.5.0_all_php$PHP_VERSION.zip" Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/ampache-[0-9\.]*_all_php$PHP_VERSION.zip\"$/{print \$4}")" ampache # Reinstall: Preserve configs from old and new paths From a0264534245f964fec57cbfa1d1765889a7e866d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 10 Jun 2024 20:45:08 +0200 Subject: [PATCH 02/66] v9.5 - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 --- .build/images/Quartz64/quartz64_defconfig | 1 + CHANGELOG.txt | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/.build/images/Quartz64/quartz64_defconfig b/.build/images/Quartz64/quartz64_defconfig index adea7ecf51..76e8c5888c 100644 --- a/.build/images/Quartz64/quartz64_defconfig +++ b/.build/images/Quartz64/quartz64_defconfig @@ -209,6 +209,7 @@ CONFIG_ENERGY_MODEL=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y CONFIG_EXT4_FS_POSIX_ACL=y +CONFIG_EXT4_FS_SECURITY=y CONFIG_EXTCON_ADC_JACK=y CONFIG_EXTCON_GPIO=y CONFIG_EXTCON_USB_GPIO=y diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 398da0455d..dcc08c4a8f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,16 @@ +v9.6 +(2024-07-06) + +Enhancements: +- Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 + +Bug fixes: +- + +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/ADDME + +----------------------------------------------------------------------------------------------------------- + v9.5 (2024-06-09) From 2a0f2314d2d534b38f48ec9a67bf76e4c5bd934a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 10 Jun 2024 21:11:02 +0200 Subject: [PATCH 03/66] Init v9.6 --- .meta/dietpi-survey_report | 8 +++++++- .update/version | 4 ++-- CHANGELOG.txt | 2 +- dietpi/func/dietpi-globals | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 8328fd9b53..690509e96c 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -721,8 +721,14 @@ shopt -s extglob done aSOFTWARE_NAME9_5[177]='Forgejo' + aSOFTWARE_NAME9_6=() + for i in "${!aSOFTWARE_NAME9_5[@]}" + do + aSOFTWARE_NAME9_6[i]=${aSOFTWARE_NAME9_5[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_NAME9_5[@]}" + for i in "${aSOFTWARE_NAME9_6[@]}" do aSOFTWARE[$i]=0 done diff --git a/.update/version b/.update/version index 3058b8362e..c0cf4610de 100644 --- a/.update/version +++ b/.update/version @@ -2,8 +2,8 @@ # shellcheck disable=SC2034 # Available DietPi version G_REMOTE_VERSION_CORE=9 -G_REMOTE_VERSION_SUB=5 -G_REMOTE_VERSION_RC=1 +G_REMOTE_VERSION_SUB=6 +G_REMOTE_VERSION_RC=-1 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=7 G_MIN_VERSION_SUB=0 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index dcc08c4a8f..c42adea9ec 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,7 +5,7 @@ Enhancements: - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 Bug fixes: -- +- 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/ADDME diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 06a70c3942..40d601b491 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -54,8 +54,8 @@ [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=9 - [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=5 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=6 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=-1 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch From c428ad160b1f5b1eb74018c3de3e3538f15ce940 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 10 Jun 2024 21:39:44 +0200 Subject: [PATCH 04/66] v9.6 - CI | DietPi-Build: Re-add binfmt-support for Bullseye builds, since mmdebstrap fails on Jammy runners with systemd-binfmt, for whatever reason --- .build/images/dietpi-build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 72b10d7ef1..653e35eeaf 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -223,7 +223,11 @@ fi (( $efi_size )) || [[ $boot_size -gt 0 && $boot_fstype == 'fat'* ]] && apackages+=('dosfstools') # Emulation support in case of incompatible architecture -(( ( $G_HW_ARCH < 10 && $G_HW_ARCH < $HW_ARCH ) || ( ( $G_HW_ARCH == 10 || $G_HW_ARCH == 11 ) && $G_HW_ARCH != $HW_ARCH ) )) && apackages+=('qemu-user-static') +emulation=0 +(( ( $G_HW_ARCH < 10 && $G_HW_ARCH < $HW_ARCH ) || ( ( $G_HW_ARCH == 10 || $G_HW_ARCH == 11 ) && $G_HW_ARCH != $HW_ARCH ) )) && emulation=1 + +# Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: can neither be executed natively nor via qemu user emulation with binfmt_misc" +(( $emulation )) && { apackages+=('qemu-user-static'); (( $DISTRO == 6 )) && apackages+=('binfmt-support'); } # Virtual machine disk conversion [[ $VMTYPE && $VMTYPE != 'raw' ]] && apackages+=('qemu-utils') @@ -231,7 +235,7 @@ fi G_AG_CHECK_INSTALL_PREREQ parted mmdebstrap dbus systemd-container xz-utils "${apackages[@]}" # Register QEMU binfmt configs -dpkg-query -s 'qemu-user-static' &> /dev/null && G_EXEC systemctl restart systemd-binfmt +(( $emulation && $DISTRO != 6 )) && G_EXEC systemctl restart systemd-binfmt # Bootstrap archive keyring if missing if [[ ! -f $keyring ]] From 06d4ed6087bbd14cf27f0cebd34e403378562dc2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 11 Jun 2024 19:48:10 +0200 Subject: [PATCH 05/66] v9.6 - CI | DietPi-Build: Raise some image sizes and attempt to fix another segmentation fault on armhf Bullseye systems, this time not at mmdebstrap, but when actually booting the system - DietPi-Installer/Patches | Install zstd on Odroid XU4 and 32-bit Amlogic (Odroid C1) systems, for better initramfs compression and faster decompression. Those are (now) supported by current kernel builds. --- .build/images/dietpi-build | 54 ++++++++++++++++++++-------------- .build/images/dietpi-installer | 2 +- .update/patches | 9 ++++++ 3 files changed, 42 insertions(+), 23 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 653e35eeaf..03cb17be59 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -91,29 +91,29 @@ case $HW_MODEL in 4) iname='RPi234' HW_ARCH=3 boot_size=128 root_size=895;; 5) iname='RPi5' HW_ARCH=3 boot_size=128 root_size=895;; 10) iname='OdroidC1' HW_ARCH=2 partition_start=4 boot_size=128 root_size=700 boot_fstype='fat16';; - 11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=764;; + 11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=800;; 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=1148;; 15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=1148;; 16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=1148;; 20) iname='VM' HW_ARCH=${HW_ARCH:-10} VMTYPE=${VMTYPE:-raw};; 21) iname='NativePC-BIOS' HW_ARCH=10 root_size=1663;; 40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=1020;; - 42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=1008;; - 43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=1008;; + 42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=1100;; + 43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=1100;; 44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=1020;; 45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=1020;; - 46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=1008;; - 47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=1008;; + 46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=1100;; + 47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=1100;; 48) iname='NanoPiR1' HW_ARCH=2 partition_start=4 root_size=800;; '49.1') iname='Quartz64A' HW_ARCH=3 partition_start=16 root_size=752;; '49.2') iname='Quartz64B' HW_ARCH=3 partition_start=16 root_size=752;; '49.3') iname='SOQuartz' HW_ARCH=3 partition_start=16 root_size=752;; 52) iname='ASUSTB' HW_ARCH=2 partition_start=4 root_size=764;; 54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=1148;; - 55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=1008;; + 55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=1100;; 56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=1100;; 57) iname='NanoPiNEOPlus2' HW_ARCH=3 partition_start=4 root_size=1000;; - 58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=1008;; + 58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=1100;; 59) iname='ZeroPi' HW_ARCH=2 partition_start=4 root_size=800;; 60) iname='NanoPiNEO' HW_ARCH=2 partition_start=4 root_size=800;; 61) iname='NanoPiM2' HW_ARCH=2 partition_start=4 boot_size=64 root_size=700 boot_fstype='ext4';; @@ -125,30 +125,30 @@ case $HW_MODEL in '65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=1020;; 66) iname='NanoPiM1Plus' HW_ARCH=2 partition_start=4 root_size=800;; 67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=1020;; - '68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=1008;; - '68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=1008;; - '68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=1008;; + '68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=1100;; + '68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=1100;; + '68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=1100;; 70) iname='SparkySBC' HW_ARCH=2 partition_start=8 boot_size=48 root_size=712 boot_fstype='fat16';; - '72.1') iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=1008;; - '72.2') iname='ROCK4SE' HW_ARCH=3 partition_start=16 root_size=1008;; - '72.3') iname='ROCK4CPlus' HW_ARCH=3 partition_start=16 root_size=1008;; - 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=1008;; + '72.1') iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=1100;; + '72.2') iname='ROCK4SE' HW_ARCH=3 partition_start=16 root_size=1100;; + '72.3') iname='ROCK4CPlus' HW_ARCH=3 partition_start=16 root_size=1100;; + 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=1100;; 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=1148;; 75) iname='Container' HW_ARCH=${HW_ARCH:-10} root_size=575;; '76.1') iname='NanoPiR5S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; '76.2') iname='NanoPiR5C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; - 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; - '79.1') iname='NanoPiR6S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; - '79.2') iname='NanoPiR6C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; - '79.3') iname='NanoPCT6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; + '79.1') iname='NanoPiR6S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; + '79.2') iname='NanoPiR6C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; + '79.3') iname='NanoPCT6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; 81) iname='VisionFive2' HW_ARCH=11 root_size=639;; - 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; 83) iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=1148;; 84) iname='Star64' HW_ARCH=11 root_size=639;; - 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; - 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=1008;; + 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1100;; + 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=1100;; 87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1136;; 88) iname='OrangePiZero2W' HW_ARCH=3 partition_start=4 root_size=1148;; 89) iname='OrangePi3LTS' HW_ARCH=3 partition_start=4 root_size=1000;; @@ -235,7 +235,17 @@ emulation=0 G_AG_CHECK_INSTALL_PREREQ parted mmdebstrap dbus systemd-container xz-utils "${apackages[@]}" # Register QEMU binfmt configs -(( $emulation && $DISTRO != 6 )) && G_EXEC systemctl restart systemd-binfmt +if (( $emulation )) +then + if (( $DISTRO == 6 )) + then + G_EXEC systemctl disbale --now systemd-binfmt + G_EXEC systemctl restart binfmt-support + else + G_EXEC systemctl restart systemd-binfmt + fi +fi + # Bootstrap archive keyring if missing if [[ ! -f $keyring ]] diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 71d6d33933..7ec056e9ec 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1156,7 +1156,7 @@ 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 == 'rk35xx' || $kernel == 'meson64' || $kernel == 'sunxi64' || $kernel == 'sunxi' || $kernel == 'rockchip' ]] && zstd=('zstd') + [[ $kernel == 's5p6818' ]] || 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 or is not available diff --git a/.update/patches b/.update/patches index 348747baa3..694d195297 100755 --- a/.update/patches +++ b/.update/patches @@ -1657,6 +1657,15 @@ Patch_9_5() fi } +Patch_9_6() +{ + # Odroid XU4/Meson: Install zstd for better compressed initramfs images + if dpkg-query -s 'linux-image-current-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-current-meson' &> /dev/null + then + G_AGI zstd + fi +} + # v6.35 => v7 migration if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 )) then From 2439d78b51649a24d3c84b8fca25ec723c9b1287 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 11 Jun 2024 19:57:37 +0200 Subject: [PATCH 06/66] v9.6 - CI | DietPi-Build: Remove doubled newline --- .build/images/dietpi-build | 1 - 1 file changed, 1 deletion(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 03cb17be59..db3e0d9fc0 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -246,7 +246,6 @@ then fi fi - # Bootstrap archive keyring if missing if [[ ! -f $keyring ]] then From ced3e38ff8e62684bc3a2f1759591e50e63a5dce Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 11 Jun 2024 21:16:42 +0200 Subject: [PATCH 07/66] v9.6 - DietPi-Installer | Stop apt-daily services and timers before doing any APT installs. It just happened that they triggered while the installer tried to do its APT installs --- .build/images/dietpi-installer | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 7ec056e9ec..339425a51b 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -830,6 +830,13 @@ setenv rootuuid "true"' /boot/boot.cmd G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] APT configuration"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ + G_DIETPI-NOTIFY 2 'Disabling apt-daily services to prevent random APT cache lock' + for i in apt-daily{,-upgrade}.{service,timer} + do + G_EXEC systemctl disable --now "$i" + G_EXEC systemctl mask "$i" + done + G_DIETPI-NOTIFY 2 "Setting APT sources.list: $DISTRO_TARGET_NAME $DISTRO_TARGET" # We need to forward $DISTRO_TARGET* to dietpi-set_software, as well as $G_HW_MODEL + $G_RASPBIAN for Debian vs Raspbian decision. @@ -1823,13 +1830,6 @@ _EOF_' #----------------------------------------------------------------------------------- # MISC - G_DIETPI-NOTIFY 2 'Disabling apt-daily services to prevent random APT cache lock' - for i in apt-daily{,-upgrade}.{service,timer} - do - G_EXEC systemctl disable --now "$i" - G_EXEC systemctl mask "$i" - done - if command -v e2scrub > /dev/null then G_DIETPI-NOTIFY 2 'Disabling e2scrub services which are for LVM and require lvm2/lvcreate being installed' From 04b58a299c120ad269e0ca298c56f1c12cf50825 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 11 Jun 2024 21:19:25 +0200 Subject: [PATCH 08/66] v9.6 - DietPi-Build | Typo --- .build/images/dietpi-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index db3e0d9fc0..c55821e2f8 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -239,7 +239,7 @@ if (( $emulation )) then if (( $DISTRO == 6 )) then - G_EXEC systemctl disbale --now systemd-binfmt + G_EXEC systemctl disable --now systemd-binfmt G_EXEC systemctl restart binfmt-support else G_EXEC systemctl restart systemd-binfmt From d8aad599eaf4d6a5edd8c0d4d57a72b989254c4c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 12 Jun 2024 00:12:18 +0200 Subject: [PATCH 09/66] v9.6 - DietPi-Build | Do not install recommended packages along with dependencies --- .build/images/dietpi-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index c55821e2f8..8941b4d79a 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -232,7 +232,7 @@ emulation=0 # Virtual machine disk conversion [[ $VMTYPE && $VMTYPE != 'raw' ]] && apackages+=('qemu-utils') -G_AG_CHECK_INSTALL_PREREQ parted mmdebstrap dbus systemd-container xz-utils "${apackages[@]}" +G_AG_CHECK_INSTALL_PREREQ --no-install-recommends parted mmdebstrap dbus systemd-container xz-utils "${apackages[@]}" # Register QEMU binfmt configs if (( $emulation )) From f6390741dff48bf0b343e640cfa674e5b3fbd8ec Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 12 Jun 2024 16:00:20 +0200 Subject: [PATCH 10/66] v9.6 - Odroid C1 | Resolved an issue, where the kernel upgrade did not apply as intended. Many thanks to @th2j for reporting this issue: https://github.com/MichaIng/DietPi/issues/6332#issuecomment-2162959873 --- .build/images/dietpi-installer | 21 ++------------------- .update/patches | 10 +--------- .update/pre-patches | 28 ++++++++++++++-------------- CHANGELOG.txt | 2 +- 4 files changed, 18 insertions(+), 43 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 339425a51b..57f6a953e8 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1139,19 +1139,8 @@ _EOF_ *) :;; esac - # Odroid C1: https://dietpi.com/forum/t/odroid-c1-not-booting-after-kernel-upgrade/17818 - if (( $G_HW_MODEL == 10 )) - then - G_DIETPI-NOTIFY 2 'Pinning Odroid C1 "current" and "edge" kernel packages to latest known functional version and in case enforcing automated downgrade' - cat << '_EOF_' > /etc/apt/preferences.d/00-dietpi-odroidc1 -Package: linux-image-current-meson linux-dtb-current-meson linux-headers-current-meson linux-image-edge-meson linux-dtb-edge-meson linux-headers-edge-meson -Pin: version 23.02.2 -Pin-Priority: 1000 -_EOF_ - G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian' - # NanoPi R2S/NEO3 - elif [[ $G_HW_MODEL =~ ^(55|56)$ ]] + if [[ $G_HW_MODEL =~ ^(55|56)$ ]] then G_DIETPI-NOTIFY 2 'Blacklisting video related kernel modules' cat << '_EOF_' > /etc/modprobe.d/dietpi-headless.conf @@ -1194,14 +1183,8 @@ _EOF_ # Flash U-Boot /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc "$BOOT_DEVICE" - # Odroid C1 cleanup: https://dietpi.com/forum/t/odroid-c1-not-booting-after-kernel-upgrade/17818 - if (( $G_HW_MODEL == 10 )) - then - G_DIETPI-NOTIFY 2 'Setting Odroid C1 "current" and "edge" kernel packages on hold' - G_EXEC apt-mark hold linux-image-current-meson linux-dtb-current-meson linux-headers-current-meson linux-image-edge-meson linux-dtb-edge-meson linux-headers-edge-meson - # Radxa Zero: Enable USB OTG OOTB: https://github.com/MichaIng/DietPi/issues/5931 - elif (( $G_HW_MODEL == 74 )) + if (( $G_HW_MODEL == 74 )) then G_AGI device-tree-compiler G_EXEC mkdir -p /boot/overlay-user diff --git a/.update/patches b/.update/patches index 694d195297..52f0bb8c33 100755 --- a/.update/patches +++ b/.update/patches @@ -1291,16 +1291,8 @@ Patch_8_22() [[ -f '/etc/apt/preferences.d/dietpi-armbian-tmp' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-armbian-tmp [[ -f '/etc/apt/apt.conf.d/dietpi-armbian' ]] && G_EXEC rm /etc/apt/apt.conf.d/dietpi-armbian - # Odroid C1: Set kernel packages on hold. We pin them in pre-patches and enforce an automated downgrade, in case, but since v23.02.2 might not be available forever, we should also set them on hold, until we know there is a compatble newer version available: - # - https://dietpi.com/forum/t/odroid-c1-not-booting-after-kernel-upgrade/17818 - # - https://github.com/MichaIng/DietPi/issues/6616#issuecomment-1730900296 - if (( $G_HW_MODEL == 10 )) - then - G_DIETPI-NOTIFY 2 'Setting Odroid C1 "current" and "edge" kernel packages on hold' - G_EXEC apt-mark hold linux-image-current-meson linux-dtb-current-meson linux-headers-current-meson linux-image-edge-meson linux-dtb-edge-meson linux-headers-edge-meson - # NanoPi R4S: Fix Ethernet LEDs: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 - elif (( $G_HW_MODEL == 47 )) + if (( $G_HW_MODEL == 47 )) then G_DIETPI-NOTIFY 2 'Updating udev rule for NanoPi R4S Ethernet LEDs' G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' diff --git a/.update/pre-patches b/.update/pre-patches index 11fbb5afe4..0f6c7c38ba 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -257,20 +257,6 @@ _EOF_ Package: base-files Pin: release o=Debian Pin-Priority: 1000 -_EOF_ - G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian' - fi - - # Odroid C1: Pin "current" and "edge" kernel versions to Armbian 23.02.2, which are the latest currently known functional versions for C1: - # - https://dietpi.com/forum/t/odroid-c1-not-booting-after-kernel-upgrade/17818 - # - https://github.com/MichaIng/DietPi/issues/6616#issuecomment-1730900296 - if (( $G_HW_MODEL == 10 )) - then - G_DIETPI-NOTIFY 2 'Pinning Odroid C1 "current" and "edge" kernel packages to latest known functional version and in case enforcing automated downgrade' - cat << '_EOF_' > /etc/apt/preferences.d/00-dietpi-odroidc1 -Package: linux-image-current-meson linux-dtb-current-meson linux-headers-current-meson linux-image-edge-meson linux-dtb-edge-meson linux-headers-edge-meson -Pin: version 23.02.2 -Pin-Priority: 1000 _EOF_ G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian' fi @@ -426,5 +412,19 @@ then fi fi +# v9.6 +if (( $G_DIETPI_VERSION_CORE < 9 || ( $G_DIETPI_VERSION_CORE == 9 && $G_DIETPI_VERSION_SUB < 6 ) )) +then + # https://github.com/MichaIng/DietPi/issues/6332#issuecomment-2162959873 + if (( $G_HW_MODEL == 10 )) + then + G_DIETPI-NOTIFY 2 'Re-allowing kernel upgrades on Odroid C1' + [[ -f '/etc/apt/preferences.d/00-dietpi-odroidc1' ]] G_EXEC rm /etc/apt/preferences.d/00-dietpi-odroidc1 + mapfile -t apackages < <(apt-mark showhold | grep -E '^linux-(image|dtb|headers}-(current|edge)-meson$') + [[ ${apackages[0]} ]] && G_EXEC apt-mark unhold "${apackages[@]}" + unset -v apackages + fi +fi + exit 0 } diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c42adea9ec..b6aab5a5c9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,7 +5,7 @@ Enhancements: - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 Bug fixes: -- +- Odroid C1 | Resolved an issue, where the kernel upgrade did not apply as intended. Many thanks to @th2j for reporting this issue: https://github.com/MichaIng/DietPi/issues/6332#issuecomment-2162959873 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/ADDME From 50e6f8b66b5f75415e8d3d34bf9be330ac1407c4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 12 Jun 2024 16:30:47 +0200 Subject: [PATCH 11/66] v9.6 - DietPi-Pre-patches | Syntax --- .update/pre-patches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/pre-patches b/.update/pre-patches index 0f6c7c38ba..702c1bd182 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -419,7 +419,7 @@ then if (( $G_HW_MODEL == 10 )) then G_DIETPI-NOTIFY 2 'Re-allowing kernel upgrades on Odroid C1' - [[ -f '/etc/apt/preferences.d/00-dietpi-odroidc1' ]] G_EXEC rm /etc/apt/preferences.d/00-dietpi-odroidc1 + [[ -f '/etc/apt/preferences.d/00-dietpi-odroidc1' ]] && G_EXEC rm /etc/apt/preferences.d/00-dietpi-odroidc1 mapfile -t apackages < <(apt-mark showhold | grep -E '^linux-(image|dtb|headers}-(current|edge)-meson$') [[ ${apackages[0]} ]] && G_EXEC apt-mark unhold "${apackages[@]}" unset -v apackages From bdabec56da1004dc8b09cbb5f30184b483242890 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 12 Jun 2024 19:45:39 +0200 Subject: [PATCH 12/66] v9.6 - CI | DietPi-Build: Add mmdebstrap debug flag and define mode and format explicitly --- .build/images/dietpi-build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 8941b4d79a..b00a6a7737 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -408,7 +408,7 @@ packages='apt,bash-completion,bzip2,ca-certificates,cron,curl,fdisk,gpg,htop,ipu (( $DISTRO > 7 )) && packages+='7zip,' || packages+='p7zip,' [[ $HW_MODEL == 75 ]] && packages+='iproute2' || packages+='console-setup,dropbear,ethtool,fake-hwclock,ifupdown,isc-dhcp-client,kmod,rfkill,systemd-timesyncd,usbutils' # - "--skip=check/empty" to ignore /etc/fstab, boot and tmpfs mounts we added above -G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --skip=check/empty --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" +G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --debug --mode=root --format=dir --skip=check/empty --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" G_EXEC umount rootfs/dev rootfs/run rootfs/var/cache/apt rootfs/var/lib/apt/lists rootfs/var/log ########################################## From fc820dd3d285174dc686f70149a965b3c0415fad Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 12 Jun 2024 19:53:17 +0200 Subject: [PATCH 13/66] v9.6 - CI | DietPi-Build: Remove the need for "arch-test" package --- .build/images/dietpi-build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index b00a6a7737..f63b21a80c 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -408,7 +408,8 @@ packages='apt,bash-completion,bzip2,ca-certificates,cron,curl,fdisk,gpg,htop,ipu (( $DISTRO > 7 )) && packages+='7zip,' || packages+='p7zip,' [[ $HW_MODEL == 75 ]] && packages+='iproute2' || packages+='console-setup,dropbear,ethtool,fake-hwclock,ifupdown,isc-dhcp-client,kmod,rfkill,systemd-timesyncd,usbutils' # - "--skip=check/empty" to ignore /etc/fstab, boot and tmpfs mounts we added above -G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --debug --mode=root --format=dir --skip=check/empty --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" +# - "--skip=check/qemu" to skip arch test, which requires the "arch-test" package. We however assure emulation support out end. +G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --debug --mode=root --format=dir --skip=check/empty,check/qemu --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" G_EXEC umount rootfs/dev rootfs/run rootfs/var/cache/apt rootfs/var/lib/apt/lists rootfs/var/log ########################################## From eea7c5a0a64a70060e1a6ba90189a78e51602e2a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 12 Jun 2024 19:56:45 +0200 Subject: [PATCH 14/66] v9.6 - DietPi-Software | ruTorrent: Update fallback version --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 4f5b75893e..8d7d9a3095 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8534,7 +8534,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.3.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"; } + [[ $version ]] || { version='v4.3.3'; 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 From 5dac7e3557c5f0eb995660956bb74d85c45d5f12 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 12 Jun 2024 22:52:40 +0200 Subject: [PATCH 15/66] v9.6 - Network | Resolved a rare issue, where shutdowns could hang, when networking.service and ifup@.service instances try to bring down the same network interface concurrently. Many thanks to @ioctl2 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7104 --- .update/patches | 5 ++++- CHANGELOG.txt | 1 + rootfs/etc/systemd/system/ifup@.service | 17 +++++++++++++++++ .../systemd/system/ifup@.service.d/dietpi.conf | 5 ----- 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 rootfs/etc/systemd/system/ifup@.service delete mode 100644 rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf diff --git a/.update/patches b/.update/patches index 52f0bb8c33..9a41f6ec12 100755 --- a/.update/patches +++ b/.update/patches @@ -1652,10 +1652,13 @@ Patch_9_5() Patch_9_6() { # Odroid XU4/Meson: Install zstd for better compressed initramfs images - if dpkg-query -s 'linux-image-current-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-current-meson' &> /dev/null + if dpkg-query -s 'linux-image-current-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-edge-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-current-meson' &> /dev/null || dpkg-query -s 'linux-image-edge-meson' &> /dev/null then G_AGI zstd fi + + # Remove obsolete drop-in config: https://github.com/MichaIng/DietPi/issues/7104 + [[ -d '/etc/systemd/system/ifup@.service.d' ]] && G_EXEC rm -R /etc/systemd/system/ifup@.service.d } # v6.35 => v7 migration diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b6aab5a5c9..2b6d95b15e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ Enhancements: - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 Bug fixes: +- Network | Resolved a rare issue, where shutdowns could hang, when networking.service and ifup@.service instances try to bring down the same network interface concurrently. Many thanks to @ioctl2 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7104 - Odroid C1 | Resolved an issue, where the kernel upgrade did not apply as intended. Many thanks to @th2j for reporting this issue: https://github.com/MichaIng/DietPi/issues/6332#issuecomment-2162959873 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/ADDME diff --git a/rootfs/etc/systemd/system/ifup@.service b/rootfs/etc/systemd/system/ifup@.service new file mode 100644 index 0000000000..c9f8c45466 --- /dev/null +++ b/rootfs/etc/systemd/system/ifup@.service @@ -0,0 +1,17 @@ +[Unit] +Description=ifup for %I +After=local-fs.target network-pre.target apparmor.service systemd-sysctl.service +Before=network.target network-online.target +BindsTo=sys-subsystem-net-devices-%i.device +After=sys-subsystem-net-devices-%i.device +DefaultDependencies=no +IgnoreOnIsolate=yes + +[Service] +Type=oneshot +# avoid stopping on shutdown via stopping system-ifup.slice +Slice=system.slice +ExecStart=/sbin/ifup --allow=hotplug %I +ExecStop=/sbin/ifdown %I +RemainAfterExit=true +TimeoutStartSec=5min diff --git a/rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf b/rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf deleted file mode 100644 index eacef9fac8..0000000000 --- a/rootfs/etc/systemd/system/ifup@.service.d/dietpi.conf +++ /dev/null @@ -1,5 +0,0 @@ -# Override service type to give network(-online).target more meaning and remove obsolete ifquery call: https://github.com/MichaIng/DietPi/issues/4121#issuecomment-782057374 -[Service] -Type=oneshot -ExecStart= -ExecStart=/sbin/ifup --allow=hotplug %I From 738a6113a0d8c89417b399b0fa972400c7e2ba21 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 13 Jun 2024 15:37:26 +0200 Subject: [PATCH 16/66] v9.6 - DietPi-Installer | Raise /tmp tmpfs size to 1 GiB, since in a few cases, APT update fails with "getline (12: Cannot allocate memory)" --- .build/images/dietpi-installer | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 57f6a953e8..103d031ea9 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -60,9 +60,9 @@ # Assure that /tmp is a tmpfs of at least 512 MiB if findmnt -M /tmp > /dev/null then - (( $(findmnt -Ufnrbo SIZE -M /tmp) < 536870912 )) && mount -o 'remount,size=512M,noatime,lazytime,nodev,nosuid,mode=1777' /tmp + (( $(findmnt -Ufnrbo SIZE -M /tmp) < 1024**3 )) && mount -o 'remount,size=1G,noatime,lazytime,nodev,nosuid,mode=1777' /tmp else - mount -t tmpfs -o 'size=512M,noatime,lazytime,nodev,nosuid,mode=1777' tmpfs /tmp + mount -t tmpfs -o 'size=1G,noatime,lazytime,nodev,nosuid,mode=1777' tmpfs /tmp fi # Work inside /tmp tmpfs to reduce disk I/O and speed up download and unpacking From 0217da682811a0b66ab86afed4953cf47bd6ab6c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 13 Jun 2024 21:25:45 +0200 Subject: [PATCH 17/66] v9.6 - CHANGELOG | Add entry about fixed VisionFive 2 image --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2b6d95b15e..edfd84b8c1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,6 +7,7 @@ Enhancements: Bug fixes: - Network | Resolved a rare issue, where shutdowns could hang, when networking.service and ifup@.service instances try to bring down the same network interface concurrently. Many thanks to @ioctl2 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7104 - Odroid C1 | Resolved an issue, where the kernel upgrade did not apply as intended. Many thanks to @th2j for reporting this issue: https://github.com/MichaIng/DietPi/issues/6332#issuecomment-2162959873 +- VisionFive 2 | Resolved an issue where our new image did not boot, because of a false device tree name in /boot/extlinux/extlinux.conf. 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/ADDME From bea468bbf8c9a455c4f9d7f0163caf3dd03344fa Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 14 Jun 2024 17:14:25 +0200 Subject: [PATCH 18/66] v9.6 - DietPi-Banner | Resolved an issue where incorrect RAM usage was printed with German and potentially other locales. Many thanks to @jwgn for reporting this issue: https://github.com/MichaIng/DietPi/issues/7107 --- CHANGELOG.txt | 1 + dietpi/func/dietpi-banner | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index edfd84b8c1..47755c8e84 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Bug fixes: - Network | Resolved a rare issue, where shutdowns could hang, when networking.service and ifup@.service instances try to bring down the same network interface concurrently. Many thanks to @ioctl2 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7104 - Odroid C1 | Resolved an issue, where the kernel upgrade did not apply as intended. Many thanks to @th2j for reporting this issue: https://github.com/MichaIng/DietPi/issues/6332#issuecomment-2162959873 - VisionFive 2 | Resolved an issue where our new image did not boot, because of a false device tree name in /boot/extlinux/extlinux.conf. +- DietPi-Banner | Resolved an issue where incorrect RAM usage was printed with German and potentially other locales. Many thanks to @jwgn for reporting this issue: https://github.com/MichaIng/DietPi/issues/7107 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/ADDME diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index e119656403..044f0c8cc5 100755 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -29,6 +29,9 @@ readonly G_PROGRAM_NAME='DietPi-Banner' G_CHECK_ROOT_USER # Required to store settings G_INIT + else + # Apply safe locale in non-menu mode (where G_INIT does it) + export LC_ALL='C.UTF-8' LANG='C.UTF-8' fi # Import DietPi-Globals -------------------------------------------------------------- From 9ca6c8a5580847d9bcbff8a0dfd47c14efb9330c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 14 Jun 2024 23:19:06 +0200 Subject: [PATCH 19/66] v9.6 - DietPi-Software | Rclone: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8d7d9a3095..be500575da 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11639,7 +11639,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/rclone/rclone/releases/download/v1.66.0/rclone-v1.66.0-linux-$arch.deb" + local fallback_url="https://github.com/rclone/rclone/releases/download/v1.67.0/rclone-v1.67.0-linux-$arch.deb" Download_Install "$(curl -sSfL 'https://api.github.com/repos/rclone/rclone/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/rclone-v[^\"\/]*-linux-$arch.deb\"$/{print \$4}")" fi fi From 5db7d27f4690186c807ac017435852796c4b6708 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 14:09:32 +0200 Subject: [PATCH 20/66] v9.6 - NanoPi R6C | Resolved an issue where our new images did not boot, since the latest mainline U-Boot for R6S does not support the R6C anymore. Many thanks to @labmaster for reporting this issue: https://github.com/MichaIng/DietPi/issues/7109 --- .build/images/dietpi-installer | 2 +- .update/patches | 9 ++++++++- CHANGELOG.txt | 1 + dietpi/func/dietpi-set_software | 6 +++--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 103d031ea9..605e1df8e5 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -692,7 +692,6 @@ 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;; - 79) (( $HW_VARIANT == 2 )) && G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588s-nanopi-r6c.dtb' /boot/dietpiEnv.txt;; 85) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588s-rock-5a.dtb' /boot/dietpiEnv.txt;; 87) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3566-orangepi-3b.dtb' /boot/dietpiEnv.txt;; *) :;; @@ -1124,6 +1123,7 @@ _EOF_ 78) model='rock-5b' kernel='rk35xx' branch='legacy';; 79) kernel='rk35xx' branch='legacy' case $HW_VARIANT in + 2) model='nanopi-r6c';; 3) model='nanopct6';; *) model='nanopi-r6s';; esac;; diff --git a/.update/patches b/.update/patches index 9a41f6ec12..7d346adc71 100755 --- a/.update/patches +++ b/.update/patches @@ -1651,8 +1651,15 @@ Patch_9_5() Patch_9_6() { + # NanoPi R6C: Migrate to dedicated APT component and U-Boot package: https://github.com/MichaIng/DietPi/issues/7109 + if (( $G_HW_MODEL == 79 )) && grep -q '^[[:blank:]]*fdtfile=rockchip/rk3588s-nanopi-r6c.dtb$' /boot/dietpiEnv.txt + then + HW_VARIANT=2 /boot/dietpi/func/dietpi-set_software apt-mirror dietpi + G_AGUP + G_AGUG + # Odroid XU4/Meson: Install zstd for better compressed initramfs images - if dpkg-query -s 'linux-image-current-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-edge-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-current-meson' &> /dev/null || dpkg-query -s 'linux-image-edge-meson' &> /dev/null + elif dpkg-query -s 'linux-image-current-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-edge-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-current-meson' &> /dev/null || dpkg-query -s 'linux-image-edge-meson' &> /dev/null then G_AGI zstd fi diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 47755c8e84..9fa56995ca 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,6 +8,7 @@ Bug fixes: - Network | Resolved a rare issue, where shutdowns could hang, when networking.service and ifup@.service instances try to bring down the same network interface concurrently. Many thanks to @ioctl2 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7104 - Odroid C1 | Resolved an issue, where the kernel upgrade did not apply as intended. Many thanks to @th2j for reporting this issue: https://github.com/MichaIng/DietPi/issues/6332#issuecomment-2162959873 - VisionFive 2 | Resolved an issue where our new image did not boot, because of a false device tree name in /boot/extlinux/extlinux.conf. +- NanoPi R6C | Resolved an issue where our new images did not boot, since the latest mainline U-Boot for R6S does not support the R6C anymore. Many thanks to @labmaster for reporting this issue: https://github.com/MichaIng/DietPi/issues/7109 - DietPi-Banner | Resolved an issue where incorrect RAM usage was printed with German and potentially other locales. Many thanks to @jwgn for reporting this issue: https://github.com/MichaIng/DietPi/issues/7107 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/ADDME diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 5479c79b77..a219453703 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -218,12 +218,12 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package # shellcheck disable=SC2154 case $HW_VARIANT in - 1|2) all_components='nanopir6s';; # R6C shares R6S component (and bootloader) for now + 1) all_components='nanopir6s';; + 2) all_components='nanopir6c';; 3) all_components='nanopct6';; *) [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) - # shellcheck disable=SC2043 - [[ $all_components ]] || for i in nano{pi-r6s,pct6} + [[ $all_components ]] || for i in nano{pi-r6s,pi-r6c,pct6} do dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue all_components=${i/-//} From ed92c63deee1ab628877067a65dbea1a49e537bb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 14:18:19 +0200 Subject: [PATCH 21/66] v9.6 - NanoPi R6C | Do actually migrate to new U-Boot package --- .update/patches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/patches b/.update/patches index 7d346adc71..a28d96bce0 100755 --- a/.update/patches +++ b/.update/patches @@ -1628,7 +1628,7 @@ Patch_9_5() then /boot/dietpi/func/dietpi-set_software apt-mirror dietpi G_AGUP - G_AGUG + G_AGI linux-u-boot-nanopi-r6c-current fi # Flash new U-Boot on Odroid C1 and Radxa ZERO 3 From e885cd9ff92679ec216bb22143a495cb28c7f50e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 14:19:15 +0200 Subject: [PATCH 22/66] v9.6 - DietPi-Patches | Move patch to correct code block --- .update/patches | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.update/patches b/.update/patches index a28d96bce0..186996ecbe 100755 --- a/.update/patches +++ b/.update/patches @@ -1628,7 +1628,7 @@ Patch_9_5() then /boot/dietpi/func/dietpi-set_software apt-mirror dietpi G_AGUP - G_AGI linux-u-boot-nanopi-r6c-current + G_AGUG fi # Flash new U-Boot on Odroid C1 and Radxa ZERO 3 @@ -1656,7 +1656,7 @@ Patch_9_6() then HW_VARIANT=2 /boot/dietpi/func/dietpi-set_software apt-mirror dietpi G_AGUP - G_AGUG + G_AGI linux-u-boot-nanopi-r6c-current # Odroid XU4/Meson: Install zstd for better compressed initramfs images elif dpkg-query -s 'linux-image-current-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-edge-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-current-meson' &> /dev/null || dpkg-query -s 'linux-image-edge-meson' &> /dev/null From 83123042a830ff71aea350272195e8cd9be52eb5 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 15:29:58 +0200 Subject: [PATCH 23/66] v9.6 - DietPi-Installer | NanoPi R6C: Revert back to defining the device tree explicitly, since Armbian for whichever reason chose to use a generic RK3588 config for explicit NanoPi R6C U-Boot builds. --- .build/images/dietpi-installer | 1 + 1 file changed, 1 insertion(+) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 605e1df8e5..24d77d624d 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -692,6 +692,7 @@ 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;; + 79) (( $HW_VARIANT == 2 )) && G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588s-nanopi-r6c.dtb' /boot/dietpiEnv.txt;; 85) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3588s-rock-5a.dtb' /boot/dietpiEnv.txt;; 87) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3566-orangepi-3b.dtb' /boot/dietpiEnv.txt;; *) :;; From f7a206b736e808af60d24f0c8017673c81383b12 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 16:09:21 +0200 Subject: [PATCH 24/66] v9.6 - DietPi-Installer | NanoPi R6C: Temporarily assure correct APT component, until DietPi v9.6 release, to allow master branch builds. The live patch is applied before the APT config exist, and would be overwritten by it, hence we need to switch again here. --- .build/images/dietpi-installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 24d77d624d..275121873f 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1124,7 +1124,7 @@ _EOF_ 78) model='rock-5b' kernel='rk35xx' branch='legacy';; 79) kernel='rk35xx' branch='legacy' case $HW_VARIANT in - 2) model='nanopi-r6c';; + 2) model='nanopi-r6c'; G_EXEC sed -i 's/r6s/r6c/' /etc/apt/sources.list.d/dietpi.list;; # ToDo: Temporarily assure correct APT component, until DietPi v9.6 release 3) model='nanopct6';; *) model='nanopi-r6s';; esac;; From 232cd37fdfb060eb0085e7f1d1ce7be772ae319d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 16:29:31 +0200 Subject: [PATCH 25/66] v9.6 - DietPi-Installer | Skip live patch 0 on NanoPi R6C, which cannot succeed at this stage of the script, but will be applied at a later stage --- .build/images/dietpi-installer | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 275121873f..7832b35bd6 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -809,6 +809,8 @@ setenv rootuuid "true"' /boot/boot.cmd G_DIETPI-NOTIFY 2 'Applying DietPi live patches to fix known bugs in this version' for i in "${!G_LIVE_PATCH[@]}" do + # ToDo: Temporarily skip live patch 0 on NanoPi R6C, which cannot succeed here, but will be applied later in this script + (( $G_HW_MODEL == 79 && $HW_VARIANT == 2 && $i == 0 )) && [[ ${G_LIVE_PATCH_DESC[i]} == *'NanoPi R6C' ]] && continue if eval "${G_LIVE_PATCH_COND[$i]}" then G_DIETPI-NOTIFY 2 "Applying live patch $i" From 38cc8235f64ede7983c774f912dbae8f6a107b11 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 16:34:36 +0200 Subject: [PATCH 26/66] v9.6 - DietPi-Patches | NanoPi R6C: Use correct U-Boot package branch --- .update/patches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/patches b/.update/patches index 186996ecbe..e5dc060ec9 100755 --- a/.update/patches +++ b/.update/patches @@ -1656,7 +1656,7 @@ Patch_9_6() then HW_VARIANT=2 /boot/dietpi/func/dietpi-set_software apt-mirror dietpi G_AGUP - G_AGI linux-u-boot-nanopi-r6c-current + G_AGI linux-u-boot-nanopi-r6c-legacy # Odroid XU4/Meson: Install zstd for better compressed initramfs images elif dpkg-query -s 'linux-image-current-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-edge-odroidxu4' &> /dev/null || dpkg-query -s 'linux-image-current-meson' &> /dev/null || dpkg-query -s 'linux-image-edge-meson' &> /dev/null From ade85dbfd7348a3b12a9d5439b056bb61ddf7d09 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 16:45:29 +0200 Subject: [PATCH 27/66] v9.6 - DietPi-Set_software | Fix U-Boot branch in some cases for auto-detecting correct APT component --- dietpi/func/dietpi-set_software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index a219453703..8690a7f276 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -184,7 +184,7 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) [[ $all_components ]] || for i in nanopineo2{,black} do - dpkg-query -s "linux-u-boot-$i-legacy" &> /dev/null || continue + dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue all_components=$i break done @@ -225,7 +225,7 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) [[ $all_components ]] || for i in nano{pi-r6s,pi-r6c,pct6} do - dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue + dpkg-query -s "linux-u-boot-$i-legacy" &> /dev/null || continue all_components=${i/-//} break done From e653d8760f243d29af5b37c9910ef4b60292e900 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 17:26:17 +0200 Subject: [PATCH 28/66] v9.6 - DietPi-Installer | Despite 1G /tmp size, apt update still somehow fails with "getline (12: Cannot allocate memory)". Clean APT lists after last change and add some debug info to see what exactly is consuming such huge amount of space --- .build/images/dietpi-installer | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 7832b35bd6..7a196c3ae2 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1064,7 +1064,9 @@ _EOF_ find /etc/apt/sources.list.d -mindepth 1 ! -name 'dietpi.list' -exec rm -Rf {} + # Add Armbian repository G_EXEC eval "echo 'deb https://apt.armbian.com ${DISTRO_TARGET_NAME/bullseye/bookworm} main' > /etc/apt/sources.list.d/dietpi-armbian.list" - # Update APT lists + # Update APT lists cleanly + find /tmp -exec ls -dl {} + # debug + /boot/dietpi/func/dietpi-set_software apt clean G_AGUP # Install kernel, device tree, U-Boot, firmware and initramfs packages local model='odroidn2' kernel='meson64' arch='arm64' branch='current' zstd=() From 25f4ce49c64aa84ae420e84bd0015c369fb2fada Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 17:48:21 +0200 Subject: [PATCH 29/66] v9.6 - DietPi-Installer | APT updates fail despite ~10 MiB being used. Add more debug info, probably the reason is host memory, not guest or tmpfs size --- .build/images/dietpi-installer | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 7a196c3ae2..f2a64b054e 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1066,8 +1066,9 @@ _EOF_ G_EXEC eval "echo 'deb https://apt.armbian.com ${DISTRO_TARGET_NAME/bullseye/bookworm} main' > /etc/apt/sources.list.d/dietpi-armbian.list" # Update APT lists cleanly find /tmp -exec ls -dl {} + # debug + df -h /tmp # debug /boot/dietpi/func/dietpi-set_software apt clean - G_AGUP + G_EXEC_NOHALT=1 G_AGUP || { free -m; find /tmp -exec ls -dl {} +; df -h /tmp; exit 1; } # Install kernel, device tree, U-Boot, firmware and initramfs packages local model='odroidn2' kernel='meson64' arch='arm64' branch='current' zstd=() case $G_HW_MODEL in From 85467830279d5037a30a40322611d174da3b0eec Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 18:05:35 +0200 Subject: [PATCH 30/66] v9.6 - DietPi-Installer | Update APT list after NanoPi R6C component has been added --- .build/images/dietpi-installer | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index f2a64b054e..73c29437db 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1055,21 +1055,21 @@ Pin-Priority: 1000 _EOF_ G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian' fi + # Bootstrap Armbian repository G_EXEC_RETRIES=2 G_EXEC eval 'curl -sSfL '\''https://apt.armbian.com/armbian.key'\'' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-armbian.gpg --yes' + # Remove obsolete combined keyring [[ -f '/etc/apt/trusted.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' + # Remove obsolete lists find /etc/apt/sources.list.d -mindepth 1 ! -name 'dietpi.list' -exec rm -Rf {} + + # Add Armbian repository G_EXEC eval "echo 'deb https://apt.armbian.com ${DISTRO_TARGET_NAME/bullseye/bookworm} main' > /etc/apt/sources.list.d/dietpi-armbian.list" - # Update APT lists cleanly - find /tmp -exec ls -dl {} + # debug - df -h /tmp # debug - /boot/dietpi/func/dietpi-set_software apt clean - G_EXEC_NOHALT=1 G_AGUP || { free -m; find /tmp -exec ls -dl {} +; df -h /tmp; exit 1; } - # Install kernel, device tree, U-Boot, firmware and initramfs packages + + # Select kernel, device tree and U-Boot packages local model='odroidn2' kernel='meson64' arch='arm64' branch='current' zstd=() case $G_HW_MODEL in 10) model='odroidc1' kernel='meson' arch='arm';; @@ -1157,10 +1157,18 @@ blacklist rockchip_rga blacklist rockchip_vdec _EOF_ fi + + # Update APT lists cleanly + find /tmp -exec ls -dl {} + # debug + df -h /tmp # debug + /boot/dietpi/func/dietpi-set_software apt clean + G_EXEC_NOHALT=1 G_AGUP || { free -m; find /tmp -exec ls -dl {} +; df -h /tmp; exit 1; } + # 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 == 's5p6818' ]] || 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 or is not available if (( $TEST_KERNEL )) then @@ -1169,6 +1177,7 @@ _EOF_ G_EXEC_OUTPUT=1 G_EXEC dpkg -i package[12].deb G_EXEC rm package[12].deb fi + # Download and pre-install U-Boot hosted on dietpi.com where the Armbian APT repo provides a too old version or is not available if (( $TEST_UBOOT )) then @@ -1176,16 +1185,20 @@ _EOF_ G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb G_EXEC rm package.deb fi + # Install kernel and bootloader 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 [[ -f '/boot/.next' ]] && G_EXEC rm /boot/.next [[ -f '/boot/armbianEnv.txt' ]] && G_EXEC rm /boot/armbianEnv.txt [[ -f '/boot/orangepiEnv.txt' ]] && G_EXEC rm /boot/orangepiEnv.txt [[ -f '/boot/uEnv.txt' ]] && G_EXEC rm /boot/uEnv.txt + # Compile U-Boot script [[ -f '/boot/boot.cmd' ]] && G_EXEC mkimage -C none -A "$arch" -T script -d /boot/boot.cmd /boot/boot.scr + # Flash U-Boot /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc "$BOOT_DEVICE" From 8d05a19f26b202b63483740127798cc399ecd0a1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 18:27:28 +0200 Subject: [PATCH 31/66] v9.6 - CI | DietPi-Build: Add most host side debug output in case of systems-nspawn or dietpi-installer failure. --- .build/images/dietpi-build | 4 ++-- .github/workflows/dietpi-software.bash | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index f63b21a80c..ee9716afd6 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -455,9 +455,9 @@ then abind=("--bind=$FP_LOOP" '--bind=/dev/disk') for i in "${FP_LOOP}p"*; do abind+=("--bind=$i"); done fi -systemd-nspawn -bD rootfs "${abind[@]}" || exit 1 +systemd-nspawn -bD rootfs "${abind[@]}" || { G_DIETPI-NOTIFY 1 'systemd-nspawn failed, aborting...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; } -[[ -f 'rootfs/success' ]] || { G_DIETPI-NOTIFY 1 'The container setup did not finish successfully, aborting...'; exit 1; } +[[ -f 'rootfs/success' ]] || { G_DIETPI-NOTIFY 1 'The container setup did not finish successfully, aborting...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; } G_EXEC rm rootfs/success G_EXEC rm -Rf rootfs/{dev,proc,run,sys,tmp,var/log}/{,.??,.[^.]}* # Failsafe: /var/log/journal was found despite tmpfs mount! G_EXEC sync diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 518c360924..077ce42663 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -426,5 +426,5 @@ G_EXEC sed --follow-symlinks -i 's|Prompt_on_Failure$|{ journalctl -n 50; ss -tu # Boot container ########################################## systemd-nspawn -bD rootfs -[[ -f 'rootfs/success' ]] || { journalctl -n 25; ss -tulpn; df -h; free -h; exit 1; } +[[ -f 'rootfs/success' ]] || { journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; } } From f0a40f08e2daf9027b405e6300ddcbbbf1662f33 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 18:45:49 +0200 Subject: [PATCH 32/66] v9.6 - DietPi-Installer | Revert minimal /tmp tmpfs size to 512 MiB, since it turned out to not be the reason for "getline (12: Cannot allocate memory)". That the issue disappeared after doing this change was a coincidence. It re-appears and disappears randomly, pretty much an indicator for a host-side issue. Debug output has been added to investigate it in case. --- .build/images/dietpi-installer | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 73c29437db..85b9f3a094 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -60,9 +60,9 @@ # Assure that /tmp is a tmpfs of at least 512 MiB if findmnt -M /tmp > /dev/null then - (( $(findmnt -Ufnrbo SIZE -M /tmp) < 1024**3 )) && mount -o 'remount,size=1G,noatime,lazytime,nodev,nosuid,mode=1777' /tmp + (( $(findmnt -Ufnrbo SIZE -M /tmp) < 512*1024**2 )) && mount -o 'remount,size=512M,noatime,lazytime,nodev,nosuid,mode=1777' /tmp else - mount -t tmpfs -o 'size=1G,noatime,lazytime,nodev,nosuid,mode=1777' tmpfs /tmp + mount -t tmpfs -o 'size=512M,noatime,lazytime,nodev,nosuid,mode=1777' tmpfs /tmp fi # Work inside /tmp tmpfs to reduce disk I/O and speed up download and unpacking From 2b5b0e7943366edad7991a1897502fa6cd6b0ec3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 19:06:23 +0200 Subject: [PATCH 33/66] Live patch 0 v9.5 (#7110) - Live patch 0 | Migrate to new U-Boot package on NanoPi R6C --- .update/version | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.update/version b/.update/version index 3058b8362e..8b5b58abf4 100644 --- a/.update/version +++ b/.update/version @@ -14,6 +14,7 @@ G_MIN_DEBIAN=6 # Alternative Git branch to automatically migrate to when Debian version is too low G_OLD_DEBIAN_BRANCH='8' # Live patches -G_LIVE_PATCH_DESC=() -G_LIVE_PATCH_COND=() -G_LIVE_PATCH=() +G_LIVE_PATCH_DESC=('Migrate to new U-Boot package on NanoPi R6C') +# shellcheck disable=SC2016 +G_LIVE_PATCH_COND=('(( $G_HW_MODEL == 79 )) && grep -q '\''^[[:blank:]]*fdtfile=rockchip/rk3588s-nanopi-r6c.dtb$'\'' /boot/dietpiEnv.txt') +G_LIVE_PATCH=('sed -i '\''s/r6s/r6c/'\'' /etc/apt/sources.list.d/dietpi.list && G_AGUP && G_AGI linux-u-boot-nanopi-r6c-legacy') From c7198cbb7bf173104e0dbf1d72c0e1d789730d99 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 19:07:52 +0200 Subject: [PATCH 34/66] v9.6 - META | Remove live patch merged from master --- .update/version | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.update/version b/.update/version index 498a16b17e..c0cf4610de 100644 --- a/.update/version +++ b/.update/version @@ -14,7 +14,6 @@ G_MIN_DEBIAN=6 # Alternative Git branch to automatically migrate to when Debian version is too low G_OLD_DEBIAN_BRANCH='8' # Live patches -G_LIVE_PATCH_DESC=('Migrate to new U-Boot package on NanoPi R6C') -# shellcheck disable=SC2016 -G_LIVE_PATCH_COND=('(( $G_HW_MODEL == 79 )) && grep -q '\''^[[:blank:]]*fdtfile=rockchip/rk3588s-nanopi-r6c.dtb$'\'' /boot/dietpiEnv.txt') -G_LIVE_PATCH=('sed -i '\''s/r6s/r6c/'\'' /etc/apt/sources.list.d/dietpi.list && G_AGUP && G_AGI linux-u-boot-nanopi-r6c-legacy') +G_LIVE_PATCH_DESC=() +G_LIVE_PATCH_COND=() +G_LIVE_PATCH=() From 18c694a6329ad14511a27420eeec19b07fbcf04b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 19:33:18 +0200 Subject: [PATCH 35/66] v9.6 - CI | DietPi-Build: Bullseye/Jammy host mmdebstrap seems to not support "--skip=check/empty,check/qemu", hence split options --- .build/images/dietpi-build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index ee9716afd6..92b064a622 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -409,7 +409,8 @@ packages='apt,bash-completion,bzip2,ca-certificates,cron,curl,fdisk,gpg,htop,ipu [[ $HW_MODEL == 75 ]] && packages+='iproute2' || packages+='console-setup,dropbear,ethtool,fake-hwclock,ifupdown,isc-dhcp-client,kmod,rfkill,systemd-timesyncd,usbutils' # - "--skip=check/empty" to ignore /etc/fstab, boot and tmpfs mounts we added above # - "--skip=check/qemu" to skip arch test, which requires the "arch-test" package. We however assure emulation support out end. -G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --debug --mode=root --format=dir --skip=check/empty,check/qemu --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" +# - Bullseye/Jammy host mmdebstrap seems to not support "--skip=check/empty,check/qemu". +G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --debug --mode=root --format=dir --skip=check/empty --skip=check/qemu --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" G_EXEC umount rootfs/dev rootfs/run rootfs/var/cache/apt rootfs/var/lib/apt/lists rootfs/var/log ########################################## From f7b60cf3c26878cfde451461df376b4ed3d2bbdb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 22:56:50 +0200 Subject: [PATCH 36/66] v9.6 - Orange Pi 5 | Older U-Boot builds caused the Ethernet MAC address to be random and change on every boot. Recent U-Boot builds solve this, but they are not flashed automatically on package upgrades. We hence inform users and offer to flash the latest U-Boot image during the DietPi update. Many thanks to @thuehlinger for reporting and testing the case: https://github.com/MichaIng/DietPi/issues/6663 --- .update/patches | 28 +++++++++++++++++++++++++++- CHANGELOG.txt | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.update/patches b/.update/patches index e5dc060ec9..b10f7bcd84 100755 --- a/.update/patches +++ b/.update/patches @@ -1651,8 +1651,34 @@ Patch_9_5() Patch_9_6() { + # Orange Pi 5: Offer to flash new U-Boot image to solve random Ethernet MAC address: https://github.com/MichaIng/DietPi/issues/6663 + if (( $G_HW_MODEL == 80 )) + then + if G_WHIP_YESNO '[ INFO ] U-Boot update available to solve random Ethernet MAC address +\nIn case you are affected by a random Ethernet MAC address, which changes every boot, flashing the latest U-Boot image has shown to solve it: https://github.com/MichaIng/DietPi/issues/6663 +\nDo you want to flash the latest U-Boot image now? +\nNB: This can be done any time later via dietpi-config > Advanced Options.' + then + if [[ $G_ROOTFS_DEV == '/dev/mmcblk'* ]] + then + /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc + + elif [[ -b '/dev/mtdblock0' ]] + then + . /usr/lib/u-boot/platform_install.sh + # shellcheck disable=SC2154 + G_EXEC_OUTPUT=1 G_EXEC dd if="$DIR/rkspi_loader.img" of=/dev/mtdblock0 oflag=direct conv=notrunc status=progress + else + G_WHIP_MSG '[FAILED] SPI block device /dev/mtdblock0 not found +\nWe expect the SPI block device /dev/mtdblock0 to be the target for the U-Boot image. It however does not exist. +\nPlease report this to our forum or GitHub site, so we can check back: +- https://dietpi.com/forum/c/troubleshooting/10 +- https://github.com/MichaIng/DietPi/issues' + fi + fi + # NanoPi R6C: Migrate to dedicated APT component and U-Boot package: https://github.com/MichaIng/DietPi/issues/7109 - if (( $G_HW_MODEL == 79 )) && grep -q '^[[:blank:]]*fdtfile=rockchip/rk3588s-nanopi-r6c.dtb$' /boot/dietpiEnv.txt + elif (( $G_HW_MODEL == 79 )) && grep -q '^[[:blank:]]*fdtfile=rockchip/rk3588s-nanopi-r6c.dtb$' /boot/dietpiEnv.txt then HW_VARIANT=2 /boot/dietpi/func/dietpi-set_software apt-mirror dietpi G_AGUP diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9fa56995ca..5d26c72df5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v9.6 Enhancements: - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 +- Orange Pi 5 | Older U-Boot builds caused the Ethernet MAC address to be random and change on every boot. Recent U-Boot builds solve this, but they are not flashed automatically on package upgrades. We hence inform users and offer to flash the latest U-Boot image during the DietPi update. Many thanks to @thuehlinger for reporting and testing the case: https://github.com/MichaIng/DietPi/issues/6663 Bug fixes: - Network | Resolved a rare issue, where shutdowns could hang, when networking.service and ifup@.service instances try to bring down the same network interface concurrently. Many thanks to @ioctl2 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7104 From 8d57269989812622bca5dbf98d259d133c8b35e8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 23:21:50 +0200 Subject: [PATCH 37/66] v9.6 - Quartz64/Star64/VisionFive 2 | eBPF functionality for firewall and network monitoring software like Cilium has been added to our kernel builds for these SBCs. Many thanks to @kbrighton for reporting these missing features: https://github.com/MichaIng/DietPi/issues/6834 --- .build/images/Quartz64/quartz64_defconfig | 3 +++ CHANGELOG.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/.build/images/Quartz64/quartz64_defconfig b/.build/images/Quartz64/quartz64_defconfig index 76e8c5888c..c2190049f6 100644 --- a/.build/images/Quartz64/quartz64_defconfig +++ b/.build/images/Quartz64/quartz64_defconfig @@ -142,6 +142,7 @@ CONFIG_CRYPTO_SHA2_ARM64_CE=y CONFIG_CRYPTO_SHA3_ARM64=m CONFIG_CRYPTO_SHA512_ARM64_CE=m CONFIG_CRYPTO_SM3_ARM64_CE=m +CONFIG_CRYPTO_USER_API_HASH=m CONFIG_CRYPTO_USER_API_RNG=m CONFIG_CUSE=m CONFIG_DEBUG_FS=y @@ -545,6 +546,7 @@ CONFIG_NET_ACT_GACT=m CONFIG_NET_ACT_GATE=m CONFIG_NET_ACT_MIRRED=m CONFIG_NET_CLS_ACT=y +CONFIG_NET_CLS_BPF=m CONFIG_NET_CLS_BASIC=m CONFIG_NET_CLS_FLOWER=m CONFIG_NET_DSA=m @@ -844,6 +846,7 @@ CONFIG_SATA_AHCI=y CONFIG_SATA_AHCI_PLATFORM=y CONFIG_SATA_MV=y CONFIG_SATA_SIL24=y +CONFIG_SCHEDSTATS=y CONFIG_SCHED_AUTOGROUP=y # CONFIG_SCHED_DEBUG is not set CONFIG_SCHED_MC=y diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5d26c72df5..2b5a16464b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v9.6 Enhancements: - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 +- Quartz64/Star64/VisionFive 2 | eBPF functionality for firewall and network monitoring software like Cilium has been added to our kernel builds for these SBCs. Many thanks to @kbrighton for reporting these missing features: https://github.com/MichaIng/DietPi/issues/6834 - Orange Pi 5 | Older U-Boot builds caused the Ethernet MAC address to be random and change on every boot. Recent U-Boot builds solve this, but they are not flashed automatically on package upgrades. We hence inform users and offer to flash the latest U-Boot image during the DietPi update. Many thanks to @thuehlinger for reporting and testing the case: https://github.com/MichaIng/DietPi/issues/6663 Bug fixes: From b041ddfc4fca46bd990152d205d7a9bebe7dac86 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 15 Jun 2024 23:22:57 +0200 Subject: [PATCH 38/66] v9.6 - META | Mute shellcheck annotation --- .update/patches | 1 + 1 file changed, 1 insertion(+) diff --git a/.update/patches b/.update/patches index b10f7bcd84..c4d55f2fe0 100755 --- a/.update/patches +++ b/.update/patches @@ -1665,6 +1665,7 @@ Patch_9_6() elif [[ -b '/dev/mtdblock0' ]] then + # shellcheck disable=SC1091 . /usr/lib/u-boot/platform_install.sh # shellcheck disable=SC2154 G_EXEC_OUTPUT=1 G_EXEC dd if="$DIR/rkspi_loader.img" of=/dev/mtdblock0 oflag=direct conv=notrunc status=progress From 9f6147ce6fc57d70dd7858682de938d43c75b064 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 16 Jun 2024 01:20:57 +0200 Subject: [PATCH 39/66] v9.6 - DietPi-Dashboard | Resolved an issue where the installation on RISC-V systems failed. --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 20 +++++++------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2b5a16464b..5dc6524597 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ Bug fixes: - VisionFive 2 | Resolved an issue where our new image did not boot, because of a false device tree name in /boot/extlinux/extlinux.conf. - NanoPi R6C | Resolved an issue where our new images did not boot, since the latest mainline U-Boot for R6S does not support the R6C anymore. Many thanks to @labmaster for reporting this issue: https://github.com/MichaIng/DietPi/issues/7109 - DietPi-Banner | Resolved an issue where incorrect RAM usage was printed with German and potentially other locales. Many thanks to @jwgn for reporting this issue: https://github.com/MichaIng/DietPi/issues/7107 +- DietPi-Dashboard | Resolved an issue where the installation on RISC-V systems failed. 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/ADDME diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index be500575da..b7693bfdc4 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3285,27 +3285,21 @@ _EOF_ [[ $backend == 'Yes' ]] && backend='-backend' || backend= # Download binary and set config URL - local url - if (( $G_HW_ARCH == 11 )) - then - url="https://dietpi.com/downloads/binaries/dietpi-dashboard-$G_HW_ARCH_NAME$backend.zip" - - elif [[ $version == 'Stable' ]] - then - Download_Install "$(curl -sSfL 'https://api.github.com/repos/ravenclaw900/dietpi-dashboard/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*dietpi-dashboard-$G_HW_ARCH_NAME$backend\"$/{print \$4}")" /opt/dietpi-dashboard/dietpi-dashboard - url="https://raw.githubusercontent.com/ravenclaw900/DietPi-Dashboard/$(curl -sSfL 'https://api.github.com/repos/ravenclaw900/dietpi-dashboard/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}')/config.toml" - - elif [[ $version == 'Nightly' ]] + local config_url + if [[ $G_HW_ARCH == 11 || $version == 'Nightly' ]] then Download_Install "https://nightly.link/ravenclaw900/DietPi-Dashboard/workflows/push-build/main/dietpi-dashboard-$G_HW_ARCH_NAME$backend.zip" /opt/dietpi-dashboard - url='https://raw.githubusercontent.com/ravenclaw900/DietPi-Dashboard/main/config.toml' + config_url='https://raw.githubusercontent.com/ravenclaw900/DietPi-Dashboard/main/config.toml' + else + Download_Install "$(curl -sSfL 'https://api.github.com/repos/ravenclaw900/dietpi-dashboard/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*dietpi-dashboard-$G_HW_ARCH_NAME$backend\"$/{print \$4}")" /opt/dietpi-dashboard/dietpi-dashboard + config_url="https://raw.githubusercontent.com/ravenclaw900/DietPi-Dashboard/$(curl -sSfL 'https://api.github.com/repos/ravenclaw900/dietpi-dashboard/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}')/config.toml" fi G_EXEC chmod +x /opt/dietpi-dashboard/dietpi-dashboard # Config if [[ ! -f '/opt/dietpi-dashboard/config.toml' ]] then - G_EXEC curl -sSfL "$url" -o /opt/dietpi-dashboard/config.toml + G_EXEC curl -sSfL "$config_url" -o /opt/dietpi-dashboard/config.toml # Enable password protection with global software password by default G_CONFIG_INJECT 'pass[[:blank:]]' 'pass = true' /opt/dietpi-dashboard/config.toml G_CONFIG_INJECT 'hash[[:blank:]]' "hash = \"$(echo -n "$GLOBAL_PW" | sha512sum | mawk '{print $1}')\"" /opt/dietpi-dashboard/config.toml From 93b2ff690dbe331517d27dd36d928f651dc8fbe0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 16 Jun 2024 01:24:11 +0200 Subject: [PATCH 40/66] v9.6 - CI | DietPi-Software test: Install nightly version of DietPi-Dashboard when passing test flag --- .github/workflows/dietpi-software.bash | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 077ce42663..e9c5bdb332 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -311,8 +311,12 @@ then fi # Install test builds from dietpi.com if requested -# shellcheck disable=SC2016 -[[ $TEST == 'true' ]] && G_EXEC sed --follow-symlinks -i '/# Start DietPi-Software/a\sed -i '\''s|dietpi.com/downloads/binaries/$G_DISTRO_NAME/|dietpi.com/downloads/binaries/$G_DISTRO_NAME/testing/|'\'' /boot/dietpi/dietpi-software' rootfs/boot/dietpi/dietpi-login +if [[ $TEST == 'true' ]] +then + # shellcheck disable=SC2016 + G_EXEC sed --follow-symlinks -i '/# Start DietPi-Software/a\sed -i '\''s|dietpi.com/downloads/binaries/$G_DISTRO_NAME/|dietpi.com/downloads/binaries/$G_DISTRO_NAME/testing/|'\'' /boot/dietpi/dietpi-software' rootfs/boot/dietpi/dietpi-login + G_CONFIG_INJECT 'SOFTWARE_DIETPI_DASHBOARD_VERSION=' 'SOFTWARE_DIETPI_DASHBOARD_VERSION=Nightly' rootfs/boot/dietpi.txt +fi # Workaround invalid TERM on login # shellcheck disable=SC2016 From 9d0fbe50e6becd75b0e8362af2bd159ed895ed44 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 16 Jun 2024 01:51:11 +0200 Subject: [PATCH 41/66] v9.6 - CI | Align and update emulation dependencies and setup --- .build/images/dietpi-build | 2 +- .build/software/Amiberry/container_build.bash | 20 +++++++++++++++++-- .build/software/dietpi-software-build.bash | 20 +++++++++++++++++-- .github/workflows/dietpi-software.bash | 20 +++++++++++++++++-- 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 92b064a622..462cbb43a1 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -224,7 +224,7 @@ fi # Emulation support in case of incompatible architecture emulation=0 -(( ( $G_HW_ARCH < 10 && $G_HW_ARCH < $HW_ARCH ) || ( ( $G_HW_ARCH == 10 || $G_HW_ARCH == 11 ) && $G_HW_ARCH != $HW_ARCH ) )) && emulation=1 +(( $G_HW_ARCH == $HW_ARCH || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $HW_ARCH ) )) || emulation=1 # Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: can neither be executed natively nor via qemu user emulation with binfmt_misc" (( $emulation )) && { apackages+=('qemu-user-static'); (( $DISTRO == 6 )) && apackages+=('binfmt-support'); } diff --git a/.build/software/Amiberry/container_build.bash b/.build/software/Amiberry/container_build.bash index 18b95af376..8a2b9c5102 100755 --- a/.build/software/Amiberry/container_build.bash +++ b/.build/software/Amiberry/container_build.bash @@ -59,11 +59,27 @@ image="DietPi_Container-$image.img" # Dependencies ########################################## apackages=('xz-utils' 'parted' 'fdisk' 'systemd-container') -(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || apackages+=('qemu-user-static') + +# Emulation support in case of incompatible architecture +emulation=0 +(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || emulation=1 + +# Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: can neither be executed natively nor via qemu user emulation with binfmt_misc" +(( $emulation )) && { apackages+=('qemu-user-static'); [[ $DISTRO == 'bullseye' ]] && apackages+=('binfmt-support'); } + G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" # Register QEMU binfmt configs -dpkg-query -s 'qemu-user-static' &> /dev/null && G_EXEC systemctl restart systemd-binfmt +if (( $emulation )) +then + if [[ $DISTRO == 'bullseye' ]] + then + G_EXEC systemctl disable --now systemd-binfmt + G_EXEC systemctl restart binfmt-support + else + G_EXEC systemctl restart systemd-binfmt + fi +fi ########################################## # Prepare container diff --git a/.build/software/dietpi-software-build.bash b/.build/software/dietpi-software-build.bash index de37c10ab5..76da35068e 100644 --- a/.build/software/dietpi-software-build.bash +++ b/.build/software/dietpi-software-build.bash @@ -63,11 +63,27 @@ image="DietPi_Container-$image.img" # Dependencies ########################################## apackages=('xz-utils' 'parted' 'fdisk' 'systemd-container') -(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || apackages+=('qemu-user-static') + +# Emulation support in case of incompatible architecture +emulation=0 +(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || emulation=1 + +# Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: can neither be executed natively nor via qemu user emulation with binfmt_misc" +(( $emulation )) && { apackages+=('qemu-user-static'); [[ $DISTRO == 'bullseye' ]] && apackages+=('binfmt-support'); } + G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" # Register QEMU binfmt configs -dpkg-query -s 'qemu-user-static' &> /dev/null && G_EXEC systemctl restart systemd-binfmt +if (( $emulation )) +then + if [[ $DISTRO == 'bullseye' ]] + then + G_EXEC systemctl disable --now systemd-binfmt + G_EXEC systemctl restart binfmt-support + else + G_EXEC systemctl restart systemd-binfmt + fi +fi ########################################## # Prepare container diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index e9c5bdb332..de53cc80bc 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -260,11 +260,27 @@ done # Dependencies ########################################## apackages=('xz-utils' 'parted' 'fdisk' 'systemd-container') -(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || apackages+=('qemu-user-static') + +# Emulation support in case of incompatible architecture +emulation=0 +(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || emulation=1 + +# Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: can neither be executed natively nor via qemu user emulation with binfmt_misc" +(( $emulation )) && { apackages+=('qemu-user-static'); [[ $DISTRO == 'bullseye' ]] && apackages+=('binfmt-support'); } + G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" # Register QEMU binfmt configs -dpkg-query -s 'qemu-user-static' &> /dev/null && G_EXEC systemctl restart systemd-binfmt +if (( $emulation )) +then + if [[ $DISTRO == 'bullseye' ]] + then + G_EXEC systemctl disable --now systemd-binfmt + G_EXEC systemctl restart binfmt-support + else + G_EXEC systemctl restart systemd-binfmt + fi +fi ########################################## # Prepare container From 0e75521d5598ed37801e85fd7b798af55ecc3e20 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 17 Jun 2024 23:11:53 +0200 Subject: [PATCH 42/66] v9.6 - CI | Obtain host Debian/Ubuntu version in all build/test scripts. Since Ubuntu ships /etc/debian_version from Debian testing, assume that it is one version lower. Fix binfmt support in all scripts based on now correctly obtained host distro version. --- .build/images/dietpi-build | 7 +++++-- .build/images/dietpi-imager | 3 +++ .build/software/Amiberry/container_build.bash | 14 ++++++++++++-- .build/software/dietpi-software-build.bash | 14 ++++++++++++-- .github/workflows/dietpi-software.bash | 14 ++++++++++++-- 5 files changed, 44 insertions(+), 8 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 462cbb43a1..3c63703489 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -20,6 +20,9 @@ else '13.'*|'trixie/sid') G_DISTRO=8;; *) G_DIETPI-NOTIFY 1 "Unsupported distro version \"$debian_version\". Aborting ..."; exit 1;; esac + # Ubuntu ships with /etc/debian_version from Debian testing, hence we assume one version lower. + grep -q '^ID=ubuntu' /etc/os-release && ((G_DISTRO--)) + (( $G_DISTRO < 6 )) && { G_DIETPI-NOTIFY 1 'Unsupported Ubuntu version. Aborting ...'; exit 1; } fi case $G_HW_ARCH_NAME in 'armv6l') export G_HW_ARCH=1;; @@ -227,7 +230,7 @@ emulation=0 (( $G_HW_ARCH == $HW_ARCH || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $HW_ARCH ) )) || emulation=1 # Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: can neither be executed natively nor via qemu user emulation with binfmt_misc" -(( $emulation )) && { apackages+=('qemu-user-static'); (( $DISTRO == 6 )) && apackages+=('binfmt-support'); } +(( $emulation )) && { apackages+=('qemu-user-static'); (( $G_DISTRO < 7 )) && apackages+=('binfmt-support'); } # Virtual machine disk conversion [[ $VMTYPE && $VMTYPE != 'raw' ]] && apackages+=('qemu-utils') @@ -237,7 +240,7 @@ G_AG_CHECK_INSTALL_PREREQ --no-install-recommends parted mmdebstrap dbus systemd # Register QEMU binfmt configs if (( $emulation )) then - if (( $DISTRO == 6 )) + if (( $G_DISTRO < 7 )) then G_EXEC systemctl disable --now systemd-binfmt G_EXEC systemctl restart binfmt-support diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index 153565d5be..e4369281e0 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -33,6 +33,9 @@ '13.'*|'trixie/sid') G_DISTRO=8;; *) G_DIETPI-NOTIFY 1 "Unsupported distro version \"$debian_version\". Aborting ..."; exit 1;; esac + # Ubuntu ships with /etc/debian_version from Debian testing, hence we assume one version lower. + grep -q '^ID=ubuntu' /etc/os-release && ((G_DISTRO--)) + (( $G_DISTRO < 6 )) && { G_DIETPI-NOTIFY 1 'Unsupported Ubuntu version. Aborting ...'; exit 1; } fi readonly G_PROGRAM_NAME='DietPi-Imager' G_CHECK_ROOT_USER diff --git a/.build/software/Amiberry/container_build.bash b/.build/software/Amiberry/container_build.bash index 8a2b9c5102..c2c8cd7d8e 100755 --- a/.build/software/Amiberry/container_build.bash +++ b/.build/software/Amiberry/container_build.bash @@ -14,6 +14,16 @@ else . /tmp/dietpi-globals G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) + read -r debian_version < /etc/debian_version + case $debian_version in + '11.'*|'bullseye/sid') G_DISTRO=6;; + '12.'*|'bookworm/sid') G_DISTRO=7;; + '13.'*|'trixie/sid') G_DISTRO=8;; + *) G_DIETPI-NOTIFY 1 "Unsupported distro version \"$debian_version\". Aborting ..."; exit 1;; + esac + # Ubuntu ships with /etc/debian_version from Debian testing, hence we assume one version lower. + grep -q '^ID=ubuntu' /etc/os-release && ((G_DISTRO--)) + (( $G_DISTRO < 6 )) && { G_DIETPI-NOTIFY 1 'Unsupported Ubuntu version. Aborting ...'; exit 1; } fi case $G_HW_ARCH_NAME in 'armv6l') export G_HW_ARCH=1;; @@ -65,14 +75,14 @@ emulation=0 (( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || emulation=1 # Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: can neither be executed natively nor via qemu user emulation with binfmt_misc" -(( $emulation )) && { apackages+=('qemu-user-static'); [[ $DISTRO == 'bullseye' ]] && apackages+=('binfmt-support'); } +(( $emulation )) && { apackages+=('qemu-user-static'); (( $G_DISTRO < 7 )) && apackages+=('binfmt-support'); } G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" # Register QEMU binfmt configs if (( $emulation )) then - if [[ $DISTRO == 'bullseye' ]] + if (( $G_DISTRO < 7 )) then G_EXEC systemctl disable --now systemd-binfmt G_EXEC systemctl restart binfmt-support diff --git a/.build/software/dietpi-software-build.bash b/.build/software/dietpi-software-build.bash index 76da35068e..554c274e1f 100644 --- a/.build/software/dietpi-software-build.bash +++ b/.build/software/dietpi-software-build.bash @@ -14,6 +14,16 @@ else . /tmp/dietpi-globals G_EXEC rm /tmp/dietpi-globals export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) + read -r debian_version < /etc/debian_version + case $debian_version in + '11.'*|'bullseye/sid') G_DISTRO=6;; + '12.'*|'bookworm/sid') G_DISTRO=7;; + '13.'*|'trixie/sid') G_DISTRO=8;; + *) G_DIETPI-NOTIFY 1 "Unsupported distro version \"$debian_version\". Aborting ..."; exit 1;; + esac + # Ubuntu ships with /etc/debian_version from Debian testing, hence we assume one version lower. + grep -q '^ID=ubuntu' /etc/os-release && ((G_DISTRO--)) + (( $G_DISTRO < 6 )) && { G_DIETPI-NOTIFY 1 'Unsupported Ubuntu version. Aborting ...'; exit 1; } fi case $G_HW_ARCH_NAME in 'armv6l') export G_HW_ARCH=1;; @@ -69,14 +79,14 @@ emulation=0 (( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || emulation=1 # Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: can neither be executed natively nor via qemu user emulation with binfmt_misc" -(( $emulation )) && { apackages+=('qemu-user-static'); [[ $DISTRO == 'bullseye' ]] && apackages+=('binfmt-support'); } +(( $emulation )) && { apackages+=('qemu-user-static'); (( $G_DISTRO < 7 )) && apackages+=('binfmt-support'); } G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" # Register QEMU binfmt configs if (( $emulation )) then - if [[ $DISTRO == 'bullseye' ]] + if (( $G_DISTRO < 7 )) then G_EXEC systemctl disable --now systemd-binfmt G_EXEC systemctl restart binfmt-support diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index de53cc80bc..4dd6efdf90 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -13,6 +13,16 @@ else . /tmp/dietpi-globals G_EXEC rm /tmp/dietpi-globals export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) + read -r debian_version < /etc/debian_version + case $debian_version in + '11.'*|'bullseye/sid') G_DISTRO=6;; + '12.'*|'bookworm/sid') G_DISTRO=7;; + '13.'*|'trixie/sid') G_DISTRO=8;; + *) G_DIETPI-NOTIFY 1 "Unsupported distro version \"$debian_version\". Aborting ..."; exit 1;; + esac + # Ubuntu ships with /etc/debian_version from Debian testing, hence we assume one version lower. + grep -q '^ID=ubuntu' /etc/os-release && ((G_DISTRO--)) + (( $G_DISTRO < 6 )) && { G_DIETPI-NOTIFY 1 'Unsupported Ubuntu version. Aborting ...'; exit 1; } fi case $G_HW_ARCH_NAME in 'armv6l') export G_HW_ARCH=1;; @@ -266,14 +276,14 @@ emulation=0 (( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || emulation=1 # Bullseye/Jammy: binfmt-support still required for emulation. With systemd-binfmt only, mmdebstrap throws "E: can neither be executed natively nor via qemu user emulation with binfmt_misc" -(( $emulation )) && { apackages+=('qemu-user-static'); [[ $DISTRO == 'bullseye' ]] && apackages+=('binfmt-support'); } +(( $emulation )) && { apackages+=('qemu-user-static'); (( $G_DISTRO < 7 )) && apackages+=('binfmt-support'); } G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" # Register QEMU binfmt configs if (( $emulation )) then - if [[ $DISTRO == 'bullseye' ]] + if (( $G_DISTRO < 7 )) then G_EXEC systemctl disable --now systemd-binfmt G_EXEC systemctl restart binfmt-support From d27bc2c2a9b4e2b9f7410aa57de6250abccf7e9c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 17 Jun 2024 23:53:08 +0200 Subject: [PATCH 43/66] v9.6 - DietPi-Globals | G_CHECK_NET: Update command string in G_EXEC info and error output and error handler dialogue with the actually checked IP/domain --- dietpi/func/dietpi-globals | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 40d601b491..e7845822a9 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1137,6 +1137,7 @@ Press any key to continue...' { acommand[5]=$(sed -n '/^[[:blank:]]*CONFIG_CHECK_CONNECTION_IP=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) [[ ${acommand[5]} ]] || acommand[5]='9.9.9.9' + ecommand=${acommand[*]//\\/\\\\} } # Run check with given timeout and retries G_EXEC_RETRIES=$retries @@ -1165,6 +1166,7 @@ Press any key to continue...' G_GET_NET -6 -q gateway > /dev/null && [[ $(ip -6 -br a s scope global to 2000::/3 2> /dev/null) ]] || { exit_code=0; return 0; } acommand[5]=$(sed -n '/^[[:blank:]]*CONFIG_CHECK_CONNECTION_IPV6=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) [[ ${acommand[5]} ]] || acommand[5]='2620:fe::fe' + ecommand=${acommand[*]//\\/\\\\} } # Run check with given timeout and retries G_EXEC_RETRIES=$retries @@ -1187,6 +1189,7 @@ Press any key to continue...' { acommand[2]=$(sed -n '/^[[:blank:]]*CONFIG_CHECK_DNS_DOMAIN=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) [[ ${acommand[2]} ]] || acommand[2]='dns9.quad9.net' + ecommand=${acommand[*]//\\/\\\\} } # Run check with given retries G_EXEC_RETRIES=$retries From a636c0b4c7f20910baf1d1ef378a3ed453af2ff9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 18 Jun 2024 17:52:09 +0200 Subject: [PATCH 44/66] v9.6 - CI | Armbian: Use version 5.7.1 for Raspberry Pi 1, since the target has been removed with v6.7.2 --- .build/software/Amiberry/build.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.build/software/Amiberry/build.bash b/.build/software/Amiberry/build.bash index 61379b0115..7db831b63f 100755 --- a/.build/software/Amiberry/build.bash +++ b/.build/software/Amiberry/build.bash @@ -111,6 +111,8 @@ fi v_ami=$(curl -sSf 'https://api.github.com/repos/BlitterStudio/amiberry/releases/latest' | mawk -F\" '/^ "tag_name"/{print $4}') [[ $v_ami ]] || { G_DIETPI-NOTIFY 1 'No latest Amiberry version found, aborting ...'; exit 1; } v_ami=${v_ami#v} +# - ARMv6: v5.7.2 dropped support for Raspberry Pi 1, hence use v5.7.1 +[[ $PLATFORM == 'rpi1'* ]] && v_ami='5.7.1' G_DIETPI-NOTIFY 2 "Building Amiberry version \e[33m$v_ami\e[90m for platform: \e[33m$PLATFORM" G_EXEC cd /tmp G_EXEC curl -sSfLO "https://github.com/BlitterStudio/amiberry/archive/v$v_ami.tar.gz" From 8d25254ac27df1c7fbad42345880ff2c1c883505 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 18 Jun 2024 17:56:04 +0200 Subject: [PATCH 45/66] v9.6 - DietPi-Software | Box86/64: Update code for cleaner/complete uninstall, including de-registration from binfmt and cleanup of working dir on install. For Box64, on RPi 2 with BCM2710 (ARMv8, PCB v1.2) use RPi 3 target, which has the same SoC. --- dietpi/dietpi-software | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b7693bfdc4..3aa24b368d 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11050,6 +11050,10 @@ _EOF_ G_EXEC strip --remove-section=.comment --remove-section=.note box86 G_EXEC make install + # Cleanup + G_EXEC cd "$G_WORKING_DIR" + G_EXEC rm "box86-${version#v}" + # Reload binfmt if kernel module is available to have i386 binaries executed via box86 automatically from now on modprobe binfmt_misc 2> /dev/null && G_EXEC systemctl restart systemd-binfmt fi @@ -11071,8 +11075,8 @@ _EOF_ if (( $G_HW_ARCH == 11 )) then G_EXEC cmake .. -DNOGIT=1 -DCMAKE_BUILD_TYPE=Release -DRV64=1 - # - RPi 3 - elif (( $G_HW_MODEL == 3 )) + # - RPi 2/3 + elif (( $G_HW_MODEL == 2 || $G_HW_MODEL == 3 )) then G_EXEC cmake .. -DNOGIT=1 -DCMAKE_BUILD_TYPE=Release -DRPI3ARM64=1 # - RPi 4 @@ -11103,6 +11107,10 @@ _EOF_ G_EXEC strip --remove-section=.comment --remove-section=.note box64 G_EXEC make install + # Cleanup + G_EXEC cd "$G_WORKING_DIR" + G_EXEC rm "box64-${version#v}" + # Reload binfmt if kernel module is available to have x86_64 binaries executed via box64 automatically from now on modprobe binfmt_misc 2> /dev/null && G_EXEC systemctl restart systemd-binfmt fi @@ -12921,20 +12929,25 @@ If no WireGuard (auto)start is included, but you require it, please do the follo if To_Uninstall 62 # Box86 then - [[ -f '/usr/local/bin/box86' ]] && G_EXEC rm /usr/local/bin/box86 [[ -f '/etc/binfmt.d/box86.conf' ]] && G_EXEC rm /etc/binfmt.d/box86.conf - [[ -f '/usr/lib/i386-linux-gnu/libstdc++.so.6' ]] && G_EXEC rm /usr/lib/i386-linux-gnu/libstdc++.so.6 - [[ -f '/usr/lib/i386-linux-gnu/libstdc++.so.5' ]] && G_EXEC rm /usr/lib/i386-linux-gnu/libstdc++.so.5 - [[ -f '/usr/lib/i386-linux-gnu/libgcc_s.so.1' ]] && G_EXEC rm /usr/lib/i386-linux-gnu/libgcc_s.so.1 + [[ -d '/proc/sys/fs/binfmt_misc' ]] && G_EXEC systemctl restart systemd-binfmt + [[ -f '/usr/local/bin/box86' ]] && G_EXEC rm /usr/local/bin/box86 + for i in /usr/lib/i386-linux-gnu/lib{gcc_s,png12,stdc++,unwind}.so* + do + [[ -e $i ]] && ! dpkg-query -S "$i" &> /dev/null && G_EXEC rm "$i" + done [[ -d '/usr/lib/i386-linux-gnu' ]] && G_EXEC rmdir --ignore-fail-on-non-empty /usr/lib/i386-linux-gnu fi if To_Uninstall 197 # Box64 then - [[ -f '/usr/local/bin/box64' ]] && G_EXEC rm /usr/local/bin/box64 [[ -f '/etc/binfmt.d/box64.conf' ]] && G_EXEC rm /etc/binfmt.d/box64.conf - [[ -f '/usr/lib/x86_64-linux-gnu/libstdc++.so.6' ]] && G_EXEC rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6 - [[ -f '/usr/lib/x86_64-linux-gnu/libgcc_s.so.1' ]] && G_EXEC rm /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 + [[ -d '/proc/sys/fs/binfmt_misc' ]] && G_EXEC systemctl restart systemd-binfmt + [[ -f '/usr/local/bin/box64' ]] && G_EXEC rm /usr/local/bin/box64 + for i in /usr/lib/x86_64-linux-gnu/lib{crypto,gcc_s,mbed,png12,ssl,stdc++,unwind}* + do + [[ -e $i ]] && ! dpkg-query -S "$i" &> /dev/null && G_EXEC rm "$i" + done [[ -d '/usr/lib/x86_64-linux-gnu' ]] && G_EXEC rmdir --ignore-fail-on-non-empty /usr/lib/x86_64-linux-gnu fi From b119f41f1f54f5f2489a9601b4a66e10adb4a216 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 18 Jun 2024 20:26:13 +0200 Subject: [PATCH 46/66] v9.6 - DietPi-Software | ruTorrent: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3aa24b368d..268c314171 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8528,7 +8528,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.3.3'; 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.3.4'; 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 From 42aec57ea7f0b3a215e724b73a98d69f085037dd Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 18 Jun 2024 12:15:05 -0700 Subject: [PATCH 47/66] v9.6 (#7115) - DietPi-Software | ADS-B Feeder: Newer versions of the Feeder Image no longer have the adsb-nonimage service. So don't try to start it. Signed-off-by: Dirk Hohndel --- dietpi/dietpi-software | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 268c314171..a4e0944e87 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11931,11 +11931,6 @@ _EOF_ # finally ensure that /run allows executables (this is needed for the containers to be able to not do excessive # writes to physical storage - which might be an SD card) G_EXEC mount -o remount,exec /run - - # now that everything is in place, run the one time service to get the software pre-configured - # running this as a service allows it to do a bit of housekeeping in the background without disrupting - # the software install flow - G_EXEC systemctl start adsb-nonimage fi if To_Install 172 # WireGuard From 7982c249029bba9c899fd1d83d40973a2a528cc3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 19 Jun 2024 22:02:54 +0200 Subject: [PATCH 48/66] v9.6 (#7118) - DietPi-Config | Some updates: Align coding. Hide LED control option on container images. Remove legacy Odroid C2 resolution and GPU memory split options. Add gateway/router and local DNS resolver to static DNS selection menu, when detected. --- CHANGELOG.txt | 2 + dietpi/dietpi-config | 546 ++++++++++++++----------------------------- 2 files changed, 183 insertions(+), 365 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5dc6524597..01949cb322 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,8 @@ Enhancements: - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 - Quartz64/Star64/VisionFive 2 | eBPF functionality for firewall and network monitoring software like Cilium has been added to our kernel builds for these SBCs. Many thanks to @kbrighton for reporting these missing features: https://github.com/MichaIng/DietPi/issues/6834 - Orange Pi 5 | Older U-Boot builds caused the Ethernet MAC address to be random and change on every boot. Recent U-Boot builds solve this, but they are not flashed automatically on package upgrades. We hence inform users and offer to flash the latest U-Boot image during the DietPi update. Many thanks to @thuehlinger for reporting and testing the case: https://github.com/MichaIng/DietPi/issues/6663 +- DietPi-Config | Legacy Odroid C2 resolution and GPU memory options have been removed. +- DietPi-Config | The static DNS server menu now contains entries to select the default gateway/router or locally running DNS resolver (Pi-hole, AdGuard Home, Unbound, systemd-resolvd, ...), if detected. Bug fixes: - Network | Resolved a rare issue, where shutdowns could hang, when networking.service and ifup@.service instances try to bring down the same network interface concurrently. Many thanks to @ioctl2 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7104 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 0fd4369391..97b81a64c4 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -58,14 +58,12 @@ Menu_Main() { G_WHIP_MENU_ARRAY=( - '1' ': Display Options' '2' ': Audio Options' ) # Hide performance options on VM and container (( $G_HW_MODEL == 20 || $G_HW_MODEL == 75 )) || G_WHIP_MENU_ARRAY+=('3' ': Performance Options') G_WHIP_MENU_ARRAY+=( - '4' ': Advanced Options' '5' ': Language/Regional Options' '6' ': Security Options' @@ -92,23 +90,22 @@ esac } + # $1: 0=landscape 1=portrait Display_Rotation_Calc_XY_Invert() { - # 0=landscape 1=portrait - local input=$1 - local framebuffer_x=$(grep -m1 '^[[:blank:]]*framebuffer_width=' /boot/config.txt || vcgencmd get_config framebuffer_width) framebuffer_x=${framebuffer_x#*=}; framebuffer_x=${framebuffer_x:-0} local framebuffer_y=$(grep -m1 '^[[:blank:]]*framebuffer_height=' /boot/config.txt || vcgencmd get_config framebuffer_height) framebuffer_y=${framebuffer_y#*=}; framebuffer_y=${framebuffer_y:-0} + # 0/180 landscape - if (( $input == 0 && $framebuffer_x < $framebuffer_y )) + if (( $1 == 0 && $framebuffer_x < $framebuffer_y )) then G_CONFIG_INJECT 'framebuffer_width=' "framebuffer_width=$framebuffer_y" /boot/config.txt G_CONFIG_INJECT 'framebuffer_height=' "framebuffer_height=$framebuffer_x" /boot/config.txt # 90/270 portrait - elif (( $input == 1 && $framebuffer_x > $framebuffer_y )) + elif (( $1 == 1 && $framebuffer_x > $framebuffer_y )) then G_CONFIG_INJECT 'framebuffer_width=' "framebuffer_width=$framebuffer_y" /boot/config.txt G_CONFIG_INJECT 'framebuffer_height=' "framebuffer_height=$framebuffer_x" /boot/config.txt @@ -118,34 +115,35 @@ # TARGETMENUID=1 Menu_DisplayOptions() { - if (( $G_HW_MODEL == 21 )); then - + # Driver/Resolution + if (( $G_HW_MODEL == 21 )) + then G_WHIP_MENU_ARRAY=('1' ': Display Driver') - else - G_WHIP_MENU_ARRAY=('1' ': Display Resolution') - (( $G_HW_MODEL < 10 || $G_HW_MODEL == 12 )) && G_WHIP_MENU_ARRAY+=('2' ': GPU/RAM Memory Split') - if (( $G_HW_MODEL < 20 )) then local lcdpanel_text=$(sed -n '/^[[:blank:]]*CONFIG_LCDPANEL=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) G_WHIP_MENU_ARRAY+=('3' ": LCD/OLED Panel addon: [${lcdpanel_text:=none}]") fi - fi - # Display brightness + # Brightness G_WHIP_MENU_ARRAY+=('16' ': Display Brightness') + # X11 DPI local xorg_dpi_current=$(sed -n '/^[[:blank:]]*SOFTWARE_XORG_DPI=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) G_WHIP_MENU_ARRAY+=('17' ": X.Org DPI: [${xorg_dpi_current:-N/A}]") - (( $G_HW_MODEL == 20 )) || G_WHIP_MENU_ARRAY+=('14' ': LED Control') + # LED control: Hide on VM/container + (( $G_HW_MODEL == 20 || $G_HW_MODEL == 75 )) || G_WHIP_MENU_ARRAY+=('14' ': LED Control') # RPi only - if (( $G_HW_MODEL < 10 )); then + if (( $G_HW_MODEL < 10 )) + then + # GPU memory split + G_WHIP_MENU_ARRAY+=('2' ': GPU/RAM memory split') # HDMI rotation local rotation_hdmi_current=$(sed -n '/^[[:blank:]]*display_hdmi_rotate=/{s/^[^=]*=//p;q}' /boot/config.txt) @@ -161,23 +159,21 @@ (( $overscan_disabled )) && overscan_text='Off' G_WHIP_MENU_ARRAY+=('6' ": Overscan : [$overscan_text]") # - Overscan sizes - if (( ! $overscan_disabled )); then - + if (( ! $overscan_disabled )) + then local overscan_options=('overscan_left' 'overscan_right' 'overscan_top' 'overscan_bottom') local overscan_left=$(grep -m1 '^[[:blank:]]*overscan_left=' /boot/config.txt || vcgencmd get_config overscan_left); overscan_left=${overscan_left#*=} local overscan_right=$(grep -m1 '^[[:blank:]]*overscan_right=' /boot/config.txt || vcgencmd get_config overscan_right); overscan_right=${overscan_right#*=} local overscan_top=$(grep -m1 '^[[:blank:]]*overscan_top=' /boot/config.txt || vcgencmd get_config overscan_top); overscan_top=${overscan_top#*=} local overscan_bottom=$(grep -m1 '^[[:blank:]]*overscan_bottom=' /boot/config.txt || vcgencmd get_config overscan_bottom); overscan_bottom=${overscan_bottom#*=} G_WHIP_MENU_ARRAY+=('15' ": Overscan Compensation [L:${overscan_left:-N/A}] [R:${overscan_right:-N/A}] [T:${overscan_top:-N/A}] [B:${overscan_bottom:-N/A}]") - fi # HDMI signal boost, RPi up to 3 only - if (( $G_HW_MODEL < 4 )); then - + if (( $G_HW_MODEL < 4 )) + then local hdmi_boost_current=$(grep -m1 '^[[:blank:]]*config_hdmi_boost=' /boot/config.txt || vcgencmd get_config config_hdmi_boost); hdmi_boost_current=${hdmi_boost_current#*=} G_WHIP_MENU_ARRAY+=('7' ": HDMI Boost : [${hdmi_boost_current:-N/A}]") - fi # RPi codecs @@ -211,8 +207,8 @@ G_WHIP_MENU_ARRAY+=('13' ": MPEG2 Key : [${mpeg2_key_current:-none}]") # Odroids only - elif (( $G_HW_MODEL < 13 )); then - + elif (( $G_HW_MODEL < 13 )) + then # Remote local odroid_remote_text='Off' local odroid_remote_enabled=0 @@ -222,17 +218,14 @@ odroid_remote_enabled=1 fi G_WHIP_MENU_ARRAY+=('10' ": Odroid remote : [$odroid_remote_text]") - fi G_WHIP_DEFAULT_ITEM=$WHIP_SELECTION_PREVIOUS - G_WHIP_MENU 'Please select an option:' || { Back_or_Exit 0; return 0; } # Main menu - WHIP_SELECTION_PREVIOUS=$G_WHIP_RETURNED_VALUE - if (( $G_WHIP_RETURNED_VALUE == 15 )); then - + if (( $G_WHIP_RETURNED_VALUE == 15 )) + then for i in "${overscan_options[@]}" do G_WHIP_DEFAULT_ITEM=${!i} @@ -242,25 +235,22 @@ REBOOT_REQUIRED=1 done - elif (( $G_WHIP_RETURNED_VALUE == 1 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 1 )) + then TARGETMENUID=2 - elif (( $G_WHIP_RETURNED_VALUE == 3 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 3 )) + then G_WHIP_MENU_ARRAY=('none' ': Uninstall all panels') G_WHIP_MENU_ARRAY+=('waveshare32' ': 320x240 panel with touch input') - if (( $G_HW_MODEL < 10 )); then - + if (( $G_HW_MODEL < 10 )) + then G_WHIP_MENU_ARRAY+=('esp01215e' ': Elecrow 1024x600 7" IPS HDMI panel with touch input') G_WHIP_MENU_ARRAY+=('allo-boss2-oled' ': Allo Boss2 DAC OLED display') - else - G_WHIP_MENU_ARRAY+=('odroid-lcd35' ': 480x320 panel with touch input') (( $G_HW_MODEL == 11 )) && G_WHIP_MENU_ARRAY+=('odroid-cloudshell' ': 320x240 panel' 'odroid-cloudshell2' ': Odroid XU4 CloudShell 2 LCD') - fi G_WHIP_DEFAULT_ITEM=$lcdpanel_text @@ -268,32 +258,27 @@ /boot/dietpi/func/dietpi-set_hardware lcdpanel "$G_WHIP_RETURNED_VALUE" && REBOOT_REQUIRED=1 - elif (( $G_WHIP_RETURNED_VALUE == 2 )); then - - G_WHIP_MSG 'GPU/RAM Memory splits are pre-configured and applied during DietPi-Software setup.\n\nThe split value is optimized based on your software installs, however, feel free to tweak them.' + elif (( $G_WHIP_RETURNED_VALUE == 2 )) + then TARGETMENUID=6 - elif (( $G_WHIP_RETURNED_VALUE == 6 )); then - - if (( $overscan_disabled )); then - + elif (( $G_WHIP_RETURNED_VALUE == 6 )) + then + if (( $overscan_disabled )) + then G_CONFIG_INJECT 'disable_overscan=' 'disable_overscan=0' /boot/config.txt - else - G_CONFIG_INJECT 'disable_overscan=' 'disable_overscan=1' /boot/config.txt for i in "${overscan_options[@]}" do sed --follow-symlinks -i "/^[[:blank:]]*$i=/c\#$i=0" /boot/config.txt done - fi REBOOT_REQUIRED=1 - elif (( $G_WHIP_RETURNED_VALUE == 7 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 7 )) + then G_WHIP_MENU_ARRAY=( - '0' ': Disabled' '2' ': RPi 1 A/B Default' '5' ': RPi 1+/2/3 Default' @@ -311,49 +296,47 @@ A long (or insufficiently manufactured) cable may required a higher boost settin G_CONFIG_INJECT 'config_hdmi_boost=' "config_hdmi_boost=$G_WHIP_RETURNED_VALUE" /boot/config.txt && REBOOT_REQUIRED=1 - elif (( $G_WHIP_RETURNED_VALUE == 18 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 18 )) + then /boot/dietpi/func/dietpi-set_hardware rpi-codec $(( ! $rpi_codecs_enabled )) && REBOOT_REQUIRED=1 - elif (( $G_WHIP_RETURNED_VALUE == 8 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 8 )) + then /boot/dietpi/func/dietpi-set_hardware rpi-camera $(( ! $rpi_camera_module_enabled )) && REBOOT_REQUIRED=1 - elif (( $G_WHIP_RETURNED_VALUE == 9 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 9 )) + then G_CONFIG_INJECT 'disable_camera_led=' "disable_camera_led=$(( ! $rpi_camera_led_disabled ))" /boot/config.txt && REBOOT_REQUIRED=1 - elif (( $G_WHIP_RETURNED_VALUE == 10 )); then - - if (( $odroid_remote_enabled )); then - + elif (( $G_WHIP_RETURNED_VALUE == 10 )) + then + if (( $odroid_remote_enabled )) + then /boot/dietpi/func/dietpi-set_hardware remoteir none && REBOOT_REQUIRED=1 elif G_WHIP_YESNO 'This will enable the IR modules, setup Lirc and the Odroid Remote for Odroid C1, C2 and XU4 CloudShell. -\nNB: Other remotes can be configured by running "irrecord" and applying the codes to "/etc/lirc/lircd.conf"\n\nDo you wish to continue?'; then - +\nNB: Other remotes can be configured by running "irrecord" and applying the codes to "/etc/lirc/lircd.conf"\n\nDo you wish to continue?' + then /boot/dietpi/func/dietpi-set_hardware remoteir odroid_remote && REBOOT_REQUIRED=1 - fi - elif (( $G_WHIP_RETURNED_VALUE == 11 )); then - - if (( $justboom_ir_remote_enabled )); then - + elif (( $G_WHIP_RETURNED_VALUE == 11 )) + then + if (( $justboom_ir_remote_enabled )) + then /boot/dietpi/func/dietpi-set_hardware remoteir none && REBOOT_REQUIRED=1 elif G_WHIP_YESNO 'Got a JustBoom IR Remote? Excellent! -\nDietPi will enable the IR modules, setup Lirc and enable support for MPD controls by default:\n\nDo you wish to continue?'; then - +\nDietPi will enable the IR modules, setup Lirc and enable support for MPD controls by default:\n\nDo you wish to continue?' + then /boot/dietpi/func/dietpi-set_hardware remoteir justboom_ir_remote && REBOOT_REQUIRED=1 - fi - elif (( $G_WHIP_RETURNED_VALUE == 12 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 12 )) + then G_WHIP_DEFAULT_ITEM=$vc1_key_current - if G_WHIP_INPUTBOX 'Please enter your key for VC1:\n - EG: 0x00000000'; then - + if G_WHIP_INPUTBOX 'Please enter your key for VC1:\n - EG: 0x00000000' + then G_CONFIG_INJECT 'decode_WVC1=' "decode_WVC1=$G_WHIP_RETURNED_VALUE" /boot/config.txt # https://github.com/MichaIng/DietPi/issues/1487 @@ -361,14 +344,13 @@ A long (or insufficiently manufactured) cable may required a higher boost settin (( ${current_gpu_mem:=76} < 96 )) && /boot/dietpi/func/dietpi-set_hardware gpumemsplit 96 REBOOT_REQUIRED=1 - fi - elif (( $G_WHIP_RETURNED_VALUE == 13 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 13 )) + then G_WHIP_DEFAULT_ITEM=$mpeg2_key_current - if G_WHIP_INPUTBOX 'Please enter your key for MPEG2:\n - EG: 0x00000000'; then - + if G_WHIP_INPUTBOX 'Please enter your key for MPEG2:\n - EG: 0x00000000' + then G_CONFIG_INJECT 'decode_MPG2=' "decode_MPG2=$G_WHIP_RETURNED_VALUE" /boot/config.txt # https://github.com/MichaIng/DietPi/issues/1487 @@ -376,13 +358,11 @@ A long (or insufficiently manufactured) cable may required a higher boost settin (( ${current_gpu_mem:=76} < 96 )) && /boot/dietpi/func/dietpi-set_hardware gpumemsplit 96 REBOOT_REQUIRED=1 - fi - elif (( $G_WHIP_RETURNED_VALUE == 4 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 4 )) + then G_WHIP_MENU_ARRAY=( - '0' ': Disabled (default)' '1' ': 90 degrees' '2' ': 180 degrees' @@ -408,8 +388,8 @@ A long (or insufficiently manufactured) cable may required a higher boost settin fi REBOOT_REQUIRED=1 - elif (( $G_WHIP_RETURNED_VALUE == 5 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 5 )) + then G_WHIP_MENU_ARRAY=( '0' ': Disabled (default)' @@ -417,18 +397,17 @@ A long (or insufficiently manufactured) cable may required a higher boost settin ) G_WHIP_DEFAULT_ITEM=$rotation_lcd_current - if G_WHIP_MENU 'Please select an option:\n\nNB: This option is for RPi touchscreen.'; then - + if G_WHIP_MENU 'Please select an option:\n\nNB: This option is for RPi touchscreen.' + then G_CONFIG_INJECT 'lcd_rotate=' "lcd_rotate=$G_WHIP_RETURNED_VALUE" /boot/config.txt && REBOOT_REQUIRED=1 - fi - elif (( $G_WHIP_RETURNED_VALUE == 14 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 14 )) + then /boot/dietpi/dietpi-led_control - elif (( $G_WHIP_RETURNED_VALUE == 16 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 16 )) + then # Find and obtain values for all backlight devices local fp_brightness iTotalAvailable=0 aFp_Brightness_Available=() aBrightness_Name=() aBrightness_Current=() aBrightness_Max=() for fp_brightness in /sys/class/backlight/* @@ -494,10 +473,9 @@ A long (or insufficiently manufactured) cable may required a higher boost settin Info_HW_OptionNotSupported fi - elif (( $G_WHIP_RETURNED_VALUE == 17 )); then - + elif (( $G_WHIP_RETURNED_VALUE == 17 )) + then G_WHIP_MENU_ARRAY=( - '96' ': Default' '120' ": +25% larger" '144' ": +50% larger" @@ -509,31 +487,28 @@ A long (or insufficiently manufactured) cable may required a higher boost settin if G_WHIP_MENU "Please select a DPI value for Xorg: - A higher value will make text and windows larger - Has no effect on local terminal (eg: no desktop installed) - \nNB: Setting will only take effect, once system is restarted."; then - + \nNB: Setting will only take effect, once system is restarted." + then G_CONFIG_INJECT 'SOFTWARE_XORG_DPI=' "SOFTWARE_XORG_DPI=$G_WHIP_RETURNED_VALUE" /boot/dietpi.txt G_EXEC mkdir -p /etc/X11/Xsession.d echo "xrandr --dpi $G_WHIP_RETURNED_VALUE" > /etc/X11/Xsession.d/99-dietpi-dpi REBOOT_REQUIRED=1 - fi - fi } # TARGETMENUID=2 - Menu_DisplayOptions_Driver_Resolution(){ - + Menu_DisplayOptions_Driver_Resolution() + { G_WHIP_BUTTON_CANCEL_TEXT='Cancel' # VM - if (( $G_HW_MODEL == 20 )); then - + if (( $G_HW_MODEL == 20 )) + then local current=$(sed -n '/^[[:blank:]]*GRUB_GFXMODE=/{s/^[^=]*=//p;q}' /etc/default/grub) [[ $current ]] || current='System default' G_WHIP_MENU_ARRAY=( - 'System default' '' '1600x1200' '' '1280x1024' '' @@ -547,23 +522,20 @@ A long (or insufficiently manufactured) cable may required a higher boost settin \nNB: This only affects the virtual screen resolution, not the SSH session. You might need to increase the maximum guest screen resolution within your VM software." || { Back_or_Exit 1; return 0; } # Display Options - if [[ $G_WHIP_RETURNED_VALUE == 'System default' ]]; then - + if [[ $G_WHIP_RETURNED_VALUE == 'System default' ]] + then sed --follow-symlinks -i 's/^[[:blank:]]*GRUB_GFXMODE=/#GRUB_GFXMODE=/' /etc/default/grub sed --follow-symlinks -i 's/^[[:blank:]]*GRUB_GFXPAYLOAD_LINUX=/#GRUB_GFXPAYLOAD_LINUX=/' /etc/default/grub - else - G_CONFIG_INJECT 'GRUB_GFXMODE=' "GRUB_GFXMODE=$G_WHIP_RETURNED_VALUE" /etc/default/grub G_CONFIG_INJECT 'GRUB_GFXPAYLOAD_LINUX=' 'GRUB_GFXPAYLOAD_LINUX=keep' /etc/default/grub 'GRUB_GFXMODE=' - fi update-grub # Native PC - elif (( $G_HW_MODEL == 21 )); then - + elif (( $G_HW_MODEL == 21 )) + then local gpu_current=$(sed -n '/^[[:blank:]]*CONFIG_GPU_DRIVER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) gpu_current=${gpu_current,,} local driver_installed=() @@ -596,7 +568,6 @@ A long (or insufficiently manufactured) cable may required a higher boost settin fi G_WHIP_MENU_ARRAY=( - 'Nvidia' ": ${driver_installed[0]} | Proprietary GPU driver" 'Intel' ": ${driver_installed[1]} | Open-Source VA-API GPU drivers" 'AMD' ": ${driver_installed[2]} | Proprietary GPU driver" @@ -625,25 +596,23 @@ A long (or insufficiently manufactured) cable may required a higher boost settin fi # RPi - elif (( $G_HW_MODEL < 10 )); then - + elif (( $G_HW_MODEL < 10 )) + then local framebuffer_x=$(grep -m1 '^[[:blank:]]*framebuffer_width=' /boot/config.txt || vcgencmd get_config framebuffer_width) framebuffer_x=${framebuffer_x#*=}; framebuffer_x=${framebuffer_x:-0} local framebuffer_y=$(grep -m1 '^[[:blank:]]*framebuffer_height=' /boot/config.txt || vcgencmd get_config framebuffer_height) framebuffer_y=${framebuffer_y#*=}; framebuffer_y=${framebuffer_y:-0} local current_value=$(sed -n '/^[[:blank:]]*dtoverlay=vc4-/{s/^[^=]*=//p;q}' /boot/config.txt) # OpenGL check 1st - if [[ ! $current_value ]]; then - + if [[ ! $current_value ]] + then # Framebuffer current_value="$framebuffer_x X $framebuffer_y" # Check for headless grep -q '^[[:blank:]]*AUTO_SETUP_HEADLESS=1' /boot/dietpi.txt && current_value='Headless' - fi G_WHIP_MENU_ARRAY=( - 'vc4-kms-v3d' ': OpenGL | 1920 x 1080' 'vc4-fkms-v3d' ': OpenGL | 1920 x 1080' '1080p' ': 1920 x 1080' @@ -667,8 +636,8 @@ A long (or insufficiently manufactured) cable may required a higher boost settin REBOOT_REQUIRED=1 # Enable headless if chosen, else always disable - if [[ $G_WHIP_RETURNED_VALUE == 'Headless' ]]; then - + if [[ $G_WHIP_RETURNED_VALUE == 'Headless' ]] + then G_WHIP_YESNO 'Using the Headless option will: - Disable HDMI and composite output - Disable the framebuffer @@ -680,91 +649,42 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the - In dietpi.txt, set "AUTO_SETUP_HEADLESS=0".' || { REBOOT_REQUIRED=0; return; } /boot/dietpi/func/dietpi-set_hardware headless 1 - else - /boot/dietpi/func/dietpi-set_hardware headless 0 - fi # Disable composite if not chosen - if [[ $G_WHIP_RETURNED_VALUE != 'sdtv_mode'* ]]; then - + if [[ $G_WHIP_RETURNED_VALUE != 'sdtv_mode'* ]] + then sed --follow-symlinks -i '/sdtv_mode=/c\#sdtv_mode=0' /boot/config.txt sed --follow-symlinks -i '/enable_tvout=/c\#enable_tvout=0' /boot/config.txt - fi # Disable OpenGL if not chosen [[ $G_WHIP_RETURNED_VALUE == 'vc4-'* ]] || /boot/dietpi/func/dietpi-set_hardware rpi-opengl disable - if [[ $G_WHIP_RETURNED_VALUE == 'vc4-'* ]]; then - + if [[ $G_WHIP_RETURNED_VALUE == 'vc4-'* ]] + then /boot/dietpi/func/dietpi-set_hardware rpi-opengl "$G_WHIP_RETURNED_VALUE" - elif [[ $G_WHIP_RETURNED_VALUE != 'Headless' ]]; then - + elif [[ $G_WHIP_RETURNED_VALUE != 'Headless' ]] + then case "$G_WHIP_RETURNED_VALUE" in - 'sdtv_mode'*) - # Enable SDTV on RPi4, apply to all RPi to allow SD card switch G_CONFIG_INJECT 'enable_tvout=' 'enable_tvout=1' /boot/config.txt G_CONFIG_INJECT 'sdtv_mode=' "$G_WHIP_RETURNED_VALUE" /boot/config.txt - framebuffer_x=720 - framebuffer_y=576 - ;; - - 'DietPi-CloudShell') - - framebuffer_x=320 - framebuffer_y=240 + framebuffer_x=720 framebuffer_y=576 ;; - - '1080p') - - framebuffer_x=1920 - framebuffer_y=1080 - ;; - - '720p') - - framebuffer_x=1280 - framebuffer_y=720 - ;; - - '480p') - - framebuffer_x=854 - framebuffer_y=480 - ;; - - 'RPi Touchscreen') - - framebuffer_x=800 - framebuffer_y=480 - ;; - - 'PC1') - - framebuffer_x=1024 - framebuffer_y=768 - ;; - - 'PC2') - - framebuffer_x=800 - framebuffer_y=640 - ;; - - 'PC3') - - framebuffer_x=640 - framebuffer_y=480 - ;; - + 'DietPi-CloudShell') framebuffer_x=320 framebuffer_y=240;; + '1080p') framebuffer_x=1920 framebuffer_y=1080;; + '720p') framebuffer_x=1280 framebuffer_y=720;; + '480p') framebuffer_x=854 framebuffer_y=480;; + 'RPi Touchscreen') framebuffer_x=800 framebuffer_y=480;; + 'PC1') framebuffer_x=1024 framebuffer_y=768;; + 'PC2') framebuffer_x=800 framebuffer_y=640;; + 'PC3') framebuffer_x=640 framebuffer_y=480;; *) :;; - esac # Apply framebuffer size and Chromium autostart resolution @@ -772,30 +692,22 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the G_CONFIG_INJECT 'framebuffer_height=' "framebuffer_height=$framebuffer_y" /boot/config.txt G_CONFIG_INJECT 'SOFTWARE_CHROMIUM_RES_X=' "SOFTWARE_CHROMIUM_RES_X=$framebuffer_x" /boot/dietpi.txt G_CONFIG_INJECT 'SOFTWARE_CHROMIUM_RES_Y=' "SOFTWARE_CHROMIUM_RES_Y=$framebuffer_y" /boot/dietpi.txt - fi # Odroid XU4 - elif (( $G_HW_MODEL == 11 )); then - + elif (( $G_HW_MODEL == 11 )) + then # Get Current Values local current_resolution=$(grep -Em1 'setenv[[:blank:]]+videoconfig[[:blank:]]' /boot/boot.ini) - if [[ $current_resolution == *'1920x1080'* ]]; then - - current_resolution='1080p' - - elif [[ $current_resolution == *'1280x720'* ]]; then - - current_resolution='720p' - - elif [[ $current_resolution == *'720x480'* ]]; then - - current_resolution='480p' - - fi + case $current_resolution in + *'1920x1080'*) current_resolution='1920x1080';; + *'1280x720'*) current_resolution='1280x720';; + *'720x480'*) current_resolution='720x480';; + *'1024x600'*) current_resolution='1024x600';; + *) :;; + esac G_WHIP_MENU_ARRAY=( - '1920x1080' ': 1080p' '1280x720' ': 720p' '720x480' ': 480p' @@ -805,8 +717,6 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the G_WHIP_DEFAULT_ITEM=$current_resolution G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $current_resolution" || { Back_or_Exit 1; return 0; } # Display Options - REBOOT_REQUIRED=1 - # DVI or HDMI if [[ $G_WHIP_RETURNED_VALUE == '1024x600' ]] then @@ -817,56 +727,11 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the G_CONFIG_INJECT 'setenv[[:blank:]]+videoconfig[[:blank:]]' "setenv videoconfig \"drm_kms_helper.edid_firmware=edid/$G_WHIP_RETURNED_VALUE.bin\"" /boot/boot.ini 'ODROIDXU-UBOOT-CONFIG' - # Odroid C2 legacy - elif [[ $G_HW_MODEL == 12 && -f '/boot/boot.ini' ]]; then - - # Get Current Values - local current_resolution=$(mawk -F '"' '/setenv m "/{print $2;exit}' /boot/boot.ini | sed 's/p/p /') - # - NB: also added space after xxxp, so its easier to read, and selects default item. - - G_WHIP_MENU_ARRAY=( - - '2160p 60hz' ': 4K (Recommended)' - '2160p 50hz' ': 4K' - '2160p 30hz' ': 4K' - '2160p 25hz' ': 4K' - '2160p 24hz' ': 4K' - '1080p 60hz' ': 1080p (Recommended)' - '1080p 50hz' ': 1080p' - '1080p 24hz' ': 1080p' - '720p 60hz' ': 720p (Recommended)' - '720p 50hz' ': 720p' - '480p 60hz' ': 480p' - '1024x600p 60hz' ': VU7+' - '1024x768p 60hz' ': 4:3' - '800x600p 60hz' ': 4:3' - ) - - G_WHIP_DEFAULT_ITEM=$current_resolution - G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $current_resolution" || { Back_or_Exit 1; return 0; } # Display Options - - [[ $current_resolution != "$G_WHIP_RETURNED_VALUE" ]] && REBOOT_REQUIRED=1 - - # Always reset vga/dvi options - sed --follow-symlinks -Ei 's/^[[:blank:]]*(setenv[[:blank:]]+vout[[:blank:]].*$)/#\1/' /boot/boot.ini - - # DVI / VU7+ - if [[ $G_WHIP_RETURNED_VALUE == '1024x600p 60hz' ]]; then - - # DVI mode - G_CONFIG_INJECT 'setenv[[:blank:]]+vout[[:blank:]]' 'setenv vout "dvi"' /boot/boot.ini 'ODROIDC2-UBOOT-CONFIG' - - fi - - # Remove the space from option - local temp_string=${G_WHIP_RETURNED_VALUE//[[:blank:]]/} - - G_CONFIG_INJECT 'setenv[[:blank:]]+m[[:blank:]]' "setenv m \"$temp_string\"" /boot/boot.ini 'ODROIDC2-UBOOT-CONFIG' + REBOOT_REQUIRED=1 else Info_HW_OptionNotSupported Back_or_Exit 1 # Display Options fi - } # TARGETMENUID=19 @@ -1725,79 +1590,30 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will # TARGETMENUID=6 Menu_GpumemoryOptions() { - G_WHIP_BUTTON_CANCEL_TEXT='Cancel' - - # RPi - if (( $G_HW_MODEL < 10 )); then - - # Get current memory split - # - Get override setting: gpu_mem_1024 is effective for all models with >= 1 GiB - local value=1024 - (( $value < 1024 )) && value=$G_HW_MEMORY_SIZE - local gpu_mem_current=$(sed -n "/^[[:blank:]]*gpu_mem_$value=/{s/^[^=]*=//p;q}" /boot/config.txt) # override setting - [[ $gpu_mem_current ]] || gpu_mem_current=$(sed -n "/^[[:blank:]]*gpu_mem=/{s/^[^=]*=//p;q}" /boot/config.txt) # base setting - [[ $gpu_mem_current ]] || { (( $value < 1024 )) && gpu_mem_current=64 || gpu_mem_current=76; } # default value - local ram_mem_current=$((G_HW_MEMORY_SIZE-gpu_mem_current)) - - # Create array for storing menu selectable options. - G_WHIP_MENU_ARRAY=( - - 16 ': Server' - 64 ': Desktop' - 96 ': Camera' - 128 ': Gaming' - ) - - if (( $G_HW_MEMORY_SIZE >= 512 )); then - - G_WHIP_MENU_ARRAY+=(192 '') - G_WHIP_MENU_ARRAY+=(256 ': Video de/encoding') - - if (( $G_HW_MEMORY_SIZE >= 1024 )); then - - G_WHIP_MENU_ARRAY+=(384 '') - G_WHIP_MENU_ARRAY+=(512 ': You are insane!') - - fi - - fi - - G_WHIP_DEFAULT_ITEM=$gpu_mem_current - G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent: $gpu_mem_current MiB GPU | $ram_mem_current MiB RAM" || { Back_or_Exit 1; return 0; } # Display Options - - /boot/dietpi/func/dietpi-set_hardware gpumemsplit "$G_WHIP_RETURNED_VALUE" && REBOOT_REQUIRED=1 - - # Odroid C2 legacy - elif [[ $G_HW_MODEL == 12 && -f '/boot/boot.ini' ]]; then - - # Get current memory split - local ram_mem_current=$(free -m | mawk '/Mem:/{print $2;exit}') - local gpu_mem_current=$((2048-ram_mem_current)) - - # HDMI/headless extra data - local display_output_enabled=$(grep -Ecm1 '^[[:blank:]]*setenv[[:blank:]]+nographics[[:blank:]]+"0"' /boot/boot.ini) - local display_output_text='On' - (( $display_output_enabled )) || display_output_text='Off' - - G_WHIP_MENU_ARRAY=( - - 'Headless' ': HDMI: Disabled | VPU: Disabled | +300 MiB RAM' - 'Default' ': HDMI: Enabled | VPU: Enabled | -300 MiB RAM' - ) - - G_WHIP_MENU "Hardware : $G_HW_MODEL_NAME\nCurrent : HDMI: [$display_output_text] | VPU: [$display_output_text]\nMemory : $gpu_mem_current MiB GPU | $ram_mem_current MiB RAM\nNB: GPU/RAM figures require a reboot after a change is made." || { Back_or_Exit 1; return 0; } # Display Options + # Get current memory split + # - Get override setting: gpu_mem_1024 is effective for all models with >= 1 GiB RAM + local size=1024 default=76 + (( $G_HW_MEMORY_SIZE < 1024 )) && size=$G_HW_MEMORY_SIZE default=64 + local gpu_mem_current=$(sed -n "/^[[:blank:]]*gpu_mem_$size=/{s/^[^=]*=//p;q}" /boot/config.txt) # override setting + [[ $gpu_mem_current ]] || gpu_mem_current=$(sed -n "/^[[:blank:]]*gpu_mem=/{s/^[^=]*=//p;q}" /boot/config.txt) # base setting + [[ $gpu_mem_current ]] || gpu_mem_current=$default # default value + local ram_mem_current=$((G_HW_MEMORY_SIZE-gpu_mem_current)) + + # Create array for storing menu selectable options. + G_WHIP_MENU_ARRAY=( - case $G_WHIP_RETURNED_VALUE in + 16 ': Server/Console/Headless' + 32 ': Minimal GUI' + "$default" ': Full GUI/Desktop/Default' + 96 ': Camera/Legacy GPU' + ) - 'Headless') /boot/dietpi/func/dietpi-set_hardware headless 1 && REBOOT_REQUIRED=1;; - 'Default') /boot/dietpi/func/dietpi-set_hardware headless 0 && REBOOT_REQUIRED=1;; - *) G_DIETPI-NOTIFY 1 'An invalid "case" option was used. This is a bug, please report at: https://github.com/MichaIng/DietPi/issues'; exit 1;; - esac + G_WHIP_BUTTON_CANCEL_TEXT='Cancel' + G_WHIP_DEFAULT_ITEM=$gpu_mem_current + G_WHIP_MENU "GPU/RAM memory splits are pre-configured and optimized by DietPi-Software based on your software installs. However, feel free to tweak them. +\nCurrent: $gpu_mem_current MiB GPU | $ram_mem_current MiB RAM" || { Back_or_Exit 1; return 0; } # Display Options - else - Info_HW_OptionNotSupported - Back_or_Exit 1 # Display Options - fi + /boot/dietpi/func/dietpi-set_hardware gpumemsplit "$G_WHIP_RETURNED_VALUE" && REBOOT_REQUIRED=1 } # TARGETMENUID=7 @@ -1853,7 +1669,7 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will NET_RX_MB='N/A' NET_TX_MB='N/A' - # $1 = device+index + # $1 = interface Net_Update_UsageStats() { local input=$1 @@ -1910,7 +1726,7 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will Network_ETH_CopyCurrentToStatic() { # Apply if we have a connection - (( $ETH_CONNECTED )) || return + (( $ETH_CONNECTED )) || return 0 ETH_IP_STATIC=$ETH_IP ETH_GATEWAY_STATIC=$ETH_GATEWAY @@ -1921,7 +1737,7 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will Network_WIFI_CopyCurrentToStatic() { # Apply if we have a connection - (( $WIFI_CONNECTED )) || return + (( $WIFI_CONNECTED )) || return 0 WIFI_IP_STATIC=$WIFI_IP WIFI_GATEWAY_STATIC=$WIFI_GATEWAY @@ -1981,20 +1797,18 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will # Check if resolvconf is available, else apply static DNS server via /etc/resolv.conf directly instead of /etc/network/interfaces entry local i resolvconf=0 command -v resolvconf > /dev/null && resolvconf=1 - if (( ! $resolvconf )); then - - if (( ! $ETH_DISABLED && $ETH_MODE_TARGET == 0 )); then - + if (( ! $resolvconf )) + then + if (( ! $ETH_DISABLED && $ETH_MODE_TARGET == 0 )) + then > /etc/resolv.conf for i in $ETH_DNS_STATIC; do echo "nameserver $i" >> /etc/resolv.conf; done - elif (( ! $WIFI_DISABLED && $WIFI_MODE_TARGET == 0 )); then - + elif (( ! $WIFI_DISABLED && $WIFI_MODE_TARGET == 0 )) + then > /etc/resolv.conf for i in $WIFI_DNS_STATIC; do echo "nameserver $i" >> /etc/resolv.conf; done - fi - fi # Eth @@ -2092,67 +1906,72 @@ _EOF_ Network_Restart } + # $1: Adapter type | 0=Eth, 1=WiFi Change_StaticIp() { # Ethernet - if (( $1 == 0 )); then - + if (( ! $1 )) + then G_WHIP_DEFAULT_ITEM=$ETH_IP_STATIC G_WHIP_INPUTBOX 'Please enter a new static Ethernet IP address:' && ETH_IP_STATIC=$G_WHIP_RETURNED_VALUE # WiFi - elif (( $1 == 1 )); then - + else G_WHIP_DEFAULT_ITEM=$WIFI_IP_STATIC G_WHIP_INPUTBOX 'Please enter a new static WiFi IP address:' && WIFI_IP_STATIC=$G_WHIP_RETURNED_VALUE - fi } + # $1: Adapter type | 0=Eth, 1=WiFi Change_StaticGateway() { # Ethernet - if (( $1 == 0 )); then - + if (( ! $1 )) + then G_WHIP_DEFAULT_ITEM=$ETH_GATEWAY_STATIC G_WHIP_INPUTBOX 'Please enter a new static Ethernet gateway address:' && ETH_GATEWAY_STATIC=$G_WHIP_RETURNED_VALUE # WiFi - elif (( $1 == 1 )); then - + else G_WHIP_DEFAULT_ITEM=$WIFI_GATEWAY_STATIC G_WHIP_INPUTBOX 'Please enter a new static WiFi gateway address:' && WIFI_GATEWAY_STATIC=$G_WHIP_RETURNED_VALUE - fi } + # $1: Adapter type | 0=Eth, 1=WiFi Change_StaticMask() { # Ethernet - if (( $1 == 0 )); then - + if (( ! $1 )) + then G_WHIP_DEFAULT_ITEM=$ETH_MASK_STATIC G_WHIP_INPUTBOX 'Please enter a new static Ethernet network mask:' && ETH_MASK_STATIC=$G_WHIP_RETURNED_VALUE # WiFi - elif (( $1 == 1 )); then - + else G_WHIP_DEFAULT_ITEM=$WIFI_MASK_STATIC G_WHIP_INPUTBOX 'Please enter a new static WiFi network mask:' && WIFI_MASK_STATIC=$G_WHIP_RETURNED_VALUE - fi } + # $1: Adapter type | 0=Eth, 1=WiFi Change_StaticDns() { - # $1 = Adapater type | 0=Eth, 1=WiFi - # Current value => default choice (( $1 )) && G_WHIP_DEFAULT_ITEM=$WIFI_DNS_STATIC || G_WHIP_DEFAULT_ITEM=$ETH_DNS_STATIC + G_WHIP_MENU_ARRAY=("$G_WHIP_DEFAULT_ITEM" ': Your current DNS server') - G_WHIP_MENU_ARRAY=( + # Auto detect local gateway(s)/router(s) to offer as DNS server(s). + local gateway=$(ip r l 0/0 | mawk '{print $3}' ORS=' ') + while [[ $gateway == *' '*' '* ]]; do gateway=${gateway% *}; done + [[ $gateway ]] && G_WHIP_MENU_ARRAY+=("$gateway" ': Use local router as DNS server (recommended)') + # Auto detect local DNS resolver to offer as system DNS + ss -uln | grep -q ':53[[:blank:]]' && G_WHIP_MENU_ARRAY+=('127.0.0.1' ': Use local Pi-hole/AdGuard Home/Unbound (not recommended)') + + G_WHIP_MENU_ARRAY+=( 'Custom' ': Manually enter your DNS server' + '' '●─ Public DNS providers ' '1.1.1.1 1.0.0.1' ': Cloudflare' '9.9.9.9 149.112.112.112' ': Quad9' '8.8.8.8 8.8.4.4' ': Google' @@ -2164,12 +1983,14 @@ _EOF_ '84.200.69.80 84.200.70.40' ': DNS.WATCH' ) - G_WHIP_MENU 'Please select a DNS server, or choose "Custom" for manual entry:' || return - if [[ $G_WHIP_RETURNED_VALUE == 'Custom' ]]; then + G_WHIP_MENU 'Please select a DNS server, or choose "Custom" for manual entry:' || return 0 + if [[ $G_WHIP_RETURNED_VALUE == 'Custom' ]] + then (( $1 )) && G_WHIP_DEFAULT_ITEM=$WIFI_DNS_STATIC || G_WHIP_DEFAULT_ITEM=$ETH_DNS_STATIC - G_WHIP_INPUTBOX 'Please enter a new DNS server address\n - 2 maximum, seperated by a space.\n - E.g.: 9.9.9.9 149.112.112.112' || return - + G_WHIP_INPUTBOX "Please enter one or two space-separated DNS server addresses + - E.g.: 9.9.9.9 149.112.112.112 + - Current: $G_WHIP_DEFAULT_ITEM" || return 0 fi # Apply new value @@ -2427,20 +2248,16 @@ NB: All Ethernet connections will be temporarily dropped!' && Network_ApplyChang # Onboard WiFi # - RPi 3/4/Zero W - if (( $G_HW_ONBOARD_WIFI )); then - + if (( $G_HW_ONBOARD_WIFI )) + then local onboard_wifi_enabled=1 - if grep -q '^[[:blank:]]*dtoverlay=disable-wifi' /boot/config.txt; then - + if grep -q '^[[:blank:]]*dtoverlay=disable-wifi' /boot/config.txt + then onboard_wifi_enabled=0 G_WHIP_MENU_ARRAY+=('Onboard WiFi' ': [Off]') - else - G_WHIP_MENU_ARRAY+=('Onboard WiFi' ': [On]') - fi - fi G_WHIP_MENU_ARRAY+=('' '●─ Additional Options ') @@ -2574,14 +2391,13 @@ NB: All Ethernet connections will be temporarily dropped!' && Network_ApplyChang G_WHIP_MENU_ARRAY+=('Change Mode' ": [$mode_text]") # Show static options - if (( $ETH_MODE_TARGET == 0 )); then - + if (( $ETH_MODE_TARGET == 0 )) + then G_WHIP_MENU_ARRAY+=('Copy' ': Copy current address to "Static"') G_WHIP_MENU_ARRAY+=('Static IP' ": [$ETH_IP_STATIC]") G_WHIP_MENU_ARRAY+=('Static Mask' ": [$ETH_MASK_STATIC]") G_WHIP_MENU_ARRAY+=('Static Gateway' ": [$ETH_GATEWAY_STATIC]") G_WHIP_MENU_ARRAY+=('Static DNS' ": [$ETH_DNS_STATIC]") - fi G_WHIP_MENU_ARRAY+=('' '●─ Additional Options ') From f741f322cdef844a8d4d6d2ed58f776fe0fe17c1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 21 Jun 2024 23:13:06 +0200 Subject: [PATCH 49/66] v9.6 - DietPi-Software | Update fallback URLs --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a4e0944e87..cc84a22608 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9513,7 +9513,7 @@ _EOF_ esac url=$(curl -sSfL 'https://api.github.com/repos/Radarr/Radarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}") - local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.6.0.8846/Radarr.master.5.6.0.8846.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.7.0.8882/Radarr.master.5.7.0.8882.linux-core-$arch.tar.gz" fi Download_Install "$url" @@ -9953,7 +9953,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.18.0.4543/Prowlarr.master.1.18.0.4543.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.19.0.4568/Prowlarr.master.1.19.0.4568.linux-core-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Prowlarr/Prowlarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC mv Prowlarr /opt/prowlarr fi From 29034e964aca94dd0968f20703c65bf6d6dbce64 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 22 Jun 2024 19:24:29 +0200 Subject: [PATCH 50/66] v9.6 (#7122) - General | Since we provide all kernel, bootloader and firmware packages from our own APT repository now, the Armbian APT repository is removed form all systems. In case you use an SBC which is not officially supported by DietPi, as generic device, it is however preserved. --- .build/images/dietpi-build | 14 ++--- .build/images/dietpi-installer | 105 ++++++++++++++++---------------- .update/patches | 18 +++++- .update/pre-patches | 19 +++--- CHANGELOG.txt | 1 + dietpi/func/dietpi-globals | 15 ----- dietpi/func/dietpi-set_software | 52 +++++++++++++++- 7 files changed, 137 insertions(+), 87 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 3c63703489..1490dc7f6a 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -412,8 +412,8 @@ packages='apt,bash-completion,bzip2,ca-certificates,cron,curl,fdisk,gpg,htop,ipu [[ $HW_MODEL == 75 ]] && packages+='iproute2' || packages+='console-setup,dropbear,ethtool,fake-hwclock,ifupdown,isc-dhcp-client,kmod,rfkill,systemd-timesyncd,usbutils' # - "--skip=check/empty" to ignore /etc/fstab, boot and tmpfs mounts we added above # - "--skip=check/qemu" to skip arch test, which requires the "arch-test" package. We however assure emulation support out end. -# - Bullseye/Jammy host mmdebstrap seems to not support "--skip=check/empty,check/qemu". -G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --debug --mode=root --format=dir --skip=check/empty --skip=check/qemu --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" +# - Bullseye/Jammy host mmdebstrap does not support "--skip=check/empty,check/qemu". +G_EXEC_OUTPUT=1 G_EXEC mmdebstrap --mode=root --format=dir --skip=check/empty --skip=check/qemu --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" G_EXEC umount rootfs/dev rootfs/run rootfs/var/cache/apt rootfs/var/lib/apt/lists rootfs/var/log ########################################## @@ -431,15 +431,15 @@ _EOF_ cat << _EOF_ >> rootfs/etc/rc.local export GITOWNER='$GITOWNER' GITBRANCH='$GITBRANCH' HW_MODEL='$HW_MODEL' IMAGE_CREATOR=0 PREIMAGE_INFO=0 WIFI_REQUIRED=1 DISTRO_TARGET=$DISTRO TEST_KERNEL=$TEST_KERNEL TEST_UBOOT=$TEST_UBOOT echo '[ INFO ] Running DietPi-Installer for $G_GITOWNER/$G_GITBRANCH' -bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-installer')" || poweroff +bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-installer')" || { echo '[FAILED] DietPi-Installer failed, shutting down ...'; journalctl -n 25; df -h; free -h; poweroff; exit 1; } _EOF_ # - VM: Generate tiny-initramfs with explicit kernel modules, as auto-detection doesn't work correctly within container and loop devices [[ $HW_MODEL == 20 ]] && cat << _EOF_ >> rootfs/etc/rc.local echo '[ INFO ] Rebuilding virtual machine initramfs to support all virtualizers...' -version=\$(dpkg --get-selections | mawk '\$1~/^linux-image-.*-$parch\$/{print \$1;exit}') || poweroff +version=\$(dpkg --get-selections | mawk '\$1~/^linux-image-.*-$parch\$/{print \$1;exit}') || { echo '[FAILED] Obtaining kernel version failed, shutting down ...'; journalctl -n 25; df -h; free -h; poweroff; exit 1; } version=\${version#linux-image-} -mktirfs -m no -M no --include-modules='ahci,sd_mod,vmw_pvscsi,hv_storvsc,virtio_scsi,virtio_pci,BusLogic,$FSTYPE' -o "/boot/initrd.img-\$version" "\$version" || poweroff +mktirfs -m no -M no --include-modules='ahci,sd_mod,vmw_pvscsi,hv_storvsc,virtio_scsi,virtio_pci,BusLogic,$FSTYPE' -o "/boot/initrd.img-\$version" "\$version" || { echo '[FAILED] Generating initramfs failed, shutting down ...'; journalctl -n 25; df -h; free -h; poweroff; exit 1; } _EOF_ cat << '_EOF_' >> rootfs/etc/rc.local @@ -459,9 +459,9 @@ then abind=("--bind=$FP_LOOP" '--bind=/dev/disk') for i in "${FP_LOOP}p"*; do abind+=("--bind=$i"); done fi -systemd-nspawn -bD rootfs "${abind[@]}" || { G_DIETPI-NOTIFY 1 'systemd-nspawn failed, aborting...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; } +systemd-nspawn -bD rootfs "${abind[@]}" || { G_DIETPI-NOTIFY 1 'systemd-nspawn failed, aborting ...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; } -[[ -f 'rootfs/success' ]] || { G_DIETPI-NOTIFY 1 'The container setup did not finish successfully, aborting...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; } +[[ -f 'rootfs/success' ]] || { G_DIETPI-NOTIFY 1 'The container setup did not finish successfully, aborting ...'; journalctl -n 25; ss -tlpn; df -h; free -h; exit 1; } G_EXEC rm rootfs/success G_EXEC rm -Rf rootfs/{dev,proc,run,sys,tmp,var/log}/{,.??,.[^.]}* # Failsafe: /var/log/journal was found despite tmpfs mount! G_EXEC sync diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 85b9f3a094..c2fd0f14d5 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -598,7 +598,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Moving kernel and boot configuration to /boot' # Hardware specific boot configs - local armbian_repo=0 + local armbian_packages=0 if (( $G_HW_MODEL < 10 )) then if findmnt -M /boot/firmware &> /dev/null @@ -615,7 +615,7 @@ _EOF_ elif [[ $G_HW_MODEL =~ ^(10|11)$ ]] then - armbian_repo=1 + armbian_packages=1 local model='OdroidC1' (( $G_HW_MODEL == 11 )) && model='OdroidXU4' G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/$model/boot.ini" /boot/boot.ini @@ -629,7 +629,7 @@ _EOF_ elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|76|77|78|79|80|82|83|85|86|87|88|89|90)$ ]] then - armbian_repo=1 + armbian_packages=1 G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/boot.cmd" /boot/boot.cmd G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/dietpiEnv.txt" /boot/dietpiEnv.txt G_CONFIG_INJECT 'rootdev=' "rootdev=UUID=$(findmnt -Ufnro UUID -M /)" /boot/dietpiEnv.txt @@ -673,11 +673,7 @@ setenv rootuuid "true"' /boot/boot.cmd G_EXEC sed --follow-symlinks -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x9000000"' /boot/boot.cmd G_CONFIG_INJECT 'overlay_path=' 'overlay_path=rockchip' /boot/dietpiEnv.txt - case $G_HW_MODEL in - 73) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3308' /boot/dietpiEnv.txt;; - 78|79|80|82|85) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3588' /boot/dietpiEnv.txt;; # ToDo: There are multiple other prefixes used in the kernel package, "rock-5b", "rock-5ab", "rockchip" (for fixup), so the boot.cmd need heavy adjustments (eliminate the prefix entirely) to work with all overlays. - *) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rockchip' /boot/dietpiEnv.txt;; - esac + # Device tree case $G_HW_MODEL in 46) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3399-pinebook-pro.dtb' /boot/dietpiEnv.txt;; 55) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3328-nanopi-r2-rev00.dtb' /boot/dietpiEnv.txt;; # Not necessarily needed as rk3328-nanopi-r2s.dtb is automatically chosen, but provides more consistent /sys/class/leds/{wan,lan}_led interface and blinking instead of steady lid power LED @@ -697,6 +693,13 @@ setenv rootuuid "true"' /boot/boot.cmd 87) G_CONFIG_INJECT 'fdtfile=' 'fdtfile=rockchip/rk3566-orangepi-3b.dtb' /boot/dietpiEnv.txt;; *) :;; esac + # Overlay prefix + case $G_HW_MODEL in + 73) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3308' /boot/dietpiEnv.txt;; + 78|79|80|82|85) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rk3588' /boot/dietpiEnv.txt;; # ToDo: There are multiple other prefixes used in the kernel package, "rock-5b", "rock-5ab", "rockchip" (for fixup), so the boot.cmd need heavy adjustments (eliminate the prefix entirely) to work with all overlays. + *) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=rockchip' /boot/dietpiEnv.txt;; + esac + # Console args case $G_HW_MODEL in 73) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS0,1500000' /boot/dietpiEnv.txt;; # headless 47|55|56) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS2,1500000' /boot/dietpiEnv.txt;; # headless @@ -761,12 +764,14 @@ setenv rootuuid "true"' /boot/boot.cmd G_EXEC sed --follow-symlinks -i -e 's|\${prefix}Image|${prefix}zImage|' -e 's/booti/bootz/' -e 's|\${overlay_path}/||' /boot/boot.cmd G_EXEC sed --follow-symlinks -i '/^overlay_path/d' /boot/dietpiEnv.txt G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun8i-h3' /boot/dietpiEnv.txt + # Overlays case $G_HW_MODEL in 48) G_CONFIG_INJECT 'overlays=' 'overlays=usbhost1 usbhost2 uart1' /boot/dietpiEnv.txt;; 59|60) G_CONFIG_INJECT 'overlays=' 'overlays=usbhost1 usbhost2' /boot/dietpiEnv.txt;; 64) G_CONFIG_INJECT 'overlays=' 'overlays=usbhost2 usbhost3' /boot/dietpiEnv.txt;; *) :;; esac + # Console args case $G_HW_MODEL in 48) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS1,115200' /boot/dietpiEnv.txt;; # headless 59|60|64) G_CONFIG_INJECT 'consoleargs=' 'consoleargs=console=ttyS0,115200' /boot/dietpiEnv.txt;; # headless @@ -1033,10 +1038,19 @@ setenv rootuuid "true"' /boot/boot.cmd [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' # DietPi-Build with Armbian kernel/bootloader/firmware - elif (( $armbian_repo )) + elif (( $armbian_packages )) then - # Prevent any unintended packages from being installed from Armbian's APT repository, like base-files: https://github.com/MichaIng/DietPi/issues/6227#issuecomment-1713688577 - cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian + # Remove obsolete combined keyring + [[ -f '/etc/apt/trusted.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg + [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' + + # Remove obsolete lists + find /etc/apt/sources.list.d -mindepth 1 ! -name 'dietpi.list' -exec rm -Rf {} + + + if [[ $G_GITBRANCH == 'master' ]] + then + # Prevent any unintended packages from being installed from Armbian's APT repository, like base-files: https://github.com/MichaIng/DietPi/issues/6227#issuecomment-1713688577 + cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian Package: * Pin: origin apt.armbian.com Pin-Priority: -1 @@ -1045,29 +1059,23 @@ Package: armbian-firmware* linux-* Pin: origin apt.armbian.com Pin-Priority: 500 _EOF_ - if dpkg --compare-versions "$(dpkg-query -Wf '${Version}' base-files)" gt 20 - then - G_DIETPI-NOTIFY 2 'Enforcing downgrade of Armbian'\''s base-files package to Debian'\''s' - cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian-tmp + if dpkg --compare-versions "$(dpkg-query -Wf '${Version}' base-files)" gt 20 + then + G_DIETPI-NOTIFY 2 'Enforcing downgrade of Armbian'\''s base-files package to Debian'\''s' + cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian-tmp Package: base-files Pin: release o=Debian Pin-Priority: 1000 _EOF_ - G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian' - fi - - # Bootstrap Armbian repository - G_EXEC_RETRIES=2 G_EXEC eval 'curl -sSfL '\''https://apt.armbian.com/armbian.key'\'' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-armbian.gpg --yes' + G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian' + fi - # Remove obsolete combined keyring - [[ -f '/etc/apt/trusted.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg - [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' + # Bootstrap Armbian repository + G_EXEC_RETRIES=2 G_EXEC eval 'curl -sSfL '\''https://apt.armbian.com/armbian.key'\'' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-armbian.gpg --yes' - # Remove obsolete lists - find /etc/apt/sources.list.d -mindepth 1 ! -name 'dietpi.list' -exec rm -Rf {} + - - # Add Armbian repository - G_EXEC eval "echo 'deb https://apt.armbian.com ${DISTRO_TARGET_NAME/bullseye/bookworm} main' > /etc/apt/sources.list.d/dietpi-armbian.list" + # Add Armbian repository + G_EXEC eval "echo 'deb https://apt.armbian.com ${DISTRO_TARGET_NAME/bullseye/bookworm} main' > /etc/apt/sources.list.d/dietpi-armbian.list" + fi # Select kernel, device tree and U-Boot packages local model='odroidn2' kernel='meson64' arch='arm64' branch='current' zstd=() @@ -1367,14 +1375,7 @@ _EOF_ systemctl stop armbian-* # Keep currently installed kernel and bootloader packages - local apackages=( - - 'linux-image-' - 'linux-dtb-' - 'linux-u-boot-' - ) - - for i in "${apackages[@]}" + for i in linux-{image,dtb,u-boot}- do while read -r line do @@ -1383,7 +1384,6 @@ _EOF_ done < <(dpkg-query -Wf '${Package}\n' | mawk -v pat="^$i" '$0~pat') done - unset -v apackages # Add initramfs-tools and u-boot-tools, required to convert initramfs images into u-boot format aPACKAGES_REQUIRED_INSTALL+=('initramfs-tools' 'u-boot-tools') @@ -1435,6 +1435,21 @@ _EOF_ G_EXEC rm -f /{initrd.img,vmlinuz}{,.old} fi + if [[ -f '/boot/armbianEnv.txt' ]] + then + # Force legacy network interface names + G_CONFIG_INJECT 'extraargs=' 'extraargs=net.ifnames=0' /boot/armbianEnv.txt + + # Disable bootsplash logo, as we removed the file above: https://github.com/MichaIng/DietPi/issues/3932#issuecomment-852376681 + G_CONFIG_INJECT 'bootlogo=' 'bootlogo=false' /boot/armbianEnv.txt + + # Reset default kernel log verbosity, reduced to "1" on most Armbian images + G_CONFIG_INJECT 'verbosity=' 'verbosity=4' /boot/armbianEnv.txt + + # Disable Docker optimisations, since this has some performance drawbacks, enable on Docker install instead + G_CONFIG_INJECT 'docker_optimizations=' 'docker_optimizations=off' /boot/armbianEnv.txt + fi + # Generic kernel, device tree, bootloader and firmware package auto detect + initramfs-tools elif (( $G_HW_MODEL != 75 )) then @@ -2180,22 +2195,6 @@ _EOF_ G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' fi - # Armbian - if [[ -f '/boot/armbianEnv.txt' ]] - then - # Force legacy network interface names - G_CONFIG_INJECT 'extraargs=' 'extraargs=net.ifnames=0' /boot/armbianEnv.txt - - # Disable bootsplash logo, as we removed the file above: https://github.com/MichaIng/DietPi/issues/3932#issuecomment-852376681 - G_CONFIG_INJECT 'bootlogo=' 'bootlogo=false' /boot/armbianEnv.txt - - # Reset default kernel log verbosity, reduced to "1" on most Armbian images - G_CONFIG_INJECT 'verbosity=' 'verbosity=4' /boot/armbianEnv.txt - - # Disable Docker optimisations, since this has some performance drawbacks, enable on Docker install instead - G_CONFIG_INJECT 'docker_optimizations=' 'docker_optimizations=off' /boot/armbianEnv.txt - fi - #------------------------------------------------------------------------------------------------ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Finalise system for first boot of DietPi"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ diff --git a/.update/patches b/.update/patches index c4d55f2fe0..272c58bf99 100755 --- a/.update/patches +++ b/.update/patches @@ -1651,8 +1651,15 @@ Patch_9_5() Patch_9_6() { + # Update DietPi APT list for several SBCs we added components to our repo for + if [[ $PATCH_9_3_RAN == 0 && $G_HW_MODEL =~ ^(42|43|46|47|52|55|58|68|72|73|76|77|86|87)$ ]] + then + /boot/dietpi/func/dietpi-set_software apt-mirror dietpi + G_AGUP + G_AGUG + # Orange Pi 5: Offer to flash new U-Boot image to solve random Ethernet MAC address: https://github.com/MichaIng/DietPi/issues/6663 - if (( $G_HW_MODEL == 80 )) + elif (( $G_HW_MODEL == 80 )) then if G_WHIP_YESNO '[ INFO ] U-Boot update available to solve random Ethernet MAC address \nIn case you are affected by a random Ethernet MAC address, which changes every boot, flashing the latest U-Boot image has shown to solve it: https://github.com/MichaIng/DietPi/issues/6663 @@ -1691,6 +1698,15 @@ Patch_9_6() G_AGI zstd fi + # Remove Armbian APT repository from all systems which have an "all" component for kernel/bootloader/firmware packages form our APT repository + if [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' && -f '/etc/apt/sources.list.d/dietpi.list' ]] && grep -q 'dietpi.com/apt all' /etc/apt/sources.list.d/dietpi.list + then + G_DIETPI-NOTIFY 2 'Removing obsolete Armbian APT repository' + G_EXEC rm /etc/apt/sources.list.d/dietpi-armbian.list + [[ -f '/etc/apt/preferences.d/dietpi-armbian' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-armbian + [[ -f '/etc/apt/trusted.gpg.d/dietpi-armbian.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-armbian.gpg + fi + # Remove obsolete drop-in config: https://github.com/MichaIng/DietPi/issues/7104 [[ -d '/etc/systemd/system/ifup@.service.d' ]] && G_EXEC rm -R /etc/systemd/system/ifup@.service.d } diff --git a/.update/pre-patches b/.update/pre-patches index 702c1bd182..a7715faad7 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -211,12 +211,6 @@ then G_DIETPI-NOTIFY 2 'Adding new non-free-firmware component to APT lists, to re-enable firmware upgrades' G_EXEC sed --follow-symlinks -i '/non-free/s/$/ non-free-firmware/' /etc/apt/sources.list fi - if (( $G_DISTRO > 6 )) && [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' || -f '/etc/apt/sources.list.d/armbian.list' ]] - then - G_DIETPI-NOTIFY 2 'Updating Armbian APT repo list with Bookworm suite' - [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] && G_EXEC sed --follow-symlinks -i 's/bullseye/bookworm/' /etc/apt/sources.list.d/dietpi-armbian.list - [[ -f '/etc/apt/sources.list.d/armbian.list' ]] && G_EXEC sed --follow-symlinks -i 's/bullseye/bookworm/' /etc/apt/sources.list.d/armbian.list - fi fi # v8.21 @@ -240,7 +234,7 @@ then if [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] then G_DIETPI-NOTIFY 2 'Preventing any unintended packages from being installed from Armbian'\''s APT repository' - cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian + cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian || exit 1 Package: * Pin: origin apt.armbian.com Pin-Priority: -1 @@ -382,7 +376,7 @@ fi if (( $G_DIETPI_VERSION_CORE < 9 || ( $G_DIETPI_VERSION_CORE == 9 && $G_DIETPI_VERSION_SUB < 3 ) )) then # Update APT repo on Bullseye systems to Bookworm, but re-assure only kernel and firmware packages are pulled form it. Armbian dropped Bullseye support. - if [[ $G_DISTRO == 6 && -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] + if [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] && grep -q 'bullseye' /etc/apt/sources.list.d/dietpi-armbian.list then G_DIETPI-NOTIFY 2 'Moving EOL Armbian Bullseye repo to Bookworm for Debian-version-agnostic firmware and kernel upgrades' cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian || exit 1 @@ -424,6 +418,15 @@ then [[ ${apackages[0]} ]] && G_EXEC apt-mark unhold "${apackages[@]}" unset -v apackages fi + + # Remove Armbian APT repository from all systems which have an "all" component for kernel/bootloader/firmware packages form our APT repository + if [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' && -f '/etc/apt/sources.list.d/dietpi.list' ]] && grep -q 'dietpi.com/apt all' /etc/apt/sources.list.d/dietpi.list + then + G_DIETPI-NOTIFY 2 'Removing obsolete Armbian APT repository' + G_EXEC rm /etc/apt/sources.list.d/dietpi-armbian.list + [[ -f '/etc/apt/preferences.d/dietpi-armbian' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-armbian + [[ -f '/etc/apt/trusted.gpg.d/dietpi-armbian.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-armbian.gpg + fi fi exit 0 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 01949cb322..cf06a4daaf 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v9.6 (2024-07-06) Enhancements: +- General | Since we provide all kernel, bootloader and firmware packages from our own APT repository now, the Armbian APT repository is removed form all systems. In case you use an SBC which is not officially supported by DietPi, as generic device, it is however preserved. - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 - Quartz64/Star64/VisionFive 2 | eBPF functionality for firewall and network monitoring software like Cilium has been added to our kernel builds for these SBCs. Many thanks to @kbrighton for reporting these missing features: https://github.com/MichaIng/DietPi/issues/6834 - Orange Pi 5 | Older U-Boot builds caused the Ethernet MAC address to be random and change on every boot. Recent U-Boot builds solve this, but they are not flashed automatically on package upgrades. We hence inform users and offer to flash the latest U-Boot image during the DietPi update. Many thanks to @thuehlinger for reporting and testing the case: https://github.com/MichaIng/DietPi/issues/6663 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index e7845822a9..baba175c77 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1499,9 +1499,6 @@ Press any key to continue...' G_CHECK_ROOT_USER 1 - # Workaround for Armbian mirrors being out of sync regularly or throwing 5xx errors - [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] && G_EXEC_POST_FUNC(){ [[ $exit_code != 0 ]] && grep -q '^E: Failed to fetch .*armbian' "$fp_log" && G_EXEC_RETRIES=2 && unset -f G_EXEC_POST_FUNC; } - G_EXEC_DESC="\e[0mAPT install \e[33m$*\e[0m" DEBIAN_FRONTEND=noninteractive G_EXEC_OUTPUT=1 G_EXEC_OUTPUT_COL='\e[90m' G_EXEC apt-get -y --allow-change-held-packages install "$@" local exit_code=$? @@ -1548,9 +1545,6 @@ Press any key to continue...' { G_CHECK_ROOT_USER 1 - # Workaround for Armbian mirrors being out of sync regularly or throwing 5xx errors - [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] && G_EXEC_POST_FUNC(){ [[ $exit_code != 0 ]] && grep -q '^E: Failed to fetch .*armbian' "$fp_log" && G_EXEC_RETRIES=2 && unset -f G_EXEC_POST_FUNC; } - G_EXEC_DESC="\e[0mAPT fix${*:+ \e[33m$*\e[0m}" DEBIAN_FRONTEND=noninteractive G_EXEC_OUTPUT=1 G_EXEC_OUTPUT_COL='\e[90m' G_EXEC apt-get -y --allow-change-held-packages -f install "$@" local exit_code=$? @@ -1575,9 +1569,6 @@ Press any key to continue...' # Clean cache before every update, which can corrupt and gets fully rewritten anyway G_EXEC_PRE_FUNC(){ apt-get clean; } - # Workaround for Armbian mirrors being out of sync regularly or throwing 5xx errors - [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] && G_EXEC_POST_FUNC(){ [[ $exit_code != 0 ]] && grep -q '^E: Failed to fetch .*armbian' "$fp_log" && G_EXEC_RETRIES=2 && unset -f G_EXEC_POST_FUNC; } - G_EXEC_DESC='\e[0mAPT update' G_EXEC_OUTPUT=1 G_EXEC_OUTPUT_COL='\e[90m' G_EXEC apt-get -y -eany update local exit_code=$? @@ -1620,9 +1611,6 @@ Press any key to continue...' { G_CHECK_ROOT_USER 1 - # Workaround for Armbian mirrors being out of sync regularly or throwing 5xx errors - [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] && G_EXEC_POST_FUNC(){ [[ $exit_code != 0 ]] && grep -q '^E: Failed to fetch .*armbian' "$fp_log" && G_EXEC_RETRIES=2 && unset -f G_EXEC_POST_FUNC; } - G_EXEC_DESC="\e[0mAPT upgrade${*:+ \e[33m$*\e[0m}" DEBIAN_FRONTEND=noninteractive G_EXEC_OUTPUT=1 G_EXEC_OUTPUT_COL='\e[90m' G_EXEC apt-get -y --with-new-pkgs upgrade "$@" local exit_code=$? @@ -1639,9 +1627,6 @@ Press any key to continue...' { G_CHECK_ROOT_USER 1 - # Workaround for Armbian mirrors being out of sync regularly or throwing 5xx errors - [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] && G_EXEC_POST_FUNC(){ [[ $exit_code != 0 ]] && grep -q '^E: Failed to fetch .*armbian' "$fp_log" && G_EXEC_RETRIES=2 && unset -f G_EXEC_POST_FUNC; } - G_EXEC_DESC="\e[0mAPT dist-upgrade${*:+ \e[33m$*\e[0m}" DEBIAN_FRONTEND=noninteractive G_EXEC_OUTPUT=1 G_EXEC_OUTPUT_COL='\e[90m' G_EXEC apt-get -y dist-upgrade "$@" local exit_code=$? diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 8690a7f276..ca4952bf64 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -128,8 +128,12 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R 15) all_components='odroidn2';; 16) all_components='odroidc4';; 40) all_components='pinea64';; + 42) all_components='rockpro64';; + 43) all_components='rock64';; 44) all_components='pinebook';; 45) all_components='pineh64';; + 46) all_components='pinebookpro';; + 47) all_components='nanopir4s';; 48) all_components='nanopir1';; 49) # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed kernel/firmware package @@ -149,9 +153,12 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R ;; esac ;; + 52) all_components='tinkerboard';; 54) all_components='nanopik2';; + 55) all_components='nanopir2s';; 56) all_components='nanopineo3';; 57) all_components='nanopineoplus2';; + 58) all_components='nanopim4v2';; 59) all_components='zeropi';; 60) all_components='nanopineo';; 61) all_components='nanopi2';; @@ -193,18 +200,54 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R ;; 66) all_components='nanopim1plus';; 67) all_components='nanopik1plus';; + 68) + # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package + # shellcheck disable=SC2154 + case $HW_VARIANT in + 1) all_components='nanopim4';; + 2) all_components='nanopct4';; + 3) all_components='nanopineo4';; + *) + [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) + [[ $all_components ]] || for i in nano{pim4,pineo4,pct4} + do + dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue + all_components=${i/-//} + break + done + ;; + esac + ;; 70) all_components='sparkysbc';; + 72) + # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package + # shellcheck disable=SC2154 + case $HW_VARIANT in + 1) all_components='rock4';; + 2) all_components='rock4se';; + 3) all_components='rock4cplus';; + *) + [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) + [[ $all_components ]] || for i in rock{pi-4b,-4se,pi-4cplus} + do + dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue + all_components=${i/-//} + break + done + ;; + esac + ;; + 73) all_components='rockpis';; 74) all_components='radxazero';; 76) # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package # shellcheck disable=SC2154 case $HW_VARIANT in - 1) all_components='';; # no R5S component is available yet + 1) all_components='nanopir5s';; 2) all_components='nanopir5c';; *) [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) - # shellcheck disable=SC2043 - [[ $all_components ]] || for i in nanopi-r5c + [[ $all_components ]] || for i in nanopi-r5{c,s} do dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue all_components=${i/-//} @@ -213,6 +256,7 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R ;; esac ;; + 77) all_components='rock3a';; 78) all_components='rock5b';; 79) # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package @@ -238,6 +282,8 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R 83) all_components='orangepizero3';; 84) all_components='star64';; 85) all_components='rock5a';; + 86) all_components='tinkerboard2';; + 87) all_components='orangepi3b';; 88) all_components='orangepizero2w';; 89) all_components='orangepi3lts';; 90) all_components='radxazero3';; From 611c04784c98b9dd07e98ad9b72685d7040e775f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jun 2024 18:16:59 +0200 Subject: [PATCH 51/66] v9.6 - DietPi-Software | Node-RED: Resolved an issue where reinstalls/updates failed because of incompatibilities between latest Node.js or global modules with older local instances. Many thanks to @thinkbig1979 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7128 - DietPi-Software | Add "@latest" version tag to all Node module installs, else installed modules won't necessarily be updated - DietPi-Software | Replace sudo calls with "runuser". It is an alternative, which can only be executed as root user, and hence does not imply any authentication system. Shell aliases added for future user calls, however, need to keep using sudo, to support non-root logins. --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 90 +++++++++++++++++++++++------------------- 2 files changed, 51 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index cf06a4daaf..57d67fffb9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -16,6 +16,7 @@ Bug fixes: - NanoPi R6C | Resolved an issue where our new images did not boot, since the latest mainline U-Boot for R6S does not support the R6C anymore. Many thanks to @labmaster for reporting this issue: https://github.com/MichaIng/DietPi/issues/7109 - DietPi-Banner | Resolved an issue where incorrect RAM usage was printed with German and potentially other locales. Many thanks to @jwgn for reporting this issue: https://github.com/MichaIng/DietPi/issues/7107 - DietPi-Dashboard | Resolved an issue where the installation on RISC-V systems failed. +- DietPi-Software | Node-RED: Resolved an issue where reinstalls/updates failed because of incompatibilities between latest Node.js or global modules with older local instances. Many thanks to @thinkbig1979 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7128 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/ADDME diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cc84a22608..9ef1111964 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -3932,15 +3932,15 @@ _EOF_ # Database G_EXEC systemctl start postgresql local synapse_pass=$(tr -dc '[:alnum:]' < /dev/random | head -c30) - if [[ $(sudo -u postgres psql -tAc "SELECT 1 FROM pg_roles WHERE rolname='synapse'") != 1 ]] + if [[ $(runuser -u postgres -- psql -tAc "SELECT 1 FROM pg_roles WHERE rolname='synapse'") != 1 ]] then - G_EXEC sudo -u postgres psql -c "CREATE ROLE synapse WITH LOGIN PASSWORD '$synapse_pass';" + G_EXEC runuser -u postgres -- psql -c "CREATE ROLE synapse WITH LOGIN PASSWORD '$synapse_pass';" else - G_EXEC sudo -u postgres psql -c "ALTER ROLE synapse WITH PASSWORD '$synapse_pass';" + G_EXEC runuser -u postgres -- psql -c "ALTER ROLE synapse WITH PASSWORD '$synapse_pass';" fi - if [[ $(sudo -u postgres psql -tAc "SELECT 1 FROM pg_database WHERE datname='synapse'") != 1 ]] + if [[ $(runuser -u postgres -- psql -tAc "SELECT 1 FROM pg_database WHERE datname='synapse'") != 1 ]] then - G_EXEC sudo -u postgres createdb --encoding=UTF8 --locale=C --template=template0 --owner=synapse synapse + G_EXEC runuser -u postgres -- createdb --encoding=UTF8 --locale=C --template=template0 --owner=synapse synapse fi # Pre-create drop-in config for database access details @@ -4236,7 +4236,7 @@ _EOF_ G_EXEC curl -sSf 'https://sh.rustup.rs/' -o rustup-init.sh G_EXEC chmod +x rustup-init.sh # RPi with 64-bit kernel on 32-bit image: Enforce 32-bit toolchain: https://github.com/MichaIng/DietPi/issues/6306 - G_EXEC_OUTPUT=1 G_EXEC sudo -u "$micro_name" ./rustup-init.sh -y --profile minimal ${RPI_64KERNEL_32OS:+'--default-host' 'armv7-unknown-linux-gnueabihf'} + G_EXEC_OUTPUT=1 G_EXEC runuser -u "$micro_name" -- ./rustup-init.sh -y --profile minimal ${RPI_64KERNEL_32OS:+'--default-host' 'armv7-unknown-linux-gnueabihf'} G_EXEC rm rustup-init.sh fi @@ -4261,7 +4261,7 @@ PS1=\"(microblog.pub) \$PS1\"" > "$micro_pyenv_activate_file" # Install Python 3.10 and Poetry G_EXEC chown -R "$micro_name:$micro_name" "$micro_pyenv_dir" G_EXEC_DESC='Installing Python with Poetry into pyenv' - G_EXEC_OUTPUT=1 G_EXEC sudo -u "$micro_name" dash -c " + G_EXEC_OUTPUT=1 G_EXEC runuser -u "$micro_name" -- dash -c " . $micro_pyenv_activate_file || exit 1 pyenv install $micro_python_version || exit 1 pyenv local $micro_python_version || exit 1 @@ -4454,7 +4454,7 @@ location = /.well-known/caldav { return 301 /owncloud/remote.php/dav/; }' > /et G_EXEC systemctl restart redis-server # Initially add occ command shortcut, will be added as alias by /etc/bashrc.d/dietpi.bash if occ file exist: - occ(){ sudo -u www-data php /var/www/owncloud/occ "$@"; } + occ(){ runuser -u www-data -- php /var/www/owncloud/occ "$@"; } # Adjusting config file: local config_php='/var/www/owncloud/config/config.php' @@ -4685,7 +4685,7 @@ location = /.well-known/caldav { return 301 /nextcloud/remote.php/dav/; }' > /e G_EXEC systemctl restart redis-server # Initially add occ command shortcut, will be added as alias by /etc/bashrc.d/dietpi.bash if occ file exist: - ncc(){ sudo -u www-data php /var/www/nextcloud/occ "$@"; } + ncc(){ runuser -u www-data -- php /var/www/nextcloud/occ "$@"; } # Adjusting config file: local config_php='/var/www/nextcloud/config/config.php' @@ -6668,7 +6668,17 @@ _EOF_ # Install as local instance for "nodered" user G_EXEC cd /mnt/dietpi_userdata/node-red - G_EXEC_OUTPUT=1 G_EXEC sudo -u nodered npm i --no-audit node-red + # - Disable cache + local cache=$(runuser -u nodered -- mktemp -d) + # - Reinstall: Remove all locally installed modules, to work around update issues, but preserve installed plugins from package.json: https://github.com/MichaIng/DietPi/issues/7128 + if [[ -f 'package.json' ]] + then + G_EXEC rm -Rf node_modules .npm/_cacache + G_EXEC_OUTPUT=1 G_EXEC runuser -u nodered -- npm up --cache "$cache" --no-audit + else + G_EXEC_OUTPUT=1 G_EXEC runuser -u nodered -- npm i --cache "$cache" --no-audit node-red + fi + G_EXEC rm -R "$cache" G_EXEC cd "$G_WORKING_DIR" # Service @@ -6769,10 +6779,10 @@ _EOF_ fi # RPi: Install "onoff" for GPIO access - (( $G_HW_MODEL > 9 )) || G_EXEC_OUTPUT=1 G_EXEC npm i -g --no-audit onoff + (( $G_HW_MODEL > 9 )) || G_EXEC_OUTPUT=1 G_EXEC npm i -g --no-audit onoff@latest # Install Blynk JS library - G_EXEC_OUTPUT=1 G_EXEC npm i -g --no-audit blynk-library + G_EXEC_OUTPUT=1 G_EXEC npm i -g --no-audit blynk-library@latest # Preserve existing config if [[ ! -f '/mnt/dietpi_userdata/blynk/server.properties' ]] @@ -7092,12 +7102,12 @@ _EOF_ # CLI install: https://github.com/FreshRSS/FreshRSS/blob/master/cli/README.md#commands G_EXEC cd /opt/FreshRSS - sudo -u www-data php ./cli/prepare.php - sudo -u www-data php ./cli/do-install.php --default_user dietpi --auth_type form --environment production --title FreshRSS --db-type mysql --db-host localhost --db-user freshrss --db-password "$password" --db-base freshrss --db-prefix freshrss + runuser -u www-data -- php ./cli/prepare.php + runuser -u www-data -- php ./cli/do-install.php --default_user dietpi --auth_type form --environment production --title FreshRSS --db-type mysql --db-host localhost --db-user freshrss --db-password "$password" --db-base freshrss --db-prefix freshrss unset -v password - sudo -u www-data php ./cli/create-user.php --user dietpi --password "$GLOBAL_PW" --api_password "$GLOBAL_PW" - sudo -u www-data php ./cli/actualize-user.php --user dietpi - sudo -u www-data php ./cli/db-optimize.php --user dietpi + runuser -u www-data -- php ./cli/create-user.php --user dietpi --password "$GLOBAL_PW" --api_password "$GLOBAL_PW" + runuser -u www-data -- php ./cli/actualize-user.php --user dietpi + runuser -u www-data -- php ./cli/db-optimize.php --user dietpi G_EXEC cd "$G_WORKING_DIR" # Link web interface to webroot @@ -8383,7 +8393,7 @@ _EOF_ G_EXEC chmod +x mineos_console.js webui.js update_webui.sh reset_webui.sh generate-sslcert.sh # Workaround: Node.js posix needs to be installed alone first: https://github.com/MichaIng/DietPi/issues/5181 - G_EXEC_OUTPUT=1 G_EXEC npm i --no-audit --no-package-lock posix + G_EXEC_OUTPUT=1 G_EXEC npm i --no-audit --no-package-lock posix@latest # Install MineOS G_EXEC_OUTPUT=1 G_EXEC npm i --no-audit @@ -8934,7 +8944,7 @@ _EOF_ G_EXEC chown dietpi /mnt/dietpi_userdata # Run Syncthing to pre-create config dir and exit - G_EXEC_OUTPUT=1 G_EXEC sudo -u dietpi /opt/syncthing/syncthing -generate=/mnt/dietpi_userdata/syncthing + G_EXEC_OUTPUT=1 G_EXEC runuser -u dietpi -- /opt/syncthing/syncthing -generate=/mnt/dietpi_userdata/syncthing # Allow remote access: https://docs.syncthing.net/users/faq.html#how-do-i-access-the-web-gui-from-another-computer G_EXEC sed --follow-symlinks -i '\|:8384|c\
0.0.0.0:8384
' /mnt/dietpi_userdata/syncthing/config.xml @@ -9127,9 +9137,9 @@ _EOF_ if [[ ${aSOFTWARE_INSTALL_STATE[153]} == 2 && -f '/mnt/dietpi_userdata/octoprint/.octoprint/config.yaml' ]] then G_DIETPI-NOTIFY 2 'Configuring OctoPrint to use mjpg-streamer for webcam support' - G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(G_GET_NET ip):8082/?action=stream" - G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' - G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(G_GET_NET ip):8082/?action=stream" + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" fi fi @@ -9382,8 +9392,8 @@ _EOF_ Download_Test_Media # Init - G_EXEC_OUTPUT=1 G_EXEC sudo -u koel "php$PHP_VERSION" artisan koel:init -n --no-assets - G_EXEC_OUTPUT=1 G_EXEC sudo -u koel "php$PHP_VERSION" artisan koel:sync + G_EXEC_OUTPUT=1 G_EXEC runuser -u koel -- "php$PHP_VERSION" artisan koel:init -n --no-assets + G_EXEC_OUTPUT=1 G_EXEC runuser -u koel -- "php$PHP_VERSION" artisan koel:sync G_EXEC cd "$G_WORKING_DIR" # Service: Run on port 8003 by default to avoid conflict with Icecast @@ -10154,7 +10164,7 @@ _EOF_ aDEPS=('gcc' 'libffi-dev') G_EXEC curl -sSf 'https://sh.rustup.rs/' -o rustup-init.sh G_EXEC chmod +x rustup-init.sh - G_EXEC_OUTPUT=1 G_EXEC sudo -u octoprint ./rustup-init.sh -y --profile minimal + G_EXEC_OUTPUT=1 G_EXEC runuser -u octoprint -- ./rustup-init.sh -y --profile minimal G_EXEC rm rustup-init.sh aPATH=("PATH='/mnt/dietpi_userdata/octoprint/.cargo/bin:$PATH'") @@ -10168,7 +10178,7 @@ _EOF_ [[ -d '/mnt/dietpi_userdata/octoprint/.cache' ]] && G_EXEC rm -R /mnt/dietpi_userdata/octoprint/.cache # Install OctoPrint - G_EXEC_OUTPUT=1 G_EXEC sudo -u octoprint "${aPATH[@]}" pip3 install -U --user --no-warn-script-location octoprint + G_EXEC_OUTPUT=1 G_EXEC runuser -u octoprint -- "${aPATH[@]}" pip3 install -U --user --no-warn-script-location octoprint # Service: https://github.com/OctoPrint/OctoPrint/blob/master/scripts/octoprint.service cat << '_EOF_' > /etc/systemd/system/octoprint.service @@ -10190,22 +10200,22 @@ _EOF_ echo "alias octoprint='sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint'" > /etc/bashrc.d/dietpi-octoprint.sh # On fresh installs, change listening port to 5001 to avoid conflict with Shairport Sync. - [[ -f '/mnt/dietpi_userdata/octoprint/.octoprint/config.yaml' ]] || G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.port '5001' + [[ -f '/mnt/dietpi_userdata/octoprint/.octoprint/config.yaml' ]] || G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.port '5001' # Apply service and system commands: Allow execution via specific sudoers config, use "which" for "reboot" and "poweroff", since we create shell functions in dietpi-globals to bypass logind calls, if logind is not running. # shellcheck disable=SC2230 echo "octoprint ALL=NOPASSWD: $(command -v systemctl) restart octoprint, $(which reboot), $(which poweroff)" > /etc/sudoers.d/octoprint - G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.serverRestartCommand 'sudo systemctl restart octoprint' - G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemRestartCommand 'sudo reboot' - G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemShutdownCommand 'sudo poweroff' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.serverRestartCommand 'sudo systemctl restart octoprint' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemRestartCommand 'sudo reboot' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set server.commands.systemShutdownCommand 'sudo poweroff' # mjpg-streamer: Configure OctoPrint to use it, if installed if (( ${aSOFTWARE_INSTALL_STATE[137]} > 0 )) then G_DIETPI-NOTIFY 2 'Configuring OctoPrint to use mjpg-streamer for webcam support' - G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(G_GET_NET ip):8082/?action=stream" - G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' - G_EXEC sudo -u octoprint /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.stream "http://$(G_GET_NET ip):8082/?action=stream" + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.snapshot 'http://127.0.0.1:8082/?action=snapshot' + G_EXEC runuser -u octoprint -- /mnt/dietpi_userdata/octoprint/.local/bin/octoprint config set webcam.ffmpeg "$(command -v ffmpeg)" fi fi @@ -10892,7 +10902,7 @@ _EOF_ # -sm: Skip mimic build which is time intense and can be manually done any time later. # - Remove PulseAudio from dependencies, we use ALSA G_EXEC sed --follow-symlinks -Ei 's/[^[:blank:]"'\'']*pulseaudio[^[:blank:]"'\'']*//g' ./dev_setup.sh - G_EXEC_OUTPUT=1 G_EXEC sudo -u mycroft ./dev_setup.sh -sm + G_EXEC_OUTPUT=1 G_EXEC runuser -u mycroft -- ./dev_setup.sh -sm G_EXEC cd "$G_WORKING_DIR" # Service @@ -11306,7 +11316,7 @@ _EOF_ G_EXEC curl -sSf 'https://sh.rustup.rs/' -o rustup-init.sh G_EXEC chmod +x rustup-init.sh # RPi with 64-bit kernel on 32-bit image: Enforce 32-bit toolchain: https://github.com/MichaIng/DietPi/issues/6306 - G_EXEC_OUTPUT=1 G_EXEC sudo -u "$ha_user" ./rustup-init.sh -y --profile minimal ${RPI_64KERNEL_32OS:+'--default-host' 'armv7-unknown-linux-gnueabihf'} + G_EXEC_OUTPUT=1 G_EXEC runuser -u "$ha_user" -- ./rustup-init.sh -y --profile minimal ${RPI_64KERNEL_32OS:+'--default-host' 'armv7-unknown-linux-gnueabihf'} G_EXEC rm rustup-init.sh fi @@ -11353,7 +11363,7 @@ eval \"\$(pyenv init -)\" [ -f '.cargo/env' ] && . .cargo/env" > "$ha_home/pyenv-activate.sh" G_EXEC_DESC='Installing Python with Home Assistant module into pyenv' - G_EXEC_OUTPUT=1 G_EXEC sudo -u "$ha_user" dash -c " + G_EXEC_OUTPUT=1 G_EXEC runuser -u "$ha_user" -- dash -c " $ha_pyenv_activation pyenv install $ha_python_version pyenv local $ha_python_version @@ -12359,8 +12369,8 @@ If no WireGuard (auto)start is included, but you require it, please do the follo systemctl start redis-server if systemctl start mariadb then - sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off - sudo -u www-data php /var/www/nextcloud/occ app:disable spreed + runuser -u www-data -- php /var/www/nextcloud/occ maintenance:mode --off + runuser -u www-data -- php /var/www/nextcloud/occ app:disable spreed fi G_DIETPI-NOTIFY 2 'Disabled Nextcloud Talk app, but you need to remove it manually from Nextcloud web UI, if desired.' fi @@ -12630,8 +12640,8 @@ If no WireGuard (auto)start is included, but you require it, please do the follo [[ -d '/mnt/dietpi_userdata/synapse' ]] && G_EXEC rm -R /mnt/dietpi_userdata/synapse command -v pip3 > /dev/null && G_EXEC_OUTPUT=1 G_EXEC pip3 uninstall -y matrix-synapse - command -v dropdb > /dev/null && sudo -u postgres dropdb synapse - command -v dropuser > /dev/null && sudo -u postgres dropuser synapse + command -v dropdb > /dev/null && runuser -u postgres -- dropdb synapse + command -v dropuser > /dev/null && runuser -u postgres -- dropuser synapse fi if To_Uninstall 132 # Aria2 From 4a5d8b2f031c90b8a282e760630a9592040b8964 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 25 Jun 2024 23:16:56 +0200 Subject: [PATCH 52/66] v9.6 - DietPi-Software | Readarr: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 9ef1111964..26a06369a6 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10037,7 +10037,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.28.2554/Readarr.develop.0.3.28.2554.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.29.2565/Readarr.develop.0.3.29.2565.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 From e4c8c86f99185171266eedb2fcc76f1b9c59f240 Mon Sep 17 00:00:00 2001 From: Frapi d'Illiers Date: Wed, 26 Jun 2024 17:25:18 +0200 Subject: [PATCH 53/66] v9.6 (#7121) - DietPi-Banner | Resolved an issue where logins as non-root user printed "No certificate found" if the Let's Encrypt cert status option was enabled, since non-root users have no permission to see the certificate files. In such cases, sudo is now used automatically, if the user has NOPASSWD permissions, else a meaningful info is shown. Many thanks to @FrapiFrance for implementing this fix: https://github.com/MichaIng/DietPi/pull/7121 Co-authored-by: fdilliers Co-authored-by: MichaIng --- CHANGELOG.txt | 1 + dietpi/func/dietpi-banner | 31 +++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 57d67fffb9..c017118aca 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ Bug fixes: - VisionFive 2 | Resolved an issue where our new image did not boot, because of a false device tree name in /boot/extlinux/extlinux.conf. - NanoPi R6C | Resolved an issue where our new images did not boot, since the latest mainline U-Boot for R6S does not support the R6C anymore. Many thanks to @labmaster for reporting this issue: https://github.com/MichaIng/DietPi/issues/7109 - DietPi-Banner | Resolved an issue where incorrect RAM usage was printed with German and potentially other locales. Many thanks to @jwgn for reporting this issue: https://github.com/MichaIng/DietPi/issues/7107 +- DietPi-Banner | Resolved an issue where logins as non-root user printed "No certificate found" if the Let's Encrypt cert status option was enabled, since non-root users have no permission to see the certificate files. In such cases, sudo is now used automatically, if the user has NOPASSWD permissions, else a meaningful info is shown. Many thanks to @FrapiFrance for implementing this fix: https://github.com/MichaIng/DietPi/pull/7121 - DietPi-Dashboard | Resolved an issue where the installation on RISC-V systems failed. - DietPi-Software | Node-RED: Resolved an issue where reinstalls/updates failed because of incompatibilities between latest Node.js or global modules with older local instances. Many thanks to @thinkbig1979 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7128 diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index 044f0c8cc5..c6b04d3b98 100755 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -182,6 +182,20 @@ $GREEN_LINE" echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[5]} $GREEN_SEPARATOR ${ip:-Use dietpi-config to setup a connection} (${iface:-NONE})" } + Print_Cert_Status() + { + # Let's Encrypt cert status - MUST be run as root + local i + for i in /etc/letsencrypt/live/*/cert.pem + do + # shellcheck disable=SC2292 + [ -f "$i" ] || continue + openssl x509 -enddate -noout -in "$i" | mawk '/notAfter=/{print "Valid until "$4"-"substr($1,10)"-"$2" "$3}' + return 0 + done + echo 'No certificate found' + } + Print_Credits() { echo -e " ${aCOLOUR[2]}DietPi Team : https://github.com/MichaIng/DietPi#the-dietpi-project-team" @@ -262,14 +276,15 @@ $GREEN_LINE" # Let's Encrypt cert status if (( ${aENABLED[16]} == 1 )) then - local i certinfo='No certificate found' - for i in /etc/letsencrypt/live/*/cert.pem - do - [[ -f $i ]] || continue - certinfo=$(openssl x509 -enddate -noout -in "$i" | mawk '/notAfter=/{print "Valid until "$4"-"substr($1,10)"-"$2" "$3}' 2>&1) - break - done - echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[16]} $GREEN_SEPARATOR $certinfo" + echo -en "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[16]} $GREEN_SEPARATOR " + if [[ $EUID == 0 ]] + then + # Running as root + Print_Cert_Status 2>&1 + else + # Running as non-root: Fail silently without NOPASSWD to avoid password prompt, but print info instead + sudo -n dash -c "$(declare -f Print_Cert_Status); Print_Cert_Status 2>&1" 2> /dev/null || echo 'NOPASSWD sudo required to obtain cert status' + fi fi # Custom (( ${aENABLED[10]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[10]} $GREEN_SEPARATOR $(bash "$FP_CUSTOM" 2>&1)" From adb54f37cc13ef0d2bd41245b3562870a2b00f52 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 26 Jun 2024 17:37:33 +0200 Subject: [PATCH 54/66] v9.6 - DietPi-Software | ruTorrent: Update fallback version --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 26a06369a6..3d8192e54e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8538,7 +8538,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.3.4'; 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.3.5'; 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 From 4ea651484805d49971a26268b3758db729453738 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jun 2024 13:23:23 +0200 Subject: [PATCH 55/66] v9.6 - DietPi-Software | qBittorrent: Stashed tiny change: I want to generally replace "command -v" derived executable paths in systemd units with the hardcoded ones we know and expect from installed packages. If someone compiles alternative versions, it is just consequent that this requires an alteration of the systemd service as well. --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3d8192e54e..0219213083 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8511,7 +8511,7 @@ _EOF_ fi # Service - cat << _EOF_ > /etc/systemd/system/qbittorrent.service + cat << '_EOF_' > /etc/systemd/system/qbittorrent.service [Unit] Description=qBittorrent (DietPi) Documentation=man:qbittorrent-nox(1) @@ -8522,7 +8522,7 @@ After=network-online.target remote-fs.target User=qbittorrent UMask=002 LogsDirectory=qbittorrent -ExecStart=$(command -v qbittorrent-nox) +ExecStart=/usr/bin/qbittorrent-nox [Install] WantedBy=multi-user.target From 00c4099b40d9b67f3f795d1192593db099783358 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 29 Jun 2024 04:37:15 -0700 Subject: [PATCH 56/66] v9.6 (#7133) - DietPi-Software | ADS-B Feeder: Fix failing service start by adding the missing python requests library and the app flag file. Signed-off-by: Dirk Hohndel --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 14 +++++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c017118aca..e7275e818d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -46,6 +46,7 @@ Bug fixes: - DietPi-Software | Shairport Sync: Resolved a DietPi v9.4 regression, where the AirPlay 2 choice did not have an effect, but the AirPlay 1 package was always installed. Additionally, uninstalling Shairport Sync will now also purge the AirPlay 2 package. Many thanks to @pulpe for fixing this bug: https://github.com/MichaIng/DietPi/pull/7082 - DietPi-Software | Box64: Resolved an issue where an invalid build target was used on Raspberry Pi 5 with 16k page size kernel. This target was removed with latest Box64, as page size handling is now done at runtime. - DietPi-Software | Jellyfin: Resolved an issue where the intended HTTP port change could not be applied, since the network config file is not created anymore at service start. We do now pre-create a minimal one, which is complemented with defaults automatically. +- DietPi-Software | ADS-B Feeder: Resolved an issue where the service start could have failed because of a missing Python module. Many thanks to @moonraka for reporting the issue and @dirkhh sending a fix quickly: https://dietpi.com/forum/t/ads-b-feeder-not-working/20601 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/7098 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 0219213083..74b728d88f 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11925,18 +11925,14 @@ _EOF_ G_EXEC mkdir -p /mnt/dietpi_userdata/adsb-feeder/config G_EXEC ln -s /mnt/dietpi_userdata/adsb-feeder/config . - # set the 'image name' and version that are shown in the footer of the Web UI + # set the 'image name' and version that are shown in the footer of the Web UI and mark as app, not image G_EXEC eval 'echo '\''ADSB Feeder app running on DietPi'\'' > feeder-image.name' G_EXEC eval "echo '$ADSB_FEEDER_VERSION' > adsb.im.version" + G_EXEC rm -f os.adsb.feeder.image + G_EXEC touch app.adsb.feeder.image - # get the Python module - # for older distros we need to install via pip in order to get flask 2 - if (( $G_DISTRO < 7 )) - then - G_EXEC_OUTPUT=1 G_EXEC pip3 install -U flask - else - G_AGI python3-flask - fi + # get the Python modules + G_EXEC_OUTPUT=1 G_EXEC pip3 install -U flask requests # finally ensure that /run allows executables (this is needed for the containers to be able to not do excessive # writes to physical storage - which might be an SD card) From d3f88a15d967bdba810c37cb2d1980621640771c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jun 2024 16:54:56 +0200 Subject: [PATCH 57/66] v9.6 - DietPi-Software | Forefox: Remove user configs on uninstall --- dietpi/dietpi-software | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 74b728d88f..1de13284f4 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -13780,6 +13780,8 @@ _EOF_ if To_Uninstall 67 # Firefox then G_AGP firefox-esr + G_EXEC rm -Rf /{root,home/*}/.mozilla/firefox + for i in /{root,home/*}/.mozilla; do [[ -d $i ]] && G_EXEC rmdir --ignore-fail-on-non-empty "$i"; done fi if To_Uninstall 159 # Allo GUI full From 562630acc29a81321799ec1c089c8630cf99838e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 29 Jun 2024 19:43:34 +0200 Subject: [PATCH 58/66] v9.6 - DietPi-Drive_Manager | Resolved an issue, where network drives and potentially mounts in general could be attempted to be unmounted on shutdown, before services which can access them are stopped, leading to hanging shutdown sequences and potentially even data loss. Many thanks to @polite-garlic for reporting this issue: https://dietpi.com/forum/t/20542 --- CHANGELOG.txt | 1 + dietpi/dietpi-drive_manager | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e7275e818d..8a9913100b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -16,6 +16,7 @@ Bug fixes: - NanoPi R6C | Resolved an issue where our new images did not boot, since the latest mainline U-Boot for R6S does not support the R6C anymore. Many thanks to @labmaster for reporting this issue: https://github.com/MichaIng/DietPi/issues/7109 - DietPi-Banner | Resolved an issue where incorrect RAM usage was printed with German and potentially other locales. Many thanks to @jwgn for reporting this issue: https://github.com/MichaIng/DietPi/issues/7107 - DietPi-Banner | Resolved an issue where logins as non-root user printed "No certificate found" if the Let's Encrypt cert status option was enabled, since non-root users have no permission to see the certificate files. In such cases, sudo is now used automatically, if the user has NOPASSWD permissions, else a meaningful info is shown. Many thanks to @FrapiFrance for implementing this fix: https://github.com/MichaIng/DietPi/pull/7121 +- DietPi-Drive_Manager | Resolved an issue, where network drives and potentially mounts in general could be attempted to be unmounted on shutdown, before services which can access them are stopped, leading to hanging shutdown sequences and potentially even data loss. Many thanks to @polite-garlic for reporting this issue: https://dietpi.com/forum/t/20542 - DietPi-Dashboard | Resolved an issue where the installation on RISC-V systems failed. - DietPi-Software | Node-RED: Resolved an issue where reinstalls/updates failed because of incompatibilities between latest Node.js or global modules with older local instances. Many thanks to @thinkbig1979 for reporting this issue: https://github.com/MichaIng/DietPi/issues/7128 diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 7a18cd438f..00e10d6ab5 100755 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -267,7 +267,7 @@ $swap_mounts else - options+=',nofail,noauto,x-systemd.automount' + options+=',noauto,x-systemd.automount' fi @@ -369,7 +369,7 @@ $swap_mounts # - Container: Assume host supports it (relevant for network drives) if (( $G_HW_MODEL != 75 )) && ! modprobe -nq autofs4 then - sed --follow-symlinks -Ei '/x-systemd\.automount/s/,(noauto|x-systemd\.automount)//g' "$fp_fstab_tmp" + sed --follow-symlinks -i -e '/,x-systemd\.automount/s/noauto/nofail/' -e 's/,x-systemd\.automount//' "$fp_fstab_tmp" G_DIETPI-NOTIFY 2 'autofs4 module not available in kernel, x-systemd.automount has been disabled, all drives will be mounted at boot instead' fi @@ -1757,7 +1757,7 @@ _EOF_ # Apply to fstab sed --follow-symlinks -i "\#[[:blank:]]${samba_fp_mount_target}[[:blank:]]#d" /etc/fstab # - NB: Convert spaces to '\040': https://github.com/MichaIng/DietPi/issues/1201#issuecomment-339720271 - echo "//$samba_clientname/${samba_clientshare//[[:blank:]]/\\040} $samba_fp_mount_target cifs cred=$cred,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i,nofail,noauto,x-systemd.automount" >> /etc/fstab + echo "//$samba_clientname/${samba_clientshare//[[:blank:]]/\\040} $samba_fp_mount_target cifs cred=$cred,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i,noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$samba_fp_mount_target Init_Drives_and_Refresh @@ -1870,7 +1870,7 @@ _EOF_ then # Apply to fstab sed --follow-symlinks -i "\#[[:blank:]]${nfs_fp_mount_target}[[:blank:]]#d" /etc/fstab - echo "$nfs_server_ip:$nfs_fp_server_share $nfs_fp_mount_target nfs nofail,noauto,x-systemd.automount" >> /etc/fstab + echo "$nfs_server_ip:$nfs_fp_server_share $nfs_fp_mount_target nfs noauto,x-systemd.automount" >> /etc/fstab MENU_DRIVE_TARGET=$nfs_fp_mount_target Init_Drives_and_Refresh From f1eb0ee1d40f1e148180f862574a407db716fa20 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 30 Jun 2024 19:23:33 +0200 Subject: [PATCH 59/66] v9.6 - DietPi-Backup | Add additional note to backup confirmation dialogue, that software services will be stopped: https://github.com/MichaIng/DietPi/issues/6897 --- dietpi/dietpi-backup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index 733b6d3bda..c453844a95 100755 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -489,7 +489,7 @@ _EOF_ 'Help') G_WHIP_MSG 'DietPi-Backup is a program that allows you to Backup and Restore your DietPi system. \nIf you have broken your system, or want to reset your system to an earlier date, this can all be done with DietPi-Backup. \nSimply choose a location where you want to save and restore your backups from, then, select Backup or Restore. -\nEnable a daily system backup to run it once a day via daily cron job. The execution time can be changed in "dietpi-cron". Note that this temporarily stops server services. Also we recommend to configure and test the backup with a manual call before enabling this feature. +\nEnable a daily system backup to run it once a day via daily cron job. The execution time can be changed in "dietpi-cron". Note that this temporarily stops software services. Also we recommend to configure and test the backup with a manual call before enabling this feature. \nMore information: https://dietpi.com/docs/dietpi_tools/#dietpi-backup-backuprestore';; 'Last log') log=1 G_WHIP_VIEWFILE "$FP_TARGET/$FP_LOG";; @@ -506,7 +506,7 @@ _EOF_ 'Delete') G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET" && G_EXEC_NOEXIT=1 G_EXEC rm -R "$FP_TARGET";; - 'Backup') G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET\n\nDo you wish to continue and start the backup?" && Run_Backup;; + 'Backup') G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET\n\nThis will temporarily stop software services\!\n\nDo you wish to continue and start the backup?" && Run_Backup;; 'Restore') if (( $AMOUNT > 1 )) From d1d23686e97feb7fe28cc29263ec75a325fcf3ea Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 30 Jun 2024 19:41:14 +0200 Subject: [PATCH 60/66] v9.6 - DietPi-Software | Assure that the script does not continue to run after the reboot call, when a dist-upgrade is done on first login, with a kernel upgrade which removes currently used kernel modules. Also auto-remove packages after the dist-upgrade, to assure x86_64 systems are rebooted as well. Debian uses versioned kernel packages, pulled in by the meta package, so old kernel modules remain until the auto-removal purges the old versioned package. --- dietpi/dietpi-software | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1de13284f4..cceab29f60 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14493,13 +14493,14 @@ _EOF_ if [[ ! -f '/boot/dietpi/.skip_distro_upgrade' ]] then G_AGUP - # Do not repeat APT update in Run_Installations() - SKIP_APT_UPDATE=1 G_AGDUG + G_AGA # Create a persistent flag to not repeat G_AGDUG and rule out a reboot loop when kernel modules remain missing G_EXEC eval '> /boot/dietpi/.skip_distro_upgrade' # Perform a reboot if required as of missing kernel modules - G_CHECK_KERNEL || { G_DIETPI-NOTIFY 2 'A reboot is done to finalise the kernel upgrade'; sync; reboot; } + G_CHECK_KERNEL || { G_DIETPI-NOTIFY 2 'A reboot is done to finalise the kernel upgrade'; sync; reboot; exit 0; } + # Do not repeat APT update in Run_Installations() + SKIP_APT_UPDATE=1 fi # Global PW From 31d6c89da072ccd915386b46406f387e0ff82ae9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 30 Jun 2024 19:47:58 +0200 Subject: [PATCH 61/66] v9.6 - DietPi-Backup | A leading exclamation mark is interpreted as event call. Escaping it with slash prevents that, but the slash remains in the string. Solve it with trailing space instead. --- dietpi/dietpi-backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-backup b/dietpi/dietpi-backup index c453844a95..ce894b9d0f 100755 --- a/dietpi/dietpi-backup +++ b/dietpi/dietpi-backup @@ -506,7 +506,7 @@ _EOF_ 'Delete') G_WHIP_YESNO "Do you wish to DELETE the following backup?\n - $FP_TARGET" && G_EXEC_NOEXIT=1 G_EXEC rm -R "$FP_TARGET";; - 'Backup') G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET\n\nThis will temporarily stop software services\!\n\nDo you wish to continue and start the backup?" && Run_Backup;; + 'Backup') G_WHIP_YESNO "The system will be backed up to:\n - $FP_TARGET\n\nThis will temporarily stop software services! \n\nDo you wish to continue and start the backup?" && Run_Backup;; 'Restore') if (( $AMOUNT > 1 )) From 867addaea737edde4be7efcfe9ae1ec781364841 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 2 Jul 2024 22:04:39 +0200 Subject: [PATCH 62/66] v9.6 - DietPi-Software | Update fallback URLs --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cceab29f60..68c980a882 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8929,7 +8929,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.8/syncthing-linux-$arch-v1.27.8.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.9/syncthing-linux-$arch-v1.27.9.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 @@ -11665,7 +11665,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/restic/restic/releases/download/v0.16.4/restic_0.16.4_linux_$arch.bz2" + local fallback_url="https://github.com/restic/restic/releases/download/v0.16.5/restic_0.16.5_linux_$arch.bz2" Download_Install "$(curl -sSfL 'https://api.github.com/repos/restic/restic/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/restic_[^\"\/]*_linux_$arch\.bz2\"$/{print \$4}")" /usr/local/bin/restic G_EXEC chmod +x /usr/local/bin/restic fi From 1470a6b35fa0b8e90f9345bc4c4e7185bb0837cc Mon Sep 17 00:00:00 2001 From: Subhaditya Nath <56714626+subnut@users.noreply.github.com> Date: Wed, 3 Jul 2024 04:12:21 +0530 Subject: [PATCH 63/66] v9.6 (#7124) - DietPi-Software | soju: This IRC bouncer has been added to our software catalogue. Many thanks to @subnut for implementing it: https://github.com/MichaIng/DietPi/pull/7124 Co-authored-by: MichaIng --- .github/workflows/dietpi-software.bash | 5 ++ .meta/dietpi-survey_report | 1 + CHANGELOG.txt | 3 + README.md | 1 + dietpi/dietpi-services | 1 + dietpi/dietpi-software | 89 ++++++++++++++++++++++++++ 6 files changed, 100 insertions(+) diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 4dd6efdf90..28882c83ad 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -240,6 +240,7 @@ Process_Software() 209) aCOMMANDS[i]='restic version';; 211) aCOMMANDS[i]='hb-service status' aSERVICES[i]='homebridge' aTCP[i]='8581'; (( $arch < 10 )) && aDELAY[i]=30; (( $arch == 3 )) && aDELAY[i]=120;; 212) aSERVICES[i]='kavita' aTCP[i]='2036'; (( $arch < 10 )) && aDELAY[i]=180; (( $arch == 10 )) && aDELAY[i]=30;; + 213) aSERVICES[i]='soju' aTCP[i]='6667';; *) :;; esac done @@ -261,6 +262,8 @@ do #86|134|185) Process_Software 162;; # Docker does not start in systemd containers (without dedicated network) 166) Process_Software 70;; 180) (( $arch == 10 || $arch == 3 )) || Process_Software 170;; + 188) Process_Software 17;; + 213) Process_Software 17 188;; *) :;; esac Process_Software "$i" @@ -351,6 +354,7 @@ G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ INFO ] Unsup # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt # - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 +# - Set HOME path, required e.g. go builds, which is otherwise missing when started from a systemd unit. if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $arch && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $arch ) )) then cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service @@ -361,6 +365,7 @@ After=dietpi-postboot.service [Service] Type=idle StandardOutput=tty +Environment=HOME=/root ExecStart=/bin/dash -c 'infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb; exec /boot/dietpi/dietpi-login' ExecStop=/sbin/poweroff diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 690509e96c..c13944aa27 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -726,6 +726,7 @@ shopt -s extglob do aSOFTWARE_NAME9_6[i]=${aSOFTWARE_NAME9_5[i]} done + aSOFTWARE_NAME9_6[213]='soju' # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs for i in "${aSOFTWARE_NAME9_6[@]}" diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8a9913100b..f94024d1ce 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,9 @@ v9.6 (2024-07-06) +New software: +- soju | This IRC bouncer has been added to our software catalogue. Many thanks to @subnut for implementing it: https://github.com/MichaIng/DietPi/pull/7124 + Enhancements: - General | Since we provide all kernel, bootloader and firmware packages from our own APT repository now, the Armbian APT repository is removed form all systems. In case you use an SBC which is not officially supported by DietPi, as generic device, it is however preserved. - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 diff --git a/README.md b/README.md index a6805bf5bf..95022d1050 100644 --- a/README.md +++ b/README.md @@ -340,6 +340,7 @@ Links to hardware and software manufacturers, sources and build instructions use - [ADS-B Feeder](https://github.com/dirkhh/adsb-feeder-image) - [Kavita](https://github.com/Kareadita/Kavita) - [Forgejo](https://codeberg.org/forgejo/forgejo) +- [soju](https://github.com/emersion/soju) --- diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index 07d9a13610..2c267a3045 100755 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -230,6 +230,7 @@ _EOF_ 'openbazaar' 'synapse' 'microblog-pub' + 'soju' # - Hardware Projects 'pi-spc' diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 68c980a882..50e323539f 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1047,6 +1047,13 @@ Available commands: aSOFTWARE_CATX[$software_id]=6 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/social/#mediawiki' aSOFTWARE_DEPS[$software_id]='88 89 webserver' + #------------------ + software_id=213 + aSOFTWARE_NAME[$software_id]='soju' + aSOFTWARE_DESC[$software_id]='A user-friendly IRC bouncer' + aSOFTWARE_CATX[$software_id]=6 + aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/social/#soju' + aSOFTWARE_DEPS[$software_id]='188' # Camera & Surveillance #-------------------------------------------------------------------------------- @@ -12097,6 +12104,70 @@ If no WireGuard (auto)start is included, but you require it, please do the follo unset -v choice_required domain port invalid_text server_ip fi + + if To_Install 213 soju # soju + then + # Dependencies + aDEPS=('make' 'scdoc' 'gcc' 'libsqlite3-dev' 'libpam-dev') + + # Download + local fallback_url='https://github.com/emersion/soju/releases/download/v0.8.0/soju-0.8.0.tar.gz' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/emersion/soju/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/soju-[^"\/]*\.tar\.gz"$/{print $4}')" + + # Build + G_EXEC cd soju-* + G_EXEC_OUTPUT=1 G_EXEC make all "-j$(nproc)" config_path='/mnt/dietpi_userdata/soju/config' GOFLAGS='-tags=pam,libsqlite3' + + # Install + local commands=('soju' 'sojuctl' 'sojudb') + local manpages=('doc/soju.1' 'doc/sojuctl.1') + G_EXEC cp "${commands[@]}" /usr/local/bin/ + G_EXEC mkdir -p /usr/local/share/man/man1 + G_EXEC cp "${manpages[@]}" /usr/local/share/man/man1/ + + # Config + if [[ ! -f '/mnt/dietpi_userdata/soju/config' ]] + then + # We shall default to on-disk chat logs + # It's a lossy format, as stated under `message-store` subsection in https://soju.im/doc/soju.1.html#CONFIG_FILE + # But it's the recommended setting as per https://git.sr.ht/~emersion/soju/tree/master/doc/getting-started.md + G_EXEC mkdir -p /mnt/dietpi_userdata/soju + cat <<- '_EOF_' > /mnt/dietpi_userdata/soju/config + db sqlite3 /mnt/dietpi_userdata/soju/data.db + message-store fs /mnt/dietpi_userdata/soju/logs + listen irc+insecure:// + listen unix+admin:// + _EOF_ + fi + + # User + Create_User -d /mnt/dietpi_userdata/soju soju + G_EXEC chown 'soju:soju' -R /mnt/dietpi_userdata/soju + G_EXEC chmod 0660 -R /mnt/dietpi_userdata/soju + G_EXEC chmod 0770 /mnt/dietpi_userdata/soju + + # Service: https://github.com/emersion/soju/blob/master/contrib/soju.service + # - CAP_NET_BIND_SERVICE needed for builtin identd server: https://github.com/emersion/soju/blob/master/doc/packaging.md#binding-to-privileged-ports + cat << '_EOF_' > /etc/systemd/system/soju.service +[Unit] +Description=soju IRC bouncer service +Documentation=https://soju.im/ +Documentation=man:soju(1) man:sojuctl(1) +Wants=network-online.target +After=network-online.target + +[Service] +User=soju +RuntimeDirectory=soju +WorkingDirectory=/mnt/dietpi_userdata/soju +AmbientCapabilities=CAP_NET_BIND_SERVICE +ExecStart=/usr/local/bin/soju +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target +_EOF_ + fi } # $1: 0=None -1=Dropbear -2=OpenSSH @@ -14229,6 +14300,24 @@ _EOF_ [[ -d '/mnt/dietpi_userdata/spotifyd' ]] && G_EXEC rm -R /mnt/dietpi_userdata/spotifyd fi + if To_Uninstall 213 # soju + then + Remove_Service soju 1 1 + local x + local commands=('soju' 'sojuctl' 'sojudb') + local manpages=('soju.1' 'sojuctl.1') + for x in "${commands[@]}" + do + [[ -f /usr/local/bin/$x ]] && G_EXEC rm "/usr/local/bin/$x" + done + for x in "${manpages[@]}" + do + [[ -f /usr/local/share/man/man1/$x ]] && G_EXEC rm "/usr/local/share/man/man1/$x" + done + [[ -d '/usr/local/share/man/man1' ]] && G_EXEC rmdir -p --ignore-fail-on-non-empty /usr/local/share/man/man1 + [[ -d '/mnt/dietpi_userdata/soju' ]] && G_EXEC rm -Rf /mnt/dietpi_userdata/soju + fi + G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Finalising uninstall' # Uninstall finished, set all uninstalled software to state 0 (not installed) From a3068d2a4dcef349080bed4a073ced690103cca1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 3 Jul 2024 00:46:51 +0200 Subject: [PATCH 64/66] v9.6 - RC up --- .update/version | 2 +- dietpi/func/dietpi-globals | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.update/version b/.update/version index c0cf4610de..6c2285e750 100644 --- a/.update/version +++ b/.update/version @@ -3,7 +3,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=9 G_REMOTE_VERSION_SUB=6 -G_REMOTE_VERSION_RC=-1 +G_REMOTE_VERSION_RC=0 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=7 G_MIN_VERSION_SUB=0 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index baba175c77..326d8a831b 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,7 +55,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=9 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=6 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=-1 + [[ $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 From e765387f55d87dcb0328a243b0dd3f2b06202a77 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 3 Jul 2024 01:09:51 +0200 Subject: [PATCH 65/66] v9.6 - DietPi-Patches | Treat loop devices as MMC devices, to flash U-Boot to. This could be relevant for testing DietPi updates in containers. --- .update/patches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/patches b/.update/patches index 272c58bf99..4c248367e8 100755 --- a/.update/patches +++ b/.update/patches @@ -1666,7 +1666,7 @@ Patch_9_6() \nDo you want to flash the latest U-Boot image now? \nNB: This can be done any time later via dietpi-config > Advanced Options.' then - if [[ $G_ROOTFS_DEV == '/dev/mmcblk'* ]] + if [[ $G_ROOTFS_DEV == '/dev/mmcblk'* || $G_ROOTFS_DEV == '/dev/loop'* ]] then /boot/dietpi/func/dietpi-set_hardware flash-u-boot-mmc From c0bd77d8aa3a07052ec3efba2c293252972eadb9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 3 Jul 2024 01:12:37 +0200 Subject: [PATCH 66/66] v9.6 - DietPi-Patches | Be more careful when removing our ifup@.service config. Remove our own config, and the directory only, if it is empty afterwards. --- .update/patches | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.update/patches b/.update/patches index 4c248367e8..fdb8a26263 100755 --- a/.update/patches +++ b/.update/patches @@ -1708,7 +1708,8 @@ Patch_9_6() fi # Remove obsolete drop-in config: https://github.com/MichaIng/DietPi/issues/7104 - [[ -d '/etc/systemd/system/ifup@.service.d' ]] && G_EXEC rm -R /etc/systemd/system/ifup@.service.d + [[ -f '/etc/systemd/system/ifup@.service.d/dietpi.conf' ]] && G_EXEC rm -R /etc/systemd/system/ifup@.service.d/dietpi.conf + [[ -d '/etc/systemd/system/ifup@.service.d' ]] && G_EXEC rmdir --ignore-fail-on-non-empty /etc/systemd/system/ifup@.service.d } # v6.35 => v7 migration