You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(8) |
Sep
(14) |
Oct
(7) |
Nov
(9) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(11) |
Feb
(4) |
Mar
(6) |
Apr
(3) |
May
(7) |
Jun
(12) |
Jul
(4) |
Aug
(6) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(2) |
2011 |
Jan
(2) |
Feb
(3) |
Mar
(10) |
Apr
(7) |
May
(5) |
Jun
(3) |
Jul
(7) |
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(4) |
Dec
(6) |
2012 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(2) |
May
(21) |
Jun
(6) |
Jul
(3) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(10) |
2013 |
Jan
(10) |
Feb
(8) |
Mar
|
Apr
(9) |
May
(33) |
Jun
(11) |
Jul
(16) |
Aug
(3) |
Sep
(8) |
Oct
(1) |
Nov
(16) |
Dec
(7) |
2014 |
Jan
(19) |
Feb
(71) |
Mar
(46) |
Apr
(16) |
May
(1) |
Jun
(18) |
Jul
(6) |
Aug
(12) |
Sep
(7) |
Oct
(4) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(15) |
Feb
(6) |
Mar
(10) |
Apr
(7) |
May
(16) |
Jun
(21) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Nathan F. <nf...@au...> - 2010-03-03 21:22:40
|
The SLES 10 releases of powerpc-utils do not include all of the commands currently in the powerpc-utils package. Namely these are drmgr, lsslot, lsdevinfo, ls-veth, ls-vscsi, and ls-vdev. In order to allow SLES 10 install bases to come up to speed without causing any collisions in package naming a powerpc-utils-sles10-addons package is being created to install the previously mentioned utilities. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/addon/powerpc-utils-addon.spec =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ powerpc-utils/addon/powerpc-utils-addon.spec 2010-02-18 16:04:34.000000000 -0600 @@ -0,0 +1,63 @@ +%define name powerpc-utils-sles10-addons +%define version 1.0.0 +%define release 0 +Summary: Powerpc-utils Add-ons for SLES10 SP3 +Name: %{name} +Version: %{version} +Release: %{release} +License: IBM Common Public License (CPL) +Group: System Environment +Source: powerpc-utils-sles10-addons-%{version}.tar.gz +BuildRoot: /tmp/%{name}-buildroot/ +Requires: /bin/bash, /bin/sh, /bin/sed, /usr/bin/perl, librtas >= 1.3.0 + +%description +Additional utilities for maintaining and servicing PowerPC systems on SLES10 +SP3 releases. + +%prep +%setup -q + +%build +%configure +%{__make} %{?_smp_mflags} + +%install +%{__rm} -rf $RPM_BULD_ROOT +%{__make} install -C addon DESTDIR=$RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +#/usr/share/doc/packages/powerpc-utils-sles10-addons/README +#/usr/share/doc/packages/powerpc-utils-sles10-addons/COPYRIGHT + +/usr/sbin/drmgr +/usr/sbin/lsslot +/usr/sbin/lsdevinfo +/usr/sbin/ls-veth +/usr/sbin/ls-vdev +/usr/sbin/ls-vscsi + +%post +# Post-install script ----------------------------------------------- +ln -sf /usr/sbin/drmgr /usr/sbin/drslot_chrp_slot +ln -sf /usr/sbin/drmgr /usr/sbin/drslot_chrp_pci +ln -sf /usr/sbin/drmgr /usr/sbin/drslot_chrp_cpu +ln -sf /usr/sbin/drmgr /usr/sbin/drslot_chrp_phb +ln -sf /usr/sbin/drmgr /usr/sbin/drslot_chrp_mem +ln -sf /usr/sbin/drmgr /usr/sbin/drslot_chrp_hea +ln -sf /usr/sbin/drmgr /usr/sbin/drmig_chrp_pmig + +%postun +# Post-uninstall script --------------------------------------------- +if [ "$1" = "0" ]; then + # last uninstall + rm /usr/sbin/drslot_chrp_slot + rm /usr/sbin/drslot_chrp_pci + rm /usr/sbin/drslot_chrp_cpu + rm /usr/sbin/drslot_chrp_phb + rm /usr/sbin/drslot_chrp_mem + rm /usr/sbin/drslot_chrp_hea + rm /usr/sbin/drmig_chrp_pmig +fi + Index: powerpc-utils/addon/Makefile =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ powerpc-utils/addon/Makefile 2010-02-18 20:04:38.000000000 -0600 @@ -0,0 +1,35 @@ +## Makefile for powerpc-utils-sles10-addons + +PPU_ADDONS_NAME = powerpc-utils-sles10-addons +VERSION = 1.0.0 + +SCRIPTS = ../scripts/lsdevinfo ../scripts/ls-vdev ../scripts/ls-veth ../scripts/ls-vscsi +UTILS = ../src/drmgr/drmgr ../src/drmgr/lsslot +DOCS = ../COPYRIGHT README + +INSTALL = /usr/bin/install +SBIN_DIR = /usr/sbin +DOC_DIR = /usr/share/doc/packages/$(PPU_ADDONS_NAME) + +PPU_TARNAME = powerpc-utils-1.2.2 +PPU_ADDONS_TARNAME = $(PPU_ADDONS_NAME)-$(VERSION) + +all: + +install: + $(INSTALL) -d -m 755 $(DESTDIR)$(SBIN_DIR) + $(foreach f,$(SCRIPTS),$(INSTALL) -m 744 $f $(DESTDIR)$(SBIN_DIR);) + $(foreach f,$(UTILS),$(INSTALL) -m 744 $f $(DESTDIR)$(SBIN_DIR);) + $(INSTALL) -d -m 755$(DESTDIR)$(DOC_DIR) + $(foreach f,$(DOCS),$(INSTALL) -m 744 $f $(DESTDIR)$(DOC_DIR);) + +dist: + $(MAKE) -C .. dist + tar -xzf ../$(PPU_TARNAME).tar.gz + mv $(PPU_TARNAME) $(PPU_ADDONS_TARNAME) + mkdir $(PPU_ADDONS_TARNAME)/addon + cp Makefile $(PPU_ADDONS_TARNAME)/addon + cp powerpc-utils-sles10-addons.spec $(PPU_ADDONS_TARNAME)/addon + tar -chof $(PPU_ADDONS_TARNAME).tar $(PPU_ADDONS_TARNAME) + gzip $(PPU_ADDONS_TARNAME).tar + rm -rf $(PPU_ADDONS_TARNAME) Index: powerpc-utils/addon/README =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ powerpc-utils/addon/README 2010-02-18 20:12:22.000000000 -0600 @@ -0,0 +1,27 @@ +powerpc-utils-sles10-addons package +=================================== +This package is meant as an addon for the SLES 10 SP3 release to bring +the installed powerpc-utilities up to par with the latest ppowerpc-utils +release. the packages installed are those that are not installed with the +version of powerpc-utils shipped with SLES 10 SP3. + +This package contains utilities which are intended for maintenance of IBM +powerpc platforms that follow the POWER Architecture Platform Reference (PAPR), +This package requires the librtas package in order to function properly. +All of these utilities must be run as root. + +drmgr +----- +Dynamic reconfiguration manager. This isn't neccessarily meant to be invoked +from the command line, but rather is the command invoked via the RMC connection +from an HMC. + +lsslot: +------ +Tool used to determine dyanmic reconfiguration capable slots/cpus/memory +on a partition. + +lsdevinfo, ls-vdev, ls-veth, ls-vscsi: +--------- +These utilities provides the HMC or IVM with name information for +virtual devices so they can be matched against the VIOS names. |
From: Roman R. <rr...@re...> - 2010-03-03 17:43:37
|
Hi, I have done some changes in init script. Also I have changed vscsisadmin script; now it returns usable return values. And those return values are now used in init script. RR |
From: Brian K. <br...@li...> - 2010-02-16 22:20:24
|
Running ls-vdev with disconnected adapters can result in errors getting printed. Fixup ls-vdev to bit bucket these errors. Signed-off-by: Brian King <br...@li...> --- scripts/ls-vdev | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN scripts/ls-vdev~powerpc_lsvdev_fixup scripts/ls-vdev --- powerpc-utils/scripts/ls-vdev~powerpc_lsvdev_fixup 2010-02-16 16:04:22.000000000 -0600 +++ powerpc-utils-bjking1/scripts/ls-vdev 2010-02-16 16:13:12.000000000 -0600 @@ -53,12 +53,12 @@ for dev in $($LS -d /proc/device-tree/vd slot=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/v-scsi@//") # there is only one host per device, assign it to the path's name - for host in $($LS -d /sys/devices/vio/$slot/host*) ; do + for host in $($LS -d /sys/devices/vio/$slot/host* 2> /dev/null) ; do parent=$(echo $host | $SED -e "s/.*\///") host=$($LS -d /sys/devices/vio/$slot/host*/) # loop through the targets for this host. - for t in $($LS -d $host/target*); do + for t in $($LS -d $host/target* 2> /dev/null); do target=$(echo $($LS -d $t/$($LS $t | $GREP -v uevent | $GREP -v power | $GREP -v subsystem))) if [[ ! -d $target/block ]]; then name=$(echo $($LS -d $target/block*) | $SED -e "s/.*://") _ |
From: Brian K. <br...@li...> - 2010-02-12 23:13:11
|
Adds ls-vscsi, ls-veth, and ls-vdev scripts the HMC can call to retrieve VIO related information from Linux. Signed-off-by: Brian King <br...@li...> --- powerpc-utils.spec.in | 3 + scripts/Makefile.am | 4 +- scripts/Makefile.in | 4 +- scripts/ls-vdev | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ scripts/ls-veth | 64 ++++++++++++++++++++++++++++++++++++++++++ scripts/ls-vscsi | 62 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 209 insertions(+), 4 deletions(-) diff -puN /dev/null scripts/ls-vdev --- /dev/null 2009-12-15 17:58:07.000000000 -0600 +++ powerpc-utils-bjking1/scripts/ls-vdev 2010-02-12 17:00:27.000000000 -0600 @@ -0,0 +1,76 @@ +#! /bin/bash + +# Copyright (c) 2010 International Business Machines +# Common Public License Version 1.0 (see COPYRIGHT) +# +# Author Brian King <br...@li...> +# +# ls-vdev - This utility provides the HMC or IVM with name information for +# virtual scsi adapters and devices +# + +LSVDEV="ls-vdev" +VERSION="0.1" +LS="/bin/ls" +GREP="/bin/grep" +SED="/bin/sed" + +usage() +{ + echo "Usage: $LSVDEV" + echo "Provide information on Virtual SCSI adapters and devices" + echo "" + echo "Optional arguments." + echo " -V, --version Display version information and exit" + echo " -h, --help Display this help information and exit" + echo "" +} + +show_version() +{ + echo "$LSVDEV: Version $VERSION" + echo "Written by: Brian King <br...@li...>" +} + + +while getopts "Vh" flag ; do + case "$flag" in + V) show_version + exit 0 ;; + + h) usage + exit 0 ;; + \?) usage + exit 1 ;; + :) echo "Option -$OPTARG requires an argument." + exit 1 ;; + esac +done + +# Look at every ibmvscsi (Virtual SCSI) device +for dev in $($LS -d /proc/device-tree/vdevice/v-scsi* 2> /dev/null) ; do + # find the slot so it can be used in sysfs + slot=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/v-scsi@//") + + # there is only one host per device, assign it to the path's name + for host in $($LS -d /sys/devices/vio/$slot/host*) ; do + parent=$(echo $host | $SED -e "s/.*\///") + host=$($LS -d /sys/devices/vio/$slot/host*/) + + # loop through the targets for this host. + for t in $($LS -d $host/target*); do + target=$(echo $($LS -d $t/$($LS $t | $GREP -v uevent | $GREP -v power | $GREP -v subsystem))) + if [[ ! -d $target/block ]]; then + name=$(echo $($LS -d $target/block*) | $SED -e "s/.*://") + else + name=$($LS $target/block) + fi + + echo "$parent $name" + done + done +done + +exit 0 + +# end diff -puN /dev/null scripts/ls-veth --- /dev/null 2009-12-15 17:58:07.000000000 -0600 +++ powerpc-utils-bjking1/scripts/ls-veth 2010-02-12 16:57:39.000000000 -0600 @@ -0,0 +1,64 @@ +#! /bin/bash + +# Copyright (c) 2010 International Business Machines +# Common Public License Version 1.0 (see COPYRIGHT) +# +# Author Brian King <br...@li...> +# +# ls-veth - This utility provides the HMC or IVM with name information for +# virtual ethernet devices +# + +LSVETH="ls-veth" +VERSION="0.1" +OFPATHNAME="/usr/sbin/ofpathname" +CAT="/bin/cat" +LS="/bin/ls" +SED="/bin/sed" + +usage() +{ + echo "Usage: $LSVETH [-h]" + echo "Provide information on Virtual Ethernet devices" + echo "" + echo "Optional arguments." + echo " -V, --version Display version information and exit" + echo " -h, --help Display this help information and exit" + echo "" +} + +show_version() +{ + echo "$LSVETH: Version $VERSION" + echo "Written by: Brian King <br...@li...>" +} + + +while getopts "Vh" flag ; do + case "$flag" in + V) show_version + exit 0 ;; + + h) usage + exit 0 ;; + \?) usage + exit 1 ;; + :) echo "Option -$OPTARG requires an argument." + exit 1 ;; + esac +done + +# Look at every ibmveth (Virtual Ethernet) device +for dev in $($LS -d /proc/device-tree/vdevice/l-lan* 2> /dev/null); do + # use ofpathname to get the device name (i.e. eth0) + name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//")) + + # get the physical location + physloc=$($CAT $dev/ibm,loc-code) + + echo "$name $physloc" +done + +exit 0 + +# end diff -puN /dev/null scripts/ls-vscsi --- /dev/null 2009-12-15 17:58:07.000000000 -0600 +++ powerpc-utils-bjking1/scripts/ls-vscsi 2010-02-12 16:59:31.000000000 -0600 @@ -0,0 +1,62 @@ +#! /bin/bash + +# Copyright (c) 2010 International Business Machines +# Common Public License Version 1.0 (see COPYRIGHT) +# +# Author Brian King <br...@li...> +# +# ls-vscsi - This utility provides the HMC or IVM with name information for +# virtual scsi devices +# + +LSVSCSI="ls-vscsi" +VERSION="0.1" +CAT="/bin/cat" +LS="/bin/ls" +SED="/bin/sed" + +usage() +{ + echo "Usage: $LSVSCSI" + echo "Provide information on Virtual devices" +} + +show_version() +{ + echo "$LSVSCSI: Version $VERSION" + echo "Written by: Brian King <br...@li...>" +} + + +while getopts "Vh" flag ; do + case "$flag" in + + V) show_version + exit 0 ;; + + h) usage + exit 0 ;; + \?) usage + exit 1 ;; + esac +done + + +# Look at every ibmvscsi (Virtual SCSI) device +for dev in $($LS -d /proc/device-tree/vdevice/v-scsi* 2> /dev/null) ; do + # pull the physical location + physloc=$($CAT $dev/ibm,loc-code) + + # find the slot so it can be used in sysfs + slot=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/v-scsi@//") + + # there is only one host per device, assign it to the path's name + for host in $($LS -d /sys/devices/vio/$slot/host*) ; do + name=$(echo $host | $SED -e "s/.*\///") + echo "$name $physloc" + done +done + +exit 0 + +# end diff -puN powerpc-utils.spec.in~powerpc_lsvio powerpc-utils.spec.in --- powerpc-utils/powerpc-utils.spec.in~powerpc_lsvio 2010-02-12 17:08:37.000000000 -0600 +++ powerpc-utils-bjking1/powerpc-utils.spec.in 2010-02-12 17:09:06.000000000 -0600 @@ -41,6 +41,9 @@ Utilities for maintaining and servicing /usr/sbin/ofpathname /usr/sbin/ppc64_cpu /usr/sbin/lsdevinfo +/usr/sbin/ls-veth +/usr/sbin/ls-vdev +/usr/sbin/ls-vscsi /etc/init.d/ibmvscsis.sh diff -puN scripts/Makefile.am~powerpc_lsvio scripts/Makefile.am --- powerpc-utils/scripts/Makefile.am~powerpc_lsvio 2010-02-12 17:10:39.000000000 -0600 +++ powerpc-utils-bjking1/scripts/Makefile.am 2010-02-12 17:11:11.000000000 -0600 @@ -2,10 +2,10 @@ bin_SCRIPTS = amsstat dist_bin_SCRIPTS = amsstat sbin_SCRIPTS = update_flash hvcsadmin vscsisadmin rtas_dump snap \ - bootlist ofpathname lsdevinfo + bootlist ofpathname lsdevinfo ls-veth ls-vscsi ls-vdev dist_sbin_SCRIPTS = update_flash hvcsadmin vscsisadmin rtas_dump snap \ - bootlist ofpathname lsdevinfo + bootlist ofpathname lsdevinfo ls-veth ls-vscsi ls-vdev initdir = /etc/init.d init_DATA = ibmvscsis.sh diff -puN scripts/Makefile.in~powerpc_lsvio scripts/Makefile.in --- powerpc-utils/scripts/Makefile.in~powerpc_lsvio 2010-02-12 17:10:44.000000000 -0600 +++ powerpc-utils-bjking1/scripts/Makefile.in 2010-02-12 17:11:24.000000000 -0600 @@ -150,10 +150,10 @@ top_srcdir = @top_srcdir@ bin_SCRIPTS = amsstat dist_bin_SCRIPTS = amsstat sbin_SCRIPTS = update_flash hvcsadmin vscsisadmin rtas_dump snap \ - bootlist ofpathname lsdevinfo + bootlist ofpathname lsdevinfo ls-veth ls-vscsi ls-vdev dist_sbin_SCRIPTS = update_flash hvcsadmin vscsisadmin rtas_dump snap \ - bootlist ofpathname lsdevinfo + bootlist ofpathname lsdevinfo ls-veth ls-vscsi ls-vdev initdir = /etc/init.d init_DATA = ibmvscsis.sh _ |
From: Brian K. <br...@li...> - 2010-02-12 23:01:42
|
Fixes up lsdevinfo to return the data needed by the HMC to fully support end to end virtual device view enablement. Adds support for the -R parameter, which is required. Also adds support for the uniquetype field. Signed-off-by: Brian King <br...@li...> --- scripts/lsdevinfo | 258 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 232 insertions(+), 26 deletions(-) diff -puN scripts/lsdevinfo~lsdevinfo_fixups scripts/lsdevinfo --- powerpc-utils/scripts/lsdevinfo~lsdevinfo_fixups 2010-02-12 16:26:21.000000000 -0600 +++ powerpc-utils-bjking1/scripts/lsdevinfo 2010-02-12 16:53:13.000000000 -0600 @@ -20,6 +20,7 @@ CAT="/bin/cat" LS="/bin/ls" GREP="/bin/grep" SED="/bin/sed" +TR="/usr/bin/tr" # Usage statemnet usage() @@ -31,6 +32,7 @@ usage() echo " -q criteria Specifies a criteria to select which devices are" echo " to be displayed." echo " -F format Specifies the set of attributes to be displayed." + echo " -R Recursively display children of selected devices" echo " -c Display output as a comma separated list for" echo " each device." echo " -V, --version Display version information and exit" @@ -102,16 +104,21 @@ print_attr () # default: CR separated list comma_sep=0 +# default: non recursive +recursive=0 + # default: display all devices criteria="" # default: display all attributes format="" -while getopts "cq:F:Vh" flag ; do +while getopts "cRq:F:Vh" flag ; do case "$flag" in c) comma_sep=1;; + R) recursive=1;; + q) criteria=$OPTARG;; F) format=$OPTARG;; @@ -141,13 +148,13 @@ if [[ $comma_sep -eq 0 ]]; then separator="\n" begin="\t" dev_end="\n\n" - path_begin="\n\npath:\n\tparent=\"vio\"" + path_begin="\n\npath:\n\tparent=" path_end="" else dev_begin="" separator="," dev_end="\n" - path_begin=",path=(parent=\"vio\"," + path_begin=",path=(parent=" path_end=")" fi @@ -156,9 +163,17 @@ fi for dev in $($LS -d /proc/device-tree/vdevice/l-lan* 2> /dev/null); do # use ofpathname to get the device name (i.e. eth0) name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//")) + connection=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/l-lan@//") + parent="vio" # get the physical location physloc=$($CAT $dev/ibm,loc-code) + uniquetype="adapter/vdevice/IBM,l-lan" + class="adapter" + subclass="vdevice" + type="IBM,l-lan" + prefix="eth" + driver="ibmveth" show=1 # if there is a criteria in the command line, check if this device matches @@ -166,6 +181,12 @@ for dev in $($LS -d /proc/device-tree/vd show=0 check_criteria "name" check_criteria "physloc" + check_criteria "uniquetype" + check_criteria "class" + check_criteria "subclass" + check_criteria "type" + check_criteria "prefix" + check_criteria "driver" fi # print the info only if the device matches the criteria @@ -173,12 +194,20 @@ for dev in $($LS -d /proc/device-tree/vd # the name attribute is always printed echo -ne $dev_begin$begin"name="\"$name\" + print_attr "uniquetype" + print_attr "class" + print_attr "subclass" + print_attr "type" + print_attr "prefix" + print_attr "driver" + # if there is no format in the command line or it contains "path", then # print the path. Doesn't use print_attr because all of the fields in # the path attribute should be printed. if [[ $format == "" || $format =~ "path" ]]; then - echo -ne $path_begin - echo -ne $separator$begin"physloc="$physloc + echo -ne $path_begin\"$parent\" + echo -ne $separator$begin"physloc="\"$physloc\" + echo -ne $separator$begin"connection="\"$connection\" echo -ne $path_end fi # done with this device @@ -191,18 +220,92 @@ done for dev in $($LS -d /proc/device-tree/vdevice/v-scsi* 2> /dev/null) ; do # pull the physical location physloc=$(cat $dev/ibm,loc-code) + hostphysloc=$physloc + connection=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/v-scsi@//") # find the slot so it can be used in sysfs slot=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/v-scsi@//") # there is only one host per device, assign it to the path's name for host in $($LS -d /sys/devices/vio/$slot/host*) ; do - parent=$(echo $host/scsi_host* | $SED -e "s/.*://") + parent=$(echo $host | $SED -e "s/.*\///") + name=$parent + + uniquetype="adapter/vdevice/IBM,v-scsi" + class="adapter" + subclass="vdevice" + type="IBM,v-scsi" + prefix="host" + driver="ibmvscsic" + + host=$($LS -d /sys/devices/vio/$slot/host*/) + if [[ -d $host/scsi_host ]]; then + scsihost=$($LS -d $host/scsi_host/host*/) + else + scsihost=$($LS -d $host/scsi_host*/) + fi + + if [[ $(cat $scsihost/state) == "running" ]] ; then + status=1 + else + status=0 + fi + + show=1 + # if there is a criteria in the command line, check if this + # device matches + if [[ $criteria != "" ]] ; then + show=0 + check_criteria "name" + check_criteria "physloc" + check_criteria "status" + check_criteria "uniquetype" + check_criteria "class" + check_criteria "subclass" + check_criteria "type" + check_criteria "prefix" + check_criteria "driver" + fi + + if [[ $show -ne 0 ]]; then + # the name attribute is always printed + echo -ne $dev_begin$begin"name="\"$name\" + + print_attr "uniquetype" + print_attr "class" + print_attr "subclass" + print_attr "type" + print_attr "prefix" + print_attr "driver" + print_attr "status" + + # print the path, see note for ibmveth above + if [[ $format == "" || $format =~ "path" ]]; then + echo -ne $path_begin"\"vio\"" + echo -ne $separator$begin"connection="\"$connection\" + echo -ne $separator$begin"physloc="\"$physloc\" + echo -ne $path_end + fi + # done with this target + echo -ne $dev_end + fi # loop through the targets for this host. for t in $($LS -d $host/target*); do - target=$(echo $($LS -d $t/$($LS $t | $GREP -v uevent))) - name=$(echo $($LS -d $target/block*) | $SED -e "s/.*://") + target=$(echo $($LS -d $t/$($LS $t | $GREP -v uevent | $GREP -v power | $GREP -v subsystem))) + if [[ ! -d $target/block ]]; then + name=$(echo $($LS -d $target/block*) | $SED -e "s/.*://") + else + name=$($LS $target/block) + fi + + conn=$($OFPATHNAME /dev/$name 2> /dev/null | $SED -e "s/.*disk@//") + connection=${conn:0:12} + uniquetype="disk/vscsi/vdisk" + class="disk" + subclass="vscsi" + type="vdisk" + physloc=$hostphysloc"-L"$conn if [[ $(cat $target/state) == "running" ]] ; then status=1 @@ -210,15 +313,24 @@ for dev in $($LS -d /proc/device-tree/vd status=0 fi - show=1 - # if there is a criteria in the command line, check if this - # device matches - if [[ $criteria != "" ]] ; then + # if there is a criteria in the command line, we are recursive and + # the parent passed criteria, show the device + if [[ $criteria != "" && $show -eq 1 && $recursive -eq 1 ]]; then + show=1 + elif [[ $criteria != "" ]] ; then + # if there is a criteria in the command line, check if this + # device matches show=0 check_criteria "name" - check_criteria "physloc" check_criteria "status" + check_criteria "physloc" check_criteria "parent" + check_criteria "uniquetype" + check_criteria "class" + check_criteria "subclass" + check_criteria "type" + else + show=1 fi # print the info only if the device matches the criteria @@ -226,14 +338,20 @@ for dev in $($LS -d /proc/device-tree/vd # the name attribute is always printed echo -ne $dev_begin$begin"name="\"$name\" + print_attr "uniquetype" + print_attr "class" + print_attr "subclass" + print_attr "type" print_attr "status" # print the path, see note for ibmveth above if [[ $format == "" || $format =~ "path" ]]; then - echo -ne $path_begin - echo -ne $separator$begin"name="\"$parent\" - echo -ne $separator$begin"physloc="$physloc - echo $path_end + echo -ne $path_begin\"$parent\" + echo -ne $separator$begin"connection="\"$connection\" + echo -ne $separator$begin"physloc="\"$physloc\" + echo -ne $separator$begin"path_id="\""0"\" + echo -ne $separator$begin"path_status="\"$status\" + echo -ne $path_end fi # done with this target echo -ne $dev_end @@ -247,13 +365,75 @@ done for dev in $($LS -d /proc/device-tree/vdevice/vfc-client* 2> /dev/null) ; do # pull the physical location physloc=$(cat $dev/ibm,loc-code) + connection=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/vfc-client@//") + hostphysloc=$physloc # find the slot so it can be used in sysfs slot=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/vfc-client@//") # there is only one host per device, assign it to the path's name for host in $($LS -d /sys/devices/vio/$slot/host*) ; do - parent=$(echo $host/scsi_host* | $SED -e "s/.*://") + parent=$(echo $host | $SED -e "s/.*\///") + name=$parent + + uniquetype="adapter/vdevice/IBM,vfc-client" + class="adapter" + subclass="vdevice" + type="IBM,vfc-client" + prefix="host" + driver="ibmvfc" + + host=$($LS -d /sys/devices/vio/$slot/host*/) + if [[ -d $host/scsi_host ]]; then + scsihost=$($LS -d $host/scsi_host/host*/) + else + scsihost=$($LS -d $host/scsi_host*/) + fi + + if [[ $(cat $scsihost/state) == "running" ]] ; then + status=1 + else + status=0 + fi + + show=1 + # if there is a criteria in the command line, check if this + # device matches + if [[ $criteria != "" ]] ; then + show=0 + check_criteria "name" + check_criteria "physloc" + check_criteria "status" + check_criteria "uniquetype" + check_criteria "class" + check_criteria "subclass" + check_criteria "type" + check_criteria "prefix" + check_criteria "driver" + fi + + if [[ $show -ne 0 ]]; then + # the name attribute is always printed + echo -ne $dev_begin$begin"name="\"$name\" + + print_attr "uniquetype" + print_attr "class" + print_attr "subclass" + print_attr "type" + print_attr "prefix" + print_attr "driver" + print_attr "status" + + # print the path, see note for ibmveth above + if [[ $format == "" || $format =~ "path" ]]; then + echo -ne $path_begin"\"vio\"" + echo -ne $separator$begin"connection="\"$connection\" + echo -ne $separator$begin"physloc="\"$physloc\" + echo -ne $path_end + fi + # done with this target + echo -ne $dev_end + fi # As opposed to ibmvscsi, there are multiple rports in each host for rport in $($LS -d $host/rport*); do @@ -262,7 +442,18 @@ for dev in $($LS -d /proc/device-tree/vd # the targets for t in $($LS -d $rport/target*); do for target in $($LS $t | $GREP "[0-9]*:[0-9]*:[0-9]*:[0-9]*"); do - name=$(echo $($LS -d $t/$target/block*) | $SED -e "s/.*://") + if [[ ! -d $t/$target/block ]]; then + name=$(echo $($LS -d $t/$target/block*) | $SED -e "s/.*://") + else + name=$($LS $t/$target/block) + fi + + connection=$($OFPATHNAME /dev/$name 2> /dev/null | $SED -e "s/.*disk@//") + physloc=$hostphysloc"-W"$(echo $connection | $TR "[:lower:]" "[:upper:]" | $SED -e "s/,/-L/") + uniquetype="disk/fcp/disk" + class="disk" + subclass="fcp" + type="disk" if [[ $(cat $t/$target/state) == "running" ]] ; then status=1 @@ -270,15 +461,24 @@ for dev in $($LS -d /proc/device-tree/vd status=0 fi - show=1 + # if there is a criteria in the command line, we are recursive and + # the parent passed criteria, show the device + if [[ $criteria != "" && $show -eq 1 && $recursive -eq 1 ]]; then + show=1 + elif [[ $criteria != "" ]] ; then # if there is a criteria in the command line, check if this - # device matches - if [[ $criteria != "" ]] ; then - show=0 + # device matches + show=0 check_criteria "name" check_criteria "physloc" check_criteria "status" check_criteria "parent" + check_criteria "uniquetype" + check_criteria "class" + check_criteria "subclass" + check_criteria "type" + else + show=1 fi # print the info only if the device matches the criteria @@ -286,13 +486,19 @@ for dev in $($LS -d /proc/device-tree/vd # the name attribute is always printed echo -ne $dev_begin$begin"name="\"$name\" + print_attr "uniquetype" + print_attr "class" + print_attr "subclass" + print_attr "type" print_attr "status" # print the path, see note for ibmveth above if [[ $format == "" || $format =~ "path" ]]; then - echo -ne $path_begin - echo -ne $separator$begin"name="\"$parent\" - echo -ne $separator$begin"physloc="$physloc + echo -ne $path_begin\"$parent\" + echo -ne $separator$begin"connection="\"$connection\" + echo -ne $separator$begin"physloc="\"$physloc\" + echo -ne $separator$begin"path_id="\""0"\" + echo -ne $separator$begin"path_status="\"$status\" echo -ne $path_end fi # done with this device _ |
From: Brian K. <br...@li...> - 2010-02-12 23:01:36
|
Adds ls-vscsi, ls-veth, and ls-vdev scripts the HMC can call to retrieve VIO related information from Linux. Signed-off-by: Brian King <br...@li...> --- scripts/ls-vdev | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ scripts/ls-veth | 64 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/ls-vscsi | 62 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 202 insertions(+) diff -puN /dev/null scripts/ls-vdev --- /dev/null 2009-12-15 17:58:07.000000000 -0600 +++ powerpc-utils-bjking1/scripts/ls-vdev 2010-02-12 17:00:27.000000000 -0600 @@ -0,0 +1,76 @@ +#! /bin/bash + +# Copyright (c) 2010 International Business Machines +# Common Public License Version 1.0 (see COPYRIGHT) +# +# Author Brian King <br...@li...> +# +# ls-vdev - This utility provides the HMC or IVM with name information for +# virtual scsi adapters and devices +# + +LSVDEV="ls-vdev" +VERSION="0.1" +LS="/bin/ls" +GREP="/bin/grep" +SED="/bin/sed" + +usage() +{ + echo "Usage: $LSVDEV" + echo "Provide information on Virtual SCSI adapters and devices" + echo "" + echo "Optional arguments." + echo " -V, --version Display version information and exit" + echo " -h, --help Display this help information and exit" + echo "" +} + +show_version() +{ + echo "$LSVDEV: Version $VERSION" + echo "Written by: Brian King <br...@li...>" +} + + +while getopts "Vh" flag ; do + case "$flag" in + V) show_version + exit 0 ;; + + h) usage + exit 0 ;; + \?) usage + exit 1 ;; + :) echo "Option -$OPTARG requires an argument." + exit 1 ;; + esac +done + +# Look at every ibmvscsi (Virtual SCSI) device +for dev in $($LS -d /proc/device-tree/vdevice/v-scsi* 2> /dev/null) ; do + # find the slot so it can be used in sysfs + slot=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/v-scsi@//") + + # there is only one host per device, assign it to the path's name + for host in $($LS -d /sys/devices/vio/$slot/host*) ; do + parent=$(echo $host | $SED -e "s/.*\///") + host=$($LS -d /sys/devices/vio/$slot/host*/) + + # loop through the targets for this host. + for t in $($LS -d $host/target*); do + target=$(echo $($LS -d $t/$($LS $t | $GREP -v uevent | $GREP -v power | $GREP -v subsystem))) + if [[ ! -d $target/block ]]; then + name=$(echo $($LS -d $target/block*) | $SED -e "s/.*://") + else + name=$($LS $target/block) + fi + + echo "$parent $name" + done + done +done + +exit 0 + +# end diff -puN /dev/null scripts/ls-veth --- /dev/null 2009-12-15 17:58:07.000000000 -0600 +++ powerpc-utils-bjking1/scripts/ls-veth 2010-02-12 16:57:39.000000000 -0600 @@ -0,0 +1,64 @@ +#! /bin/bash + +# Copyright (c) 2010 International Business Machines +# Common Public License Version 1.0 (see COPYRIGHT) +# +# Author Brian King <br...@li...> +# +# ls-veth - This utility provides the HMC or IVM with name information for +# virtual ethernet devices +# + +LSVETH="ls-veth" +VERSION="0.1" +OFPATHNAME="/usr/sbin/ofpathname" +CAT="/bin/cat" +LS="/bin/ls" +SED="/bin/sed" + +usage() +{ + echo "Usage: $LSVETH [-h]" + echo "Provide information on Virtual Ethernet devices" + echo "" + echo "Optional arguments." + echo " -V, --version Display version information and exit" + echo " -h, --help Display this help information and exit" + echo "" +} + +show_version() +{ + echo "$LSVETH: Version $VERSION" + echo "Written by: Brian King <br...@li...>" +} + + +while getopts "Vh" flag ; do + case "$flag" in + V) show_version + exit 0 ;; + + h) usage + exit 0 ;; + \?) usage + exit 1 ;; + :) echo "Option -$OPTARG requires an argument." + exit 1 ;; + esac +done + +# Look at every ibmveth (Virtual Ethernet) device +for dev in $($LS -d /proc/device-tree/vdevice/l-lan* 2> /dev/null); do + # use ofpathname to get the device name (i.e. eth0) + name=$($OFPATHNAME -l $(echo $dev | $SED -e "s/\/proc\/device-tree//")) + + # get the physical location + physloc=$($CAT $dev/ibm,loc-code) + + echo "$name $physloc" +done + +exit 0 + +# end diff -puN /dev/null scripts/ls-vscsi --- /dev/null 2009-12-15 17:58:07.000000000 -0600 +++ powerpc-utils-bjking1/scripts/ls-vscsi 2010-02-12 16:59:31.000000000 -0600 @@ -0,0 +1,62 @@ +#! /bin/bash + +# Copyright (c) 2010 International Business Machines +# Common Public License Version 1.0 (see COPYRIGHT) +# +# Author Brian King <br...@li...> +# +# ls-vscsi - This utility provides the HMC or IVM with name information for +# virtual scsi devices +# + +LSVSCSI="ls-vscsi" +VERSION="0.1" +CAT="/bin/cat" +LS="/bin/ls" +SED="/bin/sed" + +usage() +{ + echo "Usage: $LSVSCSI" + echo "Provide information on Virtual devices" +} + +show_version() +{ + echo "$LSVSCSI: Version $VERSION" + echo "Written by: Brian King <br...@li...>" +} + + +while getopts "Vh" flag ; do + case "$flag" in + + V) show_version + exit 0 ;; + + h) usage + exit 0 ;; + \?) usage + exit 1 ;; + esac +done + + +# Look at every ibmvscsi (Virtual SCSI) device +for dev in $($LS -d /proc/device-tree/vdevice/v-scsi* 2> /dev/null) ; do + # pull the physical location + physloc=$($CAT $dev/ibm,loc-code) + + # find the slot so it can be used in sysfs + slot=$(echo $dev | $SED -e "s/\/proc\/device-tree\/vdevice\/v-scsi@//") + + # there is only one host per device, assign it to the path's name + for host in $($LS -d /sys/devices/vio/$slot/host*) ; do + name=$(echo $host | $SED -e "s/.*\///") + echo "$name $physloc" + done +done + +exit 0 + +# end _ |
From: Nathan F. <nf...@au...> - 2010-01-25 16:26:59
|
Brad Peters wrote: > Nathan Fontenot wrote: >> Brad Peters wrote: >>> These spec file changes allow you to run rpmbuild to build the rpm from >>> source. All >>> you need to do now is provide the tarball with a >>> powerpc-utils-[version].tar.gz name, >>> copy it into /usr/src/packages/SOURCES (or whereever $_topdir is >>> pointing), copy the >>> spec in /usr/src/packages/SPECS, and run: >>> >>>> rpmbuild --ba --target=ppc /usr/src/packages/SPECS/powerpc-utils.spec >>> I guess either way will work, but it seems like a good idea to have >>> rpmbuild do as >>> much of the work as possible. >>> >> Took this for a spin, and this is much nicer than all of the prep work >> I was having to do previously to get a rpm built. >> >> I have one comment on the patch... >> >> (please post patches inline instead of attaching them, this way people >> don't have to cut and paste the patch into their reply to comment on it) >> >> --- powerpc-utils-1.2.2/powerpc-utils.spec.in 2010-01-19 >> 10:18:05.000000000 -0800 >> +++ powerpc-utils.spec.in 2010-01-20 10:43:21.000000000 -0800 >> @@ -7,13 +7,24 @@ Version: %{version} >> Release: %{release} >> License: IBM Common Public License (CPL) >> Group: System Environment >> -Source0: N/A >> -BuildRoot: /tmp/%{name}-buildroot/ >> +Source: powerpc-utils-%{version}.tar.gz >> +BuildRoot: %{name}-buildroot/ >> >> I think this still needs to be /tmp/%{name}-buildroot. In my testing the >> rpm build failed when trying to create /powerpc-utils-buildroot. > > Hi Nathan, > > Huh, normally, rpmbuild will create the specified > directory in /tmp by default, then do an install to $_topdir, or > /usr/src/packages/BUILD/powerpc-utils-1.2.2, in this case. This looks like > a permissions problem, so I'm curious if you built as root, or as a > normal user? I did the build as myself and it attempted to create /powerpc-utils-buildroot. Which failed as it should. -Nathan > > >> + /bin/mkdir /powerpc-utils-buildroot >> /bin/mkdir: cannot create directory `/powerpc-utils-buildroot': >> Permission denied >> error: Bad exit status from /var/tmp/rpm-tmp.38059 (%build) >> >> -Nathan > > |
From: Brad P. <bp...@li...> - 2010-01-23 00:53:25
|
Nathan Fontenot wrote: > Brad Peters wrote: >> These spec file changes allow you to run rpmbuild to build the rpm from >> source. All >> you need to do now is provide the tarball with a >> powerpc-utils-[version].tar.gz name, >> copy it into /usr/src/packages/SOURCES (or whereever $_topdir is >> pointing), copy the >> spec in /usr/src/packages/SPECS, and run: >> >>> rpmbuild --ba --target=ppc /usr/src/packages/SPECS/powerpc-utils.spec >> >> I guess either way will work, but it seems like a good idea to have >> rpmbuild do as >> much of the work as possible. >> > > Took this for a spin, and this is much nicer than all of the prep work > I was having to do previously to get a rpm built. > > I have one comment on the patch... > > (please post patches inline instead of attaching them, this way people > don't have to cut and paste the patch into their reply to comment on it) > > --- powerpc-utils-1.2.2/powerpc-utils.spec.in 2010-01-19 > 10:18:05.000000000 -0800 > +++ powerpc-utils.spec.in 2010-01-20 10:43:21.000000000 -0800 > @@ -7,13 +7,24 @@ Version: %{version} > Release: %{release} > License: IBM Common Public License (CPL) > Group: System Environment > -Source0: N/A > -BuildRoot: /tmp/%{name}-buildroot/ > +Source: powerpc-utils-%{version}.tar.gz > +BuildRoot: %{name}-buildroot/ > > I think this still needs to be /tmp/%{name}-buildroot. In my testing the > rpm build failed when trying to create /powerpc-utils-buildroot. Hi Nathan, Huh, normally, rpmbuild will create the specified directory in /tmp by default, then do an install to $_topdir, or /usr/src/packages/BUILD/powerpc-utils-1.2.2, in this case. This looks like a permissions problem, so I'm curious if you built as root, or as a normal user? > > + /bin/mkdir /powerpc-utils-buildroot > /bin/mkdir: cannot create directory `/powerpc-utils-buildroot': > Permission denied > error: Bad exit status from /var/tmp/rpm-tmp.38059 (%build) > > -Nathan -- Best regards, Brad Peters IBM Linux on System-P Platform Serviceability Team Lead 15350 SW Koll Parkway 503-578-3493 TL: 775-3493 bp...@li... bp...@us... AIM: bradpeters1000 |
From: Nathan F. <nf...@au...> - 2010-01-22 21:08:41
|
Brad Peters wrote: > These spec file changes allow you to run rpmbuild to build the rpm from > source. All > you need to do now is provide the tarball with a > powerpc-utils-[version].tar.gz name, > copy it into /usr/src/packages/SOURCES (or whereever $_topdir is > pointing), copy the > spec in /usr/src/packages/SPECS, and run: > >> rpmbuild --ba --target=ppc /usr/src/packages/SPECS/powerpc-utils.spec > > I guess either way will work, but it seems like a good idea to have > rpmbuild do as > much of the work as possible. > Took this for a spin, and this is much nicer than all of the prep work I was having to do previously to get a rpm built. I have one comment on the patch... (please post patches inline instead of attaching them, this way people don't have to cut and paste the patch into their reply to comment on it) --- powerpc-utils-1.2.2/powerpc-utils.spec.in 2010-01-19 10:18:05.000000000 -0800 +++ powerpc-utils.spec.in 2010-01-20 10:43:21.000000000 -0800 @@ -7,13 +7,24 @@ Version: %{version} Release: %{release} License: IBM Common Public License (CPL) Group: System Environment -Source0: N/A -BuildRoot: /tmp/%{name}-buildroot/ +Source: powerpc-utils-%{version}.tar.gz +BuildRoot: %{name}-buildroot/ I think this still needs to be /tmp/%{name}-buildroot. In my testing the rpm build failed when trying to create /powerpc-utils-buildroot. + /bin/mkdir /powerpc-utils-buildroot /bin/mkdir: cannot create directory `/powerpc-utils-buildroot': Permission denied error: Bad exit status from /var/tmp/rpm-tmp.38059 (%build) -Nathan |
From: Nathan F. <nf...@au...> - 2010-01-22 20:18:21
|
Brian King wrote: > From an end user ease of use perspective, we should probably build > both binary and src rpms and make them available on sourceforge. The real problem with this is that the rpms are different than those supplied by the distros. For example, the powerpc-utils package is mucked with and renamed to ppc6-utils on RHEL. This makes it difficult to provide an rpm that cleanly applies to a RHEL install base. Similair situation for Novell, though may no longer do any mucking around with the package in the latest release. Since powerpc-utils is shipped with the distros, I have gone the route of only supplying source tarballs on the website and having users go through their distro to pick an installable package. This also helps avoid the need to provide packages for debian/ubuntu and other non-rpm based distros. -Nathan > > -Brian > > On 01/22/2010 09:48 AM, Nathan Fontenot wrote: >> Brad Peters wrote: >>> Spec file was quite out of date. I added some prep/build/install logic, >>> and corrected for man page name changes. >> Brad, >> >> How are you building rpms with the spec file? The current spec file is set up >> to build binary rpms. It appears that your patch wants to build an rpm with a >> tarball of the source and have the code built on the target machine. >> >> Perhaps this is the way we should go moving forward. Previous powerpc-utils packages >> were built as binary rpms since the rpm was not shipped with the distros and the >> target machine to install these on (i.e. servers) was not expected to have a >> compiler installed. Since powrepc-utils is now shipped with most distros it may >> be time to convert the spec file to not build a binary rpm. >> >> I'm not sure about the man page changes, I have had no problem with the man pages >> when building a binary rpm. Perhaps this change is part of the switch to not >> building this as a binary package. >> >> -Nathan >> >>> Signed-off by: Yours truly, Aka Brad Peters >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------ >>> >>> ------------------------------------------------------------------------------ >>> Throughout its 18-year history, RSA Conference consistently attracts the >>> world's best and brightest in the field, creating opportunities for Conference >>> attendees to learn about information security's most important issues through >>> interactions with peers, luminaries and emerging and established companies. >>> http://p.sf.net/sfu/rsaconf-dev2dev >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Powerpc-utils-devel mailing list >>> Pow...@li... >>> https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel >> ------------------------------------------------------------------------------ >> Throughout its 18-year history, RSA Conference consistently attracts the >> world's best and brightest in the field, creating opportunities for Conference >> attendees to learn about information security's most important issues through >> interactions with peers, luminaries and emerging and established companies. >> http://p.sf.net/sfu/rsaconf-dev2dev >> _______________________________________________ >> Powerpc-utils-devel mailing list >> Pow...@li... >> https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel > > |
From: Brad P. <bp...@li...> - 2010-01-22 18:42:38
|
Nathan Fontenot wrote: > Brad Peters wrote: >> Spec file was quite out of date. I added some prep/build/install logic, >> and corrected for man page name changes. > > Brad, > > How are you building rpms with the spec file? The current spec file > is set up > to build binary rpms. It appears that your patch wants to build an > rpm with a > tarball of the source and have the code built on the target machine. > > Perhaps this is the way we should go moving forward. Previous > powerpc-utils packages > were built as binary rpms since the rpm was not shipped with the > distros and the > target machine to install these on (i.e. servers) was not expected to > have a > compiler installed. Since powrepc-utils is now shipped with most > distros it may > be time to convert the spec file to not build a binary rpm. > > I'm not sure about the man page changes, I have had no problem with > the man pages > when building a binary rpm. Perhaps this change is part of the switch > to not > building this as a binary package. > > -Nathan > Hi Nathan, These spec file changes allow you to run rpmbuild to build the rpm from source. All you need to do now is provide the tarball with a powerpc-utils-[version].tar.gz name, copy it into /usr/src/packages/SOURCES (or whereever $_topdir is pointing), copy the spec in /usr/src/packages/SPECS, and run: > rpmbuild --ba --target=ppc /usr/src/packages/SPECS/powerpc-utils.spec I guess either way will work, but it seems like a good idea to have rpmbuild do as much of the work as possible. Best, Brad >> >> Signed-off by: Yours truly, Aka Brad Peters >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------ >> >> Throughout its 18-year history, RSA Conference consistently attracts the >> world's best and brightest in the field, creating opportunities for >> Conference >> attendees to learn about information security's most important issues >> through >> interactions with peers, luminaries and emerging and established >> companies. >> http://p.sf.net/sfu/rsaconf-dev2dev >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Powerpc-utils-devel mailing list >> Pow...@li... >> https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel -- Best regards, Brad Peters IBM Linux on System-P Platform Serviceability Team Lead 15350 SW Koll Parkway 503-578-3493 TL: 775-3493 bp...@li... bp...@us... AIM: bradpeters1000 |
From: Brian K. <br...@li...> - 2010-01-22 15:54:39
|
>From an end user ease of use perspective, we should probably build both binary and src rpms and make them available on sourceforge. -Brian On 01/22/2010 09:48 AM, Nathan Fontenot wrote: > Brad Peters wrote: >> Spec file was quite out of date. I added some prep/build/install logic, >> and corrected for man page name changes. > > Brad, > > How are you building rpms with the spec file? The current spec file is set up > to build binary rpms. It appears that your patch wants to build an rpm with a > tarball of the source and have the code built on the target machine. > > Perhaps this is the way we should go moving forward. Previous powerpc-utils packages > were built as binary rpms since the rpm was not shipped with the distros and the > target machine to install these on (i.e. servers) was not expected to have a > compiler installed. Since powrepc-utils is now shipped with most distros it may > be time to convert the spec file to not build a binary rpm. > > I'm not sure about the man page changes, I have had no problem with the man pages > when building a binary rpm. Perhaps this change is part of the switch to not > building this as a binary package. > > -Nathan > >> >> Signed-off by: Yours truly, Aka Brad Peters >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------ >> Throughout its 18-year history, RSA Conference consistently attracts the >> world's best and brightest in the field, creating opportunities for Conference >> attendees to learn about information security's most important issues through >> interactions with peers, luminaries and emerging and established companies. >> http://p.sf.net/sfu/rsaconf-dev2dev >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Powerpc-utils-devel mailing list >> Pow...@li... >> https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel -- Brian King Linux on Power Virtualization IBM Linux Technology Center |
From: Nathan F. <nf...@au...> - 2010-01-22 15:50:09
|
Brad Peters wrote: > Spec file was quite out of date. I added some prep/build/install logic, > and corrected for man page name changes. Brad, How are you building rpms with the spec file? The current spec file is set up to build binary rpms. It appears that your patch wants to build an rpm with a tarball of the source and have the code built on the target machine. Perhaps this is the way we should go moving forward. Previous powerpc-utils packages were built as binary rpms since the rpm was not shipped with the distros and the target machine to install these on (i.e. servers) was not expected to have a compiler installed. Since powrepc-utils is now shipped with most distros it may be time to convert the spec file to not build a binary rpm. I'm not sure about the man page changes, I have had no problem with the man pages when building a binary rpm. Perhaps this change is part of the switch to not building this as a binary package. -Nathan > > Signed-off by: Yours truly, Aka Brad Peters > > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > > > ------------------------------------------------------------------------ > > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Brad P. <bp...@li...> - 2010-01-20 18:48:45
|
Spec file was quite out of date. I added some prep/build/install logic, and corrected for man page name changes. Signed-off by: Yours truly, Aka Brad Peters -- Best regards, Brad Peters IBM Linux on System-P Platform Serviceability Team Lead 15350 SW Koll Parkway 503-578-3493 TL: 775-3493 bp...@li... bp...@us... AIM: bradpeters1000 |
From: Nathan F. <nf...@au...> - 2010-01-15 19:35:14
|
This patch is dependent on two additional patches that are queued for inclusion in the kernel. http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-November/078181.html http://lkml.org/lkml/2009/11/26/368 With this new kernel functionality CPU DLPAR can be done completely in the kernel. Under this new scheme the drmgr command only has to write the drc-index of a cpu to /sys/devices/system/cpu/probe to have the cpu dlpar added and hotplug added to the system. The DLPAR remove of a cpu involves writing the path in the device tree for the the cpu to be removed to he /sys/sdevices/system/cpu/release file. This will hotplug remove the cpu and dlpar remove it. This updated patch corrects hotplugging of the cpu to only be done when cpu kernel dlpar is not present. Signed-off-by: Nathan Fontenot <nf...@au...> --- src/drmgr/common_cpu.c | 127 +++++++++++++++++++++++++++++++++++--------- src/drmgr/drcpu.h | 5 + src/drmgr/drslot_chrp_cpu.c | 25 -------- 3 files changed, 108 insertions(+), 49 deletions(-) Index: powerpc-utils/src/drmgr/common_cpu.c =================================================================== --- powerpc-utils.orig/src/drmgr/common_cpu.c 2010-01-05 12:57:34.000000000 -0600 +++ powerpc-utils/src/drmgr/common_cpu.c 2010-01-15 12:48:18.000000000 -0600 @@ -604,7 +604,7 @@ * @param drc_index * @returns pointer to cpu_info on success, NULL otherwise */ -int +static int acquire_cpu(struct dr_node *cpu, struct dr_info *dr_info) { struct of_node *of_nodes; @@ -637,6 +637,57 @@ return 0; } +int +probe_cpu(struct dr_node *cpu, struct dr_info *dr_info) +{ + char drc_index[DR_STR_MAX]; + int probe_file; + int write_len; + int rc = 0; + + probe_file = open(CPU_PROBE_FILE, O_WRONLY); + if (probe_file <= 0) { + /* Attempt to add cpu from user-space, this may be an older + * kernel without the infrastructure to handle dlpar. + */ + rc = acquire_cpu(cpu, dr_info); + if (rc) + return rc; + + rc = online_cpu(cpu, dr_info); + if (rc) { + /* Roll back the operation. Is this the correct + * behavior? + */ + dbg("Unable to online %s\n", cpu->drc_name); + offline_cpu(cpu); + release_cpu(cpu, dr_info); + cpu->unusable = 1; + } + + } else { + memset(drc_index, 0, DR_STR_MAX); + write_len = sprintf(drc_index, "0x%x", cpu->drc_index); + + dbg("Probing cpu 0x%x\n", cpu->drc_index); + rc = write(probe_file, drc_index, write_len); + if (rc != write_len) + dbg("Probe failed! rc = %x\n", rc); + else + /* reset rc to success */ + rc = 0; + + close(probe_file); + } + + if (!rc) { + update_cpu_node(cpu, NULL, dr_info); + refresh_cache_info(dr_info); + } + + return rc; +} + /** * release_caches * Remove any unused cache info. Failure to remove the cache, while not @@ -688,39 +739,66 @@ int release_cpu(struct dr_node *cpu, struct dr_info *dr_info) { + int release_file; int rc; - /* Should we check to make sure all threads of the cpu are offline? */ + release_file = open(CPU_RELEASE_FILE, O_WRONLY); + if (release_file > 0) { + /* DLPAR can be done in kernel */ + char *path = cpu->ofdt_path + strlen(OFDT_BASE); + int write_len = strlen(path); + + dbg("Releasing cpu \"%s\"\n", path); + rc = write(release_file, path, write_len); + if (rc != write_len) + dbg("Release failed! rc = %d\n", rc); + else + /* set rc to success */ + rc = 0; + + close(release_file); + } else { + /* Must do DLPAR from user-space */ + rc = offline_cpu(cpu); + if (rc) { + err_msg("Could not offline cpu %s\n", cpu->drc_name); + return rc; + } - rc = release_drc(cpu->drc_index, CPU_DEV); - if (rc) { - dbg("Could not release drc resources for %s\n", cpu->name); - return rc; - } + rc = release_drc(cpu->drc_index, CPU_DEV); + if (rc) { + dbg("Could not release drc resources for %s\n", + cpu->name); + return rc; + } - rc = remove_device_tree_nodes(cpu->ofdt_path); - if (rc) { - struct of_node *of_nodes; + rc = remove_device_tree_nodes(cpu->ofdt_path); + if (rc) { + struct of_node *of_nodes; - dbg("Could not remove device tree nodes %s\n", cpu->name); + dbg("Could not remove device tree nodes %s\n", + cpu->name); - of_nodes = configure_connector(cpu->drc_index); - if (of_nodes == NULL) { - err_msg("Call to configure_connector failed for %s. " - "The device tree\nmay contain invalid data " - "for this cpu and a re-activation of the " - "partition is needed to correct it.\n", - cpu->name); - } else { - rc = add_device_tree_nodes(CPU_OFDT_BASE, of_nodes); - free_of_node(of_nodes); + of_nodes = configure_connector(cpu->drc_index); + if (of_nodes == NULL) { + err_msg("Call to configure_connector failed " + "for %s. The device tree\nmay contain " + "invalid data for this cpu and a " + "re-activation of the partition is " + "needed to correct it.\n", cpu->name); + } else { + rc = add_device_tree_nodes(CPU_OFDT_BASE, + of_nodes); + free_of_node(of_nodes); + } + + acquire_drc(cpu->drc_index); + return rc; } - acquire_drc(cpu->drc_index); - return rc; + release_caches(cpu, dr_info); } - release_caches(cpu, dr_info); return rc; } Index: powerpc-utils/src/drmgr/drcpu.h =================================================================== --- powerpc-utils.orig/src/drmgr/drcpu.h 2010-01-05 12:57:34.000000000 -0600 +++ powerpc-utils/src/drmgr/drcpu.h 2010-01-14 15:05:06.000000000 -0600 @@ -9,6 +9,9 @@ #include "dr.h" +#define CPU_PROBE_FILE "/sys/devices/system/cpu/probe" +#define CPU_RELEASE_FILE "/sys/devices/system/cpu/release" + struct cache_info { char name[DR_BUF_SZ]; /* node name */ char path[DR_BUF_SZ]; /* node path */ @@ -45,7 +48,7 @@ struct cache_info * cache_get_dependent_cache(struct cache_info *, struct dr_info *); int release_cpu(struct dr_node *, struct dr_info *); -int acquire_cpu(struct dr_node *, struct dr_info *); +int probe_cpu(struct dr_node *, struct dr_info *); struct dr_node *get_available_cpu(struct options *, struct dr_info *); #endif /* _H_DRCPU */ Index: powerpc-utils/src/drmgr/drslot_chrp_cpu.c =================================================================== --- powerpc-utils.orig/src/drmgr/drslot_chrp_cpu.c 2010-01-05 12:57:34.000000000 -0600 +++ powerpc-utils/src/drmgr/drslot_chrp_cpu.c 2010-01-14 15:14:54.000000000 -0600 @@ -138,7 +138,7 @@ if (!cpu) break; - rc = acquire_cpu(cpu, dr_info); + rc = probe_cpu(cpu, dr_info); if (rc) { dbg("Unable to acquire CPU with drc index %x\n", cpu->drc_index); @@ -146,18 +146,6 @@ continue; } - rc = online_cpu(cpu, dr_info); - if (rc) { - /* Roll back the operation. Is this the correct - * behavior? - */ - dbg("Unable to online %s\n", cpu->drc_name); - offline_cpu(cpu); - release_cpu(cpu, dr_info); - cpu->unusable = 1; - continue; - } - fprintf(stdout, "%s\n", cpu->drc_name); count++; } @@ -201,15 +189,6 @@ if (!cpu) break; - rc = offline_cpu(cpu); - if (rc) { - /* Need to online any threads we took offline */ - online_cpu(cpu, dr_info); - err_msg("Could not offline cpu %s\n", cpu->drc_name); - cpu->unusable = 1; - continue; - } - /* cpu is invalid after release_cpu, so no recovery * steps seem feasible. We could copy the cpu name * and look it up again if the operation fails. @@ -217,8 +196,6 @@ rc = release_cpu(cpu, dr_info); if (rc) { online_cpu(cpu, dr_info); - err_msg("Offlined but could not release %s\n", - cpu->drc_name); cpu->unusable = 1; continue; } |
From: Brian K. <br...@li...> - 2010-01-13 22:14:59
|
Nathan, When I do a fresh pull from git, I don't see this patch applied. Can you apply this and push it out? Thanks, Brian On 07/10/2009 11:31 AM, Nathan Fontenot wrote: > Applied. > > -Nathan > > Robert Jennings wrote: >> The amsvis command will fail if vio devices have addresses greater than >> 30000009 due to a problem with hexidecimal values attempting to be sorted >> as long integers. This patch changes the sort to use string comparisions. >> >> Signed-off-by: Robert Jennings <rc...@li...> >> >> --- >> scripts/amsvis/powerpcAMS/amswidget.py | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> Index: b/scripts/amsvis/powerpcAMS/amswidget.py >> =================================================================== >> --- a/scripts/amsvis/powerpcAMS/amswidget.py >> +++ b/scripts/amsvis/powerpcAMS/amswidget.py >> @@ -675,12 +675,12 @@ class device_data_widget(ams_widget): >> def __cmp__(self, other): >> """Compare device data widgets to other widgets (or anything). >> >> - The comparision is based on the nummerical name of the device, which >> - is the bus address for the device. >> + The comparision is based on the name of the device, which is the >> + bus address for the device. >> """ >> - if (long(self.data[0]["name"])) < other: >> + if self.data[0]["name"] < other: >> return -1 >> - elif (long(self.data[0]["name"])) > other: >> + elif self.data[0]["name"] > other: >> return 1 >> else: >> return 0 >> > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel -- Brian King Linux on Power Virtualization IBM Linux Technology Center |
From: Nathan F. <nf...@au...> - 2010-01-06 19:47:13
|
The check to determine if cpu dlpar is capable on a system has a flaw, namely that a similarly named file can cause a failure. The capable check looks for the online file in the /sys/devices/system/cpu/cpuX directory, where X is a number. This checked fails on newer kernels that present a cpufreq directory that does not (nor should) contain an online file. The simple fix is to ensure that the directory we check starts with 'cpu' and is followed by a digit. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/src/drmgr/common.c =================================================================== --- powerpc-utils.orig/src/drmgr/common.c 2010-01-05 12:57:34.000000000 -0600 +++ powerpc-utils/src/drmgr/common.c 2010-01-05 16:08:57.000000000 -0600 @@ -15,6 +15,7 @@ #include <errno.h> #include <dirent.h> #include <execinfo.h> +#include <ctype.h> #include "dr.h" #include "ofdt.h" @@ -1026,6 +1027,12 @@ if (strncmp(de->d_name, "cpu", 3)) continue; + /* Ensure this is a cpu directory, i.e. cpu0, and not a + * non-cpu directory, i.e. cpufreq + */ + if (!isdigit(de->d_name[3])) + continue; + sprintf(fname, "%s/%s/online", cpu_dir, de->d_name); if (stat(fname, &sbuf)) { |
From: Nathan F. <nf...@au...> - 2009-12-02 20:24:31
|
The current logic in ppc64_cpu will loop through the maximum number of cpu threads (set to 1024) when trying to determine or set a particular cpu attribuite. For example, when setting smt mode, the code would try to set cpu thread 0..1024 either online or offline until a failure occurs. This usually was trying to set the smt mode for a cpu thread that does not exist. While this is mostly harmless, the side effect was that an error was returned even though the smt setting operation completed successfully. This patch changes the logic so that it only tries to set cpu attributes for the cpu threads that are present on the system. This resolves the inadvertent error return and is logically a bit nicer than trying all possible threads. Signed-off-by: Nathan Fontenot <nf...@au...> --- src/ppc64_cpu.c | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- powerpc-utils.orig/src/ppc64_cpu.c 2009-12-01 13:31:21.000000000 -0600 +++ powerpc-utils/src/ppc64_cpu.c 2009-12-02 13:53:34.000000000 -0600 @@ -19,11 +19,12 @@ #define SYSFS_CPUDIR "/sys/devices/system/cpu/cpu%d" #define INTSERV_PATH "/proc/device-tree/cpus/%s/ibm,ppc-interrupt-server#s" #define SYSFS_PATH_MAX 128 -#define MAX_THREADS 1024 #define DIAGNOSTICS_RUN_MODE 42 -int threads_per_cpu; +int threads_per_cpu = 0; +int cpus_in_system = 0; +int threads_in_system = 0; int get_attribute(char *path, int *value) { @@ -72,7 +73,7 @@ int i, rc; int system_attribute = -1; - for (i = 0; i < MAX_THREADS; i++) { + for (i = 0; i < threads_in_system; i++) { int cpu_attribute; /* only check online cpus */ @@ -99,7 +100,7 @@ char path[SYSFS_PATH_MAX]; int i, rc; - for (i = 0; i < MAX_THREADS; i++) { + for (i = 0; i < threads_in_system; i++) { /* only set online cpus */ if (!cpu_online(i)) continue; @@ -113,11 +114,11 @@ return 0; } -int get_threads_per_cpu(void) +int get_cpu_info(void) { DIR *d; struct dirent *de; - int nthreads = -1; + int first_cpu = 1; int rc; d = opendir("/proc/device-tree/cpus"); @@ -126,20 +127,25 @@ while ((de = readdir(d)) != NULL) { if (!strncmp(de->d_name, "PowerPC", 7)) { - struct stat sbuf; - char path[128]; + if (first_cpu) { + struct stat sbuf; + char path[128]; + + sprintf(path, INTSERV_PATH, de->d_name); + rc = stat(path, &sbuf); + if (!rc) + threads_per_cpu = sbuf.st_size / 4; - sprintf(path, INTSERV_PATH, de->d_name); - rc = stat(path, &sbuf); - if (!rc) - nthreads = sbuf.st_size / 4; + first_cpu = 0; + } - break; + cpus_in_system++; } } closedir(d); - return nthreads; + threads_in_system = cpus_in_system * threads_per_cpu; + return 0; } int is_smt_capable(void) @@ -148,7 +154,7 @@ char path[SYSFS_PATH_MAX]; int i; - for (i = 0; i < MAX_THREADS; i++) { + for (i = 0; i < threads_in_system; i++) { sprintf(path, SYSFS_CPUDIR"/smt_snooze_delay", i); if (stat(path, &sb)) continue; @@ -187,7 +193,7 @@ int system_state = -1; int i; - for (i = 0; i < MAX_THREADS; i += threads_per_cpu) { + for (i = 0; i < threads_in_system; i += threads_per_cpu) { int cpu_state; cpu_state = get_one_smt_state(i); @@ -236,7 +242,7 @@ if (rc) update_ssd = 0; - for (i = 0; i < MAX_THREADS; i += threads_per_cpu) { + for (i = 0; i < threads_in_system; i += threads_per_cpu) { rc = set_one_smt_state(i, smt_state); if (rc) break; @@ -254,7 +260,7 @@ char path[SYSFS_PATH_MAX]; int i; - for (i = 0; i < MAX_THREADS; i++) { + for (i = 0; i < threads_in_system; i++) { sprintf(path, SYSFS_CPUDIR"/dscr", i); if (stat(path, &sb)) continue; @@ -436,10 +442,10 @@ return 0; } - threads_per_cpu = get_threads_per_cpu(); - if (threads_per_cpu < 0) { - printf("Could not determine thread count\n"); - return -1; + rc = get_cpu_info(); + if (rc) { + printf("Could not determine system cpu/thread information.\n"); + return rc; } while (1) { |
From: Nathan F. <nf...@au...> - 2009-12-01 21:19:20
|
This patch is dependent on two additional patches that are queued for inclusion in the kernel. http://lists.ozlabs.org/pipermail/linuxppc-dev/2009-November/078181.html http://lkml.org/lkml/2009/11/26/368 With this new kernel functionality CPU DLPAR can be done completely in the kernel. Under this new scheme the drmgr command only has to write the drc-index of a cpu to /sys/devices/system/cpu/probe to have the cpu dlpar added and hotplug added to the system. The DLPAR remove of a cpu involves writing the path in the device tree for the the cpu to be removed to he /sys/sdevices/system/cpu/release file. This will hotplug remove the cpu and dlpar remove it. This patch should only be pulled in once the patchsets mentioned above appear in the mainline kernel. Signed-off-by: Nathan Fontenot <nf...@au...> --- src/drmgr/common_cpu.c | 108 +++++++++++++++++++++++++++++++++----------- src/drmgr/drcpu.h | 5 +- src/drmgr/drslot_chrp_cpu.c | 2 3 files changed, 88 insertions(+), 27 deletions(-) Index: powerpc-utils/src/drmgr/common_cpu.c =================================================================== --- powerpc-utils.orig/src/drmgr/common_cpu.c 2009-12-01 10:55:06.000000000 -0600 +++ powerpc-utils/src/drmgr/common_cpu.c 2009-12-01 14:18:28.000000000 -0600 @@ -604,7 +604,7 @@ * @param drc_index * @returns pointer to cpu_info on success, NULL otherwise */ -int +static int acquire_cpu(struct dr_node *cpu, struct dr_info *dr_info) { struct of_node *of_nodes; @@ -637,6 +637,43 @@ return 0; } +int +probe_cpu(struct dr_node *cpu, struct dr_info *dr_info) +{ + char drc_index[DR_STR_MAX]; + int probe_file; + int write_len; + int rc = 0; + + probe_file = open(CPU_PROBE_FILE, O_WRONLY); + if (probe_file <= 0) { + /* Attempt to add cpu from user-space, this may be an older + * kernel without the infrastructure to handle dlpar. + */ + rc = acquire_cpu(cpu, dr_info); + } else { + memset(drc_index, 0, DR_STR_MAX); + write_len = sprintf(drc_index, "0x%x", cpu->drc_index); + + dbg("Probing cpu 0x%x\n", cpu->drc_index); + rc = write(probe_file, drc_index, write_len); + if (rc != write_len) + dbg("Probe failed! rc = %x\n", rc); + else + /* reset rc to success */ + rc = 0; + + close(probe_file); + } + + if (!rc) { + update_cpu_node(cpu, NULL, dr_info); + refresh_cache_info(dr_info); + } + + return rc; +} + /** * release_caches * Remove any unused cache info. Failure to remove the cache, while not @@ -688,39 +725,60 @@ int release_cpu(struct dr_node *cpu, struct dr_info *dr_info) { + int release_file; int rc; - /* Should we check to make sure all threads of the cpu are offline? */ - - rc = release_drc(cpu->drc_index, CPU_DEV); - if (rc) { - dbg("Could not release drc resources for %s\n", cpu->name); - return rc; - } + release_file = open(CPU_RELEASE_FILE, O_WRONLY); + if (release_file > 0) { + /* DLPAR can be done in kernel */ + char *path = cpu->ofdt_path + strlen(OFDT_BASE); + int write_len = strlen(path); + + dbg("Releasing cpu \"%s\"\n", path); + rc = write(release_file, path, write_len); + if (rc != write_len) + dbg("Release failed! rc = %d\n", rc); + else + /* set rc to success */ + rc = 0; + + close(release_file); + } else { + /* Must do DLPAR from user-space */ + rc = release_drc(cpu->drc_index, CPU_DEV); + if (rc) { + dbg("Could not release drc resources for %s\n", + cpu->name); + return rc; + } - rc = remove_device_tree_nodes(cpu->ofdt_path); - if (rc) { - struct of_node *of_nodes; + rc = remove_device_tree_nodes(cpu->ofdt_path); + if (rc) { + struct of_node *of_nodes; - dbg("Could not remove device tree nodes %s\n", cpu->name); + dbg("Could not remove device tree nodes %s\n", + cpu->name); - of_nodes = configure_connector(cpu->drc_index); - if (of_nodes == NULL) { - err_msg("Call to configure_connector failed for %s. " - "The device tree\nmay contain invalid data " - "for this cpu and a re-activation of the " - "partition is needed to correct it.\n", - cpu->name); - } else { - rc = add_device_tree_nodes(CPU_OFDT_BASE, of_nodes); - free_of_node(of_nodes); + of_nodes = configure_connector(cpu->drc_index); + if (of_nodes == NULL) { + err_msg("Call to configure_connector failed " + "for %s. The device tree\nmay contain " + "invalid data for this cpu and a " + "re-activation of the partition is " + "needed to correct it.\n", cpu->name); + } else { + rc = add_device_tree_nodes(CPU_OFDT_BASE, + of_nodes); + free_of_node(of_nodes); + } + + acquire_drc(cpu->drc_index); + return rc; } - acquire_drc(cpu->drc_index); - return rc; + release_caches(cpu, dr_info); } - release_caches(cpu, dr_info); return rc; } Index: powerpc-utils/src/drmgr/drcpu.h =================================================================== --- powerpc-utils.orig/src/drmgr/drcpu.h 2009-12-01 10:55:06.000000000 -0600 +++ powerpc-utils/src/drmgr/drcpu.h 2009-12-01 14:18:28.000000000 -0600 @@ -9,6 +9,9 @@ #include "dr.h" +#define CPU_PROBE_FILE "/sys/devices/system/cpu/probe" +#define CPU_RELEASE_FILE "/sys/devices/system/cpu/release" + struct cache_info { char name[DR_BUF_SZ]; /* node name */ char path[DR_BUF_SZ]; /* node path */ @@ -45,7 +48,7 @@ struct cache_info * cache_get_dependent_cache(struct cache_info *, struct dr_info *); int release_cpu(struct dr_node *, struct dr_info *); -int acquire_cpu(struct dr_node *, struct dr_info *); +int probe_cpu(struct dr_node *, struct dr_info *); struct dr_node *get_available_cpu(struct options *, struct dr_info *); #endif /* _H_DRCPU */ Index: powerpc-utils/src/drmgr/drslot_chrp_cpu.c =================================================================== --- powerpc-utils.orig/src/drmgr/drslot_chrp_cpu.c 2009-12-01 13:35:42.000000000 -0600 +++ powerpc-utils/src/drmgr/drslot_chrp_cpu.c 2009-12-01 14:18:28.000000000 -0600 @@ -138,7 +138,7 @@ if (!cpu) break; - rc = acquire_cpu(cpu, dr_info); + rc = probe_cpu(cpu, dr_info); if (rc) { dbg("Unable to acquire CPU with drc index %x\n", cpu->drc_index); |
From: Nathan F. <nf...@au...> - 2009-12-01 21:09:28
|
There are several build warnings generated when building the powerpc-utils package, most of these are just innocuous initializations of variables. There are a couple of larger changes such as in serv_config.c where the results of the fread call needed to be properly checked. Signed-off-by: Nathan Fontenot <nf...@au...> --- src/drmgr/common_pci.c | 4 ++-- src/drmgr/drslot_chrp_cpu.c | 4 ++-- src/drmgr/drslot_chrp_mem.c | 2 +- src/drmgr/rtas_calls.c | 2 +- src/nvram.c | 3 ++- src/ppc64_cpu.c | 5 +++-- src/serv_config.c | 7 +++---- 7 files changed, 14 insertions(+), 13 deletions(-) Index: powerpc-utils/src/ppc64_cpu.c =================================================================== --- powerpc-utils.orig/src/ppc64_cpu.c 2009-12-01 10:55:06.000000000 -0600 +++ powerpc-utils/src/ppc64_cpu.c 2009-12-01 13:31:21.000000000 -0600 @@ -117,7 +117,7 @@ { DIR *d; struct dirent *de; - int nthreads; + int nthreads = -1; int rc; d = opendir("/proc/device-tree/cpus"); @@ -427,7 +427,8 @@ int main(int argc, char *argv[]) { - int rc, opt; + int rc = 0; + int opt; int option_index; if (argc == 1) { Index: powerpc-utils/src/drmgr/common_pci.c =================================================================== --- powerpc-utils.orig/src/drmgr/common_pci.c 2009-12-01 10:55:06.000000000 -0600 +++ powerpc-utils/src/drmgr/common_pci.c 2009-12-01 13:52:06.000000000 -0600 @@ -620,8 +620,8 @@ struct dr_connector *drc_list; struct dr_connector *drc; struct dr_node *node; - int child_dev_type; - int rc; + int child_dev_type = 0; + int rc = -1; drc_list = get_drc_info(path); if (drc_list == NULL) Index: powerpc-utils/src/drmgr/drslot_chrp_cpu.c =================================================================== --- powerpc-utils.orig/src/drmgr/drslot_chrp_cpu.c 2009-12-01 13:35:11.000000000 -0600 +++ powerpc-utils/src/drmgr/drslot_chrp_cpu.c 2009-12-01 13:35:42.000000000 -0600 @@ -66,7 +66,7 @@ struct dr_node * get_available_cpu(struct options *opts, struct dr_info *dr_info) { - struct dr_node *cpu; + struct dr_node *cpu = NULL; struct dr_node *survivor = NULL; struct thread *t; @@ -297,7 +297,7 @@ drslot_chrp_cpu(struct options *opts) { struct dr_info dr_info; - int rc; + int rc = -1; if (! cpu_dlpar_capable()) { err_msg("CPU DLPAR capability is not enabled on this " Index: powerpc-utils/src/drmgr/drslot_chrp_mem.c =================================================================== --- powerpc-utils.orig/src/drmgr/drslot_chrp_mem.c 2009-12-01 10:55:06.000000000 -0600 +++ powerpc-utils/src/drmgr/drslot_chrp_mem.c 2009-12-01 13:36:42.000000000 -0600 @@ -1062,7 +1062,7 @@ int drslot_chrp_mem(struct options *opts) { - int rc; + int rc = -1; if (opts->p_option) { /* This is a entitlement or weight change */ Index: powerpc-utils/src/drmgr/rtas_calls.c =================================================================== --- powerpc-utils.orig/src/drmgr/rtas_calls.c 2009-12-01 10:55:06.000000000 -0600 +++ powerpc-utils/src/drmgr/rtas_calls.c 2009-12-01 13:39:31.000000000 -0600 @@ -267,7 +267,7 @@ struct of_node *first_node = NULL; struct of_node *last_node = NULL; /* Last node processed */ struct of_property *property; - struct of_property *last_property; /* Last property processed */ + struct of_property *last_property = NULL; /* Last property processed */ int *work_int; int rc; Index: powerpc-utils/src/serv_config.c =================================================================== --- powerpc-utils.orig/src/serv_config.c 2009-12-01 10:55:06.000000000 -0600 +++ powerpc-utils/src/serv_config.c 2009-12-01 13:49:42.000000000 -0600 @@ -1673,10 +1673,8 @@ return 2; } rc = fread(buffer, 1, BUF_SIZE, fp); - buffer[rc-1] = '\0'; - pclose(fp); - - if (buffer) { + if (!ferror(fp)) { + buffer[rc] = '\0'; if (strstr(buffer, "ibm,setupcfg")) nvram_setupcfg = 1; if (strstr(buffer, "common")) @@ -1684,6 +1682,7 @@ if (strstr(buffer, "of-config")) nvram_ofconfig = 1; } + pclose(fp); if (verbose > 1) { printf("ibm,setupcfg NVRAM partition %s.\n", Index: powerpc-utils/src/nvram.c =================================================================== --- powerpc-utils.orig/src/nvram.c 2009-12-01 13:50:57.000000000 -0600 +++ powerpc-utils/src/nvram.c 2009-12-01 14:03:28.000000000 -0600 @@ -42,6 +42,7 @@ #include <netinet/in.h> /* for ntohs */ #include <glob.h> #include <getopt.h> +#include <inttypes.h> #include "nvram.h" @@ -1020,7 +1021,7 @@ /* ToDo: what is the length of the data? We dump until the next cpu data. */ len = cpu_regs[cpu+1] - cpu_regs[cpu]; - printf("CPU %d Register Data (len=%x, offset=%x)\n", cpu, len, + printf("CPU %d Register Data (len=%x, offset=%"PRIx64")\n", cpu, len, cpu_regs[cpu]-p); if (len < 4096) /* reasonable bound */ dump_raw_data((char *)cpu_regs[cpu], len); |
From: Nathan F. <nf...@au...> - 2009-12-01 20:56:55
|
Applied. -Nathan Nathan Fontenot wrote: > For certain SAS devices we need to grab the sas address from sysfs > sas_device information instead of using the LUN to calculate the > sas address for the adapter. > > Signed-off-by: Nathan Fontenot <nf...@au...> > --- > > Index: powerpc-utils/scripts/ofpathname > =================================================================== > --- powerpc-utils.orig/scripts/ofpathname 2009-11-11 11:01:21.000000000 -0600 > +++ powerpc-utils/scripts/ofpathname 2009-11-12 10:38:40.000000000 -0600 > @@ -510,15 +510,27 @@ > OF_PATH=$OF_PATH/disk\@$vdiskno > fi > elif [[ -d /proc/device-tree$OF_PATH/sas ]]; then > - local B T L > - B=`echo $BUS | tr "[a-z]" "[A-Z]"` > - B=`echo "ibase=16;obase=A; $B" | bc` > - T=`echo $ID | tr "[a-z]" "[A-Z]"` > - T=`echo "ibase=16;obase=A; $T" | bc` > - L=`echo $LUN | tr "[a-z]" "[A-Z]"` > - L=`echo "ibase=16;obase=A; $L" | bc` > + local vendor_id sas_id > + > + vendor_id=`od -tx /proc/device-tree/$OF_PATH/vendor-id` > + vendor_id=`echo $vendor_id | cut -d " " -f 2` > + if [[ $vendor_id = "00001000" ]]; then > + local dev_id > + goto_dir $device_path "sas_end_device*" > + dev_id=${PWD##*-} > + sas_id=`cat /sys/class/sas_device/end_device-$dev_id/sas_address` > + else > + local B T L > + B=`echo $BUS | tr "[a-z]" "[A-Z]"` > + B=`echo "ibase=16;obase=A; $B" | bc` > + T=`echo $ID | tr "[a-z]" "[A-Z]"` > + T=`echo "ibase=16;obase=A; $T" | bc` > + L=`echo $LUN | tr "[a-z]" "[A-Z]"` > + L=`echo "ibase=16;obase=A; $L" | bc` > + > + sas_id=$(( ($B << 16) | ($T << 8) | $L )) > + fi > > - local sas_id=$(( ($B << 16) | ($T << 8) | $L )) > OF_PATH=$(printf "%s/sas/disk@%x" $OF_PATH $sas_id) > if [[ $LUN != "0" ]]; then > OF_PATH=$(printf "%s,%x" $OF_PATH $LUN) > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Nathan F. <nf...@au...> - 2009-12-01 20:56:46
|
Applied. -Nathan Nathan Fontenot wrote: > It has been pointed out that there are several ares in which the powerpc-utils > package could improve its use of autoconf. Additionally, some things are just > plain broken, such as make dist, with using autoconf and powerpc-utils. This > set of patches cleans up a lot of this and updates the package so one can now > just run configure and make to build the package. > > -Nathan > > 1/7 - Correct make dist and ship the autoconf tools > 2/7 - rename spec file to spec.in > 3/7 - remove amsvis man page > 4/7 - remove bootstrap.sh script > 5/7 - Add Makefile.in files > 6/7 - update README file > 7/7 - Updated configure script > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Nathan F. <nf...@au...> - 2009-12-01 16:39:54
|
Please disregard, a new patch for kernel cpu dlpar handling is on its way. -Nathan Nathan Fontenot wrote: > This patch updates the drmgr command to do CPU DLPAR on kernels > that have been enabled to do the DLPAR work in the kernel. Previously > the work of acquiring the cpu from firmware vi a rtas calls and > updating the device tree was done by drmgr. On newer kernels this > is now done in the kernel by writing to the sysfs cpu 'probe' file. > > Note: this patch is entirely dependent on the patch set to enable > kernel dlpar capabilities that has been submitted to the mailing lists. > > Signed-off-by: Nathan Fontenot <nf...@au...> > --- > > Index: powerpc-utils/src/drmgr/common_cpu.c > =================================================================== > --- powerpc-utils.orig/src/drmgr/common_cpu.c 2009-09-15 10:15:17.000000000 -0500 > +++ powerpc-utils/src/drmgr/common_cpu.c 2009-09-15 11:21:51.000000000 -0500 > @@ -604,7 +604,7 @@ > * @param drc_index > * @returns pointer to cpu_info on success, NULL otherwise > */ > -int > +static int > acquire_cpu(struct dr_node *cpu, struct dr_info *dr_info) > { > struct of_node *of_nodes; > @@ -637,6 +637,43 @@ > return 0; > } > > +int > +probe_cpu(struct dr_node *cpu, struct dr_info *dr_info) > +{ > + char drc_index[DR_STR_MAX]; > + int probe_file; > + int write_len; > + int rc = 0; > + > + probe_file = open(CPU_PROBE_FILE, O_WRONLY); > + if (probe_file <= 0) { > + /* Attempt to add cpu from user-space, this may be an older > + * kernel without the infrastructure to handle dlpar. > + */ > + rc = acquire_cpu(cpu, dr_info); > + } else { > + memset(drc_index, 0, DR_STR_MAX); > + write_len = sprintf(drc_index, "0x%x", cpu->drc_index); > + > + dbg("Probing cpu 0x%x\n", cpu->drc_index); > + rc = write(probe_file, drc_index, write_len); > + if (rc != write_len) > + dbg("Probe failed! rc = %x\n", rc); > + else > + /* reset rc to success */ > + rc = 0; > + > + close(probe_file); > + } > + > + if (!rc) { > + update_cpu_node(cpu, NULL, dr_info); > + refresh_cache_info(dr_info); > + } > + > + return rc; > +} > + > /** > * release_caches > * Remove any unused cache info. Failure to remove the cache, while not > @@ -688,39 +725,60 @@ > int > release_cpu(struct dr_node *cpu, struct dr_info *dr_info) > { > + int release_file; > int rc; > > - /* Should we check to make sure all threads of the cpu are offline? */ > - > - rc = release_drc(cpu->drc_index, CPU_DEV); > - if (rc) { > - dbg("Could not release drc resources for %s\n", cpu->name); > - return rc; > - } > + release_file = open(CPU_RELEASE_FILE, O_WRONLY); > + if (release_file > 0) { > + /* DLPAR can be done in kernel */ > + char *path = cpu->ofdt_path + strlen(OFDT_BASE); > + int write_len = strlen(path); > + > + dbg("Releasing cpu \"%s\"\n", path); > + rc = write(release_file, path, write_len); > + if (rc != write_len) > + dbg("Release failed! rc = %d\n", rc); > + else > + /* set rc to success */ > + rc = 0; > + > + close(release_file); > + } else { > + /* Must do DLPAR from user-space */ > + rc = release_drc(cpu->drc_index, CPU_DEV); > + if (rc) { > + dbg("Could not release drc resources for %s\n", > + cpu->name); > + return rc; > + } > > - rc = remove_device_tree_nodes(cpu->ofdt_path); > - if (rc) { > - struct of_node *of_nodes; > + rc = remove_device_tree_nodes(cpu->ofdt_path); > + if (rc) { > + struct of_node *of_nodes; > > - dbg("Could not remove device tree nodes %s\n", cpu->name); > + dbg("Could not remove device tree nodes %s\n", > + cpu->name); > > - of_nodes = configure_connector(cpu->drc_index); > - if (of_nodes == NULL) { > - err_msg("Call to configure_connector failed for %s. " > - "The device tree\nmay contain invalid data " > - "for this cpu and a re-activation of the " > - "partition is needed to correct it.\n", > - cpu->name); > - } else { > - rc = add_device_tree_nodes(CPU_OFDT_BASE, of_nodes); > - free_of_node(of_nodes); > + of_nodes = configure_connector(cpu->drc_index); > + if (of_nodes == NULL) { > + err_msg("Call to configure_connector failed " > + "for %s. The device tree\nmay contain " > + "invalid data for this cpu and a " > + "re-activation of the partition is " > + "needed to correct it.\n", cpu->name); > + } else { > + rc = add_device_tree_nodes(CPU_OFDT_BASE, > + of_nodes); > + free_of_node(of_nodes); > + } > + > + acquire_drc(cpu->drc_index); > + return rc; > } > > - acquire_drc(cpu->drc_index); > - return rc; > + release_caches(cpu, dr_info); > } > > - release_caches(cpu, dr_info); > return rc; > } > > Index: powerpc-utils/src/drmgr/drcpu.h > =================================================================== > --- powerpc-utils.orig/src/drmgr/drcpu.h 2009-09-15 10:15:17.000000000 -0500 > +++ powerpc-utils/src/drmgr/drcpu.h 2009-09-15 10:46:08.000000000 -0500 > @@ -9,6 +9,9 @@ > > #include "dr.h" > > +#define CPU_PROBE_FILE "/sys/devices/system/cpu/probe" > +#define CPU_RELEASE_FILE "/sys/devices/system/cpu/release" > + > struct cache_info { > char name[DR_BUF_SZ]; /* node name */ > char path[DR_BUF_SZ]; /* node path */ > @@ -45,7 +48,7 @@ > struct cache_info * cache_get_dependent_cache(struct cache_info *, > struct dr_info *); > int release_cpu(struct dr_node *, struct dr_info *); > -int acquire_cpu(struct dr_node *, struct dr_info *); > +int probe_cpu(struct dr_node *, struct dr_info *); > struct dr_node *get_available_cpu(struct options *, struct dr_info *); > > #endif /* _H_DRCPU */ > Index: powerpc-utils/src/drmgr/drslot_chrp_cpu.c > =================================================================== > --- powerpc-utils.orig/src/drmgr/drslot_chrp_cpu.c 2009-09-15 10:15:17.000000000 -0500 > +++ powerpc-utils/src/drmgr/drslot_chrp_cpu.c 2009-09-15 10:33:21.000000000 -0500 > @@ -138,7 +138,7 @@ > if (!cpu) > break; > > - rc = acquire_cpu(cpu, dr_info); > + rc = probe_cpu(cpu, dr_info); > if (rc) { > dbg("Unable to acquire CPU with drc index %x\n", > cpu->drc_index); > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Nathan F. <nf...@au...> - 2009-12-01 16:38:07
|
Please disregard this patch, the kernel memory dlpar handling is not yet upstream. I will re-submit once the kernel bits have made it upstream. -Nathan Nathan Fontenot wrote: > This patch enables drmgr to do DLPAR operations for memory > on systems that can do the acquisition via rtas and device tree > updating in the kernel. > > NOTE: This patch depends on the DLPAR infrastructure patch set posted > to linuxppc-dev. > > Signed-off-by: Nathan Fontenot <nf...@au...> > --- > > Index: powerpc-utils/src/drmgr/drmem.h > =================================================================== > --- powerpc-utils.orig/src/drmgr/drmem.h 2009-09-15 13:30:26.000000000 -0500 > +++ powerpc-utils/src/drmgr/drmem.h 2009-09-15 13:37:40.000000000 -0500 > @@ -19,6 +19,7 @@ > #define DRMEM_DRC_INVALID 0x00000020 > > #define MEM_PROBE_FILE "/sys/devices/system/memory/probe" > +#define MEM_RELEASE_FILE "/sys/devices/system/memory/release" > #define MEM_BLOCK_SIZE_BYTES "/sys/devices/system/memory/block_size_bytes" > #define DYNAMIC_RECONFIG_MEM "/proc/device-tree/ibm,dynamic-reconfiguration-memory" > > Index: powerpc-utils/src/drmgr/drslot_chrp_mem.c > =================================================================== > --- powerpc-utils.orig/src/drmgr/drslot_chrp_mem.c 2009-09-15 13:30:26.000000000 -0500 > +++ powerpc-utils/src/drmgr/drslot_chrp_mem.c 2009-09-15 13:39:32.000000000 -0500 > @@ -35,6 +35,16 @@ > *pusage = usagestr; > } > > +static int > +is_kernel_dlpar_capable(void) > +{ > + struct stat sbuf; > + int rc; > + > + rc = stat(MEM_RELEASE_FILE, &sbuf); > + return !rc; > +} > + > /** > * get_phandle > * > @@ -302,13 +312,13 @@ > if (drmem->flags & DRMEM_ASSIGNED) { > found++; > lmb->is_owned = 1; > - > - /* find the associated sysfs memory blocks */ > - rc = get_mem_scns(lmb); > - if (rc) > - break; > } > > + /* find the associated sysfs memory blocks */ > + rc = get_mem_scns(lmb); > + if (rc) > + break; > + > drmem++; /* trust your compiler */ > } > > @@ -756,6 +766,34 @@ > return 0; > } > > +static int > +release_lmb(struct dr_node *lmb) > +{ > + char buf[DR_STR_MAX]; > + int release_file; > + int write_len; > + int rc; > + > + release_file = open(MEM_RELEASE_FILE, O_WRONLY); > + if (release_file <= 0) { > + dbg("Could not open %s to release lmb\n", MEM_RELEASE_FILE); > + return errno; > + } > + > + memset(buf, 0, DR_STR_MAX); > + write_len = sprintf(buf, "0x%x", lmb->drc_index); > + rc = write(release_file, buf, write_len); > + if (rc != write_len) > + dbg("Write to %s failed!\n%s\n", MEM_RELEASE_FILE, > + strerror(errno)); > + else > + /* reset rc to success */ > + rc = 0; > + > + close(release_file); > + return rc; > +} > + > /** > * set_lmb_state > * > @@ -818,6 +856,7 @@ > { > int rc = 0; > struct dr_node *lmb; > + int kernel_dlpar_capable = is_kernel_dlpar_capable(); > > lmb_list->lmbs_modified = 0; > while (lmb_list->lmbs_modified < (int)opts->quantity) { > @@ -825,23 +864,28 @@ > if (lmb == NULL) > return -1; > > - rc = acquire_drc(lmb->drc_index); > - if (rc) { > - lmb->unusable = 1; > - continue; > - } > + if (!kernel_dlpar_capable) { > + rc = acquire_drc(lmb->drc_index); > + if (rc) { > + lmb->unusable = 1; > + continue; > + } > > - rc = add_device_tree_lmb(lmb, lmb_list); > - if (rc) { > - release_drc(lmb->drc_index, MEM_DEV); > - lmb->unusable = 1; > - continue; > + rc = add_device_tree_lmb(lmb, lmb_list); > + if (rc) { > + release_drc(lmb->drc_index, MEM_DEV); > + lmb->unusable = 1; > + continue; > + } > } > > rc = set_lmb_state(lmb, ONLINE); > if (rc) { > - remove_device_tree_lmb(lmb, lmb_list); > - release_drc(lmb->drc_index, MEM_DEV); > + if (!kernel_dlpar_capable) { > + remove_device_tree_lmb(lmb, lmb_list); > + release_drc(lmb->drc_index, MEM_DEV); > + } > + > lmb->unusable = 1; > continue; > } > @@ -893,6 +937,7 @@ > { > struct dr_node *lmb; > int rc; > + int kernel_dlpar_capable = is_kernel_dlpar_capable(); > > while (lmb_list->lmbs_modified < (int)opts->quantity) { > lmb = get_available_lmb(opts, lmb_list); > @@ -905,25 +950,33 @@ > continue; > } > > - rc = remove_device_tree_lmb(lmb, lmb_list); > - if (rc) { > - set_lmb_state(lmb, ONLINE); > - lmb->unusable = 1; > - continue; > - } > + if (kernel_dlpar_capable) { > + rc = release_lmb(lmb); > + if (rc) { > + lmb->unusable = 1; > + continue; > + } > + } else { > + rc = remove_device_tree_lmb(lmb, lmb_list); > + if (rc) { > + set_lmb_state(lmb, ONLINE); > + lmb->unusable = 1; > + continue; > + } > > - while (lmb->lmb_mem_scns) { > - struct mem_scn *scn = lmb->lmb_mem_scns; > - lmb->lmb_mem_scns = scn->next; > - free(scn); > - } > + while (lmb->lmb_mem_scns) { > + struct mem_scn *scn = lmb->lmb_mem_scns; > + lmb->lmb_mem_scns = scn->next; > + free(scn); > + } > > - rc = release_drc(lmb->drc_index, 0); > - if (rc) { > - add_device_tree_lmb(lmb, lmb_list); > - set_lmb_state(lmb, ONLINE); > - lmb->unusable = 1; > - continue; > + rc = release_drc(lmb->drc_index, 0); > + if (rc) { > + add_device_tree_lmb(lmb, lmb_list); > + set_lmb_state(lmb, ONLINE); > + lmb->unusable = 1; > + continue; > + } > } > > lmb->is_removable = 0; > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Powerpc-utils-devel mailing list > Pow...@li... > https://lists.sourceforge.net/lists/listinfo/powerpc-utils-devel |
From: Nathan F. <nf...@au...> - 2009-11-17 17:01:28
|
Updated configure script based on all of the changes made in the previous patches. Signed-off-by: Nathan Fontenot <nf...@au...> --- Index: powerpc-utils/configure =================================================================== --- powerpc-utils.orig/configure 2009-11-16 15:49:24.000000000 -0600 +++ powerpc-utils/configure 2009-11-16 15:51:55.000000000 -0600 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for powerpc-utils 1.2.0. +# Generated by GNU Autoconf 2.63 for powerpc-utils 1.2.1. # # Report bugs to <nf...@au...>. # @@ -596,8 +596,8 @@ # Identity of this package. PACKAGE_NAME='powerpc-utils' PACKAGE_TARNAME='powerpc-utils' -PACKAGE_VERSION='1.2.0' -PACKAGE_STRING='powerpc-utils 1.2.0' +PACKAGE_VERSION='1.2.1' +PACKAGE_STRING='powerpc-utils 1.2.1' PACKAGE_BUGREPORT='nf...@au...' ac_unique_file="src/rtas_ibm_get_vpd.c" @@ -1286,7 +1286,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures powerpc-utils 1.2.0 to adapt to many kinds of systems. +\`configure' configures powerpc-utils 1.2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1352,7 +1352,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of powerpc-utils 1.2.0:";; + short | recursive ) echo "Configuration of powerpc-utils 1.2.1:";; esac cat <<\_ACEOF @@ -1439,7 +1439,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -powerpc-utils configure 1.2.0 +powerpc-utils configure 1.2.1 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1453,7 +1453,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by powerpc-utils $as_me 1.2.0, which was +It was created by powerpc-utils $as_me 1.2.1, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1824,10 +1824,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.10' - ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do +for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" @@ -1843,8 +1841,8 @@ fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&2;} { (exit 1); exit 1; }; } fi @@ -1857,6 +1855,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +am__api_version='1.10' + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -2172,7 +2172,7 @@ # Define the identity of the package. PACKAGE='powerpc-utils' - VERSION='1.2.0' + VERSION='1.2.1' cat >>confdefs.h <<_ACEOF @@ -6740,6 +6740,9 @@ done +echo "Configuring powerpc-utils.spec" +sed "s|\@VERSION\@|1.2.1|g" powerpc-utils.spec.in > powerpc-utils.spec + ac_config_files="$ac_config_files Makefile src/Makefile src/drmgr/Makefile scripts/Makefile man/Makefile" cat >confcache <<\_ACEOF @@ -7211,7 +7214,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by powerpc-utils $as_me 1.2.0, which was +This file was extended by powerpc-utils $as_me 1.2.1, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7265,7 +7268,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -powerpc-utils config.status 1.2.0 +powerpc-utils config.status 1.2.1 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" |