kittykernel - a little GUI for managing kernels

Get involved, create or participate in a project.
Schallaven
Level 1
Level 1
Posts: 16
Joined: Sun Jul 16, 2017 11:42 am

kittykernel - a little GUI for managing kernels

Postby Schallaven » Fri Aug 18, 2017 3:25 pm

Hello!

I wrote myself a little tool for managing kernels on Mint (and another Ubuntu machine actually) and thought maybe someone else might also find it handy. Thus, I am sharing :) Find the tool at: https://github.com/Schallaven/kittykernel

Features:
  • Manages kernels with a handy GUI
  • Can install all kernels available in repos (e.g. low-latency)
  • Can remove and/or purge multiple kernels to clean up /boot (this was actually the driving point for writing this)
  • If available: scrolls to the currently selected kernel in the changelog
  • Convinces users by using an alliteration for its name

At the moment it uses synaptic for installing packages (it provides a handy interface to have progress-dialogs, etc), but that might change in future.

Impression:
kittykernelimpression.png

User avatar
Pjotr
Level 18
Level 18
Posts: 8422
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: kittykernel - a little GUI for managing kernels

Postby Pjotr » Fri Aug 18, 2017 3:39 pm

Sounds cool! :)

When it comes to removing old kernels, in what respects does it differ from purge-old-kernels?

Code: Select all

#!/bin/sh
#
#    purge-old-kernels - remove old kernel packages
#    Copyright (C) 2012 Dustin Kirkland <kirkland@ubuntu.com>
#
#    Authors: Dustin Kirkland <kirkland@ubuntu.com>
#             Kees Cook <kees@ubuntu.com>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, version 3 of the License.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Ensure we're running as root
if [ "$(id -u)" != 0 ]; then
   echo "ERROR: This script must run as root.  Hint..." 1>&2
   echo "  sudo $0 $@" 1>&2
   exit 1
fi

# NOTE: This script will ALWAYS keep the currently running kernel
# NOTE: Default is to keep 2 more, user overrides with --keep N
KEEP=2
# NOTE: Any unrecognized option will be passed straight through to apt
APT_OPTS=
while [ ! -z "$1" ]; do
   case "$1" in
      --keep)
         # User specified the number of kernels to keep
         KEEP="$2"
         shift 2
      ;;
      *)
         APT_OPTS="$APT_OPTS $1"
         shift 1
      ;;
   esac
done

# Build our list of kernel packages to purge
CANDIDATES=$(ls -tr /boot/vmlinuz-* | head -n -${KEEP} | grep -v "$(uname -r)$" | cut -d- -f2- | awk '{print "linux-image-" $0 " linux-headers-" $0}' )
for c in $CANDIDATES; do
   dpkg-query -s "$c" >/dev/null 2>&1 && PURGE="$PURGE $c"
done

if [ -z "$PURGE" ]; then
   echo "No kernels are eligible for removal"
   exit 0
fi

apt $APT_OPTS remove --purge $PURGE
Tip: 10 things to do after installing Linux Mint 18.2 Sonya
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

Schallaven
Level 1
Level 1
Posts: 16
Joined: Sun Jul 16, 2017 11:42 am

Re: kittykernel - a little GUI for managing kernels

Postby Schallaven » Fri Aug 18, 2017 11:36 pm

For me, I moved from 4.4 through 4.8 to 4.10 now, and might in future go to 4.11 (actually waiting for 4.12). I wanted to keep always the last generation/line of kernels, prior to my current one. So, if I want just to purge 4.4-line, I can do that by right clicking on 4.4, choose the respective option, and done. As far as I can see, the script does not do this.

In future, I want to add some handy features like "hiding this line", so I don't see anything from 4.4 anymore, for example. Small, handy things (or look for example that it shows the /boot size and the current kernel above the list, etc.)

But in the end, you can always ask such things as "Why do people use software manager instead of apt-get install?" or similar. Because people differ in taste and requirements. Same here, I think :)

User avatar
mrmajik45
Level 2
Level 2
Posts: 94
Joined: Tue Aug 29, 2017 9:51 pm
Location: USA, indiana
Contact:

Re: kittykernel - a little GUI for managing kernels

Postby mrmajik45 » Sat Sep 02, 2017 7:46 pm

Cool Program! If you learn a bit more about linux you might be able to use something as than synaptic for the installer
:D :D :D
The linux coder.


Return to “Community Projects”

Who is online

Users browsing this forum: No registered users and 2 guests