Skip to content

Commit

Permalink
Added debian11 as possible WN OS
Browse files Browse the repository at this point in the history
  • Loading branch information
mambelli committed Jul 11, 2023
1 parent 0941bf9 commit 401e819
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions creation/web_base/condor_platform_select.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ findversion_debian() {
dist_id_line=$(grep "DISTRIB_ID" /etc/lsb-release)
dist_rel_line=$(grep "DISTRIB_RELEASE" /etc/lsb-release)
if [[ ${dist_id_line} == *"Debian"* ]]; then
[[ ${dist_rel_line:16:3} = "11." ]] && condor_os='linux-debian10' && return
[[ ${dist_rel_line:16:3} = "12." ]] && condor_os='linux-debian11' && return
[[ ${dist_rel_line:16:3} = "11." ]] && condor_os='linux-debian11' && return
[[ ${dist_rel_line:16:3} = "10." ]] && condor_os='linux-debian10' && return
[[ ${dist_rel_line:16:2} = "9." ]] && condor_os='linux-debian9' && return
[[ ${dist_rel_line:16:2} = "8." ]] && condor_os='linux-debian8' && return
[[ ${dist_rel_line:16:2} = "7." ]] && condor_os='linux-debian7' && return
elif [[ ${dist_id_line} == *"Ubuntu"* ]]; then
[[ ${dist_rel_line:16:3} = "22." ]] && condor_os='linux-ubuntu20' && return
[[ ${dist_rel_line:16:3} = "22." ]] && condor_os='linux-ubuntu22' && return
[[ ${dist_rel_line:16:3} = "20." ]] && condor_os='linux-ubuntu20' && return
[[ ${dist_rel_line:16:3} = "18." ]] && condor_os='linux-ubuntu18' && return
[[ ${dist_rel_line:16:3} = "16." ]] && condor_os='linux-ubuntu16' && return
Expand All @@ -87,6 +88,41 @@ findversion_debian() {
fi
}

findversion_os_release() {
local os_f=
local os_release dist_id dist_id_like ver major_ver
if [ -f "/etc/os-release" ]; then
os_f="/etc/os-release"
elif [ -f "/usr/lib/os-release" ]; then
os_f="/usr/lib/os-release"
else
echo "No os-release files"
return
fi
os_release=$(cat "$os_f")
dist_id=$(echo "$os_release" | awk -F '=' '/^ID=/ {print $2}')
dist_id_like=$(echo "$os_release" | awk -F '=' '/^ID_LIKE=/ {print $2}')
ver=$(echo "$os_release" | awk -F '=' '/^VERSION_ID=/ {print $2}' | tr -d '"')
major_ver="${ver%%.*}"
# write the release info
if [[ $dist_id_like =~ (rhel|centos|fedora) ]]; then
condor_os="linux-rhel${major_ver},rhel${major_ver}"
else
case "$dist_id" in
debian)
condor_os="linux-debian${major_ver}";;
ubuntu)
condor_os="linux-ubuntu${major_ver}";;
*)
echo "Unknown dist id"
esac
fi
}

# The current (since 2012) recommendation for release checking is /etc/os-release
# It should replace /etc/redhat-release and /etc/fedora-release and lsb
# https://www.freedesktop.org/software/systemd/man/os-release.html
# https://0pointer.de/blog/projects/os-release
if [[ "$condor_os" == "auto" ]]; then
if [ -f "/etc/redhat-release" ]; then
# rhel, now determine the version
Expand All @@ -101,10 +137,10 @@ if [[ "$condor_os" == "auto" ]]; then
# # I am not aware of anything newer right now
# condor_os='linux-rhel5'
#fi
elif [ -f "/etc/lsb-release" ]; then
elif [[ -f "/etc/lsb-release" ]]; then
# debian/ubuntu, now determine the version
# default debian
condor_os='linux-debian10'
condor_os='linux-debian11'
findversion_debian
# elif [ -f "/etc/debian_version" ]; then
# # debian, now determine the version
Expand All @@ -116,7 +152,8 @@ if [[ "$condor_os" == "auto" ]]; then
# # I am not aware of anything newer right now
# condor_os='linux-debian50'
# fi

elif [[ -f "/etc/os-release" || -f "/usr/lib/os-release" ]]; then
findversion_os_release
else
#echo "Not a RHEL not Debian compatible system. Autodetect not supported" 1>&2
STR="Not a RHEL not Debian compatible system. Autodetect not supported"
Expand Down

0 comments on commit 401e819

Please sign in to comment.