Subject: checkrestart: please check for upgraded kernel image
Package: debian-goodies
Version: 0.47
Severity: wishlist
File: /usr/sbin/checkrestart

It would be nice if checkrestart could also check to see if the running
kernel is different from the installed one. This is what I use now
(which can surely be improved):

  # get the installed kernel version
  kernfile=`readlink -e /vmlinuz || readlink -e /boot/vmlinuz`
  kernel=`dpkg -S $kernfile | awk -F : '{print $1}'`
  installed_version=`apt-cache policy $kernel | sed -n 's/^ *Installed: *//p'`

  # get the running kernel version
  running_version=`sed 's/^Linux version [^(]* (Debian \([^)]*\)) .*$/\1/' 
/proc/version`

This obviously only works with Debian kernels and may have some
limitations but it works for me. It also handles the case where the
kernel was upgraded but the kernel version stays the same (e.g. uname -r
is the same for both the running and the new kernel).

Thanks.

-- System Information:
Debian Release: 5.0.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages debian-goodies depends on:
ii  curl                      7.18.2-8lenny2 Get a file from an HTTP, HTTPS or 
ii  dctrl-tools [grep-dctrl]  2.13.1         Command-line tools to process Debi
ii  dialog                    1.1-20080316-1 Displays user-friendly dialog boxe
ii  less                      418-1          Pager program similar to more
ii  lsof                      4.78.dfsg.1-4  List open files
ii  python                    2.5.2-3        An interactive high-level object-o
ii  whiptail                  0.52.2-11.3    Displays user-friendly dialog boxe

Versions of packages debian-goodies suggests:
pn  popularity-contest            <none>     (no description available)
ii  xdg-utils                     1.0.2-6.1  desktop integration utilities from
ii  zenity                        2.22.1-2   Display graphical dialog boxes fro

-- 
-- arthur de jong - art...@west.nl - west consulting b.v. --




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to