Open ermo opened 1 year ago
Looks like this needs a bit of design work:
binDir
of the executed binary for executing sister binaries:
/usr/local/bin/boulder => binDir = /usr/local/bin/{moss, moss-container}
/usr/bin/boulder => binDir = /usr/bin/{moss, moss-container}
-C foo
, use configPrefix = foo
and assume default vendorPrefix = /usr
for config filesconfigPrefix = /
and set vendorPrefix = binDir/..
NB: In normal use, full paths aren't specified, so the first hit in $PATH will be used. Hence, it will likely be useful if binaries explicitly specify their binDir in a trace
statement (to verify assumptions).
Examples:
## pkg manager boulder, automagically deduced relative vendorPrefix
sudo /usr/bin/boulder build stone.yml
# binDir= /usr/bin
# configPrefix = /
# vendorPrefix = /usr/bin/..
# configuration file searchPath = [/usr/bin/../share/boulder, /etc/boulder]
## onboarding boulder, automagically deduced relative vendorPrefix
sudo /usr/local/bin/boulder build stone.yml
# binDir = /usr/local/bin
# configPrefix = /
# vendorPrefix = /usr/local/bin/..
# configuration file searchPath = [/usr/local/bin/../share/boulder, /etc/boulder]
## onboarding boulder, pkg manager configPrefix (bugfix test case)
sudo /usr/local/bin/boulder -C / build stone.yml
# binDir = /usr/local/bin
# configPrefix = /
# vendorPrefix = /usr
# configuration file searchPath = [/usr/share/boulder, /etc/boulder]
## pkg manager boulder, custom configPrefix
sudo /usr/bin/boulder -C /var/lib/machines/sosroot build stone.yml
# binDir = /usr/bin
# configPrefix = /var/lib/machines/sosroot
# vendorPrefix = /var/lib/machines/sosroot/usr
# configuration file searchPath = [/var/lib/machines/sosroot/usr/share/boulder, /var/lib/machines/sosroot/etc/boulder]
@ikeycode: Does ^ sound about right to you?
This should allow e.g. /usr/local/bin/boulder to look for its configuration files in /usr/local/bin/../share/
Depends on https://github.com/serpent-os/libmoss/pull/2