feat(bootstrap-salt): add Rocky Linux detection and functions

Fix #1803.
This commit is contained in:
Imran Iqbal 2022-02-26 09:14:00 +00:00
parent 13a60f400b
commit 2f0fe6bcd5
No known key found for this signature in database
GPG key ID: 6D8629439D2B7819

View file

@ -945,7 +945,7 @@ __strip_duplicates() {
__sort_release_files() {
KNOWN_RELEASE_FILES=$(echo "(arch|alpine|centos|debian|ubuntu|fedora|redhat|suse|\
mandrake|mandriva|gentoo|slackware|turbolinux|unitedlinux|void|lsb|system|\
oracle|os|almalinux)(-|_)(release|version)" | sed -E 's:[[:space:]]::g')
oracle|os|almalinux|rocky)(-|_)(release|version)" | sed -E 's:[[:space:]]::g')
primary_release_files=""
secondary_release_files=""
# Sort know VS un-known files first
@ -959,7 +959,7 @@ __sort_release_files() {
done
# Now let's sort by know files importance, max important goes last in the max_prio list
max_prio="redhat-release centos-release oracle-release fedora-release almalinux-release"
max_prio="redhat-release centos-release oracle-release fedora-release almalinux-release rocky-release"
for entry in $max_prio; do
if [ "$(echo "${primary_release_files}" | grep "$entry")" != "" ]; then
primary_release_files=$(echo "${primary_release_files}" | sed -e "s:\\(.*\\)\\($entry\\)\\(.*\\):\\2 \\1 \\3:g")
@ -1028,6 +1028,8 @@ __gather_linux_system_info() {
elif [ "${DISTRO_NAME}" = "Arch" ]; then
DISTRO_NAME="Arch Linux"
return
elif [ "${DISTRO_NAME}" = "Rocky" ]; then
DISTRO_NAME="Rocky Linux"
fi
rv=$(lsb_release -sr)
[ "${rv}" != "" ] && DISTRO_VERSION=$(__parse_version_string "$rv")
@ -1087,6 +1089,7 @@ __gather_linux_system_info() {
void ) n="VoidLinux" ;;
oracle ) n="Oracle Linux" ;;
almalinux ) n="AlmaLinux" ;;
rocky ) n="Rocky Linux" ;;
system )
while read -r line; do
[ "${n}x" != "systemx" ] && break
@ -1816,14 +1819,14 @@ elif [ "${DISTRO_NAME_L}" = "debian" ]; then
__debian_codename_translation
fi
if [ "$(echo "${DISTRO_NAME_L}" | grep -E '(debian|ubuntu|centos|gentoo|red_hat|oracle|scientific|amazon|fedora|macosx|almalinux)')" = "" ] && [ "$ITYPE" = "stable" ] && [ "$STABLE_REV" != "latest" ]; then
if [ "$(echo "${DISTRO_NAME_L}" | grep -E '(debian|ubuntu|centos|gentoo|red_hat|oracle|scientific|amazon|fedora|macosx|almalinux|rocky)')" = "" ] && [ "$ITYPE" = "stable" ] && [ "$STABLE_REV" != "latest" ]; then
echoerror "${DISTRO_NAME} does not have major version pegged packages support"
exit 1
fi
# Only RedHat based distros have testing support
if [ "${ITYPE}" = "testing" ]; then
if [ "$(echo "${DISTRO_NAME_L}" | grep -E '(centos|red_hat|amazon|oracle|almalinux)')" = "" ]; then
if [ "$(echo "${DISTRO_NAME_L}" | grep -E '(centos|red_hat|amazon|oracle|almalinux|rocky)')" = "" ]; then
echoerror "${DISTRO_NAME} does not have testing packages support"
exit 1
fi
@ -4912,6 +4915,69 @@ install_almalinux_check_services() {
#
#######################################################################################################################
#######################################################################################################################
#
# Rocky Linux Install Functions
#
install_rocky_linux_stable_deps() {
install_centos_stable_deps || return 1
return 0
}
install_rocky_linux_git_deps() {
install_centos_git_deps || return 1
return 0
}
install_rocky_linux_testing_deps() {
install_centos_testing_deps || return 1
return 0
}
install_rocky_linux_stable() {
install_centos_stable || return 1
return 0
}
install_rocky_linux_git() {
install_centos_git || return 1
return 0
}
install_rocky_linux_testing() {
install_centos_testing || return 1
return 0
}
install_rocky_linux_stable_post() {
install_centos_stable_post || return 1
return 0
}
install_rocky_linux_git_post() {
install_centos_git_post || return 1
return 0
}
install_rocky_linux_testing_post() {
install_centos_testing_post || return 1
return 0
}
install_rocky_linux_restart_daemons() {
install_centos_restart_daemons || return 1
return 0
}
install_rocky_linux_check_services() {
install_centos_check_services || return 1
return 0
}
#
# Ended Rocky Linux Install Functions
#
#######################################################################################################################
#######################################################################################################################
#
# Scientific Linux Install Functions