From dbea7d1511d8e1b2604960d37146ec931d9dfe15 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Wed, 14 Aug 2019 07:22:14 +0000 Subject: [PATCH] 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 --- etc/kernel/postinst.d/30_remove-system-map | 5 +++++ usr/lib/security-misc/remove-system.map | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100755 etc/kernel/postinst.d/30_remove-system-map diff --git a/etc/kernel/postinst.d/30_remove-system-map b/etc/kernel/postinst.d/30_remove-system-map new file mode 100755 index 0000000..fc4a604 --- /dev/null +++ b/etc/kernel/postinst.d/30_remove-system-map @@ -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 diff --git a/usr/lib/security-misc/remove-system.map b/usr/lib/security-misc/remove-system.map index 10071f8..621879b 100755 --- a/usr/lib/security-misc/remove-system.map +++ b/usr/lib/security-misc/remove-system.map @@ -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