[PATCH rhel7-branch] Allow specifying an environment in the kickstart file (#1050994).
by Chris Lumens
This is done without introducing any new kickstart syntax. We just check all
the groups listed and if any is an environment, select it. This should work
for deselecting environments too.
---
pyanaconda/packaging/yumpayload.py | 38 ++++++++++++++++++++++++++++++++----
pyanaconda/ui/gui/spokes/software.py | 10 +++++++++-
2 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 4b4a226..0cf380b 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -1365,8 +1365,20 @@ reposdir=%s
"""
self._selectYumGroup("core")
- if self.data.packages.default and self.environments:
- self.selectEnvironment(self.environments[0])
+ foundEnv = None
+
+ if self.environments:
+ if self.data.packages.default:
+ self.selectEnvironment(self.environments[0])
+ else:
+ # Look through all groups listed in the kickstart file. If one
+ # is an environment, select it now and then mark which one it is
+ # so we don't later try to select it as a group, too.
+ for (ndx, grp) in enumerate(self.data.packages.groupList):
+ if grp.name in self.environments:
+ self.selectEnvironment(grp.name)
+ foundEnv = ndx
+ break
for package in self.data.packages.packageList:
try:
@@ -1374,7 +1386,11 @@ reposdir=%s
except NoSuchPackage as e:
self._handleMissing(e)
- for group in self.data.packages.groupList:
+ for (ndx, group) in enumerate(self.data.packages.groupList):
+ # Skip any previously selected environment.
+ if ndx == foundEnv:
+ continue
+
default = False
optional = False
if group.include == GROUP_DEFAULT:
@@ -1394,7 +1410,21 @@ reposdir=%s
except NoSuchPackage as e:
self._handleMissing(e)
- for group in self.data.packages.excludedGroupList:
+ # And then do the same thing for removing environments as we did for
+ # adding them earlier.
+ foundEnv = None
+ if self.environments:
+ for (ndx, grp) in enumerate(self.data.packages.excludedGroupList):
+ if grp.name in self.environments:
+ self.deselectEnvironment(grp.name)
+ foundEnv = ndx
+ break
+
+ for (ndx, group) in enumerate(self.data.packages.excludedGroupList):
+ # Skip any previously selected environment.
+ if ndx == foundEnv:
+ continue
+
try:
self._deselectYumGroup(group.name)
except NoSuchGroup as e:
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 1f92e3d..b35c5a0 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -250,8 +250,16 @@ class SoftwareSelectionSpoke(NormalSpoke):
self._environmentStore = self.builder.get_object("environmentStore")
self._environmentStore.clear()
+
+ # If we don't know what the environment is, perhaps it's listed in the
+ # kickstart file. Look in there to see.
if self.environment not in self.payload.environments:
- self.environment = None
+ for grp in self.data.packages.groupList:
+ if grp.name in self.payload.environments:
+ self.environment = grp.name
+ break
+ else:
+ self.environment = None
clasess = []
firstEnvironment = True
--
1.8.3.1
10 years, 3 months
[rhel7-branch/master][PATCH] Prevent kickstart parsing errors from corrupting boot options
by Martin Kolman
Turns out we were kickstart parsing errors, so parsing of the given command was not interrupted,
but the error message was instead added to the output file.
This garbage then caused shlex to throw an exception when parsing the file.
So I've set errorsAreFatal to True - with this errors end up in Journal,
the boot option file has only correctly parsed options and Anaconda will
abort the installation as usual when it re-parses the file on startup and
gets the same error.
If the kickstart error prevents stage2 from startup, the error is in the system log and
can be debugged.
Martin Kolman (1):
Prevent kickstart parsing errors from ending up in boot options (#1060184)
dracut/parse-kickstart | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--
1.8.5.3
10 years, 3 months
[PATCH rhel7-branch] Add support for fcoe --autovlan option (#1055779)
by Radek Vykydal
Port from rhel6-branch
Resolves: rhbz#1055779
---
anaconda.spec.in | 2 +-
pyanaconda/kickstart.py | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index f6d2436..74794c1 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -21,7 +21,7 @@ Source0: %{name}-%{version}.tar.bz2
%define gconfversion 2.28.1
%define intltoolver 0.31.2-3
%define libnlver 1.0
-%define pykickstartver 1.99.43.4
+%define pykickstartver 1.99.43.8
%define yumver 3.4.3-91
%define partedver 1.8.1
%define pypartedver 2.5-2
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index c5588d0..aa8c9b2 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -520,9 +520,9 @@ class ClearPart(commands.clearpart.F17_ClearPart):
storage.clearPartitions()
-class Fcoe(commands.fcoe.F13_Fcoe):
+class Fcoe(commands.fcoe.RHEL7_Fcoe):
def parse(self, args):
- fc = commands.fcoe.F13_Fcoe.parse(self, args)
+ fc = commands.fcoe.RHEL7_Fcoe.parse(self, args)
if fc.nic not in nm.nm_devices():
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent nic %s in fcoe command" % fc.nic)
@@ -531,7 +531,7 @@ class Fcoe(commands.fcoe.F13_Fcoe):
log.info("Kickstart fcoe device %s already added from EDD, ignoring"
% fc.nic)
else:
- msg = blivet.fcoe.fcoe().addSan(nic=fc.nic, dcb=fc.dcb, auto_vlan=True)
+ msg = blivet.fcoe.fcoe().addSan(nic=fc.nic, dcb=fc.dcb, auto_vlan=fc.autovlan)
if not msg:
msg = "Succeeded."
blivet.fcoe.fcoe().added_nics.append(fc.nic)
--
1.7.11.7
10 years, 3 months
[PATCH rhel7-branch] The autopart scheme combo should work for creating partitions manually, too.
by Chris Lumens
Previous changes moved the autopart scheme combo onto the custom partitioning
screen, on the left side where we list options for creating mount points.
However, this change made it appear that the combo did not affect mount points
created on this screen manually. This change moves the combo down a little
under a different heading and makes sure it works for manually created
mount points.
Related: rhbz#1014671
---
pyanaconda/ui/gui/spokes/custom.py | 12 ++++++
pyanaconda/ui/gui/spokes/lib/accordion.py | 62 +++++++++++++++++++------------
2 files changed, 50 insertions(+), 24 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 7c9747f..b2fdc9b 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -898,6 +898,17 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._current_selector.set_chosen(False)
self._current_selector = None
+ def _change_autopart_type(self, autopartTypeCombo):
+ # This is called when the autopart type combo on the left hand side of
+ # custom partitioning is changed. We already know how to handle the
+ # case where the user changes the type and then clicks the autopart
+ # link button. This handles the case where the user changes the type
+ # and then clicks the '+' button.
+
+ # NOTE: This assumes the order of things in the combo box and the order
+ # of the pykickstart AUTOPART_TYPE_* constants are the same.
+ self.data.autopart.type = autopartTypeCombo.get_active()
+
def _do_refresh(self, mountpointToShow=None):
# block mountpoint selector signal handler for now
self._initialized = False
@@ -941,6 +952,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
if not new_devices:
page = CreateNewPage(self.translated_new_install_name,
self.on_create_clicked,
+ self._change_autopart_type,
partitionsToReuse=bool(ui_roots))
self._accordion.addPage(page, cb=self.on_page_clicked)
diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py
index 7def9e7..b5f8993 100644
--- a/pyanaconda/ui/gui/spokes/lib/accordion.py
+++ b/pyanaconda/ui/gui/spokes/lib/accordion.py
@@ -1,7 +1,7 @@
# vim: set fileencoding=utf-8
# Mountpoint selector accordion and page classes
#
-# Copyright (C) 2012 Red Hat, Inc.
+# Copyright (C) 2012-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
@@ -247,7 +247,7 @@ class UnknownPage(Page):
# of this class will be packed into the Accordion first and then when the new installation
# is created, it will be removed and replaced with a Page for it.
class CreateNewPage(Page):
- def __init__(self, title, cb, partitionsToReuse=True):
+ def __init__(self, title, createClickedCB, autopartTypeChangedCB, partitionsToReuse=True):
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL, spacing=6)
self.members = []
self.pageTitle = title
@@ -261,55 +261,69 @@ class CreateNewPage(Page):
label = Gtk.Label(_("You haven't created any mount points for your %s %s installation yet. You can:") % (productName, productVersion))
label.set_line_wrap(True)
label.set_alignment(0, 0.5)
- self._createBox.attach(label, 0, 0, 3, 1)
+ self._createBox.attach(label, 0, 0, 2, 1)
dot = Gtk.Label("•")
- dot.set_alignment(0.5, 0)
+ dot.set_alignment(0.5, 0.4)
dot.set_hexpand(False)
self._createBox.attach(dot, 0, 1, 1, 1)
- label = Gtk.Label(_("Create them _automatically:"))
- label.set_use_underline(True)
- label.set_line_wrap(True)
+ self._createNewButton = Gtk.LinkButton("", label=_("_Click here to create them automatically."))
+ label = self._createNewButton.get_children()[0]
label.set_alignment(0, 0.5)
- self._createBox.attach(label, 1, 1, 2, 1)
+ label.set_hexpand(True)
+ label.set_line_wrap(True)
+ label.set_use_underline(True)
+ # Create this now to pass into the callback. It will be populated later
+ # on in this method.
combo = Gtk.ComboBoxText()
- label.set_mnemonic_widget(combo)
- combo.append_text(_("Standard Partition"))
- combo.append_text(_("BTRFS"))
- combo.append_text(_("LVM"))
- combo.append_text(_("LVM Thin Provisioning"))
- combo.set_active(2)
- self._createBox.attach(combo, 1, 2, 1, 1)
+ combo.connect("changed", autopartTypeChangedCB)
- button = Gtk.Button(_("_Create"))
- button.set_margin_right(6)
- button.set_use_underline(True)
- button.connect("clicked", cb, combo)
- self._createBox.attach(button, 2, 2, 1, 1)
+ self._createNewButton.set_has_tooltip(False)
+ self._createNewButton.set_halign(Gtk.Align.START)
+ self._createNewButton.connect("clicked", createClickedCB, combo)
+ self._createNewButton.connect("activate-link", lambda *args: Gtk.true())
+ self._createBox.attach(self._createNewButton, 1, 1, 1, 1)
dot = Gtk.Label("•")
dot.set_alignment(0.5, 0)
dot.set_hexpand(False)
- self._createBox.attach(dot, 0, 3, 1, 1)
+ self._createBox.attach(dot, 0, 2, 1, 1)
label = Gtk.Label(_("Create new mount points by clicking the '+' button."))
label.set_alignment(0, 0.5)
label.set_hexpand(True)
label.set_line_wrap(True)
- self._createBox.attach(label, 1, 3, 2, 1)
+ self._createBox.attach(label, 1, 2, 1, 1)
if partitionsToReuse:
dot = Gtk.Label("•")
dot.set_alignment(0.5, 0)
dot.set_hexpand(False)
- self._createBox.attach(dot, 0, 4, 1, 1)
+ self._createBox.attach(dot, 0, 3, 1, 1)
label = Gtk.Label(_("Or, assign new mount points to existing partitions after selecting them below."))
label.set_alignment(0, 0.5)
label.set_hexpand(True)
label.set_line_wrap(True)
- self._createBox.attach(label, 1, 4, 2, 1)
+ self._createBox.attach(label, 1, 3, 1, 1)
+
+ label = Gtk.Label(_("_New mount points will use the following partitioning scheme:"))
+ label.set_alignment(0, 0.5)
+ label.set_line_wrap(True)
+ label.set_use_underline(True)
+ self._createBox.attach(label, 0, 4, 2, 1)
+
+ label.set_mnemonic_widget(combo)
+ combo.append_text(_("Standard Partition"))
+ combo.append_text(_("BTRFS"))
+ combo.append_text(_("LVM"))
+ combo.append_text(_("LVM Thin Provisioning"))
+ combo.set_active(2)
+ combo.set_margin_left(18)
+ combo.set_margin_right(18)
+ combo.set_hexpand(False)
+ self._createBox.attach(combo, 0, 5, 2, 1)
self.add(self._createBox)
--
1.8.3.1
10 years, 3 months
[rhel7-branch][PATCH] Search for service files of all first boot utilities (#1060698)
by Vratislav Podzimek
If just Initial Setup gets installed, we should disable it if 'firstboot
--disable' appears in the kickstart file.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/kickstart.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index c5588d0..36d0710 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -580,7 +580,12 @@ class Firstboot(commands.firstboot.FC3_Firstboot):
self.firstboot = FIRSTBOOT_SKIP
def execute(self, *args):
- if not os.path.exists(ROOT_PATH + "/lib/systemd/system/firstboot-graphical.service"):
+ service_paths = ("/lib/systemd/system/firstboot-graphical.service",
+ "/lib/systemd/system/initial-setup-graphical.service",
+ "/lib/systemd/system/initial-setup-text.service")
+
+ if not any(os.path.exists(ROOT_PATH + path) for path in service_paths):
+ # none of the first boot utilities installed, nothing to do here
return
action = "enable"
--
1.8.5.3
10 years, 3 months
[RHEL 7] Cast the blame appropriately when the kernel refuses efivars changes.
by Peter Jones
There's nothing anaconda can do if the underlying API does not work, so
explain in the traceback that this isn't anaconda's fault.
Related: rhbz#959866
Related: rhbz#1009680
Signed-off-by: Peter Jones <pjones(a)redhat.com>
---
pyanaconda/bootloader.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index eea75ab..c313b6a 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1679,7 +1679,7 @@ class EFIGRUB(GRUB2):
rc = self.efibootmgr("-b", slot_id, "-B",
root=ROOT_PATH)
if rc:
- raise BootLoaderError("failed to remove old efi boot entry")
+ raise BootLoaderError("failed to remove old efi boot entry. This is most likely a kernel bug.")
@property
def efi_dir_as_efifs_dir(self):
@@ -1703,7 +1703,7 @@ class EFIGRUB(GRUB2):
self.efi_dir_as_efifs_dir + "\\shim.efi",
root=ROOT_PATH)
if rc:
- raise BootLoaderError("failed to set new efi boot target")
+ raise BootLoaderError("failed to set new efi boot target. This is most likely a kernel bug.")
def install(self):
if not flags.leavebootorder:
--
1.8.5.3
10 years, 3 months
[PATCH] Cast the blame appropriately when the kernel refuses efivars changes.
by Peter Jones
There's nothing anaconda can do if the underlying API does not work, so
explain in the traceback that this isn't anaconda's fault.
Related: rhbz#959866
Related: rhbz#1009680
Signed-off-by: Peter Jones <pjones(a)redhat.com>
---
pyanaconda/bootloader.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index aa307c1..9906eaa 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1669,7 +1669,7 @@ class EFIGRUB(GRUB2):
rc = self.efibootmgr("-b", slot_id, "-B")
if rc:
- raise BootLoaderError("failed to remove old efi boot entry")
+ raise BootLoaderError("failed to remove old efi boot entry. This is most likely a kernel bug.")
@property
def efi_dir_as_efifs_dir(self):
@@ -1692,7 +1692,7 @@ class EFIGRUB(GRUB2):
"-l",
self.efi_dir_as_efifs_dir + "\\shim.efi")
if rc:
- raise BootLoaderError("failed to set new efi boot target")
+ raise BootLoaderError("failed to set new efi boot target. This is most likely a kernel bug.")
def install(self, args=None):
if not flags.leavebootorder:
--
1.8.5.3
10 years, 3 months
[blivet] Convert the string representation of Size to a str type. (#1060382)
by David Shea
The return value of Size.humanReadable is sometimes a unicode, since the
translated units need to be unicode in order for upper/lower to work.
Convert the value back to a str so that __str__ conversions don't get
confused.
---
blivet/size.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/size.py b/blivet/size.py
index e7b6d30..dd19201 100644
--- a/blivet/size.py
+++ b/blivet/size.py
@@ -207,7 +207,7 @@ class Size(Decimal):
return self
def __str__(self, context=None):
- return self.humanReadable()
+ return str(self.humanReadable())
def __repr__(self):
return "Size('%s')" % self
--
1.8.5.3
10 years, 3 months
[PATCH] Convert the ntfs minsize to an int (#1060031)
by David Shea
The minsize string needs to be explicitly converted to an int before it
can be used in a %d format.
---
blivet/formats/fs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 8358144..4072870 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -1384,7 +1384,7 @@ class NTFS(FS):
continue
try:
# ntfsresize uses SI unit prefixes
- minSize = Size(spec="%d mb" % l.split(":")[1].strip())
+ minSize = Size(spec="%d mb" % int(l.split(":")[1].strip()))
except (IndexError, ValueError) as e:
minSize = None
log.warning("Unable to parse output for minimum size on %s: %s" %(self.device, e))
--
1.8.5.3
10 years, 3 months
[makebumpver] Update bumpver to allow Related bugs
by Brian C. Lane
Related bugs that are against a different component will have mismatched
Fixed-in-version strings, which is to be expected. So if it is Related,
valid and has an ack override the bad flag and allow it.
--- NOTE: This should be applied to makebumpver for blivet and anaconda on rhle7 branch
---
scripts/makebumpver | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/scripts/makebumpver b/scripts/makebumpver
index 1192312..d6b5aac 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -303,9 +303,11 @@ class MakeBumpVer:
bad = True
else:
bad = True
+ summary_bug = ckbug
else:
summary = summary.strip()
summary += " (%s)" % author
+ summary_bug = None
for bodyline in body:
m = re.match(r"^(Resolves|Related|Conflicts):\ +rhbz#\d+.*$",
@@ -324,6 +326,11 @@ class MakeBumpVer:
if valid:
rhbz.add("%s: rhbz#%s" % (action, ckbug))
+
+ # Remove the summary bug's action if it is for the same bug
+ summary_str = "Resolves: rhbz#%s" % summary_bug
+ if summary_bug and ckbug == summary_bug and summary_str in rhbz:
+ rhbz.remove(summary_str)
else:
bad = True
@@ -335,6 +342,11 @@ class MakeBumpVer:
fixedIn) or \
not self._isRHELBugAcked(ckbug, commit, summary)):
bad = True
+ elif valid and action == 'Related' and \
+ self._isRHELBugAcked(ckbug, commit, summary):
+ print "*** Bug %s Related commit %s is allowed\n" % (bug, commit)
+ # Related bugs only need to be valid and have an ack
+ bad = False
if len(rhbz) == 0:
print "*** No bugs referenced in commit %s\n" % commit
--
1.8.4.2
10 years, 3 months