This little tool will track ioctl calls from any program linked against. As
it knows only about the LOOP_SET_STATUS(64) calls, it's only useful to track
losetup. losetup has a long history of being patched in many weird ways, so
this is my attempt to shortcut the migration hassle.

How it works:

$ make
$ export LD_PRELOAD=./lotrack.so
$ losetup <your regular parameters>

It will output stuff like this:

ghanima:/home/clemens/losetup-tracker# hashalot sha256 | ~root/util-linux-2.12/mount/losetup -e aes /dev/loop/4 /dev/hda-narf
Enter passphrase:
Notice: Key Length is 256 bit
lo-tracker: unknown ioctl call with request 4c00
keysize 32, key:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08

Don't worry about my non standard way of calling losetup, your way will
look different, however losetup should correctly output the key used
finally regardless of the password preprocessing. You can now feed 
the key to dmsetup to migrate to dm-crypt.

A loop-aes patched losetup is not supported, since loop-aes uses different
ioctl calls for key setup and further uses an IV calculation which is
currently not support by dm-crypt.

--
Clemens Fruhwirth <clemens@endorphin.org>
