cleanup: create postinstall script for cleanup package for live with installer
This commit is contained in:
parent
4d04c1c27c
commit
ead23b5da9
30
features.in/cleanup/live/image-scripts.d/90-cleanup-live-install-pkgs
Executable file
30
features.in/cleanup/live/image-scripts.d/90-cleanup-live-install-pkgs
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh -efu
|
||||
### create a postinstall script to drop temporarily needed packages
|
||||
|
||||
if [ -n "$GLOBAL_VERBOSE" ]; then
|
||||
echo "** GLOBAL_CLEANUP_PACKAGES: $GLOBAL_CLEANUP_PACKAGES"
|
||||
echo "** GLOBAL_CLEANUP_BASE_PACKAGES: $GLOBAL_CLEANUP_BASE_PACKAGES"
|
||||
fi >&2
|
||||
|
||||
[ -n "$GLOBAL_CLEANUP_PACKAGES" ] ||
|
||||
[ -n "$GLOBAL_CLEANUP_BASE_PACKAGES" ] || exit 0
|
||||
|
||||
[ -x /usr/sbin/install2-init ] || exit 0
|
||||
|
||||
CLEANUP_PACKAGES="$GLOBAL_CLEANUP_PACKAGES $GLOBAL_CLEANUP_BASE_PACKAGES"
|
||||
|
||||
SCRIPT="/usr/share/install2/postinstall.d/01-remove-pkgs"
|
||||
|
||||
cat > "$SCRIPT" << EOF
|
||||
#!/bin/sh -efu
|
||||
|
||||
. install2-init-functions
|
||||
|
||||
# don't override the script start message on the same line
|
||||
echo "removing $CLEANUP_PACKAGES"
|
||||
|
||||
# remove temporary packages from the installed system
|
||||
list="\$(exec_chroot rpmquery -a --qf='%{NAME}\\n' $CLEANUP_PACKAGES)"
|
||||
[ -z "\$list" ] || exec_chroot apt-get remove -f -y -- \$list
|
||||
EOF
|
||||
chmod +x "$SCRIPT"
|
Loading…
x
Reference in New Issue
Block a user