blob: c81af0503b52393229a425f0fe5b0d180ccff43f [file] [log] [blame]
Ryan Cairnsdd1ceb82010-03-02 21:35:01 -08001#!/bin/bash
2
3# Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7set -e
8
9DEVKIT_URL=$(grep ^CHROMEOS_DEVSERVER /etc/lsb-release | cut -d = -f 2-)
10BOARD_NAME=$(grep ^CHROMEOS_RELEASE_BOARD $dir/etc/lsb-release | cut -d = -f 2-)
11
12if [ -z $DEVKIT_URL ]
13then
14 echo "No devkit server specified in /etc/lsb-release"
15 exit 1
16fi
17
18if [ -z $BOARD_NAME ]
19then
20 echo "No board specified in /etc/lsb-release"
21 exit 1
22fi
23
24mount -o remount,rw /
25mkdir -p /etc/make.profile
26
27echo "Building $1"
28ESCAPED_PACKAGE=$(python -c "import urllib; print urllib.quote('''$1''')")
29ESCAPED_BOARD=$(python -c \
30 "import urllib; print urllib.quote('''${BOARD_NAME}''')")
31
32wget $DEVKIT_URL/build --post-data="pkg=${ESCAPED_PACKAGE}&board=${ESCAPED_BOARD}"
33
34echo "Emerging $1"
35
36export PORTAGE_BINHOST="${DEVKIT_URL}/static/pkgroot/${BOARD_NAME}/packages"
37export PORTAGE_TMPDIR=/tmp
38export ACCEPT_KEYWORDS=x86
39
40emerge --getbinpkg --usepkgonly $1