From f0987c908f408a63d4927711979b571071b1d21a Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 12 Nov 2013 16:42:03 +0800 Subject: [PATCH] fix for bug 4374: support running postscripts under directories in /intall/postscripts/ --- xCAT-server/share/xcat/install/scripts/post.ubuntu | 4 +++- xCAT-server/share/xcat/install/scripts/post.xcat | 4 +++- xCAT/postscripts/xcatdsklspost | 5 +++-- xCAT/postscripts/xcatinstallpost | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) mode change 100644 => 100755 xCAT-server/share/xcat/install/scripts/post.ubuntu diff --git a/xCAT-server/share/xcat/install/scripts/post.ubuntu b/xCAT-server/share/xcat/install/scripts/post.ubuntu old mode 100644 new mode 100755 index d9eb677f2..8a9d65132 --- a/xCAT-server/share/xcat/install/scripts/post.ubuntu +++ b/xCAT-server/share/xcat/install/scripts/post.ubuntu @@ -63,7 +63,9 @@ do export XCATSERVER mv $i/postscripts /xcatpost rm -rf $i - chmod +x /xcatpost/* + # To support the postscripts in the subdirectories under /install/postscripts + #chmod +x /xcatpost/* + chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'` /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' | sed -e 's/<//g' -e 's/&/\&/g' -e 's/"/"/g' -e "s/'/'/g" > /xcatpost/mypostscript MYCONT=`grep MASTER /xcatpost/mypostscript` MAX_RETRIES=10 diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat b/xCAT-server/share/xcat/install/scripts/post.xcat index 44fdf2912..8db67f756 100755 --- a/xCAT-server/share/xcat/install/scripts/post.xcat +++ b/xCAT-server/share/xcat/install/scripts/post.xcat @@ -43,7 +43,9 @@ do # If mypostscript doesn't exist, we will get it through getpostscript.awk if [ ! -x /xcatpost/mypostscript ]; then - chmod +x /xcatpost/* + # To support the postscripts in the subdirectories under /install/postscripts + # chmod +x /xcatpost/* + chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'` /xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' | sed -e 's/<//g' -e 's/&/\&/g' -e 's/"/"/g' -e "s/'/'/g" > /xcatpost/mypostscript diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index e279b9b89..51b5ec830 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -478,8 +478,9 @@ if grep 'rw /rw tmpfs ' /proc/mounts >/dev/null 2>&1; then ln -sf /etc/rc6.d/K10xcatmounts /etc/rc0.d/K10xcatmounts fi - -chmod +x /$xcatpost/*; +# To support the postscripts in the subdirectories under /install/postscripts +#chmod +x /$xcatpost/*; +chmod -R +x `find $xcatpost/ -maxdepth 1 -print | grep -E -v "^($xcatpost/|$xcatpost/_xcat|$xcatpost/_ssh|$xcatpost/ca|$xcatpost/hostkeys)$"` cd /$xcatpost; PATH=/$xcatpost:$PATH diff --git a/xCAT/postscripts/xcatinstallpost b/xCAT/postscripts/xcatinstallpost index 03fd10b82..784721c32 100755 --- a/xCAT/postscripts/xcatinstallpost +++ b/xCAT/postscripts/xcatinstallpost @@ -33,7 +33,9 @@ done cd /xcatpost; PATH=/xcatpost:$PATH export PATH -chmod +x /xcatpost/*; +# To support the postscripts in the subdirectories under /install/postscripts +#chmod +x /xcatpost/*; +chmod -R +x `find /xcatpost/ -maxdepth 1 -print | grep -E -v '^(/xcatpost/|/xcatpost/_xcat|/xcatpost/_ssh|/xcatpost/ca|/xcatpost/hostkeys)$'` POST_IN_DIR="/xcatpost"