2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

Remove trailing spaces in file xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite

This commit is contained in:
GONG Jie 2017-12-31 23:59:59 +00:00
parent aeeaee143f
commit 1938976d4f

View File

@ -1,5 +1,5 @@
#!/bin/bash
# rc.statelite will grab all the mount points we need to check
# rc.statelite will grab all the mount points we need to check
# for keeping an image together. This will have to do until unionfs
# is ready.
# don't do chkconfig: 345 00 99
@ -18,8 +18,8 @@ DEFAULT="${MNTDIR}/.default"
LOCAL="${MNTDIR}/.sllocal/localmnt"
LOG="${MNTDIR}/${SL}/statelite.log"
ELIST=[] # entry list, each entry will contain the type and the path
declare -a CLIST
declare -a PLIST
declare -a CLIST
declare -a PLIST
PERSISTENT="${MNTDIR}/$SL/persistent"
@ -35,7 +35,7 @@ GetSyncInfo () {
# who is our xCAT server? He's most likely our dhcp identifier.
if [ ! -x ${MNTDIR}/usr/bin/openssl ]; then
echo "Image does not include openssl!"
echo "Image does not include openssl!"
exit 1
fi
@ -93,7 +93,7 @@ GetSyncInfo () {
# files will now be inside /.snapshot/tmpfs/synclist in the form:
# options path
xCATCmd $XCATSERVER litetree \
| sed -e 's/<[^>]*>//g' \
| egrep -v '^ *$' \
@ -164,8 +164,8 @@ MountTrees () {
ResolveLinks () {
exec <$SYNCLIST
i=0
while read type path
i=0
while read type path
do
ELIST[$i]="$type $path";
i=$[ $i+1 ];
@ -176,7 +176,7 @@ ResolveLinks () {
set -- ${ELIST[$i]}
type=$1
path=$2
parent="`/usr/bin/dirname $path`/"
efound=0
while [ "$parent" != "//" ]; do
@ -187,11 +187,11 @@ ResolveLinks () {
if [ "$parent" = "$jpath" ]; then
efound=1
break 2
fi
fi
done
parent="`/usr/bin/dirname $parent`/"
done
if [ "$efound" = "1" ]; then
# put it into CLIST
CLIST[$[ ${#CLIST[@]} ]]=${ELIST[$i]}
@ -207,7 +207,7 @@ ResolveLinks () {
# put it into PLIST
PLIST[$[ ${#PLIST[@]} ]]=${ELIST[$i]}
fi
fi
fi
done
num=${#PLIST[@]}
@ -240,7 +240,7 @@ ProcessType () {
echo "mkdir -p ${TMPFS}${PPATH}" >>$LOG
fi
case "${3}" in
case "${3}" in
link) # the previous name is tmpfs,rw
if [ -d ${TMPFS}${2} ]; then
/bin/cp -r -a ${1}* ${TMPFS}${2}
@ -270,7 +270,7 @@ ProcessType () {
if [ "${4}" = "0" ]; then
TARGET=`echo ${TMPFS}${2} | /bin/sed -e 's/\/$//'`
LINK=`echo ${1} | /bin/sed -e "s|^${MNTDIR}||"`
echo "ln -sf ${LINK} ${TARGET}" >>$LOG 2>&1
/bin/ln -sf ${LINK} ${TARGET} >>$LOG 2>&1
fi
@ -355,7 +355,7 @@ ProcessType () {
tempfs) # "tempfs" is kept here for compatibility, "tmpfs" has replaced it
ORIG=`echo ${2} | /bin/sed -e 's/\/$//'`
TARGET=`echo ${1}`
if [ -d ${TMPFS}${2} ]; then
/bin/cp -r -a ${1}* ${TMPFS}${2}
echo "cp -r -a ${1}* ${TMPFS}${2}" >>$LOG
@ -363,16 +363,16 @@ ProcessType () {
/bin/cp -r -a ${1} ${TMPFS}${2}
echo "cp -r -a ${1} ${TMPFS}${2}" >>$LOG
fi
if [ "$isChild" = "0" ]; then
echo "mount --bind ${TMPFS}${2} ${MNTDIR}${ORIG}" >>$LOG
/bin/mount --bind ${TMPFS}${2} ${MNTDIR}${ORIG}>>$LOG 2>&1
/bin/mount --bind ${TMPFS}${2} ${MNTDIR}${ORIG}>>$LOG 2>&1
fi
;;
tmpfs) # the default option, same as "rw" and "NULL"
ORIG=`echo ${2} | /bin/sed -e 's/\/$//'`
TARGET=`echo ${1}`
if [ -d ${TMPFS}${2} ]; then
/bin/cp -r -a ${1}* ${TMPFS}${2}
echo "cp -r -a ${1}* ${TMPFS}${2}" >>$LOG
@ -380,10 +380,10 @@ ProcessType () {
/bin/cp -r -a ${1} ${TMPFS}${2}
echo "cp -r -a ${1} ${TMPFS}${2}" >>$LOG
fi
if [ "$isChild" = "0" ]; then
echo "mount --bind ${TMPFS}${2} ${MNTDIR}${ORIG}" >>$LOG
/bin/mount --bind ${TMPFS}${2} ${MNTDIR}${ORIG}>>$LOG 2>&1
/bin/mount --bind ${TMPFS}${2} ${MNTDIR}${ORIG}>>$LOG 2>&1
fi
;;
localdisk)
@ -416,7 +416,7 @@ ProcessType () {
rw) # the default option, same as "tmpfs" and "NULL"
ORIG=`echo ${2} | /bin/sed -e 's/\/$//'`
TARGET=`echo ${1}`
if [ -d ${TMPFS}${2} ]; then
/bin/cp -r -a ${1}* ${TMPFS}${2}
echo "cp -r -a ${1}* ${TMPFS}${2}" >>$LOG
@ -424,10 +424,10 @@ ProcessType () {
/bin/cp -r -a ${1} ${TMPFS}${2}
echo "cp -r -a ${1} ${TMPFS}${2}" >>$LOG
fi
if [ "$isChild" = "0" ]; then
echo "mount --bind ${TMPFS}${2} ${MNTDIR}${ORIG}" >>$LOG
/bin/mount --bind ${TMPFS}${2} ${MNTDIR}${ORIG}>>$LOG 2>&1
/bin/mount --bind ${TMPFS}${2} ${MNTDIR}${ORIG}>>$LOG 2>&1
fi
;;
persistent)
@ -448,7 +448,7 @@ ProcessType () {
echo "mount --bind ${TARGET} ${MNTDIR}/${ORIG}" >>$LOG
/bin/mount --bind ${TARGET} ${MNTDIR}/${ORIG}>>$LOG 2>&1
;;
ro)
ro)
# need to make sure directory exists:
if [ ! -d ${TMPFS}${PPATH} ]; then
/bin/mkdir -p ${TMPFS}${PPATH} >>$LOG 2>&1
@ -457,7 +457,7 @@ ProcessType () {
# before mount, need to check whether it exists or not
STRPATH="${TMPFS}${2}"
STRLEN=${#STRPATH}
CHAREND=`echo ${STRPATH} | /usr/bin/cut -c${STRLEN}`
CHAREND=`echo ${STRPATH} | /usr/bin/cut -c${STRLEN}`
if [ "${CHAREND}" = "/" ]; then # it is one directory
/bin/rm -rf ${STRPATH}