Re: scheduling while atomic & hang.

From: J. Bruce Fields
Date: Wed Jul 10 2013 - 16:54:44 EST


On Thu, Jul 04, 2013 at 03:49:02AM -0400, Dave Jones wrote:
> I don't use the auto config, because I end up filling up /boot
> unless I go through and clean them out by hand every time I install
> a new one (which I do probably a dozen or so times a day).
> Is there some easy way to prune old builds I'm missing ?

I run this by hand every now and then. I'm probably doing it all wrong.

--b.

#!/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:

ssh "root@$1" '

for f in $(ls /lib/modules); 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
'
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/