add hook etc/kernel/postinst.d/30_remove-system-map to remove system.map

on kernel package upgrade;

self-document this package: during upgrade the following will be written
to stdout:

Setting up linux-image-4.19.0-5-amd64 (4.19.37-5+deb10u2) ...
/etc/kernel/postinst.d/30_remove-system-map:
removed '/boot/System.map-4.19.0-5-amd64
This commit is contained in:
Patrick Schleizer 2019-08-14 07:22:14 +00:00
parent f1d8cbc9fb
commit dbea7d1511
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
#!/bin/bash
if test -x /usr/lib/security-misc/remove-system.map ; then
/usr/lib/security-misc/remove-system.map
fi

View File

@ -9,6 +9,6 @@ shopt -s nullglob
for filename in /boot/System.map-*
do
if [ -f "${filename}" ]; then
rm -f "${filename}"
rm --verbose --force "${filename}"
fi
done