anaconda: update Qubes-specific code to upstream base
QubesOS/qubes-issues#2574
This commit is contained in:
parent
16b7346023
commit
378cfc44dd
@ -1848,12 +1848,12 @@ class XenEFI(EFIGRUB):
|
|||||||
def add_efi_boot_target(self):
|
def add_efi_boot_target(self):
|
||||||
if self.stage1_device.type == "partition":
|
if self.stage1_device.type == "partition":
|
||||||
boot_disk = self.stage1_device.disk
|
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":
|
elif self.stage1_device.type == "mdarray":
|
||||||
# FIXME: I'm just guessing here. This probably needs the full
|
# FIXME: I'm just guessing here. This probably needs the full
|
||||||
# treatment, ie: multiple targets for each member.
|
# treatment, ie: multiple targets for each member.
|
||||||
boot_disk = self.stage1_device.parents[0].disk
|
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)
|
boot_part_num = str(boot_part_num)
|
||||||
|
|
||||||
if not os.path.exists(
|
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("options=loglvl=all dom0_mem=min:1024M dom0_mem=max:4096M\n")
|
||||||
config.write("kernel={} root={} {}\n".format(
|
config.write("kernel={} root={} {}\n".format(
|
||||||
image.kernel,
|
image.kernel,
|
||||||
image.device.fstabSpec,
|
image.device.fstab_spec,
|
||||||
self.boot_args))
|
self.boot_args))
|
||||||
config.write("ramdisk={}\n".format(image.initrd))
|
config.write("ramdisk={}\n".format(image.initrd))
|
||||||
|
|
||||||
|
@ -24,7 +24,10 @@ from pyanaconda.product import *
|
|||||||
from pyanaconda import network
|
from pyanaconda import network
|
||||||
from pyanaconda.i18n import N_
|
from pyanaconda.i18n import N_
|
||||||
import os, types
|
import os, types
|
||||||
|
import blivet.platform
|
||||||
|
|
||||||
|
from blivet.size import Size
|
||||||
|
from blivet.platform import platform
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
|
|
||||||
class InstallClass(BaseInstallClass):
|
class InstallClass(BaseInstallClass):
|
||||||
@ -56,16 +59,23 @@ class InstallClass(BaseInstallClass):
|
|||||||
|
|
||||||
def configure(self, anaconda):
|
def configure(self, anaconda):
|
||||||
BaseInstallClass.configure(self, anaconda)
|
BaseInstallClass.configure(self, anaconda)
|
||||||
|
self.setDefaultPartitioning(anaconda.storage)
|
||||||
|
|
||||||
def setDefaultPartitioning(self, storage):
|
def setDefaultPartitioning(self, storage):
|
||||||
BaseInstallClass.setDefaultPartitioning(self,
|
BaseInstallClass.setDefaultPartitioning(self,
|
||||||
storage)
|
storage)
|
||||||
for autoreq in storage.autoPartitionRequests:
|
for autoreq in storage.autopart_requests:
|
||||||
if autoreq.mountpoint == "/":
|
if autoreq.mountpoint == "/":
|
||||||
autoreq.maxSize=None
|
autoreq.max_size=None
|
||||||
autoreq.requiredSpace=10*1024
|
autoreq.required_space=Size("10GiB")
|
||||||
if autoreq.mountpoint == "/home":
|
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):
|
def productMatches(self, oldprod):
|
||||||
if oldprod is None:
|
if oldprod is None:
|
||||||
|
@ -370,6 +370,11 @@ class UserSpoke(NormalSpoke, GUISpokeInputCheckHandler):
|
|||||||
|
|
||||||
self._user.name = self.username.get_text()
|
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
|
# Copy the spoke data back to kickstart
|
||||||
# If the user name is not set, no user will be created.
|
# If the user name is not set, no user will be created.
|
||||||
if self._user.name:
|
if self._user.name:
|
||||||
|
Loading…
Reference in New Issue
Block a user