debian/0000775000000000000000000000000012370003245007164 5ustar debian/copyright0000664000000000000000000000213312245462422011125 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: ledmon Source: http://sourceforge.net/projects/ledmon/files/ Files: * Copyright: 2009-2012 Intel Corporation License: GPL-2.0+ Files: debian/* Copyright: 2012 Dell Inc. License: GPL-2.0+ License: GPL-2.0+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that 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, see . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". debian/rules0000775000000000000000000000025412247210160010244 0ustar #!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 #export DH_OPTIONS=-v clean: $(MAKE) mrproper dh_clean %: dh $@ debian/source/0000775000000000000000000000000012245462422010473 5ustar debian/source/format0000664000000000000000000000001412245462422011701 0ustar 3.0 (quilt) debian/docs0000664000000000000000000000000712245462422010043 0ustar README debian/watch0000664000000000000000000000014212245462422010221 0ustar # watch control file for uscan version=3 http://sf.net/ledmon/ledmon-(.+)\.tar\.gz debian uupdate debian/changelog0000664000000000000000000000564412370003245011047 0ustar ledmon (0.79-0.2ubuntu0.1) trusty; urgency=high * debian/patches/sysfs-bool-values.patch Add upstream fix for 3.13 kernel change (LP: #1349920) -- Kent Baxley Wed, 30 Jul 2014 16:32:08 -0500 ledmon (0.79-0.2) unstable; urgency=low * Non-maintainer upload. * Fix FTBFS on non-Linux with "Architecture: linux-any" -- Kamal Mostafa Tue, 03 Dec 2013 07:16:30 -0800 ledmon (0.79-0.1) unstable; urgency=low * Non-maintainer upload. * New upstream release. * Adds support for NVME SSD devices (uses nvme/nvmhci block driver). * Fix small coding error in ledctl.pod * Update help info regarding reporting bugs * Make sure addr is null-terminated * Check if the directory 'holders' exists * Check device for NULL before dereferencing * ledctl documentation improvements * Do not use ISO C99 standard * Do not send LED command if state of block device has not changed * Change ledmon's behavior during rebuild. * Correct some style problems using kernel's checkpatch. * Remove indentation info * Correct indentation according to the Linux coding style using indent * Update Copyright year to 2013 * Fix support for Dell PCIe SSD Devices * More minor fixes revealed by a coverity scan * Minor fixes revealed by a coverity scan -- Kent Baxley Wed, 27 Nov 2013 15:33:27 -0600 ledmon (0.74-1) unstable; urgency=low * New upstream release: * restart of the ledmon's internal state when an unrecoverable error occurs (e.g. lack of disk's location) * logging level for not supported patterns changed from 'warning' to 'debug' * more detailed information about device change (name changed, missing) * added extra checks against device presence in sysfs (device may disappear at anytime: during rescan, initialization, sending command) * pattern "locate_off" fixed * SES-2 support for enclosures * New patterns (SES-2) in ledctl for drives in enclosures * Improved LED blinking and slot locations for AHCI and SCSI DA * ledctl and ledmon were converted to the raw bitstream (TX_GP) interface, so they do not need additional SGPIO support in the kernel now (by Dan Williams ) * the way ledctl works has been changed: so far turning on some LEDs did not change the state of all other LEDs of all controllers, now turning on some LEDs turns off all other LEDs of all controllers * ledctl's manual was corrected and updated -- Daniel Jared Dominguez Thu, 23 Aug 2012 16:28:32 -0500 ledmon (0.32-1) unstable; urgency=low * New upstream release * Fixes issue where HOTSPARE had higher priority than REBUILD -- Daniel Jared Dominguez Mon, 05 Mar 2012 11:41:06 -0600 ledmon (0.31-1) unstable; urgency=low * Initial release (Closes: #658815) -- Daniel Jared Dominguez Mon, 23 Jan 2012 13:45:41 -0600 debian/control0000664000000000000000000000173012370003252010566 0ustar Source: ledmon Section: admin Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Daniel Jared Dominguez Build-Depends: debhelper (>= 9), perl, libsgutils2-dev Standards-Version: 3.9.5 Homepage: http://ledmon.sourceforge.net/ Package: ledmon Architecture: linux-any Depends: ${shlibs:Depends}, ${misc:Depends}, openipmi Description: Enclosure LED Utilities ledmon and ledctl are userspace tools designed to control storage enclosure LEDs. The user must have root privileges to use these tools. . These tools use the SGPIO and SES-2 protocols to monitor and control LEDs. They been verified to work with Intel(R) storage controllers (i.e. the Intel(R) AHCI controller) and have not been tested with storage controllers of other vendors (especially SAS/SCSI controllers). . For backplane enclosures attached to ISCI controllers, support is limited to Intel(R) Intelligent Backplanes. debian/patches/0000775000000000000000000000000012370002760010614 5ustar debian/patches/respect-external-CFLAGS-CPPFLAGS-LDFLAGS.patch0000664000000000000000000000232212247207450020333 0ustar Description: Respect external CFLAGS, CPPFLAGS, LDFLAGS Author: Kamal Mostafa --- ledmon-0.79.orig/src/Makefile +++ ledmon-0.79/src/Makefile @@ -55,10 +55,14 @@ LEDCTL_OBJECTS=\ $(OUTDIR)/ledctl.o \ $(OBJECTS) -CFLAGS=-O0 -g -Wall DEFFLAGS=-D_DEBUG -D_GNU_SOURCE -D_BSD_SOURCE -DDMALLOC_DISABLE INCFLAGS=-I../config -LDFLAGS=-O0 -g $(DEFFLAGS) -lsgutils2 + +# CFLAGS+=-O0 -g +# LDFLAGS+=-O0 -g +CFLAGS+=-Wall +CPPFLAGS+=$(DEFFLAGS) $(INCFLAGS) +LDFLAGS+=-lsgutils2 SOURCES:=$(shell find -name "*.[cC]" -print) @@ -71,7 +75,7 @@ ledctl: $(OUTDIR)/.depend $(LEDCTL_OBJEC $(CC) $(LDLIBS) $(LEDCTL_OBJECTS) -o $@ $(LDFLAGS) $(OUTDIR)/%.o: %.c - $(CC) $(CFLAGS) $(DEFFLAGS) $(INCFLAGS) -c $< -o $@ + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ all: $(OUTDIR)/.depend ledmon ledctl @@ -93,7 +97,7 @@ mrproper: clean $(OUTDIR)/.depend: $(SOURCES) mkdir -p $(OUTDIR) - $(CC) $(CFLAGS) $(DEFFLAGS) $(INCFLAGS) -M $^ | sed 's/^[a-z,0-9]/$(subst /,\/,$(OUTDIR))\/&/' > $(OUTDIR)/.depend + $(CC) $(CFLAGS) $(CPPFLAGS) -M $^ | sed 's/^[a-z,0-9]/$(subst /,\/,$(OUTDIR))\/&/' > $(OUTDIR)/.depend ifeq ($(filter install uninstall depend clean mrproper,$(MAKECMDGOALS)),) -include $(OUTDIR)/.depend debian/patches/sysfs-bool-values.patch0000664000000000000000000000633212370002760015236 0ustar Description: Fix ledmon breakage brought on by changes in the kernel Forwarded: http://sourceforge.net/p/ledmon/code/ci/6f7d38bbe5d7b13c84987cf3b3b550a11c39392e/ Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/ledmon/+bug/1349920 Author: Artur Paszkiewicz Last-Update: 2014-07-29 commit 6f7d38bbe5d7b13c84987cf3b3b550a11c39392e (HEAD, refs/remotes/origin/master, refs/remotes/origin/HEAD, refs/heads/upstream) Date: Tue Jul 29 13:49:05 2014 +0200 Recognize bool values in sysfs The type of libahci parameter ahci_em_messages was changed from int to bool in kernel v3.13, which caused AHCI HBAs to not be detected properly. Reported-and-tested-by: Paul Boven Signed-off-by: Artur Paszkiewicz diff --git a/src/cntrl.c b/src/cntrl.c index 2e6509b..e5170a2 100644 --- a/src/cntrl.c +++ b/src/cntrl.c @@ -216,8 +216,11 @@ static unsigned int _ahci_em_messages(const char *path) if (get_int(path, 0, "driver/module/parameters/ahci_em_messages") != 0) return 1; - if (!get_int("", 0, "sys/module/libahci/parameters/ahci_em_messages")) - return 0; + /* parameter type changed from int to bool since kernel v3.13 */ + if (!get_int("", 0, "sys/module/libahci/parameters/ahci_em_messages")) { + if (!get_bool("", 0, "sys/module/libahci/parameters/ahci_em_messages")) + return 0; + } if (snprintf(buf, sizeof(buf), "%s/%s", path, "driver") < 0) return 0; diff --git a/src/utils.c b/src/utils.c index 36e4147..fca00a8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -86,6 +86,23 @@ char *get_text(const char *path, const char *name) } /* + * Function returns integer value (1 or 0) based on a boolean value ('Y' or 'N') + * read from a text file. See utils.h for details. + */ +int get_bool(const char *path, int defval, const char *name) +{ + char *p = get_text(path, name); + if (p) { + if (*p == 'Y') + defval = 1; + else if (*p == 'N') + defval = 0; + free(p); + } + return defval; +} + +/* * Function returns 64-bit unsigned integer value read from a text file. See * utils.h for details. */ diff --git a/src/utils.h b/src/utils.h index c982113..5a0a76c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -111,6 +111,23 @@ uint64_t get_uint64(const char *path, uint64_t defval, const char *name); char *get_text(const char *path, const char *name); /** + * @brief Reads boolean value from a text file. + * + * This function assumes that the only text in a file is the requested value to + * read. The recognized boolean values are in the format 'Y' for True and 'N' + * for False. In case of an error while reading from file the function will + * return a value stored in defval argument. + * + * @param[in] path Path where a file is located. + * @param[in] defval Default value to be returned in case of error. + * @param[in] name Name of a file to be read. + * + * @return Value read from a file if successful, otherwise a value stored in + * defval argument. 1 is returned for True, 0 for False. + */ +int get_bool(const char *path, int defval, const char *name); + +/** * @brief Writes a text to file. * * This function writes a text to a file and return the number of bytes written. debian/patches/series0000664000000000000000000000013312370002760012026 0ustar ldflags-order.patch respect-external-CFLAGS-CPPFLAGS-LDFLAGS.patch sysfs-bool-values.patch debian/patches/ldflags-order.patch0000664000000000000000000000103212245462422014364 0ustar LDFLAGS is specified too early, causing sgutils2 not to be found at the right time. --- a/src/Makefile +++ b/src/Makefile @@ -65,10 +65,10 @@ 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) $(DEFFLAGS) $(INCFLAGS) -c $< -o $@ debian/compat0000664000000000000000000000000212247210165010366 0ustar 9