1b64e86cdSJ. Bruce Fields#!/bin/bash 2*b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 3b64e86cdSJ. Bruce Fields 4b64e86cdSJ. Bruce Fields# because I use CONFIG_LOCALVERSION_AUTO, not the same version again and 5b64e86cdSJ. Bruce Fields# again, /boot and /lib/modules/ eventually fill up. 6b64e86cdSJ. Bruce Fields# Dumb script to purge that stuff: 7b64e86cdSJ. Bruce Fields 8b64e86cdSJ. Bruce Fieldsfor f in "$@" 9b64e86cdSJ. Bruce Fieldsdo 10b64e86cdSJ. Bruce Fields if rpm -qf "/lib/modules/$f" >/dev/null; then 11b64e86cdSJ. Bruce Fields echo "keeping $f (installed from rpm)" 12b64e86cdSJ. Bruce Fields elif [ $(uname -r) = "$f" ]; then 13b64e86cdSJ. Bruce Fields echo "keeping $f (running kernel) " 14b64e86cdSJ. Bruce Fields else 15b64e86cdSJ. Bruce Fields echo "removing $f" 16b64e86cdSJ. Bruce Fields rm -f "/boot/initramfs-$f.img" "/boot/System.map-$f" 17b64e86cdSJ. Bruce Fields rm -f "/boot/vmlinuz-$f" "/boot/config-$f" 18b64e86cdSJ. Bruce Fields rm -rf "/lib/modules/$f" 19b64e86cdSJ. Bruce Fields new-kernel-pkg --remove $f 20b64e86cdSJ. Bruce Fields fi 21b64e86cdSJ. Bruce Fieldsdone 22