Remake dm-verity hash table for updated rootfs 31/246031/2
authorKichan Kwon <k_c.kwon@samsung.com>
Thu, 22 Oct 2020 10:23:35 +0000 (19:23 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Mon, 26 Oct 2020 02:31:31 +0000 (11:31 +0900)
Change-Id: I1b22dcc1da3a0ac386007f71a076022a4ab623a3
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
scripts/40-fota.list.in
scripts/fota-init.sh

index 7bbacbd..fb67a27 100755 (executable)
@@ -28,6 +28,8 @@ WITHLIBS="
 /bin/cut
 /bin/tr
 /bin/wc
+/bin/verityctl
+/bin/verity_handler
 /usr/sbin/agetty
 "
 
index 06bea9d..937c44e 100755 (executable)
@@ -33,6 +33,8 @@ SORT="/usr/bin/sort"
 SED="/usr/bin/sed"
 WC="/usr/bin/wc"
 LS="/bin/ls"
+VERITYCTL="/usr/bin/verityctl"
+VERITY_HANDLER="/usr/bin/verity_handler"
 
 FOTA_GUI="/usr/bin/fota_gui"
 FOTA_GUI_ENABLE=
@@ -286,6 +288,20 @@ check_debug_mode() {
 }
 
 #------------------------------------------------
+#      remake_hash_table
+#------------------------------------------------
+remake_hash_table() {
+       if [ -f "${VERITYCTL}" ]; then
+               if [ -f "${VERITY_HANDLER}" ]; then
+                       "$MOUNT" -o remount,ro ${FAKE_ROOT}
+                       "${VERITY_HANDLER}" ${PART_ROOTFS}
+               else
+                       echo "Warning: ${VERITYCTL} exists but ${VERITY_HANDLER} not exists"
+               fi
+       fi
+}
+
+#------------------------------------------------
 #      Main Routine Start
 #------------------------------------------------
 
@@ -316,6 +332,8 @@ fota_result=$?
 if [ "$fota_result" = "0" ]; then
        /bin/rm -fr ${DELTA_DIR}/*
 fi
+
+remake_hash_table
 umount_partitions
 
 if [ "$fota_result" = "0" ]; then