Moving removal of backup and temporary files to their own hook script.
This commit is contained in:
parent
21ac95b9a6
commit
7caf9ed19f
|
@ -612,7 +612,9 @@ Set_defaults ()
|
|||
remove-linux-image-backups \
|
||||
remove-mdadm-configuration \
|
||||
remote-adjtime-configuration \
|
||||
disable-kexec-tools}"
|
||||
disable-kexec-tools \
|
||||
remove-backup-files \
|
||||
remove-temporary-files}"
|
||||
;;
|
||||
|
||||
kubuntu)
|
||||
|
@ -627,7 +629,9 @@ Set_defaults ()
|
|||
remove-linux-image-backups \
|
||||
remove-mdadm-configuration \
|
||||
remove-adjtime-configuration \
|
||||
disable-kexec-tools}"
|
||||
disable-kexec-tools \
|
||||
remove-backup-files \
|
||||
remove-temporary-files}"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
|
@ -104,23 +104,6 @@ case "${LB_INITRAMFS_COMPRESSION}" in
|
|||
;;
|
||||
esac
|
||||
|
||||
# Remove cruft
|
||||
rm -f chroot/boot/initrd*bak*
|
||||
rm -f chroot/etc/apt/trusted.gpg~
|
||||
rm -f chroot/etc/group- chroot/etc/passwd-
|
||||
rm -f chroot/etc/gshadow- chroot/etc/shadow-
|
||||
rm -f chroot/var/cache/debconf/*-old
|
||||
rm -f chroot/var/lib/dpkg/*-old
|
||||
rm -f chroot/var/log/apt/term.log
|
||||
|
||||
# Delete and re-create temporary directories
|
||||
TEMP_DIRS="/tmp /var/tmp"
|
||||
for DIR in ${TEMP_DIRS}
|
||||
do
|
||||
rm -rf "chroot/${DIR}"
|
||||
install -d -m 1777 "chroot/${DIR}"
|
||||
done
|
||||
|
||||
if [ -n "${LB_ROOT_COMMAND}" ]
|
||||
then
|
||||
${LB_ROOT_COMMAND} chown -R --quiet $(whoami):$(whoami) chroot
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Remove backup files
|
||||
rm -f /etc/apt/trusted.gpg~
|
||||
|
||||
rm -f /etc/passwd-
|
||||
rm -f /etc/group-
|
||||
rm -f /etc/shadow-
|
||||
rm -f /etc/gshadow-
|
||||
|
||||
rm -f /var/cache/debconf/*-old
|
||||
rm -f /var/lib/dpkg/*-old
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Remove temporary files
|
||||
for _DIRECTORY in /tmp /var/tmp
|
||||
do
|
||||
rm -rf ${_DIRECTORY}
|
||||
|
||||
mkdir -p ${_DIRECTORY}
|
||||
chmod 1777 ${_DIRECTORY}
|
||||
done
|
Loading…
Reference in New Issue