From af288652227af1b4d27a3f480bd88e31f7f76d63 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Thu, 13 Dec 2012 16:45:58 +0100 Subject: [PATCH] Add multipath support to ofpathname for bug #884826 --- powerpc-utils-1.2.12-ofpathname-884826.patch | 29 ++++++++++++++++++++ powerpc-utils.spec | 7 ++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 powerpc-utils-1.2.12-ofpathname-884826.patch diff --git a/powerpc-utils-1.2.12-ofpathname-884826.patch b/powerpc-utils-1.2.12-ofpathname-884826.patch new file mode 100644 index 0000000..b3d7acf --- /dev/null +++ b/powerpc-utils-1.2.12-ofpathname-884826.patch @@ -0,0 +1,29 @@ +diff -up powerpc-utils-1.2.12/scripts/ofpathname.884826 powerpc-utils-1.2.12/scripts/ofpathname +--- powerpc-utils-1.2.12/scripts/ofpathname.884826 2012-12-13 16:31:42.890057349 +0100 ++++ powerpc-utils-1.2.12/scripts/ofpathname 2012-12-13 16:33:23.929498245 +0100 +@@ -291,6 +291,13 @@ print_aliases() + fi + } + ++get_slave() ++{ ++ cd /sys/class/*/$1 ++ while [[ -n "`ls slaves 2> /dev/null`" ]]; do cd slaves/*; done ++ $FIND /dev -name "`basename $PWD`" ++} ++ + # + # logical_to_ofpathname + # Conversion for logical device name to an Open Firmware device path +@@ -333,6 +340,11 @@ logical_to_ofpathname() + fi ;; + hd*) l2of_ide ;; + fd*) echo "no fd support yet" ;; ++ dm-*) ++ DEVNAME=`get_slave $DEVICE` ++ logical_to_ofpathname ++ exit ++ ;; + esac + + if [[ -z $OF_PATH ]]; then diff --git a/powerpc-utils.spec b/powerpc-utils.spec index 4dfa6a9..a8deb6f 100644 --- a/powerpc-utils.spec +++ b/powerpc-utils.spec @@ -1,6 +1,6 @@ Name: powerpc-utils Version: 1.2.12 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Utilities for PowerPC platforms Group: System Environment/Base @@ -8,6 +8,7 @@ License: CPL URL: http://sourceforge.net/projects/%{name}/ Source0: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Source1: nvsetenv +Patch0: powerpc-utils-1.2.12-ofpathname-884826.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: zlib-devel doxygen automake librtas-devel libservicelog-devel >= 1.0.1-2 @@ -30,6 +31,7 @@ Utilities for PowerPC platforms. %prep %setup -q +%patch0 -p1 # This hack is needed only for platforms with autoconf < 2.63 %if 0%{?fedora} < 9 && 0%{?rhel} < 6 @@ -129,6 +131,9 @@ rm -rf $RPM_BUILD_ROOT %preun %changelog +* Thu Dec 13 2012 Karsten Hopp 1.2.12-4 +- Add multipath support to ofpathname for bug #884826 + * Tue Sep 04 2012 Karsten Hopp 1.2.12-3 - require powerpc-utils-python (#852326 comment 7)