LUKS on Cubox (imx6 platform)
Now I have a Cubox (i2ex), I wanted to encrypt my backup disks. I followed this excellent tutorial. The cipher recommendation is aes-xts-plain64. So, I created formated disk, encrypt it, copy data from my computer and connect it to the Cubox.
But, I get this error :
cryptsetup --type luks open /dev/sda1 backup
Enter passphrase for /dev/sda1:
No key available with this passphrase.
I tried a couple of times, use a keyfile. Nothing worked !! It made me crazy. After a bunch of search, I found that the current kernel in the Debian image from Igor Pečovnik is 3.14.14 and has issues with NEON AES implementation.
I cannot blacklist the module as it's builtin. The solution is to build a new module from the latest 3.14.49 kernel (maintained by Greg Kroah-Hartman). Ouf ! I increased cra_priority to be sure to use the new implementation.
Instructions
In the Cubox :
- Install kernel headers (already here in the image)
- Download the latest 3.14 kernel from kernel.org
- Decompress it
- Apply this patch
- Compile
- Install
- Reboot
Commands :
patch -p1 < crypto.patch
cd linux-3.14.49/arch/arm/crypto/
make
sudo make install
sudo echo aes-arm-bs >> /etc/modules
reboot
If you just want to test :
insmod aes-arm-bs.ko
Precompiled version
A precompiled version is available here. To manually install it :
sudo cp aes-arm-bs.ko /lib/modules/3.14.14-cubox-i/extra/
sudo depmod
sudo echo aes-arm-bs >> /etc/modules
Or just
sudo make install
sudo echo aes-arm-bs >> /etc/modules