eclean-kernel
eclean-kernel copied to clipboard
systemd-boot support
It'd be nice if systemd-boot, former gummiboot, was supported.
Good news, everyone. I've started reviving the project, and this is next on my TODO list. So maybe tomorrow.
tomorrow, eh?
tomorrow, eh?
Don't you see the commit, though?
I do, it looks like it's not finding my kernel because it was installed as linux
and not vmlinuz
as it expects.
or being placed in a subdir of /boot/<machine_id> like /boot/<machine_id>/<KERNEL_VER>
clean-kernel -n 5 -p --debug
DEBUG:root:Layout: <ecleankernel.layout.blspec.BlSpecLayout object at 0x7f501b934df0>
DEBUG:root:Bootloader failed: <class 'ecleankernel.bootloader.lilo.LILO'>
DEBUG:root:Bootloader failed: <class 'ecleankernel.bootloader.grub2.GRUB2'>
DEBUG:root:Bootloader failed: <class 'ecleankernel.bootloader.grub.GRUB'>
DEBUG:root:Bootloader failed: <class 'ecleankernel.bootloader.yaboot.Yaboot'>
DEBUG:root:Bootloader: <ecleankernel.bootloader.symlinks.Symlinks object at 0x7f501b934eb0>
DEBUG:root:Sorter: <ecleankernel.sort.VersionSort object at 0x7f501b934e20>
DEBUG:root:in get_removal_list()
Preserving currently running kernel (5.11.2)
Legend:
[-] file being removed
[+] file being kept (used by other kernels
These are the kernels which would be removed:
- 5.10.18: vmlinuz does not exist
[-] /boot/dbca93ecd27d4e08aa36d39eedea459f/5.10.18/initrd
[-] /boot/dbca93ecd27d4e08aa36d39eedea459f/5.10.18/linux
[-] /boot/dbca93ecd27d4e08aa36d39eedea459f/5.10.18
[-] /lib/modules/5.10.18/../../../usr/src/linux-5.10.18
[-] /lib/modules/5.10.18
- 5.10.19: vmlinuz does not exist
[-] /boot/dbca93ecd27d4e08aa36d39eedea459f/5.10.19/initrd
[-] /boot/dbca93ecd27d4e08aa36d39eedea459f/5.10.19/linux
[-] /boot/dbca93ecd27d4e08aa36d39eedea459f/5.10.19
[-] /lib/modules/5.10.19/../../../usr/src/linux-5.10.19
[-] /lib/modules/5.10.19
- 5.6.13-gentoo: vmlinuz does not exist
[-] /usr/src/linux-5.6.13-gentoo
[-] /lib/modules/5.6.13-gentoo
- 5.9.3-gentoo: vmlinuz does not exist
[-] /usr/src/linux-5.9.3-gentoo
[-] /lib/modules/5.9.3-gentoo
magic number returned is ynam
and not HdrS
. However, my kernel version is also at 61440 bytes into the file and not 14848 bytes in.
I guess you need to teach it how to find the (compressed?) kernel image.
Ya, how to read the efi binary to find the kernel image and then from that read the kernel version (as I mentioned on irc last night).
If you need inspiration for parsing the PE file headers, I threw this together in a hurry - though I did this for self-practice and I don't mean to steal the show from prometheanfire. https://github.com/Jannik2099/eclean-kernel/blob/efistub/ecleankernel/file.py#L169
I can confirm that the the edit seems to work. https://github.com/Jannik2099/eclean-kernel/commit/32b1a2d48813fec60826fa5f23a54c9ff4774588
Oh, I'm positively surprised that this is in working condition, heh - I can't predict when I'll find time to work on this, so anyone may feel free to pick up from here.