diff --git a/AndroidProducts.mk b/AndroidProducts.mk new file mode 100644 index 0000000..ef00c17 --- /dev/null +++ b/AndroidProducts.mk @@ -0,0 +1 @@ +PRODUCT_MAKEFILES := $(LOCAL_DIR)/rpi2.mk diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..09b6244 --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,37 @@ +TARGET_NO_BOOTLOADER := true +TARGET_NO_KERNEL := true +TARGET_NO_RECOVERY := true +TARGET_NO_RADIOIMAGE := true + +TARGET_ARCH := arm +TARGET_ARCH_VARIANT := armv7-a-neon +TARGET_CPU_VARIANT := cortex-a7 +TARGET_CPU_ABI := armeabi-v7a +TARGET_CPU_ABI2 := armeabi +TARGET_CPU_SMP := true + +TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := true + +TARGET_PROVIDES_INIT_RC := false +TARGET_COMPRESS_MODULE_SYMBOLS := false +TARGET_PRELINK_MODULE := false + +TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +TARGET_USERIMAGES_USE_EXT4 := true + +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 536870912 # 512M +BOARD_CACHEIMAGE_PARTITION_SIZE := 134217728 # 128M +BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 134217728 # 128M + +BOARD_FLASH_BLOCK_SIZE := 4096 +BOARD_MALLOC_ALIGNMENT := 16 + +BOARD_USES_GENERIC_AUDIO := false +BOARD_USES_USB_AUDIO := false + +BOARD_EGL_CFG := device/brcm/rpi2/egl.cfg +USE_OPENGL_RENDERER := true +TARGET_USE_PAN_DISPLAY := true + +USE_CAMERA_STUB := true diff --git a/egl.cfg b/egl.cfg new file mode 100644 index 0000000..c4a1437 --- /dev/null +++ b/egl.cfg @@ -0,0 +1 @@ +0 0 android diff --git a/fstab.rpi2 b/fstab.rpi2 new file mode 100644 index 0000000..4238063 --- /dev/null +++ b/fstab.rpi2 @@ -0,0 +1,8 @@ +# Android fstab file. +# +# The filesystem that contains the filesystem checker binary (typically /system) cannot +# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK + +/dev/block/mmcblk0p2 /system ext4 ro wait +/dev/block/mmcblk0p3 /cache ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait +/dev/block/mmcblk0p4 /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait diff --git a/init.rpi2.rc b/init.rpi2.rc new file mode 100644 index 0000000..f46c158 --- /dev/null +++ b/init.rpi2.rc @@ -0,0 +1,56 @@ + +on init + mkdir /mnt/shell/emulated 0700 shell shell + mkdir /storage/emulated 0555 root root + + export EXTERNAL_STORAGE /storage/emulated/legacy + export EMULATED_STORAGE_SOURCE /mnt/shell/emulated + export EMULATED_STORAGE_TARGET /storage/emulated + + symlink /storage/emulated/legacy /sdcard + symlink /storage/emulated/legacy /storage/sdcard0 + symlink /mnt/shell/emulated/0 /storage/emulated/legacy + +on fs + mount_all /fstab.rpi2 + setprop ro.crypto.state unencrypted + setprop ro.crypto.fuse_sdcard true + +on post-fs-data + mkdir /data/media 0770 media_rw media_rw + start sdcard + + # Set indication (checked by vold) that we have finished this action + setprop vold.post_fs_data_done 1 + +on early-boot + + setprop sys.fb.bits 16 + +on boot + setprop net.dns1 8.8.8.8 + setprop net.dns2 8.8.4.4 + setprop ro.build.product rpi2 + setprop ro.product.device rpi2 + +# fake some battery state + setprop status.battery.state Slow + setprop status.battery.level 5 + setprop status.battery.level_raw 50 + setprop status.battery.level_scale 9 + + setprop service.adb.tcp.port 5555 + start adbd + +service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023 + class late_start + +service dhcpcd_eth0 /system/bin/dhcpcd -aABKL + class main + disabled + oneshot + +service iprenew_eth0 /system/bin/dhcpcd -n + class late_start + disabled + oneshot diff --git a/init.usb.rc b/init.usb.rc new file mode 100644 index 0000000..10ea338 --- /dev/null +++ b/init.usb.rc @@ -0,0 +1,3 @@ +# +# USB configuration +# diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000..0870d05 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,56 @@ + + + + + true + + + false + + + false + + + false + + + false + + + 4 + + + 2 + + + true + + + + + + + "ethernet,9,9,9,-1,true" + + + + + "9,1" + + + + ;com.android.tv.settings; + + diff --git a/overlay/frameworks/base/core/res/res/xml/storage_list.xml b/overlay/frameworks/base/core/res/res/xml/storage_list.xml new file mode 100644 index 0000000..b9ffebd --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml/storage_list.xml @@ -0,0 +1,44 @@ + + + + + + + + + diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml new file mode 100644 index 0000000..406df08 --- /dev/null +++ b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml @@ -0,0 +1,34 @@ + + + + + + + false + + + true + + + true + + + true + + + 0 + + diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml new file mode 100644 index 0000000..e4d3aae --- /dev/null +++ b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml @@ -0,0 +1,25 @@ + + + + + + + com.android.systemui.statusbar.tv.TvStatusBar + + + false + + diff --git a/rpi2.mk b/rpi2.mk new file mode 100644 index 0000000..23dc6d0 --- /dev/null +++ b/rpi2.mk @@ -0,0 +1,33 @@ +$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk) + +PRODUCT_NAME := rpi2 +PRODUCT_DEVICE := rpi2 +PRODUCT_BRAND := AndroidTV +PRODUCT_MODEL := AndroidTV on rpi2 +PRODUCT_MANUFACTURER := brcm + +PRODUCT_AAPT_CONFIG := normal tvdpi hdpi +PRODUCT_AAPT_PREF_CONFIG := tvdpi + +include frameworks/native/build/tablet-7in-hdpi-1024-dalvik-heap.mk + +PRODUCT_PACKAGES += \ + libGLES_android + +PRODUCT_COPY_FILES := \ + frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \ + frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml \ + device/generic/goldfish/camera/media_profiles.xml:system/etc/media_profiles.xml \ + device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ + $(LOCAL_PATH)/rpi2_core_hardware.xml:system/etc/permissions/rpi2_core_hardware.xml \ + $(LOCAL_PATH)/init.rpi2.rc:root/init.rpi2.rc \ + $(LOCAL_PATH)/init.usb.rc:root/init.usb.rc \ + $(LOCAL_PATH)/fstab.rpi2:root/fstab.rpi2 \ + $(PRODUCT_COPY_FILES) + +DEVICE_PACKAGE_OVERLAYS := device/brcm/rpi2/overlay +PRODUCT_CHARACTERISTICS := tablet,nosdcard +PRODUCT_LOCALES := en_US,ko_KR,ja_JP,zh_CN diff --git a/rpi2_core_hardware.xml b/rpi2_core_hardware.xml new file mode 100644 index 0000000..ebfc6e8 --- /dev/null +++ b/rpi2_core_hardware.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/system.prop b/system.prop new file mode 100644 index 0000000..f48c39a --- /dev/null +++ b/system.prop @@ -0,0 +1,2 @@ +ro.kernel.qemu=1 +ro.sf.lcd_density=213 diff --git a/vendorsetup.sh b/vendorsetup.sh new file mode 100644 index 0000000..9b59afb --- /dev/null +++ b/vendorsetup.sh @@ -0,0 +1,17 @@ +# +# Copyright (C) 2015 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. +# + +add_lunch_combo rpi2-eng