blob: 94a1b210ec4f671457aacd098f97db09f3740d6f [file] [log] [blame]
Andreas Gampe31782c12019-02-06 09:47:25 -08001#!/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
20log_info "=== ART runtime pre-install ==="
21
22set_arches || exit 101
23log_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.
29mkdir -p /data/ota/dalvik-cache || exit 102
30# Bind-mount to perceive as normal structure.
31mount -o bind /data/ota/dalvik-cache /data/dalvik-cache || exit 103
32
33for 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
41done
42
Andreas Gampe29c111e2019-02-28 13:58:07 -080043PRIMARY_ARCH=`echo $ARCHES | sed -e 's/ .*//'`
44`dirname $0`/art_preinstall_hook_system_server $PRIMARY_ARCH || exit 300
45
46FILES=`find /data/dalvik-cache -type f`
47for FILE in $FILES ; do
48 setup_fsverity $FILE || exit 400
49done