diff --git a/.gitignore b/.gitignore index e0bc970..63ab9c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/ledmon-0.80.tar.gz +SOURCES/ledmon-0.90.tar.gz diff --git a/.ledmon.metadata b/.ledmon.metadata index 89a7c2d..e8b897c 100644 --- a/.ledmon.metadata +++ b/.ledmon.metadata @@ -1 +1 @@ -58376a4ee280503c52b8ca5693af2c5f3af2e738 SOURCES/ledmon-0.80.tar.gz +2db38c084173806d779e6f5556c795b039d47067 SOURCES/ledmon-0.90.tar.gz diff --git a/SOURCES/ledmon-nvme.patch b/SOURCES/ledmon-nvme.patch deleted file mode 100644 index 749f916..0000000 --- a/SOURCES/ledmon-nvme.patch +++ /dev/null @@ -1,67 +0,0 @@ -commit 868a01e894f6abd33a98457a7ee4c1aa7e1eb2fe -Author: Artur Paszkiewicz -Date: Tue May 9 11:21:25 2017 +0200 - - 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") - -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); - } - - /** diff --git a/SOURCES/ledmon_cflags.patch b/SOURCES/ledmon_cflags.patch index 72da7e3..d61c130 100644 --- a/SOURCES/ledmon_cflags.patch +++ b/SOURCES/ledmon_cflags.patch @@ -1,13 +1,13 @@ ---- ledmon-0.80/src/Makefile 2016-11-25 13:59:48.000000000 +0100 -+++ ledmon-0.80-new/src/Makefile 2016-12-06 14:03:59.935258740 +0100 -@@ -57,10 +57,6 @@ LEDCTL_OBJECTS=\ - $(OUTDIR)/ledctl.o \ - $(OBJECTS) +--- ledmon-0.90/src/Makefile 2018-02-14 12:26:04.000000000 +0100 ++++ ledmon-0.90-new/src/Makefile 2018-06-13 14:11:45.480919496 +0200 +@@ -64,10 +64,6 @@ TEST_CONFIG_OBJECTS=\ + $(OUTDIR)/list.o \ + $(OUTDIR)/utils.o --CXFLAGS=-O0 -g +-CXFLAGS=-O0 -g -std=gnu99 -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/SPECS/ledmon.spec b/SPECS/ledmon.spec index 0d00e84..0d83e62 100644 --- a/SPECS/ledmon.spec +++ b/SPECS/ledmon.spec @@ -1,15 +1,15 @@ Summary: Enclosure LED Utilities Name: ledmon -Version: 0.80 -Release: 2%{?dist} +Version: 0.90 +Release: 1%{?dist} License: GPLv2+ Group: Applications/System URL: http://sourceforge.net/projects/ledmon/ Source0: http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Patch0: ledmon_cflags.patch -Patch1: ledmon-nvme.patch BuildRequires: perl BuildRequires: sg3_utils-devel +BuildRequires: systemd-devel Obsoletes: ledctl = 0.1-1 Provides: ledctl = %{version}-%{release} Requires: sg3_utils-libs @@ -24,7 +24,6 @@ use this application. %prep %setup -q %patch0 -p1 -b .cflags -%patch1 -p1 %build # can't use smp_flags because -j4 makes the build fail @@ -40,6 +39,9 @@ make install INSTALL="%{__install} -p" DESTDIR=$RPM_BUILD_ROOT SBIN_DIR=$RPM_BUI %{_mandir}/*/* %changelog +* Wed Jun 13 2018 Jan Synáček - 0.90-1 +- Update to 0.90 (#1494473) + * Fri May 12 2017 Jan Synáček - 0.80-2 - LEDs don't blink during resync/recovery operations on the NVMe RAID volume (#1449990)