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 ) )
}
+#------------------------------------------------------------------------------
+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
echo
info "Installing additional packages: ${PACKAGES}"
export DEBIAN_FRONTEND="noninteractive"
- CHROOT apt-get install ${PACKAGES}
+ CHROOT apt-get install -y ${PACKAGES}
}
#------------------------------------------------------------------------------
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
-#!/bin/sh -e
+#!/bin/bash -e
#
# rc.local
#
# 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