summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-12-07 20:20:41 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2014-12-07 20:20:41 +0100
commit2546f1aab108268768c7a2fae1d00e047b71336c (patch)
treed18732f3e9c8b82a5ef8af5e38de4740b22ecba8 /examples
parente1c99bfd56ea23e1f18bc4c0a0a0a0ef2055e368 (diff)
downloadbiruda-2546f1aab108268768c7a2fae1d00e047b71336c.tar.gz
biruda-2546f1aab108268768c7a2fae1d00e047b71336c.tar.bz2
added gold build example
Diffstat (limited to 'examples')
-rw-r--r--examples/build_gold_image/biruda.conf29
-rw-r--r--examples/build_gold_image/build.sh60
2 files changed, 89 insertions, 0 deletions
diff --git a/examples/build_gold_image/biruda.conf b/examples/build_gold_image/biruda.conf
new file mode 100644
index 0000000..f131699
--- /dev/null
+++ b/examples/build_gold_image/biruda.conf
@@ -0,0 +1,29 @@
+# example of a gold image build
+# (on ArchLinux, building a RHEL6 image)
+
+coordinator
+{
+ control = "tcp://eeepc:5555"
+}
+
+worker example_build_gold
+{
+ control = "tcp://eeepc:5555"
+
+ data = "tcp://eeepc:5556"
+
+ execution = direct
+
+ command = "/bin/sh ./build.sh"
+}
+
+worker example_run
+{
+ control = "tcp://eeepc:5555"
+
+ data = "tcp://eeepc:5556"
+
+ execution = direct
+
+ command = "/bin/chroot rhel6-x64 /bin/bash -c '/bin/cat /etc/redhat-release'"
+}
diff --git a/examples/build_gold_image/build.sh b/examples/build_gold_image/build.sh
new file mode 100644
index 0000000..7400dfe
--- /dev/null
+++ b/examples/build_gold_image/build.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+# Centos 6 (64-bit)
+
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin:${PATH}
+
+CHROOT_DIR=rhel6-x64
+
+rm -rf $CHROOT_DIR
+
+mkdir $CHROOT_DIR
+
+mkdir -p $CHROOT_DIR/var/lib/rpm
+
+rpm -v --rebuilddb --root=`pwd`/$CHROOT_DIR
+
+wget http://mirror.centos.org/centos/6.5/os/x86_64/Packages/centos-release-6-5.el6.centos.11.1.x86_64.rpm
+
+rpm -v -i --root=`pwd`/$CHROOT_DIR --nodeps centos-release-6-5.el6.centos.11.1.x86_64.rpm
+
+rm -f centos-release-6-5.el6.centos.11.1.x86_64.rpm
+
+wget http://mirror.centos.org/centos/6.5/os/x86_64/RPM-GPG-KEY-CentOS-6
+
+rpm -v --root=`pwd`/$CHROOT_DIR --import RPM-GPG-KEY-CentOS-6
+
+rm RPM-GPG-KEY-CentOS-6
+
+yum --installroot=`pwd`/$CHROOT_DIR install -y yum
+yum --installroot=`pwd`/$CHROOT_DIR install -y coreutils procps net-tools wget
+
+# rebuild the RPM database with the rpm inside the chroot
+chroot $CHROOT_DIR /bin/rpm -v --rebuilddb
+
+cp /etc/resolv.conf $CHROOT_DIR/etc/
+
+cp $CHROOT_DIR/etc/skel/.bashrc $CHROOT_DIR/root
+cp $CHROOT_DIR/etc/skel/.bash_profile $CHROOT_DIR/root
+cp $CHROOT_DIR/etc/skel/.bash_logout $CHROOT_DIR/root
+
+cat >> $CHROOT_DIR/root/.bash_profile <<EOF
+export PATH=\$PATH:/usr/sbin:/usr/bin:/sbin:/bin
+EOF
+
+# development stuff
+
+wget http://mirror.switch.ch/ftp/mirror/epel/6/x86_64/epel-release-6-8.noarch.rpm
+
+rpm -v -i --root=`pwd`/$CHROOT_DIR --nodeps epel-release-6-8.noarch.rpm
+
+rm epel-release-6-8.noarch.rpm
+
+wget http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6
+
+rpm -v --root=`pwd`/$CHROOT_DIR --import RPM-GPG-KEY-EPEL-6
+
+rm RPM-GPG-KEY-CentOS-6
+
+yum --installroot=`pwd`/$CHROOT_DIR install -y make gcc gcc-c++ rpm-build tar ccache distcc git
+