[titan] Cannot boot kernel compiled with pmOS
It can happen as well to other devices.
LineageOS boot image is 8MB and I can flash it but my pmOS boot image is 12MB, of which 8MB is the kernel.
We need to find some way to make the kernel smaller. I had to disable CONFIG_KERNEL_XZ
otherwise the kernel would not boot. With CONFIG_KERNEL_LZMA
it won't boot either.
Things to investigate:
-
Why just enabling XZ kernel compression doesn't work (this works for hammerhead) -
How much we can achieve without the gzip wrapper (code) -
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-
Add a gzip layer around the already compressed vmlinuz (and repack boot.img) (*) -
Only compress initrd with XZ -
Load modules instead -
How can we know that is the size limit beforehand? -
Can we change this limit? Is it safe? -
Is this limit the same for all the devices?
(*) MartijnBraam said on IRC:
you can try compressing the xz kernel image with gzip so the bootloader unpacks only one layer
Your bootloader might be patched to always gunzip
Littlekernel should detect the gzip header and unpack before booting
This is the output of fastboot:
$ sudo fastboot flash boot boot.img
target reported max download size of 536870912 bytes
sending 'boot' (11920 KB)...
OKAY [ 0.461s]
writing 'boot'...
(bootloader) Image size exeeded partition limits
(bootloader) Preflash validation failed
FAILED (remote failure)
finished. total time: 0.501s
With LineageOS boot.img:
sudo fastboot flash boot boot.img
target reported max download size of 536870912 bytes
sending 'boot' (8192 KB)...
OKAY [ 0.352s]
writing 'boot'...
OKAY [ 0.459s]
finished. total time: 0.811s