aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorIngo Molnar <[email protected]>2016-02-13 08:30:07 +0100
committerIngo Molnar <[email protected]>2016-02-13 08:30:07 +0100
commite2d6f8a5f596b1f09839990b11a3c2e0c9f0dbc2 (patch)
tree7ccf35788cbb9def996204399f079366da251361 /scripts
parentfed0764fafd8e2e629a033c0f7df4106b0dcb7f0 (diff)
parent0cbb0b92689a1c4e0ac55f6188be563a813ac808 (diff)
Merge branch 'linus' into locking/core, to resolve conflicts
Conflicts: kernel/locking/lockdep.c Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'scripts')
-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 000000000000..ab5034e1d081
--- /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