From 666713d20490dd6815a4b62ec6679bbaa687bbfa Mon Sep 17 00:00:00 2001 From: linggao Date: Fri, 5 Mar 2010 22:29:56 +0000 Subject: [PATCH] bug fix for statelite. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5396 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../xcat/netboot/add-on/statelite/rc.statelite | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite index 05cb7f4dc..129aad988 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite @@ -209,14 +209,21 @@ ProcessType () { #mount -n --bind ${TMPFS}${2} ${1} fi - # finally make the tmpfs link point to the persistent file + #if target is a directory, then remove it first, + #otherwise, the link will be created under this dir instead of replacing it. + # whack of trailing / for persistent directories: + TARGET=`echo ${TMPFS}${2} | sed -e 's/\/$//'` + if [ -d ${TARGET} ] + then + echo "rm -Rf ${TARGET}" >>$LOG + rm -Rf ${TARGET} 2>&1 >>$LOG + fi + # finally make the tmpfs link point to the persistent file + # you have to get rid of the /sysroot in the beginning # so that when the chroot happens the link is valid. LINK=`echo ${PERSISTENT}${2} | sed -e 's/^\/sysroot//'` - # whack of trailing / for persistent directories: - TARGET=`echo ${TMPFS}${2} | sed -e 's/\/$//'` - echo "ln -sf ${LINK} ${TARGET}" >>$LOG ln -sf ${LINK} ${TARGET} >>$LOG 2>&1 ;;