Make postmarketos-mkinitfs easier to maintain
Created by: ollieparanoid
Creating #1133 (closed) (mkinitfs: Fail on missing depends / better usability in general) would have been a lot easier if there wasn't so much to manually test. Here are some ideas to improve maintainability, comments welcome!
-
mkinitfs.sh
: use#!/bin/sh -e
, so it fails when any command in the script fails - make it pass
shellcheck
and test against it in CI - split the
mkinitfs
code up in multiple files (at least two) - make the
mkinitfs
usage simpler. the current one was done for compatibility with Alpine'smkinitfs
. But since we roll our own kernels anyway, there's no real need to keep it that way. We could at least optionally support easier syntax. - create testcases for each possible error case (e.g. missing
mkbootimg
, but creating aboot.img
was requested) - possible test case: boot up a qemu VM with the mainline kernel, and with the android kernel, and check if the network connections work in both cases
- I think it makes sense to move it to its own repository.
- upside: much better testing possible, which does not slow down main
pmbootstrap
repository testing. - upside: we can put initramfs related issues into its own repository.
- downside: sometimes we make changes that require code editing in both
postmarketos-mkinitfs
and the rest of thepmbootstrap
code. That would get a bit harder. - downside:
pmbootstrap initfs hook_ls
needs to be adjusted
- upside: much better testing possible, which does not slow down main