hwclock was fixed to work with musl.

Unfortunately, the fix breaks under musl 1.2.x. Backported patch to fix
that.

Add libblkid DEPENDS to blkdiscard. Seems to be needed now.

Signed-off-by: Rosen Penev <ros...@gmail.com>
---
 package/utils/util-linux/Makefile             |  9 +++---
 .../patches/003-fix_pkgconfig_files.patch     |  2 +-
 .../util-linux/patches/200-musl-1.2.x.patch   | 28 +++++++++++++++++++
 3 files changed, 34 insertions(+), 5 deletions(-)
 create mode 100644 package/utils/util-linux/patches/200-musl-1.2.x.patch

diff --git a/package/utils/util-linux/Makefile 
b/package/utils/util-linux/Makefile
index 3953d83238..185526b97e 100644
--- a/package/utils/util-linux/Makefile
+++ b/package/utils/util-linux/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=util-linux
-PKG_VERSION:=2.35.1
-PKG_RELEASE:=2
+PKG_VERSION:=2.36
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.35
-PKG_HASH:=d9de3edd287366cd908e77677514b9387b22bc7b88f45b83e1922c3597f1d7f9
+PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.36
+PKG_HASH:=9e4b1c67eb13b9b67feb32ae1dc0d50e08ce9e5d82e1cccd0ee771ad2fa9e0b1
 PKG_CPE_ID:=cpe:/a:kernel:util-linux
 
 PKG_LICENSE:=GPL-2.0
@@ -125,6 +125,7 @@ endef
 define Package/blkdiscard
 $(call Package/util-linux/Default)
   TITLE:=discard sectors on a device
+  DEPENDS+= +libblkid
   SUBMENU=Disc
 endef
 
diff --git a/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch 
b/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch
index c4afdb1b6e..3f97eaf737 100644
--- a/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch
+++ b/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch
@@ -10,7 +10,7 @@
  endif # BUILD_LIBUUID
 --- a/configure.ac
 +++ b/configure.ac
-@@ -2496,18 +2496,23 @@ AC_CONFIG_HEADERS([config.h])
+@@ -2586,18 +2586,23 @@ AC_CONFIG_HEADERS([config.h])
  #
  AC_CONFIG_FILES([
  Makefile
diff --git a/package/utils/util-linux/patches/200-musl-1.2.x.patch 
b/package/utils/util-linux/patches/200-musl-1.2.x.patch
new file mode 100644
index 0000000000..d840f7af3d
--- /dev/null
+++ b/package/utils/util-linux/patches/200-musl-1.2.x.patch
@@ -0,0 +1,28 @@
+From 69e4fbfbfd9c42af508954d9fb985c5c7b657784 Mon Sep 17 00:00:00 2001
+From: Karel Zak <k...@redhat.com>
+Date: Tue, 11 Aug 2020 11:02:31 +0200
+Subject: [PATCH] hwclock: add fallback if SYS_settimeofday does not exist
+
+It seems Musl-C removes SYS_settimeofday macro at all.
+
+Addresses: 
https://github.com/karelzak/util-linux/commit/9c6139a72017cecb9145e46102152cb4f456ada6#commitcomment-41290951
+Signed-off-by: Karel Zak <k...@redhat.com>
+---
+ sys-utils/hwclock.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
+index ac4f9c753..ac74549d7 100644
+--- a/sys-utils/hwclock.c
++++ b/sys-utils/hwclock.c
+@@ -675,6 +675,10 @@ display_time(struct timeval hwctime)
+  */
+ #define __set_time(_tv)               settimeofday(_tv, NULL)
+ 
++#if !defined(SYS_settimeofday) && defined(__NR_settimeofday)
++# define SYS_settimeofday     __NR_settimeofday
++#endif
++
+ static inline int __set_timezone(const struct timezone *tz)
+ {
+ #ifdef SYS_settimeofday
-- 
2.26.2


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to