summaryrefslogtreecommitdiff
path: root/cppreopts
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2019-01-02 11:50:34 -0800
committerYifan Hong <elsk@google.com>2019-01-03 16:21:22 -0800
commit7605f8923c19aed45f4f449a478019cb1245c77a (patch)
tree9c279058f4a5c62c067aa4fce117c26d4a45b1f2 /cppreopts
parent8873b8f86596522c7e40570dfb1c317816b1267d (diff)
downloadextras-7605f8923c19aed45f4f449a478019cb1245c77a.tar.gz
Mount fstab.postinstall
Instead of using the 'mount' built-in, do a mount_all /system/etc/fstab.postinstall which mounts system_other to postinstall properly. This works for devices with and without dynamic partitions. - retrofit and non DAP devices mount the physical system_other partition - launch devices mount the logical system_other partition Fixes: 113182233 Test: boot the first time and look at cppreopt results (on retrofit and launch DAP devices) Change-Id: I70aef55235a5b8be34a521774c4e9dc8461b84de
Diffstat (limited to 'cppreopts')
-rw-r--r--cppreopts/Android.bp6
-rw-r--r--cppreopts/cppreopts.rc12
-rw-r--r--cppreopts/fstab.postinstall21
3 files changed, 29 insertions, 10 deletions
diff --git a/cppreopts/Android.bp b/cppreopts/Android.bp
index 30028f61..e9d19145 100644
--- a/cppreopts/Android.bp
+++ b/cppreopts/Android.bp
@@ -28,5 +28,11 @@ cc_prebuilt_binary {
required: [
"preopt2cachename",
"preloads_copy.sh",
+ "fstab.postinstall",
],
}
+
+prebuilt_etc {
+ name: "fstab.postinstall",
+ src: "fstab.postinstall",
+}
diff --git a/cppreopts/cppreopts.rc b/cppreopts/cppreopts.rc
index 9892d023..e29a73ab 100644
--- a/cppreopts/cppreopts.rc
+++ b/cppreopts/cppreopts.rc
@@ -12,16 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-on property:sys.cppreopt=requested && property:ro.boot.slot_suffix=_a
- mount ext4 /dev/block/by-name/system_b /postinstall ro nosuid nodev noexec
- exec - root -- /system/bin/cppreopts.sh /postinstall
- # Optional script to copy additional preloaded content to data directory
- exec - system system -- /system/bin/preloads_copy.sh /postinstall
- umount /postinstall
- setprop sys.cppreopt finished
-
-on property:sys.cppreopt=requested && property:ro.boot.slot_suffix=_b
- mount ext4 /dev/block/by-name/system_a /postinstall ro nosuid nodev noexec
+on property:sys.cppreopt=requested
+ mount_all /system/etc/fstab.postinstall
exec - root -- /system/bin/cppreopts.sh /postinstall
# Optional script to copy additional preloaded content to data directory
exec - system system -- /system/bin/preloads_copy.sh /postinstall
diff --git a/cppreopts/fstab.postinstall b/cppreopts/fstab.postinstall
new file mode 100644
index 00000000..81272ebb
--- /dev/null
+++ b/cppreopts/fstab.postinstall
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Tries to mount system_other as a logical partition. If that fails, then
+# mount as a physical partition.
+
+#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
+system /postinstall ext4 ro,nosuid,nodev,noexec slotselect_other,logical
+/dev/block/by-name/system /postinstall ext4 ro,nosuid,nodev,noexec slotselect_other