dual-image: remount alt partitions during update

When the BMC is to updating the alt image, it needs to stop the sync
manager, umount the rofs/rwfs-alt partitions before the flashing,
mount them after it's done, and restart the sync manager.

Otherwise the mount point of rofs/rwfs-alt will get error because the
content is updated.

Tested: Verify the rofs/rwfs-alt are umounted during the alt flashing,
        and are mounted again after the flashing is done, and the sync
        manager is restarted.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I21e2bd8e0616cf529b9b4e5245d5da1ea4dfb51e
diff --git a/static/obmc-flash-bmc-alt@.service.in b/static/obmc-flash-bmc-alt@.service.in
index 8ea4790..f302e03 100644
--- a/static/obmc-flash-bmc-alt@.service.in
+++ b/static/obmc-flash-bmc-alt@.service.in
@@ -4,4 +4,10 @@
 [Service]
 Type=oneshot
 RemainAfterExit=no
+ExecStartPre=-/bin/systemctl stop xyz.openbmc_project.Software.Sync.service
+ExecStartPre=-/usr/bin/obmc-flash-bmc umount-static-altfs rofs-alt
+ExecStartPre=-/usr/bin/obmc-flash-bmc umount-static-altfs rwfs-alt
 ExecStart=/usr/sbin/flashcp /tmp/images/%i/image-bmc /dev/mtd/alt-bmc
+ExecStartPost=-/usr/bin/obmc-flash-bmc static-altfs squashfs alt-rofs rofs-alt
+ExecStartPost=-/usr/bin/obmc-flash-bmc static-altfs jffs2 alt-rwfs rwfs-alt
+ExecStartPost=-/bin/systemctl start xyz.openbmc_project.Software.Sync.service