Skip to content

Commit

Permalink
initial device config (minimal) for bootimage creation
Browse files Browse the repository at this point in the history
Signed-off-by: Arnav Gupta <[email protected]>
  • Loading branch information
championswimmer committed Jul 17, 2012
1 parent 8ed0fff commit fddb618
Show file tree
Hide file tree
Showing 15 changed files with 363 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
LOCAL_PATH := $(call my-dir)
# if some modules are built directly from this directory (not subdirectories),
# their rules should be written here.
ifeq ($(TARGET_DEVICE),nypon)
include $(call all-makefiles-under,$(LOCAL_PATH))
endif
19 changes: 19 additions & 0 deletions AndroidBoard.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (C) 2007 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.

LOCAL_PATH := $(call my-dir)

# Least specific includes go first, so that they can get
# overridden further down
include $(CLEAR_VARS)
29 changes: 29 additions & 0 deletions AndroidProducts.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Copyright (C) 2008 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.
#

#
# This file should set PRODUCT_MAKEFILES to a list of product makefiles
# to expose to the build system. LOCAL_DIR will already be set to
# the directory containing this file.
#
# This file may not rely on the value of any variable other than
# LOCAL_DIR; do not use any conditionals, and do not look up the
# value of any variable that isn't set in this file or in a file that
# it includes.
#

PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/full_nypon.mk
9 changes: 9 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-include device/sony/u8500_common/BoardConfigCommon.mk

TARGET_KERNEL_SOURCE := kernel/sony/u8500
#TARGET_KERNEL_CONFIG := cyanogen_zeus_defconfig
TARGET_PREBUILT_KERNEL := device/semc/zeus/prebuilt/kernel

BOARD_CUSTOM_RECOVERY_KEYMAPPING := ../../device/sony/nypon/recovery/recovery_keys.c

TARGET_OTA_ASSERT_DEVICE := LT22i,LT22a,nypon,Sola,LT22
49 changes: 49 additions & 0 deletions CleanSpec.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright (C) 2007 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.
#

# If you don't need to do a full clean build but would like to touch
# a file or delete some intermediate files, add a clean step to the end
# of the list. These steps will only be run once, if they haven't been
# run before.
#
# E.g.:
# $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
#
# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
# files that are missing or have been moved.
#
# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
# Use $(OUT_DIR) to refer to the "out" directory.
#
# If you need to re-do something that's already mentioned, just copy
# the command and add it to the bottom of the list. E.g., if a change
# that you made last week required touching a file and a change you
# made today requires touching the same file, just copy the old
# touch step and add it to the end of the list.
#
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************

# For example:
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)

# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
35 changes: 35 additions & 0 deletions cm.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Release name
PRODUCT_RELEASE_NAME := LT22i
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Inherit device configuration
$(call inherit-product, device/sony/nypon/full_nypon.mk)
## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := nypon
PRODUCT_NAME := cm_nypon
PRODUCT_BRAND := Sony
PRODUCT_MODEL := LT22i
PRODUCT_MANUFACTURER := Sony

PRODUCT_COPY_FILES += \
bootable/recovery/res/images/icon_firmware_error.png:root/res/images/icon_firmware_error.png \
bootable/recovery/res/images/icon_firmware_install.png:root/res/images/icon_firmware_install.png \
bootable/recovery/res/images/icon_clockwork.png:root/res/images/icon_clockwork.png \
bootable/recovery/res/images/icon_error.png:root/res/images/icon_error.png \
bootable/recovery/res/images/icon_installing.png:root/res/images/icon_installing.png \
bootable/recovery/res/images/icon_installing_overlay01.png:root/res/images/icon_installing_overlay01.png \
bootable/recovery/res/images/icon_installing_overlay02.png:root/res/images/icon_installing_overlay02.png \
bootable/recovery/res/images/icon_installing_overlay03.png:root/res/images/icon_installing_overlay03.png \
bootable/recovery/res/images/icon_installing_overlay04.png:root/res/images/icon_installing_overlay04.png \
bootable/recovery/res/images/icon_installing_overlay05.png:root/res/images/icon_installing_overlay05.png \
bootable/recovery/res/images/icon_installing_overlay06.png:root/res/images/icon_installing_overlay06.png \
bootable/recovery/res/images/icon_installing_overlay07.png:root/res/images/icon_installing_overlay07.png \
bootable/recovery/res/images/indeterminate01.png:root/res/images/indeterminate01.png \
bootable/recovery/res/images/indeterminate02.png:root/res/images/indeterminate02.png \
bootable/recovery/res/images/indeterminate03.png:root/res/images/indeterminate03.png \
bootable/recovery/res/images/indeterminate04.png:root/res/images/indeterminate04.png \
bootable/recovery/res/images/indeterminate05.png:root/res/images/indeterminate05.png \
bootable/recovery/res/images/indeterminate06.png:root/res/images/indeterminate06.png \
bootable/recovery/res/images/progress_empty.png:root/res/images/progress_empty.png \
bootable/recovery/res/images/progress_fill.png:root/res/images/progress_fill.png

33 changes: 33 additions & 0 deletions extract-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

VENDOR=sony
DEVICE=nypon

BASE=../../../vendor/$VENDOR/$DEVICE/proprietary

while getopts ":nh" options
do
case $options in
n ) NC=1 ;;
h ) echo "Usage: `basename $0` [OPTIONS] "
echo " -n No clenup"
echo " -h Show this help"
exit ;;
* ) ;;
esac
done

if [ "x$NC" != "x1" ];
then
rm -rf $BASE/*
fi

for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
DIR=`dirname $FILE`
if [ ! -d $BASE/$DIR ]; then
mkdir -p $BASE/$DIR
fi
adb pull /system/$FILE $BASE/$FILE
done

./setup-makefiles.sh
15 changes: 15 additions & 0 deletions full_nypon.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)

# proprietary side of the device
$(call inherit-product-if-exists, vendor/sony/nypon/nypon-vendor.mk)

# Set those variables here to overwrite the inherited values.
PRODUCT_DEVICE := nypon
PRODUCT_NAME := nypon
PRODUCT_BRAND := Sony
PRODUCT_MANUFACTURER := Sony
PRODUCT_MODEL := LT22i

PRODUCT_COPY_FILES += \
device/sony/u8500_common/prebuilt/bootrec:root/sbin/bootrec
16 changes: 16 additions & 0 deletions prebuilt/bootrec-device
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/sbin/sh


# short vibration
echo '200' > /sys/class/timed_output/vibrator/enable
# softkey backlight on
echo '255' > /sys/class/leds/button-backlight/brightness
# check for volume key presses
cat /dev/input/event2 > /dev/keycheck&
# wait 3 seconds
sleep 3


echo '0' > /sys/class/leds/button-backlight/brightness

kill -9 $!
1 change: 1 addition & 0 deletions prebuilt/kernel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
empty placeholder prebuilt kernel
1 change: 1 addition & 0 deletions proprietary-files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#we will populate this later on
6 changes: 6 additions & 0 deletions recovery.fstab
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# mount point fstype device [device2] fstype2
/cache ext4 /dev/block/mmcblk0p12
/data ext4 /dev/block/mmcblk0p11
/system ext4 /dev/block/mmcblk0p10
/sdcard vfat /dev/block/mmcblk0p14
/boot emmc /dev/block/mmcblk0p9
60 changes: 60 additions & 0 deletions recovery/recovery_keys.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (C) 2009 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 <linux/input.h>
#include "recovery_ui.h"
#include "common.h"
#include "extendedcommands.h"
int device_toggle_display(volatile char* key_pressed, int key_code) {
// hold power and press volume-up
return key_pressed[KEY_POWER] && key_code == KEY_VOLUMEUP;
}
int device_handle_key(int key_code, int visible) {
if (visible) {
switch (key_code) {
case KEY_CAPSLOCK:
case KEY_DOWN:
case KEY_VOLUMEDOWN:
case KEY_MENU:
return HIGHLIGHT_DOWN;
case KEY_LEFTSHIFT:
case KEY_UP:
case KEY_VOLUMEUP:
return HIGHLIGHT_UP;
case KEY_POWER:
if (ui_get_showing_back_button()) {
return SELECT_ITEM;
}
break;
case KEY_HOME:
case KEY_LEFTBRACE:
case KEY_ENTER:
case BTN_MOUSE:
case KEY_CAMERA:
case KEY_F21:
case KEY_SEND:
return SELECT_ITEM;
case KEY_END:
case KEY_BACKSPACE:
case KEY_SEARCH:
if (ui_get_showing_back_button()) {
return SELECT_ITEM;
}
case KEY_BACK:
return GO_BACK;
}
}
return NO_ACTION;
}
81 changes: 81 additions & 0 deletions setup-makefiles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/sh

VENDOR=sony
DEVICE=nypon
OUTDIR=vendor/$VENDOR/$DEVICE
MAKEFILE=../../../$OUTDIR/$DEVICE-vendor-blobs.mk

(cat << EOF) > $MAKEFILE
# Copyright (C) 2011 The CyanogenMod 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.
# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh
# Prebuilt libraries that are needed to build open-source libraries
#PRODUCT_COPY_FILES += \\
#$OUTDIR/proprietary/lib/libaudioalsa.so:obj/lib/libaudioalsa.so \\
#$OUTDIR/proprietary/lib/libv8.so:obj/lib/libv8.so
PRODUCT_COPY_FILES += \\
EOF
LINEEND=" \\"
COUNT=`cat proprietary-files.txt | grep -v ^# | grep -v ^$ | wc -l | awk {'print $1'}`
for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
COUNT=`expr $COUNT - 1`
if [ $COUNT = "0" ]; then
LINEEND=""
fi
echo " $OUTDIR/proprietary/$FILE:system/$FILE$LINEEND" >> $MAKEFILE
done
(cat << EOF) > ../../../$OUTDIR/$DEVICE-vendor.mk
# Copyright (C) 2011 The CyanogenMod 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.
# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh
\$(call inherit-product, vendor/$VENDOR/$DEVICE/$DEVICE-vendor-blobs.mk)
EOF
(cat << EOF) > ../../../$OUTDIR/BoardConfigVendor.mk
# Copyright (C) 2011 The CyanogenMod 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.
# This file is generated by device/$VENDOR/$DEVICE/setup-makefiles.sh
USE_CAMERA_STUB := false
EOF
3 changes: 3 additions & 0 deletions vendorsetup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_lunch_combo nypon-eng
add_lunch_combo cm_nypon-userdebug
add_lunch_combo aokp_nypon-userdebug

0 comments on commit fddb618

Please sign in to comment.