From 4bc3f5a338a9b2015f5f45cd499248c9259f8b84 Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Tue, 16 Apr 2024 15:48:35 -0700 Subject: [PATCH] Reland: Copy persist partition files to /data on boot Since /persisit was previously mounted during eraly-init stage, this CL delays the /persist mount to post-fs-data stage. Actions which depends on the /persist partition are also moved. Bug: 319335586 Change-Id: I6bcc775f16331905c6896f3a2ec5bbea9e20744f --- conf/fstab.efs.from_data | 2 ++ conf/init.efs.16k.rc | 5 ++++- copy_efs_files_to_data.sh | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/conf/fstab.efs.from_data b/conf/fstab.efs.from_data index dbddeac5..4845e3ee 100644 --- a/conf/fstab.efs.from_data +++ b/conf/fstab.efs.from_data @@ -6,3 +6,5 @@ /data/vendor/copied/efs_backup /mnt/vendor/efs_backup none bind latemount /data/vendor/copied/modem_userdata /mnt/vendor/modem_userdata none bind latemount + +/data/vendor/copied/persist /mnt/vendor/persist none bind latemount diff --git a/conf/init.efs.16k.rc b/conf/init.efs.16k.rc index a9066835..cfe1e2aa 100644 --- a/conf/init.efs.16k.rc +++ b/conf/init.efs.16k.rc @@ -11,13 +11,16 @@ on post-fs-data && property:ro.boot.flash.locked=0 restorecon_recursive /data/vendor/copied restorecon_recursive /mnt/vendor mount_all /vendor/etc/fstab.efs + mount_all /vendor/etc/fstab.persist exec_start copy_efs_files_to_data umount_all /vendor/etc/fstab.efs + umount_all /vendor/etc/fstab.persist mount_all /vendor/etc/fstab.efs.from_data - mount_all /vendor/etc/fstab.persist restorecon_recursive /mnt/vendor/efs restorecon_recursive /mnt/vendor/efs_backup restorecon_recursive /mnt/vendor/modem_userdata + restorecon_recursive /mnt/vendor/persist + restorecon_recursive /data/vendor/ss setprop ro.vendor.persist.status mounted on post-fs-data && property:ro.boot.flash.locked=1 diff --git a/copy_efs_files_to_data.sh b/copy_efs_files_to_data.sh index bcbe8828..898bc8e9 100644 --- a/copy_efs_files_to_data.sh +++ b/copy_efs_files_to_data.sh @@ -38,3 +38,5 @@ copy_files_to_data "/dev/block/by-name/efs" "/mnt/vendor/efs" copy_files_to_data "/dev/block/by-name/efs_backup" "/mnt/vendor/efs_backup" copy_files_to_data "/dev/block/by-name/modem_userdata" "/mnt/vendor/modem_userdata" +chmod g+rx -R /mnt/vendor/persist +copy_files_to_data "/dev/block/by-name/persist" "/mnt/vendor/persist"