Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
TDuffinNTU authored Oct 14, 2023
2 parents 862c7c9 + 6cab64c commit d232532
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 56 deletions.
22 changes: 3 additions & 19 deletions .meta/dietpi-bookworm-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ mapfile -t apackages < <(apt-mark showhold)
unset -v apackages

G_DIETPI-NOTIFY 2 'Migrating package lists to Bookworm suite'
G_EXEC sed -i -e 's/bullseye/bookworm/g' -e 's/ non-free$/ non-free non-free-firmware/' /etc/apt/sources.list
G_EXEC sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
(( $G_RASPBIAN )) || G_EXEC sed -i 's/ non-free$/ non-free non-free-firmware/' /etc/apt/sources.list
[[ $(find /etc/apt/sources.list.d/*.list 2> /dev/null) ]] && G_EXEC sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list
[[ -f '/etc/apt/sources.list.d/dietpi-mympd.list' ]] && G_EXEC sed -i 's/Debian_11/Debian_Testing/' /etc/apt/sources.list.d/dietpi-mympd.list

Expand All @@ -67,23 +68,6 @@ 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 -i 's/bookworm/bullseye/' /etc/apt/sources.list.d/influxdb.list
[[ -f '/etc/apt/sources.list.d/mopidy.list' ]] && G_EXEC sed -i 's/bookworm/bullseye/' /etc/apt/sources.list.d/mopidy.list

# RPi/ARMv6 container Bookworm
if [[ -f '/etc/apt/sources.list.d/raspi.list' ]]
then
# Avoid conflict between RPi repo and Bookworm FFmpeg packages: https://github.com/MichaIng/DietPi/issues/6461
G_DIETPI-NOTIFY 2 'Enforcing Debian Bookworm FFmpeg packages over RPi repo ones'
cat << '_EOF_' > /etc/apt/preferences.d/dietpi-ffmpeg
Package: src:ffmpeg
Pin: version 7:5*
Pin-Priority: 1000
_EOF_
if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[31\]=2' /boot/dietpi/.installed && dpkg-query -s kodi &> /dev/null
then
G_DIETPI-NOTIFY 2 'Temporarily removeing Kodi packages to avoid conflicts with Debian Bookworm packages'
G_EXEC_OUTPUT=1 G_EXEC apt-get -y autoremove kodi
fi
fi

G_DIETPI-NOTIFY 2 'Applying the actual upgrade to Debian Bookworm'
/boot/dietpi/dietpi-services stop
G_AGUP
Expand Down Expand Up @@ -122,7 +106,7 @@ dpkg-query -s unbound &> /dev/null && G_AGI dns-root-data
# Allow IPv6 port binding failure explicitly, not implicit anymore since Bookworm: https://github.com/MichaIng/DietPi/pull/6103#issuecomment-1407749720
[[ -f '/etc/redis/redis.conf' ]] && G_EXEC sed -i '/^bind 127.0.0.1 ::1$/c\bind 127.0.0.1 -::1' /etc/redis/redis.conf
# Reinstall all PHP applications which require non-standard PHP modules, webservers which did access a versioned PHP-FPM socket, Python applications installed via pip, ...
G_PROMPT_BACKUP_DISABLED=1 /boot/dietpi/dietpi-software reinstall 31 38 40 47 48 83 84 85 89 93 114 118 125 130 134 136 139 143 153 155 157 180
G_PROMPT_BACKUP_DISABLED=1 /boot/dietpi/dietpi-software reinstall 38 40 47 48 83 84 85 89 93 114 118 125 130 134 136 139 143 153 155 157 180

# PostgreSQL upgrade
if grep -q '^aSOFTWARE_INSTALL_STATE\[194\]=2$' /boot/dietpi/.installed
Expand Down
11 changes: 8 additions & 3 deletions .update/patches
Original file line number Diff line number Diff line change
Expand Up @@ -1376,9 +1376,6 @@ Patch_8_20()

# Odroid N2: Assure that hardware random generator driver is loaded as early as possible to prevent rngd failures: https://github.com/MichaIng/DietPi/issues/6483
(( $G_HW_MODEL == 15 )) && G_EXEC eval 'echo '\''meson_rng'\'' > /etc/modules-load.d/dietpi-hwrng.conf'

# Hotfix for FFmpeg "downgrade" on RPi Bookworm: https://github.com/MichaIng/DietPi/issues/6512
[[ -f '/etc/apt/apt.conf.d/dietpi-ffmpeg' ]] && G_EXEC rm /etc/apt/apt.conf.d/dietpi-ffmpeg
}

Patch_8_21()
Expand Down Expand Up @@ -1480,6 +1477,14 @@ Patch_8_23()
G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb
G_EXEC rm package.deb
fi
# ADS-B Feeder used to install two service files that aren't needed: https://github.com/MichaIng/DietPi/pull/6661
if [[ -f '/boot/dietpi/.installed' ]] && grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[141\]=2' /boot/dietpi/.installed
then
systemctl -q is-enabled adsb-update.timer && G_EXEC systemctl --no-reload disable --now adsb-update.timer
[[ -f '/etc/systemd/system/adsb-update.timer' ]] && G_EXEC rm /etc/systemd/system/adsb-update.timer
systemctl -q is-enabled adsb-update && G_EXEC systemctl --no-reload disable --now adsb-update
[[ -f '/etc/systemd/system/adsb-update.service' ]] && G_EXEC rm /etc/systemd/system/adsb-update.service
fi
}

# v6.35 => v7 migration
Expand Down
28 changes: 11 additions & 17 deletions .update/pre-patches
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fi
# v8.15
if (( $G_DIETPI_VERSION_CORE < 8 || ( $G_DIETPI_VERSION_CORE == 8 && $G_DIETPI_VERSION_SUB < 15 ) ))
then
if [[ $G_RASPBIAN != 1 ]] && (( $G_DISTRO == 7 )) && grep -q 'non-free' /etc/apt/sources.list && ! grep -q 'non-free-firmware' /etc/apt/sources.list
if [[ $G_RASPBIAN != 1 ]] && (( $G_DISTRO > 6 )) && grep -q 'non-free' /etc/apt/sources.list && ! grep -q 'non-free-firmware' /etc/apt/sources.list
then
# https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.en.html#non-free-split
G_DIETPI-NOTIFY 2 'Adding new non-free-firmware component to APT lists, to re-enable firmware upgrades'
Expand All @@ -235,22 +235,6 @@ then
fi
fi

# v8.20
if (( $G_DIETPI_VERSION_CORE < 8 || ( $G_DIETPI_VERSION_CORE == 8 && $G_DIETPI_VERSION_SUB < 20 ) ))
then
# RPi/ARMv6 container Bookworm: Avoid conflict between RPi repo and Bookworm FFmpeg packages: https://github.com/MichaIng/DietPi/issues/6461
if [[ $G_DISTRO -ge 7 && -f '/etc/apt/sources.list.d/raspi.list' ]]
then
G_DIETPI-NOTIFY 2 'Enforcing Debian Bookworm FFmpeg packages over RPi repo ones'
cat << '_EOF_' > /etc/apt/preferences.d/dietpi-ffmpeg
Package: src:ffmpeg
Pin: version 7:5*
Pin-Priority: 1000
_EOF_
G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-ffmpeg'
fi
fi

# v8.21
if (( $G_DIETPI_VERSION_CORE < 8 || ( $G_DIETPI_VERSION_CORE == 8 && $G_DIETPI_VERSION_SUB < 21 ) ))
then
Expand Down Expand Up @@ -317,6 +301,16 @@ then
G_DIETPI-NOTIFY 2 'Migrating from Debian ports to regular Debian Sid repository, which now supports RISC-V'
G_EXEC eval 'echo '\''deb https://deb.debian.org/debian/ sid main contrib non-free non-free-firmware'\'' > /etc/apt/sources.list'
dpkg-query -s 'debian-ports-archive-keyring' &> /dev/null && G_EXEC apt-mark auto debian-ports-archive-keyring

# RPi/ARMv6 container Bookworm
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'
[[ -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'
(( $G_RASPBIAN )) && G_EXEC sed -i 's/ non-free-firmware$//' /etc/apt/sources.list
fi
fi

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ v8.23
(2023-10-21)

Enhancements:
- RPi | On Debian Bookworm and above, the RPi APT repository will be migrated to its new Bookworm suite. This solves issues and should enhance performance with FFmpeg, Kodi and some other A/V software, where we used the Debian packages with less hardware support before. The packages should be upgraded automatically on DietPi update. Please report back if you experience any issues during this process.
- ROCK 5B | Added an option to dietpi-config "Advanced Option" to flash the SPI bootloader, which enables NVMe boot for DietPi images.
- DietPi-Software | Firefox: Enabled the software option for RISC-V, since Debian provides packages now. But do not expect good performance, as GPU-acceleration is missing.
- DietPi-Software | ADS-B Feeder: The uninstall has been hardened to rule out the removal of unused Docker images which were not created by ADS-B Feeder. Furthermore, beta tags are now correctly shown in the version string. Many thanks to @andreagdipaolo for reporting a related issue and @dirkhh for implementing the enhancement: https://github.com/MichaIng/DietPi/pull/6587#issuecomment-1743744008

Bug fixes:
- Raspberry Pi | Resolved an issue where the /dev/serial* symlinks were missing if binutils was not installed, which broke Bluetooth support among other things. Many thanks to @Rhiz3K for reporting this issue: https://github.com/MichaIng/DietPi/issues/6666
Expand Down
31 changes: 17 additions & 14 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -6073,7 +6073,7 @@ _EOF_
fi

# Install
G_EXEC curl -sSfL "$url" -o install.sh
G_EXEC curl -sSfLo install.sh "$url"
G_EXEC chmod +x install.sh
# - Skip web interface dialogue (which defaults to "true"), since we install a web server and PHP anyway
# - Skip query logging dialogue (which affects file logging only, not database>web UI) and set to "false"
Expand Down Expand Up @@ -6127,7 +6127,8 @@ _EOF_
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
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

# Add and enable Pi-hole config
Expand Down Expand Up @@ -6177,20 +6178,21 @@ _EOF_
- 10.*
- 172.16.* - 172.31.*
- ::1
- fe80:* - febf:*
- fc00:* - fdff:*
- fe80:* - febf:* (LLAs)
- fc00:* - fdff:* (ULAs)
\nNote that if you use IPv6 and hostnames within your LAN, but no ULAs (Unique Local Addresses), this might also block accesses from within your LAN, as then GUAs (Global Unicast Addresses) are used, which cannot be distinguished from public accesses.
\nYou can always enable/disable this later using the commands:
- $enable_cmd
- $disable_cmd
\nDo you want to block public access to the admin panel now?" && eval "$enable_cmd"

# Create symlinks to align Pi-hole admin and 404 page relative to webroot
[[ -e '/var/www/admin' && ! -L '/var/www/admin' ]] && G_EXEC mv /var/www/admin{,.bak}
G_EXEC ln -sf /var/www/{html/admin,admin}
G_EXEC ln -sf /var/www/{html/,}admin
[[ -e '/var/www/pihole' && ! -L '/var/www/pihole' ]] && G_EXEC mv /var/www/pihole{,.bak}
G_EXEC ln -sf /var/www/{html/pihole,pihole}
G_EXEC ln -sf /var/www/{html/,}pihole

# Pi-hole v5: Add webserver user to pihole group to allow gravity.db access from web UI: https://github.com/MichaIng/DietPi/issues/3391
# Add webserver user to pihole group to allow gravity.db access from web UI: https://github.com/MichaIng/DietPi/issues/3391
G_EXEC usermod -aG pihole www-data

# Set web interface PW: https://github.com/MichaIng/DietPi/issues/662
Expand Down Expand Up @@ -6652,7 +6654,7 @@ _EOF_
esac

# Download
local fallback_url="https://github.com/fatedier/frp/releases/download/v0.51.3/frp_0.51.3_linux_$arch.tar.gz"
local fallback_url="https://github.com/fatedier/frp/releases/download/v0.52.1/frp_0.52.1_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_*
Expand Down Expand Up @@ -12015,11 +12017,13 @@ _EOF_
# remove the service that isn't needed for an app install on DietPi and install the rest
G_EXEC cd /tmp/adsb-feeder/src/modules/adsb-feeder/filesystem/root
G_EXEC rm ./usr/lib/systemd/system/adsb-bootstrap.service
G_EXEC rm ./usr/lib/systemd/system/adsb-update.service
G_EXEC rm ./usr/lib/systemd/system/adsb-update.timer
G_EXEC mv ./usr/lib/systemd/system/* /etc/systemd/system/

# determine the version
local ADSB_FEEDER_DATE_COMPONENT=$(git log -20 --date='format:%y%m%d' --format='%ad' | uniq -c | mawk '{print $2"."$1;exit}')
local ADSB_FEEDER_TAG_COMPONENT=$(git describe --match 'v[0-9]*' | cut -d- -f1)
local ADSB_FEEDER_TAG_COMPONENT=$(git describe --match 'v[0-9]*' --long | sed 's/-[0-9]*-g[0-9a-f]*//')
local ADSB_FEEDER_VERSION="$ADSB_FEEDER_TAG_COMPONENT(dietpi)-$ADSB_FEEDER_DATE_COMPONENT"

# create the target directory for the app and populated with the code from the git checkout
Expand Down Expand Up @@ -12814,11 +12818,10 @@ If no WireGuard (auto)start is included, but you require it, please do the follo
if To_Uninstall 141 # ADS-B Feeder
then
G_EXEC_NOHALT=1 G_EXEC_OUTPUT=1 G_EXEC /opt/adsb/docker-compose-adsb down
Remove_Service adsb-bootstrap
Remove_Service adsb-docker
Remove_Service adsb-feeder-update
Remove_Service adsb-setup
Remove_Service adsb-update
command -v docker &> /dev/null && G_EXEC docker image prune -a -f
[[ -f /opt/adsb/pre-uninstall-cleanup ]] && G_EXEC /opt/adsb/pre-uninstall-cleanup
G_EXEC rm -Rf /opt/adsb /mnt/dietpi_userdata/adsb-feeder /opt/adsb-feeder-update
fi

Expand Down Expand Up @@ -15176,7 +15179,7 @@ _EOF_
G_WHIP_CHECKLIST_ARRAY+=("$j" "${aSOFTWARE_NAME[$j]}: ${aSOFTWARE_DESC[$j]}" "$selected")

# Add previously selected items to array to be unmarked if deselected when selection is confirmed.
(( ${aSOFTWARE_INSTALL_STATE[$j]} == 1 )) && reset+=("$i")
(( ${aSOFTWARE_INSTALL_STATE[$j]} == 1 )) && reset+=("$j")
done
done
fi
Expand All @@ -15188,7 +15191,7 @@ _EOF_
- Software and usage details: https://dietpi.com/docs/software/' || return 0

# Unmark all listed pending state items, so deselected items are not installed.
for i in "${!reset[@]}"
for i in "${reset[@]}"
do
aSOFTWARE_INSTALL_STATE[$i]=0
done
Expand Down
5 changes: 2 additions & 3 deletions dietpi/func/dietpi-set_software
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ $FP_SCRIPT disable_ssh_password_logins [01]|root|<empty> Whether to disable SSH

[[ $INPUT_MODE_VALUE ]] || { Unknown_Input_Mode; return 1; }

# RPi: Trixie suite does not exist yet, Bookworm suite is still empty
local rpi_distro=${G_DISTRO_NAME/trixie/bookworm}
(( $G_HW_MODEL < 10 || ( $G_HW_MODEL == 75 && ${G_RASPBIAN:-0} == 1 ) )) && G_EXEC eval "echo 'deb https://archive.raspberrypi.org/debian/ ${rpi_distro/bookworm/bullseye} main' > /etc/apt/sources.list.d/raspi.list"
# 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"

# RISC-V: Provided via Sid only
if (( $G_HW_ARCH == 11 ))
Expand Down

0 comments on commit d232532

Please sign in to comment.