#!/bin/ksh # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # bos720 src/bos/usr/lib/nim/methods/c_mkshroot.sh 1.2 # # Licensed Materials - Property of IBM # # Restricted Materials of IBM # # COPYRIGHT International Business Machines Corp. 2009 # All Rights Reserved # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # IBM_PROLOG_END_TAG # @(#)51 1.2 src/bos/usr/lib/nim/methods/c_mkshroot.sh, cmdnim, bos720 4/16/09 08:36:10 # COMPONENT_NAME: CMDNIM # # FUNCTIONS: ./usr/lib/nim/methods/c_mkshroot.sh # # ORIGINS: 83 # # include common NIM shell defines/functions NIMPATH=${0%/*} NIMPATH=${NIMPATH%/*} [[ ${NIMPATH} = ${0} ]] && NIMPATH=/usr/lpp/bos.sysmgt/nim NIM_METHODS="${NIMPATH}/methods" . ${NIM_METHODS}/c_sh_lib #---------------------------- module globals -------------------------------- REQUIRED_ATTRS="location spot" OPTIONAL_ATTRS="" # include common root/shared_root defines/functions . ${NIM_METHODS}/dd_funcs #*---------------------------- c_mkshroot ------------------------------ # # NAME: c_mkshroot # # FUNCTION: # create and populate a shared root directory for a diskless client # # EXECUTION ENVIRONMENT: # # NOTES: # # RECOVERY OPERATION: # # DATA STRUCTURES: # parameters: # global: # # RETURNS: (int) # 0 = no errors # >0 = failure # # OUTPUT: #-----------------------------------------------------------------------------*/ # signal processing trap cleanup 0 trap err_signal 1 2 11 15 # NIM initialization nim_init # set parameters from command line while getopts :a:qv c do case ${c} in a) # validate the attr ass parse_attr_ass "${OPTARG}" # if host:dir format given, separate them if [[ ${value} = ?*:/* ]] then eval ${variable}=\"${value#*:}\" eval ${variable}"_host"=${value%:*} else eval ${variable}=\"${value}\" fi ;; q) # show attr info cmd_what exit 0 ;; v) # verbose mode (for debugging) set -x for i in $(typeset +f) do typeset -ft $i done ;; \?) # unknown option error ${ERR_BAD_OPT} ${OPTARG} ;; esac done # check for missing attrs ck_attrs # save the root path from the location variable root="${location}" # populate the shared root directory pop_root # Set the dump device ODM stuff here, once for all set_odm_dump # save ${root}/etc/hosts and link it to /../etc/hosts. # this link will be used by clients in phase 2 of boot. cp ${root}${HOSTS} ${root}${HOSTS}.save ln -fs /..${HOSTS} ${root}${HOSTS} # link /unix to the 64 bit kernel /usr/bin/ln -fs /usr/lib/boot/unix_64 ${location}/unix # add a link from ${root}usr/lib to /../usr/lib ln -fs /../usr/lib ${root}/usr/lib # create the client specific dedicated directory mkdir ${root}/${SHROOT_CUSTDIR} # success exit 0