[why] Only initramfs needs modules.cgz and headers.cgz.
[how] Judge if it boots with initramfs before setting the values of linux_modules_initrd and linux_headers_initrd.
Signed-off-by: Xu Xijian hdxuxijian@163.com --- src/lib/job.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 6309809..07873ab 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -302,8 +302,10 @@ class Job boot_dir = "#{SRV_OS}/#{os_dir}/boot" suffix = "-#{kernel_version}" if self["kernel_version"]? self["linux_vmlinuz_path"] = File.real_path("#{boot_dir}/vmlinuz#{suffix}") - self["linux_modules_initrd"] = File.real_path("#{boot_dir}/modules#{suffix}.cgz") - self["linux_headers_initrd"] = File.real_path("#{boot_dir}/headers#{suffix}.cgz") + if "#{os_mount}" == "initramfs" + self["linux_modules_initrd"] = File.real_path("#{boot_dir}/modules#{suffix}.cgz") + self["linux_headers_initrd"] = File.real_path("#{boot_dir}/headers#{suffix}.cgz") + end end
private def set_kernel_uri