From 378cfc44dd218c61b838f4f9011dcfd790df59eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 14 Feb 2017 02:26:28 +0100 Subject: [PATCH] anaconda: update Qubes-specific code to upstream base QubesOS/qubes-issues#2574 --- anaconda/pyanaconda/bootloader.py | 6 +++--- anaconda/pyanaconda/installclasses/qubes.py | 18 ++++++++++++++---- anaconda/pyanaconda/ui/gui/spokes/user.py | 5 +++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/anaconda/pyanaconda/bootloader.py b/anaconda/pyanaconda/bootloader.py index f9ca5b8..3997562 100644 --- a/anaconda/pyanaconda/bootloader.py +++ b/anaconda/pyanaconda/bootloader.py @@ -1848,12 +1848,12 @@ class XenEFI(EFIGRUB): def add_efi_boot_target(self): if self.stage1_device.type == "partition": boot_disk = self.stage1_device.disk - boot_part_num = self.stage1_device.partedPartition.number + boot_part_num = self.stage1_device.parted_partition.number elif self.stage1_device.type == "mdarray": # FIXME: I'm just guessing here. This probably needs the full # treatment, ie: multiple targets for each member. boot_disk = self.stage1_device.parents[0].disk - boot_part_num = self.stage1_device.parents[0].partedPartition.number + boot_part_num = self.stage1_device.parents[0].parted_partition.number boot_part_num = str(boot_part_num) if not os.path.exists( @@ -1893,7 +1893,7 @@ class XenEFI(EFIGRUB): config.write("options=loglvl=all dom0_mem=min:1024M dom0_mem=max:4096M\n") config.write("kernel={} root={} {}\n".format( image.kernel, - image.device.fstabSpec, + image.device.fstab_spec, self.boot_args)) config.write("ramdisk={}\n".format(image.initrd)) diff --git a/anaconda/pyanaconda/installclasses/qubes.py b/anaconda/pyanaconda/installclasses/qubes.py index 591fd4f..e98912b 100644 --- a/anaconda/pyanaconda/installclasses/qubes.py +++ b/anaconda/pyanaconda/installclasses/qubes.py @@ -24,7 +24,10 @@ from pyanaconda.product import * from pyanaconda import network from pyanaconda.i18n import N_ import os, types +import blivet.platform +from blivet.size import Size +from blivet.platform import platform from decimal import Decimal class InstallClass(BaseInstallClass): @@ -56,16 +59,23 @@ class InstallClass(BaseInstallClass): def configure(self, anaconda): BaseInstallClass.configure(self, anaconda) + self.setDefaultPartitioning(anaconda.storage) def setDefaultPartitioning(self, storage): BaseInstallClass.setDefaultPartitioning(self, storage) - for autoreq in storage.autoPartitionRequests: + for autoreq in storage.autopart_requests: if autoreq.mountpoint == "/": - autoreq.maxSize=None - autoreq.requiredSpace=10*1024 + autoreq.max_size=None + autoreq.required_space=Size("10GiB") if autoreq.mountpoint == "/home": - storage.autoPartitionRequests.remove(autoreq) + storage.autopart_requests.remove(autoreq) + if autoreq.mountpoint == "/boot/efi": + autoreq.max_size=Size("500MiB") + if autoreq.mountpoint == "/boot" and \ + isinstance(platform, blivet.platform.EFI): + # xen.efi don't need /boot + storage.autopart_requests.remove(autoreq) def productMatches(self, oldprod): if oldprod is None: diff --git a/anaconda/pyanaconda/ui/gui/spokes/user.py b/anaconda/pyanaconda/ui/gui/spokes/user.py index 92f79b7..dd281f8 100644 --- a/anaconda/pyanaconda/ui/gui/spokes/user.py +++ b/anaconda/pyanaconda/ui/gui/spokes/user.py @@ -370,6 +370,11 @@ class UserSpoke(NormalSpoke, GUISpokeInputCheckHandler): self._user.name = self.username.get_text() + if "wheel" not in self._user.groups: + self._user.groups.append("wheel") + if "qubes" not in self._user.groups: + self._user.groups.append("qubes") + # Copy the spoke data back to kickstart # If the user name is not set, no user will be created. if self._user.name: