From cee0dd4867601c1ccb66b6718085c92761a97d7c Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Wed, 4 Feb 2009 23:36:23 +0000 Subject: [PATCH] branches/one arch compatible now? let's see --- inxi | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index 2ae09e0..82f7368 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.9.10-b1-t1 +#### version: 0.9.10-b1-t2 #### Date: 4 February 2009 ######################################################################## #### SPECIAL THANKS @@ -2376,10 +2376,16 @@ get_partition_data_advanced() #echo mount_point $mount_point dev_partition_data=$( gawk ' BEGIN { - label = "" - uuid = "" + IGNORECASE = 1 + partition = "" + partTemp = "" } /[ \t]'$mount_point'[ \t]/ && $1 != "rootfs" { + # initialize the variables + label = "" + uuid = "" + + # slice out the /dev partition=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, $1 ) # label and uuid can occur for root if ( partition ~ /by-label/ ) { @@ -2393,7 +2399,19 @@ get_partition_data_advanced() if ( partition ~ /disk/ ) { partition = "" } - #print $1 "," label "," uuid + # handle Arch /dev/root for / id + if ( partition == "root" ) { + partTemp='$(readlink /dev/root)' + if ( partTemp ~ /^[hs]d[a-z][0-9]+$/ ) { + partition=partTemp + } + else if ( partTemp ~ /[a-z]+-[a-z]+-[a-z]+/ ) { + uuid=partTemp + } + else if ( partTemp != "" ) { + label=partTemp + } + } print partition "," label "," uuid }' $DIR_MOUNTS )