Merge pull request #396 from mwhudson/include-curtin

include curtin in snap
This commit is contained in:
Michael Hudson-Doyle 2018-11-21 10:34:44 +13:00 committed by GitHub
commit daba9990f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 16 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

@ -19,6 +19,16 @@ apps:
restart-condition: always
parts:
curtin:
plugin: python
source-type: git
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:
plugin: python
build-packages:
@ -53,11 +63,11 @@ parts:
plugin: dump
build-packages:
- user-setup
prepare: |
override-build: |
echo "get passwd/user-default-groups" | \
debconf-communicate user-setup | \
cut -d ' ' -f 2- > users-and-groups
cp /usr/lib/user-setup/reserved-usernames .
cut -d ' ' -f 2- > $SNAPCRAFT_PART_INSTALL/users-and-groups
cp /usr/lib/user-setup/reserved-usernames $SNAPCRAFT_PART_INSTALL/
stage-packages: [libc6]
stage:
- users-and-groups
@ -69,8 +79,8 @@ parts:
- locales
- xkb-data-i18n
stage-packages: [libc6]
prepare: |
/usr/share/console-setup/kbdnames-maker /usr/share/console-setup/KeyboardNames.pl > kbdnames.txt
override-build: |
/usr/share/console-setup/kbdnames-maker /usr/share/console-setup/KeyboardNames.pl > $SNAPCRAFT_PART_INSTALL/kbdnames.txt
stage:
- kbdnames.txt
font:

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):