|
|
|
@ -208,8 +208,8 @@ class VariableOsDeviceType(ReadonlyVariable):
|
|
|
|
|
return info["MD_LEVEL"]
|
|
|
|
|
device_name = path.basename(dev)
|
|
|
|
|
if device_name in self.usbdevices:
|
|
|
|
|
if device.sysfs.read(device.sysfs.Path.Block,device_name,
|
|
|
|
|
"removable").strip() == 1:
|
|
|
|
|
if device.sysfs.read(device.sysfs.Path.Block, device_name,
|
|
|
|
|
"removable").strip() == "1":
|
|
|
|
|
return "flash"
|
|
|
|
|
else:
|
|
|
|
|
return "usb-hdd"
|
|
|
|
@ -219,13 +219,12 @@ class VariableOsDeviceType(ReadonlyVariable):
|
|
|
|
|
def get(self):
|
|
|
|
|
# get usb device by '/dev/disk/by-id'(usb devices contain 'usb' in name)
|
|
|
|
|
diskIdPath = '/dev/disk/by-id'
|
|
|
|
|
if path.exists(diskIdPath):
|
|
|
|
|
if device.devfs.exists(diskIdPath):
|
|
|
|
|
self.usbdevices = \
|
|
|
|
|
map(lambda x: \
|
|
|
|
|
os.readlink(path.join(diskIdPath, x)).rpartition('/')[
|
|
|
|
|
2],
|
|
|
|
|
device.devfs.readlink(diskIdPath, x).rpartition('/')[2],
|
|
|
|
|
filter(lambda x: x.startswith('usb-'),
|
|
|
|
|
listDirectory(diskIdPath)))
|
|
|
|
|
device.devfs.listdir(diskIdPath, fullpath=False)))
|
|
|
|
|
else:
|
|
|
|
|
self.usbdevices = []
|
|
|
|
|
return map(self.getType,
|
|
|
|
@ -946,7 +945,9 @@ class VariableOsLocationSource(LocationHelper, DeviceHelper, Variable):
|
|
|
|
|
return [
|
|
|
|
|
disk_dev for disk_dev, disk_mount in self.ZipVars(
|
|
|
|
|
"os_disk_dev", "os_disk_mount")
|
|
|
|
|
if disk_mount not in ("", "/") or disk_dev == dev_from
|
|
|
|
|
if ((disk_mount not in ("", "/")
|
|
|
|
|
or disk_dev == dev_from) and
|
|
|
|
|
not disk_mount.startswith("/boot/efi"))
|
|
|
|
|
] + self.Get('os_bind_path')
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
@ -1077,13 +1078,7 @@ class VariableOsLocationDest(LocationHelper, Variable):
|
|
|
|
|
return path.normpath(val)
|
|
|
|
|
return val
|
|
|
|
|
|
|
|
|
|
def eficonvert(val):
|
|
|
|
|
if val.lower() in ("efi", "uefi"):
|
|
|
|
|
return "/boot/efi"
|
|
|
|
|
else:
|
|
|
|
|
return val
|
|
|
|
|
|
|
|
|
|
value = map(normpath, map(eficonvert, value))
|
|
|
|
|
value = map(normpath, value)
|
|
|
|
|
return map(lambda x: x or "/", value)
|
|
|
|
|
|
|
|
|
|
def choice(self):
|
|
|
|
@ -1091,7 +1086,7 @@ class VariableOsLocationDest(LocationHelper, Variable):
|
|
|
|
|
return ["/", ""]
|
|
|
|
|
else:
|
|
|
|
|
return ['/', '/boot', '/var/calculate', '/home',
|
|
|
|
|
'/usr', '/var', '/tmp', 'swap', '/boot/efi', '']
|
|
|
|
|
'/usr', '/var', '/tmp', 'swap', '']
|
|
|
|
|
|
|
|
|
|
def check(self, value):
|
|
|
|
|
"""Check set location source"""
|
|
|
|
@ -1126,6 +1121,12 @@ class VariableOsLocationDest(LocationHelper, Variable):
|
|
|
|
|
binds = filter(lambda x: not x[0].startswith('/dev/') and x[1],
|
|
|
|
|
zip(source, value))
|
|
|
|
|
##########################
|
|
|
|
|
# detect efi specifing
|
|
|
|
|
##########################
|
|
|
|
|
if "/boot/efi" in value or "efi" in value:
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Please specify EFI partition by UEFI option"))
|
|
|
|
|
##########################
|
|
|
|
|
# detect duplicate mps
|
|
|
|
|
##########################
|
|
|
|
|
dupMP = list(set(filter(lambda x: value.count(x) > 1,
|
|
|
|
@ -1180,17 +1181,6 @@ class VariableOsLocationDest(LocationHelper, Variable):
|
|
|
|
|
if cdromPartitions:
|
|
|
|
|
raise VariableError(_("Unable to use CDROM %s for installation") %
|
|
|
|
|
cdromPartitions)
|
|
|
|
|
#############################
|
|
|
|
|
# detect right part for uefi#
|
|
|
|
|
#############################
|
|
|
|
|
efiDisks = map(lambda x: device.udev.get_devname(name=x[0]),
|
|
|
|
|
filter(lambda x: x[1] == '/boot/efi',
|
|
|
|
|
zip(source, value)))
|
|
|
|
|
wrongPart = self.Select('os_install_disk_dev',
|
|
|
|
|
where='os_install_disk_type',
|
|
|
|
|
ne='disk-partition')
|
|
|
|
|
if set(efiDisks) & set(wrongPart):
|
|
|
|
|
raise VariableError(_("UEFI partition must be a disk partition"))
|
|
|
|
|
###############################
|
|
|
|
|
# check cross bind mount points
|
|
|
|
|
###############################
|
|
|
|
@ -1521,24 +1511,6 @@ class VariableOsInstallDiskData(ReadonlyTableVariable):
|
|
|
|
|
"os_install_disk_parent"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskEfi(ReadonlyVariable):
|
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
if self.Get('os_install_root_type') == 'usb-hdd':
|
|
|
|
|
validParent = self.Select('os_install_disk_parent_base',
|
|
|
|
|
where='os_install_disk_mount_base',
|
|
|
|
|
eq='/')
|
|
|
|
|
efi_partitions = self.select('os_device_efi',
|
|
|
|
|
os_device_dev__in=validParent)
|
|
|
|
|
else:
|
|
|
|
|
efi_partitions = self.select('os_device_efi',
|
|
|
|
|
os_device_type="hdd")
|
|
|
|
|
|
|
|
|
|
return list({x for x in efi_partitions if x}
|
|
|
|
|
- set(self.Get('os_location_source')))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskParent(SourceReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
Partition parent devices using for install
|
|
|
|
@ -1558,59 +1530,6 @@ class VariableOsInstallDiskParent(SourceReadonlyVariable):
|
|
|
|
|
humanReadable = Variable.humanReadable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsAddonDiskDev(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
if self.Get('os_install_uefi_set') == 'on':
|
|
|
|
|
if "/boot/efi" not in self.Get('os_location_dest'):
|
|
|
|
|
efiPartition = self.Get('os_install_disk_efi')
|
|
|
|
|
if efiPartition:
|
|
|
|
|
return efiPartition[:1]
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsAddonDiskMount(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
if self.Get('os_install_uefi_set') == 'on':
|
|
|
|
|
if "/boot/efi" not in self.Get('os_location_dest'):
|
|
|
|
|
efiPartition = self.Get('os_install_disk_efi')
|
|
|
|
|
if efiPartition:
|
|
|
|
|
return ['/boot/efi']
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsAddonDiskFormat(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
if self.Get('os_install_uefi_set') == 'on':
|
|
|
|
|
if "/boot/efi" not in self.Get('os_location_dest'):
|
|
|
|
|
efiPartition = self.Get('os_install_disk_efi')
|
|
|
|
|
if efiPartition:
|
|
|
|
|
return ['vfat']
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsAddonDiskPerformFormat(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
if self.Get('os_install_uefi_set') == 'on':
|
|
|
|
|
if "/boot/efi" not in self.Get('os_location_dest'):
|
|
|
|
|
efiPartition = self.Get('os_install_disk_efi')
|
|
|
|
|
if efiPartition:
|
|
|
|
|
fsPart = self.Select('os_disk_format', where='os_disk_dev',
|
|
|
|
|
eq=efiPartition[0], limit=1)
|
|
|
|
|
if fsPart != "vfat":
|
|
|
|
|
return ['on']
|
|
|
|
|
else:
|
|
|
|
|
return ['off']
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskDevBase(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
Variable using for resolv cyclic deps
|
|
|
|
@ -1624,9 +1543,11 @@ class VariableOsInstallDiskDevBase(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
return [device.udev.get_devname(name=disk)]
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
return [source for source, dest in self.ZipVars("os_location_source",
|
|
|
|
|
"os_location_dest")
|
|
|
|
|
if dest and source.startswith("/dev/")]
|
|
|
|
|
return [dev
|
|
|
|
|
for dev, mount in self.ZipVars('os_location_source',
|
|
|
|
|
'os_location_dest')
|
|
|
|
|
if (dev.startswith("/dev") and mount and
|
|
|
|
|
not mount.startswith("/boot/efi"))]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskParentBase(VariableOsInstallDiskParent):
|
|
|
|
@ -1645,7 +1566,7 @@ class VariableOsInstallDiskDev(ReadonlyVariable, DeviceHelper):
|
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
return (self.Get('os_addon_disk_dev') +
|
|
|
|
|
return (self.Get('os_install_uefi') +
|
|
|
|
|
self.Get('os_install_disk_dev_base'))
|
|
|
|
|
|
|
|
|
|
def humanReadable(self):
|
|
|
|
@ -1679,10 +1600,11 @@ class VariableOsInstallDiskMountBase(ReadonlyVariable):
|
|
|
|
|
if disk:
|
|
|
|
|
return ["/"]
|
|
|
|
|
return []
|
|
|
|
|
return map(lambda x: x[1],
|
|
|
|
|
filter(lambda x: x[0].startswith('/dev/') and x[1],
|
|
|
|
|
zip(self.Get('os_location_source'),
|
|
|
|
|
self.Get('os_location_dest'))))
|
|
|
|
|
return [mount
|
|
|
|
|
for dev, mount in self.ZipVars('os_location_source',
|
|
|
|
|
'os_location_dest')
|
|
|
|
|
if (dev.startswith("/dev") and mount and
|
|
|
|
|
not mount.startswith("/boot/efi"))]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskMount(ReadonlyVariable):
|
|
|
|
@ -1691,10 +1613,16 @@ class VariableOsInstallDiskMount(ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
def generate_uefi_mountpoints(self):
|
|
|
|
|
yield "/boot/efi"
|
|
|
|
|
for i in range(2, 20):
|
|
|
|
|
yield "/boot/efi%d" % i
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
"""Get install disk dest"""
|
|
|
|
|
return self.Get('os_addon_disk_mount') + \
|
|
|
|
|
self.Get('os_install_disk_mount_base')
|
|
|
|
|
mps = self.generate_uefi_mountpoints()
|
|
|
|
|
return ([next(mps) for x in self.Get('os_install_uefi')] +
|
|
|
|
|
self.Get('os_install_disk_mount_base'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskUse(ReadonlyVariable):
|
|
|
|
@ -1753,12 +1681,12 @@ class VariableOsInstallDiskFormat(ReadonlyVariable):
|
|
|
|
|
type = "choice-list"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
_format = map(lambda x: x[2],
|
|
|
|
|
filter(lambda x: x[0].startswith('/dev/') and x[1],
|
|
|
|
|
zip(self.Get('os_location_source'),
|
|
|
|
|
self.Get('os_location_dest'),
|
|
|
|
|
self.Get('os_location_format'))))
|
|
|
|
|
return self.Get('os_addon_disk_format') + _format
|
|
|
|
|
_format = [fs for dev, mp, fs in self.ZipVars('os_location_source',
|
|
|
|
|
'os_location_dest',
|
|
|
|
|
'os_location_format')
|
|
|
|
|
if dev.startswith('/dev/') and mp]
|
|
|
|
|
efiformat = ['vfat' for x in self.Get('os_install_uefi')]
|
|
|
|
|
return efiformat + _format
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskPerformFormat(ReadonlyVariable):
|
|
|
|
@ -1773,7 +1701,14 @@ class VariableOsInstallDiskPerformFormat(ReadonlyVariable):
|
|
|
|
|
zip(self.Get('os_location_source'),
|
|
|
|
|
self.Get('os_location_dest'),
|
|
|
|
|
self.Get('os_location_perform_format'))))
|
|
|
|
|
return self.Get('os_addon_disk_perform_format') + _format
|
|
|
|
|
if self.GetBool('cl_autopartition_set'):
|
|
|
|
|
efiformat = ['on' for x in self.Get('os_install_uefi')]
|
|
|
|
|
res = efiformat + _format
|
|
|
|
|
else:
|
|
|
|
|
vfatdevs = self.select('os_disk_dev', os_disk_format="vfat")
|
|
|
|
|
res = ["off" if dv in vfatdevs else "on"
|
|
|
|
|
for dv in self.Get('os_install_uefi')] + _format
|
|
|
|
|
return res
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskId(ReadonlyVariable):
|
|
|
|
@ -1834,11 +1769,20 @@ class VariableOsInstallDiskSize(SourceReadonlyVariable):
|
|
|
|
|
indexField = 'os_install_disk_dev'
|
|
|
|
|
|
|
|
|
|
def getMap(self):
|
|
|
|
|
return {
|
|
|
|
|
dev: size for dev, size in chain(
|
|
|
|
|
if self.GetBool("cl_autopartition_set"):
|
|
|
|
|
return {
|
|
|
|
|
dev: size for dev, size in chain(
|
|
|
|
|
self.ZipVars('os_disk_dev', 'os_disk_size'),
|
|
|
|
|
self.ZipVars('cl_autopartition_disk_dev_full',
|
|
|
|
|
'cl_autopartition_disk_size_full'),
|
|
|
|
|
self.ZipVars('os_location_source', 'os_location_size'))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else:
|
|
|
|
|
return {
|
|
|
|
|
dev: size for dev, size in chain(
|
|
|
|
|
self.ZipVars('os_disk_dev', 'os_disk_size'),
|
|
|
|
|
self.ZipVars('os_location_source', 'os_location_size'))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def getMapHumanReadable(self):
|
|
|
|
|
return {
|
|
|
|
@ -1959,10 +1903,16 @@ class VariableOsInstallBootDevices(ReadonlyVariable):
|
|
|
|
|
if mbr and dev in devices]
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
class VariableOsUefi(ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
UEFI partitions from fstab
|
|
|
|
|
"""
|
|
|
|
|
def get(self):
|
|
|
|
|
return self.select('os_disk_dev', os_disk_mount__startswith="/boot/efi")
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallUefi(LocationHelper, Variable):
|
|
|
|
|
"""
|
|
|
|
|
Disks for boot mbr
|
|
|
|
|
UEFI partitions for install
|
|
|
|
|
"""
|
|
|
|
|
type = "choiceedit-list"
|
|
|
|
|
element = "selecttable"
|
|
|
|
@ -1997,8 +1947,7 @@ class VariableOsInstallUefi(LocationHelper, Variable):
|
|
|
|
|
return []
|
|
|
|
|
# если происходит обновление загрузчика текущей системы
|
|
|
|
|
# для определения используем /etc/fstab
|
|
|
|
|
fstabefidevs = self.select('os_disk_dev',
|
|
|
|
|
os_disk_mount__startswith="/boot/efi")
|
|
|
|
|
fstabefidevs = self.Get('os_uefi')
|
|
|
|
|
if self.Get('cl_action') != 'system':
|
|
|
|
|
return fstabefidevs
|
|
|
|
|
rootdev = self.Get('os_install_root_dev')
|
|
|
|
@ -2037,6 +1986,11 @@ class VariableOsInstallUefi(LocationHelper, Variable):
|
|
|
|
|
|
|
|
|
|
def check(self, value):
|
|
|
|
|
if value:
|
|
|
|
|
efi_boot_mgr = getProgPath('/usr/sbin/efibootmgr')
|
|
|
|
|
if not efi_boot_mgr:
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("UEFI installation is unavailable, because '%s' command "
|
|
|
|
|
"not found") % efi_boot_mgr)
|
|
|
|
|
if self.install_without_uefiboot:
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Your system must be loaded in UEFI for using this "
|
|
|
|
@ -2050,6 +2004,31 @@ class VariableOsInstallUefi(LocationHelper, Variable):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Wrong EFI device %s") % badefi[0])
|
|
|
|
|
|
|
|
|
|
fstab_disks = [dev
|
|
|
|
|
for dev, mp in self.ZipVars('os_disk_dev', 'os_disk_mount')
|
|
|
|
|
if mp and not mp.startswith("/boot/efi")
|
|
|
|
|
]
|
|
|
|
|
for disk in value:
|
|
|
|
|
if disk in fstab_disks:
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Partition {disk} already used by "
|
|
|
|
|
"the current system").format(disk=disk))
|
|
|
|
|
not_fat_efi = self.select('os_disk_dev',
|
|
|
|
|
os_disk_format__ne="vfat")
|
|
|
|
|
for efipart in value:
|
|
|
|
|
if efipart in not_fat_efi and isMount(efipart):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Please unmount {device}, as it will be used for "
|
|
|
|
|
"installation").format(device=efipart))
|
|
|
|
|
|
|
|
|
|
for efipart in value:
|
|
|
|
|
if efipart in self.select('os_location_source',
|
|
|
|
|
os_location_dest__ne=""):
|
|
|
|
|
raise VariableError(
|
|
|
|
|
_("Partition {disk} already used for "
|
|
|
|
|
"installation").format(disk=efipart))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def uncompatible(self):
|
|
|
|
|
"""
|
|
|
|
|
Uncompatible with autopartition
|
|
|
|
@ -2273,32 +2252,36 @@ class VariableOsInstallFstabMountConf(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
else:
|
|
|
|
|
return s
|
|
|
|
|
|
|
|
|
|
def formatFstab(self, used, dev, mp, fs, opts, spec):
|
|
|
|
|
ret = "{dev}\t{mp}\t{fs}\t{opts}\t{spec}".format(
|
|
|
|
|
dev=used, mp=mp, fs=fs, opts=opts, spec=spec
|
|
|
|
|
)
|
|
|
|
|
if used.startswith("UUID"):
|
|
|
|
|
return "# %s was on %s during installation\n%s" % (mp, dev, ret)
|
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
devicesForFstab = self.Select([
|
|
|
|
|
'os_install_disk_use',
|
|
|
|
|
'os_install_disk_mount',
|
|
|
|
|
'os_install_disk_format',
|
|
|
|
|
'os_install_disk_options',
|
|
|
|
|
'os_install_disk_dev'],
|
|
|
|
|
where='os_install_disk_mount',
|
|
|
|
|
func=lambda x: x[0] != "" and x[0] != "swap")
|
|
|
|
|
|
|
|
|
|
devicesForFstab = sorted(
|
|
|
|
|
self.Select(['os_install_disk_use',
|
|
|
|
|
'os_install_disk_mount',
|
|
|
|
|
'os_install_disk_format',
|
|
|
|
|
'os_install_disk_options',
|
|
|
|
|
'os_install_disk_dev'],
|
|
|
|
|
where='os_install_disk_mount',
|
|
|
|
|
func=lambda x: x[0] != "" and x[0] != "swap"),
|
|
|
|
|
lambda x, y: cmp(self.separateDevice(x[1]),
|
|
|
|
|
self.separateDevice(y[1])))
|
|
|
|
|
if self.Get('os_install_scratch') == "on":
|
|
|
|
|
devicesForFstab = filter(lambda x: x[1] != "/", devicesForFstab)
|
|
|
|
|
|
|
|
|
|
# rootLine one string, but it correct work if devicesForFstab is empty
|
|
|
|
|
rootLine = "\n".join(map(lambda x: "%s\t%s\t%s\t%s\t0 1" %
|
|
|
|
|
(
|
|
|
|
|
self._commentFstab(x[0], x[1],
|
|
|
|
|
x[4]),
|
|
|
|
|
x[1], x[2], x[3]),
|
|
|
|
|
devicesForFstab[:1]))
|
|
|
|
|
otherLines = "\n".join(map(lambda x: "%s\t%s\t%s\t%s\t0 0" %
|
|
|
|
|
(self._commentFstab(x[0], x[1],
|
|
|
|
|
x[4]), x[1],
|
|
|
|
|
x[2], x[3]),
|
|
|
|
|
devicesForFstab[1:]))
|
|
|
|
|
devicesForFstab, key=lambda x: self.separateDevice(x[1]))
|
|
|
|
|
|
|
|
|
|
rootLine = "\n".join(
|
|
|
|
|
self.formatFstab(used, dev, mp, fs, opts, "0 1")
|
|
|
|
|
for used, mp, fs, opts, dev in devicesForFstab[:1]
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
otherLines = "\n".join(
|
|
|
|
|
self.formatFstab(used, dev, mp, fs, opts, "0 0")
|
|
|
|
|
for used, mp, fs, opts, dev in devicesForFstab[1:]
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
bindData = self.ZipVars('os_install_bind_path',
|
|
|
|
|
'os_install_bind_mountpoint')
|
|
|
|
@ -2308,6 +2291,28 @@ class VariableOsInstallFstabMountConf(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
return "\n".join(filter(lambda x: x, [rootLine, otherLines, bindLines]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallFstabEfiConf(VariableOsInstallFstabMountConf):
|
|
|
|
|
def get(self):
|
|
|
|
|
devicesForFstab = self.Select([
|
|
|
|
|
'os_install_disk_use',
|
|
|
|
|
'os_install_disk_mount',
|
|
|
|
|
'os_install_disk_format',
|
|
|
|
|
'os_install_disk_options',
|
|
|
|
|
'os_install_disk_dev'],
|
|
|
|
|
where='os_install_disk_mount',
|
|
|
|
|
func=lambda x: x[0].startswith("/boot/efi"))
|
|
|
|
|
|
|
|
|
|
devicesForFstab = sorted(
|
|
|
|
|
devicesForFstab, key=lambda x: self.separateDevice(x[1]))
|
|
|
|
|
|
|
|
|
|
efiLines = "\n".join(
|
|
|
|
|
self.formatFstab(used, dev, mp, fs, opts, "0 0")
|
|
|
|
|
for used, mp, fs, opts, dev in devicesForFstab
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return "\n".join(filter(lambda x: x, [efiLines]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallFstabSwapConf(VariableOsInstallFstabMountConf):
|
|
|
|
|
"""
|
|
|
|
|
FStab.conf contains swap partition
|
|
|
|
|