]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
Added ProfitBricks packages in creating of the GRML squash image.
authorFrank Brehm <frank.brehm@profitbricks.com>
Tue, 3 Jun 2014 10:09:36 +0000 (12:09 +0200)
committerFrank Brehm <frank.brehm@profitbricks.com>
Tue, 3 Jun 2014 10:09:36 +0000 (12:09 +0200)
create-grml-squash.sh
files/rc.local

index eb74640b22e5328f99baccb0a05d87b31d260c51..6eb8d12377cfa4a43e1ac0266c873e469d7ccfa8 100755 (executable)
@@ -51,7 +51,7 @@ fi
 ORIG_IMG="/mnt/grml/live/grml64-full/grml64-full.squashfs"
 TARGET_DIR="/var/tmp/grml"
 
-PACKAGES="infiniband-diags opensm bc git libpcre3 mbuffer lsscsi bind9-host bind9utils"
+PACKAGES="infiniband-diags opensm bc git libpcre3 mbuffer lsscsi bind9-host bind9utils megacli lsitools"
 
 MY_BASE=$(basename $0 )
 MY_DIR=$( readlink -f $( dirname $0 ) )
@@ -330,6 +330,25 @@ unmounting_dirs() {
 
 }
 
+#------------------------------------------------------------------------------
+add_pb_repo() {
+
+    echo
+    info "Adding Profitbricks Debian repository."
+    CHROOT apt-key adv --fetch-keys http://alexandria.pb.local/profitbricks-repository/0CC30F89AD6863A7.asc
+
+    cat >${TARGET_DIR}/etc/apt/sources.list.d/profitbricks.list <<EOF
+# ProfitBricks Debian repositories
+
+deb     http://alexandria.pb.local/pb-wheezy production                     main non-free contrib
+deb-src http://alexandria.pb.local/pb-wheezy production                     main non-free contrib
+deb     http://alexandria.pb.local/pb-wheezy production-approved-updates    main non-free contrib
+deb-src http://alexandria.pb.local/pb-wheezy production-approved-updates    main non-free contrib
+
+EOF
+
+}
+
 #------------------------------------------------------------------------------
 update_packages() {
     echo
@@ -348,7 +367,7 @@ add_packages() {
     echo
     info "Installing additional packages: ${PACKAGES}"
     export DEBIAN_FRONTEND="noninteractive"
-    CHROOT apt-get install ${PACKAGES}
+    CHROOT apt-get install -y ${PACKAGES}
 }
 
 #------------------------------------------------------------------------------
@@ -452,14 +471,16 @@ main() {
     mounting_dirs
     trap "unmangle_resolv_conf; unmounting_dirs; exit 9" EXIT INT QUIT TERM
 
+    add_pb_repo
     update_packages
     add_packages
-    install_megacli
     disable_opensm
     opensm_config
     copy_files
     zeroing_logfiles
 
+    #CHROOT zsh -l
+
     info "Finishing ..."
     trap - EXIT INT QUIT TERM
     unmangle_resolv_conf
index a886edd984f9a6c77c781d17a20073bf56bc2b8f..824a176875a8e774c968f7c4e45adb14fc4cd13d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 #
 # rc.local
 #
@@ -21,8 +21,22 @@ apt-get -y update || true
 
 # Load grml.sh file in order to apply modifications without rebuilding the squashfs (/turbas)
 
+if [[ -d /sys/class/infiniband ]] ; then
+    echo
+    echo "Initializing infiniband ..."
+    declare -i hca_id=1
+    for hca in /sys/class/infiniband/*; do
+        if [ -e ${hca}/node_desc ]; then
+            HOST_INFO="$(hostname -s) HCA-${hca_id}"
+            echo "  - writing '${HOST_INFO}' -> ${hca}/node_desc"
+            echo -n "${HOST_INFO}" >> ${hca}/node_desc
+        fi
+        let hca_id++
+    done
+fi
+
 wget http://mgmt/liveboot-turbas/grml.sh -O /tmp/grml.sh ||true
-if [ -f /tmp/grml.sh -a -s /tmp/grml.sh ] ; then
+if [[ -f /tmp/grml.sh -a -s /tmp/grml.sh ]] ; then
     chmod 755 /tmp/grml.sh ||true
     /tmp/grml.sh ||true
 fi