Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can’t handle different file names. #25

Open
navid-zamani opened this issue Aug 22, 2021 · 3 comments
Open

Can’t handle different file names. #25

navid-zamani opened this issue Aug 22, 2021 · 3 comments

Comments

@navid-zamani
Copy link

I stopped calling my kernel files “vmlinuz” a long time ago, because it doesn’t fit modern systems and formats.
And eclean-kernel just removed ALL my kernels! If the config files hadn’t been saved somewhere else too, they’d be gone and I would have had to re-install from backups before rebooting, or been left with a broken system. :/

My layout is as follows: In /boot, there are symlinks
.config -> /boot/.config-$currentVersion
.config.stable -> /boot/.config-$lastVersion
System.map -> /boot/System.map-$currentVersion
System.map.stable -> /boot/System.map-$lastVersion
kernel -> /boot/kernel-$currentVersion
kernel.stable -> /boot/kernel-$lastVersion

E.g.
currentVersion=5.13.10-zen1.0
lastVersion=5.13.4-zen1.0

eclean-kernel deleted every System.map-* and every kernel-* and then all /etc/src/linux-* directories too, including the .config files therein.

Looking at its, frankly, gigantic amount of source code for such a simple program, I cannot even locate where to alter what it looks for to determine which kernels are still in use. It seems to all be much too generic code. So I’m even more surprised it failed for my case. (Did it fail because of the symlinks?)

So can you please enable people to specify how they named their stuff inside /boot?
Because like this, eclean-kernel is not only useless for all but “I don’t care, just do it the standard way” cases… when the whole point of Gentoo is that you care and customize… but it also can be out-performed by a 5-line bash script. (Or a Haskell one-liner, albeit in write-only code ;)

@thesamesam
Copy link
Contributor

thesamesam commented Aug 23, 2021

I stopped calling my kernel files “vmlinuz” a long time ago, because it doesn’t fit modern systems and formats.
And eclean-kernel just removed ALL my kernels! If the config files hadn’t been saved somewhere else too, they’d be gone and I would have had to re-install from backups before rebooting, or been left with a broken system. :/

My layout is as follows: In /boot, there are symlinks
.config -> /boot/.config-$currentVersion
.config.stable -> /boot/.config-$lastVersion
System.map -> /boot/System.map-$currentVersion
System.map.stable -> /boot/System.map-$lastVersion
kernel -> /boot/kernel-$currentVersion
kernel.stable -> /boot/kernel-$lastVersion

E.g.
currentVersion=5.13.10-zen1.0
lastVersion=5.13.4-zen1.0

eclean-kernel deleted every System.map-* and every kernel-* and then all /etc/src/linux-* directories too, including the .config files therein.

I would use --pretend in future, but it's of course unfortunate.

Looking at its, frankly, gigantic amount of source code for such a simple program, I cannot even locate where to alter what it looks for to determine which kernels are still in use. It seems to all be much too generic code. So I’m even more surprised it failed for my case. (Did it fail because of the symlinks?)

Nobody is making you use this, to be fair.

So can you please enable people to specify how they named their stuff inside /boot?
Because like this, eclean-kernel is not only useless for all but “I don’t care, just do it the standard way” cases… when the whole point of Gentoo is that you care and customize… but it also can be out-performed by a 5-line bash script. (Or a Haskell one-liner, albeit in write-only code ;)

Sure, Gentoo might have a lot of use for customisation, but that doesn't mean one particular upstream is obligated to make their software do what you want. It's worth being a little bit more polite when making feature requests IMO.

@jstrieter
Copy link

jstrieter commented Mar 28, 2024

The Gentoo distribution kernel package sys-kernel/gentoo-kernel has started calling their kernel "kernel-" instead of vmlinuz as of 6.6 so either this issue should be taken seriously or the eclean-kernel package deprecated and it's use discouraged on the Kernel/Removal page - or at least a warning added.

Edit: added output of --pretend.

% sudo eclean-kernel -p

Legend:
[-] file being removed
[+] file being kept (used by other kernels)

These are the kernels which would be removed:

  • modules-only 6.6.21-gentoo-dist: vmlinuz does not exist
    [-] /lib/modules/6.6.21-gentoo-dist/../../../src/linux-6.6.21-gentoo-dist
    [-] /lib/modules/6.6.21-gentoo-dist
    kernel-install will be called to perform prerm tasks.
    Bootloader grub2 config will be updated.

@yaaarg32
Copy link

yaaarg32 commented Jul 1, 2024

Ran into this same issue today when trying to automate some of my tasks.

eclean-kernel -n 4 -p
eclean-kernel has met the following issue:

SystemError('No vmlinuz found. This seems ridiculous, aborting.')

If you believe that the mentioned issue is a bug, please report it
to https://github.com/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.

I see a long list of "modules-only":
eclean-kernel --list-kernels
modules-only 6.9.6-gentoo-x86_64 [None]

  • modules: /lib/modules/6.9.6-gentoo-x86_64
  • build: /usr/src/linux-6.9.6-gentoo
  • last modified: 2024-06-27 09:18:57
    modules-only 6.9.5-gentoo-x86_64 [None]
  • modules: /lib/modules/6.9.5-gentoo-x86_64
  • build: /usr/src/linux-6.9.5-gentoo
  • last modified: 2024-06-21 21:03:33
    ...
    etc.

Debug:
DEBUG:root:Sorter: <ecleankernel.sort.VersionSort object at 0x7fd8e9a335f0>
DEBUG:root:Layout: <ecleankernel.layout.blspec.BlSpecLayout object at 0x7fd8e97a2870>
DEBUG:root:Bootloader failed: <class 'ecleankernel.bootloader.lilo.LILO'>
DEBUG:root:/boot/grub/grub.cfg found
DEBUG:root:Bootloader: <ecleankernel.bootloader.grub2.GRUB2 object at 0x7fd8e97a2810>
DEBUG:root:in get_removal_list()
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.12/eclean-kernel", line 8, in
sys.exit(setuptools_main())
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/ecleankernel/main.py", line 391, in setuptools_main
sys.exit(main(sys.argv[1:]))
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/ecleankernel/main.py", line 251, in main
removals = get_removal_list(
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/ecleankernel/process.py", line 81, in get_removal_list
raise SystemError(
SystemError: No vmlinuz found. This seems ridiculous, aborting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants