Advertisement
ruberval

./extract-files.sh

Feb 22nd, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 9.54 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Copyright (C) 2012 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=galaxys2-common
  19. DEVICE=i9100
  20. COMMONOUTDIR=vendor/$VENDOR/$COMMON
  21. COMMONBASE=../../../$COMMONOUTDIR/proprietary
  22. COMMONMAKEFILE=../../../$COMMONOUTDIR/common-vendor-blobs.mk
  23. DEVICEOUTDIR=vendor/$VENDOR/$DEVICE
  24. DEVICEBASE=../../../$DEVICEOUTDIR/proprietary
  25. DEVICEMAKEFILE=../../../$DEVICEOUTDIR/$DEVICE-vendor-blobs.mk
  26.  
  27. echo "Pulling common files..."
  28. for FILE in `cat proprietary-common-files.txt | grep -v ^# | grep -v ^$`; do
  29.     DIR=`dirname $FILE`
  30.     if [ ! -d $COMMONBASE/$DIR ]; then
  31.         mkdir -p $COMMONBASE/$DIR
  32.     fi
  33.     adb pull /$FILE $COMMONBASE/$FILE
  34. done
  35.  
  36. adb pull /system/lib/hw/vendor-camera.exynos4.so $COMMONBASE/system/lib/hw/camera.exynos4.so
  37.  
  38. echo "Pulling device specific files..."
  39. for FILE in `cat proprietary-$DEVICE-files.txt | grep -v ^# | grep -v ^$`; do
  40.     DIR=`dirname $FILE`
  41.     if [ ! -d $DEVICEBASE/$DIR ]; then
  42.         mkdir -p $DEVICEBASE/$DIR
  43.     fi
  44.     adb pull /$FILE $DEVICEBASE/$FILE
  45. done
  46.  
  47. (cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__DEVICE__/$DEVICE/g | sed s/__VENDOR__/$VENDOR/g > $COMMONMAKEFILE
  48. # Copyright (C) 2012 The CyanogenMod Project
  49. #
  50. # Licensed under the Apache License, Version 2.0 (the "License");
  51. # you may not use this file except in compliance with the License.
  52. # You may obtain a copy of the License at
  53. #
  54. #      http://www.apache.org/licenses/LICENSE-2.0
  55. #
  56. # Unless required by applicable law or agreed to in writing, software
  57. # distributed under the License is distributed on an "AS IS" BASIS,
  58. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  59. # See the License for the specific language governing permissions and
  60. # limitations under the License.
  61.  
  62. PRODUCT_PACKAGES += \\
  63.     libTVOut \\
  64.     libUMP \\
  65.     libfimc \\
  66.     libhdmi \\
  67.     libhdmiclient \\
  68.     libsecion
  69.  
  70. PRODUCT_COPY_FILES += \\
  71.     vendor/__VENDOR__/__COMMON__/proprietary/system/lib/hw/camera.exynos4.so:system/lib/hw/vendor-camera.exynos4.so \\
  72. EOF
  73.  
  74. LINEEND=" \\"
  75. COUNT=`cat proprietary-common-files.txt | grep -v ^# | grep -v ^$ | wc -l | awk {'print $1'}`
  76. for FILE in `cat proprietary-common-files.txt | grep -v ^# | grep -v ^$`; do
  77.     COUNT=`expr $COUNT - 1`
  78.     if [ $COUNT = "0" ]; then
  79.         LINEEND=""
  80.     fi
  81.     echo "    $COMMONOUTDIR/proprietary/$FILE:$FILE$LINEEND" >> $COMMONMAKEFILE
  82. done
  83.  
  84. (cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__DEVICE__/$DEVICE/g | sed s/__VENDOR__/$VENDOR/g > $COMMONBASE/Android.mk
  85. # Copyright (C) 2012 The CyanogenMod Project
  86. #
  87. # Licensed under the Apache License, Version 2.0 (the "License");
  88. # you may not use this file except in compliance with the License.
  89. # You may obtain a copy of the License at
  90. #
  91. #      http://www.apache.org/licenses/LICENSE-2.0
  92. #
  93. # Unless required by applicable law or agreed to in writing, software
  94. # distributed under the License is distributed on an "AS IS" BASIS,
  95. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  96. # See the License for the specific language governing permissions and
  97. # limitations under the License.
  98.  
  99. LOCAL_PATH := \$(call my-dir)
  100.  
  101. ifneq (\$(filter i777 i9100 n7000,\$(TARGET_DEVICE)),)
  102.  
  103. include \$(CLEAR_VARS)
  104. LOCAL_MODULE := libTVOut
  105. LOCAL_MODULE_OWNER := samsung
  106. LOCAL_SRC_FILES := system/lib/libTVOut.so
  107. LOCAL_MODULE_TAGS := optional
  108. LOCAL_MODULE_SUFFIX := .so
  109. LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  110. LOCAL_MODULE_PATH := \$(TARGET_OUT)/lib
  111. include \$(BUILD_PREBUILT)
  112.  
  113. include \$(CLEAR_VARS)
  114. LOCAL_MODULE := libUMP
  115. LOCAL_MODULE_OWNER := samsung
  116. LOCAL_SRC_FILES := system/lib/libUMP.so
  117. LOCAL_MODULE_TAGS := optional
  118. LOCAL_MODULE_SUFFIX := .so
  119. LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  120. LOCAL_MODULE_PATH := \$(TARGET_OUT)/lib
  121. include \$(BUILD_PREBUILT)
  122.  
  123. include \$(CLEAR_VARS)
  124. LOCAL_MODULE := libsecion
  125. LOCAL_MODULE_OWNER := samsung
  126. LOCAL_SRC_FILES := system/lib/libsecion.so
  127. LOCAL_MODULE_TAGS := optional
  128. LOCAL_MODULE_SUFFIX := .so
  129. LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  130. LOCAL_MODULE_PATH := \$(TARGET_OUT)/lib
  131. include \$(BUILD_PREBUILT)
  132.  
  133. include \$(CLEAR_VARS)
  134. LOCAL_MODULE := libfimc
  135. LOCAL_MODULE_OWNER := samsung
  136. LOCAL_SRC_FILES := system/lib/libfimc.so
  137. LOCAL_MODULE_TAGS := optional
  138. LOCAL_MODULE_SUFFIX := .so
  139. LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  140. LOCAL_MODULE_PATH := \$(TARGET_OUT)/lib
  141. include \$(BUILD_PREBUILT)
  142.  
  143. include \$(CLEAR_VARS)
  144. LOCAL_MODULE := libhdmi
  145. LOCAL_MODULE_OWNER := samsung
  146. LOCAL_SRC_FILES := system/lib/libhdmi.so
  147. LOCAL_MODULE_TAGS := optional
  148. LOCAL_MODULE_SUFFIX := .so
  149. LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  150. LOCAL_MODULE_PATH := \$(TARGET_OUT)/lib
  151. include \$(BUILD_PREBUILT)
  152.  
  153. include \$(CLEAR_VARS)
  154. LOCAL_MODULE := libhdmiclient
  155. LOCAL_MODULE_OWNER := samsung
  156. LOCAL_SRC_FILES := system/lib/libhdmiclient.so
  157. LOCAL_MODULE_TAGS := optional
  158. LOCAL_MODULE_SUFFIX := .so
  159. LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  160. LOCAL_MODULE_PATH := \$(TARGET_OUT)/lib
  161. include \$(BUILD_PREBUILT)
  162.  
  163. endif
  164.  
  165. EOF
  166.  
  167. (cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__DEVICE__/$DEVICE/g | sed s/__VENDOR__/$VENDOR/g > $DEVICEMAKEFILE
  168. # Copyright (C) 2012 The CyanogenMod Project
  169. #
  170. # Licensed under the Apache License, Version 2.0 (the "License");
  171. # you may not use this file except in compliance with the License.
  172. # You may obtain a copy of the License at
  173. #
  174. #      http://www.apache.org/licenses/LICENSE-2.0
  175. #
  176. # Unless required by applicable law or agreed to in writing, software
  177. # distributed under the License is distributed on an "AS IS" BASIS,
  178. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  179. # See the License for the specific language governing permissions and
  180. # limitations under the License.
  181.  
  182. # Prebuilt libraries that are needed to build open-source libraries
  183. PRODUCT_COPY_FILES := \\
  184.     vendor/__VENDOR__/__DEVICE__/proprietary/system/lib/libril.so:obj/lib/libril.so \\
  185.     vendor/__VENDOR__/__DEVICE__/proprietary/system/lib/libsecril-client.so:obj/lib/libsecril-client.so
  186.  
  187. PRODUCT_COPY_FILES += \\
  188. EOF
  189.  
  190. LINEEND=" \\"
  191. COUNT=`cat proprietary-$DEVICE-files.txt | grep -v ^# | grep -v ^$ | wc -l | awk {'print $1'}`
  192. for FILE in `cat proprietary-$DEVICE-files.txt | grep -v ^# | grep -v ^$`; do
  193.     COUNT=`expr $COUNT - 1`
  194.     if [ $COUNT = "0" ]; then
  195.         LINEEND=""
  196.     fi
  197.     echo "    $DEVICEOUTDIR/proprietary/$FILE:$FILE$LINEEND" >> $DEVICEMAKEFILE
  198. done
  199.  
  200. (cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__DEVICE__/$DEVICE/g | sed s/__VENDOR__/$VENDOR/g > ../../../$COMMONOUTDIR/common-vendor.mk
  201. # Copyright (C) 2012 The CyanogenMod Project
  202. #
  203. # Licensed under the Apache License, Version 2.0 (the "License");
  204. # you may not use this file except in compliance with the License.
  205. # You may obtain a copy of the License at
  206. #
  207. #      http://www.apache.org/licenses/LICENSE-2.0
  208. #
  209. # Unless required by applicable law or agreed to in writing, software
  210. # distributed under the License is distributed on an "AS IS" BASIS,
  211. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  212. # See the License for the specific language governing permissions and
  213. # limitations under the License.
  214.  
  215. # Pick up overlay for features that depend on non-open-source files
  216. DEVICE_PACKAGE_OVERLAYS += vendor/__VENDOR__/__COMMON__/overlay
  217.  
  218. \$(call inherit-product, vendor/__VENDOR__/__COMMON__/common-vendor-blobs.mk)
  219. EOF
  220.  
  221. (cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__DEVICE__/$DEVICE/g | sed s/__VENDOR__/$VENDOR/g > ../../../$DEVICEOUTDIR/BoardConfigVendor.mk
  222. # Copyright (C) 2012 The CyanogenMod Project
  223. #
  224. # Licensed under the Apache License, Version 2.0 (the "License");
  225. # you may not use this file except in compliance with the License.
  226. # You may obtain a copy of the License at
  227. #
  228. #      http://www.apache.org/licenses/LICENSE-2.0
  229. #
  230. # Unless required by applicable law or agreed to in writing, software
  231. # distributed under the License is distributed on an "AS IS" BASIS,
  232. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  233. # See the License for the specific language governing permissions and
  234. # limitations under the License.
  235.  
  236. USE_CAMERA_STUB := false
  237. BOARD_USES_GENERIC_AUDIO := false
  238. EOF
  239.  
  240. (cat << EOF) | sed s/__COMMON__/$COMMON/g | sed s/__DEVICE__/$DEVICE/g | sed s/__VENDOR__/$VENDOR/g > ../../../$DEVICEOUTDIR/$DEVICE-vendor.mk
  241. # Copyright (C) 2012 The CyanogenMod Project
  242. #
  243. # Licensed under the Apache License, Version 2.0 (the "License");
  244. # you may not use this file except in compliance with the License.
  245. # You may obtain a copy of the License at
  246. #
  247. #      http://www.apache.org/licenses/LICENSE-2.0
  248. #
  249. # Unless required by applicable law or agreed to in writing, software
  250. # distributed under the License is distributed on an "AS IS" BASIS,
  251. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  252. # See the License for the specific language governing permissions and
  253. # limitations under the License.
  254.  
  255. # Pick up overlay for features that depend on non-open-source files
  256. DEVICE_PACKAGE_OVERLAYS += vendor/__VENDOR__/__DEVICE__/overlay
  257.  
  258. \$(call inherit-product, vendor/__VENDOR__/__DEVICE__/__DEVICE__-vendor-blobs.mk)
  259. EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement