Skip to content

Commit b10e0c0

Browse files
Merge pull request #244 from yuravk/master
AlmaLinux OS 10.0 support
2 parents 6a91221 + ef3055b commit b10e0c0

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
matrix:
5252
# OSs image:tag
5353
image_tag:
54+
- "redhat/ubi10:latest"
55+
- "quay.io/centos/centos:stream10"
5456
- "oraclelinux:9"
5557
- "rockylinux/rockylinux:9"
5658
- "quay.io/centos/centos:stream9"
@@ -231,6 +233,7 @@ jobs:
231233
run_arch=${platform#linux/}
232234
al8_gpg_pubkey='3abb34f8-5ffd890e'
233235
al9_gpg_pubkey='b86b3716-61e69f29'
236+
al10_gpg_pubkey='c2a1e572-668fe8ef'
234237
235238
echo "Testing AlmaLinux on ${platform}:"
236239
arch=$( docker run --platform=${platform} ${{ steps.build-container.outputs.digest }} /bin/bash -c "uname -m" )
@@ -249,10 +252,10 @@ jobs:
249252
echo " - ${almalinux_release} did not match" && false
250253
fi
251254
252-
gpg_pubkey=$( docker run --platform=${platform} ${{ steps.build-container.outputs.digest }} /bin/bash -c "rpm -q gpg-pubkey | egrep -e '${al8_gpg_pubkey}|${al9_gpg_pubkey}'" )
255+
gpg_pubkey=$( docker run --platform=${platform} ${{ steps.build-container.outputs.digest }} /bin/bash -c "rpm -q gpg-pubkey | grep -E '${al8_gpg_pubkey}|${al9_gpg_pubkey}|${al10_gpg_pubkey}'" )
253256
if [ -n "${gpg_pubkey}" ]; then
254257
echo " + GPG KEY(s) installed:"
255258
echo "${gpg_pubkey}"
256259
else
257-
echo " - None of ${al8_gpg_pubkey} or ${al9_gpg_pubkey} GPG KEY(s) were installed." && false
260+
echo " - None of ${al8_gpg_pubkey}, ${al9_gpg_pubkey} or ${al10_gpg_pubkey} GPG KEY(s) were installed." && false
258261
fi

almalinux-deploy.sh

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ assert_secureboot_disabled() {
202202

203203
# Prints a system architecture.
204204
get_system_arch() {
205-
uname -i
205+
uname -m
206206
}
207207

208208
# Reads a variable value from /etc/os-release.
@@ -267,7 +267,7 @@ get_enabled_repos() {
267267
#
268268
# $1 - operational system type.
269269
enable_repos() {
270-
local -r os_version="${1:0:1}"
270+
local -r os_version="${1%%.*}"
271271
if get_status_of_stage "enable_repos"; then
272272
return 0
273273
fi
@@ -300,7 +300,7 @@ enable_repos() {
300300
# $1 - operational system type.
301301
# $2 - system architecture.
302302
check_local_repo() {
303-
local -r os_version="${1:0:1}"
303+
local -r os_version="${1%%.*}"
304304
local -r arch="${2}"
305305
local check_repos="BaseOS AppStream"
306306
local check_links="almalinux-release-latest-${os_version}.${arch}.rpm RPM-GPG-KEY-AlmaLinux-${os_version}"
@@ -310,7 +310,7 @@ check_local_repo() {
310310
8*)
311311
check_repos+=" PowerTools"
312312
;;
313-
9*)
313+
9*|10*)
314314
check_repos+=" CRB"
315315
;;
316316
esac
@@ -343,7 +343,7 @@ check_local_repo() {
343343
# $1 - operational system type.
344344
# $2 - system architecture.
345345
switch_to_local_repo() {
346-
local -r os_version="${1:0:1}"
346+
local -r os_version="${1%%.*}"
347347
local -r arch="${2}"
348348

349349
# Switch only if local repository URL is set
@@ -391,7 +391,7 @@ assert_supported_system() {
391391
return 0
392392
fi
393393
local -r os_type="${1}"
394-
local -r os_version="${2:0:1}"
394+
local -r os_version="${2%%.*}"
395395
local -r arch="${3}"
396396
case "${arch}" in
397397
x86_64|aarch64|ppc64le|s390x)
@@ -401,7 +401,7 @@ assert_supported_system() {
401401
exit 1
402402
;;
403403
esac
404-
if [[ ${os_version} -lt ${MINIMAL_SUPPORTED_VERSION:0:1} ]]; then
404+
if [[ ${os_version} -lt ${MINIMAL_SUPPORTED_VERSION%%.*} ]]; then
405405
report_step_error "Check EL${os_version} is supported"
406406
exit 1
407407
fi
@@ -488,7 +488,7 @@ assert_dnf_plugins_core() {
488488
#
489489
# Prints almalinux-release RPM package download URL.
490490
get_release_file_url() {
491-
local -r os_version="${1:0:1}"
491+
local -r os_version="${1%%.*}"
492492
local -r arch="${2}"
493493
echo "${ALMA_RELEASE_URL:-${REPO_URL}/almalinux-release-latest-${os_version}.${arch}.rpm}"
494494
}
@@ -500,7 +500,7 @@ get_release_file_url() {
500500
#
501501
# Prints almalinux-release RPM package download URL.
502502
get_repos_file_url() {
503-
local -r os_version="${1:0:1}"
503+
local -r os_version="${1%%.*}"
504504
local -r arch="${2}"
505505
echo "${ALMA_REPOS_URL:-${REPO_URL}/almalinux-repos-latest-${os_version}.${arch}.rpm}"
506506
}
@@ -512,7 +512,7 @@ get_repos_file_url() {
512512
#
513513
# Prints almalinux-gpg-keys RPM package download URL.
514514
get_gpg_keys_file_url() {
515-
local -r os_version="${1:0:1}"
515+
local -r os_version="${1%%.*}"
516516
local -r arch="${2}"
517517
echo "${ALMA_REPOS_URL:-${REPO_URL}/almalinux-gpg-keys-latest-${os_version}.${arch}.rpm}"
518518
}
@@ -526,7 +526,7 @@ install_rpm_pubkey() {
526526
return 0
527527
fi
528528
local -r tmp_dir="${1}"
529-
local -r os_version="${2:0:1}"
529+
local -r os_version="${2%%.*}"
530530
local -r pubkey_url="${ALMA_PUBKEY_URL:-${REPO_URL}/RPM-GPG-KEY-AlmaLinux-${os_version}}"
531531
local -r pubkey_path="${tmp_dir}/RPM-GPG-KEY-AlmaLinux"
532532
local -r step='Download RPM-GPG-KEY-AlmaLinux'
@@ -676,13 +676,13 @@ assert_compatible_os_version() {
676676
alma_version=$(rpm -qp --queryformat '%{version}' "${release_path}")
677677

678678
if [[ "$(get_os_release_var 'NAME')" != 'CentOS Stream' ]]; then
679-
if [[ "${os_version:0:1}" -lt "${MINIMAL_SUPPORTED_VERSION:0:1}" ]] && [[ "${os_version:2:3}" -lt "${MINIMAL_SUPPORTED_VERSION:2:3}" ]]; then
679+
if [[ "${os_version%%.*}" -lt "${MINIMAL_SUPPORTED_VERSION%%.*}" ]] && [[ "${os_version#*.}" -lt "${MINIMAL_SUPPORTED_VERSION#*.}" ]]; then
680680
report_step_error "Please upgrade your OS from ${os_version} to" \
681681
"at least ${MINIMAL_SUPPORTED_VERSION} and try again"
682682
exit 1
683683
fi
684684
fi
685-
if [[ "${os_version:0:1}" -lt "${alma_version:0:1}" ]] && [[ "${os_version:2:3}" -gt "${alma_version:2:3}" ]]; then
685+
if [[ "${os_version%%.*}" -lt "${alma_version%%.*}" ]] && [[ "${os_version#*.}" -gt "${alma_version#*.}" ]]; then
686686
report_step_error "Version of your OS ${os_version} is not supported yet"
687687
exit 1
688688
fi
@@ -854,7 +854,7 @@ migrate_from_centos() {
854854
fi
855855
local -r release_path="${1}"
856856
case "${os_version}" in
857-
9*)
857+
9*|10*)
858858
local -r repos_path="${2}"
859859
local -r gpg_keys_path="${3}"
860860
;;
@@ -865,7 +865,7 @@ migrate_from_centos() {
865865
remove_not_needed_redhat_dirs
866866
install_almalinux_release_package "${release_path}"
867867
case "${os_version}" in
868-
9*)
868+
9*|10*)
869869
install_almalinux_repos_package "${repos_path}"
870870
install_almalinux_gpg_keys_package "${gpg_keys_path}"
871871
;;
@@ -901,7 +901,7 @@ distro_sync() {
901901
8*)
902902
local dnf_repos="--enablerepo=powertools"
903903
;;
904-
9*)
904+
9*|10*)
905905
local dnf_repos="--enablerepo=crb"
906906
;;
907907
esac
@@ -1310,7 +1310,7 @@ main() {
13101310
os_type="$(get_os_release_var 'ID')"
13111311
os_version="$(get_os_version "${os_type}")"
13121312
#os_version="$(get_os_release_var 'VERSION_ID')"
1313-
#os_version="${os_version:0:1}"
1313+
#os_version="${os_version%%.*}"
13141314
assert_supported_system "${os_type}" "${os_version}" "${arch}"
13151315
assert_supported_filesystem
13161316
assert_dnf_plugins_core
@@ -1354,13 +1354,17 @@ main() {
13541354
8*)
13551355
migrate_from_centos "${release_path}"
13561356
;;
1357-
9*)
1357+
9*|10*)
13581358
repos_url=$(get_repos_file_url "${os_version}" "${arch}")
13591359
repos_path=$(download_repos_files "${tmp_dir}" "${repos_url}")
13601360
gpg_keys_url=$(get_gpg_keys_file_url "${os_version}" "${arch}")
13611361
gpg_keys_path=$(download_gpg_keys_files "${tmp_dir}" "${gpg_keys_url}")
13621362
migrate_from_centos "${release_path}" "${repos_path}" "${gpg_keys_path}"
13631363
;;
1364+
*)
1365+
report_step_error "Migrate ${os_version}: not supported"
1366+
exit 1
1367+
;;
13641368
esac
13651369
;;
13661370
*)

0 commit comments

Comments
 (0)