When run job with initramfs, there is a default combination of kernel, modules and headers, and I add a key "kernel_version" to make it optional.
Signed-off-by: Xu Xijian xuxijian@huawei.com --- src/lib/job.cr | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 7fbc414..10c9a98 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -86,6 +86,7 @@ class Job kernel_append_root kernel_params docker_image + kernel_version )
macro method_missing(call) @@ -293,8 +294,9 @@ class Job end
private def set_kernel_uri + vmlinuz_sub_path = (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}") self["kernel_uri"] = "kernel #{OS_HTTP_PREFIX}" + - "#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/vmlinuz")}" + "#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/#{vmlinuz_sub_path}")}" end
private def kernel_common_params @@ -315,10 +317,16 @@ class Job temp_initrds = [] of String
osimage_dir = "#{SRV_INITRD}/osimage/#{os_dir}" + boot_dir = "#{SRV_OS}/#{os_dir}/boot" + self["kernel_version"] ||= "default" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/current")}" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/run-ipconfig.cgz")}" + temp_initrds << "#{OS_HTTP_PREFIX}" + + "#{JobHelper.service_path("#{boot_dir}/modules-#{kernel_version}.cgz")}" + temp_initrds << "#{OS_HTTP_PREFIX}" + + "#{JobHelper.service_path("#{boot_dir}/headers-#{kernel_version}.cgz")}"
temp_initrds.concat(initrd_deps.split(/ /)) unless initrd_deps.empty? temp_initrds.concat(initrd_pkg.split(/ /)) unless initrd_pkg.empty?
On Thu, Oct 29, 2020 at 10:10:42AM +0800, Xu Xijian wrote:
When run job with initramfs, there is a default combination of kernel, modules and headers, and I add a key "kernel_version" to make it optional.
Signed-off-by: Xu Xijian xuxijian@huawei.com
src/lib/job.cr | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 7fbc414..10c9a98 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -86,6 +86,7 @@ class Job kernel_append_root kernel_params docker_image
- kernel_version )
where is kernel_version come from? user specify in job.yaml and has a dafault?
Thanks, Shenwei
macro method_missing(call) @@ -293,8 +294,9 @@ class Job end
private def set_kernel_uri
- vmlinuz_sub_path = (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}") self["kernel_uri"] = "kernel #{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/vmlinuz")}"
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/#{vmlinuz_sub_path}")}"
end
private def kernel_common_params
@@ -315,10 +317,16 @@ class Job temp_initrds = [] of String
osimage_dir = "#{SRV_INITRD}/osimage/#{os_dir}"
boot_dir = "#{SRV_OS}/#{os_dir}/boot"
self["kernel_version"] ||= "default" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/current")}" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/run-ipconfig.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/modules-#{kernel_version}.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/headers-#{kernel_version}.cgz")}"
temp_initrds.concat(initrd_deps.split(/ /)) unless initrd_deps.empty? temp_initrds.concat(initrd_pkg.split(/ /)) unless initrd_pkg.empty?
-- 2.23.0
On Thu, Oct 29, 2020 at 10:14:57AM +0800, Xiao Shenwei wrote:
On Thu, Oct 29, 2020 at 10:10:42AM +0800, Xu Xijian wrote:
When run job with initramfs, there is a default combination of kernel, modules and headers, and I add a key "kernel_version" to make it optional.
Signed-off-by: Xu Xijian xuxijian@huawei.com
src/lib/job.cr | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 7fbc414..10c9a98 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -86,6 +86,7 @@ class Job kernel_append_root kernel_params docker_image
- kernel_version )
where is kernel_version come from? user specify in job.yaml and has a dafault?
Thanks, Shenwei
Every os has a default kernel_version, if users not set, it will use default, if users specify a kernel_version in job.yaml, it will use the specified one.
Thanks, Xijian
macro method_missing(call) @@ -293,8 +294,9 @@ class Job end
private def set_kernel_uri
- vmlinuz_sub_path = (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}") self["kernel_uri"] = "kernel #{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/vmlinuz")}"
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/#{vmlinuz_sub_path}")}"
end
private def kernel_common_params
@@ -315,10 +317,16 @@ class Job temp_initrds = [] of String
osimage_dir = "#{SRV_INITRD}/osimage/#{os_dir}"
boot_dir = "#{SRV_OS}/#{os_dir}/boot"
self["kernel_version"] ||= "default" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/current")}" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/run-ipconfig.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/modules-#{kernel_version}.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/headers-#{kernel_version}.cgz")}"
temp_initrds.concat(initrd_deps.split(/ /)) unless initrd_deps.empty? temp_initrds.concat(initrd_pkg.split(/ /)) unless initrd_pkg.empty?
-- 2.23.0
kernel_append_root kernel_params docker_image
- kernel_version )
where is kernel_version come from? user specify in job.yaml and has a dafault?
Thanks, Shenwei
Every os has a default kernel_version, if users not set, it will use default, if users specify a kernel_version in job.yaml, it will use the specified one.
Thanks, Xijian
macro method_missing(call) @@ -293,8 +294,9 @@ class Job end
private def set_kernel_uri
- vmlinuz_sub_path = (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}") self["kernel_uri"] = "kernel #{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/vmlinuz")}"
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/#{vmlinuz_sub_path}")}"
vmlinuz should keep, if use vmlinuz_sub_path, can it find default vmlinuz?
Thanks, Yinsi
end
private def kernel_common_params @@ -315,10 +317,16 @@ class Job temp_initrds = [] of String
osimage_dir = "#{SRV_INITRD}/osimage/#{os_dir}"
boot_dir = "#{SRV_OS}/#{os_dir}/boot"
self["kernel_version"] ||= "default" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/current")}" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/run-ipconfig.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/modules-#{kernel_version}.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/headers-#{kernel_version}.cgz")}"
temp_initrds.concat(initrd_deps.split(/ /)) unless initrd_deps.empty? temp_initrds.concat(initrd_pkg.split(/ /)) unless initrd_pkg.empty?
-- 2.23.0
On Thu, Oct 29, 2020 at 12:08:28PM +0800, Liu Yinsi wrote:
kernel_append_root kernel_params docker_image
- kernel_version )
where is kernel_version come from? user specify in job.yaml and has a dafault?
Thanks, Shenwei
Every os has a default kernel_version, if users not set, it will use default, if users specify a kernel_version in job.yaml, it will use the specified one.
Thanks, Xijian
macro method_missing(call) @@ -293,8 +294,9 @@ class Job end
private def set_kernel_uri
- vmlinuz_sub_path = (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}") self["kernel_uri"] = "kernel #{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/vmlinuz")}"
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/#{vmlinuz_sub_path}")}"
vmlinuz should keep, if use vmlinuz_sub_path, can it find default vmlinuz?
Thanks, Yinsi
I've kept vmlinuz: (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}") says if use default kernel, vmlinuz_sub_path is just vmlinuz.
Thanks, Xijian
private def set_kernel_uri
- vmlinuz_sub_path = (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}")
we not use soft link?
Thanks, Yinsi
self["kernel_uri"] = "kernel #{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/vmlinuz")}"
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/#{vmlinuz_sub_path}")}"
end
private def kernel_common_params
@@ -315,10 +317,16 @@ class Job temp_initrds = [] of String
osimage_dir = "#{SRV_INITRD}/osimage/#{os_dir}"
boot_dir = "#{SRV_OS}/#{os_dir}/boot"
self["kernel_version"] ||= "default" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/current")}" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/run-ipconfig.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/modules-#{kernel_version}.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/headers-#{kernel_version}.cgz")}"
temp_initrds.concat(initrd_deps.split(/ /)) unless initrd_deps.empty? temp_initrds.concat(initrd_pkg.split(/ /)) unless initrd_pkg.empty?
-- 2.23.0
On Thu, Oct 29, 2020 at 10:23:44AM +0800, Liu Yinsi wrote:
private def set_kernel_uri
- vmlinuz_sub_path = (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}")
we not use soft link?
Thanks, Yinsi
Because there are several kernel versions to choose, if all of them use soft link, there will be several soft links, it's redundant. For example, 100 kernel versions will need 100 soft links. So I just keep the default kernel version as a soft link.
Thanks, Xijian
self["kernel_uri"] = "kernel #{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/vmlinuz")}"
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/#{vmlinuz_sub_path}")}"
end
private def kernel_common_params
@@ -315,10 +317,16 @@ class Job temp_initrds = [] of String
osimage_dir = "#{SRV_INITRD}/osimage/#{os_dir}"
boot_dir = "#{SRV_OS}/#{os_dir}/boot"
self["kernel_version"] ||= "default" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/current")}" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/run-ipconfig.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/modules-#{kernel_version}.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/headers-#{kernel_version}.cgz")}"
temp_initrds.concat(initrd_deps.split(/ /)) unless initrd_deps.empty? temp_initrds.concat(initrd_pkg.split(/ /)) unless initrd_pkg.empty?
-- 2.23.0
On Thu, Oct 29, 2020 at 10:10:42AM +0800, Xu Xijian wrote:
When run job with initramfs, there is a default combination of kernel, modules and headers, and I add a key "kernel_version" to make it optional.
Signed-off-by: Xu Xijian xuxijian@huawei.com
src/lib/job.cr | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 7fbc414..10c9a98 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -86,6 +86,7 @@ class Job kernel_append_root kernel_params docker_image
kernel_version )
macro method_missing(call)
@@ -293,8 +294,9 @@ class Job end
private def set_kernel_uri
- vmlinuz_sub_path = (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}") self["kernel_uri"] = "kernel #{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/vmlinuz")}"
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/#{vmlinuz_sub_path}")}"
end
private def kernel_common_params
@@ -315,10 +317,16 @@ class Job temp_initrds = [] of String
osimage_dir = "#{SRV_INITRD}/osimage/#{os_dir}"
- boot_dir = "#{SRV_OS}/#{os_dir}/boot"
- self["kernel_version"] ||= "default"
You cant set the default kernel_version, that's not a right logic, you should set the default first, like set_kernel_version is need and call it the set default.
Thanks, Xueliang
temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/current")}" temp_initrds << "#{INITRD_HTTP_PREFIX}" + "#{JobHelper.service_path("#{osimage_dir}/run-ipconfig.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/modules-#{kernel_version}.cgz")}"
temp_initrds << "#{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{boot_dir}/headers-#{kernel_version}.cgz")}"
temp_initrds.concat(initrd_deps.split(/ /)) unless initrd_deps.empty? temp_initrds.concat(initrd_pkg.split(/ /)) unless initrd_pkg.empty?
-- 2.23.0
On Thu, Oct 29, 2020 at 11:24:19AM +0800, Cao Xueliang wrote:
On Thu, Oct 29, 2020 at 10:10:42AM +0800, Xu Xijian wrote:
When run job with initramfs, there is a default combination of kernel, modules and headers, and I add a key "kernel_version" to make it optional.
Signed-off-by: Xu Xijian xuxijian@huawei.com
src/lib/job.cr | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/lib/job.cr b/src/lib/job.cr index 7fbc414..10c9a98 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -86,6 +86,7 @@ class Job kernel_append_root kernel_params docker_image
kernel_version )
macro method_missing(call)
@@ -293,8 +294,9 @@ class Job end
private def set_kernel_uri
- vmlinuz_sub_path = (("#{kernel_version}" == "default") ? "vmlinuz" : "boot/vmlinuz-#{kernel_version}") self["kernel_uri"] = "kernel #{OS_HTTP_PREFIX}" +
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/vmlinuz")}"
"#{JobHelper.service_path("#{SRV_OS}/#{os_dir}/#{vmlinuz_sub_path}")}"
end
private def kernel_common_params
@@ -315,10 +317,16 @@ class Job temp_initrds = [] of String
osimage_dir = "#{SRV_INITRD}/osimage/#{os_dir}"
- boot_dir = "#{SRV_OS}/#{os_dir}/boot"
- self["kernel_version"] ||= "default"
You cant set the default kernel_version, that's not a right logic, you should set the default first, like set_kernel_version is need and call it the set default.
Thanks, Xueliang
OK.
Thanks, Xijian