truecrypt: Fixed compilation with Linux 2.6.34

This commit is contained in:
Alan Mizrahi 2010-05-18 00:25:42 +09:00
parent 73fce35a4c
commit 94b17a30ae
5 changed files with 222 additions and 5 deletions

View File

@ -1,4 +1,6 @@
144cb38da950e8970c38df2d460543fd truecrypt-4.3a-2.6.23.patch
5fd25dfacea831a526f793c8d78cc24e truecrypt-4.3a-2.6.24.patch
1aaccb83503e0bbcf0f01b181b20fe7e truecrypt-4.3a-2.6.29.patch
a22a76f9b38b05ffe3e827bde2c953c5 truecrypt-4.3a.tar.bz2
1aaccb83503e0bbcf0f01b181b20fe7e truecrypt-kernel-2.6.29.patch
8d7ea2b32e09c4af38681cf3ca19490b truecrypt-kernel-2.6.34.patch
8294190bb83500e3230284b3f2256e77 truecrypt-nochecks.patch

View File

@ -6,14 +6,20 @@
name=truecrypt
version=4.3a
release=2
source=(http://www.mizrahi.com.ve/crux/dist/$name-$version.tar.bz2 truecrypt-4.3a-2.6.23.patch truecrypt-4.3a-2.6.24.patch truecrypt-4.3a-2.6.29.patch)
release=3
source=(http://www.mizrahi.com.ve/crux/dist/$name-$version.tar.bz2 truecrypt-4.3a-2.6.23.patch truecrypt-4.3a-2.6.24.patch truecrypt-kernel-2.6.29.patch truecrypt-kernel-2.6.34.patch truecrypt-nochecks.patch)
# Note: Currently doesn't build as non-root
build () {
cd $name-$version/Linux
cd $name-$version
patch -p1 -i $SRC/truecrypt-kernel-2.6.34.patch
cd Linux
patch -p2 -i $SRC/truecrypt-4.3a-2.6.23.patch
patch -p2 -i $SRC/truecrypt-4.3a-2.6.24.patch
patch -p2 -i $SRC/truecrypt-4.3a-2.6.29.patch
patch -p2 -i $SRC/truecrypt-kernel-2.6.29.patch
patch -p2 -i $SRC/truecrypt-nochecks.patch
./build.sh
install -m 755 -D Cli/truecrypt $PKG/usr/bin/truecrypt

View File

@ -0,0 +1,50 @@
--- truecrypt-4.3a/Linux/Kernel/Dm-target.c.orig 2010-05-17 23:21:41.550280774 +0900
+++ truecrypt-4.3a/Linux/Kernel/Dm-target.c 2010-05-17 23:22:15.086944158 +0900
@@ -210,7 +210,7 @@
}
tc->start = sector;
- if (dm_get_device (ti, argv[TC_ARG_DEV], tc->start, ti->len, dm_table_get_mode (ti->table), &tc->dev))
+ if (dm_get_device (ti, argv[TC_ARG_DEV], dm_table_get_mode (ti->table), &tc->dev))
{
ti->error = "truecrypt: Device lookup failed";
goto err;
--- truecrypt-4.3a/Common/GfMul.c.orig 2010-05-18 00:15:32.303291101 +0900
+++ truecrypt-4.3a/Common/GfMul.c 2010-05-18 00:17:18.773280384 +0900
@@ -53,6 +53,7 @@
#ifdef LINUX_DRIVER
#include <linux/module.h>
#include <linux/string.h>
+#include <linux/slab.h>
#else
#include <memory.h>
#endif
--- truecrypt-4.3a/Common/Crypto.c.orig 2010-05-18 00:12:47.460807274 +0900
+++ truecrypt-4.3a/Common/Crypto.c 2010-05-18 00:17:33.216612793 +0900
@@ -16,6 +16,7 @@
#ifdef LINUX_DRIVER
#include <linux/module.h>
#include <linux/string.h>
+#include <linux/slab.h>
#else
#include <string.h>
#endif
--- truecrypt-4.3a/Linux/Kernel/Dm-target.c.orig 2010-05-18 00:16:32.969951706 +0900
+++ truecrypt-4.3a/Linux/Kernel/Dm-target.c 2010-05-18 00:17:02.470782111 +0900
@@ -6,6 +6,8 @@
distribution packages.
*/
+#include <linux/slab.h>
+
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/ctype.h>
@@ -16,7 +18,6 @@
#include <linux/moduleparam.h>
#include <linux/version.h>
#include <linux/workqueue.h>
-#include <dm.h>
#include "Tcdefs.h"
#include "Crypto.h"

View File

@ -0,0 +1,159 @@
--- truecrypt-4.3a/Linux/build.sh.orig 2010-05-17 23:18:38.256965720 +0900
+++ truecrypt-4.3a/Linux/build.sh 2010-05-17 23:19:47.604458859 +0900
@@ -11,154 +11,9 @@
KERNEL_BUILD=/lib/modules/$KERNEL_VER/build
KERNEL_SRC=/lib/modules/$KERNEL_VER/source
-TMP=.build.sh.tmp
-umask 022
-
-error ()
-{
- echo "Error: $*" >&2
-}
-
-check_kernel_version ()
-{
- M="$1/Makefile"
- [ ! -f "$M" ] && return 1
-
- VER=$(grep '^VERSION *=' "$M" | head -n 1 | tr -d ' ' | cut -d'=' -f2)
- VER=$VER.$(grep '^PATCHLEVEL *=' "$M" | head -n 1 | tr -d ' ' | cut -d'=' -f2)
- VER=$VER.$(grep '^SUBLEVEL *=' "$M" | head -n 1 | tr -d ' ' | cut -d'=' -f2)
-
- [ $VER = $(echo $KERNEL_VER | cut -d- -f1 | cut -d. -f1-3) ] && return 0
- return 1
-}
-
-# Prerequisites
-
-echo "Checking build requirements..."
-
-[ $(id -u) -ne 0 ] && error "Administrator (root) privileges required for kernel source configuration." && exit 1
-
-V=""
-case "$KERNEL_VER" in
- [01].*) V=1 ;;
- 2.[0-5].*) V=1 ;;
- 2.6.[0-4]) V=1 ;;
- 2.6.[0-4][.-]*) V=1 ;;
-esac
-[ "$V" ] && error "TrueCrypt requires Linux kernel 2.6.5 or later" && exit 1
-
-check_kernel_version "$KERNEL_SRC" || KERNEL_SRC=/usr/src/linux-$KERNEL_VER
-check_kernel_version "$KERNEL_SRC" || KERNEL_SRC=/usr/src/linux-source-$KERNEL_VER
-check_kernel_version "$KERNEL_SRC" || KERNEL_SRC=/usr/src/kernels/$KERNEL_VER-$(uname -p)
-check_kernel_version "$KERNEL_SRC" || KERNEL_SRC=/usr/src/linux-$(echo $KERNEL_VER | cut -d'-' -f1)
-check_kernel_version "$KERNEL_SRC" || KERNEL_SRC=/usr/src/linux-source-$(echo $KERNEL_VER | cut -d'-' -f1)
-check_kernel_version "$KERNEL_SRC" || KERNEL_SRC=/usr/src/linux
-
-if ! check_kernel_version "$KERNEL_SRC"
-then
- echo -n "Linux kernel ($KERNEL_VER) source directory [$KERNEL_SRC]: "
- read A
- [ "$A" ] && KERNEL_SRC="$A"
- [ ! -d "$KERNEL_SRC" ] && error "$KERNEL_SRC does not exit" && exit 1
-fi
-
-if ! check_kernel_version "$KERNEL_SRC"
-then
- error "Kernel source version in $KERNEL_SRC is not $KERNEL_VER"
- exit 1
-fi
-
-if [ ! -f "$KERNEL_SRC/drivers/md/dm.h" ]
-then
- error "Kernel source code is incomplete - $KERNEL_SRC/drivers/md/dm.h not found."
- exit 1
-fi
-
-if [ ! -d "$KERNEL_BUILD/include/asm/" -o ! -f "$KERNEL_BUILD/Module.symvers" -o ! -f "$KERNEL_BUILD/.config" ]
-then
- if [ ! -f "$KERNEL_SRC/.config" ]
- then
- if [ -f /proc/config.gz -o -f /boot/config-$KERNEL_VER -o -f /boot/config-$(uname -r) ]
- then
- echo -n "Configure kernel source according to the system configuration? [Y/n]: "
- read A
- if [ -z "$A" -o "$A" = "y" -o "$A" = "Y" ]
- then
- echo -n "Configuring kernel source in $KERNEL_SRC... "
-
- if [ -f /proc/config.gz ]
- then
- zcat /proc/config.gz >$KERNEL_SRC/.config || exit 1
- else
- if [ -f /boot/config-$(uname -r) ]
- then
- cp /boot/config-$(uname -r) $KERNEL_SRC/.config || exit 1
- else
- cp /boot/config-$KERNEL_VER $KERNEL_SRC/.config || exit 1
- fi
- fi
-
- make -C $KERNEL_SRC oldconfig </dev/null >/dev/null || exit 1
- echo Done.
- fi
- fi
-
- if [ ! -f "$KERNEL_SRC/.config" ]
- then
- error "Kernel not configured. You should run make -C $KERNEL_SRC config"
- exit 1
- fi
- fi
-
- if [ ! -d "$KERNEL_SRC/include/asm" ] && grep -q modules_prepare $KERNEL_SRC/Makefile
- then
- echo -n "Preparing kernel build system in $KERNEL_SRC... "
- if ! make -C $KERNEL_SRC modules_prepare >/dev/null 2>$TMP
- then
- cat $TMP; rm $TMP
- exit 1
- fi
- rm $TMP
- echo Done.
- fi
-
-
- if [ ! -d "$KERNEL_SRC/include/asm" -o ! -f "$KERNEL_SRC/Module.symvers" ]
- then
- echo -n "Building internal kernel modules (may take a long time)... "
- if ! make -C $KERNEL_SRC modules >/dev/null 2>$TMP
- then
- cat $TMP; rm $TMP
- exit 1
- fi
- rm $TMP
- echo Done.
- fi
-
- if [ ! -d "$KERNEL_SRC/include/asm" ]
- then
- error "Kernel source code is not prepared for building of modules - $KERNEL_SRC/include/asm not found."
- exit 1
- fi
-
- KERNEL_BUILD=$KERNEL_SRC
-fi
-
-if [ -f $KERNEL_BUILD/.config ]
-then
- grep -qi 'CONFIG_BLK_DEV_DM=[YM]' $KERNEL_BUILD/.config || echo "Warning: kernel device mapper support (CONFIG_BLK_DEV_DM) is disabled in $KERNEL_SRC"
-fi
-
# Build
echo -n "Building kernel module... "
-cd Kernel && make "KERNEL_SRC=$KERNEL_SRC" "KERNEL_BUILD=$KERNEL_BUILD" NO_WARNINGS=1 >/dev/null
-[ $? -ne 0 ] && error "Failed to build kernel module" && exit 1
-echo Done.
-
-echo -n "Building truecrypt... "
-cd ../Cli && make NO_WARNINGS=1 >/dev/null
-[ $? -ne 0 ] && error "Failed to build truecrypt" && exit 1
-echo Done.
+cd Kernel && make "KERNEL_SRC=$KERNEL_SRC" "KERNEL_BUILD=$KERNEL_BUILD" NO_WARNINGS=1 && \
+cd ../Cli && make NO_WARNINGS=1
-exit 0