livecd-rootfs/minimize-manual
Philip Roche 0a1e1cc0a7 fix: ensure minimize-manual script uses passed in argument for all commands (LP: #2036198)
minimize-manual takes an argument of the path to the chroot but of the 3 commands that are run the argument
is only used twice and with the third hardcoding "chroot" as the path to the chroot.

Thankfully "chroot" has been the patch passed in for the current uses of minimize-manual but this
could cause issues later if that were to change.

This commit resolves the problem preventing future issues.
2023-09-15 11:59:12 +01:00

17 lines
460 B
Bash
Executable File

#!/bin/sh
# Minimize the number of manually installed packages in the image
# Finds all packages which could be marked as automatically installed and marks
# them as such
set -e
chroot_directory=$1
auto_packages=$(/usr/share/livecd-rootfs/auto-markable-pkgs $chroot_directory)
if [ -n "$auto_packages" ]; then
chroot $chroot_directory apt-mark auto $auto_packages
fi
[ -z "$(/usr/share/livecd-rootfs/auto-markable-pkgs $chroot_directory 2> /dev/null)" ]