[original values] kernel_params: ' user=lkp job=/lkp/scheduled/job.yaml RESULT_ROOT=/result/job rootovl ip=dhcp ro rdinit=/sbin/init prompt_ramdisk=0 initrd=20201022.0.cgz initrd=run-ipconfig_20200904.cgz initrd=modules-4.19.90-2003.cgz initrd=headers-4.19.90-2003.cgz initrd=mpstat_20201104.cgz initrd=spinlock_20201104.cgz initrd=git-1.cgz initrd=1.0-1.cgz initrd=lkp-aarch64.cgz initrd=job.cgz '
[now values] kernel_params: - user=lkp - job=/lkp/scheduled/job.yaml - RESULT_ROOT=/result/job - rootovl - ip=dhcp - ro - rdinit=/sbin/init - prompt_ramdisk=0 - initrd=20201022.0.cgz - initrd=run-ipconfig_20200904.cgz - initrd=modules-4.19.90-2003.4.0.0036.oe1.aarch64.cgz - initrd=headers-4.19.90-2003.4.0.0036.oe1.aarch64.cgz - initrd=mpstat_20201104.cgz - initrd=spinlock_20201104.cgz - initrd=git-1.cgz - initrd=1.0-1.cgz - initrd=lkp-aarch64.cgz - initrd=job.cgz
Signed-off-by: Bai Jing 799286817@qq.com --- src/scheduler/find_job_boot.cr | 4 ++-- src/scheduler/kernel_params.cr | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/scheduler/find_job_boot.cr b/src/scheduler/find_job_boot.cr index 3b68b59..ad48f27 100644 --- a/src/scheduler/find_job_boot.cr +++ b/src/scheduler/find_job_boot.cr @@ -135,8 +135,8 @@ class Sched private def get_boot_ipxe(job : Job) response = "#!ipxe\n\n" response += Array(String).from_json(job.initrds_uri).join("\n") + "\n" - response += job.kernel_uri - response += job.kernel_params + response += job.kernel_uri + " " + response += Array(String).from_json(job.kernel_params).join(" ") response += "\nboot\n"
return response diff --git a/src/scheduler/kernel_params.cr b/src/scheduler/kernel_params.cr index 0afe692..76606aa 100644 --- a/src/scheduler/kernel_params.cr +++ b/src/scheduler/kernel_params.cr @@ -30,7 +30,9 @@ class Job end
private def set_kernel_params - self["kernel_params"] = " #{kernel_common_params()} #{kernel_custom_params()} #{self.kernel_append_root} #{kernel_console()}" + 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) end
end