2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 20:30:56 +00:00

reduce the number of options

This commit is contained in:
huweihua
2015-10-18 05:29:15 -04:00
parent c9a3a3ab21
commit 600fa8fa00

View File

@ -19,13 +19,13 @@
#
#usage:
#
# Copy the xCAT mlnxofed_ib_install.v2 script file to postscripts directory:
# Copy the xCAT mlnxofed_ib_install.v2 script file to postscripts directory and rename to mlnxofed_ib_install:
# cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 /install/postscripts/mlnxofed_ib_install
#
# Prepare Mellanox OFED ISO file and save it into any subdirectory under /install. but for easy to use and comply with xcat regular rule, recommend using a meaningful directory, such as /install/post/otherpkgs/<osver>/<arch>/ofed/
# Prepare Mellanox OFED ISO file and save it into any subdirectory under /install.
#
# 1. install the ofed driver for diskfull node
# [NOTE] step 1.1-1.2 only needed by redhat and sles
# [NOTE] step 1.1-1.2 are only needed by redhat and sles
# 1.1 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:
@ -33,23 +33,23 @@
# 1.2 Make the related osimage use the customized pkglist.
# chdef -t osimage -o <osver>-<arch>-install-compute pkglist=/install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist
# 1.3 set mlnxofed_ib_install as postbootscripts for the target node. assign necessary attribute for mlnxofed_ib_install at same time.
# chdef <node> -p postbootscripts="mlnxofed_ib_install -ofeddir <the path of OFED ISO file> -ofedname <OFED ISO file name>"
# chdef <node> -p postbootscripts="mlnxofed_ib_install -p /install/<path>/<OFED.ISO>"
# [NOTE] The default options input into Mellanox are '--without-32bit --without-fw-update --force'
# you can appoint the options by yourslef with '-passmlnxofedoptions' option of mlnxofed_ib_install
# In order to distinguish which options are tranfered to Mellanox and which options are belong to mlnxofed_ib_install, any options wanted to transfered to Mellanox must follow behind -passmlnxofedoptions and end with "-end-", for example:
# chdef <node> -p postbootscripts="mlnxofed_ib_install -ofeddir <the path of OFED ISO file> -passmlnxofedoptions --without-32bit --add-kernel-support --force -end- -ofedname < OFED ISO file name>"
# you can appoint the options by yourslef with '-m' option of mlnxofed_ib_install
# In order to distinguish which options are tranfered to Mellanox and which options are belong to mlnxofed_ib_install, any options wanted to transfered to Mellanox must follow behind -m and end with "-end-", for example:
# chdef <node> -p postbootscripts="mlnxofed_ib_install -p /install/<path>/<OFED.ISO> -m --without-32bit --add-kernel-support --force -end-"
# 1.4 do the diskfull installation
# nodeset <node> osimage=<osimage> ......
#
# 2. install the ofed driver for diskless images:
# [NOTE] step 2.1 only needed by redhat and sles
# [NOTE] step 2.1 is only needed by redhat and sles
# 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:
# #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:
# /install/postscripts/mlnxofed_ib_install -ofeddir <the path of OFED ISO file> -ofedname <OFED ISO file name> -nodesetstate genimage -installroot $1
# /install/postscripts/mlnxofed_ib_install -p /install/<path>/<OFED.ISO> -n genimage -i $1
# 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:
@ -73,21 +73,20 @@ function usage() {
echo "Usage: mlnxofed_ib_install [-attribute]"
echo " attribute include:"
echo " -h: print this help message"
echo " -ofeddir: the directory where OFED file is saved. this is necessary attribute"
echo " -ofedname: the name of OFED file. this is necessary attribute"
echo " -passmlnxofedoptions: the options inputted into mlnxofedinstall script, defualt value are --without-32bit --without-fw-update --force"
echo " -installroot: the image root path. this is necessary attribute in diskless scenario"
echo " -nodesetstate: nodeset status, the value are install, boot or genimage"
echo " -p: the path where OFED file is saved. this is necessary attribute"
echo " -m: the options inputted into mlnxofedinstall script, defualt value are --without-32bit --without-fw-update --force"
echo " -i: the image root path. this is necessary attribute in diskless scenario"
echo " -n: nodeset status, the value are one of install, boot or genimage"
}
while [ "$#" -gt "0" ]
do
case "$1" in
"-ofeddir")
"-p")
shift
OFED_DIR="$1"
OFED_PATH="$1"
;;
"-passmlnxofedoptions")
"-m")
shift
while [ "-end-" != "$1" ]
do
@ -95,15 +94,11 @@ do
shift
done
;;
"-ofedname")
shift
OFED_NAME="$1"
;;
"-installroot")
"-i")
shift
IMGROOTPATH="$1"
;;
"-nodesetstate")
"-n")
shift
NODESETSTATE="$1"
;;
@ -119,16 +114,11 @@ do
shift
done
if [ -z "$OFED_DIR" ]; then
if [ -z "$OFED_PATH" ]; then
echo "[Error] Without Mellanox OFED file path, please assign correct path"
exit 1
fi
if [ -z "$OFED_NAME" ]; then
echo "[Error] Without Mellanox OFED file name, please assign correct name"
exit 1
fi
if [ "$NODESETSTATE" = "genimage" -a -z "$IMGROOTPATH" ]; then
echo "[Error] this is for diskless installation, please assign correct diskless image root path"
exit 1
@ -136,6 +126,9 @@ fi
[ "${#MLNXOFED_OPTS}" = 0 ] && MLNXOFED_OPTS=(--without-32bit --without-fw-update --force)
OFED_DIR=${OFED_PATH%/*}
OFED_NAME=${OFED_PATH##*/}
echo "Mellanox OFED file path is $OFED_DIR"
echo "Mellanox OFED file is $OFED_NAME"
echo "Mellanox OFED options are ${MLNXOFED_OPTS[@]}"