mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: kernel pruning script..
Date: Wed, 10 Feb 2016 13:05:46 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1602101304290.16000@chino.kir.corp.google.com> (raw)
In-Reply-To: <CA+55aFx-aMLAcvQsLPCScONME=9AFO7VpMbgQEAbg1_jgcy=nQ@mail.gmail.com>

On Mon, 8 Feb 2016, Linus Torvalds 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
> > '

I do something similar to this on a regular basis as well, but I also rm 
-rf /lib/firmware/$f

  parent reply	other threads:[~2016-02-10 21:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 20:14 Linus Torvalds
2016-02-08 20:22 ` J. Bruce Fields
2016-02-10 21:05 ` David Rientjes [this message]
2016-02-10 21:51   ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1602101304290.16000@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=bfields@fieldses.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®