Original: 'kernel_params' is composed of common kernel params and kernel params for boot.ipxe.
Now divide this field into 'kernel_params' and 'ipxe_kernel_params'.
Signed-off-by: Ren Wen 15991987063@163.com --- src/lib/job.cr | 11 +++-------- src/scheduler/kernel_params.cr | 9 ++++----- 2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 218e2e1..260b1ea 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -100,6 +100,7 @@ class Job user_lkp_src kernel_uri kernel_params + ipxe_kernel_params docker_image kernel_version linux_vmlinuz_path @@ -488,14 +489,8 @@ class Job return temp_initrds end
- private def initrds_basename - basenames = "" - - get_initrds().each do |initrd| - basenames += "initrd=#{File.basename(initrd)} " - end - - return basenames + private def initrds_basename : Array(String) + return os_mount == "container" ? [] of String : get_initrds.map { |initrd| "initrd=#{File.basename(initrd)}" } end
private def set_initrds_uri diff --git a/src/scheduler/kernel_params.cr b/src/scheduler/kernel_params.cr index 76606aa..dea9215 100644 --- a/src/scheduler/kernel_params.cr +++ b/src/scheduler/kernel_params.cr @@ -2,7 +2,6 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
class Job - private def kernel_common_params return "user=lkp job=/lkp/scheduled/job.yaml RESULT_ROOT=/result/job rootovl ip=dhcp ro" end @@ -15,10 +14,10 @@ class Job os_real_path = JobHelper.service_path("#{SRV_OS}/#{os_dir}")
fs2root = { - "nfs" => "root=#{OS_HTTP_HOST}:#{os_real_path} #{initrds_basename()}", + "nfs" => "root=#{OS_HTTP_HOST}:#{os_real_path}", "cifs" => "root=cifs://#{OS_HTTP_HOST}#{os_real_path}" + - ",guest,ro,hard,vers=1.0,noacl,nouser_xattr #{initrds_basename()}", - "initramfs" => "rdinit=/sbin/init prompt_ramdisk=0 #{initrds_basename()}", + ",guest,ro,hard,vers=1.0,noacl,nouser_xattr", + "initramfs" => "rdinit=/sbin/init prompt_ramdisk=0", "container" => "", }
@@ -33,6 +32,6 @@ class Job kernel_params_values = "#{kernel_common_params()} #{kernel_custom_params()} #{self.kernel_append_root} #{kernel_console()}" kernel_params_values = kernel_params_values.split(" ").map(&.strip()).reject!(&.empty?) @hash["kernel_params"] = JSON.parse(kernel_params_values.to_json) + @hash["ipxe_kernel_params"] = JSON.parse(initrds_basename.to_json) end - end