Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
peyo-hd committed Feb 26, 2015
0 parents commit adf629e
Show file tree
Hide file tree
Showing 14 changed files with 331 additions and 0 deletions.
1 change: 1 addition & 0 deletions AndroidProducts.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PRODUCT_MAKEFILES := $(LOCAL_DIR)/rpi2.mk
37 changes: 37 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions egl.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0 0 android
8 changes: 8 additions & 0 deletions fstab.rpi2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# 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
56 changes: 56 additions & 0 deletions init.rpi2.rc
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions init.usb.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
# USB configuration
#
56 changes: 56 additions & 0 deletions overlay/frameworks/base/core/res/res/values/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<!-- Flag indicating that the media framework should allow changing
master volume stream and nothing else . -->
<bool name="config_useMasterVolume">true</bool>

<!-- Flag indicating that the media framework should support playing of sounds on volume
key usage. This adds noticeable additional overhead to volume key processing, so
is disableable for products for which it is irrelevant. -->
<bool name="config_useVolumeKeySounds">false</bool>

<!-- Disable AUDIO_BECOMING_NOISY notifications. -->
<bool name="config_sendAudioBecomingNoisy">false</bool>

<!-- This device is data-only. -->
<bool name="config_voice_capable">false</bool>

<!-- This device does not allow sms service. -->
<bool name="config_sms_capable">false</bool>

<!-- Control the default UI mode type to use when there is no other type override
happening. One of the following values (See Configuration.java):
1 UI_MODE_TYPE_NORMAL
4 UI_MODE_TYPE_TELEVISION
5 UI_MODE_TYPE_APPLIANCE
Any other values will have surprising consequences. -->
<integer name="config_defaultUiModeType">4</integer>

<!-- Override long press on home: launch assist intent. -->
<integer name="config_longPressOnHomeBehavior">2</integer>

<!-- Override configuration check for dpad so that we always appear to have one -->
<bool name="config_hasPermanentDpad">true</bool>


<!-- An Array of "[Connection name],[ConnectivityManager.TYPE_xxxx],
[associated radio-type],[priority],[restoral-timer(ms)],[dependencyMet] -->
<!-- the 5th element "restore-time" indicates the number of milliseconds to delay
before automatically restore the default connection. Set -1 if the connection
does not require auto-restore. -->
<!-- the 6th element indicates boot-time dependency-met value. -->
<string-array translatable="false" name="networkAttributes">
<item>"ethernet,9,9,9,-1,true"</item>
</string-array>

<!-- An Array of "[ConnectivityManager connectionType],
[# simultaneous connection types]" -->
<string-array translatable="false" name="radioAttributes">
<item>"9,1"</item>
</string-array>

<!-- Apps that are authorized to access shared accounts -->
<string name="config_appsAuthorizedForSharedAccounts">;com.android.tv.settings;</string>

</resources>
44 changes: 44 additions & 0 deletions overlay/frameworks/base/core/res/res/xml/storage_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
**
** Copyright 2012, 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.
*/
-->

<!-- The <device> element should contain one or more <storage> elements.
Exactly one of these should have the attribute primary="true".
This storage will be the primary external storage and should have path="/mnt/sdcard".
Each storage should have both a path and description attribute set.
The following boolean attributes are optional:
primary: this storage is the primary external storage
removable: this is removable storage (for example, a real SD card)
emulated: the storage is emulated via the FUSE sdcard daemon
mtp-reserve: number of megabytes of storage MTP should reserve for free storage
(used for emulated storage that is shared with system's data partition)
allowMassStorage: (boolean) true if this volume can be shared via USB mass storage
maxFileSize: (integer) maximum file size in megabytes
A storage should not have both emulated and removable set to true
-->

<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
<!-- internal emulated storage -->
<storage android:mountPoint="/storage/sdcard0"
android:storageDescription="@string/storage_internal"
android:primary="true"
android:emulated="true"
android:mtpReserve="100" />
</StorageList>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->

<resources>

<!-- Do not enable auto rotation switching -->
<bool name="def_accelerometer_rotation">false</bool>

<!-- Disable the lockscreen -->
<bool name="def_lockscreen_disabled">true</bool>

<!-- No setup wizard -->
<bool name="def_device_provisioned">true</bool>

<!-- Keep screen on at all times by default -->
<bool name="def_stay_on_while_plugged_in">true</bool>

<!-- Do not give up on DHCP -->
<integer name="def_max_dhcp_retries">0</integer>

</resources>
25 changes: 25 additions & 0 deletions overlay/frameworks/base/packages/SystemUI/res/values/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->

<resources>

<!-- Empty stub status/navigation bar -->
<string name="config_statusBarComponent" translatable="false">com.android.systemui.statusbar.tv.TvStatusBar</string>

<!-- Disable KeyguardSerivce -->
<bool name="config_enableKeyguardService">false</bool>

</resources>
33 changes: 33 additions & 0 deletions rpi2.mk
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions rpi2_core_hardware.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<feature name="android.hardware.audio.output" />
<feature name="android.hardware.location" />
<feature name="android.hardware.location.network" />
<feature name="android.hardware.screen.landscape" />
<feature name="android.hardware.type.television" />

<feature name="android.software.app_widgets" />
<feature name="android.software.backup" />
<feature name="android.software.leanback" />
<feature name="android.software.live_tv" />

</permissions>
2 changes: 2 additions & 0 deletions system.prop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ro.kernel.qemu=1
ro.sf.lcd_density=213
17 changes: 17 additions & 0 deletions vendorsetup.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit adf629e

Please sign in to comment.