[Why] In some cases, we do not need to configure the result rootfs, so add a switch to configure rootfs.
[How] Add 'config_rootfs' field in job.yaml. and support the following two fields now: - dns: will config /etc/resolv.conf. - no_selinux: will disable selinux in /etc/selinux/config.
Signed-off-by: Yu Chuan 13186087857@163.com --- jobs/iso2rootfs.yaml | 6 ++++++ tests/iso2rootfs | 2 ++ 2 files changed, 8 insertions(+)
diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index 8796874ce79d..55bf71517174 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -11,6 +11,12 @@ iso2rootfs: initrd_http_host: initrd_http_port:
+ # config rootfs related fields + ## supportted fields: + ## - dns: will config /etc/resolv.conf. + ## - no_selinux: will disable selinux in /etc/selinux/config. + config_rootfs: + # dailybuild related fields dailybuild_iso_url_file:
diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 5f85cc9db01e..c2e823c93ff9 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -345,6 +345,7 @@ run_qcow2rootfs() ############ config rootfs ############ config_dns_resolver() { + echo "${config_rootfs}" | grep -qw 'dns' || return 0 cat <<-EOF > "${ROOTFS_DES_DIR}/etc/resolv.conf" nameserver 114.114.114.114 nameserver 8.8.8.8 @@ -353,6 +354,7 @@ config_dns_resolver()
disable_selinux() { + echo "${config_rootfs}" | grep -qw 'no_selinux' || return 0 sed -i 's/^SELINUX=.*/SELINUX=disabled/g' "${ROOTFS_DES_DIR}/etc/selinux/config" }