summaryrefslogtreecommitdiffstats
path: root/package/devel
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2023-10-31 08:14:21 +0100
committerChristian Lamparter <chunkeey@gmail.com>2023-12-12 19:35:03 +0100
commitaab21ee0552019c4bf1c7b829aea2992b59fb9bf (patch)
treee1f1fab0c2bd3756a88aaef94eeea5571ead48c5 /package/devel
parent8613353b5e7348d5c04ec7d04e248309f708687a (diff)
downloadopenwrt-aab21ee0552019c4bf1c7b829aea2992b59fb9bf.tar.gz
openwrt-aab21ee0552019c4bf1c7b829aea2992b59fb9bf.tar.bz2
openwrt-aab21ee0552019c4bf1c7b829aea2992b59fb9bf.zip
tools: add ledumon and ledhwbmon packages
ledumon: This program creates a new userspace LED class device and monitors it. For this it es using the kmod-leds-uled.ko kernel module. ledhwbmon: This program monitors LED brightness level changes having its origin in hardware/firmware, i.e. outside of kernel control. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'package/devel')
-rw-r--r--package/devel/leds/Makefile74
1 files changed, 74 insertions, 0 deletions
diff --git a/package/devel/leds/Makefile b/package/devel/leds/Makefile
new file mode 100644
index 0000000000..47b9674c4f
--- /dev/null
+++ b/package/devel/leds/Makefile
@@ -0,0 +1,74 @@
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=leds
+PKG_VERSION:=$(LINUX_VERSION)
+PKG_RELEASE:=1
+
+PKG_BUILD_PARALLEL:=1
+PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
+PKG_LICENSE:=GPL-2.0-only
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/leds/default
+ SECTION:=devel
+ CATEGORY:=Development
+ VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
+ URL:=http://www.kernel.org
+endef
+
+define Package/ledumon
+ $(Package/leds/default)
+ TITLE:=Monitoring userspace LEDs
+ DEPENDS:=+kmod-leds-uleds
+endef
+
+define Package/ledumon/description
+ This program creates a new userspace LED class device and monitors it.
+ A timestamp and brightness value is printed each time the brightness
+ changes.
+endef
+
+define Package/ledhwbmon
+ $(Package/leds/default)
+ TITLE:=Monitoring hardware controlled LED brightness
+endef
+
+define Package/ledhwbmon/description
+ This program monitors LED brightness level changes having its origin
+ in hardware/firmware, i.e. outside of kernel control. A timestamp and
+ brightness value is printed each time the brightness changes.
+endef
+
+MAKE_FLAGS = \
+ ARCH="$(LINUX_KARCH)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ CC="$(TARGET_CC)" \
+ LD="$(TARGET_CROSS)ld" \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS) -static" \
+ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
+ prefix=/usr
+
+define Build/Compile
+ -$(MAKE) clean \
+ -C $(LINUX_DIR)/tools/leds
+ +$(MAKE_FLAGS) $(MAKE) \
+ -C $(LINUX_DIR)/tools/leds
+endef
+
+define Package/ledumon/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(LINUX_DIR)/tools/leds/uledmon \
+ $(1)/usr/bin/ledumon
+endef
+
+define Package/ledhwbmon/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(LINUX_DIR)/tools/leds/led_hw_brightness_mon \
+ $(1)/usr/bin/ledhwbmon
+endef
+
+$(eval $(call BuildPackage,ledumon))
+$(eval $(call BuildPackage,ledhwbmon))