projg2 / eclean-kernel2

Reboot of eclean-kernel [now defunct in favor of reviving ek1]
BSD 2-Clause "Simplified" License
17 stars 6 forks source link

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

Open uzytkownik opened 6 years ago

uzytkownik commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

mgomersbach commented 6 years ago
$ 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 commented 6 years ago

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

mgorny commented 6 years ago

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

mgomersbach commented 6 years ago
$ 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
sashs commented 5 years ago

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.