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

Modules not coupled to kernels #2

Closed zeule closed 8 years ago

zeule commented 8 years ago

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.

zeule commented 8 years ago

Oh, the modules are coupled with sources! Then this is an obvious bug. The modules have to be kept.

mgorny commented 8 years ago

Yes, for some reason it doesn't read the kernel version correctly from your kernel files. Could you paste the output of:

file /boot/vmlinuz-4.6.4-gentoo

Besides, the removal of sources is to be reworked. Eventually I want ek2 to only kill builddirs, and leave sources to emerge. It's a non-trivial problem though.

zeule commented 8 years ago

Please:

$ file /boot/vmlinuz-4.6.4-gentoo
/boot/vmlinuz-4.6.4-gentoo: Linux kernel x86 boot executable bzImage, version 4.6.4-gentoo (root@tiger) #1 SMP Wed Jul 13 22:14:09 CEST 2016, RO-rootFS, swap_dev 0x4, Normal VGA
mgorny commented 8 years ago

Hmm, looks like ek2 doing something wrong then ;-f. Would you be able to send me the compiled file? (assuming you keep no secrets inside ;-)). Either mail it (mgorny@g.o) or use some random file sharing service ;-).

zeule commented 8 years ago

Excuse me, don't understand which file: the kernel or the eclean-kernel binary?

mgorny commented 8 years ago

The kernel ;-).

zeule commented 8 years ago

Mailed to the g.o address.

mgorny commented 8 years ago

Excuse me but I don't seem to have anything in inbox or spam. Are you sure that you typed the address correctly? @g.o expands into gentoo.org.

zeule commented 8 years ago

Yes, gentoo.org domain. GMail recognized you as the owner of the e-mail. Anyway, the file is here: https://drive.google.com/file/d/0B6hiAwMSyJYMbk93QjZNTUFmWm8/view?usp=sharing

mgorny commented 8 years ago

Thanks for finding a corner case ;-). It turned out to be a sign error, it should be fixed now.