From 197212a8867c7a71deeb34be33eaf5b8dd291195 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Mon, 9 Jan 2017 23:36:10 -0500 Subject: [PATCH] Modification based on Victor's comments --- build-ubunturepo | 18 ++++++++++++------ makerpm | 16 +++++++++++----- xCAT-genesis-scripts/bin/bmcsetup | 2 +- xCAT-genesis-scripts/bin/getipmi | 2 ++ 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/build-ubunturepo b/build-ubunturepo index 797b4941a..5895becea 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -249,18 +249,24 @@ then else if [ "$file" = "xCAT-genesis-scripts" ]; then echo "Rename control file to build pkg: mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control" - mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control + cp ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control elif [ "$file" = "xCAT" ]; then - cp ${CURDIR}/../xCAT-genesis-scripts/bin/bmcsetup ${CURDIR}/postscripts/ - cp ${CURDIR}/../xCAT-genesis-scripts/bin/getipmi ${CURDIR}/postscripts/ + # shipping bmcsetup and getipmi scripts as part of postscripts + files=("bmcsetup" "getipmi") + for f in "${files[@]}"; do + cp ${CURDIR}/../xCAT-genesis-scripts/bin/$f ${CURDIR}/postscripts/$f + sed -i "s/xcat.genesis.$f/$f/g" ${CURDIR}/postscripts/$f + done fi dpkg-buildpackage -uc -us -a$target_arch if [ "$file" = "xCAT-genesis-scripts" ]; then echo "Move control file back: mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch}" - mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch} + rm ${CURDIR}/debian/control elif [ "$file" = "xCAT" ]; then - rm -f ${CURDIR}/postscripts/bmcsetup - rm -f ${CURDIR}/postscripts/getipmi + files=("bmcsetup" "getipmi") + for f in "${files[@]}"; do + rm -f ${CURDIR}/postscripts/$f + done fi fi rc=$? diff --git a/makerpm b/makerpm index 2042f1bbf..ba9dd6292 100755 --- a/makerpm +++ b/makerpm @@ -108,9 +108,13 @@ function makexcat { if [ "$RPMNAME" = "xCAT" ]; then cd `dirname $0`/ - cp xCAT-genesis-scripts/bin/bmcsetup $RPMNAME/postscripts - cp xCAT-genesis-scripts/bin/getipmi $RPMNAME/postscripts - cd $RPMNAME + # shipping bmcsetup and getipmi scripts as part of postscripts + files=("bmcsetup" "getipmi") + for f in "${files[@]}"; do + cp "xCAT-genesis-scripts/bin/"$f ${RPMNAME}/postscripts/$f + sed -i "s/xcat.genesis.$f/$f/g" ${RPMNAME}/postscripts/$f + done + cd `dirname $0`/$RPMNAME tar --exclude .svn --exclude upflag -czf $RPMROOT/SOURCES/postscripts.tar.gz postscripts LICENSE.html tar --exclude .svn -czf $RPMROOT/SOURCES/prescripts.tar.gz prescripts tar --exclude .svn -czf $RPMROOT/SOURCES/templates.tar.gz templates @@ -143,8 +147,10 @@ function makexcat { rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec $TARGET --define "version $VER" $REL "$EASE" RC=$? if [ "$RPMNAME" = "xCAT" ]; then - rm -f `dirname $0`/$RPMNAME/postscripts/bmcsetup - rm -f `dirname $0`/$RPMNAME/postscripts/getipmi + files=("bmcsetup" "getipmi") + for f in "${files[@]}"; do + rm -f `dirname $0`/${RPMNAME}/postscripts/$f + done fi fi } diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index 27d82281c..d28a3bf59 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -13,7 +13,7 @@ # 0x08 0x00 0x49 0x4e 0x54 0x45 0x4c # 0x08 0x04 # -log_label="bmcsetup" +log_label="xcat.genesis.bmcsetup" TIMEOUT=15 diff --git a/xCAT-genesis-scripts/bin/getipmi b/xCAT-genesis-scripts/bin/getipmi index 5ec67b7c6..ecc046213 100755 --- a/xCAT-genesis-scripts/bin/getipmi +++ b/xCAT-genesis-scripts/bin/getipmi @@ -1,5 +1,7 @@ #!/bin/bash +log_label="xcat.genesis.getipmi" + allowcred.awk & CREDPID=$! if [ -z "$XCATDEST" ]; then