summaryrefslogtreecommitdiff
path: root/grub.sh
blob: 0d9927c915c9d620b594c4106b65637581664013 (plain)
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
37
#!/bin/bash
# Script used by CI to build GRUB for ARM
# Requirements: autogen bison flex gcc-arm-linux-gnueabihf packages
# Optional dependencies: libdevmapper-dev libfreetype6-dev libfuse-dev

set -e

pkg_source=linaro-grub
pkg_repository=http://bazaar.launchpad.net/~leif-lindholm/linaro-grub/arm-uboot

bzr_commit=`bzr revno ${pkg_repository}`
if [ -z "${bzr_commit}" ]; then
	echo "Invalid bzr revision: ${bzr_commit}" >&2
	exit 1
fi

base_version=2.00
pkg_version=${base_version}+bzr${bzr_commit}+`date +%Y%m%d`
pkg_dir=${pkg_source}-${pkg_version}

if [ -z "${WORKSPACE}" ]; then
  # Local build
  export WORKSPACE=`pwd`
  export BUILD_NUMBER=1
  # Get the sources
  bzr branch --use-existing-dir ${pkg_repository} .
fi

# Create source tarball
bzr export --root=${pkg_dir} ${pkg_source}_${pkg_version}.orig.tar.bz2

./autogen.sh
./configure \
  --build=x86_64-linux-gnu \
  --host=arm-linux-gnueabihf \
  --with-platform=uboot
make -j`getconf _NPROCESSORS_ONLN`