Mailinglist Archive: opensuse-commit (817 mails)

< Previous Next >
commit sgpio
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Wed, 03 Dec 2008 16:40:58 +0100
  • Message-id: <20081203154059.07267678166@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package sgpio
checked in at Wed Dec 3 16:40:58 CET 2008.


--------
--- sgpio/sgpio.changes 2008-10-06 17:00:30.000000000 +0200
+++ /mounts/work_src_done/STABLE/sgpio/sgpio.changes 2008-12-03
10:33:47.000000000 +0100
@@ -1,0 +2,6 @@
+Wed Dec 03 10:29:31 CET 2008 - bwalle@xxxxxxx
+
+- Update to 1.2.1 to get a new script that can be used with MD.
+ The update does not affect existing sgpio app. (bnc #450037)
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


Old:
----
sgpio-1.2.tar.bz2

New:
----
sgpio-1.2.1.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ sgpio.spec ++++++
--- /var/tmp/diff_new_pack.EC3283/_old 2008-12-03 16:40:45.000000000 +0100
+++ /var/tmp/diff_new_pack.EC3283/_new 2008-12-03 16:40:45.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package sgpio (Version 1.2)
+# spec file for package sgpio (Version 1.2.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,8 +19,8 @@

Name: sgpio
Url: http://sources.redhat.com/lvm2/wiki/DMRAID_Eventing
-Version: 1.2
-Release: 2
+Version: 1.2.1
+Release: 1
License: GPL v2 or later
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: System/Base
@@ -71,5 +71,8 @@
%{_mandir}/man1/sgpio.1.gz

%changelog
+* Wed Dec 03 2008 bwalle@xxxxxxx
+- Update to 1.2.1 to get a new script that can be used with MD.
+ The update does not affect existing sgpio app. (bnc #450037)
* Mon Oct 06 2008 bwalle@xxxxxxx
- initial package (FATE#304217)

++++++ sgpio-1.2.tar.bz2 -> sgpio-1.2.1.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn
--exclude=.svnignore old/sgpio/sgpio.sh new/sgpio/sgpio.sh
--- old/sgpio/sgpio.sh 1970-01-01 01:00:00.000000000 +0100
+++ new/sgpio/sgpio.sh 2008-11-26 14:12:07.000000000 +0100
@@ -0,0 +1,139 @@
+#! /bin/sh
+
+#
+# sgpio wrapper for MD Monitoring utility
+# Copyright (c) 2008, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+
+# This shell script is intended to be used with MD monitoring utility
+# to control the LEDs in disk enclosures via sgpio application.
+#
+# Usage:
+# sgpio.sh "RebuildStarted" /dev/<md-device-name>
+# sgpio.sh "RebuildFinished" /dev/<md-device-name>
+# sgpio.sh "Fail" /dev/<md-device-name> /dev/<block-device>
+#
+# "RebuildStarted" or "RebuildFinished" events will set the LEDs to "rebuild"
+# or "off" state on devices in enclosed MD raid.
+# "Fail" event will set the LEDs to "off" state to a device name
+# in the 3-rd parameter of the script.
+# Other events are silently ignored.
+#
+#
+# Monitoring usage example:
+# mdadm -F --scan -p sgpio.sh
+#
+# sgpio application can be found in
+#
http://sources.redhat.com/lvm2/wiki/DMRAID_Eventing?action=AttachFile&do=view&target=sgpio-1.2.tgz
+#
+
+
+if ! [ -n "$1" ]
+then
+echo >&2 "Invalid number of parameters"
+exit 1
+fi
+
+if [ "$1" == "Fail" ] || [ "$1" == "RebuildFinished" ] || [ "$1" ==
"RebuildStarted" ]
+then
+# check number of parameters
+
+if [ -n "$1" ] && [ -n "$2" ]
+then
+event=$1
+else
+echo >&2 "Invalid number of parameters"
+exit 1
+fi
+
+# we have rebuild started and finished action
+
+if [ "$event" == "Fail" ]
+then
+if [ -n "$3" ]
+then
+# in case of "Fail" event we have drive name in $3
+DISK=`ls $3 | sed -e "s@/dev/@@g"`
+sgpio -d $DISK -s "off"
+exit 0
+else
+echo >&2 "Invalid number of parameters"
+exit 1
+fi
+fi
+
+if [ "$event" == "RebuildFinished" ]
+then
+STATUS="off"
+fi
+
+if [ "$event" == "RebuildStarted" ]
+then
+STATUS="rebuild"
+fi
+
+
+
+# check if /dev/md* exists
+if ! [ -b $2 ]
+then
+echo >&2 "file $2 does not exist"
+exit 1
+fi
+
+
+X=`stat -c "let major=0x%t; let minor=0x%T;" $2`
+eval $X
+DEV=/sys/dev/block/${major}:${minor}
+
+if ! [ -d $DEV ]
+then
+echo >&2 "Directory $DEV does not exists (based on $2 major and minor numbers)"
+exit 1
+fi
+
+
+X=`find $DEV/ -name md -print`
+if [ "$X" == "" ]
+then
+echo >&2 "Missing directory: $DEV/md"
+exit 1
+fi
+
+X=`find $DEV/md -name dev-sd\* -print`
+if [ "$X" == "" ]
+then
+echo >&2 "Missing directory: $DEV/md/dev-sd*"
+exit 1
+fi
+
+# create a list of disk in the device
+DISKS=`ls -d $DEV/md/dev-sd* | sed -e "s@$DEV/md/dev-@@g"`
+
+# replace spaces with comma separator
+DISKS=`echo $DISKS | sed "s@ @,@g"`
+
+if [ "$DISKS" == "" ]
+then
+echo >&2 "MD device disk lisk list is empty: $DEV/md/"
+exit 1
+fi
+
+# change LEDs status
+sgpio -d $DISKS -s $STATUS
+
+fi
\ No newline at end of file


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages