Skip to content

Commit

Permalink
Merge pull request #227 from pastalian/miraclelinux
Browse files Browse the repository at this point in the history
Support MIRACLE LINUX
  • Loading branch information
andrewlukoshko authored Aug 22, 2024
2 parents 86c0545 + 6553cbe commit d683961
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ jobs:
- "quay.io/centos/centos:stream9"
- "redhat/ubi9:latest"
- "virtuozzo/vzlinux9:latest"
- "pastalian/miraclelinux:9"
- "oraclelinux:8"
- "rockylinux/rockylinux:8"
- "quay.io/centos/centos:stream8"
- "redhat/ubi8:latest"
- "virtuozzo/vzlinux8:latest"
- "pastalian/miraclelinux:8"

# Platforms list
platform:
Expand Down Expand Up @@ -105,6 +107,22 @@ jobs:
- image_tag: "rockylinux/rockylinux:8"
platform: linux/s390x

# MIRACLE LINUX 9
- image_tag: "pastalian/miraclelinux:9"
platform: linux/ppc64le
- image_tag: "pastalian/miraclelinux:9"
platform: linux/s390x
- image_tag: "pastalian/miraclelinux:9"
platform: linux/arm64

# MIRACLE LINUX 8
- image_tag: "pastalian/miraclelinux:8"
platform: linux/ppc64le
- image_tag: "pastalian/miraclelinux:8"
platform: linux/s390x
- image_tag: "pastalian/miraclelinux:8"
platform: linux/arm64

steps:

- name: Prepare stuff
Expand Down Expand Up @@ -228,4 +246,4 @@ jobs:
echo "${gpg_pubkey}"
else
echo " - None of ${al8_gpg_pubkey} or ${al9_gpg_pubkey} GPG KEY(s) were installed." && false
fi
fi
27 changes: 14 additions & 13 deletions almalinux-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ DOWNGRADE='NO'

BRANDING_PKGS=("centos-backgrounds" "centos-logos" "centos-indexhtml" \
"centos-logos-ipa" "centos-logos-httpd" \
"miraclelinux-backgrounds" "miraclelinux-logos" "miraclelinux-indexhtml" \
"miraclelinux-logos-ipa" "miraclelinux-logos-httpd" \
"oracle-backgrounds" "oracle-logos" "oracle-indexhtml" \
"oracle-logos-ipa" "oracle-logos-httpd" \
"oracle-epel-release-el8" "oracle-epel-release-el9" \
Expand All @@ -39,6 +41,9 @@ REMOVE_PKGS=("centos-linux-release" "centos-gpg-keys" "centos-linux-repos" \
"libreport-plugin-rhtsupport" "libreport-rhel" "insights-client" \
"libreport-rhel-anaconda-bugzilla" "libreport-rhel-bugzilla" \
"linux-firmware-core" "iwlax2xx-firmware" \
"miraclelinux-release" "miraclelinux-repos" "asianux-release" \
"axtsn-client-tools" "axtsn-setup" "dnf-axtu-plugin" \
"NetworkManager-config-connectivity-miraclelinux" \
"oraclelinux-release" "oraclelinux-release-el8" \
"oraclelinux-release-el9" "python3-gobject-base-noarch" \
"redhat-release" "redhat-release-eula" \
Expand Down Expand Up @@ -183,24 +188,20 @@ get_os_release_var() {
# Prints OS version.
get_os_version() {
local -r os_type="${1}"
local -a no_minor_os_types=("centos" "miraclelinux" "virtuozzo")
local os_version
if [[ "${os_type}" == 'centos' ]]; then
if [[ " ${no_minor_os_types[*]} " =~ [[:space:]]${os_type}[[:space:]] ]]; then
if [[ "$(get_os_release_var 'NAME')" == 'CentOS Stream' ]]; then
if [[ ! "${DOWNGRADE}" == 'YES' ]]; then
report_step_error "Use '-d or --downgrade' option to allow downgrade from CentOS Stream"
exit 1
fi
os_version="$(get_os_release_var 'VERSION_ID')"
else
if ! os_version="$(grep -oP 'CentOS\s+Linux\s+release\s+\K(\d+\.\d+)' \
"${REDHAT_RELEASE_PATH}" 2>/dev/null)"; then
report_step_error "Detect ${os_type} version"
fi
fi
elif [[ "${os_type}" == 'virtuozzo' ]]; then
if ! os_version="$(grep -oP 'Virtuozzo\s+Linux\s+release\s+\K(\d+\.\d+)' \
"${REDHAT_RELEASE_PATH}" 2>/dev/null)"; then
report_step_error "Detect ${os_type} version"
if ! os_version="$(grep -oP '\s+release\s+\K(\d+\.\d+)' \
"${REDHAT_RELEASE_PATH}" 2>/dev/null)"; then
report_step_error "Detect ${os_type} version"
fi
fi
else
os_version="$(get_os_release_var 'VERSION_ID')"
Expand Down Expand Up @@ -248,7 +249,7 @@ assert_supported_system() {
report_step_error "Check EL${os_version} is supported"
exit 1
fi
os_types=("centos" "almalinux" "ol" "rhel" "rocky" "virtuozzo")
os_types=("centos" "almalinux" "miraclelinux" "ol" "rhel" "rocky" "virtuozzo")
if [[ ! " ${os_types[*]} " =~ ${os_type} ]]; then
report_step_error "Check ${os_type} operating system is supported"
exit 1
Expand Down Expand Up @@ -653,7 +654,7 @@ replace_brand_packages() {
;;
*)
# shellcheck disable=SC2001
alma_pkg="$(echo "${pkg_name}" | sed 's#centos\|oracle\|redhat\|rocky\|vzlinux#almalinux#')"
alma_pkg="$(echo "${pkg_name}" | sed 's#centos\|miraclelinux\|oracle\|redhat\|rocky\|vzlinux#almalinux#')"
;;
esac
alma_pkgs+=("${alma_pkg}")
Expand Down Expand Up @@ -1166,7 +1167,7 @@ main() {
assert_compatible_os_version "${os_version}" "${release_path}"

case "${os_type}" in
almalinux|centos|ol|rhel|rocky|virtuozzo)
almalinux|centos|miraclelinux|ol|rhel|rocky|virtuozzo)
backup_issue

if [[ "${os_type}" == "rhel" ]]; then
Expand Down

0 comments on commit d683961

Please sign in to comment.