toltec
toltec copied to clipboard
Kernelctl
This is a utility to manage aftermarket kernels.
Does it make sense to force bz2 compression as the only option? It might make more sense to allow multiple compression algorithms to be used, like xz, gz, zstd.
I do not see the benefit in allowing different compression formats: there are no preexisting kernels that we need to accommodate for so we might as well ask for a specific format. Moreover dealing with multiple formats would add a small complexity to the script.
Fair enough. The next question is why bz2 instead of one of the other formats?
Higher compression rate compared to gz. I do not really have a preference.
If the compression ratio is what we want, and we aren't concerned about decompression speed, xz would be the better option. If we care about decompression speed while still having a good compression ratio, zstd would be better.
I am not sure compression rate is such a concern: the backup of the vendor kernel is currently around 5.6M. Compression time is indeed quite slow with bz2. zstd is not currently available in the official firmware but we could depend on the toltec version.
Here is a testing kernel you can use to check that kernelctl works. It is for RM2. It is basically the same as the current upstream kernel with uinput
enabled and TRIM_UNUSED_KSYMS=n
.
edit: the kernel here had an issue with RDINS
GH is just dumb: I can attach a .gz
but not a .bz2
so please just rename it to vendor_patched-20220315.tar.bz2
before using it.
PS: if there is enough interest in having the upstream kernel with few modifications in toltec I might easily be persuaded to make a package.
@Etn40ff I'm on a rM1 so I can't test, but it looks like the automated checks are complaining about the script not following the style guide. You'll need to resolve that before it can be merged.
~~It should be fixed now.~~ Oops, now the linter complains. This will take longer, I'll have a look at it tomorrow.
As for the file format, should I switch to zstd or xz?
Kernelctl should in theory work as well on a rm1. Actually it need testing there but I do not own a rm1. Could you do it? Do you need me to provide a testing kernel for you? Should I make a toltec package with the modifications I use on my rm2 (uevent, tun/tap, and TRIM_UNUSED_KSYMS=n
)?
Automated checks should be fine now
I am unhappy of the current status:
Currently this script passes the list produced by tar tjf current_kernel_backup.tar.bz2
to rm -rf
to clear up before installing the new kernel. The flags -rf
are needed because a directory might be passed to rm before it has been emptied and it would give an error.
Obviously this is an easy recipe for disaster: if the kernel backup is not properly formatted one could delete something that should not be deleted. (I just erased the whole /lib
this way and I was not a happy camper.) Any suggestion on a better way to delete all files and directories (if empty) from a list?
I might have answered my own question but better solutions are welcome
Here is a better kernel for testing on RM2: I messed up the previous one.
This is vanilla + uinput + tun - TRIM_UNUSED_KSYMS vendor_patched-20220329.tar.bz2.zip
Any update on this? I'd love to get https://github.com/toltec-dev/toltec/pull/488 merged
Any update on this? I'd love to get #488 merged
I pinged toltec's team over Discord few days ago, they said that they wanted to focus on getting a stable release out first. That happened already so, hopefully, they will have some spare time soon.
Any updates?
Tested on RM1 with linux-stracciatella. kernelctl works as advertised. Thank you!