aboutsummaryrefslogtreecommitdiff
path: root/build-scripts/create-user-kernel-script
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2012-04-09 22:24:03 -0500
committerAndy Doan <andy.doan@linaro.org>2012-04-09 22:24:03 -0500
commit79df9470a3db7d238f6429608dee81aed4fef80f (patch)
tree3d92c79103429f09681ec0a82939f7bcdcc73ee2 /build-scripts/create-user-kernel-script
parentdbaab76c3527c9cfa109a2458481a9b708d980c2 (diff)
allow origen/snowball builds to deal with .config click-through
Origen and Snowball builds have their kernel .config files behind a click-through. This updates the script generated for them to make the user download it and specify its location on disk to the script
Diffstat (limited to 'build-scripts/create-user-kernel-script')
-rwxr-xr-xbuild-scripts/create-user-kernel-script36
1 files changed, 30 insertions, 6 deletions
diff --git a/build-scripts/create-user-kernel-script b/build-scripts/create-user-kernel-script
index 4b1870c..e758c78 100755
--- a/build-scripts/create-user-kernel-script
+++ b/build-scripts/create-user-kernel-script
@@ -13,6 +13,17 @@ SNAPSHOT_URL=${BUILD_URL/http*jenkins\/job\//http://snapshots.linaro.org/android
# change the dash in doanac_build... to doanac/build...
SNAPSHOT_URL=${SNAPSHOT_URL/_/\/}
+CLICKTHROUGH=0
+[ ${TARGET_PRODUCT} == 'snowball' ] && CLICKTHROUGH=1
+[ ${TARGET_PRODUCT} == 'origen' ] && CLICKTHROUGH=1
+
+OPTS="d:ht"
+
+[ $CLICKTHROUGH ] && OPTS="c:d:ht"
+[ $CLICKTHROUGH ] && CLICKTHROUGH_OPT="-c .config"
+[ $CLICKTHROUGH ] && CLICKTHROUGH_OPT_CASE="c ) CFG=\$OPTARG;;"
+[ $CLICKTHROUGH ] && CLICKTHROUGH_MSG="\" -c .config file The kernel config file from the build. Download from:\n ${SNAPSHOT_URL}/kernel_config\n from a browser with cookies enabled.\""
+
header()
{
cat <<EOF
@@ -27,7 +38,8 @@ CPUS=\`grep -c processor /proc/cpuinfo\`
usage()
{
- echo 'Usage: \$0 [ -t -d directory ]'
+ echo 'Usage: \$0 ${CLICKTHROUGH_OPT}[ -t -d directory ]'
+ echo -e ${CLICKTHROUGH_MSG}
echo " -t Reproduce the from the tip of the branch rather than doing"
echo " an exact replica build"
echo " -d <directory> The directory to download code and build from"
@@ -35,15 +47,20 @@ usage()
exit 1
}
-while getopts "d:ht" optn; do
+while getopts "${OPTS}" optn; do
case \$optn in
d ) DIR=\$OPTARG;;
t ) EXACT=0;;
+ ${CLICKTHROUGH_OPT_CASE}
h ) usage; exit 1;;
esac
done
EOF
+if [ $CLICKTHROUGH -eq 1 ] ; then
+ echo "[ \$CFG ] || usage"
+ echo
+fi
}
sync_commands()
@@ -64,19 +81,26 @@ fi
cd \$DIR
git checkout $GITREV
-# download the kernel config
-curl -q $SNAPSHOT_URL/kernel_config > linaro_kernel_config
-
EOF
+if [ $CLICKTHROUGH -eq 0 ] ; then
+ echo "# download the kernel config"
+ echo "curl -q $SNAPSHOT_URL/kernel_config> linaro_kernel_config"
+ echo
+fi
}
build_commands()
{
+if [ $CLICKTHROUGH -eq 1 ] ; then
+ CP_CMD="cp \$CFG out/.config"
+else
+ CP_CMD="cp linaro_kernel_config out/.config"
+fi
cat <<EOF
# build the code
CROSS_COMPILE=\`which arm-linux-gnueabi-gcc |sed -e 's,gcc,,'\`
[ -d out ] || mkdir out
-[ -f out/.config ] || cp linaro_kernel_config out/.config
+[ -f out/.config ] || $CP_CMD
make -j\${CPUS} O=out ARCH=arm CROSS_COMPILE=\$CROSS_COMPILE uImage modules
mkdir out/modules_for_android
make O=out ARCH=arm modules_install INSTALL_MOD_PATH=modules_for_android