[Why] Not all sources of one repo file are enabled, sometimes we need to enable all sources to install the specified pkg.
Signed-off-by: Yu Chuan 13186087857@163.com --- jobs/iso2rootfs.yaml | 1 + tests/iso2rootfs | 12 ++++++++++++ 2 files changed, 13 insertions(+)
diff --git a/jobs/iso2rootfs.yaml b/jobs/iso2rootfs.yaml index 2a6455245584..55c4345fad94 100644 --- a/jobs/iso2rootfs.yaml +++ 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 diff --git a/tests/iso2rootfs b/tests/iso2rootfs index 65a1935b7f49..06c8565110ab 100755 --- a/tests/iso2rootfs +++ b/tests/iso2rootfs @@ -393,11 +393,23 @@ install_pkgs_for_rootfs() fi }
+enable_repos() +{ + echo "${config_rootfs}" | grep -qw 'enable_repos' || return 0 + + ls ${ROOTFS_DES_DIR}/etc/yum.repos.d/*.repo > /dev/null 2>&1 && { + 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 }