dual-image: Sync files before sync-manager starts

The sync-manager only sync files when it's changed/deleted, but does not
sync when it's untouched.
If the service starts and there is no change, the files will not be
synced.

Mount the rwfs-alt and add a script to sync the files before the
sync-manager starts, so that they are always synced when the
sync-manager is running.

Tested: Verify the files are synced before the sync-manager starts.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I5613738b7b490201c556a175425b48aebae1505b
diff --git a/sync-once.sh b/sync-once.sh
new file mode 100644
index 0000000..e26d5af
--- /dev/null
+++ b/sync-once.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Sync the files/dirs specified in synclist once
+# Usually the sync-manager could sync the file once before it starts, so that
+# it makes sure the synclist is always synced when the sync-manager is running.
+
+SYNCLIST=/etc/synclist
+DEST_DIR=/run/media/rwfs-alt/cow
+
+while read l; do
+    echo rsync -a -R "${l}" "${DEST_DIR}"
+    rsync -a -R "${l}" "${DEST_DIR}"
+done < ${SYNCLIST}