summaryrefslogtreecommitdiff
path: root/dynamic_partitions
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2018-11-15 13:20:57 -0800
committerYifan Hong <elsk@google.com>2018-11-15 14:02:43 -0800
commit8f7a8730f91cc1bbe965c1469ba9196a7483b67a (patch)
treeac75e5622d92a492b5fe2117bde62f6ff1cf5a43 /dynamic_partitions
parentc29d6e2eea84a794e1ad2c4ce501a5474990a0f9 (diff)
Add check_dynamic_partitions script.
Test: run the script on device Test: manually apply regular OTA on non-DAP build Change-Id: If643a18ef08a6ebee504f25bb0158fd9fa2f4048
Diffstat (limited to 'dynamic_partitions')
-rw-r--r--dynamic_partitions/Android.mk27
-rwxr-xr-xdynamic_partitions/check_dynamic_partitions34
2 files changed, 61 insertions, 0 deletions
diff --git a/dynamic_partitions/Android.mk b/dynamic_partitions/Android.mk
new file mode 100644
index 0000000..af4a79f
--- /dev/null
+++ b/dynamic_partitions/Android.mk
@@ -0,0 +1,27 @@
+#
+# Copyright 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE:= check_dynamic_partitions
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_SRC_FILES := check_dynamic_partitions
+LOCAL_PRODUCT_MODULE := true
+
+include $(BUILD_PREBUILT)
diff --git a/dynamic_partitions/check_dynamic_partitions b/dynamic_partitions/check_dynamic_partitions
new file mode 100755
index 0000000..13733c7
--- /dev/null
+++ b/dynamic_partitions/check_dynamic_partitions
@@ -0,0 +1,34 @@
+#!/system/bin/sh
+
+#
+# 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.
+#
+
+# This script will run as an environment check for regular dynamic partitions
+# update. In particular, a regular update with dynamic partitions enabled
+# should not be applied on a build that does not have dynamic partitions.
+
+DP_PROPERTY_NAME="ro.boot.dynamic_partitions"
+DP_RETROFIT_PROPERTY_NAME="ro.boot.dynamic_partitions_retrofit"
+
+DP_PROPERTY=$(getprop ${DP_PROPERTY_NAME})
+DP_RETROFIT_PROPERTY=$(getprop ${DP_RETROFIT_PROPERTY_NAME})
+
+if [ "${DP_PROPERTY}" != "true" ] || [ "${DP_RETROFIT_PROPERTY}" != "true" ] ; then
+ echo "Error: applied non-retrofit update on build without dynamic partitions."
+ echo "${DP_PROPERTY_NAME}=${DP_PROPERTY}"
+ echo "${DP_RETROFIT_PROPERTY_NAME}=${DP_RETROFIT_PROPERTY}"
+ exit 1
+fi