From d9e42476ab49acfc9570dff99f76642f1a6314f4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 27 Aug 2023 20:55:32 +0200 Subject: [PATCH 01/36] v8.22 - CHANGELOG | Typo --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fa470b7c44..c5f5b3680f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,7 +7,7 @@ New images: Enhancements: - Orange Pi 5/ROCK 5B | An update of the kernel to Linux 5.10.160 will be applied automatically as part of the DietPi update. - Orange Pi 5 | An update of the U-Boot package will be applied. When flashing it to SPI via dietpi-config > Advanced Options > Update SPI bootloader, it enables booting DietPi via NVMe and USB. -- 64-bit Rockchip SBCs | All SBCs with Armbian's 64-bit Rockchip kernel package "linux-image-current-rockchip64" will receive a major kernel upgrade to Linux 6.1.46, including lots of fixes and enhancements that have been applied upstream and by Armbian in the meantime. Since Armbian's APT repository has not seen any update since February 2023, we started compiling and hosting own builds. An own APT repository is being worked on to better distribute our own package builds. Until the, headers for this kernel package can be downloaded at: https://dietpi.com/downloads/binaries/linux-headers-current-rockchip64.deb +- 64-bit Rockchip SBCs | All SBCs with Armbian's 64-bit Rockchip kernel package "linux-image-current-rockchip64" will receive a major kernel upgrade to Linux 6.1.46, including lots of fixes and enhancements that have been applied upstream and by Armbian in the meantime. Since Armbian's APT repository has not seen any update since February 2023, we started compiling and hosting own builds. An own APT repository is being worked on to better distribute our own package builds. Until then, headers for this kernel package can be downloaded at: https://dietpi.com/downloads/binaries/linux-headers-current-rockchip64.deb - DietPi-Config | WiFi Hotspot: When applying settings, manually changed IP addresses in /etc/network/interfaces will now be preserved. Additionally, it is now assured that changing interface names, e.g. due to an additionally attached WiFi adapter, are now aligned across /etc/network/interfaces, hostapd and DHCP server configs. - DietPi-Config | WiFi Hotspot: Toggles for enabling 802.11ac/WiFi 5, 802.11ax/WiFi 6 (Bookworm only) and 5 GHz WiFi respectively have been added to the menu. - DietPi-Software | WiFi Hotspot: We added new dietpi.txt settings "SOFTWARE_WIFI_HOTSPOT_WIFI4", "SOFTWARE_WIFI_HOTSPOT_WIFI5", "SOFTWARE_WIFI_HOTSPOT_WIFI6" and "SOFTWARE_WIFI_HOTSPOT_5G" to have 802.11n/WiFi 4, 802.11ac/WiFi 5, 802.11ax/WiFi 6 (Bookworm only) and 5 GHz support respectively enabled on install. From 0ea55c072de3f98660d02bd5e52320e939d6bead Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 27 Aug 2023 21:20:09 +0200 Subject: [PATCH 02/36] v8.22 - DietPi-Software | rTorrent: Update rutorrent fallback version --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e2b28211ab..0fa62ed4e5 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8664,7 +8664,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.2.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.2.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 4ae09e6e28318ace7a6b0ace6bb916e5abc88668 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 27 Aug 2023 21:29:51 +0200 Subject: [PATCH 03/36] v8.22 - CHANGELOG | Make Rochchip64 kernel upgrade more precise: Only RK33xx SoCs are affected, as RK35xx have other kernel packages installed --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c5f5b3680f..83d85a3292 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,7 +7,7 @@ New images: Enhancements: - Orange Pi 5/ROCK 5B | An update of the kernel to Linux 5.10.160 will be applied automatically as part of the DietPi update. - Orange Pi 5 | An update of the U-Boot package will be applied. When flashing it to SPI via dietpi-config > Advanced Options > Update SPI bootloader, it enables booting DietPi via NVMe and USB. -- 64-bit Rockchip SBCs | All SBCs with Armbian's 64-bit Rockchip kernel package "linux-image-current-rockchip64" will receive a major kernel upgrade to Linux 6.1.46, including lots of fixes and enhancements that have been applied upstream and by Armbian in the meantime. Since Armbian's APT repository has not seen any update since February 2023, we started compiling and hosting own builds. An own APT repository is being worked on to better distribute our own package builds. Until then, headers for this kernel package can be downloaded at: https://dietpi.com/downloads/binaries/linux-headers-current-rockchip64.deb +- RK33xx SBCs | All SBCs with RK33xx SoC and Armbian's "linux-image-current-rockchip64" kernel package will receive a major kernel upgrade to Linux 6.1.46, including lots of fixes and enhancements that have been applied upstream and by Armbian in the meantime. Since Armbian's APT repository has not seen any update since February 2023, we started compiling and hosting own builds. An own APT repository is being worked on to better distribute our own package builds. Until then, headers for this kernel package can be downloaded at: https://dietpi.com/downloads/binaries/linux-headers-current-rockchip64.deb - DietPi-Config | WiFi Hotspot: When applying settings, manually changed IP addresses in /etc/network/interfaces will now be preserved. Additionally, it is now assured that changing interface names, e.g. due to an additionally attached WiFi adapter, are now aligned across /etc/network/interfaces, hostapd and DHCP server configs. - DietPi-Config | WiFi Hotspot: Toggles for enabling 802.11ac/WiFi 5, 802.11ax/WiFi 6 (Bookworm only) and 5 GHz WiFi respectively have been added to the menu. - DietPi-Software | WiFi Hotspot: We added new dietpi.txt settings "SOFTWARE_WIFI_HOTSPOT_WIFI4", "SOFTWARE_WIFI_HOTSPOT_WIFI5", "SOFTWARE_WIFI_HOTSPOT_WIFI6" and "SOFTWARE_WIFI_HOTSPOT_5G" to have 802.11n/WiFi 4, 802.11ac/WiFi 5, 802.11ax/WiFi 6 (Bookworm only) and 5 GHz support respectively enabled on install. From e850fdfcf6840b97861081b9a388803383907330 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 28 Aug 2023 19:50:50 +0200 Subject: [PATCH 04/36] Init v8.22 --- .meta/dietpi-survey_report | 4 +++- .update/patches | 5 +++++ .update/version | 4 ++-- CHANGELOG.txt | 11 +++++++++++ dietpi/func/dietpi-globals | 4 ++-- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 707baaa300..dfa13b52ab 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -683,13 +683,15 @@ shopt -s extglob aSOFTWARE_NAME8_20[211]='Homebridge' aSOFTWARE_NAME8_21=() + aSOFTWARE_NAME8_22=() for i in "${!aSOFTWARE_NAME8_20[@]}" do aSOFTWARE_NAME8_21[i]=${aSOFTWARE_NAME8_20[i]} + aSOFTWARE_NAME8_22[i]=${aSOFTWARE_NAME8_21[i]} done # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs - for i in "${aSOFTWARE_NAME8_21[@]}" + for i in "${aSOFTWARE_NAME8_22[@]}" do aSOFTWARE[$i]=0 done diff --git a/.update/patches b/.update/patches index cefd175279..39033caa3a 100755 --- a/.update/patches +++ b/.update/patches @@ -1470,6 +1470,11 @@ Patch_8_21() fi } +Patch_8_22() +{ + : +} + # v6.35 => v7 migration if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 )) then diff --git a/.update/version b/.update/version index 3450adc4ff..3584ab528c 100644 --- a/.update/version +++ b/.update/version @@ -2,8 +2,8 @@ # shellcheck disable=SC2034 # Available DietPi version G_REMOTE_VERSION_CORE=8 -G_REMOTE_VERSION_SUB=21 -G_REMOTE_VERSION_RC=1 +G_REMOTE_VERSION_SUB=22 +G_REMOTE_VERSION_RC=-1 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=14 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 83d85a3292..8b126229ec 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,14 @@ +v8.22 +(2023-09-23) + +Enhancements: + +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/6580 + +----------------------------------------------------------------------------------------------------------- + v8.21 (2023-08-26) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 511e5c5f99..ee41286297 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -58,8 +58,8 @@ [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=8 - [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=21 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=22 + [[ $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 c38a8f4b01aeb0979e0a873419d628b12b15cf97 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 28 Aug 2023 20:55:40 +0200 Subject: [PATCH 05/36] v8.22 - DietPi-Software | TasmoAdmin: 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 0fa62ed4e5..2780bfdd73 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11234,7 +11234,7 @@ _EOF_ # v3 drops PHP 7.4 support: https://github.com/TasmoAdmin/TasmoAdmin/releases/tag/v3.0.0 if (( $G_DISTRO > 6 )) then - local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.1.0/tasmoadmin_v3.1.0.tar.gz' + local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.1.1/tasmoadmin_v3.1.1.tar.gz' Download_Install "$(curl -sSfL 'https://api.github.com/repos/TasmoAdmin/TasmoAdmin/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/tasmoadmin_v[^"\/]*\.tar\.gz"$/{print $4}')" # v2 drops PHP <7.4 support: https://github.com/TasmoAdmin/TasmoAdmin/releases/tag/v2.0.0 From 370ad73dc3d3f11501482ccb78d3b12ac5cfe101 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 28 Aug 2023 23:33:57 +0200 Subject: [PATCH 06/36] v8.22 - DietPi-Software | HAProxy: Bump to v2.8.2 --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 2780bfdd73..e5b013d058 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6966,7 +6966,7 @@ _EOF_ if To_Install 98 haproxy # HAProxy then - local version='2.7.6' # https://www.haproxy.org/download/ + local version='2.8.2' # https://www.haproxy.org/download/ aDEPS=('make' 'gcc' 'libpcre3-dev' 'libssl-dev' 'zlib1g-dev' 'libsystemd-dev') Download_Install "https://www.haproxy.org/download/${version%.*}/src/haproxy-$version.tar.gz" From f0671ba3040dce136c90895bf0f319c61ed45ea2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 29 Aug 2023 00:00:48 +0200 Subject: [PATCH 07/36] v8.22 - CHANGELOG | Fix credit as of removed GitHub user --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 8b126229ec..b96f2030a8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1518,7 +1518,7 @@ Bug Fixes: - DietPi-Software | Home Assistant: Resolved on issue where fresh install failed to started to start due to missing permissions. Many thanks to @slopsjon, @tyjtyj and @pakikje for reporting this issue. - DietPi-Software | Google AIY: Resolved an issue where fresh install failed to start due to missing permissions - DietPi-Software | Grafana: Resolved an issue where install failed on RPi 1/Zero Buster systems. The fix includes an update of Grafana to the latest official version for those models. Many thanks to @TBail for reporting this issue: https://github.com/MichaIng/DietPi/issues/3213 -- DietPi-Software | Jackett: Resolved an issue where the internal updater broke the Jackett instance. Automated updates can be safely enabled again. Many thanks to @ngosang for providing the workaround: https://github.com/MichaIng/DietPi/issues/2593 +- DietPi-Software | Jackett: Resolved an issue where the internal updater broke the Jackett instance. Automated updates can be safely enabled again. Many thanks to @ezekini for reporting this issue: https://github.com/MichaIng/DietPi/issues/2593 - DietPi-Software | Pi-hole: Resolved an issue where choosing to block public admin panel access on Nginx failed. Many thanks to @anubis-genix for reporting this issue: https://github.com/MichaIng/DietPi/issues/3024#issuecomment-550342684 - DietPi-Software | Java: Resolved an issue where install on ARMv6 RPis (1/Zero) on Buster system failed, since Java 11 is not ARMv6-compatible. On these system, Java 8 is now installed instead. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/3182 - DietPi-Software | rTorrent: Resolved an issue where rTorrent and the webserver didn't have sufficient permissions to read and write ruTorrent web UI settings and data. Many thanks to @notDavid for reporting this issue: https://github.com/MichaIng/DietPi/issues/3244 From a57a2ae878a0c42a5adee158c19d4d41630e8ec3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 29 Aug 2023 12:40:45 +0200 Subject: [PATCH 08/36] v8.21 - DietPi-Config | The menu option to update the SPI bootloader is now shown on Orange Pi 5 Plus as well, as intended. Many thanks for @zappydood for reporting its absence: https://github.com/MichaIng/DietPi/issues/6501#issuecomment-1697175109 --- CHANGELOG.txt | 1 + dietpi/dietpi-config | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b96f2030a8..a61f537521 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v8.22 Enhancements: Bug fixes: +- DietPi-Config | The menu option to update the SPI bootloader is now shown on Orange Pi 5 Plus as well, as intended. Many thanks for @zappydood for reporting its absence: https://github.com/MichaIng/DietPi/issues/6501#issuecomment-1697175109 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/6580 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index e1098d07e5..492aabb158 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1068,8 +1068,8 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the G_WHIP_MENU_ARRAY+=('Update RPi4 EEPROM firmware' ': Install rpi-eeprom APT package') fi - # Orange Pi 5: https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457 - elif (( $G_HW_MODEL == 80 )) + # Orange Pi 5 (Plus): https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457 + elif [[ $G_HW_MODEL == 8[02] ]] then [[ -b '/dev/mtdblock0' && -f '/usr/lib/u-boot/platform_install.sh' ]] && G_WHIP_MENU_ARRAY+=('Update SPI bootloader' ': Flash current U-Boot to /dev/mtdblock0') From bdde5bd732142a25468e309d3a9473b1c9407ad8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 30 Aug 2023 22:46:00 +0200 Subject: [PATCH 09/36] v8.22 - NanoPi R4S | Resolved a v8.20 regression where the Ethernet LEDs did not react correctly after the kernel upgrade. Many thanks to @idaanx for reporting this issue: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 --- .build/images/dietpi-installer | 4 ++-- .update/patches | 20 ++++++++++---------- CHANGELOG.txt | 1 + 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 509df364ac..389ea5d542 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1962,8 +1962,8 @@ _EOF_ G_DIETPI-NOTIFY 2 'Enabling NanoPi R4S Ethernet LEDs' G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules -SUBSYSTEM=="leds", KERNEL=="lan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" -SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" +SUBSYSTEM=="leds", KERNEL=="green:lan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" +SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" _EOF_ # NanoPi R2S elif (( $G_HW_MODEL == 55 )) diff --git a/.update/patches b/.update/patches index 39033caa3a..c2d4466e32 100755 --- a/.update/patches +++ b/.update/patches @@ -1162,15 +1162,6 @@ Patch_8_17() [[ -f '/etc/systemd/system/roonbridge.service.d/dietpi-no-caps.conf' ]] && G_EXEC rm /etc/systemd/system/roonbridge.service.d/dietpi-no-caps.conf [[ -f '/etc/systemd/system/roonbridge.service.d' ]] && G_EXEC rmdir --ignore-fail-on-non-empty /etc/systemd/system/roonbridge.service.d - # NanoPi R4S - elif (( $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' - cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules -SUBSYSTEM=="leds", KERNEL=="lan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" -SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" -_EOF_ # NanoPi R2S elif (( $G_HW_MODEL == 55 )) then @@ -1472,7 +1463,16 @@ Patch_8_21() Patch_8_22() { - : + # NanoPi R4S: Fix Ethernet LEDs: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 + 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' + cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules +SUBSYSTEM=="leds", KERNEL=="green:lan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" +SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" +_EOF_ + fi } # v6.35 => v7 migration diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a61f537521..d42f892f39 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ v8.22 Enhancements: Bug fixes: +- NanoPi R4S | Resolved a v8.20 regression where the Ethernet LEDs did not react correctly after the kernel upgrade. Many thanks to @idaanx for reporting this issue: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 - DietPi-Config | The menu option to update the SPI bootloader is now shown on Orange Pi 5 Plus as well, as intended. Many thanks for @zappydood for reporting its absence: https://github.com/MichaIng/DietPi/issues/6501#issuecomment-1697175109 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/6580 From 4ca5181852a3f57c71fa80d8e39ec17269ed5ffd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 4 Sep 2023 23:31:22 +0200 Subject: [PATCH 10/36] v8.22 - DietPi-Software | Ampache: Resolved an issue where the latest version was not successfully detected on install, so that an older fallback version was installed instead. Many thanks to @bartolus39 for reporting this issue: https://github.com/MichaIng/DietPi/issues/6598 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d42f892f39..b6383eab40 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Enhancements: Bug fixes: - NanoPi R4S | Resolved a v8.20 regression where the Ethernet LEDs did not react correctly after the kernel upgrade. Many thanks to @idaanx for reporting this issue: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 - DietPi-Config | The menu option to update the SPI bootloader is now shown on Orange Pi 5 Plus as well, as intended. Many thanks for @zappydood for reporting its absence: https://github.com/MichaIng/DietPi/issues/6501#issuecomment-1697175109 +- DietPi-Software | Ampache: Resolved an issue where the latest version was not successfully detected on install, so that an older fallback version was installed instead. Many thanks to @bartolus39 for reporting this issue: https://github.com/MichaIng/DietPi/issues/6598 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/6580 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index e5b013d058..1940b14c7d 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7598,8 +7598,8 @@ _EOF_ # Bullseye+ if (( $G_DISTRO > 5 )) then - local fallback_url='https://github.com/ampache/ampache/releases/download/5.5.3/ampache-5.5.3_all.zip' - Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" '/"browser_download_url": ".*\/ampache-[0-9\.]*_all.zip"/{print $4}')" ampache + local fallback_url="https://github.com/ampache/ampache/releases/download/6.0.2/ampache-6.0.2_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 # Ampache is installed to /mnt/dietpi_userdata/ampache and the "public" directory linked to /var/www/ampache: https://github.com/MichaIng/DietPi/pull/5205 local fp_install='/mnt/dietpi_userdata' fp_public='ampache/public' From 226630ba3922c6e4200f1675d55af712b2934930 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 23:36:58 +0200 Subject: [PATCH 11/36] Bump actions/checkout from 3 to 4 (#6599) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/shellcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index a18e8c5d4a..133655760e 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Setup tmpfs run: sudo mount -t tmpfs -o "noatime,lazytime,uid=$(id -u)" tmpfs "$GITHUB_WORKSPACE" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup DietPi-Globals run: | sudo mkdir -p /boot/dietpi/func From 708b193141cf271c6b2e725b0d3d8ee0164c20bc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 7 Sep 2023 15:55:22 +0200 Subject: [PATCH 12/36] v8.22 - DietPi-Software | Update fallback versions/URLs --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1940b14c7d..c5ca635f92 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -8664,7 +8664,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.2.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"; } + [[ $version ]] || { version='v4.2.6'; 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 @@ -9055,7 +9055,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.23.7/syncthing-linux-$arch-v1.23.7.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.24.0/syncthing-linux-$arch-v1.24.0.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 From c27a0f21855688d67eb120cf74544a61fae27cd0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 7 Sep 2023 19:22:23 +0200 Subject: [PATCH 13/36] v8.22 - DietPi-Software | Docker: Enabled support for Trixie and RISC-V via "docker.io" package from Debian repository. --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 35 +++++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b6383eab40..4ee008508a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v8.22 (2023-09-23) Enhancements: +- DietPi-Software | Docker: Enabled support for Trixie and RISC-V via "docker.io" package from Debian repository. Bug fixes: - NanoPi R4S | Resolved a v8.20 regression where the Ethernet LEDs did not react correctly after the kernel upgrade. Many thanks to @idaanx for reporting this issue: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c5ca635f92..fd41d4f572 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1122,8 +1122,6 @@ Available commands: aSOFTWARE_DESC[$software_id]='Build, ship, and run distributed applications' aSOFTWARE_CATX[$software_id]=8 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/programming/#docker' - # - RISC-V: Missing package: https://download.docker.com/linux/debian/dists/ - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=185 aSOFTWARE_NAME[$software_id]='Portainer' @@ -10535,23 +10533,32 @@ _EOF_ if To_Install 162 docker # Docker then - # Detect distro - local distro='debian' - (( $G_RASPBIAN )) && distro='raspbian' + # APT package name + # - RISC-V: Use "docker.io" from Debian repo as the official Docker repo does not support RISC-V yet: https://download.docker.com/linux/debian/dists/ + local package='docker.io' + if (( $G_HW_ARCH != 11 )) + then + # Detect distro + local distro='debian' + (( $G_RASPBIAN )) && distro='raspbian' - # APT key - local url="https://download.docker.com/linux/$distro/gpg" - G_CHECK_URL "$url" - G_EXEC eval "curl -sSfL '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-docker.gpg --yes" + # APT key + local url="https://download.docker.com/linux/$distro/gpg" + G_CHECK_URL "$url" + G_EXEC eval "curl -sSfL '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-docker.gpg --yes" - # APT list - G_EXEC eval "echo 'deb https://download.docker.com/linux/$distro/ $G_DISTRO_NAME stable' > /etc/apt/sources.list.d/docker.list" - G_AGUP + # APT list + G_EXEC eval "echo 'deb https://download.docker.com/linux/$distro/ ${G_DISTRO_NAME/trixie/bookworm} stable' > /etc/apt/sources.list.d/docker.list" + G_AGUP + + # APT package name + package='docker-ce' + fi # APT package # - Mask service to prevent iptables related startup failure: https://github.com/MichaIng/DietPi/issues/6013 G_EXEC systemctl mask --now docker - G_AGI docker-ce + G_AGI "$package" G_EXEC systemctl unmask docker G_EXEC systemctl start docker.socket @@ -10563,7 +10570,7 @@ _EOF_ # - Move Docker containers to dietpi_userdata # - Log to systemd-journald (journalctl) by default with reduced log level: https://github.com/MichaIng/DietPi/issues/2388 # + containerd: https://github.com/docker/docker.github.io/issues/9091 - [[ -d '/mnt/dietpi_userdata/docker-data' ]] || G_EXEC mkdir /mnt/dietpi_userdata/docker-data + G_EXEC mkdir -p /mnt/dietpi_userdata/docker-data if [[ -f '/etc/docker/daemon.json' ]] then GCI_PRESERVE=1 G_CONFIG_INJECT '"data-root":' ' "data-root": "/mnt/dietpi_userdata/docker-data",' /etc/docker/daemon.json '^\{([[:space:]]|$)' From 35988ff7240c952a70b9a6b6885b79bd18599efa Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 9 Sep 2023 00:50:25 +0200 Subject: [PATCH 14/36] v8.22 - DietPi-Software | Portainer: Enabled for RISC-V as Docker is now supported on RISC-V as well. --- CHANGELOG.txt | 3 ++- dietpi/dietpi-software | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4ee008508a..c8ac78b1ac 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,7 +2,8 @@ v8.22 (2023-09-23) Enhancements: -- DietPi-Software | Docker: Enabled support for Trixie and RISC-V via "docker.io" package from Debian repository. +- DietPi-Software | Docker: Enabled for Trixie and RISC-V via "docker.io" package from Debian repository. +- DietPi-Software | Portainer: Enabled for RISC-V as Docker is now supported on RISC-V as well. Bug fixes: - NanoPi R4S | Resolved a v8.20 regression where the Ethernet LEDs did not react correctly after the kernel upgrade. Many thanks to @idaanx for reporting this issue: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fd41d4f572..116c8c5da6 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1131,8 +1131,6 @@ Available commands: aSOFTWARE_DEPS[$software_id]='162' # - ARMv6: https://dietpi.com/forum/t/armv6-bookworm-software-test-matrix-question/16380/11 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # - RISC-V: Missing Docker package: https://download.docker.com/linux/debian/dists/ - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=134 aSOFTWARE_NAME[$software_id]='Docker Compose' @@ -10706,7 +10704,7 @@ _EOF_ *) local arch='arm-6';; esac - local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.20.3/gitea-1.20.3-linux-$arch.xz" + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.20.4/gitea-1.20.4-linux-$arch.xz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/go-gitea/gitea/releases/latest' | mawk -F\" "/\"browser_download_url\": \".*\/gitea-[^\"\/]*-linux-$arch\.xz\"/{print \$4}")" /mnt/dietpi_userdata/gitea/gitea # User From ed9f3f3321d33b1da52a6fac0c83d3605ed6ea89 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 9 Sep 2023 01:15:34 +0200 Subject: [PATCH 15/36] v8.22 - DietPi-Installer | Do not pre-install Armbian kernel and U-Boot packages from our server which have been finally updated on their APT repository as well --- .build/images/dietpi-installer | 39 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 389ea5d542..0cebad0f72 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -990,13 +990,13 @@ _EOF_ 40) model='pine64' kernel='sunxi64';; 42) model='rockpro64' kernel='rockchip64';; 43) model='rock64' kernel='rockchip64';; - 44) model='pinebook-a64' kernel='sunxi64' dietpi_com=1;; + 44) model='pinebook-a64' kernel='sunxi64';; 45) model='pineh64-b' kernel='sunxi64';; - 46) model='pinebook-pro' kernel='rockchip64' dietpi_com=1;; + 46) model='pinebook-pro' kernel='rockchip64';; 47) model='nanopi-r4s' kernel='rockchip64';; 48) model='nanopi-r1' kernel='sunxi' arch='arm';; 52) model='tinkerboard' kernel='rockchip' arch='arm';; - 54) model='nanopik2-s905' dietpi_com=1;; + 54) model='nanopik2-s905';; 55) model='nanopi-r2s' kernel='rockchip64';; 56) model='nanopineo3' kernel='rockchip64';; 57) model='nanopineoplus2' kernel='sunxi64';; @@ -1007,10 +1007,9 @@ _EOF_ case $HW_VARIANT in 2) model='nanopifire3';; *) model='nanopim3';; - esac - dietpi_com=1;; + esac;; 63) model='nanopim1' kernel='sunxi' arch='arm' dietpi_com=1;; - 64) model='nanopiair' kernel='sunxi' arch='arm' dietpi_com=1;; + 64) model='nanopiair' kernel='sunxi' arch='arm';; 65) kernel='sunxi64' case $HW_VARIANT in 2) model='nanopineo2black';; @@ -1021,11 +1020,11 @@ _EOF_ 68) kernel='rockchip64' case $HW_VARIANT in 1) model='nanopim4';; - 3) model='nanopineo4' dietpi_com=1;; + 3) model='nanopineo4';; *) model='nanopct4';; esac;; 72) model='rockpi-4b' kernel='rockchip64';; - 73) model='rockpi-s' kernel='rockchip64' dietpi_com=1;; + 73) model='rockpi-s' kernel='rockchip64';; 74) model='radxa-zero';; 77) model='rock-3a' kernel='rk35xx' branch='edge';; 78) model='rock-5b' kernel='rk35xx' branch='legacy';; @@ -1033,8 +1032,8 @@ _EOF_ 82) model='orangepi5-plus' kernel='rk35xx' branch='legacy';; *) :;; esac - # Download and pre-install U-Boot hosted on dietpi.com where it has not been ported (and probably never will) to the Armbian Bookworm repo or where it provides a too old version - if (( $dietpi_com && $G_DISTRO > 6 || $G_HW_MODEL == 62 || $G_HW_MODEL == 72 || $G_HW_MODEL == 80 || $G_HW_MODEL == 82 )) + # Download and pre-install U-Boot hosted on dietpi.com where it has not been ported to the Armbian Bookworm repo or has been removed completely + if (( $dietpi_com && $G_DISTRO > 6 || $G_HW_MODEL == 62 )) then G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb" G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb @@ -1056,19 +1055,19 @@ _EOF_ # 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' ]] && zstd=('zstd') # - Download and pre-install a more recent armbian-firmware package from our server - G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/armbian-firmware.deb' - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb - G_EXEC rm package.deb + #G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/armbian-firmware.deb' + #G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb + #G_EXEC rm package.deb G_AGI initramfs-tools u-boot-tools armbian-firmware "${zstd[@]}" [[ ${zstd[0]} ]] && G_CONFIG_INJECT 'COMPRESS=' 'COMPRESS=zstd' /etc/initramfs-tools/initramfs.conf # Download and pre-install kernel hosted on dietpi.com where the Armbian APT repo provides a too old version - if [[ $G_HW_MODEL =~ ^(78|80|82)$ || ( $kernel == 'rockchip64' && $branch == 'current' ) ]] - then - G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" - G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb - G_EXEC rm package1.deb package2.deb - fi + #if [[ $G_HW_MODEL =~ ^(78|80|82)$ || ( $kernel == 'rockchip64' && $branch == 'current' ) ]] + #then + # G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" + # G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" + # G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb + # G_EXEC rm package1.deb package2.deb + #fi G_AGI linux-{image,dtb}-"$branch-$kernel" "linux-u-boot-$model-$branch" # Cleanup [[ $G_HW_MODEL != 10 && -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage From a8bc7a6e8f15896ca68e8c56c2a283444bd1295e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 10 Sep 2023 17:07:36 +0200 Subject: [PATCH 16/36] v8.22 - 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 116c8c5da6..220ee135fd 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10129,7 +10129,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.7.4.3769/Prowlarr.master.1.7.4.3769.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.8.6.3946/Prowlarr.master.1.8.6.3946.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 @@ -10204,7 +10204,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.3.2171/Readarr.develop.0.3.3.2171.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.4.2207/Readarr.develop.0.3.4.2207.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 05b399482b939cec752227a8fb2ef3bf6ac88389 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 10 Sep 2023 11:09:25 -0700 Subject: [PATCH 17/36] v8.22 (#6587) - DietPi-Software | Add ADS-B Feeder: track airplanes using SDRs and feed the data to ADS-B aggregators (based on https://adsb.im) Signed-off-by: Dirk Hohndel Co-authored-by: MichaIng --- .meta/dietpi-survey_report | 1 + CHANGELOG.txt | 3 ++ README.md | 1 + dietpi/dietpi-services | 2 ++ dietpi/dietpi-software | 68 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 75 insertions(+) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index dfa13b52ab..5a06fdf49d 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -689,6 +689,7 @@ shopt -s extglob aSOFTWARE_NAME8_21[i]=${aSOFTWARE_NAME8_20[i]} aSOFTWARE_NAME8_22[i]=${aSOFTWARE_NAME8_21[i]} done + aSOFTWARE_NAME8_22[141]='ADS-B Feeder' # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs for i in "${aSOFTWARE_NAME8_22[@]}" diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c8ac78b1ac..968a2642c5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,9 @@ v8.22 (2023-09-23) +New software: +- ADS-B Feeder | Track airplanes using SDRs and feed the data to ADS-B aggregators. Many thanks to @dirkhh for maintaining and implementing this software option: https://github.com/MichaIng/DietPi/pull/6587 + Enhancements: - DietPi-Software | Docker: Enabled for Trixie and RISC-V via "docker.io" package from Debian repository. - DietPi-Software | Portainer: Enabled for RISC-V as Docker is now supported on RISC-V as well. diff --git a/README.md b/README.md index a30c71f33d..f14488ca3e 100644 --- a/README.md +++ b/README.md @@ -337,6 +337,7 @@ Links to hardware and software manufacturers, sources and build instructions use - [Restic](https://github.com/restic/restic) - [MediaWiki](https://github.com/wikimedia/mediawiki) - [Homebridge](https://github.com/homebridge/homebridge) +- [ADS-B Feeder](https://github.com/dirkhh/adsb-feeder-image) --- diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index d8e5f558b5..04b8758ae3 100755 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -268,6 +268,8 @@ _EOF_ 'fahclient' 'ipfs' 'yacy' + 'adsb-setup' + 'adsb-docker' ) # Additional services: https://github.com/MichaIng/DietPi/issues/1869#issuecomment-401017251 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 220ee135fd..7cf1edc03e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1591,6 +1591,13 @@ Available commands: aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/distributed_projects/#yacy' aSOFTWARE_DEPS[$software_id]='196' #------------------ + software_id=141 + aSOFTWARE_NAME[$software_id]='ADS-B Feeder' + aSOFTWARE_DESC[$software_id]='track airplanes using SDRs and feed the data to ADS-B aggregators' + aSOFTWARE_CATX[$software_id]=19 + aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/distributed_projects/#adsb-feeder' + aSOFTWARE_DEPS[$software_id]='17 130 134 162' # Git, Python, Docker & Docker Compose + #------------------ software_id=184 aSOFTWARE_NAME[$software_id]='Tor Relay' aSOFTWARE_DESC[$software_id]='add a node to the Tor network' @@ -11935,6 +11942,56 @@ _EOF_ G_EXEC_OUTPUT=1 G_EXEC docker run -d -p '9002:9000' --name=portainer --restart=always -v '/run/docker.sock:/var/run/docker.sock' -v 'portainer_data:/data' 'portainer/portainer-ce' fi + if To_Install 141 adsb-setup adsb-docker # ADS-B Feeder + then + # clone the adsb-feeder repo into /tmp + G_EXEC_OUTPUT=1 G_EXEC git clone -b dietpi 'https://github.com/dirkhh/adsb-feeder-image.git' /tmp/adsb-feeder + + # remove the service that isn't needed for an app install on DietPi and install the rest + G_EXEC cd /tmp/adsb-feeder/src/modules/adsb-feeder/filesystem/root + G_EXEC rm ./usr/lib/systemd/system/adsb-bootstrap.service + G_EXEC mv ./usr/lib/systemd/system/* /etc/systemd/system/ + + # determine the version + local ADSB_FEEDER_DATE_COMPONENT=$(git log -20 --date='format:%y%m%d' --format='%ad' | uniq -c | mawk '{print $2"."$1;exit}') + local ADSB_FEEDER_TAG_COMPONENT=$(git describe --match 'v[0-9]*' | cut -d- -f1) + local ADSB_FEEDER_VERSION="$ADSB_FEEDER_TAG_COMPONENT(dietpi)-$ADSB_FEEDER_DATE_COMPONENT" + + # create the target directory for the app and populated with the code from the git checkout + [[ -d '/opt/adsb' ]] && G_EXEC rm -R /opt/adsb + G_EXEC mv /tmp/adsb-feeder/src/modules/adsb-feeder/filesystem/root/opt/adsb /opt/ + G_EXEC cd /opt/adsb + + # remove the git clone of the repo we installed from + G_EXEC rm -R /tmp/adsb-feeder + + # create a symlink so the config files reside where they should be in /mnt/dietpi_userdata/adsb-feeder + 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 + G_EXEC eval 'echo '\''ADSB Feeder app running on DietPi'\'' > feeder-image.name' + G_EXEC eval "echo '$ADSB_FEEDER_VERSION' > adsb.im.version" + + # 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 + + # 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 then # Packages available on Buster backports and Bullseye: On Raspbian Buster add Bullseye repo @@ -12689,6 +12746,17 @@ If no WireGuard (auto)start is included, but you require it, please do the follo [[ -d '/etc/yacy' ]] && G_EXEC rm -R /etc/yacy fi + if To_Uninstall 141 # ADS-B Feeder + then + G_EXEC_NOHALT=1 G_EXEC_OUTPUT=1 G_EXEC /opt/adsb/docker-compose-adsb down + Remove_Service adsb-bootstrap + Remove_Service adsb-feeder-update + Remove_Service adsb-setup + Remove_Service adsb-update + command -v docker &> /dev/null && G_EXEC docker image prune -a -f + G_EXEC rm -Rf /opt/adsb /mnt/dietpi_userdata/adsb-feeder /opt/adsb-feeder-update + fi + if To_Uninstall 2 # Folding@Home then # Un-check out all work units, so they can be picked up by other donors prior to timeout: https://github.com/FoldingAtHome/fah-issues/issues/1255 From 63c84fcf2006a6d64c7fb16ae1e1579f4100cdb4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 10 Sep 2023 13:58:50 -0700 Subject: [PATCH 18/36] v8.22 (#6602) - General | DietPi images are now shipped with a trailing FAT partition which contains dietpi.txt and other config files for easier pre-configuration and automation from Windows and macOS hosts. Related CLI flags have been added to our build scripts. Many thanks to @dirkhh for implementing this feature: https://github.com/MichaIng/DietPi/pull/6602 Signed-off-by: Dirk Hohndel Co-authored-by: MichaIng --- .build/images/dietpi-build | 42 ++++++++- .build/images/dietpi-imager | 93 +++++++++++++++---- CHANGELOG.txt | 1 + .../dietpi/services/fs_partition_resize.sh | 17 ++++ 4 files changed, 131 insertions(+), 22 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index dd40cbc50f..85bde4234e 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -45,6 +45,7 @@ GITBRANCH='master' GITOWNER='MichaIng' EDITION= SUFFIX= +ADD_DOS_PART=1 while (( $# )) do case $1 in @@ -59,6 +60,7 @@ do '-o') shift; GITOWNER=$1;; '-e') shift; EDITION=$1;; '-s') shift; SUFFIX=$1;; + '--no-dos-part') ADD_DOS_PART=0;; *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; esac shift @@ -170,6 +172,10 @@ case $PTTYPE in *) G_DIETPI-NOTIFY 1 "Invalid partition table type \"$PTTYPE\" passed, aborting..."; exit 1;; esac +# Do not add trailing FAT partitions for VM, container and (Clonezilla) installer images, and if there is a boot FAT partition already +[[ $HW_MODEL == 20 || $HW_MODEL == 75 || $ITYPE == 'Installer' ]] && ADD_DOS_PART=0 +[[ $boot_size -gt 0 && $boot_fstype == 'fat'* ]] && ADD_DOS_PART=0 + fsname='' apackages=() afs_opts=() afsck=() aresize=() case $FSTYPE in 'ext4') apackages+=('e2fsprogs') afs_opts=('-e' 'remount-ro') afsck=('e2fsck' '-fyD') aresize=('resize2fs');; @@ -419,6 +425,7 @@ _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 +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 _EOF_ @@ -464,7 +471,13 @@ G_EXEC losetup -d "$FP_LOOP" # Do not pack and upload raw VM image if not explicitly requested [[ $VMTYPE && ! $VMTYPE =~ ^(raw|all)$ ]] && SKIP_ARCHIVE=1 || SKIP_ARCHIVE=0 export FP_ROOT_DEV CLONING_TOOL OUTPUT_IMG_NAME MOUNT_IT='Off' SKIP_ARCHIVE SKIP_FIRSTBOOT_RESIZE=1 -[[ $EDITION && $EDITION != 'all' ]] || bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "$OUTPUT_IMG_NAME.img" || exit 1 +IMAGER_ARGS=("$OUTPUT_IMG_NAME.img") +(( $ADD_DOS_PART )) && IMAGER_ARGS+=('--add-dos-part') +if [[ ! $EDITION || $EDITION == 'all' ]] +then + G_DIETPI-NOTIFY 2 "Running DietPi-Imager for $G_GITOWNER/$G_GITBRANCH" + bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1 +fi # Amiberry edition: Install automatically on first boot, enable autostart option and onboard audio on RPi if [[ $EDITION == 'Amiberry' || ( $EDITION == 'all' && $HW_MODEL == 0 ) ]] @@ -478,6 +491,15 @@ then G_EXEC partprobe "$FP_LOOP" G_EXEC partx -u "$FP_LOOP" + # Remove added DOS partition, it will be re-added by DietPi-Imager + if (( $ADD_DOS_PART )) && [[ $(lsblk -nrbo FSTYPE,LABEL "$FP_LOOP" | tail -1) == 'vfat DIETPISETUP' ]] + then + SETUP_PART=$(sfdisk -lqo DEVICE "$FP_LOOP" | tail -1) + G_EXEC_OUTPUT=1 G_EXEC sfdisk --no-reread --no-tell-kernel --delete "$FP_LOOP" "${SETUP_PART: -1}" + G_EXEC partprobe "$FP_LOOP" + G_EXEC partx -u "$FP_LOOP" + fi + # Mount filesystems G_EXEC mkdir rootfs if (( $boot_size )) @@ -502,7 +524,8 @@ then G_EXEC rmdir rootfs G_EXEC losetup -d "$FP_LOOP" - bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "$OUTPUT_IMG_NAME.img" || exit 1 + G_DIETPI-NOTIFY 2 "Running DietPi-Imager for $G_GITOWNER/$G_GITBRANCH" + bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1 fi # AlloGUI edition: Pre-install Allo GUI with all managed audiophile software @@ -517,7 +540,17 @@ then G_EXEC losetup "$FP_LOOP" "$OUTPUT_IMG_NAME.img" G_EXEC partprobe "$FP_LOOP" G_EXEC partx -u "$FP_LOOP" - # Raise partition and filesystem size as well, since resize2fs within the image returns "Nothing to do!" + + # Remove added DOS partition, it will be re-added by DietPi-Imager + if (( $ADD_DOS_PART )) && [[ $(lsblk -nrbo FSTYPE,LABEL "$FP_LOOP" | tail -1) == 'vfat DIETPISETUP' ]] + then + SETUP_PART=$(sfdisk -lqo DEVICE "$FP_LOOP" | tail -1) + G_EXEC_OUTPUT=1 G_EXEC sfdisk --no-reread --no-tell-kernel --delete "$FP_LOOP" "${SETUP_PART: -1}" + G_EXEC partprobe "$FP_LOOP" + G_EXEC partx -u "$FP_LOOP" + fi + + # Raise partition and filesystem sizes as well, since partprobe cannot inform the host kernel about the changed size from within the container G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -fN2 '$FP_LOOP' <<< ',+'" G_EXEC partprobe "$FP_LOOP" G_EXEC partx -u "$FP_LOOP" @@ -625,7 +658,8 @@ _EOF_ G_EXEC rmdir rootfs G_EXEC losetup -d "$FP_LOOP" - bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "$OUTPUT_IMG_NAME.img" || exit 1 + G_DIETPI-NOTIFY 2 "Running DietPi-Imager for $G_GITOWNER/$G_GITBRANCH" + bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1 fi [[ $VMTYPE && $VMTYPE != 'raw' ]] || exit 0 diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index 29d309d052..b6996ec194 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -46,22 +46,11 @@ exit 1 } - # Inputs + ########################################## + # Process inputs + ########################################## SOURCE_TYPE='Drive' FP_SOURCE_IMG= - if [[ -b $1 ]] - then - FP_SOURCE=$1 - - elif [[ -f $1 ]] - then - SOURCE_TYPE='Image' - FP_SOURCE_IMG=$1 - - elif [[ $1 ]] - then - Error_Exit "Input source $1 does not exist, aborting..." - fi PART_TABLE_TYPE= #FP_ROOT_DEV= ROOT_FS_TYPE= @@ -69,9 +58,32 @@ OUTPUT_IMG_EXT='img' #OUTPUT_IMG_NAME= [[ $MOUNT_IT == 'On' ]] || MOUNT_IT='Off' + [[ $SKIP_FIRSTBOOT_RESIZE == 1 ]] || SKIP_FIRSTBOOT_RESIZE=0 [[ $SHRINK_ONLY == 1 ]] || SHRINK_ONLY=0 [[ $SKIP_ARCHIVE == 1 ]] || SKIP_ARCHIVE=0 - [[ $SKIP_FIRSTBOOT_RESIZE == 1 ]] || SKIP_FIRSTBOOT_RESIZE=0 + ADD_DOS_PART=0 + while (( $# )) + do + case $1 in + '--add-dos-part') ADD_DOS_PART=1;; + *) + if [[ -b $1 ]] + then + FP_SOURCE=$1 + + elif [[ -f $1 ]] + then + SOURCE_TYPE='Image' + FP_SOURCE_IMG=$1 + + elif [[ $1 ]] + then + Error_Exit "Input source $1 does not exist, aborting..." + fi + ;; + esac + shift + done Unmount_tmp() { @@ -494,12 +506,57 @@ G_EXEC partx -u "$FP_SOURCE" fi + # Derive target image size from last partition end + 1 sector + IMAGE_SIZE=$(( ( $(sfdisk -qlo End "$FP_SOURCE" | tail -1) + 1 ) * 512 )) # 512 byte sectors => bytes + + # Add trailing FAT partition to simplify first run setup if requested + # - WARNING: this assumes that the partitions in the table are in order (which we do in other places as well) + if (( $ADD_DOS_PART )) + then + G_DIETPI-NOTIFY 2 'Adding a 1 MiB FAT partition to simplify first run setup' + # Increase source image size if required + [[ $SOURCE_TYPE == 'Image' ]] && (( $(stat -c '%s' "$FP_SOURCE_IMG") < $IMAGE_SIZE + 1048576 )) && G_EXEC truncate -s "$(( $IMAGE_SIZE + 1048576 ))" "$FP_SOURCE_IMG" && G_EXEC losetup -c "$FP_SOURCE" + # Add new DOS partition + local type='EBD0A0A2-B9E5-4433-87C0-68B6B72699C7' # https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs + [[ $PART_TABLE_TYPE == 'dos' ]] && type='c' + G_EXEC eval "sfdisk -a '$FP_SOURCE' <<< 'start=$IMAGE_SIZE,size=2048,type=$type'" # size in sectors + G_EXEC partprobe "$FP_SOURCE" + G_EXEC partx -u "$FP_SOURCE" + # create a FAT filesystem and add config files to it + local new_dos_part=$(sfdisk -l "$FP_SOURCE" | mawk "/ $IMAGE_SIZE /{print \$1;exit}") + G_EXE_OUTPUT=1 G_EXEC mkfs.fat -F 16 -n DIETPISETUP "$new_dos_part" + local fat_mountpoint=$(mktemp -d) + local root_mountpoint=$(mktemp -d) + G_EXEC mount "$new_dos_part" "$fat_mountpoint" + G_EXEC mount "$FP_ROOT_DEV" "$root_mountpoint" + G_DIETPI-NOTIFY 2 'Copying dietpi.txt and other config files to the DIETPISETUP partition' + for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' + do + [[ -f $root_mountpoint/boot/$f ]] && G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/" + done + cat << '_EOF_' > "$fat_mountpoint/Readme-DietPi-Config.txt" +DietPi pre-boot configuration + +You can edit the files in this folder to setup some configuration options +or even a completely automated install. Please check the documentation and +dietpi.txt for details: https://dietpi.com/docs/install/ + +This folder also supports the following additional files. Please ensure that +they have UNIX style LF line endings: +- unattended_pivpn.conf +- Automation_Custom_PreScript.sh +- Automation_Custom_Script.sh +_EOF_ + G_EXEC umount "$root_mountpoint" "$fat_mountpoint" + G_EXEC rmdir "$root_mountpoint" "$fat_mountpoint" + ((IMAGE_SIZE+=1048576)) + fi + # Exit now if source shall be shrunk only (( $SHRINK_ONLY )) && exit 0 - # Finished: Derive final image size from last partition end + 1 sector - IMAGE_SIZE=$(( ( $(sfdisk -qlo End "$FP_SOURCE" | tail -1) + 1 ) * 512 )) # 512 byte sectors => bytes - [[ $PART_TABLE_TYPE == 'gpt' ]] && IMAGE_SIZE=$(( $IMAGE_SIZE + 33*512 )) # Add 33 (34 overall) sectors for GPT backup partition table + # Add 33 (34 overall) sectors for GPT backup partition table + [[ $PART_TABLE_TYPE == 'gpt' ]] && IMAGE_SIZE=$(( $IMAGE_SIZE + 33*512 )) # Image file source and dd target if [[ $FP_SOURCE_IMG && $CLONING_TOOL == 'dd' ]] diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 968a2642c5..1cb46eb0dc 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ New software: - ADS-B Feeder | Track airplanes using SDRs and feed the data to ADS-B aggregators. Many thanks to @dirkhh for maintaining and implementing this software option: https://github.com/MichaIng/DietPi/pull/6587 Enhancements: +- General | DietPi images are now shipped with a trailing FAT partition which contains dietpi.txt and other config files for easier pre-configuration and automation from Windows and macOS hosts. Related CLI flags have been added to our build scripts. Many thanks to @dirkhh for implementing this feature: https://github.com/MichaIng/DietPi/pull/6602 - DietPi-Software | Docker: Enabled for Trixie and RISC-V via "docker.io" package from Debian repository. - DietPi-Software | Portainer: Enabled for RISC-V as Docker is now supported on RISC-V as well. diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh index 5495eb128a..7140597829 100755 --- a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh +++ b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh @@ -39,6 +39,23 @@ exit 1 fi + # Check if the last partition contains a FAT filesystem with DIETPISETUP label + if [[ $(lsblk -nrbo FSTYPE,LABEL "$ROOT_DRIVE" | tail -1) == 'vfat DIETPISETUP' ]] + then + # Mount it and copy files if present and newer + SETUP_PART=$(sfdisk -lqo DEVICE "$ROOT_DRIVE" | tail -1) + TMP_MOUNT=$(mktemp -d) + mount "$SETUP_PART" "$TMP_MOUNT" + for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' + do + [[ -f $TMP_MOUNT/$f ]] && cp -u "$TMP_MOUNT/$f" /boot/ + done + umount "$SETUP_PART" + rmdir "$TMP_MOUNT" + # Finally delete the partition so the resizing works + sfdisk --no-reread --no-tell-kernel --delete "$ROOT_DRIVE" "${SETUP_PART: -1}" + fi + # Only increase partition size if not yet done on first boot if [[ -f '/dietpi_skip_partition_resize' ]] then From fc9ab698d33b3bf0fc99641af963872ed9f2301e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 10 Sep 2023 23:05:28 +0200 Subject: [PATCH 19/36] v8.22 - CHANGELOG | Explain the added setup FAT partition and related CLI flags a little more --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1cb46eb0dc..96bbf05d0f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,7 +5,7 @@ New software: - ADS-B Feeder | Track airplanes using SDRs and feed the data to ADS-B aggregators. Many thanks to @dirkhh for maintaining and implementing this software option: https://github.com/MichaIng/DietPi/pull/6587 Enhancements: -- General | DietPi images are now shipped with a trailing FAT partition which contains dietpi.txt and other config files for easier pre-configuration and automation from Windows and macOS hosts. Related CLI flags have been added to our build scripts. Many thanks to @dirkhh for implementing this feature: https://github.com/MichaIng/DietPi/pull/6602 +- General | DietPi images are now shipped with a trailing FAT partition which contains dietpi.txt and other config files for easier pre-configuration and automation from Windows and macOS hosts. The partition is removed automatically on first boot, after copying all supported config files/scripts. Related CLI flags have been added to our build scripts: "--add-fat-part" for dietpi-imager and "--no-fat-part" for dietpi-build. Many thanks to @dirkhh for implementing this feature: https://github.com/MichaIng/DietPi/pull/6602 - DietPi-Software | Docker: Enabled for Trixie and RISC-V via "docker.io" package from Debian repository. - DietPi-Software | Portainer: Enabled for RISC-V as Docker is now supported on RISC-V as well. From 3bf1053a270ff4c8bce11cf80d5fba49cd65ad78 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 10 Sep 2023 23:59:20 +0200 Subject: [PATCH 20/36] v8.22 - DietPi-Build | Adjust DietPi-Imager args for image editions --- .build/images/dietpi-build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 85bde4234e..406657d208 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -484,6 +484,7 @@ if [[ $EDITION == 'Amiberry' || ( $EDITION == 'all' && $HW_MODEL == 0 ) ]] then G_EXEC mv "$OUTPUT_IMG_NAME.img" "${OUTPUT_IMG_NAME}_Amiberry.img" OUTPUT_IMG_NAME="${OUTPUT_IMG_NAME}_Amiberry" + IMAGER_ARGS[0]="$OUTPUT_IMG_NAME.img" # Create loop device FP_LOOP=$(losetup -f) @@ -533,6 +534,7 @@ if [[ $EDITION == 'AlloGUI' || ( $EDITION == 'all' && $HW_MODEL =~ ^(0|70)$ ) ]] then G_EXEC mv "$OUTPUT_IMG_NAME.img" "${OUTPUT_IMG_NAME%_Amiberry}_AlloGUI.img" OUTPUT_IMG_NAME="${OUTPUT_IMG_NAME%_Amiberry}_AlloGUI" + IMAGER_ARGS[0]="$OUTPUT_IMG_NAME.img" # Raise image size to 2.5 GiB and create loop device G_EXEC truncate -s '2560M' "$OUTPUT_IMG_NAME.img" From b553331de95071e3801f59546e3a8f91dd051088 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 Sep 2023 19:45:45 +0200 Subject: [PATCH 21/36] v8.22 - DietPi-Software | Update fallback URLs --- dietpi/dietpi-software | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 7cf1edc03e..af33a3fa17 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7503,8 +7503,8 @@ _EOF_ then Download_Install 'https://github.com/gotson/komga/releases/download/v0.165.0/komga-0.165.0.jar' /mnt/dietpi_userdata/komga/komga.jar else - local fallback_url='https://github.com/gotson/komga/releases/download/v1.3.1/komga-1.3.1.jar' - Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/"browser_download_url": .*\/komga-[^"\/]*\.jar"/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar + local fallback_url='https://github.com/gotson/komga/releases/download/v1.4.0/komga-1.4.0.jar' + Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/komga-[^"\/]*\.jar"$/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar fi # User @@ -11695,8 +11695,8 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/rclone/rclone/releases/download/v1.63.1/rclone-v1.63.1-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}")" + local fallback_url="https://github.com/rclone/rclone/releases/download/v1.64.0/rclone-v1.64.0-linux-$arch-v6.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 4fb188a67ac65066899fa5638741334035b92a5c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 Sep 2023 22:16:02 +0200 Subject: [PATCH 22/36] v8.22 - DietPi-Imager | Handle image size correctly in 512 sectors when adding setup FAT partition, convert to bytes afterwards. Obtain requried free disk space correctly if no 7z archive is generated. --- .build/images/dietpi-imager | 18 ++++++++++-------- dietpi/dietpi-software | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index b6996ec194..0b987af1df 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -507,7 +507,7 @@ fi # Derive target image size from last partition end + 1 sector - IMAGE_SIZE=$(( ( $(sfdisk -qlo End "$FP_SOURCE" | tail -1) + 1 ) * 512 )) # 512 byte sectors => bytes + IMAGE_SIZE=$(( $(sfdisk -qlo End "$FP_SOURCE" | tail -1) + 1 )) # 512 byte sectors # Add trailing FAT partition to simplify first run setup if requested # - WARNING: this assumes that the partitions in the table are in order (which we do in other places as well) @@ -515,7 +515,7 @@ then G_DIETPI-NOTIFY 2 'Adding a 1 MiB FAT partition to simplify first run setup' # Increase source image size if required - [[ $SOURCE_TYPE == 'Image' ]] && (( $(stat -c '%s' "$FP_SOURCE_IMG") < $IMAGE_SIZE + 1048576 )) && G_EXEC truncate -s "$(( $IMAGE_SIZE + 1048576 ))" "$FP_SOURCE_IMG" && G_EXEC losetup -c "$FP_SOURCE" + [[ $SOURCE_TYPE == 'Image' ]] && (( $(stat -c '%s' "$FP_SOURCE_IMG") < $IMAGE_SIZE * 512 + 1048576 )) && G_EXEC truncate -s "$(( $IMAGE_SIZE * 512 + 1048576 ))" "$FP_SOURCE_IMG" && G_EXEC losetup -c "$FP_SOURCE" # Add new DOS partition local type='EBD0A0A2-B9E5-4433-87C0-68B6B72699C7' # https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs [[ $PART_TABLE_TYPE == 'dos' ]] && type='c' @@ -549,14 +549,15 @@ they have UNIX style LF line endings: _EOF_ G_EXEC umount "$root_mountpoint" "$fat_mountpoint" G_EXEC rmdir "$root_mountpoint" "$fat_mountpoint" - ((IMAGE_SIZE+=1048576)) + ((IMAGE_SIZE+=2048)) fi # Exit now if source shall be shrunk only (( $SHRINK_ONLY )) && exit 0 # Add 33 (34 overall) sectors for GPT backup partition table - [[ $PART_TABLE_TYPE == 'gpt' ]] && IMAGE_SIZE=$(( $IMAGE_SIZE + 33*512 )) + [[ $PART_TABLE_TYPE == 'gpt' ]] && ((IMAGE_SIZE+=33)) + IMAGE_SIZE=$(( $IMAGE_SIZE * 512 )) # 512 byte sectors => bytes # Image file source and dd target if [[ $FP_SOURCE_IMG && $CLONING_TOOL == 'dd' ]] @@ -571,13 +572,15 @@ _EOF_ [[ $(readlink -f "$PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT") != "$(readlink -f "$FP_SOURCE_IMG")" ]] && G_EXEC mv "$FP_SOURCE_IMG" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" # Check for sufficient free disk space to store the 7z archive with 100 MiB buffer - G_CHECK_FREESPACE . $(( $IMAGE_SIZE * 15/100 / 1024**2 + 100 )) || exit 1 + (( $SKIP_ARCHIVE )) || G_CHECK_FREESPACE . $(( $IMAGE_SIZE * 15/100 / 1024**2 + 100 )) || exit 1 # Drive source and dd target elif [[ $CLONING_TOOL == 'dd' ]] then - # Check for sufficient free disk space to store the image and the 7z archive with 100 MiB buffer - G_CHECK_FREESPACE . $(( $IMAGE_SIZE * 115/100 / 1024**2 + 100 )) || exit 1 + # Check for sufficient free disk space to store the image and in case the 7z archive with 100 MiB buffer + local free_space_percent=100 + (( $SKIP_ARCHIVE )) || free_space_percent=115 # 15% image size for 7z archive + G_CHECK_FREESPACE . $(( $IMAGE_SIZE * $free_space_percent/100 / 1024**2 + 100 )) || exit 1 G_DIETPI-NOTIFY 2 "Creating final image with actually used size: $(( $IMAGE_SIZE / 1024**2 + 1 )) MiB" G_EXEC_OUTPUT=1 G_EXEC dd if="$FP_SOURCE" of="$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" bs=1M status=progress count=$(( $IMAGE_SIZE / 1024**2 + 1 )) @@ -736,7 +739,6 @@ _EOF_ (( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && limit_threads=('-mmt2') [[ -f $OUTPUT_IMG_NAME.7z ]] && G_EXEC rm "$OUTPUT_IMG_NAME.7z" [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 - # Add "-bsp1 -bso1 -bse2" to print output to regular STDOUT and STDERR, else the pipe to "tee" makes it omit at least the progress output. G_EXEC_DESC='Creating final 7zip archive' G_EXEC "$c7zz" a -mx=9 "${limit_threads[@]}" "$OUTPUT_IMG_NAME.7z" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" hash.txt README.md G_EXEC_NOHALT=1 G_EXEC rm hash.txt README.md diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index af33a3fa17..cac29da475 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11710,7 +11710,7 @@ _EOF_ esac local fallback_url="https://github.com/restic/restic/releases/download/v0.15.2/restic_0.15.2_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 + 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 6418cd3e14663e370d9ed6654ea7f8ca3a23207f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 Sep 2023 23:04:58 +0200 Subject: [PATCH 23/36] v8.22 - DietPi-Imager | Add 33 extra sectors for GPT partition table as well when needed to add the setup FAT partition. Reorder code to make it easier to understand the steps --- .build/images/dietpi-imager | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index 0b987af1df..d738066442 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -506,24 +506,30 @@ G_EXEC partx -u "$FP_SOURCE" fi - # Derive target image size from last partition end + 1 sector - IMAGE_SIZE=$(( $(sfdisk -qlo End "$FP_SOURCE" | tail -1) + 1 )) # 512 byte sectors + # Derive target image size from last partition end + # - WARNING: this assumes that the partitions in the table are in order (which we do in other places as well) + local last_part_end=$(sfdisk -qlo End "$FP_SOURCE" | tail -1) # 512 byte sectors + IMAGE_SIZE=$last_part_end + # Add 34 sectors for GPT backup partition table and 1 sector for MBR + [[ $PART_TABLE_TYPE == 'gpt' ]] && ((IMAGE_SIZE+=33)) || ((IMAGE_SIZE++)) + ((IMAGE_SIZE*=512)) # 512 byte sectors => bytes # Add trailing FAT partition to simplify first run setup if requested - # - WARNING: this assumes that the partitions in the table are in order (which we do in other places as well) if (( $ADD_DOS_PART )) then G_DIETPI-NOTIFY 2 'Adding a 1 MiB FAT partition to simplify first run setup' + ((IMAGE_SIZE+=1048576)) # Increase source image size if required - [[ $SOURCE_TYPE == 'Image' ]] && (( $(stat -c '%s' "$FP_SOURCE_IMG") < $IMAGE_SIZE * 512 + 1048576 )) && G_EXEC truncate -s "$(( $IMAGE_SIZE * 512 + 1048576 ))" "$FP_SOURCE_IMG" && G_EXEC losetup -c "$FP_SOURCE" + [[ $SOURCE_TYPE == 'Image' ]] && (( $(stat -c '%s' "$FP_SOURCE_IMG") < $IMAGE_SIZE )) && G_EXEC truncate -s "$IMAGE_SIZE" "$FP_SOURCE_IMG" && G_EXEC losetup -c "$FP_SOURCE" # Add new DOS partition + local start=$(( $last_part_end + 1 )) local type='EBD0A0A2-B9E5-4433-87C0-68B6B72699C7' # https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs [[ $PART_TABLE_TYPE == 'dos' ]] && type='c' - G_EXEC eval "sfdisk -a '$FP_SOURCE' <<< 'start=$IMAGE_SIZE,size=2048,type=$type'" # size in sectors + G_EXEC eval "sfdisk -a '$FP_SOURCE' <<< 'start=$start,size=2048,type=$type'" # size in sectors G_EXEC partprobe "$FP_SOURCE" G_EXEC partx -u "$FP_SOURCE" # create a FAT filesystem and add config files to it - local new_dos_part=$(sfdisk -l "$FP_SOURCE" | mawk "/ $IMAGE_SIZE /{print \$1;exit}") + local new_dos_part=$(sfdisk -l "$FP_SOURCE" | mawk "/ $start /{print \$1;exit}") G_EXE_OUTPUT=1 G_EXEC mkfs.fat -F 16 -n DIETPISETUP "$new_dos_part" local fat_mountpoint=$(mktemp -d) local root_mountpoint=$(mktemp -d) @@ -549,16 +555,11 @@ they have UNIX style LF line endings: _EOF_ G_EXEC umount "$root_mountpoint" "$fat_mountpoint" G_EXEC rmdir "$root_mountpoint" "$fat_mountpoint" - ((IMAGE_SIZE+=2048)) fi # Exit now if source shall be shrunk only (( $SHRINK_ONLY )) && exit 0 - # Add 33 (34 overall) sectors for GPT backup partition table - [[ $PART_TABLE_TYPE == 'gpt' ]] && ((IMAGE_SIZE+=33)) - IMAGE_SIZE=$(( $IMAGE_SIZE * 512 )) # 512 byte sectors => bytes - # Image file source and dd target if [[ $FP_SOURCE_IMG && $CLONING_TOOL == 'dd' ]] then From 0b73004c266f2e553020018ffd5ee31b031c2973 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 Sep 2023 23:12:48 +0200 Subject: [PATCH 24/36] v8.22 - CI | Satisfy shellcheck --- .build/images/dietpi-imager | 1 + 1 file changed, 1 insertion(+) diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index d738066442..f7cb3a33c0 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -511,6 +511,7 @@ local last_part_end=$(sfdisk -qlo End "$FP_SOURCE" | tail -1) # 512 byte sectors IMAGE_SIZE=$last_part_end # Add 34 sectors for GPT backup partition table and 1 sector for MBR + # shellcheck disable=SC2015 [[ $PART_TABLE_TYPE == 'gpt' ]] && ((IMAGE_SIZE+=33)) || ((IMAGE_SIZE++)) ((IMAGE_SIZE*=512)) # 512 byte sectors => bytes From 84a1a06027e5bd99ad22950fbb1bc2520541bc84 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 11 Sep 2023 23:28:00 +0200 Subject: [PATCH 25/36] v8.22 - DietPi-Imager | Really add the intended 34 sectors for the GPT backup partition table --- .build/images/dietpi-imager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index f7cb3a33c0..f376015699 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -512,7 +512,7 @@ IMAGE_SIZE=$last_part_end # Add 34 sectors for GPT backup partition table and 1 sector for MBR # shellcheck disable=SC2015 - [[ $PART_TABLE_TYPE == 'gpt' ]] && ((IMAGE_SIZE+=33)) || ((IMAGE_SIZE++)) + [[ $PART_TABLE_TYPE == 'gpt' ]] && ((IMAGE_SIZE+=34)) || ((IMAGE_SIZE++)) ((IMAGE_SIZE*=512)) # 512 byte sectors => bytes # Add trailing FAT partition to simplify first run setup if requested From 15db3f8305dc7a8b4c1f9d0c0713e857f685e8ab Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 12 Sep 2023 00:05:25 +0200 Subject: [PATCH 26/36] v8.22 - DietPi-Imager | 1 MiB is too small for FAT16. FAT12 is anyway the smallest FAT size supported, so let mkfs decide --- .build/images/dietpi-imager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index f376015699..ba1db427ef 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -531,7 +531,7 @@ G_EXEC partx -u "$FP_SOURCE" # create a FAT filesystem and add config files to it local new_dos_part=$(sfdisk -l "$FP_SOURCE" | mawk "/ $start /{print \$1;exit}") - G_EXE_OUTPUT=1 G_EXEC mkfs.fat -F 16 -n DIETPISETUP "$new_dos_part" + G_EXE_OUTPUT=1 G_EXEC mkfs.fat -n DIETPISETUP "$new_dos_part" local fat_mountpoint=$(mktemp -d) local root_mountpoint=$(mktemp -d) G_EXEC mount "$new_dos_part" "$fat_mountpoint" From 13dfec1d2a02e6bbdc297c7918b05bd2f7cccda6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 12 Sep 2023 19:46:24 +0200 Subject: [PATCH 27/36] v8.22 - CI | DietPi-Software: Add webserver/PHP/MariaDB checks for webserver stacks and fix MediaWiki software ID --- .github/workflows/dietpi-software.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 7d54933e14..b30f7f3520 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -232,8 +232,8 @@ for i in $SOFTWARE do case $i in 205) Process_Software webserver;; - 27|56|63|64|107|132) Process_Software 89 webserver;; # 93 (Pi-hole) cannot be installed non-interactively - 38|40|48|54|55|57|59|90|141|160) Process_Software 88 89 webserver;; + 27|56|63|64|75|78|81|107|132) Process_Software 89 webserver;; # 93 (Pi-hole) cannot be installed non-interactively + 38|40|48|54|55|57|59|76|79|82|90|160|210) Process_Software 88 89 webserver;; 159) Process_Software 36 37 65 88 89 96 121 124 128 129 152 160 163 webserver;; 47|114|168) Process_Software 88 89 91 webserver;; 8|33|131|179|206) Process_Software 196;; From f3e5f09b48252841df9f4df1070d51c39eb766cd Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 14 Sep 2023 20:23:24 +0200 Subject: [PATCH 28/36] v8.22 (#6591) - Images: All our images are now compressed via xz instead of 7z. These are a little easier to handle, especially on Linux hosts, and many flashing utilities allow to flash zx-compressed images directly to disk, without the need to manually decompress them first. As xz compresses files and no directories, the dedicated README.md and hash text files are not included anymore. The hashes for integrity checks within an archive have no real purpose, as the compression algorithms imply hashes internally (CRC64 in case of xz), which are checked and integrity of the content assed as part of the decompression. --- .build/images/dietpi-build | 115 +++++++----------------------------- .build/images/dietpi-imager | 31 +++------- CHANGELOG.txt | 3 +- 3 files changed, 31 insertions(+), 118 deletions(-) mode change 100755 => 100644 .build/images/dietpi-imager diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 406657d208..098c9554ec 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -210,11 +210,7 @@ fi # Virtual machine disk conversion [[ $VMTYPE && $VMTYPE != 'raw' ]] && apackages+=('qemu-utils') -# p7zip vs 7zip package -# shellcheck disable=SC2015 -(( $G_DISTRO < 7 )) && apackages+=('p7zip') c7zz='7zr' || apackages+=('7zip') c7zz='7zz' - -G_AG_CHECK_INSTALL_PREREQ parted debootstrap dbus systemd-container "${apackages[@]}" +G_AG_CHECK_INSTALL_PREREQ parted debootstrap dbus systemd-container xz-utils "${apackages[@]}" # Bootstrap archive keyring if missing if [[ ! -f $keyring ]] @@ -248,9 +244,8 @@ then 79) series=6;; *) :;; esac - G_EXEC curl -sSfO "https://dietpi.com/downloads/nanopi$series.7z" - G_EXEC "$c7zz" x "nanopi$series.7z" - G_EXEC rm "nanopi$series.7z" + G_EXEC curl -sSfO "https://dietpi.com/downloads/nanopi$series.img.xz" + G_EXEC xz -d "nanopi$series.img.xz" G_EXEC truncate -s "$(( 140 + $root_size ))M" "nanopi$series.img" G_EXEC_OUTPUT=1 G_EXEC sgdisk -e "nanopi$series.img" G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -fN8 'nanopi$series.img' <<< ',+'" @@ -669,11 +664,9 @@ fi ########################################## # Virtual machines ########################################## -G_EXEC_DESC='Downloading current README.md to pack with image...' G_EXEC curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/README.md" -o README.md - # NB: LZMA2 ultra compression requires much memory per thread. 1 GiB is not sufficient for >2 threads, hence use "-mmt2" to limit used CPU threads to "2" on 1 GiB devices with more than two cores. limit_threads=() -(( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && limit_threads=('-mmt2') +(( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && limit_threads=('-T2') # Since qemu-img does not support VMDK and VHDX resizing, we need to resize the raw .img. It is usually done as sparse file, hence the actual disk usage does not change. G_EXEC qemu-img resize "$OUTPUT_IMG_NAME.img" 8G @@ -728,25 +721,11 @@ ethernet0.virtualDev = "e1000" ethernet0.present = "TRUE" extendedConfigFile = "$image_name.vmxf" floppy0.present = "FALSE" -_EOF_ - G_DIETPI-NOTIFY 2 'Generating hashes to pack with VMware appliance, please wait...' - cat << _EOF_ > hash.txt -FILE: $image_name.vmdk -DATE: $(date) -MD5: $(md5sum "$image_name.vmdk" | mawk '{print $1}') -SHA1: $(sha1sum "$image_name.vmdk" | mawk '{print $1}') -SHA256: $(sha256sum "$image_name.vmdk" | mawk '{print $1}') - -FILE: $image_name.vmx -DATE: $(date) -MD5: $(md5sum "$image_name.vmx" | mawk '{print $1}') -SHA1: $(sha1sum "$image_name.vmx" | mawk '{print $1}') -SHA256: $(sha256sum "$image_name.vmx" | mawk '{print $1}') _EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 - G_EXEC_DESC='Creating VMware 7-Zip archive' G_EXEC "$c7zz" a -mx=9 "${limit_threads[@]}" "$image_name.7z" "$image_name.vmdk" "$image_name.vmx" hash.txt README.md + G_EXEC_DESC='Creating VMware tar.xz archive' XZ_OPT="-e9 ${limit_threads[*]}" G_EXEC tar -cJf "$image_name.tar.xz" "$image_name.vmdk" "$image_name.vmx" G_EXEC rm "$image_name.vmdk" "$image_name.vmx" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.7z" && G_EXEC rm "$image_name.7z" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz" && G_EXEC rm "$image_name.tar.xz" fi ####### ESXi ############################# @@ -870,18 +849,9 @@ _EOF_ [[ $VMTYPE == 'all' ]] || G_EXEC rm "$image_name.vmdk" G_EXEC rm "$image_name."{ovf,mf} - G_DIETPI-NOTIFY 2 'Generating hashes to pack with ESXi appliance, please wait...' - cat << _EOF_ > hash.txt -FILE: $image_name.ova -DATE: $(date) -MD5: $(md5sum "$image_name.ova" | mawk '{print $1}') -SHA1: $(sha1sum "$image_name.ova" | mawk '{print $1}') -SHA256: $(sha256sum "$image_name.ova" | mawk '{print $1}') -_EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 - G_EXEC_DESC='Creating VirtualBox 7-Zip archive' G_EXEC "$c7zz" a -mx=9 "${limit_threads[@]}" "$image_name.7z" "$image_name.ova" hash.txt README.md - G_EXEC rm "$image_name.ova" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.7z" && G_EXEC rm "$image_name.7z" + G_EXEC_DESC='Creating ESXi xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$image_name.ova" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz" && G_EXEC rm "$image_name.ova.xz" fi ####### VirtualBox ####################### @@ -1028,18 +998,9 @@ _EOF_ G_EXEC tar -cf "$image_name.ova" "$image_name."{ovf,vmdk,mf} G_EXEC rm "$image_name."{ovf,vmdk,mf} - G_DIETPI-NOTIFY 2 'Generating hashes to pack with VMware appliance, please wait...' - cat << _EOF_ > hash.txt -FILE: $image_name.ova -DATE: $(date) -MD5: $(md5sum "$image_name.ova" | mawk '{print $1}') -SHA1: $(sha1sum "$image_name.ova" | mawk '{print $1}') -SHA256: $(sha256sum "$image_name.ova" | mawk '{print $1}') -_EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 - G_EXEC_DESC='Creating VirtualBox 7-Zip archive' G_EXEC "$c7zz" a -mx=9 "${limit_threads[@]}" "$image_name.7z" "$image_name.ova" hash.txt README.md - G_EXEC rm "$image_name.ova" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.7z" && G_EXEC rm "$image_name.7z" + G_EXEC_DESC='Creating VirtualBox xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$image_name.ova" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz" && G_EXEC rm "$image_name.ova.xz" fi ####### Hyper-V ########################## @@ -1049,18 +1010,9 @@ then # Convert raw image to VHDX G_EXEC qemu-img convert -O vhdx "$OUTPUT_IMG_NAME.img" "$image_name.vhdx" - G_DIETPI-NOTIFY 2 'Generating hashes to pack with Hyper-V image, please wait...' - cat << _EOF_ > hash.txt -FILE: $image_name.vhdx -DATE: $(date) -MD5: $(md5sum "$image_name.vhdx" | mawk '{print $1}') -SHA1: $(sha1sum "$image_name.vhdx" | mawk '{print $1}') -SHA256: $(sha256sum "$image_name.vhdx" | mawk '{print $1}') -_EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 - G_EXEC_DESC='Creating Hyper-V 7-Zip archive' G_EXEC "$c7zz" a -mx=9 "${limit_threads[@]}" "$image_name.7z" "$image_name.vhdx" hash.txt README.md - G_EXEC rm "$image_name.vhdx" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.7z" && G_EXEC rm "$image_name.7z" + G_EXEC_DESC='Creating Hyper-V xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$image_name.vhdx" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.vhdx.xz" && G_EXEC rm "$image_name.vhdx.xz" fi ####### Proxmox ############################ @@ -1070,18 +1022,13 @@ then # Convert raw image to QCOW2 G_EXEC qemu-img convert -c -O qcow2 "$OUTPUT_IMG_NAME.img" "$image_name.qcow2" - G_DIETPI-NOTIFY 2 'Generating hashes to pack with Proxmox image, please wait...' - cat << _EOF_ > hash.txt -FILE: $image_name.qcow2 -DATE: $(date) -MD5: $(md5sum "$image_name.qcow2" | mawk '{print $1}') -SHA1: $(sha1sum "$image_name.qcow2" | mawk '{print $1}') -SHA256: $(sha256sum "$image_name.qcow2" | mawk '{print $1}') -_EOF_ + # Keep QCOW2 in compression when UTM appliance shall be generated from it as well. + keep=() + [[ $VMTYPE == 'all' ]] && keep=('-k') + [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 - G_EXEC_DESC='Creating Proxmox 7-Zip archive' G_EXEC "$c7zz" a -mx=9 "${limit_threads[@]}" "$image_name.7z" "$image_name.qcow2" hash.txt README.md - [[ $VMTYPE == 'all' ]] || G_EXEC rm "$image_name.qcow2" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.7z" && G_EXEC rm "$image_name.7z" + G_EXEC_DESC='Creating Proxmox xz archive' G_EXEC xz -9e "${limit_threads[@]}" "${keep[@]}" "$image_name.qcow2" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.qcow2.xz" && G_EXEC rm "$image_name.qcow2.xz" fi ####### UTM ############################## @@ -1246,35 +1193,15 @@ _EOF_ -_EOF_ - G_DIETPI-NOTIFY 2 'Generating hashes to pack with UTM appliance, please wait...' - cat << _EOF_ > hash.txt -FILE: $image_name.utm/Images/data.qcow2 -DATE: $(date) -MD5: $(md5sum "$image_name.utm/Images/data.qcow2" | mawk '{print $1}') -SHA1: $(sha1sum "$image_name.utm/Images/data.qcow2" | mawk '{print $1}') -SHA256: $(sha256sum "$image_name.utm/Images/data.qcow2" | mawk '{print $1}') - -FILE: $image_name.utm/config.plist -DATE: $(date) -MD5: $(md5sum "$image_name.utm/config.plist" | mawk '{print $1}') -SHA1: $(sha1sum "$image_name.utm/config.plist" | mawk '{print $1}') -SHA256: $(sha256sum "$image_name.utm/config.plist" | mawk '{print $1}') - -FILE: $image_name.utm/view.plist -DATE: $(date) -MD5: $(md5sum "$image_name.utm/view.plist" | mawk '{print $1}') -SHA1: $(sha1sum "$image_name.utm/view.plist" | mawk '{print $1}') -SHA256: $(sha256sum "$image_name.utm/view.plist" | mawk '{print $1}') _EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 - G_EXEC_DESC='Creating UTM 7-Zip archive' G_EXEC "$c7zz" a -mx=9 "${limit_threads[@]}" "$image_name.7z" "$image_name.utm" hash.txt README.md + G_EXEC_DESC='Creating UTM tar.xz archive' XZ_OPT="-e9 ${limit_threads[*]}" G_EXEC tar -cJf "$image_name.tar.xz" "$image_name.utm" G_EXEC rm -R "$image_name.utm" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.7z" && G_EXEC rm "$image_name.7z" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz" && G_EXEC rm "$image_name.tar.xz" fi # Cleanup -G_EXEC rm hash.txt README.md "$OUTPUT_IMG_NAME.img" +G_EXEC rm "$OUTPUT_IMG_NAME.img" exit 0 } diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager old mode 100755 new mode 100644 index ba1db427ef..3b82afd54d --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -13,7 +13,7 @@ # or use an existing .img file # or use Clonezilla to generate a bootable installer ISO from drive for x86_64 systems # - Minimises root partition and filesystem - # - Hashes and 7z's the final image ready for release + # - Compresses the final image ready for release #//////////////////////////////////// # Import DietPi-Globals --------------------------------------------------------------- @@ -289,9 +289,7 @@ Main(){ # Dependencies - local p7zip='7zip' c7zz='7zz' - (( $G_DISTRO < 7 )) && p7zip='p7zip' c7zz='7zr' - G_AG_CHECK_INSTALL_PREREQ parted fdisk zerofree "$p7zip" + G_AG_CHECK_INSTALL_PREREQ parted fdisk zerofree xz-utils # Skip menu if all inputs are provided via environment variables if [[ ( $SOURCE_TYPE$FP_SOURCE == 'Drive'?* || $SOURCE_TYPE$FP_SOURCE_IMG == 'Image'?* ) && $FP_ROOT_DEV && $CLONING_TOOL =~ ^(dd|Clonezilla)$ && $OUTPUT_IMG_NAME ]] @@ -723,33 +721,20 @@ _EOF_ # Exit now when archive shall be skipped (( $SKIP_ARCHIVE )) && exit 0 - # Generate hashes: MD5, SHA1, SHA256 - G_DIETPI-NOTIFY 2 'Generating hashes to pack with image, please wait...' - cat << _EOF_ > hash.txt -FILE: $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT -DATE: $(date) -MD5: $(md5sum "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" | mawk '{print $1}') -SHA1: $(sha1sum "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" | mawk '{print $1}') -SHA256: $(sha256sum "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" | mawk '{print $1}') -_EOF_ - # Download current README - G_EXEC_DESC='Downloading current README.md to pack with image...' G_EXEC curl -sSf "$DIETPI_REPO/README.md" -o README.md - - # Generate 7z archive + # Generate xz archive # NB: LZMA2 ultra compression requires much memory per thread. 1 GiB is not sufficient for >2 threads, hence use "-mmt2" to limit used CPU threads to "2" on 1 GiB devices with more than two cores. local limit_threads=() - (( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && limit_threads=('-mmt2') - [[ -f $OUTPUT_IMG_NAME.7z ]] && G_EXEC rm "$OUTPUT_IMG_NAME.7z" + (( $(free -m | mawk '/Mem:/{print $2}') < 1750 && $(nproc) > 2 )) && limit_threads=('-T2') + [[ -f $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz ]] && G_EXEC rm "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 - G_EXEC_DESC='Creating final 7zip archive' G_EXEC "$c7zz" a -mx=9 "${limit_threads[@]}" "$OUTPUT_IMG_NAME.7z" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" hash.txt README.md + G_EXEC_DESC='Creating final xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" - G_EXEC_NOHALT=1 G_EXEC rm hash.txt README.md G_DIETPI-NOTIFY 0 "DietPi-Imager has successfully finished. Final image file: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT -Final 7z archive: $PWD/$OUTPUT_IMG_NAME.7z" +Final xz archive: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" # Upload archive automatically if there is an upload.sh in the same directory - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$OUTPUT_IMG_NAME.7z" && G_EXEC rm -R "$OUTPUT_IMG_NAME.7z" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" && G_EXEC rm -R "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" } diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 96bbf05d0f..fddb209565 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,7 +5,8 @@ New software: - ADS-B Feeder | Track airplanes using SDRs and feed the data to ADS-B aggregators. Many thanks to @dirkhh for maintaining and implementing this software option: https://github.com/MichaIng/DietPi/pull/6587 Enhancements: -- General | DietPi images are now shipped with a trailing FAT partition which contains dietpi.txt and other config files for easier pre-configuration and automation from Windows and macOS hosts. The partition is removed automatically on first boot, after copying all supported config files/scripts. Related CLI flags have been added to our build scripts: "--add-fat-part" for dietpi-imager and "--no-fat-part" for dietpi-build. Many thanks to @dirkhh for implementing this feature: https://github.com/MichaIng/DietPi/pull/6602 +- Images | DietPi images are now shipped with a trailing FAT partition which contains dietpi.txt and other config files for easier pre-configuration and automation from Windows and macOS hosts. The partition is removed automatically on first boot, after copying all supported config files/scripts. Related CLI flags have been added to our build scripts: "--add-fat-part" for dietpi-imager and "--no-fat-part" for dietpi-build. Many thanks to @dirkhh for implementing this feature: https://github.com/MichaIng/DietPi/pull/6602 +- Images | All our images are now compressed via xz instead of 7z. These are a little easier to handle, especially on Linux hosts, and many flashing utilities allow to flash zx-compressed images directly to disk, without the need to manually decompress them first. As xz compresses files and no directories, the dedicated README.md and hash text files are not included anymore. The hashes for integrity checks within an archive have no real purpose, as the compression algorithms imply hashes internally (CRC64 in case of xz), which are checked and integrity of the content assed as part of the decompression. - DietPi-Software | Docker: Enabled for Trixie and RISC-V via "docker.io" package from Debian repository. - DietPi-Software | Portainer: Enabled for RISC-V as Docker is now supported on RISC-V as well. From 21a6b52f3947d4b92daf95bf9295b9bbabd902df Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 15 Sep 2023 00:38:30 +0200 Subject: [PATCH 29/36] v8.22 (#6617) - Images | Add SHA256 hashes for every uploaded image archive --- .build/images/dietpi-build | 18 ++++++++++++------ .build/images/dietpi-imager | 8 +++++--- .github/workflows/dietpi-build.yml | 9 ++++++--- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 098c9554ec..7d10996fb7 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -725,7 +725,8 @@ _EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating VMware tar.xz archive' XZ_OPT="-e9 ${limit_threads[*]}" G_EXEC tar -cJf "$image_name.tar.xz" "$image_name.vmdk" "$image_name.vmx" G_EXEC rm "$image_name.vmdk" "$image_name.vmx" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz" && G_EXEC rm "$image_name.tar.xz" + G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.tar.xz' > '$image_name.tar.xz.sha256'" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz"{,.sha256} && G_EXEC rm "$image_name.tar.xz"{,.sha256} fi ####### ESXi ############################# @@ -851,7 +852,8 @@ _EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating ESXi xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$image_name.ova" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz" && G_EXEC rm "$image_name.ova.xz" + G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.ova.xz' > '$image_name.ova.xz.sha256'" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz"{,.sha256} && G_EXEC rm "$image_name.ova.xz"{,.sha256} fi ####### VirtualBox ####################### @@ -1000,7 +1002,8 @@ _EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating VirtualBox xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$image_name.ova" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz" && G_EXEC rm "$image_name.ova.xz" + G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.ova.xz' > '$image_name.ova.xz.sha256'" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz"{,.sha256} && G_EXEC rm "$image_name.ova.xz"{,.sha256} fi ####### Hyper-V ########################## @@ -1012,7 +1015,8 @@ then [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating Hyper-V xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$image_name.vhdx" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.vhdx.xz" && G_EXEC rm "$image_name.vhdx.xz" + G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.vhdx.xz' > '$image_name.vhdx.xz.sha256'" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.vhdx.xz"{,.sha256} && G_EXEC rm "$image_name.vhdx.xz"{,.sha256} fi ####### Proxmox ############################ @@ -1028,7 +1032,8 @@ then [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating Proxmox xz archive' G_EXEC xz -9e "${limit_threads[@]}" "${keep[@]}" "$image_name.qcow2" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.qcow2.xz" && G_EXEC rm "$image_name.qcow2.xz" + G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.qcow2.xz' > '$image_name.qcow2.xz.sha256'" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.qcow2.xz"{,.sha256} && G_EXEC rm "$image_name.qcow2.xz"{,.sha256} fi ####### UTM ############################## @@ -1197,7 +1202,8 @@ _EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating UTM tar.xz archive' XZ_OPT="-e9 ${limit_threads[*]}" G_EXEC tar -cJf "$image_name.tar.xz" "$image_name.utm" G_EXEC rm -R "$image_name.utm" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz" && G_EXEC rm "$image_name.tar.xz" + G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.tar.xz' > '$image_name.tar.xz.sha256'" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz"{,.sha256} && G_EXEC rm "$image_name.tar.xz"{,.sha256} fi # Cleanup diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index 3b82afd54d..ab097ddc03 100644 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -728,13 +728,15 @@ _EOF_ [[ -f $OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz ]] && G_EXEC rm "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating final xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" + G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz' > '$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.sha256'" G_DIETPI-NOTIFY 0 "DietPi-Imager has successfully finished. -Final image file: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT -Final xz archive: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" +Image file: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT +xz archive: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz +SHA256 hash: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.sha256" # Upload archive automatically if there is an upload.sh in the same directory - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" && G_EXEC rm -R "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz"{,.sha256} && G_EXEC rm -R "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz"{,.sha256} } diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index 0eb5b6e43f..a78f1a78cb 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -111,8 +111,11 @@ jobs: sudo dash -c 'umask 377; echo '\''${{ secrets.KNOWN_HOSTS }}'\'' > /root/.ssh/known_hosts; echo '\''${{ secrets.SSH_KEY }}'\'' > /root/.ssh/id_ed25519; > upload.sh; chmod 0711 upload.sh' echo '#!/bin/dash set -e - curl -T "${1:-EMPTY}" --key /root/.ssh/id_ed25519 '\''${{ secrets.UPLOAD_URL }}testing/'\'' - curl '\''https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache'\'' -H '\''Authorization: Bearer ${{ secrets.CF_TOKEN }}'\'' -H '\''Content-Type: application/json'\'' \ - --data "{\"files\":[\"https://dietpi.com/downloads/images/testing/\",\"https://dietpi.com/downloads/images/testing/${1##*/}\"]}"' | sudo tee upload.sh > /dev/null + urls="\"https://dietpi.com/downloads/images/testing/\"" + for i in "$@"; do urls="$urls,\"https://dietpi.com/downloads/images/testing/${i##*/}\""; done + IFS=, + curl -T "{$*}" --key /root/.ssh/id_ed25519 '\''${{ secrets.UPLOAD_URL }}testing/'\'' + curl -H '\''Authorization: Bearer ${{ secrets.CF_TOKEN }}'\'' -H '\''Content-Type: application/json'\'' -d "{\"files\":[$urls]}" '\''https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache'\'' + echo' | sudo tee upload.sh > /dev/null - name: Run DietPi-Build run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=${GITHUB_REF#refs/heads/}; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/${GITHUB_REF#refs/heads/}/.build/images/dietpi-build")" 'DietPi-Build' ${{ matrix.buildargs }} From 4d1cba63aa493e87a0784503bd3b41103b64eea4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 16 Sep 2023 23:41:51 +0200 Subject: [PATCH 30/36] v8.22 - CI | Shairport Sync: Fix Trixie builds as of raised libavcodec version --- .build/software/shairport-sync/build.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.build/software/shairport-sync/build.bash b/.build/software/shairport-sync/build.bash index fb0b9e5e55..52a88fdfa2 100755 --- a/.build/software/shairport-sync/build.bash +++ b/.build/software/shairport-sync/build.bash @@ -487,7 +487,11 @@ find "$DIR" ! \( -path "$DIR/DEBIAN" -prune \) -type f -exec md5sum {} + | sed " # - Add dependencies adeps+=('libplist3' 'libsodium23' 'libgcrypt20') -(( $G_DISTRO > 6 )) && adeps+=('libavcodec59') || adeps+=('libavcodec58') +case $G_DISTRO in + 5|6) adeps+=('libavcodec58');; + 7) adeps+=('libavcodec59');; + *) adeps+=('libavcodec60');; +esac DEPS_APT_VERSIONED= for i in "${adeps[@]}" do From 9670f4a2e591a2190244271cf9e14c8445138610 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 Sep 2023 00:11:12 +0200 Subject: [PATCH 31/36] v8.22 - DietPi-Software | File Browser: Update fallback URL --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index cac29da475..7ad2784ab8 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -11826,8 +11826,8 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.24.2/linux-$arch-filebrowser.tar.gz" - Download_Install "$(curl -sSfL 'https://api.github.com/repos/filebrowser/filebrowser/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/linux-$arch-filebrowser\.tar\.gz\"/{print \$4}")" ./filebrowser/ + local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.25.0/linux-$arch-filebrowser.tar.gz" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/filebrowser/filebrowser/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/linux-$arch-filebrowser\.tar\.gz\"$/{print \$4}")" ./filebrowser/ # Reinstall [[ -d '/opt/filebrowser' ]] && G_EXEC rm -R /opt/filebrowser @@ -11836,7 +11836,7 @@ _EOF_ G_EXEC mv filebrowser /opt/ # User - [[ -d '/mnt/dietpi_userdata/filebrowser' ]] || G_EXEC mkdir /mnt/dietpi_userdata/filebrowser + G_EXEC mkdir -p /mnt/dietpi_userdata/filebrowser Create_User -g dietpi -d /mnt/dietpi_userdata/filebrowser filebrowser # Config if not exist From 63616366f9bd02e846244427653d29ea1a7ed4d3 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 Sep 2023 22:33:17 +0200 Subject: [PATCH 32/36] v8.22 (#6623) - Images | SHA256 hashes and GPG signatures are now provided for all our images, linked from our download page or found here: https://dietpi.com/downloads/images/. Our public GPG keyring can be found at https://github.com/MichaIng.gpg. --- .build/images/dietpi-build | 27 +++++++++++++++++++++------ .build/images/dietpi-imager | 8 ++++++-- .github/workflows/dietpi-build.yml | 5 ++++- CHANGELOG.txt | 3 ++- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 7d10996fb7..1f4f5fde66 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -46,6 +46,7 @@ GITOWNER='MichaIng' EDITION= SUFFIX= ADD_DOS_PART=1 +SIGN_PASS= while (( $# )) do case $1 in @@ -61,6 +62,7 @@ do '-e') shift; EDITION=$1;; '-s') shift; SUFFIX=$1;; '--no-dos-part') ADD_DOS_PART=0;; + '--sign') shift; SIGN_PASS=$1;; *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; esac shift @@ -468,6 +470,7 @@ G_EXEC losetup -d "$FP_LOOP" export FP_ROOT_DEV CLONING_TOOL OUTPUT_IMG_NAME MOUNT_IT='Off' SKIP_ARCHIVE SKIP_FIRSTBOOT_RESIZE=1 IMAGER_ARGS=("$OUTPUT_IMG_NAME.img") (( $ADD_DOS_PART )) && IMAGER_ARGS+=('--add-dos-part') +[[ $SIGN_PASS ]] && IMAGER_ARGS+=('--sign' "$SIGN_PASS") if [[ ! $EDITION || $EDITION == 'all' ]] then G_DIETPI-NOTIFY 2 "Running DietPi-Imager for $G_GITOWNER/$G_GITBRANCH" @@ -726,7 +729,9 @@ _EOF_ G_EXEC_DESC='Creating VMware tar.xz archive' XZ_OPT="-e9 ${limit_threads[*]}" G_EXEC tar -cJf "$image_name.tar.xz" "$image_name.vmdk" "$image_name.vmx" G_EXEC rm "$image_name.vmdk" "$image_name.vmx" G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.tar.xz' > '$image_name.tar.xz.sha256'" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz"{,.sha256} && G_EXEC rm "$image_name.tar.xz"{,.sha256} + signature=() + [[ $SIGN_PASS ]] && { G_DIETPI-NOTIFY 2 'Signing archive ...'; gpg --batch --pinentry-mode loopback --passphrase "$SIGN_PASS" -b --armor "$image_name.tar.xz" || exit 1; signature=("$image_name.tar.xz.asc"); } + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz"{,.sha256} "${signature[@]}" && G_EXEC rm "$image_name.tar.xz"{,.sha256} "${signature[@]}" fi ####### ESXi ############################# @@ -853,7 +858,9 @@ _EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating ESXi xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$image_name.ova" G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.ova.xz' > '$image_name.ova.xz.sha256'" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz"{,.sha256} && G_EXEC rm "$image_name.ova.xz"{,.sha256} + signature=() + [[ $SIGN_PASS ]] && { G_DIETPI-NOTIFY 2 'Signing archive ...'; gpg --batch --pinentry-mode loopback --passphrase "$SIGN_PASS" -b --armor "$image_name.ova.xz" || exit 1; signature=("$image_name.ova.xz.asc"); } + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz"{,.sha256} "${signature[@]}" && G_EXEC rm "$image_name.ova.xz"{,.sha256} "${signature[@]}" fi ####### VirtualBox ####################### @@ -1003,7 +1010,9 @@ _EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating VirtualBox xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$image_name.ova" G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.ova.xz' > '$image_name.ova.xz.sha256'" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz"{,.sha256} && G_EXEC rm "$image_name.ova.xz"{,.sha256} + signature=() + [[ $SIGN_PASS ]] && { G_DIETPI-NOTIFY 2 'Signing archive ...'; gpg --batch --pinentry-mode loopback --passphrase "$SIGN_PASS" -b --armor "$image_name.ova.xz" || exit 1; signature=("$image_name.ova.xz.asc"); } + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.ova.xz"{,.sha256} "${signature[@]}" && G_EXEC rm "$image_name.ova.xz"{,.sha256} "${signature[@]}" fi ####### Hyper-V ########################## @@ -1016,7 +1025,9 @@ then [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating Hyper-V xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$image_name.vhdx" G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.vhdx.xz' > '$image_name.vhdx.xz.sha256'" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.vhdx.xz"{,.sha256} && G_EXEC rm "$image_name.vhdx.xz"{,.sha256} + signature=() + [[ $SIGN_PASS ]] && { G_DIETPI-NOTIFY 2 'Signing archive ...'; gpg --batch --pinentry-mode loopback --passphrase "$SIGN_PASS" -b --armor "$image_name.vhdx.xz" || exit 1; signature=("$image_name.vhdx.xz.asc"); } + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.vhdx.xz"{,.sha256} "${signature[@]}" && G_EXEC rm "$image_name.vhdx.xz"{,.sha256} "${signature[@]}" fi ####### Proxmox ############################ @@ -1033,7 +1044,9 @@ then [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating Proxmox xz archive' G_EXEC xz -9e "${limit_threads[@]}" "${keep[@]}" "$image_name.qcow2" G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.qcow2.xz' > '$image_name.qcow2.xz.sha256'" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.qcow2.xz"{,.sha256} && G_EXEC rm "$image_name.qcow2.xz"{,.sha256} + signature=() + [[ $SIGN_PASS ]] && { G_DIETPI-NOTIFY 2 'Signing archive ...'; gpg --batch --pinentry-mode loopback --passphrase "$SIGN_PASS" -b --armor "$image_name.qcow2.xz" || exit 1; signature=("$image_name.qcow2.xz.asc"); } + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.qcow2.xz"{,.sha256} "${signature[@]}" && G_EXEC rm "$image_name.qcow2.xz"{,.sha256} "${signature[@]}" fi ####### UTM ############################## @@ -1203,7 +1216,9 @@ _EOF_ G_EXEC_DESC='Creating UTM tar.xz archive' XZ_OPT="-e9 ${limit_threads[*]}" G_EXEC tar -cJf "$image_name.tar.xz" "$image_name.utm" G_EXEC rm -R "$image_name.utm" G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$image_name.tar.xz' > '$image_name.tar.xz.sha256'" - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz"{,.sha256} && G_EXEC rm "$image_name.tar.xz"{,.sha256} + signature=() + [[ $SIGN_PASS ]] && { G_DIETPI-NOTIFY 2 'Signing archive ...'; gpg --batch --pinentry-mode loopback --passphrase "$SIGN_PASS" -b --armor "$image_name.tar.xz" || exit 1; signature=("$image_name.tar.xz.asc"); } + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$image_name.tar.xz"{,.sha256} "${signature[@]}" && G_EXEC rm "$image_name.tar.xz"{,.sha256} "${signature[@]}" fi # Cleanup diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index ab097ddc03..f4caf1b807 100644 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -62,10 +62,12 @@ [[ $SHRINK_ONLY == 1 ]] || SHRINK_ONLY=0 [[ $SKIP_ARCHIVE == 1 ]] || SKIP_ARCHIVE=0 ADD_DOS_PART=0 + SIGN_PASS= while (( $# )) do case $1 in '--add-dos-part') ADD_DOS_PART=1;; + '--sign') shift; SIGN_PASS=$1;; *) if [[ -b $1 ]] then @@ -729,14 +731,16 @@ _EOF_ [[ ( -t 0 || -t 1 ) && $TERM != 'dumb' ]] && G_EXEC_OUTPUT=1 G_EXEC_DESC='Creating final xz archive' G_EXEC xz -9e "${limit_threads[@]}" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" G_EXEC_DESC='Generating SHA256 hash' G_EXEC eval "sha256sum '$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz' > '$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.sha256'" + local signature=() sig_text='' + [[ $SIGN_PASS ]] && { G_DIETPI-NOTIFY 2 'Signing archive ...'; gpg --batch --pinentry-mode loopback --passphrase "$SIGN_PASS" -b --armor "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz" || exit 1; signature=("$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.asc") sig_text="\nSignature: $PWD/${signature[*]}"; } G_DIETPI-NOTIFY 0 "DietPi-Imager has successfully finished. Image file: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT xz archive: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz -SHA256 hash: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.sha256" +SHA256 hash: $PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz.sha256$sig_text" # Upload archive automatically if there is an upload.sh in the same directory - [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz"{,.sha256} && G_EXEC rm -R "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz"{,.sha256} + [[ -x 'upload.sh' ]] && G_EXEC_OUTPUT=1 G_EXEC ./upload.sh "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz"{,.sha256} "${signature[@]}" && G_EXEC rm -R "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT.xz"{,.sha256} "${signature[@]}" } diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index a78f1a78cb..83bcfddf04 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -117,5 +117,8 @@ jobs: curl -T "{$*}" --key /root/.ssh/id_ed25519 '\''${{ secrets.UPLOAD_URL }}testing/'\'' curl -H '\''Authorization: Bearer ${{ secrets.CF_TOKEN }}'\'' -H '\''Content-Type: application/json'\'' -d "{\"files\":[$urls]}" '\''https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache'\'' echo' | sudo tee upload.sh > /dev/null + sudo gpg --batch --import << _EOF_ + ${{ secrets.GPG_KEY }} + _EOF_ - name: Run DietPi-Build - run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=${GITHUB_REF#refs/heads/}; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/${GITHUB_REF#refs/heads/}/.build/images/dietpi-build")" 'DietPi-Build' ${{ matrix.buildargs }} + run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=${GITHUB_REF#refs/heads/}; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/${GITHUB_REF#refs/heads/}/.build/images/dietpi-build")" 'DietPi-Build' ${{ matrix.buildargs }} --sign '${{ secrets.GPG_PASS }}' diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fddb209565..d05edc0553 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,7 +6,8 @@ New software: Enhancements: - Images | DietPi images are now shipped with a trailing FAT partition which contains dietpi.txt and other config files for easier pre-configuration and automation from Windows and macOS hosts. The partition is removed automatically on first boot, after copying all supported config files/scripts. Related CLI flags have been added to our build scripts: "--add-fat-part" for dietpi-imager and "--no-fat-part" for dietpi-build. Many thanks to @dirkhh for implementing this feature: https://github.com/MichaIng/DietPi/pull/6602 -- Images | All our images are now compressed via xz instead of 7z. These are a little easier to handle, especially on Linux hosts, and many flashing utilities allow to flash zx-compressed images directly to disk, without the need to manually decompress them first. As xz compresses files and no directories, the dedicated README.md and hash text files are not included anymore. The hashes for integrity checks within an archive have no real purpose, as the compression algorithms imply hashes internally (CRC64 in case of xz), which are checked and integrity of the content assed as part of the decompression. +- Images | All our images are now compressed via xz instead of 7z. These are a little easier to handle, especially on Linux hosts, and many flashing utilities allow to flash zx-compressed images directly to disk, without the need to manually decompress them first. As xz compresses files and no directories, the dedicated README.md and hash text files are not included anymore. The hashes for integrity checks within an archive have no real purpose, as the compression algorithms imply hashes internally (CRC64 in case of xz), which are checked and integrity of the content assured as part of the decompression. +- Images | SHA256 hashes and GPG signatures are now provided for all our images, linked from our download page or found here: https://dietpi.com/downloads/images/. Our public GPG keyring can be found at https://github.com/MichaIng.gpg. - DietPi-Software | Docker: Enabled for Trixie and RISC-V via "docker.io" package from Debian repository. - DietPi-Software | Portainer: Enabled for RISC-V as Docker is now supported on RISC-V as well. From f0b5abc279902a50d26de0ff52847f3ff91b90a7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 Sep 2023 22:48:03 +0200 Subject: [PATCH 33/36] v8.22 - DietPi-Patches | Migrate Armbian keyring from /etc/apt/trusted.gpg to /etc/apt/trusted.gpg.d for old images --- .update/patches | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.update/patches b/.update/patches index c2d4466e32..5f17701275 100755 --- a/.update/patches +++ b/.update/patches @@ -1473,6 +1473,14 @@ SUBSYSTEM=="leds", KERNEL=="green:lan", ACTION=="add", ATTR{trigger}="netdev", A SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" _EOF_ fi + + # Migrate Armbian keyring from /etc/apt/trusted.gpg to /etc/apt/trusted.gpg.d for old images + if [[ -f '/etc/apt/trusted.gpg' && $(apt-key --keyring /etc/apt/trusted.gpg list 'DF00FAF1C577104B50BF1D0093D6889F9F0E78D5' 2> /dev/null) ]] + then + 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 apt-key --keyring /etc/apt/trusted.gpg del 'DF00FAF1C577104B50BF1D0093D6889F9F0E78D5' + [[ $(apt-key --keyring /etc/apt/trusted.gpg list 2> /dev/null) ]] || G_EXEC rm /etc/apt/trusted.gpg + fi } # v6.35 => v7 migration From b38163c92fe6015f882b52de66e82fae7ad72934 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 Sep 2023 23:30:59 +0200 Subject: [PATCH 34/36] v8.22 - dietpi-bookworm-upgrade | Resolved an issue on systems with Armbian repository, where the system was still identified as Bullseye after the distribution upgrade to Bookworm. Reason was Armbian's base-files package, which was not upgraded as intended. On all DietPi systems, the original base-files package from Debian will now be enforced to prevent this and similar issues. Many thanks to @rogerthn2019 for reporting this issue: https://github.com/MichaIng/DietPi/issues/6227#issuecomment-1713688577 --- .build/images/dietpi-installer | 10 ++++++++++ .update/patches | 4 ++++ .update/pre-patches | 30 ++++++++++++++++++++++++++++++ CHANGELOG.txt | 1 + 4 files changed, 45 insertions(+) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 0cebad0f72..96ea0ca5f2 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -969,6 +969,16 @@ _EOF_ # DietPi-Build with Armbian kernel/bootloader/firmware elif (( $armbian_repo )) 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 + +Package: armbian-firmware* linux-* +Pin: origin apt.armbian.com +Pin-Priority: 500 +_EOF_ # Bootstrap Armbian repository 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 diff --git a/.update/patches b/.update/patches index 5f17701275..fed74700ed 100755 --- a/.update/patches +++ b/.update/patches @@ -1463,6 +1463,10 @@ Patch_8_21() Patch_8_22() { + # Remove obsolete configs from pre-patches + [[ -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 + # NanoPi R4S: Fix Ethernet LEDs: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 if (( $G_HW_MODEL == 47 )) then diff --git a/.update/pre-patches b/.update/pre-patches index a66bead827..98f23da6ab 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -264,5 +264,35 @@ then fi fi +# v8.22 +if (( $G_DIETPI_VERSION_CORE < 8 || ( $G_DIETPI_VERSION_CORE == 8 && $G_DIETPI_VERSION_SUB < 22 ) )) +then + # Block and enforce downgrade of Armbian's base-files package to Debian's: https://github.com/MichaIng/DietPi/issues/6227#issuecomment-1713688577 + [[ -f '/etc/apt/sources.list.d/armbian.list' ]] && G_EXEC mv /etc/apt/sources.list.d/{,dietpi-}armbian.list + 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 +Package: * +Pin: origin apt.armbian.com +Pin-Priority: -1 + +Package: armbian-firmware* linux-* +Pin: origin apt.armbian.com +Pin-Priority: 500 +_EOF_ + fi + 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 +fi + exit 0 } diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d05edc0553..6fcc3d5f5d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -13,6 +13,7 @@ Enhancements: Bug fixes: - NanoPi R4S | Resolved a v8.20 regression where the Ethernet LEDs did not react correctly after the kernel upgrade. Many thanks to @idaanx for reporting this issue: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 +- dietpi-bookworm-upgrade | Resolved an issue on systems with Armbian repository, where the system was still identified as Bullseye after the distribution upgrade to Bookworm. Reason was Armbian's base-files package, which was not upgraded as intended. On all DietPi systems, the original base-files package from Debian will now be enforced to prevent this and similar issues. Many thanks to @rogerthn2019 for reporting this issue: https://github.com/MichaIng/DietPi/issues/6227#issuecomment-1713688577 - DietPi-Config | The menu option to update the SPI bootloader is now shown on Orange Pi 5 Plus as well, as intended. Many thanks for @zappydood for reporting its absence: https://github.com/MichaIng/DietPi/issues/6501#issuecomment-1697175109 - DietPi-Software | Ampache: Resolved an issue where the latest version was not successfully detected on install, so that an older fallback version was installed instead. Many thanks to @bartolus39 for reporting this issue: https://github.com/MichaIng/DietPi/issues/6598 From a2d8018af0d52c45d182d36288e8c6997bb94b70 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 Sep 2023 23:49:51 +0200 Subject: [PATCH 35/36] v8.22 - 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 3584ab528c..ee1494577d 100644 --- a/.update/version +++ b/.update/version @@ -3,7 +3,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=8 G_REMOTE_VERSION_SUB=22 -G_REMOTE_VERSION_RC=-1 +G_REMOTE_VERSION_RC=0 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=14 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index ee41286297..d90ec52a45 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -59,7 +59,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=8 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=22 - [[ $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 6272c21cb2442ec3a72678432421b65b4fc17e5c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 17 Sep 2023 23:51:09 +0200 Subject: [PATCH 36/36] v8.22 - DietPi-Imager | Restore execute permissions of script --- .build/images/dietpi-imager | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .build/images/dietpi-imager diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager old mode 100644 new mode 100755