How to use truecrypt on puppy 2.12

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
kkpity
Posts: 112
Joined: Mon 27 Nov 2006, 16:16
Location: Brazil

How to use truecrypt on puppy 2.12

#1 Post by kkpity »

Hi everybody!

Finally I had success installing truecrypt 4.2a in puppy 2.12!

Basically, I follow topics below with some minor changes:
http://www.murga-linux.com/puppy/viewto ... t&start=15
http://www.murga-linux.com/puppy/viewto ... le&t=13557

I had reorganized instructions from above links to reflect what I did step by step.

I hope this help others in the community.

I am assuming that you have puppy running from CD and have the puppy_save.3fs in other location as a pendrive for example. These instructions should work for systems installed on hd with just minor changes.

Let's go on...

Get following files:
linux-2.6.18.1-source-patched_sfs_log_via.tar.bz2 (http://www.puptrix.org/isos/Puppylinux- ... evelopment)
truecrypt-4.2a-source-code.tar.gz (http://www.truecrypt.org)
device-mapper.1.02.13.tgz (ftp://sources.redhat.com/pub/dm/device- ... .02.13.tgz)
devx_212.sfs (http://www.puptrix.org/isos/Puppylinux- ... evelopment - this file provides "make" command plus gcc tools and should be at your /root or at same path as puppy_save.3fs)

1. Make sure you have enough space for your puppy_save.3fs. In my case, I had to resize it to be 512M, but I think 256M should be enough if you have few configurations/programs as the default ones.

To check if puppy_save.3fs will be enough you can follow below instructions (I know that there are other "easy" ways to do that, but I'm just typing what I did. You can try other solutions):

BACKUP your puppy_save.3fs (If puppy_save.3fs has no enough size, the file will be corrupted after below steps. In fact it will work, but with strange behaviors).

Unpack the kernel source
# cd /usr/src
# tar -jxf linux-2.6.18.1-source-patched_sfs_log_via.tar.bz2
# cd /usr/src/linux-2.6.18.1
Copy over the latest config file to /usr/src/linux/.config (I forget the nomenclature; it'll be in /usr/src/linux and it'll have a date at the end like "DOTconfig-K2.6.18.1-19OCT06"). In my case was:
# cp /usr/src/linux/DOTconfig-K2.6.18.1-19OCT06 /usr/src/linux/.config
# make mrproper
# make bzImage

Reboot your machine and see the messages when puppy is synchronizing your RAM data with puppy_save.3fs. If you have no space available, you will see the message "no space left on device". In this case, you have to resize your puppy_save.3fs file to a bigger size. Just back your previous puppy_save.3fs file and resize it (you can find a link on puppy menu -> utilities -> Resize personal storage data).

Supposing everything was ok on step 1, let's continue...

###############

2. Select the build options
# cd /usr/src/linux
# make menuconfig
Specify device-mapper as module (and crypto if you want)
Device Drivers --> RAID and LVM Support -->
[*] Multiple devices driver support (RAID and LVM)
<M> Device mapper support
<M> Crypt target support

Exit and save your config.

# make modules

Once the modules are made (It'll take a while unless you turn off all the other modules, which will take just as long, so just build 'em all), pick the ones you want:

# mkdir -p /lib/modules/2.6.18.1/md
# cp /usr/src/linux/drivers/md/dm-mod.ko /usr/src/linux/drivers/md/dm-crypt.ko /lib/modules/2.6.18.1/md/

update modules.dep

# depmod -a

Your modules are in /usr/src/linux/drivers/md/*.ko if you want to bundle them up later.

###############

3. build device-mapper:

# mkdir /tmp/build
# cd /tmp/build
# mkdir /tmp/build/destdir
# tar -zxvf /dev/hda2/temp/device-mapper.1.02.13.tgz
# cd device-mapper.1.02.13
# ./configure --prefix=/usr
# make
# make install DESTDIR=/tmp/build/destdir
# cp -R /tmp/build/destdir/* /

device-mapper is in /tmp/build/destdir if you want to bundle it up later.

###############

4. build & install the kernel module for truecrypt

# cd /tmp/build
# tar -zxvf /mnt/hda2/temp/truecrypt-4.2a-source-code.tar.gz (supposing this file is on /mnt/hda2/temp)
# cd /tmp/build/truecrypt-4.2a/Linux/Kernel/
# make

If you got errors like ...
/tmp/build/truecrypt-4.2a/Linux/Kernel/Dm-target.c:644: error: parse error before "DM_MSG_PREFIX"

... you have to insert following line at /usr/src/linux-2.6.18.1/drivers/md/dm.h after line 19:

#define DM_MSG_PREFIX "target"

and run "make" command again.

# mkdir -p /lib/modules/2.6.18.1/extra
# cp /tmp/build/truecrypt-4.2a/Linux/Kernel/truecrypt.ko /lib/modules/2.6.18.1/extra
# depmod -a

the module is in /tmp/build/truecrypt-4.2a/Linux/Kernel/truecrypt.ko if you want to bundle it up later

###############

5. Build the truecrypt CLI
# cd /tmp/build/truecrypt-4.2a/Linux/Cli/
# make
# cp /tmp/build/truecrypt-4.2a/Linux/Cli/truecrypt /usr/bin

the program is in /tmp/build/truecrypt-4.2a/Linux/Cli if you want to bundle it up later.

You can also get the manpage for truecrypt if you want; it's in the same tree as the program (/tmp/build/truecrypt-4.2a/Linux/Cli/Man). It goes in /usr/man/man1/truecrypt.1 (you should have to create dir /usr/man/man1)

###############

6. Make the device node:

# mkdir /dev/mapper 2>/dev/null && chmod 755 /dev/mapper
# mknod -m 600 /dev/mapper/control c 10 63

That's it.

Now, you can create a truecrypt file:
# truecrypt -c
(follow the prompts)

If you want, create a hidden container in that one
# truecrypt -c
(follow the prompts, specify the file you just created)

Open the file and write something in it--try the outer and hidden containers, protect the hidden, and so forth.
# truecrypt -i
(follow the prompts)

Then copy the file somewhere and test it on a windows box to prove interoperability.

Module sent for the building of a dotpup; watch the thread & see what appears.

You *really* should NOT TRUST crypto binaries, so maybe it's best if you roll your own.

Have fun!

############################

Sorry guys from the other topics. I had copied some entire text, but I think this topic is fitting better with puppy 2.12

My intention was just share my experience with other puppy users.

I also would like to have a .pup package for that, but I have no experience, yet. Maybe will be my next steps ;-)

Good luck!

kkpity
Linux user #388359 (http://counter.li.org/)

mlamelas
Posts: 42
Joined: Wed 04 Oct 2006, 12:53
Location: Madrid, Spain
Contact:

Post compiled files

#2 Post by mlamelas »

Hi kkpity,

If you have been able to compile from the source, would you be able to post the two compiled files, truecrypt (probably in /usr/bin) and truecrypt.ko (probably in /lib/module/2.16.18.1....), and indicate the exact location of the two files.

Wouldn't it be possible then to copy those two files to the locations, create the nodes for the mapper as you describe, and run truecrypt?

Thanks,

Mel

wdef
Posts: 91
Joined: Fri 13 Apr 2007, 20:16

#3 Post by wdef »

Be sure to post the md5sums of those files _in_the_forum_body_. So downloaders can verify these binaries are in fact the same as yours.

Or better still post a .pet package, but even then post the md5sum as text in the body of a forum post for verification.

I do agree that encryption binaries are best compiled yourself from gpg-signed sources, unless it's a very trusted source.

mlamelas
Posts: 42
Joined: Wed 04 Oct 2006, 12:53
Location: Madrid, Spain
Contact:

Problems compiling with 2.15 and TrueCrypt 4.3

#4 Post by mlamelas »

As a follow up to my post yesterday, I attempted to compile truecrypt using the instructions in the post. Only difference is that I am using Puppy 2.15 (same kernel source 2.6.18.1 per uname -r), and using truecrypt 4.3 vs. 4.2a.

Went through the entire process and when I tried to mount an existing tc file (created with Truecrypt running on Kubuntu 7.04), I get the following error message:

WARNING: Error inserting dm_mod (/lib/modules/2.6.18.1/md/dm-mod.ko): Invalid module format
FATAL: Error inserting truecrypt (/lib/modules/2.6.18.1/extra/truecrypt.ko): Invalid module format
Failed to load TrueCrypt kernel module

Any thoughts?

Thanks,

Mel

User avatar
kkpity
Posts: 112
Joined: Mon 27 Nov 2006, 16:16
Location: Brazil

#5 Post by kkpity »

Hi all¸

As requested¸ I'm attaching truecrypt (binary one) and truecrypt.ko.

Actually I'm using puppy version 2.13 and truecrypt 4.2a

md5sum:
/usr/bin/truecrypt:
972d0f2fce8d18f81e1a18470ce6ca59

/lib/modules/2.6.18.1/extra/truecrypt.ko:
3ae99e8a6d8ddaa15933bdff4612863a

Good luck!

kkpity

P.S. Latest note:
I had to zip both files.
Attachments
truecrypt.ko.gz
(75.05 KiB) Downloaded 596 times
truecrypt.gz
(111.55 KiB) Downloaded 583 times

mlamelas
Posts: 42
Joined: Wed 04 Oct 2006, 12:53
Location: Madrid, Spain
Contact:

Thanks

#6 Post by mlamelas »

Hi kkpity,

Thanks for the help. I don't see the files attached to your posting. Also, it would help if you attached the md-mod.ko and md-crypto.ko from the /lib/modules.2.6.../md directory.

Best regards,

Mel

mlamelas
Posts: 42
Joined: Wed 04 Oct 2006, 12:53
Location: Madrid, Spain
Contact:

Thanks

#7 Post by mlamelas »

Hi kkpity,

Had a browser problem. I see your two attachments. If you don't mind, it would be great if you post the two dm ko's in modules/dm so that they are from the same compile.

I will try to copy these files to the appropriate directories and see if I can get TC to work on 2.15.

Best regards,

Mel

User avatar
kkpity
Posts: 112
Joined: Mon 27 Nov 2006, 16:16
Location: Brazil

#8 Post by kkpity »

Hi¸

Here are the files located at /lib/modules/2.6.18.1/md/

dm-crypt.ko:
md5sum - bb5ccf0ebd6a2b2a3b1bd23189649d11

dm-mod.ko:
md5sum - bb5ccf0ebd6a2b2a3b1bd23189649d11

Regards¸

kkpity
Attachments
dm-mod.ko.gz
(27.24 KiB) Downloaded 617 times
dm-crypt.ko.gz
(27.25 KiB) Downloaded 579 times
Linux user #388359 (http://counter.li.org/)

mlamelas
Posts: 42
Joined: Wed 04 Oct 2006, 12:53
Location: Madrid, Spain
Contact:

Works with glitches

#9 Post by mlamelas »

Hi kkpity,

Thanks for posting the two dm modules. I copied them to the dm folder, did a depmod -a, and I was able to mount my existing tc file under Puppy2.15.

Only glitch is that the files are showing up with their 8.3 names, rather than their long file name. With Truecrypt in Kubuntu, they show up with their long name.

To all the posters on this thread, two questions:

Any idea why the names are showing up in 8.3 format?

Why will truecrypt compile under Puppy 2.12 but not under 2.15? Aren't they both using the same kernel code? I was able to take the modules compiled under 2.12 and install them in 2.15, with only the 8.3 name glitch.

Many thanks,

Mel

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#10 Post by John Doe »

I compiled TrueCrypt on 2.14 which is what 2.15 is based on.

No idea why you can't with 2.15.

btw, I used these two versions:

truecrypt-4.3a-source-code.tar.gz
devmapper-1.02.08.orig.tar.gz

mlamelas
Posts: 42
Joined: Wed 04 Oct 2006, 12:53
Location: Madrid, Spain
Contact:

Was there a change to 2.15

#11 Post by mlamelas »

Thanks for the reply. I used device-mapper.1.02.13.tgz, so I don't know if that made a difference. There was a statement in another thread on pupsave encryption that said that "encryption" had been removed from 2.15, so I was wondering if the code removed from 2.15 affects my ability to compile Truecrypt.

User avatar
kkpity
Posts: 112
Joined: Mon 27 Nov 2006, 16:16
Location: Brazil

#12 Post by kkpity »

Hi

To fix the 8.3 names you have to use the following command when monting the volumes:

truecrypt --mount-options "rw,sync,utf8,uid=1000,umask=0007" <your volume name> <mount dir>

Basically¸ the option utf8 is the one that fix the 8.3 issue but the others ones should be useful.

Regards¸

kkpity
Linux user #388359 (http://counter.li.org/)

mlamelas
Posts: 42
Joined: Wed 04 Oct 2006, 12:53
Location: Madrid, Spain
Contact:

There appears to be some change to encryption in 2.15

#13 Post by mlamelas »

First, thanks to all posters for your input. I have been following another thread on encrypting the pupsave file, and there are some references to encryption being taken out of 2.15, which may explain why tc can compile in previous versions. I tried again today with Truecrypt 4.3a and had the same error messages.

Using the ko files posted by kkpity tc can run, even in 2.15. Presumably as long as the kernel remains 2.6.18.1 we can simply copy them to the appropriate directories. If the kernel changes, then it may get interesting.

If I figure out the problem with 2.15, I will post it here.

Mel

Post Reply