Hi! I’m trying to configure my Nvidia Nano developer kit 4GB to use “veritysetup open”
first issue with veritysetup open
was related to DM_VERITY
module not enabled in a kernel.
I followed existing topic ( DM-Verity support on Jetson Nano 4GB (B02) - Jetson & Embedded Systems / Jetson Nano - NVIDIA Developer Forums), and added following options to “public/kernel/kernel-4.9/arch/arm64/configs/tegra_defconfig” before compiling the kernel:
CONFIG_DM_VERITY=y # Enable DM-Verity
CONFIG_DM_VERITY_HASH_PREFETCH_MIN_SIZE_128=y # DM-Verity hash prefetch optimization
btw final .config
file didn’t contain “CONFIG_DM_VERITY_HASH_PREFETCH_MIN_SIZE_128” param
after flashing veritysetup open
command started to recognize DM_VERITY, but still failed with error:
Verity device detected corruption after activation
Error happens on any veritysetup open
data, as a test I also tried code from a topic I mentioned:
Create data image
dd if=/dev/zero of=~/tmp/data_partition.img bs=4k count=256
mkfs.ext4 ~/tmp/data_partition.img
tune2fs -c0 -i0 ~/tmp/data_partition.img
Create a text file for testing
sudo mount -o loop data_partition.img /mnt/
cd /mnt/
sudo touch hello.txt
cd ~/tmp/
sudo umount /mnt
Create image for hashes
dd if=/dev/zero of=~/tmp/hash_partition.img bs=4k count=256
mkfs.ext4 ~/tmp/hash_partition.img
tune2fs -c0 -i0 ~/tmp/hash_partition.img
Setting up dm-verity
veritysetup -v --debug format data_partition.img hash_partition.img
sudo veritysetup open data_partition.img verity-test hash_partition.img [hashcode]
I also tried compiling different versions of veritysetup
, extended logs, but corrupted
status basically comes from dm, didn’t find anything specific that I can change in veritysetup
to make it work.
Not sure if it helps, but I also tried running veritysetup
in a privilleged docker container, and from here veritysetup open
worked without errors, but further execution of veritysetup status
command returned status corrupted
afterwards.
I also tried to enablefec
and to run veritysetup open
with --fec-device
flag, but in this case command just hangs in an endless attempt to fix corrupted data. dmesg
logs:
[ +0,000002] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[ +0,016200] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[ +0,011909] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[ +0,011980] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[ +0,010901] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[ +0,011534] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[ +0,011458] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[ +0,011574] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[ +0,011519] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[ +0,011161] device-mapper: verity-fec: 7:2: FEC: recursion too deep
[лис12 14:17] verity_fec_decode: 1516 callbacks suppressed
Perhaps I need to enable some other modules in a kernel?
Appreciate any suggestions
Thanks!