aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-03 10:40:11 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-03 10:40:11 +0100
commitae68678efc1b6d2ef479f48a988dde8e6f95dd26 (patch)
tree5dddae90ed245550dd600fec5b720a8f90dcbfdd /utils
parent97288851c9575e9add85360ab0360950fad729e5 (diff)
downloadbuildroot-test-ae68678efc1b6d2ef479f48a988dde8e6f95dd26.tar.gz
buildroot-test-ae68678efc1b6d2ef479f48a988dde8e6f95dd26.tar.bz2
Add script to help reproducing builds
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'utils')
-rwxr-xr-xutils/br-reproduce-build66
1 files changed, 66 insertions, 0 deletions
diff --git a/utils/br-reproduce-build b/utils/br-reproduce-build
new file mode 100755
index 0000000..7b4961c
--- /dev/null
+++ b/utils/br-reproduce-build
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+# A directory that contains an existing Git repository of
+# Buildroot. The script will git clone from it instead of git cloning
+# from the official repo, in order to reduce the clone time.
+BASE_GIT=/home/test/buildroot/
+
+# Location where the output directories will be created. One
+# subdirectory, named after the build ID will be created for each
+# build.
+OUTPUT_DIR=/home/test/outputs/
+
+if [ $# -ne 1 ] ; then
+ echo "Usage: $0 buildid" ;
+ echo " buildid is the SHA1 of the build result, as found on http://autobuild.buildroot.net"
+ exit 1 ;
+fi
+
+BUILD_ID=$1
+
+BUILD_DIR=${OUTPUT_DIR}/${BUILD_ID}
+
+mkdir -p ${BUILD_DIR}
+if [ $? -ne 0 ] ; then
+ echo "Cannot create output directory"
+ exit 1
+fi
+
+wget -O ${BUILD_DIR}/config http://autobuild.buildroot.org/results/${BUILD_ID}/config
+if [ $? -ne 0 ] ; then
+ echo "Cannot get configuration for build ${BUILD_ID}"
+ rm -f ${BUILD_DIR}
+ exit 1
+fi
+
+wget -O ${BUILD_DIR}/gitid http://autobuild.buildroot.org/results/${BUILD_ID}/gitid
+
+cd ${BUILD_DIR}
+git clone ${BASE_GIT}
+if [ $? -ne 0 ] ; then
+ echo "Cannot clone Buildroot Git repository"
+ rm -rf ${BUILD_DIR}
+ exit 1
+fi
+
+cd buildroot
+
+git remote set-url origin git://git.busybox.net/buildroot
+
+git pull
+if [ $? -ne 0 ] ; then
+ echo "Cannot pull Buildroot Git repository"
+ rm -rf ${BUILD_DIR}
+ exit 1
+fi
+
+git checkout $(cat ../gitid)
+if [ $? -ne 0 ] ; then
+ echo "Cannot checkout commit " $(cat ../gitid)
+ rm -rf ${BUILD_DIR}
+ exit 1
+fi
+
+mkdir ../output
+cp ${BUILD_DIR}/config ../output/.config
+make 2>&1 O=../output | tee logfile