mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-22 03:32:04 +00:00
modify getipmi and bmcsetup works also as a post/postboot script for diskful or diskless installation
This commit is contained in:
parent
aeda6e9021
commit
6440032111
@ -232,6 +232,7 @@ then
|
||||
#genesis scripts package, don't remove genesis amd64 files
|
||||
#rm -f ../../$package_dir_name/${file_low}-amd64_*.deb
|
||||
cd $file
|
||||
CURDIR=$(pwd)
|
||||
dch -v $pkg_version -b -c debian/changelog $build_string
|
||||
if [ "$target_arch" = "all" ]; then
|
||||
#xcat probe use some functions shipped by xCAT, for below reasons we need to copy files to xCAT-probe directory
|
||||
@ -239,7 +240,6 @@ then
|
||||
#2 don't maintain two files for each script
|
||||
#3 symbolic link can't work during package
|
||||
if [ $file_low = "xcat-probe" ]; then
|
||||
CURDIR=$(pwd)
|
||||
mkdir -p ${CURDIR}/lib/perl/xCAT/
|
||||
cp -f ${CURDIR}/../perl-xCAT/xCAT/NetworkUtils.pm ${CURDIR}/lib/perl/xCAT/
|
||||
cp -f ${CURDIR}/../perl-xCAT/xCAT/GlobalDef.pm ${CURDIR}/lib/perl/xCAT/
|
||||
@ -248,15 +248,19 @@ then
|
||||
dpkg-buildpackage -uc -us
|
||||
else
|
||||
if [ "$file" = "xCAT-genesis-scripts" ]; then
|
||||
CURDIR=$(pwd)
|
||||
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
|
||||
elif [ "$file" = "xCAT" ]; then
|
||||
cp ${CURDIR}/../xCAT-genesis-scripts/bin/bmcsetup ${CURDIR}/postscripts/
|
||||
cp ${CURDIR}/../xCAT-genesis-scripts/bin/getipmi ${CURDIR}/postscripts/
|
||||
fi
|
||||
dpkg-buildpackage -uc -us -a$target_arch
|
||||
if [ "$file" = "xCAT-genesis-scripts" ]; then
|
||||
CURDIR=$(pwd)
|
||||
echo "Move control file back: mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch}"
|
||||
mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch}
|
||||
elif [ "$file" = "xCAT" ]; then
|
||||
rm -f ${CURDIR}/postscripts/bmcsetup
|
||||
rm -f ${CURDIR}/postscripts/getipmi
|
||||
fi
|
||||
fi
|
||||
rc=$?
|
||||
|
9
makerpm
9
makerpm
@ -107,7 +107,10 @@ function makexcat {
|
||||
TARGET="--target $ARCH"
|
||||
|
||||
if [ "$RPMNAME" = "xCAT" ]; then
|
||||
cd `dirname $0`/$RPMNAME
|
||||
cd `dirname $0`/
|
||||
cp xCAT-genesis-scripts/bin/bmcsetup $RPMNAME/postscripts
|
||||
cp xCAT-genesis-scripts/bin/getipmi $RPMNAME/postscripts
|
||||
cd $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
|
||||
@ -139,6 +142,10 @@ function makexcat {
|
||||
echo "Building $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER-snap*.$ARCH.rpm $EMBEDTXT..."
|
||||
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
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
# 0x08 0x00 0x49 0x4e 0x54 0x45 0x4c
|
||||
# 0x08 0x04
|
||||
#
|
||||
log_label="xcat.genesis.bmcsetup"
|
||||
log_label="bmcsetup"
|
||||
|
||||
TIMEOUT=15
|
||||
|
||||
@ -29,6 +29,7 @@ TIMEOUT=15
|
||||
function cold_reset_bmc() {
|
||||
if [ -z $XPROD ]; then
|
||||
logger -s -t $log_label -p local4.crit "CRITICAL ERROR - XPROD must be set before calling ${FUNCNAME[0]}"
|
||||
rm -f /tmp/ipmicfg.xml
|
||||
exit 1
|
||||
fi
|
||||
if [ "$XPROD" = "43707" -a "$IPMIMFG" != '0' ]; then
|
||||
@ -87,6 +88,7 @@ function cold_reset_bmc() {
|
||||
function snooze() {
|
||||
if [ -z $XPROD ]; then
|
||||
logger -s -t $log_label -p local4.crit "CRITICAL ERROR - XPROD must be set before calling ${FUNCNAME[0]}"
|
||||
rm -f /tmp/ipmicfg.xml
|
||||
exit 1
|
||||
fi
|
||||
if [ "$XPROD" = "43707" -a "$IPMIMFG" != '0' ]; then
|
||||
@ -100,7 +102,15 @@ function snooze() {
|
||||
logger -s -t $log_label -p local4.debug "snooze for 1 second..."
|
||||
sleep 1
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
if which ipmitool 2>&1 | grep no; then
|
||||
echo "No ipmitool find, please install it first";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
# Add ipmi_devintf module to allow the ipmitool operation in-band
|
||||
modprobe ipmi_devintf
|
||||
|
||||
allowcred.awk &
|
||||
CREDPID=$!
|
||||
@ -605,3 +615,5 @@ while [ $idev -gt 0 ]; do
|
||||
fi
|
||||
done
|
||||
|
||||
# remove the bmc configuration information before exit
|
||||
rm -f /tmp/ipmicfg.xml
|
||||
|
@ -1,11 +1,12 @@
|
||||
#!/bin/bash
|
||||
log_label="xcat.genesis.getipmi"
|
||||
|
||||
allowcred.awk &
|
||||
CREDPID=$!
|
||||
if [ -z "$XCATDEST" ]; then
|
||||
XCATDEST=$1
|
||||
fi
|
||||
|
||||
# This section only works in genesis
|
||||
if [ -z "$XCATDEST" ]; then
|
||||
for parm in `cat /proc/cmdline` ; do
|
||||
if echo $parm |grep xcatd= > /dev/null; then
|
||||
@ -13,6 +14,12 @@ if [ -z "$XCATDEST" ]; then
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# This section works in diskless/diskful
|
||||
# The environment MASTER_IP and XCATDPORT is exported by mypostscript
|
||||
if [ -z "$XCATDEST" ]; then
|
||||
XCATDEST=$MASTER_IP:$XCATDPORT
|
||||
fi
|
||||
|
||||
for LANCHAN in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
|
||||
if ipmitool channel info $LANCHAN 2> /dev/null | grep 802.3 > /dev/null 2>&1 && ipmitool raw 0xc 2 $LANCHAN 5 0 0 > /dev/null 2>&1;
|
||||
then break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user