Skip to content

Commit

Permalink
Annotate scripts assuming they can use host tools/files
Browse files Browse the repository at this point in the history
Annotate script fragments that use tools or files from the host (so outside of
the chroot) with an "OUTSIDE:" marker.
This will become important later, when we split scripts between "on the inside"
and "on the outside" scripts.
  • Loading branch information
zeha committed Jan 30, 2025
1 parent f5b89ad commit cb610d1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/scripts/GRMLBASE/01-packages
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set -e
# FAI sets $target, but shellcheck does not know that.
target=${target:?}

# OUTSIDE: This fragment assumes it runs outside the chroot.
echo -n > "${LOGDIR}"/package_errors.log # ensure we start with an empty file

PACKAGE_LIST=/grml-live/log/install_packages.list
Expand Down
1 change: 1 addition & 0 deletions config/scripts/GRMLBASE/47-update-wallpaper
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ if [ ! -f "$FONTFILE" ]; then
exit 0
fi

# OUTSIDE: This fragment assumes it runs outside the chroot.
convert "$GRML_BG" -gravity center \
-fill white -font "$FONTFILE" \
-pointsize "$TITLE_FONTSIZE" \
Expand Down
4 changes: 4 additions & 0 deletions config/scripts/GRMLBASE/95-package-information
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ if ! [ -w "${LOGDIR}" ] ; then
exit 1
fi

# OUTSIDE: This fragment assumes it runs outside the chroot.
# store package list:
COLUMNS=200 $ROOTCMD dpkg --list > "${LOGDIR}"/dpkg.list
COLUMNS=200 $ROOTCMD dpkg --get-selections > "${LOGDIR}"/dpkg.selections

# OUTSIDE: This fragment assumes it runs outside the chroot.
# store list of packages sorted by size:
if [ -x "$target"/usr/bin/dpkg-query ] ; then
# shellcheck disable=SC2016 # Embedded $ is correct.
$ROOTCMD dpkg-query -W --showformat='${Package}\t${Installed-Size}\n' > \
"${LOGDIR}"/packages.size
fi

# OUTSIDE: This fragment assumes it runs outside the chroot.
# store a list of non-free packages and their licenses
echo "The following packages from the Debian non-free section are included in this release" \
> "${LOGDIR}"/nonfree-licenses.txt
Expand All @@ -35,6 +38,7 @@ echo >> "${LOGDIR}"/nonfree-licenses.txt
# copyright information for non-free packages
non_free_pkgs=$($ROOTCMD apt-cache show '~i' | awk '/^Package: / {pkg=$2} /^Section: non-free/ {print pkg}')

# OUTSIDE: This fragment assumes it runs outside the chroot.
for pkg in ${non_free_pkgs:-} ; do
echo "Package: ${pkg}" >> "${LOGDIR}"/nonfree-licenses.txt
echo "========================================================================" \
Expand Down
1 change: 1 addition & 0 deletions config/scripts/RELEASE/99-update-wallpaper
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ if [ ! -f "$FONTFILE" ]; then
exit 0
fi

# OUTSIDE: This fragment assumes it runs outside the chroot.
convert "$GRML_BG" -gravity center \
-fill white -font "$FONTFILE" \
-pointsize "$TITLE_FONTSIZE" \
Expand Down

0 comments on commit cb610d1

Please sign in to comment.