Signed-off-by: Yu Chuan 13186087857@163.com --- jobs/iso2rootfs.yaml | 1 + tests/iso2rootfs | 7 +++++++ 2 files changed, 8 insertions(+)
diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index 2c4d3a93ff62..9123bef24ae5 100644 --- a/jobs/iso2rootfs.yaml +++ b/jobs/iso2rootfs.yaml @@ -21,6 +21,7 @@ iso2rootfs: ## supported fields: ## - dns: will config /etc/resolv.conf. ## - no_selinux: will disable selinux in /etc/selinux/config. + ## - no_fstab: will comment all line in /etc/fstab. config_rootfs:
# dailybuild related fields diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 9adbc930b48f..ce02080875ce 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -361,10 +361,17 @@ disable_selinux() sed -i 's/^SELINUX=.*/SELINUX=disabled/g' "${ROOTFS_DES_DIR}/etc/selinux/config" }
+disable_fstab() +{ + echo "${config_rootfs}" | grep -qw 'no_fstab' || return 0 + sed -i 's/^([^#])/# \1/g' "${ROOTFS_DES_DIR}/etc/fstab" +} + config_rootfs() { config_dns_resolver disable_selinux + disable_fstab }
############ test rootfs ############