summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-networking/recipes-daemons
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-networking/recipes-daemons')
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0001-argz.h-fix-musl-compile-add-missing-defines.patch45
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch43
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/atftpd.service10
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/atftp_git.bb64
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch94
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch163
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch152
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd.init37
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch48
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/add-the-needed-stdarg.h.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-do-not-check-for-modprobe.patch89
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-fix-lib-deps.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/cross.patch53
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix-the-YACC-rule-to-fix-a-building-failure.patch63
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch47
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/force-STRIP-to-emtpy.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/no-bash.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/remove-bashism.patch118
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb77
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch46
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff14
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff27
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf11
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb96
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.conf.sample21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.init94
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.service12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy/0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb16
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-Respect-flags-from-env.patch56
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-link-with-libtirpc.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch58
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-musl-fixes.patch283
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/always_syslog.patch22
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool.service19
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_init.d.patch65
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_parallel_make_and_pic.patch89
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_usl_timer.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/makefile-add-ldflags.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/runtest.sh26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool_1.3.bb113
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils2
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian119
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator4
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service15
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service13
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.876.bb117
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/keepalived/keepalived_1.4.2.bb48
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.default2
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.init.d128
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/lldpd/files/src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.8.bb65
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/ncftp-configure-use-BUILD_CC-for-ccdv.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/unistd.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp_3.2.6.bb35
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-Fix-build-failures-with-gcc7.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-ipmidirect-Replace-__STRING.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch47
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/c++11.patch12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch1288
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/fix-narrowing-warning.patch20
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch23
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch24
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch48
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch23
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch28
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init230
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service11
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest5
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb115
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch123
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch122
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb67
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch64
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/postfix/files/aliasesdb20
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/postfix/files/check_hostname.sh13
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/icu-config.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/install.patch93
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/internal_recipient1
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/main.cf105
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/makedefs.patch116
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix94
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix-install.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix.service16
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc262
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb9
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/build_fixup.patch112
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/contrib.patch42
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/default9
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init220
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd.service12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb138
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd-use-pkgconfig.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.conf7
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.service10
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb58
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.42.bb22
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.default1
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.init135
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd2
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/radvd.inc67
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/radvd_2.17.bb5
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch46
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-configure-Check-for-Wno-error-format-truncation-comp.patch118
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch65
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/gcc7-fixes.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/run-ptest3
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/set_sysroot_patch.patch41
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-don-t-do-squid-conf-tests-at-build-time.patch61
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/volatiles.03_squid3
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.26.bb114
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch62
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch81
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/default3
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/init105
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch60
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch165
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch24
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch20
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch38
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd18
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service10
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket8
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb91
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch16
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf2
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init193
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade1
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/vblade_22.bb51
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch62
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/vsftpd/files/init50
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd1
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf139
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers15
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service9
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list20
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch43
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch52
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch16
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch89
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb112
192 files changed, 10510 insertions, 0 deletions
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0001-argz.h-fix-musl-compile-add-missing-defines.patch b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0001-argz.h-fix-musl-compile-add-missing-defines.patch
new file mode 100644
index 000000000..cfa8a7325
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0001-argz.h-fix-musl-compile-add-missing-defines.patch
@@ -0,0 +1,45 @@
+From 543e67919f5cacf309ac88ab091331e41af4224b Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Thu, 16 Apr 2015 22:41:57 +0200
+Subject: [PATCH] argz.h: fix musl compile (add missing defines)
+
+Upstream-Status: Pending
+
+Add __THROW, __BEGIN_DECLS, __END_DECLS and __attribute_pure__ defines.
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
+---
+ argz.h | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/argz.h b/argz.h
+index 582be55..bdf9f62 100644
+--- a/argz.h
++++ b/argz.h
+@@ -48,6 +48,22 @@
+ # define __const const
+ #endif
+
++#ifndef __THROW
++# define __THROW
++#endif
++
++#ifndef __BEGIN_DECLS
++# define __BEGIN_DECLS
++#endif
++
++#ifndef __END_DECLS
++# define __END_DECLS
++#endif
++
++#ifndef __attribute_pure__
++# define __attribute_pure__
++#endif
++
+ #ifndef __error_t_defined
+ typedef int error_t;
+ #endif
+--
+2.1.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch
new file mode 100644
index 000000000..093054ce8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch
@@ -0,0 +1,43 @@
+From 77e399899d9d7297d23c321811b628febdf0fd92 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Thu, 16 Apr 2015 22:43:49 +0200
+Subject: [PATCH] tftp.h/tftpd.h: fix musl compile (missing include)
+
+Upstream-Status: Pending
+
+Add sys/types.h include for u_char typedef.
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
+---
+ tftp.h | 1 +
+ tftpd.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/tftp.h b/tftp.h
+index 12bd6aa..32a3f63 100644
+--- a/tftp.h
++++ b/tftp.h
+@@ -19,6 +19,7 @@
+
+ #include <sys/time.h>
+ #include <sys/times.h>
++#include <sys/types.h>
+ #include "tftp_def.h"
+ #include "config.h"
+
+diff --git a/tftpd.h b/tftpd.h
+index 945065e..60d3a49 100644
+--- a/tftpd.h
++++ b/tftpd.h
+@@ -20,6 +20,7 @@
+ #include <pthread.h>
+ #include <arpa/tftp.h>
+ #include <arpa/inet.h>
++#include <sys/types.h>
+ #include "tftp_io.h"
+
+ /*
+--
+2.1.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/atftpd.service b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/atftpd.service
new file mode 100644
index 000000000..480bc702e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/atftpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Advanced TFTP Server
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/atftpd --daemon --port 69
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp_git.bb b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp_git.bb
new file mode 100644
index 000000000..a9949d59a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp_git.bb
@@ -0,0 +1,64 @@
+SUMMARY = "Advanced TFTP server and client"
+SECTION = "net"
+HOMEPAGE = "http://packages.debian.org/atftp"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f"
+PV = "0.7.1+git${SRCPV}"
+PR = "r3"
+
+SRCREV = "be3291a18c069ae23a124ffdc56d64a5ff0bbec7"
+
+SRC_URI = "git://git.code.sf.net/p/atftp/code \
+ file://atftpd-0.7_circumvent_tftp_size_restrictions.patch \
+ file://atftpd-0.7_unprotected_assignments_crash.patch \
+ file://atftpd.init \
+ file://atftpd.service \
+ file://atftp-0.7-sorcerers_apprentice.patch \
+"
+SRC_URI_append_libc-musl = " file://0001-argz.h-fix-musl-compile-add-missing-defines.patch \
+ file://0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools update-rc.d systemd
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[pcre] = "--enable-libpcre,--disable-libpcre,libpcre"
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+PACKAGECONFIG[readline] = "--enable-libreadline,--disable-libreadline,readline"
+
+INITSCRIPT_PACKAGES = "${PN}d"
+INITSCRIPT_NAME_${PN}d = "atftpd"
+INITSCRIPT_PARAMS_${PN}d = "defaults 80"
+
+
+EXTRA_OEMAKE = "CFLAGS='${CFLAGS} -std=gnu89'"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/atftpd.init ${D}${sysconfdir}/init.d/atftpd
+
+ install -d ${D}/srv/tftp
+
+ rm ${D}${sbindir}/in.tftpd
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/atftpd.service ${D}${systemd_unitdir}/system
+}
+
+PACKAGES =+ "${PN}d"
+
+FILES_${PN} = "${bindir}/*"
+
+FILES_${PN}d = "${sbindir}/* \
+ ${sysconfdir} \
+ /srv/tftp \
+ ${systemd_unitdir}/system/atftpd.service \
+"
+
+SYSTEMD_PACKAGES = "${PN}d"
+SYSTEMD_SERVICE_${PN}d = "atftpd.service"
+RPROVIDES_${PN}d += "${PN}d-systemd"
+RREPLACES_${PN}d += "${PN}d-systemd"
+RCONFLICTS_${PN}d += "${PN}d-systemd"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch
new file mode 100644
index 000000000..fc64291cd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch
@@ -0,0 +1,94 @@
+atftp exhibits the well known "Sorcerer's Apprentice Syndrome"(SAS) problem.
+According to RFC 1350, the fix to SAS is quite simple: further copies of the
+acknowledgment for a particular data block would be ignored.
+
+Patch originally from OpenSUSE:
+https://build.opensuse.org/package/view_file?file=atftp-0.7-sorcerers_apprentice.patch&package=atftp.539&project=openSUSE%3A12.1%3AUpdate&rev=84569792975e00573d7df597d2a6e895
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+Index: atftp-0.7/tftp_file.c
+===================================================================
+--- atftp-0.7.orig/tftp_file.c 2011-11-22 15:12:53.792744083 +0100
++++ atftp-0.7/tftp_file.c 2011-11-22 15:13:51.706421893 +0100
+@@ -605,6 +605,7 @@
+ int timeout_state = state; /* what state should we go on when timeout */
+ int result;
+ long block_number = 0;
++ long last_requested_block = -1;
+ long last_block = -1;
+ int data_size; /* size of data received */
+ int sockfd = data->sockfd; /* just to simplify calls */
+@@ -765,6 +766,17 @@
+ connected = 1;
+ }
+ block_number = ntohs(tftphdr->th_block);
++
++ if (last_requested_block >= block_number)
++ {
++ if (data->trace)
++ fprintf(stderr, "received duplicated ACK <block: %ld >= %ld>\n",
++ last_requested_block, block_number);
++ break;
++ }
++ else
++ last_requested_block = block_number;
++
+ if (data->trace)
+ fprintf(stderr, "received ACK <block: %ld>\n",
+ block_number);
+Index: atftp-0.7/tftpd_file.c
+===================================================================
+--- atftp-0.7.orig/tftpd_file.c 2011-11-22 15:12:53.793744112 +0100
++++ atftp-0.7/tftpd_file.c 2011-11-22 15:15:04.617534260 +0100
+@@ -403,6 +403,7 @@
+ int timeout_state = state;
+ int result;
+ long block_number = 0;
++ long last_requested_block = -1;
+ long last_block = -1;
+ int block_loops = 0;
+ int data_size;
+@@ -859,6 +860,32 @@
+ {
+ logger(LOG_DEBUG, "received ACK <block: %d>", block_number);
+ }
++
++ /* check whether the block request isn't already fulfilled */
++
++ /* multicast, block numbers could contain gaps */
++ if (multicast) {
++ if (last_requested_block >= block_number)
++ {
++ if (data->trace)
++ logger(LOG_DEBUG, "received duplicated ACK <block: %d >= %d>", last_requested_block, block_number);
++ break;
++ }
++ else
++ last_requested_block = block_number;
++ /* unicast, blocks should be requested one after another */
++ } else {
++ if (last_requested_block + 1 != block_number && last_requested_block != -1)
++ {
++ if (data->trace)
++ logger(LOG_DEBUG, "received out of order ACK <block: %d != %d>", last_requested_block + 1, block_number);
++ break;
++ }
++ else
++ last_requested_block = block_number;
++ }
++
++
+ if (ntohs(tftphdr->th_block) == 65535)
+ {
+ block_loops++;
+@@ -958,6 +985,8 @@
+ /* nedd to send an oack to that client */
+ state = S_SEND_OACK;
+ fseek(fp, 0, SEEK_SET);
++ /* reset the last block received counter */
++ last_requested_block = -1;
+ }
+ else
+ {
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch
new file mode 100644
index 000000000..280b570b2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch
@@ -0,0 +1,163 @@
+Fate #303031: Circumvent TFTP size restrictions in atftpd
+The size of a single image file that can be transferred with TFTP is limited to
+2^(2*8) *BLOCKSIZE (as per RFC 1350 there are only two bytes for the block
+counter). This is problematic for one of our customers who needs to transfer
+100+ MB Windows images using a TFTP client (NT bootloader) which has a
+hardwared BLOCKSIZE setting of 1432).
+
+block rollover
+http://www.compuphase.com/tftp.htm
+
+Patch originally from OpenSUSE:
+https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2
+
+Upstream-Status: Pending
+
+Index: git/tftp_def.h
+===================================================================
+--- git.orig/tftp_def.h 2012-11-19 16:28:50.221027144 -0800
++++ git/tftp_def.h 2012-11-20 17:40:54.391206979 -0800
+@@ -32,6 +32,7 @@
+ #define TIMEOUT 5 /* Client timeout */
+ #define S_TIMEOUT 5 /* Server timout. */
+ #define NB_OF_RETRY 5
++#define MAXBLOCKS 1000000 /* maximum number of blocks in a download */
+
+ /* definition to use tftp_options structure */
+ #define OPT_FILENAME 0
+Index: git/tftp_file.c
+===================================================================
+--- git.orig/tftp_file.c 2012-11-19 16:28:50.221027144 -0800
++++ git/tftp_file.c 2012-11-19 16:28:51.201027167 -0800
+@@ -622,8 +622,8 @@
+ int state = S_SEND_REQ; /* current state in the state machine */
+ int timeout_state = state; /* what state should we go on when timeout */
+ int result;
+- int block_number = 0;
+- int last_block = -1;
++ long block_number = 0;
++ long last_block = -1;
+ int data_size; /* size of data received */
+ int sockfd = data->sockfd; /* just to simplify calls */
+ struct sockaddr_storage sa; /* a copy of data.sa_peer */
+@@ -637,8 +637,8 @@
+ int convert = 0; /* if true, do netascii convertion */
+ char string[MAXLEN];
+
+- int prev_block_number = 0; /* needed to support netascii convertion */
+- int prev_file_pos = 0;
++ long prev_block_number = 0; /* needed to support netascii convertion */
++ long prev_file_pos = 0;
+ int temp = 0;
+
+ data->file_size = 0;
+@@ -745,7 +745,7 @@
+ data_size, data->data_buffer);
+ data->file_size += data_size;
+ if (data->trace)
+- fprintf(stderr, "sent DATA <block: %d, size: %d>\n",
++ fprintf(stderr, "sent DATA <block: %ld, size: %d>\n",
+ block_number + 1, data_size - 4);
+ state = S_WAIT_PACKET;
+ break;
+@@ -785,7 +785,7 @@
+ }
+ block_number = ntohs(tftphdr->th_block);
+ if (data->trace)
+- fprintf(stderr, "received ACK <block: %d>\n",
++ fprintf(stderr, "received ACK <block: %ld>\n",
+ block_number);
+ if ((last_block != -1) && (block_number > last_block))
+ {
+Index: git/tftp_io.c
+===================================================================
+--- git.orig/tftp_io.c 2012-11-19 16:28:50.221027144 -0800
++++ git/tftp_io.c 2012-11-19 16:28:51.201027167 -0800
+@@ -350,8 +350,8 @@
+ /*
+ * Read from file and do netascii conversion if needed
+ */
+-int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, int block_number,
+- int convert, int *prev_block_number, int *prev_file_pos, int *temp)
++int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, long block_number,
++ int convert, long *prev_block_number, long *prev_file_pos, int *temp)
+ {
+ int i;
+ int c;
+Index: git/tftp_io.h
+===================================================================
+--- git.orig/tftp_io.h 2012-11-19 16:28:50.221027144 -0800
++++ git/tftp_io.h 2012-11-19 16:28:51.201027167 -0800
+@@ -52,8 +52,8 @@
+ int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa,
+ struct sockaddr_storage *from, struct sockaddr_storage *to,
+ int timeout, int *size, char *data);
+-int tftp_file_read(FILE *fp, char *buffer, int buffer_size, int block_number, int convert,
+- int *prev_block_number, int *prev_file_pos, int *temp);
++int tftp_file_read(FILE *fp, char *buffer, int buffer_size, long block_number, int convert,
++ long *prev_block_number, long *prev_file_pos, int *temp);
+ int tftp_file_write(FILE *fp, char *data_buffer, int data_buffer_size, int block_number,
+ int data_size, int convert, int *prev_block_number, int *temp);
+ #endif
+Index: git/tftpd_file.c
+===================================================================
+--- git.orig/tftpd_file.c 2012-11-19 16:28:50.225027144 -0800
++++ git/tftpd_file.c 2012-11-19 16:28:51.201027167 -0800
+@@ -407,8 +407,9 @@
+ int state = S_BEGIN;
+ int timeout_state = state;
+ int result;
+- int block_number = 0;
+- int last_block = -1;
++ long block_number = 0;
++ long last_block = -1;
++ int block_loops = 0;
+ int data_size;
+ struct sockaddr_storage *sa = &data->client_info->client;
+ struct sockaddr_storage from;
+@@ -431,8 +432,8 @@
+ struct client_info *client_old = NULL;
+ struct tftp_opt options[OPT_NUMBER];
+
+- int prev_block_number = 0; /* needed to support netascii convertion */
+- int prev_file_pos = 0;
++ long prev_block_number = 0; /* needed to support netascii convertion */
++ long prev_file_pos = 0;
+ int temp = 0;
+
+ /* look for mode option */
+@@ -565,11 +566,12 @@
+ logger(LOG_INFO, "blksize option -> %d", result);
+ }
+
+- /* Verify that the file can be sent in 2^16 block of BLKSIZE octets */
+- if ((file_stat.st_size / (data->data_buffer_size - 4)) > 65535)
++ /* Verify that the file can be sent in MAXBLOCKS blocks of BLKSIZE octets */
++ if ((file_stat.st_size / (data->data_buffer_size - 4)) > MAXBLOCKS)
+ {
+ tftp_send_error(sockfd, sa, EUNDEF, data->data_buffer, data->data_buffer_size);
+- logger(LOG_NOTICE, "Requested file to big, increase BLKSIZE");
++ logger(LOG_NOTICE, "Requested file too big, increase BLKSIZE");
++ logger(LOG_NOTICE, "Only %d blocks of %d bytes can be served.", MAXBLOCKS, data->data_buffer_size);
+ if (data->trace)
+ logger(LOG_DEBUG, "sent ERROR <code: %d, msg: %s>", EUNDEF,
+ tftp_errmsg[EUNDEF]);
+@@ -880,10 +882,15 @@
+ }
+ /* The ACK is from the current client */
+ number_of_timeout = 0;
+- block_number = ntohs(tftphdr->th_block);
++ block_number = (block_loops * 65536) + ntohs(tftphdr->th_block);
+ if (data->trace)
+- logger(LOG_DEBUG, "received ACK <block: %d>",
+- block_number);
++ {
++ logger(LOG_DEBUG, "received ACK <block: %d>", block_number);
++ }
++ if (ntohs(tftphdr->th_block) == 65535)
++ {
++ block_loops++;
++ };
+ if ((last_block != -1) && (block_number > last_block))
+ {
+ state = S_END;
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch
new file mode 100644
index 000000000..28fba6cf5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch
@@ -0,0 +1,152 @@
+Avoid assigning thread data outside of mutex lock
+
+Patch originally from OpenSUSE:
+https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2
+
+Upstream-Status: Pending
+
+Index: git/tftpd_list.c
+===================================================================
+--- git.orig/tftpd_list.c 2012-10-24 21:48:47.000000000 -0700
++++ git/tftpd_list.c 2012-10-24 21:52:04.266205076 -0700
+@@ -49,11 +49,11 @@
+ */
+ int tftpd_list_add(struct thread_data *new)
+ {
+- struct thread_data *current = thread_data;
++ struct thread_data *current;
+ int ret;
+
+ pthread_mutex_lock(&thread_list_mutex);
+-
++ current = thread_data;
+ number_of_thread++;
+
+ ret = number_of_thread;
+@@ -81,11 +81,13 @@
+ */
+ int tftpd_list_remove(struct thread_data *old)
+ {
+- struct thread_data *current = thread_data;
++ struct thread_data *current;
+ int ret;
+
+ pthread_mutex_lock(&thread_list_mutex);
+
++ current = thread_data;
++
+ number_of_thread--;
+ ret = number_of_thread;
+
+@@ -137,23 +139,26 @@
+ struct thread_data *data,
+ struct client_info *client)
+ {
+- struct thread_data *current = thread_data; /* head of the list */
+- struct tftp_opt *tftp_options = data->tftp_options;
++ struct thread_data *current; /* head of the list */
++ struct tftp_opt *tftp_options;
+ struct client_info *tmp;
+ char options[MAXLEN];
+ char string[MAXLEN];
+ char *index;
+ int len;
+
++ /* lock the whole list before walking it */
++ pthread_mutex_lock(&thread_list_mutex);
++
+ *thread = NULL;
+
++ current = thread_data;
++ tftp_options = data->tftp_options;
++
+ opt_request_to_string(tftp_options, options, MAXLEN);
+ index = strstr(options, "multicast");
+ len = (int)index - (int)options;
+
+- /* lock the whole list before walking it */
+- pthread_mutex_lock(&thread_list_mutex);
+-
+ while (current)
+ {
+ if (current != data)
+@@ -214,9 +219,10 @@
+ void tftpd_clientlist_remove(struct thread_data *thread,
+ struct client_info *client)
+ {
+- struct client_info *tmp = thread->client_info;
++ struct client_info *tmp;
+
+ pthread_mutex_lock(&thread->client_mutex);
++ tmp = thread->client_info;
+ while ((tmp->next != client) && (tmp->next != NULL))
+ tmp = tmp->next;
+ if (tmp->next == NULL)
+@@ -231,9 +237,11 @@
+ void tftpd_clientlist_free(struct thread_data *thread)
+ {
+ struct client_info *tmp;
+- struct client_info *head = thread->client_info;
++ struct client_info *head;
+
+ pthread_mutex_lock(&thread->client_mutex);
++ head = thread->client_info;
++
+ while (head)
+ {
+ tmp = head;
+@@ -250,9 +258,10 @@
+ struct client_info *client,
+ struct sockaddr_storage *sock)
+ {
+- struct client_info *head = thread->client_info;
++ struct client_info *head;
+
+ pthread_mutex_lock(&thread->client_mutex);
++ head = thread->client_info;
+
+ if (client)
+ {
+@@ -334,10 +343,10 @@
+
+ void tftpd_list_kill_threads(void)
+ {
+- struct thread_data *current = thread_data; /* head of list */
++ struct thread_data *current; /* head of list */
+
+ pthread_mutex_lock(&thread_list_mutex);
+-
++ current = thread_data;
+
+ while (current != NULL)
+ {
+Index: git/tftpd_mcast.c
+===================================================================
+--- git.orig/tftpd_mcast.c 2012-10-24 21:48:47.000000000 -0700
++++ git/tftpd_mcast.c 2012-10-24 21:49:11.570201582 -0700
+@@ -51,9 +51,11 @@
+ */
+ int tftpd_mcast_get_tid(char **addr, short *port)
+ {
+- struct tid *current = tid_list;
++ struct tid *current;
+
+ pthread_mutex_lock(&mcast_tid_list);
++ current = tid_list;
++
+ /* walk the list for a free tid */
+ while (current != NULL)
+ {
+@@ -74,9 +76,11 @@
+
+ int tftpd_mcast_free_tid(char *addr, short port)
+ {
+- struct tid *current = tid_list;
++ struct tid *current;
+
+ pthread_mutex_lock(&mcast_tid_list);
++ current = tid_list;
++
+ while (current != NULL)
+ {
+ if ((current->used == 1) && (current->port == port) &&
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd.init b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd.init
new file mode 100644
index 000000000..161d97aca
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd.init
@@ -0,0 +1,37 @@
+#! /bin/sh
+#
+# This is an init script for openembedded
+# Copy it to /etc/init.d/atftpd and type
+# > update-rc.d atftpd defaults 60
+#
+
+
+test -f /usr/sbin/atftpd || exit 0
+
+test -d /srv/tftp || mkdir -p /srv/tftp
+
+case "$1" in
+ start)
+ echo -n "Starting tftp daemon: atftpd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/atftpd -- --daemon --port 69
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping tftp daemon: atftpd"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/atftpd
+ echo "."
+ ;;
+ reload|force-reload)
+ start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/atftpd
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/atftpd {start|stop|reload|restart|force-reload}"
+ exit 1
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch
new file mode 100644
index 000000000..87159718b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch
@@ -0,0 +1,48 @@
+From 987c8f4a718cdd6b764592ba7510090a59623959 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 19:10:57 -0700
+Subject: [PATCH] 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 <raj.khem@gmail.com>
+
+---
+ include/automount.h | 8 ++++++++
+ include/nsswitch.h | 3 +++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/include/automount.h b/include/automount.h
+index cc336ad..8bdcf12 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 d3e4027..7a0c38f 100644
+--- a/include/nsswitch.h
++++ b/include/nsswitch.h
+@@ -24,6 +24,9 @@
+ #include <netdb.h>
+ #include "list.h"
+
++#ifndef _PATH_NSSWITCH_CONF
++#define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
++#endif
+ #define NSSWITCH_FILE _PATH_NSSWITCH_CONF
+
+ enum nsswitch_status {
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch
new file mode 100644
index 000000000..32293dd09
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch
@@ -0,0 +1,27 @@
+From 745e355ac8b595a27e1fcca75bf01d3e244f4a5f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Sep 2017 22:22:31 -0700
+Subject: [PATCH] modules/lookup_multi.c: Replace __S_IEXEC with S_IEXEC
+
+__S_IEXEC is internal to libc and may not be available on
+all libc e.g. musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ modules/lookup_multi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/lookup_multi.c b/modules/lookup_multi.c
+index 3ecda6d..cf109de 100644
+--- a/modules/lookup_multi.c
++++ b/modules/lookup_multi.c
+@@ -452,7 +452,7 @@ int lookup_reinit(const char *my_mapfmt,
+ continue;
+ }
+
+- if (st.st_mode & __S_IEXEC)
++ if (st.st_mode & S_IEXEC)
+ type = src_prog;
+ else
+ type = src_file;
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch
new file mode 100644
index 000000000..469027aac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch
@@ -0,0 +1,49 @@
+From 557ca399f4b3a397f20bb147ec6dc4ab9732dd1e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 19:12:10 -0700
+Subject: [PATCH] Replace __S_IEXEC with S_IEXEC
+
+S_IEXEC is portable
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ 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 201ccbb..d821db8 100644
+--- a/daemon/lookup.c
++++ b/daemon/lookup.c
+@@ -366,7 +366,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;
+@@ -856,7 +856,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 fadd2ea..3ecda6d 100644
+--- a/modules/lookup_multi.c
++++ b/modules/lookup_multi.c
+@@ -247,7 +247,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;
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/add-the-needed-stdarg.h.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/add-the-needed-stdarg.h.patch
new file mode 100644
index 000000000..816a409cd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/add-the-needed-stdarg.h.patch
@@ -0,0 +1,25 @@
+From df5d45b2d7ad7e7b5f0542a816d08b0409a529a1 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Tue, 19 Aug 2014 11:31:35 +0800
+Subject: [PATCH] [PATCH] add the needed stdarg.h
+
+Upstream-status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ lib/defaults.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/defaults.c b/lib/defaults.c
+index 0e48a78..667f35d 100644
+--- a/lib/defaults.c
++++ b/lib/defaults.c
+@@ -16,6 +16,7 @@
+
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <stdarg.h>
+ #include <ctype.h>
+ #include <string.h>
+ #include <sys/utsname.h>
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-do-not-check-for-modprobe.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-do-not-check-for-modprobe.patch
new file mode 100644
index 000000000..1d5c3e1ee
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-do-not-check-for-modprobe.patch
@@ -0,0 +1,89 @@
+From 2cbc576ea1fbd1cbf4579d64b30e41d762084e7f Mon Sep 17 00:00:00 2001
+From: "yanjun.zhu" <yanjun.zhu@windriver.com>
+Date: Tue, 15 Jan 2013 12:45:44 +0800
+Subject: [PATCH] autofs: do not check for modprobe
+
+Description: Loading autofs module is #ifdef'ed in the source, so
+ there is no need to check for /proc (which is only used
+ to load module) or modprobe. Both modprobe and /proc
+ are always in the fixed location so there's no need to
+ check for these to start with.
+
+Upstream-Status: Backport [1]
+[1] http://www.spinics.net/lists/autofs/msg00139.html
+
+---
+ configure.in | 6 ------
+ daemon/module.c | 3 +++
+ include/automount.h | 11 +++--------
+ 3 files changed, 6 insertions(+), 14 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 44a1c8b..b226236 100644
+--- a/configure.in
++++ b/configure.in
+@@ -34,11 +34,6 @@ AC_MSG_CHECKING([for binaries in])
+ AC_MSG_RESULT([$searchpath])
+
+ #
+-# Make sure we have "/proc"
+-#
+-AF_LINUX_PROCFS()
+-
+-#
+ # Location of init.d directory?
+ #
+ AF_INIT_D()
+@@ -142,7 +137,6 @@ AF_PATH_INCLUDE(UMOUNT, umount, /bin/umount, $searchpath)
+ AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath)
+ AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath)
+ AF_PATH_INCLUDE(E4FSCK, fsck.ext4 e4fsck, , $searchpath)
+-AF_PATH_INCLUDE(MODPROBE, modprobe, , $searchpath)
+
+ AF_CHECK_PROG(LEX, flex lex, , $searchpath)
+ AF_CHECK_PROG(YACC, bison, , $searchpath)
+diff --git a/daemon/module.c b/daemon/module.c
+index bed8f7a..e41a98e 100644
+--- a/daemon/module.c
++++ b/daemon/module.c
+@@ -19,6 +19,8 @@
+ #include "automount.h"
+ #include "nsswitch.h"
+
++#if 0
++/* see comment in daemon/automount.c around load_autofs4_module() call */
+ int load_autofs4_module(void)
+ {
+ FILE *fp;
+@@ -53,6 +55,7 @@ int load_autofs4_module(void)
+
+ return 1;
+ }
++#endif
+
+ int open_lookup(const char *name, const char *err_prefix, const char *mapfmt,
+ int argc, const char *const *argv, struct lookup_mod **lookup)
+diff --git a/include/automount.h b/include/automount.h
+index c0f5fbf..cc336ad 100644
+--- a/include/automount.h
++++ b/include/automount.h
+@@ -51,16 +51,11 @@
+ #error Failed to locate umount(8)!
+ #endif
+
+-#ifndef HAVE_MODPROBE
+-#error Failed to locate modprobe(8)!
+-#endif
+-
+-#ifndef HAVE_LINUX_PROCFS
+-#error Failed to verify existence of procfs filesystem!
+-#endif
+-
++#if 0
++/* see comment in daemon/automount.c around load_autofs4_module() call */
+ #define FS_MODULE_NAME "autofs4"
+ int load_autofs4_module(void);
++#endif
+
+ /* The -s (sloppy) option to mount is good, if we have it... */
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-fix-lib-deps.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-fix-lib-deps.patch
new file mode 100644
index 000000000..8e06db6e4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-fix-lib-deps.patch
@@ -0,0 +1,26 @@
+From 080626108c9ab70e2489752ef2a14006d0564b0c Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe.macdonald@windriver.com>
+Date: Tue, 18 Jun 2013 10:05:21 -0400
+Subject: [PATCH] Fix the dependency issue
+
+Upstream-Status: Pending
+
+autofs's lib sources have a dependency on a number of files that are
+generated by rpcgen during buildtime
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
+
+---
+ lib/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 518b483..4798a4b 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -81,3 +81,4 @@ install: all
+ clean:
+ rm -f $(LIB) $(RPCS) $(OBJS) $(YACCSRC) *.output *~
+
++$(OBJS): $(RPCS)
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch
new file mode 100644
index 000000000..9b0942ebf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch
@@ -0,0 +1,30 @@
+From 2256b8aa98cff15ddf2a8d36496e6c9125927901 Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <obi@opendreambox.org>
+Date: Wed, 13 Mar 2013 16:17:08 +0100
+Subject: [PATCH] autofs-5.0.7: include linux/nfs.h directly in rpc_subs.h
+
+Upstream-Status: Pending
+
+Fixes compile error with uclibc. Glibc's nfs/nfs.h contains
+nothing but "#include linux/nfs.h". rpc_subs.h already includes
+other linux/nfs*.h files directly.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+---
+ include/rpc_subs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/rpc_subs.h b/include/rpc_subs.h
+index e744e89..83db47e 100644
+--- a/include/rpc_subs.h
++++ b/include/rpc_subs.h
+@@ -18,7 +18,7 @@
+
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_prot.h>
+-#include <nfs/nfs.h>
++#include <linux/nfs.h>
+ #include <linux/nfs2.h>
+ #include <linux/nfs3.h>
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch
new file mode 100644
index 000000000..18ce19385
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch
@@ -0,0 +1,39 @@
+From b31decac4acb194b020c621d2d11019f636a45e0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 24 Apr 2017 20:41:25 -0700
+Subject: [PATCH] autofs: Upgrade to 5.1.2 release
+
+Make configure compatible with -Wl,--as-needed following
+https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Failure_in_..2Fconfigure
+
+2016-07-05 Martin von Gagern
+
+---
+ aclocal.m4 | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 0e4a624..2e620cd 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -415,9 +415,9 @@ AC_DEFUN([AF_CHECK_LIBTIRPC],
+ [
+ # save current flags
+ af_check_libtirpc_save_cflags="$CFLAGS"
+-af_check_libtirpc_save_ldflags="$LDFLAGS"
++af_check_libtirpc_save_libs="$LIBS"
+ CFLAGS="$CFLAGS -I=/usr/include/tirpc"
+-LDFLAGS="$LDFLAGS -ltirpc"
++LIBS="$LIBS -ltirpc"
+
+ AC_TRY_LINK(
+ [ #include <rpc/rpc.h> ],
+@@ -440,7 +440,7 @@ AC_CHECK_FUNCS([getrpcbyname getservbyname])
+
+ # restore flags
+ CFLAGS="$af_check_libtirpc_save_cflags"
+-LDFLAGS="$af_check_libtirpc_save_ldflags"
++LIBS="$af_check_libtirpc_save_libs"
+ ])
+
+ AC_DEFUN([AF_WITH_LIBTIRPC],
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/cross.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/cross.patch
new file mode 100644
index 000000000..b25c43f74
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/cross.patch
@@ -0,0 +1,53 @@
+From b9b44cd82caceeb638cc6a862b5bb90b93ad6c6a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Jan 2013 19:53:10 -0800
+
+---
+ aclocal.m4 | 2 ++
+ configure.in | 8 ++++++--
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 2115204..2a9a802 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -7,6 +7,8 @@ dnl --------------------------------------------------------------------------
+ AC_DEFUN(AF_PATH_INCLUDE,
+ [AC_PATH_PROGS($1,$2,$3,$4)
+ if test -n "$$1"; then
++ AH_TEMPLATE([HAVE_$1], [Have $2])
++ AH_TEMPLATE([PATH_$1], [Have $2])
+ AC_DEFINE(HAVE_$1,1,[define if you have $1])
+ AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1])
+ HAVE_$1=1
+diff --git a/configure.in b/configure.in
+index 25d7c4e..44a1c8b 100644
+--- a/configure.in
++++ b/configure.in
+@@ -324,13 +324,15 @@ AC_PROG_CC
+ cat > pietest.c <<EOF
+ int main(void) { return 0; }
+ EOF
++AF_tmp_ldflags="$LDFLAGS"
++AF_tmp_cflags="$CFLAGS"
+ CFLAGS=-fPIE
+ LDFLAGS=-pie
+ DAEMON_CFLAGS=
+ DAEMON_LDFLAGS=
+ AC_MSG_CHECKING([whether gcc -fPIE works])
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])],
+- [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no])
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])],
++ [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no])
+ AC_MSG_RESULT([$gcc_supports_pie])
+ if test $gcc_supports_pie = yes ; then
+ DAEMON_CFLAGS="-fPIE"
+@@ -339,6 +341,8 @@ fi
+ rm -f pietest.c
+ AC_SUBST(DAEMON_CFLAGS)
+ AC_SUBST(DAEMON_LDFLAGS)
++CFLAGS="${AF_tmp_cflags}"
++LDFLAGS="${AF_tmp_ldflags}"
+
+ #
+ # Enable ability to access value in external env variable
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix-the-YACC-rule-to-fix-a-building-failure.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix-the-YACC-rule-to-fix-a-building-failure.patch
new file mode 100644
index 000000000..21a97c8f5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix-the-YACC-rule-to-fix-a-building-failure.patch
@@ -0,0 +1,63 @@
+From 971d48a00ef82880c34e89778bf430a01360ebd5 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Mon, 18 May 2015 16:28:36 +0800
+Subject: [PATCH] [PATCH] fix the YACC rule to fix a building failure
+
+Upstream-Statu: Pending
+
+The original rule will create the header file twice, one is that the header
+file as the object file is created, other time is when create the C source file.
+since YACC always has "-d" parameter.
+
+This lead to a race when compile amd_tok.o, the header file maybe rewritten.
+ |----------------------
+ |amd_tok.l:359:10: error: 'RBRACKET' undeclared (first use in this function)
+ | ")" { return RBRACKET; }
+ | ^
+ |../Makefile.rules:64: recipe for target 'amd_tok.o' failed
+ |----------------------
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ lib/Makefile | 6 ++++--
+ modules/Makefile | 3 ++-
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 4798a4b..c40cf86 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -57,7 +57,8 @@ mount_xdr.o: mount_xdr.c
+ master_tok.c: master_tok.l
+ $(LEX) -o$@ -Pmaster_ $?
+
+-master_parse.tab.c master_parse.tab.h: master_parse.y
++master_parse.tab.h: master_parse.tab.c
++master_parse.tab.c: master_parse.y
+ $(YACC) -v -d -p master_ -b master_parse $?
+
+ master_tok.o: master_tok.c master_parse.tab.h
+@@ -67,7 +68,8 @@ master_parse.tab.o: master_parse.tab.c master_parse.tab.h
+ nss_tok.c: nss_tok.l
+ $(LEX) -o$@ -Pnss_ $?
+
+-nss_parse.tab.c nss_parse.tab.h: nss_parse.y
++nss_parse.tab.h: nss_parse.tab.c
++nss_parse.tab.c: nss_parse.y
+ $(YACC) -v -d -p nss_ -b nss_parse $?
+
+ nss_tok.o: nss_tok.c nss_parse.tab.h
+diff --git a/modules/Makefile b/modules/Makefile
+index d9ab06c..abc7698 100644
+--- a/modules/Makefile
++++ b/modules/Makefile
+@@ -103,7 +103,8 @@ amd_tok.c: amd_tok.l
+
+ amd_tok.o: amd_tok.c amd_parse.tab.h
+
+-amd_parse.tab.c amd_parse.tab.h: amd_parse.y
++amd_parse.tab.h: amd_parse.tab.c
++amd_parse.tab.c: amd_parse.y
+ $(YACC) -v -d -p amd_ -b amd_parse $?
+
+ amd_parse.tab.o: amd_parse.tab.c amd_parse.tab.h
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch
new file mode 100644
index 000000000..414325974
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch
@@ -0,0 +1,47 @@
+From c500d9906f163bf716c872d37403b9de02ef0a86 Mon Sep 17 00:00:00 2001
+From: Amy Fong <amy.fong@windriver.com>
+Date: Fri, 18 Jan 2013 12:13:32 -0500
+Subject: [PATCH] autofs: fails to compile with openldap disabled
+
+As of 5.0.6, it appears that changes were introduced so that
+if you compile with openldap disabled and openldap headers are not
+available, then autofs fails to build.
+
+Upstream-Status: Pending
+
+Signed-off-by: Amy Fong <amy.fong@windriver.com>
+--
+ lookup_ldap.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+---
+ include/lookup_ldap.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/include/lookup_ldap.h b/include/lookup_ldap.h
+index 3a7aba7..bfdb0b3 100644
+--- a/include/lookup_ldap.h
++++ b/include/lookup_ldap.h
+@@ -1,7 +1,9 @@
+ #ifndef LOOKUP_LDAP_H
+ #define LOOKUP_LDAP_H
+
++#ifdef WITH_LDAP
+ #include <ldap.h>
++#endif
+
+ #ifdef WITH_SASL
+ #include <openssl/ssl.h>
+@@ -117,10 +119,12 @@ struct lookup_context {
+
+ #define LDAP_AUTH_USESIMPLE 0x0008
+
++#ifdef WITH_LDAP
+ /* lookup_ldap.c */
+ LDAP *init_ldap_connection(unsigned logopt, const char *uri, struct lookup_context *ctxt);
+ int unbind_ldap_connection(unsigned logopt, struct ldap_conn *conn, struct lookup_context *ctxt);
+ int authtype_requires_creds(const char *authtype);
++#endif
+
+ #ifdef WITH_SASL
+ /* cyrus-sasl.c */
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/force-STRIP-to-emtpy.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/force-STRIP-to-emtpy.patch
new file mode 100644
index 000000000..21396dd6f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/force-STRIP-to-emtpy.patch
@@ -0,0 +1,26 @@
+From 3cbee00fe5725b87abdae80cfa2ee735e4513ca6 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Tue, 19 Aug 2014 11:31:35 +0800
+Subject: [PATCH] [PATCH] force STRIP to emtpy
+
+otherwise the generate file will be stripped
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ Makefile.rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.rules b/Makefile.rules
+index 709dd04..b1f7e50 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -31,7 +31,7 @@ LDFLAGS ?= -s
+ endif
+
+ ifdef DONTSTRIP
+-STRIP ?= :
++STRIP = :
+ else
+ STRIP ?= strip --strip-debug
+ endif
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc.patch
new file mode 100644
index 000000000..0a2d502b8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc.patch
@@ -0,0 +1,35 @@
+From cb6a4f61adb027f2366318f2c08c8264ebf39218 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Jan 2013 19:53:10 -0800
+
+---
+ Makefile.rules | 2 +-
+ aclocal.m4 | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.rules b/Makefile.rules
+index 6fa3e02..709dd04 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -46,7 +46,7 @@ CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64
+ LIBS += -lpthread
+
+ ifdef TIRPCLIB
+-CFLAGS += -I/usr/include/tirpc
++CFLAGS += -I=/usr/include/tirpc
+ LIBS += $(TIRPCLIB)
+ endif
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 2a9a802..0e4a624 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -416,7 +416,7 @@ AC_DEFUN([AF_CHECK_LIBTIRPC],
+ # save current flags
+ af_check_libtirpc_save_cflags="$CFLAGS"
+ af_check_libtirpc_save_ldflags="$LDFLAGS"
+-CFLAGS="$CFLAGS -I/usr/include/tirpc"
++CFLAGS="$CFLAGS -I=/usr/include/tirpc"
+ LDFLAGS="$LDFLAGS -ltirpc"
+
+ AC_TRY_LINK(
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/no-bash.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/no-bash.patch
new file mode 100644
index 000000000..c46c0e5ad
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/no-bash.patch
@@ -0,0 +1,29 @@
+From a3007d7ea930823926611081bb873ddd771325cb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Jan 2013 19:53:10 -0800
+
+---
+ samples/auto.net | 2 +-
+ samples/auto.smb | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/samples/auto.net b/samples/auto.net
+index 0384f61..61215f6 100755
+--- a/samples/auto.net
++++ b/samples/auto.net
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # This file must be executable to work! chmod 755!
+
+diff --git a/samples/auto.smb b/samples/auto.smb
+index 6af5d85..d296b81 100755
+--- a/samples/auto.smb
++++ b/samples/auto.smb
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # This file must be executable to work! chmod 755!
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch
new file mode 100644
index 000000000..1c7b11997
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch
@@ -0,0 +1,28 @@
+From e3ae56cf0bb4063c31295f45d04e3c504f4b6cc7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 24 Apr 2017 20:41:25 -0700
+Subject: [PATCH] autofs: Upgrade to 5.1.2 release
+
+Use pkg-config first to look for external libnsl which is now
+split out from glibc, if it does not exist then see if its provided
+by glibc itself.
+
+-Khem
+
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 9cf73b8..1016c71 100644
+--- a/configure.in
++++ b/configure.in
+@@ -186,7 +186,7 @@ fi
+ #
+ # glibc/libc 6 new libraries
+ #
+-AC_CHECK_LIB(nsl, yp_match, LIBNSL="-lnsl")
++PKG_CHECK_MODULES([NSL], [libnsl], [], [AC_CHECK_LIB([nsl],[yp_match],[LIBNSL="-lnsl"],[LIBNSL=""])])
+ AC_SUBST(LIBNSL)
+
+ AC_CHECK_LIB(resolv, res_query, LIBRESOLV="-lresolv")
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/remove-bashism.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/remove-bashism.patch
new file mode 100644
index 000000000..4183069bb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/remove-bashism.patch
@@ -0,0 +1,118 @@
+From cfacbb917f87b903b50132a5025f86b0cc522e9c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sat, 13 Sep 2014 20:19:28 -0700
+Subject: [PATCH] autofs.init.in: remove bashism
+
+It can work without the bashism.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+---
+ redhat/autofs.init.in | 12 ++++++------
+ samples/rc.autofs.in | 10 +++++-----
+ 2 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in
+index 9d008ff..4f1c0d8 100644
+--- a/redhat/autofs.init.in
++++ b/redhat/autofs.init.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # rc file for automount using a Sun-style "master map".
+ #
+@@ -42,7 +42,7 @@ if [ -r $confdir/autofs ]; then
+ . $confdir/autofs
+ fi
+
+-function start() {
++start() {
+ # Make sure autofs4 module is loaded
+ if ! grep -q autofs /proc/filesystems
+ then
+@@ -102,7 +102,7 @@ function start() {
+ return $RETVAL
+ }
+
+-function stop() {
++stop() {
+ echo -n $"Stopping $prog: "
+ count=0
+ while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
+@@ -125,7 +125,7 @@ function stop() {
+ return $RETVAL
+ }
+
+-function restart() {
++restart() {
+ status autofs > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ stop
+@@ -143,7 +143,7 @@ function restart() {
+ start
+ }
+
+-function reload() {
++reload() {
+ if [ ! -f /var/lock/subsys/autofs ]; then
+ echo $"$prog not running"
+ RETVAL=1
+@@ -161,7 +161,7 @@ function reload() {
+ return $RETVAL
+ }
+
+-function usage_message() {
++usage_message() {
+ echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}"
+ }
+
+diff --git a/samples/rc.autofs.in b/samples/rc.autofs.in
+index 487669f..e96cde1 100644
+--- a/samples/rc.autofs.in
++++ b/samples/rc.autofs.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # rc file for automount using a Sun-style "master map".
+ #
+@@ -36,7 +36,7 @@ if [ -r $confdir/autofs ]; then
+ . $confdir/autofs
+ fi
+
+-function start() {
++start() {
+ echo -n "Starting $prog: "
+
+ # Make sure autofs4 module is loaded
+@@ -85,7 +85,7 @@ function start() {
+ return $RETVAL
+ }
+
+-function stop() {
++stop() {
+ echo -n $"Stopping $prog: "
+ count=0
+ while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
+@@ -102,7 +102,7 @@ function stop() {
+ return $RETVAL
+ }
+
+-function restart() {
++restart() {
+ stop
+ while [ -n "`pidof $prog`" ] ; do
+ sleep 5
+@@ -110,7 +110,7 @@ function restart() {
+ start
+ }
+
+-function reload() {
++reload() {
+ pid=`pidof $prog`
+ if [ -z $pid ]; then
+ echo $"$prog not running"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch
new file mode 100644
index 000000000..3d0c6bd71
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch
@@ -0,0 +1,40 @@
+From dabcbdae38038a8e4ad2c4286112381c407c5ce7 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Tue, 19 Aug 2014 11:31:35 +0800
+Subject: [PATCH] using pkg-config to detect libxml-2.0 and krb5
+
+Upstream-status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ configure.in | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index b226236..9cf73b8 100644
+--- a/configure.in
++++ b/configure.in
+@@ -162,8 +162,20 @@ if test x$enable_sloppy_mount = xyes; then
+ fi
+
+ # LDAP SASL auth needs libxml and Kerberos
+-AF_CHECK_LIBXML()
+-AF_CHECK_KRB5()
++PKG_CHECK_MODULES(XML, [libxml-2.0],HAVE_LIBXML=1,HAVE_LIBXML=0)
++AC_SUBST([HAVE_LIBXML])
++XML_FLAGS=$XML_CFLAGS
++
++PKG_CHECK_MODULES(KRB5, [krb5],HAVE_KRB5=1,HAVE_KRB5=0)
++AC_SUBST([HAVE_KRB5])
++if test "x$HAVE_KRB5" = "x1"; then
++ SAVE_CFLAGS=$CFLAGS
++ SAVE_LIBS=$LIBS
++ CFLAGS="$CFLAGS $KRB5_FLAGS"
++ LIBS="$LIBS $KRB5_LIBS"
++
++ AC_CHECK_FUNCS([krb5_principal_get_realm])
++fi
+
+ AC_SEARCH_LIBS([versionsort],[])
+ if test "$ac_cv_search_versionsort" = "no"; then
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb
new file mode 100644
index 000000000..68c64fdb0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb
@@ -0,0 +1,77 @@
+SUMMARY = "Kernel based automounter for linux"
+SECTION = "utils"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+DEPENDS += "libtirpc flex-native bison-native e2fsprogs openssl libxml2 util-linux cyrus-sasl libnsl2"
+
+CFLAGS += "-I${STAGING_INCDIR}/tirpc"
+
+inherit autotools-brokensep systemd update-rc.d pkgconfig
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \
+ file://autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch \
+ file://no-bash.patch \
+ file://cross.patch \
+ file://libtirpc.patch \
+ file://autofs-5.0.7-do-not-check-for-modprobe.patch \
+ file://fix_disable_ldap.patch \
+ file://autofs-5.0.7-fix-lib-deps.patch \
+ file://add-the-needed-stdarg.h.patch \
+ file://using-pkg-config-to-detect-libxml-2.0-and-krb5.patch \
+ 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 \
+ file://autofs-5.1.2-libtirpc-as-need.patch \
+ file://pkgconfig-libnsl.patch \
+ file://0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch \
+ "
+SRC_URI[md5sum] = "28cf88f99eff553a8500659ba5d45a76"
+SRC_URI[sha256sum] = "0d57e4138c2ec8058ca92164d035546f68ce4af93acb893369993d67c7056a10"
+
+INITSCRIPT_NAME = "autofs"
+INITSCRIPT_PARAMS = "defaults"
+
+# FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS
+#CFLAGS += "${LDFLAGS}"
+
+PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+
+EXTRA_OEMAKE = "DONTSTRIP=1"
+EXTRA_OECONF += "--disable-mount-locking \
+ --enable-ignore-busy --with-openldap=no \
+ --with-sasl=no --with-libtirpc \
+ --with-path=${STAGING_BINDIR_NATIVE} \
+"
+CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \
+ ac_cv_path_RPCGEN=rpcgen \
+"
+
+do_configure_prepend () {
+ sed -e "s:filagdir:flagdir:" -i ${S}/configure.in
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cp ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+}
+
+do_install_append () {
+ if [ -d ${D}/run ]; then
+ rmdir ${D}/run
+ fi
+ if [ -d ${D}${localstatedir}/run ]; then
+ rmdir ${D}${localstatedir}/run
+ fi
+}
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
+
+INSANE_SKIP_${PN} = "dev-so"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "autofs.service"
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch
new file mode 100644
index 000000000..3fa8431c3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch
@@ -0,0 +1,25 @@
+Fix hardcoded libdir.
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ plugins/Makefile.am | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/plugins/Makefile.am b/plugins/Makefile.am
+index b00915f..25262a1 100644
+--- a/plugins/Makefile.am
++++ b/plugins/Makefile.am
+@@ -62,7 +62,7 @@ plugindir = @plugindir@
+
+ common_sources = plugin_common.c plugin_common.h
+
+-sasldir = $(prefix)/lib/sasl2
++sasldir = $(libdir)/sasl2
+ sasl_LTLIBRARIES = @SASL_MECHS@
+ EXTRA_LTLIBRARIES = libplain.la libanonymous.la libkerberos4.la libcrammd5.la \
+ libgs2.la libgssapiv2.la libdigestmd5.la liblogin.la libsrp.la libotp.la \
+--
+1.7.4.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch
new file mode 100644
index 000000000..6407721ae
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch
@@ -0,0 +1,46 @@
+Avoid to call AC_TRY_RUN
+
+Upstream-Status: Inappropriate [configuration]
+
+Avoid to call AC_TRY_RUN to check if GSSAPI libraries support SPNEGO
+on cross-compile environment by definition AC_ARG_ENABLE enable-spnego
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ cmulocal/sasl2.m4 | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/cmulocal/sasl2.m4 b/cmulocal/sasl2.m4
+index 3c2841a..a5ecf81 100644
+--- a/cmulocal/sasl2.m4
++++ b/cmulocal/sasl2.m4
+@@ -281,6 +281,17 @@ if test "$gssapi" != no; then
+
+ cmu_save_LIBS="$LIBS"
+ LIBS="$LIBS $GSSAPIBASE_LIBS"
++ AC_ARG_ENABLE([spnego],
++ [AC_HELP_STRING([--enable-spnego=<DIR>],
++ [enable SPNEGO support in GSSAPI libraries [no]])],
++ [spnego=$enableval],
++ [spnego=no])
++
++ if test "$spnego" = no; then
++ echo "no"
++ elif test "$spnego" = yes; then
++ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
++ else
+ AC_MSG_CHECKING([for SPNEGO support in GSSAPI libraries])
+ AC_TRY_RUN([
+ #ifdef HAVE_GSSAPI_H
+@@ -308,7 +319,7 @@ int main(void)
+ AC_MSG_RESULT(yes) ],
+ AC_MSG_RESULT(no))
+ LIBS="$cmu_save_LIBS"
+-
++ fi
+ else
+ AC_MSG_RESULT([disabled])
+ fi
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff
new file mode 100644
index 000000000..8eff5a8bd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff
@@ -0,0 +1,14 @@
+Author: Fabian Fagerholm <fabbe@debian.org>
+Description: Fix linking with libsasldb.a when saslauthd is built with sasldb
+support.
+--- a/saslauthd/configure.in
++++ b/saslauthd/configure.in
+@@ -77,7 +77,7 @@ if test "$authsasldb" != no; then
+ AC_DEFINE(AUTH_SASLDB,[],[Include SASLdb Support])
+ SASL_DB_PATH_CHECK()
+ SASL_DB_CHECK()
+- SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.al"
++ SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.a"
+ fi
+
+ AC_ARG_ENABLE(httpform, [ --enable-httpform enable HTTP form authentication [[no]] ],
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff
new file mode 100644
index 000000000..2e5b1750d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff
@@ -0,0 +1,27 @@
+Author: Fabian Fagerholm <fabbe@debian.org>
+Description: This patch makes sure the non-PIC version of libsasldb.a, which
+is created out of non-PIC objects, is not going to overwrite the PIC version,
+which is created out of PIC objects. The PIC version is placed in .libs, and
+the non-PIC version in the current directory. This ensures that both non-PIC
+and PIC versions are available in the correct locations.
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -78,7 +78,7 @@ endif
+
+ libsasl2.a: libsasl2.la $(SASL_STATIC_OBJS)
+ @echo adding static plugins and dependencies
+- $(AR) cru .libs/$@ $(SASL_STATIC_OBJS)
++ $(AR) cru $@ $(SASL_STATIC_OBJS)
+ @for i in ./libsasl2.la ../sasldb/libsasldb.la ../plugins/lib*.la; do \
+ if test ! -f $$i; then continue; fi; . $$i; \
+ for j in $$dependency_libs foo; do \
+--- a/sasldb/Makefile.am
++++ b/sasldb/Makefile.am
+@@ -63,6 +63,6 @@ libsasldb_a_SOURCES =
+ EXTRA_libsasldb_a_SOURCES =
+
+ libsasldb.a: libsasldb.la $(SASL_DB_BACKEND_STATIC)
+- $(AR) cru .libs/$@ $(SASL_DB_BACKEND_STATIC)
++ $(AR) cru $@ $(SASL_DB_BACKEND_STATIC)
+
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch
new file mode 100644
index 000000000..ecbab845d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch
@@ -0,0 +1,31 @@
+From 92d72789c811b0d55f624a8bac5ccc4412f5996e Mon Sep 17 00:00:00 2001
+From: Ken Murchison <murch@andrew.cmu.edu>
+Date: Thu, 20 Dec 2012 18:14:50 -0500
+Subject: [PATCH] sasl.h: #include <stddef.h> for size_t on NetBSD
+
+This patch was imported from git://git.cyrusimap.org/cyrus-sasl
+commit 67a188693796a14e3a76ac603104807fbbfddfc4
+
+Upstream-Status: Backport
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ include/sasl.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/sasl.h b/include/sasl.h
+index fef4d51..8b8a63f 100755
+--- a/include/sasl.h
++++ b/include/sasl.h
+@@ -121,6 +121,8 @@
+ #ifndef SASL_H
+ #define SASL_H 1
+
++#include <stddef.h> /* For size_t */
++
+ /* Keep in sync with win32/common.mak */
+ #define SASL_VERSION_MAJOR 2
+ #define SASL_VERSION_MINOR 1
+--
+1.8.3.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf
new file mode 100644
index 000000000..a91a9d334
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf
@@ -0,0 +1,11 @@
+# Directory in which to place saslauthd's listening socket, pid file, and so
+# on. This directory must already exist.
+SOCKETDIR=@LOCALSTATEDIR@/run/saslauthd
+
+# Mechanism to use when checking passwords. Run "saslauthd -v" to get a list
+# of which mechanism your installation was compiled with the ablity to use.
+MECH=pam
+
+# Additional flags to pass to saslauthd on the command line. See saslauthd(8)
+# for the list of accepted flags.
+FLAGS=
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service
new file mode 100644
index 000000000..96dbae378
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=SASL authentication daemon.
+After=syslog.target
+
+[Service]
+Type=forking
+PIDFile=@LOCALSTATEDIR@/run/saslauthd/saslauthd.pid
+EnvironmentFile=@SYSCONFDIR@/default/saslauthd
+ExecStart=@SBINDIR@/saslauthd -m $SOCKETDIR -a $MECH $FLAGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb
new file mode 100644
index 000000000..6dbff87dd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb
@@ -0,0 +1,96 @@
+SUMMARY = "Generic client/server library for SASL authentication"
+SECTION = "libs"
+HOMEPAGE = "http://asg.web.cmu.edu/sasl/"
+DEPENDS = "openssl db"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3f55e0974e3d6db00ca6f57f2d206396"
+
+SRC_URI = "ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-${PV}.tar.gz \
+ file://avoid-to-call-AC_TRY_RUN.patch \
+ file://Fix-hardcoded-libdir.patch \
+ file://debian_patches_0009_sasldb_al.diff \
+ file://debian_patches_0014_avoid_pic_overwrite.diff \
+ file://sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch \
+ file://saslauthd.service \
+ file://saslauthd.conf \
+"
+
+inherit autotools-brokensep pkgconfig useradd systemd
+
+EXTRA_OECONF += "--with-dblib=berkeley \
+ --with-bdb-libdir=${STAGING_LIBDIR} \
+ --with-bdb-incdir=${STAGING_INCDIR} \
+ --with-bdb=db-5.3 \
+ --with-plugindir="${libdir}/sasl2" \
+ andrew_cv_runpath_switch=none"
+
+PACKAGECONFIG ??= "ntlm \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 ldap pam', d)} \
+"
+PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5,"
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
+PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie,"
+PACKAGECONFIG[des] = "--with-des,--without-des,,"
+PACKAGECONFIG[ldap] = "--with-ldap=${STAGING_LIBDIR} --enable-ldapdb,--without-ldap --disable-ldapdb,openldap,"
+PACKAGECONFIG[ntlm] = "--with-ntlm,--without-ntlm,,"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+CFLAGS += "-fPIC"
+
+do_configure_prepend () {
+ rm -f acinclude.m4 config/libtool.m4
+
+ # make it be able to work with db 5.0 version
+ local sed_files="sasldb/db_berkeley.c utils/dbconverter-2.c"
+ for sed_file in $sed_files; do
+ sed -i 's#DB_VERSION_MAJOR == 4.*#(&) || DB_VERSION_MAJOR == 5#' $sed_file
+ done
+}
+
+do_compile_prepend () {
+ cd include
+ ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} makemd5.c -o makemd5
+ touch makemd5.o makemd5.lo makemd5
+ cd ..
+}
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/saslauthd.service ${D}${systemd_unitdir}/system
+
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
+ sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
+
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /run/saslauthd/ - - - -" > ${D}${sysconfdir}/tmpfiles.d/saslauthd.conf
+
+ install -d ${D}${sysconfdir}/default/
+ install -m 0644 ${WORKDIR}/saslauthd.conf ${D}${sysconfdir}/default/saslauthd
+ sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/default/saslauthd
+ fi
+}
+
+USERADD_PACKAGES = "${PN}-bin"
+USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus"
+
+SYSTEMD_PACKAGES = "${PN}-bin"
+SYSTEMD_SERVICE_${PN}-bin = "saslauthd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425"
+SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3"
+
+PACKAGES =+ "${PN}-bin"
+
+FILES_${PN} += "${libdir}/sasl2/*.so*"
+FILES_${PN}-bin += "${bindir} \
+ ${sysconfdir}/default/saslauthd \
+ ${systemd_unitdir}/system/saslauthd.service \
+ ${sysconfdir}/tmpfiles.d/saslauthd.conf"
+FILES_${PN}-dev += "${libdir}/sasl2/*.la"
+FILES_${PN}-dbg += "${libdir}/sasl2/.debug"
+FILES_${PN}-staticdev += "${libdir}/sasl2/*.a"
+
+INSANE_SKIP_${PN} += "dev-so"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.conf.sample b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.conf.sample
new file mode 100644
index 000000000..ec0584193
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.conf.sample
@@ -0,0 +1,21 @@
+# options to dnrd
+
+# example: two default dns servers and dns servers for exampledomain.com. The
+# latter are load balanced (-b)
+#
+#
+
+# DNRD_OPTS="
+# -s XXX.XXX.XX.XXX
+# -s XXX.XXX.XX.XXX
+# -b
+# -s XXX.XXX.XX.XXX:exampledomain.com
+# -s XXX.XXX.XX.XXX:exampledomain.com"
+
+# example: dnrd user
+#
+
+# DNRD_USER="user"
+#
+
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.init b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.init
new file mode 100644
index 000000000..2fe583fcf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.init
@@ -0,0 +1,94 @@
+#!/bin/sh
+#
+# Startup script for dnrd
+#
+# Copyright 2008, Rakesh Pandit <rakesh.pandit@gmail.com>
+#
+# This source is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This source is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# chkconfig: - 85 15
+# description: dnrd is a proxying nameserver. It forwards DNS queries to the
+# appropriate nameserver, but can also act as the primary nameserver for
+# a subnet behind a firewall. It also has features such as caching DNS
+# requests, support for DNS servers, cache poisoning prevention, TCP
+# support, etc..
+
+# processname: dnrd
+# pidfile: /var/run/dnrd.pid
+# config: /etc/dnrd/dnrd.conf
+
+# Provides: dnrd
+# Required-Start:
+# Should-Start:
+# Required-Stop:
+# Default-Stop: 0 1 2 6
+# Short-Description: Start dnrd daemon
+# Description: Domain Name Relay Daemon
+# END INIT INFO
+
+exe=/usr/sbin/dnrd
+pfile=/etc/passwd
+
+# Source function library.
+. /etc/init.d/functions
+
+# Source conf file
+. /etc/dnrd/dnrd.conf
+
+[ -x $exe ] || exit 1
+[ -r "/etc/dnrd/dnrd.conf" ] || exit 1
+if [ $DNRD_USER ]
+then
+ grep "^${LOGIN}:" $pfile >/dev/null 2>&1
+ if [ $? -eq 0 ];then
+ echo "$DNRD_USER specified in /etc/dnrd/dnrd.conf does not exist!"
+ fi
+else
+ echo "DNRD_USER not set at /etc/dnrd/dnrd.conf!"
+ exit 1
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting dnrd: "
+ daemon dnrd $DNRD_OPTS -u $DNRD_USER
+ echo
+ touch /var/lock/subsys/dnrd
+ ;;
+ stop)
+ echo -n "Shutting down dnrd: "
+ killproc dnrd
+ echo
+ rm -f /var/lock/subsys/dnrd
+ rm -f /var/run/dnrd.pid
+ ;;
+ status)
+ status dnrd
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ reload)
+ echo -n "Reloading dnrd: "
+ killproc dnrd -HUP
+ echo
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|status}"
+ exit 1
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.service b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.service
new file mode 100644
index 000000000..9c9fa6639
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Domain Name Relay Daemon
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/dnrd.pid
+EnvironmentFile=/etc/dnrd/dnrd.conf
+ExecStart=/usr/sbin/dnrd $DNRD_OPTS -u $DNRD_USER
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy/0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch b/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy/0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch
new file mode 100644
index 000000000..82cdc36ac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy/0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch
@@ -0,0 +1,25 @@
+From a557651a08e21e3c7c7f5eca9f5405f86624903f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 22:42:51 -0700
+Subject: [PATCH] src/igmpproxy.h: Include sys/types.h for u_short/u_init
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/igmpproxy.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/igmpproxy.h b/src/igmpproxy.h
+index 4dabd1c..4454729 100644
+--- a/src/igmpproxy.h
++++ b/src/igmpproxy.h
+@@ -46,6 +46,7 @@
+ #include <stdbool.h>
+
+ #include <sys/socket.h>
++#include <sys/types.h>
+ #include <sys/un.h>
+ #include <sys/time.h>
+ #include <sys/ioctl.h>
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb b/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb
new file mode 100644
index 000000000..5424dc455
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb
@@ -0,0 +1,16 @@
+SUMMARY = "simple dynamic multicast routing daemon that only uses IGMP signalling"
+HOMEPAGE = "http://sourceforge.net/projects/igmpproxy/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1e995e2799bb0d27d63069b97f805420"
+
+SRC_URI = "http://sourceforge.net/projects/igmpproxy/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+ file://0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch \
+ "
+
+SRC_URI[md5sum] = "c56f41ec195bc1fe016369bf74efc5a1"
+SRC_URI[sha256sum] = "ee18ff3d8c3ae3a29dccb7e5eedf332337330020168bd95a11cece8d7d7ee6ae"
+
+inherit autotools pkgconfig
+
+CFLAGS += "-D_GNU_SOURCE"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-Respect-flags-from-env.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-Respect-flags-from-env.patch
new file mode 100644
index 000000000..e96762125
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-Respect-flags-from-env.patch
@@ -0,0 +1,56 @@
+From 4848b9e4d516a9203c08432901a7b40419e8f43c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Jul 2017 15:54:35 -0700
+Subject: [PATCH 1/3] Respect flags from env
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 4 ++--
+ cli/Makefile | 2 +-
+ pppd/Makefile | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index a05a000..439a978 100644
+--- a/Makefile
++++ b/Makefile
+@@ -81,8 +81,8 @@ LIBS.dmalloc= -ldmalloc
+ export USE_DMALLOC
+ endif
+
+-CPPFLAGS= $(CPPFLAGS.ippooltest)
+-CFLAGS= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
++CPPFLAGS+= $(CPPFLAGS.ippooltest)
++CFLAGS+= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
+ LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
+ LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
+
+diff --git a/cli/Makefile b/cli/Makefile
+index 4b5dd59..56fbf2f 100644
+--- a/cli/Makefile
++++ b/cli/Makefile
+@@ -7,7 +7,7 @@ CLI_SRCS_TEST.o= $(CLI_SRCS_TEST.c:%.c=%.o)
+
+ LDFLAGS.cli_test= -L.. -L. $(READLINE_LDFLAGS) -lcli -lusl -lreadline -lcurses -lc
+
+-CFLAGS= $(CFLAGS.optimize) -MMD -Wall -Werror -I.. $(READLINE_CFLAGS)
++CFLAGS= $(CFLAGS.optimize) -MMD -Wall -Werror -I.. $(READLINE_CFLAGS) $(CPPFLAGS)
+
+ .PHONY: all test clean
+
+diff --git a/pppd/Makefile b/pppd/Makefile
+index 106deca..7fd815f 100644
+--- a/pppd/Makefile
++++ b/pppd/Makefile
+@@ -10,7 +10,7 @@ endif
+
+ # END CONFIGURABLE SETTINGS
+
+-CFLAGS += -g -I.. -I/usr/include/pppd $(CFLAGS.pppd) -fPIC
++CFLAGS += -g -I.. -I=/usr/include/pppd $(CFLAGS.pppd) -fPIC
+ LDFLAGS += -shared
+
+ all: ippool.so
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch
new file mode 100644
index 000000000..7d3f9acb6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch
@@ -0,0 +1,31 @@
+From e4e0aae139b6489dc582fd14e54e562126482ce2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 07:23:53 -0700
+Subject: [PATCH 1/3] read() returns ssize_t
+
+Fixes
+usl_fd.c:284:10: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
+ if (nb < 0) {
+ ~~ ^ ~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usl/usl_fd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usl/usl_fd.c b/usl/usl_fd.c
+index 3b7a813..04ba48c 100644
+--- a/usl/usl_fd.c
++++ b/usl/usl_fd.c
+@@ -280,7 +280,7 @@ size_t usl_fd_read(int fd, void *buf, size_t count)
+ char *ptr = buf;
+
+ for (chars_read = 0; chars_read < count; ) {
+- size_t nb = read(fd, ptr, count - chars_read);
++ ssize_t nb = read(fd, ptr, count - chars_read);
+ if (nb < 0) {
+ if (errno == EINTR)
+ continue;
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch
new file mode 100644
index 000000000..6fb7cc5c4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch
@@ -0,0 +1,28 @@
+From 5d7f20c045b3c74dad2c53d65e30bd4840250082 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 15:17:19 -0700
+Subject: [PATCH] usl_timer: Check for return value of write() API
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usl/usl_timer.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/usl/usl_timer.c b/usl/usl_timer.c
+index fda752b..d8414a6 100644
+--- a/usl/usl_timer.c
++++ b/usl/usl_timer.c
+@@ -94,7 +94,9 @@ void usl_timer_tick(void)
+
+ if (!usl_tick_pending) {
+ usl_tick_pending = 1;
+- write(usl_tick_pipe[1], &msg, sizeof(msg));
++ if (write(usl_tick_pipe[1], &msg, sizeof(msg)) != sizeof(msg)) {
++ fprintf(stderr, "write to fd %i failed: %s\n", usl_tick_pipe[1], strerror(errno));
++ }
+ }
+ }
+
+--
+2.13.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch
new file mode 100644
index 000000000..6e2bd523d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch
@@ -0,0 +1,31 @@
+From cf25576428903168cd41b183fb1ca9c2b7e2666e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 07:28:10 -0700
+Subject: [PATCH 2/3] Mark first element of a string as null
+
+Fixes
+cli_lib.c:427:20: error: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Werror,-Wnon-literal-null-conversion]
+ values[arg] = '\0';
+ ^~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_lib.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cli/cli_lib.c b/cli/cli_lib.c
+index 41a0b06..e4d2fd5 100644
+--- a/cli/cli_lib.c
++++ b/cli/cli_lib.c
+@@ -424,7 +424,7 @@ int cli_find_args(int argc, char *argv[], struct cli_node *cmd, struct cli_node
+ if (arg_string[1] == '\0') {
+ /* no arg value - only allowed for string args */
+ if (node->arg->parser == cli_arg_parse_string) {
+- values[arg] = '\0';
++ *values[arg] = '\0';
+ } else {
+ result = -EINVAL;
+ break;
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-link-with-libtirpc.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-link-with-libtirpc.patch
new file mode 100644
index 000000000..d80f7b436
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-link-with-libtirpc.patch
@@ -0,0 +1,30 @@
+From 47aef26198431f7ad568c2277dded158bda3e36f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Jul 2017 16:00:35 -0700
+Subject: [PATCH 2/3] link with libtirpc
+
+musl needs it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 439a978..ea821eb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -83,8 +83,8 @@ endif
+
+ CPPFLAGS+= $(CPPFLAGS.ippooltest)
+ CFLAGS+= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
+-LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
+-LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
++LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc -ltirpc
++LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses $(LIBS.dmalloc) -lc -ltirpc
+
+ OPT_CFLAGS?= -O
+
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch
new file mode 100644
index 000000000..3854b1133
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch
@@ -0,0 +1,58 @@
+From 994d9575374d3cdb34b1b0f70c3c53ae76fe578e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 07:41:05 -0700
+Subject: [PATCH 3/3] cli: Mark return of strtol as long int
+
+strtol does not return unsigned long
+
+error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value]
+ if ((*endp == '\0') && (labs(tmp) < 32768)) {
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_lib.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/cli/cli_lib.c b/cli/cli_lib.c
+index e4d2fd5..5f487dc 100644
+--- a/cli/cli_lib.c
++++ b/cli/cli_lib.c
+@@ -522,7 +522,7 @@ int cli_arg_parse_int32(struct cli_node *arg, const char *val, void *result)
+ int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result)
+ {
+ int16_t *intval = result;
+- unsigned long tmp;
++ long tmp;
+ char *endp;
+ int ret = 0;
+
+@@ -539,7 +539,7 @@ int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result)
+ int cli_arg_parse_int8(struct cli_node *arg, const char *val, void *result)
+ {
+ int8_t *intval = result;
+- unsigned long tmp;
++ long tmp;
+ char *endp;
+ int ret = 0;
+
+@@ -573,7 +573,7 @@ int cli_arg_parse_uint32(struct cli_node *arg, const char *val, void *result)
+ int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result)
+ {
+ uint16_t *intval = result;
+- unsigned long tmp;
++ long tmp;
+ char *endp;
+ int ret = 0;
+
+@@ -590,7 +590,7 @@ int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result)
+ int cli_arg_parse_uint8(struct cli_node *arg, const char *val, void *result)
+ {
+ uint8_t *intval = result;
+- unsigned long tmp;
++ long tmp;
+ char *endp;
+ int ret = 0;
+
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-musl-fixes.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-musl-fixes.patch
new file mode 100644
index 000000000..3cd5259fa
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-musl-fixes.patch
@@ -0,0 +1,283 @@
+From eb345047decba665e3f39908336a83f039e1ece2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Jul 2017 16:01:32 -0700
+Subject: [PATCH 3/3] musl fixes
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_readline.c | 7 +-
+ ippool_api.c | 9 ++-
+ net/ppp_defs.h | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ usl/usl.h | 4 ++
+ 4 files changed, 208 insertions(+), 6 deletions(-)
+ create mode 100644 net/ppp_defs.h
+
+diff --git a/cli/cli_readline.c b/cli/cli_readline.c
+index 2812e6e..542935c 100644
+--- a/cli/cli_readline.c
++++ b/cli/cli_readline.c
+@@ -17,13 +17,14 @@
+ * Boston, MA 02110-1301 USA
+ *
+ *****************************************************************************/
+-
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/file.h>
+ #include <sys/stat.h>
+-#include <sys/errno.h>
++#include <fcntl.h>
++#include <errno.h>
+ #include <signal.h>
+
+ #include <readline/readline.h>
+@@ -630,7 +631,7 @@ static void cli_rl_uninstall_signal_handlers(void)
+
+ static int cli_rl_install_signal_handlers(void)
+ {
+- __sighandler_t handler;
++ sighandler_t handler;
+
+ rl_catch_signals = 0;
+ rl_clear_signals();
+diff --git a/ippool_api.c b/ippool_api.c
+index 2c10c47..d1127a9 100644
+--- a/ippool_api.c
++++ b/ippool_api.c
+@@ -181,10 +181,13 @@ int ippool_api_rpc_check_request(SVCXPRT *xprt)
+ * non-loopback interface, reject the request.
+ */
+ if ((!ippool_opt_remote_rpc) &&
+- ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) &&
+- (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) {
++ ((xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_LOOPBACK)) &&
++ (xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_ANY)))) {
++ char straddr[INET6_ADDRSTRLEN];
++ inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, sizeof(straddr));
++
+ if (ippool_opt_debug) {
+- ippool_log(LOG_ERR, "Rejecting RPC request from %s", inet_ntoa(xprt->xp_raddr.sin_addr));
++ ippool_log(LOG_ERR, "Rejecting RPC request from %s", straddr);
+ }
+ svcerr_auth(xprt, AUTH_TOOWEAK);
+ return -EPERM;
+diff --git a/net/ppp_defs.h b/net/ppp_defs.h
+new file mode 100644
+index 0000000..b06eda5
+--- /dev/null
++++ b/net/ppp_defs.h
+@@ -0,0 +1,194 @@
++/* $Id: ppp_defs.h,v 1.17 2002/12/06 09:49:15 paulus Exp $ */
++
++/*
++ * ppp_defs.h - PPP definitions.
++ *
++ * Copyright (c) 1984 Paul Mackerras. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ *
++ * 3. The name(s) of the authors of this software must not be used to
++ * endorse or promote products derived from this software without
++ * prior written permission.
++ *
++ * 4. Redistributions of any form whatsoever must retain the following
++ * acknowledgment:
++ * "This product includes software developed by Paul Mackerras
++ * <paulus@samba.org>".
++ *
++ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
++ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
++ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
++ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#ifndef _PPP_DEFS_H_
++#define _PPP_DEFS_H_
++
++/*
++ * The basic PPP frame.
++ */
++#define PPP_HDRLEN 4 /* octets for standard ppp header */
++#define PPP_FCSLEN 2 /* octets for FCS */
++
++/*
++ * Packet sizes
++ *
++ * Note - lcp shouldn't be allowed to negotiate stuff outside these
++ * limits. See lcp.h in the pppd directory.
++ * (XXX - these constants should simply be shared by lcp.c instead
++ * of living in lcp.h)
++ */
++#define PPP_MTU 1500 /* Default MTU (size of Info field) */
++#define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN)
++#define PPP_MINMTU 64
++#define PPP_MRU 1500 /* default MRU = max length of info field */
++#define PPP_MAXMRU 65000 /* Largest MRU we allow */
++#define PPP_MINMRU 128
++
++#define PPP_ADDRESS(p) (((u_char *)(p))[0])
++#define PPP_CONTROL(p) (((u_char *)(p))[1])
++#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3])
++
++/*
++ * Significant octet values.
++ */
++#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */
++#define PPP_UI 0x03 /* Unnumbered Information */
++#define PPP_FLAG 0x7e /* Flag Sequence */
++#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */
++#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */
++
++/*
++ * Protocol field values.
++ */
++#define PPP_IP 0x21 /* Internet Protocol */
++#define PPP_AT 0x29 /* AppleTalk Protocol */
++#define PPP_IPX 0x2b /* IPX protocol */
++#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */
++#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */
++#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */
++#define PPP_COMP 0xfd /* compressed packet */
++#define PPP_IPCP 0x8021 /* IP Control Protocol */
++#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */
++#define PPP_IPXCP 0x802b /* IPX Control Protocol */
++#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
++#define PPP_CCP 0x80fd /* Compression Control Protocol */
++#define PPP_ECP 0x8053 /* Encryption Control Protocol */
++#define PPP_LCP 0xc021 /* Link Control Protocol */
++#define PPP_PAP 0xc023 /* Password Authentication Protocol */
++#define PPP_LQR 0xc025 /* Link Quality Report protocol */
++#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */
++#define PPP_CBCP 0xc029 /* Callback Control Protocol */
++#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */
++
++/*
++ * Values for FCS calculations.
++ */
++#define PPP_INITFCS 0xffff /* Initial FCS value */
++#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
++#define PPP_FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
++
++/*
++ * A 32-bit unsigned integral type.
++ */
++
++#if !defined(__BIT_TYPES_DEFINED__) && !defined(_BITYPES) \
++ && !defined(__FreeBSD__) && (NS_TARGET < 40)
++#ifdef UINT32_T
++typedef UINT32_T u_int32_t;
++#else
++typedef unsigned int u_int32_t;
++typedef unsigned short u_int16_t;
++#endif
++#endif
++
++/*
++ * Extended asyncmap - allows any character to be escaped.
++ */
++typedef u_int32_t ext_accm[8];
++
++/*
++ * What to do with network protocol (NP) packets.
++ */
++enum NPmode {
++ NPMODE_PASS, /* pass the packet through */
++ NPMODE_DROP, /* silently drop the packet */
++ NPMODE_ERROR, /* return an error */
++ NPMODE_QUEUE /* save it up for later. */
++};
++
++/*
++ * Statistics.
++ */
++struct pppstat {
++ unsigned int ppp_ibytes; /* bytes received */
++ unsigned int ppp_ipackets; /* packets received */
++ unsigned int ppp_ierrors; /* receive errors */
++ unsigned int ppp_obytes; /* bytes sent */
++ unsigned int ppp_opackets; /* packets sent */
++ unsigned int ppp_oerrors; /* transmit errors */
++};
++
++struct vjstat {
++ unsigned int vjs_packets; /* outbound packets */
++ unsigned int vjs_compressed; /* outbound compressed packets */
++ unsigned int vjs_searches; /* searches for connection state */
++ unsigned int vjs_misses; /* times couldn't find conn. state */
++ unsigned int vjs_uncompressedin; /* inbound uncompressed packets */
++ unsigned int vjs_compressedin; /* inbound compressed packets */
++ unsigned int vjs_errorin; /* inbound unknown type packets */
++ unsigned int vjs_tossed; /* inbound packets tossed because of error */
++};
++
++struct ppp_stats {
++ struct pppstat p; /* basic PPP statistics */
++ struct vjstat vj; /* VJ header compression statistics */
++};
++
++struct compstat {
++ unsigned int unc_bytes; /* total uncompressed bytes */
++ unsigned int unc_packets; /* total uncompressed packets */
++ unsigned int comp_bytes; /* compressed bytes */
++ unsigned int comp_packets; /* compressed packets */
++ unsigned int inc_bytes; /* incompressible bytes */
++ unsigned int inc_packets; /* incompressible packets */
++ unsigned int ratio; /* recent compression ratio << 8 */
++};
++
++struct ppp_comp_stats {
++ struct compstat c; /* packet compression statistics */
++ struct compstat d; /* packet decompression statistics */
++};
++
++/*
++ * The following structure records the time in seconds since
++ * the last NP packet was sent or received.
++ */
++struct ppp_idle {
++ time_t xmit_idle; /* time since last NP packet sent */
++ time_t recv_idle; /* time since last NP packet received */
++};
++
++#ifndef __P
++#ifdef __STDC__
++#define __P(x) x
++#else
++#define __P(x) ()
++#endif
++#endif
++
++#endif /* _PPP_DEFS_H_ */
+diff --git a/usl/usl.h b/usl/usl.h
+index cdc16db..88d2714 100644
+--- a/usl/usl.h
++++ b/usl/usl.h
+@@ -38,6 +38,10 @@
+ #include "usl_fsm.h"
+ #include "usl_list.h"
+
++#ifndef WAIT_ANY
++#define WAIT_ANY (-1)
++#endif
++
+ #define USL_VERSION "0.6"
+
+ #ifdef DEBUG
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/always_syslog.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/always_syslog.patch
new file mode 100644
index 000000000..e475276c0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/always_syslog.patch
@@ -0,0 +1,22 @@
+ippool: always log to syslog
+
+Even when running in the foreground, send log messages to syslog.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+
+--- a/ippool_main.c
++++ b/ippool_main.c
+@@ -251,9 +251,8 @@ void ippool_vlog(int level, const char *
+ if (ippool_opt_nodaemon) {
+ vprintf(fmt, ap);
+ printf("\n");
+- } else {
+- vsyslog(level, fmt, ap);
+ }
++ vsyslog(level, fmt, ap);
+ DMALLOC_VMESSAGE(fmt, ap);
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool.service b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool.service
new file mode 100644
index 000000000..e5917fc14
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=ip address pool allocator
+Requires=rpcbind.service
+After=rpcbind.service
+
+[Service]
+Type=simple
+# Start ippoold in the foreground!
+ExecStart=@SBINDIR@/ippoold -f
+# Normal output will go to syslog, so suppress stdout.
+StandardOutput=null
+StandardError=syslog
+# ExecStop is not needed. systemd will send SIGTERM
+# and ippoold will exit status 1.
+SuccessExitStatus=1
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_init.d.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_init.d.patch
new file mode 100644
index 000000000..14a768d0f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_init.d.patch
@@ -0,0 +1,65 @@
+Fix start error if lsb init-functions doesn't exist
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/debian/init.d b/debian/init.d
+index 363ba89..0327fec 100644
+--- a/debian/init.d
++++ b/debian/init.d
+@@ -10,6 +10,9 @@
+ # Description: Start ippool daemon
+ ### END INIT INFO
+
++# Source function library.
++. /etc/init.d/functions
++
+ DAEMON=/usr/sbin/ippoold
+ NAME=ippoold
+ MODULE=pppol2tp
+@@ -18,7 +21,23 @@ MODULE=pppol2tp
+ test -x $DAEMON || exit 0
+
+ # Get lsb functions
+-. /lib/lsb/init-functions
++if [ -f /lib/lsb/init-functions ]
++then
++ . /lib/lsb/init-functions
++else
++ log_begin_msg() {
++ echo -n $*
++ }
++
++ log_end_msg() {
++ if [ $1 -eq 0 ]; then
++ echo "done"
++ else
++ echo "failed"
++ fi
++ }
++fi
++
+ . /etc/default/rcS
+
+ case "$1" in
+@@ -35,6 +54,10 @@ case "$1" in
+ fi
+ log_end_msg $?
+ ;;
++ status)
++ status /usr/sbin/ippoold;
++ exit $?
++ ;;
+ restart)
+ $0 stop
+ sleep 1
+@@ -46,7 +69,7 @@ case "$1" in
+ log_end_msg $?
+ ;;
+ *)
+- log_success_msg "Usage: /etc/init.d/ippoold {start|stop|restart|reload|force-reload}"
++ log_success_msg "Usage: /etc/init.d/ippoold {start|stop|status|restart|reload|force-reload}"
+ exit 1
+ esac
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_parallel_make_and_pic.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_parallel_make_and_pic.patch
new file mode 100644
index 000000000..1ebd95ea1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_parallel_make_and_pic.patch
@@ -0,0 +1,89 @@
+1)add -fPIC for $(IPPOOL_RPC_STEM)_xdr.o, $(IPPOOL_RPC_STEM)_client.o
+2)add sub target for subdirs-all, and those dependencies below
+ pppd plugin directory build depends on $(IPPOOL_RPC_STEM)_xdr.o
+$(IPPOOL_RPC_STEM)_client.o ippool_rpc.h
+
+ ippoold depends on libusl
+ ippoolconfig depends on libcli
+
+ $(IPPOOL_RPC_STEM)_xdr.o, $(IPPOOL_RPC_STEM)_client.o
+$(IPPOOL_RPC_STEM)_server.o *.o in main directory depends on ippool_rpc.h
+as those all directly or indirectly include ippool_rpc.h which is
+dynamically generated by rpcgen
+
+to make parallel make working.
+3)include dependency files for pppd.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+diff --git a/Makefile b/Makefile
+index 73aa72f..4f7af1d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -106,14 +106,14 @@ all: generated-files $(IPPOOL_RPC_STEM)_xdr.o $(IPPOOL_RPC_STEM)_client.o \
+ subdirs-all $(PROGS.sbin) $(PROGS.bin)
+
+ # Compile without -Wall because rpcgen-generated code is full of warnings
+-$(IPPOOL_RPC_STEM)_xdr.o: $(IPPOOL_RPC_STEM)_xdr.c
+- $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
++$(IPPOOL_RPC_STEM)_xdr.o: $(IPPOOL_RPC_STEM)_xdr.c $(IPPOOL_RPC_STEM).h
++ $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
+
+-$(IPPOOL_RPC_STEM)_client.o: $(IPPOOL_RPC_STEM)_client.c
+- $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
++$(IPPOOL_RPC_STEM)_client.o: $(IPPOOL_RPC_STEM)_client.c $(IPPOOL_RPC_STEM).h
++ $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
+
+-$(IPPOOL_RPC_STEM)_server.o: $(IPPOOL_RPC_STEM)_server.c
+- $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
++$(IPPOOL_RPC_STEM)_server.o: $(IPPOOL_RPC_STEM)_server.c $(IPPOOL_RPC_STEM).h
++ $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
+
+ $(IPPOOL_RPC_STEM)_xdr.c: $(IPPOOL_RPC_STEM).x
+ -$(RM) $@
+@@ -136,8 +136,12 @@ $(IPPOOL_RPC_STEM).h: $(IPPOOL_RPC_STEM).x
+
+ generated-files: $(RPC_FILES)
+
+-subdirs-all:
+- @for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" all; if [ $$? -ne 0 ]; then exit 1; fi; done
++subdirs-all: $(patsubst %,%-dir, $(SUBDIRS))
++
++pppd-dir: $(IPPOOL_RPC_STEM)_xdr.o $(IPPOOL_RPC_STEM)_client.o $(IPPOOL_RPC_STEM).h
++
++$(patsubst %,%-dir,$(SUBDIRS)):
++ @for d in $(patsubst %-dir,%,$@); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" all; if [ $$? -ne 0 ]; then exit 1; fi; done
+
+ clean:
+ @for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; if [ $$? -ne 0 ]; then exit 1; fi; done
+@@ -151,13 +155,13 @@ TAGS:
+ @for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; done
+ etags -t $(wildcard *.c) $(wildcard *.h)
+
+-ippoold: $(IPPOOLD_SRCS.o)
+- $(CC) -o $@ $^ $(LDFLAGS.ippoold)
++ippoold: $(IPPOOLD_SRCS.o) usl-dir
++ $(CC) -o $@ $(IPPOOLD_SRCS.o) $(LDFLAGS.ippoold)
+
+-ippoolconfig: $(IPPOOLCONFIG_SRCS.o)
+- $(CC) -o $@ $^ $(LDFLAGS.ippoolconfig)
++ippoolconfig: $(IPPOOLCONFIG_SRCS.o) cli-dir
++ $(CC) -o $@ $(IPPOOLCONFIG_SRCS.o) $(LDFLAGS.ippoolconfig)
+
+-%.o: %.c
++%.o: %.c $(IPPOOL_RPC_STEM).h
+ $(CC) -c $(CFLAGS) $< -o $@
+
+ install: all
+diff --git a/pppd/Makefile b/pppd/Makefile
+index 78d9b33..106deca 100644
+--- a/pppd/Makefile
++++ b/pppd/Makefile
+@@ -24,3 +24,5 @@ install: ippool.so
+
+ clean:
+ -rm -rf *.o *.so
++
++include $(wildcard *.d /dev/null)
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_usl_timer.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_usl_timer.patch
new file mode 100644
index 000000000..ca0e3320c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_usl_timer.patch
@@ -0,0 +1,49 @@
+include limits.h to avoid UINT_MAX undefined compiling error.
+remove the unused assign which caused compiling error with -Werror.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+
+diff --git a/usl/usl_timer.c b/usl/usl_timer.c
+index 734b820..fda752b 100644
+--- a/usl/usl_timer.c
++++ b/usl/usl_timer.c
+@@ -42,6 +42,7 @@
+ #include <signal.h>
+ #include <string.h>
+ #include <sys/time.h>
++#include <limits.h>
+
+ #include "usl.h"
+
+@@ -87,14 +88,13 @@ void (*usl_timer_tick_hook)(void);
+ */
+ void usl_timer_tick(void)
+ {
+- int result;
+ char msg = '\0';
+
+ usl_tick++;
+
+ if (!usl_tick_pending) {
+ usl_tick_pending = 1;
+- result = write(usl_tick_pipe[1], &msg, sizeof(msg));
++ write(usl_tick_pipe[1], &msg, sizeof(msg));
+ }
+ }
+
+@@ -111,11 +111,10 @@ static void usl_timer_tick_handler(int fd, void *arg)
+ struct usl_ord_list_head *tmp;
+ struct usl_list_head *iwalk;
+ struct usl_list_head *itmp;
+- int result;
+ char msg;
+ USL_LIST_HEAD(expire_list);
+
+- result = usl_fd_read(usl_tick_pipe[0], &msg, sizeof(msg));
++ usl_fd_read(usl_tick_pipe[0], &msg, sizeof(msg));
+ usl_tick_pending = 0;
+
+ usl_list_for_each(walk, tmp, &usl_timer_list) {
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/makefile-add-ldflags.patch
new file mode 100644
index 000000000..7d5b715ae
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/makefile-add-ldflags.patch
@@ -0,0 +1,21 @@
+Add LDFLAGS variable to Makefile so that extra linker flags can be sent via this variable.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/Makefile b/Makefile
+index 4f7af1d..a05a000 100644
+--- a/Makefile
++++ b/Makefile
+@@ -83,8 +83,8 @@ endif
+
+ CPPFLAGS= $(CPPFLAGS.ippooltest)
+ CFLAGS= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
+-LDFLAGS.ippoold= -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
+-LDFLAGS.ippoolconfig= -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
++LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
++LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
+
+ OPT_CFLAGS?= -O
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/runtest.sh b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/runtest.sh
new file mode 100644
index 000000000..f91f58237
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/runtest.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+BANNER="----------------------------------------------------------------------------"
+TCLSH="tclsh all.tcl -preservecore 3 -verbose bps -tmpdir ./results -outfile test-ippool.result"
+
+test_setup() {
+ if [ -d ./results ]; then rm -fr ./results; fi
+ mkdir ./results
+}
+
+test_ippool() {
+ echo "${BANNER}"
+ eval $TCLSH -constraints "ipPool"
+}
+test_postprocess() {
+ echo "${BANNER}"
+ (failed=`grep FAILED results/*.result | wc -l`; \
+ let failed2=failed/2 ;\
+ passed=`grep PASSED results/*.result | wc -l`; \
+ echo "TEST SUMMARY: $passed tests PASSED, $failed2 tests FAILED" ;\
+ exit $failed2)
+}
+
+test_setup
+test_ippool
+test_postprocess
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool_1.3.bb b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
new file mode 100644
index 000000000..6e4748357
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
@@ -0,0 +1,113 @@
+SUMMARY = "An IP address pool manager"
+DESCRIPTION = "IpPool is implemented as a separate server daemon \
+to allow any application to use its address pools. This makes it possible \
+to define address pools that are shared by PPP, L2TP, PPTP etc. It may be \
+useful in some VPN server setups. IpPool comes with a command line \
+management application, ippoolconfig to manage and query address pool \
+status. A pppd plugin is supplied which allows pppd to request IP \
+addresses from ippoold. \
+"
+HOMEPAGE = "http://www.openl2tp.org/"
+SECTION = "console/network"
+LICENSE = "GPLv2+"
+
+SRC_URI = "https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+ file://runtest.sh \
+ file://ippool.service \
+ file://ippool_usl_timer.patch \
+ file://ippool_parallel_make_and_pic.patch \
+ file://ippool_init.d.patch \
+ file://always_syslog.patch \
+ file://makefile-add-ldflags.patch \
+ file://0001-usl_timer-Check-for-return-value-of-write-API.patch \
+ file://0001-Respect-flags-from-env.patch \
+ file://0001-read-returns-ssize_t.patch \
+ file://0002-Mark-first-element-of-a-string-as-null.patch \
+ file://0003-cli-Mark-return-of-strtol-as-long-int.patch \
+ "
+SRC_URI_append_libc-musl = "\
+ file://0002-link-with-libtirpc.patch \
+ file://0003-musl-fixes.patch \
+ "
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f"
+SRC_URI[md5sum] = "e2401e65db26a3764585b97212888fae"
+SRC_URI[sha256sum] = "d3eab7d6cad5da8ccc9d1e31d5303e27a39622c07bdb8fa3618eea314412075b"
+
+inherit systemd
+
+DEPENDS = "readline ppp ncurses gzip-native"
+DEPENDS_append_libc-musl = " libtirpc"
+RDEPENDS_${PN} = "rpcbind"
+
+EXTRA_OEMAKE = "CC='${CC}' AS='${AS}' LD='${LD}' AR='${AR}' NM='${NM}' STRIP='${STRIP}'"
+EXTRA_OEMAKE += "PPPD_VERSION=${PPPD_VERSION} SYS_LIBDIR=${libdir}"
+# enable self tests
+EXTRA_OEMAKE += "IPPOOL_TEST=y"
+
+CPPFLAGS += "${SELECTED_OPTIMIZATION}"
+CPPFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+
+SYSTEMD_SERVICE_${PN} = "ippool.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+
+do_compile_prepend() {
+ # fix the CFLAGS= and CPPFLAGS= in main Makefile, to have the extra CFLAGS in env
+ sed -i -e "s/^CFLAGS=/CFLAGS+=/" ${S}/Makefile
+ sed -i -e "s/^CPPFLAGS=/CPPFLAGS+=/" ${S}/Makefile
+
+ sed -i -e "s:-I/usr/include/pppd:-I=/usr/include/pppd:" ${S}/pppd/Makefile
+
+}
+
+
+do_install() {
+ oe_runmake DESTDIR=${D} install
+
+ install -D -m 0755 ${S}/debian/init.d ${D}${sysconfdir}/init.d/ippoold
+ install -D -m 0644 ${WORKDIR}/ippool.service ${D}${systemd_system_unitdir}/ippool.service
+ sed -i -e 's:@SBINDIR@:${sbindir}:g' ${D}${systemd_system_unitdir}/ippool.service
+
+ # install self test
+ install -d ${D}/opt/${BPN}
+ install ${S}/test/all.tcl ${S}/test/ippool.test \
+ ${S}/test/test_procs.tcl ${D}/opt/${BPN}
+ install ${WORKDIR}/runtest.sh ${D}/opt/${BPN}
+ # fix the ../ippoolconfig in test_procs.tcl
+ sed -i -e "s:../ippoolconfig:ippoolconfig:" \
+ ${D}/opt/${BPN}/test_procs.tcl
+}
+
+
+PACKAGES =+ "${PN}-test"
+
+FILES_${PN} += "${libdir}/pppd/${PPPD_VERSION}/ippool.so"
+FILES_${PN}-dbg += "${libdir}/pppd/${PPPD_VERSION}/.debug/ippool.so"
+FILES_${PN}-test = "/opt/${BPN}"
+
+# needs tcl to run tests
+RDEPENDS_${PN}-test += "tcl ${BPN}"
+
+PPPD_VERSION="${@get_ppp_version(d)}"
+
+def get_ppp_version(d):
+ import re
+
+ pppd_plugin = d.expand('${STAGING_LIBDIR}/pppd')
+ if not os.path.isdir(pppd_plugin):
+ return None
+
+ bb.debug(1, "pppd plugin dir %s" % pppd_plugin)
+ r = re.compile("\d*\.\d*\.\d*")
+ for f in os.listdir(pppd_plugin):
+ if os.path.isdir(os.path.join(pppd_plugin, f)):
+ ma = r.match(f)
+ if ma:
+ bb.debug(1, "pppd version dir %s" % f)
+ return f
+ else:
+ bb.debug(1, "under pppd plugin dir %s" % f)
+
+ return None
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch
new file mode 100644
index 000000000..f5e1bec8a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch
@@ -0,0 +1,25 @@
+From cfee58d5863a535b61aa54690ae205b876f57944 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 22:53:29 -0800
+Subject: [PATCH 1/2] libopeniscsiusr: Include limit.h for PATH_MAX
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libopeniscsiusr/iface.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libopeniscsiusr/iface.c b/libopeniscsiusr/iface.c
+index 79898df..a48ef36 100644
+--- a/libopeniscsiusr/iface.c
++++ b/libopeniscsiusr/iface.c
+@@ -30,6 +30,7 @@
+ #include <netdb.h>
+ #include <assert.h>
+ #include <inttypes.h>
++#include <limits.h>
+
+ #include "libopeniscsiusr/libopeniscsiusr.h"
+ #include "misc.h"
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch
new file mode 100644
index 000000000..174aa50d2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch
@@ -0,0 +1,25 @@
+From 197713ad7e3e944102bbd792e1ab9ec4a67100c0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 23:25:21 -0800
+Subject: [PATCH 1/4] qedi.c: Removed unused linux/ethtool.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ iscsiuio/src/unix/libs/qedi.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/iscsiuio/src/unix/libs/qedi.c b/iscsiuio/src/unix/libs/qedi.c
+index b81fecd..24cb89a 100644
+--- a/iscsiuio/src/unix/libs/qedi.c
++++ b/iscsiuio/src/unix/libs/qedi.c
+@@ -49,7 +49,6 @@
+ #include <arpa/inet.h>
+ #include <linux/types.h>
+ #include <linux/sockios.h>
+-#include <linux/ethtool.h>
+ #include <linux/netlink.h>
+ #include <sys/mman.h>
+ #include <sys/ioctl.h>
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch
new file mode 100644
index 000000000..aecede6ee
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch
@@ -0,0 +1,25 @@
+From 2b39f85dcf020647544002cb0b0e734748391dfb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 23:27:25 -0800
+Subject: [PATCH 2/4] idbm.c: Include fcnl.h for O_RDWR and O_CREAT definitions
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usr/idbm.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/usr/idbm.c b/usr/idbm.c
+index 5532202..0a51b85 100644
+--- a/usr/idbm.c
++++ b/usr/idbm.c
+@@ -27,6 +27,7 @@
+ #include <errno.h>
+ #include <dirent.h>
+ #include <limits.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch
new file mode 100644
index 000000000..836ed6048
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch
@@ -0,0 +1,29 @@
+From 29571f71692e28ce9a17d1450097a98492f3b465 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 22:54:04 -0800
+Subject: [PATCH 2/2] libopeniscsiusr: Add CFLAGS to linker cmdline
+
+This will ensure that -fPIC is passed to linker as
+well
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libopeniscsiusr/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile
+index 8b9b523..4f1d0d6 100644
+--- a/libopeniscsiusr/Makefile
++++ b/libopeniscsiusr/Makefile
+@@ -49,7 +49,7 @@ LIBADD =
+ all: $(LIBS) $(LIBS_MAJOR) $(TESTS) doc
+
+ $(LIBS): $(OBJS)
+- $(CC) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LIBADD)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LIBADD)
+ ln -sf $@ $(DEVLIB)
+
+ $(LIBS_MAJOR): $(LIBS)
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch
new file mode 100644
index 000000000..0ce155f7a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch
@@ -0,0 +1,49 @@
+From 9b7a32903b56ce4d41f264a345ca59a0b00d53b3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 23:28:33 -0800
+Subject: [PATCH 3/4] bnx2x.c: Reorder the includes to avoid duplicate defines
+ with musl
+
+including nic.h before linux/ethtool.h avoids redefinitions of
+eth structs
+
+/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/
+usr/include/netinet/if_ether.h:104:8: error: redefinition of 'struct ethhdr'
+ struct ethhdr {
+ ^~~~~~
+In file included from /mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.
+876-r0/recipe-sysroot/usr/include/linux/ethtool.h:19:0,
+ from qedi.c:52:
+/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/
+usr/include/linux/if_ether.h:154:8: note: originally defined here
+ struct ethhdr {
+ ^~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ iscsiuio/src/unix/libs/bnx2x.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c
+index 3df6d5f..62530d1 100644
+--- a/iscsiuio/src/unix/libs/bnx2x.c
++++ b/iscsiuio/src/unix/libs/bnx2x.c
+@@ -36,6 +36,7 @@
+ * bnx2x.c - bnx2x user space driver
+ *
+ */
++#include "nic.h"
+ #include <errno.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -58,7 +59,6 @@
+ #include "bnx2x.h"
+ #include "cnic.h"
+ #include "logger.h"
+-#include "nic.h"
+ #include "nic_id.h"
+ #include "nic_utils.h"
+ #include "options.h"
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch
new file mode 100644
index 000000000..57bdc8cb6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch
@@ -0,0 +1,28 @@
+From 6f9c1a04d250388d1574cfaf20a1ff66a64beb48 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 23:42:12 -0800
+Subject: [PATCH 4/4] fwparam_ppc.c: Do not use __compar_fn_t
+
+__compar_fn_t is not defined in musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/fwparam_ibft/fwparam_ppc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/fwparam_ibft/fwparam_ppc.c b/utils/fwparam_ibft/fwparam_ppc.c
+index c298b8c..391faa2 100644
+--- a/utils/fwparam_ibft/fwparam_ppc.c
++++ b/utils/fwparam_ibft/fwparam_ppc.c
+@@ -356,7 +356,7 @@ static int loop_devs(const char *devtree)
+ * Sort the nics into "natural" order. The proc fs
+ * device-tree has them in somewhat random, or reversed order.
+ */
+- qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp);
++ qsort(niclist, nic_count, sizeof(char *), nic_cmp);
+
+ snprintf(prefix, sizeof(prefix), "%s/%s", devtree, "aliases");
+ dev_count = 0;
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils
new file mode 100644
index 000000000..42fdd602f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils
@@ -0,0 +1,2 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d root root 0755 /var/lock/iscsi none
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian
new file mode 100644
index 000000000..99a763861
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian
@@ -0,0 +1,119 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop:
+# Short-Description: Starts and stops the iSCSI initiator services and logins to default targets
+### END INIT INFO
+#set -x
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/iscsid
+ADM=/usr/sbin/iscsiadm
+PIDFILE=/var/run/iscsid.pid
+
+[ -x "$DAEMON" ] || exit 0
+
+if [ ! -d /sys/class/ ]; then
+ echo "Failure:" "iSCSI requires a mounted sysfs, not started."
+ exit 1
+fi
+
+nodestartup_re='s/^node\.conn\[0]\.startup[ ]*=[ ]*//p'
+
+RETVAL=0
+
+start() {
+ echo "Starting iSCSI initiator service" "iscsid"
+ modprobe -q iscsi_tcp 2>/dev/null || :
+ modprobe -q ib_iser 2>/dev/null || :
+ if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then
+ INITIATORNAME=$(iscsi-iname)
+ cat >/etc/iscsi/initiatorname.iscsi <<EOF
+## DO NOT EDIT OR REMOVE THIS FILE!
+## If you remove this file, the iSCSI daemon will not start.
+## If you change the InitiatorName, existing access control lists
+## may reject this initiator. The InitiatorName must be unique
+## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
+InitiatorName=$INITIATORNAME
+EOF
+ fi
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
+ RETVAL=$?
+ starttargets
+}
+
+starttargets() {
+ echo "Setting up iSCSI targets"
+ $ADM -m node --loginall=automatic
+}
+
+stoptargets() {
+ echo "Disconnecting iSCSI targets"
+ sync
+ $ADM -m node --logoutall=all
+ RETVAL=$?
+ #if RETVAL is 21, means no active sessions, consider ok
+ if [ "$RETVAL" = "21" ]; then
+ RETVAL=0
+ fi
+}
+
+stop() {
+ stoptargets
+ if [ $RETVAL -ne 0 ]; then
+ echo "Failure:" "Could not stop all targets, try again later"
+ return $RETVAL
+ fi
+
+ echo "Stopping iSCSI initiator service"
+ start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
+ rm -f $PIDFILE
+ status=0
+ modprobe -r ib_iser 2>/dev/null
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
+ modprobe -r iscsi_tcp 2>/dev/null
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
+}
+
+restart() {
+ stop
+ if [ $RETVAL -ne 0 ]; then
+ echo "Failure:" "Stopping iSCSI initiator service failed, not starting"
+ return $RETVAL
+ fi
+ start
+}
+
+restarttargets() {
+ stoptargets
+ if [ $RETVAL -ne 0 ]; then
+ echo "Failure:" "Could not stop all targets, try again later"
+ return $RETVAL
+ fi
+ starttargets
+}
+
+status() {
+ #XXX FIXME: what to do here?
+ #status iscsid
+ # list active sessions
+ echo Current active iSCSI sessions:
+ $ADM -m session
+}
+
+case "$1" in
+ start|starttargets|stop|stoptargets|restart|restarttargets|status)
+ $1
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
+exit $RETVAL
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator
new file mode 100644
index 000000000..7fa49a2d6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator
@@ -0,0 +1,4 @@
+# default command line settings for open-iscsi's iscsid
+
+OPTS_ISCSID=""
+OPTS_ISCSIADM=""
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service
new file mode 100644
index 000000000..564b2d21d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Open-iSCSI initiator (i.e. client) target bindings
+After=iscsi-initiator.service
+Requires=iscsi-initiator.service
+
+[Service]
+Type=oneshot
+EnvironmentFile=/etc/default/iscsi-initiator
+ExecStart=/usr/sbin/iscsiadm -m node --loginall=automatic $OPTS_ISCSIADM
+ExecStop=/usr/sbin/iscsiadm -m node --logoutall=all $OPTS_ISCSIADM
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service
new file mode 100644
index 000000000..3790daebd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Open-iSCSI initiator (i.e. client) service
+After=syslog.target
+
+[Service]
+EnvironmentFile=/etc/default/iscsi-initiator
+ExecStartPre=/sbin/modprobe iscsi_tcp
+ExecStartPre=/usr/lib/iscsi/set_initiatorname
+ExecStart=/usr/sbin/iscsid -f $OPTS_ISCSID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname
new file mode 100644
index 000000000..a196c6b79
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname
@@ -0,0 +1,12 @@
+#!/bin/sh
+if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then
+ INITIATORNAME=$(iscsi-iname)
+ cat >/etc/iscsi/initiatorname.iscsi <<EOF
+## DO NOT EDIT OR REMOVE THIS FILE!
+## If you remove this file, the iSCSI daemon will not start.
+## If you change the InitiatorName, existing access control lists
+## may reject this initiator. The InitiatorName must be unique
+## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
+InitiatorName=$INITIATORNAME
+EOF
+fi
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.876.bb b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.876.bb
new file mode 100644
index 000000000..823227c46
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.876.bb
@@ -0,0 +1,117 @@
+SUMMARY = "iSCSI daemon and utility programs"
+DESCRIPTION = "Open-iSCSI project is a high performance, transport \
+independent, multi-platform implementation of RFC3720. The iscsi package \
+provides the server daemon for the iSCSI protocol, as well as the utility \
+programs used to manage it. iSCSI is a protocol for distributed \
+disk access using SCSI commands sent over Internet Protocol networks."
+HOMEPAGE = "http://www.open-iscsi.com/"
+LICENSE = "GPLv2 & LGPLv2.1"
+SECTION = "net"
+DEPENDS = "openssl flex-native bison-native open-isns util-linux"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRCREV ?= "24580adc4c174bbc5dde3ae7594a46d57635e906"
+
+SRC_URI = "git://github.com/open-iscsi/open-iscsi \
+ file://initd.debian \
+ file://99_iscsi-initiator-utils \
+ file://iscsi-initiator \
+ file://iscsi-initiator.service \
+ file://iscsi-initiator-targets.service \
+ file://set_initiatorname \
+ file://0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch \
+ file://0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch \
+ file://0001-qedi.c-Removed-unused-linux-ethtool.h.patch \
+ file://0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch \
+ file://0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch \
+ file://0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch \
+"
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
+
+inherit update-rc.d systemd autotools
+
+EXTRA_OECONF = " \
+ --target=${TARGET_SYS} \
+ --host=${BUILD_SYS} \
+"
+
+EXTRA_OEMAKE = ' \
+ OS="${TARGET_SYS}" \
+ TARGET="${TARGET_OS}" \
+ BASE="${prefix}" \
+ MANDIR="${mandir}" \
+'
+
+do_configure () {
+ cd ${S}/iscsiuio ; autoreconf --install; ./configure ${EXTRA_OECONF}
+}
+
+do_compile () {
+ # Make sure we DO NOT regenerate prom_lex.c.
+ if [ -f ${S}/utils/fwparam_ibft/prom_lex.l ]; then
+ mv ${S}/utils/fwparam_ibft/prom_lex.l ${S}/utils/fwparam_ibft/prom_lex.l.unused
+ fi
+ oe_runmake -C ${S} ${EXTRA_OEMAKE} user
+}
+
+do_install () {
+ #install necessary directories
+ install -d ${D}${sbindir} \
+ ${D}${sysconfdir}/init.d \
+ ${D}${sysconfdir}/iscsi \
+ ${D}${localstatedir}/lib/iscsi/nodes \
+ ${D}${localstatedir}/lib/iscsi/send_targets \
+ ${D}${localstatedir}/lib/iscsi/static \
+ ${D}${localstatedir}/lib/iscsi/isns \
+ ${D}${localstatedir}/lib/iscsi/slp \
+ ${D}${localstatedir}/lib/iscsi/ifaces \
+ ${D}${libdir} \
+ ${D}${mandir}/man8
+
+ install -p -m 755 ${S}/usr/iscsid ${S}/usr/iscsiadm \
+ ${S}/utils/iscsi-iname \
+ ${S}/usr/iscsistart ${D}/${sbindir}
+
+ cp -dR ${S}/libopeniscsiusr/libopeniscsiusr.so* ${D}${libdir}
+ install -p -m 644 ${S}/doc/iscsiadm.8 ${S}/doc/iscsid.8 ${D}/${mandir}/man8
+ install -p -m 644 ${S}/etc/iscsid.conf ${D}${sysconfdir}/iscsi
+ install -p -m 755 ${WORKDIR}/initd.debian ${D}${sysconfdir}/init.d/iscsid
+
+ sed -i -e "s:= /sbin/iscsid:= ${sbindir}/iscsid:" ${D}${sysconfdir}/iscsi/iscsid.conf
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /run/${BPN}/lock - - - -" \
+ > ${D}${sysconfdir}/tmpfiles.d/iscsi.conf
+ install -d ${D}/etc/default/
+ install -p -m 755 ${WORKDIR}/iscsi-initiator ${D}${sysconfdir}/default/
+
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/iscsi-initiator.service \
+ ${WORKDIR}/iscsi-initiator-targets.service \
+ ${D}${systemd_unitdir}/system/
+ install -d ${D}${nonarch_libdir}/iscsi
+ install -m 0755 ${WORKDIR}/set_initiatorname ${D}${nonarch_libdir}/iscsi
+ else
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/99_iscsi-initiator-utils ${D}/etc/default/volatiles
+ fi
+}
+
+pkg_postinst_${PN}() {
+ if [ "x$D" = "x" ]; then
+ if [ -e /etc/init.d/populate-volatile.sh ]; then
+ /etc/init.d/populate-volatile.sh update
+ elif command -v systemd-tmpfiles >/dev/null; then
+ systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/iscsi.conf
+ fi
+ fi
+}
+
+SYSTEMD_SERVICE = " iscsi-initiator.service iscsi-initiator-targets.service "
+INITSCRIPT_NAME = "iscsid"
+INITSCRIPT_PARAMS = "start 30 1 2 3 4 5 . stop 70 0 1 2 3 4 5 6 ."
+
+FILES_${PN} += "${nonarch_libdir}/iscsi"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/keepalived/keepalived_1.4.2.bb b/meta-openembedded/meta-networking/recipes-daemons/keepalived/keepalived_1.4.2.bb
new file mode 100644
index 000000000..36417b72a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/keepalived/keepalived_1.4.2.bb
@@ -0,0 +1,48 @@
+SUMMARY = "High Availability monitor built upon LVS, VRRP and service pollers"
+DESCRIPTION = "Keepalived is a routing software written in C. The main goal \
+of this project is to provide simple and robust facilities for loadbalancing \
+and high-availability to Linux system and Linux based infrastructures. \
+Loadbalancing framework relies on well-known and widely used Linux Virtual \
+Server (IPVS) kernel module providing Layer4 loadbalancing \
+"
+HOMEPAGE = "http://www.keepalived.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "http://www.keepalived.org/software/${BP}.tar.gz"
+SRC_URI[md5sum] = "610af6e04071f02d3469191de7499f4e"
+SRC_URI[sha256sum] = "4e2d7cc01a6ee29a3955f5c622d47704ba7d9dd758189f15e9def016a2d1faa3"
+
+DEPENDS = "libnfnetlink openssl"
+
+inherit autotools pkgconfig systemd update-rc.d
+
+PACKAGECONFIG ??= "libnl snmp \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+"
+PACKAGECONFIG[libnl] = "--enable-libnl,--disable-libnl,libnl"
+PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
+PACKAGECONFIG[systemd] = "--with-init=systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--with-init=SYSV,systemd"
+
+EXTRA_OECONF = "--disable-libiptc"
+EXTRA_OEMAKE = "initdir=${sysconfdir}/init.d"
+
+do_install_append() {
+ if [ -f ${D}${sysconfdir}/init.d/${BPN} ]; then
+ chmod 0755 ${D}${sysconfdir}/init.d/${BPN}
+ sed -i 's#rc.d/##' ${D}${sysconfdir}/init.d/${BPN}
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -D -m 0644 ${B}/${BPN}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service
+ fi
+}
+
+FILES_${PN} += "${datadir}/snmp/mibs/KEEPALIVED-MIB.txt"
+
+INITSCRIPT_NAME = "keepalived"
+INITSCRIPT_PARAMS = "remove"
+
+SYSTEMD_SERVICE_${PN} = "keepalived.service"
+SYSTEMD_AUTO_ENABLE ?= "disable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.default b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.default
new file mode 100644
index 000000000..3acacfd90
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.default
@@ -0,0 +1,2 @@
+# Uncomment to start SNMP subagent and enable CDP, SONMP and EDP protocol
+#DAEMON_ARGS="-x -c -s -e"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.init.d b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.init.d
new file mode 100644
index 000000000..88bf95898
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.init.d
@@ -0,0 +1,128 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: lldpd
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $network $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: LLDP daemon
+# Description: lldpd is a 802.1AB implementation, a L2 network
+# discovery protocol. It also supports CDP, EDP and
+# various other protocols.
+### END INIT INFO
+
+# Do NOT "set -e"
+
+log_daemon_msg() {
+ echo $*
+}
+
+log_end_msg() {
+ if [ $1 -eq 0 ]; then
+ success $*
+ else
+ failure $*
+ fi
+}
+
+log_failure_msg() {
+ echo $*
+}
+
+log_success_msg() {
+ echo $*
+}
+
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="LLDP daemon"
+NAME=lldpd
+DAEMON=/usr/sbin/$NAME
+DAEMON_ARGS=""
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+CHROOT=/var/run/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# LSB log_* functions
+. /etc/init.d/functions
+
+do_start()
+{
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+ $DAEMON_ARGS \
+ || return 2
+}
+
+do_stop()
+{
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+ RETVAL="$?"
+ [ "$RETVAL" = 2 ] && return 2
+ start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+ [ "$?" = 2 ] && return 2
+ rm -f $PIDFILE
+ return "$RETVAL"
+}
+
+do_reload() {
+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+ return 0
+}
+
+case "$1" in
+ start)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+ do_start
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ stop)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ reload)
+ log_daemon_msg "Reloading $DESC" "$NAME"
+ do_reload
+ log_end_msg $?
+ ;;
+ restart|force-reload)
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1)
+ do_start
+ case "$?" in
+ 0) log_end_msg 0 ;;
+ 1) log_end_msg 1 ;; # Old process is still running
+ *) log_end_msg 1 ;; # Failed to start
+ esac
+ ;;
+ *)
+ # Failed to stop
+ log_end_msg 1
+ ;;
+ esac
+ ;;
+ status)
+ status_of_proc $DAEMON $NAME -p $PIDFILE && exit 0 || exit $?
+ ;;
+ *)
+ echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
+ exit 3
+ ;;
+esac
+
+:
diff --git a/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch
new file mode 100644
index 000000000..4876e1794
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch
@@ -0,0 +1,32 @@
+From f9f3e4dd31588cce5f655730da7b5c3f56a9bdc1 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Tue, 26 Sep 2017 09:19:51 -0300
+Subject: [PATCH] src/daemon/lldpd.service.in: Use fixed path for mkdir command
+Organization: O.S. Systems Software LTDA.
+
+@mkdir_p@ is expanded to host tools path ../build/tmp/hosttools/mkdir that
+doesn't exist on target. Remove @mkdir_p@ and use /bin/mkdir -p to
+create /var/run/lldpd directory.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ src/daemon/lldpd.service.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/daemon/lldpd.service.in b/src/daemon/lldpd.service.in
+index fdb7338..4291830 100644
+--- a/src/daemon/lldpd.service.in
++++ b/src/daemon/lldpd.service.in
+@@ -9,7 +9,7 @@ Type=notify
+ NotifyAccess=main
+ EnvironmentFile=-/etc/default/lldpd
+ EnvironmentFile=-/etc/sysconfig/lldpd
+-ExecStartPre=@mkdir_p@ @PRIVSEP_CHROOT@
++ExecStartPre=/bin/mkdir -p @PRIVSEP_CHROOT@
+ ExecStart=@sbindir@/lldpd $DAEMON_ARGS $LLDPD_OPTIONS
+ Restart=on-failure
+ PrivateTmp=yes
+--
+2.14.2
diff --git a/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.8.bb b/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.8.bb
new file mode 100644
index 000000000..dbd84cf67
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.8.bb
@@ -0,0 +1,65 @@
+SUMMARY = "A 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments"
+SECTION = "net/misc"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"
+
+DEPENDS = "libbsd libevent"
+
+SRC_URI = "\
+ http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \
+ file://lldpd.init.d \
+ file://lldpd.default \
+ file://src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch \
+ "
+
+SRC_URI[md5sum] = "8809600492f6b73149eb19158e819c1f"
+SRC_URI[sha256sum] = "9ee494e91bc33938575b2c09b26188c486ef8eac6e2155d250c189cc4e988c4f"
+
+inherit autotools update-rc.d useradd systemd pkgconfig bash-completion
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system -g lldpd --shell /bin/false lldpd"
+GROUPADD_PARAM_${PN} = "--system lldpd"
+
+EXTRA_OECONF += "--without-embedded-libevent \
+ --disable-oldies \
+ --with-privsep-user=lldpd \
+ --with-privsep-group=lldpd \
+ --with-systemdsystemunitdir=${systemd_system_unitdir} \
+ --without-sysusersdir \
+"
+
+PACKAGECONFIG ??= "cdp fdp edp sonmp lldpmed dot1 dot3"
+PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxm2"
+PACKAGECONFIG[snmp] = "--with-snmp,--without-snmp,net-snmp"
+PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
+PACKAGECONFIG[seccomp] = "--with-seccomp,--without-seccomp,libseccomp"
+PACKAGECONFIG[cdp] = "--enable-cdp,--disable-cdp"
+PACKAGECONFIG[fdp] = "--enable-fdp,--disable-fdp"
+PACKAGECONFIG[edp] = "--enable-edp,--disable-edp"
+PACKAGECONFIG[sonmp] = "--enable-sonmp,--disable-sonmp"
+PACKAGECONFIG[lldpmed] = "--enable-lldpmed,--disable-lldpmed"
+PACKAGECONFIG[dot1] = "--enable-dot1,--disable-dot1"
+PACKAGECONFIG[dot3] = "--enable-dot3,--disable-dot3"
+PACKAGECONFIG[custom] = "--enable-custom,--disable-custom"
+
+INITSCRIPT_NAME = "lldpd"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "lldpd.service"
+
+do_install_append() {
+ install -Dm 0755 ${WORKDIR}/lldpd.init.d ${D}${sysconfdir}/init.d/lldpd
+ install -Dm 0644 ${WORKDIR}/lldpd.default ${D}${sysconfdir}/default/lldpd
+ # Make an empty configuration file
+ touch ${D}${sysconfdir}/lldpd.conf
+}
+
+PACKAGES =+ "${PN}-zsh-completion"
+
+FILES_${PN} += "${libdir}/sysusers.d"
+RDEPENDS_${PN} += "os-release"
+
+FILES_${PN}-zsh-completion += "${datadir}/zsh/"
+# FIXME: zsh is broken in meta-oe so this cannot be enabled for now
+#RDEPENDS_${PN}-zsh-completion += "zsh"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/ncftp-configure-use-BUILD_CC-for-ccdv.patch b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/ncftp-configure-use-BUILD_CC-for-ccdv.patch
new file mode 100644
index 000000000..aa590175c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/ncftp-configure-use-BUILD_CC-for-ccdv.patch
@@ -0,0 +1,32 @@
+From 043e1a9ec83a59671ef8c4cad679dbf781e5ef98 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Sun, 29 Nov 2015 23:37:06 -0800
+Subject: [PATCH] configure: use BUILD_CC for ccdv
+
+ccdv is intended to be invoked from Makefiles only,
+it doesn't work for the cross compiling, so compile
+it with $BUILD_CC and corresponding CFLAGS.
+
+Upstream-Status: Inappropriate [cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 2f0fae0..a7e9112 100755
+--- a/configure
++++ b/configure
+@@ -11286,7 +11286,7 @@ panic:
+ } /* main */
+ /* eof ccdv.c */
+ EOF
+- ${CC-cc} $DEFS $CPPFLAGS $CFLAGS "ccdv.c" -o "ccdv" >/dev/null 2>&1
++ ${BUILD_CC} $DEFS ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} "ccdv.c" -o "ccdv" >/dev/null 2>&1
+ rm -f ccdv.c ccdv.o ccdv.c.gz.uu ccdv.c.gz
+ strip ./ccdv >/dev/null 2>&1
+ ./ccdv >/dev/null 2>&1
+--
+2.3.5
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/unistd.patch b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/unistd.patch
new file mode 100644
index 000000000..1c8146eda
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/unistd.patch
@@ -0,0 +1,32 @@
+This patch is needed to avoid double definitions of functions
+especially when building with security flags turned on. The double
+definitions causes the sed.sh script in configure to fail since it
+starts to spit out double outputs e.g.
+
+wi_cv_gethostname_size_t size_t size_t
+
+which then caused almost all subsequent compile time tests to fail since
+this gets into confdefs.h file
+
+removing this include causes only one definitions to be emitted into
+the genrated protos.h file and thus avoiding the above failure.
+
+Other solution would to fix sed.sh to ignore double definitions
+
+Upstream-Status: Pending
+
+Signed-of-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: ncftp-3.2.6/configure
+===================================================================
+--- ncftp-3.2.6.orig/configure
++++ ncftp-3.2.6/configure
+@@ -7859,7 +7859,6 @@ chmod 755 "$wi_tmpdir/prpp.pl"
+ cat << 'EOF' > "$wi_tmpdir/unistd.c"
+ #include <confdefs.h>
+
+-#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp_3.2.6.bb b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp_3.2.6.bb
new file mode 100644
index 000000000..5f92f27fd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp_3.2.6.bb
@@ -0,0 +1,35 @@
+DESCRIPTION = "A sophisticated console ftp client"
+HOMEPAGE = "http://ncftp.com/"
+SECTION = "net"
+LICENSE = "ClArtistic"
+LIC_FILES_CHKSUM = "file://ncftp/cmds.c;beginline=3;endline=4;md5=9c2390809f71465aa7ff76e03dc14d91"
+DEPENDS = "ncurses"
+
+SRC_URI = "ftp://ftp.ncftp.com/${BPN}/${BP}-src.tar.xz \
+ file://ncftp-configure-use-BUILD_CC-for-ccdv.patch \
+ file://unistd.patch \
+"
+SRC_URI[md5sum] = "42d0f896d69a4d603ec097546444245f"
+SRC_URI[sha256sum] = "5f200687c05d0807690d9fb770327b226f02dd86155b49e750853fce4e31098d"
+
+inherit autotools-brokensep pkgconfig
+
+CFLAGS += "-DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -Wall"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[ccdv] = "--enable-ccdv,--disable-ccdv,,"
+
+EXTRA_OECONF = "--disable-precomp"
+TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}"
+
+do_configure() {
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+ oe_runconf
+}
+do_install () {
+ install -d ${D}${bindir} ${D}${sysconfdir} ${D}${mandir}
+ oe_runmake 'prefix=${D}${prefix}' 'BINDIR=${D}${bindir}' \
+ 'SYSCONFDIR=${D}${sysconfdir}' 'mandir=${D}${mandir}' \
+ install
+}
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-Fix-build-failures-with-gcc7.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-Fix-build-failures-with-gcc7.patch
new file mode 100644
index 000000000..4f493f7b8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-Fix-build-failures-with-gcc7.patch
@@ -0,0 +1,49 @@
+From 398c6db66c643ed6133cc2b028ab1e27a17c5295 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 1 May 2017 19:10:09 +0000
+Subject: [PATCH] Fix build failures with gcc7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ plugins/ipmidirect/ipmi_mc_vendor.cpp | 2 +-
+ plugins/ipmidirect/ipmi_resource.cpp | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/plugins/ipmidirect/ipmi_mc_vendor.cpp b/plugins/ipmidirect/ipmi_mc_vendor.cpp
+index 2c6c090..557771c 100644
+--- a/plugins/ipmidirect/ipmi_mc_vendor.cpp
++++ b/plugins/ipmidirect/ipmi_mc_vendor.cpp
+@@ -322,7 +322,7 @@ cIpmiMcVendor::CreateResources( cIpmiDomain *domain, cIpmiMc *source_mc, cIpmiSd
+ if ( addr.m_channel != source_mc->GetChannel() )
+ stdlog << "WARNING : SDR channel " << addr.m_channel << " NOT equal to MC channel " << source_mc->GetChannel() << "\n";
+
+- if ( FindOrCreateResource( domain, source_mc, fru_id, sdr, sdrs ) == false ) {
++ if ( !FindOrCreateResource( domain, source_mc, fru_id, sdr, sdrs ) ) {
+ return false;
+ }
+ }
+diff --git a/plugins/ipmidirect/ipmi_resource.cpp b/plugins/ipmidirect/ipmi_resource.cpp
+index c438e74..2552673 100644
+--- a/plugins/ipmidirect/ipmi_resource.cpp
++++ b/plugins/ipmidirect/ipmi_resource.cpp
+@@ -73,7 +73,7 @@ cIpmiResource::SendCommandReadLock( const cIpmiMsg &msg, cIpmiMsg &rsp,
+
+ domain->ReadLock();
+
+- if ( domain->VerifyResource( resource ) == false )
++ if ( !domain->VerifyResource( resource ) )
+ return SA_ERR_HPI_NOT_PRESENT;
+
+ return rv;
+@@ -91,7 +91,7 @@ cIpmiResource::SendCommandReadLock( cIpmiRdr *rdr, const cIpmiMsg &msg, cIpmiMsg
+
+ domain->ReadLock();
+
+- if ( domain->VerifyRdr( rdr ) == false )
++ if ( !domain->VerifyRdr( rdr ) )
+ return SA_ERR_HPI_NOT_PRESENT;
+
+ return rv;
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-ipmidirect-Replace-__STRING.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-ipmidirect-Replace-__STRING.patch
new file mode 100644
index 000000000..4d56f6535
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-ipmidirect-Replace-__STRING.patch
@@ -0,0 +1,31 @@
+From be40b3f11460cf495bbbef45692e7763afda0c2b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 14 Sep 2017 17:56:31 -0700
+Subject: [PATCH] ipmidirect: Replace __STRING
+
+__STRING is not universally available e.g.
+musl does not define it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ plugins/ipmidirect/t/test.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/ipmidirect/t/test.h b/plugins/ipmidirect/t/test.h
+index 8d71381..978d5ff 100644
+--- a/plugins/ipmidirect/t/test.h
++++ b/plugins/ipmidirect/t/test.h
+@@ -22,7 +22,7 @@ TestFunction( const char *str, const char *file, int line, bool expr )
+ }
+
+
+-#define Test(expr) TestFunction( __STRING(expr), __FILE__, __LINE__, expr )
++#define Test(expr) TestFunction( #expr, __FILE__, __LINE__, expr )
+
+
+ static int
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch
new file mode 100644
index 000000000..0f033ac85
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch
@@ -0,0 +1,47 @@
+From be665d9513cca7e8b64c79ae424cf44ac166b052 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 14 Sep 2017 17:07:58 -0700
+Subject: [PATCH] plugins: Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+ before use
+
+musl does not define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+so we can not assume that all Linux systems support PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+its a glibc specific define so check for it being defined before using it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ plugins/dynamic_simulator/thread.cpp | 2 +-
+ plugins/ipmidirect/thread.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/dynamic_simulator/thread.cpp b/plugins/dynamic_simulator/thread.cpp
+index d663be0..9210fd7 100644
+--- a/plugins/dynamic_simulator/thread.cpp
++++ b/plugins/dynamic_simulator/thread.cpp
+@@ -229,7 +229,7 @@ cThread::Exit( void *rv )
+ /**
+ * Constructor
+ **/
+-#if ( defined(__sun) && defined(__SVR4) ) || defined(__FreeBSD__)
++#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+ cThreadLock::cThreadLock()
+ {
+ pthread_mutexattr_t attr;
+diff --git a/plugins/ipmidirect/thread.cpp b/plugins/ipmidirect/thread.cpp
+index 5c52557..48e83fa 100644
+--- a/plugins/ipmidirect/thread.cpp
++++ b/plugins/ipmidirect/thread.cpp
+@@ -167,7 +167,7 @@ cThread::Exit( void *rv )
+ // cThreadLock
+ //////////////////////////////////////////////////
+
+-#if ( defined(__sun) && defined(__SVR4) ) || defined(__FreeBSD__)
++#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+ cThreadLock::cThreadLock()
+ {
+ pthread_mutexattr_t attr;
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/c++11.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/c++11.patch
new file mode 100644
index 000000000..0549d5977
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/c++11.patch
@@ -0,0 +1,12 @@
+Index: openhpi-3.6.1/configure.ac
+===================================================================
+--- openhpi-3.6.1.orig/configure.ac
++++ openhpi-3.6.1/configure.ac
+@@ -44,6 +44,7 @@ AC_PROG_CPP
+ AC_PROG_INSTALL
+ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
++AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
+
+ enabled_non32bit="no"
+ AC_ARG_ENABLE([non32bit-int],
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch
new file mode 100644
index 000000000..9b35a0cce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch
@@ -0,0 +1,1288 @@
+Index: openhpi-3.6.1/plugins/dynamic_simulator/new_sim.cpp
+===================================================================
+--- openhpi-3.6.1.orig/plugins/dynamic_simulator/new_sim.cpp
++++ openhpi-3.6.1/plugins/dynamic_simulator/new_sim.cpp
+@@ -415,7 +415,7 @@ extern "C" {
+ /**
+ * Alias for @ref öh_open(), implemented by @ref NewSimulatorOpen().
+ **/
+-static void * NewSimulatorOpen( GHashTable *, unsigned int, oh_evt_queue * ) __attribute__((used));
++static void * NewSimulatorOpen( GHashTable *, unsigned int, oh_evt_queue * ) __asm__("NewSimulatorOpen") __attribute__((used));
+
+ /**
+ * @fn NewSimulatorOpen( GHashTable *handler_config, unsigned int hid,
+@@ -530,7 +530,7 @@ static void * NewSimulatorOpen( GHashTab
+ /**
+ * Alias for @ref öh_close(), implemented by @ref NewSimulatorClose().
+ **/
+-static void NewSimulatorClose( void * ) __attribute__((used));
++static void NewSimulatorClose( void * ) __asm__("NewSimulatorClose") __attribute__((used));
+
+ /**
+ * @relate NewSimulatorClose
+@@ -585,7 +585,7 @@ static void NewSimulatorClose( void *hnd
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorGetEvent( void * ) __attribute__((used));
++static SaErrorT NewSimulatorGetEvent( void * ) __asm__("NewSimulatorGetEvent") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetEvent( void *hnd ) {
+ dbg( "NewSimulatorGetEvent" );
+@@ -613,7 +613,7 @@ static SaErrorT NewSimulatorGetEvent( vo
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorDiscoverResources( void * ) __attribute__((used));
++static SaErrorT NewSimulatorDiscoverResources( void * ) __asm__("NewSimulatorDiscoverResources") __attribute__((used));
+
+ static SaErrorT NewSimulatorDiscoverResources( void *hnd ) {
+ dbg( "NewSimulatorDiscoverResources" );
+@@ -641,7 +641,7 @@ static SaErrorT NewSimulatorDiscoverReso
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorSetResourceTag( void *, SaHpiResourceIdT, SaHpiTextBufferT * ) __attribute__((used));
++static SaErrorT NewSimulatorSetResourceTag( void *, SaHpiResourceIdT, SaHpiTextBufferT * ) __asm__("NewSimulatorSetResourceTag") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetResourceTag( void *hnd, SaHpiResourceIdT id,
+ SaHpiTextBufferT *tag ) {
+@@ -669,7 +669,7 @@ static SaErrorT NewSimulatorSetResourceT
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorSetResourceSeverity( void *, SaHpiResourceIdT, SaHpiSeverityT ) __attribute__((used));
++static SaErrorT NewSimulatorSetResourceSeverity( void *, SaHpiResourceIdT, SaHpiSeverityT ) __asm__("NewSimulatorSetResourceSeverity") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetResourceSeverity( void *hnd, SaHpiResourceIdT id,
+ SaHpiSeverityT sev ) {
+@@ -703,7 +703,7 @@ static SaErrorT NewSimulatorGetSensorRea
+ SaHpiResourceIdT id,
+ SaHpiSensorNumT num,
+ SaHpiSensorReadingT *data,
+- SaHpiEventStateT *state ) __attribute__((used));
++ SaHpiEventStateT *state ) __asm__("NewSimulatorGetSensorReading") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorReading( void *hnd,
+ SaHpiResourceIdT id,
+@@ -738,7 +738,7 @@ static SaErrorT NewSimulatorGetSensorRea
+ static SaErrorT NewSimulatorGetSensorThresholds( void *hnd,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiSensorThresholdsT * ) __attribute__((used));
++ SaHpiSensorThresholdsT * ) __asm__("NewSimulatorGetSensorThresholds") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorThresholds( void *hnd,
+ SaHpiResourceIdT id,
+@@ -777,7 +777,7 @@ static SaErrorT NewSimulatorGetSensorThr
+ static SaErrorT NewSimulatorSetSensorThresholds( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- const SaHpiSensorThresholdsT * ) __attribute__((used));
++ const SaHpiSensorThresholdsT * ) __asm__("NewSimulatorSetSensorThresholds") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSensorThresholds( void *hnd,
+ SaHpiResourceIdT id,
+@@ -815,7 +815,7 @@ static SaErrorT NewSimulatorSetSensorThr
+ static SaErrorT NewSimulatorGetSensorEnable( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT * ) __attribute__((used));
++ SaHpiBoolT * ) __asm__("NewSimulatorGetSensorEnable") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorEnable( void *hnd,
+ SaHpiResourceIdT id,
+@@ -849,7 +849,7 @@ static SaErrorT NewSimulatorGetSensorEna
+ static SaErrorT NewSimulatorSetSensorEnable( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT ) __attribute__((used));
++ SaHpiBoolT ) __asm__("NewSimulatorSetSensorEnable") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSensorEnable( void *hnd,
+ SaHpiResourceIdT id,
+@@ -883,7 +883,7 @@ static SaErrorT NewSimulatorSetSensorEna
+ static SaErrorT NewSimulatorGetSensorEventEnables( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT * ) __attribute__((used));
++ SaHpiBoolT * ) __asm__("NewSimulatorGetSensorEventEnables") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorEventEnables( void *hnd,
+ SaHpiResourceIdT id,
+@@ -916,7 +916,7 @@ static SaErrorT NewSimulatorGetSensorEve
+ static SaErrorT NewSimulatorSetSensorEventEnables( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT ) __attribute__((used));
++ SaHpiBoolT ) __asm__("NewSimulatorSetSensorEventEnables") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSensorEventEnables( void *hnd,
+ SaHpiResourceIdT id,
+@@ -952,7 +952,7 @@ static SaErrorT NewSimulatorGetSensorEve
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+ SaHpiEventStateT *,
+- SaHpiEventStateT * ) __attribute__((used));
++ SaHpiEventStateT * ) __asm__("NewSimulatorGetSensorEventMasks") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorEventMasks( void *hnd,
+ SaHpiResourceIdT id,
+@@ -990,7 +990,7 @@ static SaErrorT NewSimulatorSetSensorEve
+ SaHpiSensorNumT,
+ SaHpiSensorEventMaskActionT,
+ SaHpiEventStateT,
+- SaHpiEventStateT ) __attribute__((used));
++ SaHpiEventStateT ) __asm__("NewSimulatorSetSensorEventMasks") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSensorEventMasks( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1026,7 +1026,7 @@ static SaErrorT NewSimulatorSetSensorEve
+ static SaErrorT NewSimulatorGetControlState( void *, SaHpiResourceIdT,
+ SaHpiCtrlNumT,
+ SaHpiCtrlModeT *,
+- SaHpiCtrlStateT * ) __attribute__((used));
++ SaHpiCtrlStateT * ) __asm__("NewSimulatorGetControlState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetControlState( void *hnd, SaHpiResourceIdT id,
+ SaHpiCtrlNumT num,
+@@ -1061,7 +1061,7 @@ static SaErrorT NewSimulatorGetControlSt
+ static SaErrorT NewSimulatorSetControlState( void *, SaHpiResourceIdT,
+ SaHpiCtrlNumT,
+ SaHpiCtrlModeT,
+- SaHpiCtrlStateT * ) __attribute__((used));
++ SaHpiCtrlStateT * ) __asm__("NewSimulatorSetControlState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetControlState( void *hnd, SaHpiResourceIdT id,
+ SaHpiCtrlNumT num,
+@@ -1099,7 +1099,7 @@ static SaErrorT NewSimulatorGetNextAnnou
+ SaHpiAnnunciatorNumT,
+ SaHpiSeverityT,
+ SaHpiBoolT,
+- SaHpiAnnouncementT *) __attribute__((used));
++ SaHpiAnnouncementT *) __asm__("NewSimulatorGetNextAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetNextAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1135,7 +1135,7 @@ static SaErrorT NewSimulatorGetNextAnnou
+ static SaErrorT NewSimulatorGetAnnouncement(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+ SaHpiEntryIdT,
+- SaHpiAnnouncementT *) __attribute__((used));
++ SaHpiAnnouncementT *) __asm__("NewSimulatorGetAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1171,7 +1171,7 @@ static SaErrorT NewSimulatorGetAnnouncem
+ static SaErrorT NewSimulatorAckAnnouncement(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+ SaHpiEntryIdT,
+- SaHpiSeverityT) __attribute__((used));
++ SaHpiSeverityT) __asm__("NewSimulatorAckAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorAckAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1205,7 +1205,7 @@ static SaErrorT NewSimulatorAckAnnouncem
+ **/
+ static SaErrorT NewSimulatorAddAnnouncement(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+- SaHpiAnnouncementT *) __attribute__((used));
++ SaHpiAnnouncementT *) __asm__("NewSimulatorAddAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1239,7 +1239,7 @@ static SaErrorT NewSimulatorAddAnnouncem
+ static SaErrorT NewSimulatorDelAnnouncement(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+ SaHpiEntryIdT,
+- SaHpiSeverityT) __attribute__((used));
++ SaHpiSeverityT) __asm__("NewSimulatorDelAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorDelAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1273,7 +1273,7 @@ static SaErrorT NewSimulatorDelAnnouncem
+ **/
+ static SaErrorT NewSimulatorGetAnnMode(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+- SaHpiAnnunciatorModeT *) __attribute__((used));
++ SaHpiAnnunciatorModeT *) __asm__("NewSimulatorGetAnnMode") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetAnnMode(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1306,7 +1306,7 @@ static SaErrorT NewSimulatorGetAnnMode(v
+ **/
+ static SaErrorT NewSimulatorSetAnnMode(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+- SaHpiAnnunciatorModeT) __attribute__((used));
++ SaHpiAnnunciatorModeT) __asm__("NewSimulatorSetAnnMode") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetAnnMode(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1340,7 +1340,7 @@ static SaErrorT NewSimulatorSetAnnMode(v
+ static SaErrorT NewSimulatorGetIdrInfo( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrInfoT * ) __attribute__((used));
++ SaHpiIdrInfoT * ) __asm__("NewSimulatorGetIdrInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetIdrInfo( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1380,7 +1380,7 @@ static SaErrorT NewSimulatorGetIdrAreaHe
+ SaHpiIdrAreaTypeT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiIdrAreaHeaderT * ) __attribute__((used));
++ SaHpiIdrAreaHeaderT * ) __asm__("NewSimulatorGetIdrAreaHeader") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetIdrAreaHeader( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1419,7 +1419,7 @@ static SaErrorT NewSimulatorAddIdrArea(
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiIdrAreaTypeT,
+- SaHpiEntryIdT * ) __attribute__((used));
++ SaHpiEntryIdT * ) __asm__("NewSimulatorAddIdrArea") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddIdrArea( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1456,7 +1456,7 @@ static SaErrorT NewSimulatorAddIdrAreaBy
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiIdrAreaTypeT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("NewSimulatorAddIdrAreaById") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddIdrAreaById( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1490,7 +1490,7 @@ static SaErrorT NewSimulatorAddIdrAreaBy
+ static SaErrorT NewSimulatorDelIdrArea( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("NewSimulatorDelIdrArea") __attribute__((used));
+
+ static SaErrorT NewSimulatorDelIdrArea( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1532,7 +1532,7 @@ static SaErrorT NewSimulatorGetIdrField(
+ SaHpiIdrFieldTypeT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("NewSimulatorGetIdrField") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetIdrField( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1570,7 +1570,7 @@ static SaErrorT NewSimulatorGetIdrField(
+ static SaErrorT NewSimulatorAddIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("NewSimulatorAddIdrField") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddIdrField( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1604,7 +1604,7 @@ static SaErrorT NewSimulatorAddIdrField(
+ static SaErrorT NewSimulatorAddIdrFieldById( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("NewSimulatorAddIdrFieldById") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddIdrFieldById( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1637,7 +1637,7 @@ static SaErrorT NewSimulatorAddIdrFieldB
+ static SaErrorT NewSimulatorSetIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("NewSimulatorSetIdrField") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetIdrField( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1672,7 +1672,7 @@ static SaErrorT NewSimulatorDelIdrField(
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiEntryIdT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("NewSimulatorDelIdrField") __attribute__((used));
+
+ static SaErrorT NewSimulatorDelIdrField( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1704,7 +1704,7 @@ static SaErrorT NewSimulatorDelIdrField(
+ **/
+ static SaErrorT NewSimulatorGetSelInfo( void *,
+ SaHpiResourceIdT,
+- SaHpiEventLogInfoT * ) __attribute__((used));
++ SaHpiEventLogInfoT * ) __asm__("NewSimulatorGetSelInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSelInfo( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1736,7 +1736,7 @@ static SaErrorT NewSimulatorGetSelInfo(
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorSetSelTime( void *, SaHpiResourceIdT, SaHpiTimeT ) __attribute__((used));
++static SaErrorT NewSimulatorSetSelTime( void *, SaHpiResourceIdT, SaHpiTimeT ) __asm__("NewSimulatorSetSelTime") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSelTime( void *hnd, SaHpiResourceIdT id, SaHpiTimeT t ) {
+ SaErrorT rv = SA_ERR_HPI_INTERNAL_ERROR;
+@@ -1766,7 +1766,7 @@ static SaErrorT NewSimulatorSetSelTime(
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorAddSelEntry( void *, SaHpiResourceIdT, const SaHpiEventT * ) __attribute__((used));
++static SaErrorT NewSimulatorAddSelEntry( void *, SaHpiResourceIdT, const SaHpiEventT * ) __asm__("NewSimulatorAddSelEntry") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddSelEntry( void *hnd, SaHpiResourceIdT id,
+ const SaHpiEventT *Event ) {
+@@ -1809,7 +1809,7 @@ static SaErrorT NewSimulatorGetSelEntry(
+ SaHpiEventLogEntryIdT *,
+ SaHpiEventLogEntryT *,
+ SaHpiRdrT *,
+- SaHpiRptEntryT * ) __attribute__((used));
++ SaHpiRptEntryT * ) __asm__("NewSimulatorGetSelEntry") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSelEntry( void *hnd, SaHpiResourceIdT id,
+ SaHpiEventLogEntryIdT current,
+@@ -1844,7 +1844,7 @@ static SaErrorT NewSimulatorGetSelEntry(
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorClearSel( void *, SaHpiResourceIdT ) __attribute__((used));
++static SaErrorT NewSimulatorClearSel( void *, SaHpiResourceIdT ) __asm__("NewSimulatorClearSel") __attribute__((used));
+
+ static SaErrorT NewSimulatorClearSel( void *hnd, SaHpiResourceIdT id ) {
+ SaErrorT rv = SA_ERR_HPI_INTERNAL_ERROR;
+@@ -1875,7 +1875,7 @@ static SaErrorT NewSimulatorClearSel( vo
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetSelState(void *, SaHpiResourceIdT,
+- SaHpiBoolT) __attribute__((used));
++ SaHpiBoolT) __asm__("NewSimulatorSetSelState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSelState( void *hnd, SaHpiResourceIdT id,
+ SaHpiBoolT state ) {
+@@ -1907,7 +1907,7 @@ static SaErrorT NewSimulatorSetSelState(
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetSelState(void *, SaHpiResourceIdT,
+- SaHpiBoolT *) __attribute__((used));
++ SaHpiBoolT *) __asm__("NewSimulatorGetSelState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSelState( void *hnd, SaHpiResourceIdT id,
+ SaHpiBoolT *state ) {
+@@ -1939,7 +1939,7 @@ static SaErrorT NewSimulatorGetSelState(
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetSelCapability(void *, SaHpiResourceIdT,
+- SaHpiEventLogCapabilitiesT *) __attribute__((used));
++ SaHpiEventLogCapabilitiesT *) __asm__("NewSimulatorGetSelCapability") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSelCapability( void *hnd, SaHpiResourceIdT id,
+ SaHpiEventLogCapabilitiesT *caps ) {
+@@ -1970,7 +1970,7 @@ static SaErrorT NewSimulatorGetSelCapabi
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorResetSelOverflow(void *, SaHpiResourceIdT)
+- __attribute__((used));
++ __asm__("NewSimulatorResetSelOverflow") __attribute__((used));
+
+ static SaErrorT NewSimulatorResetSelOverflow( void *hnd, SaHpiResourceIdT id ) {
+
+@@ -2002,7 +2002,7 @@ static SaErrorT NewSimulatorResetSelOver
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorHotswapPolicyCancel( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("NewSimulatorHotswapPolicyCancel") __attribute__((used));
+
+ static SaErrorT NewSimulatorHotswapPolicyCancel( void *hnd, SaHpiResourceIdT id,
+ SaHpiTimeoutT timeout) {
+@@ -2032,7 +2032,7 @@ static SaErrorT NewSimulatorHotswapPolic
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetHotswapState( void *, SaHpiResourceIdT ,
+- SaHpiHsStateT * ) __attribute__((used));
++ SaHpiHsStateT * ) __asm__("NewSimulatorGetHotswapState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetHotswapState( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsStateT *state ) {
+@@ -2063,7 +2063,7 @@ static SaErrorT NewSimulatorGetHotswapSt
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetHotswapState( void *, SaHpiResourceIdT,
+- SaHpiHsStateT ) __attribute__((used));
++ SaHpiHsStateT ) __asm__("NewSimulatorSetHotswapState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetHotswapState( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsStateT state ) {
+@@ -2105,7 +2105,7 @@ static SaErrorT NewSimulatorSetHotswapSt
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorRequestHotswapAction( void *, SaHpiResourceIdT,
+- SaHpiHsActionT ) __attribute__((used));
++ SaHpiHsActionT ) __asm__("NewSimulatorRequestHotswapAction") __attribute__((used));
+
+ static SaErrorT NewSimulatorRequestHotswapAction( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsActionT act ) {
+@@ -2139,7 +2139,7 @@ static SaErrorT NewSimulatorRequestHotsw
+ static SaErrorT NewSimulatorGetWatchdogInfo(void *,
+ SaHpiResourceIdT,
+ SaHpiWatchdogNumT,
+- SaHpiWatchdogT *) __attribute__((used));
++ SaHpiWatchdogT *) __asm__("NewSimulatorGetWatchdogInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetWatchdogInfo(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2170,7 +2170,7 @@ static SaErrorT NewSimulatorGetWatchdogI
+ static SaErrorT NewSimulatorSetWatchdogInfo(void *,
+ SaHpiResourceIdT,
+ SaHpiWatchdogNumT,
+- SaHpiWatchdogT *) __attribute__((used));
++ SaHpiWatchdogT *) __asm__("NewSimulatorSetWatchdogInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetWatchdogInfo(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2199,7 +2199,7 @@ static SaErrorT NewSimulatorSetWatchdogI
+ **/
+ static SaErrorT NewSimulatorResetWatchdog(void *,
+ SaHpiResourceIdT,
+- SaHpiWatchdogNumT) __attribute__((used));
++ SaHpiWatchdogNumT) __asm__("NewSimulatorResetWatchdog") __attribute__((used));
+
+ static SaErrorT NewSimulatorResetWatchdog(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2229,7 +2229,7 @@ static SaErrorT NewSimulatorResetWatchdo
+ static SaErrorT NewSimulatorGetFumiSpec(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiFumiSpecInfoT *) __attribute__((used));
++ SaHpiFumiSpecInfoT *) __asm__("NewSimulatorGetFumiSpec") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiSpec(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2260,7 +2260,7 @@ static SaErrorT NewSimulatorGetFumiSpec(
+ static SaErrorT NewSimulatorGetFumiServImpact(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiFumiServiceImpactDataT *) __attribute__((used));
++ SaHpiFumiServiceImpactDataT *) __asm__("NewSimulatorGetFumiServImpact") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiServImpact(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2294,7 +2294,7 @@ static SaErrorT NewSimulatorSetFumiSourc
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiTextBufferT *) __attribute__((used));
++ SaHpiTextBufferT *) __asm__("NewSimulatorSetFumiSource") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetFumiSource(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2327,7 +2327,7 @@ static SaErrorT NewSimulatorSetFumiSourc
+ static SaErrorT NewSimulatorValidateFumiSource(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorValidateFumiSource") __attribute__((used));
+
+ static SaErrorT NewSimulatorValidateFumiSource(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2361,7 +2361,7 @@ static SaErrorT NewSimulatorGetFumiSourc
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiFumiSourceInfoT *) __attribute__((used));
++ SaHpiFumiSourceInfoT *) __asm__("NewSimulatorGetFumiSource") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiSource(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2400,7 +2400,7 @@ static SaErrorT NewSimulatorGetFumiSourc
+ SaHpiBankNumT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiFumiComponentInfoT *) __attribute__((used));
++ SaHpiFumiComponentInfoT *) __asm__("NewSimulatorGetFumiSourceComponent") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiSourceComponent(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2437,7 +2437,7 @@ static SaErrorT NewSimulatorGetFumiTarge
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiFumiBankInfoT *) __attribute__((used));
++ SaHpiFumiBankInfoT *) __asm__("NewSimulatorGetFumiTarget") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiTarget(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2476,7 +2476,7 @@ static SaErrorT NewSimulatorGetFumiTarge
+ SaHpiBankNumT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiFumiComponentInfoT *) __attribute__((used));
++ SaHpiFumiComponentInfoT *) __asm__("NewSimulatorGetFumiTargetComponent") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiTargetComponent(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2511,7 +2511,7 @@ static SaErrorT NewSimulatorGetFumiTarge
+ static SaErrorT NewSimulatorGetFumiLogicalTarget(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiFumiLogicalBankInfoT *) __attribute__((used));
++ SaHpiFumiLogicalBankInfoT *) __asm__("NewSimulatorGetFumiLogicalTarget") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiLogicalTarget(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2547,7 +2547,7 @@ static SaErrorT NewSimulatorGetFumiLogic
+ SaHpiFumiNumT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiFumiLogicalComponentInfoT *) __attribute__((used));
++ SaHpiFumiLogicalComponentInfoT *) __asm__("NewSimulatorGetFumiLogicalTargetComponent") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiLogicalTargetComponent(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2579,7 +2579,7 @@ static SaErrorT NewSimulatorGetFumiLogic
+ **/
+ static SaErrorT NewSimulatorStartFumiBackup(void *,
+ SaHpiResourceIdT,
+- SaHpiFumiNumT) __attribute__((used));
++ SaHpiFumiNumT) __asm__("NewSimulatorStartFumiBackup") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiBackup(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2612,7 +2612,7 @@ static SaErrorT NewSimulatorSetFumiBankO
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiUint32T) __attribute__((used));
++ SaHpiUint32T) __asm__("NewSimulatorSetFumiBankOrder") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetFumiBankOrder(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2647,7 +2647,7 @@ static SaErrorT NewSimulatorStartFumiBan
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorStartFumiBankCopy") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiBankCopy(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2680,7 +2680,7 @@ static SaErrorT NewSimulatorStartFumiBan
+ static SaErrorT NewSimulatorStartFumiInstall(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorStartFumiInstall") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiInstall(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2714,7 +2714,7 @@ static SaErrorT NewSimulatorGetFumiStatu
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiFumiUpgradeStatusT *) __attribute__((used));
++ SaHpiFumiUpgradeStatusT *) __asm__("NewSimulatorGetFumiStatus") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiStatus(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2747,7 +2747,7 @@ static SaErrorT NewSimulatorGetFumiStatu
+ static SaErrorT NewSimulatorStartFumiVerification(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorStartFumiVerification") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiVerification(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2776,7 +2776,7 @@ static SaErrorT NewSimulatorStartFumiVer
+ **/
+ static SaErrorT NewSimulatorStartFumiVerificationMain(void *,
+ SaHpiResourceIdT,
+- SaHpiFumiNumT) __attribute__((used));
++ SaHpiFumiNumT) __asm__("NewSimulatorStartFumiVerificationMain") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiVerificationMain(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2807,7 +2807,7 @@ static SaErrorT NewSimulatorStartFumiVer
+ static SaErrorT NewSimulatorCancelFumiUpgrade(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorCancelFumiUpgrade") __attribute__((used));
+
+ static SaErrorT NewSimulatorCancelFumiUpgrade(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2838,7 +2838,7 @@ static SaErrorT NewSimulatorCancelFumiUp
+ static SaErrorT NewSimulatorGetFumiRollback(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBoolT *) __attribute__((used));
++ SaHpiBoolT *) __asm__("NewSimulatorGetFumiRollback") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiRollback(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2870,7 +2870,7 @@ static SaErrorT NewSimulatorGetFumiRollb
+ static SaErrorT NewSimulatorSetFumiRollback(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBoolT) __attribute__((used));
++ SaHpiBoolT) __asm__("NewSimulatorSetFumiRollback") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetFumiRollback(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2900,7 +2900,7 @@ static SaErrorT NewSimulatorSetFumiRollb
+ **/
+ static SaErrorT NewSimulatorStartFumiRollback(void *,
+ SaHpiResourceIdT,
+- SaHpiFumiNumT) __attribute__((used));
++ SaHpiFumiNumT) __asm__("NewSimulatorStartFumiRollback") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiRollback(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2929,7 +2929,7 @@ static SaErrorT NewSimulatorStartFumiRol
+ **/
+ static SaErrorT NewSimulatorActivateFumi(void *,
+ SaHpiResourceIdT,
+- SaHpiFumiNumT) __attribute__((used));
++ SaHpiFumiNumT) __asm__("NewSimulatorActivateFumi") __attribute__((used));
+
+ static SaErrorT NewSimulatorActivateFumi(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2960,7 +2960,7 @@ static SaErrorT NewSimulatorActivateFumi
+ static SaErrorT NewSimulatorStartFumiActivation(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBoolT) __attribute__((used));
++ SaHpiBoolT) __asm__("NewSimulatorStartFumiActivation") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiActivation(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2992,7 +2992,7 @@ static SaErrorT NewSimulatorStartFumiAct
+ static SaErrorT NewSimulatorCleanupFumi(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorCleanupFumi") __attribute__((used));
+
+ static SaErrorT NewSimulatorCleanupFumi(void *hnd,
+ SaHpiResourceIdT id,
+@@ -3023,7 +3023,7 @@ static SaErrorT NewSimulatorCleanupFumi(
+ static SaErrorT NewSimulatorGetDimiInfo( void *,
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+- SaHpiDimiInfoT *) __attribute__((used));
++ SaHpiDimiInfoT *) __asm__("NewSimulatorGetDimiInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiInfo( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3057,7 +3057,7 @@ static SaErrorT NewSimulatorGetDimiTestI
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+- SaHpiDimiTestT *) __attribute__((used));
++ SaHpiDimiTestT *) __asm__("NewSimulatorGetDimiTestInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiTestInfo( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3092,7 +3092,7 @@ static SaErrorT NewSimulatorGetDimiTestR
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+- SaHpiDimiReadyT *) __attribute__((used));
++ SaHpiDimiReadyT *) __asm__("NewSimulatorGetDimiTestReadiness") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiTestReadiness( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3129,7 +3129,7 @@ static SaErrorT NewSimulatorStartDimiTes
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+ SaHpiUint8T,
+- SaHpiDimiTestVariableParamsT *) __attribute__((used));
++ SaHpiDimiTestVariableParamsT *) __asm__("NewSimulatorStartDimiTest") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartDimiTest( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3163,7 +3163,7 @@ static SaErrorT NewSimulatorStartDimiTes
+ static SaErrorT NewSimulatorCancelDimiTest( void *,
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+- SaHpiDimiTestNumT) __attribute__((used));
++ SaHpiDimiTestNumT) __asm__("NewSimulatorCancelDimiTest") __attribute__((used));
+
+ static SaErrorT NewSimulatorCancelDimiTest( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3199,7 +3199,7 @@ static SaErrorT NewSimulatorGetDimiTestS
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+ SaHpiDimiTestPercentCompletedT *,
+- SaHpiDimiTestRunStatusT *) __attribute__((used));
++ SaHpiDimiTestRunStatusT *) __asm__("NewSimulatorGetDimiTestStatus") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiTestStatus( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3234,7 +3234,7 @@ static SaErrorT NewSimulatorGetDimiTestR
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+- SaHpiDimiTestResultsT *) __attribute__((used));
++ SaHpiDimiTestResultsT *) __asm__("NewSimulatorGetDimiTestResults") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiTestResults( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3263,7 +3263,7 @@ static SaErrorT NewSimulatorGetDimiTestR
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetAutoInsertTimeout( void *,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("NewSimulatorSetAutoInsertTimeout") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetAutoInsertTimeout( void *hnd, SaHpiTimeoutT timeout) {
+ NewSimulator *newsim = VerifyNewSimulator( hnd );
+@@ -3289,7 +3289,7 @@ static SaErrorT NewSimulatorSetAutoInser
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetAutoExtractTimeout( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT * ) __attribute__((used));
++ SaHpiTimeoutT * ) __asm__("NewSimulatorGetAutoExtractTimeout") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetAutoExtractTimeout( void *hnd, SaHpiResourceIdT id,
+ SaHpiTimeoutT *timeout ) {
+@@ -3319,7 +3319,7 @@ static SaErrorT NewSimulatorGetAutoExtra
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetAutoExtractTimeout( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("NewSimulatorSetAutoExtractTimeout") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetAutoExtractTimeout( void *hnd, SaHpiResourceIdT id,
+ SaHpiTimeoutT timeout ) {
+@@ -3350,7 +3350,7 @@ static SaErrorT NewSimulatorSetAutoExtra
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetPowerState( void *, SaHpiResourceIdT,
+- SaHpiPowerStateT * ) __attribute__((used));
++ SaHpiPowerStateT * ) __asm__("NewSimulatorGetPowerState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetPowerState( void *hnd, SaHpiResourceIdT id,
+ SaHpiPowerStateT *state ) {
+@@ -3382,7 +3382,7 @@ static SaErrorT NewSimulatorGetPowerStat
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetPowerState( void *, SaHpiResourceIdT,
+- SaHpiPowerStateT ) __attribute__((used));
++ SaHpiPowerStateT ) __asm__("NewSimulatorSetPowerState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetPowerState( void *hnd, SaHpiResourceIdT id,
+ SaHpiPowerStateT state ) {
+@@ -3414,7 +3414,7 @@ static SaErrorT NewSimulatorSetPowerStat
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetIndicatorState( void *, SaHpiResourceIdT,
+- SaHpiHsIndicatorStateT * ) __attribute__((used));
++ SaHpiHsIndicatorStateT * ) __asm__("NewSimulatorGetIndicatorState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetIndicatorState( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsIndicatorStateT *state ) {
+@@ -3446,7 +3446,7 @@ static SaErrorT NewSimulatorGetIndicator
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetIndicatorState( void *, SaHpiResourceIdT,
+- SaHpiHsIndicatorStateT ) __attribute__((used));
++ SaHpiHsIndicatorStateT ) __asm__("NewSimulatorSetIndicatorState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetIndicatorState( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsIndicatorStateT state ) {
+@@ -3479,7 +3479,7 @@ static SaErrorT NewSimulatorSetIndicator
+ **/
+ static SaErrorT NewSimulatorControlParm( void *,
+ SaHpiResourceIdT,
+- SaHpiParmActionT ) __attribute__((used));
++ SaHpiParmActionT ) __asm__("NewSimulatorControlParm") __attribute__((used));
+
+ static SaErrorT NewSimulatorControlParm( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3512,7 +3512,7 @@ static SaErrorT NewSimulatorControlParm(
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetResetState( void *, SaHpiResourceIdT,
+- SaHpiResetActionT * ) __attribute__((used));
++ SaHpiResetActionT * ) __asm__("NewSimulatorGetResetState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetResetState( void *hnd, SaHpiResourceIdT id,
+ SaHpiResetActionT *act ) {
+@@ -3545,7 +3545,7 @@ static SaErrorT NewSimulatorGetResetStat
+ **/
+ static SaErrorT NewSimulatorSetResetState( void *,
+ SaHpiResourceIdT,
+- SaHpiResetActionT ) __attribute__((used));
++ SaHpiResetActionT ) __asm__("NewSimulatorSetResetState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetResetState( void *hnd,
+ SaHpiResourceIdT id,
+Index: openhpi-3.6.1/plugins/dynamic_simulator/new_sim_file.cpp
+===================================================================
+--- openhpi-3.6.1.orig/plugins/dynamic_simulator/new_sim_file.cpp
++++ openhpi-3.6.1/plugins/dynamic_simulator/new_sim_file.cpp
+@@ -44,9 +44,9 @@
+ ///< Global skip characters for oh_scanner_config
+ static gchar skip_characters[] = " \t\n";
+ ///< Global identifier_first for oh_scanner_config
+-static gchar identifier_first[] = G_CSET_a_2_z"_/."G_CSET_A_2_Z;
++static gchar identifier_first[] = G_CSET_a_2_z "_/." G_CSET_A_2_Z;
+ ///< Global identifier_nth for oh_scanner_config
+-static gchar identifier_nth[] = G_CSET_a_2_z"_-0123456789/."G_CSET_A_2_Z;
++static gchar identifier_nth[] = G_CSET_a_2_z "_-0123456789/." G_CSET_A_2_Z;
+ ///< Global comment signs for oh_scanner_config
+ static gchar comment_single[] = "#\n";
+
+Index: openhpi-3.6.1/plugins/ipmidirect/ipmi.cpp
+===================================================================
+--- openhpi-3.6.1.orig/plugins/ipmidirect/ipmi.cpp
++++ openhpi-3.6.1/plugins/ipmidirect/ipmi.cpp
+@@ -279,7 +279,7 @@ extern "C" {
+ // ABI Interface functions
+
+ static void *
+-IpmiOpen( GHashTable *, unsigned int, oh_evt_queue * ) __attribute__((used));
++IpmiOpen( GHashTable *, unsigned int, oh_evt_queue * ) __asm__("IpmiOpen") __attribute__((used));
+
+ static void *
+ IpmiOpen( GHashTable *handler_config, unsigned int hid, oh_evt_queue *eventq )
+@@ -388,7 +388,7 @@ IpmiOpen( GHashTable *handler_config, un
+
+
+ static void
+-IpmiClose( void * ) __attribute__((used));
++IpmiClose( void * ) __asm__("IpmiClose") __attribute__((used));
+
+ static void
+ IpmiClose( void *hnd )
+@@ -436,7 +436,7 @@ IpmiClose( void *hnd )
+
+
+ static SaErrorT
+-IpmiGetEvent( void * ) __attribute__((used));
++IpmiGetEvent( void * ) __asm__("IpmiGetEvent") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetEvent( void *hnd )
+@@ -458,7 +458,7 @@ IpmiGetEvent( void *hnd )
+
+
+ static SaErrorT
+-IpmiDiscoverResources( void * ) __attribute__((used));
++IpmiDiscoverResources( void * ) __asm__("IpmiDiscoverResources") __attribute__((used));
+
+ static SaErrorT
+ IpmiDiscoverResources( void *hnd )
+@@ -479,7 +479,7 @@ IpmiDiscoverResources( void *hnd )
+
+
+ static SaErrorT
+-IpmiSetResourceTag( void *, SaHpiResourceIdT, SaHpiTextBufferT * ) __attribute__((used));
++IpmiSetResourceTag( void *, SaHpiResourceIdT, SaHpiTextBufferT * ) __asm__("IpmiSetResourceTag") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetResourceTag( void *hnd, SaHpiResourceIdT id, SaHpiTextBufferT *tag )
+@@ -499,7 +499,7 @@ IpmiSetResourceTag( void *hnd, SaHpiReso
+
+
+ static SaErrorT
+-IpmiSetResourceSeverity( void *, SaHpiResourceIdT, SaHpiSeverityT ) __attribute__((used));
++IpmiSetResourceSeverity( void *, SaHpiResourceIdT, SaHpiSeverityT ) __asm__("IpmiSetResourceSeverity") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetResourceSeverity( void *hnd, SaHpiResourceIdT id, SaHpiSeverityT sev )
+@@ -523,7 +523,7 @@ IpmiGetSensorReading( void *,
+ SaHpiResourceIdT id,
+ SaHpiSensorNumT num,
+ SaHpiSensorReadingT *data,
+- SaHpiEventStateT *state ) __attribute__((used));
++ SaHpiEventStateT *state ) __asm__("IpmiGetSensorReading") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorReading( void *hnd,
+@@ -550,7 +550,7 @@ static SaErrorT
+ IpmiGetSensorThresholds( void *hnd,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiSensorThresholdsT * ) __attribute__((used));
++ SaHpiSensorThresholdsT * ) __asm__("IpmiGetSensorThresholds") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorThresholds( void *hnd,
+@@ -581,7 +581,7 @@ static SaErrorT
+ IpmiSetSensorThresholds( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- const SaHpiSensorThresholdsT * ) __attribute__((used));
++ const SaHpiSensorThresholdsT * ) __asm__("IpmiSetSensorThresholds") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSensorThresholds( void *hnd,
+@@ -612,7 +612,7 @@ static SaErrorT
+ IpmiGetSensorEnable( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT * ) __attribute__((used));
++ SaHpiBoolT * ) __asm__("IpmiGetSensorEnable") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorEnable( void *hnd,
+@@ -638,7 +638,7 @@ static SaErrorT
+ IpmiSetSensorEnable( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT ) __attribute__((used));
++ SaHpiBoolT ) __asm__("IpmiSetSensorEnable") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSensorEnable( void *hnd,
+@@ -664,7 +664,7 @@ static SaErrorT
+ IpmiGetSensorEventEnables( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT * ) __attribute__((used));
++ SaHpiBoolT * ) __asm__("IpmiGetSensorEventEnables") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorEventEnables( void *hnd,
+@@ -690,7 +690,7 @@ static SaErrorT
+ IpmiSetSensorEventEnables( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT ) __attribute__((used));
++ SaHpiBoolT ) __asm__("IpmiSetSensorEventEnables") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSensorEventEnables( void *hnd,
+@@ -717,7 +717,7 @@ IpmiGetSensorEventMasks( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+ SaHpiEventStateT *,
+- SaHpiEventStateT * ) __attribute__((used));
++ SaHpiEventStateT * ) __asm__("IpmiGetSensorEventMasks") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorEventMasks( void *hnd,
+@@ -747,7 +747,7 @@ IpmiSetSensorEventMasks( void *,
+ SaHpiSensorNumT,
+ SaHpiSensorEventMaskActionT,
+ SaHpiEventStateT,
+- SaHpiEventStateT ) __attribute__((used));
++ SaHpiEventStateT ) __asm__("IpmiSetSensorEventMasks") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSensorEventMasks( void *hnd,
+@@ -776,7 +776,7 @@ static SaErrorT
+ IpmiGetControlState( void *, SaHpiResourceIdT,
+ SaHpiCtrlNumT,
+ SaHpiCtrlModeT *,
+- SaHpiCtrlStateT * ) __attribute__((used));
++ SaHpiCtrlStateT * ) __asm__("IpmiGetControlState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetControlState( void *hnd, SaHpiResourceIdT id,
+@@ -802,7 +802,7 @@ static SaErrorT
+ IpmiSetControlState( void *, SaHpiResourceIdT,
+ SaHpiCtrlNumT,
+ SaHpiCtrlModeT,
+- SaHpiCtrlStateT * ) __attribute__((used));
++ SaHpiCtrlStateT * ) __asm__("IpmiSetControlState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetControlState( void *hnd, SaHpiResourceIdT id,
+@@ -828,7 +828,7 @@ static SaErrorT
+ IpmiGetIdrInfo( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrInfoT * ) __attribute__((used));
++ SaHpiIdrInfoT * ) __asm__("IpmiGetIdrInfo") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetIdrInfo( void *hnd,
+@@ -857,7 +857,7 @@ IpmiGetIdrAreaHeader( void *,
+ SaHpiIdrAreaTypeT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiIdrAreaHeaderT * ) __attribute__((used));
++ SaHpiIdrAreaHeaderT * ) __asm__("IpmiGetIdrAreaHeader") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetIdrAreaHeader( void *hnd,
+@@ -887,7 +887,7 @@ IpmiAddIdrArea( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiIdrAreaTypeT,
+- SaHpiEntryIdT * ) __attribute__((used));
++ SaHpiEntryIdT * ) __asm__("IpmiAddIdrArea") __attribute__((used));
+
+ static SaErrorT
+ IpmiAddIdrArea( void *hnd,
+@@ -914,7 +914,7 @@ static SaErrorT
+ IpmiDelIdrArea( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("IpmiDelIdrArea") __attribute__((used));
+
+ static SaErrorT
+ IpmiDelIdrArea( void *hnd,
+@@ -944,7 +944,7 @@ IpmiGetIdrField( void *,
+ SaHpiIdrFieldTypeT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("IpmiGetIdrField") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetIdrField( void *hnd,
+@@ -974,7 +974,7 @@ static SaErrorT
+ IpmiAddIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("IpmiAddIdrField") __attribute__((used));
+
+ static SaErrorT
+ IpmiAddIdrField( void *hnd,
+@@ -1000,7 +1000,7 @@ static SaErrorT
+ IpmiSetIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("IpmiSetIdrField") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetIdrField( void *hnd,
+@@ -1027,7 +1027,7 @@ IpmiDelIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiEntryIdT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("IpmiDelIdrField") __attribute__((used));
+
+ static SaErrorT
+ IpmiDelIdrField( void *hnd,
+@@ -1053,7 +1053,7 @@ IpmiDelIdrField( void *hnd,
+ static SaErrorT
+ IpmiGetSelInfo( void *,
+ SaHpiResourceIdT,
+- SaHpiEventLogInfoT * ) __attribute__((used));
++ SaHpiEventLogInfoT * ) __asm__("IpmiGetSelInfo") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSelInfo( void *hnd,
+@@ -1075,7 +1075,7 @@ IpmiGetSelInfo( void *hnd,
+
+
+ static SaErrorT
+-IpmiSetSelTime( void *, SaHpiResourceIdT, SaHpiTimeT ) __attribute__((used));
++IpmiSetSelTime( void *, SaHpiResourceIdT, SaHpiTimeT ) __asm__("IpmiSetSelTime") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSelTime( void *hnd, SaHpiResourceIdT id, SaHpiTimeT t )
+@@ -1096,7 +1096,7 @@ IpmiSetSelTime( void *hnd, SaHpiResource
+
+ static SaErrorT
+ IpmiAddSelEntry( void *, SaHpiResourceIdT,
+- const SaHpiEventT * ) __attribute__((used));
++ const SaHpiEventT * ) __asm__("IpmiAddSelEntry") __attribute__((used));
+
+ static SaErrorT
+ IpmiAddSelEntry( void *hnd, SaHpiResourceIdT id,
+@@ -1118,7 +1118,7 @@ IpmiAddSelEntry( void *hnd, SaHpiResourc
+ #ifdef NOTUSED
+ static SaErrorT
+ IpmiDelSelEntry( void *, SaHpiResourceIdT,
+- SaHpiEventLogEntryIdT ) __attribute__((used));
++ SaHpiEventLogEntryIdT ) __asm__("IpmiDelSelEntry") __attribute__((used));
+
+ static SaErrorT
+ IpmiDelSelEntry( void *hnd, SaHpiResourceIdT id,
+@@ -1145,7 +1145,7 @@ IpmiGetSelEntry( void *hnd, SaHpiResourc
+ SaHpiEventLogEntryIdT *, SaHpiEventLogEntryIdT *,
+ SaHpiEventLogEntryT *,
+ SaHpiRdrT *,
+- SaHpiRptEntryT * ) __attribute__((used));
++ SaHpiRptEntryT * ) __asm__("IpmiGetSelEntry") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSelEntry( void *hnd, SaHpiResourceIdT id,
+@@ -1170,7 +1170,7 @@ IpmiGetSelEntry( void *hnd, SaHpiResourc
+
+
+ static SaErrorT
+-IpmiClearSel( void *, SaHpiResourceIdT ) __attribute__((used));
++IpmiClearSel( void *, SaHpiResourceIdT ) __asm__("IpmiClearSel") __attribute__((used));
+
+ static SaErrorT
+ IpmiClearSel( void *hnd, SaHpiResourceIdT id )
+@@ -1190,7 +1190,7 @@ IpmiClearSel( void *hnd, SaHpiResourceId
+
+ static SaErrorT
+ IpmiHotswapPolicyCancel( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("IpmiHotswapPolicyCancel") __attribute__((used));
+
+ static SaErrorT
+ IpmiHotswapPolicyCancel( void *hnd, SaHpiResourceIdT id,
+@@ -1210,7 +1210,7 @@ IpmiHotswapPolicyCancel( void *hnd, SaHp
+ }
+
+ static SaErrorT
+-IpmiSetAutoInsertTimeout( void *, SaHpiTimeoutT ) __attribute__((used));
++IpmiSetAutoInsertTimeout( void *, SaHpiTimeoutT ) __asm__("IpmiSetAutoInsertTimeout") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetAutoInsertTimeout( void *hnd, SaHpiTimeoutT timeout)
+@@ -1229,7 +1229,7 @@ IpmiSetAutoInsertTimeout( void *hnd, SaH
+
+ static SaErrorT
+ IpmiGetAutoExtractTimeout( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT * ) __attribute__((used));
++ SaHpiTimeoutT * ) __asm__("IpmiGetAutoExtractTimeout") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetAutoExtractTimeout( void *hnd, SaHpiResourceIdT id,
+@@ -1250,7 +1250,7 @@ IpmiGetAutoExtractTimeout( void *hnd, Sa
+
+ static SaErrorT
+ IpmiSetAutoExtractTimeout( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("IpmiSetAutoExtractTimeout") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetAutoExtractTimeout( void *hnd, SaHpiResourceIdT id,
+@@ -1271,7 +1271,7 @@ IpmiSetAutoExtractTimeout( void *hnd, Sa
+
+ static SaErrorT
+ IpmiGetHotswapState( void *, SaHpiResourceIdT ,
+- SaHpiHsStateT * ) __attribute__((used));
++ SaHpiHsStateT * ) __asm__("IpmiGetHotswapState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetHotswapState( void *hnd, SaHpiResourceIdT id,
+@@ -1293,7 +1293,7 @@ IpmiGetHotswapState( void *hnd, SaHpiRes
+
+ static SaErrorT
+ IpmiSetHotswapState( void *, SaHpiResourceIdT,
+- SaHpiHsStateT ) __attribute__((used));
++ SaHpiHsStateT ) __asm__("IpmiSetHotswapState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetHotswapState( void *hnd, SaHpiResourceIdT id,
+@@ -1315,7 +1315,7 @@ IpmiSetHotswapState( void *hnd, SaHpiRes
+
+ static SaErrorT
+ IpmiRequestHotswapAction( void *, SaHpiResourceIdT,
+- SaHpiHsActionT ) __attribute__((used));
++ SaHpiHsActionT ) __asm__("IpmiRequestHotswapAction") __attribute__((used));
+
+ static SaErrorT
+ IpmiRequestHotswapAction( void *hnd, SaHpiResourceIdT id,
+@@ -1337,7 +1337,7 @@ IpmiRequestHotswapAction( void *hnd, SaH
+
+ static SaErrorT
+ IpmiGetPowerState( void *, SaHpiResourceIdT,
+- SaHpiPowerStateT * ) __attribute__((used));
++ SaHpiPowerStateT * ) __asm__("IpmiGetPowerState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetPowerState( void *hnd, SaHpiResourceIdT id,
+@@ -1359,7 +1359,7 @@ IpmiGetPowerState( void *hnd, SaHpiResou
+
+ static SaErrorT
+ IpmiSetPowerState( void *, SaHpiResourceIdT,
+- SaHpiPowerStateT ) __attribute__((used));
++ SaHpiPowerStateT ) __asm__("IpmiSetPowerState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetPowerState( void *hnd, SaHpiResourceIdT id,
+@@ -1381,7 +1381,7 @@ IpmiSetPowerState( void *hnd, SaHpiResou
+
+ static SaErrorT
+ IpmiGetIndicatorState( void *, SaHpiResourceIdT,
+- SaHpiHsIndicatorStateT * ) __attribute__((used));
++ SaHpiHsIndicatorStateT * ) __asm__("IpmiGetIndicatorState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetIndicatorState( void *hnd, SaHpiResourceIdT id,
+@@ -1403,7 +1403,7 @@ IpmiGetIndicatorState( void *hnd, SaHpiR
+
+ static SaErrorT
+ IpmiSetIndicatorState( void *, SaHpiResourceIdT,
+- SaHpiHsIndicatorStateT ) __attribute__((used));
++ SaHpiHsIndicatorStateT ) __asm__("IpmiSetIndicatorState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetIndicatorState( void *hnd, SaHpiResourceIdT id,
+@@ -1426,7 +1426,7 @@ IpmiSetIndicatorState( void *hnd, SaHpiR
+ static SaErrorT
+ IpmiControlParm( void *,
+ SaHpiResourceIdT,
+- SaHpiParmActionT ) __attribute__((used));
++ SaHpiParmActionT ) __asm__("IpmiControlParm") __attribute__((used));
+
+ static SaErrorT
+ IpmiControlParm( void *hnd,
+@@ -1449,7 +1449,7 @@ IpmiControlParm( void *hnd,
+
+ static SaErrorT
+ IpmiGetResetState( void *, SaHpiResourceIdT,
+- SaHpiResetActionT * ) __attribute__((used));
++ SaHpiResetActionT * ) __asm__("IpmiGetResetState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetResetState( void *hnd, SaHpiResourceIdT id,
+@@ -1472,7 +1472,7 @@ IpmiGetResetState( void *hnd, SaHpiResou
+ static SaErrorT
+ IpmiSetResetState( void *,
+ SaHpiResourceIdT,
+- SaHpiResetActionT ) __attribute__((used));
++ SaHpiResetActionT ) __asm__("IpmiSetResetState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetResetState( void *hnd,
+@@ -1496,7 +1496,7 @@ static SaErrorT
+ IpmiGetWatchdogInfo(void *,
+ SaHpiResourceIdT,
+ SaHpiWatchdogNumT,
+- SaHpiWatchdogT *) __attribute__((used));
++ SaHpiWatchdogT *) __asm__("IpmiGetWatchdogInfo") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetWatchdogInfo(void *hnd,
+@@ -1517,7 +1517,7 @@ static SaErrorT
+ IpmiSetWatchdogInfo(void *,
+ SaHpiResourceIdT,
+ SaHpiWatchdogNumT,
+- SaHpiWatchdogT *) __attribute__((used));
++ SaHpiWatchdogT *) __asm__("IpmiSetWatchdogInfo") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetWatchdogInfo(void *hnd,
+@@ -1537,7 +1537,7 @@ IpmiSetWatchdogInfo(void *hnd,
+ static SaErrorT
+ IpmiResetWatchdog(void *,
+ SaHpiResourceIdT,
+- SaHpiWatchdogNumT) __attribute__((used));
++ SaHpiWatchdogNumT) __asm__("IpmiResetWatchdog") __attribute__((used));
+
+ static SaErrorT
+ IpmiResetWatchdog(void *hnd,
+Index: openhpi-3.6.1/plugins/ipmidirect/ipmi_auth.h
+===================================================================
+--- openhpi-3.6.1.orig/plugins/ipmidirect/ipmi_auth.h
++++ openhpi-3.6.1/plugins/ipmidirect/ipmi_auth.h
+@@ -32,7 +32,7 @@ class cIpmiAuthSg
+ {
+ public:
+ void *data; /* NULL to terminate. */
+- int len;
++ unsigned int len;
+ };
+
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/fix-narrowing-warning.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/fix-narrowing-warning.patch
new file mode 100644
index 000000000..4c545708f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/fix-narrowing-warning.patch
@@ -0,0 +1,20 @@
+Fix
+
+sensor_factors_000.cpp:66:5: error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned char' in initializer list [-Wc++11-narrowing]
+((dRExp << 4) & 0xf0) | (dBExp & 0x0f ), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: openhpi-3.6.1/plugins/ipmidirect/t/sensor_factors_000.cpp
+===================================================================
+--- openhpi-3.6.1.orig/plugins/ipmidirect/t/sensor_factors_000.cpp
++++ openhpi-3.6.1/plugins/ipmidirect/t/sensor_factors_000.cpp
+@@ -63,7 +63,7 @@ static cIpmiSdr sdr =
+ dB & 0xff,
+ ((dB >> 2) & 0xc0) | (dAccuracy & 0x3f),
+ ((dAccuracy >> 2) & 0xf0) | ((dAccuracyExp << 2) & 0x0c),
+- ((dRExp << 4) & 0xf0) | (dBExp & 0x0f ),
++ (unsigned char)(((dRExp << 4) & 0xf0) | (dBExp & 0x0f )),
+ 0,
+ 0,
+ }
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch
new file mode 100644
index 000000000..4644910b7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch
@@ -0,0 +1,25 @@
+[PATCH] add libnetsnmp when link
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ plugins/snmp_bc/t/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/snmp_bc/t/Makefile.am b/plugins/snmp_bc/t/Makefile.am
+index 57e77ac..9894620 100644
+--- a/plugins/snmp_bc/t/Makefile.am
++++ b/plugins/snmp_bc/t/Makefile.am
+@@ -74,7 +74,7 @@ nodist_libsnmp_bc_la_SOURCES = $(GENERATED_EVENT_CODE) $(REMOTE_SIM_SOURCES)
+ # libopenhpi_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la
+ # libopenhpi_la_LDFLAGS = -L$(top_builddir)/utils -version-info @HPI_LIB_VERSION@ -export-symbols $(top_srcdir)/src/hpi.sym
+
+-libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la
++libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la -lnetsnmp
+ libsnmp_bc_la_LDFLAGS = -L$(top_builddir)/utils -module -version-info @HPI_LIB_VERSION@
+ # libsnmp_bc_la_LDFLAGS = -version 0:0:0
+
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch
new file mode 100644
index 000000000..077e26cbf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch
@@ -0,0 +1,23 @@
+Fix alignment issue in ipmi_inventory.c
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/plugins/ipmi/ipmi_inventory.c b/plugins/ipmi/ipmi_inventory.c
+index 5382186..01655c6 100644
+--- a/plugins/ipmi/ipmi_inventory.c
++++ b/plugins/ipmi/ipmi_inventory.c
+@@ -2546,8 +2546,11 @@ static SaErrorT modify_inventory(SaHpiIdrFieldT *field,
+ if (tb->DataLength == 0) {
+ rv = ipmi_fru_set_board_info_mfg_time(fru, 0);
+ } else {
++ time_t the_time;
++ /* tb->Data is not aligned -- copy to temp */
++ memcpy(&the_time, tb->Data, sizeof(the_time));
+ rv = ipmi_fru_set_board_info_mfg_time(fru,
+- *(time_t *)tb->Data);
++ the_time);
+ }
+ break;
+ case SAHPI_IDR_FIELDTYPE_MANUFACTURER:
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch
new file mode 100644
index 000000000..97c515e00
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch
@@ -0,0 +1,24 @@
+fix host gcc warnings
+
+Remove gcc warnings when gcc is v3.2
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Index: openhpi-3.6.1/configure.ac
+===================================================================
+--- openhpi-3.6.1.orig/configure.ac
++++ openhpi-3.6.1/configure.ac
+@@ -656,11 +656,6 @@ AC_ARG_ENABLE([werror],
+ fi],
+ [])
+
+-if test -n "`gcc --version | grep ' 3.2'`" ; then
+- CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
+- CXX_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
+-fi
+-
+ case $host_os in
+ solaris*)
+ CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wcast-qual//g'`
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch
new file mode 100644
index 000000000..60e2e7919
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch
@@ -0,0 +1,33 @@
+Fix for saftest failures.
+
+Upstream-Status: Pending
+
+Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
+
+Index: openhpi-3.6.1/openhpid/safhpi.c
+===================================================================
+--- openhpi-3.6.1.orig/openhpid/safhpi.c
++++ openhpi-3.6.1/openhpid/safhpi.c
+@@ -1933,7 +1933,7 @@ SaErrorT SAHPI_API saHpiSensorThresholds
+ oh_release_domain(d); /* Unlock domain */
+
+ OH_CALL_ABI(h, set_sensor_thresholds, SA_ERR_HPI_INVALID_CMD, rv,
+- ResourceId, SensorNum, SensorThresholds);
++ ResourceId, SensorNum, &tmp);
+ oh_release_handler(h);
+
+ return rv;
+Index: openhpi-3.6.1/utils/sahpi_struct_utils.c
+===================================================================
+--- openhpi-3.6.1.orig/utils/sahpi_struct_utils.c
++++ openhpi-3.6.1/utils/sahpi_struct_utils.c
+@@ -3861,6 +3861,9 @@ SaHpiBoolT oh_valid_textbuffer(SaHpiText
+ /* found a unpaired surrogate */
+ return SAHPI_FALSE;
+ }
++ } else {
++ /*the first 2 bytes wrong*/
++ return SAHPI_FALSE;
+ }
+ }
+ break;
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch
new file mode 100644
index 000000000..1627c9797
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch
@@ -0,0 +1,33 @@
+Fix glib cross compile
+
+Uses proper PKG_CONFIG_PATH when cross-compiling
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index b5f5aad..f5a5b74 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -110,13 +110,13 @@ else
+ *** GLIB is always available from ftp://ftp.gtk.org/.])
+ fi
+
+-exact_version=`pkg-config --modversion $GLIB`;
+-GLIB_CFLAGS=`pkg-config --cflags $GLIB $GTHREAD`
+-GLIB_LIBS=`pkg-config --libs $GLIB $GTHREAD`
+-GLIB_ONLY_CFLAGS=`pkg-config --cflags $GLIB`
+-GLIB_ONLY_LIBS=`pkg-config --libs $GLIB`
+-GMODULE_ONLY_CFLAGS=`pkg-config --cflags $GMODULE`
+-GMODULE_ONLY_LIBS=`pkg-config --libs $GMODULE`
++exact_version=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --modversion $GLIB`;
++GLIB_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB $GTHREAD`
++GLIB_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB $GTHREAD`
++GLIB_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB`
++GLIB_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB`
++GMODULE_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GMODULE`
++GMODULE_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GMODULE`
+
+ # On some versions of Solaris the pkg-config file for gthread-2.0 contains a
+ # compiler option, '-mt', that is incompatible with gcc
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch
new file mode 100644
index 000000000..cc21ff8c7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch
@@ -0,0 +1,29 @@
+commit e9f9a73c9dba8dd59f3d6c3acd9988ec8361d55a
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date: Mon Dec 17 16:23:45 2012 -0500
+
+ Correct dangling g_thread_exit in session.c
+
+ hpi_shell's session.c has its progress_bar
+ thread created using pthread_create but
+ exited using g_thread_exit. Use pthread_exit
+ instead to avoid unpredictable GLIB thread
+ errors.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+Index: openhpi-3.6.1/hpi_shell/session.c
+===================================================================
+--- openhpi-3.6.1.orig/hpi_shell/session.c
++++ openhpi-3.6.1/hpi_shell/session.c
+@@ -73,7 +73,7 @@ static void* progress_bar(void *unused)
+ if (i < (PROGRESS_BUF_SIZE - mes_len - 1)) i++;
+ t++;
+ };
+- g_thread_exit(0);
++ pthread_exit(0);
+ return (void *)1;
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch
new file mode 100644
index 000000000..d03c97e18
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Submitted
+
+Package saftest run a test case to pass invalid session id to function
+saHpiResourceIdGet that expect return SA_ERR_HPI_INVALID_SESSION. But the check
+for SA_ERR_HPI_INVALID_SESSION is missed somehow in function saHpiResourceIdGet.
+
+Add check for SA_ERR_HPI_INVALID_SESSION.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+-----
+--- openhpi-3.4.0/baselib/safhpi.cpp.orig 2014-02-25 10:45:20.911734868 +0800
++++ openhpi-3.4.0/baselib/safhpi.cpp 2014-02-25 10:46:05.366925389 +0800
+@@ -477,6 +477,8 @@
+ &rpt_update_count );
+ if ( rv == SA_ERR_HPI_NOT_PRESENT ) {
+ return SA_ERR_HPI_NOT_PRESENT;
++ } else if ( rv == SA_ERR_HPI_INVALID_SESSION) {
++ return SA_ERR_HPI_INVALID_SESSION;
+ } else if ( rv != SA_OK ) {
+ return SA_ERR_HPI_UNKNOWN;
+ }
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch
new file mode 100644
index 000000000..c848b3502
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch
@@ -0,0 +1,21 @@
+Fix libxml2 for cross-compiling
+
+Use proper XML2_INCLUDE path when cross-compiling
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Index: openhpi-3.6.1/configure.ac
+===================================================================
+--- openhpi-3.6.1.orig/configure.ac
++++ openhpi-3.6.1/configure.ac
+@@ -177,7 +177,7 @@ AC_CHECK_HEADERS([openssl/md2.h openssl/
+
+ dnl xml is used for XML-based communication in ilo2_ribcl and oa_soap
+ AC_CHECK_LIB([xml2],[xmlParseMemory],[XML2_LIB=-lxml2],[XML2_LIB=])
+-AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="-I/usr/include/libxml2"],[XML2_INCLUDE])
++AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="$XML2_INCLUDE"],[XML2_INCLUDE])
+ AC_SUBST(XML2_LIB)
+ AC_SUBST(XML2_INCLUDE)
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch
new file mode 100644
index 000000000..3222f5d13
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch
@@ -0,0 +1,33 @@
+Fix ipmi plugin's test dir compilation
+
+The ipmi plugin's test dir is not included
+in compilation since it does not compile
+properly with SSL
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ plugins/ipmi/Makefile.in | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/ipmi/Makefile.in b/plugins/ipmi/Makefile.in
+index 7c6b0a4..6204dbe 100644
+--- a/plugins/ipmi/Makefile.in
++++ b/plugins/ipmi/Makefile.in
+@@ -448,7 +448,9 @@ top_srcdir = @top_srcdir@
+ MAINTAINERCLEANFILES = Makefile.in
+ AM_CPPFLAGS = -DG_LOG_DOMAIN=\"ipmi\" @OPENHPI_INCLUDES@
+ EXTRA_DIST = ipmi.sym ekeyfru.h
+-SUBDIRS = t
++#SUBDIRS = t
++#Tests don't compile wih SSL properly so comment them out
++SUBDIRS =
+ AM_CFLAGS = @OPENIPMI_CFLAGS@
+ pkglib_LTLIBRARIES = libipmi.la
+ libipmi_la_SOURCES = ipmi.c \
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch
new file mode 100644
index 000000000..95b0abc91
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch
@@ -0,0 +1,48 @@
+Fix net-snmp when cross-compiling
+
+Remove irrelevant references to net-snmp libs and flags
+when cross-compiling net-snmp
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ acinclude.m4 | 4 ++--
+ configure | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 82c33f6..727e461 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -160,8 +160,8 @@ AC_DEFUN([OH_CHECK_NETSNMP],
+ ],
+ [
+ have_netsnmp=yes
+- SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/-O\S*//g'`
+- SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
++ SNMPFLAGS=""
++ SNMPLIBS=""
+ AC_MSG_RESULT(yes)
+ ],
+ [AC_MSG_RESULT(no. No SNMP based plugins can be built!)])
+diff --git a/configure b/configure
+index 00067bc..36b913c 100755
+--- a/configure
++++ b/configure
+@@ -15949,8 +15949,8 @@ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+ have_netsnmp=yes
+- SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/-O\S*//g'`
+- SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
++ SNMPFLAGS=""
++ SNMPLIBS=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch
new file mode 100644
index 000000000..38d9a6742
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch
@@ -0,0 +1,23 @@
+Fix sysfs when cross-compiling
+
+Use proper paths for sysfs plugins when cross-compiling
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+diff --git a/plugins/sysfs/sysfs2hpi.c b/plugins/sysfs/sysfs2hpi.c
+index a745214..3685598 100644
+--- a/plugins/sysfs/sysfs2hpi.c
++++ b/plugins/sysfs/sysfs2hpi.c
+@@ -18,7 +18,7 @@
+
+ #include <stdlib.h>
+ #include <string.h>
+-#include <libsysfs.h>
++#include <sysfs/libsysfs.h>
+
+ #include <SaHpi.h>
+ #include <oh_utils.h>
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch
new file mode 100644
index 000000000..3e09180d4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch
@@ -0,0 +1,28 @@
+From 36fbaa27e7299f63c1324b0ad22b970e9365d6a7 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 24 Dec 2014 10:54:59 +0800
+Subject: [PATCH] openhpi: use serial-tests config needed by ptest
+
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Upstream-Status: Inappropriate [default automake behavior incompatible with ptest]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+Index: openhpi-3.6.1/configure.ac
+===================================================================
+--- openhpi-3.6.1.orig/configure.ac
++++ openhpi-3.6.1/configure.ac
+@@ -7,7 +7,7 @@ dnl various hacks by Sean Dague <http:
+ AC_PREREQ(2.57)
+ AC_INIT(openhpi, 3.6.1)
+ AC_CONFIG_SRCDIR(openhpi.spec.in)
+-AM_INIT_AUTOMAKE([1.8])
++AM_INIT_AUTOMAKE([1.8 serial-tests])
+
+ AM_CONFIG_HEADER(config.h)
+ AH_TOP([#ifndef __OPENHPI_CONFIG_H
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init
new file mode 100755
index 000000000..3a5f4a06a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init
@@ -0,0 +1,230 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides: openhpid
+# Required-Start: $network $remote_fs $syslog
+# Required-Stop: $network $remote_fs $syslog
+# Should-Start: $named
+# Should-Stop: $named
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start OpenHPI daemon at boot time
+# Description: Enable OpenHPI service which is provided by openhpid.
+### END INIT INFO
+#
+# openhpid.sh Start/Stop the openhpi daemon.
+#
+# description: openhpid is standard UNIX program which uses the OpenHPI \
+# APIs and provides a standard internet server to access those \
+# APIs for client programs.
+# processname: openhpid
+# config: the standard openhpi conf file specified on the command line or the env.
+# pidfile: /var/run/openhpid.pid
+#
+# Author(s):
+# W. David Ashley <dashley@us.ibm.com>
+# Daniel de Araujo <ddearauj@us.ibm.com>
+
+# Source function library.
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+prog="OpenHPI"
+
+# If the openhpid executable is not available, we can't do any of this
+test -f /usr/sbin/openhpid || exit 0
+
+# Determine whether the lsb package is installed
+# If it is, determine which lsb is installed:
+# redhat, suse, or standard lsb
+
+if test -f /etc/init.d/functions
+then
+ lsbtype="rh"
+ . /etc/init.d/functions
+elif test -f /etc/rc.status
+then
+ lsbtype="suse"
+ . /etc/rc.status
+elif test -f /lib/lsb/init-functions
+then
+ lsbtype="lsb"
+ . /lib/lsb/init-functions
+elif test -f /etc/gentoo-release
+then
+ lsbtype="gentoo"
+ . /sbin/functions.sh
+else
+ lsbtype="nolsb"
+fi
+
+print_outcome()
+{
+
+ case "${lsbtype}" in
+
+ suse)
+ rc_status -v
+ ;;
+
+ lsb)
+ if test "$?" -eq 0
+ then
+ log_success_msg "success"
+ else
+ log_failure_msg "failed"
+ fi
+ ;;
+
+ gentoo)
+ eend $?
+ ;;
+
+ nolsb | rh)
+ if test "$?" -eq 0
+ then
+ echo " ... success"
+ fi
+ if test "$?" -ne 0
+ then
+ echo " ... failed"
+ fi
+ ;;
+ esac
+}
+
+start() {
+ case "${lsbtype}" in
+
+ suse)
+ echo -n "Starting $prog: "
+ startproc /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
+ RETVAL=$?
+ ;;
+ lsb)
+ echo -n "Starting $prog: "
+ start_daemon /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
+ RETVAL=$?
+ ;;
+ gentoo | rh)
+ echo "Starting $prog: "
+ start-stop-daemon --start --quiet --exec /usr/sbin/openhpid -- -c /etc/openhpi/openhpi.conf
+ RETVAL=$?
+ ;;
+ nolsb)
+ echo -n "Starting $prog: "
+ /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
+ RETVAL=$?
+ ;;
+
+ esac
+
+ print_outcome
+
+}
+
+stop() {
+ case "${lsbtype}" in
+
+ lsb | suse)
+ echo -n "Stopping $prog: "
+ killproc /usr/sbin/openhpid
+ RETVAL=$?
+ ;;
+
+ gentoo)
+ echo "Stopping $prog: "
+ start-stop-daemon --stop --quiet --exec /usr/sbin/openhpid
+ RETVAL=$?
+ ;;
+
+ nolsb | rh)
+ echo -n "Stopping $prog: "
+ if test -f /var/run/openhpid.pid && test "`cat /var/run/openhpid.pid`" != ""
+ then
+ kill "`cat /var/run/openhpid.pid`"
+ RETVAL=$?
+ else
+ RETVAL=0
+ fi
+ ;;
+
+ esac
+
+ print_outcome
+
+ if test "$RETVAL" -eq 0 && test -f /var/run/openhpid.pid
+ then
+ rm -f /var/lock/openhpid
+ rm -f /var/run/openhpid.pid
+ fi
+
+}
+
+dstatus() {
+ echo "Checking for $prog daemon: "
+
+ case "${lsbtype}" in
+
+ suse)
+ checkproc /usr/sbin/openhpid
+ rc_status -v
+ ;;
+ lsb)
+ pid="`pidofproc /usr/sbin/openhpid`"
+ if test "${pid}" != ""
+ then
+ log_success_msg "$prog is running"
+ else
+ log_success_msg "$prog is not running"
+ fi
+ ;;
+ gentoo | nolsb | rh)
+ if test -f /var/run/openhpid.pid &&
+ test "`cat /var/run/openhpid.pid`" != "" &&
+ kill -s 0 "`cat /var/run/openhpid.pid`"
+ then
+ echo "$prog is running"
+ else
+ echo "$prog is not running"
+ fi
+
+ ;;
+
+ esac
+
+
+
+}
+
+restart() {
+ stop
+ start
+}
+
+force_reload() {
+ # We don't currently support a reload, but can do a restart
+ stop
+ start
+}
+
+# See how we were called.
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ status)
+ dstatus
+ ;;
+ force-reload)
+ force_reload
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status|force-reload}"
+ exit 1
+esac
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service
new file mode 100644
index 000000000..cd4168f8e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Daemon providing access to the SAF Hardware Platform Interface
+After=syslog.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/openhpid.pid
+ExecStart=@SBINDIR@/openhpid -c @SYSCONFDIR@/openhpi/openhpi.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest
new file mode 100755
index 000000000..5b187d908
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+for x in `find ./ -name Makefile`;
+do
+ make -C `dirname ${x}` -k runtest-TESTS
+done
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb b/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb
new file mode 100644
index 000000000..ecf71d70f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb
@@ -0,0 +1,115 @@
+SUMMARY = "Hardware Platform Interface Library and Tools"
+
+DESCRIPTION = "\
+OpenHPI is an open source project created with the intent of providing an \
+implementation of the SA Forum's Hardware Platform Interface (HPI). HPI \
+provides an abstracted interface to managing computer hardware, typically for \
+chassis and rack based servers. HPI includes resource modeling; access to and \
+control over sensor, control, watchdog, and inventory data associated with \
+resources; abstracted System Event Log interfaces; hardware events and alerts; \
+and a managed hotswap interface. \
+\
+OpenHPI provides a modular mechanism for adding new hardware and device support \
+easily. Many plugins exist in the OpenHPI source tree to provide access to \
+various types of hardware. This includes, but is not limited to, IPMI based \
+servers, Blade Center, and machines which export data via sysfs. \
+"
+
+HOMEPAGE = "http://openhpi.sourceforge.net/Home"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e3c772a32386888ccb5ae1c0ba95f1a4"
+
+DEPENDS = "net-snmp libxml2 ncurses openssl glib-2.0 popt e2fsprogs autoconf-archive-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
+ file://openhpi.init \
+ file://openhpid.service \
+ file://run-ptest \
+ file://openhpi-netsnmp-cross-compile.patch \
+ file://openhpi-sysfs-cross-compile.patch \
+ file://openhpi-libxml2-cross-compile.patch \
+ file://openhpi-glib-cross-compile.patch \
+ file://openhpi-linkfix.patch \
+ file://openhpi-fix-host-gcc.patch \
+ file://openhpi-hpi-shell-thread-fix.patch \
+ file://openhpi-fix-testfail-errors.patch \
+ file://openhpi-add-libnetsnmp-when-link.patch \
+ file://openhpi-invalide-session.patch \
+ file://openhpi-use-serial-tests-config-needed-by-ptest.patch \
+ file://openhpi-fix-alignment-issue.patch \
+ file://0001-Fix-build-failures-with-gcc7.patch \
+ file://c++11.patch \
+ file://clang-c++11.patch \
+ file://fix-narrowing-warning.patch \
+ file://0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch \
+ file://0001-ipmidirect-Replace-__STRING.patch \
+ "
+
+SRC_URI[md5sum] = "4718b16e0f749b5ad214a9b04f45dd23"
+SRC_URI[sha256sum] = "e0a810cb401c4bdcfc9551f2e6afd5a8ca4b411f5ee3bc60c19f82fd6e84a3dc"
+
+inherit autotools pkgconfig ptest update-rc.d systemd
+
+PACKAGES =+ "${PN}-libs"
+
+FILES_${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so"
+
+INSANE_SKIP_${PN}-libs = "dev-so"
+RDEPENDS_${PN} += "${PN}-libs"
+
+PACKAGECONFIG ??= "libgcrypt non32bit"
+PACKAGECONFIG[sysfs] = "--enable-sysfs,--disable-sysfs,sysfsutils,"
+PACKAGECONFIG[libgcrypt] = "--enable-encryption,--disable-encryption,libgcrypt,"
+PACKAGECONFIG[non32bit] = "--enable-non32bit-int,--disable-non32bit-int,,"
+
+do_install_append () {
+ install -m 0755 -d ${D}${sysconfdir}/${BPN}
+ install -m 0755 ${S}/openhpiclient.conf.example ${D}${sysconfdir}/${BPN}/openhpiclient.conf
+ install -m 0700 ${S}/openhpi.conf.example ${D}${sysconfdir}/${BPN}/openhpi.conf
+ install -m 0755 ${S}/simulation.data.example ${D}${sysconfdir}/${BPN}/simulation.data
+ install -m 0755 ${S}/test_agent.data.example ${D}${sysconfdir}/${BPN}/test_agent.data
+ install -m 0755 ${WORKDIR}/openhpi.init ${D}${sysconfdir}/init.d/openhpid
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/openhpid.service ${D}${systemd_unitdir}/system
+ sed -i -e "s,@SBINDIR@,${sbindir},g" -e "s,@SYSCONFDIR@,${sysconfdir},g" \
+ ${D}${systemd_unitdir}/system/openhpid.service
+}
+
+do_compile_ptest () {
+ for x in `find ${B} -name Makefile -exec grep -l buildtest-TESTS {} \;`; do
+ dir=`dirname ${x}`
+ upper=`dirname ${dir}`
+ if [ `basename ${upper}` != "cpp" ]; then
+ oe_runmake -C ${dir} buildtest-TESTS
+ fi
+ done
+}
+
+do_install_ptest () {
+ cp -rf ${B}/openhpid/t/ohpi/.libs/* ${B}/openhpid/t/ohpi/
+ TESTS="utils marshal openhpid"
+ for subtest in ${TESTS}; do
+ mkdir -p ${D}${PTEST_PATH}/${subtest}/t
+ cp -rf ${B}/${subtest}/t/* ${D}${PTEST_PATH}/${subtest}/t
+ done
+
+ for x in `find ${D}${PTEST_PATH} -name Makefile`; do
+ sed -i "s:${S}:${PTEST_PATH}/:g" ${x};
+ sed -i "s/^Makefile:/MM:/g" ${x};
+ done;
+
+ mkdir -p ${D}${PTEST_PATH}/plugins/watchdog/
+ cp -L ${D}/${libdir}/${BPN}/libwatchdog.so ${D}${PTEST_PATH}/plugins/watchdog/
+ cp -L ${D}/${libdir}/${BPN}/libsimulator.so ${D}${PTEST_PATH}/plugins/watchdog/
+ find ${D}${PTEST_PATH}/ -name "*.c" -exec rm {} \;
+ find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \;
+ find ${D}${PTEST_PATH}/ -name "*.h" -exec rm {} \;
+}
+
+INITSCRIPT_NAME = "openhpid"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "openhpid.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch
new file mode 100644
index 000000000..effe25c85
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch
@@ -0,0 +1,123 @@
+From ab00d6f5793b2d850f975bcb6d5d0aa6d7a9eaa4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 12:34:37 -0700
+Subject: [PATCH] configure: Disable format-overflow if supported by gcc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.am | 6 ++--
+ configure.ac | 2 ++
+ m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 79 insertions(+), 3 deletions(-)
+ create mode 100644 m4/ax_check_compile_flag.m4
+
+Index: opensaf-5.18.02/Makefile.am
+===================================================================
+--- opensaf-5.18.02.orig/Makefile.am
++++ opensaf-5.18.02/Makefile.am
+@@ -52,10 +52,10 @@ AM_CPPFLAGS = \
+ -pthread \
+ -D_GNU_SOURCE -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"' \
+ $(CORE_INCLUDES) \
+- $(all_includes)
++ $(all_includes) @NOWARNINGS@
+
+-AM_CFLAGS = -pipe -std=gnu11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
+-AM_CXXFLAGS = -pipe -std=gnu++11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
++AM_CFLAGS = -pipe -std=gnu11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror @NOWARNINGS@
++AM_CXXFLAGS = -pipe -std=gnu++11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror @NOWARNINGS@
+
+ if ENABLE_GCOV
+ AM_CFLAGS += --coverage
+Index: opensaf-5.18.02/configure.ac
+===================================================================
+--- opensaf-5.18.02.orig/configure.ac
++++ opensaf-5.18.02/configure.ac
+@@ -593,6 +593,8 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
+ fi
+ AC_SUBST(OSAF_HARDEN_FLAGS)
+
++AX_CHECK_COMPILE_FLAG([-Werror=format-overflow],[NOWARNINGS=-Wno-error=format-overflow])
++AC_SUBST(NOWARNINGS)
+ #############################################
+ # List the output Makefiles
+ #############################################
+Index: opensaf-5.18.02/m4/ax_check_compile_flag.m4
+===================================================================
+--- /dev/null
++++ opensaf-5.18.02/m4/ax_check_compile_flag.m4
+@@ -0,0 +1,74 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
++#
++# DESCRIPTION
++#
++# Check whether the given FLAG works with the current language's compiler
++# or gives an error. (Warnings, however, are ignored)
++#
++# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
++# success/failure.
++#
++# If EXTRA-FLAGS is defined, it is added to the current language's default
++# flags (e.g. CFLAGS) when the check is done. The check is thus made with
++# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
++# force the compiler to issue an error when a bad flag is given.
++#
++# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
++#
++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
++# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
++#
++# LICENSE
++#
++# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation, either version 3 of the License, or (at your
++# option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program. If not, see <https://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 5
++
++AC_DEFUN([AX_CHECK_COMPILE_FLAG],
++[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
++ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
++ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
++ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
++ [AS_VAR_SET(CACHEVAR,[yes])],
++ [AS_VAR_SET(CACHEVAR,[no])])
++ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
++AS_VAR_IF(CACHEVAR,yes,
++ [m4_default([$2], :)],
++ [m4_default([$3], :)])
++AS_VAR_POPDEF([CACHEVAR])dnl
++])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch
new file mode 100644
index 000000000..5756a027b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch
@@ -0,0 +1,29 @@
+From 6248b717b4861d16b80235fd8e57d64e4f636428 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Apr 2017 17:39:07 -0700
+Subject: [PATCH] configure: Pass linker specific options with -Wl
+
+This helps make it pass the options to linker correctly
+and we can use non-gcc compilers
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index df4fc58..02771c6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -553,7 +553,7 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
+ if echo "${CFLAGS} ${CXXFLAGS}" | grep -q -- -O0; then
+ OSAF_HARDEN_FLAGS=""
+ fi
+- OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -zrelro -znow"
++ OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -Wl,-z,relro,-z,now"
+ fi
+ AC_SUBST(OSAF_HARDEN_FLAGS)
+
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch
new file mode 100644
index 000000000..76c47c658
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch
@@ -0,0 +1,34 @@
+From 508ea7c0d67243feb1684eaa83569cb687561d64 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 15 Sep 2017 10:09:03 -0700
+Subject: [PATCH] immpbe_dump.cc: Use sys/wait.h instead of wait.h
+
+Fixes
+redirecting incorrect #include <wait.h> to <sys/wait.h>
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/imm/common/immpbe_dump.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc
+index 100222f37..33e47ce3c 100644
+--- a/src/imm/common/immpbe_dump.cc
++++ b/src/imm/common/immpbe_dump.cc
+@@ -26,12 +26,12 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <time.h>
+-#include <wait.h>
+ #include <unistd.h>
+ #include <iostream>
+ #include <sstream>
+ #include <stdint.h>
+ #include <sys/stat.h>
++#include <sys/wait.h>
+ #include <libgen.h>
+
+ #include <saAis.h>
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch
new file mode 100644
index 000000000..4a2a825f9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch
@@ -0,0 +1,122 @@
+From 6442b57a855e273aa5a3d93e8596783cea128073 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 15 Sep 2017 09:39:40 -0700
+Subject: [PATCH] src: Add missing header limits.h for _POSIX_HOST_NAME_MAX
+
+Use _GNU_SOURCE instead of libc internal __USE_GNU
+Do not use the deprecated headers under include/sys
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/base/os_defs.h | 5 +++--
+ src/mds/mds_dt_tcp.c | 1 -
+ src/mds/mds_dt_tcp_disc.h | 2 +-
+ src/mds/mds_dt_tipc.c | 1 -
+ src/mds/mds_dt_tipc.h | 2 +-
+ src/mds/mds_dt_trans.c | 1 -
+ src/ntf/ntfd/NtfLogger.cc | 2 +-
+ 7 files changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/src/base/os_defs.h b/src/base/os_defs.h
+index 50a9bf5fc..af6842863 100644
+--- a/src/base/os_defs.h
++++ b/src/base/os_defs.h
+@@ -47,17 +47,18 @@
+ #include <sys/stat.h>
+ #include <sys/msg.h> /* Added for message-queues : PM : 28/10/03 */
+ #include <syslog.h>
+-#ifndef __USE_GNU
++#include <limits.h>
++#ifndef _GNU_SOURCE
+ struct msgbuf {
+ long int mtype;
+ char mtext[1];
+ };
+ #endif /* else defined in <sys/msg.h> */
+ #include <sys/time.h>
+-#include <sys/fcntl.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+
++#include <fcntl.h>
+ #include <signal.h>
+ #include <pthread.h>
+
+diff --git a/src/mds/mds_dt_tcp.c b/src/mds/mds_dt_tcp.c
+index 1407eb1ab..a87c22faa 100644
+--- a/src/mds/mds_dt_tcp.c
++++ b/src/mds/mds_dt_tcp.c
+@@ -27,7 +27,6 @@
+
+ #include <stdlib.h>
+ #include <sched.h>
+-#include <sys/poll.h>
+ #include <poll.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+diff --git a/src/mds/mds_dt_tcp_disc.h b/src/mds/mds_dt_tcp_disc.h
+index a6249d73e..574f52681 100644
+--- a/src/mds/mds_dt_tcp_disc.h
++++ b/src/mds/mds_dt_tcp_disc.h
+@@ -24,7 +24,7 @@
+ #include "base/ncssysf_tsk.h"
+ #include "base/ncssysf_mem.h"
+ #include "mds_dt_tcp_disc.h"
+-#include "sys/poll.h"
++#include <poll.h>
+
+ /* mds_indentifire + mds_version + msg_type + scope_type + server_type +
+ server_instance_lower + server_instance_upper + sub_ref_val + sub_ref_val +
+diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
+index 37745e7f0..9b3255567 100644
+--- a/src/mds/mds_dt_tipc.c
++++ b/src/mds/mds_dt_tipc.c
+@@ -35,7 +35,6 @@
+ #include <stdbool.h>
+ #include <stdlib.h>
+ #include <sched.h>
+-#include <sys/poll.h>
+ #include <poll.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+diff --git a/src/mds/mds_dt_tipc.h b/src/mds/mds_dt_tipc.h
+index e73a11b09..401d208c2 100644
+--- a/src/mds/mds_dt_tipc.h
++++ b/src/mds/mds_dt_tipc.h
+@@ -32,7 +32,7 @@
+ #include <assert.h>
+ #include <string.h>
+ #include <sys/param.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <netdb.h>
+ #include <errno.h>
+ #include <fcntl.h>
+diff --git a/src/mds/mds_dt_trans.c b/src/mds/mds_dt_trans.c
+index 6f621e04e..5aacbd33e 100644
+--- a/src/mds/mds_dt_trans.c
++++ b/src/mds/mds_dt_trans.c
+@@ -26,7 +26,6 @@
+ #include "mds_core.h"
+ #include "base/osaf_utility.h"
+
+-#include <sys/poll.h>
+ #include <poll.h>
+
+ #define MDS_PROT_TCP 0xA0
+diff --git a/src/ntf/ntfd/NtfLogger.cc b/src/ntf/ntfd/NtfLogger.cc
+index 84014b578..31b1ccc6c 100644
+--- a/src/ntf/ntfd/NtfLogger.cc
++++ b/src/ntf/ntfd/NtfLogger.cc
+@@ -20,7 +20,7 @@
+ * INCLUDE FILES
+ * ========================================================================
+ */
+-#include <sys/poll.h>
++#include <poll.h>
+
+ #include "base/osaf_utility.h"
+ #include <saAis.h>
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb
new file mode 100644
index 000000000..4b556ce8c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb
@@ -0,0 +1,67 @@
+SUMMARY = "OpenSAF is an open source implementation of the SAF AIS specification"
+DESCRIPTION = "OpenSAF is an open source project established to develop a base platform \
+middleware consistent with Service Availability Forum (SA Forum) \
+specifications, under the LGPLv2.1 license. The OpenSAF Foundation was \
+established by leading Communications and Enterprise Computing Companies to \
+facilitate the OpenSAF Project and to accelerate the adoption of the OpenSAF \
+code base in commercial products. \
+The OpenSAF project was launched in mid 2007 and has been under development by \
+an informal group of supporters of the OpenSAF initiative. The OpenSAF \
+Foundation was founded on January 22nd 2008 with Emerson Network Power, \
+Ericsson, Nokia Siemens Networks, HP and Sun Microsystems as founding members."
+HOMEPAGE = "http://www.opensaf.org"
+SECTION = "admin"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7"
+
+DEPENDS = "libxml2 python"
+TOOLCHAIN = "gcc"
+
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
+ file://0001-configure-Pass-linker-specific-options-with-Wl.patch \
+ file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \
+ file://0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch \
+ file://0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch \
+"
+SRC_URI[md5sum] = "42064f5ddbc7f560bfc5ff93ea9eecc7"
+SRC_URI[sha256sum] = "f9e24897f9cfd63bb3115f6275c706de1702d3d9bae2fc423227db72b23c37f0"
+
+inherit autotools useradd systemd pkgconfig
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-f -r opensaf"
+USERADD_PARAM_${PN} = "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf"
+
+SYSTEMD_SERVICE_${PN} += "opensafd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+PACKAGECONFIG[systemd] = ",,systemd"
+PACKAGECONFIG[openhpi] = "--with-hpi-interface=B03 --enable-ais-plm,,openhpi"
+
+PACKAGECONFIG_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
+
+PKGLIBDIR="${libdir}"
+
+LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
+
+do_install_append() {
+ cp -av --no-preserve=ownership ${B}/lib/.libs/*.so* ${D}${libdir}
+ rm -fr "${D}${localstatedir}/lock"
+ rm -fr "${D}${localstatedir}/run"
+ rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
+ rmdir --ignore-fail-on-non-empty "${D}${datadir}/java"
+ if [ ! -d "${D}${sysconfdir}/init.d" ]; then
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${B}/osaf/services/infrastructure/nid/scripts/opensafd ${D}${sysconfdir}/init.d/
+ fi
+}
+
+FILES_${PN} += "${systemd_unitdir}/system/*.service"
+FILES_${PN}-staticdev += "${PKGLIBDIR}/*.a"
+
+INSANE_SKIP_${PN} = "dev-so"
+
+RDEPENDS_${PN} += "bash python"
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch
new file mode 100644
index 000000000..6b86e3925
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch
@@ -0,0 +1,26 @@
+From 63619acf25151d4dade6d65732722ec4a710a5ac Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Jul 2017 09:54:25 -0700
+Subject: [PATCH] Check for glibc before setting CANT_USE_SEND_RECV_MSG
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/util/sys_defs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h
+index f720e2a..7314c63 100644
+--- a/src/util/sys_defs.h
++++ b/src/util/sys_defs.h
+@@ -813,7 +813,7 @@ extern int initgroups(const char *, int);
+ #define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1)
+ #endif
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) \
+- || (__GLIBC__ < 2)
++ || (defined(__GLIBC__) && (__GLIBC__ < 2))
+ #define CANT_USE_SEND_RECV_MSG
+ #define DEF_SMTP_CACHE_DEMAND 0
+ #else
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch
new file mode 100644
index 000000000..763a4a9b9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch
@@ -0,0 +1,64 @@
+From a0d0de10e4c5ab55bc2fa48798079e2876b1211d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 10:29:37 -0700
+Subject: [PATCH] makedefs: Use native compiler to build makedefs.test
+
+Its a binary used during build
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ makedefs | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/makedefs b/makedefs
+index 9fd4bc2..5ee7747 100644
+--- a/makedefs
++++ b/makedefs
+@@ -526,7 +526,7 @@ int main(int argc, char **argv)
+ exit(0);
+ }
+ EOF
+- ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
++ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c || exit 1
+ rm -f makedefs.test makedefs.test.[co]
+ fi;;
+ esac
+@@ -762,7 +762,7 @@ int main(int argc, char **argv)
+ exit(0);
+ }
+ EOF
+- ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
++ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c || exit 1
+ ./makedefs.test 2>/dev/null ||
+ CCARGS="$CCARGS -DNO_SIGSETJMP"
+ rm -f makedefs.test makedefs.test.[co]
+@@ -796,7 +796,7 @@ int main(int argc, char **argv)
+ &error) != 14);
+ }
+ EOF
+- ${CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \
++ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \
+ $icu_ldflags >/dev/null 2>&1
+ if ./makedefs.test 2>/dev/null ; then
+ CCARGS="$CCARGS $icu_cppflags"
+@@ -911,7 +911,7 @@ int main(void)
+ exit(ferror(stdout) ? 1 : 0);
+ }
+ EOF
+- eval ${CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
++ eval ${BUILD_CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
+ ./makedefs.test || exit 1
+ rm -f makedefs.test makedefs.test.[co]
+ }
+@@ -1067,7 +1067,7 @@ int main(void)
+ exit(ferror(stdout) ? 1 : 0);
+ }
+ EOF
+- eval ${CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
++ eval ${BUILD_CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
+ parm_val=`./makedefs.test` || exit 1
+ rm -f makedefs.test makedefs.test.[co]
+ eval ${parm_name}=\""\$parm_val"\"
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/aliasesdb b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/aliasesdb
new file mode 100755
index 000000000..855a64f70
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/aliasesdb
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp
+
+make_aliasesdb() {
+ if [ "$(/usr/sbin/postconf -h alias_database)" = "hash:/etc/aliases" ]
+ then
+ # /etc/aliases.db may be used by other MTA, make sure nothing
+ # has touched it since our last newaliases call
+ [ /etc/aliases -nt /etc/aliases.db ] ||
+ [ "$ALIASESDB_STAMP" -nt /etc/aliases.db ] ||
+ [ "$ALIASESDB_STAMP" -ot /etc/aliases.db ] || return 0
+ /usr/bin/newaliases
+ touch -r /etc/aliases.db "$ALIASESDB_STAMP"
+ else
+ /usr/bin/newaliases
+ fi
+}
+
+make_aliasesdb
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/check_hostname.sh b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/check_hostname.sh
new file mode 100755
index 000000000..37a0dd088
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/check_hostname.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+HOSTNAME=$(/bin/hostname)
+
+if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" -o ! -z "`echo $HOSTNAME | sed -n '/^[0-9]*\.[0-9].*/p'`" ]; then
+ # If hostname is invalid, and myhostname not existed in main.cf
+ /usr/sbin/postconf -h "myhostname" 2>/dev/null
+ if [ $? -ne 0 ]; then
+ # Set "localhost" to main.cf
+ /usr/sbin/postconf -e "myhostname=localhost"
+ fi
+fi
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/icu-config.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/icu-config.patch
new file mode 100644
index 000000000..9bd9c2f03
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/icu-config.patch
@@ -0,0 +1,21 @@
+do not entertain cppflags from icu, this is because
+icu-config feeds the -I path without sysroot which
+caused native headers to be included and build is
+corrupted in any case its just adding -I/usr/include
+to the CCARGS which we loose nothing if its not
+entertained.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: postfix-3.2.2/makedefs
+===================================================================
+--- postfix-3.2.2.orig/makedefs
++++ postfix-3.2.2/makedefs
+@@ -799,7 +799,6 @@ EOF
+ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \
+ $icu_ldflags >/dev/null 2>&1
+ if ./makedefs.test 2>/dev/null ; then
+- CCARGS="$CCARGS $icu_cppflags"
+ SYSLIBS="$SYSLIBS $icu_ldflags"
+ else
+ CCARGS="$CCARGS -DNO_EAI"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/install.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/install.patch
new file mode 100644
index 000000000..d023680f3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/install.patch
@@ -0,0 +1,93 @@
+From 190650e1cd5700cd6950ead3fcb17ebcec192a2e Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Fri, 19 Jun 2015 17:14:58 +0900
+Subject: [PATCH] Change fixed postconf to a variable for cross-compiling
+
+Upstreamstatus: Inappropriate [embedded specific]
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+ postfix-install | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/postfix-install b/postfix-install
+index 1662c3d..d11fa12 100644
+--- a/postfix-install
++++ b/postfix-install
+@@ -226,8 +226,8 @@ test -z "$non_interactive" -a ! -t 0 && {
+ exit 1
+ }
+
+-test -x bin/postconf || {
+- echo $0: Error: no bin/postconf file. Did you forget to run \"make\"? 1>&2
++test -x "$POSTCONF" || {
++ echo $0: Error: no $POSTCONF file. Did you forget to run \"make\"? 1>&2
+ exit 1
+ }
+
+@@ -248,7 +248,7 @@ do
+ case "$junk" in
+ *MAIL_VERSION*)
+ case "$mail_version" in
+- "") mail_version="`bin/postconf -dhx mail_version`" || exit 1
++ "") mail_version="`$POSTCONF -dhx mail_version`" || exit 1
+ esac
+ val=`echo "$junk" | sed 's/MAIL_VERSION$/'"$mail_version/g"` || exit 1
+ case "$val" in
+@@ -434,7 +434,7 @@ template files main.cf.proto and master.cf.proto."
+
+ : ${install_root=/}
+ : ${tempdir=`pwd`}
+-: ${config_directory=`bin/postconf -c conf -h -d config_directory`}
++: ${config_directory=`$POSTCONF -c conf -h -d config_directory`}
+
+ # Find out the location of installed configuration files.
+
+@@ -500,7 +500,7 @@ test -f $CONFIG_DIRECTORY/main.cf && {
+ case "$junk" in
+ "") eval unset $name;;
+ esac
+- eval : \${$name=\`bin/postconf -c $CONFIG_DIRECTORY -hx $name\`} ||
++ eval : \${$name=\`$POSTCONF -c $CONFIG_DIRECTORY -hx $name\`} ||
+ exit 1
+ done
+ }
+@@ -513,7 +513,7 @@ do
+ case "$junk" in
+ "") eval unset $name;;
+ esac
+- eval : \${$name=\`bin/postconf -c conf -d -hx $name\`} || exit 1
++ eval : \${$name=\`$POSTCONF -c conf -d -hx $name\`} || exit 1
+ done
+
+ # Override settings manually.
+@@ -639,6 +639,8 @@ README_DIRECTORY=$install_root$readme_directory
+ SHLIB_DIRECTORY=$install_root$shlib_directory
+ META_DIRECTORY=$install_root$meta_directory
+
++test "x$POSTCONF" != "x" || POSTCONF="bin/postconf"
++
+ # Avoid repeated tests for existence of these; default permissions suffice.
+
+ test -d $DAEMON_DIRECTORY || mkdir -p $DAEMON_DIRECTORY || exit 1
+@@ -810,7 +812,7 @@ IFS="$BACKUP_IFS"
+ # the wrong place when Postfix is being upgraded.
+
+ case "$mail_version" in
+-"") mail_version="`bin/postconf -dhx mail_version`" || exit 1
++"") mail_version="`$POSTCONF -dhx mail_version`" || exit 1
+ esac
+
+ # Undo MAIL_VERSION expansion at the end of a parameter value. If
+@@ -830,7 +832,7 @@ do
+ esac
+ done
+
+-bin/postconf -c $CONFIG_DIRECTORY -e \
++"$POSTCONF" -c $CONFIG_DIRECTORY -e \
+ "daemon_directory = $daemon_directory" \
+ "data_directory = $data_directory" \
+ "command_directory = $command_directory" \
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/internal_recipient b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/internal_recipient
new file mode 100644
index 000000000..6a8f2681b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/internal_recipient
@@ -0,0 +1 @@
+root@ permit_mynetworks,reject
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/main.cf b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/main.cf
new file mode 100644
index 000000000..e75c6fc0d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/main.cf
@@ -0,0 +1,105 @@
+compatibility_level = 2
+smtputf8_enable = no
+
+# Configure your domain and accounts
+#mydomain=sample.com
+#FQDN from gethostname
+#myhostname =
+mydomain=localdomain
+mydestination = $myhostname, localhost.localdomain localhost
+mynetworks = 127.0.0.1/8
+inet_interfaces = 127.0.0.1
+
+virtual_mailbox_domains = sample.com, other.net
+virtual_mailbox_maps = hash:/etc/postfix/virtual
+virtual_alias_maps = hash:/etc/postfix/virtual_alias
+
+alias_maps = hash:/etc/aliases
+
+# You'll start with the following lines for maildir storage
+virtual_mailbox_base = /var/spool/vmail
+virtual_uid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 3`
+virtual_gid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 4`
+
+
+# You'll start with the following lines for IMAP storage
+#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp
+
+
+# General stuff here again
+#config_directory = /etc/postfix
+sample_directory = /etc/postfix
+queue_directory = /var/spool/postfix
+mail_spool_directory = /var/spool/mail
+readme_directory = no
+command_directory = /usr/sbin
+daemon_directory = @LIBEXECDIR@/postfix
+mail_owner = postfix
+setgid_group = postdrop
+unknown_local_recipient_reject_code = 450
+mynetworks_style = host
+debug_peer_level = 2
+sendmail_path = /usr/sbin/sendmail
+newaliases_path = /usr/bin/newaliases
+mailq_path = /usr/bin/mailq
+
+smtpd_data_restrictions =
+ permit_mynetworks,
+ reject_unauth_pipelining,
+ permit
+
+smtpd_client_restrictions =
+ permit_mynetworks,
+ # reject_unknown_client, # This can cause a lot of false rejects.
+ reject_invalid_hostname,
+ reject_rbl_client list.dsbl.org,
+ reject_rbl_client sbl.spamhaus.org,
+ reject_rbl_client cbl.abuseat.org,
+ reject_rbl_client dul.dnsbl.sorbs.net,
+ permit
+
+smtpd_helo_required = yes
+smtpd_helo_restrictions =
+ permit_mynetworks,
+ reject_unauth_pipelining,
+ # reject_non_fqdn_hostname, # This can cause a lot of false rejects.
+ # reject_unknown_hostname, # This can cause a lot of false rejects.
+ reject_invalid_hostname,
+ permit
+
+smtpd_sender_restrictions =
+ permit_mynetworks,
+ reject_non_fqdn_sender,
+ # check_sender_access hash:/etc/postfix/access_domains,
+ reject_unknown_sender_domain,
+ permit
+
+smtpd_recipient_restrictions =
+ permit_mynetworks,
+ permit_sasl_authenticated,
+ reject_unauth_destination,
+
+ # check_recipient_access pcre:/etc/postfix/recipient_checks.pcre,
+ # check_helo_access pcre:/etc/postfix/helo_checks.pcre,
+
+ # check_client_access hash:/etc/postfix/maps/access_client,
+ # check_client_access hash:/etc/postfix/maps/exceptions_client,
+ # check_helo_access hash:/etc/postfix/maps/access_helo,
+ # check_helo_access hash:/etc/postfix/maps/verify_helo,
+ # check_sender_access hash:/etc/postfix/maps/access_sender,
+ # check_sender_access hash:/etc/postfix/maps/verify_sender,
+ # check_recipient_access hash:/etc/postfix/maps/access_recipient,
+
+ # reject_multi_recipient_bounce,
+ reject_non_fqdn_recipient,
+ reject_unknown_recipient_domain,
+ # reject_unlisted_recipient,
+ #check_policy_service unix:private/policy,
+
+ # check_sender_access hash:/etc/postfix/maps/no_verify_sender,
+ # check_sender_access hash:/etc/postfix/access_domains,
+ # reject_unverified_sender,
+ # reject_unverified_recipient
+ check_recipient_access hash:/etc/postfix/internal_recipient
+
+disable_vrfy_command = yes
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/makedefs.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/makedefs.patch
new file mode 100644
index 000000000..98d5f7ed6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/makedefs.patch
@@ -0,0 +1,116 @@
+From 4f49e2ce420fb3c17415937530493158ef312733 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Fri, 19 Jun 2015 16:45:54 +0900
+Subject: [PATCH] 1)remove RANLIB, SYSLIBS, AR and get them from env.
+
+2)reference sysroot when searching header files
+3)include sysroot path instead of absolute include path
+for Linux2 and Linux3 systems.
+4)for non-native build, search STAGING_BASELIBDIR/LIBDIR
+ native build, search host library path for nsl and resolv library
+ which comes from libc
+
+Upstreamstatus: Inappropriate [embedded specific]
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+ makedefs | 27 +++++++++++----------------
+ 1 file changed, 11 insertions(+), 16 deletions(-)
+
+diff --git a/makedefs b/makedefs
+index 8b84e47..893fb0d 100644
+--- a/makedefs
++++ b/makedefs
+@@ -170,9 +170,6 @@ echo "# pie=$pie"
+
+ # Defaults for most sane systems
+
+-RANLIB=ranlib
+-SYSLIBS=
+-AR=ar
+ ARFL=rv
+
+ # Ugly function to make our error message more visible among the
+@@ -424,12 +421,12 @@ case "$SYSTEM.$RELEASE" in
+ case "$CCARGS" in
+ *-DNO_DB*) ;;
+ *-DHAS_DB*) ;;
+- *) if [ -f /usr/include/db.h ]
++ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
+ then
+ : we are all set
+- elif [ -f /usr/include/db/db.h ]
++ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
+ then
+- CCARGS="$CCARGS -I/usr/include/db"
++ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
+ else
+ # No, we're not going to try db1 db2 db3 etc.
+ # On a properly installed system, Postfix builds
+@@ -438,12 +435,12 @@ case "$SYSTEM.$RELEASE" in
+ echo "Install the appropriate db*-devel package first." 1>&2
+ exit 1
+ fi
+- SYSLIBS="-ldb"
++ SYSLIBS="$SYSLIBS -ldb"
+ ;;
+ esac
+ for name in nsl resolv $GDBM_LIBS
+ do
+- for lib in /usr/lib64 /lib64 /usr/lib /lib
++ for lib in $BUILD_SYSROOT_NSL_PATH
+ do
+ test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
+ SYSLIBS="$SYSLIBS -l$name"
+@@ -463,7 +460,7 @@ case "$SYSTEM.$RELEASE" in
+ if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ]
+ then
+ :
+- elif [ ! -e /usr/include/sys/epoll.h ]
++ elif [ ! -e "$BUILD_SYSROOT"/usr/include/sys/epoll.h ]
+ then
+ echo CCARGS="$CCARGS -DNO_EPOLL"
+ else
+@@ -487,8 +484,6 @@ int main(int argc, char **argv)
+ }
+ EOF
+ ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
+- ./makedefs.test 2>/dev/null ||
+- CCARGS="$CCARGS -DNO_EPOLL"
+ rm -f makedefs.test makedefs.test.[co]
+ fi;;
+ esac
+@@ -504,12 +499,12 @@ EOF
+ case "$CCARGS" in
+ *-DNO_DB*) ;;
+ *-DHAS_DB*) ;;
+- *) if [ -f /usr/include/db.h ]
++ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
+ then
+ : we are all set
+- elif [ -f /usr/include/db/db.h ]
++ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
+ then
+- CCARGS="$CCARGS -I/usr/include/db"
++ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
+ else
+ # On a properly installed system, Postfix builds
+ # by including <db.h> and by linking with -ldb
+@@ -517,12 +512,12 @@ EOF
+ echo "Install the appropriate db*-devel package first." 1>&2
+ exit 1
+ fi
+- SYSLIBS="-ldb"
++ SYSLIBS="$SYSLIBS -ldb"
+ ;;
+ esac
+ for name in nsl resolv
+ do
+- for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/*
++ for lib in $BUILD_SYSROOT_NSL_PATH
+ do
+ test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
+ SYSLIBS="$SYSLIBS -l$name"
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix
new file mode 100755
index 000000000..8c7a60175
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix
@@ -0,0 +1,94 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: postfix MTA
+# Default-Start: 2345
+# Default-Stop: 016
+# Short-Description: start and stop postfix
+# Description: Postfix is a Mail Transport Agent, which is the program
+# that moves mail from one machine to another.
+### END INIT INFO
+
+success() {
+ echo " Successful"
+ exit 0
+}
+
+fail() {
+ echo " Failed"
+ exit 1
+
+}
+
+check_return () {
+ local ret="$1"
+
+ if [ "$ret" = "0" ]; then
+ success
+ else
+ fail
+ fi
+}
+
+PIDFile=/var/spool/postfix/pid/master.pid
+case "$1" in
+
+ start)
+ echo -n "Starting Postfix..."
+ if [ ! -e /etc/aliases.db ]; then
+ # The alias database is necessary for postfix to work correctly.
+ echo "Creating aliases database ..."
+ newaliases
+ fi
+ if ! postfix status >/dev/null 2>&1; then
+ /usr/sbin/check_hostname.sh
+ postfix start
+ check_return $?
+ else
+ success
+ fi
+ ;;
+
+ stop)
+ echo -n "Stopping Postfix..."
+ if postfix status >/dev/null 2>&1; then
+ postfix stop
+ check_return $?
+ else
+ success
+ fi
+ ;;
+
+ reload)
+ echo -n "Reloading Postfix..."
+ if postfix status >/dev/null 2>&1; then
+ postfix reload
+ check_return $?
+ else
+ postfix start
+ check_return $?
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ status)
+ if postfix status >/dev/null 2>&1; then
+ pid=`sed -e 's/\s//g' $PIDFile`
+ echo "The Postfix mail system is running (PID: $pid)"
+ exit 0
+ else
+ echo "The Postfix mail system is not running"
+ exit 1
+ fi
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|status|reload|restart}"
+ exit 1
+ ;;
+esac
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix-install.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix-install.patch
new file mode 100644
index 000000000..45479bd52
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix-install.patch
@@ -0,0 +1,26 @@
+Index: postfix-3.2.2/postfix-install
+===================================================================
+--- postfix-3.2.2.orig/postfix-install
++++ postfix-3.2.2/postfix-install
+@@ -843,7 +843,7 @@ IFS="$BACKUP_IFS"
+ # the wrong place when Postfix is being upgraded.
+
+ case "$mail_version" in
+-"") mail_version="`$POSTCONF -dhx mail_version`" || exit 1
++"") mail_version="`$POSTCONF -c $CONFIG_DIRECTORY -dhx mail_version`" || exit 1
+ esac
+
+ # Undo MAIL_VERSION expansion at the end of a parameter value. If
+Index: postfix-3.2.2/Makefile.in
+===================================================================
+--- postfix-3.2.2.orig/Makefile.in
++++ postfix-3.2.2/Makefile.in
+@@ -20,7 +20,7 @@ META = meta/main.cf.proto meta/master.cf
+ EXPAND = sed -e "s;\$${LIB_PREFIX};$(LIB_PREFIX);" \
+ -e "s;\$${LIB_SUFFIX};$(LIB_SUFFIX);"
+ SHLIB_DIR_OVERRIDE = \
+- $${shlib_directory:-`$(SHLIB_ENV) bin/postconf -dhx shlib_directory`}
++ $${shlib_directory:-`$(SHLIB_ENV) $(POSTCONF) -dhx shlib_directory`}
+
+ default: update
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix.service b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix.service
new file mode 100644
index 000000000..30d54a440
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Postfix Mail Transport Agent
+After=syslog.target network.target
+Conflicts=sendmail.service exim.service
+
+[Service]
+Type=forking
+PIDFile=@LOCALSTATEDIR@/spool/postfix/pid/master.pid
+ExecStartPre=-@SBINDIR@/check_hostname.sh
+ExecStartPre=-@LIBEXECDIR@/postfix/aliasesdb
+ExecStart=@SBINDIR@/postfix start
+ExecReload=@SBINDIR@/postfix reload
+ExecStop=@SBINDIR@/postfix stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
new file mode 100644
index 000000000..09447d50a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -0,0 +1,262 @@
+SUMMARY = "Postfix Mail Transport Agent"
+DESCRIPTION = "Postfix is Wietse Venema's mail server that started life at \
+IBM research as an alternative to the widely-used Sendmail program. \
+Postfix attempts to be fast, easy to administer, and secure. The outsidei \
+has a definite Sendmail-ish flavor, but the inside is completely different."
+
+HOMEPAGE= "http://www.postfix.org"
+SECTION = "mail"
+DEPENDS = "db icu libpcre openssl postfix-native \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'openldap', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', 'cyrus-sasl', '', d)} \
+"
+DEPENDS_class-native = "db-native icu-native openssl-native libpcre-native"
+
+LICENSE = "IPL-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=64375f37431336ea1b1b3005fe3fa354"
+
+SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \
+ file://makedefs.patch \
+ file://install.patch \
+ file://main.cf \
+ file://postfix \
+ file://internal_recipient \
+ file://postfix.service \
+ file://aliasesdb \
+ file://check_hostname.sh \
+"
+
+S = "${WORKDIR}/postfix-${PV}"
+
+CLEANBROKEN = "1"
+
+BBCLASSEXTEND = "native"
+
+inherit update-rc.d useradd update-alternatives systemd
+
+INITSCRIPT_NAME = "postfix"
+INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ."
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = \
+"-d /var/spool/postfix -r -g postfix --shell /bin/false postfix; \
+ -d /var/spool/vmail -r -g vmail --shell /bin/false vmail \
+"
+GROUPADD_PARAM_${PN} = "--system postfix;--system postdrop;--system vmail"
+
+export SYSLIBS = "${LDFLAGS}"
+
+# CCARGS specifies includes, defines
+# AUXLIBS specifies libraries
+# Linux2/Linux3 has HAS_DB defined
+# makedefs will make CC to be CC+CCARGS
+
+# ldap support
+export CCARGS-ldap = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-DHAS_LDAP', '', d)}"
+export AUXLIBS-ldap = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-lldap -llber', '', d)}"
+
+# no native openldap
+export CCARGS-ldap_class-native = ""
+export AUXLIBS-ldap_class-native = ""
+
+export CCARGS-nonis_libc-musl = "-DNO_NIS"
+export CCARGS-nonis = ""
+
+# SASL support -DUSE_LDAP_SASL -DUSE_SASL_AUTH
+# current openldap didn't enable SASL
+export CCARGS-sasl = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${STAGING_INCDIR}/sasl', '', d)}"
+export AUXLIBS-sasl = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-lsasl2', '', d)}"
+export CCARGS-sasl_class-native = ""
+export AUXLIBS-sasl_class-native = ""
+
+# PCRE, TLS support default
+export CCARGS = "${CFLAGS} -DHAS_PCRE -DUSE_TLS -I${STAGING_INCDIR}/openssl ${CCARGS-ldap} ${CCARGS-sasl} ${CCARGS-nonis}"
+export AUXLIBS = "-lpcre -lssl -lcrypto ${AUXLIBS-sasl} ${AUXLIBS-ldap}"
+export POSTCONF = "${STAGING_DIR_NATIVE}${sbindir_native}/postconf"
+
+export CCARGS-nonis_libc-musl = "-DNO_NIS"
+# OPT,DEBUG is aready in CFLAGS
+# ignore the OPTS="CC=$CC" in Makefile it will not use the CC=$CC $CCARGS
+EXTRA_OEMAKE += "OPT= DEBUG= OPTS= "
+
+do_compile () {
+ unset CFLAGS CPPFLAGS CXXFLAGS
+ local native_build
+
+ native_build="${@['0', '1'][bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d)]}"
+
+ # if not native build, then pass SYSTEM and RELEASE to makedefs
+ if [ "${native_build}" != "1" ]; then
+ # uname -s for target
+ SYSTEM="Linux"
+
+ # uname -r, use 2.6 as bottomline, even target kernel ver > 2.6
+ RELEASE="2.6.34"
+ sed -i -e \
+ "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \
+ ${S}/Makefile.in
+ export BUILD_SYSROOT="${STAGING_DIR_HOST}"
+ export BUILD_SYSROOT_NSL_PATH="${STAGING_BASELIBDIR} \
+ ${STAGING_LIBDIR}"
+ else
+ # native build
+ export BUILD_SYSROOT="${STAGING_DIR_NATIVE}"
+
+ # ubuntu x86 host: /lib/x86_64-linux-gnu(64) /lib/i386-linux-gnu (32)
+ # on 64 bits, 32 libs in i386-linux-gnu
+ # let makedefs finds nsl and resolv libs, host CC will link
+ # the correct libraries
+ BUILD_SYSROOT_NSL_PATH="$(${CC} -print-search-dirs 2>/dev/null | \
+ sed -n '/^libraries: =/s/libraries: =//p' | \
+ sed -e 's/:/\n/g' | xargs -n1 readlink -f | \
+ grep -v 'gcc\|/[0-9.]\+$' | sort -u)"
+ if [ -z "$BUILD_SYSROOT_NSL_PATH" ]; then
+ BUILD_SYSROOT_NSL_PATH="/usr/lib64 /lib64 \
+ /lib/x86_64-linux-gnu \
+ /usr/lib /lib \
+ /lib/i386-linux-gnu"
+ fi
+ export BUILD_SYSROOT_NSL_PATH
+ fi
+
+ oe_runmake makefiles
+ oe_runmake
+}
+
+do_install_prepend_class-native() {
+ export POSTCONF="bin/postconf"
+}
+
+SYSTEMD_SERVICE_${PN} = "postfix.service"
+
+do_install () {
+ sh ./postfix-install 'install_root=${D}' \
+ 'config_directory=${sysconfdir}/postfix' \
+ 'daemon_directory=${libexecdir}/postfix' \
+ 'command_directory=${sbindir}' \
+ 'queue_directory=${localstatedir}/spool/postfix' \
+ 'sendmail_path=${sbindir}/sendmail.postfix' \
+ 'newaliases_path=${bindir}/newaliases' \
+ 'mailq_path=${bindir}/mailq' \
+ 'manpage_directory=${mandir}' \
+ 'readme_directory=${datadir}/doc/postfix' \
+ 'data_directory=${localstatedir}/lib/postfix' \
+ -non-interactive
+ rm -rf ${D}${localstatedir}/spool/postfix
+ mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/sample-main.cf
+ install -m 755 ${S}/bin/smtp-sink ${D}/${sbindir}/
+ install -d ${D}${sysconfdir}/init.d
+ install -m 644 ${WORKDIR}/main.cf ${D}${sysconfdir}/postfix/main.cf
+ sed -i 's#@LIBEXECDIR@#${libexecdir}#' ${D}${sysconfdir}/postfix/main.cf
+
+ install -m 755 ${WORKDIR}/check_hostname.sh ${D}${sbindir}/
+
+ install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix
+ install -m 644 ${WORKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/postfix.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_unitdir}/system/postfix.service
+ sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/postfix.service
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/postfix.service
+
+ install -m 0755 ${WORKDIR}/aliasesdb ${D}${libexecdir}/postfix
+
+ install -m 770 -d ${D}${localstatedir}/spool/postfix
+ chown postfix:postfix ${D}${localstatedir}/spool/postfix
+
+ install -m 0755 -d ${D}${localstatedir}/lib/postfix
+ chown postfix:nogroup ${D}${localstatedir}/lib/postfix
+ install -m 0755 -d ${D}${localstatedir}/spool/postfix
+ chown root:postfix ${D}${localstatedir}/spool/postfix
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/active
+ chown postfix:root ${D}${localstatedir}/spool/postfix/active
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/bounce
+ chown postfix:root ${D}${localstatedir}/spool/postfix/bounce
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/corrupt
+ chown postfix:root ${D}${localstatedir}/spool/postfix/corrupt
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/defer
+ chown postfix:root ${D}${localstatedir}/spool/postfix/defer
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/deferred
+ chown postfix:root ${D}${localstatedir}/spool/postfix/deferred
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/flush
+ chown postfix:root ${D}${localstatedir}/spool/postfix/flush
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/hold
+ chown postfix:root ${D}${localstatedir}/spool/postfix/hold
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/incoming
+ chown postfix:root ${D}${localstatedir}/spool/postfix/incoming
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/saved
+ chown postfix:root ${D}${localstatedir}/spool/postfix/saved
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/trace
+ chown postfix:root ${D}${localstatedir}/spool/postfix/trace
+ install -m 0730 -d ${D}${localstatedir}/spool/postfix/maildrop
+ chown postfix:postdrop ${D}${localstatedir}/spool/postfix/maildrop
+ install -m 0755 -d ${D}${localstatedir}/spool/postfix/pid
+ chown root:root ${D}${localstatedir}/spool/postfix/pid
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/private
+ chown postfix:root ${D}${localstatedir}/spool/postfix/private
+ install -m 0710 -d ${D}${localstatedir}/spool/postfix/public
+ chown postfix:postdrop ${D}${localstatedir}/spool/postfix/public
+ install -m 0755 -d ${D}${localstatedir}/spool/vmail
+ chown vmail:vmail ${D}${localstatedir}/spool/vmail
+
+ chown :postdrop ${D}${sbindir}/postqueue
+ chown :postdrop ${D}${sbindir}/postdrop
+ chmod g+s ${D}${sbindir}/postqueue
+ chmod g+s ${D}${sbindir}/postdrop
+}
+
+do_install_append_class-native() {
+ ln -sf ../sbin/sendmail.postfix ${D}${bindir}/newaliases
+ ln -sf ../sbin/sendmail.postfix ${D}${bindir}/mailq
+}
+
+do_install_append_class-target() {
+ # Remove references to buildmachine paths in target makedefs.out
+ sed -i 's:-fdebug-prefix-map[^ ]*::g; s:--sysroot=${STAGING_DIR_TARGET}::g' ${D}/etc/postfix/makedefs.out
+}
+
+ALTERNATIVE_${PN} = "sendmail"
+ALTERNATIVE_TARGET[sendmail] = "${sbindir}/sendmail.postfix"
+ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
+ALTERNATIVE_PRIORITY = "120"
+
+ALTERNATIVE_${PN}-doc += "mailq.1 newaliases.1 sendmail.1"
+ALTERNATIVE_LINK_NAME[mailq.1] = "${mandir}/man1/mailq.1"
+ALTERNATIVE_LINK_NAME[newaliases.1] = "${mandir}/man1/newaliases.1"
+ALTERNATIVE_LINK_NAME[sendmail.1] = "${mandir}/man1/sendmail.1"
+
+PACKAGE_WRITE_DEPS += "postfix-native"
+pkg_postinst_${PN} () {
+ if [ "x$D" = "x" ]; then
+ touch /etc/aliases
+ newaliases
+
+ # generate virtual_alias, default is hash
+ touch /etc/postfix/virtual_alias
+ postmap /etc/postfix/virtual_alias
+ else
+ if ${@'true' if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) else 'false'}; then
+ # /usr/lib/sendmail is required by LSB core test
+ [ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
+ fi
+
+ touch $D/etc/aliases
+ # This can fail depending on host setup
+ if ! newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases; then
+ $INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX}
+ exit 0
+ fi
+ touch $D/etc/postfix/virtual_alias
+ postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
+
+ fi
+}
+
+# Exclude .debug directories from the main package
+FILES_${PN} = "${sysconfdir} ${localstatedir} ${bindir}/* ${sbindir}/* \
+ ${libexecdir}/* ${systemd_unitdir}/*"
+FILES_${PN}-dbg += "${libexecdir}/postfix/.debug"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb
new file mode 100644
index 000000000..89af406ac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb
@@ -0,0 +1,9 @@
+require postfix.inc
+
+SRC_URI += "file://0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch \
+ file://0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch \
+ file://postfix-install.patch \
+ file://icu-config.patch \
+ "
+SRC_URI[md5sum] = "aea073a9b0bea5bdb590460a270a4aa0"
+SRC_URI[sha256sum] = "d06849418d119d09366997b2b481bb23f737629769b4e4a52da42fb3ad8b0576"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch
new file mode 100644
index 000000000..4967bed1e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Inappropriate [configuration]
+
+proftpd tries to get the IP address from the hostname.
+Unluckily now the hostname is not properly configured in /etc/hosts.
+We can use this patch as a workaround.
+
+Author: Dexuan Cui <dexuan.cui@intel.com>
+Tue Oct 25 12:59:27 CST 2011
+
+--- proftpd-1.3.3c.orig/sample-configurations/basic.conf
++++ proftpd-1.3.3c/sample-configurations/basic.conf
+@@ -7,6 +7,9 @@
+ ServerType standalone
+ DefaultServer on
+
++#By default we bind to all interfaces.
++DefaultAddress 0.0.0.0
++
+ # Port 21 is the standard FTP port.
+ Port 21
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/build_fixup.patch b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/build_fixup.patch
new file mode 100644
index 000000000..9816d4d22
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/build_fixup.patch
@@ -0,0 +1,112 @@
+Upstream-Status: Inappropriate [configuration]
+
+combined the following patches into one:
+make, move-pidfile-to-var-run, move-runfile-to-var-run
+
+move pidfile to /var/run
+redefine PR_RUN_DIR as ${localstatedir}/run
+
+Signed-off-By: Armin Kuster <akuster808@gmail.com>
+
+
+Index: proftpd-1.3.6/Make.rules.in
+===================================================================
+--- proftpd-1.3.6.orig/Make.rules.in
++++ proftpd-1.3.6/Make.rules.in
+@@ -30,9 +30,9 @@ INSTALL=@INSTALL@
+ INSTALL_STRIP=@INSTALL_STRIP@
+ INSTALL_USER=@install_user@
+ INSTALL_GROUP=@install_group@
+-INSTALL_BIN=$(INSTALL) $(INSTALL_STRIP) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755
+-INSTALL_SBIN=$(INSTALL) $(INSTALL_STRIP) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755
+-INSTALL_MAN=$(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644
++INSTALL_BIN=$(INSTALL) -m 0755
++INSTALL_SBIN=$(INSTALL) -m 0755
++INSTALL_MAN=$(INSTALL) -m 0644
+
+ RM=rm -f
+ SHELL=@CONFIG_SHELL@
+Index: proftpd-1.3.6/Makefile.in
+===================================================================
+--- proftpd-1.3.6.orig/Makefile.in
++++ proftpd-1.3.6/Makefile.in
+@@ -105,7 +105,6 @@ check: proftpd$(EXEEXT)
+ $(DESTDIR)$(localedir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir)/proftpd $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir) $(DESTDIR)$(libdir)/proftpd $(DESTDIR)$(libexecdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man8:
+ @if [ ! -d $@ ]; then \
+ mkdir -p $@; \
+- chown $(INSTALL_USER):$(INSTALL_GROUP) $@; \
+ chmod 0755 $@; \
+ fi
+
+@@ -115,7 +114,6 @@ install-proftpd: proftpd $(DESTDIR)$(inc
+ rm -f $(DESTDIR)$(sbindir)/in.proftpd ; \
+ fi
+ ln -s proftpd $(DESTDIR)$(sbindir)/in.proftpd
+- -chown -h $(INSTALL_USER):$(INSTALL_GROUP) $(DESTDIR)$(sbindir)/in.proftpd
+
+ install-libs: $(DESTDIR)$(libdir)/proftpd
+ cd lib/ && $(MAKE) install
+@@ -152,11 +150,11 @@ install-utils: $(DESTDIR)$(sbindir) $(DE
+ $(INSTALL_SBIN) ftpshut $(DESTDIR)$(sbindir)/ftpshut
+ $(INSTALL_BIN) ftptop $(DESTDIR)$(bindir)/ftptop
+ $(INSTALL_BIN) ftpwho $(DESTDIR)$(bindir)/ftpwho
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs
++ $(INSTALL) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs
+
+ install-conf: $(DESTDIR)$(sysconfdir)
+ if [ ! -f $(DESTDIR)$(sysconfdir)/proftpd.conf ] ; then \
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644 \
++ $(INSTALL) -m 0644 \
+ $(top_srcdir)/sample-configurations/basic.conf \
+ $(DESTDIR)$(sysconfdir)/proftpd.conf ; \
+ fi
+Index: proftpd-1.3.6/configure
+===================================================================
+--- proftpd-1.3.6.orig/configure
++++ proftpd-1.3.6/configure
+@@ -41777,7 +41777,7 @@ _ACEOF
+
+
+ cat >>confdefs.h <<_ACEOF
+-#define PR_RUN_DIR "`eval echo "${localstatedir}"`"
++#define PR_RUN_DIR "`eval echo "${localstatedir}"/run/`"
+ _ACEOF
+
+
+@@ -41787,7 +41787,7 @@ _ACEOF
+
+
+ cat >>confdefs.h <<_ACEOF
+-#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/proftpd.pid"`"
++#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/run/proftpd.pid"`"
+ _ACEOF
+
+
+Index: proftpd-1.3.6/configure.in
+===================================================================
+--- proftpd-1.3.6.orig/configure.in
++++ proftpd-1.3.6/configure.in
+@@ -3833,8 +3833,8 @@ locale_dir="`eval echo ${locale_dir}`"
+ AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`", [Define the locale directory])
+
+ AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`", [Define the run directory])
+-AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`", [Define the configuration file path])
+-AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/proftpd.pid"`", [Define the PID file path])
++AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/run/proftpd.conf"`", [Define the configuration file path])
++AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/run/proftpd.pid"`", [Define the PID file path])
+
+ prefix="$pr_saved_prefix"
+ exec_prefix="$pr_saved_exec_prefix"
+Index: proftpd-1.3.6/lib/libcap/Makefile
+===================================================================
+--- proftpd-1.3.6.orig/lib/libcap/Makefile
++++ proftpd-1.3.6/lib/libcap/Makefile
+@@ -26,7 +26,7 @@ OBJS=$(addsuffix .o, $(FILES))
+ all: $(LIBNAME)
+
+ _makenames: _makenames.c cap_names.sed
+- $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
++ $(BUILD_CC) $(CFLAGS) $(LDFLAGS) $< -o $@
+
+ cap_names.h: _makenames
+ ./_makenames > cap_names.h
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch
new file mode 100644
index 000000000..c64535cac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch
@@ -0,0 +1,27 @@
+close RequireValidShell check
+
+Upstream-Status: Inappropriate [configuration]
+
+close RequireValidShell check since we like to make /bin/false as shell
+for ftp user
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ sample-configurations/basic.conf | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/sample-configurations/basic.conf b/sample-configurations/basic.conf
+index 314eb79..abcb284 100644
+--- a/sample-configurations/basic.conf
++++ b/sample-configurations/basic.conf
+@@ -53,6 +53,7 @@ AllowOverwrite on
+ # We want clients to be able to login with "anonymous" as well as "ftp"
+ UserAlias anonymous ftp
+
++ RequireValidShell off
+ # Limit the maximum number of anonymous logins
+ MaxClients 10
+
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/contrib.patch b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/contrib.patch
new file mode 100644
index 000000000..7e2a8e3ce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/contrib.patch
@@ -0,0 +1,42 @@
+The contrib directory now contains its own Makefile which is
+used during installation. It was required to pass DESTDIR through
+when it gets called from the base Makefile.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
+---
+ Makefile.in | 2 +-
+ contrib/Makefile.in | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 5b2e683..ee72fe1 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -120,7 +120,7 @@ install-modules: $(DESTDIR)$(libexecdir) $(DESTDIR)$(sysconfdir)
+ test -z "$(SHARED_MODULE_OBJS)" -a -z "$(SHARED_MODULE_DIRS)" -a -z "$(STATIC_MODULE_DIRS)" || (cd modules/ && $(MAKE) install)
+
+ install-utils: $(DESTDIR)$(sbindir) $(DESTDIR)$(bindir)
+- cd contrib/ && $(MAKE) install-utils
++ cd contrib/ && $(MAKE) DESTDIR=${DESTDIR} install-utils
+ $(INSTALL_BIN) ftpcount $(DESTDIR)$(bindir)/ftpcount
+ $(INSTALL_BIN) ftpdctl $(DESTDIR)$(bindir)/ftpdctl
+ $(INSTALL_SBIN) ftpscrub $(DESTDIR)$(sbindir)/ftpscrub
+diff --git a/contrib/Makefile.in b/contrib/Makefile.in
+index 5bcc038..51d248c 100644
+--- a/contrib/Makefile.in
++++ b/contrib/Makefile.in
+@@ -18,6 +18,6 @@ Makefile: Makefile.in ../config.status
+ cd ../ && ./config.status
+
+ install-utils:
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota
++ $(INSTALL) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd
++ $(INSTALL) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail
++ $(INSTALL) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota
+--
+1.7.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/default b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/default
new file mode 100644
index 000000000..b31f36ce2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/default
@@ -0,0 +1,9 @@
+# Defaults for proftpd initscript
+
+# Master system-wide proftpd switch. The initscript
+# will not run if it is not set to yes.
+RUN="yes"
+
+# Default options.
+# For more exhaustive logging, try "-d 3".
+OPTIONS=""
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init
new file mode 100644
index 000000000..01c998c92
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init
@@ -0,0 +1,220 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: proftpd
+# Required-Start: $remote_fs $syslog $local_fs $network
+# Required-Stop: $remote_fs $syslog $local_fs $network
+# Should-Start: $named
+# Should-Stop: $named
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts ProFTPD daemon
+# Description: This script runs the FTP service offered
+# by the ProFTPD daemon
+### END INIT INFO
+
+# Start the proftpd FTP daemon.
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DAEMON=/usr/sbin/proftpd
+NAME=proftpd
+
+# Defaults
+RUN="no"
+OPTIONS=""
+CONFIG_FILE=/etc/proftpd.conf
+
+PIDFILE=`grep -i '^pidfile' $CONFIG_FILE|awk '{ print $2 }'`
+if [ "x$PIDFILE" = "x" ];
+then
+ PIDFILE=/var/run/proftpd.pid
+fi
+
+# Read config (will override defaults)
+[ -r /etc/default/proftpd ] && . /etc/default/proftpd
+
+trap "" 1
+trap "" 15
+
+test -f $DAEMON || exit 0
+
+. /etc/init.d/functions
+
+#
+# Servertype could be inetd|standalone|none.
+# In all cases check against inetd and xinetd support.
+#
+if ! egrep -qi "^[[:space:]]*ServerType.*standalone" $CONFIG_FILE
+then
+ if egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.conf 2>/dev/null || \
+ egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.d/* 2>/dev/null || \
+ egrep -qi "^ftp.*/usr/sbin/proftpd" /etc/inetd.conf 2>/dev/null
+ then
+ RUN="no"
+ INETD="yes"
+ else
+ if ! egrep -qi "^[[:space:]]*ServerType.*inetd" $CONFIG_FILE
+ then
+ RUN="yes"
+ INETD="no"
+ else
+ RUN="no"
+ INETD="no"
+ fi
+ fi
+fi
+
+# /var/run could be on a tmpfs
+
+[ ! -d /var/run/proftpd ] && mkdir /var/run/proftpd
+
+inetd_check()
+{
+ if [ ! -x /usr/sbin/inetd -a ! -x /usr/sbin/xinetd ]; then
+ echo "Neither inetd nor xinetd appears installed: check your configuration."
+ fi
+}
+
+start()
+{
+ set -e
+ echo -n "Starting ftp server $NAME... "
+ start-stop-daemon --start --quiet --pidfile "$PIDFILE" --oknodo --exec $DAEMON -- -c $CONFIG_FILE $OPTIONS
+ echo "done."
+}
+
+signal()
+{
+
+ if [ "$1" = "stop" ]; then
+ SIGNAL="TERM"
+ echo -n "Stopping ftp server $NAME... "
+ else
+ if [ "$1" = "reload" ]; then
+ SIGNAL="HUP"
+ echo -n "Reloading ftp server $NAME... "
+ else
+ echo "ERR: wrong parameter given to signal()"
+ exit 1
+ fi
+ fi
+ if [ -f "$PIDFILE" ]; then
+ start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
+ if [ $? = 0 ]; then
+ echo "done."
+ return
+ else
+ SIGNAL="KILL"
+ start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
+ if [ $? != 0 ]; then
+ echo
+ [ $2 != 0 ] || exit 0
+ else
+ echo "done."
+ return
+ fi
+ fi
+ if [ "$SIGNAL" = "KILL" ]; then
+ rm -f "$PIDFILE"
+ fi
+ else
+ echo "done."
+ return
+ fi
+}
+
+case "$1" in
+ start)
+ if [ "x$RUN" = "xyes" ] ; then
+ start
+ else
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "ProFTPD is started from inetd/xinetd."
+ inetd_check
+ else
+ echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
+ fi
+ fi
+ ;;
+
+ force-start)
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "Warning: ProFTPD is started from inetd/xinetd (trying to start anyway)."
+ inetd_check
+ fi
+ start
+ ;;
+
+ stop)
+ if [ "x$RUN" = "xyes" ] ; then
+ signal stop 0
+ else
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "ProFTPD is started from inetd/xinetd."
+ inetd_check
+ else
+ echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
+ fi
+ fi
+ ;;
+
+ force-stop)
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "Warning: ProFTPD is started from inetd/xinetd (trying to kill anyway)."
+ inetd_check
+ fi
+ signal stop 0
+ ;;
+
+ reload)
+ signal reload 0
+ ;;
+
+ force-reload|restart)
+ if [ "x$RUN" = "xyes" ] ; then
+ signal stop 1
+ sleep 2
+ start
+ else
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "ProFTPD is started from inetd/xinetd."
+ inetd_check
+ else
+ echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
+ fi
+ fi
+ ;;
+
+ status)
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "ProFTPD is started from inetd/xinetd."
+ inetd_check
+ exit 0
+ else
+ if [ -f "$PIDFILE" ]; then
+ pid=$(cat $PIDFILE)
+ else
+ pid="x"
+ fi
+ if [ `pidof proftpd|grep "$pid"|wc -l` -ne 0 ] ; then
+ echo "ProFTPD is started in standalone mode, currently running."
+ exit 0
+ else
+ echo "ProFTPD is started in standalone mode, currently not running."
+ exit 3
+ fi
+ fi
+ ;;
+
+ check-config)
+ $DAEMON -t >/dev/null && echo "ProFTPD configuration OK" && exit 0
+ exit 1
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/$NAME {start|status|force-start|stop|force-stop|reload|restart|force-reload|check-config}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd.service b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd.service
new file mode 100644
index 000000000..18764385e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=proftpd Daemon
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/proftpd -c @SYSCONFDIR@/proftpd.conf
+StandardError=syslog
+
+[Install]
+WantedBy=default.target
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb b/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb
new file mode 100644
index 000000000..409947265
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb
@@ -0,0 +1,138 @@
+SUMMARY = "Secure and configurable FTP server"
+SECTION = "net"
+HOMEPAGE = "http://www.proftpd.org"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184"
+
+SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \
+ file://basic.conf.patch \
+ file://proftpd-basic.init \
+ file://default \
+ file://close-RequireValidShell-check.patch \
+ file://contrib.patch \
+ file://build_fixup.patch \
+ file://proftpd.service \
+ "
+iSRC_URI[md5sum] = "13270911c42aac842435f18205546a1b"
+SRC_URI[sha256sum] = "91ef74b143495d5ff97c4d4770c6804072a8c8eb1ad1ecc8cc541b40e152ecaf"
+
+inherit autotools-brokensep useradd update-rc.d systemd
+
+PACKAGECONFIG ??= "shadow \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
+ "
+
+PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses, --disable-curses --disable-ncurses, ncurses"
+PACKAGECONFIG[openssl] = "--enable-openssl, --disable-openssl, openssl, openssl"
+PACKAGECONFIG[pam] = "--enable-auth-pam, --disable-auth-pam, libpam, libpam"
+PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6"
+PACKAGECONFIG[shadow] = "--enable-shadow, --disable-shadow"
+PACKAGECONFIG[pcre] = "--enable-pcre, --disable-pcre, libpcre "
+
+# enable POSIX.1e capabilities
+PACKAGECONFIG[cap] = "--enable-cap, --disable-cap, libcap, libcap"
+
+#enable support for POSIX ACLs
+PACKAGECONFIG[acl] = "--enable-facl, --disable-facl"
+
+#enable proftpd controls via ftpdct
+PACKAGECONFIG[ctrls] = "--enable-ctrls, --disable-crtls"
+
+#prevent proftpd from using its bundled getopt implementation.
+PACKAGECONFIG[getopt] = "--with-getopt, --without-getopt"
+
+#do not strip debugging symbols from installed code
+PACKAGECONFIG[strip] = "--enable-strip, --disable-strip"
+
+#enable SIA authentication support (Tru64)
+PACKAGECONFIG[sia] = "--enable-sia, --disable-sia"
+PACKAGECONFIG[sendfile] = "-enable-sendfile, --disable-sendfile"
+
+#enable Native Language Support (NLS)
+PACKAGECONFIG[nls] = "--enable-nls, --disable-nls"
+
+#add mod_dso to core modules
+PACKAGECONFIG[dso] = "--enable-dso, --disable-dso"
+PACKAGECONFIG[largefile] = "--enable-largefile, --disable-largefile"
+
+#omit mod_auth_file from core modules
+PACKAGECONFIG[auth] = "--enable-auth-file, --disable-auth-file"
+
+
+# proftpd uses libltdl which currently makes configuring using
+# autotools.bbclass a pain...
+do_configure () {
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+ oe_runconf
+ cp ${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool ${S}/libtool
+}
+
+FTPUSER = "ftp"
+FTPGROUP = "ftp"
+
+do_install () {
+ oe_runmake DESTDIR=${D} install
+ rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale
+ [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir}
+ sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf
+ sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd
+ sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd
+
+ # create the pub directory
+ mkdir -p ${D}/home/${FTPUSER}/pub/
+ chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
+ # install proftpd pam configuration
+ install -d ${D}${sysconfdir}/pam.d
+ install -m 644 ${S}/contrib/dist/rpm/ftp.pamd ${D}${sysconfdir}/pam.d/proftpd
+ sed -i '/ftpusers/d' ${D}${sysconfdir}/pam.d/proftpd
+ # specify the user Authentication config
+ sed -i '/^MaxInstances/a\AuthPAM on\nAuthPAMConfig proftpd' \
+ ${D}${sysconfdir}/proftpd.conf
+ fi
+
+ install -d ${D}/${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/proftpd.service ${D}/${systemd_unitdir}/system
+ sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ -i ${D}${systemd_unitdir}/system/*.service
+
+ sed -e 's|--sysroot=${STAGING_DIR_HOST}||g' \
+ -e 's|${STAGING_DIR_NATIVE}||g' \
+ -e 's|-fdebug-prefix-map=[^ ]*||g' \
+ -i ${D}/${bindir}/prxs
+
+ # ftpmail perl script, which reads the proftpd log file and sends
+ # automatic email notifications once an upload finishs,
+ # depends on an old perl Mail::Sendmail
+ # The Mail::Sendmail has not been maintained for almost 10 years
+ # Other distribution not ship with ftpmail, so do the same to
+ # avoid confusion about having it fails to run
+ rm -rf ${D}${bindir}/ftpmail
+ rm -rf ${D}${mandir}/man1/ftpmail.1
+}
+
+INITSCRIPT_NAME = "proftpd"
+INITSCRIPT_PARAM = "defaults 85 15"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "proftpd.service"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}"
+USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \
+ --shell /bin/false ${FTPUSER}"
+
+FILES_${PN} += "/home/${FTPUSER}"
+
+RDEPENDS_${PN} += "perl"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd-use-pkgconfig.patch b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd-use-pkgconfig.patch
new file mode 100644
index 000000000..e4578dda7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd-use-pkgconfig.patch
@@ -0,0 +1,35 @@
+From 4c850b92a1cf8cfa19677c66bcde2edfab1a4490 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Tue, 24 Feb 2015 23:02:14 -0500
+Subject: [PATCH] ptpd: use pkgconfig
+
+Yocto uses pkg-config for libpcap, rather than pcap-config, so use that
+instead as the source for libs and cflags.
+
+Upstream-status: Inappropriate [ embedded specific ]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index dc9541f..288f547 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -112,10 +112,10 @@ case "$try_pcap" in
+ yes)
+ case "$PATH_PCAP_CONFIG" in
+ /*)
+- PCAP_LIBS=`$PATH_PCAP_CONFIG --libs`
++ PCAP_LIBS=`$PATH_PCAP_CONFIG --libs libpcap`
+ AC_SUBST([PCAP_LIBS])
+ # Separate CPPFLAGS and CFLAGS
+- foo=`$PATH_PCAP_CONFIG --cflags`
++ foo=`$PATH_PCAP_CONFIG --cflags libpcap`
+ PCAP_CPPFLAGS=
+ PCAP_CFLAGS=
+ for i in $foo; do
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.conf b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.conf
new file mode 100644
index 000000000..ddd571036
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.conf
@@ -0,0 +1,7 @@
+#
+# PTPD Configuration
+#
+# See man ptpd2 for arguments.
+#
+# Example arguments
+PTPDARGS="-d 1 -i eth0"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.service b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.service
new file mode 100644
index 000000000..f84799eb5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=ptpd time precision daemon
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/ptpd
+ExecStart=@BINDIR@/ptpd2 $PTPDARGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb
new file mode 100644
index 000000000..e13619320
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb
@@ -0,0 +1,58 @@
+SUMMARY = "The PTP daemon (PTPd)"
+DESCRIPTION = "The PTP daemon (PTPd) implements the Precision Time protocol (PTP) as \
+defined by the relevant IEEE 1588 standard. PTP Version 1 implements IEEE-1588-2002, \
+and PTP Version 2 implements IEEE-1588-2008. PTP was developed to provide very precise \
+time coordination of LAN connected computers."
+HOMEPAGE = "http://sourceforge.net/projects/ptpd"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://README;md5=0733e1b3788ab2ebbc63bf33a020da1d"
+
+DEPENDS = "libpcap"
+
+inherit autotools pkgconfig systemd
+
+# return something like '1.2.3' or '1.2.3/rc1'
+#
+def get_sub(d):
+ parts = d.getVar('PV').split('-')
+ try:
+ return parts[0] + '/' + parts[1]
+ except:
+ return parts[0]
+
+SRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${@get_sub(d)}/ptpd-${PV}.tar.gz \
+ file://ptpd-use-pkgconfig.patch \
+ file://ptpd.service \
+ file://ptpd.conf \
+"
+
+SRC_URI[md5sum] = "253bab7ab51d969616ea811be1f132f3"
+SRC_URI[sha256sum] = "0dbf54dd2c178bd9fe62481d2c37513ee36636d8bf137cfdad96891490cdbf93"
+
+S = "${WORKDIR}/ptpd-${PV}"
+
+EXTRA_OEMAKE = ""
+
+EXTRA_OECONF += "--disable-snmp --with-pcap-config=pkg-config"
+
+do_install() {
+ install -d ${D}${bindir} ${D}${mandir}/man8
+ install -m 0755 ${B}/src/ptpd2 ${D}${bindir}
+ install -m 0644 ${B}/src/ptpd2.8 ${D}${mandir}/man8
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/ptpd.service ${D}${systemd_unitdir}/system
+
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/ptpd.service
+ sed -i -e 's#@BINDIR@#${bindir}#g' ${D}${systemd_unitdir}/system/ptpd.service
+
+ install -d ${D}${sysconfdir}/default/
+ install -m 0644 ${WORKDIR}/ptpd.conf ${D}${sysconfdir}/default/ptpd
+ fi
+}
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "ptpd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch
new file mode 100644
index 000000000..76523fb99
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch
@@ -0,0 +1,39 @@
+From 1bafadf2502334a3e972ff667061469316d0d2ca Mon Sep 17 00:00:00 2001
+From: Tudor Florea <tudor.florea@enea.com>
+Date: Tue, 4 Aug 2015 02:46:39 +0200
+Subject: [PATCH] Remove hardcoded /usr/local includes from configure.ac
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+---
+ configure.ac | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6c78e8c..851d45d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -100,18 +100,6 @@ AC_ARG_VAR(PYTHON,local path to the python interpreter)
+ python_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/python/bin:/opt/python/usr/bin:/opt/python/usr/local/bin"
+ AC_PATH_PROG(PYTHON,python,/usr/bin/env python,$python_possible_path)
+
+-if test -d /usr/local/include; then
+- CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+-fi
+-
+-if test -d /usr/kerberos/include; then
+- CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
+-fi
+-
+-if test -d /usr/local/lib; then
+- LDFLAGS="$LDFLAGS -L/usr/local/lib"
+-fi
+-
+ CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
+
+ dnl Checks for header files
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch
new file mode 100644
index 000000000..4cb33bc5c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch
@@ -0,0 +1,31 @@
+From 0290bd6f4ceddff2c52dff833c9d31d24de7d0e1 Mon Sep 17 00:00:00 2001
+From: Tudor Florea <tudor.florea@enea.com>
+Date: Tue, 4 Aug 2015 03:07:01 +0200
+Subject: [PATCH] Don't mess with CFLAGS and LDFLAGS when --with-minimal is specified
+
+We especially don't want stripping enabled.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+---
+ configure.ac | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 851d45d..dc410a1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -423,8 +423,6 @@ AC_ARG_WITH(minimal,
+ AC_DEFINE(NO_FTP_USERS)
+ AC_DEFINE(WITHOUT_ASCII)
+ AC_DEFINE(BORING_MODE)
+- CFLAGS="$CFLAGS -Os -fomit-frame-pointer -fno-unroll-loops "
+- LDFLAGS="$LDFLAGS -s "
+ fi ])
+
+ AC_ARG_WITH(paranoidmsg,
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.42.bb b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.42.bb
new file mode 100644
index 000000000..c1f150405
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.42.bb
@@ -0,0 +1,22 @@
+SUMMARY = "FTP Server with a strong focus on software security"
+DESCRIPTION = "Pure-FTPd is a free (BSD license), secure, production-quality and standard-conformant FTP server."
+HOMEPAGE = "http://www.pureftpd.org/project/pure-ftpd"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=90352fb2bfe17f4261687a0d6e09f489"
+
+DEPENDS = "libcap"
+
+
+SRC_URI = "http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${PV}.tar.gz \
+ file://0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch \
+ file://nostrip.patch \
+"
+SRC_URI[md5sum] = "4195af8f0e5ee2a798b1014071dae3a3"
+SRC_URI[sha256sum] = "7be73a8e58b190a7054d2ae00c5e650cb9e091980420082d02ec3c3b68d8e7f9"
+
+inherit autotools
+
+EXTRA_OECONF = "--with-minimal"
+PACKAGECONFIG[libsodium] ="ac_cv_lib_sodium_crypto_pwhash_scryptsalsa208sha256_str=yes, \
+ ac_cv_lib_sodium_crypto_pwhash_scryptsalsa208sha256_str=no, libsodium"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.default b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.default
new file mode 100644
index 000000000..7cb73c771
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.default
@@ -0,0 +1 @@
+OPTIONS="-u radvd"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.init b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.init
new file mode 100755
index 000000000..8b26317ee
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.init
@@ -0,0 +1,135 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides: radvd
+# Required-Start: $remote_fs $named $syslog
+# Required-Stop: $remote_fs $named $syslog
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Description: router advertisement daemon
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/radvd
+NAME=radvd
+DESC=radvd
+CONFIG=/etc/radvd.conf
+SAVED_SETTINGS=/var/run/radvd/saved-settings
+PIDFILE=/var/run/radvd/radvd.pid
+OPTIONS="-u radvd -p $PIDFILE"
+
+test -x $DAEMON || exit 0
+
+set -e
+
+# Check for IPv6 support in kernel
+if test \! -e /proc/sys/net/ipv6; then
+ echo "IPv6 support must be enabled in the kernel for $DESC to work."
+ exit
+fi
+
+save_settings()
+{
+ local file=$1
+
+ rm -f $file
+ for if_conf in /proc/sys/net/ipv6/conf/*; do
+ echo -e "$if_conf/forwarding\t `cat $if_conf/forwarding`" >> $file
+ done
+ return 0
+}
+
+restore_settings()
+{
+ file=$1
+
+ if [ ! -f $file ]; then
+ echo "$0: warning: cannot restore settings"
+ return
+ fi
+
+ (
+ while read f value; do
+ if [ -w $f ]; then
+ echo $value > $f
+ fi
+ done
+ ) < $file
+}
+
+chkconfig() {
+ if [ ! -e $CONFIG -o ! -s $CONFIG ]; then
+ echo ""
+ echo "* $CONFIG does not exist or is empty."
+ echo "* See /usr/share/doc/radvd/radvd.conf.example for a simple"
+ echo "* configuration suitable for most systems, and radvd.conf(5)"
+ echo "* for configuration file syntax. radvd will *not* be started."
+ exit 0
+ fi
+}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ chkconfig
+ save_settings $SAVED_SETTINGS
+
+ # We must enable IPv6 forwarding for radvd to work
+ echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
+
+ # Check for stale pidfile; radvd won't start if one is lying around
+ if [ -f $PIDFILE ] && ! ps `cat $PIDFILE` > /dev/null; then
+ rm -f $PIDFILE
+ fi
+ if ! start-stop-daemon --oknodo --start --pidfile $PIDFILE \
+ --exec $DAEMON -- $OPTIONS; then
+ echo "failed." && exit 1
+ fi
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ if ! [ -f $PIDFILE ] ; then
+ echo "not running."
+ exit 0
+ fi
+ start-stop-daemon --oknodo --stop --pidfile $PIDFILE \
+ --exec $DAEMON
+ restore_settings $SAVED_SETTINGS
+ rm -f $SAVED_SETTINGS
+ echo "$NAME."
+ ;;
+ status)
+ status $DAEMON;
+ exit $?
+ ;;
+ reload|force-reload)
+ echo "Reloading $DESC configuration files."
+ start-stop-daemon --stop --signal HUP --quiet --pidfile \
+ $PIDFILE --exec $DAEMON
+ ;;
+ restart)
+ chkconfig
+ echo -n "Restarting $DESC: "
+ if ! start-stop-daemon --stop --quiet --pidfile \
+ $PIDFILE --exec $DAEMON; then
+ # stop failed, so we were not running
+ save_settings $SAVED_SETTINGS
+ echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
+ fi
+ sleep 1
+ start-stop-daemon --start --quiet --pidfile \
+ $PIDFILE --exec $DAEMON -- $OPTIONS
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|status|restart|reload|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.service b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.service
new file mode 100644
index 000000000..e60798a6b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Router advertisement daemon for IPv6
+After=network.target
+ConditionPathExists=@SYSCONFDIR@/radvd.conf
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/default/radvd
+ExecStart=@SBINDIR@/radvd -n $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd
new file mode 100644
index 000000000..89256a40e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd
@@ -0,0 +1,2 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d radvd root 0755 /var/run/radvd none
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd.inc b/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd.inc
new file mode 100644
index 000000000..06d16a4ce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd.inc
@@ -0,0 +1,67 @@
+SUMMARY = "IPv6 router advertisement daemon"
+DESCRIPTION = "radvd is the router advertisement daemon for IPv6. It \
+listens to router solicitations and sends router \
+advertisements as described in RFC 2461, Neighbor \
+Discovery for IP Version 6 (IPv6). With these \
+advertisements hosts can automatically configure their \
+addresses and some other parameters. They also can \
+choose a default router based on these advertisements."
+HOMEPAGE = "http://www.litech.org/radvd/"
+SECTION = "net"
+DEPENDS = "flex-native bison-native libdaemon "
+
+# License is BSD-Style (with advertising clause) but also has an additional 0th clause
+LICENSE = "radvd"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=73ebbf7182ae996e65e8fadc9a8c45db"
+
+SRC_URI = "http://v6web.litech.org/radvd/dist/radvd-${PV}.tar.gz \
+ file://radvd.init \
+ file://radvd.service \
+ file://volatiles.03_radvd \
+ file://radvd.default"
+
+inherit autotools update-rc.d useradd pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "radvd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append () {
+ install -m 0755 -d ${D}${sysconfdir}/init.d \
+ ${D}${sysconfdir}/default/volatiles \
+ ${D}${docdir}/radvd
+ # Install init script and volatiles
+ install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd
+ sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd
+
+ install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/volatiles.03_radvd
+
+ # Install systemd service files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/radvd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' \
+ -e 's#@SBINDIR@#${sbindir}#g' \
+ -e 's#@BASE_BINDIR@#${base_bindir}#g' ${D}${systemd_unitdir}/system/radvd.service
+
+ # Install default environment file
+ install -m 0644 ${WORKDIR}/radvd.default ${D}${sysconfdir}/default/radvd
+
+ # Documentation
+ for i in radvd.conf.example README; do \
+ install -m 0644 ${S}/$i ${D}${docdir}/radvd; \
+ done
+}
+
+INITSCRIPT_NAME = "radvd"
+INITSCRIPT_PARAMS = "defaults 20 80"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd"
+
+pkg_postinst_${PN} () {
+ if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then
+ /etc/init.d/populate-volatile.sh update
+ fi
+}
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd_2.17.bb b/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd_2.17.bb
new file mode 100644
index 000000000..4baea01d0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd_2.17.bb
@@ -0,0 +1,5 @@
+
+require radvd.inc
+
+SRC_URI[md5sum] = "64ee3fdb5544bcddef1c6cd80d77fa0a"
+SRC_URI[sha256sum] = "53757e7f2164899e1145482f1ae91829600a6e2f6fec29cfb3b350a3bb45bd5d"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch
new file mode 100644
index 000000000..f482f8088
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch
@@ -0,0 +1,46 @@
+From 27e10667bf27baf5f119a791e3473bb9435a786a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Apr 2017 10:28:28 -0700
+Subject: [PATCH] SquidNew: use noexcept instead of throw for C++11 compilers
+
+Fixes errors with gcc7 which is more pedantic about c++11
+conformance regarding deprecated features
+
+include/SquidNew.h:21:51: error: dynamic exception specifications are deprecated in C++11
+_SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc)
+ ^~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ include/SquidNew.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/include/SquidNew.h b/include/SquidNew.h
+index 39fcee0..c960347 100644
+--- a/include/SquidNew.h
++++ b/include/SquidNew.h
+@@ -18,19 +18,19 @@
+ */
+ #include <new>
+
+-_SQUID_EXTERNNEW_ void *operator new(size_t size) throw (std::bad_alloc)
++_SQUID_EXTERNNEW_ void *operator new(size_t size) noexcept(false)
+ {
+ return xmalloc(size);
+ }
+-_SQUID_EXTERNNEW_ void operator delete (void *address) throw()
++_SQUID_EXTERNNEW_ void operator delete (void *address) noexcept(true)
+ {
+ xfree(address);
+ }
+-_SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc)
++_SQUID_EXTERNNEW_ void *operator new[] (size_t size) noexcept(false)
+ {
+ return xmalloc(size);
+ }
+-_SQUID_EXTERNNEW_ void operator delete[] (void *address) throw()
++_SQUID_EXTERNNEW_ void operator delete[] (void *address) noexcept(true)
+ {
+ xfree(address);
+ }
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-configure-Check-for-Wno-error-format-truncation-comp.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-configure-Check-for-Wno-error-format-truncation-comp.patch
new file mode 100644
index 000000000..302136a03
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-configure-Check-for-Wno-error-format-truncation-comp.patch
@@ -0,0 +1,118 @@
+From c21adbb0b230ffba97cf5d059e2bd024e13a37df Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 11:54:57 -0700
+Subject: [PATCH] configure: Check for -Wno-error=format-truncation compiler
+ option
+
+If this option is supported by compiler then disable it ( gcc7+)
+Fixes
+client.c:834:23: error: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Werror=format-truncation=]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ acinclude/ax_check_compile_flag.m4 | 74 ++++++++++++++++++++++++++++++++++++++
+ configure.ac | 2 ++
+ 2 files changed, 76 insertions(+)
+ create mode 100644 acinclude/ax_check_compile_flag.m4
+
+diff --git a/acinclude/ax_check_compile_flag.m4 b/acinclude/ax_check_compile_flag.m4
+new file mode 100644
+index 0000000..dcabb92
+--- /dev/null
++++ b/acinclude/ax_check_compile_flag.m4
+@@ -0,0 +1,74 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
++#
++# DESCRIPTION
++#
++# Check whether the given FLAG works with the current language's compiler
++# or gives an error. (Warnings, however, are ignored)
++#
++# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
++# success/failure.
++#
++# If EXTRA-FLAGS is defined, it is added to the current language's default
++# flags (e.g. CFLAGS) when the check is done. The check is thus made with
++# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
++# force the compiler to issue an error when a bad flag is given.
++#
++# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
++#
++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
++# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
++#
++# LICENSE
++#
++# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation, either version 3 of the License, or (at your
++# option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program. If not, see <https://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 5
++
++AC_DEFUN([AX_CHECK_COMPILE_FLAG],
++[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
++ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
++ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
++ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
++ [AS_VAR_SET(CACHEVAR,[yes])],
++ [AS_VAR_SET(CACHEVAR,[no])])
++ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
++AS_VAR_IF(CACHEVAR,yes,
++ [m4_default([$2], :)],
++ [m4_default([$3], :)])
++AS_VAR_POPDEF([CACHEVAR])dnl
++])dnl AX_CHECK_COMPILE_FLAGS
+diff --git a/configure.ac b/configure.ac
+index ff4688c..9382fdf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,6 +26,7 @@ m4_include([acinclude/pkg.m4])
+ m4_include([acinclude/lib-checks.m4])
+ m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4])
+ m4_include([acinclude/ax_cxx_0x_types.m4])
++m4_include([acinclude/ax_check_compile_flag.m4])
+
+ HOSTCXX="$BUILD_CXX"
+ PRESET_CFLAGS="$CFLAGS"
+@@ -44,6 +45,7 @@ AC_PROG_CXX
+ AC_LANG([C++])
+ AC_CANONICAL_HOST
+
++AX_CHECK_COMPILE_FLAG([-Werror=format-truncation],[CFLAGS="$CFLAGS -Wno-error=format-truncation" CXXFLAGS="$CXXFLAGS -Wno-error=format-truncation"])
+ # Clang 3.2 on some CPUs requires -march-native to detect correctly.
+ # GCC 4.3+ can also produce faster executables when its used.
+ # But building inside a virtual machine environment has been found to
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch
new file mode 100644
index 000000000..8ea55d0e1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch
@@ -0,0 +1,32 @@
+From faaa796a138cbd5033b1e53f33faac0cf4162bf5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 25 Jun 2017 00:59:24 -0700
+Subject: [PATCH] tools.cc: fixed unused-result warning
+
+fix
+| ../../squid-3.5.26/src/tools.cc: In function 'void enter_suid()':
+| ../../squid-3.5.26/src/tools.cc:616:11: error: ignoring return value of 'int setuid(__uid_t)', declared with attribute warn_unused_result [-Werror=unused-result]
+| setuid(0);
+| ~~~~~~^~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ src/tools.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/tools.cc b/src/tools.cc
+index 8137a03..843e266 100644
+--- a/src/tools.cc
++++ b/src/tools.cc
+@@ -612,8 +612,8 @@ enter_suid(void)
+ if (setresuid((uid_t)-1, 0, (uid_t)-1) < 0)
+ debugs (21, 3, "enter_suid: setresuid failed: " << xstrerror ());
+ #else
+-
+- setuid(0);
++ if (setuid(0) < 0)
++ debugs(50, DBG_IMPORTANT, "WARNING: no_suid: setuid(0): " << xstrerror());
+ #endif
+ #if HAVE_PRCTL && defined(PR_SET_DUMPABLE)
+ /* Set Linux DUMPABLE flag */
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch
new file mode 100644
index 000000000..25f68aff8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch
@@ -0,0 +1,40 @@
+From b4943594654cd340b95aabdc2f3750a4705cc0de Mon Sep 17 00:00:00 2001
+From: Jim Somerville <Jim.Somerville@windriver.com>
+Date: Mon, 21 Oct 2013 12:50:44 -0400
+Subject: [PATCH] Fix flawed dynamic -ldb link test in configure
+
+The test uses dbopen, but just ignores the fact
+that this function may not exist in the db version
+used. This leads to the dynamic link test failing
+and the configure script just making assumptions
+about why and setting the need for -ldb incorrectly.
+
+Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
+
+---
+ configure.ac | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 57cd1ac..3827222 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3229,8 +3229,16 @@ AC_CHECK_DECL(dbopen,,,[
+ #include <db.h>
+ #endif])
+
+-dnl 1.85
+-SQUID_CHECK_DBOPEN_NEEDS_LIBDB
++if test "x$ac_cv_have_decl_dbopen" = "xyes"; then
++ dnl 1.85
++ SQUID_CHECK_DBOPEN_NEEDS_LIBDB
++else
++ # dbopen isn't there. So instead of running a compile/link test that
++ # uses it and is thus guaranteed to fail, we just assume that we will
++ # need to link in the db library, rather than fabricate some other
++ # dynamic compile/link test.
++ ac_cv_dbopen_libdb="yes"
++fi
+ if test "x$ac_cv_dbopen_libdb" = "xyes"; then
+ LIB_DB="-ldb"
+ fi
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch
new file mode 100644
index 000000000..3852f7c25
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch
@@ -0,0 +1,28 @@
+From 995aaf30799fa972441354b6feb45f0621968929 Mon Sep 17 00:00:00 2001
+From: Jim Somerville <Jim.Somerville@windriver.com>
+Date: Wed, 16 Oct 2013 16:41:03 -0400
+Subject: [PATCH] Set up for cross compilation
+
+Message-Id: <17e5a28667f667859c48bee25e575a072d39ee1b.1381956170.git.Jim.Somerville@windriver.com>
+
+Set the host compiler to BUILD_CXX so
+proper cross compilation can occur.
+
+Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
+
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index fe80ee0..57cd1ac 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -27,6 +27,7 @@ m4_include([acinclude/lib-checks.m4])
+ m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4])
+ m4_include([acinclude/ax_cxx_0x_types.m4])
+
++HOSTCXX="$BUILD_CXX"
+ PRESET_CFLAGS="$CFLAGS"
+ PRESET_CXXFLAGS="$CXXFLAGS"
+ PRESET_LDFLAGS="$LDFLAGS"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch
new file mode 100644
index 000000000..6a3352548
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch
@@ -0,0 +1,65 @@
+From a85311965707ba2fa78f7ce044e6f61e65e66fd0 Mon Sep 17 00:00:00 2001
+From: Jim Somerville <Jim.Somerville@windriver.com>
+Date: Tue, 14 Oct 2014 02:56:08 -0400
+Subject: [PATCH] Skip AC_RUN_IFELSE tests
+
+Upstream-Status: Inappropriate [cross compiling specific]
+
+Such tests are not supported in a cross compile
+environment. Choose sane defaults.
+
+Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+---
+ acinclude/krb5.m4 | 10 +++++++++-
+ acinclude/lib-checks.m4 | 8 ++++++--
+ 2 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4
+index 5c83d88..c264118 100644
+--- a/acinclude/krb5.m4
++++ b/acinclude/krb5.m4
+@@ -61,7 +61,15 @@ main(void)
+
+ return 0;
+ }
+-]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ])
++]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ],
++[
++ dnl Can't test in cross compiled env - so assume good
++ squid_cv_broken_heimdal_krb5_h=no
++])
++ ],
++ [
++ dnl Can't test in cross compiled env - so assume good
++ squid_cv_broken_heimdal_krb5_h=no
+ ])
+ ])
+ ]) dnl SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H
+diff --git a/acinclude/lib-checks.m4 b/acinclude/lib-checks.m4
+index c4874da..ba72982 100644
+--- a/acinclude/lib-checks.m4
++++ b/acinclude/lib-checks.m4
+@@ -177,7 +177,9 @@ AC_DEFUN([SQUID_CHECK_OPENSSL_CONST_SSL_METHOD],[
+ [
+ AC_MSG_RESULT([no])
+ ],
+- [])
++ [
++ AC_MSG_RESULT([skipped - can't test in cross-compiled env])
++ ])
+
+ SQUID_STATE_ROLLBACK(check_const_SSL_METHOD)
+ ]
+@@ -265,7 +267,9 @@ AC_DEFUN([SQUID_CHECK_OPENSSL_TXTDB],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(SQUID_USE_SSLLHASH_HACK, 1)
+ ],
+-[])
++[
++ AC_MSG_RESULT([skipped - can't test in cross-compiled env])
++])
+
+ SQUID_STATE_ROLLBACK(check_TXTDB)
+ ])
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/gcc7-fixes.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/gcc7-fixes.patch
new file mode 100644
index 000000000..2feca4986
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/gcc7-fixes.patch
@@ -0,0 +1,26 @@
+From 660fce9cfa00a57e5b7cec46116a31e21595c306 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 19 Jun 2017 23:47:01 -0700
+Subject: [PATCH] squid: Upgrade to 3.5.26
+
+../../squid-3.5.26/src/DiskIO/DiskThreads/aiops.cc: In function 'void squidaio_init()': ../../squid-3.5.26/src/DiskIO/DiskThreads/DiskThreads.h:30:50: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] #define NUMTHREADS (Config.cacheSwap.n_configured*16)
+
+Upstream-Status: Backport
+
+---
+ src/DiskIO/DiskThreads/aiops.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/DiskIO/DiskThreads/aiops.cc b/src/DiskIO/DiskThreads/aiops.cc
+index b44adfa..e11f948 100644
+--- a/src/DiskIO/DiskThreads/aiops.cc
++++ b/src/DiskIO/DiskThreads/aiops.cc
+@@ -290,7 +290,7 @@ squidaio_init(void)
+ /* Create threads and get them to sit in their wait loop */
+ squidaio_thread_pool = memPoolCreate("aio_thread", sizeof(squidaio_thread_t));
+
+- assert(NUMTHREADS);
++ assert(NUMTHREADS != 0);
+
+ for (i = 0; i < NUMTHREADS; ++i) {
+ threadp = (squidaio_thread_t *)squidaio_thread_pool->alloc();
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/run-ptest b/meta-openembedded/meta-networking/recipes-daemons/squid/files/run-ptest
new file mode 100644
index 000000000..de79a293c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+#
+make -C test-suite -k runtest-TESTS
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/set_sysroot_patch.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/set_sysroot_patch.patch
new file mode 100644
index 000000000..e990480a6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/set_sysroot_patch.patch
@@ -0,0 +1,41 @@
+From 702bd881b66dc034e711c0ff47805f2da40b6e0d Mon Sep 17 00:00:00 2001
+From: Yue Tao <yue.tao@windriver.com>
+Date: Mon, 8 Aug 2016 16:04:33 +0800
+Subject: [PATCH] Set the SYSROOT for libxml2 header file to avoid host
+ contamination.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+---
+ configure.ac | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 504a844..ff4688c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -974,15 +974,15 @@ if test "x$squid_opt_use_esi" = "xyes" -a "x$with_libxml2" != "xno" ; then
+ dnl Find the main header and include path...
+ AC_CACHE_CHECK([location of libxml2 include files], [ac_cv_libxml2_include], [
+ AC_CHECK_HEADERS([libxml/parser.h], [], [
+- AC_MSG_NOTICE([Testing in /usr/include/libxml2])
++ AC_MSG_NOTICE([Testing in $SYSROOT/usr/include/libxml2])
+ SAVED_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
++ CPPFLAGS="-I$SYSROOT/usr/include/libxml2 $CPPFLAGS"
+ unset ac_cv_header_libxml_parser_h
+- AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/include/libxml2"], [
+- AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
+- CPPFLAGS="-I/usr/local/include/libxml2 $SAVED_CPPFLAGS"
++ AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I$SYSROOT/usr/include/libxml2"], [
++ AC_MSG_NOTICE([Testing in $SYSROOT/usr/local/include/libxml2])
++ CPPFLAGS="-I$SYSROOT/usr/local/include/libxml2 $SAVED_CPPFLAGS"
+ unset ac_cv_header_libxml_parser_h
+- AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/local/include/libxml2"], [
++ AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I$SYSROOT/usr/local/include/libxml2"], [
+ AC_MSG_NOTICE([Failed to find libxml2 header file libxml/parser.h])
+ ])
+ ])
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-don-t-do-squid-conf-tests-at-build-time.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-don-t-do-squid-conf-tests-at-build-time.patch
new file mode 100644
index 000000000..e5267ea2b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-don-t-do-squid-conf-tests-at-build-time.patch
@@ -0,0 +1,61 @@
+From 8786b91488dae3f6dfeadd686e80d2ffc5c29320 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 25 Aug 2016 15:22:57 +0800
+Subject: [PATCH] squid: don't do squid-conf-tests at build time
+
+* squid-conf-tests is a test to run "squid -k parse -f"
+ to perse the config files, which should not be run
+ at build time since we are cross compiling, so remove
+ it but it will be added back for the runtime ptest.
+
+* Fix the directories of the conf files for squid-conf-tests
+ so that it can run on the target board.
+
+Upstream-Status: Inappropriate [cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+---
+ test-suite/Makefile.am | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
+index 061a463..350dfb2 100644
+--- a/test-suite/Makefile.am
++++ b/test-suite/Makefile.am
+@@ -41,8 +41,7 @@ TESTS += debug \
+ MemPoolTest\
+ mem_node_test\
+ mem_hdr_test\
+- $(ESI_TESTS) \
+- squid-conf-tests
++ $(ESI_TESTS)
+
+ ## Sort by alpha - any build failures are significant.
+ check_PROGRAMS += debug \
+@@ -125,19 +124,19 @@ VirtualDeleteOperator_SOURCES = VirtualDeleteOperator.cc $(DEBUG_SOURCE)
+ ##$(TARGLIB): $(LIBOBJS)
+ ## $(AR_R) $(TARGLIB) $(LIBOBJS)
+
+-squid-conf-tests: $(top_builddir)/src/squid.conf.default $(srcdir)/squidconf/*
++squid-conf-tests: $(sysconfdir)/squid.conf.default squidconf/*
+ @failed=0; cfglist="$?"; rm -f $@ || $(TRUE); \
+ for cfg in $$cfglist ; do \
+- $(top_builddir)/src/squid -k parse -f $$cfg || \
++ squid -k parse -f $$cfg || \
+ { echo "FAIL: squid.conf test: $$cfg" | \
+- sed s%$(top_builddir)/src/%% | \
+- sed s%$(srcdir)/squidconf/%% ; \
++ sed s%$(sysconfdir)/%% | \
++ sed s%squidconf/%% ; \
+ failed=1; break; \
+ }; \
+ if test "$$failed" -eq 0; then \
+ echo "PASS: squid.conf test: $$cfg" | \
+- sed s%$(top_builddir)/src/%% | \
+- sed s%$(srcdir)/squidconf/%% ; \
++ sed s%$(sysconfdir)/%% | \
++ sed s%squidconf/%% ; \
+ else break; fi; \
+ done; \
+ if test "$$failed" -eq 0; then cp $(TRUE) $@ ; fi
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch
new file mode 100644
index 000000000..9c75f17e7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch
@@ -0,0 +1,29 @@
+From 9bcec221a2bb438d8a9ed59aed846ffe3be9cffa Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 19 Jul 2016 01:56:23 -0400
+Subject: [PATCH] squid: use serial-tests config needed by ptest
+
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Upstream-Status: Inappropriate [default automake behavior incompatible with ptest]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3827222..504a844 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -10,7 +10,7 @@ AC_PREREQ(2.61)
+ AC_CONFIG_HEADERS([include/autoconf.h])
+ AC_CONFIG_AUX_DIR(cfgaux)
+ AC_CONFIG_SRCDIR([src/main.cc])
+-AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects])
++AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects serial-tests])
+ AC_REVISION($Revision$)dnl
+ AC_PREFIX_DEFAULT(/usr/local/squid)
+ AM_MAINTAINER_MODE
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/volatiles.03_squid b/meta-openembedded/meta-networking/recipes-daemons/squid/files/volatiles.03_squid
new file mode 100644
index 000000000..83e1f8b7a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/volatiles.03_squid
@@ -0,0 +1,3 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d squid squid 0755 /var/run/squid none
+d squid squid 0750 /var/log/squid none
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.26.bb b/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.26.bb
new file mode 100644
index 000000000..3ee96abb7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.26.bb
@@ -0,0 +1,114 @@
+SUMMARY = "A fully-featured http proxy and web-cache daemon for Linux"
+DESCRIPTION = "A fully-featured http proxy and web-cache daemon for Linux. \
+Squid offers a rich access control, authorization and logging environment to \
+develop web proxy and content serving applications. \
+Squid offers a rich set of traffic optimization options, most of which are \
+enabled by default for simpler installation and high performance. \
+"
+HOMEPAGE = "http://www.squid-cache.org"
+SECTION = "web"
+LICENSE = "GPLv2+"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}"
+MIN_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "http://www.squid-cache.org/Versions/v${MAJ_VER}/${MIN_VER}/${BPN}-${PV}.tar.bz2 \
+ file://Set-up-for-cross-compilation.patch \
+ file://Skip-AC_RUN_IFELSE-tests.patch \
+ file://Fix-flawed-dynamic-ldb-link-test-in-configure.patch \
+ file://squid-use-serial-tests-config-needed-by-ptest.patch \
+ file://run-ptest \
+ file://volatiles.03_squid \
+ file://set_sysroot_patch.patch \
+ file://squid-don-t-do-squid-conf-tests-at-build-time.patch \
+ file://0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch \
+ file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \
+ file://gcc7-fixes.patch \
+ file://0001-tools.cc-fixed-unused-result-warning.patch \
+ "
+
+SRC_URI_remove_toolchain-clang = "file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch"
+
+SRC_URI[md5sum] = "dc1830cd361e077814aa39bcc3691d8b"
+SRC_URI[sha256sum] = "41d8845863dcd026c856508cd1599d417c8947ffd96e86e24085f9893cb8b8c2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c492e2d6d32ec5c1aad0e0609a141ce9 \
+ file://errors/COPYRIGHT;md5=8861130fae91400bcf99b66f133172b3 \
+ "
+DEPENDS = "libtool krb5 openldap db cyrus-sasl openssl expat libxml2"
+
+inherit autotools pkgconfig useradd ptest perlnative
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /var/run/squid --shell /bin/false --user-group squid"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('TARGET_ARCH', 'powerpc', 'noatomics', '', d)} \
+ ${@bb.utils.contains('TARGET_ARCH', 'mips', 'noatomics', '', d)} \
+ ${@bb.utils.contains('TARGET_ARCH', 'mipsel', 'noatomics', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+ "
+PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack"
+PACKAGECONFIG[noatomics] = "squid_cv_gnu_atomics=no,squid_cv_gnu_atomics=yes,,"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+BASIC_AUTH = "DB SASL LDAP"
+
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+BASIC_AUTH += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'PAM', '', d)}"
+
+EXTRA_OECONF += "--with-default-user=squid --enable-auth-basic='${BASIC_AUTH}' \
+ --sysconfdir=${sysconfdir}/${BPN} \
+ --with-logdir=${localstatedir}/log/${BPN} \
+ 'PERL=${USRBINPATH}/env perl'"
+
+export BUILDCXXFLAGS="${BUILD_CXXFLAGS}"
+
+TESTDIR = "test-suite"
+
+do_configure_prepend() {
+ export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
+}
+
+do_compile_ptest() {
+ oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+ cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
+ cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
+
+ # do NOT need to rebuild Makefile itself
+ sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+
+ # Add squid-conf-tests for runtime tests
+ sed -e 's/^\(runtest-TESTS:\)/\1 squid-conf-tests/' \
+ -e "s/\(list=' \$(TESTS)\)/\1 squid-conf-tests/" \
+ -i ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+
+ # Ensure the path for command true is correct
+ sed -i 's:^TRUE = .*$:TRUE = /bin/true:' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+}
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d ${localstatedir}/run/${BPN} 0755 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+ echo "d ${localstatedir}/log/${BPN} 0750 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+ fi
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/03_squid
+
+ rmdir "${D}${localstatedir}/run/${BPN}"
+ rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run"
+
+ rmdir "${D}${localstatedir}/log/${BPN}"
+ rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log"
+}
+
+FILES_${PN} += "${libdir} ${datadir}/errors ${datadir}/icons"
+FILES_${PN}-dbg += "/usr/src/debug"
+FILES_${PN}-doc += "${datadir}/*.txt"
+
+RDEPENDS_${PN} += "perl"
+RDEPENDS_${PN}-ptest += "make"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch
new file mode 100644
index 000000000..cead977e2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch
@@ -0,0 +1,62 @@
+From 941038fc05be21202cab7a7a9434097fb55ecbe0 Mon Sep 17 00:00:00 2001
+From: Thorsten Glaser <tg@mirbsd.de>
+Date: Thu, 31 Jul 2014 16:29:41 +0930
+Subject: [PATCH] __progname[] is provided by libc
+
+Rename local variable to tftpd_progname to avoid a clash with glibc
+global symbols and work around Debian bug #519006 (Closes: #564052).
+
+[ hpa: specifically, double-underscore symbols in C are reserved for
+ the implementation, i.e. compiler/libc. ]
+
+Signed-off-by: Ron Lee <ron@debian.org>
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+---
+ tftpd/tftpd.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
+index e247b97..5fec7bf 100644
+--- a/tftpd/tftpd.c
++++ b/tftpd/tftpd.c
+@@ -76,7 +76,7 @@ static int ai_fam = AF_INET;
+ #define TRIES 6 /* Number of attempts to send each packet */
+ #define TIMEOUT_LIMIT ((1 << TRIES)-1)
+
+-const char *__progname;
++const char *tftpd_progname;
+ static int peer;
+ static unsigned long timeout = TIMEOUT; /* Current timeout value */
+ static unsigned long rexmtval = TIMEOUT; /* Basic timeout value */
+@@ -395,9 +395,9 @@ int main(int argc, char **argv)
+ /* basename() is way too much of a pain from a portability standpoint */
+
+ p = strrchr(argv[0], '/');
+- __progname = (p && p[1]) ? p + 1 : argv[0];
++ tftpd_progname = (p && p[1]) ? p + 1 : argv[0];
+
+- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
++ openlog(tftpd_progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
+
+ srand(time(NULL) ^ getpid());
+
+@@ -946,14 +946,14 @@ int main(int argc, char **argv)
+ syslog daemon gets restarted by the time we get here. */
+ if (secure && standalone) {
+ closelog();
+- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
++ openlog(tftpd_progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
+ }
+
+ #ifdef HAVE_TCPWRAPPERS
+ /* Verify if this was a legal request for us. This has to be
+ done before the chroot, while /etc is still accessible. */
+ request_init(&wrap_request,
+- RQ_DAEMON, __progname,
++ RQ_DAEMON, tftpd_progname,
+ RQ_FILE, fd,
+ RQ_CLIENT_SIN, &from, RQ_SERVER_SIN, &myaddr, 0);
+ sock_methods(&wrap_request);
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch
new file mode 100644
index 000000000..d01c20d38
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch
@@ -0,0 +1,81 @@
+From bd5773947af5ca80ca546ad5625818fc912bdd60 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Thu, 22 Aug 2013 08:56:09 +0800
+Subject: [PATCH] tftp-hpa: add error check for disk filled up
+
+Upstream-status: Pending [Sent to http://www.syslinux.org/archives/2013-August/020765.html]
+
+Add error check when the write-buffer is finally flushed to the file,
+the caller can detect if the disk filled up (or had an i/o error) and
+return a NOSAPCE nak to the other side.
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ common/tftpsubs.c | 8 +++++---
+ tftpd/tftpd.c | 12 ++++++++++--
+ 2 files changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/common/tftpsubs.c b/common/tftpsubs.c
+index 8c999f6..b4d4ffe 100644
+--- a/common/tftpsubs.c
++++ b/common/tftpsubs.c
+@@ -206,20 +206,22 @@ int write_behind(FILE * file, int convert)
+
+ p = buf;
+ ct = count;
++ count = 0;
+ while (ct--) { /* loop over the buffer */
+ c = *p++; /* pick up a character */
+ if (prevchar == '\r') { /* if prev char was cr */
+ if (c == '\n') /* if have cr,lf then just */
+- fseek(file, -1, 1); /* smash lf on top of the cr */
++ count = count - 1;
+ else if (c == '\0') /* if have cr,nul then */
+ goto skipit; /* just skip over the putc */
+ /* else just fall through and allow it */
+ }
+- putc(c, file);
++ buf[count] = c;
++ count ++;
+ skipit:
+ prevchar = c;
+ }
+- return count;
++ return write(fileno(file), buf, count);
+ }
+
+ /* When an error has occurred, it is possible that the two sides
+diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
+index 1873e70..c2adbda 100644
+--- a/tftpd/tftpd.c
++++ b/tftpd/tftpd.c
+@@ -1681,7 +1681,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac
+ syslog(LOG_WARNING, "tftpd: write(ack): %m");
+ goto abort;
+ }
+- write_behind(file, pf->f_convert);
++ if(write_behind(file, pf->f_convert) < 0) {
++ nak(ENOSPACE, NULL);
++ (void)fclose(file);
++ goto abort;
++ }
+ for (;;) {
+ n = recv_time(peer, dp, PKTSIZE, 0, &r_timeout);
+ if (n < 0) { /* really? */
+@@ -1712,7 +1716,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac
+ goto abort;
+ }
+ } while (size == segsize);
+- write_behind(file, pf->f_convert);
++ if(write_behind(file, pf->f_convert) < 0) {
++ nak(ENOSPACE, NULL);
++ (void)fclose(file);
++ goto abort;
++ }
+ (void)fclose(file); /* close data file */
+
+ ap->th_opcode = htons((u_short) ACK); /* send the "final" ack */
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/default b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/default
new file mode 100644
index 000000000..1dce7fdfe
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/default
@@ -0,0 +1,3 @@
+#Defaults for tftpd-hpa
+RUN_DAEMON="yes"
+OPTIONS="-l -s /var/lib/tftpboot"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch
new file mode 100644
index 000000000..452aa05f8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch
@@ -0,0 +1,39 @@
+[PATCH] fix the empty file writting
+
+Upstream-Status: pending
+
+With the feature that checking the disk filled up, the return
+value of function write_behind was checked and used to detect
+the disk status. While for empty file, without data being
+written, this function will return -1 thus the disk filled up
+error was miss-raised.
+
+make write_behind to return 0 if written file is empty, to fix
+the this bug.
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ common/tftpsubs.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/common/tftpsubs.c b/common/tftpsubs.c
+index b4ea3f2..9f6cafc 100644
+--- a/common/tftpsubs.c
++++ b/common/tftpsubs.c
+@@ -198,9 +198,12 @@ int write_behind(FILE * file, int convert)
+ nextone = !nextone; /* incr for next time */
+ buf = dp->th_data;
+
+- if (count <= 0)
++ if (count < 0)
+ return -1; /* nak logic? */
+
++ if (count == 0)
++ return 0;
++
+ if (convert == 0)
+ return write(fileno(file), buf, count);
+
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/init b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/init
new file mode 100644
index 000000000..9e1843635
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/init
@@ -0,0 +1,105 @@
+#! /bin/sh
+#
+# Author: Jaakko Niemi <liiwi@iki.fi>
+# Modified from skeleton file in sarge
+
+### BEGIN INIT INFO
+# Provides: tftp-hpa
+# Required-Start: $local_fs $remote_fs $syslog $network
+# Required-Stop: $local_fs $remote_fs $syslog $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: HPA's tftp client
+# Description: tftp server to allow booting clients which support
+# the PXE protocol.
+### END INIT INFO
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DESC="HPA's tftpd"
+NAME=in.tftpd-hpa
+SCRIPTNAME=/etc/init.d/tftpd-hpa
+
+# Read config file if it is present.
+if [ -r /etc/default/tftpd-hpa ]
+then
+ . /etc/default/tftpd-hpa
+fi
+
+DAEMON=/usr/sbin/$NAME
+PIDFILE=/var/run/$NAME.pid
+
+# Gracefully exit if the package has been removed.
+test -x $DAEMON || exit 0
+
+if [ "$RUN_DAEMON" != "yes" ] ; then
+ echo "tftpd-hpa disabled in /etc/default/tftpd-hpa"
+ exit 0
+fi
+
+#
+# Function that starts the daemon/service.
+#
+d_start() {
+ start-stop-daemon --start --quiet --exec $DAEMON -- $OPTIONS
+}
+
+#
+# Function that stops the daemon/service.
+#
+d_stop() {
+ start-stop-daemon --stop --quiet --name $NAME
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service.
+#
+d_reload() {
+ start-stop-daemon --stop --quiet --name $NAME --signal 1
+}
+
+case "$1" in
+ start)
+ echo "Starting $DESC: $NAME"
+ d_start
+ echo "."
+ ;;
+ stop)
+ echo "Stopping $DESC: $NAME"
+ d_stop
+ echo "."
+ ;;
+ #reload)
+ #
+ # If the daemon can reload its configuration without
+ # restarting (for example, when it is sent a SIGHUP),
+ # then implement that here.
+ #
+ # If the daemon responds to changes in its config file
+ # directly anyway, make this an "exit 0".
+ #
+ # echo -n "Reloading $DESC configuration..."
+ # d_reload
+ # echo "done."
+ #;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented, move the "force-reload"
+ # option to the "reload" entry above. If not, "force-reload" is
+ # just the same as "restart".
+ #
+ echo "Restarting $DESC: $NAME"
+ d_stop
+ sleep 1
+ d_start
+ echo "."
+ ;;
+ *)
+ # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch
new file mode 100644
index 000000000..3f690609a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch
@@ -0,0 +1,25 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/tftpd/remap.c.zero tftp-hpa-0.49/tftpd/remap.c
+--- tftp-hpa-0.49/tftpd/remap.c.zero 2008-10-20 18:08:31.000000000 -0400
++++ tftp-hpa-0.49/tftpd/remap.c 2008-11-25 11:41:09.000000000 -0500
+@@ -286,6 +286,7 @@ struct rule *parserulefile(FILE * f)
+ int lineno = 0;
+ int err = 0;
+
++ memset(this_rule, '\0', sizeof(struct rule));
+ while (lineno++, fgets(line, MAXLINE, f)) {
+ rv = parseline(line, this_rule, lineno);
+ if (rv < 0)
+@@ -294,6 +295,7 @@ struct rule *parserulefile(FILE * f)
+ *last_rule = this_rule;
+ last_rule = &this_rule->next;
+ this_rule = tfmalloc(sizeof(struct rule));
++ memset(this_rule, '\0', sizeof(struct rule));
+ }
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch
new file mode 100644
index 000000000..98a86b78b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch
@@ -0,0 +1,60 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.48/tftp-xinetd.tftpboot tftp-hpa-0.48/tftp-xinetd
+--- tftp-hpa-0.48/tftp-xinetd.tftpboot 2007-01-31 00:51:05.000000000 +0100
++++ tftp-hpa-0.48/tftp-xinetd 2008-05-20 12:05:53.000000000 +0200
+@@ -10,7 +10,7 @@ service tftp
+ wait = yes
+ user = root
+ server = /usr/sbin/in.tftpd
+- server_args = -s /tftpboot
++ server_args = -s /var/lib/tftpboot
+ disable = yes
+ per_source = 11
+ cps = 100 2
+diff -up tftp-hpa-0.48/README.security.tftpboot tftp-hpa-0.48/README.security
+--- tftp-hpa-0.48/README.security.tftpboot 2008-05-29 17:36:32.000000000 +0200
++++ tftp-hpa-0.48/README.security 2008-05-29 17:37:21.000000000 +0200
+@@ -17,10 +17,10 @@ probably the following:
+
+ 1. Create a separate "tftpd" user and group only used for tftpd;
+ 2. Have all your boot files in a single directory tree (usually called
+- /tftpboot).
+-3. Specify "-p -u tftpd -s /tftpboot" on the tftpd command line; if
++ /var/lib/tftpboot).
++3. Specify "-p -u tftpd -s /var/lib/tftpboot" on the tftpd command line; if
+ you want clients to be able to create files use
+- "-p -c -U 002 -u tftpd -s /tftpboot" (replace 002 with whatever
++ "-p -c -U 002 -u tftpd -s /var/lib/tftpboot" (replace 002 with whatever
+ umask is appropriate for your setup.)
+
+ =======================================
+@@ -40,12 +40,12 @@ directly. Thus, if your /etc/inetd.conf
+ line):
+
+ tftp dgram udp wait root /usr/sbin/tcpd
+-/usr/sbin/in.tftpd -s /tftpboot -r blksize
++/usr/sbin/in.tftpd -s /var/lib/tftpboot -r blksize
+
+ ... it's better to change to ...
+
+ tftp dgram udp wait root /usr/sbin/in.tftpd
+-in.tftpd -s /tftpboot -r blksize
++in.tftpd -s /var/lib/tftpboot -r blksize
+
+ You should make sure that you are using "wait" option in tftpd; you
+ also need to have tftpd spawned as root in order for chroot (-s) to
+diff -up tftp-hpa-0.48/tftpd/sample.rules.tftpboot tftp-hpa-0.48/tftpd/sample.rules
+--- tftp-hpa-0.48/tftpd/sample.rules.tftpboot 2008-05-29 17:38:46.000000000 +0200
++++ tftp-hpa-0.48/tftpd/sample.rules 2008-05-29 17:38:05.000000000 +0200
+@@ -30,5 +30,5 @@ rg \\ / # Convert backslashes to slash
+ rg \# @ # Convert hash marks to @ signs
+ rg /../ /..no../ # Convert /../ to /..no../
+ e ^ok/ # These are always ok
+-r ^[^/] /tftpboot/\0 # Convert non-absolute files
++r ^[^/] /var/lib/tftpboot/\0 # Convert non-absolute files
+ a \.pvt$ # Reject requests for private files
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch
new file mode 100644
index 000000000..7ae1a8722
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch
@@ -0,0 +1,21 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes tftp-hpa-0.49/tftpd/tftpd.c
+--- tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes 2009-01-15 15:28:50.000000000 +0100
++++ tftp-hpa-0.49/tftpd/tftpd.c 2009-01-15 15:31:36.000000000 +0100
+@@ -932,7 +932,10 @@ int main(int argc, char **argv)
+ exit(EX_OSERR);
+ }
+ #ifdef __CYGWIN__
+- chdir("/"); /* Cygwin chroot() bug workaround */
++ if (chdir("/") < 0) { /* Cygwin chroot() bug workaround */
++ syslog(LOG_ERR, "chroot: %m");
++ exit(EX_OSERR);
++ }
+ #endif
+ }
+ #ifdef HAVE_SETREGID
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch
new file mode 100644
index 000000000..6b8ceaaeb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch
@@ -0,0 +1,165 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/config.h.cmd_arg tftp-hpa-0.49/config.h
+--- tftp-hpa-0.49/config.h.cmd_arg 2010-04-19 15:29:10.567331454 +0200
++++ tftp-hpa-0.49/config.h 2010-04-20 07:33:03.133232772 +0200
+@@ -291,6 +291,7 @@ typedef int socklen_t;
+ /* Prototypes for libxtra functions */
+
+ void *xmalloc(size_t);
++void *xrealloc(void *, size_t);
+ char *xstrdup(const char *);
+
+ #ifndef HAVE_BSD_SIGNAL
+diff -up tftp-hpa-0.49/configure.in.cmd_arg tftp-hpa-0.49/configure.in
+--- tftp-hpa-0.49/configure.in.cmd_arg 2008-10-21 00:08:31.000000000 +0200
++++ tftp-hpa-0.49/configure.in 2010-04-19 11:05:12.387340698 +0200
+@@ -152,6 +152,7 @@ OBJROOT=`pwd`
+
+ XTRA=false
+ PA_SEARCH_LIBS_AND_ADD(xmalloc, iberty)
++PA_SEARCH_LIBS_AND_ADD(xrealloc, iberty)
+ PA_SEARCH_LIBS_AND_ADD(xstrdup, iberty)
+ PA_SEARCH_LIBS_AND_ADD(bsd_signal, bsd, bsdsignal)
+ PA_SEARCH_LIBS_AND_ADD(getopt_long, getopt, getopt_long)
+diff -up tftp-hpa-0.49/lib/xrealloc.c.cmd_arg tftp-hpa-0.49/lib/xrealloc.c
+--- tftp-hpa-0.49/lib/xrealloc.c.cmd_arg 2010-04-19 11:05:12.387340698 +0200
++++ tftp-hpa-0.49/lib/xrealloc.c 2010-04-19 11:05:12.387340698 +0200
+@@ -0,0 +1,20 @@
++/*
++ * xrealloc.c
++ *
++ * Simple error-checking version of realloc()
++ *
++ */
++
++#include "config.h"
++
++void *xrealloc(void *ptr, size_t size)
++{
++ void *p = realloc(ptr, size);
++
++ if (!p) {
++ fprintf(stderr, "Out of memory!\n");
++ exit(128);
++ }
++
++ return p;
++}
+diff -up tftp-hpa-0.49/tftp/main.c.cmd_arg tftp-hpa-0.49/tftp/main.c
+--- tftp-hpa-0.49/tftp/main.c.cmd_arg 2008-10-21 00:08:31.000000000 +0200
++++ tftp-hpa-0.49/tftp/main.c 2010-04-19 11:05:12.389329337 +0200
+@@ -89,11 +89,14 @@ int connected;
+ const struct modes *mode;
+ #ifdef WITH_READLINE
+ char *line = NULL;
++char *remote_pth = NULL;
+ #else
+ char line[LBUFLEN];
++char remote_pth[LBUFLEN];
+ #endif
+ int margc;
+-char *margv[20];
++char **margv;
++int sizeof_margv=0;
+ const char *prompt = "tftp> ";
+ sigjmp_buf toplevel;
+ void intr(int);
+@@ -379,6 +382,10 @@ static void getmoreargs(const char *part
+ free(line);
+ line = NULL;
+ }
++ if (remote_pth) {
++ free(remote_pth);
++ remote_pth = NULL;
++ }
+ line = xmalloc(len + elen + 1);
+ strcpy(line, partial);
+ strcpy(line + len, eline);
+@@ -535,6 +542,7 @@ void put(int argc, char *argv[])
+ int fd;
+ int n, err;
+ char *cp, *targ;
++ long dirlen, namelen, lastlen=0;
+
+ if (argc < 2) {
+ getmoreargs("send ", "(file) ");
+@@ -588,9 +596,22 @@ void put(int argc, char *argv[])
+ }
+ /* this assumes the target is a directory */
+ /* on a remote unix system. hmmmm. */
+- cp = strchr(targ, '\0');
+- *cp++ = '/';
++ dirlen = strlen(targ)+1;
++#ifdef WITH_READLINE
++ remote_pth = xmalloc(dirlen+1);
++#endif
++ strcpy(remote_pth, targ);
++ remote_pth[dirlen-1] = '/';
++ cp = remote_pth + dirlen;
+ for (n = 1; n < argc - 1; n++) {
++#ifdef WITH_READLINE
++ namelen = strlen(tail(argv[n])) + 1;
++ if (namelen > lastlen) {
++ remote_pth = xrealloc(remote_pth, dirlen + namelen + 1);
++ cp = remote_pth + dirlen;
++ lastlen = namelen;
++ }
++#endif
+ strcpy(cp, tail(argv[n]));
+ fd = open(argv[n], O_RDONLY | mode->m_openflags);
+ if (fd < 0) {
+@@ -600,9 +621,9 @@ void put(int argc, char *argv[])
+ }
+ if (verbose)
+ printf("putting %s to %s:%s [%s]\n",
+- argv[n], hostname, targ, mode->m_mode);
++ argv[n], hostname, remote_pth, mode->m_mode);
+ sa_set_port(&peeraddr, port);
+- tftp_sendfile(fd, targ, mode->m_mode);
++ tftp_sendfile(fd, remote_pth, mode->m_mode);
+ }
+ }
+
+@@ -801,6 +822,10 @@ static void command(void)
+ free(line);
+ line = NULL;
+ }
++ if (remote_pth) {
++ free(remote_pth);
++ remote_pth = NULL;
++ }
+ line = readline(prompt);
+ if (!line)
+ exit(0); /* EOF */
+@@ -872,7 +897,13 @@ struct cmd *getcmd(char *name)
+ static void makeargv(void)
+ {
+ char *cp;
+- char **argp = margv;
++ char **argp;
++
++ if (!sizeof_margv) {
++ sizeof_margv = 20;
++ margv = xmalloc(sizeof_margv * sizeof(char *));
++ }
++ argp = margv;
+
+ margc = 0;
+ for (cp = line; *cp;) {
+@@ -882,6 +913,11 @@ static void makeargv(void)
+ break;
+ *argp++ = cp;
+ margc += 1;
++ if (margc == sizeof_margv) {
++ sizeof_margv += 20;
++ margv = xrealloc(margv, sizeof_margv * sizeof(char *));
++ argp = margv + margc;
++ }
+ while (*cp != '\0' && !isspace(*cp))
+ cp++;
+ if (*cp == '\0')
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch
new file mode 100644
index 000000000..85110eb28
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch
@@ -0,0 +1,24 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/tftpd/tftpd.c.tzfix tftp-hpa-0.49/tftpd/tftpd.c
+--- tftp-hpa-0.49/tftpd/tftpd.c.tzfix 2008-10-20 18:08:31.000000000 -0400
++++ tftp-hpa-0.49/tftpd/tftpd.c 2008-11-25 11:45:27.000000000 -0500
+@@ -350,6 +350,14 @@ int main(int argc, char **argv)
+ const char *pidfile = NULL;
+ u_short tp_opcode;
+
++ time_t my_time = 0;
++ struct tm* p_tm;
++ char envtz[10];
++ my_time = time(NULL);
++ p_tm = localtime(&my_time);
++ snprintf(envtz, sizeof(envtz) - 1, "UTC%+d", (p_tm->tm_gmtoff * -1)/3600);
++ setenv("TZ", envtz, 0);
++
+ /* basename() is way too much of a pain from a portability standpoint */
+
+ p = strrchr(argv[0], '/');
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch
new file mode 100644
index 000000000..08d2b5b7d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch
@@ -0,0 +1,32 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -urN tftp-hpa-0.49.orig/tftp/tftp.c tftp-hpa-0.49/tftp/tftp.c
+--- tftp-hpa-0.49.orig/tftp/tftp.c 2008-10-20 18:08:31.000000000 -0400
++++ tftp-hpa-0.49/tftp/tftp.c 2009-08-05 09:47:18.072585848 -0400
+@@ -279,15 +279,16 @@
+ struct tftphdr *tp, const char *mode)
+ {
+ char *cp;
++ size_t len;
+
+ tp->th_opcode = htons((u_short) request);
+ cp = (char *)&(tp->th_stuff);
+- strcpy(cp, name);
+- cp += strlen(name);
+- *cp++ = '\0';
+- strcpy(cp, mode);
+- cp += strlen(mode);
+- *cp++ = '\0';
++ len = strlen(name) + 1;
++ memcpy(cp, name, len);
++ cp += len;
++ len = strlen(mode) + 1;
++ memcpy(cp, mode, len);
++ cp += len;
+ return (cp - (char *)tp);
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch
new file mode 100644
index 000000000..720cd69de
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch
@@ -0,0 +1,20 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/tftp/tftp.c.stats tftp-hpa-0.49/tftp/tftp.c
+--- tftp-hpa-0.49/tftp/tftp.c.stats 2011-01-03 15:38:34.217918067 +0100
++++ tftp-hpa-0.49/tftp/tftp.c 2011-01-03 15:38:37.498917014 +0100
+@@ -400,8 +400,8 @@ static void printstats(const char *direc
+ {
+ double delta;
+
+- delta = (tstop.tv_sec + (tstop.tv_usec / 100000.0)) -
+- (tstart.tv_sec + (tstart.tv_usec / 100000.0));
++ delta = (tstop.tv_sec + (tstop.tv_usec / 1000000.0)) -
++ (tstart.tv_sec + (tstart.tv_usec / 1000000.0));
+ if (verbose) {
+ printf("%s %lu bytes in %.1f seconds", direction, amount, delta);
+ printf(" [%.0f bit/s]", (amount * 8.) / delta);
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch
new file mode 100644
index 000000000..216349d26
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch
@@ -0,0 +1,29 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-5.2/tftpd/recvfrom.c.test tftp-hpa-5.2/tftpd/recvfrom.c
+--- tftp-hpa-5.2/tftpd/recvfrom.c.test 2011-12-11 23:13:52.000000000 +0100
++++ tftp-hpa-5.2/tftpd/recvfrom.c 2012-01-04 10:05:17.852042256 +0100
+@@ -149,16 +149,16 @@ myrecvfrom(int s, void *buf, int len, un
+
+ /* Try to enable getting the return address */
+ #ifdef IP_RECVDSTADDR
+- if (from->sa_family == AF_INET)
++ if (from->sa_family == AF_INET || !from->sa_family)
+ setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on));
+ #endif
+ #ifdef IP_PKTINFO
+- if (from->sa_family == AF_INET)
++ if (from->sa_family == AF_INET || !from->sa_family)
+ setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
+ #endif
+ #ifdef HAVE_IPV6
+ #ifdef IPV6_RECVPKTINFO
+- if (from->sa_family == AF_INET6)
++ if (from->sa_family == AF_INET6 || !from->sa_family)
+ setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on));
+ #endif
+ #endif
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch
new file mode 100644
index 000000000..3e220ec38
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch
@@ -0,0 +1,38 @@
+From 6ed1eb8829dee351b54e183bc42c007cb306aaa5 Mon Sep 17 00:00:00 2001
+From: Zhang Xiao <xiao.zhang@windriver.com>
+Date: Wed, 11 Jun 2014 14:01:16 +0800
+Subject: [PATCH] tftp-hpa: bug fix on separated CR and LF
+
+In ascii mode, if the CR and LF was separated into different transfer
+blocks, LF will be just dropped instead of replacing the previous CR.
+Add a checking on the first character to fix it.
+
+Upstream-Status: pending
+
+Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
+---
+ common/tftpsubs.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/common/tftpsubs.c b/common/tftpsubs.c
+index b4d4ffe..b4ea3f2 100644
+--- a/common/tftpsubs.c
++++ b/common/tftpsubs.c
+@@ -207,6 +207,14 @@ int write_behind(FILE * file, int convert)
+ p = buf;
+ ct = count;
+ count = 0;
++
++ /* Check the first character together with prevchar */
++ c = *p;
++ if ((prevchar == '\r') && (c == '\n')) {
++ lseek(fileno(file), -1, SEEK_CUR);
++ count++;
++ }
++
+ while (ct--) { /* loop over the buffer */
+ c = *p++; /* pick up a character */
+ if (prevchar == '\r') { /* if prev char was cr */
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd
new file mode 100644
index 000000000..fe7016396
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd
@@ -0,0 +1,18 @@
+# default: off
+# description: The tftp server serves files using the trivial file transfer \
+# protocol. The tftp protocol is often used to boot diskless \
+# workstations, download configuration files to network-aware printers, \
+# and to start the installation process for some operating systems.
+service tftp
+{
+ socket_type = dgram
+ protocol = udp
+ wait = yes
+ user = root
+ server = /usr/sbin/in.tftpd-hpa
+ server_args = -s /var/lib/tftpboot
+ disable = yes
+ per_source = 11
+ cps = 100 2
+ flags = IPv6
+}
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service
new file mode 100644
index 000000000..97d56586b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Tftp Server
+Requires=tftpd-hpa.socket
+
+[Service]
+ExecStart=@SBINDIR@/in.tftpd-hpa -s /var/lib/tftpboot
+StandardInput=socket
+
+[Install]
+Also=tftpd-hpa.socket
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket
new file mode 100644
index 000000000..8764c1de3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=Tftp Server Activation Socket
+
+[Socket]
+ListenDatagram=69
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
new file mode 100644
index 000000000..132972b33
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
@@ -0,0 +1,91 @@
+SUMMARY = "Client for the Trivial File Transfer Protocol"
+DESCRIPTION = \
+"The Trivial File Transfer Protocol (TFTP) is normally used only for \
+booting diskless workstations. The tftp package provides the user \
+interface for TFTP, which allows users to transfer files to and from a \
+remote machine. This program and TFTP provide very little security, \
+and should not be enabled unless it is expressly needed."
+DEPENDS = "tcp-wrappers readline"
+SECTION = "net"
+HOMEPAGE = "http://freecode.com/projects/tftp-hpa"
+LICENSE = "BSD-4-Clause"
+LIC_FILES_CHKSUM = "file://MCONFIG.in;beginline=1;endline=9;md5=c28ba5adb43041fae4629db05c83cbdd \
+ file://tftp/tftp.c;beginline=1;endline=32;md5=988c1cba99d70858a26cd877209857f4"
+
+
+SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.tar.bz2 \
+ file://tftp-0.40-remap.patch \
+ file://tftp-0.42-tftpboot.patch \
+ file://tftp-0.49-chk_retcodes.patch \
+ file://tftp-0.49-cmd_arg.patch \
+ file://tftp-hpa-0.39-tzfix.patch \
+ file://tftp-hpa-0.49-fortify-strcpy-crash.patch \
+ file://tftp-hpa-0.49-stats.patch \
+ file://tftp-hpa-5.2-pktinfo.patch \
+ file://default \
+ file://init \
+ file://add-error-check-for-disk-filled-up.patch \
+ file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \
+ file://fix-writing-emtpy-file.patch \
+ file://0001-__progname-is-provided-by-libc.patch \
+ file://tftpd-hpa.socket \
+ file://tftpd-hpa.service \
+"
+
+SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21"
+SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269"
+
+inherit autotools-brokensep update-rc.d update-alternatives systemd
+
+export AR = "${HOST_PREFIX}ar cq"
+
+EXTRA_OECONF += "--disable-option-checking"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+# configure.in has errors
+do_configure() {
+ oe_runconf
+}
+
+do_install() {
+ oe_runmake install INSTALLROOT=${D}
+ mv ${D}${bindir}/tftp ${D}${bindir}/tftp-hpa
+ mv ${D}${sbindir}/in.tftpd ${D}${sbindir}/in.tftpd-hpa
+
+ install -m 755 -d ${D}${localstatedir}/lib/tftpboot/
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/tftpd-hpa
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa
+ sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/tftpd-hpa
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/tftpd-hpa.socket ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/tftpd-hpa.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tftpd-hpa.service
+}
+
+FILES_${PN} = "${bindir}"
+
+PACKAGES += "tftp-hpa-server"
+SUMMARY_tftp-hpa-server = "Server for the Trivial File Transfer Protocol"
+FILES_tftp-hpa-server = "${sbindir} ${sysconfdir} ${localstatedir}"
+CONFFILES_tftp-hpa-server = "${sysconfdir}/default/tftpd-hpa"
+
+INITSCRIPT_PACKAGES = "tftp-hpa-server"
+INITSCRIPT_NAME = "tftpd-hpa"
+INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 20 1 ."
+
+ALTERNATIVE_${PN} = "tftp"
+ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa"
+ALTERNATIVE_PRIORITY = "60"
+
+SYSTEMD_PACKAGES = "tftp-hpa-server"
+SYSTEMD_SERVICE_tftp-hpa-server = "tftpd-hpa.socket tftpd-hpa.service"
+SYSTEMD_AUTO_ENABLE_tftp-hpa-server = "enable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch
new file mode 100644
index 000000000..d2eb15614
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch
@@ -0,0 +1,16 @@
+Remove CC and CFLAGS values, we set these ourselves
+
+Upstream-Status: Inappropriate [config]
+
+diff -urN vblade-19.old//makefile vblade-19//makefile
+--- vblade-19.old//makefile 2008-10-08 22:07:40.000000000 +0100
++++ vblade-19//makefile 2008-11-18 19:07:51.700365029 +0000
+@@ -9,8 +9,6 @@
+ mandir = ${sharedir}/man
+
+ O=aoe.o bpf.o ${PLATFORM}.o ata.o
+-CFLAGS += -Wall -g -O2
+-CC = gcc
+
+ vblade: $O
+ ${CC} -o vblade $O
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch
new file mode 100644
index 000000000..a74452db6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch
@@ -0,0 +1,19 @@
+Add LDFLAGS variable to Makefile, make sure the extra linker flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/makefile b/makefile
+index 98008da..c328ba7 100644
+--- a/makefile
++++ b/makefile
+@@ -11,7 +11,7 @@ mandir = ${sharedir}/man
+ O=aoe.o bpf.o ${PLATFORM}.o ata.o
+
+ vblade: $O
+- ${CC} -o vblade $O
++ ${CC} ${LDFLAGS} -o vblade $O
+
+ aoe.o : aoe.c config.h dat.h fns.h makefile
+ ${CC} ${CFLAGS} -c $<
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf
new file mode 100644
index 000000000..e8b93ec37
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf
@@ -0,0 +1,2 @@
+# network_device shelf slot file/disk/partition mac[,mac[,mac]]
+#eth0 0 0 /dev/sdb 00:11:22:33:44:55
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init
new file mode 100644
index 000000000..0298c8001
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init
@@ -0,0 +1,193 @@
+#!/bin/sh
+#
+# Init script for vblade (ATA over Ethernet daemon)
+#
+# chkconfig: - 30 70
+# description: vblade AoE daemon
+#
+# processname: vblade
+# config: /etc/vblade.conf
+#
+# Shamelessly hacked together from other init scripts (sshd, mostly)
+# integrate vblade.init from Fedora's vblade-14-6.fc12.src.rpm
+#
+
+RETVAL=0
+prog=vblade
+
+spawn_vblade() {
+ ALLOWMACS=""
+ [ -n "$5" ] && ALLOWMACS="-m $5"
+ ID="$1-e$2.$3"
+ if [ ! -d "/var/run/$prog" ]; then
+ mkdir /var/run/$prog
+ fi
+ PID_FILE=/var/run/$prog/${ID}.pid
+ $prog $ALLOWMACS $2 $3 $1 $4 >> /var/log/$prog.log 2>&1 &
+ pid=$!
+ RETVAL=$?
+ echo $pid > $PID_FILE
+ echo -n $"$4 (e$2.$3@$1) [pid $pid]"
+ [ "$RETVAL" = 0 ] && echo "success" || echo "failure"
+ echo
+}
+
+start() {
+ local ret
+
+ echo $"Starting up $prog: "
+
+ #/var/lock/subsys/$prog exists?
+ status $prog 2>&1 > /dev/null
+ ret=$?
+
+ if [ "$ret" = "2" ]; then
+ echo "$prog dead but subsys locked"
+ echo
+ return 2
+ else
+ if [ "$ret" = "0" ]; then
+ #is running
+ echo "already running"
+ return 0
+ fi
+ fi
+
+ if [ 0 -ne `grep -vc '^#\|^$' /etc/$prog.conf` ]
+ then
+ grep -v '^#' /etc/$prog.conf | sed -e 's/ / /g' -e 's/ / /g' | while read line
+ do
+ spawn_vblade $line
+ done
+ touch /var/lock/subsys/$prog
+ else
+ echo -n "empty $prog.conf?"
+ echo " passed"
+ echo
+ fi
+}
+
+stop() {
+ echo -n $"Shutting down $prog: "
+ for pidfile in `ls /var/run/$prog/*.pid 2>/dev/null`
+ do
+ kill -TERM `cat $pidfile`
+ rm -f $pidfile
+ done
+ echo "success"
+ echo
+ rm -f /var/lock/subsys/$prog
+}
+
+__pids_var_run() {
+ local base=${1##*/}
+ local pid_file=${2:-/var/run/$base.pid}
+
+ pid=
+ if [ -f "$pid_file" ] ; then
+ local line p
+
+ while : ; do
+ read line
+ [ -z "$line" ] && break
+ for p in $line ; do
+ [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p"
+ done
+ done < "$pid_file"
+
+ if [ -n "$pid" ]; then
+ return 0
+ fi
+ return 1 # "Program is dead and /var/run pid file exists"
+ fi
+ return 3 # "Program is not running"
+}
+
+__pids_pidof() {
+ pidof "$1" || pidof "${1##*/}"
+}
+
+status() {
+ local base pid lock_file= pid_file=
+
+ # Test syntax.
+ if [ "$#" = 0 ] ; then
+ echo $"Usage: status [-p pidfile] {program}"
+ return 1
+ fi
+ if [ "$1" = "-p" ]; then
+ pid_file=$2
+ shift 2
+ fi
+ if [ "$1" = "-l" ]; then
+ lock_file=$2
+ shift 2
+ fi
+ base=${1##*/}
+
+ # First try "pidof"
+ __pids_var_run "$1" "$pid_file"
+ RC=$?
+ if [ -z "$pid_file" -a -z "$pid" ]; then
+ pid="$(__pids_pidof "$1")"
+ fi
+ if [ -n "$pid" ]; then
+ echo $"${base} (pid $pid) is running..."
+ return 0
+ fi
+
+ case "$RC" in
+ 0)
+ echo $"${base} (pid $pid) is running..."
+ return 0
+ ;;
+ 1)
+ echo $"${base} dead but pid file exists"
+ return 1
+ ;;
+ esac
+ if [ -z "${lock_file}" ]; then
+ lock_file=${base}
+ fi
+ # See if /var/lock/subsys/${lock_file} exists
+ if [ -f /var/lock/subsys/${lock_file} ]; then
+ echo $"${base} dead but subsys locked"
+ return 2
+ fi
+ echo $"${base} is stopped"
+ return 3
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ reload)
+ # yes, this sucks, but the vblade processes die on SIGHUP
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$prog ]; then
+ stop
+ # avoid race
+ sleep 3
+ start
+ fi
+ ;;
+ status)
+ status $prog
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+ RETVAL=1
+esac
+exit $RETVAL
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service
new file mode 100644
index 000000000..83a4d5dcb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Virtual EtherDrive blade AoE target
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStart=@BINDIR@/vblade.init start
+ExecStop=@BINDIR@/vblade.init stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade
new file mode 100644
index 000000000..64a5881c0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade
@@ -0,0 +1 @@
+d root root 0755 /var/run/vblade none
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/vblade_22.bb b/meta-openembedded/meta-networking/recipes-daemons/vblade/vblade_22.bb
new file mode 100644
index 000000000..d7b1dfaad
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/vblade_22.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Virtual EtherDrive blade AoE target"
+SECTION = "admin"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/aoetools/${BP}.tar.gz \
+ file://cross.patch \
+ file://makefile-add-ldflags.patch \
+ file://${BPN}.conf \
+ file://${BPN}.init \
+ file://${BPN}.service \
+ file://volatiles.99_vblade \
+ "
+
+SRC_URI[md5sum] = "510d98ba0f231284a5fbe2da11cb2d6e"
+SRC_URI[sha256sum] = "a990378f273f10eb431e42954a871aed52714035bbab28c54cef600c458356bb"
+
+inherit autotools-brokensep update-rc.d systemd
+
+do_install() {
+ install -D -m 0755 ${S}/vblade ${D}/${sbindir}/vblade
+ install -D -m 0755 ${S}/vbladed ${D}/${sbindir}/vbladed
+ install -D -m 0644 ${S}/vblade.8 ${D}/${mandir}/man8/vblade.8
+
+ install -D -m 0644 ${WORKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN}.conf
+ install -D -m 0755 ${WORKDIR}/${BPN}.init ${D}/${sysconfdir}/init.d/${BPN}
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}/${sysconfdir}/default/volatiles
+ install -m 0755 ${WORKDIR}/volatiles.99_vblade ${D}/${sysconfdir}/default/volatiles/99_vblade
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}/${bindir}
+ install -m 0755 ${WORKDIR}/${BPN}.init ${D}/${bindir}/
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /var/run/${BPN} 0755 root root -" > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/vblade.service ${D}${systemd_system_unitdir}
+ sed -e 's,@BINDIR@,${bindir},g' -i ${D}${systemd_system_unitdir}/*.service
+ fi
+
+}
+
+INITSCRIPT_NAME = "vblade"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "vblade.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch
new file mode 100644
index 000000000..b69de1d1c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch
@@ -0,0 +1,62 @@
+From ce2be5d4967445828d5ae9d9462cfaa78ae03c73 Mon Sep 17 00:00:00 2001
+From: Ming Liu <ming.liu@windriver.com>
+Date: Wed, 18 Sep 2013 09:44:20 +0800
+Subject: [PATCH] vsftpd: change default value of secure_chroot_dir
+
+Upstream-Status: Pending
+
+Change secure_chroot_dir pointing to a volatile directory.
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+---
+ INSTALL | 6 +++---
+ tunables.c | 2 +-
+ vsftpd.conf.5 | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/INSTALL b/INSTALL
+index 4f811aa..427122a 100644
+--- a/INSTALL
++++ b/INSTALL
+@@ -27,11 +27,11 @@ user in case it does not already exist. e.g.:
+ [root@localhost root]# useradd nobody
+ useradd: user nobody exists
+
+-2b) vsftpd needs the (empty) directory /usr/share/empty in the default
++2b) vsftpd needs the (empty) directory /var/run/vsftpd/empty in the default
+ configuration. Add this directory in case it does not already exist. e.g.:
+
+-[root@localhost root]# mkdir /usr/share/empty/
+-mkdir: cannot create directory `/usr/share/empty': File exists
++[root@localhost root]# mkdir /var/run/vsftpd/empty/
++mkdir: cannot create directory `/var/run/vsftpd/empty': File exists
+
+ 2c) For anonymous FTP, you will need the user "ftp" to exist, and have a
+ valid home directory (which is NOT owned or writable by the user "ftp").
+diff --git a/tunables.c b/tunables.c
+index 284a10d..8c63c3f 100644
+--- a/tunables.c
++++ b/tunables.c
+@@ -254,7 +254,7 @@ tunables_load_defaults()
+ /* -rw------- */
+ tunable_chown_upload_mode = 0600;
+
+- install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir);
++ install_str_setting("/var/run/vsftpd/empty", &tunable_secure_chroot_dir);
+ install_str_setting("ftp", &tunable_ftp_username);
+ install_str_setting("root", &tunable_chown_username);
+ install_str_setting("/var/log/xferlog", &tunable_xferlog_file);
+diff --git a/vsftpd.conf.5 b/vsftpd.conf.5
+index fcc6022..e4ffdee 100644
+--- a/vsftpd.conf.5
++++ b/vsftpd.conf.5
+@@ -969,7 +969,7 @@ This option should be the name of a directory which is empty. Also, the
+ directory should not be writable by the ftp user. This directory is used
+ as a secure chroot() jail at times vsftpd does not require filesystem access.
+
+-Default: /usr/share/empty
++Default: /var/run/vsftpd/empty
+ .TP
+ .B ssl_ciphers
+ This option can be used to select which SSL ciphers vsftpd will allow for
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/init b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/init
new file mode 100755
index 000000000..72adf0d9a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/init
@@ -0,0 +1,50 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: vsftpd
+# Default-Start: 2345
+# Default-Stop: 016
+# Short-Description: Very Secure Ftp Daemon
+# Description: vsftpd is a Very Secure FTP daemon. It was written completely from
+# scratch
+### END INIT INFO
+
+DAEMON=/usr/sbin/vsftpd
+NAME=vsftpd
+DESC="FTP Server"
+ARGS=""
+FTPDIR=/var/lib/ftp
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "* starting $DESC: $NAME... "
+ if ! test -d $FTPDIR; then
+ mkdir -p $FTPDIR/in
+ chown ftp $FTPDIR -R
+ chmod a-w $FTPDIR
+ chmod u+w $FTPDIR/in
+ fi
+ start-stop-daemon -S -b -x $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "* stopping $DESC: $NAME... "
+ start-stop-daemon -K -x $DAEMON
+ echo "done."
+ ;;
+ restart)
+ echo "* restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd
new file mode 100644
index 000000000..8a602ba37
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd
@@ -0,0 +1 @@
+d root root 0755 /var/run/vsftpd/empty none
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf
new file mode 100644
index 000000000..bb1929480
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf
@@ -0,0 +1,139 @@
+# Example config file /etc/vsftpd.conf
+#
+# The default compiled in settings are fairly paranoid. This sample file
+# loosens things up a bit, to make the ftp daemon more usable.
+# Please see vsftpd.conf.5 for all compiled in defaults.
+#
+# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
+# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
+# capabilities.
+
+# run standalone
+listen=YES
+
+# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
+anonymous_enable=NO
+#
+# Uncomment this to allow local users to log in.
+local_enable=YES
+#
+# Uncomment this to enable any form of FTP write command.
+write_enable=YES
+#
+# Default umask for local users is 077. You may wish to change this to 022,
+# if your users expect that (022 is used by most other ftpd's)
+local_umask=022
+#
+# Uncomment this to allow the anonymous FTP user to upload files. This only
+# has an effect if the above global write enable is activated. Also, you will
+# obviously need to create a directory writable by the FTP user.
+#anon_upload_enable=YES
+#
+# Uncomment this if you want the anonymous FTP user to be able to create
+# new directories.
+#anon_mkdir_write_enable=YES
+#
+# Activate directory messages - messages given to remote users when they
+# go into a certain directory.
+dirmessage_enable=YES
+#
+# Activate logging of uploads/downloads.
+xferlog_enable=YES
+#
+# Make sure PORT transfer connections originate from port 20 (ftp-data).
+connect_from_port_20=YES
+#
+# If you want, you can arrange for uploaded anonymous files to be owned by
+# a different user. Note! Using "root" for uploaded files is not
+# recommended!
+#chown_uploads=YES
+#chown_username=whoever
+#
+# You may override where the log file goes if you like. The default is shown
+# below.
+#xferlog_file=/var/log/vsftpd.log
+#
+# If you want, you can have your log file in standard ftpd xferlog format
+xferlog_std_format=YES
+#
+# You may change the default value for timing out an idle session.
+#idle_session_timeout=600
+#
+# You may change the default value for timing out a data connection.
+#data_connection_timeout=120
+#
+# It is recommended that you define on your system a unique user which the
+# ftp server can use as a totally isolated and unprivileged user.
+#nopriv_user=ftp
+#
+# Enable this and the server will recognise asynchronous ABOR requests. Not
+# recommended for security (the code is non-trivial). Not enabling it,
+# however, may confuse older FTP clients.
+#async_abor_enable=YES
+#
+# By default the server will pretend to allow ASCII mode but in fact ignore
+# the request. Turn on the below options to have the server actually do ASCII
+# mangling on files when in ASCII mode.
+# Beware that turning on ascii_download_enable enables malicious remote parties
+# to consume your I/O resources, by issuing the command "SIZE /big/file" in
+# ASCII mode.
+# These ASCII options are split into upload and download because you may wish
+# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
+# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
+# on the client anyway..
+#ascii_upload_enable=YES
+#ascii_download_enable=YES
+#
+# You may fully customise the login banner string:
+#ftpd_banner=Welcome to blah FTP service.
+#
+# You may specify a file of disallowed anonymous e-mail addresses. Apparently
+# useful for combatting certain DoS attacks.
+#deny_email_enable=YES
+# (default follows)
+#banned_email_file=/etc/vsftpd.banned_emails
+#
+# You may specify an explicit list of local users to chroot() to their home
+# directory. If chroot_local_user is YES, then this list becomes a list of
+# users to NOT chroot().
+#chroot_list_enable=YES
+# (default follows)
+#chroot_list_file=/etc/vsftpd.chroot_list
+#
+# You may activate the "-R" option to the builtin ls. This is disabled by
+# default to avoid remote users being able to cause excessive I/O on large
+# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
+# the presence of the "-R" option, so there is a strong case for enabling it.
+#ls_recurse_enable=YES
+#
+# This string is the name of the PAM service vsftpd will use.
+pam_service_name=vsftpd
+#
+# This option is examined if userlist_enable is activated. If you set this
+# setting to NO, then users will be denied login unless they are explicitly
+# listed in the file specified by userlist_file. When login is denied, the
+# denial is issued before the user is asked for a password.
+userlist_deny=YES
+#
+# If enabled, vsftpd will load a list of usernames, from the filename given by
+# userlist_file. If a user tries to log in using a name in this file, they
+# will be denied before they are asked for a password. This may be useful in
+# preventing cleartext passwords being transmitted. See also userlist_deny.
+userlist_enable=YES
+#
+# If enabled, vsftpd will display directory listings with the time in your
+# local time zone. The default is to display GMT. The times returned by the
+# MDTM FTP command are also affected by this option.
+use_localtime=YES
+#
+# If set to YES, local users will be (by default) placed in a chroot() jail in
+# their home directory after login. Warning: This option has security
+# implications, especially if the users have upload permission, or shell access.
+# Only enable if you know what you are doing. Note that these security implications
+# are not vsftpd specific. They apply to all FTP daemons which offer to put
+# local users in chroot() jails.
+chroot_local_user=YES
+#
+allow_writeable_chroot=YES
+#
+tcp_wrappers=YES
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers
new file mode 100644
index 000000000..096142f5d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers
@@ -0,0 +1,15 @@
+# Users that are not allowed to login via ftp
+root
+bin
+daemon
+adm
+lp
+sync
+shutdown
+halt
+mail
+news
+uucp
+operator
+games
+nobody
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service
new file mode 100644
index 000000000..e27102026
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Vsftpd ftp daemon
+After=network.target
+
+[Service]
+ExecStart=@SBINDIR@/vsftpd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list
new file mode 100644
index 000000000..d283e3d26
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list
@@ -0,0 +1,20 @@
+# vsftpd userlist
+# If userlist_deny=NO, only allow users in this file
+# If userlist_deny=YES (default), never allow users in this file, and
+# do not even prompt for a password.
+# Note that the default vsftpd pam config also checks /etc/vsftpd.ftpusers
+# for users that are denied.
+root
+bin
+daemon
+adm
+lp
+sync
+shutdown
+halt
+mail
+news
+uucp
+operator
+games
+nobody
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch
new file mode 100644
index 000000000..d81c94a4a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch
@@ -0,0 +1,26 @@
+From c5caf52b9ed79da8916ef5722efe6df61a856e2f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 20:09:12 -0700
+Subject: [PATCH] sysdeputil.c: Fix with musl which does not have utmpx
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ sysdeputil.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/sysdeputil.c b/sysdeputil.c
+index 06f01f4..a8cff3b 100644
+--- a/sysdeputil.c
++++ b/sysdeputil.c
+@@ -58,7 +58,9 @@
+ #define VSF_SYSDEP_HAVE_SHADOW
+ #define VSF_SYSDEP_HAVE_USERSHELL
+ #define VSF_SYSDEP_HAVE_LIBCAP
+-#define VSF_SYSDEP_HAVE_UTMPX
++#if defined(__GLIBC__)
++ #define VSF_SYSDEP_HAVE_UTMPX
++#endif
+
+ #define __USE_GNU
+ #include <utmpx.h>
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch
new file mode 100644
index 000000000..c6c0f80a1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch
@@ -0,0 +1,43 @@
+From 9c4826c19f04da533886209361a2caddf582d65c Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Tue, 6 Sep 2016 17:17:44 +0800
+Subject: [PATCH] vsftpd: allow sysinfo() in the seccomp sandbox
+
+Upstream-Status: Pending
+
+* Allow sysinfo() in the seccomp sandbox otherwise
+ comes below OOPS: priv_sock_get_cmd as the syscall
+ sysinfo() not allowed
+
+tnftp 192.168.1.1
+Connected to 192.168.1.1.
+220 (vsFTPd 3.0.3)
+Name (192.168.1.1:root): anonymous
+331 Please specify the password.
+Password:
+230 Login successful.
+Remote system type is UNIX.
+Using binary mode to transfer files.
+ftp> prompt
+Interactive mode off.
+ftp> mget small*
+OOPS: priv_sock_get_cmd
+
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+
+---
+ seccompsandbox.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/seccompsandbox.c b/seccompsandbox.c
+index 2c350a9..67d9ca5 100644
+--- a/seccompsandbox.c
++++ b/seccompsandbox.c
+@@ -409,6 +409,7 @@ seccomp_sandbox_setup_postlogin(const struct vsf_session* p_sess)
+ allow_nr(__NR_getcwd);
+ allow_nr(__NR_chdir);
+ allow_nr(__NR_getdents);
++ allow_nr(__NR_sysinfo);
+ /* Misc */
+ allow_nr(__NR_umask);
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch
new file mode 100644
index 000000000..5ad5c14e7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch
@@ -0,0 +1,52 @@
+From bab3f62f1fd5b7c2ab197f4311ad191bf18816b9 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Mon, 20 Feb 2012 13:51:49 +0000
+Subject: [PATCH] Use DESTDIR within install to allow installing under a prefix
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+---
+ Makefile | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c63ed1b..9e4f35f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -29,21 +29,21 @@ vsftpd: $(OBJS)
+ $(CC) -o vsftpd $(OBJS) $(LINK) $(LDFLAGS) $(LIBS)
+
+ install:
+- if [ -x /usr/local/sbin ]; then \
+- $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \
++ if [ -x ${DESTDIR}/usr/local/sbin ]; then \
++ $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/local/sbin/vsftpd; \
+ else \
+- $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi
+- if [ -x /usr/local/man ]; then \
+- $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
+- $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
+- elif [ -x /usr/share/man ]; then \
+- $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
+- $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
++ $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/sbin/vsftpd; fi
++ if [ -x ${DESTDIR}/usr/local/man ]; then \
++ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/local/man/man8/vsftpd.8; \
++ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/local/man/man5/vsftpd.conf.5; \
++ elif [ -x ${DESTDIR}/usr/share/man ]; then \
++ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/share/man/man8/vsftpd.8; \
++ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/share/man/man5/vsftpd.conf.5; \
+ else \
+- $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
+- $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
+- if [ -x /etc/xinetd.d ]; then \
+- $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi
++ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/man/man8/vsftpd.8; \
++ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/man/man5/vsftpd.conf.5; fi
++ if [ -x ${DESTDIR}/etc/xinetd.d ]; then \
++ $(INSTALL) -m 644 xinetd.d/vsftpd ${DESTDIR}/etc/xinetd.d/vsftpd; fi
+
+ clean:
+ rm -f *.o *.swp vsftpd
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch
new file mode 100644
index 000000000..d2e58a325
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch
@@ -0,0 +1,30 @@
+From 328799d0cd5c523ad7a814fefec16d8a84aa8010 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Tue, 16 Apr 2013 10:53:55 +0000
+Subject: [PATCH] Hardcode LIBS instead of using a script to determine
+ available libs
+
+We want to avoid this dynamic detection so we have a deterministic
+build.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 9e4f35f..3a5535d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,7 +8,7 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \
+ -D_FORTIFY_SOURCE=2 \
+ #-pedantic -Wconversion
+
+-LIBS = `./vsf_findlibs.sh`
++LIBS = -lssl -lcrypto -lnsl -lresolv
+ LINK = -Wl,-s
+ LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch
new file mode 100644
index 000000000..e59607388
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch
@@ -0,0 +1,25 @@
+From 261874ea47973ea156141185082252fc92081906 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Tue, 16 Apr 2013 10:53:55 +0000
+Subject: [PATCH] Disable stripping at link time
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+---
+ Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 3a5535d..e78019a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,7 +9,6 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \
+ #-pedantic -Wconversion
+
+ LIBS = -lssl -lcrypto -lnsl -lresolv
+-LINK = -Wl,-s
+ LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now
+
+ OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch
new file mode 100644
index 000000000..a4387c132
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch
@@ -0,0 +1,26 @@
+From 71628ddc91b6efb9b922a3fcf8cc18522f5387be Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Mon, 20 Feb 2012 13:51:49 +0000
+Subject: [PATCH] Disable PAM
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+
+---
+ builddefs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builddefs.h b/builddefs.h
+index 0106d1a..f48a568 100644
+--- a/builddefs.h
++++ b/builddefs.h
+@@ -2,7 +2,7 @@
+ #define VSF_BUILDDEFS_H
+
+ #define VSF_BUILD_TCPWRAPPERS
+-#define VSF_BUILD_PAM
++#undef VSF_BUILD_PAM
+ #undef VSF_BUILD_SSL
+
+ #endif /* VSF_BUILDDEFS_H */
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch
new file mode 100644
index 000000000..cf0d68e27
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch
@@ -0,0 +1,16 @@
+Disable PAM
+
+Upstream-Status: Inappropriate [config]
+
+diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h
+--- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200
++++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200
+@@ -2,7 +2,7 @@
+ #define VSF_BUILDDEFS_H
+
+ #undef VSF_BUILD_TCPWRAPPERS
+-#define VSF_BUILD_PAM
++#undef VSF_BUILD_PAM
+ #undef VSF_BUILD_SSL
+
+ #endif /* VSF_BUILDDEFS_H */
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch
new file mode 100644
index 000000000..590eb5857
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch
@@ -0,0 +1,89 @@
+From b756444854c5ab3b1284fd7113043fe8860e99ec Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Fri, 24 Apr 2015 09:36:48 +0800
+Subject: [PATCH] Fix the CVE-2015-1419
+
+Upstream-Status: Pending
+
+Try to fix deny_file parsing to do more what is expected. Taken
+from fedora. CVE-2015-1419
+
+ftp://195.220.108.108/linux/fedora/linux/development/rawhide/source/SRPMS/v/vsftpd-3.0.2-13.fc22.src.rpm
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ ls.c | 26 ++++++++++++++++++++++++--
+ str.c | 11 +++++++++++
+ str.h | 1 +
+ 3 files changed, 36 insertions(+), 2 deletions(-)
+
+diff --git a/ls.c b/ls.c
+index 7e1376d..e9302dd 100644
+--- a/ls.c
++++ b/ls.c
+@@ -246,9 +246,31 @@ vsf_filename_passes_filter(const struct mystr* p_filename_str,
+ int ret = 0;
+ char last_token = 0;
+ int must_match_at_current_pos = 1;
++
++
+ str_copy(&filter_remain_str, p_filter_str);
+- str_copy(&name_remain_str, p_filename_str);
+-
++
++ if (!str_isempty (&filter_remain_str) && !str_isempty(p_filename_str)) {
++ if (str_get_char_at(p_filter_str, 0) == '/') {
++ if (str_get_char_at(p_filename_str, 0) != '/') {
++ str_getcwd (&name_remain_str);
++
++ if (str_getlen(&name_remain_str) > 1) /* cwd != root dir */
++ str_append_char (&name_remain_str, '/');
++
++ str_append_str (&name_remain_str, p_filename_str);
++ }
++ else
++ str_copy (&name_remain_str, p_filename_str);
++ } else {
++ if (str_get_char_at(p_filter_str, 0) != '{')
++ str_basename (&name_remain_str, p_filename_str);
++ else
++ str_copy (&name_remain_str, p_filename_str);
++ }
++ } else
++ str_copy(&name_remain_str, p_filename_str);
++
+ while (!str_isempty(&filter_remain_str) && *iters < VSFTP_MATCHITERS_MAX)
+ {
+ static struct mystr s_match_needed_str;
+diff --git a/str.c b/str.c
+index 6596204..ba4b92a 100644
+--- a/str.c
++++ b/str.c
+@@ -711,3 +711,14 @@ str_replace_unprintable(struct mystr* p_str, char new_char)
+ }
+ }
+
++void
++str_basename (struct mystr* d_str, const struct mystr* path)
++{
++ static struct mystr tmp;
++
++ str_copy (&tmp, path);
++ str_split_char_reverse(&tmp, d_str, '/');
++
++ if (str_isempty(d_str))
++ str_copy (d_str, path);
++}
+diff --git a/str.h b/str.h
+index ab0a9a4..3a21b50 100644
+--- a/str.h
++++ b/str.h
+@@ -100,6 +100,7 @@ void str_replace_unprintable(struct mystr* p_str, char new_char);
+ int str_atoi(const struct mystr* p_str);
+ filesize_t str_a_to_filesize_t(const struct mystr* p_str);
+ unsigned int str_octal_to_uint(const struct mystr* p_str);
++void str_basename (struct mystr* d_str, const struct mystr* path);
+
+ /* PURPOSE: Extract a line of text (delimited by \n or EOF) from a string
+ * buffer, starting at character position 'p_pos'. The extracted line will
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch
new file mode 100644
index 000000000..c558aee0a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch
@@ -0,0 +1,26 @@
+From c026b0c0de4eebb189bc77b2d4c3b9528454ac04 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Fri, 19 Jul 2013 10:19:25 +0800
+Subject: [PATCH] Enable tcp_wrapper.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+
+---
+ builddefs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builddefs.h b/builddefs.h
+index e908352..0106d1a 100644
+--- a/builddefs.h
++++ b/builddefs.h
+@@ -1,7 +1,7 @@
+ #ifndef VSF_BUILDDEFS_H
+ #define VSF_BUILDDEFS_H
+
+-#undef VSF_BUILD_TCPWRAPPERS
++#define VSF_BUILD_TCPWRAPPERS
+ #define VSF_BUILD_PAM
+ #undef VSF_BUILD_SSL
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb
new file mode 100644
index 000000000..7a2035601
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb
@@ -0,0 +1,112 @@
+SUMMARY = "Very Secure FTP server"
+HOMEPAGE = "https://security.appspot.com/vsftpd.html"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271"
+
+DEPENDS = "libcap openssl"
+
+SRC_URI = "https://security.appspot.com/downloads/vsftpd-${PV}.tar.gz \
+ file://makefile-destdir.patch \
+ file://makefile-libs.patch \
+ file://makefile-strip.patch \
+ file://init \
+ file://vsftpd.conf \
+ file://vsftpd.user_list \
+ file://vsftpd.ftpusers \
+ file://change-secure_chroot_dir.patch \
+ file://volatiles.99_vsftpd \
+ file://vsftpd.service \
+ file://vsftpd-2.1.0-filter.patch \
+ file://0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch \
+ ${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)} \
+ file://0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch \
+ "
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \
+ file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \
+ file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb"
+SRC_URI[md5sum] = "da119d084bd3f98664636ea05b5bb398"
+SRC_URI[sha256sum] = "9d4d2bf6e6e2884852ba4e69e157a2cecd68c5a7635d66a3a8cf8d898c955ef7"
+
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers"
+
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}"
+PAMLIB = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}"
+WRAPLIB = "${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', '-lwrap', '', d)}"
+NOPAM_SRC ="${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}"
+
+inherit update-rc.d useradd systemd
+
+CONFFILES_${PN} = "${sysconfdir}/vsftpd.conf"
+LDFLAGS_append =" -lcrypt -lcap"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_configure() {
+ # Fix hardcoded /usr, /etc, /var mess.
+ cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \
+ |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new
+ mv tunables.c.new tunables.c
+}
+
+do_compile() {
+ oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} ${WRAPLIB}"
+}
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -d ${D}${mandir}/man8
+ install -d ${D}${mandir}/man5
+ oe_runmake 'DESTDIR=${D}' install
+ install -d ${D}${sysconfdir}
+ install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd
+ install -d ${D}/${sysconfdir}/default/volatiles
+ install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd
+
+ install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/
+ install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/
+ if ! test -z "${PAMLIB}" ; then
+ install -d ${D}${sysconfdir}/pam.d/
+ cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd
+ sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd
+ sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd
+ fi
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /var/run/vsftpd/empty 0755 root root -" \
+ > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+ fi
+
+ # Install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/vsftpd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/vsftpd.service
+}
+
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME_${PN} = "vsftpd"
+INITSCRIPT_PARAMS_${PN} = "defaults 80"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \
+ --shell /bin/false ftp "
+GROUPADD_PARAM_${PN} = "-r ftp"
+
+SYSTEMD_SERVICE_${PN} = "vsftpd.service"
+
+pkg_postinst_${PN}() {
+ if [ -z "$D" ]; then
+ if type systemd-tmpfiles >/dev/null; then
+ systemd-tmpfiles --create
+ elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+ fi
+}
OpenPOWER on IntegriCloud