Bug 140387 - TrueCrypt does not work with 2.6.18-rc1, fix included
Bug#: 140387 Product:  Gentoo Linux Version: 2006.0 Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: crypto@gentoo.org Reported By: jva-misc@cute.se
Component: Ebuilds
URL:  http://www.truecrypt.org
Summary: TrueCrypt does not work with 2.6.18-rc1, fix included
Keywords:  
Status Whiteboard: 
Opened: 2006-07-14 10:14 0000
Description:   Opened: 2006-07-14 10:14 0000
TrueCrypt 4.2a do not support the 2.6.18-rc1 and possible newer versions of the
Linux kernel. The problem exists because the kernel developers has changed
"drivers/md/dm.h" in the Linux source code.

They have changed DMERR. In older kernels DMERR looked like this:

#define DMERR(f, x...) printk(KERN_ERR DM_NAME ": " f "\n" , ## x)

but has now been changed to:

#define DMERR(f, arg...) printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f
"\n", ## arg)

What needs to be done in the TrueCrypt source to make it work with 2.6.18 is to
simply add:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
#define DM_MSG_PREFIX "truecrypt"
#endif

to the top of "Linux/Kernel/Dm-target.c" in the TrueCrypt source code.

DM_MSG_PREFIX is used to tell from where the DMERR occured. In this case:
truecrypt

I've made a patch for TrueCrypt 4.2a, it's available here:
http://jdz.cute.se/patches/truecrypt-4.2a_kernel-2.6.18-rc1_fix.patch

------- Comment #1 From Daniel Black 2006-07-15 00:19:31 0000 -------
added patch to TrueCrypt 4.2a thanks for the patch.