codeworkx | 222b794 | 2013-02-11 17:29:55 +0000 | [diff] [blame] | 1 | #!/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 | |
| 17 | VENDOR=samsung |
| 18 | COMMON=omap4-common |
| 19 | COMMONOUTDIR=vendor/$VENDOR/$COMMON |
| 20 | COMMONBASE=../../../$COMMONOUTDIR/proprietary |
| 21 | COMMONMAKEFILE=../../../$COMMONOUTDIR/common-vendor-blobs.mk |
| 22 | COMMONPROPS=../$COMMON/proprietary-files.txt |
| 23 | |
| 24 | mkdir -p ../../../vendor/$VENDOR/$COMMON/proprietary |
| 25 | |
| 26 | adb root |
| 27 | adb wait-for-device |
| 28 | |
| 29 | echo "Pulling common files..." |
| 30 | for 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 |
| 36 | done |
| 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 | |
| 54 | LOCAL_PATH := vendor/samsung/__COMMON__ |
| 55 | |
| 56 | PRODUCT_COPY_FILES += \\ |
| 57 | EOF |
| 58 | |
| 59 | LINEEND=" \\" |
| 60 | COUNT=`cat $COMMONPROPS | grep -v ^# | grep -v ^$ | wc -l | awk {'print $1'}` |
| 61 | for 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 |
| 67 | done |
| 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 | |
| 84 | ifneq (\$(filter i9100g p3100 p3110 p5100 p5110,\$(TARGET_DEVICE)),) |
| 85 | |
| 86 | LOCAL_PATH := \$(call my-dir) |
| 87 | |
| 88 | # Creating Gralloc SymLink |
| 89 | GRALLOC_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 | |
| 96 | ALL_DEFAULT_INSTALLED_MODULES += \$(GRALLOC_SYMLINK) |
| 97 | |
| 98 | # for mm/mmm |
| 99 | all_modules: \$(GRALLOC_SYMLINK) |
| 100 | |
| 101 | endif |
| 102 | |
| 103 | EOF |
| 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 |
| 121 | DEVICE_PACKAGE_OVERLAYS += vendor/__VENDOR__/__COMMON__/overlay |
| 122 | |
| 123 | \$(call inherit-product, vendor/__VENDOR__/__COMMON__/common-vendor-blobs.mk) |
| 124 | EOF |
| 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 | |
| 141 | EOF |
| 142 | |