purge-kernels script

Hello All,

I have posted a similar request on the factory mailing list on 09/05 but didn’t get any replies until now. Maybe it was the wrong list.

Anyway, on all my installations I have the “multiversion kernel” feature activated to have at least one working kernel on my systems just in case a new kernel doesn’t boot or crashes.

Usually - to prevent the HD from getting filled up with older kernels - I had to delete them manually.

But since July there is a script available in factory and tumbleweed that does take care of deleting older kernels on the next reboot.

This script is activated with a line in zypp.conf like (in my case) the follwing:

“multiversion-kernels = latest,latest-1,latest-2,running”

The script is working fine, removing older kernels as intended, except for two packages:

The kernel-source-# and the kernel-devel-# packages are left on the disk and
still have to be removed manually.

Can anyone confirm this? Is this intended? How can this be changed?

Thank you,

Andreas

Really nobody who is using this feature and has kernel sources installed?

I tried to leave a message for the author here:

openSUSE Lizards

but it doesn’t work. I am not allowed to leave a response on that page.

Regards,

Andreas

there is a script available
What script are you meaning? Perhaps no-one else can understand either.

/etc/zypp/zypp.conf is the configuration file for zypper.

Thanks for your reply eng-int.

The script is called purge-kernels (like the title says) and it is a perl script that can be found in the /sbin/ directory and it is activated and configured in /etc/zypp/zypp.conf.

There are two lines, that have to be present in zypp.conf to make the script working. With the first one the “multikernel” feature is activated:

“multiversion = provides:multiversion(kernel)”

With the second line the way these multiple kernels are treated can be configured:

“multiversion-kernels = latest,latest-1,latest-2,running”

The line above is from my zypp.conf. It tells the purge-kernels script to keep the running kernel and the last two but to delete all older kernels.

This is what this script does perfectly on my machines, except for the source and the devel packages that belong to the older, deleted kernels. It leaves them on disk. I still have to remove old source and devel packages manually.

AFAIR this is a feature that is planned to be available in 12.1 and I think it would be a good thing if this script would remove older source and devel packages also.

Regards,

Andreas

Good idea but you need to tell the developers not use users.

openSUSE:Openfate screening - openSUSE

Thanks for your reply gogalthorp.

This is what I am trying to do for two weeks now without success.

My hopes were that another user in this forum is using/testing this script and could probably help out or that a developer might stop by and might read my post.

Anyway, I still have a lot to learn in dealing with open source software and will try to find another (hopefully right) way to contact the developer(s).

Thanks again and best regards,

Andreas

On 2011-09-16 19:16, Freigeist A wrote:

> AFAIR this is a feature that is planned to be available in 12.1 and I
> think it would be a good thing if this script would remove older source
> and devel packages also.

In that case, being an official feature, as it doesn’t fully work, then
report as a bug in bugzilla.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I disagree with your proposition. Purge-kernels is part of the mkinitrd package. The script cleans up the /boot directory following a decision to over-ride the default kernel package behaviour (which would otherwise remove old versions). This has nothing to do with the kernel-devel and kernel-source packages.

I feel that the place for “purge-kernel-devels” and “purge-kernel-surces” scripts would be within their respective packages rather than mkinitrd. However it is possible to safely remove the sources etc. using YaST or zypper. It is not generally advisable to remove the running or (boot-loader) default kernels.

There is also the case of /lib/modules, which can get left with the remnants of old kernel modules. Personally I feel that this is really only of much concern to those who build kernels, modules etc. and they would probably want to not have someone else’s script deleting they specifically chose to install; they would probbly choose to use their own one-liner.

As this is about something from Factory, discussion really belongs in the “Pre-release/Beta” sub-forum.

On 2011-09-19 09:06, eng-int wrote:

> There is also the case of /lib/modules, which can get left with the
> remnants of old kernel modules. Personally I feel that this is really
> only of much concern to those who build kernels, modules etc. and they
> would probably want to not have someone else’s script deleting they
> specifically chose to install; they would probbly choose to use their
> own one-liner.

That’s a good point. But I understand the script triggers only if there is
a certain configuration parameter.

> As this is about something from Factory, discussion really belongs in
> the “Pre-release/Beta” sub-forum.

Absolutely.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

I experimented a bit. It seems that purge-kernels is not “triggered” but has to be run explicitly as root. It just takes its arguments (parameters) from */etc/zypp/zypp.conf:multiversion.kernels = *. I suspect that it was inspired as a convenience when developing/testing mkinitrd.