162306a36Sopenharmony_ci#!/bin/bash 262306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci# because I use CONFIG_LOCALVERSION_AUTO, not the same version again and 562306a36Sopenharmony_ci# again, /boot and /lib/modules/ eventually fill up. 662306a36Sopenharmony_ci# Dumb script to purge that stuff: 762306a36Sopenharmony_ci 862306a36Sopenharmony_cifor f in "$@" 962306a36Sopenharmony_cido 1062306a36Sopenharmony_ci if rpm -qf "/lib/modules/$f" >/dev/null; then 1162306a36Sopenharmony_ci echo "keeping $f (installed from rpm)" 1262306a36Sopenharmony_ci elif [ $(uname -r) = "$f" ]; then 1362306a36Sopenharmony_ci echo "keeping $f (running kernel) " 1462306a36Sopenharmony_ci else 1562306a36Sopenharmony_ci echo "removing $f" 1662306a36Sopenharmony_ci rm -f "/boot/initramfs-$f.img" "/boot/System.map-$f" 1762306a36Sopenharmony_ci rm -f "/boot/vmlinuz-$f" "/boot/config-$f" 1862306a36Sopenharmony_ci rm -rf "/lib/modules/$f" 1962306a36Sopenharmony_ci if [ -x "$(command -v new-kernel-pkg)" ]; then 2062306a36Sopenharmony_ci new-kernel-pkg --remove $f 2162306a36Sopenharmony_ci elif [ -x "$(command -v kernel-install)" ]; then 2262306a36Sopenharmony_ci kernel-install remove $f 2362306a36Sopenharmony_ci fi 2462306a36Sopenharmony_ci fi 2562306a36Sopenharmony_cidone 26