From 679df9febb65236762400e2c687fa9274eb9cadb Mon Sep 17 00:00:00 2001 From: angli-xcat Date: Thu, 16 Jun 2011 03:06:56 +0000 Subject: [PATCH] This is to enable client to indicate options when mounting persistent directories on statelite(nfs/ramdisk) CNs, if not, "nolock,tcp" will be used as default options. This implementation aims for SLES11. client can revise the statelite table to benefit from this, like: #node,image,statemnt,mntopts,comments,disable "935n02",,"192.168.0.244:/tmp","soft,timeo=200",, ------------------------------------------------------ Another change in sles.pm: we do insmod for net interfaces (ibmveth, ehea, etc...) after all other modules, to avoid failure when do 'netstart' during installation. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9817 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/sles.pm | 12 ++++++++++++ xCAT-server/share/xcat/netboot/sles/genimage | 15 ++++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 7969484c7..d97d4de6d 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -482,6 +482,18 @@ sub mknetboot my $initrdstr = "xcat/netboot/$osver/$arch/$profile/initrd-stateless.gz"; $initrdstr = "xcat/netboot/$osver/$arch/$profile/initrd-statelite.gz" if ($statelite); + + if($statelite) + { + my $statelitetb = xCAT::Table->new('statelite'); + my $mntopts = $statelitetb->getAttribs({node => $node}, 'mntopts'); + + my $mntoptions = $mntopts->{'mntopts'}; + if(defined($mntoptions)) + { + $kcmdline .= "MNTOPTS=\'$mntoptions\'"; + } + } $bptab->setNodeAttribs( $node, { diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 6ab405ac6..79fd31eec 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -768,8 +768,8 @@ sub mkinitrd { push @ndrivers, qw{qdio.ko ccwgroup.ko qeth.ko qeth_l2.ko qeth_l3.ko} if ($arch eq "s390x"); # for nfs - push @ndrivers, qw{sunrpc.ko lockd.ko nfs_acl.ko fscache.ko auth_rpcgss.ko exportfs.ko nfsd.ko nfs.ko}; - + my @modlist = qw{sunrpc.ko lockd.ko nfs_acl.ko fscache.ko auth_rpcgss.ko exportfs.ko nfsd.ko nfs.ko}; + unshift(@ndrivers, @modlist); } mkpath("/tmp/xcatinitrd.$$/bin"); @@ -927,7 +927,7 @@ EOMS # check the kernel parameters firstly # if one parameter for the booting device is here, it will be used PRINIC=$prinic - +XCATMNTOPTS='nolock,tcp' for i in `cat /proc/cmdline`; do KEY=`echo \$i |awk -F= '{print \$1}'` if [ "\$KEY" == 'netdev' ]; then @@ -939,6 +939,11 @@ for i in `cat /proc/cmdline`; do VALUE=`echo \$i |awk -F= '{print \$2}'` # format: XCAT=xcatmaster:xcatdport XCATSERVER=\$VALUE + elif [ "\$KEY" == 'MNTOPTS' ]; then + VALUE=`echo \$i |awk -F\\' '{print \$2}'` + # format: MNTOPTS='nolock,time=800' + XCATMNTOPTS=\$VALUE + fi done @@ -1094,7 +1099,7 @@ fi mkdir -p \$NEWROOT/\$RWDIR/persistent MAXTRIES=5 ITER=0 - while ! mount \$SNAPSHOTSERVER:\$SNAPSHOTROOT \$NEWROOT/\$RWDIR/persistent -o nolock,tcp + while ! mount \$SNAPSHOTSERVER:\$SNAPSHOTROOT \$NEWROOT/\$RWDIR/persistent -o nolock,\$XCATMNTOPTS do ITER=\$(expr \$ITER + 1) if [ "\$ITER" == "\$MAXTRIES" ] @@ -1106,7 +1111,7 @@ fi shell exit fi - echo -e "\${RED}Hmmm... Can't mount \$SNAPSHOTSERVER:\$SNAPSHOTROOT. \${NORMAL}" + echo -e "\${RED}Hmmm... Can't mount \$SNAPSHOTSERVER:\$SNAPSHOTROOT. \${NORMAL} \$XCATMNTOPTS" RS=`expr \$RANDOM % 20` echo -e "Trying again in \$RS seconds" sleep \$RS