Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/github/pr/148'
Browse files Browse the repository at this point in the history
  • Loading branch information
mika committed Apr 26, 2024
2 parents 257896d + 0551e9e commit 40d666f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
9 changes: 8 additions & 1 deletion docs/grml-live.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,14 @@ ${GRML_FAI_CONFIG}/config/package_config whereas some further classes are define
example in ${GRML_FAI_CONFIG}/config/scripts/ so specific feature sets can be
selected. The following classes are predefined:

* DEBORPHAN: get rid of all packages listed in output of deborphan
* DEBORPHAN: get rid of "autoremove" and "removed-but-not-yet-purged" packages;
also all packages listed in output of deborphan (only if deborphan is actually
present, note that grml-live no longer installs deborphan by default as it's not
present since Debian/trixie!). This class is called as such for historic
reasons, and while deborphan itself is no longer relevant nowadays, the name of
the class was kept as such for backwards compatibility reasons. This class is
thought to be used *before* any further `GRML*` classes, like
`DEBORPHAN,GRMLBASE,GRML_FULL,RELEASE,...` to get proper Grml releases.

* FRESHCLAM: execute freshclam (if it's present) to update clamav definitions
(increases resulting ISO size ~70MB). By default it's skipped to avoid bigger
Expand Down
21 changes: 10 additions & 11 deletions etc/grml/fai/config/scripts/DEBORPHAN/98-clean-chroot
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,10 @@
set -u
set -e

if ! [ -x $target/usr/bin/deborphan ] ; then
echo "Warning: deborphan not installed"
exit 0
fi

# remove all packages not necessary anymore:
echo "Executing apt-get -y --purge autoremove"
$ROOTCMD apt-get -y --purge autoremove

# remove packages until deborphan does not find anymore:
while [ "$($ROOTCMD deborphan)" != "" ] ; do
echo "Executing deborphan"
$ROOTCMD apt-get -y --purge remove $($ROOTCMD deborphan)
done

# make sure we don't have any removed but not-yet-purged packages left,
# otherwise GRMLBASE/03-get-sources might try to download unavailable
# packages and will fail doing so
Expand All @@ -34,5 +23,15 @@ if [ -n "$PURGE_PACKAGES" ] ; then
$ROOTCMD dpkg --purge $PURGE_PACKAGES
fi

# note: deborphan is no longer available as of Debian/trixie,
# see https://github.com/grml/grml-live/issues/144
if [ -x "$target"/usr/bin/deborphan ] ; then
# remove packages until deborphan does not find anymore:
while [ "$($ROOTCMD deborphan)" != "" ] ; do
echo "Executing deborphan"
$ROOTCMD apt-get -y --purge remove $($ROOTCMD deborphan)
done
fi

## END OF FILE #################################################################
# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2

0 comments on commit 40d666f

Please sign in to comment.