Previously we were only running this on GRUB 2 platforms, and we need to be doing it the same way everywhere.
Resolves: rhbz#814813
Signed-off-by: Peter Jones pjones@redhat.com --- pyanaconda/bootloader.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py index c313b6a..8cee09e 100644 --- a/pyanaconda/bootloader.py +++ b/pyanaconda/bootloader.py @@ -932,11 +932,25 @@ class BootLoader(object): except OSError as e: log.error("failed to set config file permissions: %s" % e)
+ def add_crash_args(self): + buf = "" + if os.access("%s%s" % (ROOT_PATH, "/usr/sbin/rhcrashkernel-param"), \ + os.X_OK): + (pread, pwrite) = os.pipe() + os.close(pwrite) + buf = iutil.execWithCapture("/usr/sbin/rhcrashkernel-param", [], + stdin=pread, + root=ROOT_PATH) + os.close(pread) + self.boot_args.add(buf) + def write_config(self): """ Write the bootloader configuration. """ if not self.config_file: raise BootLoaderError("no config file defined for this bootloader")
+ self.add_crash_args() + config_path = os.path.normpath(ROOT_PATH + self.config_file) if os.access(config_path, os.R_OK): os.rename(config_path, config_path + ".anacbak") @@ -1396,8 +1410,6 @@ class GRUB2(GRUB):
def __init__(self): super(GRUB2, self).__init__() - self.boot_args.add("$([ -x /usr/sbin/rhcrashkernel-param ] && "\ - "/usr/sbin/rhcrashkernel-param || :)")
# XXX we probably need special handling for raid stage1 w/ gpt disklabel # since it's unlikely there'll be a bios boot partition on each disk @@ -1523,6 +1535,8 @@ class GRUB2(GRUB): os.chmod(users_file, 0700)
def write_config(self): + self.add_crash_args() + self.write_config_console(None) # See if we have a password and if so update the boot args before we # write out the defaults file. @@ -2094,6 +2108,7 @@ class ZIPL(BootLoader): "default": self.image_label(self.default)}) config.write(header)
+ # # installation #
On Mon, 2014-02-24 at 15:00 -0500, Peter Jones wrote:
Previously we were only running this on GRUB 2 platforms, and we need to be doing it the same way everywhere.
Resolves: rhbz#814813
Signed-off-by: Peter Jones pjones@redhat.com
pyanaconda/bootloader.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py index c313b6a..8cee09e 100644 --- a/pyanaconda/bootloader.py +++ b/pyanaconda/bootloader.py @@ -932,11 +932,25 @@ class BootLoader(object): except OSError as e: log.error("failed to set config file permissions: %s" % e)
- def add_crash_args(self):
buf = ""if os.access("%s%s" % (ROOT_PATH, "/usr/sbin/rhcrashkernel-param"), \os.X_OK):(pread, pwrite) = os.pipe()os.close(pwrite)buf = iutil.execWithCapture("/usr/sbin/rhcrashkernel-param", [],stdin=pread,root=ROOT_PATH)os.close(pread)self.boot_args.add(buf)
I believe this deserves a comment on the "pipe magic" used.
Otherwise this looks good to me.
anaconda-patches@lists.fedorahosted.org