3 # Copyright (C) 2010 The Android Open Source Project
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # This script auto-generates the lists of proprietary blobs necessary to build
18 # the Android Open-Source Project code for a variety of hardware targets.
20 # It needs to be run from the root of a source tree that can repo sync,
21 # runs builds with and without the vendor tree, and uses the difference
22 # to generate the lists.
24 # It can optionally upload the results to a Gerrit server for review.
26 # WARNING: It destroys the source tree. Don't leave anything precious there.
28 # Caveat: this script does many full builds (2 per device). It takes a while
29 # to run. It's best # suited for overnight runs on multi-CPU machines
32 # Syntax: device/common/generate-blob-lists.sh -f|--force [<server> <branch>]
34 # If the server and branch paramters are both present, the script will upload
35 # new files (if there's been any change) to the mentioned Gerrit server,
36 # in the specified branch.
38 if test "$1" != "-f" -a "$1" != "--force"
40 echo This script must be run with the --force option
45 DEVICES="crespo wingray panda maguro grouper"
52 ARCHIVEDIR=archive-$(date +%s)
53 if test -d archive-ref
55 cp -R archive-ref $ARCHIVEDIR
60 for DEVICENAME in $DEVICES
63 if test $DEVICENAME = maguro
66 make -j32 libdrmdecrypt
68 if test $DEVICENAME = toro
71 make -j32 libdrmdecrypt
73 lunch full_$DEVICENAME-user
75 cat out/target/product/$DEVICENAME/installed-files.txt |
77 sort -f > $ARCHIVEDIR/$DEVICENAME-with.txt
80 for DEVICENAME in $DEVICES
83 lunch full_$DEVICENAME-user
85 cat out/target/product/$DEVICENAME/installed-files.txt |
87 sort -f > $ARCHIVEDIR/$DEVICENAME-without.txt
91 for DEVICENAME in $DEVICES
93 MANUFACTURERNAME=$( find device -type d | grep [^/]\*/[^/]\*/$DEVICENAME\$ | cut -f 2 -d / )
94 if test $(wc -l < $ARCHIVEDIR/$DEVICENAME-without.txt) != 0 -a $(wc -l < $ARCHIVEDIR/$DEVICENAME-with.txt) != 0
97 echo '# Copyright (C) 2011 The Android Open Source Project'
99 echo '# Licensed under the Apache License, Version 2.0 (the "License");'
100 echo '# you may not use this file except in compliance with the License.'
101 echo '# You may obtain a copy of the License at'
103 echo '# http://www.apache.org/licenses/LICENSE-2.0'
105 echo '# Unless required by applicable law or agreed to in writing, software'
106 echo '# distributed under the License is distributed on an "AS IS" BASIS,'
107 echo '# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.'
108 echo '# See the License for the specific language governing permissions and'
109 echo '# limitations under the License.'
111 echo '# This file is generated by device/common/generate-blob-lists.sh - DO NOT EDIT'
113 diff $ARCHIVEDIR/$DEVICENAME-without.txt $ARCHIVEDIR/$DEVICENAME-with.txt |
117 ) > $ARCHIVEDIR/$DEVICENAME-proprietary-blobs.txt
118 cp $ARCHIVEDIR/$DEVICENAME-proprietary-blobs.txt device/$MANUFACTURERNAME/$DEVICENAME/proprietary-blobs.txt
121 cd device/$MANUFACTURERNAME/$DEVICENAME
123 git commit -m "$(echo -e 'auto-generated blob list\n\nBug: 4295425')"
124 if test "$1" != "" -a "$2" != ""
126 echo uploading to server $1 branch $2
127 git push ssh://$1:29418/device/$MANUFACTURERNAME/$DEVICENAME.git HEAD:refs/for/$2/autoblobs
132 cd device/$MANUFACTURERNAME/$DEVICENAME
133 git commit --allow-empty -m "$(echo -e 'DO NOT SUBMIT - BROKEN BUILD\n\nBug: 4295425')"
134 if test "$1" != "" -a "$2" != ""
136 echo uploading to server $1 branch $2
137 git push ssh://$1:29418/device/$MANUFACTURERNAME/$DEVICENAME.git HEAD:refs/for/$2/autoblobs
146 elif ! test -d archive-ref
152 grep -v ^device/common$ |