[ewg] [PATCH] ofed_1_3/ofed_docs: Add vendor script documentaion

Moni Shoua monisonlists at gmail.com
Wed Jan 9 04:27:31 PST 2008


> Moni,
> Please send a patch to OFED_tips.txt explaining how to use this new
> feature (or do you think it should go to the user guide?
> 
> Tziporet

Hi Tziporet,
After giving it a second thought,  OFED_tips.txt look the right place. Please see the patch below.
Thanks




diff --git a/OFED_tips.txt b/OFED_tips.txt
index d94fdf1..3953cb7 100644
--- a/OFED_tips.txt
+++ b/OFED_tips.txt
@@ -9,7 +9,7 @@ Table of Contents
 1. OFED Utilities
 2. Debug HOWTOs
 3. Pinning (Locking) User Memory Pages
-
+4. Adding vedndor specific actions to the installation of OFED
 
 ===============================================================================
 1. OFED Utilities
@@ -236,3 +236,80 @@ these limits entirely.
 	      
 Note: The file /etc/security/limits.conf contains further documentation.
 
+===============================================================================
+4. Adding vendor specific actions to the installation of OFED
+===============================================================================
+
+Vendors that want to add actions to the install/uninstall process of OFED can
+bind external scripts to hooks in install.pl and ofed_uninstall.sh.
+
+4.1  Specifying vendor scripts and configuration parameters
+-----------------------------------------------------------
+This option is only available when installing ofed in non interactive mode.
+Edit the OFED configuration file (ofed.conf ) and add the lines below (you don't have to use all of them).
+
+# Script to run before install process starts
+vendor_pre_install=my_pre_install.sh
+# Script to run after install process finishes
+vendor_post_install=my_post_install.sh
+# Script to run before uninstall process starts
+vendor_pre_uninstall=my_pre_uninstall.sh
+# Script to run after uninstall process finishes
+vendor_post_uninstall=my_post_uninstall.sh
+
+You can also also add vendor specific configuration parameters. Lines that start
+with vendor_config_ will not be parsed by install.pl and can be parsed by one
+of the vendor scripts
+
+vendor_config_something=value_for_that_something
+
+Running ./install.pl -c ofed.conf in the OFED directory will now invoke the
+relevant vendor specific actions.
+
+4.2. Requirements from vendor scripts
+-------------------------------------
+The script files that are given to install.pl in ofed.conf should
+	- be located in the root directory of OFED
+	- return zero on success
+
+If vendor script fails it fails the entire installation.
+
+4.2 Skeleton for pre/post install vendor script
+-----------------------------------------------
+install.pl passes some usefull installation variables to the vendor pre/post
+install scripts environment. See the example below for a typical usage.
+
+#!/bin/bash
+
+eval $*
+
+# The following env. parameters are set at this point
+# 
+# CONFIG: full path filename of the OFED configuration file
+# RPMS: directory of binary RPMs
+# SRPMS: directory of source RPMS
+# PREFIX: prefix of installation
+# TOPDIR: root of OFED package
+# QUIET: quiet operation indicator
+
+function readconf() {
+        local config=$1
+        while read line; do
+            # skip comments
+            [[ ${line:0:1} == "#" ]] && continue
+
+            # skip empty lines
+            [[ -z "$line" ]] && continue
+
+            # parse line
+            token=$(echo $line|cut -f1 -d=)
+            value=$(echo $line|cut -f2 -d=)
+
+        done < "$config"
+}
+
+readconf $CONFIG
+
+exit 0
+
+




More information about the ewg mailing list