From 2408dda6c733528a696a25d424b5cd65235a8e53 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 26 Jan 2017 11:18:03 +1300 Subject: [PATCH] remove references to firstboot (an old name for console-conf?) --- bin/console-conf-tui | 4 -- bin/subiquity-tui | 4 -- console_conf/controllers/identity.py | 4 +- firstboot.md | 63 ---------------------------- firstboot.sh | 23 ---------- subiquity/curtin.py | 1 - subiquitycore/user.py | 6 +-- subiquitycore/utils.py | 6 +-- 8 files changed, 8 insertions(+), 103 deletions(-) delete mode 100644 firstboot.md delete mode 100755 firstboot.sh diff --git a/bin/console-conf-tui b/bin/console-conf-tui index 8e62eeae..3b5ea2f8 100755 --- a/bin/console-conf-tui +++ b/bin/console-conf-tui @@ -46,10 +46,6 @@ def parse_options(argv): parser.add_argument('--dry-run', action='store_true', dest='dry_run', help='menu-only, do not call installer function') - # XXX Defaults to firstboot mode unless one runs subiquity --install. - parser.add_argument('--install', action='store_false', - dest='firstboot', default=True, - help='run installer in firstboot mode') parser.add_argument('--serial', action='store_true', dest='run_on_serial', help='Run the installer over serial console.') diff --git a/bin/subiquity-tui b/bin/subiquity-tui index b211682e..0f62db60 100755 --- a/bin/subiquity-tui +++ b/bin/subiquity-tui @@ -53,10 +53,6 @@ def parse_options(argv): parser.add_argument('--dry-run', action='store_true', dest='dry_run', help='menu-only, do not call installer function') - # XXX Defaults to firstboot mode unless one runs subiquity --install. - parser.add_argument('--install', action='store_false', - dest='firstboot', default=True, - help='run installer in firstboot mode') parser.add_argument('--serial', action='store_true', dest='run_on_serial', help='Run the installer over serial console.') diff --git a/console_conf/controllers/identity.py b/console_conf/controllers/identity.py index c6b50e15..b1a768a8 100644 --- a/console_conf/controllers/identity.py +++ b/console_conf/controllers/identity.py @@ -21,7 +21,7 @@ import sys from subiquitycore.controller import BaseController from subiquitycore.models import IdentityModel -from subiquitycore.utils import disable_first_boot_service, run_command +from subiquitycore.utils import disable_console_conf, run_command from console_conf.ui.views import IdentityView, LoginView @@ -182,6 +182,6 @@ class IdentityController(BaseController): def login_done(self): if not self.opts.dry_run: # stop the console-conf services (this will kill the current process). - disable_first_boot_service() + disable_console_conf() self.signal.emit_signal('quit') diff --git a/firstboot.md b/firstboot.md deleted file mode 100644 index 52d506e1..00000000 --- a/firstboot.md +++ /dev/null @@ -1,63 +0,0 @@ -Firstboot ---------- - -Firstboot is a tui that runs on the device's getty interfaces when a -system has not yet been configured. It displays the current network -configuration and allows user to modify that. It also collects -user information used to create a local user and import ssh public keys - - -Getting Started ---------------- - -Install pre-reqs: - - % sudo apt-get update && sudo apt-get install qemu-system-x86 cloud-image-utils - -Download the firstboot image and startup script - - % wget http://people.canonical.com/~rharper/firstboot/firstboot.sh - % chmod +x ./firstboot.sh - % wget http://people.canonical.com/~rharper/firstboot/firstboot.raw.xz - % unxz firstboot.raw.xz - % ./firstboot.sh - -This will launch the firstboot image under KVM using userspace networking -The main console will open in a new window, the serial console is available via -telnet session (telnet localhost 2447). - - -When firstboot displays the ssh URL, in the demo, since we're using qemu user -networking, we can't ssh directly to the VM, instead we redirect the guest's ssh -port 22 to host port 2222; this is a limitation of the demo. When ssh'ing to -the guest, use: - - ssh -p 2222 @localhost - - -How it works ------------- - -The firstboot program is launched after the getty service is available, and -disables getty on any tty and instead spawns the firstboot program. It will -remain available until one of the firstboot instances successfully completes. -After completion, firstboot will disable itself and re-enable getty services. - -firstboot is based on subiquity, just pulling out a few of the panels and -reusing certain parts. The networking information is probed from the host -and allows user configuration. After completion of configuration, firstboot -uses the ``ip`` command to apply the new network config to the network devices -present. Long term, we'll supply network-config yaml to snappy or whatever -network configuration tool will be present and be responsible for bringing -networking up to the desired state. - -For identity, we collect realname, username, password (and crypt it), and a -"ssh_import_id" URL. The ``ssh-import-id`` binary already supports both -launchpad (lp:) and github (gh:). In the demo, I added mock SSO support (sso:) -and this would trigger a call out to snappy login or what ever the right tool -to initiate a connection to the SSO for authentication and retrieval of the -user's ssh keys. - -After collecting the input, we run ``ip``, ``useradd`` and ``ssh-import-id`` -and display the current config, including ssh url. After selecting "Finish" -We restore the normal getty prompt from which the newly created user can login. diff --git a/firstboot.sh b/firstboot.sh deleted file mode 100755 index ca05a8e7..00000000 --- a/firstboot.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -BOOT=firstboot.raw -SEED=seed.img - -[ ! -e ${SEED} ] && { - cat > user-data < meta-data - cloud-localds ${SEED} user-data meta-data -} - -qemu-system-x86_64 -m 1024 --enable-kvm \ - -snapshot \ - -drive file=${BOOT},format=raw,if=virtio \ - -net user -net nic,model=virtio \ - -redir tcp:2222::22 \ - -cdrom $SEED \ - -monitor stdio \ - -serial telnet:localhost:2447,nowait,server diff --git a/subiquity/curtin.py b/subiquity/curtin.py index ae7e4482..fc701020 100644 --- a/subiquity/curtin.py +++ b/subiquity/curtin.py @@ -102,7 +102,6 @@ def curtin_hostinfo_to_config(hostinfo): def curtin_write_postinst_config(userinfo): - # firstboot doesn't get hostinfo; but it's still present in the template config = { 'users': curtin_userinfo_to_config(userinfo), 'hostinfo': curtin_hostinfo_to_config(userinfo), diff --git a/subiquitycore/user.py b/subiquitycore/user.py index 7821cc0c..7193f312 100644 --- a/subiquitycore/user.py +++ b/subiquitycore/user.py @@ -60,8 +60,8 @@ def create_user(userinfo, dryrun=False, extra_args=[]): run_command(chown, shell=False) # add sudo rule - with open('/etc/sudoers.d/firstboot-user', 'w') as fh: - fh.write('# firstboot config added user\n\n') + with open('/etc/sudoers.d/installer-user', 'w') as fh: + fh.write('# installer added user\n\n') fh.write('{} ALL=(ALL) NOPASSWD:ALL\n'.format(username)) else: - log.info('dry-run, skiping user configuration') + log.info('dry-run, skipping user configuration') diff --git a/subiquitycore/utils.py b/subiquitycore/utils.py index d44567c3..8a5f3c07 100644 --- a/subiquitycore/utils.py +++ b/subiquitycore/utils.py @@ -159,9 +159,9 @@ def crypt_password(passwd, algo='SHA-512'): return crypt.crypt(passwd, algos[algo] + salt) -def disable_first_boot_service(): - """ Stop firstboot service; which also restores getty service """ - log.info('disabling first boot service') +def disable_console_conf(): + """ Stop console-conf service; which also restores getty service """ + log.info('disabling console-conf service') run_command(["systemctl", "stop", "--no-block", "console-conf@*.service", "serial-console-conf@*.service"]) return