[openwrt/openwrt] util-linux: add wdctl

LEDE Commits lede-commits at lists.infradead.org
Sat Jun 21 05:20:22 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/8ef981698e8488f675cc7a9ddb0669a6f84dacd8

commit 8ef981698e8488f675cc7a9ddb0669a6f84dacd8
Author: Wei-Ting Yang <williamatcg at gmail.com>
AuthorDate: Fri Jun 6 19:18:33 2025 +0800

    util-linux: add wdctl
    
    Add the wdctl utility.
    
    Signed-off-by: Wei-Ting Yang <williamatcg at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/19041
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/utils/util-linux/Makefile | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile
index d5fef39018..083a60c9eb 100644
--- a/package/utils/util-linux/Makefile
+++ b/package/utils/util-linux/Makefile
@@ -549,6 +549,21 @@ define Package/wall/description
  set to yes
 endef
 
+define Package/wdctl
+$(call Package/util-linux/Default)
+  TITLE:=show hardware watchdog status
+  DEPENDS:= +libsmartcols
+endef
+
+define Package/wdctl/description
+ Show hardware watchdog status. The default device is /dev/watchdog. If more
+ than one device is specified then the output is separated by one blank line.
+ If the device is already used or user has no permissions to read from the
+ device, then wdctl reads data from sysfs. In this case information about
+ supported features (flags) might be missing. Note that the number of supported
+ watchdog features is hardware specific.
+endef
+
 define Package/whereis
 $(call Package/util-linux/Default)
   TITLE:=locate the binary, source, and manual page files for a command
@@ -594,7 +609,6 @@ MESON_ARGS += \
 	-Dbuild-minix=disabled \
 	-Dbuild-fdformat=disabled \
 	-Dbuild-lslogins=disabled \
-	-Dbuild-wdctl=disabled \
 	-Dbuild-switch_root=disabled \
 	-Dbuild-pivot_root=disabled \
 	-Dbuild-lsmem=disabled \
@@ -892,6 +906,12 @@ define Package/wall/install
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wall $(1)/usr/bin/
 endef
 
+# Install to /bin instead of /usr/bin to not conflict wdctl from wifidog
+define Package/wdctl/install
+	$(INSTALL_DIR) $(1)/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wdctl $(1)/bin/
+endef
+
 define Package/whereis/install
 	$(INSTALL_DIR) $(1)/usr/bin
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/whereis $(1)/usr/bin/
@@ -950,5 +970,6 @@ $(eval $(call BuildPackage,unshare))
 $(eval $(call BuildPackage,uuidd))
 $(eval $(call BuildPackage,uuidgen))
 $(eval $(call BuildPackage,wall))
+$(eval $(call BuildPackage,wdctl))
 $(eval $(call BuildPackage,whereis))
 $(eval $(call BuildPackage,wipefs))




More information about the lede-commits mailing list