aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild')
-rw-r--r--overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild55
1 files changed, 33 insertions, 22 deletions
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 e09e0c6..9feedad 100644
--- a/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild
+++ b/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild
@@ -147,38 +147,40 @@ pxe_conf()
ln -s "${ROOT}/usr/lib/syslinux/pxelinux.0" "${TFTPROOT}/pxelinux.0"
}
-nfs_root_conf()
+# In: PATH_TO_EXPORT ro/rw fsid
+# out: /etc/exports (and ${NFSROOT}/etc/autofs/auto.nfs
+add_exports()
{
- [ -d ${NFSROOT} ] || die "${NFSROOT} is missing! Either create your own of find one ;)"
- if [ ! -f ${NFSROOT}/boot/kernel ]; then
- ewarn "Couldn't find ${NFSROOT}/boot/kernel !"
- ewarn "This is what we built the config files to expect."
- ewarn "You might have to perform"
+ local I="$1"
+ local MODE=$2
+ local fsid=$3
+
+ if use nonfsv4 ; then
+ echo "${I} $NETADDR/$SUBNET($MODE,$NFSEPORTOPTS,fsid=$fsid)" >> ${ROOT}/etc/exports
+ else
+ mkdir -p ${NFSROOT}/${I}
+ mount -o bind ${I} ${NFSROOT}/${I}
fi
+ use autofs && echo "${I/\/} -$MODE,$NFSMOUNTOPTS $CLUSTER_ETH_Ir:${I}" >> ${NFSROOT}/etc/autofs/auto.nfs
+}
+
+nfs_exports_conf()
+{
+ local fsid=0
echo "${NFSROOT} $NETADDR/$SUBNET(ro,$NFSEPORTOPTS,fsid=0)" > ${ROOT}/etc/exports
- # Yes, this could be looped on RO and RW...but that wouldn't be more redable
+ # Yes, this could be looped on RO and RW...but that wouldn't be any more redable than it already isn't ;)
for I in $ROEXPORTS
do
- if use nonfsv4 ; then
- echo "${I} $NETADDR/$SUBNET(ro,$NFSEPORTOPTS)" >> ${ROOT}/etc/exports
- else
- mkdir -p ${NFSROOT}/${I}
- mount -o bind ${I} ${NFSROOT}/${I}
- fi
- use autofs && echo "${I/\/} -ro,$NFSMOUNTOPTS $CLUSTER_ETH_Ir:${I}" >> ${NFSROOT}/etc/autofs/auto.nfs
+ ((fsid++))
+ add_exports "$I" "ro" $fsid
done
for I in $RWEXPORTS
do
- if use nonfsv4 ; then
- echo "${I} $NETADDR/$SUBNET(rw,$NFSEPORTOPTS)" >> ${ROOT}/etc/exports
- else
- mkdir -p ${NFSROOT}/${I}
- mount -o bind ${I} ${NFSROOT}/${I}
- fi
- use autofs && echo "${I/\/} -rw,$NFSMOUNTOPTS $CLUSTER_ETH_Ir:${I}" >> ${NFSROOT}/etc/autofs/auto.nfs
+ ((fsid++))
+ add_exports "$I" "rw" $fsid
done
}
@@ -229,6 +231,7 @@ src_install(){
doins ${FILESDIR}/${CONFIG_FILE}
dosbin ${S}/node-manager
+ dosbin ${FILESDIR}/setup-pwdless-ssh
# add and delnode are derived from the dnsmasq add/del/old directives
# passed onto the node-manager script...don't change arbritrarily
@@ -245,11 +248,19 @@ src_install(){
pkg_config()
{
parse_config "${CONFPATH}/${CONFIG_FILE}"
+
+ [ -d ${NFSROOT} ] || die "${NFSROOT} is missing! Either create your own of find one ;)"
+ if [ ! -f ${NFSROOT}/boot/kernel ]; then
+ ewarn "Couldn't find ${NFSROOT}/boot/kernel !"
+ ewarn "This is what we built the config files to expect."
+ ewarn "You might have to perform a catalyst build to generate the NFS root filesystem."
+ fi
+
get_ip_config
dnsmasq_conf
resolv_conf
pxe_conf
- nfs_root_conf
+ nfs_exports_conf
use pbs && TORQUED="pbs_server pbs_sched"
for I in dnsmasq netmount nfs $TORQUED