Home Home > 2011 > 07 > 14
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

Archive for July 14th, 2011

Improved Kernel Package Retention in 12.1

July 14th, 2011 by

A long awaited feature of the openSUSE update stack is finally here!
Since some time, it has been possible to tell libzypp to not delete old
kernels on update:

multiversion = provides:multiversion(kernel)

in /etc/zypp/zypp.conf. That way, you don’t have to worry that a
brand new -rc kernel from Factory makes your system unbootable. This however
solves one problem and brings another one – you have to manually delete the
old kernel so that your /boot partition does not fill up. openSUSE 12.1 will
provide a solution to this, you will be able to tell what kernels you want to
keep after an update, other kernels will be deleted. The configuration is the
same file, /etc/zypp/zypp.conf:

## Comma separated list of kernel packages to keep installed in parallel, if the
## above multiversion variable is set. Packages can be specified as
## 2.6.32.12-0.7 - Exact version to keep
## latest        - Keep kernel with the highest version number
## latest-N      - Keep kernel with the Nth highest version number
## running       - Keep the running kernel
## oldest        - Keep kernel with the lowest version number (the GA kernel)
## oldest+N      - Keep kernel with the Nth lowest version number
##
## Default: Do not delete any kernels if multiversion = provides:multiversion(kernel) is set
multiversion.kernels = latest,running

If you configure this and the above multiversion variable, then after each
kernel update, during a subsequent reboot, a script will compare the list of
installed kernels with the multiversion.kernels setting and delete those that
are no longer needed. Examples:

  • Keep the latest kernel and the running one if it differs. This is similar to
    no enabling the multiversion feature at all, except that the old kernel is
    removed after reboot and not immediatelly after installation. BTW, you
    probably always want to include “running”:

    multiversion.kernels = latest,running
  • Keep last two kernels and the running one:
    multiversion.kernels = latest,latest-1,running
  • Keep the latest kernel, the running and a my test kernel with a fancy
    patch:

    multiversion.kernels = latest,running,3.0.rc7-test

If you want to try it, it’s all in Factory already. Check if these packages are
recent enough and uncomment the two variables in zypp.conf:

$ rpm -q --changelog kernel-desktop mkinitrd libzypp | grep -B2 312018
* Fri Jun 17 2011 mmarek@suse.cz
- rpm/post.sh: Touch /boot/do_purge_kernels on package install
    (fate#312018).
--
- Add purge-kernels script to automatically delete old kernel packages
  on boot, based on configuration in /etc/zypp/zypp.conf, variable
  multiversion_kernels (fate#312018).
--
* Tue Jun 21 2011 dmacvicar@suse.de
- Add configuration template for automatic kernel
  purge (feature#312018) to zypp.conf
$ grep ^multiversion /etc/zypp/zypp.conf
multiversion = provides:multiversion(kernel)
multiversion.kernels = latest,running

Happy updating!