Move PATH setup from agetty service into subiquity itself

This way `sudo snap run subiquity` will have the correct PATH for
probert/utils/curtin, as needed when running subiquity from ssh
session.
This commit is contained in:
Dimitri John Ledkov 2019-10-04 00:51:56 +01:00
parent e62045f9a5
commit e6dd21be6e
2 changed files with 8 additions and 1 deletions

View File

@ -4,7 +4,6 @@ if [ -n "$1" ]; then
port=$1
fi
/bin/dmesg -n 1
export PATH=$SNAP/bin:$SNAP/usr/bin:$PATH
if [ "$port" = "tty1" ]; then
$SNAP/usr/bin/subiquity-loadkeys
setfont $SNAP/subiquity.psf

View File

@ -84,6 +84,14 @@ AUTO_ANSWERS_FILE = "/subiquity_config/answers.yaml"
def main():
# Preffer utils from $SNAP, over system-wide
snap = os.environ.get('SNAP')
if snap:
os.environ['PATH'] = os.pathsep.join([
os.path.join(snap, 'bin'),
os.path.join(snap, 'usr', 'bin'),
os.environ['PATH'],
])
opts = parse_options(sys.argv[1:])
global LOGDIR
if opts.dry_run: