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:
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:
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.
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).
> 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.
> 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.