invoke curtin from the snap

This commit is contained in:
Michael Hudson-Doyle 2018-11-19 15:06:41 +13:00
parent 1a28d8b9c2
commit 69f018db5b
4 changed files with 8 additions and 11 deletions

View File

@ -1,5 +1,6 @@
#!/bin/sh
/bin/dmesg -n 1
export PATH=$SNAP/bin:$SNAP/usr/bin:$PATH
$SNAP/usr/bin/subiquity-loadkeys
setfont $SNAP/subiquity.psf
/sbin/agetty -n --noclear -l $SNAP/usr/bin/python3 -o $SNAP/usr/bin/subiquity tty1 $TERM

View File

@ -25,6 +25,8 @@ parts:
source: git://git.launchpad.net/curtin
source-branch: ubuntu/devel
requirements: requirements.txt
organize:
'lib/python*/site-packages/usr/lib/curtin': 'usr/lib/'
stage: [ "*", "-lib/python*/site-packages/_yaml.*.so" ]
stage-packages: [libc6]
subiquity:

View File

@ -41,10 +41,6 @@ checks:
directory:
- /proc
- /sys
exec:
file:
- /sbin/hdparm
- /usr/bin/curtin
'''

View File

@ -17,6 +17,7 @@ import datetime
import logging
import os
import subprocess
import sys
import urwid
import yaml
@ -86,10 +87,10 @@ class InstallProgressController(BaseController):
self.progress_view.show_complete(True)
self.default()
def _bg_run_command_logged(self, cmd, env):
def _bg_run_command_logged(self, cmd):
cmd = ['systemd-cat', '--level-prefix=false',
'--identifier=' + self._log_syslog_identifier] + cmd
return utils.run_command(cmd, env=env)
return utils.run_command(cmd)
def _journal_event(self, event):
if event['SYSLOG_IDENTIFIER'] == self._event_syslog_identifier:
@ -154,7 +155,7 @@ class InstallProgressController(BaseController):
log.debug("Installprogress: this is the *REAL* thing")
config_location = os.path.join('/var/log/installer',
config_file_name)
curtin_cmd = ['curtin', '--showtrace', '-c',
curtin_cmd = [sys.executable, '-m', 'curtin', '--showtrace', '-c',
config_location, 'install']
ident = self._event_syslog_identifier
@ -183,11 +184,8 @@ class InstallProgressController(BaseController):
curtin_cmd = self._get_curtin_command()
log.debug('Curtin install cmd: {}'.format(curtin_cmd))
env = os.environ.copy()
if 'SNAP' in env:
del env['SNAP']
self.run_in_bg(
lambda: self._bg_run_command_logged(curtin_cmd, env),
lambda: self._bg_run_command_logged(curtin_cmd),
self.curtin_install_completed)
def curtin_install_completed(self, fut):