A fast way to flash incrementally compiled kernels
In the following issue https://gitlab.com/postmarketOS/linux-postmarketos/issues/8 @pparent asks:
General question: So that I can work on this with most ease, can you tell what is the easiest way to recompile and flash on nexus 5 a modified version of the kernel (with just few modifications in some source files)?
Such a thing does not exist I think this is something that could done by pmbootstrap. The workflow is outlined below.
Set up envkernel
$ source pmbootstrap/helpers/envkernel.sh
$ make <defconfig>
Incremental compiles
$ make
# Flash the kernel
# Modify source code
# Incremental compile
$ make
# Flash the updated kernel
# Modify source code again
# Incremental compile
$ make
# Flash the updated kernel
# etc...
The step we are missing is a way to flash incrementally compiled kernels. What could be implemented in pmbootstrap:
Installing an updated kernel
- Leverage mkinitfs to package boot image with kernel compiled in envkernel(?)
- Possible methods to flash an updated kernel:
a. Use flasher to install incrementally compiled kernel.
$ pmbootstrap flasher flash_kernel
b. Push boot image to device. Write boot partition withdd if=boot.img of=/dev/mmcblkXpY
Dangerous: Easy to mistakenly write the wrong partition
c. Package AnyKernel updater with the zImage from envkernel. Then adb sideload the package.
d. Build kernel apk package from envkernel ???
Edited by Administrator