$ROOTCMD rm -f /etc/udev/kernel-upgrade
fi
-echo "Removing /var/lib/apt/lists/*-stuff, dpkg-status-old and pkgcache.bin"
-rm -f $target/var/lib/apt/lists/*Packages \
- $target/var/lib/apt/lists/*Release \
- $target/var/lib/apt/lists/*Sources \
- $target/var/lib/apt/lists/*IndexDiff \
- $target/var/lib/apt/lists/*.gpg \
- $target/var/cache/apt-show-versions/* \
- $target/var/cache/debconf/templates.dat-old \
- $target/var/cache/apt/*.bin
+echo "Updating package list"
+$ROOTCMD apt-get update
echo "Cleaning apt places"
$ROOTCMD apt-get check 2>/dev/null
$target/etc/*group- $target/var/spool/postfix/maildrop/* \
$target/etc/*.old $target/etc/*.original \
$target/etc/lvm/.cache $target/etc/lvm/cache/.cache \
- $target/etc/lvm/backup/main $target/tmp/* \
+ $target/etc/lvm/backup/* $target/tmp/* \
$target/var/tmp/* $target/var/backups/* \
- $target/var/lib/mysql $target/var/log/lilo_log.* $target/core*
+ $target/var/lib/mysql $target/var/log/lilo_log.* $target/core* \
+ $target/etc/blkid.tab
+
+# avoid data leakage into target system
+if ! [ -f "$target/etc/mtab" ]; then
+ echo "/etc/mtab does not exist or is not a regular file, not touching."
+else
+ echo "Removing /etc/mtab"
+ rm -f "$target/etc/mtab"
+fi
# remove only "temporary" or saved files in the given directories
nuke(){