Skip to content

Reduce the sourcing of deviceinfo in pmaports

Pablo Correa Gomez requested to merge deviceinfo-relocation into master

Most of these uses are redundant, can be abstracted away with improvements in packaging, or run in the initfs and therefore can use the new function available there.

This greatly reduces the number of times /etc/deviceinfo is requested throughout pmaports:

user@alpine-edge:~/data/Informatica/postmarketOS/pmaports$ git grep -l /etc/deviceinfo | cut -d'/' -f'-2' | uniq
main/devicepkg-dev
main/postmarketos-base
main/postmarketos-bootsplash
main/postmarketos-initramfs
main/postmarketos-update-depthcharge-kernel
main/postmarketos-update-kernel

Most of those do run in the regular installation, and are basically sourcing deviceinfo. So I'm wondering what's the best way to further reduce the use. I was thinking:

  • Create a subpackage in devicepkg-dev that is not just for development, and can be installed and sourced in the regular rootfs.
  • Possibly source /usr/share/mkinitfs/init_functions.sh, though this is terribly ugly.
  • Implement the double sourcing in every script (not unreasonable, I have to admit, the logic is dead-simple).
  • Just create a small package for that, but this feels an overkill. Maybe it'd still make more sense after some of the things @calebccff had been thinking about?

Helps #1836 (closed)

Merge request reports