Hi everyone,
I have been trying to do full disk encryption on iMX6 Quad eMMC (the version I use is EmbeddedArtists imx6qea COM on their carrier board)
What I have done is:
INITRAMFS_IMAGE = "core-image-minimal"
INITRAMFS_IMAGE_BUNDLE = "1"
IMAGE_FSTYPES = "cpio.gz tar.bz2"
<!-- the passphrase is in the file : "mfgtools_imx6q_4.9.123\Profiles\Linux\OS Firmware\firmware\keyfile" -->
<CMD state="Updater" type="push" body="send" file="firmware/keyfile" >Sending key file</CMD>
<CMD state="Updater" type="push" body="$ cat $FILE | cryptsetup luksFormat /dev/mmcblk%mmc%p2 -">Encrypting and Formatting rootfs partition</CMD>
<CMD state="Updater" type="push" body="$ cryptsetup luksOpen --key-file=$FILE /dev/mmcblk%mmc%p2 mmcblk%mmc%p2">Encrypting and Formatting rootfs partition</CMD>
<CMD state="Updater" type="push" body="$ mkfs.ext3 -E nodiscard /dev/mapper/mmcblk%mmc%p2">Encrypting and Formatting rootfs partition</CMD>
<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p2"/>
<CMD state="Updater" type="push" body="$ mount -t ext3 /dev/mapper/mmcblk%mmc%p2 /mnt/mmcblk%mmc%p2"/>
<CMD state="Updater" type="push" body="pipe tar -jxv -C /mnt/mmcblk%mmc%p2" file="files/%rootfs%-%board%.rootfs.tar.bz2">Sending and writting rootfs</CMD>
<CMD state="Updater" type="push" body="frf">Finishing rootfs write</CMD>
By doing the above steps, I was able to encrypt the rootfs using cryptsetup. After the boot into initramfs, I successfully decrypted and mounted the rootfs partition with passphrase I provided using mfgtools
$ cryptsetup --debug -v luksOpen /dev/mmcblk3p2 rootfs
$ mkdir /mnt/rootfs && mount -t ext3 /dev/mapper/rootfs /mnt/rootfs
What I was not able to do is to auto mount the encrypted rootfs instead of the kernel's attached initramfs rootfs .
Thanks
Dear f.alghamdi@ntis.com.sa,
The document "Root filesystem encryption using DM-Crypt" provides detailed steps to make a transperently encrypted Root filesystem using DM-Crypt.
The target is ARM64 you can adapt for your need (Install ARM32 toolchain and compile for ARM target instead).
If this is exactlly what you are looking for, please mark the reply as "Correct Answer" to help other users to quickly identify and access it.
Regards
Maro
Dear @marouene_boubakri,
how can I get access to the document "Root filesystem encryption using DM-Crypt"?
Hi @10sec,
Kindly refer to the Application Note AN12714 i.MX Encrypted Storage Using CAAM Secure Keys Downloadable from nxp.com portale and can be found in the documentation tab of the chip/board's home page.
Regards
Maro
Not able to access the document - The document "Root filesystem encryption using DM-Crypt"
Hello,
Please create request to get more information about disk encryption,
using CAAM-accelerated dm-crypt.
Have a great day,
Yuri
------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer
button. Thank you!
Dear @Yuri and @marouene_boubakri ,
Could you confirm if the document in the"Root filesystem encryption using DM-Crypt" is the same as https://www.nxp.com/docs/en/application-note/AN12714.pdf ?