mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* kernel pruning script..
@ 2016-02-08 20:14 Linus Torvalds
  2016-02-08 20:22 ` J. Bruce Fields
  2016-02-10 21:05 ` David Rientjes
  0 siblings, 2 replies; 4+ messages in thread
From: Linus Torvalds @ 2016-02-08 20:14 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Linux Kernel

I'm replying to a really old email, because I - once again - installed
this silly script that you wrote several years ago on a new machine.

So Bruce - how about we add this script to the kernel "tools"
directory, because it's actually very useful for anybody who uses
CONFIG_LOCALVERSION_AUTO like I do (and clearly you at least used to
do too).

I think CONFIG_LOCALVERSION_AUTO is really nice for various reasons
(not the least of which is just doing thing like

    gitk $(uname -r)..

but also because it makes it easy to go back to previous kernels when
you're working on bisecting stuff etc).

I'll happily commit it as "tools/prune-kernel" or similar, but would
like to get an ok from you as the original author.

And if somebody has improvements for specific distros, maybe the
script will start getting improvements. And I won't have to copy it
from an old machine every time, because it will just be there with the
kernel source tree (and without a kernel source tree it's not needed).

                 Linus

On Wed, Jul 10, 2013 at 1:54 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
>
> 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
> '

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-10 21:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 20:14 kernel pruning script Linus Torvalds
2016-02-08 20:22 ` J. Bruce Fields
2016-02-10 21:05 ` David Rientjes
2016-02-10 21:51   ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®