summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Wang <wvw@google.com>2019-04-01 17:44:21 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-04-01 17:44:21 -0700
commit17226e5ef69bd8b8326fc2cb9a8cfd5140ac17ae (patch)
tree841502f1660adff34d7e2e397e23ccfe546fc0e4
parent101b4d5d0e0cda4430150a1772daaf3635d1603d (diff)
parentd603390bed4041245f8d98ec2b44ff82bc39d441 (diff)
downloadextras-17226e5ef69bd8b8326fc2cb9a8cfd5140ac17ae.tar.gz
Merge "Use fsync instead of sync during first boot" am: 654a37cd65
am: d603390bed Change-Id: I7292168b8684759512e3fb6279d3a00adaa77571
-rw-r--r--cppreopts/cppreopts.rc3
-rwxr-xr-x[-rw-r--r--]cppreopts/cppreopts.sh3
2 files changed, 5 insertions, 1 deletions
diff --git a/cppreopts/cppreopts.rc b/cppreopts/cppreopts.rc
index 812b4ce8..60bd66ca 100644
--- a/cppreopts/cppreopts.rc
+++ b/cppreopts/cppreopts.rc
@@ -16,6 +16,9 @@ service cppreopts /system/bin/cppreopts.sh /postinstall
oneshot
disabled
user root
+ priority -20
+ ioprio rt 0
+ writepid /dev/cpuset/foreground/tasks
capabilities
# Post install is above Treble VINTF, because it runs some utilities from
diff --git a/cppreopts/cppreopts.sh b/cppreopts/cppreopts.sh
index a3545e17..3416e675 100644..100755
--- a/cppreopts/cppreopts.sh
+++ b/cppreopts/cppreopts.sh
@@ -28,11 +28,12 @@ function do_copy() {
log -p w -t cppreopts "Unable to copy file ${source_file} to ${temp_dest_name}!"
else
log -p i -t cppreopts "Copied file from ${source_file} to ${temp_dest_name}"
- sync
+ fsync ${temp_dest_name}
if ! mv ${temp_dest_name} ${dest_name} ; then
log -p w -t cppreopts "Unable to rename temporary file from ${temp_dest_name} to ${dest_name}"
rm ${temp_dest_name} || log -p w -t cppreopts "Unable to remove temporary file ${temp_dest_name}"
else
+ fsync ${dest_name}
log -p i -t cppreopts "Renamed temporary file from ${temp_dest_name} to ${dest_name}"
fi
fi