diff options
author | 2008-07-10 02:20:39 -0400 | |
---|---|---|
committer | 2008-07-10 02:20:39 -0400 | |
commit | 62b275210d94aff1a38ecf64670e5b890afa6cfb (patch) | |
tree | 51b6d933ed703443a8deee547a497f1e99bd424b | |
parent | Corrected a typo as per http://bugs.gentoo.org/show_bug.cgi?id=230968 (diff) | |
download | clustering-livecd-62b275210d94aff1a38ecf64670e5b890afa6cfb.tar.gz clustering-livecd-62b275210d94aff1a38ecf64670e5b890afa6cfb.tar.bz2 clustering-livecd-62b275210d94aff1a38ecf64670e5b890afa6cfb.zip |
New cluster-setup script to be runned by the user on LiveCD bootup
Corrected many OpenRC bootup sequences and quirks
--Thanks to Uber(lord) (Roy Maples) for quick fixes
--NFSroot system now boots up quickly
**There are still a few error messages on shutdown that will be adressed in later versions of OpenRC
--> ref: http://bugs.marples.name/show_bug.cgi?id=98
beowulf-head/beowulf-head automated script corrections
-rw-r--r-- | NFSroot-HOWTO | 8 | ||||
-rw-r--r-- | catalyst/livecd/2008.0/overlay/usr/sbin/cluster-setup | 87 | ||||
-rw-r--r-- | catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec | 2 | ||||
-rw-r--r-- | catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh | 22 | ||||
-rw-r--r-- | catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec | 1 | ||||
-rw-r--r-- | overlay/app-misc/livecd-tools/Manifest | 2 | ||||
-rw-r--r-- | overlay/sys-cluster/beowulf-head/Manifest | 4 | ||||
-rw-r--r-- | overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild | 17 | ||||
-rw-r--r-- | overlay/sys-cluster/beowulf-head/files/cluster.conf | 2 | ||||
-rw-r--r-- | profiles/hpc-clustering/package.keywords/baselayout2 | 1 |
10 files changed, 134 insertions, 12 deletions
diff --git a/NFSroot-HOWTO b/NFSroot-HOWTO index 782204b..7d09aed 100644 --- a/NFSroot-HOWTO +++ b/NFSroot-HOWTO @@ -1,7 +1,15 @@ # Essentially: # 1- set up the environment as described in the LiveCD-HOWTO # 2- : +# openrc is so haWt we need the latest and gratest...but since we don't want to pull git and all deps into the nfsroot, here is a "hack": +cd /var/git/ +git clone git://git.overlays.gentoo.org/proj/openrc.git +cd openrc/ +make dist +mv openrc-0.2.5.tar.bz2 /usr/portage/distfiles/ +ebuild /usr/portage/sys-apps/openrc/openrc-0.2.5.ebuild digest +# 3- : cd /var/git/clustering-livecd/catalyst/nfsroot/2008.0/specs/amd64/ for I in stage1.spec stage2.spec stage3.spec nfsroot_stage4.spec do diff --git a/catalyst/livecd/2008.0/overlay/usr/sbin/cluster-setup b/catalyst/livecd/2008.0/overlay/usr/sbin/cluster-setup new file mode 100644 index 0000000..1af73e6 --- /dev/null +++ b/catalyst/livecd/2008.0/overlay/usr/sbin/cluster-setup @@ -0,0 +1,87 @@ +#!/bin/bash +# Copyright 2008 Eric Thibodeau <kyron@neuralbs.com> +# All rights reserved. Released under the GPL v2 license. +# This script is written so parts can be reused for liveCD mounting...eventually ;) + +. /mnt/livecd/sbin/functions.sh +CDROOT=/mnt/livecd/ +MKDIR=${CDROOT}/bin/mkdir +MODPROBE=${CDROOT}/sbin/modprobe + +conf_error() { + eerror "CONFIG_OK is not set to 'yes' in $1" + eerror "Please edit ALL files in $(dirname $1)" + eerror "and re-run $0" + einfo "If there are some files in $(dirname $1)" + einfo "which don't need configuration, hid them with" + einfo "a '.' before the name of the file" + exit 1 +} + +aufs_mount() { + $MODPROBE aufs || eerror "Got $? while probing for aufs module!" + # Looping this simply because it should replace the current tmpfs mounting of the liveCD :P + for I in tftproot + do + einfo "Setting up AUFS mount for /$I" + ${MKDIR} -p /mnt/aufs/$I /$I + mount -t tmpfs tmpfs_$I /mnt/aufs/$I + mount -n -t aufs -o br:/mnt/aufs/${I}=rw:/mnt/livecd/${I} aufs_mount /${I} + done +} + +do_conf() { + . $1 + shift + einfo "Calling $* " + $* + if [ $? != 0 ]; then + eerror "Call to $* did not returne 0 errors (there were some!)" + ewarn "Look above this message for clues." + exit 1 + fi +} + +# This could have been inlined into do_conf but we would rather check configs _before_ +# we do anything...we could be a little mode selective than /etc/gentoo/* though +check_conf() { +einfo "Checking config files.." + for I in /etc/gentoo/* + do + . $I + [[ $CONFIG_OK == "yes" ]] || conf_error $I + done +} + +check_conf +aufs_mount +# After this, all paths should be ok (no need to use relative paths with ${CDROOT} + +do_conf /etc/gentoo/ldap_auth.conf "emerge --config =net-nds/ldap-auth-0.1" +/etc/init.d/slapd start || ewarn "Slapd did not start! See above for error messages...continuing" + +. /etc/gentoo/cluster.conf +einfo "Making sure $CLUSTER_ETH is configured correctly.." +if [[ $CLUSTER_ETH =~ eth.* ]]; then + echo "The cluster's NIC is set as $CLUSTER_ETH with the following config:" + /sbin/ifconfig $CLUSTER_ETH + until [[ $ANS == "y" || $ANS == "n" ]] + do + echo -n "Do you want to change this now? [y/n]: " + read ANS + done + if [[ $ANS == "y" ]]; then + net-setup $CLUSTER_ETH + einfo "Adding modules_${CLUSTER_ETH}=( \"!plug\" ) to /etc/conf.d/net (required for the system's consistency)" + echo "modules_${CLUSTER_ETH}=( \"!plug\" )" >> /etc/conf.d/net + einfo "$CLUSTER_ETH will have to be restarted to be in a consistent state" + /etc/init.d/net.$CLUSTER_ETH restart + fi + [[ $ANS == "n" ]] && einfo "You know what you're doing..." +else + einfo "CLUSTER_ETH is not set to an eth? device: $CLUSTER_ETH" + einfo "Hope you know what you're doing!" +fi + +do_conf /etc/gentoo/cluster.conf "emerge --config =sys-cluster/beowulf-head-0.1" + diff --git a/catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec b/catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec index 2cb320a..4e272cc 100644 --- a/catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec +++ b/catalyst/livecd/2008.0/specs/amd64/livecd-stage1.spec @@ -199,3 +199,5 @@ livecd/packages: # Added growmacs as per Alexey Shvetsov's request ;) # from: Bug 193532 sci-chemistry/gromacs +# man needs this: + app-arch/lzma-utils diff --git a/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh b/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh index 02d74d0..9098176 100644 --- a/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh +++ b/catalyst/nfsroot/2008.0/scripts/nfsroot_setup.sh @@ -61,13 +61,27 @@ openrc_diskless_setup() { done # /etc/conf.d/bootmisc - for I in 'wipe_tmp="NO"' - do - change_opt $I /etc/conf.d/bootmisc - done + change_opt 'wipe_tmp="NO"' /etc/conf.d/bootmisc # /etc/conf.d/net echo 'dhcpcd_eth0="-p --inform"' >> /etc/conf.d/net + + # Set clock to localtime as default + + change_opt 'clock="local"' /etc/conf.d/hwclock + change_opt 'clock_systohc="YES"' /etc/conf.d/hwclock + + # We don't do this anymore since it puts files into /lib64/rc/init.d/ + # and that causes error messages on reboot: + #echo "Pre-generating dependencies..." + #/lib/rc/bin/rc-depend -u + # Instead, we actually clean out that folder: + rm -Rf /lib64/rc/init.d/* + # The following is only useful if some freak grabs the livecd and is in a TZ + # making the /etc files dated in the future (my system is UTC-5 + echo "Moving dates to the past so the Cache isn't always regenerated" + find /etc/ -exec touch --date=yesterday {} \; + } diff --git a/catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec b/catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec index 81c5dd3..7f4817a 100644 --- a/catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec +++ b/catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec @@ -184,6 +184,7 @@ stage4/rcdel: # consolefont tries to write to /lib/rc/console (ro) consolefont|boot localmount|boot + bootmisc|boot # This overlay is dropped onto the filesystem within the loop. This can be used diff --git a/overlay/app-misc/livecd-tools/Manifest b/overlay/app-misc/livecd-tools/Manifest index 1ba1b43..dbbfa1b 100644 --- a/overlay/app-misc/livecd-tools/Manifest +++ b/overlay/app-misc/livecd-tools/Manifest @@ -1,3 +1,3 @@ -AUX password_parse.patch 319 RMD160 386685b42101d2fe465303b8eada01b35dd4c374 SHA1 887d2fd50d5fe24f963ddc26794c00cf238e139b SHA256 70e0749e127059b2fecf26ef273f30f02f621184a8545a4b89f96aed9ab376eb +AUX password_parse.patch 319 RMD160 493e812b53e3b877e76decf5694090384ffb41c4 SHA1 575ec8735416b03d7f5bf637869f8aecd4fe8d78 SHA256 220475ddad3486e3802958684d8a634353e17e9e74e08053b506560e529ff0d3 DIST livecd-tools-1.0.40.tar.bz2 10610 RMD160 8db6b15d5df1dba92b4fad70b2b6bcc3a6153287 SHA1 d9bb532ec8cd092288489949252e1310118a4b6e SHA256 03f0a6d943f6dbaade14ce16c325777498ce9ca9c8b9480147117816a9857541 EBUILD livecd-tools-1.0.40-r1.ebuild 1453 RMD160 776a761dd094a155b09c357662beda27edb283ed SHA1 7719565da2b1fee9ccc2580caa0be2243d22132e SHA256 150fef5587816fa0e78b511d92147b3d5da64c36d911863341f0579177fd5bbf diff --git a/overlay/sys-cluster/beowulf-head/Manifest b/overlay/sys-cluster/beowulf-head/Manifest index 9b81f41..3039ace 100644 --- a/overlay/sys-cluster/beowulf-head/Manifest +++ b/overlay/sys-cluster/beowulf-head/Manifest @@ -1,3 +1,3 @@ -AUX cluster.conf 2401 RMD160 e5f37c56b03791f6a884bfad6b37ec17f27045cf SHA1 685c32c8deab47c326e7e05f41caa127e11de863 SHA256 e0142db68ecb9182161b9818d1a8cf944cf316ae694c095123c6d4f8a6f0ce10 -EBUILD beowulf-head-0.1.ebuild 4575 RMD160 bdb06c2362c3e0b09197f2afadca44e1fc6f8047 SHA1 3e9a7362cbbf42f8f151a54b910e364126a0ea74 SHA256 81caa246e7e0eedf33de18f0093bde6801fb04a037d9c7d81d7dad24a90146e7 +AUX cluster.conf 2393 RMD160 2ccb24e8f2cb83d8a002fc239d0be6bb7968ed4d SHA1 ad4cc8ff8b8f2f4270755f387228efb0cc63c048 SHA256 660478b6763cc3c6190541bb46d5d17a01a5e366ac8ce84551d1ae31f2eb1673 +EBUILD beowulf-head-0.1.ebuild 4881 RMD160 9db75cb18d1c8fbf52e81a00f51431e9690ce122 SHA1 5644e5faa3d60cb9e69fbac8a8038810887e0ecf SHA256 191f869a079c2446d13609574b9a2caf333461d83d525f1e0ccca91e7e97490a MISC ChangeLog 101 RMD160 d735719ccc09237e68e4e984eb5451000b06c382 SHA1 79098d1e8ae451f0430d363da6b717966ade6e78 SHA256 8dd010e2772026c4a6b86839842931b99c85c44a5e9f380864cc275b55587ac2 diff --git a/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild b/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild index 1e23f3c..1e9961e 100644 --- a/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild +++ b/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild @@ -9,7 +9,7 @@ SRC_URI="" LICENSE="GPL-2" SLOT="0" KEYWORDS="amd64 ~x86" -IUSE="" +IUSE="autofs" DEPEND="" RDEPEND="net-nds/ldap-auth @@ -32,6 +32,13 @@ get_ip_config() IPSTOP="$(sipcalc ${CLUSTER_ETH} | egrep 'Usable range\W*-' | cut -d- -f3)" SUBNET="$(sipcalc ${CLUSTER_ETH} | egrep 'Network mask\W*-' | cut -d- -f2)" NETADDR="$(sipcalc ${CLUSTER_ETH} | egrep 'Network address' | cut -d- -f2)" + # We have to clean up the vars from spaces: + CLUSTER_ETH_IP=${CLUSTER_ETH_IP// } + RANGE_START=${RANGE_START// } + IPSTART=${IPSTART// } + IPSTOP=${IPSTOP// } + SUBNET=${SUBNET// } + NETADDR=${NETADDR// } } dnsmasq_conf() @@ -129,13 +136,13 @@ nfs_root_conf() for I in $ROEXPORTS do echo "${I} $NETADDR/$SUBNET(ro,$NFSEPORTOPTS)" >> ${ROOT}/etc/exportfs - echo "${I/\/} -ro,$NFSMOUNTOPTS $CLUSTER_ETH_Ir:${I}" >> ${NFSROOT}/etc/autofs/auto.nfs + use autofs && echo "${I/\/} -ro,$NFSMOUNTOPTS $CLUSTER_ETH_Ir:${I}" >> ${NFSROOT}/etc/autofs/auto.nfs done for I in $RWEXPORTS do echo "${I} $NETADDR/$SUBNET(rw,$NFSEPORTOPTS)" >> ${ROOT}/etc/exportfs - echo "${I/\/} -ro,$NFSMOUNTOPTS $CLUSTER_ETH_Ir:${I}" >> ${NFSROOT}/etc/autofs/auto.nfs + use autofs && echo "${I/\/} -ro,$NFSMOUNTOPTS $CLUSTER_ETH_Ir:${I}" >> ${NFSROOT}/etc/autofs/auto.nfs done } @@ -150,6 +157,7 @@ pkg_setup() { if ! built_with_use net-dns/dnsmasq tftp ; then die "net-dns/dnsmasq must be built with USE=tftp to be used with ${P}!" fi + use autofs && die "We're not there yet ;)" } src_install() @@ -171,9 +179,10 @@ pkg_config() pxe_conf nfs_root_conf - for I in dnsmasq netmount + for I in dnsmasq netmount nfs do rc-update add $I default + /etc/init.d/$I start done } diff --git a/overlay/sys-cluster/beowulf-head/files/cluster.conf b/overlay/sys-cluster/beowulf-head/files/cluster.conf index 363f3a9..2148a2a 100644 --- a/overlay/sys-cluster/beowulf-head/files/cluster.conf +++ b/overlay/sys-cluster/beowulf-head/files/cluster.conf @@ -17,7 +17,7 @@ PUBETH="eth0" # at MASTERIP+1. # Here is an example using eth1: # CLUSTER_ETH="eth1" -# You can also specify specify an IP/SUBNET as follows: +# You can also specify an IP/SUBNET as follows: # CLUSTER_ETH="10.0.0.1/24" # CLUSTER_ETH="10.0.0.1 255.255.255.0" CLUSTER_ETH="eth1" diff --git a/profiles/hpc-clustering/package.keywords/baselayout2 b/profiles/hpc-clustering/package.keywords/baselayout2 index aa526a1..2ade82e 100644 --- a/profiles/hpc-clustering/package.keywords/baselayout2 +++ b/profiles/hpc-clustering/package.keywords/baselayout2 @@ -1,2 +1,3 @@ =sys-apps/baselayout-2.0.0 ** +# it's not exatly 0.2.5, it's a git repo saved as 0.2.5 by running `make dist` from within the git clone =sys-apps/openrc-0.2.5 ** |