[openwrt/openwrt] util-linux: add last util

LEDE Commits lede-commits at lists.infradead.org
Fri Aug 1 09:29:46 PDT 2025


nick pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/765d6429e1ada4957d80ff8b8cd1d9f0c4ee2b03

commit 765d6429e1ada4957d80ff8b8cd1d9f0c4ee2b03
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Mon Jul 28 15:18:01 2025 -0400

    util-linux: add last util
    
    Add a package for the last util needed to query /var/log/wtmp
    
    Build system: x86/64
    Build-tested: x86/64-glibc
    Run-tested: x86/64-glibc
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/19586
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 package/utils/util-linux/Makefile | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile
index be7c968cdc..52dca78e3d 100644
--- a/package/utils/util-linux/Makefile
+++ b/package/utils/util-linux/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=util-linux
 PKG_VERSION:=2.41.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.41
@@ -317,6 +317,18 @@ define Package/ipcs/description
   semaphore arrays.
 endef
 
+define Package/last
+$(call Package/util-linux/Default)
+  TITLE:=display history of user logins and logout sessions
+  LICENSE=BSD-4-Clause-UC
+  LICENSE_FILES:=Documentation/licenses/COPYING.BSD-4-Clause-UC
+endef
+
+define Package/last/description
+ last utility displays a history of user login and logout sessions, system reboots,
+ and other events recorded in /var/log/wtmp (or a specified file)
+endef
+
 define Package/logger
 $(call Package/util-linux/Default)
   TITLE:=a shell command interface to the syslog system log module
@@ -706,7 +718,6 @@ MESON_ARGS += \
 	-Dbuild-rfkill=disabled \
 	-Dbuild-tunelp=disabled \
 	-Dbuild-kill=disabled \
-	-Dbuild-last=disabled \
 	-Dbuild-utmpdump=disabled \
 	-Dbuild-line=disabled \
 	-Dbuild-mesg=disabled \
@@ -862,6 +873,11 @@ define Package/ipcs/install
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ipcs $(1)/usr/bin/
 endef
 
+define Package/last/install
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/last $(1)/usr/bin/
+endef
+
 define Package/logger/install
 	$(INSTALL_DIR) $(1)/usr/bin
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/logger $(1)/usr/bin/util-linux-logger
@@ -1032,6 +1048,7 @@ $(eval $(call BuildPackage,fstrim))
 $(eval $(call BuildPackage,getopt))
 $(eval $(call BuildPackage,hwclock))
 $(eval $(call BuildPackage,ipcs))
+$(eval $(call BuildPackage,last))
 $(eval $(call BuildPackage,logger))
 $(eval $(call BuildPackage,look))
 $(eval $(call BuildPackage,losetup))




More information about the lede-commits mailing list