mjbeverley / inxi

Automatically exported from code.google.com/p/inxi
0 stars 0 forks source link

gawk syntax error with truecrypt partitions #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a truecrypt partition
2. Mount it
3. $ inxi -v7 -@10

What is the expected output? What do you see instead?

This problem appears on debugging:
P: Drives:    HDD Total Size: 2120.5GB (50.9% used)
P:            1: id: /dev/sda model: OCZ size: 120.0GB serial: *** temp: 30C 
P:            2: id: /dev/sdb model: WDC_WD10EARS size: 1000.2GB serial: *** 
temp: 35C 
P:            3: id: /dev/sdc model: WDC_WD5000AZRX size: 500.1GB serial: *** 
temp: 31C 
P:            4: id: /dev/sdd model: ST3500418AS size: 500.1GB serial: *** 
temp: 33C 
P:            Optical: No optical drives detected.
gawk: cmd. line:2:                                      /mapper/truecrypt1$/ {
gawk: cmd. line:2:                                                          ^ 
unterminated regexp
gawk: cmd. line:3:                                              print $(NF - 2)
gawk: cmd. line:3:                                              ^ syntax error
gawk: cmd. line:4:                                      }
gawk: cmd. line:4:                                      ^ syntax error
gawk: cmd. line:2:                                      /mapper/truecrypt1$/ {
gawk: cmd. line:2:                                                          ^ 
unterminated regexp
gawk: cmd. line:3:                                              print $(NF - 2)
gawk: cmd. line:3:                                              ^ syntax error
gawk: cmd. line:4:                                      }
gawk: cmd. line:4:                                      ^ syntax error
gawk: cmd. line:2:                                      /mapper/truecrypt2$/ {
gawk: cmd. line:2:                                                          ^ 
unterminated regexp
gawk: cmd. line:3:                                              print $(NF - 2)
gawk: cmd. line:3:                                              ^ syntax error
gawk: cmd. line:4:                                      }
gawk: cmd. line:4:                                      ^ syntax error
gawk: cmd. line:2:                                      /mapper/truecrypt2$/ {
gawk: cmd. line:2:                                                          ^ 
unterminated regexp
gawk: cmd. line:3:                                              print $(NF - 2)
gawk: cmd. line:3:                                              ^ syntax error
gawk: cmd. line:4:                                      }
gawk: cmd. line:4:                                      ^ syntax error
P: Partition: ID: / size: 47G used: 20G (42%) fs: ext4 dev: /dev/root label: 
N/A uuid: N/A
P:            ID: /media/STORAGE size: 932G used: 766G (83%) fs: fuseblk dev: 
/dev/sdb5 

Output of `ls -l /dev/mapper/`:
# ls -l /dev/mapper/
total 0
crw------- 1 root root 10, 236 Sep 26 11:34 control
lrwxrwxrwx 1 root root       7 Sep 26 15:10 truecrypt1 -> ../dm-2
lrwxrwxrwx 1 root root       7 Sep 26 15:10 truecrypt1_0 -> ../dm-1
lrwxrwxrwx 1 root root       7 Sep 26 15:10 truecrypt1_1 -> ../dm-0
lrwxrwxrwx 1 root root       7 Sep 26 15:10 truecrypt2 -> ../dm-5
lrwxrwxrwx 1 root root       7 Sep 26 15:10 truecrypt2_0 -> ../dm-4
lrwxrwxrwx 1 root root       7 Sep 26 15:10 truecrypt2_1 -> ../dm-3

What version of the product are you using? On what operating system?
inxi-1.8.17 - Gentoo linux (amd64)

This is not crytical as the error doesn't show on a normal `inxi -v7` output.
It's just something that's good to be fixed.

Regards.

Original issue reported on code.google.com by noksh...@gmail.com on 27 Sep 2012 at 7:24

GoogleCodeExporter commented 9 years ago
inxi doesn't use /dev/mapper at all, so I need to see:

df -h -T -P

or run: inxi -xx@14 
to upload full debugger output.

Obviously having a $ in the path is causing issues, I'm surprised to see a Unix 
like system do that to be honest, given how $ is used in so much regex etc.

I'll have to rely on your data, I won't be installing or using truecrypt myself.

Original comment by inxi-...@techpatterns.com on 3 Oct 2012 at 5:14

GoogleCodeExporter commented 9 years ago
Hi, 

└┼───┤ $ ▶ df -h -T -P
Filesystem             Type      Size  Used Avail Use% Mounted on
rootfs                 rootfs     47G   20G   27G  43% /
/dev/root              ext4       47G   20G   27G  43% /
devtmpfs               devtmpfs  7.9G  4.0K  7.9G   1% /dev
tmpfs                  tmpfs     7.9G  496K  7.9G   1% /run
cgroup_root            tmpfs      10M     0   10M   0% /sys/fs/cgroup
shm                    tmpfs     7.9G  7.5M  7.9G   1% /dev/shm
tmpfs                  tmpfs      14G   21M   14G   1% /var/tmp/portage
/dev/sdb5              fuseblk   932G  752G  180G  81% /media/STORAGE
tmpfs                  tmpfs     7.9G     0  7.9G   0% /mnt/vartmp
tmpfs                  tmpfs     512M  195M  318M  39% 
/media/STORAGE/minecraft/world
/dev/mapper/truecrypt1 ext4      443G  217G  205G  52% /media/JohnnyBlack
/dev/mapper/truecrypt2 ext4       49G   24G   22G  53% 
/media/JohnnyBlack/STUFF/Personal

After `inxi -xx@14` it seems that it uploaded the data to your server, anyways 
I'll upload it here as well.

The only file that this error seems to appear is 'inxi-FRploudxxx.txt'

Regards.

Original comment by noksh...@gmail.com on 3 Oct 2012 at 5:45

Attachments:

GoogleCodeExporter commented 9 years ago
Version 1.8.18 should have that mapper stuff supported. There were a few issues 
with supporting mapper, so I had to do some big tweaks, now it will ideally 
detect mapper partitions with either -P or -p, you can see it in -pluo

also, -o, which would have been wrong as well, since it depends on correct 
detection of the mounted partitions, should now be right, ie, not show the 
mounted partitions as unmounted.

since this was a bit too involved to test with your data, I'm just hoping it 
works, let me know.

Original comment by inxi-...@techpatterns.com on 3 Oct 2012 at 8:57

GoogleCodeExporter commented 9 years ago
Hi,
I can confirm that this error has been fixed in 1.8.18

Before:
P:            ID: /media/JohnnyBlack size: 443G used: 217G (52%) fs: ext4 dev: 
/dev/mapper/truecrypt1 
P:            label: N/A uuid: N/A
P:            ID: /media/JohnnyBlack/STUFF/Personal size: 49G used: 24G (53%) 
fs: ext4 dev: /dev/mapper/truecrypt2 
P:            label: N/A uuid: N/A

After:
P:            ID: /media/JohnnyBlack size: 443G used: 217G (52%) fs: ext4 dev: 
/dev/dm-2 
P:            label: N/A uuid: 2609d90d-1227-4083-b0b8-************
P:            ID: /media/JohnnyBlack/STUFF/Personal size: 49G used: 24G (53%) 
fs: ext4 dev: /dev/dm-5 
P:            label: N/A uuid: 22dac54a-33c6-4d13-8c19-************

NOTE: It shows a valid 'dev' now (/dev/dm-*) instead of the symlink in 
/dev/mapper/ and also shows a valid uuid (instead of N/A like before).

Thank you.

Original comment by noksh...@gmail.com on 3 Oct 2012 at 10:30

GoogleCodeExporter commented 9 years ago
Ok, then this issue is resolved.

Original comment by inxi-...@techpatterns.com on 4 Oct 2012 at 1:39