|
458 | 458 | sudo mv -f "/tmp/el${releasever}.repo" "/etc/yum.repos.d/el${releasever}.repo" |
459 | 459 | } |
460 | 460 |
|
| 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 | +} |
461 | 508 |
|
462 | 509 | # Usage: add_ubuntu_repo [region] (default|china|europe) |
463 | 510 | function add_ubuntu_repo(){ |
@@ -577,6 +624,11 @@ function add_upstream_repo(){ |
577 | 624 | add_el7_repo "${REGION}" |
578 | 625 | elif [[ $OS_VERSION == "8" || $OS_VERSION == "9" ]]; then |
579 | 626 | 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 |
580 | 632 | fi |
581 | 633 | log_info "repo file = add el${OS_VERSION}.${ARCH} ${REGION} upstream" |
582 | 634 | elif [[ ${OS_PACKAGE} == "deb" ]]; then |
@@ -661,6 +713,10 @@ function check_utils(){ |
661 | 713 | log_info "install el9 utils" |
662 | 714 | sudo dnf install -y createrepo_c unzip wget dnf-utils sshpass modulemd-tools |
663 | 715 | 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 |
664 | 720 | fi |
665 | 721 | fi |
666 | 722 |
|
|
0 commit comments