Skip to content

Commit

Permalink
v8.23 (#6661)
Browse files Browse the repository at this point in the history
- DietPi-Software | ADS-B Feeder: Harden uninstall and fix beta tags

The tag format upstream was extended - this tracks that change.

Don't install the unused update timer - we don't use that as an app.
Remove the adsb-docker service on uninstall.
Don't prune the docker images - that might remove images we don't own.

* remove unwanted service files

The names should be specific enough for this approach.

* run upstream cleanup script

This should allow us to clean up the various docker images that might have been
installed.

* improve the patch to remove services that might be still around

This is 100% written by @MichaIng - I'm just adding to the branch.

---------

Signed-off-by: Dirk Hohndel <[email protected]>
Co-authored-by: MichaIng <[email protected]>
  • Loading branch information
dirkhh and MichaIng authored Oct 12, 2023
1 parent c8c6d8e commit 3aafe6e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .update/patches
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,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
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ v8.23
Enhancements:
- 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
9 changes: 5 additions & 4 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -12015,11 +12015,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 +12816,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

0 comments on commit 3aafe6e

Please sign in to comment.