Make system-as-root a phone-specific thing
Test: auto builds, boots
BUG: 110695415
Change-Id: Iffe8863e0a99e1dccb3325a6e5004e44a93e68f1
Merged-In: Iffe8863e0a99e1dccb3325a6e5004e44a93e68f1
diff --git a/host_package.mk b/host_package.mk
index 1aafc8d..829540c 100644
--- a/host_package.mk
+++ b/host_package.mk
@@ -53,7 +53,8 @@
libicuuc-host \
cvd_host_configs := \
- cuttlefish.dtb
+ system-root.dtb \
+ initrd-root.dtb
cvd_host_package_files := \
$(addprefix config/,$(cvd_host_configs)) \
diff --git a/shared/BoardConfig.mk b/shared/BoardConfig.mk
index 4aa7380..5840808 100644
--- a/shared/BoardConfig.mk
+++ b/shared/BoardConfig.mk
@@ -25,7 +25,9 @@
TARGET_COPY_OUT_VENDOR := vendor
TARGET_NO_RECOVERY := true
+ifneq (,$(CUTTLEFISH_SYSTEM_AS_ROOT))
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
+endif
BOARD_USES_GENERIC_AUDIO := false
USE_CAMERA_STUB := true
TARGET_USERIMAGES_USE_EXT4 := true
diff --git a/shared/config/Android.mk b/shared/config/Android.mk
index 4628b90..3fc2d73 100644
--- a/shared/config/Android.mk
+++ b/shared/config/Android.mk
@@ -42,6 +42,8 @@
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(HOST_OUT)/config
LOCAL_MODULE_STEM := cuttlefish.dtb
-LOCAL_SRC_FILES := cuttlefish.dtb
+LOCAL_SRC_FILES := \
+ initrd-root.dtb \
+ system-root.dtb
include $(BUILD_PREBUILT)
diff --git a/shared/config/initrd-root.dtb b/shared/config/initrd-root.dtb
new file mode 100644
index 0000000..1c75cd6
--- /dev/null
+++ b/shared/config/initrd-root.dtb
Binary files differ
diff --git a/shared/config/initrd-root.dts b/shared/config/initrd-root.dts
new file mode 100644
index 0000000..70a34fc
--- /dev/null
+++ b/shared/config/initrd-root.dts
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+/dts-v1/;
+
+/ {
+ firmware {
+ android {
+ compatible = "android,firmware";
+ fstab {
+ compatible = "android,fstab";
+ system {
+ compatible = "android,system";
+ dev = "/dev/block/vda";
+ type = "ext4";
+ mnt_flags = "noatime,ro,errors=panic";
+ fsmgr_flags = "wait";
+ };
+
+ vendor {
+ compatible = "android,vendor";
+ dev = "/dev/block/vdd";
+ type = "ext4";
+ mnt_flags = "noatime,ro,errors=panic";
+ fsmgr_flags = "wait";
+ };
+ };
+ };
+ };
+};
diff --git a/shared/config/cuttlefish.dtb b/shared/config/system-root.dtb
similarity index 100%
rename from shared/config/cuttlefish.dtb
rename to shared/config/system-root.dtb
Binary files differ
diff --git a/shared/config/cuttlefish.dts b/shared/config/system-root.dts
similarity index 100%
rename from shared/config/cuttlefish.dts
rename to shared/config/system-root.dts
diff --git a/shared/phone/device.mk b/shared/phone/device.mk
index 4752cff..8653a85 100644
--- a/shared/phone/device.mk
+++ b/shared/phone/device.mk
@@ -18,6 +18,8 @@
$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
$(call inherit-product, device/google/cuttlefish/shared/device.mk)
+CUTTLEFISH_SYSTEM_AS_ROOT := true
+
PRODUCT_CHARACTERISTICS := nosdcard
PRODUCT_PROPERTY_OVERRIDES += \