[master/rhel7-branch][PATCH] Don't allow bootloader and /boot on iSCSI on s390 (#1034222)
Dan HorĂ¡k
dan at danny.cz
Tue Nov 26 13:47:04 UTC 2013
On Tue, 26 Nov 2013 14:41:15 +0100
Vratislav Podzimek <vpodzime at redhat.com> wrote:
> s390(x) cannot boot from an iSCSI disk.
what about other arches eg. ARM?
Dan
> Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> ---
> pyanaconda/bootloader.py | 11 +++++++++++
> pyanaconda/kickstart.py | 10 ++++++----
> 2 files changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
> index f9a1cc5..414c5cf 100644
> --- a/pyanaconda/bootloader.py
> +++ b/pyanaconda/bootloader.py
> @@ -26,6 +26,7 @@ import sys
> import os
> import re
> import struct
> +import blivet
> from parted import PARTITION_BIOS_GRUB
>
> from pyanaconda import iutil
> @@ -573,6 +574,11 @@ class BootLoader(object):
> log.debug("stage1 device cannot be of type %s" %
> device.type) return False
>
> + if blivet.arch.isS390() and all(isinstance(disk,
> blivet.devices.iScsiDiskDevice)
> + for disk in device.disks):
> + log.debug("stage1 device cannot be on an iSCSI disk on
> s390(x)")
> + return False
> +
> description = self.device_description(device)
>
> if self.stage2_is_valid_stage1 and device ==
> self.stage2_device: @@ -684,6 +690,11 @@ class BootLoader(object):
> if device.protected:
> valid = False
>
> + if blivet.arch.isS390() and all(isinstance(disk,
> blivet.devices.iScsiDiskDevice)
> + for disk in device.disks):
> + self.errors.append(_("%s cannot be on an iSCSI disk on
> s390(x)") % self.stage2_description)
> + valid = False
> +
> if not self._device_type_match(device,
> self.stage2_device_types): self.errors.append(_("%s cannot be of type
> %s") % (self.stage2_description, device.type))
> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index d615208..ade0761 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -295,12 +295,14 @@ class Bootloader
> (commands.bootloader.F19_Bootloader): if self.timeout is not None:
> storage.bootloader.timeout = self.timeout
>
> - # Throw out drives specified that don't exist.
> + # Throw out drives specified that don't exist or cannot be
> used (iSCSI
> + # device on an s390 machine)
> disk_names = [d.name for d in storage.disks
> - if not d.format.hidden and not
> d.protected]
> + if not d.format.hidden and not d.protected and
> + (not blivet.arch.isS390() or not isinstance(d,
> blivet.devices.iScsiDiskDevice))] for drive in self.driveorder[:]:
> if drive not in disk_names:
> - log.warning("requested drive %s in boot drive order
> doesn't exist" % drive)
> + log.warning("requested drive %s in boot drive order
> doesn't exist or cannot be used" % drive) self.driveorder.remove
> (drive)
> storage.bootloader.disk_order = self.driveorder
> @@ -308,7 +310,7 @@ class Bootloader
> (commands.bootloader.F19_Bootloader): if self.bootDrive:
> if not self.bootDrive in disk_names:
> raise KickstartValueError, formatErrorMsg
> (self.lineno,
> - msg="Requested boot drive %s doesn't exist"
> % self.bootDrive)
> + msg="Requested boot drive %s doesn't exist
> or cannot be used" % self.bootDrive) else:
> self.bootDrive = disk_names[0]
>
> --
> 1.8.4.2
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
More information about the anaconda-patches
mailing list