diff --git a/sbin/common/config_init.sh b/sbin/common/config_init.sh index b3f96d49c7..3f2e30bebf 100755 --- a/sbin/common/config_init.sh +++ b/sbin/common/config_init.sh @@ -79,6 +79,7 @@ OPENJDK_FOREST_NAME OPENJDK_SOURCE_DIR OPENJDK_UPDATE_VERSION OS_KERNEL_NAME +OS_FULL_VERSION OS_ARCHITECTURE PATCHES RELEASE @@ -366,6 +367,35 @@ function configDefaults() { # The OS kernel name, e.g. 'darwin' for Mac OS X BUILD_CONFIG[OS_KERNEL_NAME]=$(uname | awk '{print tolower($0)}') + # Determine OS full system version + local unameSys=$(uname -s) + local unameOSSysVer=$(uname -sr) + if [ "${unameSys}" == "Linux" ]; then + # Linux distribs add more useful distrib /etc/*-release file content + set +e + cat /etc/*-release > /dev/null + local cmdRc="$?" + if [ "${cmdRc}" == "0" ]; then + local linuxName="" + cat /etc/*-release | grep PRETTY_NAME > /dev/null + cmdRc="$?" + if [ "${cmdRc}" == "0" ]; then + linuxName=$(cat /etc/*-release | grep PRETTY_NAME | cut -d'=' -f2 | tr -d '"') + else + linuxName=$(cat /etc/*-release | tr -d '"') + fi + unameOSSysVer="${unameOSSysVer} : ${linuxName}" + fi + set -e + elif [ "${unameSys}" == "AIX" ]; then + # AIX provides full version info using oslevel + aixVer=$(oslevel) + unameOSSysVer="${unameSys} ${aixVer}" + fi + + # Store the OS full version name, eg.Darwin 20.4.0 + BUILD_CONFIG[OS_FULL_VERSION]="${unameOSSysVer}" + local arch=$(uname -m) if [ "${BUILD_CONFIG[OS_KERNEL_NAME]}" == "aix" ]; then