branches/one arch compatible now? let's see

This commit is contained in:
inxi-svn 2009-02-04 23:36:23 +00:00
parent 6f94b59e1f
commit cee0dd4867

26
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.9.10-b1-t1 #### version: 0.9.10-b1-t2
#### Date: 4 February 2009 #### Date: 4 February 2009
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -2376,10 +2376,16 @@ get_partition_data_advanced()
#echo mount_point $mount_point #echo mount_point $mount_point
dev_partition_data=$( gawk ' dev_partition_data=$( gawk '
BEGIN { BEGIN {
label = "" IGNORECASE = 1
uuid = "" partition = ""
partTemp = ""
} }
/[ \t]'$mount_point'[ \t]/ && $1 != "rootfs" { /[ \t]'$mount_point'[ \t]/ && $1 != "rootfs" {
# initialize the variables
label = ""
uuid = ""
# slice out the /dev
partition=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, $1 ) partition=gensub( /^(\/dev\/)(.+)$/, "\\2", 1, $1 )
# label and uuid can occur for root # label and uuid can occur for root
if ( partition ~ /by-label/ ) { if ( partition ~ /by-label/ ) {
@ -2393,7 +2399,19 @@ get_partition_data_advanced()
if ( partition ~ /disk/ ) { if ( partition ~ /disk/ ) {
partition = "" 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 print partition "," label "," uuid
}' $DIR_MOUNTS ) }' $DIR_MOUNTS )