Skip to content
This repository has been archived by the owner on May 24, 2020. It is now read-only.

eclean-kernel -n 3 removed all kernels but current one #15

Open
uzytkownik opened this issue Jan 29, 2018 · 8 comments · May be fixed by #20
Open

eclean-kernel -n 3 removed all kernels but current one #15

uzytkownik opened this issue Jan 29, 2018 · 8 comments · May be fixed by #20

Comments

@uzytkownik
Copy link

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
@oz123
Copy link

oz123 commented Feb 4, 2018

Hi,
I encountered the same bug.

I was not sure I even understood the output of this command. So I tried:

# diff <(eclean-kernel -n 4 -p 2>&1) <(eclean-kernel -n 3 -p 2>&1)
25a26,35
> == 4.9.79-gentoow-1 ==
> Rationale:
> [-] old
> Files:
> - /boot/System.map-4.9.79-gentoow-1
> - /boot/config-4.9.79-gentoow-1
> - /boot/vmlinuz-4.9.79-gentoow-1
> - /usr/src/linux-4.9.79-gentoo
> - /lib/modules/4.9.79-gentoow-1
> 
yeni2 / # eclean-kernel -n 3 2>1 
yeni2 / # ls /boot/
config-4.9.80-gentoow-1  grub  System.map-4.9.80-gentoow-1  vmlinuz-4.9.80-gentoow-1

@mgomersbach
Copy link

Same here:
Before:

$ eclean-kernel -l
genkernel-x86_64-4.15.10-gentoo:
- aux: /boot/System.map-genkernel-x86_64-4.15.10-gentoo
- kernel: /boot/kernel-genkernel-x86_64-4.15.10-gentoo
- build: /usr/src/linux-4.15.10-gentoo
- modules: /lib/modules/4.15.10-gentoo

Then after building and installing a new version and placing it in boot and grub:

$ eclean-kernel -p
The following kernels would be removed:

== genkernel-x86_64-4.15.12-gentoo ==
Rationale:
[-] old
Files:
- /boot/System.map-genkernel-x86_64-4.15.12-gentoo
- /boot/kernel-genkernel-x86_64-4.15.12-gentoo
- /usr/src/linux-4.15.12-gentoo
- /lib/modules/4.15.12-gentoo
- /boot/initramfs-genkernel-x86_64-4.15.12-gentoo

The following command would be run: grub-mkconfig -o /boot/grub/grub.cfg

--sort-order does not seem to change behavior as well

@mgorny
Copy link
Member

mgorny commented Mar 22, 2018

Could you give eclean-kernel -l for after state?

@mgomersbach
Copy link

$ eclean-kernel -l
genkernel-x86_64-4.15.10-gentoo:
- aux: /boot/System.map-genkernel-x86_64-4.15.10-gentoo
- kernel: /boot/kernel-genkernel-x86_64-4.15.10-gentoo
- build: /usr/src/linux-4.15.10-gentoo
- modules: /lib/modules/4.15.10-gentoo

@mgomersbach
Copy link

Or did you mean "after installing" because this is "after (e)cleaning"?

@mgorny
Copy link
Member

mgorny commented Mar 22, 2018

Yes, I meant 'after installing' but 'before cleaning'.

@mgomersbach
Copy link

$ eclean-kernel -l
genkernel-x86_64-4.15.10-gentoo:
- kernel: /boot/kernel-genkernel-x86_64-4.15.10-gentoo
- build: /usr/src/linux-4.15.10-gentoo
- modules: /lib/modules/4.15.10-gentoo
- aux: /boot/System.map-genkernel-x86_64-4.15.10-gentoo
genkernel-x86_64-4.15.12-gentoo:
- kernel: /boot/kernel-genkernel-x86_64-4.15.12-gentoo
- build: /usr/src/linux-4.15.12-gentoo
- modules: /lib/modules/4.15.12-gentoo
- aux: /boot/System.map-genkernel-x86_64-4.15.12-gentoo

anchorite added a commit to anchorite/eclean-kernel2 that referenced this issue Nov 17, 2018
The calculation how many kernels to remove before this commit was not
taking in account kernels which are already marked for removal. Thus
when adding new kernels for removal the logic would end up removing more
than the user requested.

This commit just adds the already marked for removal kernels to the
calculation.

Should fix projg2#15.
@anchorite anchorite linked a pull request Nov 17, 2018 that will close this issue
@sashs
Copy link

sashs commented Jan 23, 2019

Hi,

eclean-kernel still does not recognize how many kernels to leave. The currently running kernel is 4.20.3. I updated the kernel to 4.20.4, but didn't reboot the system.

eclean-kernel only wants to leave kernel 4.20.3 and wants to delete all other ones, although I set -n to 3. In my opinion it should leave the kernels 4.20.2 to 4.20.4.

# eclean-kernel -p -n3 

...
== 4.20.0-gentoo ==
Rationale:
[-] old
Files:
- /boot/vmlinuz-4.20.0-gentoo
- /usr/src/linux-4.20.0-gentoo
- /lib/modules/4.20.0-gentoo
- /boot/System.map-4.20.0-gentoo
- /boot/config-4.20.0-gentoo

== 4.20.1-gentoo ==
Rationale:
[-] old
Files:
- /boot/vmlinuz-4.20.1-gentoo
- /usr/src/linux-4.20.1-gentoo
- /lib/modules/4.20.1-gentoo
- /boot/System.map-4.20.1-gentoo
- /boot/config-4.20.1-gentoo

== 4.20.2-gentoo ==
Rationale:
[-] old
Files:
- /boot/vmlinuz-4.20.2-gentoo
- /usr/src/linux-4.20.2-gentoo
- /lib/modules/4.20.2-gentoo
- /boot/System.map-4.20.2-gentoo
- /boot/config-4.20.2-gentoo

== 4.20.4-gentoo ==
Rationale:
[-] old
Files:
- /boot/vmlinuz-4.20.4-gentoo
- /usr/src/linux-4.20.4-gentoo
- /lib/modules/4.20.4-gentoo
- /boot/System.map-4.20.4-gentoo
- /boot/config-4.20.4-gentoo

eclean-kernel always wants to delete those kernels, it does not matter which number I set.

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

Successfully merging a pull request may close this issue.

5 participants