Hi,
> I am trying to get filesystem encryption with cryptsetup-luks to run on a
> Gentoo Linux system on a Linksys NSLU2 (Intel ARM CPU).
I tried this with debian, too.
During this, I had a problem with cryptsetup-luks (luksOpen hangs forever).
According to Markus Engel <engel_markus@xxxxxxxxxxx>, this can be solved with
the attached patch (it removes the O_DIRECT flag from every open call).
I was not able to test it, yet. Maybe you could report, if it helps (of
course, only in case, it does not work out of the box).
regards,
Lars
diff -ur cryptsetup-luks-1.0.3.orig/luks/keyencryption.c cryptsetup-luks-1.0.3/luks/keyencryption.c
--- cryptsetup-luks-1.0.3.orig/luks/keyencryption.c 2006-03-30 14:25:12.000000000 +0200
+++ cryptsetup-luks-1.0.3/luks/keyencryption.c 2006-05-29 15:19:32.000000000 +0200
@@ -122,7 +122,7 @@
goto out1;
}
- devfd = open(fullpath, mode | O_DIRECT | O_SYNC);
+ devfd = open(fullpath, mode | O_SYNC);
if(devfd == -1) { r = -EIO; goto out2; }
r = func(devfd,src,srcLength);
diff -ur cryptsetup-luks-1.0.3.orig/luks/keymanage.c cryptsetup-luks-1.0.3/luks/keymanage.c
--- cryptsetup-luks-1.0.3.orig/luks/keymanage.c 2006-04-02 10:36:11.000000000 +0200
+++ cryptsetup-luks-1.0.3/luks/keymanage.c 2006-05-29 15:21:09.000000000 +0200
@@ -50,10 +50,12 @@
static inline void convert_V99toV991(char const *device, struct luks_phdr *hdr) {
struct luks_phdr tmp_phdr;
- fputs(_("automatic header conversion from 0.99 to 0.991 triggered"), stderr);
- hdr->mkDigestIterations = ntohs(htonl(hdr->mkDigestIterations));
+ fputs(_("automatic header conversion from 0.99 to 0.991 triggered\n"), stderr);
+ /*hdr->mkDigestIterations = ntohs(htonl(hdr->mkDigestIterations));
memcpy(&tmp_phdr, hdr, sizeof(struct luks_phdr));
- LUKS_write_phdr(device, &tmp_phdr);
+ LUKS_write_phdr(device, &tmp_phdr);*/
+ fputs(_("This should not happen in any version, quitting\n"), stderr);
+ exit(-1);
}
int LUKS_read_phdr(const char *device, struct luks_phdr *hdr)
@@ -63,7 +65,7 @@
int r = 0;
char luksMagic[] = LUKS_MAGIC;
- devfd = open(device,O_RDONLY | O_DIRECT | O_SYNC);
+ devfd = open(device,O_RDONLY | O_SYNC);
if(-1 == devfd) {
fprintf(stderr, _("Can't open device: %s\n"), device);
return -EINVAL;
@@ -112,7 +114,7 @@
struct luks_phdr convHdr;
int r;
- devfd = open(device,O_RDWR | O_DIRECT | O_SYNC);
+ devfd = open(device,O_RDWR | O_SYNC);
if(-1 == devfd) {
fprintf(stderr, _("Can't open device: %s\n"), device);
return -EINVAL;
@@ -375,7 +377,7 @@
unsigned int bufLen = (to - from) * SECTOR_SIZE;
int r = 0;
- devfd = open(device, O_RDWR | O_DIRECT);
+ devfd = open(device, O_RDWR);
if(devfd == -1) {
fprintf(stderr, _("Can't open device: %s\n"), device);
return -EINVAL;
---------------------------------------------------------------------
- http://www.saout.de/misc/dm-crypt/
To unsubscribe, e-mail: dm-crypt-unsubscribe@xxxxxxxx
For additional commands, e-mail: dm-crypt-help@xxxxxxxx