From 3e8885c6d65da7ba360f27933b0df1d3efdf0988 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 20 Dec 2023 23:40:31 +0100 Subject: [PATCH 01/77] v9.0 - DietPi-Build/Installer | Add support for the 1.5 GB variant of the Orange Pi Zero 3, which requires a different bootloader build --- .build/images/dietpi-build | 3 ++- .build/images/dietpi-installer | 7 +++++-- CHANGELOG.txt | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 5de5354459..83409d6bc6 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -127,7 +127,8 @@ case $HW_MODEL in 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; 81) iname='VisionFive2' HW_ARCH=11 root_size=639;; 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; - 83) iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=752;; + '83.1') iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=752;; + '83.2') iname='OrangePiZero3-1.5G' HW_ARCH=3 partition_start=4 root_size=752;; 84) iname='Star64' HW_ARCH=11 root_size=639;; 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=752;; diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 7007969c45..aa0bba3670 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -391,7 +391,8 @@ _EOF_ '87' ': Orange Pi 3B' '80' ': Orange Pi 5' '82' ': Orange Pi 5 Plus' - '83' ': Orange Pi Zero 3' + '83.1' ': Orange Pi Zero 3' + '83.2' ': Orange Pi Zero 3 (1.5 GB RAM)' '86' ': ASUS Tinker Board 2' '23' ': Generic Rockchip RK3328' '24' ': Generic Rockchip RK3399' @@ -1283,7 +1284,9 @@ _EOF_ # Install kernel and U-Boot packages G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb 'https://dietpi.com/downloads/binaries/linux-image-next-sun50iw9.deb' G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb 'https://dietpi.com/downloads/binaries/linux-dtb-next-sun50iw9.deb' - G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb 'https://dietpi.com/downloads/binaries/linux-u-boot-orangepizero3-next.deb' + local variant= + (( $HW_VARIANT == 2 )) && variant='_1.5G' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb "https://dietpi.com/downloads/binaries/linux-u-boot-orangepizero3-next$variant.deb" G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb package3.deb G_EXEC rm package1.deb package2.deb package3.deb diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e5e7c744ad..e2202be841 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,17 @@ +v9.0 +(2024-01-13) + +New images: +- Orange Pi Zero 3 | New images for the 1.5 GB RAM variant are now available for testing, before they are added to our download page soon: https://dietpi.com/downloads/binaries/testing/ + +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/ADDME + +----------------------------------------------------------------------------------------------------------- + v8.25 (2023-12-16) From ac58db96db6317d5677dfaeb0382db4c0b8de865 Mon Sep 17 00:00:00 2001 From: StephanStS Date: Thu, 21 Dec 2023 00:12:45 +0100 Subject: [PATCH 02/77] Init v9.0 (#6813) --- .meta/dietpi-survey_report | 4 +++- .update/patches | 5 +++++ .update/version | 6 +++--- dietpi/func/dietpi-globals | 6 +++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 2914d430b6..2a97ee0e89 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -700,15 +700,17 @@ shopt -s extglob aSOFTWARE_NAME8_23=() aSOFTWARE_NAME8_24=() aSOFTWARE_NAME8_25=() + aSOFTWARE_NAME9_0=() for i in "${!aSOFTWARE_NAME8_22[@]}" do aSOFTWARE_NAME8_23[i]=${aSOFTWARE_NAME8_22[i]} aSOFTWARE_NAME8_24[i]=${aSOFTWARE_NAME8_23[i]} aSOFTWARE_NAME8_25[i]=${aSOFTWARE_NAME8_24[i]} + aSOFTWARE_NAME9_0[i]=${aSOFTWARE_NAME8_25[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_25[@]}" + for i in "${aSOFTWARE_NAME9_0[@]}" do aSOFTWARE[$i]=0 done diff --git a/.update/patches b/.update/patches index c72b669d0c..13885d8373 100755 --- a/.update/patches +++ b/.update/patches @@ -1572,6 +1572,11 @@ Release notes: https://github.com/BlitterStudio/amiberry/releases fi } +Patch_9_0() +{ + G_DIETPI-NOTIFY 0 'DEBUG: DietPi v9.0 patches are applied :D' +} + # 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 9031ea8398..d8f1436cfc 100644 --- a/.update/version +++ b/.update/version @@ -1,9 +1,9 @@ #!/bin/bash # shellcheck disable=SC2034 # Available DietPi version -G_REMOTE_VERSION_CORE=8 -G_REMOTE_VERSION_SUB=25 -G_REMOTE_VERSION_RC=1 +G_REMOTE_VERSION_CORE=9 +G_REMOTE_VERSION_SUB=0 +G_REMOTE_VERSION_RC=-1 # 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 19803b1d6a..bf66fcedfe 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -53,9 +53,9 @@ # shellcheck disable=SC1091 [[ -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=25 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 + [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=9 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 + [[ $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 61bf7170cca51809e65b4117463d0f16e008a154 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 21 Dec 2023 00:18:25 +0100 Subject: [PATCH 03/77] v9.0 - DietPi-Software | Komga: 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 2e66508688..8ca0fe3040 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7569,7 +7569,7 @@ _EOF_ then Download_Install 'https://github.com/gotson/komga/releases/download/v0.165.0/komga-0.165.0.jar' /mnt/dietpi_userdata/komga/komga.jar else - local fallback_url='https://github.com/gotson/komga/releases/download/1.9.0/komga-1.9.0.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/1.9.2/komga-1.9.2.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 From 55a996cc497760e2d9e68f081a07bd9ea2da2ac7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 21 Dec 2023 17:25:55 +0100 Subject: [PATCH 04/77] v9.0 - DietPi-Software | Update fallback URL --- dietpi/dietpi-software | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 8ca0fe3040..484ea60dfb 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6648,7 +6648,7 @@ _EOF_ esac # Download - local fallback_url="https://github.com/fatedier/frp/releases/download/v0.53.0/frp_0.53.0_linux_$arch.tar.gz" + local fallback_url="https://github.com/fatedier/frp/releases/download/v0.53.2/frp_0.53.2_linux_$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/fatedier/frp/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/frp_[0-9.]*_linux_$arch\.tar\.gz\"/{print \$4}")" G_EXEC cd frp_* @@ -10787,7 +10787,7 @@ _EOF_ *) local arch='arm-6';; esac - local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.2/gitea-1.21.2-linux-$arch.xz" + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.3/gitea-1.21.3-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 512ce1e02a886dd38492421d6b7ab6de5d9f089c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 21 Dec 2023 20:25:31 +0100 Subject: [PATCH 05/77] v9.0 - dietpi-bookworm-upgrade | Remove obsolete WSDD repo --- .meta/dietpi-bookworm-upgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.meta/dietpi-bookworm-upgrade b/.meta/dietpi-bookworm-upgrade index ac630cc000..4262330e81 100755 --- a/.meta/dietpi-bookworm-upgrade +++ b/.meta/dietpi-bookworm-upgrade @@ -57,6 +57,9 @@ unset -v apackages G_DIETPI-NOTIFY 2 'Migrating package lists to Bookworm suite' G_EXEC sed --follow-symlinks -i 's/bullseye/bookworm/g' /etc/apt/sources.list (( $G_RASPBIAN )) || G_EXEC sed --follow-symlinks -i 's/ non-free$/ non-free non-free-firmware/' /etc/apt/sources.list +# Remove obsolete WSDD repo +[[ -f '/etc/apt/sources.list.d/dietpi-wsdd.list' ]] && G_EXEC rm /etc/apt/sources.list.d/dietpi-wsdd.list +[[ -f '/etc/apt/trusted.gpg.d/dietpi-wsdd.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-wsdd.gpg [[ $(find /etc/apt/sources.list.d/*.list 2> /dev/null) ]] && G_EXEC sed --follow-symlinks -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list [[ -f '/etc/apt/sources.list.d/dietpi-mympd.list' ]] && G_EXEC sed --follow-symlinks -i 's/Debian_11/Debian_12/' /etc/apt/sources.list.d/dietpi-mympd.list From bef0a6ec420be88f2ced660c30dd84181244f74c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 21 Dec 2023 22:08:34 +0100 Subject: [PATCH 06/77] v9.0 - dietpi-rpi-firmware-migration | Remove the dietpi-backup offer, since this backup cannot be restored (without manual pre/post steps) due to new partitioning --- .meta/dietpi-rpi-firmware-migration | 3 --- 1 file changed, 3 deletions(-) diff --git a/.meta/dietpi-rpi-firmware-migration b/.meta/dietpi-rpi-firmware-migration index 78e91ddf85..ae03c8723e 100644 --- a/.meta/dietpi-rpi-firmware-migration +++ b/.meta/dietpi-rpi-firmware-migration @@ -12,9 +12,6 @@ G_CHECK_FREESPACE / 200 G_INIT # Import DietPi-Globals --------------------------------------------------------------- -# Offer a backup before doing any changes to the system -G_PROMPT_BACKUP - G_DIETPI-NOTIFY 2 'Updating DietPi to latest version' /boot/dietpi/dietpi-update 1 From 628c3ebc4a624e1544f2dd24923d5edd9204678a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Dec 2023 16:33:39 +0100 Subject: [PATCH 07/77] v9.0 - DietPi-Software | Ampache: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 484ea60dfb..f1f6f6fbe9 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7667,7 +7667,7 @@ _EOF_ # Bullseye and above if (( $G_DISTRO > 5 )) then - local fallback_url="https://github.com/ampache/ampache/releases/download/6.1.0/ampache-6.1.0_all_php$PHP_VERSION.zip" + local fallback_url="https://github.com/ampache/ampache/releases/download/6.2.0/ampache-6.2.0_all_php$PHP_VERSION.zip" Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/ampache-[0-9\.]*_all_php$PHP_VERSION.zip\"$/{print \$4}")" ampache # 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 f52d625d820e82826a0ecb1575721a8b86dd8324 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 22 Dec 2023 22:28:55 +0100 Subject: [PATCH 08/77] v9.0 - Raspberry Pi 5 | Add onboard WiFi flag --- dietpi/func/dietpi-obtain_hw_model | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index 30e7248fec..fe66954212 100755 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -169,7 +169,7 @@ 13) G_HW_MODEL_NAME='RPi 400' G_HW_MODEL=4 G_HW_ONBOARD_WIFI=1;; 14) G_HW_MODEL_NAME='RPi CM 4' G_HW_MODEL=4;; 15) G_HW_MODEL_NAME='RPi CM 4S' G_HW_MODEL=4;; - 17) G_HW_MODEL_NAME='RPi 5 Model B' G_HW_MODEL=5;; + 17) G_HW_MODEL_NAME='RPi 5 Model B' G_HW_MODEL=5 G_HW_ONBOARD_WIFI=1;; esac # Manufacturer # shellcheck disable=SC2249 From 77ca83fd8cd7a028a760e3d26f68dac8bbd94f2d Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:48:31 +0100 Subject: [PATCH 09/77] v9.0 (#6821) - DietPi-Config | keep a full stress test log instead of last line only --- dietpi/dietpi-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index b788d8100a..1bd445f21a 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -3686,7 +3686,7 @@ Additional benchmarks: fi log_text+=" | $(( $STRESS_TEST_DURATION + $start_time_epoch - $(date '+%s') )) seconds remaining" echo "$log_text" - echo "$log_text" > "$fp_log" + echo "$log_text" >> "$fp_log" G_SLEEP 1 done From 832c5840cc0c6ec72c260cd38e8deb9d496fcc59 Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Wed, 27 Dec 2023 16:45:31 +0100 Subject: [PATCH 10/77] v9.0 (#6818) - DietPi-Set_Hardware | Revert a change done to block rpi-eeprom package on first initial boot. This step is not needed anymore. --- dietpi/func/dietpi-set_hardware | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 9fed96642f..2b67f91f01 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -224,18 +224,7 @@ _EOF_ (( $G_HW_MODEL == 4 )) || { Unsupported_Input_Name; return 1; } # Exit path for non-RPi4 # Install required APT package - if (( $G_DISTRO > 6 )) - then - if ! dpkg-query -s rpi-eeprom &> /dev/null - then - G_EXEC_OUTPUT=1 G_EXEC curl -fO 'https://dietpi.com/downloads/binaries/rpi/rpi-eeprom.deb' - G_AGI ./rpi-eeprom.deb - G_EXEC rm rpi-eeprom.deb - G_EXEC apt-mark hold rpi-eeprom - fi - else - G_AG_CHECK_INSTALL_PREREQ rpi-eeprom - fi + G_AG_CHECK_INSTALL_PREREQ rpi-eeprom # Update/flash new bootloader and VL805 USB firmware to EEPROM rpi-eeprom-update -a From fffafd63d62b1d8a55cbce40352975913751367b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 30 Dec 2023 23:37:43 +0100 Subject: [PATCH 11/77] v9.0 (#6830) - DietPi-Software | motionEye: Update dependencies and switch to pre-release from PyPI --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e2202be841..fe4626acd0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ New images: - Orange Pi Zero 3 | New images for the 1.5 GB RAM variant are now available for testing, before they are added to our download page soon: https://dietpi.com/downloads/binaries/testing/ Enhancements: +- DietPi-Software | motionEye: Updated build dependencies for ARM and RISC-V, and switched to the recent pre-release from PyPI, instead of pulling from the repositories dev branch. Bug fixes: diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f1f6f6fbe9..60a4195753 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9274,10 +9274,10 @@ _EOF_ if To_Install 136 motioneye # motionEye then # APT deps - # - ARMv6/7 Bullseye/Bookworm + RISC-V: libjpeg62-turbo-dev and gcc for Pillow - if (( ( $G_HW_ARCH < 3 && $G_DISTRO > 5 ) || $G_HW_ARCH == 11 )) + # - RISC-V: libcurl4-openssl-dev, gcc and libssl-dev for pycurl, libjpeg62-turbo-dev for Pillow + if (( $G_HW_ARCH == 11 )) then - G_AGI libjpeg62-turbo-dev gcc + G_AGI libcurl4-openssl-dev gcc libssl-dev libjpeg62-turbo-dev # - ARMv8/x86_64: libcurl4-openssl-dev, gcc and libssl-dev for pycurl elif (( $G_HW_ARCH > 2 )) @@ -9289,7 +9289,7 @@ _EOF_ (( $G_HW_MODEL > 9 )) || /boot/dietpi/func/dietpi-set_hardware rpi-camera enable # motionEye - G_EXEC_OUTPUT=1 G_EXEC pip3 install -U 'https://github.com/motioneye-project/motioneye/archive/dev.tar.gz' + G_EXEC_OUTPUT=1 G_EXEC pip3 install -U --pre motioneye G_EXEC_OUTPUT=1 G_EXEC motioneye_init --skip-apt-update G_EXEC systemctl stop motioneye G_EXEC systemctl --no-reload disable --now motion # motionEye starts motion directly. From afa3f17535855abc22baf31e410a6426561860d2 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Dec 2023 15:46:25 +0100 Subject: [PATCH 12/77] v9.0 - DietPi-Build | Raise the image size for most 64-bit SBCs. Some unrelated package must have had its size significantly raised for all of them to suddenly run into space issues on build. --- .build/images/dietpi-build | 68 +++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 83409d6bc6..87fd9b85a6 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -79,59 +79,59 @@ case $HW_MODEL in 0) iname='RPi' HW_ARCH=${HW_ARCH:-1} boot_size=128 root_size=895;; 10) iname='OdroidC1' HW_ARCH=2 partition_start=4 boot_size=128 root_size=700 boot_fstype='fat16';; 11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=764;; - 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=764;; - 15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=764;; - 16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=764;; + 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=828;; + 15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=828;; + 16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=828;; 20) iname='VM' HW_ARCH=${HW_ARCH:-10} VMTYPE=${VMTYPE:-raw};; 21) iname='NativePC-BIOS' HW_ARCH=10 root_size=1215;; - 40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=764;; - 42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=752;; - 43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=752;; - 44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=764;; - 45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=764;; - 46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=752;; - 47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=752;; + 40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=828;; + 42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=816;; + 43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=816;; + 44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=828;; + 45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=828;; + 46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=816;; + 47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=816;; 48) iname='NanoPiR1' HW_ARCH=2 partition_start=4 root_size=764;; '49.1') iname='Quartz64A' HW_ARCH=3 partition_start=16 root_size=752;; '49.2') iname='Quartz64B' HW_ARCH=3 partition_start=16 root_size=752;; '49.3') iname='SOQuartz' HW_ARCH=3 partition_start=16 root_size=752;; 52) iname='ASUSTB' HW_ARCH=2 partition_start=4 root_size=764;; - 54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=764;; - 55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=752;; - 56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=752;; - 57) iname='NanoPiNEOPlus2' HW_ARCH=3 partition_start=4 root_size=764;; - 58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=752;; + 54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=828;; + 55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=816;; + 56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=816;; + 57) iname='NanoPiNEOPlus2' HW_ARCH=3 partition_start=4 root_size=828;; + 58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=816;; 59) iname='ZeroPi' HW_ARCH=2 partition_start=4 root_size=764;; 60) iname='NanoPiNEO' HW_ARCH=2 partition_start=4 root_size=764;; 61) iname='NanoPiM2' HW_ARCH=2 partition_start=4 boot_size=64 root_size=572 boot_fstype='ext4';; - '62.1') iname='NanoPiM3' HW_ARCH=3 partition_start=4 root_size=572;; - '62.2') iname='NanoPiFire3' HW_ARCH=3 partition_start=4 root_size=572;; + '62.1') iname='NanoPiM3' HW_ARCH=3 partition_start=4 root_size=636;; + '62.2') iname='NanoPiFire3' HW_ARCH=3 partition_start=4 root_size=636;; 63) iname='NanoPiM1' HW_ARCH=2 partition_start=4 root_size=764;; 64) iname='NanoPiNEOAir' HW_ARCH=2 partition_start=4 root_size=764;; - '65.1') iname='NanoPiNEO2' HW_ARCH=3 partition_start=4 root_size=764;; - '65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=764;; + '65.1') iname='NanoPiNEO2' HW_ARCH=3 partition_start=4 root_size=828;; + '65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=828;; 66) iname='NanoPiM1Plus' HW_ARCH=2 partition_start=4 root_size=764;; - 67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=764;; - '68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=752;; - '68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=752;; - '68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=752;; + 67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=828;; + '68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=816;; + '68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=816;; + '68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=816;; 70) iname='SparkySBC' HW_ARCH=2 partition_start=8 boot_size=48 root_size=712 boot_fstype='fat16';; - 72) iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=752;; - 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=752;; - 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=764;; + 72) iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=816;; + 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=816;; + 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=828;; 75) iname='Container' HW_ARCH=${HW_ARCH:-10} root_size=447;; 76) iname='NanoPiR5S' HW_ARCH=3 root_size=752;; # Special case: Skips image file, partitioning and filesystem generation, but runs debootstrap only! - 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; - 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; + 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; + 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; 79) iname='NanoPi6' HW_ARCH=3 root_size=752;; # Special case: Skips image file, partitioning and filesystem generation, but runs debootstrap only! - 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; + 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; 81) iname='VisionFive2' HW_ARCH=11 root_size=639;; - 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; - '83.1') iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=752;; - '83.2') iname='OrangePiZero3-1.5G' HW_ARCH=3 partition_start=4 root_size=752;; + 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; + '83.1') iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=828;; + '83.2') iname='OrangePiZero3-1.5G' HW_ARCH=3 partition_start=4 root_size=828;; 84) iname='Star64' HW_ARCH=11 root_size=639;; - 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; - 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=752;; + 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; + 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=816;; 87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; *) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed, aborting..."; exit 1;; esac From 6067fd9f56f133f9690b2b9f9abdba209ccbfb65 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Dec 2023 15:54:34 +0100 Subject: [PATCH 13/77] v9.0 - DietPi-Software | Update fallback URLs --- dietpi/dietpi-software | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 60a4195753..1f1f8cf6d6 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7179,7 +7179,7 @@ _EOF_ aDEPS=() else local version=$(curl -sSfL 'https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}') - [[ $version ]] || { version='1.22.1'; G_DIETPI-NOTIFY 1 "Automatic latest FreshRSS 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='1.23.1'; G_DIETPI-NOTIFY 1 "Automatic latest FreshRSS 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/FreshRSS/FreshRSS/archive/$version.tar.gz" G_EXEC mv "FreshRSS-$version" /opt/FreshRSS fi @@ -9580,7 +9580,7 @@ _EOF_ if (( ${PHP_VERSION::1} > 7 )) then aDEPS+=("php$PHP_VERSION-curl") - local fallback_url='https://github.com/koel/koel/releases/download/v6.11.2/koel-v6.11.2.tar.gz' aphp_deps=('curl' 'dom') + local fallback_url='https://github.com/koel/koel/releases/download/v6.11.5/koel-v6.11.5.tar.gz' aphp_deps=('curl' 'dom') Download_Install "$(curl -sSfL 'https://api.github.com/repos/koel/koel/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/koel-[^"\/]*\.tar\.gz"$/{print $4}')" else aDEPS+=("php$PHP_VERSION-json") @@ -9768,7 +9768,7 @@ _EOF_ esac url=$(curl -sSfL 'https://api.github.com/repos/Radarr/Radarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}") - local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.1.3.8246/Radarr.master.5.1.3.8246.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.2.6.8376/Radarr.master.5.2.6.8376.linux-core-$arch.tar.gz" fi Download_Install "$url" @@ -10212,7 +10212,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.10.5.4116/Prowlarr.master.1.10.5.4116.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.11.4.4173/Prowlarr.master.1.11.4.4173.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 @@ -10287,7 +10287,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.12.2327/Readarr.develop.0.3.12.2327.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.14.2348/Readarr.develop.0.3.14.2348.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 @@ -11328,7 +11328,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.3.0/tasmoadmin_v3.3.0.tar.gz' + local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.3.1/tasmoadmin_v3.3.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 2bcea25a3e3506487d881d098b492e09f4d9517e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 31 Dec 2023 21:56:49 +0100 Subject: [PATCH 14/77] v9.0 - DietPi-Build | Further increase ARMv8 image sizes --- .build/images/dietpi-build | 68 +++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 87fd9b85a6..886239bec5 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -79,59 +79,59 @@ case $HW_MODEL in 0) iname='RPi' HW_ARCH=${HW_ARCH:-1} boot_size=128 root_size=895;; 10) iname='OdroidC1' HW_ARCH=2 partition_start=4 boot_size=128 root_size=700 boot_fstype='fat16';; 11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=764;; - 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=828;; - 15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=828;; - 16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=828;; + 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=892;; + 15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=892;; + 16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=892;; 20) iname='VM' HW_ARCH=${HW_ARCH:-10} VMTYPE=${VMTYPE:-raw};; 21) iname='NativePC-BIOS' HW_ARCH=10 root_size=1215;; - 40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=828;; - 42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=816;; - 43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=816;; - 44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=828;; - 45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=828;; - 46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=816;; - 47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=816;; + 40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=892;; + 42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=880;; + 43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=880;; + 44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=892;; + 45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=892;; + 46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=880;; + 47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=880;; 48) iname='NanoPiR1' HW_ARCH=2 partition_start=4 root_size=764;; '49.1') iname='Quartz64A' HW_ARCH=3 partition_start=16 root_size=752;; '49.2') iname='Quartz64B' HW_ARCH=3 partition_start=16 root_size=752;; '49.3') iname='SOQuartz' HW_ARCH=3 partition_start=16 root_size=752;; 52) iname='ASUSTB' HW_ARCH=2 partition_start=4 root_size=764;; - 54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=828;; - 55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=816;; - 56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=816;; - 57) iname='NanoPiNEOPlus2' HW_ARCH=3 partition_start=4 root_size=828;; - 58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=816;; + 54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=892;; + 55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=880;; + 56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=880;; + 57) iname='NanoPiNEOPlus2' HW_ARCH=3 partition_start=4 root_size=892;; + 58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=880;; 59) iname='ZeroPi' HW_ARCH=2 partition_start=4 root_size=764;; 60) iname='NanoPiNEO' HW_ARCH=2 partition_start=4 root_size=764;; 61) iname='NanoPiM2' HW_ARCH=2 partition_start=4 boot_size=64 root_size=572 boot_fstype='ext4';; - '62.1') iname='NanoPiM3' HW_ARCH=3 partition_start=4 root_size=636;; - '62.2') iname='NanoPiFire3' HW_ARCH=3 partition_start=4 root_size=636;; + '62.1') iname='NanoPiM3' HW_ARCH=3 partition_start=4 root_size=700;; + '62.2') iname='NanoPiFire3' HW_ARCH=3 partition_start=4 root_size=700;; 63) iname='NanoPiM1' HW_ARCH=2 partition_start=4 root_size=764;; 64) iname='NanoPiNEOAir' HW_ARCH=2 partition_start=4 root_size=764;; - '65.1') iname='NanoPiNEO2' HW_ARCH=3 partition_start=4 root_size=828;; - '65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=828;; + '65.1') iname='NanoPiNEO2' HW_ARCH=3 partition_start=4 root_size=892;; + '65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=892;; 66) iname='NanoPiM1Plus' HW_ARCH=2 partition_start=4 root_size=764;; - 67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=828;; - '68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=816;; - '68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=816;; - '68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=816;; + 67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=892;; + '68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=880;; + '68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=880;; + '68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=880;; 70) iname='SparkySBC' HW_ARCH=2 partition_start=8 boot_size=48 root_size=712 boot_fstype='fat16';; - 72) iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=816;; - 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=816;; - 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=828;; + 72) iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=880;; + 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=880;; + 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=892;; 75) iname='Container' HW_ARCH=${HW_ARCH:-10} root_size=447;; 76) iname='NanoPiR5S' HW_ARCH=3 root_size=752;; # Special case: Skips image file, partitioning and filesystem generation, but runs debootstrap only! - 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; - 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; + 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; + 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; 79) iname='NanoPi6' HW_ARCH=3 root_size=752;; # Special case: Skips image file, partitioning and filesystem generation, but runs debootstrap only! - 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; + 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; 81) iname='VisionFive2' HW_ARCH=11 root_size=639;; - 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; - '83.1') iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=828;; - '83.2') iname='OrangePiZero3-1.5G' HW_ARCH=3 partition_start=4 root_size=828;; + 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; + '83.1') iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=892;; + '83.2') iname='OrangePiZero3-1.5G' HW_ARCH=3 partition_start=4 root_size=892;; 84) iname='Star64' HW_ARCH=11 root_size=639;; - 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=816;; - 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=816;; + 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; + 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=880;; 87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; *) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed, aborting..."; exit 1;; esac From 6f04268fe47d10ad93064067c4b08d5d3b8c9c0b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Tue, 2 Jan 2024 00:56:04 +0100 Subject: [PATCH 15/77] v9.0 - DietPi-Build | Update for Orange Pi Zero 3 variant builds --- .github/workflows/dietpi-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index 1a87afbe73..9e1894e35c 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -82,7 +82,8 @@ jobs: '"-m 80 -d 6", "-m 80 -d 7", "-m 80 -d 8", '\ '"-m 81 -d 8", '\ '"-m 82 -d 6", "-m 82 -d 7", "-m 82 -d 8", '\ - '"-m 83 -d 6", "-m 83 -d 7", "-m 83 -d 8", '\ + '"-m 83.1 -d 6", "-m 83.1 -d 7", "-m 83.1 -d 8", '\ + '"-m 83.2 -d 6", "-m 83.2 -d 7", "-m 83.2 -d 8", '\ '"-m 84 -d 8", '\ '"-m 85 -d 6", "-m 85 -d 7", "-m 85 -d 8", '\ '"-m 86 -d 6", "-m 86 -d 7", "-m 86 -d 8", '\ From fd97a91cfa458dbf479348a936064a86d2fe6f7c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Jan 2024 20:38:58 +0100 Subject: [PATCH 16/77] v9.0 - dietpi-rpi-firmware-migration | Allow to gracefully rerun script in case it errored out at some point or to apply further new migration steps - dietpi-rpi-firmware-migration | Add migration for libraspberrypi => raspi-utils: The legacy GPU libraries and related tools have been removed from RPi OS and the still relevant vcgencmd merged into raspi-utils. - dietpi-rpi-firmware-migration | Add automatic upgrade to latest DietPi dev branch - dietpi-rpi-firmware-migration | Do not install 64-bit headers on 32-bit OS. This was/is possible, but those headers were never functional, as it would required a cross-compiler. --- .meta/dietpi-rpi-firmware-migration | 35 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.meta/dietpi-rpi-firmware-migration b/.meta/dietpi-rpi-firmware-migration index ae03c8723e..4aff33c96d 100644 --- a/.meta/dietpi-rpi-firmware-migration +++ b/.meta/dietpi-rpi-firmware-migration @@ -3,41 +3,46 @@ # Import DietPi-Globals --------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals readonly G_PROGRAM_NAME='dietpi-rpi-firmware-migration' -(( $G_HW_MODEL > 9 )) && { G_DIETPI-NOTIFY 1 'You can run this script on RPi systems or Trixie only!'; exit 1; } -[[ $G_DISTRO == [78] ]] || { G_DIETPI-NOTIFY 1 'You can run this script on Debian Bookworm or Trixie systems only!'; exit 1; } +(( $G_HW_MODEL > 9 )) && { G_DIETPI-NOTIFY 1 'You can run this script on RPi systems only!'; exit 1; } +(( $G_DISTRO > 6 )) || { G_DIETPI-NOTIFY 1 'You can run this script on Debian Bookworm or Trixie systems only!'; exit 1; } G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_CHECK_FREESPACE / 200 -(( $(findmnt -nbo SIZE /boot) > 128000000 )) || { G_DIETPI-NOTIFY 1 'You can run this script on a system with at least 128 MiB boot partition only!'; exit 1; } +(( $(findmnt -nbo SIZE -T /boot/firmware) > 128000000 )) || { G_DIETPI-NOTIFY 1 'You can run this script on a system with at least 128 MiB boot partition only!'; exit 1; } G_INIT # Import DietPi-Globals --------------------------------------------------------------- -G_DIETPI-NOTIFY 2 'Updating DietPi to latest version' -/boot/dietpi/dietpi-update 1 +G_DIETPI-NOTIFY 2 'Updating DietPi to latest required dev branch version' +G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=dev' /boot/dietpi.txt +if (( $G_DIETPI_VERSION_CORE < 9 )) +then + /boot/dietpi/dietpi-update 1 +else + /boot/dietpi/dietpi-update -1 +fi # Temporary rootfs mount G_EXEC mkdir -p rootfs G_EXEC mount "$G_ROOTFS_DEV" rootfs # Copy DietPi files from bootfs to rootfs -G_EXEC cp -a /boot/dietpi* rootfs/boot/ +G_EXEC cp -an /boot/dietpi* rootfs/boot/ G_EXEC chmod -x rootfs/boot/dietpi{.txt,/.??*,/func/dietpi-globals} # Remount bootfs to /boot/firmware G_EXEC mkdir -p rootfs/boot/firmware G_EXEC sed -i 's|[[:blank:]]/boot[[:blank:]]| /boot/firmware |' /etc/fstab G_EXEC systemctl daemon-reload -G_EXEC umount /boot -G_EXEC mount /boot/firmware +findmnt -M /boot &> /dev/null && G_EXEC umount /boot +findmnt -M /boot/firmware &> /dev/null || G_EXEC mount /boot/firmware G_EXEC umount rootfs # Generate config symlinks -G_EXEC ln -s firmware/cmdline.txt /boot/cmdline.txt -G_EXEC ln -s firmware/config.txt /boot/config.txt +G_EXEC ln -sf firmware/cmdline.txt /boot/cmdline.txt +G_EXEC ln -sf firmware/config.txt /boot/config.txt # Install new firmware packages apackages=('linux-image-rpi-v8') -dpkg-query -s 'raspberrypi-kernel-headers' &> /dev/null && apackages+=('linux-headers-rpi-v8') if [[ $(dpkg --print-architecture) == 'armhf' ]] then apackages+=('linux-image-rpi-v6' 'linux-image-rpi-v7' 'linux-image-rpi-v7l') @@ -46,16 +51,16 @@ then G_EXEC dpkg --add-architecture arm64 else apackages+=('linux-image-rpi-2712') - dpkg-query -s 'raspberrypi-kernel-headers' &> /dev/null && apackages+=('linux-headers-rpi-2712') + dpkg-query -s 'raspberrypi-kernel-headers' &> /dev/null && apackages+=('linux-headers-rpi-v8' 'linux-headers-rpi-2712') fi G_AGUP -G_AGI "${apackages[@]}" raspi-firmware +G_AGI "${apackages[@]}" raspi-firmware raspi-utils # Remove old firmware packages -G_AGP raspberrypi-kernel raspberrypi-headers-kernel raspberrypi-bootloader +G_AGP raspberrypi-kernel raspberrypi-headers-kernel raspberrypi-bootloader libraspberrypi-bin libraspberrypi0 # Remove obsolete files G_EXEC rm -Rf /boot/firmware/{dietpi*,COPYING.linux} G_WHIP_YESNO 'All finished!\n\nWe highly recommend to reboot, shall we reboot now?' && reboot -} \ No newline at end of file +} From 0caeb8024af76d80d945460c8a85fa201d63d3b7 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Jan 2024 20:49:40 +0100 Subject: [PATCH 17/77] v9.0 - DietPi-Software | Update fallback URLs --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1f1f8cf6d6..f56611ae92 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -9150,7 +9150,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.1/syncthing-linux-$arch-v1.27.1.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.2/syncthing-linux-$arch-v1.27.2.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 @@ -9580,7 +9580,7 @@ _EOF_ if (( ${PHP_VERSION::1} > 7 )) then aDEPS+=("php$PHP_VERSION-curl") - local fallback_url='https://github.com/koel/koel/releases/download/v6.11.5/koel-v6.11.5.tar.gz' aphp_deps=('curl' 'dom') + local fallback_url='https://github.com/koel/koel/releases/download/v6.12.0/koel-v6.12.0.tar.gz' aphp_deps=('curl' 'dom') Download_Install "$(curl -sSfL 'https://api.github.com/repos/koel/koel/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/koel-[^"\/]*\.tar\.gz"$/{print $4}')" else aDEPS+=("php$PHP_VERSION-json") @@ -11910,7 +11910,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.26.0/linux-$arch-filebrowser.tar.gz" + local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.27.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 From a6cddbeaa66e280b767ad82eeb0ad01d5bbaebc9 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 4 Jan 2024 21:42:35 +0100 Subject: [PATCH 18/77] v9.0 - Raspberry Pi | Migrate from raspberrypi.org to raspberrypi.com --- .build/images/dietpi-build | 2 +- .build/images/dietpi-installer | 2 +- .github/workflows/dietpi-software.bash | 4 ++-- .update/patches | 2 +- .update/pre-patches | 14 +++++++++++++- dietpi.txt | 2 +- dietpi/dietpi-software | 12 ++++++------ dietpi/func/dietpi-set_software | 6 +++--- 8 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 886239bec5..742e07e90b 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -148,7 +148,7 @@ fi repo='https://deb.debian.org/debian/' keyring='/usr/share/keyrings/debian-archive-keyring.gpg' case $HW_ARCH in - 1) iarch='ARMv6' parch='armhf' repo='http://raspbian.raspberrypi.org/raspbian/' keyring='/usr/share/keyrings/raspbian-archive-keyring.gpg';; + 1) iarch='ARMv6' parch='armhf' repo='http://raspbian.raspberrypi.com/raspbian/' keyring='/usr/share/keyrings/raspbian-archive-keyring.gpg';; 2) iarch='ARMv7' parch='armhf';; 3) iarch='ARMv8' parch='arm64';; 10) iarch='x86_64' parch='amd64';; diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index aa0bba3670..37fe4b7588 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -792,7 +792,7 @@ setenv rootuuid "true"' /boot/boot.cmd # Bootstrap RPi repo if key is missing if [[ ! $(apt-key list 'CF8A1AF502A2AA2D763BAE7E82B129927FA3303E' 2> /dev/null) ]] then - G_EXEC curl -sSf 'https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' -o keyring.deb + G_EXEC curl -sSf 'https://archive.raspberrypi.com/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' -o keyring.deb G_EXEC dpkg -i keyring.deb G_EXEC rm keyring.deb fi diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 8b4c6f43aa..cac4255f8c 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -299,13 +299,13 @@ then G_EXEC rm rootfs/etc/.dietpi_hw_model_identifier G_EXEC touch rootfs/boot/{bcm-rpi-dummy.dtb,config.txt,cmdline.txt} G_EXEC sed --follow-symlinks -i "/# Start DietPi-Software/iG_EXEC sed -i -e '/^G_HW_MODEL=/cG_HW_MODEL=$model' -e '/^G_HW_MODEL_NAME=/cG_HW_MODEL_NAME=\"RPi $model ($ARCH)\"' /boot/dietpi/.hw_model" rootfs/boot/dietpi/dietpi-login - G_EXEC curl -sSfo keyring.deb 'https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' + G_EXEC curl -sSfo keyring.deb 'https://archive.raspberrypi.com/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' G_EXEC dpkg --root=rootfs -i keyring.deb G_EXEC rm keyring.deb # Enforce Debian Trixie FFmpeg packages over RPi repo ones [[ $DISTRO != 'trixie' ]] || cat << '_EOF_' > rootfs/etc/apt/preferences.d/dietpi-ffmpeg || exit 1 Package: src:ffmpeg -Pin: origin archive.raspberrypi.org +Pin: origin archive.raspberrypi.com Pin-Priority: -1 _EOF_ fi diff --git a/.update/patches b/.update/patches index 13885d8373..ca5f4472c0 100755 --- a/.update/patches +++ b/.update/patches @@ -573,7 +573,7 @@ Patch_8_1() # RPi: Fix MATE install: https://github.com/MichaIng/DietPi/issues/5214 [[ $G_HW_MODEL -le 9 && -f '/etc/apt/preferences.d/dietpi-lxde' ]] && cat << '_EOF_' > /etc/apt/preferences.d/dietpi-lxde Package: openbox* obconf* libob* pcmanfm* libfm* gtk-* libgtk* libgail* gir1.2-gtk-3.0 lx* -Pin: origin archive.raspberrypi.org +Pin: origin archive.raspberrypi.com Pin-Priority: -1 _EOF_ diff --git a/.update/pre-patches b/.update/pre-patches index 56dd60e582..b953a5c2a6 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -306,7 +306,7 @@ then elif [[ $G_DISTRO -ge 7 && -f '/etc/apt/sources.list.d/raspi.list' ]] then G_DIETPI-NOTIFY 2 'Migrating RPi APT repository to Bookworm and removing obsolete FFmpeg workaround' - G_EXEC eval 'echo '\''deb https://archive.raspberrypi.org/debian/ bookworm main'\'' > /etc/apt/sources.list.d/raspi.list' + G_EXEC eval 'echo '\''deb https://archive.raspberrypi.com/debian/ bookworm main'\'' > /etc/apt/sources.list.d/raspi.list' [[ -f '/etc/apt/preferences.d/dietpi-ffmpeg' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-ffmpeg G_DIETPI-NOTIFY 2 'Removing faulty non-free-firmware component if present' @@ -381,5 +381,17 @@ then fi fi +# v9.0 +if (( $G_DIETPI_VERSION_CORE < 9 )) +then + if (( $G_HW_MODEL < 10 || ( $G_HW_MODEL == 75 && ${G_RASPBIAN:-0} == 1 ) )) + then + G_DIETPI-NOTIFY 2 'Migrating from raspberrypi.org to raspberrypi.com' + G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/sources.list /boot/dietpi.txt + find /etc/apt/sources.list.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/sources.list.d/*.list + find /etc/apt/preferences.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/preferences.d/* + fi +fi + exit 0 } diff --git a/dietpi.txt b/dietpi.txt index aa39d0cdaa..a5d83c8000 100644 --- a/dietpi.txt +++ b/dietpi.txt @@ -219,7 +219,7 @@ CONFIG_ENABLE_IPV6=1 # APT mirrors which are applied to /etc/apt/sources.list | Values here will also be applied during 1st run setup # - Raspbian: https://www.raspbian.org/RaspbianMirrors -CONFIG_APT_RASPBIAN_MIRROR=http://raspbian.raspberrypi.org/raspbian/ +CONFIG_APT_RASPBIAN_MIRROR=http://raspbian.raspberrypi.com/raspbian/ # - Debian: https://www.debian.org/mirror/official#list CONFIG_APT_DEBIAN_MIRROR=https://deb.debian.org/debian/ diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index f56611ae92..ebec2e51c4 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -319,7 +319,7 @@ Available commands: aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/remote_desktop/#realvnc-server' aSOFTWARE_DEPS[$software_id]='desktop' aSOFTWARE_CONFLICTS[$software_id]='28' - # RPi only (archive.raspberrypi.org repo, libraspberrypi0 dependency, license) + # RPi only (archive.raspberrypi.com repo, libraspberrypi0 dependency, license) (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=0 # Media Systems @@ -3102,7 +3102,7 @@ unix_socket_directories = '/run/postgresql'" > "$i/00dietpi.conf" if To_Install 170 # UnRAR then - # On Raspbian and for RISC-V, only "unrar-free" is available which does not support all RAR formats, thus we use "unrar" [non-free] from Debian on ARMv7+ models: http://raspbian.raspberrypi.org/raspbian/pool/non-free/u/unrar-nonfree/, https://deb.debian.org/debian-ports/pool/non-free/u/unrar-nonfree/ + # On Raspbian and for RISC-V, only "unrar-free" is available which does not support all RAR formats, thus we use "unrar" [non-free] from Debian on ARMv7+ models: http://raspbian.raspberrypi.com/raspbian/pool/non-free/u/unrar-nonfree/, https://deb.debian.org/debian-ports/pool/non-free/u/unrar-nonfree/ if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 11 )) then G_AGI unrar-free @@ -3122,7 +3122,7 @@ unix_socket_directories = '/run/postgresql'" > "$i/00dietpi.conf" # - https://github.com/MichaIng/DietPi/issues/4687 (( $G_HW_MODEL > 9 )) || cat << '_EOF_' > /etc/apt/preferences.d/dietpi-lxde Package: openbox* obconf* libob* pcmanfm* libfm* gtk-* libgtk* libgail* gir1.2-gtk-* lx* -Pin: origin archive.raspberrypi.org +Pin: origin archive.raspberrypi.com Pin-Priority: -1 _EOF_ # Bullseye: https://github.com/MichaIng/DietPi/issues/4687 @@ -5232,7 +5232,7 @@ _EOF_ # Purge DietPi Bullseye build with higher epoch version [[ $G_DISTRO == 6 && $(dpkg-query -Wf '${Version}' kodi 2> /dev/null) == '3:19.1-dietpi'[1-3] ]] && G_EXEC_OUTPUT=1 G_EXEC dpkg -P kodi - # Bullseye, RPi 4 and 64-bit userland: Use KMS driver: https://www.raspberrypi.org/forums/viewtopic.php?t=251645 + # Bullseye, RPi 4 and 64-bit userland: Use KMS driver: https://www.raspberrypi.com/forums/viewtopic.php?t=251645 if [[ $G_DISTRO -ge 6 || $G_HW_MODEL == 4 || $(dpkg --print-architecture) == 'arm64' ]] then # Enhance 4k support on RPi 4 @@ -5249,7 +5249,7 @@ _EOF_ # 64-bit Buster: Debian repo: https://github.com/MichaIng/DietPi/issues/4194 if [[ $G_DISTRO -le 5 && $(dpkg --print-architecture) == 'arm64' ]] then - echo -e 'Package: kodi*\nPin: origin archive.raspberrypi.org\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-kodi + echo -e 'Package: kodi*\nPin: origin archive.raspberrypi.com\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-kodi aDEPS+=('kodi-repository-kodi') # Else: RPi repo @@ -12083,7 +12083,7 @@ _EOF_ # Packages available on Buster backports and Bullseye: On Raspbian Buster add Bullseye repo if (( ${G_RASPBIAN:-0} && $G_DISTRO == 5 )) then - G_EXEC eval "echo 'deb http://raspbian.raspberrypi.org/raspbian/ bullseye main' > /etc/apt/sources.list.d/dietpi-wireguard.list" + G_EXEC eval "echo 'deb http://raspbian.raspberrypi.com/raspbian/ bullseye main' > /etc/apt/sources.list.d/dietpi-wireguard.list" # Disable repo via priority "-1", to prevent any accidental package upgrades: https://github.com/MichaIng/DietPi/issues/2568 # Enable but set WireGuard package priorities low enough to install only if not available in main repo(s) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 4198589182..41814c842f 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -101,8 +101,8 @@ $FP_SCRIPT disable_ssh_password_logins [01]|root| Whether to disable SSH [[ $INPUT_MODE_VALUE ]] || { Unknown_Input_Mode; return 1; } - # RPi Trixie: Suite does not exist yet: https://archive.raspberrypi.org/debian/dists/ - (( $G_HW_MODEL < 10 || ( $G_HW_MODEL == 75 && ${G_RASPBIAN:-0} == 1 ) )) && G_EXEC eval "echo 'deb https://archive.raspberrypi.org/debian/ ${G_DISTRO_NAME/trixie/bookworm} main' > /etc/apt/sources.list.d/raspi.list" + # RPi Trixie: Suite does not exist yet: https://archive.raspberrypi.com/debian/dists/ + (( $G_HW_MODEL < 10 || ( $G_HW_MODEL == 75 && ${G_RASPBIAN:-0} == 1 ) )) && G_EXEC eval "echo 'deb https://archive.raspberrypi.com/debian/ ${G_DISTRO_NAME/trixie/bookworm} main' > /etc/apt/sources.list.d/raspi.list" # RISC-V: Provided via Sid only if (( $G_HW_ARCH == 11 )) @@ -112,7 +112,7 @@ $FP_SCRIPT disable_ssh_password_logins [01]|root| Whether to disable SSH # Raspbian elif (( $G_RASPBIAN )) then - [[ $INPUT_MODE_VALUE == 'default' ]] && INPUT_MODE_VALUE='http://raspbian.raspberrypi.org/raspbian/' + [[ $INPUT_MODE_VALUE == 'default' ]] && INPUT_MODE_VALUE='http://raspbian.raspberrypi.com/raspbian/' G_EXEC eval "echo 'deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free' > /etc/apt/sources.list" From 4122593957e84f5487a85230ec01b583fd36d873 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 5 Jan 2024 20:58:55 +0100 Subject: [PATCH 19/77] v9.0 - dietpi-rpi-firmware-migration | Fix boot partition size check: We cannot check for /boot/firmware and /boot at the same time, since the target dir must exist for "df -T" to print anything. But it is okay to check /boot only, as if /boot/firmware exists already, the skript checked the size of the FAT partition before. --- .meta/dietpi-rpi-firmware-migration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meta/dietpi-rpi-firmware-migration b/.meta/dietpi-rpi-firmware-migration index 4aff33c96d..78a684ba4d 100644 --- a/.meta/dietpi-rpi-firmware-migration +++ b/.meta/dietpi-rpi-firmware-migration @@ -8,7 +8,7 @@ readonly G_PROGRAM_NAME='dietpi-rpi-firmware-migration' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW G_CHECK_FREESPACE / 200 -(( $(findmnt -nbo SIZE -T /boot/firmware) > 128000000 )) || { G_DIETPI-NOTIFY 1 'You can run this script on a system with at least 128 MiB boot partition only!'; exit 1; } +(( $(findmnt -nbo SIZE -T /boot) > 128000000 )) || { G_DIETPI-NOTIFY 1 'You can run this script on a system with at least 128 MiB boot partition only!'; exit 1; } G_INIT # Import DietPi-Globals --------------------------------------------------------------- From 122c030431ec2fa5408c384409a90a53fd827089 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 6 Jan 2024 16:29:40 +0100 Subject: [PATCH 20/77] v9.0 - DietPi-FS_partition_resize | Add more (debug) output to the script to better identify issues with the tailing setup partition detection: https://github.com/MichaIng/DietPi/issues/6838 --- .../dietpi/services/fs_partition_resize.sh | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh index 7140597829..86df6c110a 100755 --- a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh +++ b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh @@ -38,28 +38,34 @@ echo "[FAILED] Unsupported root device naming scheme ($ROOT_DEV). Aborting..." exit 1 fi + echo "[ INFO ] Detected root drive $ROOT_DRIVE with root partition $ROOT_PART" # Check if the last partition contains a FAT filesystem with DIETPISETUP label - if [[ $(lsblk -nrbo FSTYPE,LABEL "$ROOT_DRIVE" | tail -1) == 'vfat DIETPISETUP' ]] + LAST_PART=$(lsblk -nrbo FSTYPE,LABEL "$ROOT_DRIVE" | tail -1) + if [[ $LAST_PART == 'vfat DIETPISETUP' ]] then - # Mount it and copy files if present and newer SETUP_PART=$(sfdisk -lqo DEVICE "$ROOT_DRIVE" | tail -1) + echo "[ INFO ] Detected trailing DietPi setup partition $SETUP_PART" + # Mount it and copy files if present and newer TMP_MOUNT=$(mktemp -d) - mount "$SETUP_PART" "$TMP_MOUNT" + mount -v "$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/ + [[ -f $TMP_MOUNT/$f ]] && cp -uv "$TMP_MOUNT/$f" /boot/ done - umount "$SETUP_PART" - rmdir "$TMP_MOUNT" + umount -v "$SETUP_PART" + rmdir -v "$TMP_MOUNT" # Finally delete the partition so the resizing works sfdisk --no-reread --no-tell-kernel --delete "$ROOT_DRIVE" "${SETUP_PART: -1}" + else + echo "[ INFO ] No DietPi setup partition found, last partition is: \"$LAST_PART\"" + lsblk -po NAME,LABEL,SIZE,TYPE,FSTYPE,MOUNTPOINTS "$ROOT_DRIVE" fi # Only increase partition size if not yet done on first boot if [[ -f '/dietpi_skip_partition_resize' ]] then - rm /dietpi_skip_partition_resize + rm -v /dietpi_skip_partition_resize else # Failsafe: Sync changes to disk before touching partitions sync From 7318317590747a95572030ccf1d6788ca1b35208 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2024 17:26:40 +0100 Subject: [PATCH 21/77] v9.0 - 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 ebec2e51c4..961ec8a582 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10287,7 +10287,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.14.2348/Readarr.develop.0.3.14.2348.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.14.2358/Readarr.develop.0.3.14.2358.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 @@ -11328,7 +11328,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.3.1/tasmoadmin_v3.3.1.tar.gz' + local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.3.2/tasmoadmin_v3.3.2.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 2bf497af3f615543ca860209c127b641c1a49d18 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 7 Jan 2024 23:24:00 +0100 Subject: [PATCH 22/77] v9.0 - Quartz64 | Update kernel to Linux v6.6.10 --- .update/patches | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/.update/patches b/.update/patches index ca5f4472c0..6b5103a730 100755 --- a/.update/patches +++ b/.update/patches @@ -1511,21 +1511,8 @@ Patch_8_24() Patch_8_25() { - # Quartz64 - if (( $G_HW_MODEL == 49 )) - then - for i in quartz64{a,b} soquartz - do - dpkg --compare-versions "$(dpkg-query -Wf '${Version}' "firmware-$i" 2> /dev/null)" lt-nl 6.6.7-dietpi1 || continue - G_DIETPI-NOTIFY 2 "Updating $i kernel and bootloader ..." - G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/firmware-$i.deb" - G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb - G_EXEC rm package.deb - break - done - # VisionFive 2 - elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.68-dietpi1 + if (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.68-dietpi1 then G_DIETPI-NOTIFY 2 'Updating RISC-V StarFive VisionFive 2 kernel ...' G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb' @@ -1574,7 +1561,19 @@ Release notes: https://github.com/BlitterStudio/amiberry/releases Patch_9_0() { - G_DIETPI-NOTIFY 0 'DEBUG: DietPi v9.0 patches are applied :D' + # Quartz64 + if (( $G_HW_MODEL == 49 )) + then + for i in quartz64{a,b} soquartz + do + dpkg --compare-versions "$(dpkg-query -Wf '${Version}' "firmware-$i" 2> /dev/null)" lt-nl 6.6.10-dietpi1 || continue + G_DIETPI-NOTIFY 2 "Updating $i kernel and bootloader ..." + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/firmware-$i.deb" + G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb + G_EXEC rm package.deb + break + done + fi } # v6.35 => v7 migration From 621e6033d61ad3f5f427db941b688c567e567613 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2024 19:14:37 +0100 Subject: [PATCH 23/77] v9.0 - 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 961ec8a582..1ecb78fb93 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7569,7 +7569,7 @@ _EOF_ then Download_Install 'https://github.com/gotson/komga/releases/download/v0.165.0/komga-0.165.0.jar' /mnt/dietpi_userdata/komga/komga.jar else - local fallback_url='https://github.com/gotson/komga/releases/download/1.9.2/komga-1.9.2.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/1.10.0/komga-1.10.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 @@ -11779,7 +11779,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/rclone/rclone/releases/download/v1.65.0/rclone-v1.65.0-linux-$arch.deb" + local fallback_url="https://github.com/rclone/rclone/releases/download/v1.65.1/rclone-v1.65.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}")" fi fi From adc1ed0d405f5f71ee3cfb3729190710edf9cbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Carvalho?= Date: Mon, 8 Jan 2024 19:17:47 +0100 Subject: [PATCH 24/77] v9.0 (#6837) - DietPi-Banner | Instead of "Freespace", the "Disk usage" is now shown, including the total disk size and used percent. Many thanks to @Andr3Carvalh0 for implementing this change: https://github.com/MichaIng/DietPi/pull/6837 --- CHANGELOG.txt | 1 + dietpi/func/dietpi-banner | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fe4626acd0..2037c0e747 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ New images: - Orange Pi Zero 3 | New images for the 1.5 GB RAM variant are now available for testing, before they are added to our download page soon: https://dietpi.com/downloads/binaries/testing/ Enhancements: +- DietPi-Banner | Instead of "Freespace", the "Disk usage" is now shown, including the total disk size and used percent. Many thanks to @Andr3Carvalh0 for implementing this change: https://github.com/MichaIng/DietPi/pull/6837 - DietPi-Software | motionEye: Updated build dependencies for ARM and RISC-V, and switched to the recent pre-release from PyPI, instead of pulling from the repositories dev branch. Bug fixes: diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index f9a03a075a..e0bf28c274 100755 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -47,8 +47,8 @@ 'NIS domainname' 'LAN IP' 'WAN IP' - 'Freespace (RootFS)' - 'Freespace (userdata)' + 'Disk usage (RootFS)' + 'Disk usage (userdata)' 'Weather (wttr.in)' 'Custom banner entry' 'Display DietPi useful commands?' @@ -247,10 +247,10 @@ $GREEN_LINE" (( ${aENABLED[6]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[6]} $GREEN_SEPARATOR $(G_GET_WAN_IP 2>&1)" # DietPi-VPN connection status (( ${aENABLED[13]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[13]} $GREEN_SEPARATOR $(/boot/dietpi/dietpi-vpn status 2>&1)" - # Freespace (RootFS) - (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPARATOR $(df -h --output=avail / | mawk 'NR==2 {print $1}' 2>&1)" - # Freespace (DietPi userdata) - (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=avail /mnt/dietpi_userdata | mawk 'NR==2 {print $1}' 2>&1)" + # Disk usage (RootFS) + (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPARATOR $(df -h --output=used,size,pcent / | mawk 'NR==2 {printf $1" of "$2" ("$3"%)"}' 2>&1)" + # Disk usage (DietPi userdata) + (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=used,size,pcent /mnt/dietpi_userdata | mawk 'NR==2 {printf $1" of "$2" ("$3"%)"}' 2>&1)" # Weather (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 3 'https://wttr.in/?format=4' 2>&1)" # Let's Encrypt cert status From aa2ea27df942352c61a5e12e610753ba9d3f3f8c Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2024 20:24:52 +0100 Subject: [PATCH 25/77] v9.0 (#6842) - Amiberry | Switch from RPi DispmanX builds to SDL2-backend builds - Amiberry | Add RPi 5 and RISC-V builds - Amiberry | Add new v5.6.5 dependencies: https://github.com/BlitterStudio/amiberry/releases/tag/v5.6.5 --- .build/software/Amiberry/build.bash | 16 +++++++++++----- .build/software/Amiberry/container_build.bash | 15 ++++++++------- .github/workflows/amiberry.yml | 16 ++++++++++++---- dietpi/dietpi-software | 14 ++++++++------ 4 files changed, 39 insertions(+), 22 deletions(-) diff --git a/.build/software/Amiberry/build.bash b/.build/software/Amiberry/build.bash index 488dabbac2..fadbbc3d75 100755 --- a/.build/software/Amiberry/build.bash +++ b/.build/software/Amiberry/build.bash @@ -9,11 +9,11 @@ G_DIETPI-NOTIFY 2 "Amiberry will be built for platform: \e[33m$PLATFORM" # APT dependencies # - wget: Used for WHDLoad database update: https://github.com/BlitterStudio/amiberry/commit/d6c103e # - kbd: For "chvt" used in systemd service -adeps_build=('autoconf' 'make' 'g++' 'pkg-config' 'libdrm-dev' 'libgbm-dev' 'libudev-dev' 'libxml2-dev' 'libpng-dev' 'libfreetype6-dev' 'libflac-dev' 'libmpg123-dev' 'libmpeg2-4-dev' 'libasound2-dev' 'libserialport-dev' 'wget' 'kbd') -adeps=('libdrm2' 'libgl1-mesa-dri' 'libgbm1' 'libegl1' 'libudev1' 'libxml2' 'libpng16-16' 'libfreetype6' 'libmpg123-0' 'libmpeg2-4' 'libasound2' 'libserialport0' 'wget' 'kbd') +adeps_build=('autoconf' 'make' 'cmake' 'g++' 'pkg-config' 'libdrm-dev' 'libgbm-dev' 'libudev-dev' 'libxml2-dev' 'libpng-dev' 'libfreetype6-dev' 'libflac-dev' 'libmpg123-dev' 'libmpeg2-4-dev' 'libasound2-dev' 'libserialport-dev' 'libportmidi-dev' 'wget' 'kbd') +adeps=('libdrm2' 'libgl1-mesa-dri' 'libgbm1' 'libegl1' 'libudev1' 'libxml2' 'libpng16-16' 'libfreetype6' 'libmpg123-0' 'libmpeg2-4' 'libasound2' 'libserialport0' 'libportmidi0' 'wget' 'kbd') (( $G_DISTRO > 6 )) && adeps+=('libflac12') || adeps+=('libflac8') -# - DispmanX deps for RPi -[[ $PLATFORM == 'rpi'* ]] && adeps_build+=('libraspberrypi-dev') adeps+=('libraspberrypi0') +# - Deps for RPi DispmanX builds +[[ $PLATFORM == 'rpi'[1-5] || $PLATFORM == 'rpi'[345]'-64-dmx' ]] && adeps_build+=('libraspberrypi-dev') adeps+=('libraspberrypi0') # - Graphics rendering flags and deps (( $G_HW_ARCH == 10 )) && opengl_flags=('--disable-video-opengles2' '--enable-video-opengl') adeps_build+=('libgl1-mesa-dev') adeps+=('libgl1') || opengl_flags=('--enable-video-opengles2' '--disable-video-opengl') adeps_build+=('libgles2-mesa-dev') adeps+=('libgles2') @@ -95,6 +95,9 @@ then G_EXEC tar xf master.tar.gz G_EXEC rm master.tar.gz G_EXEC cd capsimg-master + # RISC-V: "checking build system type... ./config.guess: unable to guess system type" + G_EXEC curl -sSfo CAPSImg/config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' + G_EXEC curl -sSfo CAPSImg/config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' G_EXEC_OUTPUT=1 G_EXEC ./bootstrap G_EXEC_OUTPUT=1 G_EXEC ./configure CFLAGS='-g0 -O3' CXXFLAGS='-g0 -O3' G_EXEC_OUTPUT=1 G_EXEC make "-j$(nproc)" @@ -114,7 +117,10 @@ G_EXEC curl -sSfLO "https://github.com/BlitterStudio/amiberry/archive/v$v_ami.ta G_EXEC tar xf "v$v_ami.tar.gz" G_EXEC rm "v$v_ami.tar.gz" G_EXEC cd "amiberry-$v_ami" -G_EXEC_OUTPUT=1 G_EXEC make "-j$(nproc)" "PLATFORM=$PLATFORM" # Passing flags here overrides some mandatory flags in the Makefile, where -O3 is set as well. +# - RISC-V: Workaround for missing ld.gold: https://github.com/BlitterStudio/amiberry/issues/1213 +RISCV_LD=() +(( $G_HW_ARCH == 11 )) && RISCV_LD=('USE_LD=bfd') +G_EXEC_OUTPUT=1 G_EXEC make "-j$(nproc)" "PLATFORM=$PLATFORM" "${RISCV_LD[@]}" # Passing flags here overrides some mandatory flags in the Makefile, where -O3 is set as well. G_EXEC strip --remove-section=.comment --remove-section=.note amiberry # Prepare DEB package diff --git a/.build/software/Amiberry/container_build.bash b/.build/software/Amiberry/container_build.bash index 45da9337b6..ec02d67c2c 100755 --- a/.build/software/Amiberry/container_build.bash +++ b/.build/software/Amiberry/container_build.bash @@ -46,10 +46,11 @@ do done [[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || Error_Exit "Invalid distro \"$DISTRO\" passed" case $PLATFORM in - 'rpi1') image="ARMv6-${DISTRO^}" arch=1;; - 'rpi'[234]|'c1'|'xu4'|'RK3288'|'sun8i'|'s812') image="ARMv7-${DISTRO^}" arch=2;; - 'rpi'[34]'-64-dmx'|'AMLSM1'|'n2'|'a64'|'rk3588') image="ARMv8-${DISTRO^}" arch=3;; + 'rpi1'*) image="ARMv6-${DISTRO^}" arch=1;; + 'rpi'[345]'-64-'*|'AMLSM1'|'n2'|'a64'|'rk3588') image="ARMv8-${DISTRO^}" arch=3;; + 'rpi'[2-5]*|'c1'|'xu4'|'RK3288'|'sun8i'|'s812') image="ARMv7-${DISTRO^}" arch=2;; 'x86-64') image="x86_64-${DISTRO^}" arch=10;; + 'riscv64') image='RISC-V-Sid' arch=11;; *) Error_Exit "Invalid platform \"$PLATFORM\" passed";; esac image="DietPi_Container-$image.img" @@ -118,11 +119,11 @@ G_CONFIG_INJECT 'CONFIG_CHECK_CONNECTION_IP=' 'CONFIG_CHECK_CONNECTION_IP=127.0. # Avoid DietPi-Survey uploads to not mess with the statistics G_EXEC rm rootfs/root/.ssh/known_hosts -# RPi 64-bit: Add RPi repo, ARMv6 container images contain it already -if [[ $PLATFORM == 'rpi'[234]* ]] +# RPi: Add RPi repo, ARMv6 container images contain it already +if [[ $PLATFORM == 'rpi'[2-5]* ]] then - G_EXEC eval "echo 'deb https://archive.raspberrypi.org/debian/ ${DISTRO/trixie/bookworm} main' > rootfs/etc/apt/sources.list.d/raspi.list" - G_EXEC curl -sSf 'https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' -o keyring.deb + G_EXEC eval "echo 'deb https://archive.raspberrypi.com/debian/ ${DISTRO/trixie/bookworm} main' > rootfs/etc/apt/sources.list.d/raspi.list" + G_EXEC curl -sSf 'https://archive.raspberrypi.com/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' -o keyring.deb G_EXEC dpkg --root=rootfs -i keyring.deb G_EXEC rm keyring.deb # Enforce Debian Trixie FFmpeg packages over RPi repo ones diff --git a/.github/workflows/amiberry.yml b/.github/workflows/amiberry.yml index 262f0781cc..3b07aa0012 100644 --- a/.github/workflows/amiberry.yml +++ b/.github/workflows/amiberry.yml @@ -6,7 +6,7 @@ on: description: 'Target platform' type: choice # https://github.com/BlitterStudio/amiberry/blob/master/Makefile - options: [rpi1, rpi2, rpi3, rpi4, rpi3-64-dmx, rpi4-64-dmx, c1, xu4, RK3288, sun8i, s812, AMLSM1, n2, a64, x86-64, rk3588, all] + options: [rpi1-sdl2, rpi2-sdl2, rpi3-sdl2, rpi4-sdl2, rpi5-sdl2, rpi3-64-sdl2, rpi4-64-sdl2, rpi5-64-sdl2, c1, xu4, RK3288, sun8i, s812, AMLSM1, n2, a64, x86-64, rk3588, riscv64, all] default: all required: true dist: @@ -35,7 +35,7 @@ jobs: run: | if [ '${{ github.event.inputs.plat }}' = 'all' ] then - echo plat='["rpi1", "rpi2", "rpi3", "rpi4", "rpi3-64-dmx", "rpi4-64-dmx", "c1", "xu4", "RK3288", "sun8i", "s812", "AMLSM1", "n2", "a64", "x86-64", "rk3588"]' >> "$GITHUB_OUTPUT" + echo plat='["rpi1-sdl2", "rpi2-sdl2", "rpi3-sdl2", "rpi4-sdl2", "rpi5-sdl2", "rpi3-64-sdl2", "rpi4-64-sdl2", "rpi5-64-sdl2", "c1", "xu4", "RK3288", "sun8i", "s812", "AMLSM1", "n2", "a64", "x86-64", "rk3588", "riscv64"]' >> "$GITHUB_OUTPUT" else echo plat='["${{ github.event.inputs.plat }}"]' >> "$GITHUB_OUTPUT" fi @@ -54,8 +54,16 @@ jobs: plat: ${{ fromJson(needs.prep.outputs.plat) }} dist: ${{ fromJson(needs.prep.outputs.dist) }} exclude: - - { plat: rpi1, dist: trixie } - - { plat: rk3588, dist: buster } + - { plat: rk3588, dist: buster } # Compiler fails with: "g++: fatal error: unknown value ‘cortex-a76+fp’ for -mcpu" + - { plat: rpi1-sdl2, dist: buster } # Compiler fails with: "list sub-command REMOVE_ITEM requires two or more arguments." and those builds are not picked by DietPi v8 and earlier, the latest which support Buster + - { plat: rpi2-sdl2, dist: buster } + - { plat: rpi3-sdl2, dist: buster } + - { plat: rpi4-sdl2, dist: buster } + - { plat: rpi5-sdl2, dist: buster } + - { plat: rpi5-64-sdl2, dist: buster } # Compiler fails with: "g++: fatal error: unknown value ‘cortex-a76’ for -mcpu" + - { plat: riscv64, dist: buster } + - { plat: riscv64, dist: bullseye } + - { plat: riscv64, dist: bookworm } fail-fast: false name: "${{ matrix.plat }} - ${{ matrix.dist }}" runs-on: ubuntu-22.04 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1ecb78fb93..5951ca1478 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -887,8 +887,6 @@ Available commands: aSOFTWARE_CATX[$software_id]=5 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/gaming/#amiberry' aSOFTWARE_DEPS[$software_id]='5' - # - RISC-V: Missing target - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=51 aSOFTWARE_NAME[$software_id]='OpenTyrian' @@ -5331,13 +5329,13 @@ _EOF_ if To_Install 108 # Amiberry then # Obtain platform: https://github.com/BlitterStudio/amiberry/blob/master/Makefile - local platform='rpi1' + local platform='rpi1-sdl2' if (( $G_HW_MODEL < 10 )) # RPi then - (( $G_HW_MODEL > 1 )) && platform="rpi$G_HW_MODEL" # ID 0 is rpi1 + (( $G_HW_MODEL > 1 )) && platform="rpi$G_HW_MODEL-sdl2" # ID 0 is rpi1 # 64-bit: For RPi 2 v1.2 use RPi 3 64-bit build - (( $G_HW_ARCH == 3 )) && platform="${platform/[12]/3}-64-dmx" - /boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-fkms-v3d + (( $G_HW_ARCH == 3 )) && platform="${platform/[12]/3}-64-sdl2" + /boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-kms-v3d elif (( $G_HW_MODEL == 10 )) # Odroid C1 then @@ -5378,6 +5376,10 @@ _EOF_ elif (( $G_HW_ARCH == 10 )) # x86_64 then platform='x86-64' + + elif (( $G_HW_ARCH == 11 )) # RISC-V + then + platform='riscv64' fi # Install Amiberry DEB package From 43ecdb4a1d061f4b7d017877cc091bd476a3fd60 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2024 20:37:44 +0100 Subject: [PATCH 26/77] v9.0 - DietPi-Patches | Add some kernel and software updates --- .update/patches | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/.update/patches b/.update/patches index 6b5103a730..b7fbb31cbf 100755 --- a/.update/patches +++ b/.update/patches @@ -1511,15 +1511,6 @@ Patch_8_24() Patch_8_25() { - # VisionFive 2 - if (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.68-dietpi1 - then - G_DIETPI-NOTIFY 2 'Updating RISC-V StarFive VisionFive 2 kernel ...' - G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb' - G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb - G_EXEC rm package.deb - fi - # Software updates and migrations if [[ -f '/boot/dietpi/.installed' ]] then @@ -1538,14 +1529,6 @@ Patch_8_25() G_EXEC rm package.deb fi - # Amiberry - grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[108\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' amiberry 2> /dev/null)" lt 5.6.4-dietpi2 && G_WHIP_YESNO '[ INFO ] Amiberry update available -\nAn update to Amiberry v5.6.4 is available, including LibSDL2 v2.28.5. -Release notes: https://github.com/BlitterStudio/amiberry/releases -\nDo you want to apply the update now? -\nYou can manually apply it any time via: -# dietpi-software reinstall 108' && echo 108 >> /var/tmp/dietpi/dietpi-update_reinstalls - # NZBGet: Disable file logging if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[149\]=2' /boot/dietpi/.installed && [[ -f '/mnt/dietpi_userdata/nzbget/nzbget.conf' ]] then @@ -1573,6 +1556,33 @@ Patch_9_0() G_EXEC rm package.deb break done + + # VisionFive 2 + elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.71-dietpi1 + then + G_DIETPI-NOTIFY 2 'Updating RISC-V StarFive VisionFive 2 kernel ...' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb' + G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb + G_EXEC rm package.deb + + # Star64 + elif (( $G_HW_MODEL == 84 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-star64 2> /dev/null)" lt-nl 6.1.71-dietpi1 + then + G_DIETPI-NOTIFY 2 'Updating RISC-V PINE64 Star64 kernel ...' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-star64.deb' + G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb + G_EXEC rm package.deb + fi + + # Software updates and migrations + if [[ -f '/boot/dietpi/.installed' ]] + then + # Amiberry + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[108\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' amiberry 2> /dev/null)" lt 5.6.5-dietpi1 + then + G_DIETPI-NOTIFY 2 'Preparing Amiberry upgrade to v5.6.5, including migration for RPi systems from fake KMS DispmanX to full KMS SDL2 graphics backend' + echo 108 >> /var/tmp/dietpi/dietpi-update_reinstalls + fi fi } From 47ace8bec23dd8cdd7f0385ee920c1669991f92a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2024 20:43:45 +0100 Subject: [PATCH 27/77] v9.0 - DietPi-Banner | Minor: Switch from printf to print, which has not special handling for "%" and hence makes things a little simpler --- dietpi/func/dietpi-banner | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index e0bf28c274..c77958bc4b 100755 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -248,9 +248,9 @@ $GREEN_LINE" # DietPi-VPN connection status (( ${aENABLED[13]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[13]} $GREEN_SEPARATOR $(/boot/dietpi/dietpi-vpn status 2>&1)" # Disk usage (RootFS) - (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPARATOR $(df -h --output=used,size,pcent / | mawk 'NR==2 {printf $1" of "$2" ("$3"%)"}' 2>&1)" + (( ${aENABLED[7]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[7]} $GREEN_SEPARATOR $(df -h --output=used,size,pcent / | mawk 'NR==2 {print $1" of "$2" ("$3")"}' 2>&1)" # Disk usage (DietPi userdata) - (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=used,size,pcent /mnt/dietpi_userdata | mawk 'NR==2 {printf $1" of "$2" ("$3"%)"}' 2>&1)" + (( ${aENABLED[8]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[8]} $GREEN_SEPARATOR $(df -h --output=used,size,pcent /mnt/dietpi_userdata | mawk 'NR==2 {print $1" of "$2" ("$3")"}' 2>&1)" # Weather (( ${aENABLED[9]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[9]} $GREEN_SEPARATOR $(curl -sSfLm 3 'https://wttr.in/?format=4' 2>&1)" # Let's Encrypt cert status From baceff51ae93dbccf13f6de4917b77e60bc6f27d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 8 Jan 2024 21:01:50 +0100 Subject: [PATCH 28/77] v9.0 - DietPi-Software | Kavita: 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 5951ca1478..033e68793e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6442,7 +6442,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.7.11.2/kavita-linux-$arch.tar.gz" + local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.7.12/kavita-linux-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Kareadita/Kavita/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/kavita-linux-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC chmod +x Kavita/Kavita From 7e6414c0dca85b5ba5b72a7301b6140068a91847 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 10 Jan 2024 23:13:26 +0100 Subject: [PATCH 29/77] v9.0 - RC up - DietPi-Update | Raise minimum Debian version to Bullseye and minimal DietPi version to 7.0. Migrate older systems to the new "v8" branch automatically, from where they are migrated back to master automatically, once v8 has been applied and Debian Bullseye or above. --- .update/version | 12 ++++++------ CHANGELOG.txt | 4 ++++ dietpi/func/dietpi-globals | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.update/version b/.update/version index d8f1436cfc..a4e14efaba 100644 --- a/.update/version +++ b/.update/version @@ -3,16 +3,16 @@ # Available DietPi version G_REMOTE_VERSION_CORE=9 G_REMOTE_VERSION_SUB=0 -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 +G_MIN_VERSION_CORE=7 +G_MIN_VERSION_SUB=0 # Alternative Git branch to automatically migrate to when DietPi version is too low -G_OLD_VERSION_BRANCH='pre-v6.14' +G_OLD_VERSION_BRANCH='v8' # Minimum Debian version to allow update -G_MIN_DEBIAN=5 +G_MIN_DEBIAN=6 # Alternative Git branch to automatically migrate to when Debian version is too low -G_OLD_DEBIAN_BRANCH='stretch' +G_OLD_DEBIAN_BRANCH='v8' # Live patches G_LIVE_PATCH_DESC=() G_LIVE_PATCH_COND=() diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2037c0e747..a8d8da1e2b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,10 @@ v9.0 (2024-01-13) +Breaking: +- The minimum Debian version supported by our scripts has been raised to Bullseye. Buster systems will be migrated to a dedicated branch automatically. We highly recommend affected systems to either flash a new image or upgrade to Debian Bullseye, following this guide: https://dietpi.com/blog/?p=811. Once the upgrade has been done, the update to DietPi v9 will be offered on next update ckeck or when running "dietpi-update". +- The minimum DietPi version to support direct updates to DietPi v9 from has been raised to v7.0. Older systems will go through a two-stage process, being upgraded to DietPi v8.25 with a separate branch, and afterwards further to DietPi v9 via master branch if the Debian version requirement is met as well. + New images: - Orange Pi Zero 3 | New images for the 1.5 GB RAM variant are now available for testing, before they are added to our download page soon: https://dietpi.com/downloads/binaries/testing/ diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index bf66fcedfe..45cadc4527 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,7 +55,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=9 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 - [[ $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 4ef83c457db7adc2b0dcfa755afaf2461b8ad201 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 10 Jan 2024 23:18:38 +0100 Subject: [PATCH 30/77] v9.0 - DietPi-Update | Remove v6 patch files and their handling from the updater --- dietpi/dietpi-update | 39 +- dietpi/patch_file | 2111 --------------------------------------- dietpi/pre-patch_file | 291 ------ dietpi/server_version-6 | 3 - 4 files changed, 8 insertions(+), 2436 deletions(-) delete mode 100755 dietpi/patch_file delete mode 100755 dietpi/pre-patch_file delete mode 100644 dietpi/server_version-6 diff --git a/dietpi/dietpi-update b/dietpi/dietpi-update index 8bbdcbc8eb..a354b28750 100755 --- a/dietpi/dietpi-update +++ b/dietpi/dietpi-update @@ -11,8 +11,8 @@ # Info: # - Location: /boot/dietpi/dietpi-update # - Updates DietPi from a chosen GitHub repository - # - Uses pre-patch_file/pre-patches for patches that need to be done prior to APT calls or DietPi code updates - # - Uses patch_file/patches for incremental patching after APT calls and DietPi code updates + # - Uses pre-patches for patches that need to be done prior to APT calls or DietPi code updates + # - Uses patches for incremental patching after APT calls and DietPi code updates # # Usage: # - dietpi-update = Check for DietPi update and if available open interactive menu @@ -275,26 +275,12 @@ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying pre-patches' - # DietPi v6 pre-patches, required for DietPi pre-v6.17 systems, which have DietPi-Update restarted before having these pre-patches applied. - if (( $G_DIETPI_VERSION_CORE == 6 )) + G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/pre-patches" + G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patches + if ! ./pre-patches "$G_DIETPI_VERSION_CORE" "$G_DIETPI_VERSION_SUB" then - G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/dietpi/pre-patch_file" - G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patch_file - if ! ./pre-patch_file "$G_DIETPI_VERSION_SUB" - then - G_DIETPI-NOTIFY 1 "An error occurred during pre-patch $?. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." - exit 1 - fi - - # DietPi v6 pre-patches internally apply DietPi v7 pre-patches, hence do not apply them separately. - else - G_EXEC_DESC='Downloading pre-patches' G_EXEC curl -sSfLO "https://raw.githubusercontent.com/$GITOWNER_TARGET/DietPi/$GITBRANCH_TARGET/.update/pre-patches" - G_EXEC_DESC='Applying execute permission' G_EXEC chmod +x pre-patches - if ! ./pre-patches "$G_DIETPI_VERSION_CORE" "$G_DIETPI_VERSION_SUB" - then - G_DIETPI-NOTIFY 1 "An error occurred during pre-patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." - exit 1 - fi + G_DIETPI-NOTIFY 1 "An error occurred during pre-patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." + exit 1 fi G_DIETPI-NOTIFY 0 'Successfully applied pre-patches' @@ -307,7 +293,7 @@ G_EXEC_DESC='Downloading update archive' G_EXEC curl -sSfLO "https://github.com/$GITOWNER_TARGET/DietPi/archive/$GITBRANCH_TARGET.tar.gz" G_EXEC_DESC='Unpacking update archive' G_EXEC tar xf "${GITBRANCH_TARGET##*/}.tar.gz" # Support for Git branch names with forward slashes local dir="DietPi-${GITBRANCH_TARGET//\//-}" # GitHub translates forward slashes into dashes - G_EXEC_DESC='Removing unused files' G_EXEC rm "${GITBRANCH_TARGET##*/}.tar.gz" "$dir/dietpi/"{pre-patch_file,server_version-6} + G_EXEC_DESC='Removing unused files' G_EXEC rm "${GITBRANCH_TARGET##*/}.tar.gz" G_EXEC_DESC='Hardening update archive mode' G_EXEC chmod -R g-w "$dir" G_EXEC_DESC='Installing new DietPi scripts' G_EXEC cp -a "$dir/dietpi" /boot/ G_EXEC_DESC='Installing new DietPi system files' G_EXEC cp -a "$dir/rootfs/." / @@ -336,15 +322,6 @@ G_DIETPI-NOTIFY 2 "$INFO_CURRENT_VERSION" G_DIETPI-NOTIFY 2 "$INFO_REMOTE_VERSION" - # DietPi v6 incremental patches - if (( $G_DIETPI_VERSION_CORE == 6 )) && ! /boot/dietpi/patch_file; then - - G_DIETPI-NOTIFY 1 "An error occurred during incremental patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." - exit 1 - - fi - rm /boot/dietpi/patch_file - if ! "$dir/.update/patches"; then G_DIETPI-NOTIFY 1 "An error occurred during incremental patching. Please check the above log or $FP_LOG for errors, and rerun \"dietpi-update\" after the cause has been solved." diff --git a/dietpi/patch_file b/dietpi/patch_file deleted file mode 100755 index ed32c869e8..0000000000 --- a/dietpi/patch_file +++ /dev/null @@ -1,2111 +0,0 @@ -#!/bin/bash -{ - #//////////////////////////////////// - # DietPi Patch File Script - # - #//////////////////////////////////// - # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com - # - #//////////////////////////////////// - # - # Info: - # - Online patching for client system - # - Runs from dietpi-update - # - # Usage: - # - /boot/dietpi/patch_file [$G_DIETPI_VERSION_SUB] - #//////////////////////////////////// - - # Whether to schedule a reboot after DietPi-Update - REBOOT= - - # Pre-v6.29: DietPi-RAMdisk removal needs to be done before loading DietPi-Globals, else /boot/dietpi still contains the old code - if [[ -d '/DietPi' && $(readlink -f '/DietPi') != '/boot' ]]; then - - # Copy new code to disk - cp -Rf /DietPi/* /boot/ - - # Disable and remove service and mount - systemctl disable dietpi-ramdisk - umount -Rl /DietPi - sed --follow-symlinks -i '/[[:blank:]]\/DietPi[[:blank:]]/d' /etc/fstab - rm -Rf /DietPi /boot/dietpi/{,func/}dietpi-ramdisk /etc/systemd/system/dietpi-ramdisk.service - - # Create symlink for backwards compatibility - ln -s /boot /DietPi - - # Failsafe - sync - - fi - # - Pre-create new DietPi runtime dir for later used scripts, created via /etc/tmpfiles.d/dietpi.conf from next boot on - [[ -d '/run/dietpi' ]] || { mkdir -p /run/dietpi; chmod 777 /run/dietpi; } - - # Pre-v6.22: Update Git owner due to official lead transfer from Fourdee to MichaIng: https://github.com/MichaIng/DietPi/issues/2589 - grep -q '^[[:blank:]]*DEV_GITOWNER=Fourdee' /boot/dietpi.txt && sed --follow-symlinks -i '/^[[:blank:]]*DEV_GITOWNER=/c\DEV_GITOWNER=MichaIng' /boot/dietpi.txt - - if [[ -f '/boot/dietpi/.version' ]] && grep -q '^G_GITOWNER=Fourdee' /boot/dietpi/.version; then - - sed --follow-symlinks -i '/^G_GITOWNER=/c\G_GITOWNER=MichaIng' /boot/dietpi/.version - - # Pre-v6.17: New ".version" system - # - As loaded pre-v6.17 dietpi-update will overwrite ".version" to previous 2/3 line system, we need to rerun dietpi-update. - elif [[ ! -f '/boot/dietpi/.version' ]] || ! grep -q '^G_GITOWNER=' /boot/dietpi/.version; then - - rm /boot/dietpi/.version - - fi - - # Pre-v6.29: Convert IMAGE_ADDITIONAL_CREDITS line to .prep_info pre-image and migrate existing HW_UUID line to new .hw_model system - if [[ -f '/boot/dietpi/.hw_model' ]] && ! grep -q '^G_HW_UUID=' /boot/dietpi/.hw_model; then - - [[ ! -f '/boot/dietpi/.prep_info' && $(mawk 'NR==8' /boot/dietpi/.hw_model) ]] && cat << _EOF_ > /boot/dietpi/.prep_info -0 -$(mawk 'NR==8' /DietPi/dietpi/.hw_model) -_EOF_ - echo "G_HW_UUID=$(mawk 'NR==5' /boot/dietpi/.hw_model)" > /boot/dietpi/.hw_model - - fi - - # Pre-v6.29: Assure that C.UTF-8 locale is available - if ! locale -a | grep -qiE '^C.UTF-?8'; then - - apt-get -qq install --reinstall libc-bin - # libc-bin ships C.UTF-8 as static locale already but let's add it to memory-mapped archive as well - localedef --add-to-archive /usr/lib/locale/C.UTF-8 - - fi - - # Update changed hardware IDs before dietpi-obtain_hw_model would reset them to 22 - if [[ -f '/etc/.dietpi_hw_model_identifier' ]] - then - G_HW_MODEL=$( /etc/.dietpi_hw_model_identifier # Generic Rockchip RK3399 - - elif [[ $G_HW_MODEL == 50 || $G_HW_MODEL == 41 || $G_HW_MODEL == 3[54310] ]] # BananaPi M2+, OrangePi PC Plus, OPi Zero 2 Plus, OrangePi Plus, OrangePi Lite, OrangePi One, OrangePi PC - then - echo 25 > /etc/.dietpi_hw_model_identifier # Generic Allwinner H3 - - elif [[ $G_HW_MODEL == 3[87] ]] # OPi PC2, OPi Prime - then - echo 26 > /etc/.dietpi_hw_model_identifier # Generic Allwinner H5 - fi - fi - - # Import DietPi-Globals -------------------------------------------------------------- - /boot/dietpi/func/dietpi-obtain_hw_model # Always update - . /boot/dietpi/func/dietpi-globals - readonly G_PROGRAM_NAME='DietPi-Patch' - G_INIT - # Import DietPi-Globals -------------------------------------------------------------- - - # Grab input, if given, else fallback to dietpi-globals estimation - # - DietPi-Update includes G_VERSIONDB_SAVE after every subversion patch from v6.27 on. - (( $1 )) && G_DIETPI_VERSION_SUB=$1 - - # Pre-v6.29: Migrate newly supported SBCs from dev to master branch - if [[ $G_DIETPI_VERSION_SUB -lt 29 && -f '/etc/.dietpi_hw_model_identifier' ]]; then - - # NanoPi M4V2 (58) - # PINE H64 (45) - # ROCK Pi S (73) - if [[ $( 0 )); then - - echo 2 > /boot/dietpi/.install_stage - - # As first run dietpi-update is executed from old dietpi-software, we need to reboot to load new first run setup scripts. - else - - echo 0 > /boot/dietpi/.install_stage - REBOOT=1 - - fi - - fi - - # Restart DietPi-Update when not yet done, to migrate to v7 - if (( $(pgrep -c patch_file) < 2 )); then - - # Save current version to rerun patch on next launch - # - We know the core version is 6, so store it like that, else version prior to v6.17 will default to v7: https://github.com/MichaIng/DietPi/issues/4385 - G_DIETPI_VERSION_CORE=6 - G_VERSIONDB_SAVE - - # Remove DietPi-Update and DietPi-Patch working directories to allow concurrent execution. - G_EXEC cd /tmp - G_EXEC rm -Rf /tmp/DietPi-{Update,Patch} - - G_DIETPI-NOTIFY 0 'Restarting DietPi-Update with new code...\n' - - # Failsafe: Sync changes to disk to avoid async-related issues - sync - G_SLEEP 3 - - # Apply update forcefully, since user has already chosen to do so - /boot/dietpi/dietpi-update 1 - - # Reboot system if scheduled, else exit this script + parental dietpi-update only to avoid deprecated update finish - if [[ $REBOOT == 1 ]]; then - - G_WHIP_MSG 'The system will now reboot to finish this update.' - reboot - - else - - G_DIETPI-NOTIFY 0 'Everything done! Terminating the obsolete DietPi-Update parent instance...\n' - kill "$PPID" - exit - - fi - - fi - - #///////////////////////////////////////////////////////////////////////////////////// - # Incremental patch system - #///////////////////////////////////////////////////////////////////////////////////// - # - Prevent backup prompts during patching e.g. from DietPi-Software reinstalls - export G_PROMPT_BACKUP_DISABLED=1 - # - Prevent initial and final service control during DietPi-Software reinstalls - export G_SERVICE_CONTROL=0 - - Subversion_Patch(){ - - if (( $G_DIETPI_VERSION_SUB == 14 )); then - - #------------------------------------------------------------------------------- - # Reinstall fake-hwclock: https://github.com/MichaIng/DietPi/issues/2035#issuecomment-416345155 - G_AGI fake-hwclock - #------------------------------------------------------------------------------- - # Reinstalls: - # v6.17 MPD: https://github.com/MichaIng/DietPi/issues/2032#issuecomment-415559451 - # v6.33 PlexPy: https://github.com/MichaIng/DietPi/issues/2047 - #------------------------------------------------------------------------------- - # Update DietPi-Sync save file to new format - if [[ -f '/boot/dietpi/.dietpi-sync_settings' ]] && ! grep -q '^FP_SOURCE=' /boot/dietpi/.dietpi-sync_settings; then - - G_EXEC cp -a /boot/dietpi/.dietpi-sync_settings{,_bk} - cat << _EOF_ > /boot/dietpi/.dietpi-sync_settings -FP_SOURCE=$(mawk 'NR==1' /boot/dietpi/.dietpi-sync_settings_bk) -FP_TARGET=$(mawk 'NR==2' /boot/dietpi/.dietpi-sync_settings_bk) -SYNC_DELETE_MODE=$(mawk 'NR==3' /boot/dietpi/.dietpi-sync_settings_bk) -SYNC_CRONDAILY=$(mawk 'NR==5' /boot/dietpi/.dietpi-sync_settings_bk) -_EOF_ - - fi - #------------------------------------------------------------------------------- - # Preboot script addition - G_EXEC systemctl enable dietpi-preboot - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 15 )); then - - #------------------------------------------------------------------------------- - # Move to new WiFi cred array system and db store: https://github.com/MichaIng/DietPi/issues/368 - if [[ ! -f '/var/lib/dietpi/dietpi-wifi.db' ]]; then - - cat << _EOF_ > /var/lib/dietpi/dietpi-wifi.db -aWIFI_SSID[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_SSID=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_KEY[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_KEY=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_KEYMGR[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_KEYMGR=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_PROTO[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_PROTO=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_PAIRWISE[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_PAIRWISE=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_AUTH_ALG[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_AUTH_ALG=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_EAP[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_EAP=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_IDENTITY[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_IDENTITY=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_PASSWORD[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_PASSWORD=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_PHASE1[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_PHASE1=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_PHASE2[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_PHASE2=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -aWIFI_CERT[0]='$(grep -m1 '^[[:blank:]]*AUTO_SETUP_NET_WIFI_CERT=' /boot/dietpi.txt | sed 's/^[^=]*=//')' -_EOF_ - # Apply + init the remainder of array (5) + set permissions on file - /boot/dietpi/func/dietpi-wifidb 1 - - fi - #------------------------------------------------------------------------------- - # Fix rare WiFi interface start issue: https://github.com/MichaIng/DietPi/issues/2074 - # shellcheck disable=SC2016 - [[ -f '/etc/network/if-pre-up.d/wireless-tools' ]] && sed --follow-symlinks -i '\|^[[:blank:]]ifconfig "$IFACE" up$|c\\t/sbin/ip link set dev "$IFACE" up' /etc/network/if-pre-up.d/wireless-tools - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 16 )); then - - #------------------------------------------------------------------------------- - # Survey/BugReport SFTP uploads, add cert for access: https://github.com/MichaIng/DietPi/issues/2022 - # - Switch to "ssh.dietpi.com" die to Cloudflare: https://github.com/MichaIng/DietPi/issues/2022 - # - On v6.15 this was missing in PREP, thus images created meanwhile, so redo with v6.17 patch: - [[ -d '/root/.ssh' ]] || G_EXEC mkdir /root/.ssh - [[ -f '/root/.ssh/known_hosts' ]] || > /root/.ssh/known_hosts - G_EXEC sed --follow-symlinks -i '/^dietpi.com/d' /root/.ssh/known_hosts - G_EXEC sed --follow-symlinks -i '/^185.101.93.93/d' /root/.ssh/known_hosts - if (( $G_DISTRO < 7 )) - then - G_CONFIG_INJECT '\[?ssh.dietpi.com(]:29248)?[[:blank:]]' '[ssh.dietpi.com]:29248 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDE6aw3r6aOEqendNu376iiCHr9tGBIWPgfrLkzjXjEsHGyVSUFNnZt6pftrDeK7UX+qX4FxOwQlugG4fymOHbimRCFiv6cf7VpYg1Ednquq9TLb7/cIIbX8a6AuRmX4fjdGuqwmBq3OG7ZksFcYEFKt5U4mAJIaL8hXiM2iXjgY02LqiQY/QWATsHI4ie9ZOnwrQE+Rr6mASN1BVFuIgyHIbwX54jsFSnZ/7CdBMkuAd9B8JkxppWVYpYIFHE9oWNfjh/epdK8yv9Oo6r0w5Rb+4qaAc5g+RAaknHeV6Gp75d2lxBdCm5XknKKbGma2+/DfoE8WZTSgzXrYcRlStYN' /root/.ssh/known_hosts - else - G_CONFIG_INJECT '\[?ssh.dietpi.com(]:29248)?[[:blank:]]' '[ssh.dietpi.com]:29248 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJdEPlagpQ+RVHNOX3jkG1Bya7Oza1dAke8h8NszVW84' /root/.ssh/known_hosts - fi - #------------------------------------------------------------------------------- - # ROCK64, remove HW accell config, as its not currently functional: https://github.com/MichaIng/DietPi/issues/2086 - [[ $G_HW_MODEL == 43 && -f '/etc/X11/xorg.conf.d/20-armsoc.conf' ]] && G_EXEC rm /etc/X11/xorg.conf.d/20-armsoc.conf - #------------------------------------------------------------------------------- - # Convert and remove old dietpi.txt entry (this includes the comment) - grep -q 'CONFIG_PREFER_IPVERSION' /boot/dietpi.txt && G_EXEC sed --follow-symlinks -i '/CONFIG_PREFER_IPVERSION/d' /boot/dietpi.txt - #------------------------------------------------------------------------------- - # Update IPv6 handling: https://github.com/MichaIng/DietPi/issues/2027 - # - Advice user to re-enable IPv6 on kernel level - if [[ ! -d '/proc/sys/net/ipv6' ]]; then - - G_WHIP_MENU_ARRAY=( - - 0 ': Re-enable IPv6 on kernel level, disable via sysctl instead (Recommended)' - 1 ': Keep IPv6 disabled on kernel level, I know what I am doing!' - - ) - G_WHIP_DEFAULT_ITEM=0 - if G_WHIP_MENU '[WARNING] IPv6 is disabled via kernel module blacklist or boot cmd line.\n -This feature was previously offered via DietPi-Config and has since been removed.\n -Since more and more software requires and expects IPv6 kernel settings to be available. If you keep the current settings, this might lead to APT install errors and/or general system instability.\n -We strongly recommend you select "0 : Re-enable IPv6 on kernel level". By doing so, IPv6 will remain disabled for the interfaces at sysctl level, and, no IPv6 addresses will be assigned to your network devices.\n\nTLDR: Select option "0" :)' && (( $G_WHIP_RETURNED_VALUE == 0 )); then - - # Remove kernel module blacklisting - [[ -f '/etc/modprobe.d/99-dietpi-blacklist-ipv6.conf' ]] && rm /etc/modprobe.d/99-dietpi-blacklist-ipv6.conf - # Failsafe: Comment "blacklist ipv6" entries in all other sysctl config files - local i - for i in /etc/modprobe.d/* - do - [[ -f $i ]] && sed --follow-symlinks -i 's/^[[:blank:]]*blacklist[[:blank:]]ipv6/#&/' "$i" - done - - # Remove boot cmd line entry - # - RPi - if (( $G_HW_MODEL < 10 )); then - - # Separately remove with leading and trailing blank, since we don't know, if it's first or last argument and we must not remove both blanks - sed --follow-symlinks -i '/^[[:blank:]]*root=/s/[[:blank:]]ipv6.disable=1//' /boot/cmdline.txt - sed --follow-symlinks -i '/^[[:blank:]]*root=/s/ipv6.disable=1[[:blank:]]//' /boot/cmdline.txt - - # - Odroid - elif (( $G_HW_MODEL < 20 )); then - - sed --follow-symlinks -i '/^[[:blank:]]*setenv boot/s/[[:blank:]]ipv6.disable=1//' /boot/boot.ini - sed --follow-symlinks -i '/^[[:blank:]]*setenv boot/s/ipv6.disable=1[[:blank:]]//' /boot/boot.ini - - # - x86 - elif (( $G_HW_ARCH == 10 )); then - - sed --follow-symlinks -i '/^[[:blank:]]*GRUB_CMDLINE_LINUX_DEFAULT="/s/[[:blank:]]ipv6.disable=1//' /etc/default/grub - sed --follow-symlinks -i '/^[[:blank:]]*GRUB_CMDLINE_LINUX_DEFAULT="/s/ipv6.disable=1[[:blank:]]//' /etc/default/grub - update-grub - - fi - - # Disable IPv6 via sysctl - echo -e 'net.ipv6.conf.all.disable_ipv6=1\nnet.ipv6.conf.default.disable_ipv6=1' > /etc/sysctl.d/dietpi-disable_ipv6.conf - G_CONFIG_INJECT 'CONFIG_ENABLE_IPV6=' 'CONFIG_ENABLE_IPV6=0' /boot/dietpi.txt - - fi - - fi - #------------------------------------------------------------------------------- - # Reinstalls: - # v6.20 MPD - # v6.19 Chromium: Update kiosk mode autostart script: https://github.com/MichaIng/DietPi/issues/2158 - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - # Run Transmission and Plex Media Server as "dietpi" group: https://github.com/MichaIng/DietPi/issues/2067#issuecomment-427579779 - if grep -q '^aSOFTWARE_INSTALL_STATE\[44\]=2' /boot/dietpi/.installed; then - - mkdir -p /etc/systemd/system/transmission-daemon.service.d - echo -e '[Service]\nGroup=dietpi' >> /etc/systemd/system/transmission-daemon.service.d/dietpi-group.conf - G_CONFIG_INJECT '\"umask\":' ' "umask": 7,' /etc/transmission-daemon/settings.json - - fi - if grep -q '^aSOFTWARE_INSTALL_STATE\[42\]=2' /boot/dietpi/.installed; then - - mkdir -p /etc/systemd/system/plexmediaserver.service.d - echo -e '[Service]\nGroup=dietpi' >> /etc/systemd/system/plexmediaserver.service.d/dietpi-group.conf - - fi - - fi - #------------------------------------------------------------------------------- - # Now part of rootfs: https://github.com/MichaIng/DietPi/issues/2103 - G_EXEC chmod +x /var/lib/dietpi/services/dietpi-wifi-monitor.sh - #------------------------------------------------------------------------------- - # Remove obsolete EMR patch file and redo removal of obsolete script files, as they were not removed from disk: https://github.com/MichaIng/DietPi/pull/2123#issuecomment-428121908 - G_EXEC rm -Rf /boot/dietpi/{.patch_emr,dietpi-{obtain_hw_model,cpu_set,ramlog,logclear,banner}} - #------------------------------------------------------------------------------- - # Remove www-data under sudo without PW: https://github.com/MichaIng/DietPi/issues/2121 - G_EXEC sed --follow-symlinks -i '/^www-data ALL=NOPASSWD: ALL/d' /etc/sudoers - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 17 )); then - - #------------------------------------------------------------------------------- - # Remove mysql.service as we use mariadb.service, both cannot exist: https://github.com/MichaIng/DietPi/issues/1913#issuecomment-441343798 - if [[ -f '/etc/init.d/mysql' ]]; then - - G_DIETPI-NOTIFY 2 'Switching from /etc/init.d/mysql to mariadb.service' - killall -qw mariadb mysqld # Failsafe - G_EXEC systemctl disable --now mysql - G_EXEC rm /etc/init.d/mysql - update-rc.d -f mysql remove - - fi - #------------------------------------------------------------------------------- - # Workarounds - # - Workaround for NanoPi Fire3 with tty1 disabled: https://github.com/MichaIng/DietPi/issues/2225 - if (( $G_HW_MODEL == 62 )) && dmesg | grep -qi 'NanoPi Fire3'; then - - chvt 2 - echo -e '#!/bin/dash\nchvt 2' > /var/lib/dietpi/postboot.d/fire3_tty2 - - fi - #------------------------------------------------------------------------------- - # Reinstalls: - # v6.25 OMPD: https://github.com/MichaIng/DietPi/issues/2156#issue-372201367 - # v6.25 myMPD: https://github.com/MichaIng/DietPi/issues/2156#issue-372201367 - # RoonBridge: https://community.roonlabs.com/t/dietpi-allo-units-not-getting-the-roonbridge-b167-update-from-b164/52503/10?u=dan_knight - # v6.34 Radarr/Lidarr/Sonarr: https://github.com/MichaIng/DietPi/issues/2219 - # v6.33 Mosquitto: https://github.com/MichaIng/DietPi/issues/2243#issuecomment-439492463 - if (( $G_DIETPI_INSTALL_STAGE == 2 )) - then - echo 106 121 144 >> /var/tmp/dietpi/dietpi-update_reinstalls - # - Switch to "mariadb" systemd service on Stretch+: https://github.com/MichaIng/DietPi/pull/2196 - if grep -q '^aSOFTWARE_INSTALL_STATE\[88\]=2' /boot/dietpi/.installed - then - G_WHIP_MSG '[ INFO ] Switch from "mysql" to "mariadb" service -\nOn Stretch (and above) systems, DietPi-Services will use the pre-installed "mariadb" systemd service now, instead of the obsolete "mysql" init.d service. -\nYou will not face any practical differences, since both services start the same MariaDB binary. In case you manually want to handle the service, use "systemctl start|stop|restart mariadb" from now on.' - fi - fi - #------------------------------------------------------------------------------- - # systemd-logind required for shutdown options: https://github.com/MichaIng/DietPi/issues/2155#issuecomment-437702869 - (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[31\]=2' /boot/dietpi/.installed && systemctl unmask systemd-logind - #------------------------------------------------------------------------------- - # Patch Odroid LCD: https://github.com/MichaIng/DietPi/issues/2256 - [[ -f '/etc/systemd/system/odroid-lcd35.service' ]] && /boot/dietpi/func/dietpi-set_hardware lcdpanel odroid-lcd35 - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 18 )); then - - #------------------------------------------------------------------------------- - # Conf renaming: https://github.com/MichaIng/DietPi/pull/2312/files - # - Apache - if [[ -f '/etc/apache2/sites-available/owncloud.conf' ]]; then - - a2dissite owncloud - G_EXEC mv /etc/apache2/sites-available/owncloud.conf /etc/apache2/sites-available/dietpi-owncloud.conf - - fi - if [[ -f '/etc/apache2/sites-available/nextcloud.conf' ]]; then - - a2dissite nextcloud - G_EXEC mv /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-available/dietpi-nextcloud.conf - - fi - if [[ -f '/etc/apache2/sites-available/rutorrent.conf' ]]; then - - a2dissite rutorrent - G_EXEC mv /etc/apache2/sites-available/rutorrent.conf /etc/apache2/sites-available/dietpi-rutorrent.conf - a2ensite dietpi-rutorrent - - fi - # - Nginx - [[ -f '/etc/nginx/sites-dietpi/owncloud.config' ]] && G_EXEC mv /etc/nginx/sites-dietpi/owncloud.config /etc/nginx/sites-dietpi/dietpi-owncloud.conf - [[ -f '/etc/nginx/sites-dietpi/nextcloud.config' ]] && G_EXEC mv /etc/nginx/sites-dietpi/nextcloud.config /etc/nginx/sites-dietpi/dietpi-nextcloud.conf - [[ -f '/etc/nginx/sites-dietpi/rutorrent.config' ]] && G_EXEC mv /etc/nginx/sites-dietpi/rutorrent.config /etc/nginx/sites-dietpi/dietpi-rutorrent.conf - # - Failsafe and custom entries - for i in /etc/nginx/sites-dietpi/*.config - do - - [[ -f $i ]] || break - G_EXEC mv "$i" "${i%ig}" - - done - # - Apply to Nginx vhost - # - Move to v6.19 => v6.20 patch for users, which update directly from v6.19.5 to v6.20 - #grep -q 'include /etc/nginx/sites-dietpi/\*\.config;' /etc/nginx/sites-available/default &> /dev/null && G_CONFIG_INJECT 'include /etc/nginx/sites-dietpi/\*\.config;' 'include /etc/nginx/sites-dietpi/*.conf;' /etc/nginx/sites-available/default - # - Kodi input rules - [[ -f '/etc/udev/rules.d/99-input.rules' ]] && mv /etc/udev/rules.d/99-input.rules /etc/udev/rules.d/99-dietpi-kodi.rules - #------------------------------------------------------------------------------- - # ASUS TB 2.0.8 image, fix corrupt characters in desktops - if (( $G_HW_MODEL == 52 )) && dpkg --get-selections | grep -q 'fonts-dejavu-core'; then - - G_AGI --reinstall libfreetype6 fonts-dejavu-core - G_EXEC fc-cache -r -v - - fi - #------------------------------------------------------------------------------- - # Switch to udev rule for WiFi powersaving disable - rm -f /etc/systemd/system/wifi_disable_powersave.service* - #------------------------------------------------------------------------------- - # - Reinstalls - # Chromium: https://github.com/MichaIng/DietPi/issues/2298 - # v6.27 Allo GUI: https://github.com/MichaIng/DietPi/issues/2305 - # v6.27 GMrender: Due to Allo GUI service enable failure. - # Xorg: XU4 conf - # v6.23 Pydio: https://github.com/MichaIng/DietPi/issues/2308 - (( $G_DIETPI_INSTALL_STAGE == 2 )) && echo 6 113 >> /var/tmp/dietpi/dietpi-update_reinstalls - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 19 )); then - - #------------------------------------------------------------------------------- - # rpi-update drop support info - if command -v rpi-update > /dev/null && G_WHIP_YESNO '[ INFO ] RPi-Update detected\n\nIn our effort to improve system stability, and, offer software installations which build custom modules (eg: WireGuard), we can no longer support systems with non-stock-APT kernel installed (eg: rpi-update).\n\nWould you like to revert to the APT kernel now, ensuring stability and official DietPi system support?'; then - - local arpi_firmware=('raspberrypi-bootloader' 'raspberrypi-kernel' 'libraspberrypi-bin' 'libraspberrypi0') - G_AGP rpi-update - command -v rpi-source > /dev/null && G_EXEC rm "$(command -v rpi-source)" - G_AGI --reinstall "${arpi_firmware[@]}" - apt-mark unhold "${arpi_firmware[@]}" - - fi - #------------------------------------------------------------------------------- - # Apply Nginx vhost patch: https://github.com/MichaIng/DietPi/pull/2327 - # - Moved from v6.18 => v6.19 patch for users, which update directly from v6.19.5 to v6.20 - grep -q 'include /etc/nginx/sites-dietpi/\*\.config;' /etc/nginx/sites-available/default &> /dev/null && G_CONFIG_INJECT 'include /etc/nginx/sites-dietpi/\*\.config;' 'include /etc/nginx/sites-dietpi/*.conf;' /etc/nginx/sites-available/default - #------------------------------------------------------------------------------- - # Migrate Blynk to new dir structure: https://github.com/MichaIng/DietPi/issues/2322 - if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[131\]=2' /boot/dietpi/.installed && - [[ -d '/mnt/dietpi_userdata/blynk' && ! -d '/mnt/dietpi_userdata/blynk/data' ]]; then - - G_EXEC mv /mnt/dietpi_userdata/blynk /mnt/dietpi_userdata/blynk_bak - G_EXEC mv /etc/blynkserver /mnt/dietpi_userdata/blynk - G_EXEC mv /mnt/dietpi_userdata/blynk/server.jar /mnt/dietpi_userdata/blynk/blynkserver.jar - G_EXEC mv /mnt/dietpi_userdata/blynk_bak/server.properties /mnt/dietpi_userdata/blynk/ - G_EXEC mv /mnt/dietpi_userdata/blynk_bak /mnt/dietpi_userdata/blynk/data - G_CONFIG_INJECT 'data.folder=' 'data.folder=/mnt/dietpi_userdata/blynk/data' /mnt/dietpi_userdata/blynk/server.properties - - fi - #------------------------------------------------------------------------------- - # Grafana: Remove obsolete x86_64 APT source, reinstall below to apply official repo: https://github.com/MichaIng/DietPi/issues/2449 - G_EXEC rm -f /etc/apt/sources.list.d/grafana*.list - #------------------------------------------------------------------------------- - # - Reinstalls - # Blynk: Apply new run user, update binary (jar) - # v6.22 Deluge: https://github.com/MichaIng/DietPi/issues/2339 - # Netdata: https://github.com/MichaIng/DietPi/pull/2337 - # NAA Daemon: https://github.com/MichaIng/DietPi/issues/2387#issue-395321320 - # MPD: https://github.com/MichaIng/DietPi/issues/2377 - # Samba: https://github.com/MichaIng/DietPi/issues/2396#issuecomment-451701569 - # v6.33 Amiberry 2.24 - # Shairport Sync: https://github.com/MichaIng/DietPi/issues/2439 - # v6.27 Grafana: https://github.com/MichaIng/DietPi/issues/2449 - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - echo 37 65 124 128 131 >> /var/tmp/dietpi/dietpi-update_reinstalls - - # Samba: Link disk cache to RAM: https://github.com/MichaIng/DietPi/issues/2396 - if grep -q '^aSOFTWARE_INSTALL_STATE\[96\]=2' /boot/dietpi/.installed; then - - G_EXEC rm -Rf /var/cache/samba - G_EXEC mkdir -p /run/samba-cache - G_EXEC ln -s /run/samba-cache /var/cache/samba - G_EXEC eval "echo 'd /run/samba-cache' > /etc/tmpfiles.d/dietpi-samba_cache.conf" - - fi - - fi - #------------------------------------------------------------------------------- - # DietPi file renaming/removal: - # - autologin.conf: https://github.com/MichaIng/DietPi/pull/2343 - [[ -f '/etc/systemd/system/getty@tty1.service.d/autologin.conf' ]] && G_EXEC mv /etc/systemd/system/getty@tty1.service.d/autologin.conf /etc/systemd/system/getty@tty1.service.d/dietpi-autologin.conf - # - README.md: https://github.com/MichaIng/DietPi/pull/2341 - [[ -f '/boot/README.md' ]] && G_EXEC mv /boot/README.md /boot/dietpi-README.md - # - kill-ssh-user-sessions-before-network: https://github.com/MichaIng/DietPi/pull/2357/commits/c8eb15c169cfaba69fec0b3e631e2241e0bdb7d5 - systemctl disable kill-ssh-user-sessions-before-network 2> /dev/null - [[ -f '/etc/systemd/system/kill-ssh-user-sessions-before-network.service' ]] && G_EXEC rm /etc/systemd/system/kill-ssh-user-sessions-before-network.service - [[ -f '/var/lib/dietpi/services/kill-ssh-user-sessions-before-network.sh' ]] && G_EXEC rm /var/lib/dietpi/services/kill-ssh-user-sessions-before-network.sh - systemctl enable dietpi-kill_ssh - # - dietpi-unsupported_terminal.sh: https://github.com/MichaIng/DietPi/issues/2347 - [[ -f '/etc/profile.d/dietpi-unsupported_terminal.sh' ]] && G_EXEC rm /etc/profile.d/dietpi-unsupported_terminal.sh - # - Possible leftover from PREP: - [[ -f '/boot/dietpi/pre-patch_file' ]] && G_EXEC rm /boot/dietpi/pre-patch_file - # - dietpi/conf removal: https://github.com/MichaIng/DietPi/pull/2393 - [[ -d '/boot/dietpi/conf' ]] && G_EXEC rm -R /boot/dietpi/conf - #------------------------------------------------------------------------------- - #.dietpi-autostart_index removal, if zero: https://github.com/MichaIng/DietPi/pull/2343 - [[ -f '/boot/dietpi/.dietpi-autostart_index' ]] && (( $(> /boot/dietpi.txt" - - fi - - # Apply new headless mode method, if set - grep -q '^[[:blank:]]*CONFIG_HDMI_OUTPUT=0' /boot/dietpi.txt && /boot/dietpi/func/dietpi-set_hardware headless 1 - - # Renamed to: AUTO_SETUP_HEADLESS (added by verify_dietpi.txt automatically) - G_EXEC sed --follow-symlinks -i '/CONFIG_HDMI_OUTPUT/d' /boot/config.txt - - fi - #------------------------------------------------------------------------------- - # Buster: "systemd" does not depend on "procps" anymore, thus we need to set it manually installed, simply applied on all distro versions. - G_AGI procps - #------------------------------------------------------------------------------- - # Remove wireless-power setting from /etc/network/interfaces, if not supported by adapter/firmware: https://github.com/MichaIng/DietPi/issues/2198 - iwconfig "$(G_GET_NET -q -t wlan iface)" power off &> /dev/null || sed --follow-symlinks -i '/^wireless-power/d' /etc/network/interfaces - #------------------------------------------------------------------------------- - # Remove Armbian banner/profiles left on ASUS TB image - G_EXEC rm -f /etc/profile.d/armbian-* - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 20 )); then - - #------------------------------------------------------------------------------- - # Image updates - if [[ $G_HW_MODEL == 4[0234] && ! -f '/etc/armbian-release' ]]; then - - G_WHIP_MSG "[ INFO ] The base image for $G_HW_MODEL_NAME has been updated.\n\nPlease reinstall your system with the latest image from https://dietpi.com#download.\n\nYou can continue to use this existing installation, however, some kernel features may not be available." - - fi - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 21 )); then - - #------------------------------------------------------------------------------- - # Redo our /etc/bash.bashrc entry, user confirmed 4 entries: https://github.com/MichaIng/DietPi/issues/2529 - # As well allow ".bash" file ending and remove obsolete dietpi-*.sh scripts: https://github.com/MichaIng/DietPi/pull/2636 - G_EXEC sed --follow-symlinks -i '\#for i in /etc/bashrc#d' /etc/bash.bashrc - # shellcheck disable=SC2016 - G_CONFIG_INJECT '.*/etc/bashrc\.d/.*' 'for i in /etc/bashrc.d/*.sh /etc/bashrc.d/*.bash; do [ -r "$i" ] && . $i; done' /etc/bash.bashrc - G_EXEC rm -f /etc/bashrc.d/dietpi-*.sh - #------------------------------------------------------------------------------- - # Mopidy fix: https://github.com/MichaIng/DietPi/issues/2536 - getent passwd mopidy > /dev/null && G_EXEC usermod -aG dietpi,audio -d /mnt/dietpi_userdata/mopidy mopidy - #------------------------------------------------------------------------------- - # Removed dependency on "p7zip-full", use "7zr" (p7zip) instead: https://github.com/MichaIng/DietPi/pull/2559 - G_AGI p7zip - if dpkg-query -s p7zip-full &> /dev/null && - ! G_WHIP_BUTTON_OK_TEXT='Yes' G_WHIP_BUTTON_CANCEL_TEXT='No' G_WHIP_YESNO '[QUESTION] Do you want to keep "p7zip-full"?\n -DietPi does not require the "p7zip-full" package anymore but just "p7zip" instead. -- "p7zip" provides the lightweight standalone "7zr" command to handle 7zip archives only. -- "p7zip-full" additionally provides the "7z" and "7za" commands which can handle other archive types as well. - However, DietPi internally uses "unzip", "tar" and "unrar" to handle those.\n -Do you still want to keep "p7zip-full"?'; then - - apt-mark auto p7zip-full - G_AGA - - fi - #------------------------------------------------------------------------------- - # Fix Pi-hole permissions to allow "pihole -up" - if [[ -d '/var/www/html/pihole' && -d '/var/www/html/admin' ]]; then - - G_EXEC cd /var/www/html/admin - git reset --hard HEAD - G_EXEC cd "$G_WORKING_DIR" - - fi - #------------------------------------------------------------------------------- - # MPD: Fix permissions issue: https://github.com/MichaIng/DietPi/issues/2462 - if [[ -f '/etc/mpd.conf' ]]; then - - G_EXEC sed --follow-symlinks -Ei '/^(user|group)[[:blank:]]/d' /etc/mpd.conf - G_EXEC sed --follow-symlinks -i '/^Group=/d' /lib/systemd/system/mpd.service - G_CONFIG_INJECT 'User=' 'User=mpd' /lib/systemd/system/mpd.service '\[Service\]' - G_CONFIG_INJECT 'PermissionsStartOnly=' 'PermissionsStartOnly=true' /lib/systemd/system/mpd.service '^User=mpd' - getent passwd mpd > /dev/null && G_EXEC usermod -aG audio,dietpi mpd - - fi - #------------------------------------------------------------------------------- - # Fix rc-local.service from old images to match new systemd-rc-local-generator: https://github.com/MichaIng/DietPi/issues/2566 - systemctl disable rc-local rc.local - grep -q 'dietpi' /lib/systemd/system/rc-local.service && cat << '_EOF_' > /lib/systemd/system/rc-local.service -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -# This unit gets pulled automatically into multi-user.target by -# systemd-rc-local-generator if /etc/rc.local is executable. -[Unit] -Description=/etc/rc.local Compatibility -ConditionFileIsExecutable=/etc/rc.local -After=network.target - -[Service] -Type=forking -ExecStart=/etc/rc.local start -TimeoutSec=0 -RemainAfterExit=yes -GuessMainPID=no -_EOF_ - #------------------------------------------------------------------------------- - # Remove obsolete DietPi-Sync log: https://github.com/MichaIng/DietPi/pull/2606 - [[ -f '/var/log/dietpi-sync.log' ]] && rm /var/log/dietpi-sync.log - #------------------------------------------------------------------------------- - # XU4, use Meveric's xorg.conf which detects 3.x and 4.x kernel configuration requirements: - if [[ $G_HW_MODEL == 11 && -f '/etc/X11/xorg.conf' ]]; then - - G_EXEC rm /etc/X11/xorg.conf - G_AGI --reinstall firmware-samsung xf86-video-armsoc-odroid malit628-odroid - - fi - #------------------------------------------------------------------------------- - # RPi | Remove "framebuffer_depth" handling: https://github.com/MichaIng/DietPi/pull/2635 - (( $G_HW_MODEL < 10 )) && G_EXEC sed --follow-symlinks -i '/framebuffer_depth/d' /boot/config.txt - #------------------------------------------------------------------------------- - # Nextcloud: Add OCM/OCS provider redirects as this is checked and printed as warning on admin panel: https://github.com/MichaIng/DietPi/issues/2638 - if [[ -f '/etc/apache2/sites-available/dietpi-nextcloud.conf' ]] && - ! grep -q 'oc[ms]-provider' /etc/apache2/sites-available/dietpi-nextcloud.conf; then - - echo 'Redirect permanent /ocm-provider /nextcloud/ocm-provider -Redirect permanent /ocs-provider /nextcloud/ocs-provider' >> /etc/apache2/sites-available/dietpi-nextcloud.conf - - fi - if [[ -f '/etc/lighttpd/conf-available/99-dietpi-nextcloud.conf' ]] && - ! grep -q 'oc[ms]-provider' /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf; then - - echo 'url.redirect += ( - "^/ocm-provider" => "/nextcloud/ocm-provider", - "^/ocs-provider" => "/nextcloud/ocs-provider" -)' >> /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf - - fi - if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] && ! grep -q 'oc[ms]-provider' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf; then - - # shellcheck disable=SC2016 - echo 'location ~ ^\/(?:ocm-provider|ocs-provider).* { - rewrite ^ /nextcloud$request_uri; -}' >> /etc/nginx/sites-dietpi/dietpi-nextcloud.conf - - fi - #------------------------------------------------------------------------------- - # Reinstalls - # v6.33 Amiberry 2.25: https://github.com/MichaIng/DietPi/issues/2599 - # v6.27 Allo GUI v13: https://github.com/sparky-sbc/sparky-test/tree/master/dietpi-gui-usbdebug - # Deluge: Patch according to installer rework: https://github.com/MichaIng/DietPi/pull/2594 - # rTorrent: https://github.com/MichaIng/DietPi/issues/2629 - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - local reinstall_indices= - - if [[ -f '/root/.rtorrent.rc' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[107\]=2' /boot/dietpi/.installed; then - - reinstall_indices+=' 107' - G_CONFIG_INJECT 'system.umask.set[[:blank:]=]' 'system.umask.set = 002' /root/.rtorrent.rc - G_EXEC mkdir -p /mnt/dietpi_userdata/rtorrent - G_EXEC mv /root/.rtorrent.rc /mnt/dietpi_userdata/rtorrent/ - - fi - - if grep -q '^aSOFTWARE_INSTALL_STATE\[45\]=2' /boot/dietpi/.installed && getent passwd deluge > /dev/null; then # Only do this once, regardless of re-patches - - reinstall_indices+=' 45' - - G_AGP deluge-webui - G_EXEC mkdir -p /var/log/deluged /mnt/dietpi_userdata - [[ -e ~deluge ]] && G_EXEC mv ~deluge /mnt/dietpi_userdata/deluge_home_backup - G_EXEC userdel -rf deluge - G_EXEC rm -Rf /{root,home/*}/.config/deluge - [[ -f '/var/log/deluged.log' ]] && G_EXEC mv /var/log/deluged.log /var/log/deluged/daemon.log - [[ -f '/var/log/deluge-web.log' ]] && G_EXEC mv /var/log/deluge-web.log /var/log/deluged/web.log - - G_WHIP_MSG '[ INFO ] Deluge rework\n -Our Deluge installer has been reworked to match Debian APT package defaults and official documentations. This also resolves an issue when attempting to access "deluge-console". -- It runs now as user "debian-deluged". -- The user "deluge" has been removed, its home directory has been backed up to: - /mnt/dietpi_userdata/deluge_home_backup - in case it existed. -- Logs have been moved to /var/log/deluged/daemon.log|web.log. -- Apart from that, all your settings and data have been preserved.\n -NB: When accessing "deluge-console" you need to do that as user "debian-deluged": - sudo -u debian-deluged deluge-console' - - fi - - echo "$reinstall_indices" >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 22 )); then - - #------------------------------------------------------------------------------- - # Apply Serial/UART rework: https://github.com/MichaIng/DietPi/pull/2678 - # - Cleanup: Remove serial-getty masks for all non-existent serial devices - for i in /etc/systemd/system/serial-getty@tty{S,AMA,SAC}[0-9].service - do - [[ -L $i && $(readlink "$i") == '/dev/null' ]] || continue - local tty=${i##*serial-getty@} - tty=${tty%.service} - [[ -e /dev/$tty ]] || systemctl unmask "serial-getty@$tty" - done - # - Fix: Disable serial-getty instances for all non-existent serial devices - for i in /etc/systemd/system/getty.target.wants/serial-getty@tty{S,AMA,SAC}[0-9].service - do - [[ -L $i ]] || continue - local tty=${i##*serial-getty@} - tty=${tty%.service} - [[ -e /dev/$tty ]] || systemctl disable "serial-getty@$tty" - done - #------------------------------------------------------------------------------- - # Patch proxy settings changes: https://github.com/MichaIng/DietPi/pull/2716 - sed --follow-symlinks -i '/^[[:blank:]]*CONFIG_PROXY_ENABLED=/d' /boot/dietpi.txt - local proxy='' - if proxy=$(grep '^[[:blank:]]*export {http,https,ftp}_proxy=' /etc/bash.bashrc); then - - [[ -f '/etc/bashrc.d/dietpi-proxy.sh' ]] || echo "$proxy" > /etc/bashrc.d/dietpi-proxy.sh - G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*export {http,https,ftp}_proxy=/d' /etc/bash.bashrc - - fi - #------------------------------------------------------------------------------- - # dietpi-set_dphys-swapfile renamed to: "dietpi-set_swapfile": https://github.com/MichaIng/DietPi/pull/2720 - [[ -f '/boot/dietpi/func/dietpi-set_dphys-swapfile' ]] && rm /boot/dietpi/func/dietpi-set_dphys-swapfile - #------------------------------------------------------------------------------- - # Remove obsolete OpenJDK APT preferences on Jessie: https://github.com/MichaIng/DietPi/pull/2753 - [[ -f '/etc/apt/preferences.d/99-dietpi-openjdk-8-jdk' ]] && rm /etc/apt/preferences.d/99-dietpi-openjdk-8-jdk - #------------------------------------------------------------------------------- - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - # Infom Sonarr/Radarr/Lidarr users about DietPi-Arr_to_RAM: https://github.com/MichaIng/DietPi/pull/2698 - grep -qE '^aSOFTWARE_INSTALL_STATE\[(106|144|145)\]=2' /boot/dietpi/.installed && G_WHIP_MSG 'DietPi-Arr_to_RAM | Link Sonarr/Radarr/Lidarr database files to RAM\n -With v6.18 we silently added a new script that allows linking Sonarr/Radarr/Lidarr database files to RAM, increasing access performance, reducing disk I/O and avoiding constant external HDD spinning due to the very regular access to these files.\n -This script has gone through some rework and polishing with v6.23 and can now be enabled to automatically link those databases to RAM on boot and store them back to disk on shutdown.\n -Further info and usage: https://dietpi.com/forum/t/dietpi-arr-to-ram-link-sonarr-radarr-lidarr-database-files-to-ram/3120' - #----------------------------------------------------------------------- - # Fix IPv6 connections with WireGuard: https://github.com/MichaIng/DietPi/issues/2691 - if [[ -f '/etc/wireguard/wg0.conf' ]] && ! grep -q 'sysctl' /etc/wireguard/wg0.conf; then - - [[ -f '/etc/sysctl.d/dietpi-wireguard.conf' ]] && G_EXEC rm /etc/sysctl.d/dietpi-wireguard.conf - sed --follow-symlinks -i "/^ListenPort/a\PostUp = sysctl net.ipv4.conf.%i.forwarding=1 net.ipv4.conf.\$(ip r l 0/0 | mawk '{print \$5;exit}').forwarding=1" /etc/wireguard/wg0.conf - sed --follow-symlinks -i "/^ListenPort/a\PostUp = sysctl net.ipv6.conf.\$(ip r l 0/0 | mawk '{print \$5;exit}').accept_ra=2" /etc/wireguard/wg0.conf - sed --follow-symlinks -i "/^ListenPort/a\PostUp = sysctl net.ipv6.conf.%i.forwarding=1 net.ipv6.conf.\$(ip r l 0/0 | mawk '{print \$5;exit}').forwarding=1" /etc/wireguard/wg0.conf - sed --follow-symlinks -i "/^ListenPort/a\PostUp = ip6tables -A FORWARD -i %i -j ACCEPT; ip6tables -t nat -A POSTROUTING -o \$(ip r l 0/0 | mawk '{print \$5;exit}') -j MASQUERADE" /etc/wireguard/wg0.conf - sed --follow-symlinks -i "/^ListenPort/a\PostDown = ip6tables -D FORWARD -i %i -j ACCEPT; ip6tables -t nat -D POSTROUTING -o \$(ip r l 0/0 | mawk '{print \$5;exit}') -j MASQUERADE" /etc/wireguard/wg0.conf - - fi - #----------------------------------------------------------------------- - # NordVPN: Tiny fix for doubled auth-user-pass entry: https://github.com/MichaIng/DietPi/commit/847a016638c6929153dc16e7ce054d3dce5e4c60 - if [[ -f '/var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/settings_dietpi.conf' ]]; then - - local PROTOCOL NORDVPN_SERVER - # shellcheck disable=SC1091 - . /var/lib/dietpi/dietpi-software/installed/dietpi-nordvpn/settings_dietpi.conf - if [[ -f /etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER && $(grep -c '^auth-user-pass' "/etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER") == 2 ]]; then - - sed --follow-symlinks -i '/^auth-user-pass$/d' "/etc/openvpn/ovpn_$PROTOCOL/$NORDVPN_SERVER" - - fi - unset -v NORDVPN_USERNAME NORDVPN_PASSWORD NORDVPN_SERVER PROTOCOL - - fi - #----------------------------------------------------------------------- - # Remove obsolete "bluetooth" meta package and mark bluez instead - if dpkg-query -s bluetooth &> /dev/null; then - - apt-mark manual bluez - apt-mark auto bluetooth - G_AGA - - fi - #----------------------------------------------------------------------- - # Add /etc/network/interfaces.d/ drop-in config support - grep -q 'interfaces\.d' /etc/network/interfaces || sed --follow-symlinks -i '1i\source interfaces.d/*' /etc/network/interfaces - #----------------------------------------------------------------------- - # Blynk: Fix logging and move to RAMlog: https://github.com/MichaIng/DietPi/pull/2779 - if [[ -f '/etc/systemd/system/blynkserver.service' && -f '/mnt/dietpi_userdata/blynk/server.properties' ]]; then - - G_CONFIG_INJECT 'WorkingDirectory=' 'WorkingDirectory=/mnt/dietpi_userdata/blynk' /etc/systemd/system/blynkserver.service '\[Service\]' - G_EXEC mkdir -p /var/log/blynk - G_EXEC chown -R blynk:dietpi /var/log/blynk - G_CONFIG_INJECT 'logs.folder=' 'logs.folder=/var/log/blynk' /mnt/dietpi_userdata/blynk/server.properties - - fi - #----------------------------------------------------------------------- - # PHP7.3 migration: https://github.com/MichaIng/DietPi/issues/2367 - # - Only upgrade versions lower than 7.2 and skip any check version Buster+ where this is impossible - if (( $G_DISTRO < 5 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[89\]=2' /boot/dietpi/.installed && ! command -v php7.{2,3} > /dev/null; then - - echo 89 >> /var/tmp/dietpi/dietpi-update_reinstalls - - # Software which does not support PHP7.3, install PHP7.2 instead - local PHP_NAME='php7.3' - # - ownCloud up to v10.2 - if [[ -f '/var/www/owncloud/version.php' ]]; then - - # shellcheck disable=SC2016 - local oc_version_major=$(sed -n '/$OC_VersionString/{s/^[^0-9]*//;s/\..*$//;p;q}' /var/www/owncloud/version.php) - # shellcheck disable=SC2016 - local oc_version_minor=$(sed -n '/$OC_VersionString/{s/^[^.]*\.//;s/\..*$//;p;q}' /var/www/owncloud/version.php) - (( $oc_version_major < 10 || ( $oc_version_major == 10 && oc_version_minor < 3 ) )) && PHP_NAME='php7.2' - - fi - - G_WHIP_MSG "[ INFO ] PHP upgrade\n -Your PHP instance will be upgraded to ${PHP_NAME^^}. This enhances security and performance of your web applications and is required to run some of the latest web application versions, e.g. Nextcloud 17, ownCloud 10.3, phpBB 3.3 and others.\n -We will update webserver configurations and backup the whole /etc/php directory to /etc/php_bak, so you can recover custom settings.\n -NB: For any custom PHP-dependent web applications, which you have installed manually (outside of DietPi-Software), you might need to adjust the used socket to: /run/php/$PHP_NAME-fpm.sock -NBB: Reinstall manually installed PHP modules via: G_AGI $PHP_NAME-" - - # Backup config - [[ -d '/etc/php' ]] && G_EXEC cp -a /etc/php{,_bak} - - # Update PHP socket - # - Lighttpd - [[ -f '/etc/lighttpd/conf-available/15-fastcgi-php.conf' ]] && sed --follow-symlinks -i "s@\"socket\".*\$@\"socket\" => \"/run/php/$PHP_NAME-fpm.sock\",@" /etc/lighttpd/conf-available/15-fastcgi-php.conf - # - Nginx - [[ -f '/etc/nginx/nginx.conf' ]] && sed --follow-symlinks -i "s#/run/php.*-fpm.sock#/run/php/$PHP_NAME-fpm.sock#g" /etc/nginx/nginx.conf - - # Mark old PHP packages for autoremoval - local apackages=() - mapfile -t apackages < <(dpkg --get-selections 'php7.[01]-*' 'libapache2-mod-php7.[01]' 2> /dev/null | mawk '{print $1}') - apt-mark auto "${apackages[@]}" 2> /dev/null - unset -v apackages - - # Disable old mod-php so that new version is enabled automatically on package install - command -v a2dismod > /dev/null && a2dismod php7.{0,1} 2> /dev/null - - fi - #----------------------------------------------------------------------- - # Reinstalls - # Subsonic: https://github.com/MichaIng/DietPi/pull/2705 - [[ -L '/var/subsonic/transcode' ]] && rm /var/subsonic/transcode - # Plex Media Server: https://github.com/MichaIng/DietPi/pull/2722 - dpkg-query -s plexmediaserver-installer &> /dev/null && dpkg -r plexmediaserver-installer - # Logitech Media Server: https://github.com/MichaIng/DietPi/commit/eccef6700381c3f044ec4d435beb167736db0bb4 - if [[ -f '/etc/systemd/system/squeezeboxserver.service' ]]; then - - systemctl disable --now squeezeboxserver - mv /etc/systemd/system/squeezeboxserver.service /etc/systemd/system/logitechmediaserver.service - - fi - [[ -d '/etc/systemd/system/squeezeboxserver.service.d' ]] && mv /etc/systemd/system/squeezeboxserver.service.d /etc/systemd/system/logitechmediaserver.service.d - # SABnzbd: https://github.com/MichaIng/DietPi/pull/2768 - # v6.27 Jackett: https://github.com/MichaIng/DietPi/pull/2773 - if [[ -d '/opt/jackett/.config' ]]; then - - G_EXEC cp -a /opt/jackett/.config/. /opt/jackett/ - G_EXEC rm -R /opt/jackett/.config - - fi - echo 34 35 42 47 48 114 139 >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 23 )); then - - #------------------------------------------------------------------------------- - # Add Plex and Emby users to dietpi group to grant media and network mount access - getent passwd emby > /dev/null && usermod -aG dietpi emby - getent passwd plex > /dev/null && usermod -aG dietpi plex - #------------------------------------------------------------------------------- - # Patch Lighttpd config file on ARMv6 (Buster version installed): https://github.com/MichaIng/DietPi/issues/2808 - if [[ -f '/etc/lighttpd/lighttpd.conf' && ! -f '/usr/share/lighttpd/create-mime.assign.pl' && -f '/usr/share/lighttpd/create-mime.conf.pl' ]]; then - - sed --follow-symlinks -i 's|/usr/share/lighttpd/create-mime\.assign\.pl|/usr/share/lighttpd/create-mime.conf.pl|g' /etc/lighttpd/lighttpd.conf - - fi - #------------------------------------------------------------------------------- - # Restart DietPi-WiFi-Monitor to apply fixed script now: https://github.com/MichaIng/DietPi/issues/2802 - systemctl -q is-active dietpi-wifi-monitor && systemctl restart dietpi-wifi-monitor - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 24 )); then - - #------------------------------------------------------------------------------- - # DietPi-Services 2.0 - rm -f /boot/dietpi/{,.}dietpi-process_tool - if [[ -f '/usr/share/applications/dietpi-process_tool.desktop' ]]; then - - G_EXEC rm /usr/share/applications/dietpi-process_tool.desktop - G_EXEC curl -sSfL "https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/apps/dietpi-services.desktop" -o /usr/share/applications/dietpi-services.desktop - G_EXEC chmod +x /usr/share/applications/dietpi-services.desktop - - fi - #------------------------------------------------------------------------------- - # Disable APT cache by default (leaves package download dir at disk by default) - if [[ ! -f '/etc/apt/apt.conf.d/99-dietpi-cache' ]]; then - - G_WHIP_MSG '[ INFO ] Disabling APT cache\n -We added new options to "dietpi-config" > "Advanced Options" > "APT Cache" to disable the APT cache or move cache, repo lists and/or package download dir to RAM.\n -By default we disable the APT cache, which saves 50 - 100 MiB disk writes on each "apt-get update" call, but slows down "apt-cache" calls.\n -Use "dietpi-config" to adjust these settings to your needs.' - /boot/dietpi/func/dietpi-set_software apt-cache cache disable - - fi - #------------------------------------------------------------------------------- - # FFmpeg on RPi: Failsafe reinstall new APT package and mark priorly required libraries as auto + autoremove - if (( $G_HW_MODEL < 10 )) && command -v ffmpeg > /dev/null; then - - [[ $(ffmpeg -version 2> /dev/null | sed -n '1{s/[^0-9]//g;p}') == 32* ]] && G_AGI --reinstall ffmpeg - apt-mark auto libx264 libmp3lame libfdk-aac - G_AGA - - fi - #------------------------------------------------------------------------------- - # Node-RED: Enable sudo permissions for all installs: https://github.com/MichaIng/DietPi/issues/2910 - getent passwd nodered > /dev/null && echo 'nodered ALL=NOPASSWD: ALL' > /etc/sudoers.d/nodered - #------------------------------------------------------------------------------- - # DietPi-Survey now uses dietpi.txt for opt in/out state - if [[ -f '/boot/dietpi/.dietpi-survey' ]]; then - - G_CONFIG_INJECT 'SURVEY_OPTED_IN=' "SURVEY_OPTED_IN=$(mawk 'NR==1' /boot/dietpi/.dietpi-survey)" /boot/dietpi.txt - G_EXEC rm /boot/dietpi/.dietpi-survey - - fi - #------------------------------------------------------------------------------- - # Remove obsolete dietpi.txt entries - # - https://github.com/MichaIng/DietPi/commit/b330594f0e63a40a75484647033c3b393ecd05b3#diff-aca2a37c06074a66f2588f7c9e84d07a - G_EXEC sed --follow-symlinks -i '/AUTO_SETUP_NET_WIFI/{/AUTO_SETUP_NET_WIFI_ENABLED/!d}' /boot/dietpi.txt - # - https://github.com/MichaIng/DietPi/commit/814823899667e896291ed240281cfd39971463d9#diff-aca2a37c06074a66f2588f7c9e84d07a - G_EXEC sed --follow-symlinks -i '/CONFIG_SMBCLIENT/d' /boot/dietpi.txt - G_EXEC sed --follow-symlinks -i '/CONFIG_CURLFTPFS/d' /boot/dietpi.txt - G_EXEC sed --follow-symlinks -i '/CONFIG_NFSCLIENT/d' /boot/dietpi.txt - #------------------------------------------------------------------------------- - # Transmission: Fix web UI settings not being applied to settings file: https://github.com/MichaIng/DietPi/issues/2793 - [[ -f '/etc/systemd/system/transmission-daemon.service.d/dietpi-group.conf' ]] && echo -e '[Service]\nGroup=dietpi\nSupplementaryGroups=debian-transmission' > /etc/systemd/system/transmission-daemon.service.d/dietpi-group.conf - #------------------------------------------------------------------------------- - # RPi I-Sabre-Q2M: Switch systems to use the new integrated "i-sabre-q2m" overlay + remove obsolete "snd-bcm2835" module blacklisting (instead disable dtparam if blacklist found) - [[ -f '/boot/config.txt' ]] && sed --follow-symlinks -i 's/i-sabre-k2m/i-sabre-q2m/g' /boot/config.txt - if [[ -f '/etc/modprobe.d/rpi-bcm2708.conf' ]]; then - - G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=off' /boot/config.txt - G_EXEC rm /etc/modprobe.d/rpi-bcm2708.conf - - fi - #------------------------------------------------------------------------------- - # x86_64: Cleanup config files to disable nouveau - if (( $G_HW_ARCH == 10 )); then - - G_EXEC rm -f /etc/modprobe.d/*nouveau* - cat << '_EOF_' > /etc/modprobe.d/dietpi-disable_nouveau.conf -blacklist nouveau -blacklist lbm-nouveau -options nouveau modeset=0 -alias nouveau off -alias lbm-nouveau off -_EOF_ - # Update initramfs with above changes - if command -v update-tirfs > /dev/null; then - - update-tirfs - - else - - update-initramfs -u - - fi - - fi - #------------------------------------------------------------------------------- - # RPi Buster: Re-apply firmware Buster-only repo, remove Stretch branch, reinstall raspi-copies-and-fills (on ARMv6/7 models) which is now compatible - if (( $G_HW_MODEL < 10 && $G_DISTRO == 5 )); then - - echo 'deb https://archive.raspberrypi.org/debian/ buster main' > /etc/apt/sources.list.d/raspi.list - G_AGUP - (( $G_HW_ARCH == 3 )) || G_AGI raspi-copies-and-fills - - fi - #------------------------------------------------------------------------------- - # Install "haveged" entropy daemon by default on all non-RPi systems: https://github.com/MichaIng/DietPi/issues/2806 - (( $G_HW_MODEL > 9 )) && G_AGI haveged - #------------------------------------------------------------------------------- - # RPi3: Remove doubled config.txt temp_limit value due to: https://github.com/MichaIng/DietPi/commit/cafcbc599ef23c337e75003fb8eacc446877eaba#diff-68acf994541fd7b6ea4f6b02d04ee328L60 - if [[ $G_HW_MODEL == 3 ]] && (( $(grep -c '^[[:blank:]#]*temp_limit=' /boot/config.txt) > 1 )); then - - local current=$(grep '^[[:blank:]]*temp_limit=' /boot/config.txt | sed 's/^[^=]*=//' | tail -1) # Get current effective (last) value - disable_error=1 G_CHECK_VALIDINT "$current" || current=75 # If none, use 75'c as DietPi default on RPi3 - G_EXEC sed --follow-symlinks -i '/^[[:blank:]#]*temp_limit=/d' /boot/config.txt # Remove all entries, including comments - G_CONFIG_INJECT 'temp_limit=' "temp_limit=$current" /boot/config.txt # Re-add current effective value or default - - fi - #------------------------------------------------------------------------------- - # Reinstalls: - # O!MPD update to master: https://github.com/MichaIng/DietPi/pull/2884 - # myMPD update to master: https://github.com/MichaIng/DietPi/pull/2883 - # Gitea update to v1.8.X: https://github.com/MichaIng/DietPi/pull/2881 - # MPD: Remove obsolete and wrong RuntimeDirectory definition: https://github.com/MichaIng/DietPi/commit/882ddfb533fdc1fa597231824810909770a910c9 - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - [[ -f '/lib/systemd/system/mpd.service' ]] && sed --follow-symlinks -i '/^[[:blank:]]*RuntimeDirectory=/d' /lib/systemd/system/mpd.service - [[ -f '/var/www/ompd/include/config.inc.php' && ! -f '/var/www/ompd/include/config.local.inc.php' ]] && mv /var/www/ompd/include/config.inc.php /var/www/ompd/include/config.local.inc.php - if grep -q '^aSOFTWARE_INSTALL_STATE\[148\]=2' /boot/dietpi/.installed; then - - G_WHIP_MSG '[ INFO ] myMPD will be updated to latest upstream version\n -Due to changes in how its configuration file "/etc/mympd/mympd.conf" is structured, we need to reset it. -A backup will be created to "/etc/mympd/mympd.conf.bak_DDMMYYY_N" from where you can recover custom settings.' - G_BACKUP_FP /etc/mympd/mympd.conf - [[ -f '/etc/mympd/mympd.conf' ]] && rm /etc/mympd/mympd.conf - [[ -f '/etc/mympd/mympd.conf.dist' ]] && rm /etc/mympd/mympd.conf.dist - # - Revert to systemd unit provided by installer - [[ -f '/lib/systemd/system/mympd.service' ]] && rm /lib/systemd/system/mympd.service - - fi - echo 129 148 165 >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 25 )); then - - #------------------------------------------------------------------------------- - # Remove possible OpenMediaVault leftovers, that are not part of current OMV packages, thus save to remove: https://github.com/MichaIng/DietPi/issues/2994 - [[ -f '/etc/cron.d/openmediavault-rrdtoolgraph' ]] && rm /etc/cron.d/openmediavault-rrdtoolgraph - [[ -f '/usr/sbin/omv-mkgraph' ]] && rm /usr/sbin/omv-mkgraph - #------------------------------------------------------------------------------- - # Disable pihole.log query logging: https://github.com/pi-hole/FTL/issues/614#issuecomment-510564476 - command -v pihole > /dev/null && pihole -l off - #------------------------------------------------------------------------------- - # Remove obsolete audio related services/scripts/settings: https://github.com/MichaIng/DietPi/pull/2988 - # RPi: Remove invalid I2C baudrate entries from config.txt. Do no apply any value to preserve current system state (default): https://github.com/MichaIng/DietPi/issues/2966 - # RPi: Remove obsolete camera module entry, which is loaded by default since kernel 4.19, instead add a blacklist entry if camera is disabled. - # RPi: Further config.txt fixes: https://github.com/MichaIng/DietPi/pull/3000 - [[ -f '/var/lib/dietpi/postboot.d/sparky_unmute.sh' ]] && rm /var/lib/dietpi/postboot.d/sparky_unmute.sh - [[ -f '/etc/systemd/system/rpi-bcm2835_forced_3.5mm.service' ]] && rm /etc/systemd/system/rpi-bcm2835_forced_3.5mm.service - if (( $G_HW_MODEL < 10 )); then - - G_EXEC sed --follow-symlinks -i '/dtoverlay=i2s-mmap/d' /boot/config.txt - G_EXEC sed --follow-symlinks -i '/dtoverlay=i2s=/d' /boot/config.txt - G_EXEC sed --follow-symlinks -i '/dtoverlay=lirc-rpi/d' /boot/config.txt - G_EXEC sed --follow-symlinks -i '/^[[:blank:]#]*dtparam=gpio_in_pin=25/d' /boot/config.txt - G_EXEC sed --follow-symlinks -i '/^[[:blank:]#]*i2c_arm_baudrate=/d' /boot/config.txt - G_EXEC sed --follow-symlinks -i '/^[[:blank:]#]*bcm2835-v4l2/d' /etc/modules - grep -q '^[[:blank:]]*start_x=1' /boot/config.txt || /boot/dietpi/func/dietpi-set_hardware rpi-camera disable - [[ -f '/etc/modprobe.d/disable_bt.conf' ]] && G_CONFIG_INJECT 'dtoverlay=disable-bt' 'dtoverlay=disable-bt' /boot/config.txt - [[ -f '/etc/modprobe.d/disable_wifi_rpi3_onboard.conf' ]] && G_CONFIG_INJECT 'dtoverlay=disable-wifi' 'dtoverlay=disable-wifi' /boot/config.txt - # Offer re-adding of "initial_turbo" on RPi: https://github.com/MichaIng/DietPi/issues/3147 - if ! grep -q '^[[:blank:]]*initial_turbo' /boot/config.txt; then - - G_EXEC sed --follow-symlinks -i '\|issues/1836|d' /boot/config.txt # Remove obsolete comment - G_WHIP_BUTTON_OKAY_TEXT='Yes' G_WHIP_BUTTON_CANCEL_TEXT='No' G_WHIP_YESNO 'Re-adding "initial_turbo" option\n -The firmware issues with the "initial_turbo" option have been fixed a recent update: https://github.com/raspberrypi/firmware/issues/1005\n -This option allows you to force highest CPU frequency for a set amount of seconds during boot. This significantly reduces boot time on RPi since it by default boots with lowest frequencies, until a systemd unit sets the chosen CPU governor at later boot stage. You can now set this setting again via: - - dietpi-config > Performance Options > ARM Initial Turbo\n -Do you want to have the recommended "initial_turbo=20" re-added to your config.txt now?' && G_CONFIG_INJECT 'initial_turbo=' 'initial_turbo=20' /boot/config.txt - - fi - - fi - #------------------------------------------------------------------------------- - # Docker: Remove obsolete RPi fix: https://github.com/MichaIng/DietPi/issues/2282 (new version is available now) - [[ -f '/etc/apt/preferences.d/dietpi-docker_fix' ]] && rm /etc/apt/preferences.d/dietpi-docker_fix - #------------------------------------------------------------------------------- - # Config file renaming: https://github.com/MichaIng/DietPi/pull/3000 - [[ -f '/etc/modprobe.d/disable_bt.conf' ]] && mv /etc/modprobe.d/disable_bt.conf /etc/modprobe.d/dietpi-disable_bluetooth.conf - [[ -f '/etc/modprobe.d/disable_wifi.conf' ]] && mv /etc/modprobe.d/disable_wifi.conf /etc/modprobe.d/dietpi-disable_wifi.conf - [[ -f '/etc/modprobe.d/disable_wifi_rpi3_onboard.conf' ]] && rm /etc/modprobe.d/disable_wifi_rpi3_onboard.conf - for i in '8192cu' '8188eu' '8189es' '8723bs' 'wlan_8192eu' - do - - [[ -f /etc/modprobe.d/${i}.conf ]] || continue - cat "/etc/modprobe.d/${i}.conf" >> /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf - G_EXEC rm "/etc/modprobe.d/${i}.conf" - - done - #------------------------------------------------------------------------------- - # Remove old scripts/files that have been removed from code source long time ago but never from updated systems - G_EXEC rm -f /boot/dietpi/func/dietpi-set_{curlftpfs,nfsclient,smbclient} - G_EXEC rm -f /boot/dietpi/.dietpi-backup_{include,exclude} - [[ -f '/var/log/boottime' ]] && G_EXEC rm /var/log/boottime # https://github.com/MichaIng/DietPi/commit/e6713f874cac47ef11912e3455bf1abe58bfd412 - #------------------------------------------------------------------------------- - # Move DietPi-NordVPN service to /etc/systemd/system: https://github.com/MichaIng/DietPi/pull/3084 - [[ -f '/lib/systemd/system/dietpi-nordvpn.service' ]] && mv /lib/systemd/system/dietpi-nordvpn.service /etc/systemd/system/dietpi-nordvpn.service - #------------------------------------------------------------------------------- - # RPi - # - Replace haveged with rng-tools5, which is proven to work on RPi, is default on Raspbian and uses less RAM on idle - # - Fix headless mode - # - Remove obsolete Kodi repo for Beta testers + replace obsolete kodi-rpi4 package with new official Kodi from RPi repository - # - On RPi4 raise temp_limit from 65°C tp 75°C as new default value: https://github.com/MichaIng/DietPi/issues/3151 - if (( $G_HW_MODEL < 10 )); then - - systemctl disable --now haveged 2> /dev/null - G_AGP haveged - G_AGI rng-tools5 - if grep -q '^[[:blank:]]*hdmi_ignore_hotplug=1' /boot/config.txt && grep -q '^[[:blank:]]*hdmi_ignore_composite=1' /boot/config.txt; then - - /boot/dietpi/func/dietpi-set_hardware headless enable - tvservice -o - - fi - G_EXEC sed --follow-symlinks -i '/hdmi_ignore_composite/d' /boot/config.txt - G_EXEC rm -f /etc/apt/sources.list.d/{dietpi-kodi,pipplware,kodi}.list - if dpkg-query -s kodi-rpi4 &> /dev/null; then - - G_DIETPI-NOTIFY 2 'Replacing obsolete kodi-rpi4 package with new official Kodi from RPi repository...' - G_AGP kodi-rpi4 - mkdir -p /etc/polkit-1/localauthority/50-local.d # https://github.com/MichaIng/DietPi/issues/3031#issuecomment-540477241 - G_AGI kodi - - fi - (( $G_HW_MODEL == 4 )) && grep -q '^[[:blank:]]*temp_limit=65' /boot/config.txt && G_CONFIG_INJECT 'temp_limit=' 'temp_limit=75' /boot/config.txt - - fi - #------------------------------------------------------------------------------- - # Run "setupcon --save" to force font and cached console+keyboard script renewal. This solves an issue on Buster, where the "console-setup" service fails to do this on boot in cases: https://github.com/MichaIng/DietPi/issues/2912#issuecomment-532100542 - command -v setupcon > /dev/null && setupcon --save - #------------------------------------------------------------------------------- - # Failsafe, assure /var/tmp 1777 permissions: https://github.com/MichaIng/DietPi/issues/1144#issuecomment-517338321 - G_EXEC chmod 1777 /var/tmp - #------------------------------------------------------------------------------- - # Reinstalls and software install changes - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - # Remove obsolete install states: TightVPN and SDL2 - G_EXEC sed --follow-symlinks -Ei '/^aSOFTWARE_INSTALL_STATE\[(27|140)\]=/d' /boot/dietpi/.installed - - # Gogs: Remove /etc/__MACOSX that comes from our archive on ARMv6 - if grep -q '^aSOFTWARE_INSTALL_STATE\[49\]=2' /boot/dietpi/.installed; then - - [[ $G_HW_ARCH == 1 && -d '/etc/__MACOSX' ]] && G_EXEC rm -R /etc/__MACOSX - - fi - # Pi-hole: Update blocking page implementation and webserver configs: https://github.com/MichaIng/DietPi/pull/3072 - if [[ -f '/etc/pihole/pihole-FTL.conf' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[93\]=2' /boot/dietpi/.installed; then - - [[ -L '/var/www/index.php' && $(readlink -f '/var/www/index.php') == '/var/www/html/pihole/index.php' ]] && rm /var/www/index.php - if command -v a2ensite > /dev/null && grep -q '^aSOFTWARE_INSTALL_STATE\[83\]=2' /boot/dietpi/.installed; then - - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.block_public_admin.conf" -o /etc/apache2/sites-available/dietpi-pihole-block_public_admin.conf - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/apache.pihole.conf" -o /etc/apache2/sites-available/dietpi-pihole.conf - a2ensite dietpi-pihole - if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then - - [[ -f '/var/www/index.html' ]] && mv /var/www/index.html /var/www/index.html.bak - G_CONFIG_INJECT 'ErrorDocument 404' 'ErrorDocument 404 /html/pihole/index.php' /etc/apache2/sites-available/dietpi-pihole.conf - - fi - - fi - if command -v lighttpd-enable-mod > /dev/null && grep -q '^aSOFTWARE_INSTALL_STATE\[84\]=2' /boot/dietpi/.installed; then - - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.block_public_admin.conf" -o /etc/lighttpd/conf-available/99-dietpi-pihole-block_public_admin.conf - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/lighttpd.pihole.conf" -o /etc/lighttpd/conf-available/99-dietpi-pihole.conf - lighttpd-enable-mod dietpi-pihole - if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then - - [[ -f '/var/www/index.lighttpd.html' ]] && mv /var/www/index.lighttpd.html /var/www/index.lighttpd.html.bak - G_CONFIG_INJECT 'server.error-handler-404' 'server.error-handler-404 = "/html/pihole/index.php"' /etc/lighttpd/conf-available/99-dietpi-pihole.conf - - fi - - fi - if [[ -d '/etc/nginx/sites-dietpi' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[85\]=2' /boot/dietpi/.installed; then - - # Update Nginx default vhost, which is required to assure access restrictions for Pi-hole - G_BACKUP_FP /etc/nginx/sites-available/default - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_85/nginx.default" -o /etc/nginx/sites-available/default - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.block_public_admin.conf" -o /etc/nginx/sites-dietpi/dietpi-pihole-block_public_admin.off - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_93/nginx.pihole.conf" -o /etc/nginx/sites-dietpi/dietpi-pihole.conf - if grep -q 'BLOCKINGMODE=IP-NODATA-AAAA' /etc/pihole/pihole-FTL.conf; then - - [[ -f '/var/www/index.html' ]] && mv /var/www/index.html /var/www/index.html.bak - G_CONFIG_INJECT 'error_page 404' 'error_page 404 /html/pihole/index.php;' /etc/nginx/sites-dietpi/dietpi-pihole.conf - - fi - - fi - systemctl is-enabled dhcpcd &> /dev/null && ! pgrep dhcpcd &> /dev/null && systemctl disable dhcpcd - - fi - # X11: Fix drivers and config on Odroid C2: https://github.com/MichaIng/DietPi/issues/3028 - if (( $G_HW_MODEL == 12 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[6\]=2' /boot/dietpi/.installed; then - - G_BACKUP_FP /etc/X11/xorg.conf - G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_6/xorg_c2.conf" -o /etc/X11/xorg.conf - apt-mark auto xf86-video-mali-odroid - # Kodi: Remove PulseAudio, not required by Kodi anymore, but ask user first - if grep -q '^aSOFTWARE_INSTALL_STATE\[31\]=2' /boot/dietpi/.installed; then - - G_WHIP_YESNO 'PulseAudio was installed together with Kodi, but it is not required anymore. If you did not install it manually for a special purpose, it is safe to remove it.\n -Do you want to keep PulseAudio installed?' || apt-mark auto pulseaudio - - fi - G_AGA - G_AGI --reinstall aml-libs-odroid mali450-odroid libump-odroid xf86-video-fbturbo-odroid - - fi - # myMPD: https://github.com/MichaIng/DietPi/pull/3110 - if grep -q '^aSOFTWARE_INSTALL_STATE\[148\]=2' /boot/dietpi/.installed; then - - # NB: On Debian Buster by default /lib is a symlink to /usr/lib, thus the below fails as both files are the same. However it does not hurt and assures no obsolete service file will be left (after uninstall). - [[ -f '/usr/lib/systemd/system/mympd.service' ]] && mv /usr/lib/systemd/system/mympd.service /lib/systemd/system/mympd.service 2> /dev/null - [[ -f '/etc/systemd/systemd/mympd.service.d/dietpi-group.conf' ]] && rm /etc/systemd/systemd/mympd.service.d/dietpi-group.conf - [[ -d '/etc/systemd/systemd/mympd.service.d' ]] && rmdir --ignore-fail-on-non-empty /etc/systemd/systemd/mympd.service.d - - fi - # Fail2Ban: Enable service since it is not controlled by DietPi-Services anymore: https://github.com/MichaIng/DietPi/commit/4d6ccbeee47b54247613f880a03339ff8a72f24d - grep -q '^aSOFTWARE_INSTALL_STATE\[73\]=2' /boot/dietpi/.installed && systemctl enable --now fail2ban - # Certbot: https://github.com/MichaIng/DietPi/issues/3111 - if grep -q '^aSOFTWARE_INSTALL_STATE\[92\]=2' /boot/dietpi/.installed; then - - # Apache - if grep -q '^aSOFTWARE_INSTALL_STATE\[83\]=2' /boot/dietpi/.installed; then - - G_AGI python3-certbot-apache - grep -q '^[[:blank:]]*authenticator[[:blank:]]*=[[:blank:]]*webroot' /etc/letsencrypt/renewal/*.conf 2> /dev/null && - G_WHIP_YESNO '[Certbot] Switch back to native Apache authentication method\n -Your Certbot authenticates with the "webroot" method, while you have an Apache webserver installed. This was required some time ago due to a sudden change by Let'\''s Encrypt, which made the Apache authentication method fail. -Meanwhile, with current Certbot version, this bug has been fixed and we got some reports where the webroot method does not work reliable instead, leaving you with an expired HTTPS certificate in cases.\n -Would you like to switch back to the Apache authentication method now?' && certbot renew --force-renewal -a apache - - # Nginx - elif grep -q '^aSOFTWARE_INSTALL_STATE\[85\]=2' /boot/dietpi/.installed; then - - G_AGI python3-certbot-nginx - grep -q '^[[:blank:]]*authenticator[[:blank:]]*=[[:blank:]]*webroot' /etc/letsencrypt/renewal/*.conf 2> /dev/null && - G_WHIP_YESNO '[Certbot] Switch back to native Nginx authentication method\n -Your Certbot authenticates with the "webroot" method, while you have an Nginx webserver installed. This was required some time ago due to a sudden change by Let'\''s Encrypt, which made the Nginx authentication method fail. -Meanwhile, with current Certbot version, this bug has been fixed and we got some reports where the webroot method does not work reliable instead, leaving you with an expired HTTPS certificate in cases.\n -Would you like to switch back to the Nginx authentication method now?' && certbot renew --force-renewal -a nginx - - fi - - fi - # Mono: Use new Buster repo on Buster/Bullseye systems - (( $G_DISTRO > 4 )) && [[ -f '/etc/apt/sources.list.d/mono-xamarin.list' ]] && sed --follow-symlinks -i 's/stretch/buster/g' /etc/apt/sources.list.d/mono-xamarin.list - # Aria2: https://github.com/MichaIng/DietPi/pull/3139 - if [[ -f '/var/lib/dietpi/dietpi-software/installed/aria2.conf' ]]; then - - # If aria2.conf exists on new location, it must have been installed with new code already, thus old file is obsolete. - if [[ -f '/mnt/dietpi_userdata/aria2/aria2.conf' ]]; then - - G_EXEC rm /var/lib/dietpi/dietpi-software/installed/aria2.conf - - else - - # Apply session save/resume feature but do not overwrite existing settings - GCI_PRESERVE=1 G_CONFIG_INJECT 'input-file=' 'input-file=/mnt/dietpi_userdata/downloads/aria2.session' /var/lib/dietpi/dietpi-software/installed/aria2.conf - local fp_input=$(sed -n '/^[[:blank:]]*input-file=/{s/^[^=]*=//p;q}' /var/lib/dietpi/dietpi-software/installed/aria2.conf) - GCI_PRESERVE=1 G_CONFIG_INJECT 'save-session=' "save-session=$fp_input" /var/lib/dietpi/dietpi-software/installed/aria2.conf - GCI_PRESERVE=1 G_CONFIG_INJECT 'save-session-interval=' 'save-session-interval=60' /var/lib/dietpi/dietpi-software/installed/aria2.conf - # Move aria2.conf to new location - G_EXEC mkdir -p /mnt/dietpi_userdata/aria2 - G_EXEC mv /var/lib/dietpi/dietpi-software/installed/aria2.conf /mnt/dietpi_userdata/aria2/ - - fi - - fi - # Webmin: https://github.com/MichaIng/DietPi/commit/ec55d49a488fd9cb1dbb18cbfa067b5d1d1a974e - echo 115 132 >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 26 )); then - - #------------------------------------------------------------------------------- - # ownCloud: Remove obsolete PHP7.3 block: https://github.com/MichaIng/DietPi/pull/3169 - [[ -f '/etc/apt/preferences.d/dietpi-owncloud' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-owncloud - #------------------------------------------------------------------------------- - # RPi4 EEPROM install/update: https://github.com/MichaIng/DietPi/issues/3217 - (( $G_HW_MODEL == 4 )) && /boot/dietpi/func/dietpi-set_hardware rpi-eeprom - #------------------------------------------------------------------------------- - # Remove obsolete apt-transport-https on Buster+ where it is a transitional dummy package only, HTTPS support fixed part of apt: https://packages.debian.org/buster/apt-transport-https - (( $G_DISTRO > 4 )) && G_AGP apt-transport-https - #------------------------------------------------------------------------------- - # Remove microcode packages from VM, where they are and must be without effect - (( $G_HW_MODEL == 20 )) && G_AGP {intel,amd64}-microcode && G_AGA - #------------------------------------------------------------------------------- - G_DIETPI-NOTIFY 2 'Removing obsolete DietPi files that could have remained on older systems...' - rm -Rfv /boot/dietpi/{server_version*,login} - #------------------------------------------------------------------------------- - # Mask ARMbian services, which are otherwise re-enabled on related APT package upgrade - local apackages=() - mapfile -t apackages < <(dpkg --get-selections 'linux-*-root-*' 2> /dev/null | mawk '{print $1}') - [[ ${apackages[0]} ]] && G_DIETPI-NOTIFY 2 'Masking and removing conflicting ARMbian services and files...' - for i in "${apackages[@]}" - do - - local aservices=() - mapfile -t aservices < <(dpkg -L "$i" | sed -n 's|^/lib/systemd/system/\([^/]*\)\.service$|\1|p') - [[ ${aservices[*]} == *'armbian'* ]] || continue # Failsafe - systemctl disable --now "${aservices[@]}" 2> /dev/null - systemctl mask "${aservices[@]}" 2> /dev/null - - done - unset -v aservices - G_EXEC rm -vf /lib/systemd/system/*armbian* - G_EXEC rm -vf /etc/apt/apt.conf.d/*armbian* - G_EXEC rm -vf /etc/cron.*/*armbian* - #rm -vf /etc/default/*armbian* # Required for ARMbian root package upgrade - G_EXEC rm -vf /etc/update-motd.d/*armbian* - G_EXEC rm -vf /etc/profile.d/*armbian* - #[[ -d '/usr/lib/armbian' ]] && rm -vR /usr/lib/armbian # Required for ARMbian root package upgrade - #[[ -d '/usr/share/armbian' ]] && rm -vR /usr/share/armbian # Required for ARMbian root package upgrade - # Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi - [[ -f '/etc/armbian-release' ]] && cat << '_EOF_' > /etc/dpkg/dpkg.cfg.d/dietpi-no_armbian -# Exclude conflicting ARMbian files -path-exclude /lib/systemd/system/*armbian* -path-exclude /etc/apt/apt.conf.d/*armbian* -path-exclude /etc/cron.*/*armbian* -#path-exclude /etc/default/*armbian* # Required for ARMbian root package upgrade -path-exclude /etc/update-motd.d/*armbian* -path-exclude /etc/profile.d/*armbian* -#path-exclude /usr/lib/armbian # Required for ARMbian root package upgrade -#path-exclude /usr/share/armbian # Required for ARMbian root package upgrade -_EOF_ - # Unhold ARMbian packages (set on hold via DietPi-PREP until v6.27) - mapfile -t apackages < <(dpkg --get-selections linux-{dtb,u,image,"$G_DISTRO_NAME"}-* sunxi-tools 2> /dev/null | mawk '{print $1}') - [[ ${apackages[0]} && -f '/etc/armbian-release' ]] && apt-mark unhold "${apackages[@]}" 2> /dev/null - unset -v apackages - #------------------------------------------------------------------------------- - # Reinstalls - # Syncthing: https://github.com/MichaIng/DietPi/pull/3202 - # Grafana: https://github.com/MichaIng/DietPi/issues/3213 - # Jackett: https://github.com/MichaIng/DietPi/issues/2593 - # v6.33 Amiberry: https://github.com/MichaIng/DietPi/pull/3252 - # Home Assistant: No reinstall but inform user about required Python update: https://github.com/MichaIng/DietPi/pull/3220 - # v6.29 Allo web UI: https://github.com/MichaIng/DietPi/pull/3282 - # GMediaRender: https://github.com/MichaIng/DietPi/issues/3263, https://github.com/MichaIng/DietPi/issues/3246 - # phpMyAdmin: https://github.com/MichaIng/DietPi/issues/3284 - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - if [[ -d '/home/homeassistant/.pyenv/versions/3.6.3' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[157\]=2' /boot/dietpi/.installed; then - - G_WHIP_MSG '[WARNING] Home Assistant: Python3.6 will be deprecated -\nThe Python version for your Home Assistant pyenv needs to be updated to avoid deprecation with new HA versions: https://github.com/MichaIng/DietPi/issues/3219 -\nSince this can take a very long time, we do not automate this during the DietPi update. When you can effort the time, please run: -- dietpi-software reinstall 157' - - fi - if [[ -d '/etc/syncthing' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[50\]=2' /boot/dietpi/.installed; then - - if [[ -d '/opt/syncthing' ]]; then - - G_EXEC cp -a /etc/syncthing/. /opt/syncthing/ - G_EXEC rm -R /etc/syncthing - - else - - G_EXEC mv /etc/syncthing /opt/syncthing - - fi - [[ -d '/var/log/syncthing' ]] && rm -R /var/log/syncthing - G_WHIP_MSG '[ INFO ] Syncthing reinstall -\nThe Syncthing binary has been moved from /etc/syncthing to /opt/syncthing. -\nThe service has been updated to support auto-updates. You may want to enable it via web UI. -\nFile logging has been disabled. To view Syncthing logs, run: - - journalctl -u syncthing' - - fi - if [[ $G_HW_ARCH == 1 && -f '/etc/apt/sources.list.d/grafana.list' ]] && grep -q 'bintray.com' /etc/apt/sources.list.d/grafana.list && grep -q '^aSOFTWARE_INSTALL_STATE\[77\]=2' /boot/dietpi/.installed; then - - G_DIETPI-NOTIFY 2 'Removing obsolete bintray.com APT repo prior to Grafana update...' - G_EXEC rm /etc/apt/sources.list.d/grafana.list - - fi - if [[ -f '/usr/local/lib/libSDL2.txt' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[108\]=2' /boot/dietpi/.installed; then - - G_DIETPI-NOTIFY 2 'Removing obsolete SDL2 libraries prior to Amiberry update...' - G_EXEC rm /usr/local/lib/libSDL2* - - fi - grep -q '^aSOFTWARE_INSTALL_STATE\[163\]=2' /boot/dietpi/.installed && G_AGP gmrender gmediarender - grep -q '^aSOFTWARE_INSTALL_STATE\[90\]=2' /boot/dietpi/.installed && { G_AGP phpmyadmin; G_AGA; } - echo 50 77 90 147 163 >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 28 )); then - - #------------------------------------------------------------------------------- - # ZeroPi: Apply new revision code - if [[ -f '/etc/armbian-release' ]] && grep -q '^BOARD=zeropi' /etc/armbian-release; then - - echo 59 > /etc/.dietpi_hw_model_identifier - /boot/dietpi/func/dietpi-obtain_hw_model - - fi - #------------------------------------------------------------------------------- - G_DIETPI-NOTIFY 2 'Re-allowing PHP7.3 when phpBB is installed, supported since v3.3.0' - [[ -f '/etc/apt/preferences.d/dietpi-phpbb' ]] && rm -v /etc/apt/preferences.d/dietpi-phpbb - #------------------------------------------------------------------------------- - # Remove Armbian-related dpkg config on non-Armbian devices - [[ -f '/etc/dpkg/dpkg.cfg.d/dietpi-no_armbian' && ! -f '/etc/armbian-release' ]] && rm -v /etc/dpkg/dpkg.cfg.d/dietpi-no_armbian - #------------------------------------------------------------------------------- - # Remove Armbian zRAM logrotate.service override and exclude via dpkg.cfg - if [[ -f '/etc/dpkg/dpkg.cfg.d/dietpi-no_armbian' ]]; then - - [[ -L '/etc/systemd/system/logrotate.service' ]] || rm -fv /etc/systemd/system/logrotate.service - grep -q 'logrotate\.service' /etc/dpkg/dpkg.cfg.d/dietpi-no_armbian || echo 'path-exclude /etc/systemd/system/logrotate.service' >> /etc/dpkg/dpkg.cfg.d/dietpi-no_armbian - - fi - #------------------------------------------------------------------------------- - # Translate old DietPi-LED_control settings into new udev rules, remove old config and script location: https://github.com/MichaIng/DietPi/pull/3397 - if [[ -f '/boot/dietpi/.dietpi-led_control' ]]; then - - G_DIETPI-NOTIFY 2 'Translating old DietPi-LED_control settings into new udev rules' - local led trigger - while read -r led trigger - do - >> /etc/udev/rules.d/dietpi-led_control.rules - G_CONFIG_INJECT "SUBSYSTEM==\"leds\", KERNEL==\"$led\"" "SUBSYSTEM==\"leds\", KERNEL==\"$led\", ACTION==\"add\", ATTR{trigger}=\"$trigger\"" /etc/udev/rules.d/dietpi-led_control.rules - - done < /boot/dietpi/.dietpi-led_control - - fi - G_DIETPI-NOTIFY 2 'Removing old DietPi-LED_control config and script location' - G_EXEC rm -f /boot/dietpi/{.,func/}dietpi-led_control - #------------------------------------------------------------------------------- - G_DIETPI-NOTIFY 2 'Removing obsolete flag files' - G_EXEC rm -f /boot/dietpi/.{update_available,timesync_exit_status,network} /var/lib/dietpi/.ntpd_override /tmp/.dietpi_motd - #------------------------------------------------------------------------------- - [[ -f '/boot/dietpi/.dietpi-backup_settings' ]] && l_message='Adjusting changed DietPi-Backup variable name' G_EXEC sed --follow-symlinks -i 's/^FP_TARGET_BACKUP=/FP_TARGET=/' /boot/dietpi/.dietpi-backup_settings - #------------------------------------------------------------------------------- - if [[ -f '/etc/default/crda' ]]; then - - G_DIETPI-NOTIFY 2 'Migrating WiFi country code to be applied via native crda facility' - local country_code=$(iw reg get | mawk '/country/{print $2;exit}' | tr -d ':') - G_CONFIG_INJECT 'REGDOMAIN=' "REGDOMAIN=$country_code" /etc/default/crda - G_CONFIG_INJECT 'AUTO_SETUP_NET_WIFI_COUNTRY_CODE=' "AUTO_SETUP_NET_WIFI_COUNTRY_CODE=$country_code" /boot/dietpi.txt - # Remove from wpa_supplicant.conf - [[ -f '/etc/wpa_supplicant/wpa_supplicant.conf' ]] && sed --follow-symlinks -i '/^[[:blank:]]*country=/d' /etc/wpa_supplicant/wpa_supplicant.conf - - fi - #------------------------------------------------------------------------------- - G_DIETPI-NOTIFY 2 'Removing obsolete dietpi.txt entries' - G_EXEC sed --follow-symlinks -i '/CONFIG_AUTO_DIETPI_UPDATES=/d' /boot/dietpi.txt - G_EXEC sed --follow-symlinks -i '/CONFIG_WIFI_COUNTRY_CODE=/d' /boot/dietpi.txt - #------------------------------------------------------------------------------- - G_DIETPI-NOTIFY 2 'Removing obsolete dietpi-software config directory' - [[ -d '/var/lib/dietpi/dietpi-software/conf' ]] && G_EXEC rm -R /var/lib/dietpi/dietpi-software/conf - #------------------------------------------------------------------------------- - G_DIETPI-NOTIFY 2 'Removing obsolete hint about /DietPi RAMdisk from /boot config files' - [[ -f '/boot/dietpi.txt' ]] && sed --follow-symlinks -Ei '/^# - (Modifications to \/boot\/dietpi\.txt|Please ensure you edit from the DietPi-RAMdisk)/d' /boot/dietpi.txt - [[ -f '/boot/config.txt' ]] && sed --follow-symlinks -Ei '/^# - (Modifications to \/boot\/config\.txt|Please ensure you edit from the DietPi-RAMdisk)/d' /boot/config.txt - [[ -f '/boot/boot.ini' ]] && sed --follow-symlinks -Ei '/^# - (Modifications to \/boot\/boot\.ini|Please ensure you edit from the DietPi-RAMdisk)/d' /boot/boot.ini - #------------------------------------------------------------------------------- - # Sparky SBC: Update kernel/drivers - if (( $G_HW_MODEL == 70 )); then - - G_DIETPI-NOTIFY 2 'Update Sparky SBC kernel, drivers and services...' - - # Install latest kernel/drivers - G_EXEC curl -sSfL https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/uImage -o /boot/uImage - G_EXEC curl -sSfLO https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dragon_fly_check/3.10.38.bz2 - G_EXEC tar -xf 3.10.38.bz2 -C /lib/modules/ - G_EXEC rm 3.10.38.bz2 - # - USB audio update - G_EXEC curl -sSfL https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/dsd-marantz/snd-usb-audio.ko -o /lib/modules/3.10.38/kernel/sound/usb/snd-usb-audio.ko - # - Remove obsolete WiFi driver files - G_EXEC rm -Rf /lib/modules/3.10.38/kernel/drivers/net/wireless/rtl8812au /etc/modprobe.d/wlan_8812au.conf - [[ -f '/etc/modprobe.d/dietpi-disable_wifi_powersaving.conf' ]] && G_CONFIG_INJECT 'options wlan_8812au rtw_power_mgnt=0' 'options wlan_8812au rtw_power_mgnt=0' /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf - # Rename modprobe configs - [[ -f '/etc/modprobe.d/disable_sparkysbc_gpu.conf' ]] && mv /etc/modprobe.d/{,dietpi-}disable_sparkysbc_gpu.conf - [[ -f '/etc/modprobe.d/disable_sparkysbc_touchscreen.conf' ]] && mv /etc/modprobe.d/{,dietpi-}disable_sparkysbc_touchscreen.conf - - #------------------------------------------------------------------------------- - # Sparky SBC: Update Ethernet script - - if [[ -f '/etc/systemd/system/sparky_eth_controller.service' ]]; then - - systemctl disable sparky_eth_controller - G_EXEC rm -R /etc/systemd/system/sparky_eth_controller.service* - - fi - [[ -f '/usr/local/bin/sparky_eth_controller.sh' ]] && rm -v /usr/local/bin/sparky_eth_controller.sh - cat << '_EOF_' > /var/lib/dietpi/services/dietpi-sparkysbc_ethernet.sh -#!/bin/dash -# Called from: /etc/systemd/system/dietpi-sparkysbc_ethernet.service -# We need to wait until USB Ethernet is established on USB bus, which takes much longer than onboard init. -sleep 20 -# Disable onboard Ethernet if USB Ethernet is found -if ip a s eth1 > /dev/null 2>&1; then - - echo 'blacklist ethernet' > /etc/modprobe.d/dietpi-disable_sparkysbc_ethernet.conf - reboot - -# Enable onboard Ethernet if no adapter is found -elif ! ip a s eth0 > /dev/null 2>&1; then - - rm -f /etc/modprobe.d/dietpi-disable_sparkysbc_ethernet.conf - reboot - -fi -_EOF_ - G_EXEC chmod +x /var/lib/dietpi/services/dietpi-sparkysbc_ethernet.sh - cat << '_EOF_' > /etc/systemd/system/dietpi-sparkysbc_ethernet.service -[Unit] -Description=Sparky SBC auto detect and toggle onboard/USB Ethernet -Wants=network-online.target -After=network-online.target - -[Service] -RemainAfterExit=yes -ExecStart=/var/lib/dietpi/services/dietpi-sparkysbc_ethernet.sh - -[Install] -WantedBy=multi-user.target -_EOF_ - systemctl enable dietpi-sparkysbc_ethernet - [[ -f '/etc/modprobe.d/disable_sparkysbc_ethernet.conf' ]] && G_EXEC mv /etc/modprobe.d/{,dietpi-}disable_sparkysbc_ethernet.conf - - fi - #------------------------------------------------------------------------------- - # Fix /var/lib/dietpi permissions: https://github.com/MichaIng/DietPi/issues/3322 - local dirs=() - mapfile -t dirs < <(find /var/lib/dietpi -type d) - chmod -f +x "${dirs[@]}" /var/lib/dietpi/services/*sh /var/lib/dietpi/dietpi-software/installed/*sh - unset -v dirs - #------------------------------------------------------------------------------- - # Installed software changes - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - # Sonarr/Radarr/Lidarr: Inform user about permission changes: https://github.com/MichaIng/DietPi/pull/3349 - if grep -qE '^aSOFTWARE_INSTALL_STATE\[(106|144|145)\]=2' /boot/dietpi/.installed; then - - G_WHIP_MSG '[ INFO ] Sonarr/Radarr/Lidarr permission changes -\nThe service permissions for Sonarr/Radarr/Lidarr will become stricter with new installs and reinstalls. They will only be able to read/write files to locations inside /mnt/. -\nWe do not force a reinstall, hence you do not need to take action for now. However, the reinstall enables some other enhancements, e.g. it will allow you to update these programs through their internal web UI updater without issues. -To reinstall now, run: "dietpi-software reinstall 106 144 145" -\nIf you added custom download/media directories outside of /mnt/, after reinstall, please do the following: -1. Run "dietpi-services" from console -2. Select "sonarr", "radarr" and/or "lidarr" respectively -3. Select "Edit" -4. Uncomment (remove leading "#") the line, starting with "ReadWritePaths=" -5. Add your custom path to the end of this line, separated by one space -6. Press ctrl+o buttons to save and ctrl+x to exit' - - fi - # Pi-hole: Assure v5 compatibility - if getent group pihole > /dev/null && command -v php > /dev/null; then - - G_DIETPI-NOTIFY 2 'Assuring Pi-hole v5 compatibility...' - usermod -aG pihole www-data - if command -v php7.3 > /dev/null; then - - G_AGI php7.3-intl - - elif command -v php7.2 > /dev/null; then - - G_AGI php7.2-intl - - elif command -v php7.4 > /dev/null; then - - G_AGI php7.4-intl - - fi - - fi - # Reinstalls - # HAProxy: https://github.com/MichaIng/DietPi/pull/3416 - if [[ -f '/etc/init.d/haproxy' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[98\]=2' /boot/dietpi/.installed; then - - G_DIETPI-NOTIFY 2 'Preparing HAProxy update, removing obsolete sysvinit service...' - G_EXEC systemctl unmask haproxy - G_EXEC rm /etc/init.d/haproxy - update-rc.d -f haproxy remove - - fi - # v6.33 Amiberry: https://github.com/MichaIng/DietPi/issues/3357#issuecomment-593868445 - # Allo web UI: Updated to v13.2 to match DietPi v6.29 API - echo 98 160 >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 29 )); then - - #------------------------------------------------------------------------------- - # RPi: Fix missing root mount in fstab: https://github.com/MichaIng/DietPi/issues/3511 - if ! grep -q '[[:blank:]]/[[:blank:]]' /etc/fstab; then - - G_WHIP_MSG '[WARNING] Refreshing /etc/fstab -\nYour system seems to be affected by a bug, introduced with DietPi v6.29, where /etc/fstab does not contain a root mount entry after running DietPi-Drive_Manager. We have fixed it and will now refresh your /etc/fstab with DietPi-Drive_Manager. -\nA backup is created, just in case you made manual changes.' - G_BACKUP_FP /etc/fstab - /boot/dietpi/dietpi-drive_manager 3 - - fi - - elif (( $G_DIETPI_VERSION_SUB == 30 )); then - - #------------------------------------------------------------------------------- - # Make userdata dir world-executable so service users don't need to be in dietpi group to access their data dir: https://github.com/MichaIng/DietPi/pull/3536#issuecomment-628515444 - [[ -d '/mnt/dietpi_userdata' ]] && G_EXEC chmod a+x /mnt/dietpi_userdata - #------------------------------------------------------------------------------- - # Assure /media exists to fulfil FHS, fix htpdate service startup and probably other issues: https://github.com/MichaIng/DietPi/issues/3558 - [[ -d '/media' ]] || G_EXEC mkdir /media - #------------------------------------------------------------------------------- - # All users are permitted to "ping" now without any further capabilities, hence remove them for security reasons: https://github.com/MichaIng/DietPi/commit/caec92e92e136a2f731f6d4c45db8463896fc80a - local fp_ping=$(readlink -e "$(command -v ping)") - if [[ $fp_ping ]]; then - - sysctl -p /etc/sysctl.d/dietpi.conf - command -v getcap > /dev/null && [[ $(getcap "$fp_ping") ]] && setcap -r "$fp_ping" - chmod a-s "$fp_ping" - - fi - #------------------------------------------------------------------------------- - # Fix default RPi3+ overclocking defaults: https://dietpi.com/phpbb/viewtopic.php?t=7804 - if [[ $G_HW_MODEL == 3 && $G_HW_MODEL_NAME == *'+'* ]]; then - - G_EXEC sed --follow-symlinks -i '/#arm_freq=/c\#arm_freq=1400' /boot/config.txt - G_EXEC sed --follow-symlinks -i '/#sdram_freq=/c\#sdram_freq=500' /boot/config.txt - - fi - #------------------------------------------------------------------------------- - # Reinstalls - # Folding@Home: https://github.com/MichaIng/DietPi/pull/3546 - # Squeezelite: https://github.com/MichaIng/DietPi/issues/2386#issuecomment-651982127 - if (( $G_DIETPI_INSTALL_STAGE == 2 )); then - - # Reset QuiteRSS install state if the package has not actually been installed: https://github.com/MichaIng/DietPi/commit/49f960a7953f44e5571ff2dde68a93efca37ec03 - dpkg-query -s quiterss &> /dev/null || sed --follow-symlinks -i '/^aSOFTWARE_INSTALL_STATE\[22\]=2/d' /boot/dietpi/.installed - - if grep -q '^aSOFTWARE_INSTALL_STATE\[36\]=2' /boot/dietpi/.installed; then - - G_DIETPI-NOTIFY 2 'Preparing Squeezelite update...' - G_EXEC rm -Rf /usr/bin/squeezelite* /etc/default/squeezelite - [[ -f '/etc/systemd/system/squeezelite.service' ]] && G_CONFIG_INJECT 'User=' 'User=squeezelite' /etc/systemd/system/squeezelite.service '\[Service\]' - echo 36 >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - - if grep -q '^aSOFTWARE_INSTALL_STATE\[2\]=2' /boot/dietpi/.installed; then - - G_DIETPI-NOTIFY 2 'Preparing Folding@Home update...' - [[ -f '/lib/systemd/system/fahclient.service' ]] && rm /lib/systemd/system/fahclient.service - [[ -f '/var/log/fahclient.log' ]] && rm /var/log/fahclient.log - dpkg-query -s fahclient &> /dev/null && G_AGP fahclient - echo 2 >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - - fi - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 31 )); then - - #------------------------------------------------------------------------------- - # APT configs have been merged into a single file, contained in update archive - rm -fv /etc/apt/apt.conf.d/{99-dietpi-norecommends,98-dietpi-no_translations,99-dietpi-forceconf} - #------------------------------------------------------------------------------- - [[ -f '/boot/config.txt' ]] && G_EXEC_DESC='Removing deprecated "max_usb_current" from config.txt' G_EXEC_NOHALT=1 G_EXEC sed --follow-symlinks -i '/^[[:blank:]#]*max_usb_current=/d' /boot/config.txt - #----------------------------------------------------------------------- - # Recreate /etc/sysctl.d/99-sysctl.conf -> ../sysctl.conf symlink if not existent: https://github.com/MichaIng/DietPi/issues/3003#issuecomment-669464255 - if [[ ! -L '/etc/sysctl.d/99-sysctl.conf' ]]; then - - [[ -e '/etc/sysctl.d/99-sysctl.conf' ]] && G_EXEC mv /etc/sysctl.d/99-sysctl.conf /etc/sysctl.conf - G_EXEC ln -sf ../sysctl.conf /etc/sysctl.d/99-sysctl.conf - - fi - #------------------------------------------------------------------------------- - # DietPi-LetsEncrypt: Lighttpd: Rename HTTPS config files to new scheme: https://github.com/MichaIng/DietPi/pull/3734 - if [[ $G_DIETPI_INSTALL_STAGE == 2 && -f '/boot/dietpi/.dietpi-letsencrypt' && -d '/etc/lighttpd/conf-enabled' ]]; then - - local f='/etc/lighttpd/conf-enabled/letsencrypt.conf' - if [[ -f $f && ! -L $f ]]; then - G_EXEC mv "$f" /etc/lighttpd/conf-available/50-dietpi-https.conf - lighty-enable-mod dietpi-https - fi - f='/etc/lighttpd/conf-enabled/redirect.conf' - if [[ -f $f && ! -L $f ]]; then - G_EXEC mv "$f" /etc/lighttpd/conf-available/98-dietpi-https_redirect.conf - lighty-enable-mod dietpi-https_redirect - fi - f='/etc/lighttpd/conf-available/99-dietpi-hsts.conf' - if [[ -f $f ]]; then - G_EXEC mv "$f" "${f/99/98}" - [[ -L ${f/available/enabled} ]] && { lighty-disable-mod dietpi-hsts; lighty-enable-mod dietpi-hsts; } - fi - - fi - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 32 )); then - - #------------------------------------------------------------------------------- - # Update config file names - [[ -f '/etc/X11/xorg.conf.d/99-dietpi-dpms_off.conf' ]] && G_EXEC mv /etc/X11/xorg.conf.d/9{9-dietpi-dpms_off,8-dietpi-disable_dpms}.conf - #------------------------------------------------------------------------------- - # Transmission - if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[44\]=2' /boot/dietpi/.installed && [[ -f '/etc/systemd/system/transmission-daemon.service.d/dietpi-group.conf' ]] ; then - - G_DIETPI-NOTIFY 2 'Making "dietpi" the primary group for "debian-transmission" user instead of running the service as "dietpi" group' - G_EXEC usermod -g dietpi -aG debian-transmission debian-transmission - G_EXEC rm /etc/systemd/system/transmission-daemon.service.d/dietpi-group.conf - G_EXEC rmdir --ignore-fail-on-non-empty /etc/systemd/system/transmission-daemon.service.d - - fi - #------------------------------------------------------------------------------- - # Tautulli: https://github.com/MichaIng/DietPi/pull/3784 - if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[146\]=2' /boot/dietpi/.installed && [[ -d '/opt/plexpy' ]] ; then - - G_WHIP_MSG '[ INFO ] Renaming PlexPy to Tautulli -\nPlexPy has been renamed to Tautulli a while ago. To honour this, we will rename user, directories and service now accordingly: - - Install/Git directory: /opt/tautulli - - Data/Config directory: /mnt/dietpi_userdata/tautulli - - systemd service name: tautulli.service - - systemd service user: tautulli (group: tautulli) -\nAdditionally it will run now with Python 3 instead of Python 2. A Tautulli reinstall is done to apply these changes.' - G_EXEC mv /opt/{plexpy,tautulli} - [[ -d '/mnt/dietpi_userdata/plexpy' ]] && G_EXEC mv /mnt/dietpi_userdata/{plexpy,tautulli} - [[ -f '/opt/tautulli/config.ini' ]] && G_EXEC mv /{opt,mnt/dietpi_userdata}/tautulli/config.ini - G_EXEC sed --follow-symlinks -i 's|/opt/plexpy|/opt/tautulli|' /mnt/dietpi_userdata/tautulli/config.ini - G_EXEC sed --follow-symlinks -i 's|/mnt/dietpi_userdata/plexpy|/mnt/dietpi_userdata/tautulli|' /mnt/dietpi_userdata/tautulli/config.ini - [[ -f '/etc/systemd/system/plexpy.service' ]] && G_EXEC mv /etc/systemd/system/{plexpy,tautulli}.service - [[ -d '/etc/systemd/system/plexpy.service.d' ]] && G_EXEC mv /etc/systemd/system/{plexpy,tautulli}.service.d - getent passwd plexpy > /dev/null && G_EXEC userdel plexpy - getent group plexpy > /dev/null && G_EXEC groupdel plexpy - echo 146 >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - #------------------------------------------------------------------------------- - # Nextcloud + Lighttpd: https://dietpi.com/phpbb/viewtopic.php?p=27445#p27445 - if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[114\]=2' /boot/dietpi/.installed && grep -q '^aSOFTWARE_INSTALL_STATE\[84\]=2' /boot/dietpi/.installed && - [[ -f '/etc/lighttpd/conf-available/99-dietpi-nextcloud.conf' ]] && grep -q opcache /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf; then - - G_DIETPI-NOTIFY 2 'Removing obsolete directive from Lighttpd Nextcloud config file' - G_EXEC sed --follow-symlinks -i '/opcache/d' /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf - for i in /etc/php/7.[234]/mods-available - do - - [[ -d $i ]] || continue - echo -e '; Nextcloud PHP settings\n; priority=98\napc.enable_cli=1\nopcache.enable=1\nopcache.interned_strings_buffer=8 -opcache.max_accelerated_files=10000\nopcache.memory_consumption=128\nopcache.save_comments=1\nopcache.revalidate_freq=1' > "$i/dietpi-nextcloud.ini" - - done - G_EXEC_NOHALT=1 G_EXEC phpenmod dietpi-nextcloud - - fi - #------------------------------------------------------------------------------- - # Mosquitto reinstall: https://github.com/MichaIng/DietPi/issues/3042 - # Amiberry v3.3 - echo 108 123 >> /var/tmp/dietpi/dietpi-update_reinstalls - #------------------------------------------------------------------------------- - # Cuberite: https://github.com/MichaIng/DietPi/issues/3664 - if (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[52\]=2' /boot/dietpi/.installed && [[ ! -d '/mnt/dietpi_userdata/cuberite' ]]; then - - if [[ -d '/mnt/dietpi_userdata/cubrite' ]]; then - - G_WHIP_MSG '[ INFO ] Fixing typo in Cuberite install directory -\nThe install directory of Cuberite will be moved: -- /mnt/dietpi_userdata/cubrite > /mnt/dietpi_userdata/cuberite -\nFor this, it will be reinstalled. A backup is stored at: -- /mnt/dietpi_userdata/cuberite_bak' - G_EXEC mv /mnt/dietpi_userdata/{cubrite,cuberite} - G_EXEC cp -a /mnt/dietpi_userdata/cuberite{,_bak} - echo 52 >> /var/tmp/dietpi/dietpi-update_reinstalls - - elif [[ -d '/etc/cubrite' ]]; then - - G_WHIP_MSG '[ INFO ] Moving Cuberite install directory -\nThe install directory of Cuberite will be moved: -- /etc/cubrite > /mnt/dietpi_userdata/cuberite -\nFor this, it will be reinstalled. A backup is stored at: -- /mnt/dietpi_userdata/cuberite_bak' - G_EXEC mkdir -p /mnt/dietpi_userdata - G_EXEC mv /etc/cubrite /mnt/dietpi_userdata/cuberite - G_EXEC cp -a /mnt/dietpi_userdata/cuberite{,_bak} - echo 52 >> /var/tmp/dietpi/dietpi-update_reinstalls - - fi - - fi - #------------------------------------------------------------------------------- - # TigerVNC + LXDE: https://github.com/MichaIng/DietPi/pull/3800 - (( $G_DIETPI_INSTALL_STAGE == 2 )) && grep -q '^aSOFTWARE_INSTALL_STATE\[28\]=2' /boot/dietpi/.installed && grep -q '^aSOFTWARE_INSTALL_STATE\[23\]=2' /boot/dietpi/.installed && G_AGI dbus-user-session - #------------------------------------------------------------------------------- - # Fail2Ban: https://github.com/MichaIng/DietPi/pull/3813 - [[ ! -f '/etc/fail2ban/jail.conf' ]] || sed -n '/^\[DEFAULT\]/,/^\[/p' /etc/fail2ban/jail.conf | grep -q '^[[:blank:]]*mode[[:blank:]]*=' || sed --follow-symlinks -i '/^\[DEFAULT\]/a\mode = normal' /etc/fail2ban/jail.conf - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 33 )); then - - #------------------------------------------------------------------------------- - # Remove Tonido install flag - if [[ -f '/boot/dietpi/.installed' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[134\]=2' /boot/dietpi/.installed - then - G_EXEC sed --follow-symlinks -i '/^aSOFTWARE_INSTALL_STATE\[134\]=2/d' /boot/dietpi/.installed - # Add service to custom includes if it has not been excluded, since it has been removed from the static DietPi-Services list - grep -q '^- tonido$' /boot/dietpi/.dietpi-services_include_exclude || G_CONFIG_INJECT '+ tonido' '+ tonido' /boot/dietpi/.dietpi-services_include_exclude - fi - #------------------------------------------------------------------------------- - # Remove CloudPrint install flag - [[ -f '/boot/dietpi/.installed' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[137\]=2' /boot/dietpi/.installed && sed --follow-symlinks -i '/^aSOFTWARE_INSTALL_STATE\[137\]=2/d' /boot/dietpi/.installed - #------------------------------------------------------------------------------- - # Remove DietPi-CloudShell install flag - [[ -f '/boot/dietpi/.installed' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[62\]=2' /boot/dietpi/.installed && sed --follow-symlinks -i '/^aSOFTWARE_INSTALL_STATE\[62\]=2/d' /boot/dietpi/.installed - #------------------------------------------------------------------------------- - if [[ -f '/boot/dietpi/.installed' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[29\]=2' /boot/dietpi/.installed && ! dpkg-query -s xorgxrdp &> /dev/null - then - G_DIETPI-NOTIFY 2 'Installing xorgxrdp package to allow XRDP connections via "Xorg" method without VNC' - [[ $G_DISTRO == 4 && $G_RASPBIAN != 1 ]] && cat << '_EOF_' > /etc/apt/preferences.d/dietpi-xrdp -Package: xrdp xorgxrdp -Pin: release n=stretch-backports -Pin-Priority: 500 -_EOF_ - G_AGI xorgxrdp - - # Workaround for failing mouse and keyboard input: https://github.com/MichaIng/DietPi/issues/3022 - G_CONFIG_INJECT 'Option "CoreKeyboard"' ' Option "CoreKeyboard"' /etc/X11/xrdp/xorg.conf 'Driver "xrdpkeyb"' - G_CONFIG_INJECT 'Option "CorePointer"' ' Option "CorePointer"' /etc/X11/xrdp/xorg.conf 'Driver "xrdpmouse"' - fi - #------------------------------------------------------------------------------- - # Resolve Ampache permissions issue: https://dietpi.com/phpbb/viewtopic.php?p=29366#p29366 - [[ -f '/boot/dietpi/.installed' && -f '/var/www/ampache/config/ampache.cfg.php' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[40\]=2' /boot/dietpi/.installed && G_EXEC chown www-data /var/www/ampache/config/ampache.cfg.php - #------------------------------------------------------------------------------- - # RPi: Re-apply GPU memory split to disable VCSM if GPU memory is lower than 32 MiB - if (( $G_HW_MODEL < 10 )) - then - local value=$G_HW_MEMORY_SIZE - (( $value <= 1024 )) || value=1024 - local gpu_mem_current=$(sed -n "/^[[:blank:]]*gpu_mem_$value=/{s/^[^=]*=//p;q}" /boot/config.txt) # override setting - [[ $gpu_mem_current ]] || gpu_mem_current=$(sed -n "/^[[:blank:]]*gpu_mem=/{s/^[^=]*=//p;q}" /boot/config.txt) # base setting - [[ $gpu_mem_current ]] || gpu_mem_current=64 # default value - (( $gpu_mem_current < 32 )) && /boot/dietpi/func/dietpi-set_hardware gpumemsplit "$gpu_mem_current" - #------------------------------------------------------------------------------- - # RPi CM 3+: Update USBridgeSig Ethernet driver via postinst kernel script, until it has been merged into official RPi kernel: https://github.com/allocom/USBridgeSig/tree/master/ethernet - cat << '_EOF_' > /etc/kernel/postinst.d/dietpi-USBridgeSig -#!/bin/bash -# Only available for v7+ -[[ $1 == *'-v7+' ]] || exit 0 -# Only reasonable for USBridgeSig = CM 3+ -grep -q '^Revision.*10.$' /proc/cpuinfo || exit 0 -echo "[ INFO ] Updating ASIX AX88179 driver for kernel $1 with ARM-optimised build" -echo '[ INFO ] - by Allo: https://github.com/allocom/USBridgeSig/tree/master/ethernet' -echo '[ INFO ] Estimating required module layout...' -module_layout=$(modprobe --dump-modversions /lib/modules/$1/kernel/drivers/net/usb/asix.ko | mawk '/module_layout/{print $1;exit}') || exit 0 -echo '[ INFO ] Downloading stable branch driver...' -if ! curl -#fL "http://3.230.113.73:9011/Allocom/USBridgeSig/stable_rel/rpi-usbs-$1/ax88179_178a.ko" -o /tmp/ax88179_178a.ko || - [[ $module_layout != $(modprobe --dump-modversions /tmp/ax88179_178a.ko | mawk '/module_layout/{print $1;exit}') ]] -then - echo '[ INFO ] No matching stable branch driver found, trying master branch driver...' - if ! curl -#fL "http://3.230.113.73:9011/Allocom/USBridgeSig/rpi-usbs-$1/ax88179_178a.ko" -o /tmp/ax88179_178a.ko || - [[ $module_layout != $(modprobe --dump-modversions /tmp/ax88179_178a.ko | mawk '/module_layout/{print $1;exit}') ]] - then - echo '[ INFO ] No matching driver found, cleaning up and aborting...' - rm -fv /tmp/ax88179_178a.ko || : - echo '[ INFO ] The default RPi kernel driver will be used instead, which might result in pops and ticks in your audio stream. If so, please try to rerun this script later:' - echo " - /etc/kernel/postinst.d/dietpi-USBridgeSig $1" - exit 0 - fi -fi -echo '[ INFO ] Installing driver...' -install -vpm 644 /tmp/ax88179_178a.ko /lib/modules/$1/kernel/drivers/net/usb || exit 0 -echo '[ INFO ] Running depmod...' -depmod $1 || exit 0 -echo '[ INFO ] All succeeded, cleaning up...' -rm -v /tmp/ax88179_178a.ko || exit 0 -_EOF_ - G_EXEC chmod +x /etc/kernel/postinst.d/dietpi-USBridgeSig - # Run for all installed v7+ kernel versions now - for i in /lib/modules/*-v7+ - do - [[ -d $i ]] || continue - i=${i##*/} - /etc/kernel/postinst.d/dietpi-USBridgeSig "$i" - done - #------------------------------------------------------------------------------- - # ROCK Pi S: Fix/update Radxa APT repository - elif (( $G_HW_MODEL == 73 )) - then - G_DIETPI-NOTIFY 2 'Repairing Radxa ROCK Pi S repository and marked packages' - apt-key del 'C79E F8D1 49CF C9C0 418A 9A60 5761 288B 2B52 CC90' - [[ -f '/etc/apt/sources.list.d/apt-radxa-com.list' ]] && rm -v /etc/apt/sources.list.d/apt-radxa-com.list - G_EXEC eval "curl -sSfL https://apt.radxa.com/${G_DISTRO_NAME/bullseye/buster}-stable/public.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-radxa.gpg --yes" - G_EXEC eval "echo -e 'deb https://apt.radxa.com/${G_DISTRO_NAME/bullseye/buster}-stable/ ${G_DISTRO_NAME/bullseye/buster} main\n#deb https://apt.radxa.com/${G_DISTRO_NAME/bullseye/buster}-testing/ ${G_DISTRO_NAME/bullseye/buster} main' > /etc/apt/sources.list.d/dietpi-radxa.list" - if dpkg-query -s rockpis-rk-u-boot-latest &> /dev/null - then - G_EXEC apt-mark manual rockpis-rk-ubootimg - G_EXEC apt-mark auto rockpis-rk-u-boot-latest - fi - if dpkg-query -s linux-4.4-rockpis-latest &> /dev/null - then - G_EXEC apt-mark auto linux-4.4-rockpis-latest - G_AGI linux-4.4-rock-pi-s-latest - fi - #------------------------------------------------------------------------------- - # Sparky SBC: Update Ethernet driver: https://github.com/sparky-sbc/sparky-test/tree/master/sparky-eth - elif (( $G_HW_MODEL == 70 )) - then - G_DIETPI-NOTIFY 2 'Updating Sparky SBC Ethernet driver' - G_EXEC curl -sSfL https://raw.githubusercontent.com/sparky-sbc/sparky-test/master/sparky-eth/ethernet.ko -o /lib/modules/3.10.38/kernel/drivers/net/ethernet/acts/ethernet.ko - fi - #------------------------------------------------------------------------------- - # MineOS reinstall to migrate from supervisor to systemd unit: https://github.com/MichaIng/DietPi/pull/3904 - [[ -f '/etc/systemd/system/mineos.service' ]] || echo 53 >> /var/tmp/dietpi/dietpi-update_reinstalls - #------------------------------------------------------------------------------- - # Radarr reinstall to migrate to .NET version, available for non-ARMv6 with new v3: https://github.com/MichaIng/DietPi/issues/3943 - if [[ -f '/boot/dietpi/.installed' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[145\]=2' /boot/dietpi/.installed - then - G_DIETPI-NOTIFY 2 'Preparing Radarr reinstall to migrate to newest version' - [[ -d '/opt/Radarr' ]] && G_EXEC rm -R /opt/Radarr - [[ -d '/opt/radarr' ]] && G_EXEC rm -R /opt/radarr - [[ -f '/mnt/dietpi_userdata/radarr/config.xml' ]] && G_CONFIG_INJECT '' ' master' /mnt/dietpi_userdata/radarr/config.xml '' - echo 145 >> /var/tmp/dietpi/dietpi-update_reinstalls - fi - #------------------------------------------------------------------------------- - # OctoPrint reinstall to migrate to new PyPI-based install and apply permission fixes: https://github.com/MichaIng/DietPi/issues/3940 - if [[ -f '/boot/dietpi/.installed' ]] && grep -q '^aSOFTWARE_INSTALL_STATE\[153\]=2' /boot/dietpi/.installed - then - G_WHIP_MSG '[ INFO ] Preparing OctoPrint reinstall -\nThe internal updater of OctoPrint has changed, which does not work with the way OctoPrint was installed. We hence need to reinstall it to make the software updater, as well as plugin installs, functional. -\nNote that you likely need to reinstall plugins. We are especially sorry for users where this was required just after the last DietPi update already, due to Python 2 => Python 3 migration. -\nOctoPrint is now installed as service user local instance to: - - /mnt/dietpi_userdata/octoprint/.local/ -\nThe good news is that this is a long-term reliable method, so that we do not expect any further required changes.' - if [[ -d '/root/.octoprint' && ! -d '/mnt/dietpi_userdata/octoprint/.octoprint' ]] - then - G_EXEC mkdir -p /mnt/dietpi_userdata/octoprint - G_EXEC mv /{root,mnt/dietpi_userdata/octoprint}/.octoprint - fi - [[ -d '/opt/octoprint' ]] && G_EXEC rm -Rf /opt/octoprint - # Beta 6.34.0+1 - [[ -f '/mnt/dietpi_userdata/octoprint/pip2' ]] && G_EXEC rm /mnt/dietpi_userdata/octoprint/pip2 - [[ -f '/mnt/dietpi_userdata/octoprint/pip3' ]] && G_EXEC rm /mnt/dietpi_userdata/octoprint/pip3 - [[ -f '/mnt/dietpi_userdata/octoprint/.octoprint/config.yaml' ]] && G_EXEC sed --follow-symlinks -i '/localPipCommand/d' /mnt/dietpi_userdata/octoprint/.octoprint/config.yaml - # shellcheck disable=SC2046 - command -v pip2 > /dev/null && pip2 uninstall -y $(pip2 freeze | mawk '/[Oo]cto[Pp]rint/{print $1}') 2> /dev/null - # shellcheck disable=SC2046 - command -v pip3 > /dev/null && pip3 uninstall -y $(pip3 freeze | mawk '/[Oo]cto[Pp]rint/{print $1}') 2> /dev/null - echo 153 >> /var/tmp/dietpi/dietpi-update_reinstalls - fi - #------------------------------------------------------------------------------- - # Webmin: Remove obsolete workaround: https://github.com/MichaIng/DietPi/issues/3810 - [[ -f '/etc/apt/apt.conf.d/98dietpi-webmin' ]] && rm /etc/apt/apt.conf.d/98dietpi-webmin - #------------------------------------------------------------------------------- - # Repair sound card setting, in case "-eq" got appended multiple times: https://github.com/MichaIng/DietPi/issues/3950 - if grep -q '^[[:blank:]]*CONFIG_SOUNDCARD=.*-eq-eq$' /boot/dietpi.txt - then - G_DIETPI-NOTIFY 2 'Repairing dietpi.txt sound card setting' - local soundcard=$(sed -n '/^[[:blank:]]*CONFIG_SOUNDCARD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - while [[ $soundcard == *'-eq' ]]; do soundcard=${soundcard%-eq}; done - G_CONFIG_INJECT 'CONFIG_SOUNDCARD=' "CONFIG_SOUNDCARD=$soundcard-eq" /boot/dietpi.txt - fi - #------------------------------------------------------------------------------- - # Migrating ALSA equalizer config to new location - if [[ -f '/root/.alsaequal.bin' ]] && grep -q '^[[:blank:]]*CONFIG_SOUNDCARD=.*-eq$' /boot/dietpi.txt - then - G_DIETPI-NOTIFY 2 'Migrating ALSA equalizer config to new location' - G_EXEC mkdir -p /var/lib/dietpi/dietpi-config - G_EXEC mv /{root,var/lib/dietpi/dietpi-config}/.alsaequal.bin - G_EXEC chmod 0775 /var/lib/dietpi/dietpi-config - G_EXEC chmod 0664 /var/lib/dietpi/dietpi-config/.alsaequal.bin - G_EXEC chown dietpi:dietpi /var/lib/dietpi/dietpi-config{,/.alsaequal.bin} - fi - #------------------------------------------------------------------------------- - # Beta: Remove falsely created nyx config directory where a file should have been placed - [[ -d '/root/.nyx/config' ]] && G_EXEC rm -R /root/.nyx/config - #------------------------------------------------------------------------------- - # Nextcloud: Apply 512 MiB PHP memory limit which is required to assure updater success and will else be treated as error with Nextcloud 21: https://github.com/nextcloud/server/commit/1995097cb8623b2447a2805a8e8e045c24203311 - for i in /etc/php/*/mods-available/dietpi-nextcloud.ini - do - [[ -f $i ]] || continue - G_CONFIG_INJECT 'memory_limit[[:blank:]]*=' 'memory_limit=512M' "$i" - done - #------------------------------------------------------------------------------- - - elif (( $G_DIETPI_VERSION_SUB == 34 )); then - - #------------------------------------------------------------------------------- - # Unbound: Merge dietpi-pihole.conf into dietpi.conf - if [[ -f '/etc/unbound/unbound.conf.d/dietpi-pihole.conf' && -f '/etc/unbound/unbound.conf.d/dietpi.conf' ]] - then - G_DIETPI-NOTIFY 2 'Unbound: Merging dietpi-pihole.conf into dietpi.conf' - local interface=$(mawk '/^[ \t]*interface:/{print $2;exit}' /etc/unbound/unbound.conf.d/dietpi-pihole.conf) - local port=$(mawk '/^[ \t]*port:/{print $2;exit}' /etc/unbound/unbound.conf.d/dietpi-pihole.conf) - G_CONFIG_INJECT 'interface:[[:blank:]]' " interface: $interface" /etc/unbound/unbound.conf.d/dietpi.conf - G_CONFIG_INJECT 'port:[[:blank:]]' " port: $port" /etc/unbound/unbound.conf.d/dietpi.conf - G_EXEC rm /etc/unbound/unbound.conf.d/dietpi-pihole.conf - fi - #------------------------------------------------------------------------------- - # ReadyMedia: Fix database rebuild on service start - [[ -f '/etc/systemd/system/minidlna.service' ]] && G_EXEC sed --follow-symlinks -i '/^ExecStart=/s/ -SR / -S -R /' /etc/systemd/system/minidlna.service - #------------------------------------------------------------------------------- - # Raspberry Pi Microsoft VS Code repo: https://github.com/MichaIng/DietPi/issues/4083 - [[ $G_HW_MODEL -le 9 && -f '/etc/apt/sources.list.d/vscode.list' ]] && { G_WHIP_BUTTON_OK_TEXT='Keep it' G_WHIP_BUTTON_CANCEL_TEXT='Remove it' G_WHIP_YESNO 'The Microsoft Visual Studio Code APT repository has been found on your system. -\nThis repository was added by the "raspberrypi-sys-mods" package from the Raspberry Pi Foundation, to support development around the new Raspberry Pi Pico. -\nIf you do no VS Code development, we suggest to remove this APT repository and its key from your system.' || G_EXEC rm -f /etc/apt/sources.list.d/vscode.list /etc/apt/trusted.gpg.d/microsoft.gpg /etc/apt/preferences.d/3rd_parties.pref; } - #------------------------------------------------------------------------------- - # Remove obsolete directory - [[ -d '/var/lib/dietpi/dietpi-software/services' ]] && G_EXEC rmdir --ignore-fail-on-non-empty /var/lib/dietpi/dietpi-software/services - #------------------------------------------------------------------------------- - # Last subversion patch completed: Apply reinstalls - if [[ -f '/var/tmp/dietpi/dietpi-update_reinstalls' ]] - then - # Coders NB: Assigning to array is not easily possible here since we need to split at newline AND space. - # shellcheck disable=SC2046 - (( $G_DIETPI_INSTALL_STAGE == 2 )) && { /boot/dietpi/dietpi-software reinstall $( 34 )) - do - G_DIETPI-NOTIFY 2 "Patching $G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB to $G_DIETPI_VERSION_CORE.$(( $G_DIETPI_VERSION_SUB + 1 ))" - Subversion_Patch || exit 1 - ((G_DIETPI_VERSION_SUB++)) - # Save reached version info - G_VERSIONDB_SAVE - done - #------------------------------------------------------------------------------- - exit 0 - #------------------------------------------------------------------------------- -} diff --git a/dietpi/pre-patch_file b/dietpi/pre-patch_file deleted file mode 100755 index 2e826ae479..0000000000 --- a/dietpi/pre-patch_file +++ /dev/null @@ -1,291 +0,0 @@ -#!/bin/bash -{ - #//////////////////////////////////// - # DietPi Pre-patch script - # - #//////////////////////////////////// - # Created by MichaIng / micha@dietpi.com / dietpi.com - # - #//////////////////////////////////// - # - # Info: - # - Patches changes made to update system, critical bug fixes and changes that need to be applied before APT and patch_file to run without error - # - Runs from dietpi-update as very first update step - # - In case of failure, returns related pre-patch ID as exit code - # - NB: Keep this script as simple as possible, do not load/call dietpi-globals, to allow adjusting/fixing most kinds of DietPi code first! - # - # Usage: - # - ./pre-patch_file $G_DIETPI_VERSION_SUB - #//////////////////////////////////// - - # Grab input, being failsafe when applying to $G_DIETPI_VERSION_SUB - if [[ $1 =~ ^-?[0-9]+$ ]]; then - - G_DIETPI_VERSION_SUB=$1 - - else - - echo -e "\e[90m[\e[0m\e[31mFAILED\e[0m\e[90m]\e[0m Invalid input argument ($1)" - exit 255 - - fi - - # Obtain HW model - if [[ -f '/DietPi/dietpi/.hw_model' ]] && grep -q '^G_HW_MODEL=' /DietPi/dietpi/.hw_model; then - - # shellcheck disable=SC1091 - . /DietPi/dietpi/.hw_model - - elif [[ -f '/boot/dietpi/.hw_model' ]] && grep -q '^G_HW_MODEL=' /boot/dietpi/.hw_model; then - - . /boot/dietpi/.hw_model - - else - - # shellcheck disable=SC1091,SC2015 - G_HW_MODEL=$([[ -f '/DietPi/dietpi/.hw_model' ]] && mawk 'NR==1' /DietPi/dietpi/.hw_model || mawk 'NR==1' /boot/dietpi/.hw_model) - - fi - - #/////////////////////////////////////////////////////////////////////////////// - # Main loop - #/////////////////////////////////////////////////////////////////////////////// - #------------------------------------------------------------------------------- - # Pre-patch 1: RAMlog 0 free space check due to issues with failing DietPi cron jobs in v6.11 - if (( $G_DIETPI_VERSION_SUB < 12 && $(df -m --output=avail /var/log | tail -1) < 2 )); then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 1 | Clearing /var/log files to free up RAMlog space (<2MB) before update will continue' - /DietPi/dietpi/func/dietpi-logclear 1 || exit 1 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 2: https://github.com/MichaIng/DietPi/pull/2490 - if (( $G_DIETPI_VERSION_SUB < 21 )) && [[ -f '/etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf' ]] && grep -qi 'buster' /etc/os-release; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 2 | Patching /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf for MariaDB v10.3/Buster support' - sed --follow-symlinks -i '/innodb_large_prefix/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf || exit 2 - sed --follow-symlinks -i '/innodb_file_format/d' /etc/mysql/mariadb.conf.d/99-dietpi-4byte.cnf || exit 2 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 3: https://github.com/MichaIng/DietPi/issues/2213 - if (( $G_DIETPI_VERSION_SUB < 22 )) && GLOBAL_PW=$(openssl enc -d -a -aes-256-cbc -nosalt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin 2> /dev/null); then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 3 | Storing global DietPi-Software password with enhanced security' - grep -qEi 'buster|bullseye' /etc/os-release && pbkdf2=('-iter' '10000') || pbkdf2=() - openssl enc -e -a -md sha256 -aes-256-cbc "${pbkdf2[@]}" -salt -pass pass:'DietPiRocks!' -out /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin <<< "$GLOBAL_PW" || exit 3 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 5: Add new G_CHECK_URL dietpi.txt settings - if (( $G_DIETPI_VERSION_SUB < 23 )); then - - grep -q 'CONFIG_G_CHECK_URL_TIMEOUT' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_TIMEOUT=10' >> /DietPi/dietpi.txt || exit 5 - grep -q 'CONFIG_G_CHECK_URL_ATTEMPTS' /DietPi/dietpi.txt || echo 'CONFIG_G_CHECK_URL_ATTEMPTS=2' >> /DietPi/dietpi.txt || exit 5 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 6: Move Jessie systems to "jessie-support" branch: https://github.com/MichaIng/DietPi/issues/2332 - if grep -qi 'jessie' /etc/os-release; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 6 | Migrating Jessie systems to "jessie-support" update branch' - if grep -q '^[[:blank:]]*DEV_GITBRANCH=' /DietPi/dietpi.txt; then - - sed --follow-symlinks -i '/^[[:blank:]]*DEV_GITBRANCH=/c\DEV_GITBRANCH=jessie-support' /DietPi/dietpi.txt || exit 6 - - else - - echo 'DEV_GITBRANCH=jessie-support' >> /DietPi/dietpi.txt || exit 6 - - fi - - # Remove DietPi-Update working directory to allow concurrent execution. - cd /tmp || exit 6 - [[ -d '/tmp/DietPi-Update' ]] && { rm -R /tmp/DietPi-Update || exit 6; } - - # Apply update forcefully, since user has already chosen to do so. - /DietPi/dietpi/dietpi-update 1 || exit 6 - - echo -e '\e[90m[\e[0m\e[32m OK \e[90m]\e[0m Everything done! Terminating the obsolete DietPi-Update parent instance...' - kill "$PPID" - exit - - fi - #------------------------------------------------------------------------------- - # Pre-patch 8: https://github.com/MichaIng/DietPi/issues/2795 - if (( $G_DIETPI_VERSION_SUB < 24 )) && [[ -f '/etc/apt/preferences.d/dietpi-openssl' ]]; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 8 | Patching PHP APT repo preferences to prevent possible APT upgrade issues' - echo -e '# libssl1.1 from sury.org breaks Lighttpd install -Package: openssl libssl*\nPin: origin packages.sury.org\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-openssl || exit 8 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 9: https://github.com/MichaIng/DietPi/issues/2808 - if (( $G_DIETPI_VERSION_SUB < 25 )) && [[ -f '/etc/apt/preferences.d/dietpi-php' ]]; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 9 | Patching Buster APT repo preferences to prevent possible APT issues' - echo -e '# Allow to install PHP7.3 dependencies and meta packages from Buster -# - Lighttpd must be pulled as well from Buster since the Stretch version does not support Buster libssl1.1 (1.1.1) -Package: php libapache2-mod-php php-* libssl* libc6* libc-* libgssapi-krb5-2 libpcre2-8-0 libk5crypto3 libkrb5-3 libkrb5support0 locales libzip4 curl libcurl4-openssl-dev lighttpd -Pin: release n=buster\nPin-Priority: 501\n -# Pin down all other Buster packages to only allow upgrades of already installed ones via: "apt upgrade" -Package: *\nPin: release n=buster\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-php || exit 9 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 10: https://github.com/MichaIng/DietPi/pull/3020 - if (( $G_DIETPI_VERSION_SUB < 26 )) && command -v xrdp &> /dev/null && grep -qi 'stretch' /etc/os-release; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 10 | Allow upgrade of XRDP from backports to resolve certain issues with current Stretch version' - cat << _EOF_ > /etc/apt/preferences.d/dietpi-xrdp || exit 10 -Package: xrdp -Pin: release n=stretch-backports -Pin-Priority: 500 -_EOF_ - - fi - #------------------------------------------------------------------------------- - # Pre-patch 11: https://github.com/MichaIng/DietPi/issues/3029 - if (( $G_DIETPI_VERSION_SUB < 26 )) && [[ -f '/etc/apt/sources.list.d/sonarr.list' ]]; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 11 | Updating Sonarr APT repository key' - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0xA236C58F409091A18ACA53CBEBFF6B99D9B78493 || exit 11 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 12: https://github.com/MichaIng/DietPi/issues/3038 - if (( $G_DIETPI_VERSION_SUB < 23 )) && [[ -f '/etc/apt/sources.list.d/plex.list' ]] && grep -q 'dev2day' /etc/apt/sources.list.d/plex.list; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 12 | Removing obsolete dev2day repo for Plex Media Server, replaced by the new official APT repo' - rm /etc/apt/sources.list.d/plex.list || exit 12 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 13/14: https://github.com/MichaIng/DietPi/issues/3131#issuecomment-536997267 - # Pre-patch 17: https://github.com/MichaIng/DietPi/issues/3031#issuecomment-540477241 - if (( $G_DIETPI_VERSION_SUB < 26 )); then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 13 | Disabling dpkg status file translations by default, which have hardly any use, but raise APT update times + disk I/O ' - echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/98-dietpi-no_translations || exit 13 - - if [[ -f '/etc/apt/sources.list.d/dietpi-wireguard.list' ]]; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 14 | Switch to "bullseye" repo for WireGuard installs' - # Raspbian - if (( $G_HW_MODEL < 10 )) && (( ${G_RASPBIAN:=1} )); then - - echo 'deb http://raspbian.raspberrypi.org/raspbian/ bullseye main' > /etc/apt/sources.list.d/dietpi-wireguard.list || exit 14 - - # non-RPi - else - - echo 'deb https://deb.debian.org/debian/ bullseye main' > /etc/apt/sources.list.d/dietpi-wireguard.list || exit 14 - - fi - - fi - - if (( $G_HW_MODEL < 10 )) && dpkg-query -s kodi &> /dev/null; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 17 | Pre-create /etc/polkit-1/localauthority/50-local.d to prevent Kodi upgrade failure' - mkdir -p /etc/polkit-1/localauthority/50-local.d || exit 17 - - fi - - fi - #------------------------------------------------------------------------------- - # Pre-patch 16: https://github.com/MichaIng/DietPi/pull/2571 - # Pre-patch 19: https://github.com/MichaIng/DietPi/issues/3221#issuecomment-560462951 - # Pre-patch 20: resolvconf does not depend on ifupdown anymore since v1.80 (Debian Bullseye, but we apply on all distro versions) - if (( $G_DIETPI_VERSION_SUB < 27 )); then - - if [[ -f '/etc/apt/preferences.d/dietpi-wireguard' ]]; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 16 | Harden "bullseye" repo preferences for WireGuard installs' - echo -e 'Package: *\nPin: release n=bullseye\nPin-Priority: -1\n -Package: wireguard wireguard-dkms wireguard-tools\nPin: release n=bullseye\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard || exit 16 - - fi - - if [[ -f '/etc/kernel/postinst.d/dietpi-wireguard' ]]; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 18 | Remove WireGuard auto-rebuild skript, since DKMS is now triggered correctly' - rm /etc/kernel/postinst.d/dietpi-wireguard || exit 18 - - fi - if [[ -f '/etc/.dietpi_hw_model_identifier' && $( /etc/.dietpi_hw_model_identifier - - fi - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 20 | Mark ifupdown as manually installed to prevent its autoremoval' - apt-mark manual ifupdown - - fi - #------------------------------------------------------------------------------- - # Pre-patch 21: Assure C.UTF-8 locale being available - if (( $G_DIETPI_VERSION_SUB < 31 )) && ! locale -a | grep -qiE '^C.UTF-?8'; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 21 | Compile C.UTF-8 locale as new DietPi default' - localedef -ci C -f UTF-8 C.UTF-8 - locale -a | grep -qiE '^C.UTF-?8' || exit 21 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 22: Switch to our new Meveric's Odroid repo mirror on https://dietpi.com/meveric/ - if (( $G_DIETPI_VERSION_SUB < 33 && $G_HW_MODEL > 10 && $G_HW_MODEL < 20 )); then - - echo -e "\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 22 | Switch to our new Meveric's Odroid repo mirror on https://dietpi.com/meveric/" - sed --follow-symlinks -Ei 's@(http://fuzon\.co\.uk|https?://oph\.mdrjr\.net)@https://dietpi.com@' /etc/apt/sources.list{,.d/*.list} || exit 22 - - fi - #------------------------------------------------------------------------------- - # Pre-patch 23: https://github.com/MichaIng/DietPi/issues/3700 - if [[ $G_DIETPI_VERSION_SUB -lt 32 && $(uname -m) == 'x86_64' ]]; then - - # VirtualBox - if grep -q '/dev/disk/by-id/ata-VBOX_HARDDISK_VBeda89797-79ca820f' /var/cache/debconf/config.dat; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 23 | Fixing the grub debconf drive ID' - sed --follow-symlinks -i 's|/dev/disk/by-id/ata-VBOX_HARDDISK_VBeda89797-79ca820f|/dev/sda|' /var/cache/debconf/config.dat || exit 23 - - # Native PC BIOS - elif grep -q '/dev/disk/by-id/ata-M4-CT128M4SSD2_000000001151090024A1' /var/cache/debconf/config.dat; then - - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 23 | Fixing the grub debconf drive ID' - sed --follow-symlinks -i 's|/dev/disk/by-id/ata-M4-CT128M4SSD2_000000001151090024A1|/dev/sda|' /var/cache/debconf/config.dat || exit 23 - - fi - - fi - #------------------------------------------------------------------------------- - # Pre-patch 24: https://github.com/radxa/apt/issues/9 - if (( $G_DIETPI_VERSION_SUB < 34 && $G_HW_MODEL == 73 )) - then - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 24 | Updating expired Radxa APT repository key' - curl -sSfL https://apt.radxa.com/buster-stable/public.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-radxa.gpg --yes || exit 24 - fi - #------------------------------------------------------------------------------- - # Pre-patch 25: Run DietPi v7 pre-patches as part of DietPi v6 pre-patches, to assure they run before APT. - echo -e '\e[90m[\e[0m INFO \e[90m]\e[0m Pre-patch 25 | Running DietPi v7 pre-patches' - # - Obtain target Git repo - if [[ -f '/DietPi/dietpi.txt' ]] - then - GIT_OWNER=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) - GIT_BRANCH=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /DietPi/dietpi.txt) - else - GIT_OWNER=$(sed -n '/^[[:blank:]]*DEV_GITOWNER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - GIT_BRANCH=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - fi - [[ $GIT_OWNER ]] || GIT_OWNER='MichaIng' - [[ $GIT_BRANCH ]] || GIT_BRANCH='master' - curl -sSfLO "https://raw.githubusercontent.com/$GIT_OWNER/DietPi/$GIT_BRANCH/.update/pre-patches" || exit 26 - chmod +x pre-patches || exit 26 - ./pre-patches || exit 26 - #------------------------------------------------------------------------------- - # Finished - exit 0 - #------------------------------------------------------------------------------- -} diff --git a/dietpi/server_version-6 b/dietpi/server_version-6 deleted file mode 100644 index cac48e00cc..0000000000 --- a/dietpi/server_version-6 +++ /dev/null @@ -1,3 +0,0 @@ -6 -35 -0 From 5e4478f2924e87deca4004615ba3cd1136b00810 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 10 Jan 2024 23:26:22 +0100 Subject: [PATCH 31/77] v9.0 - DietPi-Pre-patches | Create DietPi v6 files if the updater still expects them --- .update/pre-patches | 1 + 1 file changed, 1 insertion(+) diff --git a/.update/pre-patches b/.update/pre-patches index b953a5c2a6..b592dc4114 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -391,6 +391,7 @@ then find /etc/apt/sources.list.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/sources.list.d/*.list find /etc/apt/preferences.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/preferences.d/* fi + grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > /boot/dietpi/server_version-6 > /boot/dietpi/pre-patch_file > /boot/dietpi/patch_file fi exit 0 From 983534af8b225955149e114c787cccb16fc9e81f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 10 Jan 2024 23:36:24 +0100 Subject: [PATCH 32/77] v9.0 - DietPi-Pre-patches | Fix location of DietPi v6 files and mute shellcheck --- .update/pre-patches | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.update/pre-patches b/.update/pre-patches index b592dc4114..9624e0a58f 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -391,7 +391,8 @@ then find /etc/apt/sources.list.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/sources.list.d/*.list find /etc/apt/preferences.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/preferences.d/* fi - grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > /boot/dietpi/server_version-6 > /boot/dietpi/pre-patch_file > /boot/dietpi/patch_file + # shellcheck disable=SC2261 + grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > DietPi-*/dietpi/server_version-6 > DietPi-*/dietpi/pre-patch_file > /boot/dietpi/patch_file fi exit 0 From b8a86d86df2ce3f1472f882c293263cab6867854 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 10 Jan 2024 23:41:57 +0100 Subject: [PATCH 33/77] v9.0 - DietPi-Pre-patches | Fix redirect, which does not support wildcards --- .update/pre-patches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/pre-patches b/.update/pre-patches index 9624e0a58f..ec3d3a97d1 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -392,7 +392,7 @@ then find /etc/apt/preferences.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/preferences.d/* fi # shellcheck disable=SC2261 - grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > DietPi-*/dietpi/server_version-6 > DietPi-*/dietpi/pre-patch_file > /boot/dietpi/patch_file + grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > "DietPi-${GITBRANCH_TARGET//\//-}/dietpi/server_version-6" > "DietPi-${GITBRANCH_TARGET//\//-}/dietpi/pre-patch_file" > /boot/dietpi/patch_file fi exit 0 From 609ddadf1a0917dd21d426d231fa0b28c66fc499 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Jan 2024 02:06:00 +0100 Subject: [PATCH 34/77] v9.0 - DietPi-Pre-patches | Fix --- .update/pre-patches | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.update/pre-patches b/.update/pre-patches index ec3d3a97d1..dac7d0a752 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -392,7 +392,9 @@ then find /etc/apt/preferences.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/preferences.d/* fi # shellcheck disable=SC2261 - grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > "DietPi-${GITBRANCH_TARGET//\//-}/dietpi/server_version-6" > "DietPi-${GITBRANCH_TARGET//\//-}/dietpi/pre-patch_file" > /boot/dietpi/patch_file + GITBRANCH_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + GITBRANCH_TARGET=${GITBRANCH_TARGET//\//-} + grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > "DietPi-$GITBRANCH_TARGET/dietpi/server_version-6" > "DietPi-$GITBRANCH_TARGET/dietpi/pre-patch_file" > /boot/dietpi/patch_file fi exit 0 From eb5d94e6a1670e12e62abf8c169c9b0b8925a477 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Jan 2024 02:25:13 +0100 Subject: [PATCH 35/77] v9.0 - DietPi-Pre-patches | Fix --- .update/pre-patches | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.update/pre-patches b/.update/pre-patches index dac7d0a752..1fde8a078e 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -391,10 +391,10 @@ then find /etc/apt/sources.list.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/sources.list.d/*.list find /etc/apt/preferences.d/* &> /dev/null && G_EXEC sed -i 's/raspberrypi.org/raspberrypi.com/' /etc/apt/preferences.d/* fi - # shellcheck disable=SC2261 GITBRANCH_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) GITBRANCH_TARGET=${GITBRANCH_TARGET//\//-} - grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > "DietPi-$GITBRANCH_TARGET/dietpi/server_version-6" > "DietPi-$GITBRANCH_TARGET/dietpi/pre-patch_file" > /boot/dietpi/patch_file + # shellcheck disable=SC2261 + grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > "../DietPi-Update/DietPi-$GITBRANCH_TARGET/dietpi/server_version-6" > "../DietPi-Update/DietPi-$GITBRANCH_TARGET/dietpi/pre-patch_file" > /boot/dietpi/patch_file fi exit 0 From 6c9d66808884813597a5f71db57eb48d3e964ea0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Jan 2024 02:33:12 +0100 Subject: [PATCH 36/77] v9.0 - DietPi-Pre-patches | Fix --- .update/pre-patches | 1 + 1 file changed, 1 insertion(+) diff --git a/.update/pre-patches b/.update/pre-patches index 1fde8a078e..3b050d0397 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -393,6 +393,7 @@ then fi GITBRANCH_TARGET=$(sed -n '/^[[:blank:]]*DEV_GITBRANCH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) GITBRANCH_TARGET=${GITBRANCH_TARGET//\//-} + G_EXEC mkdir -p "../DietPi-Update/DietPi-$GITBRANCH_TARGET/dietpi" # shellcheck disable=SC2261 grep -q 'DietPi v6' /boot/dietpi/dietpi-update && > "../DietPi-Update/DietPi-$GITBRANCH_TARGET/dietpi/server_version-6" > "../DietPi-Update/DietPi-$GITBRANCH_TARGET/dietpi/pre-patch_file" > /boot/dietpi/patch_file fi From 7badaa5799a8fc48e70bf119a7be8a880e6ee289 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Jan 2024 19:14:23 +0100 Subject: [PATCH 37/77] v9.0 - DietPi-Pre-patches | Apply v9.0 pre-patches as well when upgrading from from v9.-1, true in case of v9.0 patch version updates --- .update/pre-patches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/pre-patches b/.update/pre-patches index 3b050d0397..cdd47c96e2 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -382,7 +382,7 @@ then fi # v9.0 -if (( $G_DIETPI_VERSION_CORE < 9 )) +if (( $G_DIETPI_VERSION_CORE < 9 || ( $G_DIETPI_VERSION_CORE == 9 && $G_DIETPI_VERSION_SUB < 0 ) )) then if (( $G_HW_MODEL < 10 || ( $G_HW_MODEL == 75 && ${G_RASPBIAN:-0} == 1 ) )) then From 44985537a53812eaf811ddbdc282cd86128732da Mon Sep 17 00:00:00 2001 From: StephanStS Date: Thu, 11 Jan 2024 21:56:04 +0100 Subject: [PATCH 38/77] Change release date from 2024-01-13 to 2024-01-20 --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a8d8da1e2b..4d445e7962 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,5 @@ v9.0 -(2024-01-13) +(2024-01-20) Breaking: - The minimum Debian version supported by our scripts has been raised to Bullseye. Buster systems will be migrated to a dedicated branch automatically. We highly recommend affected systems to either flash a new image or upgrade to Debian Bullseye, following this guide: https://dietpi.com/blog/?p=811. Once the upgrade has been done, the update to DietPi v9 will be offered on next update ckeck or when running "dietpi-update". From eff291576c2b48995aed49c629348a86e5957f49 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Jan 2024 22:12:01 +0100 Subject: [PATCH 39/77] v9.0 - DietPi-Update | Change Buster and v6 fallback branch name to "8". GitHub internally removes the "v" from branches which match version strings, and hence the directory of the archive is not named "DietPi-v8" as expected by the updater, but "DietPi-8". --- .update/version | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.update/version b/.update/version index a4e14efaba..6ad735c192 100644 --- a/.update/version +++ b/.update/version @@ -8,11 +8,11 @@ G_REMOTE_VERSION_RC=0 G_MIN_VERSION_CORE=7 G_MIN_VERSION_SUB=0 # Alternative Git branch to automatically migrate to when DietPi version is too low -G_OLD_VERSION_BRANCH='v8' +G_OLD_VERSION_BRANCH='8' # Minimum Debian version to allow update G_MIN_DEBIAN=6 # Alternative Git branch to automatically migrate to when Debian version is too low -G_OLD_DEBIAN_BRANCH='v8' +G_OLD_DEBIAN_BRANCH='8' # Live patches G_LIVE_PATCH_DESC=() G_LIVE_PATCH_COND=() From 0aaba5a6133d8a7d8452f9ecf4a9245da6c8a094 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 11 Jan 2024 23:40:06 +0100 Subject: [PATCH 40/77] v9.0 (#6851) - DietPi-Software | Remove all Buster-specific code - DietPi-Software | Moonlight (CLI/GUI): Moonlight has been enabled on Bookworm, as packages are now available. - DietPi-Set_hardware | headless: Remove support for legacy Odroid C2 images --- .github/workflows/dietpi-software-build.yml | 5 +- .github/workflows/dietpi-software.bash | 21 +- .github/workflows/dietpi-software.yml | 5 +- CHANGELOG.txt | 1 + dietpi/dietpi-software | 511 ++++++-------------- dietpi/func/dietpi-set_hardware | 77 +-- 6 files changed, 172 insertions(+), 448 deletions(-) diff --git a/.github/workflows/dietpi-software-build.yml b/.github/workflows/dietpi-software-build.yml index 6d8f3010f7..2b253b404f 100644 --- a/.github/workflows/dietpi-software-build.yml +++ b/.github/workflows/dietpi-software-build.yml @@ -17,7 +17,7 @@ on: dist: description: 'Target Debian version' type: choice - options: [buster, bullseye, bookworm, trixie, all] + options: [bullseye, bookworm, trixie, all] default: all required: true concurrency: @@ -57,7 +57,7 @@ jobs: run: | if [ '${{ github.event.inputs.dist }}' = 'all' ] then - echo 'dist=["buster", "bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" + echo 'dist=["bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" else echo 'dist=["${{ github.event.inputs.dist }}"]' >> "$GITHUB_OUTPUT" fi @@ -69,7 +69,6 @@ jobs: arch: ${{ fromJson(needs.prep.outputs.arch) }} dist: ${{ fromJson(needs.prep.outputs.dist) }} exclude: - - { arch: riscv64, dist: buster } - { arch: riscv64, dist: bullseye } - { arch: riscv64, dist: bookworm } - { arch: riscv64, name: vaultwarden } diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index cac4255f8c..e4a89c4a0c 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -49,7 +49,7 @@ do esac shift done -[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } +[[ $DISTRO =~ ^('bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } case $ARCH in 'armv6l') image="ARMv6-${DISTRO^}" arch=1;; 'armv7l') image="ARMv7-${DISTRO^}" arch=2;; @@ -129,7 +129,7 @@ Process_Software() 85) aSERVICES[i]='nginx' aTCP[i]='80';; #86) aSERVICES[i]='roon-extension-manager';; # Docker does not start in systemd containers (without dedicated network) 88) aSERVICES[i]='mariadb' aTCP[i]='3306';; - 89) case $DISTRO in 'buster') aSERVICES[i]='php7.3-fpm';; 'bullseye') aSERVICES[i]='php7.4-fpm';; *) aSERVICES[i]='php8.2-fpm';; esac;; + 89) case $DISTRO in 'bullseye') aSERVICES[i]='php7.4-fpm';; *) aSERVICES[i]='php8.2-fpm';; esac;; 91) aSERVICES[i]='redis-server' aTCP[i]='6379';; 93) aSERVICES[i]='pihole-FTL' aUDP[i]='53';; 94) aSERVICES[i]='proftpd' aTCP[i]='21';; @@ -363,23 +363,6 @@ G_EXEC eval 'echo -e '\''[Service]\nPrivateUsers=0'\'' > rootfs/etc/systemd/syst G_EXEC eval 'echo -e '\''[Service]\nPrivateUsers=0'\'' > rootfs/etc/systemd/system/navidrome.service.d/dietpi-container.conf' G_EXEC eval 'echo -e '\''[Service]\nAmbientCapabilities='\'' > rootfs/etc/systemd/system/homebridge.service.d/dietpi-container.conf' -# Workarounds for failing MariaDB install on Buster within GitHub Actions runner (both cannot be replicated on my test systems with and without QEMU): -# - mysqld does not have write access if our symlink is in place, even that directory permissions are correct. -# - Type=notify leads to a service start timeout while mysqld has actually fully started. However, with Type=exec, /etc/mysql/debian-start starts too soon after mysqld, so that the UNIX socket is not yet ready to listen. Hence add a second to wait for it. -if [[ $DISTRO == 'buster' ]] -then - G_EXEC sed --follow-symlinks -i '/# Start DietPi-Software/a\sed -i -e '\''s|rm -Rf /var/lib/mysql|rm -Rf /mnd/dietpi_userdata/mysql|'\'' -e '\''s|ln -s /mnt/dietpi_userdata/mysql /var/lib/mysql|ln -s /var/lib/mysql /mnt/dietpi_userdata/mysql|'\'' /boot/dietpi/dietpi-software' rootfs/boot/dietpi/dietpi-login - G_EXEC mkdir rootfs/etc/systemd/system/mariadb.service.d - cat << '_EOF_' > rootfs/etc/systemd/system/mariadb.service.d/dietpi-container.conf || exit 1 -[Service] -Type=exec -ExecStartPost= -ExecStartPost=/bin/sleep 1 -ExecStartPost=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION" -ExecStartPost=/etc/mysql/debian-start -_EOF_ -fi - # Workaround for failing 32-bit ARM Rust builds on ext4 in QEMU emulated container on 64-bit host: https://github.com/rust-lang/cargo/issues/9545 (( $arch < 3 && $G_HW_ARCH > 9 )) && G_EXEC eval 'echo -e '\''tmpfs /mnt/dietpi_userdata tmpfs size=3G,noatime,lazytime\ntmpfs /root tmpfs size=3G,noatime,lazytime'\'' >> rootfs/etc/fstab' diff --git a/.github/workflows/dietpi-software.yml b/.github/workflows/dietpi-software.yml index f80c85dec7..b0ce11cb13 100644 --- a/.github/workflows/dietpi-software.yml +++ b/.github/workflows/dietpi-software.yml @@ -11,7 +11,7 @@ on: dist: description: 'Target Debian version' type: choice - options: [buster, bullseye, bookworm, trixie, all] + options: [bullseye, bookworm, trixie, all] default: all required: true soft: @@ -54,7 +54,7 @@ jobs: run: | if [ '${{ github.event.inputs.dist }}' = 'all' ] then - echo dist='["buster", "bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" + echo dist='["bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" else echo dist='["${{ github.event.inputs.dist }}"]' >> "$GITHUB_OUTPUT" fi @@ -68,7 +68,6 @@ jobs: arch: ${{ fromJson(needs.prep.outputs.arch) }} dist: ${{ fromJson(needs.prep.outputs.dist) }} exclude: - - { arch: riscv64, dist: buster } - { arch: riscv64, dist: bullseye } - { arch: riscv64, dist: bookworm } - { arch: armv6l, dist: trixie } diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 4d445e7962..eb39936ea3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -11,6 +11,7 @@ New images: Enhancements: - DietPi-Banner | Instead of "Freespace", the "Disk usage" is now shown, including the total disk size and used percent. Many thanks to @Andr3Carvalh0 for implementing this change: https://github.com/MichaIng/DietPi/pull/6837 - DietPi-Software | motionEye: Updated build dependencies for ARM and RISC-V, and switched to the recent pre-release from PyPI, instead of pulling from the repositories dev branch. +- DietPi-Software | Moonlight (CLI/GUI): Moonlight has been enabled on Bookworm, as packages are now available. Bug fixes: diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 033e68793e..fcafcdb1e8 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -137,13 +137,8 @@ Available commands: # Read encrypted password if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]] then - if ! GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc -iter 10000 -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) - then - # Allow decryption without pbkdf2/"-iter 10000" and re-encrypt on dist-upgraded Buster systems - encrypt=1 - # In case of error, assure empty password to fallback to default - GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) || GLOBAL_PW= - fi + # In case of error, assure empty password to fallback to default and re-encrypt it + GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc -iter 10000 -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) || encrypt=1 GLOBAL_PW= # If encryption has not yet been done, do it now! else @@ -528,8 +523,6 @@ Available commands: aSOFTWARE_CATX[$software_id]=2 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/media/#raspotify' aSOFTWARE_DEPS[$software_id]='5' - # - Buster: https://dtcooper.github.io/raspotify/ - aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 # - RISC-V: No package: https://github.com/dtcooper/raspotify/releases aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 # - Bookworm on ARMv6 (older package): "/usr/bin/librespot: error while loading shared libraries: ld-linux.so.3: cannot open shared object file: No such file or directory" @@ -981,10 +974,6 @@ Available commands: (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=0 # - ARMv6: https://github.com/moonlight-stream/moonlight-embedded/issues/832 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # No Bookworm packages yet and Bullseye packages depend on libssl1.1 - aSOFTWARE_AVAIL_G_DISTRO[$software_id,7]=0 - # No Buster ARMv8 packages - (( $G_HW_ARCH == 3 )) && aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 #------------------ software_id=208 aSOFTWARE_NAME[$software_id]='Moonlight (GUI)' @@ -995,8 +984,6 @@ Available commands: (( $G_HW_MODEL > 9 )) && aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=0 # - ARMv6: https://github.com/moonlight-stream/moonlight-embedded/issues/832 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # No Bookworm packages yet and Bullseye packages depend on libssl1.1 - aSOFTWARE_AVAIL_G_DISTRO[$software_id,7]=0 # Social & Search #-------------------------------------------------------------------------------- @@ -1056,8 +1043,6 @@ Available commands: aSOFTWARE_CATX[$software_id]=6 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/social/#mediawiki' aSOFTWARE_DEPS[$software_id]='88 89 webserver' - # - Buster: For MediaWiki, at least PHP 7.4.3 is required: https://www.mediawiki.org/wiki/Manual:Installation_requirements#PHP - aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 # Camera & Surveillance #-------------------------------------------------------------------------------- @@ -1852,8 +1837,8 @@ Available commands: aSOFTWARE_CATX[$software_id]=28 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/desktop/#chromium' aSOFTWARE_DEPS[$software_id]='5 6' - # - ARMv6 since Bullseye: https://github.com/RPi-Distro/chromium-browser/issues/21 - (( $G_DISTRO < 6 )) || aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + # - ARMv6: https://github.com/RPi-Distro/chromium-browser/issues/21 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 # - RISC-V: Missing package: https://packages.debian.org/sid/chromium aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ @@ -1863,8 +1848,8 @@ Available commands: aSOFTWARE_CATX[$software_id]=28 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/desktop/#firefox' aSOFTWARE_DEPS[$software_id]='5 6' - # - ARMv6 since Bullseye: https://github.com/RPi-Distro/chromium-browser/issues/21#issuecomment-997044303 - (( $G_DISTRO < 6 )) || aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 + # - ARMv6: https://github.com/RPi-Distro/chromium-browser/issues/21#issuecomment-997044303 + aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 #------------------ software_id=174 aSOFTWARE_NAME[$software_id]='GIMP' @@ -2132,8 +2117,8 @@ Available commands: # - Do no reinstalls, as those are loose dependencies (( ${aSOFTWARE_INSTALL_STATE[67]} < 1 && ${aSOFTWARE_INSTALL_STATE[113]} < 1 )) || return 1 - # Disable browser preference on ARMv6 Bullseye+ and RISC-V systems: https://github.com/RPi-Distro/chromium-browser/issues/21 - (( $G_HW_ARCH == 1 && $G_DISTRO > 5 )) || (( $G_HW_ARCH == 11 )) && return 1 + # Disable browser preference on ARMv6 and RISC-V systems: https://github.com/RPi-Distro/chromium-browser/issues/21 + (( $G_HW_ARCH == 1 || $G_HW_ARCH == 11 )) && return 1 # Auto-select browser if manually installed if dpkg-query -s 'firefox-esr' &> /dev/null @@ -2812,14 +2797,7 @@ _EOF_ # Stop OpenSSH service to unbind port 22 systemctl -q is-active ssh && G_EXEC systemctl stop ssh - # On Buster, Dropbear packages have been split: Install "dropbear-run" only to skip "dropbear-initramfs" - # With Bullseye, "dropbear-run" has become a transitional dummy package for "dropbear" which does not include "dropbear-initramfs" anymore. - if (( $G_DISTRO > 5 )) - then - G_AGI dropbear - else - G_AGI dropbear-run - fi + G_AGI dropbear # Enable Dropbear daemon, obsolete since Bookworm (( $G_DISTRO > 6 )) || G_CONFIG_INJECT 'NO_START=' 'NO_START=0' /etc/default/dropbear @@ -2971,12 +2949,12 @@ unix_socket_directories = '/run/postgresql'" > "$i/00dietpi.conf" then local version=8 - # Buster - elif (( $G_DISTRO == 5 )) + # Trixie without openHAB + elif (( $G_DISTRO > 7 && ${aSOFTWARE_INSTALL_STATE[206]} < 1 )) then - local version=11 + local version=21 - # Bullseye + # Bullseye/Bookworm else local version=17 G_EXEC_RETRIES=1 # Workaround for our old friend "Running hooks in /etc/ca-certificates/update.d... /etc/ca-certificates/update.d/jks-keystore: 82: java: not found" @@ -2992,12 +2970,12 @@ unix_socket_directories = '/run/postgresql'" > "$i/00dietpi.conf" then local version=8 - # Buster - elif (( $G_DISTRO == 5 )) + # Trixie without openHAB + elif (( $G_DISTRO > 7 && ${aSOFTWARE_INSTALL_STATE[206]} < 1 )) then - local version=11 + local version=21 - # Bullseye + # Bullseye/Bookworm else local version=17 fi @@ -3034,12 +3012,11 @@ unix_socket_directories = '/run/postgresql'" > "$i/00dietpi.conf" # ARMv6/7: Add piwheels (( $G_HW_ARCH < 3 )) && G_CONFIG_INJECT 'extra-index-url[[:blank:]]*=' 'extra-index-url=https://www.piwheels.org/simple/' /etc/pip.conf '\[global\]' - # Workaround for missing and failing numpy >=v1.21.5 build: https://github.com/piwheels/packages/issues/287#issuecomment-1036500818 - if (( $G_HW_ARCH < 3 && $G_DISTRO == 5 )) + # Buster => Bullseye upgrade: Remove obsolete pip constraint + if [[ -f '/etc/pip-constraints.txt' ]] && grep -q 'numpy' /etc/pip-constraints.txt then - G_EXEC eval 'echo "numpy<1.21.5; python_version=='\''3.7'\''" > /etc/pip-constraints.txt' - G_CONFIG_INJECT '\[install\]' '[install]' /etc/pip.conf - G_CONFIG_INJECT 'constraint[[:blank:]]*=[[:blank:]]*/etc/pip-constraints.txt' 'constraint=/etc/pip-constraints.txt' /etc/pip.conf '\[install\]' + G_EXEC sed --follow-symlinks -i '/^constraint=/d' /etc/pip.conf + G_EXEC rm /etc/pip-constraints.txt fi # Perform pip3 install (which includes setuptools and wheel modules) @@ -3123,15 +3100,12 @@ Package: openbox* obconf* libob* pcmanfm* libfm* gtk-* libgtk* libgail* gir1.2-g Pin: origin archive.raspberrypi.com Pin-Priority: -1 _EOF_ - # Bullseye: https://github.com/MichaIng/DietPi/issues/4687 - local apackages=() - (( $G_DISTRO > 5 )) && apackages+=('librsvg2-common') - # LXDE pulls in LightDM as dependency, which sets up itself as display manager so that the system boots automatically into it. So check whether a default display manager is present first, and if not, remove it afterwards. local display_manager=0 [[ -f '/etc/systemd/system/display-manager.service' ]] && display_manager=1 - G_AGI lxde lxhotkey-plugin-openbox upower "${apackages[@]}" + # librsvg2-common: https://github.com/MichaIng/DietPi/issues/4687 + G_AGI lxde lxhotkey-plugin-openbox upower librsvg2-common [[ $display_manager == 0 && -f '/etc/systemd/system/display-manager.service' ]] && G_EXEC rm /etc/systemd/system/display-manager.service @@ -3430,8 +3404,8 @@ _EOF_ # Do not allow root access via FTP G_EXEC sed --follow-symlinks -i 's/^[[:blank:]]*root/#root/' /etc/ftpusers - # Bullseye: Fix ident lookup: https://github.com/MichaIng/DietPi/issues/4666 - (( $G_DISTRO < 6 )) || G_EXEC sed --follow-symlinks -i '/IdentLookups/c\\nIdentLookups off\n' /etc/proftpd/proftpd.conf + # Fix ident lookup: https://github.com/MichaIng/DietPi/issues/4666 + G_EXEC sed --follow-symlinks -i '/IdentLookups/c\\nIdentLookups off\n' /etc/proftpd/proftpd.conf fi if To_Install 96 nmbd smbd # Samba Server @@ -3602,15 +3576,8 @@ _EOF_ local deflate=() openssl=() if [[ -f '/etc/lighttpd/lighttpd.conf' ]] then - # Buster: "create-mime.assign.pl" has been renamed to "create-mime.conf.pl" - if grep -q 'create-mime\.assign\.pl' /etc/lighttpd/lighttpd.conf - then - G_DIETPI-NOTIFY 2 'Buster upgrade detected: Migrating from "create-mime.assign.pl" to "create-mime.conf.pl"' - G_EXEC sed --follow-symlinks -i 's/create-mime\.assign\.pl/create-mime.conf.pl/' /etc/lighttpd/lighttpd.conf - fi - - # Bullseye: mod_compress has been superseded by mod_deflate - if (( $G_DISTRO > 5 )) && grep -q '^[[:blank:]]*"mod_compress",$' /etc/lighttpd/lighttpd.conf + # mod_compress has been superseded by mod_deflate + if grep -q '^[[:blank:]]*"mod_compress",$' /etc/lighttpd/lighttpd.conf then G_DIETPI-NOTIFY 2 'Bullseye upgrade detected: Migrating from mod_compress to mod_deflate' G_EXEC sed --follow-symlinks -Ei '/^compress\..*=[[:blank:]]*["(].*[")]$/d' /etc/lighttpd/lighttpd.conf @@ -3618,23 +3585,23 @@ _EOF_ deflate=('lighttpd-mod-deflate') fi - # Bullseye: Install OpenSSL module if DietPi-LetsEncrypt was used - if [[ $G_DISTRO -gt 5 && -f '/boot/dietpi/.dietpi-letsencrypt' ]] + # Install OpenSSL module if DietPi-LetsEncrypt was used + if [[ -f '/boot/dietpi/.dietpi-letsencrypt' ]] then G_DIETPI-NOTIFY 2 'DietPi-LetsEncrypt usage detected: Installing OpenSSL module' openssl=('lighttpd-mod-openssl') [[ -f '/etc/lighttpd/conf-available/50-dietpi-https.conf' ]] && ! grep -q '"mod_openssl"' /etc/lighttpd/conf-available/50-dietpi-https.conf && G_EXEC sed --follow-symlinks -i '1iserver.modules += ( "mod_openssl" )' /etc/lighttpd/conf-available/50-dietpi-https.conf fi - # Bullseye: Remove obsolete socket version string from FPM module - if [[ $G_DISTRO -gt 5 && -f '/etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf' ]] && grep -q 'php.\..-fpm\.sock' /etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf + # Remove obsolete socket version string from FPM module + if [[ -f '/etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf' ]] && grep -q 'php.\..-fpm\.sock' /etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf then G_DIETPI-NOTIFY 2 'Bullseye upgrade detected: Removing obsolete socket version string from FPM module' G_EXEC sed --follow-symlinks -i 's/php.\..-fpm\.sock/php-fpm.sock/' /etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf fi fi - # perl is required for lighty-enable-mod, it has been degraded to recommends only with Buster. + # perl is required for lighty-enable-mod, but is a recommendation only G_AGI lighttpd perl "${deflate[@]}" "${openssl[@]}" G_EXEC systemctl stop lighttpd @@ -3652,23 +3619,7 @@ _EOF_ fi [[ -d '/var/www/html' ]] && G_EXEC rmdir --ignore-fail-on-non-empty /var/www/html - # Configure PHP handler - # - Buster: Create missing fastcgi-php-fpm module - (( $G_DISTRO < 6 )) && cat << _EOF_ > /etc/lighttpd/conf-available/15-fastcgi-php-fpm.conf -# -*- depends: fastcgi -*- -# -*- conflicts: fastcgi-php -*- -# /usr/share/doc/lighttpd/fastcgi.txt.gz -# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi - -## Use PHP-FPM service for PHP via FastCGI -fastcgi.server += ( ".php" => - (( - "socket" => "/run/php/php$PHP_VERSION-fpm.sock", - "broken-scriptfilename" => "enable" - )) -) -_EOF_ - # - Disable conflicting fastcgi-php module + # Disable conflicting fastcgi-php module [[ -f '/etc/lighttpd/conf-enabled/15-fastcgi-php.conf' ]] && G_EXEC lighty-disable-mod fastcgi-php [[ -f '/etc/lighttpd/conf-enabled/15-fastcgi-php-fpm.conf' ]] || G_EXEC lighty-enable-mod fastcgi-php-fpm @@ -4417,14 +4368,7 @@ _EOF_ # Correct config.php data directory entry, in case it changed due to server migration: G_CONFIG_INJECT "'datadirectory'" "'datadirectory' => '$datadir'," /var/www/owncloud/config/config.php "'dbtype'" else - # ownCloud 10.12 drops PHP 7.3 support: https://github.com/owncloud/core/pull/40394 - if (( $G_DISTRO < 6 )) - then - G_DIETPI-NOTIFY 2 'Downloading latest ownCloud 10.11, since ownCloud 10.12 does not support PHP7.3 anymore' - Download_Install 'https://download.owncloud.com/server/stable/owncloud-10.11.0.tar.bz2' /var/www - else - Download_Install 'https://download.owncloud.com/server/stable/owncloud-latest.tar.bz2' /var/www - fi + Download_Install 'https://download.owncloud.com/server/stable/owncloud-latest.tar.bz2' /var/www fi fi @@ -4468,12 +4412,7 @@ Redirect 301 /.well-known/caldav /owncloud/remote.php/dav' > /etc/apache2/conf- # Enable required modules G_CONFIG_INJECT '"mod_access",' ' "mod_access",' /etc/lighttpd/lighttpd.conf '"mod_.+",' - if (( $G_DISTRO < 6 )) - then - G_CONFIG_INJECT '"mod_setenv"' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",' - else - [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv - fi + [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv # Move ownCloud configuration file in place and activate it owncloud_conf='/etc/lighttpd/conf-available/99-dietpi-owncloud.conf' @@ -4659,15 +4598,9 @@ The install script will now exit. After applying one of the the above, rerun die # Correct config.php data directory entry, in case it changed due to server migration: G_CONFIG_INJECT "'datadirectory'" "'datadirectory' => '$datadir'," /var/www/nextcloud/config/config.php "'dbtype'" else - local version='latest' - # Nextcloud 24 doesn't support PHP7.3 anymore: https://github.com/nextcloud/server/pull/29286 - if (( $G_DISTRO < 6 )) - then - G_DIETPI-NOTIFY 2 'Downloading latest Nextcloud 23, since Nextcloud 24 does not support PHP7.3 anymore' - version='latest-23' - # Nextcloud 26 doesn't support PHP7.4 anymore: https://github.com/nextcloud/server/pull/34997 - elif (( $G_DISTRO < 7 )) + local version='latest' + if (( $G_DISTRO < 7 )) then G_DIETPI-NOTIFY 2 'Downloading latest Nextcloud 25, since Nextcloud 26 does not support PHP7.4 anymore' version='latest-25' @@ -4733,12 +4666,7 @@ Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav' > /etc/apache2/conf # Enable required modules G_CONFIG_INJECT '"mod_access",' ' "mod_access",' /etc/lighttpd/lighttpd.conf '"mod_.+",' - if (( $G_DISTRO < 6 )) - then - G_CONFIG_INJECT '"mod_setenv"' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",' - else - [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv - fi + [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv # Move Nextcloud configuration file in place and activate it nextcloud_conf='/etc/lighttpd/conf-available/99-dietpi-nextcloud.conf' @@ -5115,31 +5043,15 @@ _EOF_ if To_Install 119 # CAVA then - # Debian ships packages from Bullseye on - if (( $G_DISTRO > 5 )) - then - G_AGI cava - # CAVA conf, preserve existing - if [[ ! -f '/root/.config/cava/config' ]] - then - G_EXEC mkdir -p /root/.config/cava - G_EXEC cp /usr/share/cava/example_files/config /root/.config/cava/ - G_CONFIG_INJECT 'method[[:blank:]]+=' 'method = fifo' /root/.config/cava/config '\[input\]' - G_CONFIG_INJECT 'foreground[[:blank:]]+=' 'foreground = cyan' /root/.config/cava/config '\[color\]' - fi - else - case $G_HW_ARCH in - 1) local arch='armv6';; - 2) local arch='armv7';; - 3) local arch='arm64';; - *) local arch='amd64';; - esac + G_AGI cava - aDEPS=('libfftw3-double3' 'libncursesw5') - Download_Install "https://dietpi.com/downloads/binaries/all/cava_0.6.1-1_$arch.deb" - - # CAVA conf, preserve existing - [[ -f '/root/.config/cava/config' ]] || dps_index=$software_id Download_Install 'cava.conf' /root/.config/cava/config + # Config: Preserve existing + if [[ ! -f '/root/.config/cava/config' ]] + then + G_EXEC mkdir -p /root/.config/cava + G_EXEC cp /usr/share/cava/example_files/config /root/.config/cava/ + G_CONFIG_INJECT 'method[[:blank:]]+=' 'method = fifo' /root/.config/cava/config '\[input\]' + G_CONFIG_INJECT 'foreground[[:blank:]]+=' 'foreground = cyan' /root/.config/cava/config '\[color\]' fi # FIFO stream for MPD @@ -5230,38 +5142,22 @@ _EOF_ # Purge DietPi Bullseye build with higher epoch version [[ $G_DISTRO == 6 && $(dpkg-query -Wf '${Version}' kodi 2> /dev/null) == '3:19.1-dietpi'[1-3] ]] && G_EXEC_OUTPUT=1 G_EXEC dpkg -P kodi - # Bullseye, RPi 4 and 64-bit userland: Use KMS driver: https://www.raspberrypi.com/forums/viewtopic.php?t=251645 - if [[ $G_DISTRO -ge 6 || $G_HW_MODEL == 4 || $(dpkg --print-architecture) == 'arm64' ]] - then - # Enhance 4k support on RPi 4 - local cma=() - (( $G_HW_MODEL == 4 )) && cma=(512) - /boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-kms-v3d "${cma[@]}" - (( $G_DISTRO < 6 )) || aDEPS+=('libgl1-mesa-dri') # Missing dependency on Bullseye package + # Enhance 4k support on RPi 4 and above + local cma=() + (( $G_HW_MODEL > 3 )) && cma=(512) + /boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-kms-v3d "${cma[@]}" - # Else legacy framebuffer driver - else - /boot/dietpi/func/dietpi-set_hardware rpi-opengl disable - fi + # Missing dependency + aDEPS+=('libgl1-mesa-dri') - # 64-bit Buster: Debian repo: https://github.com/MichaIng/DietPi/issues/4194 - if [[ $G_DISTRO -le 5 && $(dpkg --print-architecture) == 'arm64' ]] - then - echo -e 'Package: kodi*\nPin: origin archive.raspberrypi.com\nPin-Priority: -1' > /etc/apt/preferences.d/dietpi-kodi - aDEPS+=('kodi-repository-kodi') + # Buster => Bullseye upgrade: Remove obsolete APT pin + [[ -f '/etc/apt/preferences.d/dietpi-kodi' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-kodi - # Else: RPi repo - else - [[ -f '/etc/apt/preferences.d/dietpi-kodi' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-kodi - - # 32-bit Buster and Bookworm: Apply missing dir workaround: https://github.com/RPi-Distro/repo/issues/153, https://github.com/MichaIng/DietPi/issues/6703 - [[ $G_DISTRO == 5 && $(dpkg --print-architecture) == 'armhf' || $G_DISTRO == [78] ]] && G_EXEC mkdir -p /etc/polkit-1/localauthority/50-local.d + # Bookworm: Apply missing dir workaround: https://github.com/RPi-Distro/repo/issues/153, https://github.com/MichaIng/DietPi/issues/6703 + [[ $G_DISTRO == [78] ]] && G_EXEC mkdir -p /etc/polkit-1/localauthority/50-local.d - # Buster: fbset required to recover desktop with custom resolution and fix startup warning - # Bullseye: Enable hardware codecs - # shellcheck disable=SC2015 - (( $G_DISTRO < 6 )) && aDEPS+=('fbset') || /boot/dietpi/func/dietpi-set_hardware rpi-codec 1 - fi + # Enable hardware codecs + /boot/dietpi/func/dietpi-set_hardware rpi-codec 1 # Everything else else @@ -5269,9 +5165,6 @@ _EOF_ (( $G_HW_ARCH == 10 || $G_DISTRO > 6 )) || aDEPS+=('libgles2') # Missing ARM dependency until Bookworm fi - # Buster: Missing dependencies for CEC + NFS support - (( $G_DISTRO == 5 )) && aDEPS+=('libcec4' 'libnfs12') - # Desktop entry G_EXEC mkdir -p /var/lib/dietpi/dietpi-software/installed/desktop/icons /usr/share/applications G_THREAD_START curl -sSfLo /var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/desktop/icons/kodi-icon.png" @@ -5312,8 +5205,8 @@ ExecStart=$(command -v minidlnad) -S -R -f /etc/minidlna.conf -P /dev/null [Install] WantedBy=multi-user.target _EOF_ - # Bullseye: Debian patched forced file logging inside, overriding "-S": https://github.com/MichaIng/DietPi/issues/4745 - (( $G_DISTRO < 6 )) || G_CONFIG_INJECT 'LogsDirectory=' 'LogsDirectory=minidlna' /etc/systemd/system/minidlna.service 'User=' + # Debian patched forced file logging inside, overriding "-S": https://github.com/MichaIng/DietPi/issues/4745 + G_CONFIG_INJECT 'LogsDirectory=' 'LogsDirectory=minidlna' /etc/systemd/system/minidlna.service 'User=' # Config G_BACKUP_FP /etc/minidlna.conf @@ -5490,7 +5383,6 @@ _EOF_ # Install RaspiMJPEG # - Binary - (( $G_DISTRO == 5 )) && G_EXEC mv bin/raspimjpeg{-buster,} G_EXEC cp {,/usr/local/}bin/raspimjpeg G_EXEC chmod +x /usr/local/bin/raspimjpeg # - Config @@ -5605,9 +5497,6 @@ ExecStart=/usr/bin/deluged -d WantedBy=multi-user.target _EOF_ # https://github.com/deluge-torrent/deluge/blob/develop/packaging/systemd/deluge-web.service - # - Bullseye: deluge-web v2 requires the "-d" flag to stay in foreground, but v1 does not understand it yet - local flag= - (( $G_DISTRO < 6 )) || flag=' -d' cat << _EOF_ > /etc/systemd/system/deluge-web.service [Unit] Description=Deluge Web UI (DietPi) @@ -5618,7 +5507,7 @@ After=network-online.target deluged.service [Service] User=debian-deluged UMask=027 -ExecStart=/usr/bin/deluge-web$flag +ExecStart=/usr/bin/deluge-web -d [Install] WantedBy=multi-user.target @@ -6119,13 +6008,7 @@ _EOF_ if (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )) then # Enable required modules - if (( $G_DISTRO < 6 )) - then - G_CONFIG_INJECT '"mod_setenv"' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",' - else - G_EXEC_POST_FUNC(){ [[ $exit_code == 2 ]] && exit_code=0; } # Do not fail if modules are enabled already - G_EXEC lighty-enable-mod setenv - fi + [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv # Add and enable Pi-hole config dps_index=$software_id Download_Install 'lighttpd.pihole.conf' /etc/lighttpd/conf-available/99-dietpi-pihole.conf @@ -6848,11 +6731,11 @@ _EOF_ # Password file if [[ ! -f '/etc/mosquitto/passwd' ]] then - G_EXEC umask 0037 - > /etc/mosquitto/passwd # Pre-create file, required for pre-v1.6.10 (ARMv8 up to Buster): https://github.com/MichaIng/DietPi/issues/4424 + G_EXEC umask 0037 # relevant for passwd mode until v2.0.18 G_EXEC_PRE_FUNC(){ acommand[4]=$GLOBAL_PW; } - G_EXEC mosquitto_passwd -b /etc/mosquitto/passwd mosquitto "${GLOBAL_PW//?/X}" + G_EXEC mosquitto_passwd -c -b /etc/mosquitto/passwd mosquitto "${GLOBAL_PW//?/X}" G_EXEC chown root:mosquitto /etc/mosquitto/passwd + G_EXEC chmod 0640 /etc/mosquitto/passwd # from v2.0.18 on, 0600 is the default mode, hence the "mosquitto" user has no read access G_EXEC umask 0022 fi @@ -7246,12 +7129,8 @@ _EOF_ if To_Install 28 # TigerVNC Server then - # netbase is required until Bullseye to solve: "Use of uninitialized value $proto in socket at /usr/bin/tigervncserver" - # - It is a recommendation and no dependency of perl, but expected by some packages depending on perl only: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939055 - # tigervnc-common is required as it is a recommendation only until Bullseye. # tigervnc-tools ships tigervncpasswd as dedicated package since Bookworm. local apackages=() - (( $G_DISTRO > 5 )) || apackages=('tigervnc-common' 'netbase') (( $G_DISTRO > 6 )) && apackages=('tigervnc-tools') G_AGI tigervnc-standalone-server tigervnc-scraping-server "${apackages[@]}" fi @@ -7365,9 +7244,7 @@ _EOF_ # TigerVNC: Permit remote connections which implies TLSVnc authentications being enabled additionally # shellcheck disable=SC2016 - [[ -f '/etc/vnc.conf' ]] && GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/vnc.conf # Buster - # shellcheck disable=SC2016 - [[ -f '/etc/tigervnc/vncserver-config-defaults' ]] && GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/tigervnc/vncserver-config-defaults # Bullseye + GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/tigervnc/vncserver-config-defaults # Bullseye # TigerVNC: Set control + read-only passwords if [[ ${aSOFTWARE_INSTALL_STATE[28]} == 1 && ! -f '/root/.vnc/passwd' ]] @@ -7567,7 +7444,7 @@ _EOF_ if To_Install 179 komga # Komga then - if (( $G_HW_ARCH == 1 || $G_DISTRO < 6 )) + if (( $G_HW_ARCH == 1 )) 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 @@ -7666,33 +7543,21 @@ _EOF_ local json=() [[ $PHP_VERSION == 8* ]] || aDEPS+=("php$PHP_VERSION-json") json=('json') - # Bullseye and above - if (( $G_DISTRO > 5 )) - then - local fallback_url="https://github.com/ampache/ampache/releases/download/6.2.0/ampache-6.2.0_all_php$PHP_VERSION.zip" - Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/ampache-[0-9\.]*_all_php$PHP_VERSION.zip\"$/{print \$4}")" ampache - # 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' - - # Buster: Ampache v5 requires PHP7.4, hence pull latest Ampache v4: https://github.com/ampache/ampache/wiki/Ampache-Next-Changes - else - Download_Install 'https://github.com/ampache/ampache/releases/download/4.4.3/ampache-4.4.3_all.zip' ampache - # Ampache is installed to /var/www/ampache. - local fp_install='/var/www' fp_public='ampache' - fi + local fallback_url="https://github.com/ampache/ampache/releases/download/6.2.0/ampache-6.2.0_all_php$PHP_VERSION.zip" + Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/ampache-[0-9\.]*_all_php$PHP_VERSION.zip\"$/{print \$4}")" ampache # Reinstall: Preserve configs from old and new paths [[ -f '/var/www/ampache/config/ampache.cfg.php' ]] && G_EXEC mv /var/www/ampache/config/ampache.cfg.php ampache/config/ [[ -f '/var/www/ampache/config/registration_agreement.php' ]] && G_EXEC mv /var/www/ampache/config/registration_agreement.php ampache/config/ [[ -f '/mnt/dietpi_userdata/ampache/config/ampache.cfg.php' ]] && G_EXEC mv /mnt/dietpi_userdata/ampache/config/ampache.cfg.php ampache/config/ [[ -f '/mnt/dietpi_userdata/ampache/config/registration_agreement.php' ]] && G_EXEC mv /mnt/dietpi_userdata/ampache/config/registration_agreement.php ampache/config/ - [[ -f '/var/www/ampache/channel/.htaccess' ]] && G_EXEC mv /var/www/ampache/channel/.htaccess "$fp_public/channel/" - [[ -f '/var/www/ampache/rest/.htaccess' ]] && G_EXEC mv /var/www/ampache/rest/.htaccess "$fp_public/rest/" - [[ -f '/var/www/ampache/play/.htaccess' ]] && G_EXEC mv /var/www/ampache/play/.htaccess "$fp_public/play/" + [[ -f '/var/www/ampache/channel/.htaccess' ]] && G_EXEC mv /var/www/ampache/channel/.htaccess ampache/public/channel/ + [[ -f '/var/www/ampache/rest/.htaccess' ]] && G_EXEC mv /var/www/ampache/rest/.htaccess ampache/public/rest/ + [[ -f '/var/www/ampache/play/.htaccess' ]] && G_EXEC mv /var/www/ampache/play/.htaccess ampache/public/play/ [[ -d '/var/www/ampache' || -L '/var/www/ampache' ]] && G_EXEC rm -R /var/www/ampache [[ -d '/mnt/dietpi_userdata/ampache' ]] && G_EXEC rm -R /mnt/dietpi_userdata/ampache - G_EXEC mv {,"$fp_install/"}ampache + G_EXEC mv {,/mnt/dietpi_userdata/}ampache [[ -d '/mnt/dietpi_userdata/ampache/public' ]] && G_EXEC ln -s /mnt/dietpi_userdata/ampache/public /var/www/ampache Download_Test_Media @@ -7704,73 +7569,56 @@ _EOF_ local password=$(tr -dc '[:alnum:]' < /dev/random | head -c30) # Fresh install: Create new config - if [[ ! -f $fp_install/ampache/config/ampache.cfg.php ]] - then - G_EXEC cp "$fp_install/ampache/config/ampache.cfg.php"{.dist,} - G_CONFIG_INJECT 'web_path[[:blank:]]+=' 'web_path = "/ampache"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'database_hostname[[:blank:]]+=' 'database_hostname = /run/mysqld/mysqld.sock' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'database_name[[:blank:]]+=' 'database_name = ampache' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'database_username[[:blank:]]+=' 'database_username = ampache' "$fp_install/ampache/config/ampache.cfg.php" - GCI_PASSWORD=1 G_CONFIG_INJECT 'database_password[[:blank:]]+=' "database_password = \"$password\"" "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'tmp_dir_path[[:blank:]]+=' 'tmp_dir_path = "/tmp"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'transcode_cmd[[:blank:]]+=' 'transcode_cmd = "ffmpeg"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'transcode_m4a[[:blank:]]+=' 'transcode_m4a = "required"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'transcode_flac[[:blank:]]+=' 'transcode_flac = "required"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'transcode_mpc[[:blank:]]+=' 'transcode_mpc = "required"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'transcode_ogg[[:blank:]]+=' 'transcode_ogg = "allowed"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'transcode_wav[[:blank:]]+=' 'transcode_wav = "required"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'transcode_avi[[:blank:]]+=' 'transcode_avi = "allowed"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'transcode_mkv[[:blank:]]+=' 'transcode_mkv = "allowed"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'transcode_mpg[[:blank:]]+=' 'transcode_mpg = "allowed"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'encode_target[[:blank:]]+=' 'encode_target = mp3' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'encode_video_target[[:blank:]]+=' 'encode_video_target = webm' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'generate_video_preview[[:blank:]]+=' 'generate_video_preview = "true"' "$fp_install/ampache/config/ampache.cfg.php" - G_CONFIG_INJECT 'waveform[[:blank:]]+=' 'waveform = "true"' "$fp_install/ampache/config/ampache.cfg.php" + if [[ ! -f '/mnt/dietpi_userdata/ampache/config/ampache.cfg.php' ]] + then + G_EXEC cp /mnt/dietpi_userdata/ampache/config/ampache.cfg.php{.dist,} + G_CONFIG_INJECT 'web_path[[:blank:]]+=' 'web_path = "/ampache"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'database_hostname[[:blank:]]+=' 'database_hostname = /run/mysqld/mysqld.sock' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'database_name[[:blank:]]+=' 'database_name = ampache' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'database_username[[:blank:]]+=' 'database_username = ampache' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + GCI_PASSWORD=1 G_CONFIG_INJECT 'database_password[[:blank:]]+=' "database_password = \"$password\"" /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'tmp_dir_path[[:blank:]]+=' 'tmp_dir_path = "/tmp"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'transcode_cmd[[:blank:]]+=' 'transcode_cmd = "ffmpeg"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'transcode_m4a[[:blank:]]+=' 'transcode_m4a = "required"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'transcode_flac[[:blank:]]+=' 'transcode_flac = "required"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'transcode_mpc[[:blank:]]+=' 'transcode_mpc = "required"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'transcode_ogg[[:blank:]]+=' 'transcode_ogg = "allowed"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'transcode_wav[[:blank:]]+=' 'transcode_wav = "required"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'transcode_avi[[:blank:]]+=' 'transcode_avi = "allowed"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'transcode_mkv[[:blank:]]+=' 'transcode_mkv = "allowed"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'transcode_mpg[[:blank:]]+=' 'transcode_mpg = "allowed"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'encode_target[[:blank:]]+=' 'encode_target = mp3' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'encode_video_target[[:blank:]]+=' 'encode_video_target = webm' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'generate_video_preview[[:blank:]]+=' 'generate_video_preview = "true"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php + G_CONFIG_INJECT 'waveform[[:blank:]]+=' 'waveform = "true"' /mnt/dietpi_userdata/ampache/config/ampache.cfg.php # Update password as well in rare but possible case that config file still exists but database was lost elif [[ ! -d '/mnt/dietpi_userdata/mysql/ampache' ]] then - GCI_PASSWORD=1 G_CONFIG_INJECT 'database_password[[:blank:]]+=' "database_password = \"$password\"" "$fp_install/ampache/config/ampache.cfg.php" + GCI_PASSWORD=1 G_CONFIG_INJECT 'database_password[[:blank:]]+=' "database_password = \"$password\"" /mnt/dietpi_userdata/ampache/config/ampache.cfg.php fi # Permissions: Permit config file updates via web UI - G_EXEC chown www-data "$fp_install/ampache/config/ampache.cfg.php"{.dist,} + G_EXEC chown www-data /mnt/dietpi_userdata/ampache/config/ampache.cfg.php{.dist,} # Fresh install: Generate database G_EXEC systemctl start mariadb if [[ ! -d '/mnt/dietpi_userdata/mysql/ampache' ]] then /boot/dietpi/func/create_mysql_db ampache ampache "$password" - if (( $G_DISTRO > 5 )) - then - # Import template - G_EXEC mysql ampache < /mnt/dietpi_userdata/ampache/resources/sql/ampache.sql - # Generate admin user: Replace password string internally to avoid printing it to console - G_EXEC_PRE_FUNC(){ acommand[6]=$GLOBAL_PW; } - G_EXEC php /mnt/dietpi_userdata/ampache/bin/cli admin:addUser -l 100 -p "${GLOBAL_PW//?/X}" dietpi - # Generate local music catalogue - G_EXEC_OUTPUT=1 G_EXEC php /mnt/dietpi_userdata/ampache/bin/cli run:addCatalog Music /mnt/dietpi_userdata/Music music - # Scan for music files - G_EXEC_OUTPUT=1 G_EXEC php /mnt/dietpi_userdata/ampache/bin/cli run:updateCatalog - else - # Import template - G_EXEC mysql ampache < /var/www/ampache/sql/ampache.sql - # Generate admin user: Replace password string internally to avoid printing it to console - G_EXEC_PRE_FUNC(){ acommand[7]=$GLOBAL_PW; } - G_EXEC php /var/www/ampache/bin/install/add_user.inc -u dietpi -l 100 -p "${GLOBAL_PW//?/X}" - # Generate local music catalogue - # shellcheck disable=SC2016 - G_EXEC_OUTPUT=1 G_EXEC mysql -e 'use ampache; insert into `catalog` values (1,'\''Music'\'','\''local'\'',0,null,0,1,'\''%T - %t'\'','\''%a/%A'\'','\''music'\''); insert into `catalog_local` values (1,'\''/mnt/dietpi_userdata/Music'\'',1)' - # Scan for music files - G_EXEC_OUTPUT=1 G_EXEC php /var/www/ampache/bin/catalog_update.inc - fi + # Import template + G_EXEC mysql ampache < /mnt/dietpi_userdata/ampache/resources/sql/ampache.sql + # Generate admin user: Replace password string internally to avoid printing it to console + G_EXEC_PRE_FUNC(){ acommand[6]=$GLOBAL_PW; } + G_EXEC php /mnt/dietpi_userdata/ampache/bin/cli admin:addUser -l 100 -p "${GLOBAL_PW//?/X}" dietpi + # Generate local music catalogue + G_EXEC_OUTPUT=1 G_EXEC php /mnt/dietpi_userdata/ampache/bin/cli run:addCatalog Music /mnt/dietpi_userdata/Music music + # Scan for music files + G_EXEC_OUTPUT=1 G_EXEC php /mnt/dietpi_userdata/ampache/bin/cli run:updateCatalog # Reinstall: Update database - elif (( $G_DISTRO > 5 )) - then - G_EXEC_OUTPUT=1 G_EXEC php /mnt/dietpi_userdata/ampache/bin/cli admin:updateDatabase else - G_EXEC_OUTPUT=1 G_EXEC php /var/www/ampache/bin/install/update_db.inc + G_EXEC_OUTPUT=1 G_EXEC php /mnt/dietpi_userdata/ampache/bin/cli admin:updateDatabase fi unset -v password fi @@ -8241,12 +8089,7 @@ _EOF_ then # Enable Lighttpd setenv, access and rewrite modules G_CONFIG_INJECT '"mod_access",' ' "mod_access",' /etc/lighttpd/lighttpd.conf '"mod_.+",' - if (( $G_DISTRO < 6 )) - then - G_CONFIG_INJECT '"mod_setenv"' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",' - else - [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv - fi + [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv # Move Pydio Lighttpd config in place dps_index=$software_id Download_Install 'lighttpd.pydio.conf' /etc/lighttpd/conf-available/99-dietpi-pydio.conf @@ -8528,10 +8371,7 @@ _EOF_ G_CHECK_URL "$url" # APT deps - # - Buster: Python 3 is not pulled by rdiff-backup on Buster, but required to compile Node.js posix. - local python=() - (( $G_DISTRO > 5 )) || python=('python3') - G_AGI rdiff-backup rsync screen make g++ "${python[@]}" + G_AGI rdiff-backup rsync screen make g++ # Download/Update MineOS G_EXEC mkdir -p /mnt/dietpi_userdata/mineos @@ -8722,7 +8562,7 @@ WebUI\Enabled=true WebUI\HTTPS\Enabled=false WebUI\HostHeaderValidation=false WebUI\LocalHostAuth=true -WebUI\Password_ha1=@ByteArray($(echo -n "$GLOBAL_PW" | md5sum | mawk '{print $1}')) +WebUI\Password_PBKDF2="@ByteArray(tpgNK76AcpP14rjOZP9vwg==:rQNtOB0P4HfNj20pJtxiTBi9miduS6L1Xqqazc4Y6Gpm3Rn02jMXnPPT3KH2JMDKhFQjAaTGVJz0dz5JVw2QUQ==)" WebUI\Port=1340 WebUI\SecureCookie=true WebUI\UseUPnP=true @@ -8730,9 +8570,6 @@ WebUI\Username=qbittorrent _EOF_ fi - # Since v4.2.0, PBKDF2 needs to be used: https://github.com/MichaIng/DietPi/issues/4711 - (( $G_DISTRO < 6 )) || G_EXEC sed --follow-symlinks -i '/^WebUI\\Password_ha1/c\WebUI\\Password_PBKDF2="@ByteArray(tpgNK76AcpP14rjOZP9vwg==:rQNtOB0P4HfNj20pJtxiTBi9miduS6L1Xqqazc4Y6Gpm3Rn02jMXnPPT3KH2JMDKhFQjAaTGVJz0dz5JVw2QUQ==)"' /home/qbittorrent/.config/qBittorrent/qBittorrent.conf - # Service cat << _EOF_ > /etc/systemd/system/qbittorrent.service [Unit] @@ -9234,10 +9071,7 @@ _EOF_ local flags="export CHROMIUM_FLAGS=\"\$CHROMIUM_FLAGS --no-sandbox --test-type --disable-smooth-scrolling --disable-low-res-tiling --enable-low-end-device-mode --num-raster-threads=$G_HW_CPU_CORES --disable-composited-antialiasing" # - x86_64: OpenGL, else GLES (( $G_HW_ARCH == 10 )) && flags+='"' || flags+=' --use-gl=egl"' - # - RPi Buster: Uses /etc/chromium-browser/customizations, else /etc/chromium.d: https://github.com/RPi-Distro/chromium-browser/commit/f4a599d - local path='chromium.d' - (( $G_DISTRO > 5 || $G_HW_MODEL > 9 )) || path='chromium-browser/customizations' - echo "$flags" > "/etc/$path/dietpi" + echo "$flags" > /etc/chromium.d/dietpi # Autostart script for kiosk mode, based on @AYapejian: https://github.com/MichaIng/DietPi/issues/1737#issue-318697621 G_EXEC mkdir -p /var/lib/dietpi/dietpi-software/installed @@ -9269,7 +9103,6 @@ STARTX='xinit' exec "$STARTX" "$FP_CHROMIUM" $CHROMIUM_OPTS "${URL:-https://dietpi.com/}" _EOF_ - [[ $path == 'chromium.d' ]] || G_EXEC sed --follow-symlinks -i 's|chromium\.d|chromium-browser/customizations|' /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh G_EXEC chmod +x /var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh fi @@ -9431,14 +9264,7 @@ _EOF_ aDEPS+=('g++') fi - # Download: SABnzbd v4 does not support Python 3.7 (Buster) anymore: https://github.com/sabnzbd/sabnzbd/issues/2545 - if (( $G_DISTRO < 6 )) - then - Download_Install 'https://github.com/sabnzbd/sabnzbd/archive/3.7.2.tar.gz' - G_EXEC mv sabnzbd-3.7.2 sabnzbd-master - else - Download_Install 'https://github.com/sabnzbd/sabnzbd/archive/master.tar.gz' - fi + Download_Install 'https://github.com/sabnzbd/sabnzbd/archive/master.tar.gz' # Reinstall: Remove old install dir if [[ -d '/etc/sabnzbd' ]] @@ -11273,11 +11099,11 @@ _EOF_ G_EXEC eval "curl -sSfL '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-moonlight.gpg --yes" # APT list - G_EXEC eval "echo 'deb https://dl.cloudsmith.io/public/moonlight-game-streaming/moonlight-embedded/deb/raspbian/ $G_DISTRO_NAME main' > /etc/apt/sources.list.d/dietpi-moonlight.list" + G_EXEC eval "echo 'deb https://dl.cloudsmith.io/public/moonlight-game-streaming/moonlight-embedded/deb/raspbian/ ${G_DISTRO_NAME/trixie/bookworm} main' > /etc/apt/sources.list.d/dietpi-moonlight.list" G_AGUP # APT deps - (( $G_DISTRO < 6 )) && aDEPS=('libcec4') || aDEPS=('libcec6') + aDEPS=('libcec6') # Install the client G_AGI moonlight-embedded "${aDEPS[@]}" @@ -11295,7 +11121,7 @@ _EOF_ G_EXEC eval "curl -sSfL '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-moonlight-qt.gpg --yes" # APT list - G_EXEC eval "echo 'deb https://dl.cloudsmith.io/public/moonlight-game-streaming/moonlight-qt/deb/raspbian/ $G_DISTRO_NAME main' > /etc/apt/sources.list.d/dietpi-moonlight-qt.list" + G_EXEC eval "echo 'deb https://dl.cloudsmith.io/public/moonlight-game-streaming/moonlight-qt/deb/raspbian/ ${G_DISTRO_NAME/trixie/bookworm} main' > /etc/apt/sources.list.d/dietpi-moonlight-qt.list" G_AGUP # Install: libgl1 required, else start from console prints "SDL Error: Can't load EGL/GL library on window creation.", the GUI says it cannot find a video decoder and streaming does not start. @@ -11313,8 +11139,7 @@ _EOF_ if To_Install 27 # TasmoAdmin then # Install required PHP modules: https://github.com/TasmoAdmin/TasmoAdmin/wiki/Guide-for-Debian-Server-10-(Buster) - aDEPS=("php$PHP_VERSION-curl" "php$PHP_VERSION-zip") - (( $G_DISTRO > 5 )) && aDEPS+=("php$PHP_VERSION-mbstring" "php$PHP_VERSION-xml") + aDEPS=("php$PHP_VERSION-curl" "php$PHP_VERSION-zip" "php$PHP_VERSION-mbstring" "php$PHP_VERSION-xml") local adeps=("${aDEPS[@]#*-}") # Reinstall: Skip download and install, advice to use internal updater from web UI @@ -11332,13 +11157,8 @@ _EOF_ then local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.3.2/tasmoadmin_v3.3.2.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 - elif (( $G_DISTRO > 5 )) - then - Download_Install 'https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v2.4.2/tasmoadmin_v2.4.2.tar.gz' else - Download_Install 'https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v1.8.0/tasmoadmin_v1.8.0.tar.gz' + Download_Install 'https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v2.4.2/tasmoadmin_v2.4.2.tar.gz' fi G_EXEC chown -R www-data:www-data tasmoadmin G_EXEC mv tasmoadmin /var/www/ @@ -11404,9 +11224,8 @@ _EOF_ G_EXEC eval "echo 'deb$arch https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main' > /etc/apt/sources.list.d/dietpi-openhab.list" G_AGUP - # Buster: Limit to v3, as v4 requires Java 17 - (( $G_DISTRO < 6 )) && G_EXEC eval 'echo -e '\''Package: openhab*\nPin: version 3.*\nPin-Priority: 501'\'' > /etc/apt/preferences.d/dietpi-openhab' - [[ $G_DISTRO -ge 6 && -f '/etc/apt/preferences.d/dietpi-openhab' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-openhab + # Buster => Bullseye upgrade: Remove obsolete APT pin + [[ -f '/etc/apt/preferences.d/dietpi-openhab' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-openhab # APT package G_AGI openhab @@ -11711,13 +11530,13 @@ _EOF_ else G_AGI snapserver - # Enable web UI to align with upstream package (On Debian Buster repo package this file does not yet exist.) - [[ -f '/etc/snapserver.conf' ]] && G_CONFIG_INJECT 'doc_root[[:blank:]=]' 'doc_root = /usr/share/snapserver/snapweb' /etc/snapserver.conf '\[http\]' + # Enable web UI to align with upstream package + G_CONFIG_INJECT 'doc_root[[:blank:]=]' 'doc_root = /usr/share/snapserver/snapweb' /etc/snapserver.conf '\[http\]' fi G_EXEC systemctl stop snapserver # Disable JSON RPC by default if setting was never touched yet - [[ -f '/etc/snapserver.conf' ]] && G_EXEC sed --follow-symlinks -i '/^\[tcp\]/,/^\[/s/^#enabled = true$/enabled = false/' /etc/snapserver.conf + G_EXEC sed --follow-symlinks -i '/^\[tcp\]/,/^\[/s/^#enabled = true$/enabled = false/' /etc/snapserver.conf fi if To_Install 192 snapclient # Snapcast Client @@ -11827,12 +11646,7 @@ _EOF_ # - Lighttpd if (( ${aSOFTWARE_INSTALL_STATE[84]} > 0 )) then - if (( $G_DISTRO < 6 )) - then - G_CONFIG_INJECT '"mod_setenv"' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",' - else - [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv - fi + [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv cat << '_EOF_' > /etc/lighttpd/conf-available/98-dietpi-mediawiki.conf $HTTP["url"] =~ "^/wiki/images($|/)" { setenv.set-response-header = ("X-Content-Type-Options" => "nosniff") @@ -11962,15 +11776,13 @@ _EOF_ case $G_HW_ARCH in 1) arch='-armv6' variant='slim' # Only supported variant for ARMv6 - (( $G_DISTRO > 5 )) || version='0.3.4' # v0.3.5 depends on glibc >=2.29 while Buster ships 2.28 ;; 2) arch='-armhf' variant='full' - (( $G_DISTRO > 5 )) && aDEPS=('libdbus-1-3') || version='0.3.4' # v0.3.5 depends on libdbus and glibc >=2.29 while Buster ships 2.28 ;; *) - aDEPS=('libdbus-1-3' 'libpulse0') variant='full' version='0.3.3' # v0.3.4 depends on libc6 >=2.32 while Bullseye ships 2.31 - (( $G_DISTRO > 5 )) || version='0.3.2' # v0.3.3 depends on libc6 >=2.29 while Buster ships 2.28 + aDEPS=('libdbus-1-3' 'libpulse0') variant='full' + (( $G_DISTRO > 6 )) || version='0.3.3' # v0.3.4 depends on libc6 >=2.32 while Bullseye ships 2.31 ;; esac @@ -12082,19 +11894,6 @@ _EOF_ if To_Install 172 # WireGuard then - # Packages available on Buster backports and Bullseye: On Raspbian Buster add Bullseye repo - if (( ${G_RASPBIAN:-0} && $G_DISTRO == 5 )) - then - G_EXEC eval "echo 'deb http://raspbian.raspberrypi.com/raspbian/ bullseye main' > /etc/apt/sources.list.d/dietpi-wireguard.list" - - # Disable repo via priority "-1", to prevent any accidental package upgrades: https://github.com/MichaIng/DietPi/issues/2568 - # Enable but set WireGuard package priorities low enough to install only if not available in main repo(s) - echo -e 'Package: *\nPin: release n=bullseye\nPin-Priority: -1\n -Package: wireguard-tools\nPin: release n=bullseye\nPin-Priority: 100' > /etc/apt/preferences.d/dietpi-wireguard - - G_AGUP - fi - # Pre-v8.12: Purge DKMS as it is not required and might mess with available kernel module dpkg-query -s wireguard-dkms &> /dev/null && G_AGP wireguard-dkms @@ -12306,39 +12105,24 @@ If no WireGuard (auto)start is included, but you require it, please do the follo Install_Apply_GPU_Settings() { # Offer to install GPU driver when Xserver installed (x86_64 support currently only) - if (( $G_HW_ARCH == 10 && $G_HW_MODEL == 21 && - ${aSOFTWARE_INSTALL_STATE[6]} == 1 )) + if (( $G_HW_ARCH == 10 && $G_HW_MODEL == 21 && ${aSOFTWARE_INSTALL_STATE[6]} == 1 )) then local gpu_current=$(sed -n '/^[[:blank:]]*CONFIG_GPU_DRIVER=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - if [[ ${gpu_current,,} == 'none' ]] - then - G_WHIP_YESNO 'No GPU Driver is currently installed.\n\nWould you like to select a GPU driver for installation now?' && /boot/dietpi/dietpi-config 2 - fi + [[ ${gpu_current,,} == 'none' ]] && G_WHIP_YESNO 'No GPU Driver is currently installed.\n\nWould you like to select a GPU driver for installation now?' && /boot/dietpi/dietpi-config 2 fi - # RPi: Recommend memory split based on installed software - local suggest_gpu_mem=0 - - # Kodi, Jellyfin - if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 || ${aSOFTWARE_INSTALL_STATE[178]} == 1 )) - then - suggest_gpu_mem=256 - (( ${G_HW_MEMORY_SIZE:-0} > 256 )) || suggest_gpu_mem=128 - - # DXX-Rebirth - elif (( ${aSOFTWARE_INSTALL_STATE[112]} == 1 )) - then - suggest_gpu_mem=128 + # RPi: Disable headless mode and raise memory split to default for GUI applications + (( $G_HW_MODEL < 10 )) || return 0 - # RPi Cam Web Interface, Amiberry, Chromium - elif (( ${aSOFTWARE_INSTALL_STATE[59]} == 1 || + # Kodi, Jellyfin, DXX-Rebirth, RPi Cam Web Interface, Amiberry, Chromium, Desktops, OpenTyrian, Moonlight (CLI), Moonlight (GUI) + local gpu_mem=0 + if (( ${aSOFTWARE_INSTALL_STATE[31]} == 1 || + ${aSOFTWARE_INSTALL_STATE[178]} == 1 || + ${aSOFTWARE_INSTALL_STATE[112]} == 1 || + ${aSOFTWARE_INSTALL_STATE[59]} == 1 || ${aSOFTWARE_INSTALL_STATE[108]} == 1 || - ${aSOFTWARE_INSTALL_STATE[113]} == 1 )) - then - suggest_gpu_mem=96 - - # Desktops, OpenTyrian, Moonlight (CLI), Moonlight (GUI) - elif (( ${aSOFTWARE_INSTALL_STATE[23]} == 1 || + ${aSOFTWARE_INSTALL_STATE[113]} == 1 || + ${aSOFTWARE_INSTALL_STATE[23]} == 1 || ${aSOFTWARE_INSTALL_STATE[24]} == 1 || ${aSOFTWARE_INSTALL_STATE[25]} == 1 || ${aSOFTWARE_INSTALL_STATE[26]} == 1 || @@ -12347,30 +12131,19 @@ If no WireGuard (auto)start is included, but you require it, please do the follo ${aSOFTWARE_INSTALL_STATE[207]} == 1 || ${aSOFTWARE_INSTALL_STATE[208]} == 1 )) then - suggest_gpu_mem=1 # default + gpu_mem=1 fi + (( $gpu_mem )) || return 0 - # RPi Bullseye: No need to raise GPU memory above default with CMA - (( $G_DISTRO > 5 && $suggest_gpu_mem > 1 )) && suggest_gpu_mem=1 - - # Disable headless/enable GPU when GUI software was installed - (( $suggest_gpu_mem )) || return 0 - + # Disable headless mode /boot/dietpi/func/dietpi-set_hardware headless 0 - # RPi: Apply memory split - (( $G_HW_MODEL < 10 )) || return 0 - - # Never override a higher existing value + # Raise memory split to default local default_gpu_mem=76 (( $G_HW_MEMORY_SIZE < 1024 )) && default_gpu_mem=64 local current_gpu_mem=$(sed -n '/^[[:blank:]]*gpu_mem_1024=/{s/^[^=]*=//p;q}' /boot/config.txt) [[ $current_gpu_mem ]] || current_gpu_mem=$default_gpu_mem - (( $suggest_gpu_mem == 1 )) && suggest_gpu_mem=$default_gpu_mem - (( $current_gpu_mem < $suggest_gpu_mem )) && G_WHIP_DEFAULT_ITEM='Ok' G_WHIP_YESNO "[ INFO ] DietPi has detected an increased GPU memory is required for your installed software: - - Current: $current_gpu_mem MiB\n - Recommended: $suggest_gpu_mem MiB\n\nWould you like DietPi to apply the recommended GPU memory split?\n\nIf unsure, select 'Ok'." || return 0 - - /boot/dietpi/func/dietpi-set_hardware gpumemsplit "$suggest_gpu_mem" + (( $current_gpu_mem < $default_gpu_mem )) && /boot/dietpi/func/dietpi-set_hardware gpumemsplit "$default_gpu_mem" } Uninstall_Software() diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 2b67f91f01..f6ae25fea1 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -286,67 +286,36 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # headless #///////////////////////////////////////////////////////////////////////////////////// - Headless_Main(){ - - if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - - # RPi - if (( $G_HW_MODEL < 10 )); then - - # Prevent any framebuffer from being allocated - G_CONFIG_INJECT 'max_framebuffers=' 'max_framebuffers=0' /boot/config.txt - # Splash cannot be seen anyway without video output - G_CONFIG_INJECT 'disable_splash=' 'disable_splash=1' /boot/config.txt - # hdmi_blanking should not play a role, however mode 1 should be generally preferred, which on idle disables HDMI output completely instead of just blanking the screen - G_CONFIG_INJECT 'hdmi_blanking=' 'hdmi_blanking=1' /boot/config.txt - # Disable HDMI hotplug detection, which requires it to be generally responsive/active - G_CONFIG_INJECT 'hdmi_ignore_hotplug=' 'hdmi_ignore_hotplug=1' /boot/config.txt - # Disable SDTV on RPi4 (default) - G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*enable_tvout=/c\#enable_tvout=0' /boot/config.txt - - # Odroid C2 legacy image, provided until December 2021 - elif [[ $G_HW_MODEL == 12 && -f '/boot/boot.ini' ]]; then - - G_CONFIG_INJECT 'setenv[[:blank:]]+nographics[[:blank:]]' 'setenv nographics "1"' /boot/boot.ini 'ODROIDC2-UBOOT-CONFIG' - - else - - Unsupported_Input_Name - - fi + Headless_Main() + { + (( $G_HW_MODEL > 9 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-RPi + if [[ $INPUT_DEVICE_VALUE == 'enable' ]] + then + # Prevent any framebuffer from being allocated + G_CONFIG_INJECT 'max_framebuffers=' 'max_framebuffers=0' /boot/config.txt + # Splash cannot be seen anyway without video output + G_CONFIG_INJECT 'disable_splash=' 'disable_splash=1' /boot/config.txt + # hdmi_blanking should not play a role, however mode 1 should be generally preferred, which on idle disables HDMI output completely instead of just blanking the screen + G_CONFIG_INJECT 'hdmi_blanking=' 'hdmi_blanking=1' /boot/config.txt + # Disable HDMI hotplug detection, which requires it to be generally responsive/active + G_CONFIG_INJECT 'hdmi_ignore_hotplug=' 'hdmi_ignore_hotplug=1' /boot/config.txt + # Disable SDTV on RPi 4 (default) + G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*enable_tvout=/c\#enable_tvout=0' /boot/config.txt + # dietpi.txt flag G_CONFIG_INJECT 'AUTO_SETUP_HEADLESS=' 'AUTO_SETUP_HEADLESS=1' /boot/dietpi.txt - elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then - - # RPi - if (( $G_HW_MODEL < 10 )); then - - G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*max_framebuffers=/c\#max_framebuffers=2' /boot/config.txt - #G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*disable_splash=/c\#disable_splash=0' /boot/config.txt - #G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*hdmi_blanking=/c\#hdmi_blanking=0' /boot/config.txt - G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*hdmi_ignore_hotplug=/c\#hdmi_ignore_hotplug=0' /boot/config.txt - G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*enable_tvout=/c\#enable_tvout=0' /boot/config.txt - - # Odroid C2 legacy image, provided until December 2021 - elif [[ $G_HW_MODEL == 12 && -f '/boot/boot.ini' ]]; then - - G_CONFIG_INJECT 'setenv[[:blank:]]+nographics[[:blank:]]' 'setenv nographics "0"' /boot/boot.ini 'ODROIDC2-UBOOT-CONFIG' - - else - - Unsupported_Input_Name - - fi - + elif [[ $INPUT_DEVICE_VALUE == 'disable' ]] + then + G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*max_framebuffers=/c\#max_framebuffers=2' /boot/config.txt + #G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*disable_splash=/c\#disable_splash=0' /boot/config.txt + #G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*hdmi_blanking=/c\#hdmi_blanking=0' /boot/config.txt + G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*hdmi_ignore_hotplug=/c\#hdmi_ignore_hotplug=0' /boot/config.txt + G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*enable_tvout=/c\#enable_tvout=0' /boot/config.txt G_CONFIG_INJECT 'AUTO_SETUP_HEADLESS=' 'AUTO_SETUP_HEADLESS=0' /boot/dietpi.txt - else - Unknown_Input_Mode - fi - } #///////////////////////////////////////////////////////////////////////////////////// From f8c99df1d70cf2b17e13250b842fa77e5764b039 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Jan 2024 13:48:08 +0100 Subject: [PATCH 41/77] v9.0 - DietPi-Software | Update fallback URLs --- dietpi/dietpi-software | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fcafcdb1e8..ed182ad31c 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -7448,7 +7448,7 @@ _EOF_ then Download_Install 'https://github.com/gotson/komga/releases/download/v0.165.0/komga-0.165.0.jar' /mnt/dietpi_userdata/komga/komga.jar else - local fallback_url='https://github.com/gotson/komga/releases/download/1.10.0/komga-1.10.0.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/1.10.1/komga-1.10.1.jar' Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/komga-[^"\/]*\.jar"$/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar fi @@ -7543,7 +7543,7 @@ _EOF_ local json=() [[ $PHP_VERSION == 8* ]] || aDEPS+=("php$PHP_VERSION-json") json=('json') - local fallback_url="https://github.com/ampache/ampache/releases/download/6.2.0/ampache-6.2.0_all_php$PHP_VERSION.zip" + local fallback_url="https://github.com/ampache/ampache/releases/download/6.2.1/ampache-6.2.1_all_php$PHP_VERSION.zip" Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/ampache-[0-9\.]*_all_php$PHP_VERSION.zip\"$/{print \$4}")" ampache # Reinstall: Preserve configs from old and new paths @@ -8598,7 +8598,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.9'; 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.10'; 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 @@ -9404,21 +9404,16 @@ _EOF_ # - pdo_sqlite module required for "artisan koel:init" < "artisan db:seed", despite MySQL database engine used aDEPS=("php$PHP_VERSION-bcmath" "php$PHP_VERSION-mbstring" "php$PHP_VERSION-sqlite3" "php$PHP_VERSION-xml") - # Grab latest supported release: Koel v6 requires PHP 8.0 or higher for Laravel 9 and Koel v5.1 requires PHP 7.4 + # Grab latest supported release: Koel v6 requires PHP 8.0 or higher for Laravel 9 if (( ${PHP_VERSION::1} > 7 )) then aDEPS+=("php$PHP_VERSION-curl") - local fallback_url='https://github.com/koel/koel/releases/download/v6.12.0/koel-v6.12.0.tar.gz' aphp_deps=('curl' 'dom') + local fallback_url='https://github.com/koel/koel/releases/download/v6.12.1/koel-v6.12.1.tar.gz' aphp_deps=('curl' 'dom') Download_Install "$(curl -sSfL 'https://api.github.com/repos/koel/koel/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/koel-[^"\/]*\.tar\.gz"$/{print $4}')" else aDEPS+=("php$PHP_VERSION-json") local aphp_deps=('json') - if [[ $PHP_VERSION == '7.4' ]] - then - Download_Install 'https://github.com/koel/koel/releases/download/v5.1.14/koel-v5.1.14.tar.gz' - else - Download_Install 'https://github.com/koel/koel/releases/download/v5.0.2/koel-v5.0.2.tar.gz' - fi + Download_Install 'https://github.com/koel/koel/releases/download/v5.1.14/koel-v5.1.14.tar.gz' fi # Reinstall: Clear previous install, but keep existing config file @@ -11155,7 +11150,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.3.2/tasmoadmin_v3.3.2.tar.gz' + local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.3.3/tasmoadmin_v3.3.3.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}')" else Download_Install 'https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v2.4.2/tasmoadmin_v2.4.2.tar.gz' From 7ae4df965fc0ff2137130dab59fcef7031210803 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 12 Jan 2024 17:48:01 +0100 Subject: [PATCH 42/77] v9.0 - DietPi-Patches | Bump VisionFive 2 and Star64 kernel versions, now with CPUFreq support for Star64, WiFi/BT firmware for common/onboard chips and a StarFive DRI library added --- .update/patches | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.update/patches b/.update/patches index b7fbb31cbf..2ee62d7148 100755 --- a/.update/patches +++ b/.update/patches @@ -1558,7 +1558,7 @@ Patch_9_0() done # VisionFive 2 - elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.71-dietpi1 + elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.72-dietpi1 then G_DIETPI-NOTIFY 2 'Updating RISC-V StarFive VisionFive 2 kernel ...' G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb' @@ -1566,7 +1566,7 @@ Patch_9_0() G_EXEC rm package.deb # Star64 - elif (( $G_HW_MODEL == 84 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-star64 2> /dev/null)" lt-nl 6.1.71-dietpi1 + elif (( $G_HW_MODEL == 84 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-star64 2> /dev/null)" lt-nl 6.1.72-dietpi1 then G_DIETPI-NOTIFY 2 'Updating RISC-V PINE64 Star64 kernel ...' G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-star64.deb' From 5b13db64db947d70c012c857a13c7abf92dfc908 Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:59:19 +0100 Subject: [PATCH 43/77] v9.0 (#6855) - DietPi-Software | NAA Daemon: Install Bookworm package on Bookworm systems, now available --- dietpi/dietpi-software | 1 - 1 file changed, 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index ed182ad31c..c8e14ea3c4 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6842,7 +6842,6 @@ _EOF_ then # Base URL local url="https://www.signalyst.eu/bins/naa/linux/${G_DISTRO_NAME/trixie/bookworm}/" - url=${url/bookworm/bullseye} case $G_HW_ARCH in 3) local arch='arm64';; From 49d0886a2decb8cce3575787697b6add04a5794d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Jan 2024 01:12:35 +0100 Subject: [PATCH 44/77] v9.0 - DietPi-Software | ownCloud/Nextcloud: Always install a new config file on reinstalls and instead create a backup of the old one. Missing mandatory config changes are probably more likely to cause issues than admin customizations to this file (instead of a dedicated one as recommended) - DietPi-Patches | Nextcloud: Update config files for all web servers, since especially for Nginx and Lighttpd there were some important changes recently: https://dietpi.com/forum/t/nextcloud-ocm-provider-resolve-error/18740 --- .update/patches | 45 ++++++++++++++++++++++++++---------------- dietpi/dietpi-software | 42 ++++++--------------------------------- 2 files changed, 34 insertions(+), 53 deletions(-) diff --git a/.update/patches b/.update/patches index 2ee62d7148..c8646c7f7e 100755 --- a/.update/patches +++ b/.update/patches @@ -1321,25 +1321,13 @@ Patch_8_20() then # Set deprecated X-XSS-Protection header to 0 # - Apache - if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[83\]=2' /boot/dietpi/.installed - then - [[ -f '/etc/apache2/conf-available/dietpi.conf' ]] && G_EXEC sed --follow-symlinks -i '/^Header set X-XSS-Protection "/c\Header set X-XSS-Protection "0"' /etc/apache2/conf-available/dietpi.conf - - # Nextcloud: Revert to mute Nextcloud's outdated admin panel warning - [[ -f '/etc/apache2/sites-available/dietpi-nextcloud.conf' ]] && G_EXEC sed --follow-symlinks -i '/<\/IfModule>/a\\n\t# Mute outdated admin panel warning\n\tHeader set X-XSS-Protection "1; mode=block"' /etc/apache2/sites-available/dietpi-nextcloud.conf - fi + [[ -f '/etc/apache2/conf-available/dietpi.conf' ]] && G_EXEC sed --follow-symlinks -i '/^Header set X-XSS-Protection "/c\Header set X-XSS-Protection "0"' /etc/apache2/conf-available/dietpi.conf # - ownCloud - if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[47\]=2' /boot/dietpi/.installed - then - [[ -f '/etc/nginx/sites-dietpi/dietpi-owncloud.conf' ]] && G_EXEC sed --follow-symlinks -i 's/add_header X-XSS-Protection "1; mode=block" always;/add_header X-XSS-Protection "0" always;/' /etc/nginx/sites-dietpi/dietpi-owncloud.conf - [[ -f '/etc/lighttpd/conf-available/99-dietpi-owncloud.conf' ]] && G_EXEC sed --follow-symlinks -i 's/"X-XSS-Protection" => "1; mode=block"/"X-XSS-Protection" => "0"/' /etc/lighttpd/conf-available/99-dietpi-owncloud.conf - fi + [[ -f '/etc/nginx/sites-dietpi/dietpi-owncloud.conf' ]] && G_EXEC sed --follow-symlinks -i 's/add_header X-XSS-Protection "1; mode=block" always;/add_header X-XSS-Protection "0" always;/' /etc/nginx/sites-dietpi/dietpi-owncloud.conf + [[ -f '/etc/lighttpd/conf-available/99-dietpi-owncloud.conf' ]] && G_EXEC sed --follow-symlinks -i 's/"X-XSS-Protection" => "1; mode=block"/"X-XSS-Protection" => "0"/' /etc/lighttpd/conf-available/99-dietpi-owncloud.conf # - Pi-hole - if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[93\]=2' /boot/dietpi/.installed - then - [[ -f '/etc/nginx/sites-dietpi/dietpi-pihole.conf' ]] && G_EXEC sed --follow-symlinks -i 's/add_header X-XSS-Protection "1; mode=block";/add_header X-XSS-Protection "0";/' /etc/nginx/sites-dietpi/dietpi-pihole.conf - [[ -f '/etc/lighttpd/conf-available/99-dietpi-pihole.conf' ]] && G_EXEC sed --follow-symlinks -i 's/"X-XSS-Protection" => "1; mode=block"/"X-XSS-Protection" => "0"/' /etc/lighttpd/conf-available/99-dietpi-pihole.conf - fi + [[ -f '/etc/nginx/sites-dietpi/dietpi-pihole.conf' ]] && G_EXEC sed --follow-symlinks -i 's/add_header X-XSS-Protection "1; mode=block";/add_header X-XSS-Protection "0";/' /etc/nginx/sites-dietpi/dietpi-pihole.conf + [[ -f '/etc/lighttpd/conf-available/99-dietpi-pihole.conf' ]] && G_EXEC sed --follow-symlinks -i 's/"X-XSS-Protection" => "1; mode=block"/"X-XSS-Protection" => "0"/' /etc/lighttpd/conf-available/99-dietpi-pihole.conf # DietPi-Dashboard: https://github.com/ravenclaw900/DietPi-Dashboard/releases/tag/v0.6.2 if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[200\]=2' /boot/dietpi/.installed @@ -1583,6 +1571,29 @@ Patch_9_0() G_DIETPI-NOTIFY 2 'Preparing Amiberry upgrade to v5.6.5, including migration for RPi systems from fake KMS DispmanX to full KMS SDL2 graphics backend' echo 108 >> /var/tmp/dietpi/dietpi-update_reinstalls fi + + # Nextcloud + # - Apache + if [[ -f '/etc/apache2/sites-available/dietpi-nextcloud.conf' ]] + then + G_EXEC mv /etc/apache2/sites-available/dietpi-nextcloud.conf /etc/apache2/sites-available/dietpi-nextcloud.conf.dietpi-old + G_EXEC curl -sSfo /etc/apache2/sites-available/dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/lighttpd.nextcloud.conf" + [[ -f '/etc/apache2/sites-available/dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/apache2/sites-available/dietpi-nextcloud.conf.dietpi-new + fi + # - Lighttpd + if [[ -f '/etc/lighttpd/conf-available/99-dietpi-nextcloud.conf' ]] + then + G_EXEC mv /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf.dietpi-old + G_EXEC curl -sSfo /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/lighttpd.nextcloud.conf" + [[ -f '/etc/lighttpd/conf-available/99-dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/lighttpd/conf-available/99-dietpi-nextcloud.conf.dietpi-new + fi + # - Nginx + if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] + then + G_EXEC mv /etc/nginx/sites-dietpi/dietpi-nextcloud.conf /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-old + G_EXEC curl -sSfo /etc/nginx/sites-dietpi/dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/nginx.nextcloud.conf" + [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new + fi fi } diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index c8e14ea3c4..d9df73a94c 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -4388,12 +4388,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Apache webserver found, enabling ownCloud specific configuration.' # https://doc.owncloud.com/server/next/admin_manual/installation/manual_installation/manual_installation_apache.html a2enmod rewrite headers env dir mime 1> /dev/null local owncloud_conf='/etc/apache2/sites-available/dietpi-owncloud.conf' - if [[ -f $owncloud_conf ]]; then - - owncloud_conf+='.dietpi-new' - G_WHIP_MSG "Existing ownCloud Apache configuration found, will preserve the old one and save the new one for review and comparison to: $owncloud_conf" - - fi + [[ -f $owncloud_conf ]] && G_EXEC mv "$owncloud_conf" "$owncloud_conf.dietpi-old" dps_index=$software_id Download_Install 'apache.owncloud.conf' "$owncloud_conf" a2ensite dietpi-owncloud 1> /dev/null # Cal/CardDAV redirects to ownCloud DAV endpoint @@ -4416,12 +4411,7 @@ Redirect 301 /.well-known/caldav /owncloud/remote.php/dav' > /etc/apache2/conf- # Move ownCloud configuration file in place and activate it owncloud_conf='/etc/lighttpd/conf-available/99-dietpi-owncloud.conf' - if [[ -f $owncloud_conf ]]; then - - owncloud_conf+='.dietpi-new' - G_WHIP_MSG "Existing ownCloud Lighttpd configuration found, will preserve the old one and save the new one for review and comparison to: $owncloud_conf" - - fi + [[ -f $owncloud_conf ]] && G_EXEC mv "$owncloud_conf" "$owncloud_conf.dietpi-old" dps_index=$software_id Download_Install 'lighttpd.owncloud.conf' "$owncloud_conf" G_EXEC_POST_FUNC(){ [[ $exit_code == 2 ]] && exit_code=0; } # Do not fail if modules are enabled already G_EXEC lighty-enable-mod rewrite dietpi-owncloud @@ -4443,12 +4433,7 @@ url.redirect += ( G_DIETPI-NOTIFY 2 'Nginx webserver found, enabling ownCloud specific configuration.' # https://github.com/owncloud/docs/blob/deda107/modules/admin_manual/examples/installation/nginx/subdirectory-configuration.conf local owncloud_conf='/etc/nginx/sites-dietpi/dietpi-owncloud.conf' - if [[ -f $owncloud_conf ]]; then - - owncloud_conf+='.dietpi-new' - G_WHIP_MSG "Existing ownCloud Nginx configuration found, will preserve the old one and save the new one for review and comparison to: $owncloud_conf" - - fi + [[ -f $owncloud_conf ]] && G_EXEC mv "$owncloud_conf" "$owncloud_conf.dietpi-old" dps_index=$software_id Download_Install 'nginx.owncloud.conf' "$owncloud_conf" # Cal/CardDAV redirects to ownCloud DAV endpoint @@ -4642,12 +4627,7 @@ The install script will now exit. After applying one of the the above, rerun die G_DIETPI-NOTIFY 2 'Apache webserver found, enabling Nextcloud specific configuration.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#apache-web-server-configuration a2enmod rewrite headers env dir mime 1> /dev/null local nextcloud_conf='/etc/apache2/sites-available/dietpi-nextcloud.conf' - if [[ -f $nextcloud_conf ]]; then - - nextcloud_conf+='.dietpi-new' - G_WHIP_MSG "Existing Nextcloud Apache configuration found, will preserve the old one and save the new one for review and comparison to: $nextcloud_conf" - - fi + [[ -f $nextcloud_conf ]] && G_EXEC mv "$nextcloud_conf" "$nextcloud_conf.dietpi-old" dps_index=$software_id Download_Install 'apache.nextcloud.conf' "$nextcloud_conf" a2ensite dietpi-nextcloud 1> /dev/null # Cal/CardDAV redirects to Nextcloud DAV endpoint @@ -4670,12 +4650,7 @@ Redirect 301 /.well-known/caldav /nextcloud/remote.php/dav' > /etc/apache2/conf # Move Nextcloud configuration file in place and activate it nextcloud_conf='/etc/lighttpd/conf-available/99-dietpi-nextcloud.conf' - if [[ -f $nextcloud_conf ]]; then - - nextcloud_conf+='.dietpi-new' - G_WHIP_MSG "Existing Nextcloud Lighttpd configuration found, will preserve the old one and save the new one for review and comparison to: $nextcloud_conf" - - fi + [[ -f $nextcloud_conf ]] && G_EXEC mv "$nextcloud_conf" "$nextcloud_conf.dietpi-old" dps_index=$software_id Download_Install 'lighttpd.nextcloud.conf' "$nextcloud_conf" G_EXEC_POST_FUNC(){ [[ $exit_code == 2 ]] && exit_code=0; } # Do not fail if modules are enabled already G_EXEC lighty-enable-mod rewrite dietpi-nextcloud @@ -4697,12 +4672,7 @@ url.redirect += ( G_DIETPI-NOTIFY 2 'Nginx webserver found, enabling Nextcloud specific configuration.' # https://docs.nextcloud.com/server/stable/admin_manual/installation/nginx.html local nextcloud_conf='/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' - if [[ -f $nextcloud_conf ]]; then - - nextcloud_conf+='.dietpi-new' - G_WHIP_MSG "Existing Nextcloud Nginx configuration found, will preserve the old one and save the new one for review and comparison to: $nextcloud_conf" - - fi + [[ -f $nextcloud_conf ]] && G_EXEC mv "$nextcloud_conf" "$nextcloud_conf.dietpi-old" dps_index=$software_id Download_Install 'nginx.nextcloud.conf' "$nextcloud_conf" # Cal/CardDAV redirects to Nextcloud DAV endpoint From 4fda06839b25e1a1e8c6872248468ee0674afaef Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 13 Jan 2024 15:37:47 +0100 Subject: [PATCH 45/77] v9.0 (#6856) - General | Remove more Buster-related code --- .build/images/dietpi-build | 4 -- .build/images/dietpi-installer | 35 ++-------------- .build/software/dietpi-software-build.bash | 2 +- .build/software/squeezelite/build.bash | 2 +- .build/software/ympd/build.bash | 4 +- .conf/desktop/apps/kodi.desktop | 2 +- .github/workflows/amiberry.yml | 12 +----- .github/workflows/dietpi-build.yml | 1 - .meta/dietpi-bookworm-upgrade | 3 ++ .update/patches | 42 +++++-------------- .update/pre-patches | 21 +--------- dietpi/dietpi-drive_manager | 24 ++++------- dietpi/dietpi-letsencrypt | 20 +++------ dietpi/dietpi-login | 2 +- dietpi/dietpi-software | 9 +--- dietpi/func/dietpi-globals | 11 +---- dietpi/func/dietpi-obtain_hw_model | 8 +--- dietpi/func/dietpi-set_hardware | 28 ++----------- dietpi/func/dietpi-set_software | 13 ++---- dietpi/misc/start_kodi | 49 ---------------------- rootfs/etc/bashrc.d/dietpi.bash | 2 +- 21 files changed, 52 insertions(+), 242 deletions(-) delete mode 100755 dietpi/misc/start_kodi diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 742e07e90b..26e0669188 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -158,7 +158,6 @@ esac exclude= case $DISTRO in - 5) distro='buster'; [[ $HW_MODEL == 75 ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; };; 6) distro='bullseye' exclude=',gcc-8-base,gcc-9-base';; 7|8) exclude=',gcc-8-base,gcc-9-base,gcc-10-base,gcc-11-base' @@ -421,9 +420,6 @@ infocmp "$TERM" > /dev/null 2>&1 || { echo "[ WARN ] Unsupported TERM=\"$TERM\", echo '[ INFO ] Running DietPi-Installer...' _EOF_ -# Workaround for failing HTTPS validation on ARMv6/7 Buster (don't ask me why neither ARMv8 nor x86_64 are affected...) -(( $DISTRO == 5 && $HW_ARCH < 3 )) && G_EXEC eval 'echo '\''c_rehash'\'' >> rootfs/etc/rc.local' - 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' diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 37fe4b7588..48824516e8 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -4,7 +4,7 @@ # Install DietPi on any Debian system #------------------------------------------------------------------------------------------------ # REQUIREMENTS - # - Currently running Debian Buster or above, ideally minimal, e.g. Raspberry Pi OS Lite-ish =)) + # - Currently running Debian Bullseye or above, ideally minimal, e.g. Raspberry Pi OS Lite-ish =)) # - systemd as system/init/service manager # - Either Ethernet connection or local (non-SSH) terminal access #------------------------------------------------------------------------------------------------ @@ -173,12 +173,7 @@ _EOF_ # Detect the distro version of this operating system distro=$( 5 )) - then - aPACKAGES_REQUIRED_INSTALL+=('dropbear') - else - aPACKAGES_REQUIRED_INSTALL+=('dropbear-run') - fi - # All but VMs: Drive power management control (( $G_HW_MODEL == 20 )) || aPACKAGES_REQUIRED_INSTALL+=('hdparm') fi @@ -1513,13 +1493,6 @@ _EOF_ G_AGI "${aPACKAGES_REQUIRED_INSTALL[@]}" unset -v aPACKAGES_REQUIRED_INSTALL - # Adjust Dropbear package marks when Buster was upgraded to Bullseye - if dpkg-query -s 'dropbear-run' &> /dev/null - then - G_EXEC apt-mark manual dropbear - G_EXEC apt-mark auto dropbear-run - fi - G_AGA # Remove temporary APT configs diff --git a/.build/software/dietpi-software-build.bash b/.build/software/dietpi-software-build.bash index f5346d543e..1ee510ef4a 100644 --- a/.build/software/dietpi-software-build.bash +++ b/.build/software/dietpi-software-build.bash @@ -48,7 +48,7 @@ do done [[ $NAME =~ ^('gmediarender'|'gogs'|'shairport-sync'|'squeezelite'|'vaultwarden'|'ympd')$ ]] || Error_Exit "Invalid software title \"$NAME\" passed" [[ $NAME == 'gogs' ]] && EXT='7z' || EXT='deb' -[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || Error_Exit "Invalid distro \"$DISTRO\" passed" +[[ $DISTRO =~ ^('bullseye'|'bookworm'|'trixie')$ ]] || Error_Exit "Invalid distro \"$DISTRO\" passed" case $ARCH in 'armv6l') image="ARMv6-${DISTRO^}" arch=1;; 'armv7l') image="ARMv7-${DISTRO^}" arch=2;; diff --git a/.build/software/squeezelite/build.bash b/.build/software/squeezelite/build.bash index ccf8c3b921..b7dcf69aa5 100755 --- a/.build/software/squeezelite/build.bash +++ b/.build/software/squeezelite/build.bash @@ -9,7 +9,7 @@ G_AGDUG make gcc libc6-dev libasound2-dev libflac-dev libmad0-dev libvorbis-dev # Runtime deps adeps=('libc6' 'libasound2' 'libmad0' 'libvorbisfile3' 'libmpg123-0' 'libsoxr0' 'liblirc-client0' 'libfaad2' 'libopus0') case $G_DISTRO in - 5|6) adeps+=('libflac8' 'libavformat58' 'libssl1.1');; + 6) adeps+=('libflac8' 'libavformat58' 'libssl1.1');; 7) adeps+=('libflac12' 'libavformat59' 'libssl3');; 8) adeps+=('libflac12' 'libavformat60' 'libssl3');; *) G_DIETPI-NOTIFY 1 "Unsupported distro version: $G_DISTRO_NAME (ID=$G_DISTRO)"; exit 1;; diff --git a/.build/software/ympd/build.bash b/.build/software/ympd/build.bash index 8e08f05e17..e0a6cc11f1 100644 --- a/.build/software/ympd/build.bash +++ b/.build/software/ympd/build.bash @@ -4,14 +4,12 @@ # Build deps G_AGUP -# - ARMv6 Buster: Prevent install of 3.16.3-3~bpo10+1 from RPi repo, which breaks build: "list sub-command REMOVE_ITEM requires two or more arguments." -(( $G_HW_ARCH == 1 && $G_DISTRO == 5 )) && G_EXEC eval 'echo -e '\''Package: cmake cmake-data\nPin: origin archive.raspberrypi.org\nPin-Priority: -1'\'' > /etc/apt/preferences.d/dietpi-cmake' G_AGDUG cmake make gcc libc6-dev pkg-config libmpdclient-dev libssl-dev # Runtime deps adeps=('libc6' 'libmpdclient2') case $G_DISTRO in - 5|6) adeps+=('libssl1.1');; + 6) adeps+=('libssl1.1');; 7|8) adeps+=('libssl3');; *) G_DIETPI-NOTIFY 1 "Unsupported distro version: $G_DISTRO_NAME (ID=$G_DISTRO)"; exit 1;; esac diff --git a/.conf/desktop/apps/kodi.desktop b/.conf/desktop/apps/kodi.desktop index 7fb53ffc5e..bb6a332553 100644 --- a/.conf/desktop/apps/kodi.desktop +++ b/.conf/desktop/apps/kodi.desktop @@ -3,7 +3,7 @@ Version=1.0 Name=Kodi Media Center GenericName=Media Center Comment=Manage and view your media -Exec=/boot/dietpi/misc/start_kodi +Exec=kodi --standalone Icon=/var/lib/dietpi/dietpi-software/installed/desktop/icons/kodi-icon.png Terminal=false Type=Application diff --git a/.github/workflows/amiberry.yml b/.github/workflows/amiberry.yml index 3b07aa0012..ad64e136e5 100644 --- a/.github/workflows/amiberry.yml +++ b/.github/workflows/amiberry.yml @@ -12,7 +12,7 @@ on: dist: description: 'Target Debian version' type: choice - options: [buster, bullseye, bookworm, trixie, all] + options: [bullseye, bookworm, trixie, all] default: all required: true concurrency: @@ -43,7 +43,7 @@ jobs: run: | if [ '${{ github.event.inputs.dist }}' = 'all' ] then - echo dist='["buster", "bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" + echo dist='["bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" else echo dist='["${{ github.event.inputs.dist }}"]' >> "$GITHUB_OUTPUT" fi @@ -54,14 +54,6 @@ jobs: plat: ${{ fromJson(needs.prep.outputs.plat) }} dist: ${{ fromJson(needs.prep.outputs.dist) }} exclude: - - { plat: rk3588, dist: buster } # Compiler fails with: "g++: fatal error: unknown value ‘cortex-a76+fp’ for -mcpu" - - { plat: rpi1-sdl2, dist: buster } # Compiler fails with: "list sub-command REMOVE_ITEM requires two or more arguments." and those builds are not picked by DietPi v8 and earlier, the latest which support Buster - - { plat: rpi2-sdl2, dist: buster } - - { plat: rpi3-sdl2, dist: buster } - - { plat: rpi4-sdl2, dist: buster } - - { plat: rpi5-sdl2, dist: buster } - - { plat: rpi5-64-sdl2, dist: buster } # Compiler fails with: "g++: fatal error: unknown value ‘cortex-a76’ for -mcpu" - - { plat: riscv64, dist: buster } - { plat: riscv64, dist: bullseye } - { plat: riscv64, dist: bookworm } fail-fast: false diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index 9e1894e35c..98e6cbbf41 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -71,7 +71,6 @@ jobs: '"-m 72 -d 6", "-m 72 -d 7", "-m 72 -d 8", '\ '"-m 73 -d 6", "-m 73 -d 7", "-m 73 -d 8", '\ '"-m 74 -d 6", "-m 74 -d 7", "-m 74 -d 8", '\ - '"-m 75 -a 1 -d 5", "-m 75 -a 2 -d 5", "-m 75 -a 3 -d 5", "-m 75 -a 10 -d 5", '\ '"-m 75 -a 1 -d 6", "-m 75 -a 2 -d 6", "-m 75 -a 3 -d 6", "-m 75 -a 10 -d 6", '\ '"-m 75 -a 1 -d 7", "-m 75 -a 2 -d 7", "-m 75 -a 3 -d 7", "-m 75 -a 10 -d 7", '\ '"-m 75 -a 1 -d 8", "-m 75 -a 2 -d 8", "-m 75 -a 3 -d 8", "-m 75 -a 10 -d 8", "-m 75 -a 11 -d 8", '\ diff --git a/.meta/dietpi-bookworm-upgrade b/.meta/dietpi-bookworm-upgrade index 4262330e81..11afd67df4 100755 --- a/.meta/dietpi-bookworm-upgrade +++ b/.meta/dietpi-bookworm-upgrade @@ -69,6 +69,9 @@ G_DIETPI-NOTIFY 2 'Reverting some package lists to Bullseye which have no Bookwo [[ -f '/etc/apt/sources.list.d/influxdb.list' ]] && G_EXEC sed --follow-symlinks -i 's/bookworm/bullseye/' /etc/apt/sources.list.d/influxdb.list [[ -f '/etc/apt/sources.list.d/mopidy.list' ]] && G_EXEC sed --follow-symlinks -i 's/bookworm/bullseye/' /etc/apt/sources.list.d/mopidy.list +G_DIETPI-NOTIFY 2 'Removing obsolete APT pinnings' +G_EXEC rm -f /etc/apt/preferences.d/dietpi-{php,openssl,xrdp,wireguard,kodi,openhab} + if (( $G_HW_MODEL == 4 )) && dpkg-query -s rpi-eeprom &> /dev/null then G_DIETPI-NOTIFY 2 'Setting rpi-eeprom package on hold to prevent conflicting upgrade attempt' diff --git a/.update/patches b/.update/patches index c8646c7f7e..bab2c247ff 100755 --- a/.update/patches +++ b/.update/patches @@ -267,24 +267,12 @@ Patch_7_5() Patch_7_6() { # RPi: Remove obsolete cmdline entry on v5.4+ kernel systems (not Stretch) - if (( $G_HW_MODEL < 10 && $G_DISTRO > 4 )) + if (( $G_HW_MODEL < 10 )) then G_DIETPI-NOTIFY 2 'Removing obsolete "elevator" entry from /boot/cmdline.txt' G_EXEC sed --follow-symlinks -Ei 's/elevator=[^[:blank:]]*[[:blank:]]+//' /boot/cmdline.txt G_EXEC sed --follow-symlinks -Ei 's/[[:blank:]]*elevator=[^[:blank:]]*//' /boot/cmdline.txt fi - - # https://github.com/jirka-h/haveged/pull/7 https://github.com/MichaIng/DietPi/issues/3689#issuecomment-678322767 - if [[ $G_DISTRO == 5 && $G_HW_ARCH == [23] ]] && dpkg-query -s haveged &> /dev/null - then - G_DIETPI-NOTIFY 2 'Upgrading haveged entropy daemon to fix an issue on ARM: https://github.com/jirka-h/haveged/pull/7' - G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/libhavege2_$G_HW_ARCH_NAME.deb" - G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/haveged_$G_HW_ARCH_NAME.deb" - G_AGI "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" - G_EXEC rm "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" - # Mark the library as auto-installed so that it can be autoremoved when haveged itself is removed. - G_EXEC apt-mark auto libhavege2 - fi } Patch_7_7() @@ -312,7 +300,7 @@ Patch_7_7() [[ -f '/boot/dietpi/.installed' ]] && grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[142\]=' /boot/dietpi/.installed && G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[142\]=/d' /boot/dietpi/.installed # Fix Deluge web interface service on Bullseye: https://github.com/MichaIng/DietPi/issues/4785 - if [[ $G_DISTRO -ge 6 && -f '/boot/dietpi/.installed' ]] && grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[45\]=2' /boot/dietpi/.installed && ! grep -q 'ExecStart.* -d ' /etc/systemd/system/deluge-web.service + if [[ -f '/boot/dietpi/.installed' ]] && grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[45\]=2' /boot/dietpi/.installed && ! grep -q 'ExecStart.* -d ' /etc/systemd/system/deluge-web.service then G_DIETPI-NOTIFY 2 'Patching Deluge web interface service to fix startup at Bullseye' G_EXEC sed --follow-symlinks -i 's/deluge-web -l/deluge-web -d -l/' /etc/systemd/system/deluge-web.service @@ -593,7 +581,6 @@ Patch_8_2() [[ -f '/boot/cmdline.txt' ]] && while grep -q 'cgroup_enable=memory cgroup_enable=memory' /boot/cmdline.txt; do G_EXEC sed --follow-symlinks -i 's/cgroup_enable=memory cgroup_enable=memory/cgroup_enable=memory/g' /boot/cmdline.txt; done # Apply cgroups-v2 workaround if the kernel does not support it: https://github.com/MichaIng/DietPi/issues/4705 - # - This is required on Bullseye only, but we'll apply it on Buster as well to cover later distro upgrades, since the logic is too complicated for our upgrade blog article. if dpkg --compare-versions "$(uname -r)" lt-nl 4.15 then # Odroids @@ -627,11 +614,6 @@ Patch_8_2() # Remove and migrate Chromium config files [[ $G_HW_MODEL -gt 9 && -f '/root/.chromium-browser.init' ]] && G_EXEC rm /root/.chromium-browser.init - if [[ $G_DISTRO == 5 && $G_HW_MODEL -le 9 && -d '/etc/chromium.d' && -d '/etc/chromium-browser/customizations' ]] - then - [[ -f '/etc/chromium.d/custom_flags' ]] && G_EXEC mv /etc/{chromium.d/custom_flags,chromium-browser/customizations/dietpi} - G_EXEC rm -R /etc/chromium.d - fi [[ -f '/etc/chromium.d/custom_flags' ]] && G_EXEC mv /etc/chromium.d/{custom_flags,dietpi} # Remove obsolete Nvidia install state @@ -656,9 +638,6 @@ Patch_8_4() G_EXEC sed --follow-symlinks -i 's/extraargs="net.ifnames=0"/extraargs=net.ifnames=0/' /boot/armbianEnv.txt fi - # Update workaround for numpy on ARMv6/7 Buster - (( $G_HW_ARCH < 3 && $G_DISTRO == 5 )) && [[ -f '/etc/pip-constraints.txt' ]] && G_EXEC sed --follow-symlinks -i '/^numpy!=1.21.5; python_version=='\''3.7'\''$/c\numpy<1.21.5; python_version=='\''3.7'\' /etc/pip-constraints.txt - # https://github.com/MichaIng/DietPi/issues/5441 if [[ -f '/etc/sudoers.d/dietpi' ]] then @@ -915,16 +894,13 @@ Patch_8_14() if dpkg-query -s wireless-regdb &> /dev/null then G_EXEC apt-mark manual wireless-regdb - if (( $G_DISTRO > 5 )) - then - G_EXEC update-alternatives --set regulatory.db /lib/firmware/regulatory.db-upstream - (( $G_DISTRO > 6 )) || { dpkg-query -s crda &> /dev/null && dpkg --compare-versions "$(uname -r)" ge 4.15 && G_WHIP_BUTTON_CANCEL_TEXT='Keep' G_WHIP_BUTTON_OK_TEXT='Remove' G_WHIP_DEFAULT_ITEM='yes' G_WHIP_YESNO 'Removing obsolete CRDA package -\nFrom Debian Bullseye on since Linux 4.15, the CRDA package to inform the kernel about WiFi country code changes is obsolete. The kernel is now able to load this data directly without the help of CRDA. + G_EXEC update-alternatives --set regulatory.db /lib/firmware/regulatory.db-upstream + (( $G_DISTRO > 6 )) || { dpkg-query -s crda &> /dev/null && dpkg --compare-versions "$(uname -r)" ge 4.15 && G_WHIP_BUTTON_CANCEL_TEXT='Keep' G_WHIP_BUTTON_OK_TEXT='Remove' G_WHIP_DEFAULT_ITEM='yes' G_WHIP_YESNO 'Removing obsolete CRDA package +\nSince Linux 4.15, the CRDA package to inform the kernel about WiFi country code changes is obsolete. The kernel is now able to load this data directly without the help of CRDA. More info: https://bugs.debian.org/1003903 \nShall we remove this package now? \nYou can do this manually any time later: # apt autopurge crda'; } && G_AGP crda - fi fi # NanoPi R2S/NEO3 @@ -1010,7 +986,6 @@ Patch_8_16() \nTo preserve some of the service ordering benefits from the previous behaviour, some systemd units will now be configured to make use of native systemd unit ordering.' # PHP version case $G_DISTRO in - 5) local PHP_VERSION='7.3';; 6) local PHP_VERSION='7.4';; *) local PHP_VERSION='8.2';; esac @@ -1139,7 +1114,7 @@ Patch_8_17() [[ -f '/boot/overlays/dietpi-disable_headphones.dtbo' ]] && G_EXEC rm /boot/overlays/dietpi-disable_headphones.dtbo # Remove deprecated rpivid-v4l2 overlay - if (( $G_DISTRO > 5 )) && grep -q '^[[:blank:]]*dtoverlay=rpivid-v4l2$' /boot/config.txt + if grep -q '^[[:blank:]]*dtoverlay=rpivid-v4l2$' /boot/config.txt then G_DIETPI-NOTIFY 2 'Removing deprecated device tree overlay: rpivid-v4l2' G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*dtoverlay=rpivid-v4l2$/d' /boot/config.txt @@ -1256,7 +1231,7 @@ Patch_8_19() grep -Eq '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[(141|177)\]=' /boot/dietpi/.installed && G_EXEC sed --follow-symlinks -Ei '/^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[(141|177)\]=/d' /boot/dietpi/.installed # Mopidy: Bullseye suite now available in official APT repo - (( $G_DISTRO > 5 )) && [[ -f '/etc/apt/sources.list.d/mopidy.list' ]] && grep -q buster /etc/apt/sources.list.d/mopidy.list && G_EXEC sed --follow-symlinks -i 's/buster/bullseye/' /etc/apt/sources.list.d/mopidy.list + [[ -f '/etc/apt/sources.list.d/mopidy.list' ]] && grep -q buster /etc/apt/sources.list.d/mopidy.list && G_EXEC sed --follow-symlinks -i 's/buster/bullseye/' /etc/apt/sources.list.d/mopidy.list # GMediaRender grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[163\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' gmediarender 2> /dev/null)" lt 0.1-dietpi1 && G_WHIP_MSG '[ INFO ] GMediaRender update available @@ -1594,6 +1569,9 @@ Patch_9_0() G_EXEC curl -sSfo /etc/nginx/sites-dietpi/dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/nginx.nextcloud.conf" [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new fi + + # Kodi + [[ -f '/usr/share/applications/kodi.desktop' ]] && G_CONFIG_INJECT 'Exec=' 'Exec=kodi --standalone' /usr/share/applications/kodi.desktop fi } diff --git a/.update/pre-patches b/.update/pre-patches index cdd47c96e2..81523ec0eb 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -55,13 +55,6 @@ then fi -# v7.5: Perform Debian suite change once, if the installed APT version does not allow it by default yet -if (( $G_DIETPI_VERSION_CORE < 7 || ( $G_DIETPI_VERSION_CORE == 7 && $G_DIETPI_VERSION_SUB < 5 ) )) && dpkg --compare-versions "$(dpkg-query -Wf '${VERSION}' apt)" lt 1.8.2.3 -then - G_DIETPI-NOTIFY 2 'Debian Bullseye has been released, so we accept the repository suite change once.' - G_EXEC apt-get -o 'Acquire::AllowReleaseInfoChange::Suite=true' -q update -fi - # v7.6 if (( $G_DIETPI_VERSION_CORE < 7 || ( $G_DIETPI_VERSION_CORE == 7 && $G_DIETPI_VERSION_SUB < 6 ) )) && (( $G_HW_MODEL < 10 )) && [[ -f '/etc/apt/preferences.d/dietpi-lxde' ]] && ! grep -q ' lx\*$' /etc/apt/preferences.d/dietpi-lxde then @@ -132,7 +125,7 @@ then fi # v8.5: https://github.com/MichaIng/DietPi/issues/5467 -if (( $G_DIETPI_VERSION_CORE < 8 || ( $G_DIETPI_VERSION_CORE == 8 && $G_DIETPI_VERSION_SUB < 5 ) )) && (( $G_DISTRO > 5 )) && dpkg-query -s systemd-timesyncd &> /dev/null && [[ $(apt-mark showauto systemd-timesyncd) ]] +if (( $G_DIETPI_VERSION_CORE < 8 || ( $G_DIETPI_VERSION_CORE == 8 && $G_DIETPI_VERSION_SUB < 5 ) )) && dpkg-query -s systemd-timesyncd &> /dev/null && [[ $(apt-mark showauto systemd-timesyncd) ]] then G_DIETPI-NOTIFY 2 'Marking systemd-timesyncd as manually installed to prevent its autoremoval' G_EXEC apt-mark manual systemd-timesyncd @@ -180,16 +173,7 @@ then # Distro: https://download.opensuse.org/repositories/home:/jcorporation/ distro='Debian_' (( $G_HW_MODEL < 10 )) && (( $G_RASPBIAN )) && distro='Raspbian_' - if (( $G_DISTRO == 5 )) - then - distro+='10' - - elif [[ $G_DISTRO == 6 || $distro == 'Raspbian_' ]] # No Testing suite available for Raspbian, use Bullseye package on Raspbian Bookworm - then - distro+='11' - else - distro+='Testing' - fi + (( $G_DISTRO == 6 )) && distro+='11' || distro+='12' G_EXEC curl -sSfLO "https://download.opensuse.org/repositories/home:/jcorporation/$distro/Release.key" G_EXEC gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-mympd.gpg --yes Release.key G_EXEC rm Release.key @@ -356,7 +340,6 @@ then then G_DIETPI-NOTIFY 2 'Migrating openHAB APT repository from testing suite to stable suite' G_EXEC sed --follow-symlinks -i 's/ testing / stable /' /etc/apt/sources.list.d/dietpi-openhab.list - (( $G_DISTRO < 6 )) && G_EXEC eval 'echo -e '\''Package: openhab*\nPin: version 3.*\nPin-Priority: 501'\'' > /etc/apt/preferences.d/dietpi-openhab' fi if [[ $G_DISTRO -ge 7 && -f '/etc/apt/sources.list.d/raspi.list' ]] && dpkg-query -s 'kodi-repository-kodi' &> /dev/null then diff --git a/dietpi/dietpi-drive_manager b/dietpi/dietpi-drive_manager index 652a8ac5a2..6102ab0e92 100755 --- a/dietpi/dietpi-drive_manager +++ b/dietpi/dietpi-drive_manager @@ -256,8 +256,7 @@ $swap_mounts # Root/BootFS dependant flags # - fsck flag for RootFS, to allow check on reboot and for BootFS, since corruption here is most critical and fsck finishes in no time # - nofail: Allow boot to continue, if mount fails, not wanted for Root/BootFS - # - x-systemd.automount: [ 1166.110202] systemd-fstab-generator[3512]: Ignoring automount option for root device - # /boot is removed from local-fs.target by this (on Buster only?), allowing it to mount after RAMdisk starts and unmount before it stops. + # - x-systemd.automount: The rootfs is logically mounted anyway and we want the bootfs to be available ASAP as well # Source device entry local dev_entry="UUID=${aDRIVE_UUID[$index]}" if [[ ${aDRIVE_MOUNT_TARGET[$index]} =~ ^/(boot(/efi|/firmware)?)?$ ]]; then @@ -382,8 +381,8 @@ $swap_mounts # Install required APT packages for FS R/W access [[ $APT_CHECK == 0 && ${deps[0]} ]] && G_AG_CHECK_INSTALL_PREREQ "${deps[@]}" && APT_CHECK=1 - # Workaround for exfat-fuse on Bullseye: https://github.com/MichaIng/DietPi/issues/5166 - [[ $G_DISTRO -ge 6 && -e '/sbin/mount.exfat-fuse' && ! -e '/sbin/mount.exfat' ]] && G_EXEC ln -sf mount.exfat-fuse /sbin/mount.exfat + # Workaround for exfat-fuse: https://github.com/MichaIng/DietPi/issues/5166 + [[ -e '/sbin/mount.exfat-fuse' && ! -e '/sbin/mount.exfat' ]] && G_EXEC ln -sf mount.exfat-fuse /sbin/mount.exfat G_EXEC sync @@ -928,15 +927,11 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return - Not all drives support the feature of "hdparm" and visa versa. End results may vary. - You can check status with "hdparm -C [sh]d[a-z]"'; then - # Since Debian Bullseye, spindown_time is not applied if APM is not supported by the drive. force_spindown_time is required to override that. - local spindown_setting='spindown_time' - (( $G_DISTRO > 5 )) && spindown_setting='force_spindown_time' - G_DIETPI-NOTIFY 2 'Applying spindown timeout to all drives now...' hdparm -B "$apm" -S "$G_WHIP_RETURNED_VALUE" /dev/[sh]d[a-z] G_DIETPI-NOTIFY 2 'Applying spindown timeout to /etc/hdparm.conf to be effective from next boot on...' - echo -e "apm = $apm\n$spindown_setting = $G_WHIP_RETURNED_VALUE" > /etc/hdparm.conf + echo -e "apm = $apm\nforce_spindown_time = $G_WHIP_RETURNED_VALUE" > /etc/hdparm.conf fi @@ -973,15 +968,13 @@ Do you wish to ignore this warning, and, mount the drive regardless?" || return Install_exFAT_Tools() { - # Install FUSE driver if kernel does not support exFAT natively and on Bullseye prefer exfat-utils over exfatprogs + # Install FUSE driver if kernel does not support exFAT natively # - Container: Assume host supports it - local apackages=() + local apackages=('exfatprogs') if (( $G_HW_MODEL == 75 )) || modprobe -q exfat then - (( $G_DISTRO > 5 )) && apackages=('exfatprogs') || apackages=('exfat-utils') # exfatprogs not available until Bullseye dpkg-query -s 'exfat-fuse' &> /dev/null && G_AGP exfat-fuse else - (( $G_DISTRO > 6 )) && apackages=('exfatprogs') || apackages=('exfat-utils') # exfat-utils not available since Bookworm apackages+=('exfat-fuse') fi G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" @@ -1748,10 +1741,9 @@ NB: If you are planning to dedicate the drive to this system, it is recommended G_EXEC mkdir -p "$samba_fp_mount_target" > "$fp_tmp" - # - Mount attempts from highest CIFS version to lowest, until one succeeds - # 3.1.1 supported on Buster only: https://manpages.debian.org/buster/cifs-utils/mount.cifs.8.en.html#OPTIONS + # - Mount attempts from highest CIFS version to lowest, until one succeeds: https://manpages.debian.org/bullseye/cifs-utils/mount.cifs.8.en.html#vers=arg local i - for i in '3.1.1' '3.0' '2.1' '2.0' '1.0' + for i in '3.1.1' '3.0.2' '3.0' '2.1' '2.0' '1.0' do G_DIETPI-NOTIFY 2 "Attempting to mount with CIFS version: $i" if mount -t cifs -o "username=$samba_clientuser,password=$samba_clientpassword,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=$i" "//$samba_clientname/$samba_clientshare" "$samba_fp_mount_target" &>> "$fp_tmp"; then diff --git a/dietpi/dietpi-letsencrypt b/dietpi/dietpi-letsencrypt index 73055f5473..a1a360557f 100755 --- a/dietpi/dietpi-letsencrypt +++ b/dietpi/dietpi-letsencrypt @@ -107,13 +107,11 @@ fi [[ -f $fp_cert_dir/combined.pem ]] && G_EXEC rm "$fp_cert_dir/combined.pem" + # Install dedicated TLS module package + G_AG_CHECK_INSTALL_PREREQ lighttpd-mod-openssl + # Allow adding environment variables via: setenv.add-environment - if (( $G_DISTRO < 6 )) - then - G_CONFIG_INJECT '"mod_setenv"' ' "mod_setenv",' /etc/lighttpd/lighttpd.conf '"mod_.+",' - else - [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv - fi + [[ -f '/etc/lighttpd/conf-enabled/05-setenv.conf' ]] || G_EXEC lighty-enable-mod setenv cat << _EOF_ > /etc/lighttpd/conf-available/50-dietpi-https.conf # Based on: https://ssl-config.mozilla.org/#server=lighttpd @@ -131,7 +129,7 @@ server.modules += ( "mod_openssl" ) # Intermediate configuration, tweak to your needs ssl.openssl.ssl-conf-cmd = ( "MinProtocol" => "TLSv1.2", - "Options" => "-ServerPreference,-SessionTicket", + "Options" => "-ServerPreference", "CipherString" => "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305" ) } @@ -148,17 +146,11 @@ server.modules += ( "mod_openssl" ) # Intermediate configuration, tweak to your needs ssl.openssl.ssl-conf-cmd = ( "MinProtocol" => "TLSv1.2", - "Options" => "-ServerPreference,-SessionTicket", + "Options" => "-ServerPreference", "CipherString" => "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305" ) } _EOF_ - # Bullseye: Install dedicated TLS module package and keep session tickets enabled, which is safe since Lighttpd v1.4.56: https://github.com/MichaIng/DietPi/issues/4294#issuecomment-826802056 - if (( $G_DISTRO > 5 )) - then - G_AG_CHECK_INSTALL_PREREQ lighttpd-mod-openssl - G_EXEC sed --follow-symlinks -i 's/,-SessionTicket//' /etc/lighttpd/conf-available/50-dietpi-https.conf - fi [[ -f '/etc/lighttpd/conf-enabled/50-dietpi-https.conf' ]] || G_EXEC lighty-enable-mod dietpi-https # Redirect diff --git a/dietpi/dietpi-login b/dietpi/dietpi-login index 96f533587a..f23b2cdadc 100755 --- a/dietpi/dietpi-login +++ b/dietpi/dietpi-login @@ -29,7 +29,7 @@ # Kodi if (( $auto_start_index == 1 )); then - exec /boot/dietpi/misc/start_kodi + exec kodi --standalone # Desktop autologin (for root user only, as non-root user autologins are done via LightDM service since v7.2) elif (( $auto_start_index == 2 )); then diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index d9df73a94c..62c295740e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -325,10 +325,6 @@ Available commands: aSOFTWARE_CATX[$software_id]=2 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/media/#kodi' aSOFTWARE_DEPS[$software_id]='5 152' - # Bullseye + RPi 32-bit + Odroid N2 + Odroid C4: Kodi starts without X server - [[ $G_DISTRO -ge 6 || ( $G_HW_MODEL -le 9 && $(dpkg --print-architecture) == 'armhf' ) || $G_HW_MODEL == 1[56] ]] || aSOFTWARE_DEPS[$software_id]+=' 6' - # Odroids from Bullseye on (no Amlogic fbdev Kodi build available) require an X server when no DRM is available. - [[ $G_HW_MODEL == 1[56] && $G_DISTRO -ge 6 && ! -e '/dev/dri' ]] && aSOFTWARE_DEPS[$software_id]+=' 6' #------------------ software_id=32 aSOFTWARE_NAME[$software_id]='ympd' @@ -943,9 +939,8 @@ Available commands: aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/gaming/#papermc' aSOFTWARE_DEPS[$software_id]='196' aSOFTWARE_INTERACTIVE[$software_id]=1 - # As of Java 16+ need, currently only works on Bullseye+ and not on ARMv6 + # - ARMv6 as of Java 16+ need aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - aSOFTWARE_AVAIL_G_DISTRO[$software_id,5]=0 #------------------ software_id=62 aSOFTWARE_NAME[$software_id]='Box86' @@ -7213,7 +7208,7 @@ _EOF_ # TigerVNC: Permit remote connections which implies TLSVnc authentications being enabled additionally # shellcheck disable=SC2016 - GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/tigervnc/vncserver-config-defaults # Bullseye + GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/tigervnc/vncserver-config-defaults # TigerVNC: Set control + read-only passwords if [[ ${aSOFTWARE_INSTALL_STATE[28]} == 1 && ! -f '/root/.vnc/passwd' ]] diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 45cadc4527..466f4fa5f6 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -1573,17 +1573,8 @@ Press any key to continue...' # Clean cache before every update, which can corrupt and gets fully rewritten anyway G_EXEC_PRE_FUNC(){ apt-get clean; } - # Fail when some index files couldn't be downloaded, e.g. due to DNS failure. By default, apt-get update prints a warning but does not return an error code. - local eany=() - if (( $G_DISTRO < 6 )) - then - G_EXEC_POST_FUNC(){ [[ $exit_code == 0 && $(<"$fp_log") == *'W: Some index files failed to download.'* ]] && exit_code=255; } - else - eany=('-eany') - fi - G_EXEC_DESC='\e[0mAPT update' - G_EXEC_OUTPUT=1 G_EXEC_OUTPUT_COL='\e[90m' G_EXEC apt-get -y "${eany[@]}" update + G_EXEC_OUTPUT=1 G_EXEC_OUTPUT_COL='\e[90m' G_EXEC apt-get -y -eany update local exit_code=$? if [[ $1 == '-'[fv] ]] diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index fe66954212..9a0c8748ef 100755 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -97,7 +97,6 @@ # G_HW_CPUID 10 Rockchip RK3568 # G_HW_CPUID 11 Rockchip RK3588 # ---------------- - # G_DISTRO 5 Buster # G_DISTRO 6 Bullseye # G_DISTRO 7 Bookworm # G_DISTRO 8 Trixie @@ -610,12 +609,7 @@ # Get distro ID local distro=$( /etc/modprobe.d/dietpi-disable_rpi_codec.conf" - - # Disable HEVC decoder - grep -q '^[[:blank:]]*dtoverlay=rpivid-v4l2$' /boot/config.txt && G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*dtoverlay=rpivid-v4l2$/d' /boot/config.txt else Unknown_Input_Mode fi @@ -1418,9 +1412,9 @@ Do you want to continue and disable the serial login console?' || return 1 # Install required APT packages local crda=() - (( $G_DISTRO < 6 )) || dpkg --compare-versions "$(uname -r)" lt-nl 4.15 && crda=('crda') + dpkg --compare-versions "$(uname -r)" lt-nl 4.15 && crda=('crda') G_EXEC_NOEXIT=1 G_AG_CHECK_INSTALL_PREREQ 'iw' 'wireless-tools' 'wpasupplicant' 'wireless-regdb' "${crda[@]}" || EXIT_CODE=1 - (( $G_DISTRO < 6 )) || update-alternatives --set regulatory.db /lib/firmware/regulatory.db-upstream + update-alternatives --set regulatory.db /lib/firmware/regulatory.db-upstream elif [[ $INPUT_DEVICE_VALUE == 'onboard_enable' ]]; then @@ -1549,9 +1543,6 @@ _EOF_ fi fi - # Allow root login on selected TTY if not enabled by default. This file has been removed with Debian Bullseye and is not respected by its default PAM rules. - (( $G_DISTRO < 6 )) && G_CONFIG_INJECT "$INPUT_ADDITIONAL" "$INPUT_ADDITIONAL" /etc/securetty - G_DIETPI-NOTIFY 2 "Enabling serial-getty on: /dev/$INPUT_ADDITIONAL" G_EXEC systemctl unmask "serial-getty@$INPUT_ADDITIONAL" G_EXEC systemctl enable "serial-getty@$INPUT_ADDITIONAL" @@ -1672,7 +1663,7 @@ _EOF_ if [[ $INPUT_DEVICE_VALUE != 'none' && -f '/proc/asound/cards' && $( 5 )) && aPackages+=('firmware-sof-signed') # Available since Bullseye - G_AG_CHECK_INSTALL_PREREQ "${aPackages[@]}" - - ;; + 'intel-sst-dsp') G_AG_CHECK_INSTALL_PREREQ firmware-intel-sound firmware-sof-signed;; # --------------- Sparky SBC ------------ # Allo Piano DAC (firmware + module) @@ -2253,11 +2238,6 @@ _EOF_ # - Fails on ROCK 5B as well, ignore failures in general now, it is not mandatory to succeed here: https://github.com/MichaIng/DietPi/discussions/5247#discussioncomment-4236146 G_EXEC_NOFAIL=1 G_EXEC alsactl -g store - # Buster: Avoid alsa-state.service start if its config file does not exist: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932209 - (( $G_DISTRO == 5 )) || return 0 - [[ -d '/etc/systemd/system/alsa-state.service.d' ]] || G_EXEC mkdir /etc/systemd/system/alsa-state.service.d - echo -e '[Unit]\nConditionPathExists=\nConditionPathExists=/etc/alsa/state-daemon.conf' > /etc/systemd/system/alsa-state.service.d/dietpi.conf - } #///////////////////////////////////////////////////////////////////////////////////// diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 41814c842f..aa4419495d 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -125,12 +125,9 @@ $FP_SCRIPT disable_ssh_password_logins [01]|root| Whether to disable SSH G_EXEC eval "echo 'deb $INPUT_MODE_VALUE $G_DISTRO_NAME main contrib non-free deb $INPUT_MODE_VALUE $G_DISTRO_NAME-updates main contrib non-free -deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME/updates main contrib non-free +deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME-security main contrib non-free deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt/sources.list" - # Since Bullseye, dir structure has changed: https://deb.debian.org/debian-security/dists/ - (( $G_DISTRO > 5 )) && G_EXEC sed --follow-symlinks -i '3s|/updates|-security|' /etc/apt/sources.list - # Since Bookworm, non-free firmware has been moved to new component: https://deb.debian.org/debian/pool/ (( $G_DISTRO > 6 )) && G_EXEC sed --follow-symlinks -i 's/$/ non-free-firmware/' /etc/apt/sources.list @@ -311,21 +308,17 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt fi - # Since Bullseye, systemd-timesyncd is a dedicated package - local timesyncd=() - (( $G_DISTRO < 6 )) || timesyncd=('systemd-timesyncd') - # Daemon mode: dbus required for timedatectl which users may expect if [[ $INPUT_MODE_VALUE == 4 ]] then - G_AG_CHECK_INSTALL_PREREQ "${timesyncd[@]}" dbus + G_AG_CHECK_INSTALL_PREREQ systemd-timesyncd dbus G_EXEC systemctl unmask systemd-timesyncd # Failsafe G_EXEC systemctl enable --now systemd-timesyncd # Oneshot modes: Enable systemd-timesyncd to start early at boot, but stop it now elif [[ $INPUT_MODE_VALUE == [123] ]] then - [[ ${timesyncd[0]} ]] && G_AG_CHECK_INSTALL_PREREQ "${timesyncd[@]}" + [[ ${timesyncd[0]} ]] && G_AG_CHECK_INSTALL_PREREQ systemd-timesyncd G_EXEC systemctl unmask systemd-timesyncd # Failsafe G_EXEC systemctl enable systemd-timesyncd G_EXEC systemctl stop systemd-timesyncd diff --git a/dietpi/misc/start_kodi b/dietpi/misc/start_kodi deleted file mode 100755 index 2f9dae4689..0000000000 --- a/dietpi/misc/start_kodi +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/dash -{ - #//////////////////////////////////// - # DietPi Kodi run script - # - #//////////////////////////////////// - # Created by Daniel Knight / daniel.knight@dietpi.com / dietpi.com - # - #//////////////////////////////////// - # - # Info: - # - Location: /boot/dietpi/misc/start_kodi - # - Starts Kodi the correct way for various HW models from desktop and console - # - # Usage: - # - /boot/dietpi/misc/start_kodi - #//////////////////////////////////// - - # Load $G_HW_MODEL and $G_DISTRO - . /boot/dietpi/.hw_model - - #///////////////////////////////////////////////////////////////////////////////////// - # Main Loop - #///////////////////////////////////////////////////////////////////////////////////// - standalone=0 - # Bullseye + RPi 32-bit + Odroid N2 + Odroid C4: Kodi starts without X server - [ "$G_DISTRO" -ge 6 ] || { [ "$G_HW_MODEL" -le 9 ] && [ "$(dpkg --print-architecture)" = 'armhf' ]; } || [ "$G_HW_MODEL" = 15 ] || [ "$G_HW_MODEL" = 16 ] && standalone=1 - # Odroids from Bullseye on (no Amlogic fbdev Kodi build available) require an X server when no DRM is available. - { [ "$G_HW_MODEL" = 15 ] || [ "$G_HW_MODEL" = 16 ]; } && [ "$G_DISTRO" -ge 6 ] && [ ! -e '/dev/dri' ] && standalone=0 - - if [ "$standalone" = 1 ] - then - exec kodi --standalone "$@" - - # Everything else - # - From desktop - elif [ "$DISPLAY" ] - then - exec kodi "$@" - - # - From console - else - exec xinit "$(command -v kodi)" --standalone "$@" - fi - - #------------------------------------------------------------------------------------- - exit - #------------------------------------------------------------------------------------- -} diff --git a/rootfs/etc/bashrc.d/dietpi.bash b/rootfs/etc/bashrc.d/dietpi.bash index c14dc0d7cd..16d90c0f86 100644 --- a/rootfs/etc/bashrc.d/dietpi.bash +++ b/rootfs/etc/bashrc.d/dietpi.bash @@ -53,7 +53,7 @@ alias cpu='/boot/dietpi/dietpi-cpuinfo' # - Optional DietPi software aliases [[ -d '/mnt/dietpi_userdata/sonarr' || -d '/mnt/dietpi_userdata/radarr' || -d '/mnt/dietpi_userdata/lidarr' ]] && alias dietpi-arr_to_RAM='/boot/dietpi/misc/dietpi-arr_to_RAM' - command -v kodi > /dev/null && alias startkodi='/boot/dietpi/misc/start_kodi' + command -v kodi > /dev/null && alias startkodi='kodi --standalone' [[ -f '/usr/games/opentyrian/run' ]] && alias opentyrian='/usr/games/opentyrian/run' [[ -f '/mnt/dietpi_userdata/dxx-rebirth/run.sh' ]] && alias dxx-rebirth='/mnt/dietpi_userdata/dxx-rebirth/run.sh' [[ -f '/var/www/owncloud/occ' ]] && alias occ='sudo -u www-data php /var/www/owncloud/occ' From 57cdcf112bee6ba136b91633d8dcfa8d77939bbf Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jan 2024 15:16:22 +0100 Subject: [PATCH 46/77] v9.0 - DietPi-Software | Logitech Media Server: Re-enabled it for Bookworm and Trixie, now using the latest "stable nightly" builds instead of the "latest releases". Many thanks to @SteveInWA for informing us about the update: https://github.com/MichaIng/DietPi/discussions/6847 --- CHANGELOG.txt | 1 + dietpi/dietpi-software | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index eb39936ea3..d96bf66b47 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -12,6 +12,7 @@ Enhancements: - DietPi-Banner | Instead of "Freespace", the "Disk usage" is now shown, including the total disk size and used percent. Many thanks to @Andr3Carvalh0 for implementing this change: https://github.com/MichaIng/DietPi/pull/6837 - DietPi-Software | motionEye: Updated build dependencies for ARM and RISC-V, and switched to the recent pre-release from PyPI, instead of pulling from the repositories dev branch. - DietPi-Software | Moonlight (CLI/GUI): Moonlight has been enabled on Bookworm, as packages are now available. +- DietPi-Software | Logitech Media Server: Re-enabled it for Bookworm and Trixie, now using the latest "stable nightly" builds instead of the "latest releases". Many thanks to @SteveInWA for informing us about the update: https://github.com/MichaIng/DietPi/discussions/6847 Bug fixes: diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 62c295740e..b7a7f1746f 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -363,11 +363,8 @@ Available commands: aSOFTWARE_DESC[$software_id]='fka. SlimServer, SqueezeboxServer, SliMP3' aSOFTWARE_CATX[$software_id]=2 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/media/#logitech-media-server' - # - RISC-V: No package: https://downloads.slimdevices.com/releases/latest.xml + # - RISC-V: No package: https://lms-community.github.io/lms-server-repository/stable.xml aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 - # - Bookworm since it does not support perl 5.36 yet - aSOFTWARE_AVAIL_G_DISTRO[$software_id,7]=0 - aSOFTWARE_AVAIL_G_DISTRO[$software_id,8]=0 #------------------ software_id=36 aSOFTWARE_NAME[$software_id]='Squeezelite' @@ -6981,14 +6978,13 @@ _EOF_ if To_Install 35 logitechmediaserver # Logitech Media Server then - # https://wiki.slimdevices.com/index.php/DebianPackage#installing_7.9.2 # Grab architecture local arch='arm' (( $G_HW_ARCH == 10 )) && arch='amd64' # Grab latest package URL - local fallback_url="https://downloads.slimdevices.com/LogitechMediaServer_v8.3.1/logitechmediaserver_8.3.1_$arch.deb" - Download_Install "$(curl -sSfL "https://www.mysqueezebox.com/update/?version=8.3&geturl=1&os=deb$arch")" + local fallback_url="https://downloads.slimdevices.com/nightly/logitechmediaserver_8.3.2~1702911674_$arch.deb" + Download_Install "$(curl -sSf 'https://lms-community.github.io/lms-server-repository/stable.xml' | grep -om1 "https://[^\"]*_$arch.deb")" G_EXEC systemctl stop logitechmediaserver Remove_SysV logitechmediaserver @@ -10074,7 +10070,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.14.2358/Readarr.develop.0.3.14.2358.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.15.2376/Readarr.develop.0.3.15.2376.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 af856dac97a5455d7cc94360b3386ff309d6f5d1 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jan 2024 16:54:13 +0100 Subject: [PATCH 47/77] v9.0 - CI | DietPi-Software: Raise LMS test timeout on ARM (emulated) --- .github/workflows/dietpi-software.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index e4a89c4a0c..003f92898c 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -94,7 +94,7 @@ Process_Software() 30) aSERVICES[i]='nxserver' aTCP[i]='4000';; 32) aSERVICES[i]='ympd' aTCP[i]='1337';; 33) (( $arch == 10 )) && aSERVICES[i]='airsonic' aTCP[i]='8080' aDELAY[i]=30;; # Fails in QEMU-emulated containers, probably due to missing device access - 35) aSERVICES[i]='logitechmediaserver' aTCP[i]='9000';; + 35) aSERVICES[i]='logitechmediaserver' aTCP[i]='9000'; (( $arch < 10 )) && aDELAY[i]=30;; 36) aCOMMANDS[i]='squeezelite -t';; # Service listens on random high UDP port and exits if no audio device has been found, which does not exist on GitHub Actions runners, respectively within the containers 37) aSERVICES[i]='shairport-sync' aTCP[i]='5000';; # AirPlay 2 would be TCP port 7000 39) aSERVICES[i]='minidlna' aTCP[i]='8200';; From 4206815a5f50591581d98f8aaf6e1e9ebd3e13ed Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jan 2024 17:08:30 +0100 Subject: [PATCH 48/77] v9.0 - CI | DietPi-Software: Further raise LMS test timeout on ARM (emulated) --- .github/workflows/dietpi-software.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 003f92898c..5898340966 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -94,7 +94,7 @@ Process_Software() 30) aSERVICES[i]='nxserver' aTCP[i]='4000';; 32) aSERVICES[i]='ympd' aTCP[i]='1337';; 33) (( $arch == 10 )) && aSERVICES[i]='airsonic' aTCP[i]='8080' aDELAY[i]=30;; # Fails in QEMU-emulated containers, probably due to missing device access - 35) aSERVICES[i]='logitechmediaserver' aTCP[i]='9000'; (( $arch < 10 )) && aDELAY[i]=30;; + 35) aSERVICES[i]='logitechmediaserver' aTCP[i]='9000'; (( $arch < 10 )) && aDELAY[i]=60;; 36) aCOMMANDS[i]='squeezelite -t';; # Service listens on random high UDP port and exits if no audio device has been found, which does not exist on GitHub Actions runners, respectively within the containers 37) aSERVICES[i]='shairport-sync' aTCP[i]='5000';; # AirPlay 2 would be TCP port 7000 39) aSERVICES[i]='minidlna' aTCP[i]='8200';; From 149f9b4b7980a972d0009c91540bf0d4fd0857e4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 14 Jan 2024 23:06:19 +0100 Subject: [PATCH 49/77] v9.0 - CHANGELOG | Add v9.0 release PR URL --- CHANGELOG.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d96bf66b47..506d9faf2f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -16,7 +16,7 @@ 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/ADDME +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/6860 ----------------------------------------------------------------------------------------------------------- From 3bd3f3b27e215a6a1694f938e7c384e232c40652 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2024 19:24:55 +0100 Subject: [PATCH 50/77] v9.0 - dietpi-bookworm-upgrade | Remove setting rpi-eeprom on hold and re-apply pre-patch on v9.0 for those cases where the hold was applied via Bookworm upgrade script in the meantime --- .meta/dietpi-bookworm-upgrade | 9 --------- .update/pre-patches | 10 +++++----- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.meta/dietpi-bookworm-upgrade b/.meta/dietpi-bookworm-upgrade index 11afd67df4..aa96d23ea9 100755 --- a/.meta/dietpi-bookworm-upgrade +++ b/.meta/dietpi-bookworm-upgrade @@ -72,15 +72,6 @@ G_DIETPI-NOTIFY 2 'Reverting some package lists to Bullseye which have no Bookwo G_DIETPI-NOTIFY 2 'Removing obsolete APT pinnings' G_EXEC rm -f /etc/apt/preferences.d/dietpi-{php,openssl,xrdp,wireguard,kodi,openhab} -if (( $G_HW_MODEL == 4 )) && dpkg-query -s rpi-eeprom &> /dev/null -then - G_DIETPI-NOTIFY 2 'Setting rpi-eeprom package on hold to prevent conflicting upgrade attempt' - G_EXEC_OUTPUT=1 G_EXEC curl -fO 'https://dietpi.com/downloads/binaries/rpi/rpi-eeprom.deb' - G_EXEC dpkg -i --force-confdef,confold ./rpi-eeprom.deb - G_EXEC rm rpi-eeprom.deb - G_EXEC apt-mark hold rpi-eeprom -fi - G_DIETPI-NOTIFY 2 'Applying the actual upgrade to Debian Bookworm' /boot/dietpi/dietpi-services stop G_AGUP diff --git a/.update/pre-patches b/.update/pre-patches index 81523ec0eb..a665f8cd7e 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -351,11 +351,6 @@ fi # v8.25 if (( $G_DIETPI_VERSION_CORE < 8 || ( $G_DIETPI_VERSION_CORE == 8 && $G_DIETPI_VERSION_SUB < 25 ) )) then - if dpkg-query -s rpi-eeprom &> /dev/null - then - G_DIETPI-NOTIFY 2 'Reverting now obsolete rpi-eeprom hold' - G_EXEC apt-mark unhold rpi-eeprom - fi if [[ -f '/etc/apt/sources.list.d/webmin.list' ]] then G_DIETPI-NOTIFY 2 'Updating Webmin APT repo' @@ -367,6 +362,11 @@ fi # v9.0 if (( $G_DIETPI_VERSION_CORE < 9 || ( $G_DIETPI_VERSION_CORE == 9 && $G_DIETPI_VERSION_SUB < 0 ) )) then + if dpkg-query -s rpi-eeprom &> /dev/null + then + G_DIETPI-NOTIFY 2 'Reverting now obsolete rpi-eeprom hold' + G_EXEC apt-mark unhold rpi-eeprom + fi if (( $G_HW_MODEL < 10 || ( $G_HW_MODEL == 75 && ${G_RASPBIAN:-0} == 1 ) )) then G_DIETPI-NOTIFY 2 'Migrating from raspberrypi.org to raspberrypi.com' From 75ce24df3efa14080abae5d456f54a813378740e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2024 20:11:08 +0100 Subject: [PATCH 51/77] v9.0 - DietPi-Set_software | Coding and remove DietPi pre-v6.29 workaround --- dietpi/func/dietpi-set_software | 377 +++++++++++++------------------- 1 file changed, 147 insertions(+), 230 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index aa4419495d..9d53f14f5e 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -9,7 +9,7 @@ # #//////////////////////////////////// # - # Usage: + # Usage readonly FP_SCRIPT='/boot/dietpi/func/dietpi-set_software' readonly AVAIABLE_COMMANDS=" Available commands: @@ -26,10 +26,9 @@ $FP_SCRIPT add_ssh_pubkeys $FP_SCRIPT disable_ssh_password_logins [01]|root| Whether to disable SSH password logins for all users or root only; Leave empty to apply setting from /boot/dietpi.txt " #//////////////////////////////////// - # Grab inputs + # Inputs INPUT_MODE_NAME=$1 INPUT_MODE_VALUE=$2 - INPUT_ADDITIONAL_1=$3 INPUT_ADDITIONAL_2=$4 INPUT_ADDITIONAL_3=$5 @@ -45,28 +44,27 @@ $FP_SCRIPT disable_ssh_password_logins [01]|root| Whether to disable SSH EXIT_CODE=0 - Unknown_Input_Name(){ - + Unknown_Input_Name() + { EXIT_CODE=1 - G_DIETPI-NOTIFY 2 "Unknown input name ($INPUT_MODE_NAME). Nothing has been applied." + G_DIETPI-NOTIFY 2 "Unknown input command ($INPUT_MODE_NAME). Nothing has been applied." echo "$AVAIABLE_COMMANDS" } - Unknown_Input_Mode(){ - + Unknown_Input_Mode() + { EXIT_CODE=1 - G_DIETPI-NOTIFY 2 "Unknown input value ($INPUT_MODE_VALUE). Nothing has been applied." + G_DIETPI-NOTIFY 2 "Unknown input value ($INPUT_MODE_VALUE) for command \"$INPUT_MODE_NAME\". Nothing has been applied." echo "$AVAIABLE_COMMANDS" } #///////////////////////////////////////////////////////////////////////////////////// # locale - # NB: Adds C.UTF-8 alongside any input option #///////////////////////////////////////////////////////////////////////////////////// - Locale_Main(){ - - if [[ $INPUT_MODE_VALUE == 'C.UTF-8' ]] || grep -q "^$INPUT_MODE_VALUE UTF-8$" /usr/share/i18n/SUPPORTED; then - + Locale_Main() + { + if [[ $INPUT_MODE_VALUE == 'C.UTF-8' ]] || grep -q "^$INPUT_MODE_VALUE UTF-8$" /usr/share/i18n/SUPPORTED + then # Create list of locales to generate echo "$INPUT_MODE_VALUE UTF-8" > /etc/locale.gen # - Add C.UTF-8 back in, if not chosen, required by DietPi scripts. It's statically pre-compiled, but adding it here adds it to the faster (?) locale cache. @@ -85,20 +83,16 @@ $FP_SCRIPT disable_ssh_password_logins [01]|root| Whether to disable SSH # Update dietpi.txt entry G_CONFIG_INJECT 'AUTO_SETUP_LOCALE=' "AUTO_SETUP_LOCALE=$INPUT_MODE_VALUE" /boot/dietpi.txt - else - Unknown_Input_Mode - fi - } #///////////////////////////////////////////////////////////////////////////////////// - # Set APT Mirror + # apt-mirror #///////////////////////////////////////////////////////////////////////////////////// - AptMirror_Main(){ - + AptMirror_Main() + { [[ $INPUT_MODE_VALUE ]] || { Unknown_Input_Mode; return 1; } # RPi Trixie: Suite does not exist yet: https://archive.raspberrypi.com/debian/dists/ @@ -128,133 +122,113 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-updates main contrib non-free deb https://deb.debian.org/debian-security/ $G_DISTRO_NAME-security main contrib non-free deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt/sources.list" - # Since Bookworm, non-free firmware has been moved to new component: https://deb.debian.org/debian/pool/ + # Bookworm: non-free firmware has been moved to new component: https://deb.debian.org/debian/pool/ (( $G_DISTRO > 6 )) && G_EXEC sed --follow-symlinks -i 's/$/ non-free-firmware/' /etc/apt/sources.list # Update dietpi.txt entry G_CONFIG_INJECT 'CONFIG_APT_DEBIAN_MIRROR=' "CONFIG_APT_DEBIAN_MIRROR=$INPUT_MODE_VALUE" /boot/dietpi.txt fi - } #///////////////////////////////////////////////////////////////////////////////////// - # Set APT Cache + # apt #///////////////////////////////////////////////////////////////////////////////////// - Apt_Main(){ - + Apt_Main() + { local fp='/etc/apt/apt.conf.d/99-dietpi-cache' fp_compress='/etc/apt/apt.conf.d/98dietpi-nocompress' # Clean current cache before changing it, failsafe cleanup if custom dir was chosen before - apt-get clean - - if [[ $INPUT_MODE_VALUE == 'reset' ]]; then + G_EXEC_NOHALT=1 G_EXEC apt-get clean + if [[ $INPUT_MODE_VALUE == 'reset' ]] + then G_EXEC rm -Rf /tmp/apt "$fp" "$fp_compress" return 0 - fi [[ -f $fp ]] || echo '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit these settings.' > "$fp" - if [[ $INPUT_MODE_VALUE == 'clean' ]]; then - - G_EXEC rm -Rf /tmp/apt /var/cache/apt /var/lib/apt/{lists,mirrors,periodic,cdroms.list} - - elif [[ $INPUT_MODE_VALUE == 'cache' ]]; then - - if [[ $INPUT_ADDITIONAL_1 == 'disable' ]]; then - - G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" - # Leave archives on disk by default - GCI_PRESERVE=1 G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" - G_CONFIG_INJECT 'Dir::Cache::pkgcache[[:blank:]]' 'Dir::Cache::pkgcache "";' "$fp" - G_CONFIG_INJECT 'Dir::Cache::srcpkgcache[[:blank:]]' 'Dir::Cache::srcpkgcache "";' "$fp" - [[ -d '/var/cache/apt' ]] && G_EXEC rm -R /var/cache/apt - - elif [[ $INPUT_ADDITIONAL_1 == 'ram' ]]; then - - G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" - GCI_PRESERVE=1 G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" - sed --follow-symlinks -i '/pkgcache[[:blank:]]/d' "$fp" - [[ -d '/var/cache/apt' ]] && G_EXEC rm -R /var/cache/apt - - elif [[ $INPUT_ADDITIONAL_1 == 'disk' ]]; then - - sed --follow-symlinks -i '/^Dir::Cache/d' "$fp" - [[ -d '/tmp/apt' ]] && G_EXEC rm -R /tmp/apt - - fi - - elif [[ $INPUT_MODE_VALUE == 'lists' ]]; then - - if [[ $INPUT_ADDITIONAL_1 == 'ram' ]]; then - - G_CONFIG_INJECT 'Dir::State[[:blank:]]' 'Dir::State "/tmp/apt";' "$fp" - G_CONFIG_INJECT 'Dir::State::extended_states[[:blank:]]' 'Dir::State::extended_states "/var/lib/apt/extended_states";' "$fp" - G_CONFIG_INJECT 'Dir::State::status[[:blank:]]' 'Dir::State::status "/var/lib/dpkg/status";' "$fp" - G_EXEC rm -Rf /var/lib/apt/{lists,mirrors,periodic,cdroms.list} - - elif [[ $INPUT_ADDITIONAL_1 == 'disk' ]]; then - - sed --follow-symlinks -i '/^Dir::State/d' "$fp" - [[ -d '/tmp/apt' ]] && G_EXEC rm -R /tmp/apt - - fi - - elif [[ $INPUT_MODE_VALUE == 'archives' ]]; then - - if [[ $INPUT_ADDITIONAL_1 == 'ram' ]]; then - - # Cache needs to be in RAM as well for this to work reliable - G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" - G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/tmp/apt/archives";' "$fp" - [[ -d '/var/cache/apt' ]] && G_EXEC rm -R /var/cache/apt - - elif [[ $INPUT_ADDITIONAL_1 == 'disk' ]]; then - - G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" - [[ -d '/tmp/apt/archives' ]] && G_EXEC rm -R /tmp/apt/archives - - fi - - elif [[ $INPUT_MODE_VALUE == 'compress' ]]; then - - if [[ $INPUT_ADDITIONAL_1 == 1 || $INPUT_ADDITIONAL_1 == 'enable' ]]; then - - [[ -f '/etc/apt/apt.conf.d/98dietpi-nocompress' ]] && G_EXEC rm "$fp_compress" - - elif [[ $INPUT_ADDITIONAL_1 == 0 || $INPUT_ADDITIONAL_1 == 'disable' ]]; then - - echo -e '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit this setting.\nAcquire::GzipIndexes "false";' > "$fp_compress" - - fi - - fi + case $INPUT_MODE_VALUE In + 'clean') G_EXEC rm -Rf /tmp/apt /var/cache/apt /var/lib/apt/{lists,mirrors,periodic,cdroms.list};; + 'cache') + case $INPUT_ADDITIONAL_1 in + 'disable') + G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" + # Leave archives on disk by default + GCI_PRESERVE=1 G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" + G_CONFIG_INJECT 'Dir::Cache::pkgcache[[:blank:]]' 'Dir::Cache::pkgcache "";' "$fp" + G_CONFIG_INJECT 'Dir::Cache::srcpkgcache[[:blank:]]' 'Dir::Cache::srcpkgcache "";' "$fp" + [[ -d '/var/cache/apt' ]] && G_EXEC rm -R /var/cache/apt + ;; + 'ram') + G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" + GCI_PRESERVE=1 G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" + G_EXEC_NOHALT=1 G_EXEC sed --follow-symlinks -i '/pkgcache[[:blank:]]/d' "$fp" + [[ -d '/var/cache/apt' ]] && G_EXEC rm -R /var/cache/apt + ;; + 'disk') + G_EXEC_NOHALT=1 G_EXEC sed --follow-symlinks -i '/^Dir::Cache/d' "$fp" + [[ -d '/tmp/apt' ]] && G_EXEC rm -R /tmp/apt + ;; + *) :;; + esac;; + 'lists') + case $INPUT_ADDITIONAL_1 in + 'ram') + G_CONFIG_INJECT 'Dir::State[[:blank:]]' 'Dir::State "/tmp/apt";' "$fp" + G_CONFIG_INJECT 'Dir::State::extended_states[[:blank:]]' 'Dir::State::extended_states "/var/lib/apt/extended_states";' "$fp" + G_CONFIG_INJECT 'Dir::State::status[[:blank:]]' 'Dir::State::status "/var/lib/dpkg/status";' "$fp" + G_EXEC rm -Rf /var/lib/apt/{lists,mirrors,periodic,cdroms.list} + ;; + 'disk') + G_EXEC_NOHALT=1 G_EXEC sed --follow-symlinks -i '/^Dir::State/d' "$fp" + [[ -d '/tmp/apt' ]] && G_EXEC rm -R /tmp/apt + ;; + *) :;; + esac;; + 'archives') + case $INPUT_ADDITIONAL_1 in + 'ram') + # Cache needs to be in RAM as well for this to work reliable + G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" + G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/tmp/apt/archives";' "$fp" + [[ -d '/var/cache/apt' ]] && G_EXEC rm -R /var/cache/apt + ;; + 'disk') + G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" + [[ -d '/tmp/apt/archives' ]] && G_EXEC rm -R /tmp/apt/archives + + *) :;; + esac;; + 'compress') + case $INPUT_ADDITIONAL_1 in + 1|'enable') [[ -f '/etc/apt/apt.conf.d/98dietpi-nocompress' ]] && G_EXEC rm "$fp_compress";; + 0|'disable') echo -e '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit this setting.\nAcquire::GzipIndexes "false";' > "$fp_compress";; + esac;; + *) :;; + esac [[ -f $fp ]] || return 0 # Remove drop-in config if it does not contain any setting - if ! grep -q '^Dir' "$fp"; then - + if ! grep -q '^Dir' "$fp" + then G_EXEC rm "$fp" # Re-create default cache dir if archives on disk while cache in RAM, since parent dirs are not auto-created - elif grep -q '/var/cache/apt/archives' "$fp"; then - + elif grep -q '/var/cache/apt/archives' "$fp" + then G_EXEC mkdir -p /var/cache/apt/archives - fi - } #///////////////////////////////////////////////////////////////////////////////////// - # Set time sync mode - # NB: Also sets mirror as defined in dietpi.txt CONFIG_NTP_MIRROR + # ntpd-mode: Also sets mirror as defined in dietpi.txt CONFIG_NTP_MIRROR #///////////////////////////////////////////////////////////////////////////////////// - TimeSync_Main(){ - - if [[ ! $INPUT_MODE_VALUE || $INPUT_MODE_VALUE == [01234] ]]; then - + TimeSync_Main() + { + if [[ ! $INPUT_MODE_VALUE || $INPUT_MODE_VALUE == [01234] ]] + then # If no input given, re-apply current dietpi.txt setting, else revert to default mode 2 [[ $INPUT_MODE_VALUE ]] || INPUT_MODE_VALUE=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) [[ $INPUT_MODE_VALUE ]] || INPUT_MODE_VALUE=2 @@ -263,49 +237,39 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt [[ $ntp_mirror ]] || ntp_mirror='default' # Gateway, auto detect local gateway(s)/router(s) to use as NTP server(s). - if [[ ${ntp_mirror,,} == 'gateway' ]]; then - + if [[ ${ntp_mirror,,} == 'gateway' ]] + then # Convert mawk output to single line via ORS, remove trailing space afterwards local gateway=$(ip r l 0/0 | mawk '{print $3}' ORS=' '); gateway=${gateway% } - if [[ $gateway ]]; then - + if [[ $gateway ]] + then G_DIETPI-NOTIFY 0 "Gateway(s) detected: $gateway, adding as NTP server(s)." ntp_mirror=$gateway - else - G_DIETPI-NOTIFY 1 'No local gateway detected. Reverting NTP mirror back to system defaults.' EXIT_CODE=1 ntp_mirror='default' - fi - fi # Default, lets timesyncd use DHCP server or fallback to debian.pool.ntp.org. - if [[ ${ntp_mirror,,} == 'default' ]]; then - + if [[ ${ntp_mirror,,} == 'default' ]] + then [[ -f '/etc/systemd/timesyncd.conf' ]] && G_EXEC rm /etc/systemd/timesyncd.conf - else - local i ntp_mirror_entry for i in $ntp_mirror do - if [[ $i == *'pool.ntp.org' ]]; then - + if [[ $i == *'pool.ntp.org' ]] + then ntp_mirror_entry+="0.$i 1.$i 2.$i 3.$i " - else - ntp_mirror_entry+="$i " - fi done # Set mirror echo -e "[Time]\nNTP=${ntp_mirror_entry% }" > /etc/systemd/timesyncd.conf - fi # Daemon mode: dbus required for timedatectl which users may expect @@ -330,27 +294,23 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt # Update dietpi.txt G_CONFIG_INJECT 'CONFIG_NTP_MODE=' "CONFIG_NTP_MODE=$INPUT_MODE_VALUE" /boot/dietpi.txt - else - Unknown_Input_Mode - fi - } #///////////////////////////////////////////////////////////////////////////////////// - # Allo + # allo #///////////////////////////////////////////////////////////////////////////////////// - Allo_Main(){ - - if [[ $INPUT_MODE_VALUE == 'eth_dhcp' ]]; then - + Allo_Main() + { + if [[ $INPUT_MODE_VALUE == 'eth_dhcp' ]] + then G_CONFIG_INJECT 'iface eth' 'iface eth0 inet dhcp' /etc/network/interfaces sed --follow-symlinks -i '0,/^.*dns-nameservers[[:blank:]].*$/s//#dns-nameservers 9.9.9.9 149.112.112.112/' /etc/network/interfaces - elif [[ $INPUT_MODE_VALUE == 'eth_static' ]]; then - + elif [[ $INPUT_MODE_VALUE == 'eth_static' ]] + then G_CONFIG_INJECT 'iface eth' 'iface eth0 inet static' /etc/network/interfaces [[ $INPUT_ADDITIONAL_1 ]] && sed --follow-symlinks -i "0,\|^.*address[[:blank:]].*\$|s||address $INPUT_ADDITIONAL_1|" /etc/network/interfaces [[ $INPUT_ADDITIONAL_2 ]] && sed --follow-symlinks -i "0,\|^.*gateway[[:blank:]].*\$|s||gateway $INPUT_ADDITIONAL_2|" /etc/network/interfaces @@ -365,42 +325,36 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt local i for i in $INPUT_ADDITIONAL_4; do echo "nameserver $i" >> /etc/resolv.conf; done fi - else - Unknown_Input_Mode - fi - } #///////////////////////////////////////////////////////////////////////////////////// - # Users + # useradd #///////////////////////////////////////////////////////////////////////////////////// - Useradd_Main(){ - - if [[ $INPUT_MODE_VALUE ]]; then - + Useradd_Main() + { + if [[ $INPUT_MODE_VALUE ]] + then [[ -d '/home' ]] || G_EXEC mkdir /home # Failsafe # Get global password # - Encrypted - if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]]; then - + if [[ -f '/var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin' ]] + then GLOBAL_PW=$(openssl enc -d -a -md sha256 -aes-256-cbc -iter 10000 -salt -pass pass:'DietPiRocks!' -in /var/lib/dietpi/dietpi-software/.GLOBAL_PW.bin) # - DietPi-Installer, 1st run setup or user cancelled manual password choice else - GLOBAL_PW=$(sed -n '/^[[:blank:]]*AUTO_SETUP_GLOBAL_PASSWORD=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - fi # - Fallback [[ $GLOBAL_PW ]] || GLOBAL_PW='dietpi' - local usercmd='useradd -m' - getent passwd "$INPUT_MODE_VALUE" > /dev/null && usercmd='usermod' - $usercmd "$INPUT_MODE_VALUE" -p "$GLOBAL_PW" -s /bin/bash + local usercmd=('useradd' '-m') + getent passwd "$INPUT_MODE_VALUE" > /dev/null && usercmd=('usermod') + "${usercmd[@]}" "$INPUT_MODE_VALUE" -p "$GLOBAL_PW" -s /bin/bash # Copy root profile/bashrc [[ -f '/root/.profile' ]] && G_EXEC cp /root/.profile "/home/$INPUT_MODE_VALUE/" @@ -413,28 +367,18 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt [[ -f /etc/sudoers.d/$INPUT_MODE_VALUE ]] && G_EXEC chmod 0440 "/etc/sudoers.d/$INPUT_MODE_VALUE" echo "$INPUT_MODE_VALUE ALL=(ALL:ALL) NOPASSWD: ALL" > "/etc/sudoers.d/$INPUT_MODE_VALUE" umask 0022 - else - Unknown_Input_Mode - fi - } - Verify_DietPi_Txt(){ - - # Pre-v6.29 workaround: - # - This command is called between DietPi scripts update and incremental patches. - # - In case of DietPi-Update pre-v6.29, new code is stored to deprecated /DietPi mount point, hence this script loads old DietPi-Globals from /boot/dietpi/. - # - In older versions, G_GITBRANCH/G_GITOWNER variables are not yet available and further incompatibilities may arise, hence this command is doomed fail. - # - Additionally in case of Jessie systems, post-v6.25 dietpi.txt entries would be added before the update restarts with v6.25 jessie-support target branch. - # - Since all pre-v6.29 systems will have DietPi-Update restarted, this command will be called a second time with updated code, so we can skip the faulty first attempt. - # - Lets use the same check that DietPi-Patch does, to be sure the update restart is done. - [[ -d '/DietPi' && $(readlink -f '/DietPi') != '/boot' ]] && return 0 - + #///////////////////////////////////////////////////////////////////////////////////// + # verify_dietpi.txt + #///////////////////////////////////////////////////////////////////////////////////// + Verify_DietPi_Txt() + { # Add missing entries with dietpi.txt from Git - G_EXEC_DESC='Downloading current dietpi.txt' G_EXEC curl -sSfL "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/dietpi.txt" -o dietpi.txt_patch + G_EXEC_DESC='Downloading current dietpi.txt' G_EXEC curl -sSfLo dietpi.txt_patch "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/dietpi.txt" # Remove empty and commented lines, and do not re-add the password setting, which is intended to stay commented after first boot sed --follow-symlinks -Ei '/^[[:blank:]]*(#|$|AUTO_SETUP_GLOBAL_PASSWORD=)/d' dietpi.txt_patch @@ -453,9 +397,11 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt done < dietpi.txt_patch rm dietpi.txt_patch - } + #///////////////////////////////////////////////////////////////////////////////////// + # passwords + #///////////////////////////////////////////////////////////////////////////////////// Passwords_Main() { local pw_dietpi_software pw_root_dietpi_users @@ -516,6 +462,9 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt G_DIETPI-NOTIFY 2 '"root" and "dietpi" login password successfully changed' } + #///////////////////////////////////////////////////////////////////////////////////// + # boot_wait_for_network + #///////////////////////////////////////////////////////////////////////////////////// Boot_Wait_For_Network() { if [[ $INPUT_MODE_VALUE == 1 ]] @@ -534,6 +483,9 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt G_CONFIG_INJECT 'AUTO_SETUP_BOOT_WAIT_FOR_NETWORK=' "AUTO_SETUP_BOOT_WAIT_FOR_NETWORK=$INPUT_MODE_VALUE" /boot/dietpi.txt } + #///////////////////////////////////////////////////////////////////////////////////// + # add_ssh_pubkeys + #///////////////////////////////////////////////////////////////////////////////////// Add_SSH_Pubkeys() { [[ $INPUT_MODE_VALUE ]] && { Unknown_Input_Mode; return 1; } @@ -558,6 +510,9 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt done < <(sed -n '/^[[:blank:]]*AUTO_SETUP_SSH_PUBKEY=/s/^[^=]*=//p' /boot/dietpi.txt) } + #///////////////////////////////////////////////////////////////////////////////////// + # disable_ssh_password_logins + #///////////////////////////////////////////////////////////////////////////////////// Disable_SSH_Password_Logins() { # If no input given, apply dietpi.txt setting, default to "0" @@ -629,60 +584,22 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt # Main Loop #///////////////////////////////////////////////////////////////////////////////////// #----------------------------------------------------------------------------------- - # Info G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "$INPUT_MODE_NAME${INPUT_MODE_VALUE:+ ($INPUT_MODE_VALUE)}" #----------------------------------------------------------------------------------- - if [[ $INPUT_MODE_NAME == 'apt-mirror' ]]; then - - AptMirror_Main - - # Pre-v8.4: Backwards compatibility for "apt-cache" => "apt" - elif [[ $INPUT_MODE_NAME == 'apt' || $INPUT_MODE_NAME == 'apt-cache' ]]; then - - Apt_Main - - elif [[ $INPUT_MODE_NAME == 'useradd' ]]; then - - Useradd_Main - - elif [[ $INPUT_MODE_NAME == 'ntpd-mode' ]]; then - - TimeSync_Main - - elif [[ $INPUT_MODE_NAME == 'allo' ]]; then - - Allo_Main - - elif [[ $INPUT_MODE_NAME == 'verify_dietpi.txt' ]]; then - - Verify_DietPi_Txt - - elif [[ $INPUT_MODE_NAME == 'locale' ]]; then - - Locale_Main - - elif [[ $INPUT_MODE_NAME == 'passwords' ]]; then - - Passwords_Main - - elif [[ $INPUT_MODE_NAME == 'boot_wait_for_network' ]]; then - - Boot_Wait_For_Network - - elif [[ $INPUT_MODE_NAME == 'add_ssh_pubkeys' ]]; then - - Add_SSH_Pubkeys - - elif [[ $INPUT_MODE_NAME == 'disable_ssh_password_logins' ]]; then - - Disable_SSH_Password_Logins - - else - - Unknown_Input_Name - - fi - + case $INPUT_MODE_NAME in + 'apt-mirror') AptMirror_Main;; + 'apt'|'apt-cache') Apt_Main;; # Pre-v8.4: Backwards compatibility for "apt-cache" => "apt cache" + 'useradd') Useradd_Main;; + 'ntpd-mode') TimeSync_Main;; + 'allo') Allo_Main;; + 'verify_dietpi.txt') Verify_DietPi_Txt;; + 'locale') Locale_Main;; + 'passwords') Passwords_Main;; + 'boot_wait_for_network') Boot_Wait_For_Network;; + 'add_ssh_pubkeys') Add_SSH_Pubkeys;; + 'disable_ssh_password_logins') Disable_SSH_Password_Logins;; + *) Unknown_Input_Name;; + esac #----------------------------------------------------------------------------------- G_DIETPI-NOTIFY -1 "$EXIT_CODE" "$INPUT_MODE_NAME $INPUT_MODE_VALUE" exit "$EXIT_CODE" From 0b9dd24a331f6801ccbd0cbd66cd0155158f54ee Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2024 20:23:31 +0100 Subject: [PATCH 52/77] v9.0 - DietPi-Set_software | Typo --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 9d53f14f5e..1e66b36c4e 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -148,7 +148,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt [[ -f $fp ]] || echo '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit these settings.' > "$fp" - case $INPUT_MODE_VALUE In + case $INPUT_MODE_VALUE in 'clean') G_EXEC rm -Rf /tmp/apt /var/cache/apt /var/lib/apt/{lists,mirrors,periodic,cdroms.list};; 'cache') case $INPUT_ADDITIONAL_1 in From e8aaabafcaa2505fcbb15aad633967e321d1735b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2024 20:43:10 +0100 Subject: [PATCH 53/77] v9.0 - DietPi-Set_software | Syntax --- dietpi/func/dietpi-set_software | 1 + 1 file changed, 1 insertion(+) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 1e66b36c4e..03dd1975b0 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -197,6 +197,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt 'disk') G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" [[ -d '/tmp/apt/archives' ]] && G_EXEC rm -R /tmp/apt/archives + ;; *) :;; esac;; From b481bd65ac96640fd78052e8d3371495c66c99a4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2024 21:09:29 +0100 Subject: [PATCH 54/77] v9.0 - DietPi-Set_software | Further coding --- dietpi/func/dietpi-set_software | 50 ++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 03dd1975b0..84bf2eaa5e 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -58,6 +58,16 @@ $FP_SCRIPT disable_ssh_password_logins [01]|root| Whether to disable SSH echo "$AVAIABLE_COMMANDS" } + # $1: INPUT_ADDITIONAL_$1 + Unknown_Input_Additional() + { + local argument="INPUT_ADDITIONAL_$1" + argument=${!argument} + EXIT_CODE=1 + G_DIETPI-NOTIFY 2 "Unknown input argument ($argument) for command \"$INPUT_MODE_NAME $INPUT_MODE_NAME\". Nothing has been applied." + echo "$AVAIABLE_COMMANDS" + } + #///////////////////////////////////////////////////////////////////////////////////// # locale #///////////////////////////////////////////////////////////////////////////////////// @@ -138,13 +148,9 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt local fp='/etc/apt/apt.conf.d/99-dietpi-cache' fp_compress='/etc/apt/apt.conf.d/98dietpi-nocompress' # Clean current cache before changing it, failsafe cleanup if custom dir was chosen before - G_EXEC_NOHALT=1 G_EXEC apt-get clean + G_EXEC apt-get clean - if [[ $INPUT_MODE_VALUE == 'reset' ]] - then - G_EXEC rm -Rf /tmp/apt "$fp" "$fp_compress" - return 0 - fi + [[ $INPUT_MODE_VALUE == 'reset' ]] && { G_EXEC rm -Rf /tmp/apt "$fp" "$fp_compress"; return 0; } [[ -f $fp ]] || echo '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit these settings.' > "$fp" @@ -154,23 +160,22 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt case $INPUT_ADDITIONAL_1 in 'disable') G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" - # Leave archives on disk by default - GCI_PRESERVE=1 G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" + GCI_PRESERVE=1 G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" # Leave archives on disk by default G_CONFIG_INJECT 'Dir::Cache::pkgcache[[:blank:]]' 'Dir::Cache::pkgcache "";' "$fp" G_CONFIG_INJECT 'Dir::Cache::srcpkgcache[[:blank:]]' 'Dir::Cache::srcpkgcache "";' "$fp" - [[ -d '/var/cache/apt' ]] && G_EXEC rm -R /var/cache/apt + G_EXEC rm -Rf /var/cache/apt ;; 'ram') G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" GCI_PRESERVE=1 G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/var/cache/apt/archives";' "$fp" - G_EXEC_NOHALT=1 G_EXEC sed --follow-symlinks -i '/pkgcache[[:blank:]]/d' "$fp" - [[ -d '/var/cache/apt' ]] && G_EXEC rm -R /var/cache/apt + G_EXEC sed --follow-symlinks -i '/pkgcache[[:blank:]]/d' "$fp" + G_EXEC rm -Rf /var/cache/apt ;; 'disk') - G_EXEC_NOHALT=1 G_EXEC sed --follow-symlinks -i '/^Dir::Cache/d' "$fp" - [[ -d '/tmp/apt' ]] && G_EXEC rm -R /tmp/apt + G_EXEC sed --follow-symlinks -i '/^Dir::Cache/d' "$fp" + G_EXEC rm -Rf /tmp/apt ;; - *) :;; + *) Unknown_Input_Additional 1;; esac;; 'lists') case $INPUT_ADDITIONAL_1 in @@ -181,16 +186,15 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt G_EXEC rm -Rf /var/lib/apt/{lists,mirrors,periodic,cdroms.list} ;; 'disk') - G_EXEC_NOHALT=1 G_EXEC sed --follow-symlinks -i '/^Dir::State/d' "$fp" - [[ -d '/tmp/apt' ]] && G_EXEC rm -R /tmp/apt + G_EXEC sed --follow-symlinks -i '/^Dir::State/d' "$fp" + G_EXEC rm -Rf /tmp/apt ;; - *) :;; + *) Unknown_Input_Additional 1;; esac;; 'archives') case $INPUT_ADDITIONAL_1 in 'ram') - # Cache needs to be in RAM as well for this to work reliable - G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" + G_CONFIG_INJECT 'Dir::Cache[[:blank:]]' 'Dir::Cache "/tmp/apt";' "$fp" # Cache needs to be in RAM as well for this to work reliable G_CONFIG_INJECT 'Dir::Cache::archives[[:blank:]]' 'Dir::Cache::archives "/tmp/apt/archives";' "$fp" [[ -d '/var/cache/apt' ]] && G_EXEC rm -R /var/cache/apt ;; @@ -199,14 +203,16 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt [[ -d '/tmp/apt/archives' ]] && G_EXEC rm -R /tmp/apt/archives ;; - *) :;; + *) Unknown_Input_Additional 1;; esac;; 'compress') case $INPUT_ADDITIONAL_1 in - 1|'enable') [[ -f '/etc/apt/apt.conf.d/98dietpi-nocompress' ]] && G_EXEC rm "$fp_compress";; + 1|'enable') G_EXEC rm -f "$fp_compress";; 0|'disable') echo -e '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit this setting.\nAcquire::GzipIndexes "false";' > "$fp_compress";; + *) Unknown_Input_Additional 1;; esac;; - *) :;; + 'reset') :;; + *) Unknown_Input_Mode;; esac [[ -f $fp ]] || return 0 From 38bf84a302e8d636ebdedde8f48e5345525c3cf6 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2024 21:17:36 +0100 Subject: [PATCH 55/77] v9.0 - DietPi-Set_software | apt: Minor output tweak --- dietpi/func/dietpi-set_software | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 84bf2eaa5e..c72255fb48 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -208,7 +208,10 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt 'compress') case $INPUT_ADDITIONAL_1 in 1|'enable') G_EXEC rm -f "$fp_compress";; - 0|'disable') echo -e '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit this setting.\nAcquire::GzipIndexes "false";' > "$fp_compress";; + 0|'disable') + echo '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit this setting.' > "$fp_compress";; + G_CONFIG_INJECT 'Acquire::GzipIndexes[[:blank:]]' 'Acquire::GzipIndexes "false";' "$fp_compress" + ;; *) Unknown_Input_Additional 1;; esac;; 'reset') :;; From 113e476220b0a12a2e9068d9c53daebe7b4333bc Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 15 Jan 2024 21:23:12 +0100 Subject: [PATCH 56/77] v9.0 - DietPi-Set_software | Syntax --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index c72255fb48..50f6825491 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -209,7 +209,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt case $INPUT_ADDITIONAL_1 in 1|'enable') G_EXEC rm -f "$fp_compress";; 0|'disable') - echo '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit this setting.' > "$fp_compress";; + echo '# Please use "dietpi-config" > "Advanded Options" > "APT" to edit this setting.' > "$fp_compress" G_CONFIG_INJECT 'Acquire::GzipIndexes[[:blank:]]' 'Acquire::GzipIndexes "false";' "$fp_compress" ;; *) Unknown_Input_Additional 1;; From adbe791c2e5222b36e1c8c32503271d130ada851 Mon Sep 17 00:00:00 2001 From: Joulinar <47155374+Joulinar@users.noreply.github.com> Date: Wed, 17 Jan 2024 21:32:13 +0100 Subject: [PATCH 57/77] v9.0 (#6863) - DietPi-Update | Nextcloud Apache configuration update for Nextcloud, pull the correct configuration --- .update/patches | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.update/patches b/.update/patches index bab2c247ff..be2284e30e 100755 --- a/.update/patches +++ b/.update/patches @@ -1552,7 +1552,7 @@ Patch_9_0() if [[ -f '/etc/apache2/sites-available/dietpi-nextcloud.conf' ]] then G_EXEC mv /etc/apache2/sites-available/dietpi-nextcloud.conf /etc/apache2/sites-available/dietpi-nextcloud.conf.dietpi-old - G_EXEC curl -sSfo /etc/apache2/sites-available/dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/lighttpd.nextcloud.conf" + G_EXEC curl -sSfo /etc/apache2/sites-available/dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/apache.nextcloud.conf" [[ -f '/etc/apache2/sites-available/dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/apache2/sites-available/dietpi-nextcloud.conf.dietpi-new fi # - Lighttpd From 457347346d851eefd66cce9a6abba06b5f71a457 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 19:31:45 +0100 Subject: [PATCH 58/77] v9.0 - DietPi-Config | Add a menu option for RPi to select/deselect optional kernel packages to be installed/removed - dietpi-rpi-firmware-migration | Use new kernel choice dialogue instead of installing all available kernel packages --- .meta/dietpi-rpi-firmware-migration | 16 +----- dietpi/dietpi-config | 16 ++++-- dietpi/func/dietpi-set_software | 81 +++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 19 deletions(-) diff --git a/.meta/dietpi-rpi-firmware-migration b/.meta/dietpi-rpi-firmware-migration index 78a684ba4d..2130d28158 100644 --- a/.meta/dietpi-rpi-firmware-migration +++ b/.meta/dietpi-rpi-firmware-migration @@ -41,20 +41,8 @@ G_EXEC umount rootfs G_EXEC ln -sf firmware/cmdline.txt /boot/cmdline.txt G_EXEC ln -sf firmware/config.txt /boot/config.txt -# Install new firmware packages -apackages=('linux-image-rpi-v8') -if [[ $(dpkg --print-architecture) == 'armhf' ]] -then - apackages+=('linux-image-rpi-v6' 'linux-image-rpi-v7' 'linux-image-rpi-v7l') - dpkg-query -s 'raspberrypi-kernel-headers' &> /dev/null && apackages+=('linux-headers-rpi-v6' 'linux-headers-rpi-v7' 'linux-headers-rpi-v7l') - # Add foreign arm64 arch until the 64-bit kernel package has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 - G_EXEC dpkg --add-architecture arm64 -else - apackages+=('linux-image-rpi-2712') - dpkg-query -s 'raspberrypi-kernel-headers' &> /dev/null && apackages+=('linux-headers-rpi-v8' 'linux-headers-rpi-2712') -fi -G_AGUP -G_AGI "${apackages[@]}" raspi-firmware raspi-utils +# Show kernel choice dialogue: This installs the required kernel and firmware packages and allows to select optional kernel packages for other RPi models. +/boot/dietpi/func/dietpi-set_software rpi_kernel_choice 'dietpi-rpi-firmware-migration' # Remove old firmware packages G_AGP raspberrypi-kernel raspberrypi-headers-kernel raspberrypi-bootloader libraspberrypi-bin libraspberrypi0 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 1bd445f21a..3ec857e91a 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1054,8 +1054,8 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the G_WHIP_MENU_ARRAY+=('Update MMC bootloader' ": Flash current U-Boot to $rootdev") fi - # RPi4 EEPROM update: https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md - if (( $G_HW_MODEL == 4 )) + # RPi 4/5 EEPROM update: https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md + if [[ $G_HW_MODEL == [45] ]] then if dpkg -s 'rpi-eeprom' &> /dev/null then @@ -1063,9 +1063,9 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the # shellcheck disable=SC1091 . ./version_eeprom rm version_eeprom - G_WHIP_MENU_ARRAY+=('Update RPi4 EEPROM firmware' ": [Bootloader: ${BOOTLOADER_CURRENT:-N/A} | VL805: ${VL805_CURRENT:-N/A}]") + G_WHIP_MENU_ARRAY+=('Update RPi EEPROM firmware' ": [Bootloader: ${BOOTLOADER_CURRENT:-N/A} | VL805: ${VL805_CURRENT:-N/A}]") else - G_WHIP_MENU_ARRAY+=('Update RPi4 EEPROM firmware' ': Install rpi-eeprom APT package') + G_WHIP_MENU_ARRAY+=('Update RPi EEPROM firmware' ': Install rpi-eeprom APT package') fi # ROCK 4, ROCK 5B and Orange Pi 5 (Plus): https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457 @@ -1126,6 +1126,9 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the (( $rpi3_usb_boot_bit_enabled )) && rpi3_usb_boot_bit_text='On' G_WHIP_MENU_ARRAY+=('USB boot support' ": [$rpi3_usb_boot_bit_text]") fi + + # Kernel choice: Requires finished firmware migration + dpkg-query -s 'raspi-firmware' &> /dev/null && G_WHIP_MENU_ARRAY+=('RPi kernel choice' ': Select/deselect optional kernel packages') fi G_WHIP_MENU 'Please select an option:' || { Back_or_Exit 0; return 0; } # Main menu @@ -1194,7 +1197,7 @@ Please choose whether your device have an active RTC or requires "fake-hwclock": fi - elif [[ $G_WHIP_RETURNED_VALUE == 'Update RPi4 EEPROM firmware' ]]; then + elif [[ $G_WHIP_RETURNED_VALUE == 'Update RPi EEPROM firmware' ]]; then G_WHIP_YESNO '[ INFO ] EEPROM firmware update \nThis will, if required, install or upgrade the rpi-eeprom APT package and update bootloader and VL805 USB firmware on the RPi4 EEPROM. @@ -1301,6 +1304,9 @@ Latest release notes: https://github.com/starfive-tech/VisionFive2/releases /boot/dietpi/func/dietpi-set_hardware rpi3_usb_boot enable && REBOOT_REQUIRED=1 + elif [[ $G_WHIP_RETURNED_VALUE == 'RPi kernel choice' ]] + then + /boot/dietpi/func/dietpi-set_software rpi_kernel_choice fi } diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 50f6825491..9385f9a965 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -24,6 +24,7 @@ $FP_SCRIPT passwords NULL=Prompt user to change DietPi related passwords | X=o $FP_SCRIPT boot_wait_for_network [01] Enable or disable waiting for network interface configuration before DietPi-PostBoot is started, including postboot.d custom scripts and service startups $FP_SCRIPT add_ssh_pubkeys $FP_SCRIPT disable_ssh_password_logins [01]|root| Whether to disable SSH password logins for all users or root only; Leave empty to apply setting from /boot/dietpi.txt +$FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on Raspberry Pi only " #//////////////////////////////////// # Inputs @@ -68,6 +69,13 @@ $FP_SCRIPT disable_ssh_password_logins [01]|root| Whether to disable SSH echo "$AVAIABLE_COMMANDS" } + Unsupported_Input_Name() + { + EXIT_CODE=1 + G_DIETPI-NOTIFY 2 "Unsupported input command ($INPUT_MODE_NAME) for Debian ${G_DISTRO_NAME^} on $G_HW_MODEL_NAME. Nothing has been applied." + echo "$AVAIABLE_COMMANDS" + } + #///////////////////////////////////////////////////////////////////////////////////// # locale #///////////////////////////////////////////////////////////////////////////////////// @@ -590,6 +598,78 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt G_CONFIG_INJECT 'SOFTWARE_DISABLE_SSH_PASSWORD_LOGINS=' "SOFTWARE_DISABLE_SSH_PASSWORD_LOGINS=$INPUT_MODE_VALUE" /boot/dietpi.txt } + #///////////////////////////////////////////////////////////////////////////////////// + # rpi_kernel_choice + #///////////////////////////////////////////////////////////////////////////////////// + # $1='dietpi-rpi-firmware-migration': Passed by our firmware migration script to allow kernel selection prior to raspi-firmware install + RPi_Kernel_Choice() + { + # Raspberry Pi Bookworm only + (( $G_HW_MODEL > 9 || $G_DISTRO < 7 )) && { Unsupported_Input_Name; return 1; } + + # Requires firmware migration to be completed, or dietpi-rpi-firmware-migration flag + [[ $INPUT_MODE_VALUE == 'dietpi-rpi-firmware-migration' ]] || dpkg-query -s 'raspi-firmware' || { G_WHIP_MSG '[FAILED] Raspberry Pi firmware migration not completed +\nThe Raspberry Pi kernel choice requires a migration to the new firmware packages to be completed. Details about how to apply the migration can be found here: +- https://github.com/MichaIng/DietPi/issues/6676'; return 1; } + + # Obtain required kernel packages + local image_arch=$(dpkg --print-architecture) + local kernel_version=$(uname -r) + local kernel_variant=${kernel_version##*-} + [[ $kernel_variant == "$kernel_version" ]] && kernel_variant='v6' # Old ARMv6 kernel has no dash-separated suffix + local kernel_package= + case $kernel_variant in + 'v6') kernel_package='linux-image-rpi-v6';; + 'v7'|'v7+') kernel_package='linux-image-rpi-v7';; + 'v7l'|'v7l+') kernel_package='linux-image-rpi-v7l';; + 'v8'|'v8+') kernel_package='linux-image-rpi-v8';; + '2712'|'16k+') kernel_package='linux-image-rpi-2712';; # rpi-update suffixes differ: https://github.com/raspberrypi/rpi-firmware/tree/master/modules + *) { G_WHIP_MSG "[FAILED] No supported kernel variant detected +\nYou do not seem to use a kernel which we match without doubt with a certain new kernel package: +- $(uname -a) +\nYou may report this at our GitHub page or community forum: +- https://github.com/MichaIng/DietPi +- https://dietpi.com/forum/"; return 1; };; + esac + + G_WHIP_CHECKLIST_ARRAY=() + local status= + dpkg-query -s 'linux-image-rpi-v6' && status='on' || status='off' + [[ $kernel_package == 'linux-image-rpi-v6' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 1/Zero (1)' "$status") + dpkg-query -s 'linux-image-rpi-v7' && status='on' || status='off' + [[ $kernel_package == 'linux-image-rpi-v7' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 2/3/Zero 2 32-bit' "$status") + dpkg-query -s 'linux-image-rpi-v7l' && status='on' || status='off' + [[ $kernel_package == 'linux-image-rpi-v7l' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 4/5 32-bit' "$status") + dpkg-query -s 'linux-image-rpi-v8' && status='on' || status='off' + [[ $kernel_package == 'linux-image-rpi-v8' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 2-5 64-bit' "$status") + dpkg-query -s 'linux-image-rpi-2712' && status='on' || status='off' + [[ $kernel_package == 'linux-image-rpi-2712' || $image_arch == 'armhf' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 5 64-bit' "$status") + + G_WHIP_CHECKLIST "Based on your currently used kernel variant, the $kernel_package package will be installed. +\nOptionally, you can select/deselect additional kernel packages below, in case you want to boot this image from another Raspberry Pi model as well. +\nNote the following: +- The Raspberry Pi 4 and 5 models use the 64-bit kernel by default, even when using a 32-bit image, unless you explicitly define arm_64bit=0 in /boot/config.txt. +- All other Raspberry Pi models use the 32-bit kernel on 32-bit images, and the 64-bit kernel on 64-bit images, or when you explicitly define arm_64bit=1 in /boot/config.txt." || { EXIT_CODE=1; return 1; } + + local i j to_install=() to_remove=() + for i in 'linux-image-rpi-v6' 'linux-image-rpi-v7' 'linux-image-rpi-v7l' 'linux-image-rpi-v8' 'linux-image-rpi-2712' + do + [[ $i == "$kernel_package" ]] && continue + for j in $G_WHIP_RETURNED_VALUE + do + # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 + [[ $j == 'linux-image-rpi-v8' && $image_arch == 'armhf' ]] && G_EXEC dpkg --add-architecture arm64 + [[ $j == $i ]] && to_install+=("$j") || to_remove+=("j") + done + done + + # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 + [[ $kernel_package == 'linux-image-rpi-v8' && $image_arch == 'armhf' ]] && G_EXEC dpkg --add-architecture arm64 + + G_AGI "$kernel_package" "${to_install[@]}" raspi-firmware raspi-utils + G_AGP "${to_remove[@]}" + } + #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// @@ -608,6 +688,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt 'boot_wait_for_network') Boot_Wait_For_Network;; 'add_ssh_pubkeys') Add_SSH_Pubkeys;; 'disable_ssh_password_logins') Disable_SSH_Password_Logins;; + 'rpi_kernel_choice') RPi_Kernel_Choice;; *) Unknown_Input_Name;; esac #----------------------------------------------------------------------------------- From 9f90a444e8f77dd54f107f2d074e4e9fac3a1da4 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 19:36:53 +0100 Subject: [PATCH 59/77] v9.0 - DietPi-Set_software | Harden coding (shellcheck) --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 9385f9a965..0d400ac343 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -659,7 +659,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt do # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 [[ $j == 'linux-image-rpi-v8' && $image_arch == 'armhf' ]] && G_EXEC dpkg --add-architecture arm64 - [[ $j == $i ]] && to_install+=("$j") || to_remove+=("j") + [[ $j == "$i" ]] && to_install+=("$j") || to_remove+=("j") done done From 2d9fddacabbcba46846e6afbe00ac3421cd3fee8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 20:10:53 +0100 Subject: [PATCH 60/77] v9.0 - DietPi-Config | Mute dpkg-query output --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 0d400ac343..bc3b7a7d8c 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -608,7 +608,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt (( $G_HW_MODEL > 9 || $G_DISTRO < 7 )) && { Unsupported_Input_Name; return 1; } # Requires firmware migration to be completed, or dietpi-rpi-firmware-migration flag - [[ $INPUT_MODE_VALUE == 'dietpi-rpi-firmware-migration' ]] || dpkg-query -s 'raspi-firmware' || { G_WHIP_MSG '[FAILED] Raspberry Pi firmware migration not completed + [[ $INPUT_MODE_VALUE == 'dietpi-rpi-firmware-migration' ]] || dpkg-query -s 'raspi-firmware' &> /dev/null || { G_WHIP_MSG '[FAILED] Raspberry Pi firmware migration not completed \nThe Raspberry Pi kernel choice requires a migration to the new firmware packages to be completed. Details about how to apply the migration can be found here: - https://github.com/MichaIng/DietPi/issues/6676'; return 1; } From 711538e1a21f53bf86fa6bf9997f6f06d7bac990 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 20:17:35 +0100 Subject: [PATCH 61/77] v9.0 - dietpi-rpi-firmware-migration | Require a selection from the kernel choice dialogue --- .meta/dietpi-rpi-firmware-migration | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.meta/dietpi-rpi-firmware-migration b/.meta/dietpi-rpi-firmware-migration index 2130d28158..501560d9fc 100644 --- a/.meta/dietpi-rpi-firmware-migration +++ b/.meta/dietpi-rpi-firmware-migration @@ -42,7 +42,7 @@ G_EXEC ln -sf firmware/cmdline.txt /boot/cmdline.txt G_EXEC ln -sf firmware/config.txt /boot/config.txt # Show kernel choice dialogue: This installs the required kernel and firmware packages and allows to select optional kernel packages for other RPi models. -/boot/dietpi/func/dietpi-set_software rpi_kernel_choice 'dietpi-rpi-firmware-migration' +until /boot/dietpi/func/dietpi-set_software rpi_kernel_choice 'dietpi-rpi-firmware-migration'; do G_WHIP_MSG '[ INFO ] A selection is required!'; done # Remove old firmware packages G_AGP raspberrypi-kernel raspberrypi-headers-kernel raspberrypi-bootloader libraspberrypi-bin libraspberrypi0 From 1fc159c89a40d17852add2867a44383c82597017 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 20:20:44 +0100 Subject: [PATCH 62/77] v9.0 - DietPi-Config | Mute all dpkg-query output and "error" output if the checklist is exited --- dietpi/func/dietpi-set_software | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index bc3b7a7d8c..475de88958 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -634,22 +634,22 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt G_WHIP_CHECKLIST_ARRAY=() local status= - dpkg-query -s 'linux-image-rpi-v6' && status='on' || status='off' + dpkg-query -s 'linux-image-rpi-v6' &> /dev/null && status='on' || status='off' [[ $kernel_package == 'linux-image-rpi-v6' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 1/Zero (1)' "$status") - dpkg-query -s 'linux-image-rpi-v7' && status='on' || status='off' + dpkg-query -s 'linux-image-rpi-v7' &> /dev/null && status='on' || status='off' [[ $kernel_package == 'linux-image-rpi-v7' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 2/3/Zero 2 32-bit' "$status") - dpkg-query -s 'linux-image-rpi-v7l' && status='on' || status='off' + dpkg-query -s 'linux-image-rpi-v7l' &> /dev/null && status='on' || status='off' [[ $kernel_package == 'linux-image-rpi-v7l' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 4/5 32-bit' "$status") - dpkg-query -s 'linux-image-rpi-v8' && status='on' || status='off' + dpkg-query -s 'linux-image-rpi-v8' &> /dev/null && status='on' || status='off' [[ $kernel_package == 'linux-image-rpi-v8' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 2-5 64-bit' "$status") - dpkg-query -s 'linux-image-rpi-2712' && status='on' || status='off' + dpkg-query -s 'linux-image-rpi-2712' &> /dev/null && status='on' || status='off' [[ $kernel_package == 'linux-image-rpi-2712' || $image_arch == 'armhf' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 5 64-bit' "$status") G_WHIP_CHECKLIST "Based on your currently used kernel variant, the $kernel_package package will be installed. \nOptionally, you can select/deselect additional kernel packages below, in case you want to boot this image from another Raspberry Pi model as well. \nNote the following: - The Raspberry Pi 4 and 5 models use the 64-bit kernel by default, even when using a 32-bit image, unless you explicitly define arm_64bit=0 in /boot/config.txt. -- All other Raspberry Pi models use the 32-bit kernel on 32-bit images, and the 64-bit kernel on 64-bit images, or when you explicitly define arm_64bit=1 in /boot/config.txt." || { EXIT_CODE=1; return 1; } +- All other Raspberry Pi models use the 32-bit kernel on 32-bit images, and the 64-bit kernel on 64-bit images, or when you explicitly define arm_64bit=1 in /boot/config.txt." || exit 1 local i j to_install=() to_remove=() for i in 'linux-image-rpi-v6' 'linux-image-rpi-v7' 'linux-image-rpi-v7l' 'linux-image-rpi-v8' 'linux-image-rpi-2712' From df1a7a4bb3e24f61fbc10461d33a3ea80d0942d8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 21:40:29 +0100 Subject: [PATCH 63/77] v9.0 - Raspberry Pi 5 | Batch of changes for Raspberry Pi 5 support - DietPi-Config | Fix kernel package names in menu --- dietpi/dietpi-config | 8 ++++---- dietpi/dietpi-software | 4 ++-- dietpi/func/dietpi-set_hardware | 4 ++-- dietpi/func/dietpi-set_software | 10 +++++----- rootfs/var/lib/dietpi/services/dietpi-firstboot.bash | 11 ++++++++++- 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 3ec857e91a..c7f493b889 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1389,11 +1389,11 @@ Latest release notes: https://github.com/starfive-tech/VisionFive2/releases local temp_limit=$(sed -n '/^[[:blank:]]*temp_limit=/{s/^[^=]*=//p;q}' /boot/config.txt) G_WHIP_MENU_ARRAY+=('ARM Temp Limit' ": [${temp_limit:=85}'c]") - # RPi 4 only - if (( $G_HW_MODEL == 4 )) + # RPi 4/5 only + if (( $G_HW_MODEL > 3 )) then local arm_freq_min=$(sed -n '/^[[:blank:]]*arm_freq_min=/{s/^[^=]*=//p;q}' /boot/config.txt) - [[ $arm_freq_min ]] || arm_freq_min=600 # 700 on RPi1+Zero else 600 + [[ $arm_freq_min ]] || { (( $G_HW_MODEL == 5 )) && arm_freq_min=1500 || arm_freq_min=600; } # 1500 on RPi 5, 700 on RPi1+Zero else 600 G_WHIP_MENU_ARRAY+=('ARM Idle Frequency' ": [$arm_freq_min MHz]") # https://github.com/MichaIng/DietPi/issues/3690 fi @@ -3067,7 +3067,7 @@ Additional benchmarks: -e '/^[[:blank:]]*over_voltage_min=/c\#over_voltage_min=0' \ -e "/^[[:blank:]]*arm_freq=/c\#arm_freq=$arm_freq_default" \ -e "/^[[:blank:]]*core_freq=/c\#core_freq=$core_freq_default" /boot/config.txt - (( $G_HW_MODEL == 4 )) || sed --follow-symlinks -i "/^[[:blank:]]*sdram_freq=/c\#sdram_freq=$sdram_freq_default" /boot/config.txt + (( $G_HW_MODEL > 3 )) || sed --follow-symlinks -i "/^[[:blank:]]*sdram_freq=/c\#sdram_freq=$sdram_freq_default" /boot/config.txt REBOOT_REQUIRED=1 } diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index b7a7f1746f..a47f63041c 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -14527,8 +14527,8 @@ _EOF_ then /boot/dietpi/func/dietpi-set_hardware qga 1 - # RPi4 EEPROM update: https://github.com/MichaIng/DietPi/issues/3217 - elif (( $G_HW_MODEL == 4 )) + # RPi 4/5 EEPROM update: https://github.com/MichaIng/DietPi/issues/3217 + elif [[ $G_HW_MODEL == [45] ]] then /boot/dietpi/func/dietpi-set_hardware rpi-eeprom fi diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 7480021f9d..07a02c6215 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -215,7 +215,7 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// RPi_EEPROM() { - (( $G_HW_MODEL == 4 )) || { Unsupported_Input_Name; return 1; } # Exit path for non-RPi4 + (( $G_HW_MODEL > 3 )) || { Unsupported_Input_Name; return 1; } # Exit path for non-RPi 4/5 # Install required APT package G_AG_CHECK_INSTALL_PREREQ rpi-eeprom @@ -1961,7 +1961,7 @@ _EOF_ G_EXEC sed --follow-symlinks -i '/root=/s/$/ snd_bcm2835.enable_headphones=0/' /boot/cmdline.txt # Force HDMI audio via config.txt option G_CONFIG_INJECT 'hdmi_drive=' 'hdmi_drive=2' /boot/config.txt - (( $G_HW_MODEL == 4 )) && G_CONFIG_INJECT 'hdmi_drive:1=' 'hdmi_drive:1=2' /boot/config.txt 'hdmi_drive=' + (( $G_HW_MODEL > 3 )) && G_CONFIG_INJECT 'hdmi_drive:1=' 'hdmi_drive:1=2' /boot/config.txt 'hdmi_drive=' fi # Enable full KMS HDMI audio if onboard HDMI is not disabled diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 475de88958..41f6238ba8 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -635,15 +635,15 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt G_WHIP_CHECKLIST_ARRAY=() local status= dpkg-query -s 'linux-image-rpi-v6' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v6' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 1/Zero (1)' "$status") + [[ $kernel_package == 'linux-image-rpi-v6' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v6' 'Raspberry Pi 1/Zero (1)' "$status") dpkg-query -s 'linux-image-rpi-v7' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v7' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 2/3/Zero 2 32-bit' "$status") + [[ $kernel_package == 'linux-image-rpi-v7' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v7' 'Raspberry Pi 2/3/Zero 2 32-bit' "$status") dpkg-query -s 'linux-image-rpi-v7l' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v7l' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 4/5 32-bit' "$status") + [[ $kernel_package == 'linux-image-rpi-v7l' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v7l' 'Raspberry Pi 4/5 32-bit' "$status") dpkg-query -s 'linux-image-rpi-v8' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v8' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 2-5 64-bit' "$status") + [[ $kernel_package == 'linux-image-rpi-v8' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v8' 'Raspberry Pi 2-5 64-bit' "$status") dpkg-query -s 'linux-image-rpi-2712' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-2712' || $image_arch == 'armhf' ]] || G_WHIP_CHECKLIST_ARRAY+=("$kernel_package" 'Raspberry Pi 5 64-bit' "$status") + [[ $kernel_package == 'linux-image-rpi-2712' || $image_arch == 'armhf' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-2712' 'Raspberry Pi 5 64-bit' "$status") G_WHIP_CHECKLIST "Based on your currently used kernel variant, the $kernel_package package will be installed. \nOptionally, you can select/deselect additional kernel packages below, in case you want to boot this image from another Raspberry Pi model as well. diff --git a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash index 152d127a95..1318f83024 100755 --- a/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash +++ b/rootfs/var/lib/dietpi/services/dietpi-firstboot.bash @@ -75,7 +75,7 @@ then sed --follow-symlinks -i '/^#over_voltage=/c\#over_voltage=0' /boot/config.txt sed --follow-symlinks -i '/^#core_freq=/c\#core_freq=500' /boot/config.txt - sed --follow-symlinks -i '/^#sdram_freq=/d' /boot/config.txt # Not supported on RPi4, defaults to 3200 MHz + sed --follow-symlinks -i '/^#sdram_freq=/d' /boot/config.txt # Not supported on RPi 4, defaults to 3200 MHz grep -q '^temp_limit=65$' /boot/config.txt && G_CONFIG_INJECT 'temp_limit=' 'temp_limit=75' /boot/config.txt # https://github.com/MichaIng/DietPi/issues/3019 # 400 @@ -85,6 +85,15 @@ else sed --follow-symlinks -i '/^#arm_freq=/c\#arm_freq=1500' /boot/config.txt fi + + # RPi 5 + elif (( $G_HW_MODEL == 5 )) + then + sed --follow-symlinks -i '/^#over_voltage=/c\#over_voltage=0' /boot/config.txt + sed --follow-symlinks -i '/^#arm_freq=/c\#arm_freq=2400' /boot/config.txt + sed --follow-symlinks -i '/^#core_freq=/c\#core_freq=910' /boot/config.txt + sed --follow-symlinks -i '/^#sdram_freq=/d' /boot/config.txt # Not supported on RPi 5, defaults to 4267 MHz + grep -q '^temp_limit=65$' /boot/config.txt && G_CONFIG_INJECT 'temp_limit=' 'temp_limit=75' /boot/config.txt # https://github.com/MichaIng/DietPi/issues/3019 fi } From 8cd76d9d7e08a42e677f63d2491fc23aeeda0494 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 21:44:38 +0100 Subject: [PATCH 64/77] v9.0 - DietPi-Config | Fix default idle CPU frequency shown for Raspberry Pi 5 --- dietpi/dietpi-config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index c7f493b889..be41ceaee6 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1639,7 +1639,8 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will 'ARM Idle Frequency') - MIN_VALUE=300 DEF_VALUE=600 + MIN_VALUE=300 + (( $G_HW_MODEL == 5 )) && DEF_VALUE=1500 || DEF_VALUE=600 G_WHIP_DEFAULT_ITEM=$arm_freq_min if G_WHIP_INPUTBOX "ARM frequency (MHz) used by CPU governors powersave and schedutil/ondemand/conservative when on idle. - Current value: $arm_freq_min\n - Recommended value: 300\n - Minimum value: $MIN_VALUE From 244e35951da8650675a0f1c0b6c6c8496fb46fcb Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 21:51:58 +0100 Subject: [PATCH 65/77] v9.0 - DietPi-Config | Purge old kernel/firmware packages on kernel choice, instead of in migration script --- .meta/dietpi-rpi-firmware-migration | 3 --- dietpi/dietpi-config | 2 +- dietpi/func/dietpi-set_software | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.meta/dietpi-rpi-firmware-migration b/.meta/dietpi-rpi-firmware-migration index 501560d9fc..e9b20c7e3a 100644 --- a/.meta/dietpi-rpi-firmware-migration +++ b/.meta/dietpi-rpi-firmware-migration @@ -44,9 +44,6 @@ G_EXEC ln -sf firmware/config.txt /boot/config.txt # Show kernel choice dialogue: This installs the required kernel and firmware packages and allows to select optional kernel packages for other RPi models. until /boot/dietpi/func/dietpi-set_software rpi_kernel_choice 'dietpi-rpi-firmware-migration'; do G_WHIP_MSG '[ INFO ] A selection is required!'; done -# Remove old firmware packages -G_AGP raspberrypi-kernel raspberrypi-headers-kernel raspberrypi-bootloader libraspberrypi-bin libraspberrypi0 - # Remove obsolete files G_EXEC rm -Rf /boot/firmware/{dietpi*,COPYING.linux} diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index be41ceaee6..28231fd14c 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1347,7 +1347,7 @@ Latest release notes: https://github.com/starfive-tech/VisionFive2/releases G_WHIP_MENU_ARRAY=() # RPi: Overclocking - (( $G_HW_MODEL < 10 )) && G_WHIP_MENU_ARRAY+=('Overclocking' ': Set Profile') + (( $G_HW_MODEL < 5 )) && G_WHIP_MENU_ARRAY+=('Overclocking' ': Set Profile') # CPU GOV G_WHIP_MENU_ARRAY+=('CPU Governor' ": [$current_cpu_governor]") diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 41f6238ba8..cbdaa6bedb 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -667,7 +667,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt [[ $kernel_package == 'linux-image-rpi-v8' && $image_arch == 'armhf' ]] && G_EXEC dpkg --add-architecture arm64 G_AGI "$kernel_package" "${to_install[@]}" raspi-firmware raspi-utils - G_AGP "${to_remove[@]}" + G_AGP "${to_remove[@]}" raspberrypi-kernel raspberrypi-headers-kernel raspberrypi-bootloader libraspberrypi-bin libraspberrypi0 } #///////////////////////////////////////////////////////////////////////////////////// From be1405506bfe8ef93f8d973cef055434b11b6c9d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 21:53:07 +0100 Subject: [PATCH 66/77] v9.0 - DietPi-Config | Typo --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index cbdaa6bedb..81356afc1a 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -659,7 +659,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt do # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 [[ $j == 'linux-image-rpi-v8' && $image_arch == 'armhf' ]] && G_EXEC dpkg --add-architecture arm64 - [[ $j == "$i" ]] && to_install+=("$j") || to_remove+=("j") + [[ $j == "$i" ]] && to_install+=("$j") || to_remove+=("$j") done done From 76e63b88a69f63170630146bfa875fb2914a639d Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 22:05:17 +0100 Subject: [PATCH 67/77] v9.0 - DietPi-Config | Fix kernel package removal in RPi kernel choice menu --- dietpi/func/dietpi-set_software | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 81356afc1a..437a38d284 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -659,8 +659,9 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt do # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 [[ $j == 'linux-image-rpi-v8' && $image_arch == 'armhf' ]] && G_EXEC dpkg --add-architecture arm64 - [[ $j == "$i" ]] && to_install+=("$j") || to_remove+=("$j") + [[ $j == "$i" ]] && to_install+=("$i") && continue done + to_remove+=("$i") done # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 From 1c6f87efac9251aaedc4ea16dff44035303daed0 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 22:54:55 +0100 Subject: [PATCH 68/77] v9.0 - DietPi-Config | Further kernel choice menu fixes --- dietpi/func/dietpi-set_software | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 437a38d284..50d54470bb 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -634,18 +634,21 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt G_WHIP_CHECKLIST_ARRAY=() local status= - dpkg-query -s 'linux-image-rpi-v6' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v6' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v6' 'Raspberry Pi 1/Zero (1)' "$status") - dpkg-query -s 'linux-image-rpi-v7' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v7' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v7' 'Raspberry Pi 2/3/Zero 2 32-bit' "$status") - dpkg-query -s 'linux-image-rpi-v7l' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v7l' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v7l' 'Raspberry Pi 4/5 32-bit' "$status") + if [[ $image_arch == 'armhf' ]] + then + dpkg-query -s 'linux-image-rpi-v6' &> /dev/null && status='on' || status='off' + [[ $kernel_package == 'linux-image-rpi-v6' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v6' 'Raspberry Pi 1/Zero (1)' "$status") + dpkg-query -s 'linux-image-rpi-v7' &> /dev/null && status='on' || status='off' + [[ $kernel_package == 'linux-image-rpi-v7' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v7' 'Raspberry Pi 2/3/Zero 2 32-bit' "$status") + dpkg-query -s 'linux-image-rpi-v7l' &> /dev/null && status='on' || status='off' + [[ $kernel_package == 'linux-image-rpi-v7l' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v7l' 'Raspberry Pi 4/5 32-bit' "$status") + fi dpkg-query -s 'linux-image-rpi-v8' &> /dev/null && status='on' || status='off' [[ $kernel_package == 'linux-image-rpi-v8' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v8' 'Raspberry Pi 2-5 64-bit' "$status") dpkg-query -s 'linux-image-rpi-2712' &> /dev/null && status='on' || status='off' [[ $kernel_package == 'linux-image-rpi-2712' || $image_arch == 'armhf' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-2712' 'Raspberry Pi 5 64-bit' "$status") - G_WHIP_CHECKLIST "Based on your currently used kernel variant, the $kernel_package package will be installed. + G_WHIP_CHECKLIST "Based on your currently used kernel variant, the $kernel_package package will be kept/installed. \nOptionally, you can select/deselect additional kernel packages below, in case you want to boot this image from another Raspberry Pi model as well. \nNote the following: - The Raspberry Pi 4 and 5 models use the 64-bit kernel by default, even when using a 32-bit image, unless you explicitly define arm_64bit=0 in /boot/config.txt. @@ -657,9 +660,11 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt [[ $i == "$kernel_package" ]] && continue for j in $G_WHIP_RETURNED_VALUE do + [[ $j == "$i" ]] || continue # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 [[ $j == 'linux-image-rpi-v8' && $image_arch == 'armhf' ]] && G_EXEC dpkg --add-architecture arm64 - [[ $j == "$i" ]] && to_install+=("$i") && continue + to_install+=("$i") + continue 2 done to_remove+=("$i") done From 6cd596e87edb6a06e6865e26a537e39c1abe3e01 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 23:13:13 +0100 Subject: [PATCH 69/77] v9.0 - CHANGELOG | Add entry about RPi 5 and firmware migration script --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 506d9faf2f..dc81813125 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -9,6 +9,7 @@ New images: - Orange Pi Zero 3 | New images for the 1.5 GB RAM variant are now available for testing, before they are added to our download page soon: https://dietpi.com/downloads/binaries/testing/ Enhancements: +- Raspberry Pi | Further work has been done to better support the Raspberry Pi 5. Our firmware migration script to test it has been reworked to allow selecting/deselecting optional kernel packages, instead of always installing all of them: https://github.com/MichaIng/DietPi/issues/6676 - DietPi-Banner | Instead of "Freespace", the "Disk usage" is now shown, including the total disk size and used percent. Many thanks to @Andr3Carvalh0 for implementing this change: https://github.com/MichaIng/DietPi/pull/6837 - DietPi-Software | motionEye: Updated build dependencies for ARM and RISC-V, and switched to the recent pre-release from PyPI, instead of pulling from the repositories dev branch. - DietPi-Software | Moonlight (CLI/GUI): Moonlight has been enabled on Bookworm, as packages are now available. From bcd1164ad43779d04571ee924caf893f1ebdce33 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Thu, 18 Jan 2024 23:45:57 +0100 Subject: [PATCH 70/77] v9.0 - 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 6ad735c192..2e229069d2 100644 --- a/.update/version +++ b/.update/version @@ -3,7 +3,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=9 G_REMOTE_VERSION_SUB=0 -G_REMOTE_VERSION_RC=0 +G_REMOTE_VERSION_RC=1 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=7 G_MIN_VERSION_SUB=0 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 466f4fa5f6..4f6ba35801 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,7 +55,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=9 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 + [[ $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 d53811d96b433c09a93c59983308f28569b15f7a Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2024 15:41:42 +0100 Subject: [PATCH 71/77] v9.0 - RC up - Orange Pi 3B | Load WiFi/BT modules at boot when WiFi is enabled --- .update/version | 2 +- CHANGELOG.txt | 1 + dietpi/func/dietpi-globals | 2 +- dietpi/func/dietpi-set_hardware | 18 +++++++++--------- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.update/version b/.update/version index 2e229069d2..ecd150c4be 100644 --- a/.update/version +++ b/.update/version @@ -3,7 +3,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=9 G_REMOTE_VERSION_SUB=0 -G_REMOTE_VERSION_RC=1 +G_REMOTE_VERSION_RC=2 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=7 G_MIN_VERSION_SUB=0 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index dc81813125..21f7817db3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -16,6 +16,7 @@ Enhancements: - DietPi-Software | Logitech Media Server: Re-enabled it for Bookworm and Trixie, now using the latest "stable nightly" builds instead of the "latest releases". Many thanks to @SteveInWA for informing us about the update: https://github.com/MichaIng/DietPi/discussions/6847 Bug fixes: +- Orange Pi 3B | Resolved an issue where onboard WiFi and Bluetooth did not work because the related kernel module was not loaded. Many thanks to @jake5253 for reporting this: https://github.com/MichaIng/DietPi/issues/6659#issuecomment-1887072641 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/6860 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 4f6ba35801..2f0fe36df9 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,7 +55,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=9 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=0 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=2 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 07a02c6215..39b83cc8f7 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1146,7 +1146,7 @@ _EOF_ 'btbcm' # RPi3 Broadcom onboard 'rfcomm' # BPi Pro/M2+ and others 'hidp' # BPi Pro/M2+ and others - 'sprdbt_tty' # Orange Pi Zero 3 + 'sprdbt_tty' # Orange Pi 3B/Zero 3 'hci_uart' ) @@ -1244,10 +1244,10 @@ Do you want to continue and disable the serial login console?' || return 1 then (( $G_HW_ONBOARD_WIFI )) && G_EXEC systemctl enable hciuart - # Orange Pi Zero 3 - elif (( $G_HW_MODEL == 83 )) + # Orange Pi 3B/Zero 3: Module does not load automatically + elif [[ $G_HW_MODEL =~ ^(83|87)$ ]] then - G_EXEC eval 'echo '\''sprdbt_tty'\'' > /etc/modules-load.d/dietpi-enable_bluetooth.conf' + modprobe -n sprdbt_tty 2> /dev/null && G_EXEC eval 'echo '\''sprdbt_tty'\'' > /etc/modules-load.d/dietpi-enable_bluetooth.conf' fi else @@ -1340,8 +1340,8 @@ Do you want to continue and disable the serial login console?' || return 1 then aWIFI_MODULES+=('bcmdhd') - # + Orange Pi Zero 3 - elif (( $G_HW_MODEL == 83 )) + # + Orange Pi 3B/Zero 3 + elif [[ $G_HW_MODEL =~ ^(83|87)$ ]] then aWIFI_MODULES+=('sprdwl_ng') fi @@ -1387,10 +1387,10 @@ Do you want to continue and disable the serial login console?' || return 1 then G_EXEC eval 'echo -e '\''options wlan_8192eu rtw_power_mgnt=0\noptions wlan_8812au rtw_power_mgnt=0'\'' > /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf' - # - Orange Pi Zero 3: Module does not load automatically - elif (( $G_HW_MODEL == 83 )) + # - Orange Pi 3B/Zero 3: Module does not load automatically + elif [[ $G_HW_MODEL =~ ^(83|87)$ ]] then - G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' + modprobe -n sprdwl_ng 2> /dev/null && G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' fi # Remove blacklists From 5f3742e1e61473947938b5881bd78ae0dbe0fbb0 Mon Sep 17 00:00:00 2001 From: StephanStS Date: Sat, 20 Jan 2024 16:08:02 +0100 Subject: [PATCH 72/77] v9.0 (#6867) - CHANGELOG | Fix testing image links --- CHANGELOG.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 21f7817db3..735f25c9fe 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,7 +6,7 @@ Breaking: - The minimum DietPi version to support direct updates to DietPi v9 from has been raised to v7.0. Older systems will go through a two-stage process, being upgraded to DietPi v8.25 with a separate branch, and afterwards further to DietPi v9 via master branch if the Debian version requirement is met as well. New images: -- Orange Pi Zero 3 | New images for the 1.5 GB RAM variant are now available for testing, before they are added to our download page soon: https://dietpi.com/downloads/binaries/testing/ +- Orange Pi Zero 3 | New images for the 1.5 GB RAM variant are now available for testing, before they are added to our download page soon: https://dietpi.com/downloads/images/testing/ Enhancements: - Raspberry Pi | Further work has been done to better support the Raspberry Pi 5. Our firmware migration script to test it has been reworked to allow selecting/deselecting optional kernel packages, instead of always installing all of them: https://github.com/MichaIng/DietPi/issues/6676 @@ -26,8 +26,8 @@ v8.25 (2023-12-16) New images: -- Star64 | Support for the RISC-V StarFive VisionFive 2 clone from PINE64 has been added to DietPi. The images are highly experimental, like software support for the architecture in general. Find our images here, before they are added to our download page soon: https://dietpi.com/downloads/binaries/testing/ -- Orange Pi 3B | Support for this RK3566 SBC has been added to DietPi. Find our images here, before they are added to our download page soon: https://dietpi.com/downloads/binaries/testing/ +- Star64 | Support for the RISC-V StarFive VisionFive 2 clone from PINE64 has been added to DietPi. The images are highly experimental, like software support for the architecture in general. Find our images here, before they are added to our download page soon: https://dietpi.com/downloads/images/testing/ +- Orange Pi 3B | Support for this RK3566 SBC has been added to DietPi. Find our images here, before they are added to our download page soon: https://dietpi.com/downloads/images/testing/ Enhancements: - Raspberry Pi | We applied preparations for supporting the new official Raspberry Pi firmware and kernel packages, which implies support for Raspberry Pi 5. A script allows to the migration to the new package set, including the switch for the boot mountpoint from /boot to /boot/firmware. Please see the following topic about how to apply the script. Note that it is in beta stage for now, since the change might cause issues among our scripts which we did not detect yet: https://github.com/MichaIng/DietPi/issues/6676 From 7368eea56467e6ed684546b462d8b62f874cca9b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2024 23:03:24 +0100 Subject: [PATCH 73/77] v9.0 - DietPi-Config | Split RPi kernel choice menu by OS/userland architecuture to make the description and choice simpler --- dietpi/func/dietpi-set_software | 92 ++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 35 deletions(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 50d54470bb..a768c46ccd 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -613,11 +613,10 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt - https://github.com/MichaIng/DietPi/issues/6676'; return 1; } # Obtain required kernel packages - local image_arch=$(dpkg --print-architecture) local kernel_version=$(uname -r) local kernel_variant=${kernel_version##*-} [[ $kernel_variant == "$kernel_version" ]] && kernel_variant='v6' # Old ARMv6 kernel has no dash-separated suffix - local kernel_package= + local kernel_package case $kernel_variant in 'v6') kernel_package='linux-image-rpi-v6';; 'v7'|'v7+') kernel_package='linux-image-rpi-v7';; @@ -633,44 +632,67 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt esac G_WHIP_CHECKLIST_ARRAY=() - local status= + local image_arch=$(dpkg --print-architecture) to_install=() to_remove=() if [[ $image_arch == 'armhf' ]] then - dpkg-query -s 'linux-image-rpi-v6' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v6' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v6' 'Raspberry Pi 1/Zero (1)' "$status") - dpkg-query -s 'linux-image-rpi-v7' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v7' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v7' 'Raspberry Pi 2/3/Zero 2 32-bit' "$status") - dpkg-query -s 'linux-image-rpi-v7l' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v7l' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v7l' 'Raspberry Pi 4/5 32-bit' "$status") - fi - dpkg-query -s 'linux-image-rpi-v8' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-v8' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-v8' 'Raspberry Pi 2-5 64-bit' "$status") - dpkg-query -s 'linux-image-rpi-2712' &> /dev/null && status='on' || status='off' - [[ $kernel_package == 'linux-image-rpi-2712' || $image_arch == 'armhf' ]] || G_WHIP_CHECKLIST_ARRAY+=('linux-image-rpi-2712' 'Raspberry Pi 5 64-bit' "$status") - - G_WHIP_CHECKLIST "Based on your currently used kernel variant, the $kernel_package package will be kept/installed. -\nOptionally, you can select/deselect additional kernel packages below, in case you want to boot this image from another Raspberry Pi model as well. -\nNote the following: -- The Raspberry Pi 4 and 5 models use the 64-bit kernel by default, even when using a 32-bit image, unless you explicitly define arm_64bit=0 in /boot/config.txt. -- All other Raspberry Pi models use the 32-bit kernel on 32-bit images, and the 64-bit kernel on 64-bit images, or when you explicitly define arm_64bit=1 in /boot/config.txt." || exit 1 - - local i j to_install=() to_remove=() - for i in 'linux-image-rpi-v6' 'linux-image-rpi-v7' 'linux-image-rpi-v7l' 'linux-image-rpi-v8' 'linux-image-rpi-2712' - do - [[ $i == "$kernel_package" ]] && continue - for j in $G_WHIP_RETURNED_VALUE + declare -A models=( + ['linux-image-rpi-v6']='Raspberry Pi 1/Zero (1)' + ['linux-image-rpi-v7']='Raspberry Pi 2/3/Zero 2' + ['linux-image-rpi-v8']='Raspberry Pi 4/5' + ) + if grep -q '^arm_64bit=1' /boot/config.txt + then + models['linux-image-rpi-v7']='Raspberry Pi 2 PCB v1.1' + models['linux-image-rpi-v8']='Raspberry Pi 2 PCB v1.2 and Raspberry Pi 3-5' + + elif grep -q '^arm_64bit=0' /boot/config.txt + then + unset -v models['linux-image-rpi-v8'] + models['linux-image-rpi-v7l']='Raspberry Pi 4/5' + fi + + local i status + for i in "${!models[@]}" do - [[ $j == "$i" ]] || continue - # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 - [[ $j == 'linux-image-rpi-v8' && $image_arch == 'armhf' ]] && G_EXEC dpkg --add-architecture arm64 - to_install+=("$i") - continue 2 + [[ $i == "$kernel_package" ]] && continue + dpkg-query -s "$i" &> /dev/null && status='on' || status='off' + G_WHIP_CHECKLIST_ARRAY+=("$i" "${models[$i]}" "$status") done - to_remove+=("$i") - done - # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 - [[ $kernel_package == 'linux-image-rpi-v8' && $image_arch == 'armhf' ]] && G_EXEC dpkg --add-architecture arm64 + G_WHIP_CHECKLIST "Based on your currently used kernel variant, the following package will be kept/installed: +\n- $kernel_package for ${models[$kernel_package]} +\nOptionally, you can select/deselect additional kernel packages below, in case you want to boot this image from other Raspberry Pi models:" || exit 1 + + local j + for i in "${!models[@]}" + do + [[ $i == "$kernel_package" ]] && continue + for j in $G_WHIP_RETURNED_VALUE + do + [[ $j == "$i" ]] || continue + # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 + [[ $j == 'linux-image-rpi-v8' ]] && G_EXEC dpkg --add-architecture arm64 + to_install+=("$i") + continue 2 + done + to_remove+=("$i") + done + + # Add foreign arm64 arch for 64-bit kernel until it has been added to the armhf repo: https://github.com/RPi-Distro/repo/issues/356 + [[ $kernel_package == 'linux-image-rpi-v8' ]] && G_EXEC dpkg --add-architecture arm64 + else + declare -A models=( + ['linux-image-rpi-v8']='Raspberry Pi 4/5' + ['linux-image-rpi-2712']='Raspberry Pi 5 only' + ) + local optional='linux-image-rpi-v8' + [[ $kernel_package == 'linux-image-rpi-v8' ]] && local optional='linux-image-rpi-2712' + + G_WHIP_BUTTON_OK_TEXT='Yes' G_WHIP_BUTTON_CANCEL_TEXT='No' G_WHIP_YESNO "Based on your currently used kernel variant, the following package will be kept/installed: +\n- $kernel_package for ${models[$kernel_package]} +\nDo you want to keep/install the following additional kernel package, to boot this image from other Raspberry Pi models? +\n- $optional for ${models[$optional]}" && to_install=("$optional") || to_remove=("$optional") + fi G_AGI "$kernel_package" "${to_install[@]}" raspi-firmware raspi-utils G_AGP "${to_remove[@]}" raspberrypi-kernel raspberrypi-headers-kernel raspberrypi-bootloader libraspberrypi-bin libraspberrypi0 From 618088dff27e9dfafe889819e8446de873787f78 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 20 Jan 2024 23:10:02 +0100 Subject: [PATCH 74/77] v9.0 - DietPi-Set_software | Satisfy shellcheck --- dietpi/func/dietpi-set_software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index a768c46ccd..09571ab505 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -647,7 +647,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt elif grep -q '^arm_64bit=0' /boot/config.txt then - unset -v models['linux-image-rpi-v8'] + unset -v 'models[linux-image-rpi-v8]' models['linux-image-rpi-v7l']='Raspberry Pi 4/5' fi From 1a35973f3d9fb63c183ee86d9fbe803566d5ea3f Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 21 Jan 2024 00:03:51 +0100 Subject: [PATCH 75/77] v9.0 - DietPi-Patches | Bump Star64/VisionFive 2/Quartz64 kernel versions and update vaultwarden - DietPi-Set_software | Fix compatible RPi models for v8 kernel variant on 64-bit userland --- .update/patches | 36 ++++++++++++++++----------------- dietpi/func/dietpi-set_software | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.update/patches b/.update/patches index be2284e30e..3c3968ce67 100755 --- a/.update/patches +++ b/.update/patches @@ -1477,21 +1477,6 @@ Patch_8_25() # Software updates and migrations if [[ -f '/boot/dietpi/.installed' ]] then - # vaultwarden - if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[183\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' vaultwarden 2> /dev/null)" lt 1.30.1-dietpi2 - then - # Pre-v8.7 cleanup - if [[ -f '/opt/vaultwarden/target/release/vaultwarden' ]] - then - G_EXEC rm -R /opt/vaultwarden - [[ -f '/etc/systemd/system/vaultwarden.service' ]] && G_EXEC rm /etc/systemd/system/vaultwarden.service - fi - G_DIETPI-NOTIFY 2 'Updating vaultwarden package ...' - G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/vaultwarden_$G_HW_ARCH_NAME.deb" - G_AGI ./package.deb - G_EXEC rm package.deb - fi - # NZBGet: Disable file logging if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[149\]=2' /boot/dietpi/.installed && [[ -f '/mnt/dietpi_userdata/nzbget/nzbget.conf' ]] then @@ -1512,7 +1497,7 @@ Patch_9_0() then for i in quartz64{a,b} soquartz do - dpkg --compare-versions "$(dpkg-query -Wf '${Version}' "firmware-$i" 2> /dev/null)" lt-nl 6.6.10-dietpi1 || continue + dpkg --compare-versions "$(dpkg-query -Wf '${Version}' "firmware-$i" 2> /dev/null)" lt-nl 6.6.12-dietpi1 || continue G_DIETPI-NOTIFY 2 "Updating $i kernel and bootloader ..." G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/firmware-$i.deb" G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb @@ -1521,7 +1506,7 @@ Patch_9_0() done # VisionFive 2 - elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.72-dietpi1 + elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.73-dietpi1 then G_DIETPI-NOTIFY 2 'Updating RISC-V StarFive VisionFive 2 kernel ...' G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb' @@ -1529,7 +1514,7 @@ Patch_9_0() G_EXEC rm package.deb # Star64 - elif (( $G_HW_MODEL == 84 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-star64 2> /dev/null)" lt-nl 6.1.72-dietpi1 + elif (( $G_HW_MODEL == 84 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-star64 2> /dev/null)" lt-nl 6.1.73-dietpi1 then G_DIETPI-NOTIFY 2 'Updating RISC-V PINE64 Star64 kernel ...' G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-star64.deb' @@ -1572,6 +1557,21 @@ Patch_9_0() # Kodi [[ -f '/usr/share/applications/kodi.desktop' ]] && G_CONFIG_INJECT 'Exec=' 'Exec=kodi --standalone' /usr/share/applications/kodi.desktop + + # vaultwarden + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[183\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' vaultwarden 2> /dev/null)" lt 1.30.1-dietpi3 + then + # Pre-v8.7 cleanup + if [[ -f '/opt/vaultwarden/target/release/vaultwarden' ]] + then + G_EXEC rm -R /opt/vaultwarden + [[ -f '/etc/systemd/system/vaultwarden.service' ]] && G_EXEC rm /etc/systemd/system/vaultwarden.service + fi + G_DIETPI-NOTIFY 2 'Updating vaultwarden package ...' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/vaultwarden_$G_HW_ARCH_NAME.deb" + G_AGI ./package.deb + G_EXEC rm package.deb + fi fi } diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 09571ab505..e981b7d370 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -682,7 +682,7 @@ deb $INPUT_MODE_VALUE $G_DISTRO_NAME-backports main contrib non-free' > /etc/apt [[ $kernel_package == 'linux-image-rpi-v8' ]] && G_EXEC dpkg --add-architecture arm64 else declare -A models=( - ['linux-image-rpi-v8']='Raspberry Pi 4/5' + ['linux-image-rpi-v8']='Raspberry Pi 2-5' ['linux-image-rpi-2712']='Raspberry Pi 5 only' ) local optional='linux-image-rpi-v8' From f81f81f8e5ce2c490194be7e5f46aeecad8909ac Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 21 Jan 2024 00:10:37 +0100 Subject: [PATCH 76/77] v9.0 - DietPi-Software | Update fallback URLs --- dietpi/dietpi-software | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index a47f63041c..1caa05f941 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -6287,7 +6287,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.7.12/kavita-linux-$arch.tar.gz" + local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.7.13/kavita-linux-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Kareadita/Kavita/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/kavita-linux-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC chmod +x Kavita/Kavita @@ -9995,7 +9995,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.11.4.4173/Prowlarr.master.1.11.4.4173.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.12.2.4211/Prowlarr.master.1.12.2.4211.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 @@ -10570,7 +10570,7 @@ _EOF_ *) local arch='arm-6';; esac - local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.3/gitea-1.21.3-linux-$arch.xz" + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.4/gitea-1.21.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 2436b32b4b6e77e22f5025d3bc6936beb4a2b1e8 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 21 Jan 2024 00:16:50 +0100 Subject: [PATCH 77/77] v9.0 - dietpi-rpi-firmware-migration | No need to migrate to dev branch anymore --- .meta/dietpi-rpi-firmware-migration | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.meta/dietpi-rpi-firmware-migration b/.meta/dietpi-rpi-firmware-migration index e9b20c7e3a..18ee47996d 100644 --- a/.meta/dietpi-rpi-firmware-migration +++ b/.meta/dietpi-rpi-firmware-migration @@ -12,14 +12,7 @@ G_CHECK_FREESPACE / 200 G_INIT # Import DietPi-Globals --------------------------------------------------------------- -G_DIETPI-NOTIFY 2 'Updating DietPi to latest required dev branch version' -G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=dev' /boot/dietpi.txt -if (( $G_DIETPI_VERSION_CORE < 9 )) -then - /boot/dietpi/dietpi-update 1 -else - /boot/dietpi/dietpi-update -1 -fi +/boot/dietpi/dietpi-update 1 # Temporary rootfs mount G_EXEC mkdir -p rootfs