Hmm ..., ini sambungan dari yg kemarin ... :

---- email kmrn ----
'm trying to port cryptsetup to avr32 arch.
There are several issues i found when trying to porting cryptsetup to
the avr32 platform.

I think, it's usefull to show you where the issue is.
The following is the command  i use to test cryptsetup on avr32 arch
(i'm using NGW100 board …)

bash-3.2#dd if=/dev/urandom of=/home/secret bs=1M count=20
bash-3.2#losetup /dev/loop0 rahasia
bash-3.2# cryptsetup -y –cipher plain luksFormat /dev/loop0

WARNING!
========
This will overwrite data on /dev/loop0 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase:
Verify passphrase:
device-mapper: table: 254:0: zero-length target
Failed to setup dm-crypt key mapping.
Check kernel for support for the plain-cbc-plain cipher spec and
verify that /dev/loop0 contains at least 133 sectors.
Failed to write to key storage.
Command failed.bash-3.2#

it's said that cryptsetup cannot read the sector length of the target ..

But, when i check it with the fdisk utility, it can read the sector
length of the target :

Command failed.bash-3.2# fdisk /dev/loop0
Device contains neither a valid DOS partition table, nor Sun, SGI or
OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.

Warning: invalid flag 0×00,0×00 of partition table 4 will be corrected
by w(rite)

Command (m for help): p

Disk /dev/loop0: 20 MB, 20971520 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System

Command (m for help):

For you information, compile e2fsprogs without enabling devmapper
support (without using –enable-blkid-devmapper  options), it's the
root cause of problems ?

Besides that, there are differences in shared libraries used by
cryptsetup on my ubuntu box vs on my NGW100 board .., here is the
differences :

On Ubuntu :
==========
$ ldd /sbin/cryptsetup
linux-gate.so.1 =>  (0xffffe000)
libpopt.so.0 => /lib/libpopt.so.0 (0xb7f13000)
libdevmapper.so.1.02 => /lib/libdevmapper.so.1.02 (0xb7f01000)
libuuid.so.1 => /lib/libuuid.so.1 (0xb7efd000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7dbc000)
/lib/ld-linux.so.2 (0xb7f2b000)

On NGW100 (AVR32) :
===================
bash-3.2# ldd /usr/sbin/cryptsetup
libpopt.so.0 => /usr/lib/libpopt.so.0 (0×2aab3000)
libcryptsetup.so.0 => /usr/lib/libcryptsetup.so.0 (0×2aab9000)
libdevmapper.so.1.02 => /usr/lib/libdevmapper.so.1.02 (0×2aac3000)
libc.so.0 => /lib/libc.so.0 (0×2aad0000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0×2aaab000)

Ok .., now to the source code, after reading, the crytpsetup source
code (i'm using the older version cryptsetup-luks-1.0.3, when using
1.0.5 i encounter the same problem ..) :

There is one function which i cannot found where it's declared .. (as
I already mention , i'm a C newbie .. ^_^), the function is : job(arg,
backend, options);

Which is located in cryptsetup-luks-1.0.3/lib/setup.c  file, you can
see it at crypt_job() function ..

That's for now, I hope with this information You can give me a hint
why cryptsetup failed when i'm trying to porting it to the AVR32 arch
..

ioctl problem itu potongan hasil strace output ...


Semoga membantu ....

--cut ---

On 9/10/07, Ronny Haryanto <[EMAIL PROTECTED]> wrote:
> On 10/09/2007, W <[EMAIL PROTECTED]> wrote:
> > brk(0x17000)                            = 0x17000
> > ioctl(2147483647, TCGETS, 0x7fe1e6e8)   = -1 EBADF (Bad file descriptor)
> > brk(0x18000)                            = 0x18000
> > ioctl(2147483647, TCGETS, 0x7fe1e6e4)   = -1 EBADF (Bad file descriptor)
> > brk(0x19000)                            = 0x19000
> > ioctl(2147483647, TCGETS, 0x7fe1e6e4)   = -1 EBADF (Bad file descriptor)
> > brk(0x1a000)                            = 0x1a000
> > open("/dev/mmcblk0p2", O_RDONLY|O_LARGEFILE) = 4
> > ioctl(4, BLKSSZGET, 0)                  = -1 EFAULT (Bad address)
> > close(4)                                = 0
> >
> > Ada yang tau kalau seperti diatas kira2 salahnya dmn ?
>
> Tanpa konteks, jauh lebih sulit membantu. Biasanya ada lebih dari satu
> hal yg bisa menuju ke satu kondisi, jadi tidak selalu dengan diketahui
> satu kondisi (error ioctl seperti di atas misalnya) bisa langsung
> tau/dipastikan penyebabnya apa.
>
> Untuk mempermudah, anda harusnya memberikan informasi yg lebih dari
> itu. Letakkanlah informasi di atas itu ke dalam konteksnya.
> Ceritainlah, anda itu lagi ngapain, mau ngapain, dan ketemu problem
> itu pas gimana, dst. yg jelas supaya kita ngerti, atau minimal supaya
> kita nggak ngawur dalam menjawab.
>
> Ronny
>
> --
> FAQ milis di http://wiki.linux.or.id/FAQ_milis_tanya-jawab
> Unsubscribe: kirim email ke [EMAIL PROTECTED]
> Arsip dan info milis selengkapnya di http://linux.or.id/milis
>
>


-- 
---
Person who say it cannot be done should not interrupt person doing it.
Coz.....
Miracles are closer than you think ...
------------
http://wildanm.fisika.ui.edu
HP: 08888378594
Y! : hawking_123

--
FAQ milis di http://wiki.linux.or.id/FAQ_milis_tanya-jawab
Unsubscribe: kirim email ke [EMAIL PROTECTED]
Arsip dan info milis selengkapnya di http://linux.or.id/milis

Kirim email ke