summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tc0/nano_art_minimal.mk44
-rw-r--r--tc0/nano_core.mk175
-rw-r--r--tc0/tc0_nano.mk29
-rw-r--r--tc0/tc0_nano/BoardConfig.mk17
-rw-r--r--tc0/tc0_nano/init.tc0_nano.rc25
-rw-r--r--tc0/tc0_nano/public.libraries.android.txt6
6 files changed, 296 insertions, 0 deletions
diff --git a/tc0/nano_art_minimal.mk b/tc0/nano_art_minimal.mk
new file mode 100644
index 0000000..291f546
--- /dev/null
+++ b/tc0/nano_art_minimal.mk
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2017 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.
+#
+
+include $(LOCAL_PATH)/version.mk
+
+# A drastically stripped down version of build/target/product/runtime_libart.mk,
+# providing the bare minimum for running simple Java programs with ART.
+
+ifeq ($(call arm-platform-min-level, 10),)
+# Arm platform support level < 10
+
+# These packages depend on libc, libm, etc.
+# In Android-10 such libraries are prohibited to be put on /system.
+# Instead, these packages are included in com.android.runtime APEX.
+PRODUCT_PACKAGES += \
+ dex2oat \
+ dalvikvm \
+ libjavacore \
+ libopenjdk
+
+endif
+
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+ dalvik.vm.image-dex2oat-Xms=64m \
+ dalvik.vm.image-dex2oat-Xmx=64m \
+ dalvik.vm.dex2oat-Xms=64m \
+ dalvik.vm.dex2oat-Xmx=512m \
+ ro.dalvik.vm.native.bridge=0 \
+ dalvik.vm.usejit=true \
+ dalvik.vm.usejitprofiles=true \
+ dalvik.vm.appimageformat=lz4
diff --git a/tc0/nano_core.mk b/tc0/nano_core.mk
new file mode 100644
index 0000000..6c3de2a
--- /dev/null
+++ b/tc0/nano_core.mk
@@ -0,0 +1,175 @@
+#
+# Copyright (C) 2017 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.
+#
+
+include $(LOCAL_PATH)/version.mk
+
+# This is based on build/target/product/embedded.mk, with an even smaller
+# set of dependencies.
+
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/init.common.rc:root/init.common.rc
+
+# Virtually none of the platforms can reliably generate enough entropy for the
+# crng pool to be always ready before some process makes a blocking getrandom()
+# call. Since we are not really concerned about the amount of entropy provided
+# by getrandom(), let's always include the crng_init service to initialise the
+# crng pool early enough.
+PRODUCT_PACKAGES += \
+ crng_init
+
+ifneq ($(call arm-platform-min-level, 10),)
+# Arm platform support level >= 10
+
+# https://source.android.com/devices/tech/ota/apex#configuring_system_to_support_apex_updates
+$(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk)
+
+# https://source.android.com/devices/tech/ota/dynamic_partitions/implement
+# https://source.android.com/devices/tech/ota/dynamic_partitions/implement#adb-remount
+PRODUCT_USE_DYNAMIC_PARTITIONS := false
+
+endif
+# bionic
+PRODUCT_PACKAGES += \
+ libstdc++ \
+ linker
+
+# system/core
+PRODUCT_PACKAGES += \
+ adbd \
+ crash_dump \
+ debuggerd \
+ grep \
+ init \
+ init.rc \
+ init.environ.rc \
+ ld.config.txt \
+ logcat \
+ logd \
+ logwrapper \
+ reboot \
+ run-as \
+ tombstoned \
+ toolbox
+
+# system/extras
+PRODUCT_PACKAGES += \
+ su \
+ simpleperf
+
+# frameworks/native
+PRODUCT_PACKAGES += \
+ servicemanager \
+ libbinder
+
+# external
+PRODUCT_PACKAGES += \
+ ip \
+ mkshrc \
+ sh \
+ strace \
+ toybox
+
+# prebuilts
+PRODUCT_PACKAGES += \
+ gdbserver64
+
+# SELinux packages
+PRODUCT_PACKAGES += \
+ nonplat_mac_permissions.xml \
+ nonplat_property_contexts \
+ nonplat_seapp_contexts \
+ nonplat_service_contexts \
+ nonplat_hwservice_contexts \
+ plat_mac_permissions.xml \
+ plat_property_contexts \
+ plat_seapp_contexts \
+ plat_service_contexts \
+ plat_hwservice_contexts \
+ selinux_policy \
+ vndservice_contexts
+
+ifneq ($(call arm-platform-min-level, 10),)
+# Arm platform support level >= 10
+
+# First and second stage inits.
+PRODUCT_PACKAGES += \
+ apexd \
+ com.android.runtime \
+ init_system \
+ init_vendor \
+ cgroups.json
+
+# Bootstrap some libraries.
+# apexd starts early but /system/bin/init is dynamic.
+# https://source.android.com/devices/architecture/modular-system/runtime
+PRODUCT_PACKAGES += \
+ libc.bootstrap \
+ libm.bootstrap \
+ libdl.bootstrap
+
+# Required host packages
+PRODUCT_HOST_PACKAGES += \
+ adb \
+ fastboot
+
+else
+# Arm platform support level < 10
+
+# Required host packages
+PRODUCT_PACKAGES += \
+ adb \
+ fastboot
+
+endif
+
+# Ensure that this property is always defined so that bionic_systrace.cpp
+# can rely on it being initially set by init.
+PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
+ debug.atrace.tags.enableflags=0
+
+# We always need init.usb.rc even if the device has no USB (for adbd)
+PRODUCT_COPY_FILES += \
+ system/core/rootdir/init.usb.rc:root/init.usb.rc \
+ system/core/rootdir/init.usb.configfs.rc:root/init.usb.configfs.rc \
+ system/core/rootdir/ueventd.rc:root/ueventd.rc \
+ system/core/rootdir/etc/hosts:system/etc/hosts
+
+# Use a custom public library list, since we don't build most of the libraries
+# in the standard list.
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/tc0_nano/public.libraries.android.txt:system/etc/public.libraries.txt
+
+# Set a default PRODUCT_BRAND (like in build/target/product/core_tiny.mk for
+# instance).
+PRODUCT_BRAND := nano
+
+# The default setting is to support 32-bit apps only.
+TARGET_SUPPORTS_64_BIT_APPS := true
+
+
+# Never build test modules, as they pull a huge number of dependencies.
+ANDROID_NO_TEST_CHECK := true
+# Save some time by not checking the SDK API (there is no point in doing that
+# in a nano build where the whole API is not even guaranteed to work, and this
+# step takes quite a long time as it can't be sped up by CCache).
+WITHOUT_CHECK_API := true
+
+# Use our hack in build/core/main.mk: we want to be able to build
+# userdebug/eng variants without building modules tagged as debug or eng.
+ANDROID_NO_TAGGED_MODULE := true
+
+# Don't use the precollected boot image profile for generating boot image
+PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := false
diff --git a/tc0/tc0_nano.mk b/tc0/tc0_nano.mk
new file mode 100644
index 0000000..42074ca
--- /dev/null
+++ b/tc0/tc0_nano.mk
@@ -0,0 +1,29 @@
+#
+# 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.
+# 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.
+#
+
+include $(LOCAL_PATH)/version.mk
+
+$(call inherit-product, $(LOCAL_PATH)/nano_core.mk)
+$(call inherit-product, $(LOCAL_PATH)/nano_art_minimal.mk)
+$(call inherit-product, $(LOCAL_PATH)/device.mk)
+
+PRODUCT_NAME := tc0_nano
+PRODUCT_MANUFACTURER := Arm
+PRODUCT_DEVICE := tc0_nano
+PRODUCT_MODEL := Total Compute Fast Model (Nano build)
+
+PRODUCT_COPY_FILES += \
+ $(LOCAL_PATH)/tc0_nano/init.tc0_nano.rc:root/init.tc0.rc
diff --git a/tc0/tc0_nano/BoardConfig.mk b/tc0/tc0_nano/BoardConfig.mk
new file mode 100644
index 0000000..1c5ffce
--- /dev/null
+++ b/tc0/tc0_nano/BoardConfig.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2019 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.
+#
+
+include device/arm/tc0/BoardConfig_common.mk
diff --git a/tc0/tc0_nano/init.tc0_nano.rc b/tc0/tc0_nano/init.tc0_nano.rc
new file mode 100644
index 0000000..ae0dc96
--- /dev/null
+++ b/tc0/tc0_nano/init.tc0_nano.rc
@@ -0,0 +1,25 @@
+#
+# 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.
+# 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.
+#
+
+import /init.common.rc
+
+on boot
+ # 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.
+ exec u:r:shell:s0 -- /system/bin/ip address add 172.20.51.1/24 broadcast 172.20.51.255 dev eth0
+ exec u:r:shell:s0 -- /system/bin/ip route add default via 172.20.51.254
+ ifup eth0
diff --git a/tc0/tc0_nano/public.libraries.android.txt b/tc0/tc0_nano/public.libraries.android.txt
new file mode 100644
index 0000000..0654823
--- /dev/null
+++ b/tc0/tc0_nano/public.libraries.android.txt
@@ -0,0 +1,6 @@
+# See https://android.googlesource.com/platform/ndk/+/master/docs/PlatformApis.md#linker-namespaces_public-libraries-list
+libart.so
+libc.so
+libdl.so
+libm.so
+libstdc++.so