forked from AOKP/platform_manifest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manual_add_kernel_manifest.sh
executable file
·36 lines (30 loc) · 1.11 KB
/
manual_add_kernel_manifest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# To be run from the root of the build tree.
# NOT FROM THE PLATFORM_MANIFEST DIRECTORY!!!
# -KhasMek
echo "adding kernel repos to your build tree"
if [ -f .repo/local_manifest.xml ]; then
echo "local manifest already present."
echo "merging with kernel manifest for safety."
cat platform_manifest/kernel_manifest.xml | while read line
do
kernel=`grep "$line" .repo/local_manifest.xml`
if [ -z "$kernel" ]; then
echo " $line" >> .repo/local_manifest.xml
fi
done
# Cleanup
grep -Ev "^</manifest>" .repo/local_manifest.xml > .repo/local_manifest.new
echo "</manifest>" >> .repo/local_manifest.new
mv .repo/local_manifest.new .repo/local_manifest.xml
fi
cp platform_manifest/kernel_manifest.xml .repo/local_manifest.xml
echo "syncing kernel repos"
tail -n +3 platform_manifest/kernel_manifest.xml | head -n -1 | cut -f2 -d '"' > .sync
. build/envsetup.sh
while read line ;do
reposync "$line"
echo "$line synced successfully"
done < .sync
#cleanup
rm .sync