Right now you either need to use fastboot/odin or a recovery to flash a kernel update. Since we have a cool package manager we could avoid this.
The kernel package installs the kernel image in /boot, all we need is a shell script that generates and flashes the boot.img.
Good idea! Some remarks:
/boot on the sdcard, it is already working there (in theory, if you have a binary package for the kernel update)mkbootimg already generates the boot.img file (and mkbootimg gets called when you update the kernel, just like in Alpine!), so all that is left to do is flashing it to the boot partition afterwards.I've confirmed that kernel updates, using apk, install properly on the N900 now that /boot is mounted on boot.
@ollieparanoid where is mkbootimg called?
(We always call mkbootimg through mkinitfs)
I'd prefer a command like update-kernel, that you can run manually to flash the updated kernel.
Yeah, that seems to be a lot safer right now, good idea!
Just word of warning -- if power fails during update. There should still be way to recover with fastboot.
As long as we do not overwrite fastboot, this will still work 馃憤
The best solution of course would be having a proper recovery for postmarketOS which gets flashed to the recovery partition which can fix stuff 馃槈
@z3ntu: that is a bit tricky, because the recovery partition does not work the same way for all devices. Some Samsungs for example can't really have their own recovery kernel there, they were supposed to only have their own initramfs. Also non-Androids will probably not have such a recovery partition. In the long run it might make sense to provide a custom bootloader (which may load after fastboot) from where you can choose the kernel you want to boot (with the last working kernel as backup, like you can do it on PCs now with most Linux distributions, see also #421, and it already works that way on the N900 because of u-boot). But this is getting a bit off-topic, if you're interested in discussing that idea, I suggest we do it in a new issue.
Second-stage bootloader is also what EFIDroid does (getting back to #421 ^^) and it's currently being rewritten to support touchscreen and having a nice UI so maybe when this rewrite is done, we can take a look at EFIDroid again :)
Is resolved by #625. Can we now close this?
Most helpful comment
I've confirmed that kernel updates, using apk, install properly on the N900 now that /boot is mounted on boot.