1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

dist/tools: print OS and Kernel version

Add output to print_toolchain_version script to include info
on the operating system and its kernel version.
This commit is contained in:
smlng 2018-09-19 15:41:01 +02:00
parent 87505f0334
commit 6d24033bd6

View File

@ -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)"