2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-03 03:50:08 +00:00

Remove trailing spaces in file xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install

This commit is contained in:
GONG Jie 2017-12-31 23:59:59 +00:00
parent a4737061e1
commit c1aa85237a

View File

@ -13,30 +13,30 @@
#
#
# Usage:
# Copy the xCAT mlnxofed_ib_install script file to postscripts directory:
# Copy the xCAT mlnxofed_ib_install script file to postscripts directory:
# cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install /install/postscripts/mlnxofed_ib_install
#
# 1. Install the ofed driver for diskful node
# 1.1 Set the postscript as one postbootscripts for the node
# chdef xcat01 -p postbootscripts=mlnxofed_ib_install,configiba
# 1.2 Copy the pkglist to the custom directory:
# 1.2 Copy the pkglist to the custom directory:
# cp /opt/xcat/share/xcat/install/<ostype>/compute.<osver>.<arch>.pkglist /install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist
# Edit your /install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist and add:
# Edit your /install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist and add:
# #INCLUDE:/opt/xcat/share/xcat/ib/netboot/<ostype>/ib.<osver>.<arch>.pkglist#
# 1.3 Make sure the related osimage use the customized pkglist.
# 1.3 Make sure the related osimage use the customized pkglist.
# lsdef -t osimage -o <osver>-<arch>-install-compute
# if not, change it:
# chdef -t osimage -o <osver>-<arch>-install-compute pkglist=/install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist
# 1.4 Do the diskful installation
# 2. install the ofed driver for diskless images:
# 2.1 Copy the pkglist to the custom directory:
# 2.1 Copy the pkglist to the custom directory:
# cp /opt/xcat/share/xcat/netboot/<ostype>/compute.<osver>.<arch>.pkglist /install/custom/netboot/<ostype>/compute.<osver>.<arch>.pkglist
# Edit your /install/custom/netboot/<ostype>/<profile>.pkglist and add:
# Edit your /install/custom/netboot/<ostype>/<profile>.pkglist and add:
# #INCLUDE:/opt/xcat/share/xcat/ib/netboot/<ostype>/ib.<osver>.<arch>.pkglist#
# 2.2 Add to postinstall scripts
# Edit your /install/custom/netboot/<ostype>/<profile>.postinstall and add:
# Edit your /install/custom/netboot/<ostype>/<profile>.postinstall and add:
# installroot=$1 ofeddir=/install/post/otherpkgs/<osver>/<arch>/ofed/ NODESETSTATE=genimage /install/postscripts/mlnxofed_ib_install
# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall
# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall
# lsdef -t osimage -o <osver>-<arch>-netboot-compute
# if not, change it:
# chdef -t osimage -o <osver>-<arch>-netboot-compute pkglist=/install/custom/netboot/<ostype>/compute.<osver>.<arch>.pkglist postinstall=/install/custom/netboot/<ostype>/<profile>.postinstall
@ -85,9 +85,9 @@ fi
# $mlnxofed_options is an environment variable passed to the mlnxofed_ib_install script. By default mlnxofed_option is '--without-32bit --force'
if [ -z "$mlnxofed_options" ]; then
mlnxofed_options="--without-32bit --force"
fi
fi
if [[ $NODESETSTATE != "genimage" ]]; then
if [[ $NODESETSTATE != "genimage" ]]; then
# running as a postscript in a full-disk install or AIX diskless install
installroot=""
fi
@ -108,40 +108,40 @@ if [ $OS != "AIX" ]; then
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/.supported_kernels 2>> /tmp/wget.log
if [ -f /etc/os-release ] &&
if [ -f /etc/os-release ] &&
cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null
then
nodename=`hostname`
echo "$nodename 's operating system is Ubuntu."
echo "If you want to install Mellanox_OFED in $nodename, $nodename must have ability to access www.ports.ubuntu.com"
echo -n "checking $nodename 's ability to access www.ports.ubuntu.com ..........."
if ping -c 3 www.ports.ubuntu.com > /dev/null;then
if ping -c 3 www.ports.ubuntu.com > /dev/null;then
echo "[OK]"
else
echo "[Failed]"
echo "please make your $nodename have ability to access www.ports.ubuntu.com"
exit 1
fi
cp /etc/apt/sources.list /etc/apt/sources.list.bak
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty main/d" /etc/apt/sources.list
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates main/d" /etc/apt/sources.list
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty universe/d" /etc/apt/sources.list
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates universe/d" /etc/apt/sources.list
echo "deb http://ports.ubuntu.com/ubuntu-ports/ trusty main
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main
deb http://ports.ubuntu.com/ubuntu-ports/ trusty universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> /etc/apt/sources.list
apt-get clean all
sleep 1
apt-get update
fi
#rpm -Uvh --force libibverbs-devel*.rpm
#rpm -Uvh --force libibverbs-devel*.rpm
#perl -x mlnxofedinstall --without-32bit --force
if [ -f /etc/os-release ] &&
cat /etc/os-release|grep NAME|grep Ubuntu>/dev/null &&
uname -m |grep ppc64 >/dev/null
@ -176,15 +176,15 @@ deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> /etc/apt/s
mount --bind /dev $installroot/dev/
mount --bind /sys $installroot/sys
mount --bind /proc $installroot/proc
chroot $installroot rpm -e --noscripts --allmatches mlnx-ofa_kernel-kmp-default 2>/dev/null
chroot $installroot rpm -e --nodeps --allmatches libibverbs 2>/dev/null
chroot $installroot rpm -e --noscripts --allmatches mlnx-ofa_kernel-kmp-default 2>/dev/null
chroot $installroot rpm -e --nodeps --allmatches libibverbs 2>/dev/null
#chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-32bit --force
chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall $mlnxofed_options
rm -rf $installroot/tmp/ofed_install
umount $installroot/dev/
umount $installroot/sys
umount $installroot/proc
elif [ -f /etc/os-release ] &&
elif [ -f /etc/os-release ] &&
cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null; then
#mkdir $installroot/tmp/ofed_install
@ -196,7 +196,7 @@ deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> /etc/apt/s
echo "$nodename 's operating system is Ubuntu."
echo "If you want to install Mellanox_OFED in $nodename, $nodename must have ability to access public network."
echo -n "checking $nodename 's ability to access public network..........."
if ping -c 3 www.ports.ubuntu.com > /dev/null;then
if ping -c 3 www.ports.ubuntu.com > /dev/null;then
echo "[OK]"
else
echo "[Failed]"
@ -205,36 +205,36 @@ deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> /etc/apt/s
fi
sourceslist="$installroot/etc/apt/sources.list"
cp $sourceslist $sourceslist.bak
cp $sourceslist $sourceslist.bak
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty main/d" $sourceslist
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates main/d" $sourceslist
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty universe/d" $sourceslist
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates universe/d" $sourceslist
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty main/d" $sourceslist
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates main/d" $sourceslist
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty universe/d" $sourceslist
sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates universe/d" $sourceslist
echo "deb http://ports.ubuntu.com/ubuntu-ports/ trusty main
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main
deb http://ports.ubuntu.com/ubuntu-ports/ trusty universe
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> $sourceslist
deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> $sourceslist
chroot $installroot apt-get clean all
sleep 1
chroot $installroot apt-get update
mount --bind /dev $installroot/dev/
mount --bind /proc $installroot/proc/
mount --bind /proc $installroot/proc/
mount --bind /sys $installroot/sys/
mv "${installroot}/bin/uname" "${installroot}/bin/uname.nouse"
# cat <<-EOF >"${installroot}/bin/uname"
# #!/bin/sh
# #!/bin/sh
# [ "\$1" = "-r" ] && cd /lib/modules && for d in *; do :; done && echo \$d
# [ "\$1" = "-m" ] && if [ -d "/proc/powerpc" ];then echo ppc64le;else echo x86_64;fi
# [ "\$1" = "-m" ] && if [ -d "/proc/powerpc" ];then echo ppc64le;else echo x86_64;fi
# [ "\$1" = "-s" ] && echo Linux
# exit 0
# EOF
cat <<-EOF >"${installroot}/bin/uname"
#!/bin/sh
#!/bin/sh
case "\$1" in
"-m")
ARCH="\$(dpkg --print-architecture || rpm -q kernel-\$("\$0" -r) --qf '%{arch}')"
@ -260,24 +260,24 @@ deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> $sourcesli
# head -n 999 "${installroot}/bin/uname"
chmod 0755 "${installroot}/bin/uname"
chroot $installroot sh -c 'apt-get install -y linux-headers-$(uname -r)'
echo "perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options"
chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options
mv "${installroot}/bin/uname.nouse" "${installroot}/bin/uname"
rm -rf $installroot/tmp/ofed_install
rm -rf $installroot/tmp/ofed_install
umount $installroot/dev/
umount $installroot/proc/
umount $installroot/sys/
else
#mkdir $installroot/tmp/ofed_install
#cp -r $OFED_DIR/ $installroot/tmp/ofed_install/
#cp -r $OFED_DIR/ $installroot/tmp/ofed_install/
mkdir -p $installroot/tmp/ofed_install/ofed
( cd "$OFED_DIR" && tar cf - . ) | ( cd "$installroot/tmp/ofed_install/ofed" && tar xf - )
chroot $installroot rpm -e --nodeps --allmatches libibverbs 2>/dev/null
chroot $installroot rpm -e --nodeps --allmatches libibverbs 2>/dev/null
#chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-32bit --force
chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options
rm -rf $installroot/tmp/ofed_install