From d36fc37bc6400dabed545b5e5bc49514d52c851c Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 30 Dec 2014 10:42:39 +0100 Subject: [PATCH] dracut: detect musl's ldd error message. --- srcpkgs/dracut/patches/portability.patch | 35 ++++++++++++++++-------- srcpkgs/dracut/template | 2 +- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/srcpkgs/dracut/patches/portability.patch b/srcpkgs/dracut/patches/portability.patch index e30c16548c..4f4dbf1913 100644 --- a/srcpkgs/dracut/patches/portability.patch +++ b/srcpkgs/dracut/patches/portability.patch @@ -3,18 +3,8 @@ Portability fixes: - Use uid_t not __uid_t. - Define _GNU_SOURCE for cpu_set_t and others. - Include string.h for strncmp(). +- Detect musl's ldd error message. ---- install/dracut-install.c 2014-10-24 13:19:58.000000000 +0200 -+++ install/dracut-install.c 2014-12-28 07:59:14.083865632 +0100 -@@ -222,7 +222,7 @@ static int cp(const char *src, const cha - if (ret == 0) { - struct timeval tv[2]; - if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0) -- if(fchown(dest_desc, (__uid_t) - 1, sb.st_gid) != 0) -+ if(fchown(dest_desc, (uid_t) - 1, sb.st_gid) != 0) - log_error("Failed to chown %s: %m", dst); - tv[0].tv_sec = sb.st_atime; - tv[0].tv_usec = 0; --- install/util.h 2014-10-24 13:19:58.000000000 +0200 +++ install/util.h 2014-12-28 07:58:51.723864634 +0100 @@ -20,6 +20,8 @@ @@ -34,3 +24,26 @@ Portability fixes: #include #include #include +--- install/dracut-install.c.orig 2014-10-24 13:19:58.000000000 +0200 ++++ install/dracut-install.c 2014-12-30 10:16:25.850635694 +0100 +@@ -222,7 +222,7 @@ static int cp(const char *src, const cha + if (ret == 0) { + struct timeval tv[2]; + if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0) +- if(fchown(dest_desc, (__uid_t) - 1, sb.st_gid) != 0) ++ if(fchown(dest_desc, (uid_t) - 1, sb.st_gid) != 0) + log_error("Failed to chown %s: %m", dst); + tv[0].tv_sec = sb.st_atime; + tv[0].tv_usec = 0; +@@ -388,6 +388,11 @@ static int resolve_deps(const char *src) + break; + } + ++ /* musl ldd */ ++ if (strstr(buf, "Not a valid dynamic program")) ++ break; ++ ++ /* glibc */ + if (strstr(buf, "not a dynamic executable")) + break; + diff --git a/srcpkgs/dracut/template b/srcpkgs/dracut/template index 4f7a283291..1ef595057a 100644 --- a/srcpkgs/dracut/template +++ b/srcpkgs/dracut/template @@ -1,7 +1,7 @@ # Template file for 'dracut' pkgname=dracut version=040 -revision=3 +revision=4 build_style=meta hostmakedepends="libxslt docbook-xsl asciidoc" depends="psmisc cpio"