diff options
-rw-r--r-- | etc/init.rc | 3 | ||||
-rw-r--r-- | fsck_unshare_blocks.cpp | 14 | ||||
-rw-r--r-- | recovery.cpp | 8 | ||||
-rw-r--r-- | updater_sample/Android.mk | 5 | ||||
-rw-r--r-- | updater_sample/proguard.flags | 23 | ||||
-rw-r--r-- | updater_sample/tests/Android.mk | 6 |
6 files changed, 36 insertions, 23 deletions
diff --git a/etc/init.rc b/etc/init.rc index 0fc6c4c13..96c37b11c 100644 --- a/etc/init.rc +++ b/etc/init.rc @@ -22,6 +22,7 @@ on init mkdir /data mkdir /cache mkdir /sideload + mkdir /mnt/system mount tmpfs tmpfs /tmp chown root shell /tmp @@ -87,7 +88,7 @@ service charger /charger -r service recovery /sbin/recovery seclabel u:r:recovery:s0 -service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery +service adbd /system/bin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery disabled socket adbd stream 660 system system seclabel u:r:adbd:s0 diff --git a/fsck_unshare_blocks.cpp b/fsck_unshare_blocks.cpp index a100368e7..2e6b5b807 100644 --- a/fsck_unshare_blocks.cpp +++ b/fsck_unshare_blocks.cpp @@ -115,14 +115,6 @@ static bool run_e2fsck(const std::string& partition) { return true; } -static const char* get_system_root() { - if (android::base::GetBoolProperty("ro.build.system_root_image", false)) { - return "/system_root"; - } else { - return "/system"; - } -} - bool do_fsck_unshare_blocks() { // List of partitions we will try to e2fsck -E unshare_blocks. std::vector<std::string> partitions = { "/odm", "/oem", "/product", "/vendor" }; @@ -130,10 +122,10 @@ bool do_fsck_unshare_blocks() { // Temporarily mount system so we can copy e2fsck_static. bool mounted = false; if (android::base::GetBoolProperty("ro.build.system_root_image", false)) { - mounted = ensure_path_mounted_at("/", "/system_root") != -1; + mounted = ensure_path_mounted_at("/", "/mnt/system") != -1; partitions.push_back("/"); } else { - mounted = ensure_path_mounted("/system") != -1; + mounted = ensure_path_mounted_at("/system", "/mnt/system") != -1; partitions.push_back("/system"); } if (!mounted) { @@ -144,7 +136,7 @@ bool do_fsck_unshare_blocks() { LOG(ERROR) << "Could not copy e2fsck to /tmp."; return false; } - if (umount(get_system_root()) < 0) { + if (umount("/mnt/system") < 0) { PLOG(ERROR) << "umount failed"; return false; } diff --git a/recovery.cpp b/recovery.cpp index 98cbfed2f..fea65ae9e 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -820,15 +820,13 @@ static Device::BuiltinAction prompt_and_wait(Device* device, int status) { break; } case Device::MOUNT_SYSTEM: - // For a system image built with the root directory (i.e. system_root_image == "true"), we - // mount it to /system_root, and symlink /system to /system_root/system to make adb shell - // work (the symlink is created through the build system). (Bug: 22855115) + // the system partition is mounted at /mnt/system if (android::base::GetBoolProperty("ro.build.system_root_image", false)) { - if (ensure_path_mounted_at("/", "/system_root") != -1) { + if (ensure_path_mounted_at("/", "/mnt/system") != -1) { ui->Print("Mounted /system.\n"); } } else { - if (ensure_path_mounted("/system") != -1) { + if (ensure_path_mounted_at("/system", "/mnt/system") != -1) { ui->Print("Mounted /system.\n"); } } diff --git a/updater_sample/Android.mk b/updater_sample/Android.mk index 7662111b7..a5deee1c8 100644 --- a/updater_sample/Android.mk +++ b/updater_sample/Android.mk @@ -20,9 +20,8 @@ include $(CLEAR_VARS) LOCAL_PACKAGE_NAME := SystemUpdaterSample LOCAL_MODULE_TAGS := samples LOCAL_SDK_VERSION := system_current - -# TODO: enable proguard and use proguard.flags file -LOCAL_PROGUARD_ENABLED := disabled +LOCAL_PRIVILEGED_MODULE := true +LOCAL_PROGUARD_FLAG_FILES := proguard.flags LOCAL_SRC_FILES := $(call all-java-files-under, src) diff --git a/updater_sample/proguard.flags b/updater_sample/proguard.flags new file mode 100644 index 000000000..5883608d7 --- /dev/null +++ b/updater_sample/proguard.flags @@ -0,0 +1,23 @@ +# 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. + +# Keep, used in tests. +-keep public class com.example.android.systemupdatersample.UpdateManager { + public int getUpdaterState(); +} + +# Keep, used in tests. +-keep public class com.example.android.systemupdatersample.UpdateConfig { + public <init>(java.lang.String, java.lang.String, int); +} diff --git a/updater_sample/tests/Android.mk b/updater_sample/tests/Android.mk index 9aec372e3..415760454 100644 --- a/updater_sample/tests/Android.mk +++ b/updater_sample/tests/Android.mk @@ -22,10 +22,10 @@ LOCAL_SDK_VERSION := system_current LOCAL_MODULE_TAGS := tests LOCAL_JAVA_LIBRARIES := \ android.test.base.stubs \ - android.test.runner.stubs \ - guava + android.test.runner.stubs LOCAL_STATIC_JAVA_LIBRARIES := android-support-test \ - mockito-target-minus-junit4 + mockito-target-minus-junit4 \ + guava LOCAL_INSTRUMENTATION_FOR := SystemUpdaterSample LOCAL_PROGUARD_ENABLED := disabled |