]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
util-linux: add wdctl 19041/head
authorWei-Ting Yang <williamatcg@gmail.com>
Fri, 6 Jun 2025 11:18:33 +0000 (19:18 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 21 Jun 2025 12:13:44 +0000 (14:13 +0200)
Add the wdctl utility.

Signed-off-by: Wei-Ting Yang <williamatcg@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19041
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/utils/util-linux/Makefile

index d5fef3901800f28ce7ad3847ab9b13a15dbd30df..083a60c9eba8dbfdf68a65dfa65370ea4314c54b 100644 (file)
@@ -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))