From 2b4ae02f10bf56ffcd30b18ce6a6ff5a2db4a8f0 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 1 May 2014 22:46:37 +0000 Subject: [PATCH] bsd fixes --- inxi | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/inxi b/inxi index aba9790..ab0aada 100755 --- a/inxi +++ b/inxi @@ -1612,10 +1612,15 @@ debug_data_collector() echo 'Collecting system info: sensors, lsusb, lspci, lspci -v data, plus /proc data' echo 'also checking for dmidecode data: note, you must be root to have dmidecode work.' echo "Data going into: $SCRIPT_DATA_DIR/$debug_data_dir" - # bsd tools + # bsd tools http://cb.vu/unixtoolbox.xhtml + pciconf -l -cv &> $debug_data_dir/bsd-pciconf-cvl.txt pciconf -vl &> $debug_data_dir/bsd-pciconf-vl.txt + pciconf -l &> $debug_data_dir/bsd-pciconf-l.txt sysctl -a &> $debug_data_dir/bsd-sysctl-a.txt - + usbdevs -v &> $debug_data_dir/bsd-usbdevs-v.txt + kldstat &> $debug_data_dir/bsd-kldstat.txt + # diskinfo -v + # fdisk dmidecode &> $debug_data_dir/dmidecode.txt lscpu &> $debug_data_dir/lscpu.txt @@ -5953,11 +5958,29 @@ get_kernel_compiler_version() if [[ -n $compiler_version ]];then compiler_type='gcc' fi - elif [[ $BSD_TYPE == 'darwin-bsd' ]];then - if type -p gcc &>/dev/null;then - compiler_version=$( get_program_version 'gcc' 'Apple[[:space:]]LLVM' '4' ) - if [[ -n $compiler_version ]];then - compiler_type='LLVM' + else + if [[ $BSD_TYPE == 'darwin-bsd' ]];then + if type -p gcc &>/dev/null;then + compiler_version=$( get_program_version 'gcc' 'Apple[[:space:]]LLVM' '4' ) + if [[ -n $compiler_version ]];then + compiler_type='LLVM' + fi + fi + else + if [[ -f /etc/src.conf ]];then + compiler_type=$( grep '^CC' /etc/src.conf | cut -d '=' -f 2 ) + elif [[ -f /etc/make.conf ]];then + compiler_type=$( grep '^CC' /etc/make.conf | cut -d '=' -f 2 ) + fi + if [[ -n $compiler_type ]];then + if type -p $compiler_type &>/dev/null;then + if [[ $compiler_type == 'gcc' ]];then + compiler_version=$( get_program_version 'gcc' '^gcc' '3' ) + elif [[ $compiler_type == 'clang' ]];then + # FreeBSD clang version 3.0 (tags/RELEASE_30/final 145349) 20111210 + compiler_version=$( get_program_version 'clang' 'clang' '4' ) + fi + fi fi fi fi