diff --git a/0001-Don-t-rely-on-searching-for-block-in-sysfs-path-for-.patch b/0001-Don-t-rely-on-searching-for-block-in-sysfs-path-for-.patch deleted file mode 100644 index 19a255b..0000000 --- a/0001-Don-t-rely-on-searching-for-block-in-sysfs-path-for-.patch +++ /dev/null @@ -1,75 +0,0 @@ -From f0e0aac35deb8052f93256488e933409bdbfdc21 Mon Sep 17 00:00:00 2001 -From: Zhilong Liu -Date: Fri, 12 May 2017 16:13:04 +0800 -Subject: [PATCH] Don't rely on searching for "/block" in sysfs path for - detecting partitions - -It is simpler and more reliable to check for a "partition" file in the device's -directory (supported since kernel 2.6.28). The previous approach would fail for -nvme devices because their device path looks like this: -/sys/devices/pci0000:00/0000:00:0c.0/nvme/nvme0/nvme0n1 - -Fixes: b30173ec8c05 ("* fix off-normal-failure block dev status loop * remove -unused raid->slave_list member * support md raid on block device partitions") - -Signed-off-by: Zhilong Liu ---- - src/slave.c | 27 ++++++++++++++------------- - 1 file changed, 14 insertions(+), 13 deletions(-) - -diff --git a/src/slave.c b/src/slave.c -index 9843ffd..436ed4a 100644 ---- a/src/slave.c -+++ b/src/slave.c -@@ -22,6 +22,8 @@ - #include - #include - #include -+#include -+#include - - #if _HAVE_DMALLOC_H - #include -@@ -100,27 +102,26 @@ static struct block_device *_get_block(const char *path, void *block_list) - { - char temp[PATH_MAX]; - char link[PATH_MAX]; -- char *ptr; -- struct block_device *device = NULL; - - str_cpy(temp, path, PATH_MAX); - str_cat(temp, "/block", PATH_MAX); - -- if (realpath(temp, link)) { -- ptr = strrchr(link, '/'); -- if (ptr && link < ptr - strlen("/block")) { -- /* translate partition to master block dev */ -- if(strncmp( -- ptr - strlen("/block"), -- "/block", -- strlen("/block"))) { -+ if (!realpath(temp, link)) -+ return NULL; - -+ /* translate partition to master block dev */ -+ if (snprintf(temp, PATH_MAX, "%s/partition", link) > 0) { -+ struct stat sb; -+ char *ptr; -+ -+ if (stat(temp, &sb) == 0 && S_ISREG(sb.st_mode)) { -+ ptr = strrchr(link, '/'); -+ if (ptr) - *ptr = '\0'; -- } -- device = list_first_that(block_list, _compare, link); - } - } -- return device; -+ -+ return list_first_that(block_list, _compare, link); - } - - /** --- -2.6.6 - diff --git a/0001-fix-compilation-warnings-on-newer-gcc.patch b/0001-fix-compilation-warnings-on-newer-gcc.patch new file mode 100644 index 0000000..0aa5ea6 --- /dev/null +++ b/0001-fix-compilation-warnings-on-newer-gcc.patch @@ -0,0 +1,57 @@ +From 8e82bd8bec79d066c6263f99d395c87be4086dbc Mon Sep 17 00:00:00 2001 +From: Zhilong Liu +Date: Mon, 27 Nov 2017 11:29:50 +0800 +Subject: [PATCH] fix compilation warnings on newer gcc + +bsc#1067452 +URL: https://bugzilla.suse.com/show_bug.cgi?id=1067452#c4 +Upstream URL: https://github.com/intel/ledmon +Commit ID: e51e1a855df80e34e166984373dce7d765d61d52 + +Signed-off-by: Zhilong Liu +--- + src/Makefile | 2 +- + src/ledctl.c | 1 + + src/smp.c | 1 + + 3 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index bb718d5..19a27d0 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -62,7 +62,7 @@ CXFLAGS=-O0 -g + CWFLAGS=-Wall + CFLAGS=$(CXFLAGS) $(CWFLAGS) + +-DEFFLAGS=-D_DEBUG -D_GNU_SOURCE -D_BSD_SOURCE -DDMALLOC_DISABLE ++DEFFLAGS=-D_DEBUG -D_GNU_SOURCE -D_DEFAULT_SOURCE -DDMALLOC_DISABLE + CPPFLAGS=$(DEFFLAGS) + ALL_CPPFLAGS=$(CPPFLAGS) -I../config + +diff --git a/src/ledctl.c b/src/ledctl.c +index 2d013b4..e060fe2 100644 +--- a/src/ledctl.c ++++ b/src/ledctl.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #if _HAVE_DMALLOC_H + #include +diff --git a/src/smp.c b/src/smp.c +index 7912bd0..872c0ca 100644 +--- a/src/smp.c ++++ b/src/smp.c +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + #if _HAVE_DMALLOC_H + #include +-- +2.15.0 + diff --git a/Makefile-error-dependency.patch b/Makefile-error-dependency.patch deleted file mode 100644 index a889241..0000000 --- a/Makefile-error-dependency.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- - Makefile | 11 +++-------- - src/Makefile | 6 +++--- - 2 files changed, 6 insertions(+), 11 deletions(-) - -Index: src/Makefile -=================================================================== ---- src/Makefile.orig -+++ src/Makefile -@@ -61,7 +61,7 @@ CXFLAGS=-O0 -g - CWFLAGS=-Wall - CFLAGS=$(CXFLAGS) $(CWFLAGS) - --DEFFLAGS=-D_DEBUG -D_GNU_SOURCE -D_BSD_SOURCE -DDMALLOC_DISABLE -+DEFFLAGS=-D_DEBUG -D_GNU_SOURCE -D_DEFAULT_SOURCE -DDMALLOC_DISABLE - CPPFLAGS=$(DEFFLAGS) - ALL_CPPFLAGS=$(CPPFLAGS) -I../config - -@@ -73,10 +73,10 @@ SOURCES:=$(shell find -name "*.[cC]" -pr - default: all - - ledmon: $(OUTDIR)/.depend $(LEDMON_OBJECTS) -- $(CC) $(LDFLAGS) $(LDLIBS) $(LEDMON_OBJECTS) -o $@ -+ $(CC) $(LDLIBS) $(LEDMON_OBJECTS) -o $@ $(LDFLAGS) - - ledctl: $(OUTDIR)/.depend $(LEDCTL_OBJECTS) -- $(CC) $(LDFLAGS) $(LDLIBS) $(LEDCTL_OBJECTS) -o $@ -+ $(CC) $(LDLIBS) $(LEDCTL_OBJECTS) -o $@ $(LDFLAGS) - - $(OUTDIR)/%.o: %.c - $(CC) $(CFLAGS) $(ALL_CPPFLAGS) -c $< -o $@ -Index: Makefile -=================================================================== ---- Makefile.orig -+++ Makefile -@@ -19,20 +19,15 @@ - # Installation directory - DESTDIR?= - --.PHONY: ledmon ledctl man all -+.PHONY: man all - - default: all - --ledmon: -- $(MAKE) -C src ledmon -- --ledctl: -- $(MAKE) -C src ledctl -- - man: - $(MAKE) -C doc all - --all: ledmon ledctl man -+all: -+ $(MAKE) -C src all - - install: all - $(MAKE) -C src DESTDIR=$(DESTDIR) install diff --git a/ledmon-0.80.tar.gz b/ledmon-0.80.tar.gz deleted file mode 100644 index f8d7fb7..0000000 --- a/ledmon-0.80.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5000b0114c82d04b0bebdfe205458c39eed19cd002868790b2fb498c26917128 -size 64199 diff --git a/ledmon.changes b/ledmon.changes index 76708cb..8e17b63 100644 --- a/ledmon.changes +++ b/ledmon.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Mon Nov 27 06:46:41 UTC 2017 - zlliu@suse.com + +- Update to version 0.81: + * No upstream changelog available + * add: 0001-fix-compilation-warnings-on-newer-gcc.patch + * modify spec file on demand, add libudev dependency. + * Intel has moved ledmon from Souceforge to Github. +- Drop no longer needed Makefile-error-dependency.patch +- Drop 0001-Don-t-rely-on-searching-for-block-in-sysfs-path-for-.patch +- bsc#1067452 and fate#322625 + ------------------------------------------------------------------- Fri May 12 08:33:13 UTC 2017 - zlliu@suse.com diff --git a/ledmon.spec b/ledmon.spec index 5471744..ac35fbb 100644 --- a/ledmon.spec +++ b/ledmon.spec @@ -17,16 +17,16 @@ Name: ledmon -Version: 0.80 +Version: 0.81 Release: 0 Summary: Enclosure LED Utilities License: GPL-2.0 Group: Hardware/Other -Url: http://sourceforge.net/projects/ledmon/ -Source0: http://sourceforge.net/projects/ledmon/files/ledmon-%{version}/%{name}-%{version}.tar.gz -Patch0: Makefile-error-dependency.patch -Patch1: 0001-Don-t-rely-on-searching-for-block-in-sysfs-path-for-.patch +Url: https://github.com/intel/ledmon/ +Source0: https://github.com/intel/ledmon/archive/v%{version}.tar.gz +Patch0: 0001-fix-compilation-warnings-on-newer-gcc.patch BuildRequires: libsgutils-devel +BuildRequires: libudev-devel Provides: sgpio:/sbin/ledmon Provides: sgpio:/{%{_bindir}}/ledctl BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -38,8 +38,7 @@ solutions. %prep %setup -q -%patch0 -%patch1 -p1 +%patch0 -p1 %build make %{?_smp_mflags} CXFLAGS="%{optflags} -lsgutils2" diff --git a/v0.81.tar.gz b/v0.81.tar.gz new file mode 100644 index 0000000..e9b5c9e --- /dev/null +++ b/v0.81.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f125947232e1f7649fabafce3c689499448e2c13f25bb3f33440c9d873440f9 +size 61363