新增适配 Oracle Linux 操作系统

This commit is contained in:
Super Manito
2025-07-18 09:26:32 +08:00
parent 14cfbc727d
commit 76b8b0834a
2 changed files with 41 additions and 11 deletions

View File

@@ -786,7 +786,7 @@ function collect_system_info() {
# CentOS Stream # CentOS Stream
grep -q "${SYSTEM_CENTOS_STREAM}" $File_RedHatRelease && SYSTEM_JUDGMENT="${SYSTEM_CENTOS_STREAM}" grep -q "${SYSTEM_CENTOS_STREAM}" $File_RedHatRelease && SYSTEM_JUDGMENT="${SYSTEM_CENTOS_STREAM}"
# Oracle Linux # Oracle Linux
[ -s "${File_OracleLinuxRelease}" ] && unsupport_system_error "Oracle Linux" [ -s "${File_OracleLinuxRelease}" ] && SYSTEM_JUDGMENT="${SYSTEM_ORACLE}"
;; ;;
"${SYSTEM_ARCH}") "${SYSTEM_ARCH}")
if [ -f "${File_ManjaroRelease}" ]; then if [ -f "${File_ManjaroRelease}" ]; then
@@ -832,7 +832,7 @@ function collect_system_info() {
is_supported="false" is_supported="false"
fi fi
;; ;;
"${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}") "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}" | "${SYSTEM_ORACLE}")
if [[ "${SYSTEM_VERSION_ID_MAJOR}" != [8-9] && "${SYSTEM_VERSION_ID_MAJOR}" != 10 ]]; then if [[ "${SYSTEM_VERSION_ID_MAJOR}" != [8-9] && "${SYSTEM_VERSION_ID_MAJOR}" != 10 ]]; then
is_supported="false" is_supported="false"
fi fi
@@ -956,7 +956,7 @@ function collect_system_info() {
SOURCE_BRANCH="centos-altarch" SOURCE_BRANCH="centos-altarch"
fi fi
;; ;;
"${SYSTEM_CENTOS_STREAM}") "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ORACLE}")
# 自 CentOS Stream 9 开始使用 centos-stream 仓库,旧版本使用 centos 仓库 # 自 CentOS Stream 9 开始使用 centos-stream 仓库,旧版本使用 centos 仓库
case "${SYSTEM_VERSION_ID_MAJOR}" in case "${SYSTEM_VERSION_ID_MAJOR}" in
8) 8)
@@ -1562,6 +1562,23 @@ function remove_original_mirrors() {
"${SYSTEM_ALMALINUX}") "${SYSTEM_ALMALINUX}")
repo_patterns=("almalinux*") repo_patterns=("almalinux*")
;; ;;
"${SYSTEM_ORACLE}")
case "${SYSTEM_VERSION_ID_MAJOR}" in
9 | 10)
repo_patterns=(
"*ol${SYSTEM_VERSION_ID_MAJOR}.repo"
"centos-stream.repo"
"centos-stream-addons.repo"
)
;;
8)
repo_patterns=(
"*ol${SYSTEM_VERSION_ID_MAJOR}.repo"
"CentOS-Stream-*"
)
;;
esac
;;
"${SYSTEM_OPENCLOUDOS}") "${SYSTEM_OPENCLOUDOS}")
repo_patterns=("OpenCloudOS*") repo_patterns=("OpenCloudOS*")
;; ;;
@@ -2207,7 +2224,7 @@ function change_mirrors_RedHat() {
"${SYSTEM_CENTOS}") "${SYSTEM_CENTOS}")
gen_repo_files_CentOS "${SYSTEM_VERSION_ID_MAJOR}" gen_repo_files_CentOS "${SYSTEM_VERSION_ID_MAJOR}"
;; ;;
"${SYSTEM_CENTOS_STREAM}") "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ORACLE}")
gen_repo_files_CentOSStream "${SYSTEM_VERSION_ID_MAJOR}" gen_repo_files_CentOSStream "${SYSTEM_VERSION_ID_MAJOR}"
;; ;;
"${SYSTEM_ROCKY}") "${SYSTEM_ROCKY}")
@@ -2231,7 +2248,7 @@ function change_mirrors_RedHat() {
if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS}" ]]; then if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS}" ]]; then
SOURCE="vault.centos.org" SOURCE="vault.centos.org"
SOURCE_BRANCH="centos" SOURCE_BRANCH="centos"
elif [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS_STREAM}" && "${SYSTEM_VERSION_ID_MAJOR}" == 8 ]]; then elif [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS_STREAM}" || "${SYSTEM_JUDGMENT}" == "${SYSTEM_ORACLE}" ]] && [[ "${SYSTEM_VERSION_ID_MAJOR}" == 8 ]]; then
SOURCE="vault.centos.org" SOURCE="vault.centos.org"
SOURCE_BRANCH="centos" SOURCE_BRANCH="centos"
else else
@@ -2327,7 +2344,7 @@ function change_mirrors_RedHat() {
-i \ -i \
CentOS-* CentOS-*
;; ;;
"${SYSTEM_CENTOS_STREAM}") "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ORACLE}")
case "${SYSTEM_VERSION_ID_MAJOR}" in case "${SYSTEM_VERSION_ID_MAJOR}" in
9 | 10) 9 | 10)
sed -e "s|^#baseurl=https|baseurl=${WEB_PROTOCOL}|g" \ sed -e "s|^#baseurl=https|baseurl=${WEB_PROTOCOL}|g" \
@@ -2336,6 +2353,13 @@ function change_mirrors_RedHat() {
-i \ -i \
centos.repo \ centos.repo \
centos-addons.repo centos-addons.repo
if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_ORACLE}" ]]; then
# 禁用 GPG 签名检查
sed -e "s|gpgcheck=1|gpgcheck=0|g" \
-i \
centos.repo \
centos-addons.repo
fi
;; ;;
8) 8)
sed -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \ sed -e "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" \
@@ -2344,6 +2368,12 @@ function change_mirrors_RedHat() {
-e "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"${SOURCE}"}/${SOURCE_VAULT_BRANCH:-centos-vault}|g" \ -e "s|vault.centos.org/\$contentdir|${SOURCE_VAULT:-"${SOURCE}"}/${SOURCE_VAULT_BRANCH:-centos-vault}|g" \
-i \ -i \
CentOS-Stream-* CentOS-Stream-*
if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_ORACLE}" ]]; then
# 禁用 GPG 签名检查
sed -e "s|gpgcheck=1|gpgcheck=0|g" \
-i \
CentOS-Stream-*
fi
;; ;;
esac esac
;; ;;
@@ -2462,7 +2492,7 @@ function change_mirrors_RedHat() {
if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS}" ]]; then if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS}" ]]; then
SOURCE="" SOURCE=""
SOURCE_BRANCH="" SOURCE_BRANCH=""
elif [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS_STREAM}" && "${SYSTEM_VERSION_ID_MAJOR}" == 8 ]]; then elif [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS_STREAM}" || "${SYSTEM_JUDGMENT}" == "${SYSTEM_ORACLE}" ]] && [[ "${SYSTEM_VERSION_ID_MAJOR}" == 8 ]]; then
SOURCE="" SOURCE=""
SOURCE_BRANCH="" SOURCE_BRANCH=""
fi fi
@@ -2759,7 +2789,7 @@ function change_mirrors_or_install_EPEL() {
;; ;;
9) 9)
## CentOS Stream 9 特殊,有两个不同的发行包 epel-release epel-next-release ## CentOS Stream 9 特殊,有两个不同的发行包 epel-release epel-next-release
if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS_STREAM}" || "${SYSTEM_JUDGMENT}" == "${SYSTEM_RHEL}" ]]; then if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS_STREAM}" || "${SYSTEM_JUDGMENT}" == "${SYSTEM_ORACLE}" || "${SYSTEM_JUDGMENT}" == "${SYSTEM_RHEL}" ]]; then
package_path="epel/epel{,-next}-release-latest-9" package_path="epel/epel{,-next}-release-latest-9"
fi fi
;; ;;
@@ -2778,7 +2808,7 @@ function change_mirrors_or_install_EPEL() {
fi fi
## 生成 repo 源文件 ## 生成 repo 源文件
gen_repo_files_EPEL "${SYSTEM_VERSION_ID_MAJOR}" gen_repo_files_EPEL "${SYSTEM_VERSION_ID_MAJOR}"
if [[ "${epel_version}" == 9 ]] && [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS_STREAM}" || "${SYSTEM_JUDGMENT}" == "${SYSTEM_RHEL}" ]]; then if [[ "${epel_version}" == 9 ]] && [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS_STREAM}" || "${SYSTEM_JUDGMENT}" == "${SYSTEM_ORACLE}" || "${SYSTEM_JUDGMENT}" == "${SYSTEM_RHEL}" ]]; then
gen_repo_files_EPEL_NEXT "${SYSTEM_VERSION_ID_MAJOR}" gen_repo_files_EPEL_NEXT "${SYSTEM_VERSION_ID_MAJOR}"
fi fi
## 使用官方源 ## 使用官方源
@@ -2813,7 +2843,7 @@ function change_mirrors_or_install_EPEL() {
function get_package_manager() { function get_package_manager() {
local command="yum" local command="yum"
case "${SYSTEM_JUDGMENT}" in case "${SYSTEM_JUDGMENT}" in
"${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}" | "${SYSTEM_RHEL}") "${SYSTEM_RHEL}" | "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}" | "${SYSTEM_ORACLE}")
case "${SYSTEM_VERSION_ID_MAJOR}" in case "${SYSTEM_VERSION_ID_MAJOR}" in
9 | 10) 9 | 10)
command="dnf" command="dnf"

View File

@@ -1346,7 +1346,7 @@ function check_installed_result() {
function get_package_manager() { function get_package_manager() {
local command="yum" local command="yum"
case "${SYSTEM_JUDGMENT}" in case "${SYSTEM_JUDGMENT}" in
"${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}" | "${SYSTEM_RHEL}") "${SYSTEM_RHEL}" | "${SYSTEM_CENTOS_STREAM}" | "${SYSTEM_ROCKY}" | "${SYSTEM_ALMALINUX}" | "${SYSTEM_ORACLE}")
case "${SYSTEM_VERSION_ID_MAJOR}" in case "${SYSTEM_VERSION_ID_MAJOR}" in
9 | 10) 9 | 10)
command="dnf" command="dnf"