diff --git a/dist/tools/ci/print_toolchain_versions.sh b/dist/tools/ci/print_toolchain_versions.sh index 7c99b31d9e..69edf494d0 100755 --- a/dist/tools/ci/print_toolchain_versions.sh +++ b/dist/tools/ci/print_toolchain_versions.sh @@ -34,6 +34,24 @@ get_define() { printf "%s" "$line" } +get_kernel_info() { + uname -mprs +} + +get_os_info() { + local os="$(uname -s)" + local osname="unknown" + local osvers="unknown" + if [ "$os" = "Linux" ]; then + osname="$(cat /etc/os-release | grep ^NAME= | awk -F'=' '{print $2}')" + osvers="$(cat /etc/os-release | grep ^VERSION= | awk -F'=' '{print $2}')" + elif [ "$os" = "Darwin" ]; then + osname="$(sw_vers -productName)" + osvers="$(sw_vers -productVersion)" + fi + printf "%s %s" "$osname" "$osvers" +} + newlib_version() { if [ -z "$1" ]; then printf "%s" "error" @@ -52,6 +70,14 @@ avr_libc_version() { fi } +printf "\n" +# print operating system information +printf "%s\n" "Operating System Environment" +printf "%s\n" "-----------------------------" +printf "%23s: %s\n" "Operating System" "$(get_os_info)" +printf "%23s: %s\n" "Kernel" "$(get_kernel_info)" +printf "\n" + printf "%s\n" "Installed compiler toolchains" printf "%s\n" "-----------------------------" printf "%23s: %s\n" "native gcc" "$(get_cmd_version gcc)"