aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Thibodeau <kyron@neuralbs.com>2008-07-05 01:31:18 -0400
committerEric Thibodeau <kyron@neuralbs.com>2008-07-05 01:31:18 -0400
commit5d03f9e07f034bf4eee086573b54b8ea24b59e4e (patch)
treef9a74b4011f51e585acf45b1f2798367533e7e60 /catalyst
parentAdded quick NFSroot HOWTO (diff)
downloadclustering-livecd-5d03f9e07f034bf4eee086573b54b8ea24b59e4e.tar.gz
clustering-livecd-5d03f9e07f034bf4eee086573b54b8ea24b59e4e.tar.bz2
clustering-livecd-5d03f9e07f034bf4eee086573b54b8ea24b59e4e.zip
stateless.sh reWORK (nfs nodes now boot)
Imported sci-chemistry/gromacs from Bug 193532
Diffstat (limited to 'catalyst')
-rw-r--r--catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec6
-rwxr-xr-xcatalyst/nfsroot/2008.0/overlay/boot/stateless.sh113
-rw-r--r--catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh12
-rw-r--r--catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec7
4 files changed, 96 insertions, 42 deletions
diff --git a/catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec b/catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec
index 2241595..082e699 100644
--- a/catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec
+++ b/catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec
@@ -9,7 +9,7 @@ source_subpath: default/stage3-amd64-desktop-2008.0
# Kyron:
portage_confdir: /var/git/clustering-livecd/profiles/hpc-clustering/
pkgcache_path: /var/tmp/catalyst/packages/amd64_desktop
-portage_overlay: /var/git/clustering-livecd/overlay/
+portage_overlay: /var/git/clustering-livecd/overlay/ /usr/local/portage/alexxy
### end
# Kyron: added
@@ -196,4 +196,6 @@ livecd/packages:
app-admin/eselect-cblas
app-admin/eselect-blas
app-admin/eselect-lapack
-
+# Added growmacs as per Alexey Shvetsov's request ;)
+# from: Bug 193532
+ sci-chemistry/gromacs
diff --git a/catalyst/nfsroot/2008.0/overlay/boot/stateless.sh b/catalyst/nfsroot/2008.0/overlay/boot/stateless.sh
index 0cd3ffd..ed18b92 100755
--- a/catalyst/nfsroot/2008.0/overlay/boot/stateless.sh
+++ b/catalyst/nfsroot/2008.0/overlay/boot/stateless.sh
@@ -7,20 +7,19 @@
MODPROBE=/sbin/modprobe
IFCONFIG=/sbin/ifconfig
-MYHOST=$(/sbin/dhcpcd -H; /bin/hostname) # By default, we'll use the DHCP assigned hostname
+#MYHOST=$(/sbin/dhcpcd -H; /bin/hostname) # By default, we'll use the DHCP assigned hostname
NODE_NAME="node"
ahostname(){
if [ -z ${MYHOST} ]; then
echo "DHCP didn't tell me my name. Generating my own hostname..."
- MYHOST="${NODE_NAME}`$IFCONFIG eth0 | awk '/inet addr/ {print $2}' | tr -t . ' ' | awk '{print $4}'`"
+ MYHOST="${NODE_NAME}${IP##*.}"
+ echo "I proclaim that I am $MYHOST !!"
else
echo DHCP told me my hostname is ${MYHOST}...
echo "Setting domainname to DHCP's settings"
- # Unfortunately, this doesn't work anymore so we have to chaet:
- #/sbin/dhcpcd -D
- #/bin/domainname cluster.local
+ /bin/domainname $DOMAIN
fi
echo "STATELESS: Setting Hostname to $MYHOST"
@@ -28,21 +27,23 @@ ahostname(){
/bin/hostname "$MYHOST"
}
-getparams() {
- local cmdline=$(dmesg | grep '^Kernel command line' | sed 's/^Kernel command line://g')
- for pp in $cmdline; do
- echo $pp | grep '^softlevel=' >/dev/null 2>&1
- if [ $? -eq 0 ]; then
- echo $pp | sed 's/softlevel=//g'
- return 0
- fi
- done
- echo ""
- return 1
-}
+#getparams() {
+# #local cmdline=$(dmesg | grep '^Kernel command line' | sed 's/^Kernel command line://g')
+# cmdline=$(cat /proc/cmdline)
+# for pp in $cmdline; do
+# echo $pp | grep '^softlevel=' >/dev/null 2>&1
+# if [ $? -eq 0 ]; then
+# echo $pp | sed 's/softlevel=//g'
+# return 0
+# fi
+# done
+# echo ""
+# return 1
+#}
isset() {
- for p in $(getparams | tr ',' ' '); do
+ #for p in $(getparams | tr ',' ' '); do
+ for p in $(get_param softlevel); do
if [ "$p" == "$1" ]; then
return 0
fi
@@ -51,20 +52,14 @@ isset() {
}
aunionfs() {
- isset unionfs
- if [ $? -eq 0 ]; then
- echo "STATELESS: Loading module unionfs ..."
-# $MODPROBE unionfs
- while [ "$1" != "" ]; do
- echo "STATELESS: Mounting tmpfs $1 ..."
- mount -n -t tmpfs -o defaults none /mnt/unionfs/$1
- echo "STATELESS: Mounting $1 unionfs ..."
- mount -n -t unionfs -o dirs=/mnt/unionfs/$1=rw:/$1=ro none /$1
- shift
- done
- else
- echo "STATELESS: Not using unionfs as requested ..."
- fi
+# $MODPROBE unionfs
+ while [ "$1" != "" ]; do
+ echo "STATELESS: Mounting tmpfs $1 ..."
+ mount -n -t tmpfs -o defaults none /mnt/unionfs/$1
+ echo "STATELESS: Mounting $1 unionfs ..."
+ mount -n -t unionfs -o dirs=/mnt/unionfs/$1=rw:/$1=ro none /$1
+ shift
+ done
}
# ahosts was added so that we could dynamically change the NFS server address
@@ -72,11 +67,59 @@ aunionfs() {
# when you want to split the load onto different NIC interfaces within a same
# logical network.
ahosts() {
- local SERV_IP=$(dmesg | egrep -oe 'rootserver=([0-9]+\.?){1,4}')
- echo "Setting rootserver to ${SERV_IP#*=} in /etc/hosts file..."
- echo "rootserver ${SERV_IP#*=}" >> /etc/hosts
+ echo "Setting rootserver to $ROOTSERV in /etc/hosts file..."
+ echo "rootserver $ROOTSERV" >> /etc/hosts
+ echo "Setting up fstab"
+ echo "$ROOTSERV:$ROOTPATH / nfs ro,defaults,hard,intr,actimeo=120,timeo=14,tcp 0 1" > /etc/fstab
+}
+
+# get_param: parses parameters in PARSELINE which could be, for example, the kernel's command line
+# (This implies PARSELINE=$(cat /proc/cmdline)
+# Example:
+# ip=dhcp nfsroot=192.168.1.2:/tftproot/nfsroot/x86_64/,hard,intr init=/boot/stateless.sh softlevel=unionfs
+# IN:
+# $1: parameter we want (ie: nfsroot)
+# $2: which token # we want, ie: the IP address of nfsroot it token 1
+get_param() {
+ PARAM=$2
+ for opt in $PARSELINE
+ do
+ case $opt in
+ ${1}=*) set $(echo $opt | sed -e's/[=:,]/ /g' )
+ if [[ -z $PARAM ]]; then
+ shift
+ echo $*
+ else
+ shift $PARAM
+ echo $1
+ fi
+ return 0
+ ;;
+ esac
+ done
+ echo "Parameter '$1' not found" >2
+ return 1
+}
+
+# Used to extract useful information for the rest of the configuration
+# It's a horrible hack that parses dmesg but, unfortunately, /proc/net/pnp
+# is insufficient even with /proc/cmdline
+# Here is an example output of dmesg (partial)
+#IP-Config: Complete:
+# device=eth0, addr=10.0.1.140, mask=255.255.255.0, gw=10.0.1.129,
+# host=thinkbig24, domain=cluster.local, nis-domain=(none),
+# bootserver=10.0.1.129, rootserver=10.0.1.129, rootpath=/tftproot/AthlonXP
+
+import_dhcp_info() {
+ PARSELINE=$(dmesg | grep -A3 'IP-Config: Complete:' | sed -e 's/[:,]/ /g' | tr -d '\n')
+ MYIP=$(get_param addr 1)
+ MYHOST=$(get_param host 1)
+ DOMAIN=$(get_param domain 1)
+ ROOTPATH=$(get_param rootpath 1)
+ ROOTSERV=$(get_param rootserver 1)
}
+import_dhcp_info
aunionfs etc var tmp
ahostname
ahosts
diff --git a/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh b/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh
index 4ac5cd4..164838c 100644
--- a/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh
+++ b/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh
@@ -10,6 +10,7 @@ kernel_links()
cd /boot
ln -s kernel-* vmlinuz
ln -s initramfs-* initramfs
+
}
unionfs_prep()
@@ -17,7 +18,7 @@ unionfs_prep()
echo "====================================="
echo "=adding unionfs required dirs========"
echo "====================================="
- for I in etc va tmp
+ for I in etc var tmp
do
mkdir -p /mnt/unionfs/$I
done
@@ -25,9 +26,14 @@ unionfs_prep()
set_runlevel()
{
- # maybe something to do here...can't remember...
- #sed -i -e's:l3:3:wait:/sbin/rc nfsmount::' etc/inittab
+ ln -s /etc/runlevels/default /etc/runlevels/unionfs
}
+
+run_depmod() {
+ depmod -a -b /usr/src/linux
+}
+
kernel_links
unionfs_prep
+run_depmod
diff --git a/catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec b/catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec
index ff60864..f28f70d 100644
--- a/catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec
+++ b/catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec
@@ -54,13 +54,13 @@ distcc_hosts:
# targets to minimize problems.
# example:
# portage_confdir: /etc/portage
-portage_confdir: /var/git/clustering-livecd/profiles/hpc-clustering/
+portage_confdir: /var/git/clustering-livecd/profiles/hpc-clustering/
# This option specifies the location to a portage overlay that you would like to
# have used when building this target.
# example:
# portage_overlay: /usr/local/portage
-portage_overlay: /var/git/clustering-livecd/overlay/
+portage_overlay: /var/git/clustering-livecd/overlay/
# This allows the optional directory containing the output packages for
# catalyst. Mainly used as a way for different spec files to access the same
@@ -174,6 +174,9 @@ stage4/rcadd:
# the runlevel off to remove the script from any runlevels detected. We do not
# use this on the official media, so it is left blank.
stage4/rcdel:
+ root
+ fsck
+ mtab
# This overlay is dropped onto the filesystem within the loop. This can be used
# for such things as updating configuration files or adding anything else you