projg2 / eclean-kernel2 Goto Github PK
View Code? Open in Web Editor NEWReboot of eclean-kernel [now defunct in favor of reviving ek1]
License: BSD 2-Clause "Simplified" License
Reboot of eclean-kernel [now defunct in favor of reviving ek1]
License: BSD 2-Clause "Simplified" License
Here is the output from # eclean-kernel -l
:
[4.6.3-gentoo]:
- build: /usr/src/linux-4.6.3-gentoo
- modules: /lib/modules/4.6.3-gentoo
[4.6.4-gentoo]:
- build: /usr/src/linux-4.6.4-gentoo
- modules: /lib/modules/4.6.4-gentoo
4.6.3-gentoo:
- aux: /boot/System.map-4.6.3-gentoo
- kernel: /boot/vmlinuz-4.6.3-gentoo
- aux: /boot/config-4.6.3-gentoo
4.6.3-gentoo.img:
- aux: /boot/initramfs-4.6.3-gentoo.img
4.6.4-gentoo:
- aux: /boot/System.map-4.6.4-gentoo
- aux: /boot/config-4.6.4-gentoo
- kernel: /boot/vmlinuz-4.6.4-gentoo
4.6.4-gentoo.img:
- aux: /boot/initramfs-4.6.4-gentoo.img
Initramfs'es are listed as separate kernels.
Hi,
After upgrading and before rebooting to the newly built kernel, eclean-kernel is detecting the new installed kernel as a candidate for renewal, even if using the -n option. For example, while running kernel 4.14.8-gentoo-r1, after installing and compiling 4.14.10-gentoo-r1, this version is considered as "old" on my system, even if it's select through eselect-kernel :
gateway boot # eselect-kernel list
Available kernel symlink targets:
[1] linux-4.14.8-gentoo-r1
[2] linux-4.14.10-gentoo-r1 *
gateway boot # eclean-kernel -p
The following kernels would be removed:
== [4.14.6-gentoo] ==
Rationale:
[-] stale files (no matching kernel)
Files:
== [4.14.7-gentoo] ==
Rationale:
[-] stale files (no matching kernel)
Files:
== [4.14.10-gentoo] ==
Rationale:
[-] stale files (no matching kernel)
Files:
== genkernel-x86_64-4.14.10-gentoo-r1 ==
Rationale:
[-] old
Files:
The following command would be run: grub-mkconfig -o /boot/grub/grub.cfg
gateway boot # uname -a
Linux gateway 4.14.8-gentoo-r1 #1 SMP Thu Dec 21 11:12:28 CET 2017 x86_64 Intel(R) Atom(TM) CPU C2550 @ 2.40GHz GenuineIntel GNU/Linux
You have to first reboot to newer kernel before using the cleaner. In older version, this was not an issue.
Would it be possible to fix this ?
eclean-kernel had the mentioned mode. It was possible to remove unneeded kernel files manually and use eclean-kernel for cleaning. Possible use cases: LTS kernel and current kernel installed simultaneously; bisecting kernel, which produces different versions. It would be useful in these cases to be able to select which kernels to remove, either by deleting vmlinux files manually, or providing versions to eclean-kernel -l
, e.g. eclean-kernel --keep-build-dir 4.6.3-gentoo 4.4.6-gentoo
When trying to do anything (list or pretend remove kernels), I get the error:
eclean-kernel: src/ek2/sorts.cxx:137: bool numeric_less(const VersionComponent&, const VersionComponent&): Assertion `a.end - ai == b.end - bi' failed.
Aborted
You can find the list of kernels I have installed from eclean-kernel (1) here (the large number of them is because I was doing a kernel bisect): https://bpaste.net/raw/9c14c557ad02
Hello.
It would be great to refresh grub2 config file automaticaly, so that removed kernels are cleaned also from grub2 config file.
Regards,
Stanislav
It used to work about a month ago, today it doesn't. I don't know after which update it broke.
eclean-kernel -l
eclean-kernel: src/ek2/sorts.cxx:137: bool numeric_less(const VersionComponent&, const VersionComponent&): Assertion `a.end - ai == b.end - bi' failed.
[1] 21858 abort (core dumped) eclean-kernel -l
With the following kernels:
# eclean-kernel -l
[4.6.3-gentoo]:
- build: /usr/src/linux-4.6.3-gentoo
- modules: /lib/modules/4.6.3-gentoo
[4.6.4-gentoo]:
- build: /usr/src/linux-4.6.4-gentoo
- modules: /lib/modules/4.6.4-gentoo
4.6.3-gentoo:
- aux: /boot/System.map-4.6.3-gentoo
- kernel: /boot/vmlinuz-4.6.3-gentoo
- aux: /boot/config-4.6.3-gentoo
4.6.3-gentoo.img:
- aux: /boot/initramfs-4.6.3-gentoo.img
4.6.4-gentoo:
- aux: /boot/System.map-4.6.4-gentoo
- aux: /boot/config-4.6.4-gentoo
- kernel: /boot/vmlinuz-4.6.4-gentoo
4.6.4-gentoo.img:
- aux: /boot/initramfs-4.6.4-gentoo.img
eclean-kernel -p -n 2
wants to delete sources for the newest ones:
The following kernels would be removed:
[4.6.3-gentoo]:
- /usr/src/linux-4.6.3-gentoo
- /lib/modules/4.6.3-gentoo
[4.6.4-gentoo]:
- /usr/src/linux-4.6.4-gentoo
- /lib/modules/4.6.4-gentoo
4.6.3-gentoo:
- /boot/System.map-4.6.3-gentoo
- /boot/vmlinuz-4.6.3-gentoo
- /boot/config-4.6.3-gentoo
4.6.3-gentoo.img:
- /boot/initramfs-4.6.3-gentoo.img
This is certainly not what I want most of the times. Please add an option to keep sources for the kernels which will be kept.
My grub config references 4.16.4, 5.4.8 (current) and 5.4.10. But eclean-kernel removes all but current. Root partition is in a btrfs, which might be a problem.
# eclean-kernel -a
Note: referenced kernel does not exist: /boot/root-subvolume/boot/vmlinuz-5.4.8-gentoo
Note: referenced kernel does not exist: /boot/root-subvolume/boot/vmlinuz-5.4.8-gentoo
Note: referenced kernel does not exist: /boot/root-subvolume/boot/vmlinuz-5.4.8-gentoo
Note: referenced kernel does not exist: /boot/root-subvolume/boot/vmlinuz-4.16.6-gentoo
Note: referenced kernel does not exist: /boot/root-subvolume/boot/vmlinuz-4.16.6-gentoo
Note: referenced kernel does not exist: /boot/root-subvolume/boot/vmlinuz-4.16.6-gentoo.old
Note: referenced kernel does not exist: /boot/root-subvolume/boot/vmlinuz-4.16.6-gentoo.old
Preserving currently running kernel (5.4.8-gentoo)
* Removing kernel 4.16.6-gentoo.old (not referenced by bootloader (grub2))
- /boot/vmlinuz-4.16.6-gentoo.old
- /boot/System.map-4.16.6-gentoo.old
- /boot/config-4.16.6-gentoo.old
* Removing kernel 4.16.6-gentoo (not referenced by bootloader (grub2))
- /boot/vmlinuz-4.16.6-gentoo
- /boot/System.map-4.16.6-gentoo
- /boot/config-4.16.6-gentoo
- /lib64/modules/4.16.6-gentoo
- /usr/src/linux-4.16.6-gentoo
* Removing kernel 5.4.10-gentoo (not referenced by bootloader (grub2))
- /boot/vmlinuz-5.4.10-gentoo
- /boot/System.map-5.4.10-gentoo
- /boot/config-5.4.10-gentoo
- /lib64/modules/5.4.10-gentoo
- /usr/src/linux-5.4.10-gentoo
Removed 3 kernels
app-admin/eclean-kernel-0.4.3::gentoo was built with the following:
USE="" ABI_X86="(64)" PYTHON_TARGETS="python2_7 python3_6 (-python3_7)"
Possibly related to EFI stub in the kernel
Version 1.99.4 prints
# eclean-kernel -p
The following kernels would be removed:
== 4.19.0-rc6-16400-g23adc26c1ac2 ==
Rationale:
[-] stale files (no matching kernel)
Files:
- /boot/System.map-4.19.0-rc6-16400-g23adc26c1ac2
- /boot/config-4.19.0-rc6-16400-g23adc26c1ac2
- /boot/initramfs-4.19.0-rc6-16400-g23adc26c1ac2.img
The following command would be run: grub-mkconfig -o /boot/grub/grub.cfg
So all files except vmlinuz are removed.
Older 0.4x.x instead prints
Invalid magic for kernel file /boot/vmlinuz-4.19.0-rc1-00117-g5b32735eb348 (!= HdrS)
I've also remorted it to https://bugs.gentoo.org/668352 but it was closed (emerge logs not provided). Not sure what logs I should provide as there is nothing else...
In case of system without kernel modules support, we get this :
eclean-kernel: terminating due to an error:
Unable to open directory /lib/modules: No such file or directory
Please add a parameter to disable search of kernel modules
Today eclean-kernel -n 3
removed 4.15.0 I just compiled leaving only current one (4.14.14). Rationale given was old
.
== 4.15.0-gentoo ==
Rationale:
[-] old
Files:
- /boot/vmlinuz-4.15.0-gentoo
- /usr/src/linux-4.15.0-gentoo
- /lib/modules/4.15.0-gentoo
- /boot/System.map-4.15.0-gentoo
- /boot/config-4.15.0-gentoo
- /boot/initramfs-4.15.0-gentoo.img
Request for an option to only clean kernels that have no matching ebuild.
It would be nice to be able to remove specific kernels, for example when machine was not rebooted for a while and updates installed more than one new kernel. Something like:
eclean-kernel -k 4.15.10-gentoo
to remove the given kernel.
Hi,
Would you consider supporting syslinux as bootloader ?
It would be nice if the systemd-boot/gummiboot /boot layout would be supported.
Sample data:
/boot/${MACHINE_ID}/4.7.0-gentoo:
insgesamt 18M
-rwxr-xr-x 1 root root 13M 28. Jul 00:56 initrd*
-rwxr-xr-x 1 root root 5.1M 28. Jul 00:56 linux*
/boot/${MACHINE_ID}/4.7.1-gentoo:
insgesamt 17M
-rwxr-xr-x 1 root root 12M 18. Aug 18:24 initrd*
-rwxr-xr-x 1 root root 5.1M 18. Aug 18:24 linux*
/boot/loader/entries/:
insgesamt 72K
-rwxr-xr-x 1 root root 315 28. Jul 00:56 ${MACHINE_ID}-4.7.0-gentoo.conf*
-rwxr-xr-x 1 root root 315 18. Aug 18:24 ${MACHINE_ID}-4.7.1-gentoo.conf*
These kernel images were created by /etc/kernel/postinst.d/30_kernel-install
:
#!/bin/sh
version="$1" ; shift
image="$1" ; shift
exec /usr/bin/kernel-install add "${version}" "${image}"
/usr/bin/kernel-install
is part of sys-apps/systemd.
Heyo, hoping you could help me out here, figure'd I'd file a bug report instead
of just annoying you on irc. As of right now eclean-kernel is unable to clean up
my old kernels, failing with the following errors.
proprietary-killer /usr/local/portage/personal # eclean-kernel
* Removing kernel 4.14.0-gentoo (vmlinuz does not exist)
eclean-kernel has met the following issue:
execv() arg 2 must contain only strings
If you believe that the mentioned issue is a bug, please report it
to https://bitbucket.org/mgorny/eclean-kernel/issues. If possible,
please attach the output of 'eclean-kernel --list-kernels' and your
regular eclean-kernel call with additional '--debug' argument.
proprietary-killer /usr/local/portage/personal # eclean-kernel --debug
* Trying bootloader lilo
* Trying bootloader grub2
** /boot/grub/grub.cfg found
* In get_removal_list()
* Removing kernel 4.14.0-gentoo (vmlinuz does not exist)
Traceback (most recent call last):
File "/usr/lib/python-exec/python2.7/eclean-kernel", line 26, in <module>
sys.exit(main(sys.argv))
File "/usr/lib64/python2.7/site-packages/ecleankernel/cli.py", line 209, in main
k.real_kv, k.vmlinuz])
File "/usr/lib64/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1025, in _execute_child
raise child_exception
TypeError: execv() arg 2 must contain only strings
proprietary-killer /usr/local/portage/personal # eclean-kernel --debug --list-kernels
4.14.3-gentoo [4.14.3-gentoo]:
- vmlinuz: /boot/vmlinuz-4.14.3-gentoo
- systemmap: /boot/System.map-4.14.3-gentoo
- config: /boot/config-4.14.3-gentoo
- initramfs: /boot/initramfs-4.14.3-gentoo.img
- modules: /lib64/modules/4.14.3-gentoo
- build: /usr/src/linux-4.14.3-gentoo
- last modified: 2017-12-01 22:45:24
4.14.1-gentoo [4.14.1-gentoo]:
- vmlinuz: /boot/vmlinuz-4.14.1-gentoo
- systemmap: /boot/System.map-4.14.1-gentoo
- config: /boot/config-4.14.1-gentoo
- initramfs: /boot/initramfs-4.14.1-gentoo.img
- modules: /lib64/modules/4.14.1-gentoo
- build: /usr/src/linux-4.14.1-gentoo
- last modified: 2017-11-22 13:51:24
4.14.0-gentoo [None]:
- modules: /lib64/modules/4.14.0-gentoo
- last modified: 2017-11-16 17:33:58
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.