提交 fe39750e 编写于 作者: X Xu Han

rh_kernel_update: Modify the step of updating kernel cmdline

* remove the default cmdline args for configuring new kernels
* make the command run only if there is additional args
Signed-off-by: NXu Han <xuhan@redhat.com>
上级 105bfd0d
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
pkg_arch = aarch64 pkg_arch = aarch64
s390x: s390x:
pkg_arch = s390x pkg_arch = s390x
args_removed = "rhgb quiet"
args_added = "console=ttyS0,115200 console=tty0"
install_virtio = no install_virtio = no
verify_virtio = no verify_virtio = no
virtio_drivers_list = "virtio virtio_ring virtio_pci" virtio_drivers_list = "virtio virtio_ring virtio_pci"
......
...@@ -272,14 +272,20 @@ def run(test, params, env): ...@@ -272,14 +272,20 @@ def run(test, params, env):
test.error("Fail to set default kernel: %s" % o) test.error("Fail to set default kernel: %s" % o)
# remove or add the required arguments # remove or add the required arguments
error_context.context("Update the guest kernel cmdline", logging.info) update_kernel_cmd = ""
update_kernel_cmd = "grubby --update-kernel=%s" % kernel_path if args_removed:
update_kernel_cmd += ' --remove-args="%s"' % " ".join(args_removed) update_kernel_cmd += ' --remove-args="%s"' % " ".join(args_removed)
update_kernel_cmd += ' --args="%s"' % " ".join(args_added) if args_added:
update_kernel_cmd += ' --args="%s"' % " ".join(args_added)
if update_kernel_cmd:
update_kernel_cmd = ("grubby --update-kernel=%s %s"
% (kernel_path, update_kernel_cmd))
update_kernel_cmd = params.get("update_kernel_cmd", update_kernel_cmd) update_kernel_cmd = params.get("update_kernel_cmd", update_kernel_cmd)
s, o = session.cmd_status_output(update_kernel_cmd) if update_kernel_cmd:
if s != 0: error_context.context("Update the guest kernel cmdline", logging.info)
test.error("Fail to modify kernel cmdline: %s" % o) s, o = session.cmd_status_output(update_kernel_cmd)
if s != 0:
test.error("Fail to modify kernel cmdline: %s" % o)
# upgrade listed packages to latest version. # upgrade listed packages to latest version.
for pkg in params.get("upgrade_pkgs", "").split(): for pkg in params.get("upgrade_pkgs", "").split():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册