serpent-os / boulder-d-legacy

Replaced by Rust tooling
https://serpentos.com
21 stars 7 forks source link

controller: Add relative vendor prefix by default #71

Open ermo opened 1 year ago

ermo commented 1 year ago

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

ermo commented 1 year ago

Looks like this needs a bit of design work:

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?