Hi! Please find the attached truecrypt-4.0.ebuild and a patch so that it compiles on Gentoo. The only platform I could test this at the moment is x86, but it should compile on AMD64 as well. Truecrypt is a disk-encryption software that works on Linux and Windows. The newest version includes Linux support for the first time and it should be a helpful tool for people who need to access encrypted partition under different operating systems. More information is available under http://www.truecrypt.org/ I suggest app-crypt/truecrypt as the package name. Alexander Steppke
Created attachment 72673 [details] ebuild for truecrypt-4.0
Created attachment 72674 [details, diff] patch for truecrypt-4.0, so that it compiles without errors
*** Bug 111394 has been marked as a duplicate of this bug. ***
Forgot one thing, Truecrypt is released under an open-source-license but not under the GPL. Therefore it is necessary to add a new license to portage. The license can be found under http://www.truecrypt.org/docs/License.txt I include it as an attachment here as well.
Created attachment 72682 [details] Truecrypt license, somewhat similar to GPL
Comment on attachment 72673 [details] ebuild for truecrypt-4.0 # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs DESCRIPTION="Free open-source disk encryption software for Windows XP/2000/2003 and Linux" HOMEPAGE="http://www.truecrypt.org/" SRC_URI="http://www.truecrypt.org/downloads/truecrypt-${PV}-source-code.tar.gz" LICENSE="truecrypt" SLOT="0" KEYWORDS="~x86" IUSE="" DEPEND="virtual/linux-sources >=sys-fs/device-mapper-1.00.08" RDEPEND="sys-apps/module-init-tools >=sys-fs/device-mapper-1.00.08" src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/${P}-head.patch } src_compile() { ARCH=$(tc-arch-kernel) cd ${S}/Linux sh build.sh || die "build failed" } src_test() { ${S}/Linux/Cli/truecrypt --test } src_install() { # unload truecrypt modules if already loaded /sbin/rmmod truecrypt >&- 2>&- if grep -q "^truecrypt" /proc/modules then die "Please dismount all mounted TrueCrypt volumes" fi cd ${S} # installing files dobin Linux/Cli/truecrypt doman Linux/Cli/Man/truecrypt.1 dodoc Readme.txt # installing kernel module MOD_DIR=/lib/modules/$(uname -r)/extra dodir ${MOD_DIR} fperms 600 Linux/Kernel/truecrypt.ko cp Linux/Kernel/truecrypt.ko ${D}/${MOD_DIR}/ || die "Install failed!" } pkg_postinst() { depmod || die "depmod failed" echo einfo " For TrueCrypt 4.0 to work you have to load a " einfo " kernel module. This can be done in three ways: " einfo einfo " 1. Loading the module automatically by the running kernel. " einfo " For this 'Automatic kernel module loading' needs to be " einfo " enabled (CONFIG_KMOD=y). einfo " 2. Loading the module manually before mounting the volume. " einfo " Try 'modprobe truecrypt' as root to load the module. " einfo " 3. Load the module during boot by listing it in " einfo " '/etc/modules.autoload.d/kernel-2.6' " }
Created attachment 72700 [details] updated ebuild file with instructions for module loading It was not clear that the kernel module had to be loaded before you can use the program, so I wrote a small note as post installation comment. Alexander Steppke P.S.: Sorry for pasting the whole ebuild in here, I got confused by the "Edit attachment" thing.
When trying to digest, I get the following: thor truecrypt # ebuild truecrypt-4.0.ebuild digest /usr/local/portage/app-crypt/truecrypt/truecrypt-4.0.ebuild: line 73: unexpected EOF while looking for matching `"' /usr/local/portage/app-crypt/truecrypt/truecrypt-4.0.ebuild: line 75: syntax error: unexpected end of file !!! ERROR: app-crypt/truecrypt-4.0 failed. !!! Function , Line 1777, Exitcode 1 !!! error sourcing ebuild !!! If you need support, post the topmost build error, NOT this status message. aux_get(): (0) Error in app-crypt/truecrypt-4.0 ebuild. (1) Check for syntax error or corruption in the ebuild. (--debug) /usr/local/portage/app-crypt/truecrypt/truecrypt-4.0.ebuild: line 73: unexpected EOF while looking for matching `"' /usr/local/portage/app-crypt/truecrypt/truecrypt-4.0.ebuild: line 75: syntax error: unexpected end of file !!! ERROR: app-crypt/truecrypt-4.0 failed. !!! Function , Line 1777, Exitcode 1 !!! error sourcing ebuild !!! If you need support, post the topmost build error, NOT this status message. aux_get(): (0) Error in app-crypt/truecrypt-4.0 ebuild. (1) Check for syntax error or corruption in the ebuild. (--debug) Traceback (most recent call last): File "/usr/sbin/ebuild", line 71, in ? a = portage.doebuild(ebuild, arg, portage.root, tmpsettings, debug=debug, cleanup=("noauto" not in portage.features), tree=mytree) File "/usr/lib/portage/pym/portage.py", line 2435, in doebuild eapi = db[root][tree].dbapi.aux_get(mycpv, ["EAPI"])[0] File "/usr/lib/portage/pym/portage.py", line 5407, in aux_get raise KeyError KeyError
Created attachment 72723 [details] current ebuild with updated einfo Use this updated ebuild, there was a " missing in the einfo entries. Sorry for the confusion.
Are you suppose to save the patch as "truecrypt-4.0-head.patch?" If so, I'm still getting this error: * Applying truecrypt-4.0-head.patch ... * Failed Patch: truecrypt-4.0-head.patch ! * ( /usr/local/portage/app-crypt/truecrypt/files/truecrypt-4.0-head.patch ) * * Include in your bugreport the contents of: * * /var/tmp/portage/truecrypt-4.0/temp/truecrypt-4.0-head.patch-30551.out !!! ERROR: app-crypt/truecrypt-4.0 failed. !!! Function epatch, Line 363, Exitcode 0 !!! Failed Patch: truecrypt-4.0-head.patch! !!! If you need support, post the topmost build error, NOT this status message. And /var/tmp/portage/truecrypt-4.0/temp/truecrypt-4.0-head.patch-30551.out contains the following: ***** truecrypt-4.0-head.patch ***** ==================================== PATCH COMMAND: patch -p0 -g0 --no-backup-if-mismatch < /usr/local/portage/app-c rypt/truecrypt/files/truecrypt-4.0-head.patch ==================================== patching file Linux/build.sh Hunk #1 FAILED at 13. 1 out of 1 hunk FAILED -- saving rejects to file Linux/build.sh.rej ==================================== PATCH COMMAND: patch -p1 -g0 --no-backup-if-mismatch < /usr/local/portage/app-c rypt/truecrypt/files/truecrypt-4.0-head.patch ==================================== can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -pur Linux/build.sh Linux-patched/build.sh |--- Linux/build.sh 2005-11-11 16:20:12.000000000 +0100 |+++ Linux-patched/build.sh 2005-11-11 16:45:27.000000000 +0100 -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored ==================================== PATCH COMMAND: patch -p2 -g0 --no-backup-if-mismatch < /usr/local/portage/app-c rypt/truecrypt/files/truecrypt-4.0-head.patch ==================================== missing header for unified diff at line 4 of patch can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -pur Linux/build.sh Linux-patched/build.sh |--- Linux/build.sh 2005-11-11 16:20:12.000000000 +0100 |+++ Linux-patched/build.sh 2005-11-11 16:45:27.000000000 +0100 -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored ==================================== PATCH COMMAND: patch -p3 -g0 --no-backup-if-mismatch < /usr/local/portage/app-c rypt/truecrypt/files/truecrypt-4.0-head.patch ==================================== missing header for unified diff at line 4 of patch can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -pur Linux/build.sh Linux-patched/build.sh |--- Linux/build.sh 2005-11-11 16:20:12.000000000 +0100 |+++ Linux-patched/build.sh 2005-11-11 16:45:27.000000000 +0100 -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored ==================================== PATCH COMMAND: patch -p4 -g0 --no-backup-if-mismatch < /usr/local/portage/app-c rypt/truecrypt/files/truecrypt-4.0-head.patch ==================================== missing header for unified diff at line 4 of patch can't find file to patch at input line 4 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff -pur Linux/build.sh Linux-patched/build.sh |--- Linux/build.sh 2005-11-11 16:20:12.000000000 +0100 |+++ Linux-patched/build.sh 2005-11-11 16:45:27.000000000 +0100 -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored
(In reply to comment #10) > Are you suppose to save the patch as "truecrypt-4.0-head.patch?" Yes, that is the correct filename. After computing the digest of the ebuild your Manifest file should look like this: MD5 50b3fb152ff809f1fe64b3d710044160 truecrypt-4.0.ebuild 1883 MD5 216a3c5854e5e9423fda8452f1e4af8b files/truecrypt-4.0-head.patch 778 MD5 268e9d7ab4e35899e7099dc420fa33ae files/digest-truecrypt-4.0 78 Now 'ebuild truecrypt-4.0.ebuild unpack' should unpack and patch the source code. This works here without errors. Please try to clean your temporary build directory with 'ebuild truecrypt-4.0.ebuild clean' first.
Sandbox violation when using the latest ebuild: Building kernel module... ACCESS DENIED open_wr: /usr/src/linux-2.6.14/Platform.gcda *** Warning: "dm_get_device" [/var/tmp/portage/truecrypt-4.0/work/truecrypt-4.0/Linux/Kernel/truecrypt.ko] undefined! *** Warning: "dm_table_get_mode" [/var/tmp/portage/truecrypt-4.0/work/truecrypt-4.0/Linux/Kernel/truecrypt.ko] undefined! *** Warning: "dm_register_target" [/var/tmp/portage/truecrypt-4.0/work/truecrypt-4.0/Linux/Kernel/truecrypt.ko] undefined! *** Warning: "dm_unregister_target" [/var/tmp/portage/truecrypt-4.0/work/truecrypt-4.0/Linux/Kernel/truecrypt.ko] undefined! *** Warning: "dm_put_device" [/var/tmp/portage/truecrypt-4.0/work/truecrypt-4.0/Linux/Kernel/truecrypt.ko] undefined! Done. Building truecrypt... Done. --------------------------- ACCESS VIOLATION SUMMARY --------------------------- LOG FILE = "/var/log/sandbox/sandbox-app-crypt_-_truecrypt-4.0-21297.log" open_wr: /usr/src/linux-2.6.14/Platform.gcda --------------------------------------------------------------------------------
u need to have dm_crypt enabled in your kernel ... CONFIG_MD=y CONFIG_BLK_DEV_MD is not set CONFIG_BLK_DEV_DM=y CONFIG_DM_CRYPT=y
Created attachment 72821 [details] ebuild which uses linux-mod.eclass I had sandbox violations, too. Attached you'll find a modified ebuild that uses linux-mod.eclass. Please test.
Thanks, Marc. This bug does have maintainer-wanted as the assignee, care to take over? :) For completeness, your ebuild compiles with FEATURES="sandbox userpriv", but not with "usersandbox".
(In reply to comment #14) > Created an attachment (id=72821) [edit] > ebuild which uses linux-mod.eclass > > I had sandbox violations, too. > Attached you'll find a modified ebuild that uses linux-mod.eclass. > Please test. The new ebuild leads to the following output on my system: [...] * Determining the location of the kernel source code * Found kernel source directory: * /usr/src/linux * Found sources for kernel version: * 2.6.9-gentoo-r9 ERROR: ld.so: object '/lib/libsandbox.so' from LD_PRELOAD cannot be preloaded: ignored. ERROR: ld.so: object '/lib/libsandbox.so' from LD_PRELOAD cannot be preloaded: ignored. [...] I get this error even with installed sandbox and sandboxshell. I think this should be '/usr/lib/libsandbox.so'. If we do not use the supplied build.sh script it might be a good idea to implement the checks that are done in that script inside the ebuild. The script checks for example if the kernel-version is equal or higher than 2.6.5 and for device-mapper-support. In general using the sandbox is definitely a good thing.
Additionally I got the following error on a different system: # ebuild truecrypt-4.0.ebuild compile [...] make[1]: Entering directory `/usr/src/linux-2.6.12-gentoo-r10' CC [M] /var/tmp/portage/truecrypt-4.0/work/truecrypt-4.0/Linux/Kernel/../../Crypto/Aescrypt.o [...] Compiling Cli.c Linking truecrypt gcc: ../../Crypto/Aescrypt.o: No such file or directory make: *** [truecrypt] Error 1 !!! ERROR: app-crypt/truecrypt-4.0 failed. !!! Function src_compile, Line 36, Exitcode 2 !!! failed. Somehow Aescrypt.c gets compiled in the first step to build the kernel module but it is not there anymore when linking the truecrypt utility.
I'll start tracking this and help with testing. I'm interested in this package as a good solution for cross-platform encryption capabilities, among other things. Marc (or someone), care to update the ebuild so that it's "~amd64" ? I'll provide testing there for you as well.
Created attachment 73477 [details] Updated ebuild that fixes sandbox violation and misc. cleanup I've been hacking on this ebuild a bit. The first problem I was having is the following sandbox violation: --------------------------- ACCESS VIOLATION SUMMARY --------------------------- LOG FILE = "/var/log/sandbox/sandbox-app-crypt_-_truecrypt-4.0-27214.log" open_wr: /usr/src/linux-2.6.13-gentoo-r5/Platform.gcda -------------------------------------------------------------------------------- I did some digging on this and found the problem in the TrueCrypt "Linux/Kernel/Makefile". Upstream is building/executing a "platform" executable on-the-fly, after the initial MAKE process begins. Since the initial MAKE process chdir's to "/usr/src/linux" first, the "gcda" file that gets created for "platform" is written to that directory. This isn't good (and a no-no), hence the sandbox violation. I created a patch for their Makefile to generate/execute this file before the main MAKE process, which fixes this problem. I'm attaching this patch here. --------------- I also did some cleanup of the ebuild file as follows (besides adding the patch above): - I've added "~amd64" to the keywords. It is compiling fine on my initial amd64 test system. - I've removed the epatch call for the "truecrypt-4.0-head.patch" included previously. Since we aren't using the "build.sh" script included with the distro, I don't see much point in patching it at all. Please let me know if I'm missing something here. - I moved the linux-mod/linux-info eclass variables to the global scope instead of being buried in the src_unpack() function. Again, unless I'm missing something here, doesn't the src_compile() function also need access to these variables? Therefore, I moved them up to the global scope. Please advise if this is incorrect for some reason. I'll continue doing testing on this thing over the next several days. So far it seems to be coming along nicely. Please let us know how this works for you.
Created attachment 73478 [details, diff] Patch to fix Makefile platform check issue Corrects the problem with the upstream Makefile.
Comment on attachment 73477 [details] Updated ebuild that fixes sandbox violation and misc. cleanup Sorry, not a patch.
Created attachment 73628 [details] TrueCrypt-4.0 ebuild I've made some adjustments to the 4.0 ebuild: - Running parallel MAKE's would sometimes break the compile/linking process for the CLI application. Therefore, an override for the MAKEOPTS "-j" flag has been added. - Error messages for compile failures have been enhanced to give the user a better idea what went wrong. The new 4.0 ebuild has been attached here (superseding my previous fixed build). My testing is complete at this point, and everything checks out perfectly. Please let us know if any of you experience problems with your systems/configurations.
Created attachment 73630 [details] TrueCrypt-4.1 ebuild A new version of TrueCrypt has been released: 4.1 This release adds "LRW" functionality in place of the prior "CBC" mode, which in certain (rare) cases was vulnerable to volume "detection" through matched data ordering (which is bad for plausible deniability). I've taken the liberty of writing an ebuild for this version as well. Since this ebuild may "supersede" the 4.0 ebuild (since neither are yet in Portage), I've decided to attach it here. It is based on the tested 4.0 version. However, several modifications/enhancements were necessary for this release: - Upstream has changed the name of the source code folder in the archive. The new ebuild has been adjusted to compensate. - Upstream has fixed the problem with the "build.sh" script that we were fixing previously with our "head" patch. However, since we don't currently use upstream's build.sh script, my only point in mentioning this is for those testing a raw compile on the raw archive (i.e., you don't have to patch it anymore). - The compile for the CLI tool(s) in this release breaks continuously with parallel MAKE's enabled. Therefore, the MAKEOPTS "j" override is used in this ebuild as well. ------------------- I've done fairly thorough testing on these packages. I've also tested the upgrade in Portage from 4.0 to 4.1. Everything appears to be working nicely/properly. Please test and let us know how things work for you. Thanks!
Created attachment 73631 [details, diff] truecrypt-4.1 Makefile patch The 4.1 release has the same Makefile problems that the 4.0 release had. This is an updated patch for this release (same thing, just slightly different offsets).
OK, I have finished my testing of TrueCrypt and the ebuilds for both versions (4.0 and 4.1). I have tested the building of the application against different amd64 machines. I have tested initial installations of each version, as well as upgrading from one to the other, and proper operation afterward. Finally, I have tested the ebuilds against the following kernels: gentoo-sources-2.6.13-gentoo-r5 gentoo-sources-2.6.14-gentoo-r2 Everything is a go as far as I'm concerned. I haven't heard back from anyone here since the last changes were committed. Anyone else have any thoughts/concerns? Otherwise, I'm formally requesting that one of the official Gentoo Dev's commit this to Portage as "~x86" and "~amd64". Furthermore, I'd be willing to take this on as the package maintainer if one of you devs would like to sponsor me into the club. ;-)
Tested on: - CFLAGS="-march=pentium2 -O2 -pipe -fomit-frame-pointer" - Linux lance 2.6.14-gentoo-r2-gentoo #1 PREEMPT Sat Dec 3 16:32:43 CET 2005 i686 Pentium II (Deschutes) GenuineIntel GNU/Linux Both versions (4.0 and 4.1) die with the same message: "modprobe truectypt" dies with insmod /lib/modules/2.6.14-gentoo-r2-gentoo/extra/truecrypt.ko FATAL: Error inserting truecrypt (/lib/modules/2.6.14-gentoo-r2-gentoo/extra/truecrypt.ko): Invalid module format
strace tells me this: init_module("ELF", 0x27446) = -1 ENOEXEC (Exec format error) GCC used: gcc --version gcc (GCC) 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
(In reply to comment #26) > Both versions (4.0 and 4.1) die with the same message: > "modprobe truectypt" dies with > insmod /lib/modules/2.6.14-gentoo-r2-gentoo/extra/truecrypt.ko > FATAL: Error inserting truecrypt > (/lib/modules/2.6.14-gentoo-r2-gentoo/extra/truecrypt.ko): Invalid module > format This is almost always a problem with the compiling environment on your machine. One cause could be your symlink for "/usr/src/linux" not pointing to the same kernel sources as the kernel version you're running currently. In other words, are you sure that in your case (according to the information you provided) that the following is true: - You have compiled TrueCrypt against kernel sources for 2.6.14-gentoo-r2 ? - (Put another way) That your symlink for "/usr/src/linux" is pointing to "/usr/src/linux-2.6.14-gentoo-r2" ? Finally, something looks wrong with your error message output. What is with that strange path in your /lib/modules directory? You list it as "/lib/modules/2.6.14-gentoo-r2-gentoo", but it should normally be something like "/lib/modules/2.6.14-gentoo-r2".
You seem to be right, there must be something wrong with my config, although everything looks fine: lance ~ # uname -a Linux lance 2.6.14-gentoo-r2-gentoo #1 PREEMPT Sat Dec 3 16:32:43 CET 2005 i686 Pentium II (Deschutes) GenuineIntel GNU/Linux lance ~ # ls -la /usr/src/ skupno 3 drwxr-xr-x 4 root root 176 dec 3 10:30 . drwxr-xr-x 20 root root 568 dec 5 01:56 .. -rw-r--r-- 1 root root 0 okt 7 21:50 .keep lrwxrwxrwx 1 root root 22 dec 3 10:30 linux -> linux-2.6.14-gentoo-r2 drwxr-xr-x 19 root root 1280 nov 20 16:49 linux-2.6.13-gentoo-r3 drwxr-xr-x 19 root root 1336 dec 24 11:51 linux-2.6.14-gentoo-r2 lance ~ # cat /usr/src/linux/.config | grep gentoo # Linux kernel version: 2.6.14-gentoo-r2 CONFIG_LOCALVERSION="-gentoo" Just for the fun of it, I reemerged "net-misc/ksb26" (which was working fine with 2.6.13-r3) and it seems to die with the same error.
(In reply to comment #29) > You seem to be right, there must be something wrong with my config, although > everything looks fine: ... > lance ~ # cat /usr/src/linux/.config | grep gentoo > # Linux kernel version: 2.6.14-gentoo-r2 > CONFIG_LOCALVERSION="-gentoo" Well, there's where your strange (extra) "-gentoo" flag came from on your module versions. You have CONFIG_LOCALVERSION set to "-gentoo", which appends that as a version onto the end of all of your kernel-specific items (modules, etc.). This shouldn't have any effect on your compiling problems, but you may want to remove it unless you really need it on there -- it will help alleviate confusion in the future. > Just for the fun of it, I reemerged "net-misc/ksb26" (which was working fine > with 2.6.13-r3) and it seems to die with the same error. OK, that helps. I recommend that you save your .config and unmerge/re-emerge the affected Gentoo-sources kernels, making sure to wipe the source directories before the re-emerge. This should ensure a clean rebuild and hopefully that will fix your problem(s). In any case, since we know now that this isn't related to the TrueCrypt ebuilds, you should probably continue your debugging outside of this bug (e.g., in the forums or IRC, perhaps). HTH
Successfully tested the 4.1 ebuild on ~x86 with gentoo-sources 2.6.15-r1 and gcc 3.4.5. Any other showstoppers or can this be moved to ~x86?
Hi, Can just confirm Comment #31. Thanks.Rumen
Succesfully tested on ~amd64 also (4.1).
(In reply to comment #33) > Succesfully tested on ~amd64 also (4.1). Thank you for testing and reporting back. @ Official Gentoo-Dev's: So far I haven't had one bad report about these packages. All users publicly and privately report that the ebuilds and TrueCrypt are working well. We're also getting pinged back in the forums on the status of this issue. Unfortunately, we haven't heard back from an official Dev and so this sits without resolution. I have already offered to help maintain this package in Portage. All we need is for it to be added. I have also offered to complete my Gentoo Dev submissions so that I can directly take ownership of this, if need be (I also work with the Java herd from time to time). Can you please give us some direction or thoughts on getting these added? Thanks!
What exactly is holding this up? There are people willing to maintain this package (including me), no bugs have been reported, etc. Can this finally be added to portage please?
(In reply to comment #35) > What exactly is holding this up? There are people willing to maintain this > package (including me), no bugs have been reported, etc. Can this finally be > added to portage please? I agree! It's kind of sad that BestCrypt, a commercial product, is in Portage but TrueCrypt is not. Make it ~x86 if you must, but let's get it in.
Hi, I am having an error using modprobe truecrypt Tested on CFLAGS="-march=k8 -pipe -O2" linux-2.6.15-gentoo-r5 the error on modprobe truecrypt is FATAL: Error inserting truecrypt (/lib/modules/2.6.15-gentoo-r5/extra/truecrypt.ko): Unknown symbol in module, or unknown parameter (see dmesg) the output from dmesg is truecrypt: Unknown symbol dm_put_device truecrypt: Unknown symbol dm_unregister_target truecrypt: Unknown symbol dm_register_target truecrypt: Unknown symbol dm_table_get_mode truecrypt: Unknown symbol dm_get_device any help would be appreciated. thanks Hozi
Hozi, It looks like you don't have device mapper support enabled in the kernel. Simply recompile with dm suppott, and the truecrypt should work fine. Ralf
would be happy when this gets included!
it doesn't compile here: In file included from include/asm/thread_info.h:17, from include/linux/thread_info.h:21, from include/linux/preempt.h:10, from include/linux/interrupt.h:9, from include/linux/rcuref.h:36, from include/linux/fs.h:12, from include/linux/highmem.h:5, from include/linux/bio.h:23, from /var/tmp/portage/truecrypt-4.0/work/truecrypt-4.0/Linux/Kernel/Dm-target.c:8: include/asm/processor.h:71: error: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function) include/asm/processor.h:71: error: requested alignment is not a constant (...) I have CONFIG_X86_L1_CACHE_SHIFT=7 in my .config
1. Is your kernel linked to /usr/src/linux 2. Was your kernel compiled beforehand? (If you upgraded, probably not) 3. Does this also happen with tc-4.1? 4. Could you give us your "emerge --info" output? Thanks, B
In case you didn't notice yet: TrueCrypt 4.2 has been released yesterday (17th april 2006) ! One of the new features is the ability to create volumes under Linux! This is great! Anybody prepared to update the ebuild?
(In reply to comment #41) > 1. Is your kernel linked to /usr/src/linux yes > 2. Was your kernel compiled beforehand? (If you upgraded, probably not) yes > 3. Does this also happen with tc-4.1? yes > 4. Could you give us your "emerge --info" output? no, because it works now :) i reemerged gentoo sources (make clean didn't help), maybe i modified something some days ago
Created attachment 84921 [details] Ebuild for TrueCrypt 4.2 New ebuild for TrueCrypt 4.2. Previously required patch has been removed, since it doesn't seem to be required anymore. To install: Download patch and store in portage overlay directory, e.g.: /var/local/portage/app-crypt/truecrypt/ Create digest: ebuild truecrypt-4.2.ebuild digest Emerge truecrypt: emerge -u truecrypt Please test.
Tested upgrading from 4.1 to 4.2 with the 4.2 ebuild, no problems here. Using 2.6.15-gentoo-r1, gcc-3.3.6
The truecrypt-4.2 ebuild is working for me. Tested app-crypt/truecrypt-4.2 for 2.6.16-gentoo-r2 on x86 with gcc 3.3.6. Tested app-crypt/truecrypt-4.2 for 2.6.11-gentoo-r11 on amd64 with gcc 3.4.5.
the ebuild works fine here gcc-4.1 and 2.6.16-gentoo-r1. Probably some checks about device mapper support should be included in the ebuild, as I've run onto this, resulting in unresolved symbols in the truecrypt module at first, but the dm wasn't enabled at all here. looking in the cryptsetup-luks ebuild it should be fairly easy to add these checks to the truecrypt ebuild, although I haven't tested which modules should be enabled, as I've enabled them all now along with the device mapper support :) this is what is to be found in cryptsetup-luks: dm-crypt_check() { ebegin "Checking for dm-crypt support" linux_chkconfig_present DM_CRYPT eend $? if [[ $? -ne 0 ]] ; then ewarn "cryptsetup requires dm-crypt support!" ewarn "Please enable dm-crypt support in your kernel config, found at:" ewarn "(for 2.6 kernels)" ewarn ewarn " Device Drivers" ewarn " Multi-Device Support" ewarn " Device mapper support" ewarn " [*] Crypt Target Support" ewarn ewarn "and recompile your kernel if you want this package to work with this kernel" epause 5 fi }
Created attachment 84932 [details] truecrypt-4.2-r1.ebuild Updated TrueCrypt 4.2 ebuild with checks for dm-crypt kernel support. Detection works fine on my system with dm-crypt support. Can someone maybe test this on a system without dm-crypt support to see if the check works properly?
2.6.17-rc1 - gcc 3.4.6 - centrino CC [M] /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.o /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c: In function `truecrypt_ctr': /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:164: error: `SECTOR_FORMAT' undeclared (first use in this function) /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:164: error: (Each undeclared identifier is reported only once /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:164: error: for each function it appears in.) /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c: In function `truecrypt_endio': /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:378: error: syntax error before "SECTOR_FORMAT" /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c: In function `truecrypt_map': /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:423: error: syntax error before "SECTOR_FORMAT" /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:550: error: syntax error before "SECTOR_FORMAT" /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c: In function `truecrypt_status': /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:572: error: syntax error before "SECTOR_FORMAT" make[2]: *** [/var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.o] Error 1 make[1]: *** [_module_/var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel] Error 2 make[1]: Leaving directory `/usr/src/linux-2.6.17-rc1' make: *** [truecrypt] Error 2 !!! ERROR: app-crypt/truecrypt-4.2-r1 failed. Call stack: ebuild.sh, line 1532: Called dyn_compile ebuild.sh, line 929: Called src_compile truecrypt-4.2-r1.ebuild, line 38: Called linux-mod_src_compile linux-mod.eclass, line 512: Called die !!! Unable to make KSRC=/usr/src/linux NO_WARNINGS=1 truecrypt. !!! If you need support, post the topmost build error, and the call stack if relevant. Did I forgot to do anything before emerge?
S
Sérgio, my guess is that it doesn't work with the 2.6.17-rc1 kernel sources. Works fine with 2.6.16 on my system.
Hmpf... with 2.6.16 and gcc 3.4.6 on my other system it works :(
works for me on x86 and AMD64. Please add as ~x86 to portage.
Workaround for the SECTOR_FORMAT error on 2.6.17-rc1 I just added #define SECTOR_FORMAT "%Lu" to /usr/src/linux/drivers/md/dm.h now it compiles and I can mount my crypted container. Don't know what will go wrong...
(In reply to comment #48) > ... > Updated TrueCrypt 4.2 ebuild with checks for dm-crypt kernel support. Detection > works fine on my system with dm-crypt support. This works well, except for one problem: TrueCrypt does NOT require "dm-crypt" support. It only requires "Device mapper support" (one level above) since it isn't actually creating a crypt-target. I just recompiled my kernel and confirmed this. I will upload a revision-bump for this package shortly (-r2). > > Can someone maybe test this on a system without dm-crypt support to see if the > check works properly? Done. The tests work perfectly on my systems (amd64). This build is looking good. Thanks for all of the help everyone. Now if we could only get an actual Gentoo DEV to add this to the tree... :-O
Created attachment 85429 [details] truecrypt-4.2-r2.ebuild Attached new ebuild with revision bump.
Comment on attachment 85429 [details] truecrypt-4.2-r2.ebuild Renamed the attachment description for simplicity
Hi all, I've tried to compile the truecrypt on a vanilla-2.6.17-rc4 but I get this error. I've wrote also a post on the TC forum http://forums.truecrypt.org/viewtopic.php?t=2776 ++++++++++++++++++++++++++++++++++++++++++ CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/../../Crypto/Ecb3_enc.o CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/../../Crypto/Serpent.o CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/../../Crypto/Set_key.o CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/../../Crypto/Twofish.o CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/../../Common/Crc.o CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/../../Common/Crypto.o CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/../../Common/Endian.o CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/../../Common/GfMul.o CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/../../Common/Tests.o CC [M] /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.o /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c: In function `truecrypt_ctr': /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:164: error: `SECTOR_FORMAT' undeclared (first use in this function) /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:164: error: (Each undeclared identifier is reported only once /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:164: error: for each function it appears in.) /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c: In function `truecrypt_endio': /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:378: error: syntax error before "SECTOR_FORMAT" /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c: In function `truecrypt_map': /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:423: error: syntax error before "SECTOR_FORMAT" /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:550: error: syntax error before "SECTOR_FORMAT" /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c: In function `truecrypt_status': /var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:572: error: syntax error before "SECTOR_FORMAT" make[2]: *** [/var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel/Dm-target.o] Error 1 make[1]: *** [_module_/var/tmp/portage/truecrypt-4.2-r2/work/truecrypt-4.2/Linux/Kernel] Error 2 make[1]: Leaving directory `/usr/src/linux-2.6.17-rc4-lsd1' make: *** [truecrypt] Error 2 !!! ERROR: sys-fs/truecrypt-4.2-r2 failed. Call stack: ebuild.sh, line 1527: Called dyn_compile ebuild.sh, line 930: Called src_compile truecrypt-4.2-r2.ebuild, line 38: Called linux-mod_src_compile linux-mod.eclass, line 515: Called die !!! Unable to make KSRC=/usr/src/linux NO_WARNINGS=1 truecrypt. !!! If you need support, post the topmost build error, and the call stack if relevant. ++++++++++++++++++++++++++++++++++++++++++
(In reply to comment #57) Look what I had done to compile it... I really don't know if this can break things but I had no problems so far... http://bugs.gentoo.org/show_bug.cgi?id=112197#c53
(In reply to comment #49) > 2.6.17-rc1 - gcc 3.4.6 - centrino > > CC [M] > /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.o > /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c: > In function `truecrypt_ctr': > /var/tmp/portage/truecrypt-4.2-r1/work/truecrypt-4.2/Linux/Kernel/Dm-target.c:164: > error: `SECTOR_FORMAT' undeclared (first use in this function) # fgrep -r SECTOR_FORMAT /usr/include/linux/ # fgrep -r SECTOR_FORMAT /usr/src/linux /usr/src/linux-2.6.16-gentoo-r7/drivers/md/dm.h:#define SECTOR_FORMAT "%llu" /usr/src/linux-2.6.16-gentoo-r7/drivers/md/dm.h:#define SECTOR_FORMAT "%lu" # emerge info virtual/os-headers: 2.6.11-r5 Looks like the kernel headers isn't sufficient on your machine or the include path needs to be altered.
(In reply to comment #59) > > # fgrep -r SECTOR_FORMAT /usr/include/linux/ > # fgrep -r SECTOR_FORMAT /usr/src/linux > /usr/src/linux-2.6.16-gentoo-r7/drivers/md/dm.h:#define SECTOR_FORMAT "%llu" > /usr/src/linux-2.6.16-gentoo-r7/drivers/md/dm.h:#define SECTOR_FORMAT "%lu" > > # emerge info > virtual/os-headers: 2.6.11-r5 I have the same kernel headers but your kernel is 2.6.16 - I have 2.6.17... with my other system (running on 2.6.16) I had no problems. But with 2.6.17 these two defines are gone (at least from my kernel sources) So I simply put them back...
I have added the 2 rows as sugested and it seems to compile... hope it does not break anythig # grep -R SECTOR_FORMAT /usr/src/linux/* /usr/src/linux/drivers/md/dm.h:#define SECTOR_FORMAT "%lu" /usr/src/linux/drivers/md/dm.h:#define SECTOR_FORMAT "%llu"
Can someone insert a check/info that the following has to be enabled?: Device Drivers ---> Multi-device support (RAID and LVM) ---> [*] Multiple devices driver support (RAID and LVM) < > RAID support <M> Device mapper support <M> Crypt target support Device Drivers ---> Block devices ---> <M> Loopback device support
> <M> Crypt target support You don't need crypt target - truecrypt does the whole crypt stuff ;)
(In reply to comment #62) > Can someone insert a check/info that the following has to be enabled?: > > Device Drivers ---> ... This has already been completed. Please see comments #47, #48, and #54 for more info. Also, please ensure you are using the newest version of the ebuild above: truecrypt-4.2-r2.ebuild
if someone could obsolete the old version that would be great. I'll try to look next week.
Comment on attachment 73628 [details] TrueCrypt-4.0 ebuild Marking this build obsolete as per suggestion.
Comment on attachment 73630 [details] TrueCrypt-4.1 ebuild Marking obsolete per suggestion
Comment on attachment 73478 [details, diff] Patch to fix Makefile platform check issue Marking obsolete
Comment on attachment 73631 [details, diff] truecrypt-4.1 Makefile patch Marking obsolete
thanks all. esp Greg for the good ebuild (that I hacked more than I really needed too). Thanks everyone else for your patience and assistance in making this right. AMD64 people please check the ebuild that is correct. If so please lodge a bug assigned to crypto@gentoo.org with amd64@gentoo.org cced and request a keyword. Please report any bugs/improvements.
(In reply to comment #70) > thanks all. esp Greg for the good ebuild (that I hacked more than I really > needed too). Thanks everyone else for your patience and assistance in making > this right. Thanks very much Daniel for picking this up and getting it into Portage mainline. We all appreciate it! My thanks to Alexander for contributing the original ebuild snippet and getting this started. > AMD64 people please check the ebuild that is correct. If so please lodge a bug > assigned to crypto@gentoo.org with amd64@gentoo.org cced and request a keyword. I've done some rudimentary testing on amd64 and all is well. I'll submit a bug/request as suggested. Thanks again!