Merge branch 'master' into mwhudson/validation-improvements
This commit is contained in:
commit
e77509b4dd
|
@ -2,7 +2,7 @@
|
|||
> Ubuntu Server Installer & Snappy first boot experience
|
||||
|
||||
The repository contains the source for the new server installer (the
|
||||
"subiquity" part, aka "ubuquity for servers") and for the snappy first
|
||||
"subiquity" part, aka "ubiquity for servers") and for the snappy first
|
||||
boot experience (the "console-conf" part).
|
||||
|
||||
We track bugs in Launchpad at
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/sh
|
||||
true
|
|
@ -13,6 +13,9 @@ apps:
|
|||
command: usr/bin/console-conf
|
||||
probert:
|
||||
command: bin/probert
|
||||
started:
|
||||
command: usr/bin/started
|
||||
daemon: oneshot
|
||||
|
||||
parts:
|
||||
subiquity:
|
||||
|
@ -44,6 +47,7 @@ parts:
|
|||
'bin/subiquity-tui': usr/bin/subiquity
|
||||
'bin/subiquity-loadkeys': usr/bin/subiquity-loadkeys
|
||||
'bin/curtin-journald-forwarder': usr/bin/curtin-journald-forwarder
|
||||
'bin/started': usr/bin/started
|
||||
prime:
|
||||
- usr/bin
|
||||
probert:
|
||||
|
|
|
@ -193,7 +193,7 @@ class FilesystemController(BaseController):
|
|||
if not system_bootable and len(disk.partitions()) == 0:
|
||||
if self.is_uefi():
|
||||
log.debug('Adding EFI partition first')
|
||||
part = self.model.add_partition(disk=disk, partnum=1, size=UEFI_GRUB_SIZE_BYTES, flag='bios_grub')
|
||||
part = self.model.add_partition(disk=disk, partnum=1, size=UEFI_GRUB_SIZE_BYTES, flag='boot')
|
||||
fs = self.model.add_filesystem(part, 'fat32')
|
||||
self.model.add_mount(fs, '/boot/efi')
|
||||
else:
|
||||
|
|
|
@ -18,6 +18,7 @@ import logging
|
|||
import os
|
||||
import random
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from systemd import journal
|
||||
|
||||
|
@ -226,7 +227,7 @@ class InstallProgressController(BaseController):
|
|||
|
||||
def start_journald_forwarder(self):
|
||||
log.debug("starting curtin journald forwarder")
|
||||
if "SNAP" in os.environ:
|
||||
if "SNAP" in os.environ and sys.executable.startswith(os.environ["SNAP"]):
|
||||
script = os.path.join(os.environ["SNAP"], 'usr/bin/curtin-journald-forwarder')
|
||||
else:
|
||||
script = './bin/curtin-journald-forwarder'
|
||||
|
|
|
@ -294,7 +294,7 @@ class FilesystemModel(object):
|
|||
r.append(asdict(p))
|
||||
for f in self._filesystems:
|
||||
r.append(asdict(f))
|
||||
for m in self._mounts:
|
||||
for m in sorted(self._mounts, key=lambda m:len(m.path)):
|
||||
r.append(asdict(m))
|
||||
return r
|
||||
|
||||
|
@ -318,12 +318,14 @@ class FilesystemModel(object):
|
|||
|
||||
def probe(self):
|
||||
storage = self.prober.get_storage()
|
||||
VALID_MAJORS = ['8', '253']
|
||||
currently_mounted = self._get_system_mounted_disks()
|
||||
for path, data in storage.items():
|
||||
if path in currently_mounted:
|
||||
continue
|
||||
if data['DEVTYPE'] == 'disk' and data['MAJOR'] in VALID_MAJORS:
|
||||
if data['DEVTYPE'] == 'disk' \
|
||||
and not data["DEVPATH"].startswith('/devices/virtual') \
|
||||
and data["MAJOR"] != "2" \
|
||||
and data['attrs'].get('ro') != "1":
|
||||
#log.debug('disk={}\n{}'.format(
|
||||
# path, json.dumps(data, indent=4, sort_keys=True)))
|
||||
info = self.prober.get_storage_info(path)
|
||||
|
@ -388,7 +390,7 @@ class FilesystemModel(object):
|
|||
def bootable(self):
|
||||
''' true if one disk has a boot partition '''
|
||||
for p in self._partitions:
|
||||
if p.flag == 'bios_grub':
|
||||
if p.flag == 'bios_grub' or p.flag == 'boot':
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ URWID_16_NAMES = [
|
|||
URWID16 = {}
|
||||
URWID256 = {}
|
||||
|
||||
PALETTE = bytearray(16*3)
|
||||
PALETTE = bytearray(8*3)
|
||||
|
||||
colors = {
|
||||
0: ("bg", (0x00, 0x00, 0x00)),
|
||||
|
|
|
@ -20,7 +20,7 @@ configuration.
|
|||
|
||||
"""
|
||||
import logging
|
||||
from urwid import connect_signal, Text
|
||||
from urwid import connect_signal, Text, WidgetDisable
|
||||
|
||||
from subiquitycore.ui.buttons import delete_btn
|
||||
from subiquitycore.ui.container import ListBox
|
||||
|
@ -185,11 +185,16 @@ class PartitionView(PartitionFormatView):
|
|||
label = _("Save")
|
||||
super().__init__(max_size, partition, initial, lambda : self.controller.partition_disk(disk))
|
||||
self.form.buttons.base_widget[0].set_label(label)
|
||||
if partition is not None and partition.flag == "boot":
|
||||
self.form.mount.enabled = False
|
||||
self.form.fstype.enabled = False
|
||||
|
||||
def make_body(self):
|
||||
body = super().make_body()
|
||||
if self.partition is not None:
|
||||
btn = delete_btn(on_press=self.delete)
|
||||
if self.partition.flag == "boot":
|
||||
btn = WidgetDisable(Color.info_minor(btn.original_widget))
|
||||
body[-2:-2] = [
|
||||
Text(""),
|
||||
Padding.fixed_10(btn),
|
||||
|
|
|
@ -44,7 +44,10 @@ UO_R, UO_G, UO_B = 0xe9, 0x54, 0x20
|
|||
def setup_ubuntu_orange(pal, additional_opts):
|
||||
"""Overwrite color 4 (usually "dark blue") to Ubuntu orange."""
|
||||
if is_linux_tty():
|
||||
fcntl.ioctl(sys.stdout.fileno(), PIO_CMAP, pal)
|
||||
curpal = bytearray(16*3)
|
||||
fcntl.ioctl(sys.stdout.fileno(), GIO_CMAP, curpal)
|
||||
curpal[:8] = pal
|
||||
fcntl.ioctl(sys.stdout.fileno(), PIO_CMAP, curpal)
|
||||
elif os.environ['TERM'] == 'fbterm':
|
||||
print('\033[3;4;%i;%i;%i}' % (UO_R, UO_G, UO_B), flush=True)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue