Skip to content

Commit cfe6c0d

Browse files
committed
add el10 branch in bootstrap
1 parent 11f809e commit cfe6c0d

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

bootstrap

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,53 @@ EOF
458458
sudo mv -f "/tmp/el${releasever}.repo" "/etc/yum.repos.d/el${releasever}.repo"
459459
}
460460

461+
# Usage: add_el10_repo [region] (default|china|europe)
462+
function add_el10_repo(){
463+
local region=${1-"default"}
464+
local suffix=""
465+
if [ "${region}" = "china" ]; then
466+
baseurl="https://mirrors.aliyun.com"
467+
epelbase="https://mirrors.aliyun.com/epel"
468+
suffix=linux
469+
elif [ "${region}" = "europe" ]; then
470+
baseurl="https://mirrors.xtom.de"
471+
epelbase="https://mirrors.xtom.de/epel"
472+
else
473+
baseurl="https://dl.rockylinux.org/pub"
474+
epelbase="https://mirrors.edge.kernel.org/fedora-epel"
475+
fi
476+
cat > "/tmp/el${releasever}.repo" <<-EOF
477+
[baseos-default]
478+
name = EL ${releasever} BaseOS \$releasever - \$basearch
479+
baseurl = ${baseurl}/rocky${suffix}/\$releasever/BaseOS/\$basearch/os/
480+
gpgcheck = 0
481+
enabled = 1
482+
skip_if_unavailable = 1
483+
module_hotfixes=1
484+
[appstream-default]
485+
name = EL ${releasever} AppStream \$releasever - \$basearch
486+
baseurl = ${baseurl}/rocky${suffix}/\$releasever/AppStream/\$basearch/os/
487+
gpgcheck = 0
488+
enabled = 1
489+
skip_if_unavailable = 1
490+
module_hotfixes=1
491+
[crb-default]
492+
name = EL ${releasever} CRB \$releasever - \$basearch
493+
baseurl = ${baseurl}/rocky${suffix}/\$releasever/CRB/\$basearch/os/
494+
gpgcheck = 0
495+
enabled = 1
496+
skip_if_unavailable = 1
497+
module_hotfixes=1
498+
[epel-default]
499+
name = EL ${releasever} EPEL \$releasever - \$basearch
500+
baseurl = ${epelbase}/\$releasever.0/Everything/\$basearch/
501+
gpgcheck = 0
502+
enabled = 1
503+
skip_if_unavailable = 1
504+
module_hotfixes=1
505+
EOF
506+
sudo mv -f "/tmp/el${releasever}.repo" "/etc/yum.repos.d/el${releasever}.repo"
507+
}
461508

462509
# Usage: add_ubuntu_repo [region] (default|china|europe)
463510
function add_ubuntu_repo(){
@@ -577,6 +624,11 @@ function add_upstream_repo(){
577624
add_el7_repo "${REGION}"
578625
elif [[ $OS_VERSION == "8" || $OS_VERSION == "9" ]]; then
579626
add_el89_repo "${REGION}"
627+
elif [[ $OS_VERSION == "10" ]]; then
628+
add_el10_repo "${REGION}"
629+
else
630+
log_error "unsupported el version ${OS_VERSION}, please use el7, el8, el9 or el10"
631+
exit 10
580632
fi
581633
log_info "repo file = add el${OS_VERSION}.${ARCH} ${REGION} upstream"
582634
elif [[ ${OS_PACKAGE} == "deb" ]]; then
@@ -661,6 +713,10 @@ function check_utils(){
661713
log_info "install el9 utils"
662714
sudo dnf install -y createrepo_c unzip wget dnf-utils sshpass modulemd-tools
663715
sudo dnf install -y ansible python3-jmespath
716+
elif [[ $OS_VERSION == "10" ]]; then
717+
log_info "install el10 utils"
718+
sudo dnf install -y createrepo_c unzip wget dnf-utils sshpass
719+
sudo dnf install -y ansible-core
664720
fi
665721
fi
666722

0 commit comments

Comments
 (0)