take whole device for init
authorft
Thu, 05 Jun 2014 16:23:50 +0200
changeset 84fd36a6f652a
parent 7 001df120dbe3
child 9 d49050cfaab7
take whole device for init
macke shure device is not mounted
src/encryptionprovider.py
truecrypt_scripts/truecrypt_init.sh
     1.1 --- a/src/encryptionprovider.py	Thu Jun 05 13:59:54 2014 +0200
     1.2 +++ b/src/encryptionprovider.py	Thu Jun 05 16:23:50 2014 +0200
     1.3 @@ -137,14 +137,9 @@
     1.4      close = False
     1.5      while (close == False):
     1.6          time.sleep(1)
     1.7 -        if (os.path.ismount(mountpoint) == True):
     1.8 -            close = True
     1.9 -            LOG.info ("Stick \"%s\" was mounted sucessfully to \"%s\"" %(device, mountpoint,))
    1.10 -            sys.exit(0)
    1.11 -            
    1.12          if (os.path.exists(device) == False):
    1.13              close = True
    1.14 -            LOG.info ("Stick \"%s\" was removed. Exit" %(device,))
    1.15 +            LOG.info ("Stick \"%s\" removed -> exit" %(device,))
    1.16              sys.exit(0)
    1.17  
    1.18  
    1.19 @@ -172,4 +167,4 @@
    1.20          mountDevice (config.get ("Main", "MountScript"), arguments.mount[0], int(arguments.mount[1]), arguments.mount[2], arguments.mount[3], config.get ("Main", "Keyfile"))
    1.21      
    1.22      if (arguments.initialize):
    1.23 -        initDevice (config.get ("Main", "InitScript"), arguments.mount[0], int(arguments.mount[1]), arguments.mount[2], arguments.mount[3], config.get ("Main", "Keyfile"))
    1.24 +        initDevice (config.get ("Main", "InitScript"), arguments.initialize[0], int(arguments.initialize[1]), arguments.initialize[2], arguments.initialize[3], config.get ("Main", "Keyfile"))
     2.1 --- a/truecrypt_scripts/truecrypt_init.sh	Thu Jun 05 13:59:54 2014 +0200
     2.2 +++ b/truecrypt_scripts/truecrypt_init.sh	Thu Jun 05 16:23:50 2014 +0200
     2.3 @@ -14,6 +14,12 @@
     2.4  	exit 1
     2.5  fi
     2.6  
     2.7 +# make sure to have "/dev/sdb" (not "/dev/sdb1")
     2.8 +DEVICE="${DEVICE:0:8}"
     2.9 +
    2.10 +# make sure the device is not mounted
    2.11 +umount ${DEVICE}*
    2.12 +
    2.13  if [ -z "$KEYFILE" ]
    2.14  then
    2.15  	message="$($tc_cmd -c --non-interactive --quick --filesystem=none --encryption=AES --hash=RIPEMD-160 -p "$PASSWORD" "$DEVICE")"