blob: 3731cabb70fad8238a3403c7223878179604bde8 [file] [log] [blame]
codeworkx222b7942013-02-11 17:29:55 +00001#!/bin/sh
2
3# Copyright (C) 2013 The CyanogenMod Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17VENDOR=samsung
18COMMON=omap4-common
19COMMONOUTDIR=vendor/$VENDOR/$COMMON
20COMMONBASE=../../../$COMMONOUTDIR/proprietary
21COMMONMAKEFILE=../../../$COMMONOUTDIR/common-vendor-blobs.mk
22COMMONPROPS=../$COMMON/proprietary-files.txt
23
24mkdir -p ../../../vendor/$VENDOR/$COMMON/proprietary
25
26adb root
27adb wait-for-device
28
29echo "Pulling common files..."
30for FILE in `cat $COMMONPROPS | grep -v ^# | grep -v ^$`; do
31 DIR=`dirname $FILE`
32 if [ ! -d $COMMONBASE/$DIR ]; then
33 mkdir -p $COMMONBASE/$DIR
34 fi
35 adb pull /$FILE $COMMONBASE/$FILE
36done
37
38
39(cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__VENDOR__/$VENDOR/g > $COMMONMAKEFILE
40# Copyright (C) 2013 The CyanogenMod Project
41#
42# Licensed under the Apache License, Version 2.0 (the "License");
43# you may not use this file except in compliance with the License.
44# You may obtain a copy of the License at
45#
46# http://www.apache.org/licenses/LICENSE-2.0
47#
48# Unless required by applicable law or agreed to in writing, software
49# distributed under the License is distributed on an "AS IS" BASIS,
50# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51# See the License for the specific language governing permissions and
52# limitations under the License.
53
54LOCAL_PATH := vendor/samsung/__COMMON__
55
56PRODUCT_COPY_FILES += \\
57EOF
58
59LINEEND=" \\"
60COUNT=`cat $COMMONPROPS | grep -v ^# | grep -v ^$ | wc -l | awk {'print $1'}`
61for FILE in `cat $COMMONPROPS | grep -v ^# | grep -v ^$`; do
62 COUNT=`expr $COUNT - 1`
63 if [ $COUNT = "0" ]; then
64 LINEEND=""
65 fi
66 echo " \$(LOCAL_PATH)/proprietary/$FILE:$FILE$LINEEND" >> $COMMONMAKEFILE
67done
68
69(cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__VENDOR__/$VENDOR/g > $COMMONBASE/Android.mk
70# Copyright (C) 2013 The CyanogenMod Project
71#
72# Licensed under the Apache License, Version 2.0 (the "License");
73# you may not use this file except in compliance with the License.
74# You may obtain a copy of the License at
75#
76# http://www.apache.org/licenses/LICENSE-2.0
77#
78# Unless required by applicable law or agreed to in writing, software
79# distributed under the License is distributed on an "AS IS" BASIS,
80# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81# See the License for the specific language governing permissions and
82# limitations under the License.
83
84ifneq (\$(filter i9100g p3100 p3110 p5100 p5110,\$(TARGET_DEVICE)),)
85
86LOCAL_PATH := \$(call my-dir)
87
88# Creating Gralloc SymLink
89GRALLOC_SYMLINK := \$(TARGET_OUT_VENDOR)/lib/hw/gralloc.\$(TARGET_BOARD_PLATFORM).so
90\$(GRALLOC_SYMLINK): GRALLOC_FILE := gralloc.omap\$(TARGET_BOARD_OMAP_CPU).so
91\$(GRALLOC_SYMLINK): \$(LOCAL_INSTALLED_MODULE) \$(LOCAL_PATH)/Android.mk
92 @echo "Symlink: \$@ -> \$(GRALLOC_FILE)"
93 @rm -rf \$@
94 \$(hide) ln -fs \$(GRALLOC_FILE) \$@
95
96ALL_DEFAULT_INSTALLED_MODULES += \$(GRALLOC_SYMLINK)
97
98# for mm/mmm
99all_modules: \$(GRALLOC_SYMLINK)
100
101endif
102
103EOF
104
105(cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__VENDOR__/$VENDOR/g > ../../../$COMMONOUTDIR/common-vendor.mk
106# Copyright (C) 2013 The CyanogenMod Project
107#
108# Licensed under the Apache License, Version 2.0 (the "License");
109# you may not use this file except in compliance with the License.
110# You may obtain a copy of the License at
111#
112# http://www.apache.org/licenses/LICENSE-2.0
113#
114# Unless required by applicable law or agreed to in writing, software
115# distributed under the License is distributed on an "AS IS" BASIS,
116# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
117# See the License for the specific language governing permissions and
118# limitations under the License.
119
120# Pick up overlay for features that depend on non-open-source files
121DEVICE_PACKAGE_OVERLAYS += vendor/__VENDOR__/__COMMON__/overlay
122
123\$(call inherit-product, vendor/__VENDOR__/__COMMON__/common-vendor-blobs.mk)
124EOF
125
126(cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__VENDOR__/$VENDOR/g > ../../../$COMMONOUTDIR/BoardConfigVendor.mk
127# Copyright (C) 2013 The CyanogenMod Project
128#
129# Licensed under the Apache License, Version 2.0 (the "License");
130# you may not use this file except in compliance with the License.
131# You may obtain a copy of the License at
132#
133# http://www.apache.org/licenses/LICENSE-2.0
134#
135# Unless required by applicable law or agreed to in writing, software
136# distributed under the License is distributed on an "AS IS" BASIS,
137# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138# See the License for the specific language governing permissions and
139# limitations under the License.
140
141EOF
142