Merge lp:~pundiramit/linaro-android-build-tools/user-build-script into lp:linaro-android-build-tools

Proposed by Amit Pundir on 2012-12-12
Status: Merged
Approved by: Paul Sokolovsky on 2012-12-19
Approved revision: 543
Merged at revision: 543
Proposed branch: lp:~pundiramit/linaro-android-build-tools/user-build-script
Merge into: lp:linaro-android-build-tools
Diff against target: 107 lines (+51/-5)
1 file modified
build-scripts/create-user-build-script (+51/-5)
To merge this branch: bzr merge lp:~pundiramit/linaro-android-build-tools/user-build-script
Reviewer Review Type Date Requested Status
Paul Sokolovsky 2012-12-12 Approve on 2012-12-19
Linaro Infrastructure 2012-12-17 Pending
Review via email: mp+139409@code.launchpad.net

Description of the change

This Merge Proposal update user build script to support linaro-android builds on 64 bit Ubuntu 10.04, 12.04 and 12.10 versions.

To post a comment you must log in.
542. By Amit Pundir on 2012-12-14

Update user build script to clone from linaro-private git repos

543. By Amit Pundir on 2012-12-17

Update user build script to prompt for login-id

Paul Sokolovsky (pfalcon) wrote :

Having updated list of packages required for build as well as check for x86_64 is definitely good. But I'm not sure about supporting access to linaro-private. The original idea of user build script was to simplify build process for outside/3rd-party users. But outside users are not supposed to have access to private Linaro repos at all, so I'm not sure if conveniencing access for them makes sense. So, I'd like to know what are the requirements/user stories behind this change.

review: Needs Information
Amit Pundir (pundiramit) wrote :

Right now outside/3rd party users can decode http:// link of git projects from manifest files anyways, though they can not access it. How to protect manifest files is a different task all together, which is currently been worked on.

3rd party developers can clone only public projects from linaro Git manifests and they will get public-key denied error for private projects.

Idea behind this change is to facilitate authorized linaro assignees to get access to private-repos and simplify their build experience.

Paul Sokolovsky (pfalcon) wrote :

I see, sounds good, and sorry for delay.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'build-scripts/create-user-build-script'
2--- build-scripts/create-user-build-script 2012-10-03 12:25:43 +0000
3+++ build-scripts/create-user-build-script 2012-12-17 09:50:25 +0000
4@@ -14,45 +14,73 @@
5 PINNED_MANIFEST_URL=${PINNED_MANIFEST_URL/_/\/}
6
7 if [ -n "$SOURCE_OVERLAY" ]; then
8- USAGE_SUM="'Usage: \$0 -m <manifest.xml> -o <overlay.tar> [ -t -d directory ]'"
9+ USAGE_SUM="'Usage: \$0 -m <manifest.xml> -o <overlay.tar> [ -t -d directory -l login ]'"
10 USAGE_OVERLAY="'\\n -m <manifest> If -t is not used, then using a browser with cookies you\\n must download the pinned manifest from:\\n $PINNED_MANIFEST_URL\\n -o The path to the vendor required overlay.\\n Can be downloaded from http://snapshots.linaro.org/android/binaries/$SOURCE_OVERLAY\\n'"
11 USAGE_OPTOVERLAY="m:o:"
12 USAGE_OPTHANDLER="o ) SOURCE_OVERLAY=\$OPTARG;; m ) MANIFEST=\$OPTARG;;"
13 else
14- USAGE_SUM="'Usage: \$0 [ -t -d directory ]'"
15+ USAGE_SUM="'Usage: \$0 [ -t -d directory -l login ]'"
16 fi
17
18 header()
19 {
20 cat <<EOF
21 #!/bin/bash
22+# Author+=amit.pundir@linaro.org
23
24 set -e
25
26 EXACT=1
27 DIR=android
28+ID=default-bot
29
30 usage()
31 {
32 echo $USAGE_SUM
33 echo -e $USAGE_OVERLAY
34- echo " -t Reproduce the from the tip of the branch rather than doing"
35+ echo " -t Reproduce the build from the tip of the branch rather than doing"
36 echo " an exact replica build"
37 echo " -d <directory> The directory to download code and build from"
38 echo " Default: \${DIR}"
39+ echo " -l <login-id> login-id to clone from linaro-private git repositories"
40+ echo " If in doubt, kindly raise access request to rt@linaro.org"
41+ echo " Default: \${ID}"
42 exit 1
43 }
44
45-while getopts "${USAGE_OPTOVERLAY}d:ht" optn; do
46+while getopts "${USAGE_OPTOVERLAY}d:l:ht" optn; do
47 case \$optn in
48 $USAGE_OPTHANDLER
49 d ) DIR=\$OPTARG;;
50+ l ) ID=\$OPTARG;;
51 t ) EXACT=0;;
52 h ) usage; exit 1;;
53 esac
54 done
55
56-PKGS='zip curl flex bison build-essential git-core gnupg gperf zlib1g-dev libx11-dev x11proto-core-dev gcc-multilib g++-multilib libc6-dev-i386 ia32-libs lib32z-dev uboot-mkimage uuid-dev openjdk-6-jdk ant lib32ncurses5-dev'
57+UBUNTU=`cat /etc/issue.net | cut -d' ' -f2`
58+HOST_ARCH=`uname -m`
59+if [ $HOST_ARCH == "x86_64" ] ; then
60+ PKGS='git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc uboot-mkimage openjdk-6-jdk openjdk-6-jre vim-common'
61+else
62+ echo "ERROR: Only 64bit Host(Build) machines are supported at the moment."
63+ exit 1
64+fi
65+if [ $UBUNTU == "12.10" ]; then
66+ PKGS+=' lib32readline-gplv2-dev'
67+elif [ $UBUNTU == "12.04" ] ; then
68+ PKGS+=' lib32readline-gplv2-dev'
69+elif [ $UBUNTU == "10.04" ] ; then
70+ PKGS+=' ia32-libs lib32readline5-dev'
71+else
72+ echo
73+ echo "ERROR: Only Ubuntu 10.04, 12.04 and 12.10 versiona are supported."
74+ exit 1
75+fi
76+
77+echo "Checking and installing missing dependencies if any .. .."
78+sudo apt-get install $PKGS
79+
80 MISSING=\`dpkg-query -W -f='\${Status}\n' \${PKGS} 2>&1 | grep 'No packages found matching' | cut -d' ' -f5\`
81 if [ -n "\$MISSING" ] ; then
82 echo "Missing required packages:"
83@@ -148,6 +176,24 @@
84 rm .repo/manifest.xml
85 $CP_CMD
86 fi
87+# check for linaro private git repositories
88+PRI=`grep -i "linaro-private" .repo/manifests/${MANIFEST_FILENAME} | wc -l`
89+if [ $PRI -gt 0 ] ; then
90+ if [ "$ID" == "default-bot" ] ; then
91+ echo "You must specify valid login/access-id to clone from linaro-private git repositories."
92+ echo "Press "y" to continue (which may result in incomplete build), OR"
93+ echo "Press "n" to enter login details, OR"
94+ echo "Press "h" for help."
95+ read NEXT
96+ if [ ${NEXT} == n ] ; then
97+ echo "Enter login/access-id:"
98+ read ID
99+ elif [ ${NEXT} == h ] ; then
100+ usage
101+ fi
102+ fi
103+ sed -i 's/\/\/.*-bot@/\/\/'"$ID"'@/' .repo/manifests/${MANIFEST_FILENAME}
104+fi
105 ./repo sync
106
107 EOF

Subscribers

People subscribed via source and target branches