From 195aaf0811461fb9d03c1a8baaa4840e5a61a93a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 12 Jan 2016 17:41:01 +0100 Subject: [PATCH] util-linux: fix mount(8) helpers arg order with musl. Before this patch mount(8) would execute something like: /sbin/mount.helper src dest After this patch: /sbin/mount.helper src dest The reason is that musl does not reorder args to check for options, so that options must appear before real arguments to make this work. This makes zfs work correctly on musl. Thanks to @chneukirchen for help in finding the issue. --- srcpkgs/util-linux/patches/fix-musl-2.patch | 40 +++++++++++++++++++++ srcpkgs/util-linux/template | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/srcpkgs/util-linux/patches/fix-musl-2.patch b/srcpkgs/util-linux/patches/fix-musl-2.patch index 2786f617c41..89e59853993 100644 --- a/srcpkgs/util-linux/patches/fix-musl-2.patch +++ b/srcpkgs/util-linux/patches/fix-musl-2.patch @@ -11,3 +11,43 @@ Fixes rendering issue with chsh if (sz == -1) return NULL; +--- libmount/src/context_mount.c.orig 2016-01-12 17:33:25.902659537 +0100 ++++ libmount/src/context_mount.c 2016-01-12 17:34:31.198503965 +0100 +@@ -605,27 +605,27 @@ static int exec_helper(struct libmnt_con + type = mnt_fs_get_fstype(cxt->fs); + + args[i++] = cxt->helper; /* 1 */ +- args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 2 */ +- args[i++] = mnt_fs_get_target(cxt->fs); /* 3 */ + + if (mnt_context_is_sloppy(cxt)) +- args[i++] = "-s"; /* 4 */ ++ args[i++] = "-s"; /* 2 */ + if (mnt_context_is_fake(cxt)) +- args[i++] = "-f"; /* 5 */ ++ args[i++] = "-f"; /* 3 */ + if (mnt_context_is_nomtab(cxt)) +- args[i++] = "-n"; /* 6 */ ++ args[i++] = "-n"; /* 4 */ + if (mnt_context_is_verbose(cxt)) +- args[i++] = "-v"; /* 7 */ ++ args[i++] = "-v"; /* 5 */ + if (o) { +- args[i++] = "-o"; /* 8 */ +- args[i++] = o; /* 9 */ ++ args[i++] = "-o"; /* 6 */ ++ args[i++] = o; /* 7 */ + } + if (type + && strchr(type, '.') + && !endswith(cxt->helper, type)) { +- args[i++] = "-t"; /* 10 */ +- args[i++] = type; /* 11 */ ++ args[i++] = "-t"; /* 8 */ ++ args[i++] = type; /* 9 */ + } ++ args[i++] = mnt_fs_get_srcpath(cxt->fs);/* 10 */ ++ args[i++] = mnt_fs_get_target(cxt->fs); /* 11 */ + args[i] = NULL; /* 12 */ + for (i = 0; args[i]; i++) + DBG(CXT, ul_debugobj(cxt, "argv[%d] = \"%s\"", diff --git a/srcpkgs/util-linux/template b/srcpkgs/util-linux/template index e39a1f1e190..39f35281f9f 100644 --- a/srcpkgs/util-linux/template +++ b/srcpkgs/util-linux/template @@ -1,7 +1,7 @@ # Template file for 'util-linux' pkgname=util-linux version=2.27.1 -revision=2 +revision=3 short_desc="Miscellaneous linux utilities" maintainer="Juan RP " homepage="https://www.kernel.org/pub/linux/utils/util-linux/"