New version, new tarball, new man page.

Basic support added for Budgie desktop detection. This is waiting more data, so the support will be
missing the version information. Go Budgie!!

Added /var/tmp and /var/log and /opt to basic partition data: -P
This will probably not impact more than a handful of people in the world, but that's fine.

Modified the static BIOS in -M to now show UEFI for actually UEFI booted systems, and, ideally,
UEFI [Legacy] for UEFI booting in bios legacy mode, and BIOS for all others. Hopefully this will
work ok, we'll see.
This commit is contained in:
Harald Hope 2016-08-25 19:18:30 -07:00
parent afc0d4b0cf
commit 6a30d858b9
4 changed files with 91 additions and 28 deletions

View file

@ -103,7 +103,7 @@ mission of inxi: to always work on all systems all the time. Well, all
linux systems with the core tools inxi requires to operate installed. Ie, linux systems with the core tools inxi requires to operate installed. Ie,
not android, yet. What this means is this: you can have a 10 year old box, not android, yet. What this means is this: you can have a 10 year old box,
or probably 15, not sure, and you can install today's inxi on it, and it or probably 15, not sure, and you can install today's inxi on it, and it
will run. It won't run fast, but it will run. I test inxi on a 200mghz will run. It won't run fast, but it will run. I test inxi on a 200 MHz
laptop from about 1998 to keep it honest. That's also what was used to laptop from about 1998 to keep it honest. That's also what was used to
optimize the code. optimize the code.

87
inxi
View file

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### Version: 2.3.0 #### Version: 2.3.1
#### Date: 2016-04-18 #### Date: 2016-08-25
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -2050,6 +2050,10 @@ debug_data_collector()
touch $debug_data_dir/kde-about-distro-absent touch $debug_data_dir/kde-about-distro-absent
fi fi
echo $XDG_CURRENT_DESKTOP &> $debug_data_dir/xdg-current-desktop.txt echo $XDG_CURRENT_DESKTOP &> $debug_data_dir/xdg-current-desktop.txt
echo $XDG_SESSION_DESKTOP &> $debug_data_dir/xdg-session-desktop.txt
echo $DESKTOP_SESSION &> $debug_data_dir/desktop-session.txt
echo $GDMSESSION &> $debug_data_dir/gdmsession.txt
fi fi
if [[ $1 == 'disk' || $1 == 'all' ]];then if [[ $1 == 'disk' || $1 == 'all' ]];then
echo 'Collecting dev, label, disk, uuid data, df...' echo 'Collecting dev, label, disk, uuid data, df...'
@ -3000,12 +3004,12 @@ show_options()
print_lines_basic "1" "-I" "Information: processes, uptime, memory, irc client (or shell type), $SCRIPT_NAME version." print_lines_basic "1" "-I" "Information: processes, uptime, memory, irc client (or shell type), $SCRIPT_NAME version."
print_lines_basic "1" "-l" "$partition_string_u labels. Default: short $partition_string -P. For full -p output, use: -pl (or -plu)." print_lines_basic "1" "-l" "$partition_string_u labels. Default: short $partition_string -P. For full -p output, use: -pl (or -plu)."
print_lines_basic "1" "-m" "Memory (RAM) data. Physical system memory array(s), capacity, how many devices (slots) supported, and individual memory devices (sticks of memory etc). For devices, shows device locator, size, speed, type (like: DDR3). Also see -x, -xx, -xxx" print_lines_basic "1" "-m" "Memory (RAM) data. Physical system memory array(s), capacity, how many devices (slots) supported, and individual memory devices (sticks of memory etc). For devices, shows device locator, size, speed, type (like: DDR3). Also see -x, -xx, -xxx"
print_lines_basic "1" "-M" "Machine data. Motherboard, Bios, and if present, System Builder (Like Lenovo). Older systems/kernels without the required /sys data can use dmidecode instead, run as root. Dmidecode can be forced with -! 33" print_lines_basic "1" "-M" "Machine data. Motherboard, Bios, and if present, System Builder (Like Lenovo). Shows UEFI/BIOS/UEFI [Legacy}. Older systems/kernels without the required /sys data can use dmidecode instead, run as root. Dmidecode can be forced with -! 33"
print_lines_basic "1" "-n" "Advanced Network card information. Same as -Nn. Shows interface, speed, mac id, state, etc." print_lines_basic "1" "-n" "Advanced Network card information. Same as -Nn. Shows interface, speed, mac id, state, etc."
print_lines_basic "1" "-N" "Network card information. With -x, shows PCI BusID, Port number." print_lines_basic "1" "-N" "Network card information. With -x, shows PCI BusID, Port number."
print_lines_basic "1" "-o" "Unmounted $partition_string information (includes UUID and LABEL if available). Shows file system type if you have file installed, if you are root OR if you have added to /etc/sudoers (sudo v. 1.7 or newer) Example:^<username>^ALL^=^NOPASSWD:^/usr/bin/file^" print_lines_basic "1" "-o" "Unmounted $partition_string information (includes UUID and LABEL if available). Shows file system type if you have file installed, if you are root OR if you have added to /etc/sudoers (sudo v. 1.7 or newer) Example:^<username>^ALL^=^NOPASSWD:^/usr/bin/file^"
print_lines_basic "1" "-p" "Full $partition_string information (-P plus all other detected ${partition_string}s)." print_lines_basic "1" "-p" "Full $partition_string information (-P plus all other detected ${partition_string}s)."
print_lines_basic "1" "-P" "Basic $partition_string information (shows what -v^4 would show, but without extra data). Shows, if detected: / /boot /home /tmp /usr /var. Use -p to see all mounted ${partition_string}s." print_lines_basic "1" "-P" "Basic $partition_string information (shows what -v^4 would show, but without extra data). Shows, if detected: / /boot /home /opt /tmp /usr /var /var/log /var/tmp . Use -p to see all mounted ${partition_string}s."
print_lines_basic "1" "-r" "Distro repository data. Supported repo types: APT; PACMAN; PISI; PORTAGE; PORTS (BSDs); SLACKPKG; URPMQ; YUM; ZYPP." print_lines_basic "1" "-r" "Distro repository data. Supported repo types: APT; PACMAN; PISI; PORTAGE; PORTS (BSDs); SLACKPKG; URPMQ; YUM; ZYPP."
print_lines_basic "1" "-R" "RAID data. Shows RAID devices, states, levels, and components, and extra data with -x/-xx. md-raid: If device is resyncing, shows resync progress line as well." print_lines_basic "1" "-R" "RAID data. Shows RAID devices, states, levels, and components, and extra data with -x/-xx. md-raid: If device is resyncing, shows resync progress line as well."
print_lines_basic "1" "-s" "Sensors output (if sensors installed/configured): mobo/cpu/gpu temp; detected fan speeds. Gpu temp only for Fglrx/Nvidia drivers. Nvidia shows screen number for > 1 screens." print_lines_basic "1" "-s" "Sensors output (if sensors installed/configured): mobo/cpu/gpu temp; detected fan speeds. Gpu temp only for Fglrx/Nvidia drivers. Nvidia shows screen number for > 1 screens."
@ -4909,6 +4913,19 @@ get_desktop_environment()
fi fi
fi fi
desktop_environment="Unity" desktop_environment="Unity"
elif [[ $XDG_CURRENT_DESKTOP == *Budgie* ]];then
version=$( get_program_version 'budgie-desktop' '^budgie-desktop' '2' )
# not certain will always have version, so keep output right if not
if [[ -n $version ]];then
version="$version "
fi
if [[ $B_EXTRA_DATA == 'true' ]];then
toolkit=$( get_de_gtk_data )
if [[ -n $toolkit ]];then
version="$version(Gtk $toolkit)"
fi
fi
desktop_environment="Budgie"
elif [[ $XDG_CURRENT_DESKTOP == 'LXQt' ]];then elif [[ $XDG_CURRENT_DESKTOP == 'LXQt' ]];then
# if type -p lxqt-about &>/dev/null;then # if type -p lxqt-about &>/dev/null;then
# version=$( get_program_version 'lxqt-about' '^lxqt-about' '2' ) # version=$( get_program_version 'lxqt-about' '^lxqt-about' '2' )
@ -7030,7 +7047,7 @@ get_machine_data()
{ {
eval $LOGFS eval $LOGFS
local a_temp='' separator='' id_file='' file_data='' array_string='' local a_temp='' separator='' id_file='' file_data='' array_string=''
local id_dir='/sys/class/dmi/id/' dmi_data='' local id_dir='/sys/class/dmi/id/' dmi_data='' firmware_type='BIOS'
local machine_files=" local machine_files="
sys_vendor product_name product_version product_serial product_uuid sys_vendor product_name product_version product_serial product_uuid
board_vendor board_name board_version board_serial board_vendor board_name board_version board_serial
@ -7042,6 +7059,11 @@ get_machine_data()
" "
fi fi
if [[ -d $id_dir && $B_FORCE_DMIDECODE == 'false' ]];then if [[ -d $id_dir && $B_FORCE_DMIDECODE == 'false' ]];then
if [[ -d /sys/firmware/efi ]];then
firmware_type='UEFI'
elif [[ -n $(ls /sys/firmware/acpi/tables/UEFI* 2>/dev/null ) ]];then
firmware_type='BIOS [UEFI]'
fi
for id_file in $machine_files for id_file in $machine_files
do do
file_data='' file_data=''
@ -7069,6 +7091,15 @@ get_machine_data()
array_string="$array_string$separator$file_data" array_string="$array_string$separator$file_data"
separator=',' separator=','
done done
if [[ $array_string != '' ]];then
# note: dmidecode has two more data types possible, so always add 2 more
if [[ $B_EXTRA_EXTRA_DATA == 'true' ]];then
array_string="$array_string,,"
else
array_string="$array_string,,,,,,"
fi
array_string="$array_string,$firmware_type"
fi
else else
get_dmidecode_data get_dmidecode_data
if [[ -n $DMIDECODE_DATA ]];then if [[ -n $DMIDECODE_DATA ]];then
@ -7083,15 +7114,16 @@ get_machine_data()
baseboardProductName="" baseboardProductName=""
baseboardSerialNumber="" baseboardSerialNumber=""
baseboardVersion="" baseboardVersion=""
biosReleaseDate=""
biosRevision="" # only available from dmidecode
biosRomSize="" # only available from dmidecode
biosVendor=""
biosVersion=""
chassisManufacturer="" chassisManufacturer=""
chassisSerialNumber="" chassisSerialNumber=""
chassisType="" chassisType=""
chassisVersion="" chassisVersion=""
firmwareReleaseDate=""
firmwareRevision="" # only available from dmidecode
firmwareRomSize="" # only available from dmidecode
firmwareType="BIOS"
firmwareVendor=""
firmwareVersion=""
systemManufacturer="" systemManufacturer=""
systemProductName="" systemProductName=""
systemVersion="" systemVersion=""
@ -7107,13 +7139,14 @@ get_machine_data()
} }
/^Bios Information/ { /^Bios Information/ {
while ( getline && !/^$/ ) { while ( getline && !/^$/ ) {
if ( $1 ~ /^Release Date/ ) { biosReleaseDate=$2 } if ( $1 ~ /^Release Date/ ) { firmwareReleaseDate=$2 }
if ( $1 ~ /^BIOS Revision/ ) { biosRevision=$2 } if ( $1 ~ /^BIOS Revision/ ) { firmwareRevision=$2 }
if ( $1 ~ /^ROM Size/ ) { biosRomSize=$2 } if ( $1 ~ /^ROM Size/ ) { firmwareRomSize=$2 }
if ( $1 ~ /^Vendor/ ) { biosVendor=$2 } if ( $1 ~ /^Vendor/ ) { firmwareVendor=$2 }
if ( $1 ~ /^Version/ ) { biosVersion=$2 } if ( $1 ~ /^Version/ ) { firmwareVersion=$2 }
if ( $1 ~ /^UEFI is supported/ ) { firmwareType="UEFI" }
} }
testString=biosReleaseDate biosRevision biosRomSize biosVendor biosVersion testString=firmwareReleaseDate firmwareRevision firmwareRomSize firmwareVendor firmwareVersion
if ( testString != "" ) { if ( testString != "" ) {
bItemFound="true" bItemFound="true"
} }
@ -7168,10 +7201,10 @@ get_machine_data()
if ( bItemFound == "true" ) { if ( bItemFound == "true" ) {
fullString = systemManufacturer "," systemProductName "," systemVersion "," systemSerialNumber fullString = systemManufacturer "," systemProductName "," systemVersion "," systemSerialNumber
fullString = fullString "," systemUuid "," baseboardManufacturer "," baseboardProductName fullString = fullString "," systemUuid "," baseboardManufacturer "," baseboardProductName
fullString = fullString "," baseboardVersion "," baseboardSerialNumber "," biosVendor fullString = fullString "," baseboardVersion "," baseboardSerialNumber "," firmwareVendor
fullString = fullString "," biosVersion "," biosReleaseDate "," chassisManufacturer fullString = fullString "," firmwareVersion "," firmwareReleaseDate "," chassisManufacturer
fullString = fullString "," chassisType "," chassisVersion "," chassisSerialNumber fullString = fullString "," chassisType "," chassisVersion "," chassisSerialNumber
fullString = fullString "," biosRevision "," biosRomSize fullString = fullString "," firmwareRevision "," firmwareRomSize "," firmwareType
print fullString print fullString
} }
@ -8189,7 +8222,7 @@ get_partition_data()
} }
# this handles yet another fredforfaen special case where a mounted drive # this handles yet another fredforfaen special case where a mounted drive
# has the search string in its name # has the search string in its name
$NF ~ /^\/$|^\/boot$|^\/var$|^\/home$|^\/tmp$|^\/usr$/ { $NF ~ /^\/$|^\/boot$|^\/var$|^\/var\/tmp$|^\/var\/log$|^\/home$|^\/opt$|^\/tmp$|^\/usr$/ {
# note, older df in bsd do not have file system column # note, older df in bsd do not have file system column
if ( NF == "7" && $(NF - 1) ~ /[0-9]+%/ ) { if ( NF == "7" && $(NF - 1) ~ /[0-9]+%/ ) {
fileSystem=$(NF - 5) fileSystem=$(NF - 5)
@ -8207,7 +8240,7 @@ get_partition_data()
} }
# skip all these, including the first, header line. Use the --exclude-type # skip all these, including the first, header line. Use the --exclude-type
# to handle new filesystems types we do not want listed here # to handle new filesystems types we do not want listed here
$NF !~ /^\/$|^\/boot$|^\/var$|^\/home$|^\/tmp$|^\/usr$|^filesystem/ { $NF !~ /^\/$|^\/boot$|^\/var$|^\/var\/tmp$|^\/var\/log$|^\/home$|^\/opt$|^\/tmp$|^\/usr$|^filesystem/ {
# this is to avoid file systems with spaces in their names, that will make # this is to avoid file systems with spaces in their names, that will make
# the test show the wrong data in each of the fields, if no x%, then do not use # the test show the wrong data in each of the fields, if no x%, then do not use
# using 3 cases, first default, standard, 2nd, 3rd, handles one and two spaces in name # using 3 cases, first default, standard, 2nd, 3rd, handles one and two spaces in name
@ -12773,7 +12806,7 @@ print_machine_data()
{ {
eval $LOGFS eval $LOGFS
local system_line='' mobo_line='' bios_line='' chassis_line='' local system_line='' mobo_line='' bios_line='' chassis_line='' #firmware_type='BIOS'
local mobo_vendor='' mobo_model='' mobo_version='' mobo_serial='' local mobo_vendor='' mobo_model='' mobo_version='' mobo_serial=''
local bios_vendor='' bios_version='' bios_date='' bios_rom='' error_string='' local bios_vendor='' bios_version='' bios_date='' bios_rom='' error_string=''
local system_vendor='' product_name='' product_version='' product_serial='' product_uuid='' local system_vendor='' product_name='' product_version='' product_serial='' product_uuid=''
@ -12787,9 +12820,11 @@ print_machine_data()
## keys for machine data are: ## keys for machine data are:
# 0-sys_vendor 1-product_name 2-product_version 3-product_serial 4-product_uuid # 0-sys_vendor 1-product_name 2-product_version 3-product_serial 4-product_uuid
# 5-board_vendor 6-board_name 7-board_version 8-board_serial # 5-board_vendor 6-board_name 7-board_version 8-board_serial
# 9-bios_vendor 10-bios_version 11-bios_date # 9-bios_vendor 10-bios_version 11-bios_date
## with extra data: ## with extra data:
# 12-chassis_vendor 13-chassis_type 14-chassis_version 15-chassis_serial # 12-chassis_vendor 13-chassis_type 14-chassis_version 15-chassis_serial
## unused: 16-firmware_revision 17-firmware_romsize
#
# a null array always has a count of 1 # a null array always has a count of 1
if [[ ${#A_MACHINE_DATA[@]} -gt 1 ]];then if [[ ${#A_MACHINE_DATA[@]} -gt 1 ]];then
# note: in some case a mobo/version will match a product name/version, do not print those # note: in some case a mobo/version will match a product name/version, do not print those
@ -12834,6 +12869,10 @@ print_machine_data()
fi fi
fi fi
fi fi
# echo ${A_MACHINE_DATA[@]}
if [[ -n ${A_MACHINE_DATA[18]} ]];then
firmware_type=${A_MACHINE_DATA[18]}
fi
if [[ -n ${A_MACHINE_DATA[5]} ]];then if [[ -n ${A_MACHINE_DATA[5]} ]];then
mobo_vendor=${A_MACHINE_DATA[5]} mobo_vendor=${A_MACHINE_DATA[5]}
else else
@ -12872,7 +12911,7 @@ print_machine_data()
bios_rom=" ${C1}rom size$SEP3${C2} ${A_MACHINE_DATA[17]}" bios_rom=" ${C1}rom size$SEP3${C2} ${A_MACHINE_DATA[17]}"
fi fi
mobo_line="${C1}Mobo$SEP3${C2} $mobo_vendor ${C1}model$SEP3${C2} $mobo_model$mobo_version$mobo_serial" mobo_line="${C1}Mobo$SEP3${C2} $mobo_vendor ${C1}model$SEP3${C2} $mobo_model$mobo_version$mobo_serial"
bios_line="${C1}Bios$SEP3${C2} $bios_vendor ${C1}v$SEP3${C2} $bios_version ${C1}date$SEP3${C2} $bios_date$bios_rom" bios_line="${C1}$firmware_type$SEP3${C2} $bios_vendor ${C1}v$SEP3${C2} $bios_version ${C1}date$SEP3${C2} $bios_date$bios_rom"
if [[ $( calculate_line_length "$mobo_line$bios_line" ) -lt $COLS_INNER ]];then if [[ $( calculate_line_length "$mobo_line$bios_line" ) -lt $COLS_INNER ]];then
mobo_line="$mobo_line $bios_line" mobo_line="$mobo_line $bios_line"
bios_line='' bios_line=''

8
inxi.1
View file

@ -1,4 +1,4 @@
.TH INXI 1 "2016\-04\-18" inxi "inxi manual" .TH INXI 1 "2016\-08\-25" inxi "inxi manual"
.SH NAME .SH NAME
inxi \- Command line system information script for console and IRC inxi \- Command line system information script for console and IRC
.SH SYNOPSIS .SH SYNOPSIS
@ -157,7 +157,9 @@ Because dmidecode data is extremely unreliable, inxi will try to make best guess
.B \-M .B \-M
Show machine data. Motherboard, Bios, and if present, System Builder (Like Lenovo). Show machine data. Motherboard, Bios, and if present, System Builder (Like Lenovo).
Older systems/kernels without the required \fB/sys\fR data can use dmidecode instead, run as root. If using dmidecode, Older systems/kernels without the required \fB/sys\fR data can use dmidecode instead, run as root. If using dmidecode,
may also show bios revision as well as version. \fB\-! 33\fR can force use of \fBdmidecode\fR data instead of \fB/sys\fR. may also show bios revision as well as version. \fB\-! 33\fR can force use of \fBdmidecode\fR data instead of \fB/sys\fR.
Will also attempt to show if the system was booted by BIOS, UEFI, or UEFI [Legacy]. The last one is legacy BIOS boot mode
in a systemboard using UEFI but booted as BIOS/Legacy.
.TP .TP
.B \-n .B \-n
Show Advanced Network card information. Same as \fB\-Nn\fR. Shows interface, speed, Show Advanced Network card information. Same as \fB\-Nn\fR. Shows interface, speed,
@ -180,7 +182,7 @@ Show full partition information (\fB\-P\fR plus all other detected partitions).
.TP .TP
.B \-P .B \-P
Show Partition information (shows what \fB\-v 4\fR would show, but without extra data). Show Partition information (shows what \fB\-v 4\fR would show, but without extra data).
Shows, if detected: \fB/ /boot /home /tmp /usr /var\fR. Use \fB\-p\fR to see all mounted partitions. Shows, if detected: \fB/ /boot /home /opt /tmp /usr /var /var/tmp /var/log\fR. Use \fB\-p\fR to see all mounted partitions.
.TP .TP
.B \-r .B \-r
Show distro repository data. Currently supported repo types: Show distro repository data. Currently supported repo types:

View file

@ -1,3 +1,25 @@
=====================================================================================
Version: 2.3.1
Patch Version: 00
Script Date: 2016-08-25
-----------------------------------
Changes:
-----------------------------------
New version, new tarball, new man page.
Basic support added for Budgie desktop detection. This is waiting more data, so the support will be
missing the version information. Go Budgie!!
Added /var/tmp and /var/log and /opt to basic partition data: -P
This will probably not impact more than a handful of people in the world, but that's fine.
Modified the static BIOS in -M to now show UEFI for actually UEFI booted systems, and, ideally,
UEFI [Legacy] for UEFI booting in bios legacy mode, and BIOS for all others. Hopefully this will
work ok, we'll see.
-----------------------------------
-- Harald Hope - Thu, 25 Aug 2016 19:09:52 -0700
===================================================================================== =====================================================================================
Version: 2.3.0 Version: 2.3.0
Patch Version: 00 Patch Version: 00