From 488214259d17acfda308f821350630ea4ff359ae Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 31 Mar 2017 19:14:53 -0700 Subject: autofs: Patch to build on musl Signed-off-by: Khem Raj Signed-off-by: Joe MacDonald --- ...fine-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch | 50 +++++++++++++++++++++ .../0002-Replace-__S_IEXEC-with-S_IEXEC.patch | 51 ++++++++++++++++++++++ .../recipes-daemons/autofs/autofs_5.1.1.bb | 6 ++- 3 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch create mode 100644 meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch (limited to 'meta-networking/recipes-daemons') diff --git a/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch b/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch new file mode 100644 index 0000000000..075af5707b --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch @@ -0,0 +1,50 @@ +From 933e065cf8aecfa0cce5f8f92abbed5baaaf3f77 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 31 Mar 2017 19:10:57 -0700 +Subject: [PATCH 1/2] Define __SWORD_TYPE and _PATH_NSSWITCH_CONF + +if they are not defined as is in musl then define +them here + +Signed-off-by: Khem Raj +--- + include/automount.h | 8 ++++++++ + include/nsswitch.h | 3 +++ + 2 files changed, 11 insertions(+) + +diff --git a/include/automount.h b/include/automount.h +index 219b07d..b12c22a 100644 +--- a/include/automount.h ++++ b/include/automount.h +@@ -42,6 +42,14 @@ + + #define ENABLE_CORES 1 + ++#ifndef __SWORD_TYPE ++# if __WORDSIZE == 32 /* System word size */ ++# define __SWORD_TYPE int ++# else /* __WORDSIZE == 64 */ ++# define __SWORD_TYPE long int ++# endif ++#endif ++ + /* We MUST have the paths to mount(8) and umount(8) */ + #ifndef HAVE_MOUNT + #error Failed to locate mount(8)! +diff --git a/include/nsswitch.h b/include/nsswitch.h +index 2b445a9..3db77b2 100644 +--- a/include/nsswitch.h ++++ b/include/nsswitch.h +@@ -24,6 +24,9 @@ + #include + #include "list.h" + ++#ifndef _PATH_NSSWITCH_CONF ++#define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf" ++#endif + #define NSSWITCH_FILE _PATH_NSSWITCH_CONF + + enum nsswitch_status { +-- +2.12.1 + diff --git a/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch b/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch new file mode 100644 index 0000000000..6b6ba6d855 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch @@ -0,0 +1,51 @@ +From 8fd74ddb3369572c594b22b396346131af00faee Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 31 Mar 2017 19:12:10 -0700 +Subject: [PATCH 2/2] Replace __S_IEXEC with S_IEXEC + +S_IEXEC is portable + +Signed-off-by: Khem Raj +--- + daemon/lookup.c | 4 ++-- + modules/lookup_multi.c | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/daemon/lookup.c b/daemon/lookup.c +index 62071df..1bec97f 100644 +--- a/daemon/lookup.c ++++ b/daemon/lookup.c +@@ -400,7 +400,7 @@ static int read_file_source_instance(struct autofs_point *ap, struct map_source + if (!S_ISREG(st.st_mode)) + return NSS_STATUS_NOTFOUND; + +- if (st.st_mode & __S_IEXEC) ++ if (st.st_mode & S_IEXEC) + type = src_prog; + else + type = src_file; +@@ -890,7 +890,7 @@ static int lookup_name_file_source_instance(struct autofs_point *ap, struct map_ + if (!S_ISREG(st.st_mode)) + return NSS_STATUS_NOTFOUND; + +- if (st.st_mode & __S_IEXEC) ++ if (st.st_mode & S_IEXEC) + type = src_prog; + else + type = src_file; +diff --git a/modules/lookup_multi.c b/modules/lookup_multi.c +index 6ec8434..88d081f 100644 +--- a/modules/lookup_multi.c ++++ b/modules/lookup_multi.c +@@ -104,7 +104,7 @@ static struct lookup_mod *nss_open_lookup(const char *format, int argc, const ch + continue; + } + +- if (st.st_mode & __S_IEXEC) ++ if (st.st_mode & S_IEXEC) + type = src_prog; + else + type = src_file; +-- +2.12.1 + diff --git a/meta-networking/recipes-daemons/autofs/autofs_5.1.1.bb b/meta-networking/recipes-daemons/autofs/autofs_5.1.1.bb index 8d55596572..d85600e4c7 100644 --- a/meta-networking/recipes-daemons/autofs/autofs_5.1.1.bb +++ b/meta-networking/recipes-daemons/autofs/autofs_5.1.1.bb @@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" DEPENDS += "libtirpc flex-native bison-native" +CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc" + inherit autotools-brokensep systemd SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \ @@ -21,7 +23,9 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \ file://force-STRIP-to-emtpy.patch \ file://remove-bashism.patch \ file://fix-the-YACC-rule-to-fix-a-building-failure.patch \ -" + file://0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch \ + file://0002-Replace-__S_IEXEC-with-S_IEXEC.patch \ + " SRC_URI[md5sum] = "e143df66b614b8cdb1ff533735f8e12d" SRC_URI[sha256sum] = "795419383b120d15699ab3b89ea0f3d029f6fb28405a83982d305c4b7b61130f" -- cgit 1.2.3-korg