dm-verity: do not check dm-verity in init-wrapper 97/259197/4
authorINSUN PYO <insun.pyo@samsung.com>
Wed, 2 Jun 2021 03:56:59 +0000 (12:56 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Wed, 2 Jun 2021 07:48:55 +0000 (16:48 +0900)
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

scripts/init.sh

index 8f78aee72990c8cee99cdf24eba73e086563a234..4e2e6d406b222fac0783a775232829861b90bef1 100755 (executable)
@@ -117,13 +117,16 @@ function process_rootfs()
         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" ]