51 lines
2.1 KiB
Diff
51 lines
2.1 KiB
Diff
From 30efb24192b167466814a380e855b9ecf97d7fc8 Mon Sep 17 00:00:00 2001
|
|
From: Radek Vykydal <rvykydal@redhat.com>
|
|
Date: Mon, 25 Jun 2018 15:55:17 +0200
|
|
Subject: [PATCH] Use anaconda bootloader module for boot options setting
|
|
(#1594827)
|
|
|
|
---
|
|
com_redhat_kdump/ks/kdump.py | 15 ++++++++++-----
|
|
1 file changed, 10 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/com_redhat_kdump/ks/kdump.py b/com_redhat_kdump/ks/kdump.py
|
|
index d9aaa7b..496c322 100644
|
|
--- a/com_redhat_kdump/ks/kdump.py
|
|
+++ b/com_redhat_kdump/ks/kdump.py
|
|
@@ -23,6 +23,8 @@
|
|
from pyanaconda.addons import AddonData
|
|
from pyanaconda.core import util
|
|
from pyanaconda.flags import flags
|
|
+from pyanaconda.modules.common.constants.services import STORAGE
|
|
+from pyanaconda.modules.common.constants.objects import BOOTLOADER
|
|
|
|
from pykickstart.options import KSOptionParser
|
|
from pykickstart.errors import KickstartParseError, formatErrorMsg
|
|
@@ -67,18 +69,21 @@ def setup(self, storage, ksdata, instClass, payload):
|
|
if not flags.cmdline.getbool("kdump_addon", default=False):
|
|
return
|
|
|
|
+ bootloader_proxy = STORAGE.get_proxy(BOOTLOADER)
|
|
+
|
|
# Clear any existing crashkernel bootloader arguments
|
|
- if ksdata.bootloader.appendLine:
|
|
- ksdata.bootloader.appendLine = ' '.join(
|
|
- (arg for arg in ksdata.bootloader.appendLine.split() \
|
|
- if not arg.startswith('crashkernel=')))
|
|
+ extra_args = bootloader_proxy.ExtraArguments
|
|
+ new_args = [arg for arg in extra_args
|
|
+ if not arg.startswith('crashkernel=')]
|
|
|
|
# Copy our reserved amount to the bootloader arguments
|
|
if self.enabled:
|
|
# Ensure that the amount is an amount in MB
|
|
if self.reserveMB[-1] != 'M':
|
|
self.reserveMB += 'M'
|
|
- ksdata.bootloader.appendLine += ' crashkernel=%s' % self.reserveMB
|
|
+ new_args.append(' crashkernel=%s' % self.reserveMB)
|
|
+
|
|
+ bootloader_proxy.SetExtraArguments(new_args)
|
|
|
|
# Do the same thing with the storage.bootloader.boot_args set
|
|
if storage.bootloader.boot_args:
|