From a2eb94fd1cee6e5d38a39b1cab71b7d4056ceac3 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 8 Mar 2013 03:10:32 +0000 Subject: [PATCH] support genimage -l for dracut mode git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15429 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../share/xcat/netboot/rh/dracut/xcatroot | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot index 900cdad84..b6595b017 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot @@ -3,6 +3,8 @@ NEWROOT=$3 RWDIR=.statelite XCATMASTER=$XCAT +. /lib/dracut-lib.sh +rootlimit="$(getarg rootlimit=)" if [ ! -z "$imgurl" ]; then if [ xhttp = x${imgurl%%:*} ]; then NFS=0 @@ -41,7 +43,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 -o mode=755 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 @@ -52,7 +59,13 @@ elif [ -r /rootimg.gz ]; then echo Done elif [ -r /rootimg-statelite.gz ]; then echo Setting up RAM-root tmpfs for statelite mode. - mount -t tmpfs -o mode=755 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