Andreas Gampe | 31782c1 | 2019-02-06 09:47:25 -0800 | [diff] [blame] | 1 | #!/system/bin/sh |
| 2 | |
| 3 | # Copyright (C) 2019 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | |
| 18 | . `dirname $0`/art_prepostinstall_utils || exit 100 |
| 19 | |
| 20 | log_info "=== ART runtime pre-install ===" |
| 21 | |
| 22 | set_arches || exit 101 |
| 23 | log_info "Arches = `echo $ARCHES`" |
| 24 | |
| 25 | # The runtime update uses /data/ota as a staging directory, similar to |
| 26 | # A/B OTA. (There is no overlap, as A/B uses slot prefixes.) |
| 27 | |
| 28 | # Create OTA base folder. |
| 29 | mkdir -p /data/ota/dalvik-cache || exit 102 |
| 30 | # Bind-mount to perceive as normal structure. |
| 31 | mount -o bind /data/ota/dalvik-cache /data/dalvik-cache || exit 103 |
| 32 | |
| 33 | for ARCH in $ARCHES ; do |
| 34 | log_info "Preparing compilation output directories for $ARCH" |
| 35 | |
| 36 | # Create OTA folders. |
| 37 | mkdir -p /data/ota/dalvik-cache/$ARCH || exit 104 |
| 38 | rm -rf /data/ota/dalvik-cache/$ARCH/* || exit 105 |
| 39 | |
| 40 | `dirname $0`/art_preinstall_hook_boot $ARCH || exit 200 |
| 41 | done |
| 42 | |
Andreas Gampe | 29c111e | 2019-02-28 13:58:07 -0800 | [diff] [blame] | 43 | PRIMARY_ARCH=`echo $ARCHES | sed -e 's/ .*//'` |
| 44 | `dirname $0`/art_preinstall_hook_system_server $PRIMARY_ARCH || exit 300 |
| 45 | |
| 46 | FILES=`find /data/dalvik-cache -type f` |
| 47 | for FILE in $FILES ; do |
| 48 | setup_fsverity $FILE || exit 400 |
| 49 | done |