
# HG changeset patch # User Heidi Eckhart <heidieck@linux.vnet.ibm.com> # Date 1198059372 -3600 # Node ID cc317a7ef54789a792c264b0906b348e6f29a8a4 # Parent 133cbb1df893f2d031cba3534c88936bce69da78 Added installation support for openWbem Signed-off-by: Heidi Eckhart <heidieck@linux.vnet.ibm.com> diff -r 133cbb1df893 -r cc317a7ef547 base_schema/install_base_schema.sh.in --- a/base_schema/install_base_schema.sh.in Wed Dec 19 11:16:08 2007 +0100 +++ b/base_schema/install_base_schema.sh.in Wed Dec 19 11:16:12 2007 +0100 @@ -3,6 +3,7 @@ DATA="$1" DATA="$1" NS=@CIM_VIRT_NS@ CIMOM=@CIMSERVER@ +SCHEMA_VERSION="2.16" TMPDIR=$(mktemp -d /tmp/cim_schema.XXXXX) @@ -44,6 +45,17 @@ detect_sfcb_dir() { done } +detect_openwbem_dir() { + dirs="/usr/share/mof" + + for d in $dirs; do + if [ -d "$d" ]; then + echo $d + return + fi + done +} + install_schema_pegasus() { local repo=$(detect_peg_repo) @@ -76,6 +88,26 @@ install_schema_sfcb() { sfcbrepos -f } +install_schema_openwbem() { + local dir=$(detect_openwbem_dir) + local schema_dir=$dir/cimv$SCHEMA_VERSION + + mkdir $schema_dir + if [ -d "$schema_dir" ]; then + echo "Unable to determine openwbem schema directory" + return + fi + + cp ${TMPDIR}/cimv???.mof ${TMPDIR}/CIM_Schema.mof + cp -ra ${TMPDIR}/* $schema_dir + + owcreatenamespace -u http://localhost/ -n root/virt + owmofc -u http://localhost/cimom -n root/virt $schema_dir/CIM_Schema.mof + + owcreatenamespace -u http://localhost/ -n root/interop + owmofc -u http://localhost/cimom -n root/interop $schema_dir/cimv???-interop.mof +} + if [ -z "$1" ]; then echo "Usage: $0 [source_dir]" exit 1 @@ -91,6 +123,9 @@ case "$CIMOM" in pegasus) (install_schema_pegasus) >>$DEBUG 2>&1 ;; + openwbem) + (install_schema_openwbem) >>$DEBUG 2>&1 + ;; *) echo ERROR: Unknown CIMOM: $CIMOM ;; diff -r 133cbb1df893 -r cc317a7ef547 provider-register.sh --- a/provider-register.sh Wed Dec 19 11:16:08 2007 +0100 +++ b/provider-register.sh Wed Dec 19 11:16:12 2007 +0100 @@ -477,7 +477,7 @@ openwbem_transform() then for _f in $moffiles do - sed "s/Provider *( *\"cmpi:/Provider(\"cmpi::/g" < $_f >> $OUTFILE + cat $_f >> $OUTFILE done fi } @@ -497,6 +497,9 @@ openwbem_repository() openwbem_install() { + namespace=$1 + shift + CIMMOF=`which owmofc 2> /dev/null` if test $? != 0 then @@ -531,7 +534,7 @@ openwbem_install() if openwbem_transform $_REGFILENAME $* then chatter Registering providers with $state owcimomd - $CIMMOF $_REGFILENAME > /dev/null + $CIMMOF -u http://localhost/cimom -n $namespace $_REGFILENAME > /dev/null else echo "Failed to build OpenWBEM registration MOF." >&2 return 1 @@ -540,6 +543,9 @@ openwbem_install() openwbem_uninstall() { + namespace=$1 + shift + CIMMOF=`which owmofc 2> /dev/null` if test $? != 0 then @@ -728,7 +734,7 @@ then case $cimserver in pegasus) pegasus_install $namespace $mofs ":" $regs;; sfcb) sfcb_install $namespace $mofs ":" $regs;; - openwbem) openwbem_install $mofs ;; + openwbem) openwbem_install $namespace $mofs ;; sniacimom) echo sniacimom not yet supported && exit 1 ;; **) echo "Invalid CIM Server Type " $cimserver && exit 1;; esac @@ -736,7 +742,7 @@ else case $cimserver in pegasus) pegasus_uninstall $namespace $mofs ":" $regs;; sfcb) sfcb_uninstall $namespace $mofs ":" $regs;; - openwbem) openwbem_uninstall $mofs ;; + openwbem) openwbem_uninstall $namespace $mofs ;; sniacimom) echo sniacimom not yet supported && exit 1 ;; **) echo "Invalid CIM Server Type " $cimserver && exit 1;; esac