Squashed 'import-layers/meta-openembedded/' changes from df3537259..b40116cf4

Yocto 2.2.2 (Morty)

Change-Id: I3998555f14538d8306be995bcfb366173e04e975
git-subtree-dir: import-layers/meta-openembedded
git-subtree-split: b40116cf457b88a2db14b86fda9627fb34d56ae6
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
new file mode 100644
index 0000000..93c836c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
@@ -0,0 +1,58 @@
+From 8d2164a090f17286ea8291f30a123595cf447dc3 Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Wed, 30 Nov 2016 10:27:36 +0800
+Subject: [PATCH] crda: fix issues when 'USE_OPENSSL=1'.
+
+Fxed the below issues if configured with 'USE_OPENSSL=1':
+a. keys-ssl.c uses BN_ULONG but doesn't include the openssl headers leading
+   to build failures:
+   keys-ssl.c:2:8: error: unknown type name 'BN_ULONG'
+   static BN_ULONG e_0[1] = {
+
+b. The large unqualified constants also break building:
+   keys-ssl.c:8:2: warning: overflow in implicit constant conversion [-Woverflow]
+     0x63a2705416a0d8e1, 0xdc9fca11c8ba757b,
+
+c. keys-ssl.c: error: 'keys' defined but not used [-Werror=unused-variable]
+   static struct pubkey keys[] = {
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Upsteam-Status: Pending
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ utils/key2pub.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/utils/key2pub.py b/utils/key2pub.py
+index 401d58a..3ae00b8 100755
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -24,7 +24,7 @@ def print_ssl_64(output, name, val):
+     for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
+         if not idx:
+             output.write('\t')
+-        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
++        output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2xULL, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
+         idx += 1
+         if idx == 2:
+             idx = 0
+@@ -60,6 +60,7 @@ def print_ssl_32(output, name, val):
+ def print_ssl(output, name, val):
+     import os
+     output.write('#include <stdint.h>\n')
++    output.write('#include <openssl/bn.h>\n')
+     if os.getenv('TARGET_BITS') == '64':
+         return print_ssl_64(output, name, val)
+     else:
+@@ -78,7 +79,7 @@ struct pubkey {
+ 
+ #define KEYS(e,n)	{ KEY(e), KEY(n), }
+ 
+-static struct pubkey keys[] = {
++static struct pubkey keys[] __attribute__((unused))= {
+ ''')
+     for n in xrange(n + 1):
+         output.write('	KEYS(e_%d, n_%d),\n' % (n, n))
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/make.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/make.patch
new file mode 100644
index 0000000..0b73785
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/make.patch
@@ -0,0 +1,25 @@
+These headers are not related to any Make rule but they do appear in
+compiling of libreg.so, specifying .h files in compiler cmdline is flagged
+as error by clang
+
+| clang-4.0: error: cannot specify -o when generating multiple output files
+| make: *** [libreg.so] Error 1
+
+This is how we see headers in cmdline
+-O2 -fpic -std=gnu
+99 -Wall -Werror -pedantic -Wall -g -DUSE_GCRYPT -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0`  -o libreg.so -shared -Wl,-soname,libreg.so
+regdb.h reglib.h reglib.c keys-gcrypt.c -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L ./ -lm -lgcrypt
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/Makefile.kk	2016-11-15 04:54:53.338670000 +0000
++++ a/Makefile	2016-11-15 04:55:07.718670000 +0000
+@@ -114,7 +114,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(
+ 	$(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
+ 	$(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
+ 
+-$(LIBREG): regdb.h reglib.h reglib.c
++$(LIBREG): reglib.c
+ 	$(NQ) '  CC  ' $@
+ 	$(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
new file mode 100644
index 0000000..100b765
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
@@ -0,0 +1,34 @@
+From c1c42513edd27c97341f2033af77c13a4724eb8f Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Fri, 25 Nov 2016 16:48:01 +0800
+Subject: [PATCH] crda: Use target word size instead of host's.
+
+In key2pub.py, the codes check the wordsize
+of the host machine but not the target's, this fix
+fetches the wordsize of target from the build system.
+
+Upstream-Status: Pending
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ utils/key2pub.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/utils/key2pub.py b/utils/key2pub.py
+index 3e84cd2..401d58a 100755
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -58,9 +58,9 @@ def print_ssl_32(output, name, val):
+     output.write('};\n\n')
+ 
+ def print_ssl(output, name, val):
+-    import struct
++    import os
+     output.write('#include <stdint.h>\n')
+-    if len(struct.pack('@L', 0)) == 8:
++    if os.getenv('TARGET_BITS') == '64':
+         return print_ssl_64(output, name, val)
+     else:
+         return print_ssl_32(output, name, val)
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb
index 00c358d..dbddd55 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb
@@ -4,13 +4,16 @@
 LICENSE = "copyleft-next-0.3.0"
 LIC_FILES_CHKSUM = "file://copyleft-next-0.3.0;md5=8743a2c359037d4d329a31e79eabeffe"
 
-DEPENDS = "python-m2crypto-native python-native libgcrypt libnl"
+DEPENDS = "python-m2crypto-native python-native libgcrypt libnl openssl"
 
 SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz \
            file://do-not-run-ldconfig-if-destdir-is-set.patch \
            file://fix-linking-of-libraries-used-by-reglib.patch \
            file://fix-gcc-6-unused-variables.patch \
            file://0001-Makefile-respect-LDFLAGS-for-libreg.patch \
+           file://make.patch \
+           file://use-target-word-size-instead-of-host-s.patch \
+           file://fix-issues-when-USE_OPENSSL-1.patch \
 "
 SRC_URI[md5sum] = "0431fef3067bf503dfb464069f06163a"
 SRC_URI[sha256sum] = "43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf"
@@ -18,6 +21,9 @@
 inherit python-dir pythonnative
 # Recursive make problem
 EXTRA_OEMAKE = "MAKEFLAGS= DESTDIR=${D} LIBDIR=${libdir}/crda LDLIBREG='-Wl,-rpath,${libdir}/crda -lreg'"
+EXTRA_OEMAKE_append = " USE_OPENSSL=1"
+TARGET_BITS = "${SITEINFO_BITS}"
+export TARGET_BITS
 
 do_compile() {
     oe_runmake all_noverify
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb
index 8db6b74..a8c4025 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb
@@ -5,6 +5,7 @@
 HOMEPAGE = "http://www.gnu.org/software/inetutils"
 SECTION = "net"
 DEPENDS = "ncurses netbase readline"
+
 LICENSE = "GPLv3"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7"
@@ -28,6 +29,8 @@
 
 inherit autotools gettext update-alternatives texinfo
 
+acpaths = "-I ./m4"
+
 SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '', 'file://fix-disable-ipv6.patch', d)}"
 
 PACKAGECONFIG ??= "ftp uucpd \
@@ -46,6 +49,8 @@
         --enable-rpath=no \
 "
 
+EXTRA_OECONF_append_libc-musl = " --disable-rsh --disable-rcp --disable-rlogin "
+
 do_configure_prepend () {
     export HELP2MAN='true'
     cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath
@@ -64,9 +69,15 @@
     mv ${D}${libexecdir}/tftpd ${D}${sbindir}/in.tftpd
     mv ${D}${libexecdir}/telnetd ${D}${sbindir}/in.telnetd
     mv ${D}${libexecdir}/rexecd ${D}${sbindir}/in.rexecd
-    mv ${D}${libexecdir}/rlogind ${D}${sbindir}/in.rlogind
-    mv ${D}${libexecdir}/rshd ${D}${sbindir}/in.rshd
-    mv ${D}${libexecdir}/talkd ${D}${sbindir}/in.talkd
+    if [ -e ${D}${libexecdir}/rlogind ]; then
+        mv ${D}${libexecdir}/rlogind ${D}${sbindir}/in.rlogind
+    fi
+    if [ -e ${D}${libexecdir}/rshd ]; then
+        mv ${D}${libexecdir}/rshd ${D}${sbindir}/in.rshd
+    fi
+    if [ -e ${D}${libexecdir}/talkd ]; then
+        mv ${D}${libexecdir}/talkd ${D}${sbindir}/in.talkd
+    fi
     mv ${D}${libexecdir}/uucpd ${D}${sbindir}/in.uucpd
     mv ${D}${libexecdir}/* ${D}${bindir}/
     cp ${WORKDIR}/rexec.xinetd.inetutils  ${D}/${sysconfdir}/xinetd.d/rexec
@@ -76,7 +87,9 @@
     cp ${WORKDIR}/tftpd.xinetd.inetutils  ${D}/${sysconfdir}/xinetd.d/tftpd
 
     sed -e 's,@SBINDIR@,${sbindir},g' -i ${D}/${sysconfdir}/xinetd.d/*
-
+    if [ -e ${D}${libdir}/charset.alias ]; then
+        rm -rf ${D}${libdir}/charset.alias
+    fi
     rm -rf ${D}${libexecdir}/
     # remove usr/lib if empty
     rmdir ${D}${libdir} || true
@@ -98,6 +111,7 @@
 ALTERNATIVE_LINK_NAME[talkd]  = "${sbindir}/in.talkd"
 ALTERNATIVE_LINK_NAME[uucpd]  = "${sbindir}/in.uucpd"
 
+ALTERNATIVE_PRIORITY_${PN}-logger = "60"
 ALTERNATIVE_${PN}-logger = "logger"
 ALTERNATIVE_${PN}-syslogd = "syslogd"
 ALTERNATIVE_LINK_NAME[syslogd]  = "${base_sbindir}/syslogd"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.3.bb
index b0cd399..2878211 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.3.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.3.bb
@@ -14,6 +14,8 @@
 
 inherit autotools gettext pkgconfig
 
+acpaths = "-I ./m4"
+
 EXTRA_OECONF += "--with-modules"
 
 PACKAGECONFIG ??= "libidn openssl zlib gnutls readline expat"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
index 28b6c82..daa3c9f 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
@@ -4,7 +4,7 @@
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=0036c1b155f4e999f3e0a373490b5db9"
 
-SRC_URI = "http://libdnet.googlecode.com/files/libdnet-${PV}.tgz"
+SRC_URI = "${GENTOO_MIRROR}/${BP}.tgz"
 
 SRC_URI[md5sum] = "9253ef6de1b5e28e9c9a62b882e44cc9"
 SRC_URI[sha256sum] = "83b33039787cf99990e977cef7f18a5d5e7aaffc4505548a83d31bd3515eb026"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
new file mode 100644
index 0000000..0ab3436
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Submitted [https://github.com/samba-team/samba/pull/70]
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+From 50eac4fd30944e5e1d83060757633fe0ed572723 Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <obi@opendreambox.org>
+Date: Wed, 30 Nov 2016 16:25:06 +0100
+Subject: [PATCH] packaging: Avoid timeout for nmbd if started offline with
+ systemd
+
+If no network connection appears within DefaultTimeoutStartSec
+(~ 90s) after startup, nmbd fails to notify systemd and will
+therefore get killed.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+---
+ packaging/systemd/nmb.service | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/packaging/systemd/nmb.service b/packaging/systemd/nmb.service
+index 992c0cd..555c9ab 100644
+--- a/packaging/systemd/nmb.service
++++ b/packaging/systemd/nmb.service
+@@ -10,6 +10,7 @@ EnvironmentFile=-/etc/sysconfig/samba
+ ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
+ ExecReload=/usr/bin/kill -HUP $MAINPID
+ LimitCORE=infinity
++TimeoutStartSec=0
+ 
+ [Install]
+ WantedBy=multi-user.target
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch
new file mode 100644
index 0000000..6b9ade9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.2.7-pam.patch
@@ -0,0 +1,36 @@
+Lifted from gentoo and ported to 4.4.5
+
+http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.2.7-pam.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: samba-4.4.5/source3/wscript
+===================================================================
+--- samba-4.4.5.orig/source3/wscript
++++ samba-4.4.5/source3/wscript
+@@ -873,7 +873,7 @@ msg.msg_accrightslen = sizeof(fd);
+         if conf.env.with_iconv:
+             conf.DEFINE('HAVE_ICONV', 1)
+ 
+-    if Options.options.with_pam:
++    if Options.options.with_pam != False:
+         use_pam=True
+         conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
+         if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
+@@ -945,6 +945,15 @@ int i; i = PAM_RADIO_TYPE;
+         if use_pam:
+             conf.DEFINE('WITH_PAM', 1)
+             conf.DEFINE('WITH_PAM_MODULES', 1)
++    else:
++        Logs.warn("PAM disabled")
++        use_pam=False
++        conf.undefine('WITH_PAM')
++        conf.undefine('WITH_PAM_MODULES')
++        conf.undefine('HAVE_SECURITY_PAM_APPL_H')
++        conf.undefine('PAM_RHOST')
++        conf.undefine('PAM_TTY')
++        conf.undefine('HAVE_PAM_PAM_APPL_H')
+ 
+     seteuid = False
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch
new file mode 100644
index 0000000..71db99c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba-4.4.5/samba-4.3.9-remove-getpwent_r.patch
@@ -0,0 +1,87 @@
+Musl does not have _r versions of getent() and getpwent() APIs
+
+Taken from gentoo
+http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.3.9-remove-getpwent_r.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: samba-4.4.5/source4/torture/local/nss_tests.c
+===================================================================
+--- samba-4.4.5.orig/source4/torture/local/nss_tests.c
++++ samba-4.4.5/source4/torture/local/nss_tests.c
+@@ -247,7 +247,6 @@ static bool test_getgrnam_r(struct tortu
+ 	return true;
+ }
+ 
+-
+ static bool test_getgrgid(struct torture_context *tctx,
+ 			  gid_t gid,
+ 			  struct group *grp_p)
+@@ -333,6 +332,7 @@ static bool test_enum_passwd(struct tort
+ 	return true;
+ }
+ 
++#if HAVE_GETPWENT_R
+ static bool test_enum_r_passwd(struct torture_context *tctx,
+ 			       struct passwd **pwd_array_p,
+ 			       size_t *num_pwd_p)
+@@ -381,6 +381,7 @@ static bool test_enum_r_passwd(struct to
+ 
+ 	return true;
+ }
++#endif
+ 
+ static bool torture_assert_passwd_equal(struct torture_context *tctx,
+ 					const struct passwd *p1,
+@@ -432,7 +433,7 @@ static bool test_passwd_r(struct torture
+ 	struct passwd *pwd, pwd1, pwd2;
+ 	size_t num_pwd;
+ 
+-	torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
++	torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
+ 						"failed to enumerate passwd");
+ 
+ 	for (i=0; i < num_pwd; i++) {
+@@ -460,7 +461,7 @@ static bool test_passwd_r_cross(struct t
+ 	struct passwd *pwd, pwd1, pwd2, pwd3, pwd4;
+ 	size_t num_pwd;
+ 
+-	torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
++	torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
+ 						"failed to enumerate passwd");
+ 
+ 	for (i=0; i < num_pwd; i++) {
+@@ -531,6 +532,7 @@ static bool test_enum_group(struct tortu
+ 	return true;
+ }
+ 
++#if HAVE_GETGRENT_R
+ static bool test_enum_r_group(struct torture_context *tctx,
+ 			      struct group **grp_array_p,
+ 			      size_t *num_grp_p)
+@@ -579,6 +581,7 @@ static bool test_enum_r_group(struct tor
+ 
+ 	return true;
+ }
++#endif
+ 
+ static bool torture_assert_group_equal(struct torture_context *tctx,
+ 				       const struct group *g1,
+@@ -635,7 +638,7 @@ static bool test_group_r(struct torture_
+ 	struct group *grp, grp1, grp2;
+ 	size_t num_grp;
+ 
+-	torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
++	torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
+ 					       "failed to enumerate group");
+ 
+ 	for (i=0; i < num_grp; i++) {
+@@ -663,7 +666,7 @@ static bool test_group_r_cross(struct to
+ 	struct group *grp, grp1, grp2, grp3, grp4;
+ 	size_t num_grp;
+ 
+-	torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
++	torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
+ 					       "failed to enumerate group");
+ 
+ 	for (i=0; i < num_grp; i++) {
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb
index e9694d4..c564f73 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.4.5.bb
@@ -17,9 +17,14 @@
            file://16-do-not-check-xsltproc-manpages.patch \
            file://20-do-not-import-target-module-while-cross-compile.patch \
            file://21-add-config-option-without-valgrind.patch \
+           file://0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch \
            file://0006-avoid-using-colon-in-the-checking-msg.patch \
            file://volatiles.03_samba \
           "
+SRC_URI_append_libc-musl = " \
+           file://samba-4.2.7-pam.patch \
+           file://samba-4.3.9-remove-getpwent_r.patch \
+          "
 
 SRC_URI[md5sum] = "6950c5e9f7bdeb8a610c2ca957a15be4"
 SRC_URI[sha256sum] = "b876ef2e63f66265490e80a122e66ef2d7616112b839df68f56ac2e1ce17a7bd"
@@ -29,6 +34,9 @@
 RDEPENDS_${PN}_remove = "perl"
 
 DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb krb5 libbsd libaio libpam"
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
 
 SYSVINITTYPE_linuxstdbase = "lsb"
 SYSVINITTYPE = "sysv"
@@ -43,7 +51,7 @@
 "
 
 RDEPENDS_${PN}-base += "${@bb.utils.contains('PACKAGECONFIG', 'lsb', 'lsb', '', d)}"
-RDEPENDS_${PN}-ctdb-tests += "bash"
+RDEPENDS_${PN}-ctdb-tests += "bash util-linux-getopt"
 
 PACKAGECONFIG[acl] = "--with-acl-support,--without-acl-support,acl"
 PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
@@ -111,6 +119,7 @@
             -e 's,/opt/samba/smb.conf,${sysconfdir}/samba/smb.conf,g' \
             -e 's,/opt/samba/log,${localstatedir}/log/samba,g' \
             -e 's,/etc/init.d/samba.server,${sysconfdir}/init.d/samba.sh,g' \
+            -e 's,/usr/bin,${base_bindir},g' \
             -i ${D}${sysconfdir}/init.d/samba.sh
     fi
 
@@ -122,12 +131,27 @@
     install -d ${D}${sysconfdir}/sysconfig/
     install -m644 packaging/systemd/samba.sysconfig ${D}${sysconfdir}/sysconfig/samba
 
+    # install ctdb config file and test cases
+    install -D -m 0644 ${S}/ctdb/tests/onnode/nodes ${D}${sysconfdir}/ctdb/nodes
+    # the items are from ctdb/tests/run_tests.sh
+    for d in onnode takeover tool eventscripts cunit simple complex; do
+        testdir=${D}${datadir}/ctdb-tests/$d
+        install -d $testdir
+        cp ${S}/ctdb/tests/$d/*.sh $testdir
+        cp -r ${S}/ctdb/tests/$d/scripts ${S}/ctdb/tests/$d/stubs $testdir || true
+    done
+
+    # fix file-rdeps qa warning
+    if [ -f ${D}${bindir}/onnode ]; then
+        sed -i 's:\(#!/bin/\)bash:\1sh:' ${D}${bindir}/onnode
+    fi
+
     rm -rf ${D}/run ${D}${localstatedir}/run ${D}${localstatedir}/log
 }
 
 PACKAGES =+ "${PN}-python ${PN}-python-dbg ${PN}-pidl libwinbind libwinbind-dbg libwinbind-krb5-locator"
 PACKAGES =+ "libwbclient libnss-winbind winbind winbind-dbg libnetapi libsmbsharemodes \
-             libsmbclient libsmbclient-dev lib${PN}-base ${PN}-base ${PN}-ctdb-tests"
+             libsmbclient libsmbclient-dev lib${BPN}-base ${PN}-base ${PN}-ctdb-tests"
 
 RDEPENDS_${PN} += "${PN}-base"
 
@@ -140,6 +164,8 @@
 "
 
 FILES_${PN}-ctdb-tests = "${bindir}/ctdb_run_tests \
+                          ${bindir}/ctdb_run_cluster_tests \
+                          ${sysconfdir}/ctdb/nodes \
                           ${libdir}/ctdb-tests \
                           ${datadir}/ctdb-tests \
                           /run/ctdb \
@@ -163,7 +189,7 @@
 #     echo $l
 # done
 
-FILES_lib${PN}-base = "\
+FILES_lib${BPN}-base = "\
                     ${sysconfdir}/default \
                     ${sysconfdir}/samba \
                     ${libdir}/libdcerpc-binding.so.* \