Skip to contentSkip to conversation

mcelog: new package

PATCH New Romain Naour 2 participants 2 messages Nov 21, 2014 – Nov 22, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mcelog: new package

---
 package/Config.in        |  1 +
 package/mcelog/Config.in |  9 +++++++++
 package/mcelog/mcelog.mk | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 package/mcelog/Config.in
 create mode 100644 package/mcelog/mcelog.mk
package/Config.in +1 -0
index a6977ce..a2167ef 100644
@@ -76,6 +76,7 @@ endif
 	source "package/lttng-babeltrace/Config.in"
 	source "package/lttng-modules/Config.in"
 	source "package/lttng-tools/Config.in"
+	source "package/mcelog/Config.in"
 	source "package/memstat/Config.in"
 	source "package/netperf/Config.in"
 	source "package/oprofile/Config.in"
package/mcelog/Config.in new file +9 -0
new file mode 100644
index 0000000..f3ccc71
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_MCELOG
+	bool "mcelog"
+	depends on BR2_i386 || BR2_x86_64
+	depends on BR2_USE_MMU # fork()
+	help
+	  mcelog processes machine checks (in particular memory and CPU hardware
+	  errors) on modern x86 Linux systems.
+
+	  http://www.mcelog.org/
package/mcelog/mcelog.mk new file +36 -0
new file mode 100644
index 0000000..15bac77
@@ -0,0 +1,36 @@
+################################################################################
+#
+# mcelog
+#
+################################################################################
+
+MCELOG_VERSION = v105
+MCELOG_SITE = $(BR2_KERNEL_MIRROR)/scm/utils/cpu/mce/mcelog.git
+MCELOG_SITE_METHOD = git
+MCELOG_LICENSE = GPLv2
+MCELOG_LICENSE_FILES = README
+
+MCELOG_TRIGGERS = cache-error-trigger \
+	dimm-error-trigger \
+	page-error-trigger \
+	socket-memory-error-trigger \
+	bus-error-trigger \
+	iomca-error-trigger \
+	unknown-error-trigger
+
+define MCELOG_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) \
+	CFLAGS="$(TARGET_CFLAGS)" \
+	CPPFLAGS="$(TARGET_CPPFLAGS)" \
+	-C $(@D) all
+endef
+
+define MCELOG_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 755 $(@D)/mcelog $(TARGET_DIR)/usr/sbin/mcelog; \
+	$(INSTALL) -D -m 644 $(@D)/mcelog.conf $(TARGET_DIR)/etc/mcelog/mcelog.conf; \
+	for i in ${MCELOG_TRIGGERS} ; do \
+		$(INSTALL) -m 755 $(@D)/triggers/$$i $(TARGET_DIR)/etc/mcelog; \
+	done
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 mcelog: new package

Dear Romain Naour,

package/mcelog/mcelog.mk line 25

Quoted 13 lines · Romain Naour
package/mcelog/mcelog.mk new file +13 -0
+MCELOG_TRIGGERS = cache-error-trigger \
+	dimm-error-trigger \
+	page-error-trigger \
+	socket-memory-error-trigger \
+	bus-error-trigger \
+	iomca-error-trigger \
+	unknown-error-trigger
+
+define MCELOG_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) \
+	CFLAGS="$(TARGET_CFLAGS)" \
+	CPPFLAGS="$(TARGET_CPPFLAGS)" \
+	-C $(@D) all

Indentation is wrong here, the continuation lines should be intended with one more tab.

Passing CFLAGS and CPPFLAGS is useless, because those variables are already part of $(TARGET_CONFIGURE_OPTS).

package/mcelog/mcelog.mk line 34

Quoted 7 lines
package/mcelog/mcelog.mk new file +7 -0
+define MCELOG_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 755 $(@D)/mcelog $(TARGET_DIR)/usr/sbin/mcelog; \
+	$(INSTALL) -D -m 644 $(@D)/mcelog.conf $(TARGET_DIR)/etc/mcelog/mcelog.conf; \
+	for i in ${MCELOG_TRIGGERS} ; do \
+		$(INSTALL) -m 755 $(@D)/triggers/$$i $(TARGET_DIR)/etc/mcelog; \
+	done
+endef

You should use $() instead of ${} when referencing make variables. However, this whole thing seems useless: the 'install' target of the mcelog Makefile does exactly this, so I've removed this custom stuff and the MCELOG_TRIGGERS, and used 'make install' instead.

Committed to next with those changes.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com