From: Mateusz Moscicki Date: Wed, 8 May 2024 16:35:39 +0000 (+0200) Subject: Do checkpoint on datafs in init X-Git-Tag: accepted/tizen/unified/20240611.122427^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified_dev;p=platform%2Fcore%2Fsystem%2Finitrd.git Do checkpoint on datafs in init The system-data partition should be mounted before system starts to boot, due to the configuration files that may reside on it. Change-Id: Ie91c74e352ea818f486af6454c384a658abb08a9 --- diff --git a/data/initrd-file.list b/data/initrd-file.list index 37913c1..8c614f1 100644 --- a/data/initrd-file.list +++ b/data/initrd-file.list @@ -21,6 +21,7 @@ DIR_LINKS=" VERBATIMS=" /etc/blkid.conf +/usr/share/upgrade/update-checkpoint-create.sh " PROGS=" @@ -32,7 +33,10 @@ PROGS=" /usr/bin/xargs /usr/bin/mkdir /usr/bin/mount +/usr/bin/readlink /usr/bin/sleep +/usr/bin/stat +/usr/bin/sync /usr/bin/umount /usr/sbin/blkid /usr/sbin/pivot_root @@ -42,6 +46,7 @@ PROGS=" /usr/bin/cat /usr/sbin/bow-restore /usr/sbin/fsck +/usr/sbin/fstrim /usr/sbin/fsck.ext4 /usr/sbin/resize2fs /usr/sbin/btrfs diff --git a/scripts/init.sh b/scripts/init.sh index 9d45991..567fe9f 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -370,9 +370,11 @@ function process_datafs() fi /sbin/fsck -y $DATAFS - # We don't mount $DATAFS here, platform mounts it, - # because if it's an upgrade, we may need to create a checkpoint - # /bin/mount $DATAFS $DATAFS_MNT + if [ "$BOOT_MODE" == "fota" ]; then + /usr/share/upgrade/update-checkpoint-create.sh "$ROOTFS_MNT" system-data + else + /bin/mount $DATAFS $DATAFS_MNT + fi } @@ -427,18 +429,7 @@ function write_resized_flag() if [ x"$DATAFS" = "x" ]; then return; fi if [ "$NEED_RESIZEFS" = "0" ]; then return; fi - # We want to create a flag indicating that resize2fs has already been - # executed, but DATAFS partition will be mounted by systemd later. So we - # have to do this kind of ugly mouting and unmounting, to be able to create - # flag, and then for systemd to mount the partition in the normal way or - # via dm-bow (during an upgrade). - # Fortunately, it will only execute once, on the first boot after the - # images have been flashed. - /bin/mount "$DATAFS" "$DATAFS_MNT" - echo " " > ${DATAFS_MNT}/var/.resizefs_done - - /bin/umount "$DATAFS_MNT" } @@ -548,6 +539,7 @@ setup_nbd wait_find_partitions restore_partitions check_flags +check_bootmode process_rootfs process_datafs @@ -558,7 +550,6 @@ write_resized_flag load_kernel_modules pivot_root -check_bootmode change_root $@ # WARNING! never rearch