New version, new tarball. Two great bug report, issues.

1. Tightened runit init detection to use proc, note that if runit works on BSDs inxi will
   require more data to properly detect it on BSDs..
   2. Use openrc runlevel tests natively if openrc detected.
   3. Fixed subtle issue with alias to inxi file and paths.
   4. Added rc-status data collection for debugger, improved debugger data collector handling
      of bsd and other tests to note absent if not there in file names.
This commit is contained in:
inxi-svn 2015-01-24 18:51:56 +00:00
parent 2ebaa2b1c6
commit 3715909bd5
2 changed files with 105 additions and 31 deletions

117
inxi
View file

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### Version: 2.2.17 #### Version: 2.2.18
#### Date: 2015-01-14 #### Date: 2015-01-24
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -965,22 +965,22 @@ parse_version_data()
# note, using ####[[:space:]]+ to avoid having this function also trip the version datas # note, using ####[[:space:]]+ to avoid having this function also trip the version datas
case $1 in case $1 in
date) date)
version_data="$( gawk -F ': ' ' version_data=$( gawk -F ': ' '
/####[[:space:]]+Date:/ { /####[[:space:]]+Date:/ {
print $NF print $NF
}' $SCRIPT_PATH/$SCRIPT_NAME )" }' "$SCRIPT_PATH/$SCRIPT_NAME" )
;; ;;
main) main)
version_data="$( gawk ' version_data=$( gawk '
/####[[:space:]]+Version:/ { /####[[:space:]]+Version:/ {
print $3 print $3
}' $SCRIPT_PATH/$SCRIPT_NAME )" }' "$SCRIPT_PATH/$SCRIPT_NAME" )
;; ;;
patch) patch)
version_data="$( gawk ' version_data=$( gawk '
/####[[:space:]]+Patch Number:/ { /####[[:space:]]+Patch Number:/ {
print $4 print $4
}' $SCRIPT_PATH/$SCRIPT_NAME )" }' "$SCRIPT_PATH/$SCRIPT_NAME" )
;; ;;
esac esac
echo $version_data echo $version_data
@ -993,7 +993,7 @@ initialize_paths()
local extra_paths="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/local/bin" local extra_paths="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/local/bin"
# this needs to be set here because various options call the parent initialize function directly. # this needs to be set here because various options call the parent initialize function directly.
SCRIPT_PATH=$( dirname $0 ) SCRIPT_PATH=$( dirname "$0" )
# Fallback paths put into $extra_paths; This might, among others, help on gentoo. # Fallback paths put into $extra_paths; This might, among others, help on gentoo.
# Now, create a difference of $PATH and $extra_paths and add that to $PATH: # Now, create a difference of $PATH and $extra_paths and add that to $PATH:
@ -1677,18 +1677,42 @@ debug_data_collector()
echo "Data going into: $SCRIPT_DATA_DIR/$debug_data_dir" echo "Data going into: $SCRIPT_DATA_DIR/$debug_data_dir"
# bsd tools http://cb.vu/unixtoolbox.xhtml # bsd tools http://cb.vu/unixtoolbox.xhtml
# freebsd # freebsd
pciconf -l -cv &> $debug_data_dir/bsd-pciconf-cvl.txt if type -p pciconf &>/dev/null;then
pciconf -vl &> $debug_data_dir/bsd-pciconf-vl.txt pciconf -l -cv &> $debug_data_dir/bsd-pciconf-cvl.txt
pciconf -l &> $debug_data_dir/bsd-pciconf-l.txt pciconf -vl &> $debug_data_dir/bsd-pciconf-vl.txt
pciconf -l &> $debug_data_dir/bsd-pciconf-l.txt
else
touch $debug_data_dir/bsd-pciconf-absent
fi
# openbsd # openbsd
pcidump &> $debug_data_dir/bsd-pcidump.txt if type -p pcidump &>/dev/null;then
pcidump -v &> $debug_data_dir/bsd-pcidump-v.txt pcidump &> $debug_data_dir/bsd-pcidump-openbsd.txt
pcidump -v &> $debug_data_dir/bsd-pcidump-v-openbsd.txt
else
touch $debug_data_dir/bsd-pcidump-openbsd-absent
fi
# netbsd # netbsd
pcictl list &> $debug_data_dir/bsd-pcictl-list.txt if type -p pcictl &>/dev/null;then
pcictl list -n &> $debug_data_dir/bsd-pcictl-list-n.txt pcictl list &> $debug_data_dir/bsd-pcictl-list-netbsd.txt
sysctl -a &> $debug_data_dir/bsd-sysctl-a.txt pcictl list -n &> $debug_data_dir/bsd-pcictl-list-n-netbsd.txt
usbdevs -v &> $debug_data_dir/bsd-usbdevs-v.txt else
kldstat &> $debug_data_dir/bsd-kldstat.txt touch $debug_data_dir/bsd-pcictl-netbsd-absent
fi
if type -p sysctl &>/dev/null;then
sysctl -a &> $debug_data_dir/bsd-sysctl-a.txt
else
touch $debug_data_dir/bsd-sysctl-absent
fi
if type -p usbdevs &>/dev/null;then
usbdevs -v &> $debug_data_dir/bsd-usbdevs-v.txt
else
touch $debug_data_dir/bsd-usbdevs-absent
fi
if type -p kldstat &>/dev/null;then
kldstat &> $debug_data_dir/bsd-kldstat.txt
else
touch $debug_data_dir/bsd-kldstat-absent
fi
# diskinfo -v <disk> # diskinfo -v <disk>
# fdisk <disk> # fdisk <disk>
dmidecode &> $debug_data_dir/dmidecode.txt dmidecode &> $debug_data_dir/dmidecode.txt
@ -1722,9 +1746,24 @@ debug_data_collector()
ps -p 1 &> $debug_data_dir/ps-p-1.txt ps -p 1 &> $debug_data_dir/ps-p-1.txt
cat /proc/1/comm &> $debug_data_dir/proc-1-comm.txt cat /proc/1/comm &> $debug_data_dir/proc-1-comm.txt
runlevel &> $debug_data_dir/runlevel.txt runlevel &> $debug_data_dir/runlevel.txt
systemctl list-units &> $debug_data_dir/systemctl-list-units.txt if type -p rc-status &>/dev/null;then
systemctl list-units --type=target &> $debug_data_dir/systemctl-list-units-target.txt rc-status -a &> $debug_data_dir/rc-status-a.txt
initctl list &> $debug_data_dir/initctl-list.txt rc-status -l &> $debug_data_dir/rc-status-l.txt
rc-status -r &> $debug_data_dir/rc-status-r.txt
else
touch $debug_data_dir/rc-status-absent
fi
if type -p systemctl &>/dev/null;then
systemctl list-units &> $debug_data_dir/systemctl-list-units.txt
systemctl list-units --type=target &> $debug_data_dir/systemctl-list-units-target.txt
else
touch $debug_data_dir/systemctl-absent
fi
if type -p initctl &>/dev/null;then
initctl list &> $debug_data_dir/initctl-list.txt
else
touch $debug_data_dir/initctl-absent
fi
sensors &> $debug_data_dir/sensors.txt sensors &> $debug_data_dir/sensors.txt
if type -p strings &>/dev/null;then if type -p strings &>/dev/null;then
touch $debug_data_dir/strings-present touch $debug_data_dir/strings-present
@ -1743,8 +1782,16 @@ debug_data_collector()
fi fi
head -n 1 /proc/asound/card*/codec* &> $debug_data_dir/proc-asound-card-codec.txt head -n 1 /proc/asound/card*/codec* &> $debug_data_dir/proc-asound-card-codec.txt
ls /usr/bin/gcc* &> $debug_data_dir/gcc-sys-versions.txt ls /usr/bin/gcc* &> $debug_data_dir/gcc-sys-versions.txt
gcc --version &> $debug_data_dir/gcc-version.txt if type -p gcc &>/dev/null;then
clang --version &> $debug_data_dir/clang-version.txt gcc --version &> $debug_data_dir/gcc-version.txt
else
touch $debug_data_dir/gcc-absent
fi
if type -p clang &>/dev/null;then
clang --version &> $debug_data_dir/clang-version.txt
else
touch $debug_data_dir/clang-absent
fi
cat /etc/src.conf &> $debug_data_dir/bsd-etc-src-conf.txt cat /etc/src.conf &> $debug_data_dir/bsd-etc-src-conf.txt
cat /etc/make.conf &> $debug_data_dir/bsd-etc-make-conf.txt cat /etc/make.conf &> $debug_data_dir/bsd-etc-make-conf.txt
cat /etc/issue &> $debug_data_dir/etc-issue.txt cat /etc/issue &> $debug_data_dir/etc-issue.txt
@ -6384,6 +6431,14 @@ get_init_data()
init_type='Epoch' init_type='Epoch'
# epoch version == Epoch Init System 1.0.1 "Sage" # epoch version == Epoch Init System 1.0.1 "Sage"
init_version=$( get_program_version 'epoch' '^Epoch' '4' ) init_version=$( get_program_version 'epoch' '^Epoch' '4' )
# missing data: note, runit can install as a dependency without being the init system
# http://smarden.org/runit/sv.8.html
# NOTE: the proc test won't work on bsds, so if runit is used on bsds we will need more data
elif [[ -e /proc/1/comm && -n $( grep -s 'runit' /proc/1/comm ) ]];then
# elif [[ -e /sbin/runit-init || -e /etc/runit || -n $( type -p sv ) ]];then
init_type='runit' # lower case
# no data on version yet
# freebsd at least
elif type -p launchctl &>/dev/null;then elif type -p launchctl &>/dev/null;then
init_type='launchd' init_type='launchd'
# / launchd/ version.plist /etc/launchd.conf # / launchd/ version.plist /etc/launchd.conf
@ -6396,16 +6451,9 @@ get_init_data()
if [[ -n $strings_init_version ]];then if [[ -n $strings_init_version ]];then
init_version=$( gawk '{print $2}' <<< "$strings_init_version" ) init_version=$( gawk '{print $2}' <<< "$strings_init_version" )
fi fi
# missing data: note, runit can install as a dependency without being the init system
# http://smarden.org/runit/sv.8.html
elif [[ -e /sbin/runit-init || -e /etc/runit || -n $( type -p sv ) ]];then
init_type='runit' # lower case
# no data on version yet
# freebsd at least
elif [[ -f /etc/ttys ]];then elif [[ -f /etc/ttys ]];then
init_type='init (bsd)' init_type='init (bsd)'
fi fi
if [[ -n $( grep 'openrc' <<< "$ls_run" ) ]];then if [[ -n $( grep 'openrc' <<< "$ls_run" ) ]];then
rc_type='OpenRC' rc_type='OpenRC'
# /sbin/openrc --version == openrc (OpenRC) 0.13 # /sbin/openrc --version == openrc (OpenRC) 0.13
@ -6415,6 +6463,13 @@ get_init_data()
elif type -p rc &>/dev/null;then elif type -p rc &>/dev/null;then
rc_version=$( get_program_version 'rc' '^rc' '3' ) rc_version=$( get_program_version 'rc' '^rc' '3' )
fi fi
if [[ -e /run/openrc/softlevel ]];then
runlevel=$( cat /run/openrc/softlevel 2>/dev/null )
elif [[ -e /var/run/openrc/softlevel ]];then
runlevel=$( cat /var/run/openrc/softlevel 2>/dev/null )
elif type -p rc-status &>/dev/null;then
runlevel=$( rc-status -r 2>/dev/null )
fi
## assume sysvrc, but this data is too buggy and weird and inconsistent to have meaning ## assume sysvrc, but this data is too buggy and weird and inconsistent to have meaning
# leaving this off for now # leaving this off for now
# elif [[ -f /etc/inittab ]];then # elif [[ -f /etc/inittab ]];then

View file

@ -1,3 +1,22 @@
=====================================================================================
Version: 2.2.18
Patch Version: 00
Script Date: 2015-01-24
-----------------------------------
Changes:
-----------------------------------
New version, new tarball. Two great bug report, issues.
1. Tightened runit init detection to use proc, note that if runit works on BSDs inxi will
require more data to properly detect it on BSDs..
2. Use openrc runlevel tests natively if openrc detected.
3. Fixed subtle issue with alias to inxi file and paths.
4. Added rc-status data collection for debugger, improved debugger data collector handling
of bsd and other tests to note absent if not there in file names.
-----------------------------------
-- Harald Hope - Sat, 24 Jan 2015 10:25:43 -0800
===================================================================================== =====================================================================================
Version: 2.2.17 Version: 2.2.17
Patch Version: 00 Patch Version: 00