Stuff that has not yet gone into the official build.
Post a reply
dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

## Re: Automatic fstab update scripts

Fri Feb 03, 2012 5:12 pm

Getting there... probably still more to do...
Updated to configure-mounts_0.4 (same url)
should autodetect up to 2 TYPE="crypto_LUKS" (as seen by blkid) volumes and exclude them when setting up linux parts.
Tested here (only, so far) with one newly-made LUKS partition. Script does not now hang. Existing fstab entry is kept, it's "raw device" gets excluded from appends. Whether or not it is open or mounted already.
mount -a is not a problem, if the LUKS is not open, simply the message:

Code:
  `mount: special device /dev/mapper/sdc2 does not exist`

Also, a grep error when processing a swapfile is (seemingly) fixed
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Automatic fstab update scripts

Wed Feb 08, 2012 5:25 pm

I finally rebooted my main computer and tested configure-mounts_0.4+2.sh while running from usb. The script saw and added lines to fstab for both sda1 and sdb1 as it should have. Got an error message (again) about too many arguments in line 275. Fixed it by quoting the string in the test...

Code:
  `if [ "$ROOTPARTDEV" = /dev/${REMOVABLE1}[0-9] ]; then`

changed to

Code:
  `if [ "$ROOTPARTDEV" = "/dev/${REMOVABLE1}[0-9] ]"; then`

dzz

- dzz
- Posts: 647
- Joined: Wed Apr 27, 2011 11:53 am
- Location: Devon, England

## Re: Automatic fstab update scripts

Thu Feb 09, 2012 12:08 am

Thanks for pointing that error out (and all the other tests)
I had trouble with that line before. Please correct me if I am wrong but I didn't believe a "glob", [0-9], if it's in quotes, works properly like that in a conditional (and clearly doesn't behave without either, "too many arguments" ) EDIT These errors don't show in all setups the script may run in
So I made $ROOTPARTDEV just the device, (e.g. /dev/sdb) and used $ROOTPART (e.g. /dev/sdb1) everywhere else for the actual partition, now the "glob" is removed
Actually, I dont think a "real" usb install shows up as a removable, it didn't on an install here last time I looked (can't test that today) so the line in question might be redundant anyway. It's only to stop removables getting fstab entries.
Updated version (keeping older ones there for now) :
http://exe-linux.fastfishwebsolutions.c ... s_0.4+3.sh
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: Automatic fstab update scripts

Fri Feb 10, 2012 5:04 pm

I don't know exactly why there's a problem, but it's acting like word splitting is going on, so I tried quoting it, and it worked. Another solution would be to use the bash extended test ( [[ ) instead of ( [ ). I haven't tried the revised version (+3) yet.
Here are the last versions of mount and unmount crypto.
https://github.com/fsmithred/scripts/bl ... rypto03.sh
https://github.com/fsmithred/scripts/bl ... rypto03.sh
Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.