From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-oe][PATCH V2] ledmon: control hard disk led for RAID arrays
Date: Tue, 9 Apr 2019 21:32:44 -0700 [thread overview]
Message-ID: <20190410043244.12131-1-raj.khem@gmail.com> (raw)
From: Liwei Song <liwei.song@windriver.com>
Enable LED support for Intel Virtual RAID On CPU.
Fix build with musl
Signed-off-by: Liwei Song <liwei.song@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...ad-of-on_exit-for-musl-compatibility.patch | 53 +++++++++++++++++++
...include-sys-select.h-and-sys-types.h.patch | 43 +++++++++++++++
meta-oe/recipes-bsp/ledmon/ledmon_git.bb | 34 ++++++++++++
3 files changed, 130 insertions(+)
create mode 100644 meta-oe/recipes-bsp/ledmon/ledmon/0001-use-atexit-insead-of-on_exit-for-musl-compatibility.patch
create mode 100644 meta-oe/recipes-bsp/ledmon/ledmon/0002-include-sys-select.h-and-sys-types.h.patch
create mode 100644 meta-oe/recipes-bsp/ledmon/ledmon_git.bb
diff --git a/meta-oe/recipes-bsp/ledmon/ledmon/0001-use-atexit-insead-of-on_exit-for-musl-compatibility.patch b/meta-oe/recipes-bsp/ledmon/ledmon/0001-use-atexit-insead-of-on_exit-for-musl-compatibility.patch
new file mode 100644
index 0000000000..de5ce9fc83
--- /dev/null
+++ b/meta-oe/recipes-bsp/ledmon/ledmon/0001-use-atexit-insead-of-on_exit-for-musl-compatibility.patch
@@ -0,0 +1,53 @@
+From 8aba09b743b4e89ef581a679943ce39a5c7fd4a5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 9 Apr 2019 21:25:21 -0700
+Subject: [PATCH 1/2] use atexit insead of on_exit for musl compatibility
+
+musl does not support on_exit which is used in clean up.
+Instead use atexit with is supported by musl and glibc.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/ledctl.c | 2 +-
+ src/ledmon.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/ledctl.c b/src/ledctl.c
+index 2aa1abc..2c97dcf 100644
+--- a/src/ledctl.c
++++ b/src/ledctl.c
+@@ -689,7 +689,7 @@ int main(int argc, char *argv[])
+ status = _init_ledctl_conf();
+ if (status != STATUS_SUCCESS)
+ return status;
+- if (on_exit(_ledctl_fini, progname))
++ if (atexit(_ledctl_fini))
+ exit(STATUS_ONEXIT_ERROR);
+ if (_cmdline_parse(argc, argv))
+ exit(STATUS_CMDLINE_ERROR);
+diff --git a/src/ledmon.c b/src/ledmon.c
+index 0ea2583..2333c7c 100644
+--- a/src/ledmon.c
++++ b/src/ledmon.c
+@@ -860,7 +860,7 @@ int main(int argc, char *argv[])
+ set_invocation_name(argv[0]);
+ openlog(progname, LOG_PID | LOG_PERROR, LOG_DAEMON);
+
+- if (on_exit(_ledmon_status, &terminate))
++ if (atexit(_ledmon_status))
+ return STATUS_ONEXIT_ERROR;
+
+ if (_cmdline_parse_non_daemonise(argc, argv) != STATUS_SUCCESS)
+@@ -930,7 +930,7 @@ int main(int argc, char *argv[])
+ }
+ _ledmon_setup_signals();
+
+- if (on_exit(_ledmon_fini, progname))
++ if (atexit(_ledmon_fini))
+ exit(STATUS_ONEXIT_ERROR);
+ list_init(&ledmon_block_list, (item_free_t)block_device_fini);
+ sysfs_init();
+--
+2.21.0
+
diff --git a/meta-oe/recipes-bsp/ledmon/ledmon/0002-include-sys-select.h-and-sys-types.h.patch b/meta-oe/recipes-bsp/ledmon/ledmon/0002-include-sys-select.h-and-sys-types.h.patch
new file mode 100644
index 0000000000..75bf2b4f5e
--- /dev/null
+++ b/meta-oe/recipes-bsp/ledmon/ledmon/0002-include-sys-select.h-and-sys-types.h.patch
@@ -0,0 +1,43 @@
+From 2ee8796db5019341b774bcb4f7d0944d89e1845b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 9 Apr 2019 21:26:55 -0700
+Subject: [PATCH 2/2] include sys/select.h and sys/types.h
+
+sys/select.h is needed to provide fd_set definition
+sys/types.h is needed for ssize_t
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/dellssd.c | 1 +
+ src/utils.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/dellssd.c b/src/dellssd.c
+index 7b8d431..e97fe45 100644
+--- a/src/dellssd.c
++++ b/src/dellssd.c
+@@ -27,6 +27,7 @@
+ #include <unistd.h>
+
+ #include <sys/ioctl.h>
++#include <sys/select.h>
+ #include <linux/ipmi.h>
+
+ #if _HAVE_DMALLOC_H
+diff --git a/src/utils.h b/src/utils.h
+index 720447a..c106529 100644
+--- a/src/utils.h
++++ b/src/utils.h
+@@ -21,6 +21,7 @@
+ #define _UTILS_H_INCLUDED_
+
+ #include <getopt.h>
++#include <sys/types.h>
+ #include "config_file.h"
+ #include "stdlib.h"
+ #include "stdint.h"
+--
+2.21.0
+
diff --git a/meta-oe/recipes-bsp/ledmon/ledmon_git.bb b/meta-oe/recipes-bsp/ledmon/ledmon_git.bb
new file mode 100644
index 0000000000..4376ad3941
--- /dev/null
+++ b/meta-oe/recipes-bsp/ledmon/ledmon_git.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Intel(R) Enclosure LED Utilities"
+
+DESCRIPTION = "The utilities are designed primarily to be used on storage servers \
+ utilizing MD devices (aka Linux Software RAID) for RAID arrays.\
+"
+HOMEPAGE = "https://github.com/intel/ledmon"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+"
+
+DEPENDS = "sg3-utils udev"
+
+inherit systemd
+
+SYSTEMD_SERVICE_${PN} = "ledmon.service"
+
+SRC_URI = "git://github.com/intel/ledmon;branch=master \
+ file://0001-use-atexit-insead-of-on_exit-for-musl-compatibility.patch \
+ file://0002-include-sys-select.h-and-sys-types.h.patch \
+ "
+
+SRCREV = "ad1304ca1363d727425a1f23703c523e21feae4f"
+
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+
+S = "${WORKDIR}/git"
+EXTRA_OEMAKE = "CC='${CC}' LDFLAGS='${LDFLAGS}' CFLAGS='${CFLAGS}'"
+
+do_install_append() {
+ install -d ${D}/${systemd_unitdir}/system
+ oe_runmake DESTDIR=${D} install
+ oe_runmake DESTDIR=${D}${systemd_unitdir}/system install-systemd
+}
--
2.21.0
next reply other threads:[~2019-04-10 4:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-10 4:32 Khem Raj [this message]
2019-04-15 11:44 ` [meta-oe][PATCH V2] ledmon: control hard disk led for RAID arrays Adrian Bunk
2019-04-15 14:29 ` Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190410043244.12131-1-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.