summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AndroidProducts.mk3
-rw-r--r--fvp.mk5
-rw-r--r--fvp_mini.mk57
-rw-r--r--fvpbase/BoardConfig.mk4
-rw-r--r--fvpbase/README.md10
-rw-r--r--fvpbase/mini_network.rc19
-rwxr-xr-xfvpbase/mini_network.sh24
-rw-r--r--fvpbase/sepolicy/file_contexts1
-rw-r--r--fvpbase/sepolicy/mini_network.te10
-rw-r--r--minimal_system.mk61
10 files changed, 190 insertions, 4 deletions
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index 364f4ed7..90437183 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -1,3 +1,4 @@
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/sdk_phone_x86_vendor.mk \
- $(LOCAL_DIR)/fvp.mk
+ $(LOCAL_DIR)/fvp.mk \
+ $(LOCAL_DIR)/fvp_mini.mk
diff --git a/fvp.mk b/fvp.mk
index 4dbcccee..88e1877f 100644
--- a/fvp.mk
+++ b/fvp.mk
@@ -1,5 +1,5 @@
#
-# Copyright 2019 The Android Open Source Project
+# Copyright 2020 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.
@@ -109,3 +109,6 @@ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false
DEVICE_MANIFEST_FILE := device/generic/goldfish/fvpbase/manifest.xml
+# Use a multilib setup (see fvpbase/BoardConfig.mk).
+FVP_MULTILIB_BUILD := true
+
diff --git a/fvp_mini.mk b/fvp_mini.mk
new file mode 100644
index 00000000..e0e3721c
--- /dev/null
+++ b/fvp_mini.mk
@@ -0,0 +1,57 @@
+#
+# Copyright 2020 Arm Ltd. All rights reserved.
+#
+# 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.
+#
+
+$(call inherit-product, $(LOCAL_PATH)/minimal_system.mk)
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
+
+PRODUCT_NAME := fvp_mini
+PRODUCT_DEVICE := fvpbase
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP on FVP
+PRODUCT_SOONG_NAMESPACES += device/generic/goldfish
+
+PRODUCT_SHIPPING_API_LEVEL := 29
+PRODUCT_USE_DYNAMIC_PARTITIONS := true
+PRODUCT_FULL_TREBLE_OVERRIDE := true
+PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := false
+PRODUCT_BUILD_BOOT_IMAGE := true
+
+OVERRIDE_TARGET_FLATTEN_APEX := true
+
+# Use a multilib setup (see fvpbase/BoardConfig.mk).
+FVP_MULTILIB_BUILD ?= true
+
+PRODUCT_PACKAGES += \
+ com.android.runtime \
+ gdbserver \
+ init_vendor \
+ ip \
+ ping \
+ selinux_policy_nonsystem \
+
+PRODUCT_HOST_PACKAGES += \
+ bind_to_localhost
+
+PRODUCT_COPY_FILES += \
+ device/generic/goldfish/fvpbase/fstab.fvpbase:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.fvpbase \
+ device/generic/goldfish/fvpbase/fstab.fvpbase.initrd:$(TARGET_COPY_OUT_RAMDISK)/fstab.fvpbase \
+ device/generic/goldfish/fvpbase/init.fvpbase.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.fvpbase.rc \
+ device/generic/goldfish/fvpbase/mini_network.rc:system/etc/init/mini_network.rc \
+ device/generic/goldfish/fvpbase/mini_network.sh:/system/bin/mini_network.sh \
+ device/generic/goldfish/fvpbase/required_images:required_images \
diff --git a/fvpbase/BoardConfig.mk b/fvpbase/BoardConfig.mk
index e35b2a80..d3e3da1e 100644
--- a/fvpbase/BoardConfig.mk
+++ b/fvpbase/BoardConfig.mk
@@ -1,4 +1,4 @@
-# Copyright (C) 2019 The Android Open Source Project
+# Copyright (C) 2020 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.
@@ -18,11 +18,13 @@ TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_VARIANT := generic
TARGET_CPU_ABI := arm64-v8a
+ifeq ($(FVP_MULTILIB_BUILD),true)
TARGET_2ND_ARCH := arm
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_VARIANT := generic
+endif
include build/make/target/board/BoardConfigMainlineCommon.mk
diff --git a/fvpbase/README.md b/fvpbase/README.md
index f701615a..75e051a9 100644
--- a/fvpbase/README.md
+++ b/fvpbase/README.md
@@ -5,10 +5,18 @@ the ARM Fixed Virtual Platform.
```
. build/envsetup.sh
-lunch fvp-eng # or fvp-userdebug
+lunch $TARGET
m
```
+Where $TARGET above is one of: fvp-eng, fvp-userdebug, fvp_mini-eng or fvp_mini-userdebug
+The fvp-* will build a full Android with UI support, while fvp_mini-* will build a small
+subset needed to boot to shell and support command line executables.
+
+It is possible to disable 32 bit support in fvp_mini-* targets with the following command
+before ``m``:
+`export FVP_MULTILIB_BUILD=false`
+
Note that running ``m`` requires that the kernel is built first following
the instructions below.
diff --git a/fvpbase/mini_network.rc b/fvpbase/mini_network.rc
new file mode 100644
index 00000000..15a13f87
--- /dev/null
+++ b/fvpbase/mini_network.rc
@@ -0,0 +1,19 @@
+#
+# Copyright 2020 Arm Ltd. All rights reserved.
+#
+# 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.
+#
+
+service mini_network /system/bin/mini_network.sh
+ class core
+ oneshot
diff --git a/fvpbase/mini_network.sh b/fvpbase/mini_network.sh
new file mode 100755
index 00000000..f2c90673
--- /dev/null
+++ b/fvpbase/mini_network.sh
@@ -0,0 +1,24 @@
+#!/system/bin/sh
+#
+# Copyright 2020 Arm Ltd. All rights reserved.
+#
+# 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.
+#
+
+# The Android network stack is not included in Nano, so we need to
+# configure the network manually. The configuration below is the same as
+# would be obtained from the fast model's emulated DHCP.
+
+ip address add 172.20.51.1/24 broadcast 172.20.51.255 dev eth0
+ip link set eth0 up
+ip route add default via 172.20.51.254
diff --git a/fvpbase/sepolicy/file_contexts b/fvpbase/sepolicy/file_contexts
index ecd4cf6f..81c79485 100644
--- a/fvpbase/sepolicy/file_contexts
+++ b/fvpbase/sepolicy/file_contexts
@@ -6,3 +6,4 @@
/vendor/lib(64)?/libEGL_swiftshader\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libGLESv1_CM_swiftshader\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libGLESv2_swiftshader\.so u:object_r:same_process_hal_file:s0
+/system/bin/mini_network.sh u:object_r:mini_network_exec:s0
diff --git a/fvpbase/sepolicy/mini_network.te b/fvpbase/sepolicy/mini_network.te
new file mode 100644
index 00000000..c330c8c4
--- /dev/null
+++ b/fvpbase/sepolicy/mini_network.te
@@ -0,0 +1,10 @@
+type mini_network, domain, coredomain;
+type mini_network_exec, exec_type, system_file_type, file_type;
+
+init_daemon_domain(mini_network)
+
+allow mini_network self:capability net_admin;
+allow mini_network self:netlink_route_socket { bind create getattr nlmsg_write read setopt write };
+allow mini_network self:udp_socket { create ioctl };
+allow mini_network shell_exec:file { execute getattr map read };
+allow mini_network system_file:file execute_no_trans;
diff --git a/minimal_system.mk b/minimal_system.mk
new file mode 100644
index 00000000..97851eb0
--- /dev/null
+++ b/minimal_system.mk
@@ -0,0 +1,61 @@
+#
+# Copyright 2020 Arm Ltd. All rights reserved.
+#
+# 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 file contains system partition contents needed for a minimal
+# Android build that boots to shell. The items here should be present in
+# build/make/target/product/base_system.mk.
+
+PRODUCT_PACKAGES += \
+ adbd_system_api \
+ apexd \
+ boringssl_self_test \
+ cgroups.json \
+ com.android.adbd \
+ com.android.conscrypt \
+ debuggerd \
+ hwservicemanager \
+ init.environ.rc \
+ init_system \
+ libbinder \
+ libc.bootstrap \
+ libdl.bootstrap \
+ libdl_android.bootstrap \
+ libm.bootstrap \
+ libstdc++ \
+ linker \
+ linkerconfig \
+ logcat \
+ logd \
+ run-as \
+ selinux_policy_system \
+ servicemanager \
+ shell_and_utilities_system \
+ tombstoned \
+ vold \
+
+PRODUCT_HOST_PACKAGES += \
+ adb \
+
+PRODUCT_COPY_FILES += \
+ system/core/rootdir/init.usb.rc:system/etc/init/hw/init.usb.rc \
+ system/core/rootdir/init.usb.configfs.rc:system/etc/init/hw/init.usb.configfs.rc \
+ system/core/rootdir/etc/hosts:system/etc/hosts
+
+PRODUCT_SYSTEM_PROPERTIES += debug.atrace.tags.enableflags=0
+
+PRODUCT_PACKAGES_DEBUG := \
+ strace \
+ su \