The rootfs must not be mounted to apply the dm-verity.
(The limitation of dm-verity)
In the init-wrapper, rootfs is already mounted.
So in the init-wrapper, you must not check the dm-verity.
Change-Id: I979ced22111c0efabdec54726b370b6232fbd482
return
fi
- # veirfy boot
- /usr/bin/verityctl create rootfs $ROOTFS
- case $? in
- 0) echo "verityboot: enabled"; return ;;
- 1) echo "verifyboot: disabled" ;; # continue
- 2) echo "verifyboot: corrupted" ;; # should deal with the error like reboot.
- esac
+ # check verify boot only in initrd
+ if [ "$IN_INITRD" = "1" ]
+ then
+ /usr/bin/verityctl create rootfs $ROOTFS
+ case $? in
+ 0) echo "verityboot: enabled"; return ;;
+ 1) echo "verifyboot: disabled" ;; # continue
+ 2) echo "verifyboot: corrupted" ;; # should deal with the error like reboot.
+ esac
+ fi
# ext4 partion
if [ "$IN_INITRD" = "1" ]