+++ b/jobs/iso2rootfs.yaml @@ -32,6 +32,7 @@ iso2rootfs: # - dns: will config /etc/resolv.conf. # - no_selinux: will disable selinux in /etc/selinux/config. # - no_fstab: will comment all line in /etc/fstab.
# - enable_repos: will enable all repo file of result rootfs. config_rootfs:
## install pkgs for result rootfs
+enable_repos() +{
- echo "${config_rootfs}" | grep -qw 'enable_repos' || return 0
Why not get 'enable_repos' from env vars?
just follow the above code part, ${conifg_rootfs} is a env var, and a list of optional config items, such as dns, no_selinux, no_fstab, enable_repos.
- ls ${ROOTFS_DES_DIR}/etc/yum.repos.d/*.repo > /dev/null 2>&1 && {
Is this line needed?
I think so, because in some os, /etc/yum.repos.d/ is empty, and on the other hand, os like debian, ubuntu, do not have /etc/yum.repos.d/.
so if we have os like debian, ubuntu, we can add another 'if' code.
-------- Thanks Yu Chuan
Thanks, Xueliang
sed -i 's/^enabled=0$/enabled=1/g' ${ROOTFS_DES_DIR}/etc/yum.repos.d/*.repo
- }
- return 0
+}
config_rootfs() { config_dns_resolver disable_selinux disable_fstab
enable_repos
install_pkgs_for_rootfs
}
2.23.0