pmbootstrap install: add new `--cp` argument
We want to be able to install a foreign distro from the postmarketOS based installer OS, so it's easier for other distros to roll out full disk encryption, and so the mobile specific calamares stuff becomes a shared effort and everybody benefits from improvements. For an overview, see postmarketos-ondev#28.
In order for other distros to roll out their own configs and branding, they need to be able to modify the resulting installer OS. After thinking through several approaches (see below), the best solution seems to be:
$ pmbootstrap install \
--on-device-installer \
--no-rootfs \
--cp installer:root:os-image.img:/usr/share/.../os-image.img \
--cp installer:root:mobile.cfg:/etc/calamares/modules/mobile.cfg
--no-rootfs
will prevent pmbootstrap from building a postmarketOS based rootfs (#1966 (closed)).
--cp
with the format CHROOT:USER:SOURCE:TARGET
copies a file or directory from the host system (SOURCE
) to the path of the target chroot TARGET
. USER
is who will own the file afterwards, either root
or user
. CHROOT
is either installer
or rootfs
, so the same mechanism could be used to copy arbitrary files to the regular rootfs if desired (could be used to install your favorite tmux/neovim/zsh/... config, without packaging it first).
I had also thought of other approaches, but they did not seem suitable:
- require distros to modify postmarketos-ondev, then build the package from source
- (note that with the approach explained above, it's still possible to build packages from source before running
pmbootstrap install
) - less convenient
- requires each distro to have their own fork of postmarketos-ondev.git
- (note that with the approach explained above, it's still possible to build packages from source before running
- introducing pmbootstrap flags for all calamares mobile module config options
- big overhead
- config option changes need pmbootstrap changes, which isn't nice