This replaces the mkinitfs script with a re-write (in Go). The
re-written mkinitfs will atomically replace the initfs in /boot, check
for free space before doing so, and try to do whatever it can to not
leave the system in an unbootable state by botching the initfs
creation/installation.
pmb:cross-native with go cross compiling doesn't work exactly, it makes
the correct binary, but on Alpine go uses -buildmode=pie which creates a
dynamic thing, and the interpreter is wrong (e.g. it it set to use the
host arch's interpreter, like /lib/ld-musl-x86_64 even though
GOARCH=arm64)
The init.sh script is no longer a template, "initramfs-extra" is used.
Fixes https://gitlab.com/postmarketOS/pmaports/-/issues/1019
fixes https://gitlab.com/postmarketOS/pmaports/-/issues/660
We now trigger on files in /usr/share/postmarketos-mkinitfs-triggers.
This can be used by other packages like osk-sdl for which an updated
version would otherwise never be used in the initramfs
* Fail if mkbootimg/uboot-tools are not installed, but creating a
boot.img file / u-boot legacy image was requested via deviceinfo
(fixes#312)
* Fail if /boot/dt.img is missing, but we have a qcdt device
* Fail if the dtb file specified in deviceinfo does not exist
* Fail if mkbootimg etc. exit with error code
* Don't try to add the ext4 module into the initramfs. We always
compile it into the kernel. Instead, kconfig_check makes sure it
is enabled now. (fixes#1037)
* Add a note that modprobe warnings can be ignored mostly