[PATCH compass-ci] dracut-initrd: support local disk rootfs

[Why] Allow user to submit a job that rootfs is in local disk by add 'custom_ipxe' field in job.yaml. Signed-off-by: Yu Chuan <13186087857@163.com> --- container/dracut-initrd/bin/set-local-sysroot.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/container/dracut-initrd/bin/set-local-sysroot.sh b/container/dracut-initrd/bin/set-local-sysroot.sh index 9e8374290230..1a2edafaf967 100644 --- a/container/dracut-initrd/bin/set-local-sysroot.sh +++ b/container/dracut-initrd/bin/set-local-sysroot.sh @@ -2,6 +2,10 @@ analyse_kernel_cmdline_params() { rootfs="$(getarg root=)" + + # if root is a local disk, then boot directly. + [[ $rootfs =~ ^/dev/ ]] && exit 0 + # example: $nfs_server_ip:/os/${os}/${os_arch}/${os_version}-snapshots/20210310005959 rootfs_src=$(echo $"$rootfs" | sed 's/\///') timestamp="$(basename $rootfs_src)" -- 2.23.0
participants (1)
-
Yu Chuan