View Single Post
Posts: 124 | Thanked: 105 times | Joined on Jul 2010
#17
Originally Posted by Estel View Post

As for mass storage mode, obviously Your PC won't be able to see MyDocs content, if You encrypt it - without having TrueCrypt installed on PC. Even if so, it may be required to use USB Networking instead of Mass Storage (for example, via nice QtMobileHostpot program), but don't quote me on that, as I've never tried such strange combinatiuon myself.
I wanted to keep decryption on the n900 too, for the same reasons as NIN101. (plus that way you don't have to install TC on the PC)
Finally managed to get it set up the way I want this weekend.
I like my method because it's automatic and transparent:

-it mounts MyDocs and SD card as normal when you're not using TC

-if a decrypted TC volume is available, it mounts that instead of MyDocs.

-you can use it with more than one volume (though only the first one decrypted will mount - if you want to simultaneusly access multiple volumes other changes will need to be made)
For example on my phone i have a file container volume and a partition volume - the first volume I decrypt will mount over USB, doesn't matter which one it is

-you can still normally access the volumes on the n900 itself - no need to mount the TC volumes differently


The changes are made it /usr/sbin/osso-usb-mass-storage-enable.sh
(backup this file beforehand)

First I added IF statement that checks for the presence of /media/truecrypt1

If it exists then an alternate snippet is executed that mounts
the decrypted TC block device instead of MyDocs
(in most cases this seems to be /dev/mapper/truecrypt1
But you can doublecheck on your device with truecrypt -l, if it's different (i.e /dev/loop0) use that instead)

(I found that snippet in one of titan's posts, thanks to him)

find the section below (it's at the end of the file) and add code in red:

Code:
if [ $# = 1 ]; then                                
      STR= 'cat $LUN0'                       
      if [ "x$STR"  = "x" ]; then              
            if [ -e /media/truecrypt1 ]; then 
                 DEV=/dev/mapper/truecrypt1
                 echo $DEV > LUN0
            else 
            echo $1 > LUN0
            fi
      else
            echo $1 > LUN1
      fi
fi
Finally, if truecrypt gives an error dismounting after you're done,
you need to manuall run /usr/bin/osso-mass-storage-disable.sh
You will then be able to dismount. (Or can reboot the phone)

Last edited by nman; 2012-01-17 at 15:26. Reason: Changed script to reflect correct filenames used by TC 7.X
 

The Following 2 Users Say Thank You to nman For This Useful Post: