summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2014-12-13 19:53:34 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2014-12-13 19:53:34 +0100
commit991058ebf9d81d567a6f662f1c2e2e8827dcc60a (patch)
tree9a3d842a3d414e545c23cfcec7a02a9111b480a8 /examples
parent08153440c2c2867838f31012573450bdaa4b9fd9 (diff)
downloadbiruda-991058ebf9d81d567a6f662f1c2e2e8827dcc60a.tar.gz
biruda-991058ebf9d81d567a6f662f1c2e2e8827dcc60a.tar.bz2
tryied to make an architecture switch for building the rhel6 image
Diffstat (limited to 'examples')
-rw-r--r--examples/build_gold_image/biruda.conf2
-rwxr-xr-x[-rw-r--r--]examples/build_gold_image/build_centos6.sh (renamed from examples/build_gold_image/build.sh)42
2 files changed, 32 insertions, 12 deletions
diff --git a/examples/build_gold_image/biruda.conf b/examples/build_gold_image/biruda.conf
index f131699..1391ee7 100644
--- a/examples/build_gold_image/biruda.conf
+++ b/examples/build_gold_image/biruda.conf
@@ -14,7 +14,7 @@ worker example_build_gold
execution = direct
- command = "/bin/sh ./build.sh"
+ command = "/bin/sh ./build.sh x86_64"
}
worker example_run
diff --git a/examples/build_gold_image/build.sh b/examples/build_gold_image/build_centos6.sh
index f0e7c35..676c04f 100644..100755
--- a/examples/build_gold_image/build.sh
+++ b/examples/build_gold_image/build_centos6.sh
@@ -1,10 +1,30 @@
#!/bin/sh
-# Centos 6 (64-bit)
+# Centos 6
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:${PATH}
-CHROOT_DIR=rhel6-x64
+ARCH=$1
+
+case $ARCH in
+ i686)
+ SHORT_ARCH=686
+ PACKAGE_ARCH=i386
+ ARCH_SWITCH=linux32
+ ;;
+
+ x86_64)
+ SHORT_ARCH=x64
+ PACKAGE_ARCH=x86_64
+ ARCH_SWITCH=
+ ;;
+
+ default)
+ echo "Unsupported architecture '$ARCH'"
+ exit 1
+esac
+
+CHROOT_DIR=rhel6-${SHORT_ARCH}
rm -rf $CHROOT_DIR
@@ -14,23 +34,23 @@ 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
+wget http://mirror.centos.org/centos/6.6/os/${PACKAGE_ARCH}/Packages/centos-release-6-6.el6.centos.12.2.${ARCH}.rpm
-rpm -v -i --root=`pwd`/$CHROOT_DIR --nodeps centos-release-6-5.el6.centos.11.1.x86_64.rpm
+rpm -v -i --root=`pwd`/$CHROOT_DIR --nodeps centos-release-6-6.el6.centos.12.2.${ARCH}.rpm
-rm -f centos-release-6-5.el6.centos.11.1.x86_64.rpm
+rm -f centos-release-6-6.el6.centos.12.2.${ARCH}.rpm
-wget http://mirror.centos.org/centos/6.5/os/x86_64/RPM-GPG-KEY-CentOS-6
+wget http://mirror.centos.org/centos/6.6/os/${PACKAGE_ARCH}/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
+${ARCH_SWITCH} yum --installroot=`pwd`/$CHROOT_DIR install -y yum
+${ARCH_SWITCH} 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
+${ARCH_SWITCH} chroot $CHROOT_DIR /bin/rpm -v --rebuilddb
mknod -m 666 $CHROOT_DIR/dev/null c 1 3
mknod -m 666 $CHROOT_DIR/dev/zero c 1 5
@@ -50,7 +70,7 @@ EOF
# development stuff
-wget http://mirror.switch.ch/ftp/mirror/epel/6/x86_64/epel-release-6-8.noarch.rpm
+wget http://mirror.switch.ch/ftp/mirror/epel/6/${PACKAGE_ARCH}/epel-release-6-8.noarch.rpm
rpm -v -i --root=`pwd`/$CHROOT_DIR --nodeps epel-release-6-8.noarch.rpm
@@ -62,4 +82,4 @@ rpm -v --root=`pwd`/$CHROOT_DIR --import RPM-GPG-KEY-EPEL-6
rm -f RPM-GPG-KEY-EPEL-6
-yum --installroot=`pwd`/$CHROOT_DIR install -y make gcc gcc-c++ rpm-build tar ccache distcc
+${ARCH_SWITCH} yum --installroot=`pwd`/$CHROOT_DIR install -y make gcc gcc-c++ rpm-build tar ccache distcc