From d3846f47f86ca5d383a8265dd78c0e4735cc840e Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 27 Jun 2013 06:09:05 +0000 Subject: [PATCH] add new dracut scripts to support status feedback git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16794 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../fedora/dracut_009/xcat-premount.sh | 1 + .../netboot/fedora/dracut_009/xcat-updateflag | 1 + .../xcat/netboot/fedora/dracut_009/xcatroot | 38 +++++++++++++++++-- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 120000 xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-premount.sh create mode 120000 xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-updateflag diff --git a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-premount.sh b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-premount.sh new file mode 120000 index 000000000..862e21b2e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-premount.sh @@ -0,0 +1 @@ +../../rh/dracut/xcat-premount.sh \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-updateflag b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-updateflag new file mode 120000 index 000000000..ba998cfb2 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcat-updateflag @@ -0,0 +1 @@ +../../rh/dracut/xcat-updateflag \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot index ad17dc2f6..dbed8bfbd 100755 --- a/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot +++ b/xCAT-server/share/xcat/netboot/fedora/dracut_009/xcatroot @@ -3,6 +3,24 @@ NEWROOT=$3 RWDIR=.statelite XCATMASTER=$XCAT +. /lib/dracut-lib.sh +rootlimit="$(getarg rootlimit=)" + + +getarg nonodestatus +NODESTATUS=$? + +MASTER=`echo $XCATMASTER |awk -F: '{print $1}'` +XCATIPORT="$(getarg XCATIPORT=)" +if [ $? -ne 0 ]; then +XCATIPORT="3002" +fi + + +if [ $NODESTATUS -ne 0 ];then +/tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting" +fi + if [ ! -z "$imgurl" ]; then if [ xhttp = x${imgurl%%:*} ]; then NFS=0 @@ -41,7 +59,12 @@ if [ -r /rootimg.sfs ]; then mount --move /rw $NEWROOT/rw elif [ -r /rootimg.gz ]; then echo Setting up RAM-root tmpfs. - mount -t tmpfs rootfs $NEWROOT + if [ -z $rootlimit ];then + mount -t tmpfs -o mode=755 rootfs $NEWROOT + else + mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT + fi + cd $NEWROOT echo -n "Extracting root filesystem:" if [ -x /bin/cpio ]; then @@ -49,10 +72,17 @@ elif [ -r /rootimg.gz ]; then else gzip -cd /rootimg.gz |cpio -idum fi + $NEWROOT/etc/init.d/localdisk echo Done elif [ -r /rootimg-statelite.gz ]; then echo Setting up RAM-root tmpfs for statelite mode. - mount -t tmpfs rootfs $NEWROOT + + if [ -z $rootlimit];then + mount -t tmpfs -o mode=755 rootfs $NEWROOT + else + mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT + fi + cd $NEWROOT echo -n "Extracting root filesystem:" if [ -x /bin/cpio ]; then @@ -99,7 +129,8 @@ elif [ -r /rootimg-statelite.gz ]; then MAXTRIES=5 ITER=0 if [ -z $MNTOPTS ]; then - MNT_OPTIONS="nolock,rsize=32768,tcp,timeo=14" + MNT_OPTIONS="nolock,rsize=32768,tcp,timeo=14" + else MNT_OPTIONS=$MNTOPTS fi @@ -119,6 +150,7 @@ elif [ -r /rootimg-statelite.gz ]; then done fi + $NEWROOT/etc/init.d/localdisk $NEWROOT/etc/init.d/statelite fastboot=yes export fastboot