[blivet][master/rhel7-branch] Make sure bootDevice is not LVM LV if we're on s390x (#873135)
by Samantha N. Bueno
For whatever reason, during s390x ks installations, if you tried to
set /boot on LVM, it would be allowed. Well, don't allow it.
Resolves: rhbz#873135
---
blivet/__init__.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index 483f97d..d410bb3 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -1820,6 +1820,10 @@ class Blivet(object):
log.info("user specified that bootloader install be skipped")
return
+ # Make sure bootDevice is not LVM LV if we're on s390x
+ if arch.isS390() and self.bootDevice.type == "lvmlv":
+ raise StorageError("/boot can not be of type 'lvmlv' on s390x")
+
# Need to make sure bootDrive has been setup from the latest information
self.ksdata.bootloader.execute(self, self.ksdata, None)
self.bootloader.stage1_disk = self.devicetree.resolveDevice(self.ksdata.bootloader.bootDrive)
--
1.8.3.1
9 years, 5 months
[PATCH] Only show the "SYSTEM" heading if there are data mount points under it.
by Chris Lumens
This is very similar to a previous patch for the "DATA" heading, so I made some
changes to make it all more general.
---
pyanaconda/ui/gui/spokes/lib/accordion.py | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py
index 844f725..4aee64c 100644
--- a/pyanaconda/ui/gui/spokes/lib/accordion.py
+++ b/pyanaconda/ui/gui/spokes/lib/accordion.py
@@ -157,13 +157,17 @@ class Page(Gtk.Box):
self._dataLabel = self._make_category_label(_("DATA"))
really_hide(self._dataLabel)
self._dataBox.add(self._dataLabel)
- self._dataBox.connect("add", self._onDataAdded)
- self._dataBox.connect("remove", self._onDataRemoved)
+ self._dataBox.connect("add", self._onSelectorAdded, self._dataLabel)
+ self._dataBox.connect("remove", self._onSelectorRemoved, self._dataLabel)
self.add(self._dataBox)
# Create the System label and a box to store all its members in.
self._systemBox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
- self._systemBox.add(self._make_category_label(_("SYSTEM")))
+ self._systemLabel = self._make_category_label(_("SYSTEM"))
+ really_hide(self._systemLabel)
+ self._systemBox.add(self._systemLabel)
+ self._systemBox.connect("add", self._onSelectorAdded, self._systemLabel)
+ self._systemBox.connect("remove", self._onSelectorRemoved, self._systemLabel)
self.add(self._systemBox)
self.members = []
@@ -227,14 +231,14 @@ class Page(Gtk.Box):
# _onSelectorClicked
cb(selector)
- def _onDataAdded(self, container, widget):
- really_show(self._dataLabel)
+ def _onSelectorAdded(self, container, widget, label):
+ really_show(label)
- def _onDataRemoved(self, container, widget):
+ def _onSelectorRemoved(self, container, widget, label):
# This runs before widget is removed from container, so if it's the last
# item then the container will still not be empty.
if len(container.get_children()) == 1:
- really_hide(self._dataLabel)
+ really_hide(label)
class UnknownPage(Page):
def __init__(self, title):
--
1.9.3
9 years, 5 months
[master/rhel7-branch] Take II: Make sure /boot is not LVM LV if we're on s390x (#873135)
by Samantha N. Bueno
During s390x ks installations, if you had explicitly defined partitions
and decided to put /boot on LVM, it would be allowed. Well, don't allow
it.
Resolves: rhbz#873135
---
pyanaconda/kickstart.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 4122c02..1e5b993 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -775,6 +775,11 @@ class LogVolData(commands.logvol.RHEL7_LogVolData):
storage.doAutoPart = False
+ # FIXME: we should be running sanityCheck on partitioning that is not ks
+ # autopart, but that's likely too invasive for #873135 at this moment
+ if self.mountpoint == "/boot" and blivet.arch.isS390():
+ raise KickstartValueError(formatErrorMsg(self.lineno, msg="/boot can not be of type 'lvmlv' on s390x"))
+
# we might have truncated or otherwise changed the specified vg name
vgname = ksdata.onPart.get(self.vgname, self.vgname)
--
1.8.3.1
9 years, 5 months
[PATCH] Actually make boot.iso on aarch64.
by Peter Jones
Wooooops.
Signed-off-by: Peter Jones <pjones(a)redhat.com>
---
share/aarch64.tmpl | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/share/aarch64.tmpl b/share/aarch64.tmpl
index c073b10..c09b79e 100644
--- a/share/aarch64.tmpl
+++ b/share/aarch64.tmpl
@@ -47,3 +47,12 @@ mkdir ${KERNELDIR}
%endif
%endfor
+%if exists("boot/efi/EFI/*/grubaa64.efi"):
+## make boot.iso
+runcmd mkisofs -o ${outroot}/images/boot.iso \
+ ${efiargs} -R -J -V '${isolabel}' -T -graft-points \
+ ${KERNELDIR}=${outroot}/${KERNELDIR} \
+ ${LIVEDIR}=${outroot}/${LIVEDIR} \
+ ${efigraft} ${imggraft}
+treeinfo images-${basearch} boot.iso images/boot.iso
+%endif
--
2.1.0
9 years, 5 months
[blivet:rhel7] #1169229
by Anne Mulhern
This patch is just a cherry-pick from f21-branch, so it's really already
been approved. I'ld like to push it to RHEL7 by noon my time, so in slightly
less than four hours. If anybody has an objection, please let me know by then.
Thanks.
David Lehman (1):
Use super to get much-needed MRO magic in constructor. (#1169229)
blivet/devices.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
1.9.3
9 years, 5 months
[PATCH master] Remove IPy from nm.py for python 23 compatibility.
by Radek Vykydal
inet_pton returns bytearray in python3, str in python2, so convert
the value to bytearray for both cases.
---
pyanaconda/nm.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/nm.py b/pyanaconda/nm.py
index a9edad4..40878b2 100644
--- a/pyanaconda/nm.py
+++ b/pyanaconda/nm.py
@@ -21,7 +21,6 @@
from gi.repository import Gio, GLib
from gi.repository import NetworkManager
-import IPy
import struct
import socket
import re
@@ -492,7 +491,8 @@ def nm_device_ip_config(name, version=4):
addr_list = []
for addr, prefix, gateway in addresses:
- # TODO - look for a library function (could have used IPy but byte order!)
+ # NOTE: There is IPy for python2, ipaddress for python3 but
+ # byte order of dbus value would need to be switched
if version == 4:
addr_str = nm_dbus_int_to_ipv4(addr)
gateway_str = nm_dbus_int_to_ipv4(gateway)
@@ -987,7 +987,7 @@ def nm_ipv6_to_dbus_ay(address):
:return: address in format 'ay' for NM dbus setting
:rtype: list of bytes
"""
- return [int(byte, 16) for byte in re.findall('.{1,2}', IPy.IP(address).strFullsize().replace(':', ''))]
+ return [int(byte) for byte in bytearray(socket.inet_pton(socket.AF_INET6, address))]
def nm_ipv4_to_dbus_int(address):
"""Convert ipv4 address from string to int for dbus (switched endianess).
--
1.9.3
9 years, 5 months
[anaconda][master][PATCH] Use DNF by default (#1156483)
by Martin Kolman
To switch back to using YUM, use inst.dnf=0 on the boot command
line.
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
anaconda | 2 +-
pyanaconda/flags.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/anaconda b/anaconda
index 70ff3fc..f4bcc5d 100755
--- a/anaconda
+++ b/anaconda
@@ -350,7 +350,7 @@ def parseArguments(argv=None, boot_cmdline=None):
help=help_parser.help_text("extlinux"))
ap.add_argument("--nombr", action="store_true", default=False,
help=help_parser.help_text("nombr"))
- ap.add_argument("--dnf", action="store_true", default=False,
+ ap.add_argument("--dnf", action="store_true", default=True,
help=help_parser.help_text("dnf"))
ap.add_argument("--mpathfriendlynames", action="store_true", default=True,
help=help_parser.help_text("mpathfriendlynames"))
diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py
index 50511a1..207f132 100644
--- a/pyanaconda/flags.py
+++ b/pyanaconda/flags.py
@@ -65,7 +65,7 @@ class Flags(object):
self.gpt = False
self.leavebootorder = False
self.testing = False
- self.dnf = False
+ self.dnf = True
self.mpathFriendlyNames = True
# ksprompt is whether or not to prompt for missing ksdata
self.ksprompt = True
--
1.9.3
9 years, 5 months
[rhel6] Shrink the LV if the VG is out of space (#1153376)
by Brian C. Lane
lvm doesn't always create the sizes that we expect it to. This can lead
to errors like this:
Volume group "VolGroup" has insufficient free space (1965 extents): 1968
required.
This change checks the LV's size against the VG's actual free space and
shrinks the LV to fit if it would be to big.
This is a port of commit 0c40779fa8f from python-blivet.
Resolves: rhbz#1153376
---
storage/devices.py | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/storage/devices.py b/storage/devices.py
index e179339..8bdf2a5 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2545,6 +2545,36 @@ class LVMLogicalVolumeDevice(DMDevice):
return [validpvs[0].path]
+ def _preCreate(self):
+ """ Adjust the size of the LV if there isn't enough space in the VG.
+
+ size calculations sometimes don't match what lvm actually creates,
+ so check the actual free space of the VG and use that if the LV is
+ too big.
+ """
+ try:
+ vg_info = lvm.vginfo(self.vg.name)
+ except errors.LVMError as lvmerr:
+ log.error("Failed to get free space for the %s VG: %s", self.vg.name, lvmerr)
+ # nothing more can be done, we don't know the VG's free space
+ return
+
+ try:
+ extent_size = float(vg_info["pe_size"])
+ extents_free = int(vg_info["pe_free"])
+ except ValueError as e:
+ log.error("Failed to get PE information for the %s VG: %s", self.vg.name, e)
+ return
+
+ log.debug("VG has %s free PEs of size %s", extents_free, extent_size)
+
+ can_use = extent_size * extents_free
+ if self.size > can_use:
+ msg = ("%s LV's size (%s) exceeds the VG's usable free space (%s),"
+ "shrinking the LV") % (self.name, self.size, can_use)
+ log.warning(msg)
+ self.size = can_use
+
def create(self, intf=None):
""" Create the device. """
log_method_call(self, self.name, status=self.status)
@@ -2561,6 +2591,9 @@ class LVMLogicalVolumeDevice(DMDevice):
self.createParents()
self.setupParents()
+ # Make sure the LV will fit into the real VG size
+ self._preCreate()
+
# should we use --zero for safety's sake?
if self.singlePV:
lvm.lvcreate(self.vg.name, self._name, self.size, progress=w,
--
1.9.3
9 years, 5 months
[blivet:master] Check the status of the format being mounted.
by Anne Mulhern
Previous code checked the status of the format attribute. It seems
to make more sense to wait and check the status of the format selected
to be actually mounted, which may be the originalFormat attribute.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
blivet/devices/btrfs.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py
index 5061af1..13adbb4 100644
--- a/blivet/devices/btrfs.py
+++ b/blivet/devices/btrfs.py
@@ -92,15 +92,19 @@ class BTRFSDevice(StorageDevice):
return "btrfs-tmp.%s" % self.id
def _do_temp_mount(self, orig=False):
- if self.format.status or not self.exists:
+ if not self.exists:
return
- tmpdir = tempfile.mkdtemp(prefix=self._temp_dir_prefix)
if orig:
fmt = self.originalFormat
else:
fmt = self.format
+ if fmt.status:
+ return
+
+ tmpdir = tempfile.mkdtemp(prefix=self._temp_dir_prefix)
+
fmt.mount(mountpoint=tmpdir)
def _undo_temp_mount(self):
--
1.9.3
9 years, 5 months
[PATCH 0/2] Allow adding btrfs subvolumes into devicetree outside Anaconda
by Vojtěch Trefný
Currently blivet is not recognizing btrfs subvolumes when not in installer mode. There are two prob
lems:
1) devices.btrfs.listSubVolumes uses only originalFormat._mountpoint when looking for subvolumes bu
t for existing btrfs volumes originalFormat._mounpoint is always None and mountpoint is stored in f
ormat._mountpoint
2) devicetree.populate (or devicetree.handleBTRFSFormat) skips devices with existing format -- e.g. already added into devicetree but without mountpoint (and without subvolumes):wq
Vojtech Trefny (2):
Use format.mountpoint for BTRFS listSubVolumes
Allow handling device format for already handled BTRFS
blivet/devices/btrfs.py | 14 +++++++++-----
blivet/devicetree.py | 8 +++++---
2 files changed, 14 insertions(+), 8 deletions(-)
--
2.1.0
9 years, 5 months