summaryrefslogtreecommitdiff
path: root/scripts/prune-kernel
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-14 22:36:04 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-14 22:36:04 (GMT)
commit249f3c4fe4fdef159d3f9b3f7a6c41a92103c860 (patch)
tree58abfec8444741fd3bd403a908be50c4f63d4842 /scripts/prune-kernel
parent54573c4a073ff510d028f423ed3074573c7d9437 (diff)
parent18558cae0272f8fd9647e69d3fec1565a7949865 (diff)
downloadlinux-249f3c4fe4fdef159d3f9b3f7a6c41a92103c860.tar.xz
Merge 4.5-rc4 into tty-next
We want the fixes in here, and this resolves a merge error in tty_io.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/prune-kernel')
-rwxr-xr-xscripts/prune-kernel20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/prune-kernel b/scripts/prune-kernel
new file mode 100755
index 0000000..ab5034e
--- /dev/null
+++ b/scripts/prune-kernel
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# because I use CONFIG_LOCALVERSION_AUTO, not the same version again and
+# again, /boot and /lib/modules/ eventually fill up.
+# Dumb script to purge that stuff:
+
+for f in "$@"
+do
+ if rpm -qf "/lib/modules/$f" >/dev/null; then
+ echo "keeping $f (installed from rpm)"
+ elif [ $(uname -r) = "$f" ]; then
+ echo "keeping $f (running kernel) "
+ else
+ echo "removing $f"
+ rm -f "/boot/initramfs-$f.img" "/boot/System.map-$f"
+ rm -f "/boot/vmlinuz-$f" "/boot/config-$f"
+ rm -rf "/lib/modules/$f"
+ new-kernel-pkg --remove $f
+ fi
+done