diff options
author | Nathan Straz <nstraz@redhat.com> | 2009-02-02 18:44:35 -0500 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2009-02-02 18:44:35 -0500 |
commit | e38536c907b8cdfbb35de72ae1b736c015429965 (patch) | |
tree | 559e70672029eb6457ac24ec5dd47a45e375497e /steeltoe.sh | |
parent | 7e1247b426ae86d7c660a9ca87f76d43773670f6 (diff) | |
download | steeltoe-e38536c907b8cdfbb35de72ae1b736c015429965.tar.gz steeltoe-e38536c907b8cdfbb35de72ae1b736c015429965.tar.xz steeltoe-e38536c907b8cdfbb35de72ae1b736c015429965.zip |
Diffstat (limited to 'steeltoe.sh')
-rw-r--r-- | steeltoe.sh | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/steeltoe.sh b/steeltoe.sh index dcb8b20..31919c8 100644 --- a/steeltoe.sh +++ b/steeltoe.sh @@ -14,13 +14,13 @@ fail() require() { for vn in $*; do case $vn in - RSH) RSH=`xpe -f $STXML "/steeltoe/config/remoteshell"` || fail "Config option remoteshell not found";; - RCP) RCP=`xpe -f $STXML "/steeltoe/config/remotecopy"` || fail "Config option remotecopy not found";; - TFTPROOT) TFTPROOT=`xpe -f $STXML "/steeltoe/config/tftproot"` || fail "Config option tftproot not found" + RSH) RSH=`gxpp "/steeltoe/config/remoteshell" $STXML` || fail "Config option remoteshell not found";; + RCP) RCP=`gxpp "/steeltoe/config/remotecopy" $STXML` || fail "Config option remotecopy not found";; + TFTPROOT) TFTPROOT=`gxpp "/steeltoe/config/tftproot" $STXML` || fail "Config option tftproot not found" [ -d "$TFTPROOT" -a -w "$TFTPROOT" ] || fail "Directory $TFTPROOT does not exist or is not writeable";; - TREESERVER) TREESERVER=`xpe -f $STXML "/steeltoe/config/treeserver"` || fail "Config option treeserver not found";; - KSBASE) KSBASE=`xpe -f $STXML "/steeltoe/config/kickstartbase"` || fail "Config option kickstartbase not found";; - YABOOTETC) YABOOTETC=`xpe -f $STXML "/steeltoe/config/yabootetc"` || fail "Config option yabootetc not found" + TREESERVER) TREESERVER=`gxpp "/steeltoe/config/treeserver" $STXML` || fail "Config option treeserver not found";; + KSBASE) KSBASE=`gxpp "/steeltoe/config/kickstartbase" $STXML` || fail "Config option kickstartbase not found";; + YABOOTETC) YABOOTETC=`gxpp "/steeltoe/config/yabootetc" $STXML` || fail "Config option yabootetc not found" [ -d "$YABOOTETC" -a -w "$YABOOTETC" ] || fail "Directory $YABOOTETC does not exist or is not writeable";; *) fail "Unknown config requirement '$vn'" esac; done @@ -28,7 +28,7 @@ require() expand_groups() { for target in $*; do - grouplist=$(xpe -f $STXML "//group[@name='$target']") + grouplist=$(gxpp "//group[@name='$target']" $STXML) if [ -z "$grouplist" ]; then echo $target else @@ -242,7 +242,7 @@ tftp_do() hostdir="$TFTPROOT/$host" # Try to lookup something under the host so we catch a non-existant host early. - hostarch=`xpe -f $STXML "//host[@name='$host']/arch"` || fail "Could not look up architecture of host '$host'" + hostarch=`gxpp "//host[@name='$host']/arch" $STXML` || fail "Could not look up architecture of host '$host'" # Check to see if we're overriding the arch on the command line if [ -n "$forcearch" ]; then @@ -250,11 +250,11 @@ tftp_do() fi # First lookup the tree information to make sure it exists. - treebase=`xpe -f $STXML "//tree[@name='$treename' and meta/arch='$hostarch']/path"` || fail "Could not find tree '$treename' for host '$host'" + treebase=`gxpp "//tree[@name='$treename' and meta/arch='$hostarch']/path" $STXML` || fail "Could not find tree '$treename' for host '$host'" # Next figure out which bootloader we need to configure - loadername=`xpe -f $STXML "//host[@name='$host']/bootloader"` || fail "Boot loader not specified for host '$host'" + loadername=`gxpp "//host[@name='$host']/bootloader" $STXML` || fail "Boot loader not specified for host '$host'" # Now find the source for the bootloader link - loadersrc=`xpe -f $STXML "/steeltoe/config/bootloader/$loadername"` || fail "Boot loader source is not set for '$loadername'" + loadersrc=`gxpp "/steeltoe/config/bootloader/$loadername" $STXML` || fail "Boot loader source is not set for '$loadername'" # Make sure the host's TFTP directory exists [ -d "$hostdir" ] || mkdir -p $hostdir # Link in the bootloader specified in the config file @@ -274,7 +274,7 @@ tftp_do() ;; yaboot) genyaboot_do $host $treename > $hostdir/yaboot.conf require YABOOTETC - etcfn="01-`xpe -f $STXML "//host[@name='$host']/macaddr" | tr [A-Z]: [a-z]-`" + etcfn="01-`gxpp "//host[@name='$host']/macaddr" $STXML | tr [A-Z]: [a-z]-`" ln -f $hostdir/yaboot.conf $YABOOTETC/$etcfn # kernel and ramdisk locations differ between RHEL4 and RHEL5 for subdir in ppc/chrp ppc/ppc64; do if [ -f $treebase/$subdir/vmlinuz ]; then @@ -309,7 +309,7 @@ autoks_do() $RSH -l root $host /bin/true || fail "Host $host must be up to auto-kickstart" # Try to lookup something under the host so we catch a non-existant host early. - hostarch=`xpe -f $STXML "//host[@name='$host']/arch"` || fail "Could not look up architecture of host '$host'" + hostarch=`gxpp "//host[@name='$host']/arch" $STXML` || fail "Could not look up architecture of host '$host'" # Figure out where to copy the vmlinuz and initrd on the host if [ "$hostarch" = "ia64" ]; then @@ -380,15 +380,15 @@ virtinstall_do() # Let install_do do all the hard work and set up the tftp area. tftp_do $virthost $treename - virtmac=$(xpe -f $STXML "//host[@name='$virthost']/macaddr") || fail "Unable to find $virthost mac address in $STXML" + virtmac=$(gxpp "//host[@name='$virthost']/macaddr" $STXML) || fail "Unable to find $virthost mac address in $STXML" DEFAULT_RAM=1024 - virtram=$(xpe -f $STXML "//host[@name='$virthost']/ram") + virtram=$(gxpp "//host[@name='$virthost']/ram" $STXML) virtram=${virtram:-$DEFAULT_RAM} ks="$KSBASE/$virthost/ks.cfg" - hostarch=$(xpe -f $STXML "//host[@name='$virthost']/arch") || fail "Could not look up architecture of virthost '$virthost'" - treebase=$(xpe -f $STXML "//tree[@name='$treename' and meta/arch='$hostarch']/path") || fail "Could not find tree '$treename' for virthost '$virthost'" + hostarch=$(gxpp "//host[@name='$virthost']/arch" $STXML) || fail "Could not look up architecture of virthost '$virthost'" + treebase=$(gxpp "//tree[@name='$treename' and meta/arch='$hostarch']/path" $STXML) || fail "Could not find tree '$treename' for virthost '$virthost'" location="http://$TREESERVER/$treebase" extra="'ks=$ks ro selinux=0'" @@ -422,7 +422,7 @@ pxe_reboot() host="$1" set -o pipefail - rootdev=`xpe -f $STXML "//host[@name='$host']/kickstart/rootdisk" | head -1` || fail "Root disk is not specified" + rootdev=`gxpp "//host[@name='$host']/kickstart/rootdisk" $STXML | head -1` || fail "Root disk is not specified" echo "Making /dev/$rootdev on $host unbootable" $RSH -l root $host dd if=/dev/zero of=/dev/$rootdev bs=1 seek=510 count=2 conv=sync > /dev/null 2>&1 # Sync |