Debian Codegraph @

scripts/prune-kernel

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # SPDX-License-Identifier: GPL-2.0
3
4 # because I use CONFIG_LOCALVERSION_AUTO, not the same version again and
5 # again, /boot and /lib/modules/ eventually fill up.
6 # Dumb script to purge that stuff:
7
8 for f in "$@"
9 do
10 if rpm -qf "/lib/modules/$f" >/dev/nullscip-shell filesystem . . `/dev/null`.; then
11 echoscip-shell system . . echo. "keeping $f (installed from rpm)"
12 elif [scip-shell system . . `[`. $(unamescip-shell system . . uname. -r) = "$f" ]; then
13 echoscip-shell system . . echo. "keeping $f (running kernel) "
14 else
15 echoscip-shell system . . echo. "removing $f"
16 rmscip-shell system . . rm. -f "/boot/initramfs-$f.img" "/boot/System.map-$f"
17 rmscip-shell system . . rm. -f "/boot/vmlinuz-$f" "/boot/config-$f"
18 rmscip-shell system . . rm. -rf "/lib/modules/$f"
19 if [scip-shell system . . `[`. -x "$(command -v new-kernel-pkg)" ]; then
20 new-kernel-pkg --remove $f
21 elif [scip-shell system . . `[`. -x "$(command -v kernel-install)" ]; then
22 kernel-install remove $f
23 fi
24 fi
25 done