summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/recipes-extended
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2016-08-17 14:31:25 -0500
committerPatrick Williams <patrick@stwcx.xyz>2016-08-22 16:43:26 +0000
commit60f9d69e016b11c468c98ea75ba0a60c44afbbc4 (patch)
treeecb49581a9e41a37943c22cd9ef3f63451b20ee7 /import-layers/yocto-poky/meta/recipes-extended
parente18c61205e0234b03697129c20cc69c9b3940efc (diff)
downloadtalos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.tar.gz
talos-openbmc-60f9d69e016b11c468c98ea75ba0a60c44afbbc4.zip
yocto-poky: Move to import-layers subdir
We are going to import additional layers, so create a subdir to hold all of the layers that we import with git-subtree. Change-Id: I6f732153a22be8ca663035c518837e3cc5ec0799 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-extended')
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/atd.init45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/atd.service9
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/configure-fix-with-without-selinux.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/pam.conf.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.c328
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.h37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.18.bb70
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas.inc30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/sepbuildfix.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/augeas/augeas_1.4.0.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch44
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/test-output.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc65
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch169
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.48.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bc/bc_1.06.bb26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bc/files/fix-segment-fault.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch78
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/blktool/blktool_4-7.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc21
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/byacc-open.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20150711.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am72
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb44
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb67
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch178
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch217
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_v2.inc41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch339
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb47
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.init58
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.service11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crontab14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.0.bb81
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc116
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch69
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups/cups_serverbin.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.3.bb6
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils.inc18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.3.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/run-ptest2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.2.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils.inc23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.6.0.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest10
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch81
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h41
l---------import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i6861
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/png_mak.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.18.bb107
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gperf/gperf.inc22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.4.bb5
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch1342
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.23.bb43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb70
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip.inc38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.6.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-full-cmdline.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-kernel-dev.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-dev.bb7
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb9
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb50
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch92
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/targets.diff15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb76
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb42
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/00_arches.patch607
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/destdir.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/system-linkage.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libaio/libaio_0.3.110.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/0001-Set-xattrs-after-setting-times.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2015-2304.patch152
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/mkdir.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.1.2.bb71
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_1.32.bb37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_git.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch878
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch144
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd1
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf331
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.39.bb76
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch147
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb63
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/init-functions44
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_killproc6
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_log_message27
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc6
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb132
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh526
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/packages_list50
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/session194
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest_1.0.bb49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/lsof/lsof_4.89.bb60
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch147
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch394
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch285
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch270
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch136
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch351
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch67
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch88
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch48
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb109
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch71
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mailx/mailx_12.5-5.bb52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.04.bb31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/configure_sed.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-gencat.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-make.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-initial.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-newline.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-overflow.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-i18n.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-nocache.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-utf8.patch61
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-confpath.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-nonascii.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-sofix.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch145
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-mandirs.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-new_sections.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-security.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch160
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-whatis2.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-compile-warnings.patch105
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-configure.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-parallel.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-whatis3.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man.1.gzbin0 -> 12323 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man.7.gzbin0 -> 6192 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/man.conf141
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man/manpath.5.gzbin0 -> 2133 bytes
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb86
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.15.bb49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest10
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb75
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mingetty/mingetty_1.08.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/minicom/minicom_2.7.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mktemp/files/disable-strip.patch15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.3.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch638
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch363
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h75
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb109
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/cross_ar.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/pie-flags.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/files/remove_slang_include.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/libnewt-python_0.52.18.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/newt/libnewt_0.52.18.bb59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb162
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb283
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/99_pam1
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/crypt_configure.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/include_paths_header.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch226
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch97
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch200
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch240
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-account25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-auth18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-password26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/other24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam/use-utmpx.patch233
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.2.1.bb171
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/Makefile285
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/no_check.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/files/syscalls.patch55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch1287
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch185
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/procps/procps/sysctl.conf64
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.11.bb66
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc44
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch51
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc_22.21.bb12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Fix-build-with-disabled-ldap.patch93
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/fcntl.patch113
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch198
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch20
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch221
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch84
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/init.d87
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf3
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket8
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb73
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-Fix-stack-overflow-due-to-too-deep-recursion.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch58
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch137
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch65
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch135
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/fix-parallel-make.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen/screen.pam2
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.3.1.bb53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest3
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch66
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.2.2.bb46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch124
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch109
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch201
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot386
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/login_defs_pam.sed32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chfn14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chpasswd4
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chsh19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/login81
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/newusers4
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/passwd5
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/su57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/securetty238
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch91
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb38
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc196
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/shadow/shadow_4.2.1.bb10
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch218
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch108
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch70
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch116
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch42
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.2.4.bb54
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/stat/stat_3.3.bb33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/stress/files/texinfo.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/stress/stress_1.0.4.bb15
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sudo/files/sudo.pam6
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.15.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch132
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch20
-rwxr-xr-ximport-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd151
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf71
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc66
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb4
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat.inc57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch62
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/99_sysstat1
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/sysstat.service12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.2.0.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch37
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar.inc52
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar/musl_dirent.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar/remove-gets.patch22
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.28.bb18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff77
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch250
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch105
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch1255
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch153
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch47
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch83
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch255
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch68
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch73
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch21
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch45
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch54
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch23
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch35
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.834
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch31
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch59
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch41
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.828
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb132
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py122
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch49
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch24
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch43
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch64
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch16
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch233
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch17
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb55
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb82
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/time/time-1.7/debian.patch1301
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/time/time.inc12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/time/time_1.7.bb11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2016c.bb25
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2016c.bb212
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch403
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch145
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch39
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch50
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch46
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch18
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb57
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch99
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch27
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch14
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch56
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.14.bb40
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.17.1.bb8
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch28
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch53
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which-2.21/automake.patch19
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb34
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb32
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch30
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch29
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.1.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch100
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch86
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch79
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch33
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch112
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf11
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.default12
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.init64
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.service13
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb77
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb36
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/zip/zip.inc26
-rw-r--r--import-layers/yocto-poky/meta/recipes-extended/zip/zip_3.0.bb18
576 files changed, 38488 insertions, 0 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch
new file mode 100644
index 000000000..53ae28b5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch
@@ -0,0 +1,57 @@
+From 7f811d9c4ebc9444e613e251c31d6bf537a24dc1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 16:35:30 -0700
+Subject: [PATCH] remove glibc assumption
+
+glibc time.h header has an undocumented __isleap macro
+that we are using anf musl is missing it.
+Since it is undocumented & does not appear
+on any other libc, stop using it and just define the macro in
+locally instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ parsetime.y | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/parsetime.y b/parsetime.y
+index 7005e88..324e6d3 100644
+--- a/parsetime.y
++++ b/parsetime.y
+@@ -8,6 +8,9 @@
+
+ #define YYDEBUG 1
+
++#define is_leap_year(y) \
++ ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
++
+ struct tm exectm;
+ static int isgmt;
+ static int yearspec;
+@@ -217,8 +220,8 @@ date : month_name day_number
+ mnum == 12) && dnum > 31)
+ || ((mnum == 4 || mnum == 6 || mnum == 9 ||
+ mnum == 11) && dnum > 30)
+- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900))
+- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900))
++ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900))
++ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900))
+ )
+ {
+ yyerror("Error in day of month");
+@@ -261,8 +264,8 @@ date : month_name day_number
+ mnum == 12) && dnum > 31)
+ || ((mnum == 4 || mnum == 6 || mnum == 9 ||
+ mnum == 11) && dnum > 30)
+- || (mnum == 2 && dnum > 29 && __isleap(ynum+1900))
+- || (mnum == 2 && dnum > 28 && !__isleap(ynum+1900))
++ || (mnum == 2 && dnum > 29 && is_leap_year(ynum+1900))
++ || (mnum == 2 && dnum > 28 && !is_leap_year(ynum+1900))
+ )
+ {
+ yyerror("Error in day of month");
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.init b/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.init
new file mode 100644
index 000000000..eca379b3c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.init
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# Starts at daemon
+#
+
+umask 077
+
+# Source function library.
+. /etc/init.d/functions
+
+start() {
+ echo -n "Starting atd: "
+ start-stop-daemon --start --quiet --pidfile /var/run/atd.pid --background --exec /usr/sbin/atd -- -f
+ echo "OK"
+}
+stop() {
+ echo -n "Stopping atd: "
+ start-stop-daemon --stop --quiet --pidfile /var/run/atd.pid
+ echo "OK"
+}
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ restart
+ ;;
+ status)
+ status /usr/sbin/atd
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $?
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.service b/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.service
new file mode 100644
index 000000000..6dc844504
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/atd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Job spooling tools
+After=syslog.target
+
+[Service]
+ExecStart=@SBINDIR@/atd -f
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch
new file mode 100644
index 000000000..1e5efef12
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-add-enable-pam.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+--- at-3.1.12/configure.ac 2011-06-23 14:51:03.653572945 +0800
++++ at-3.1.12/configure.ac.new 2011-06-27 16:12:14.903572945 +0800
+@@ -81,10 +81,18 @@
+ AC_FUNC_VPRINTF
+ AC_FUNC_GETLOADAVG
+ AC_CHECK_FUNCS(getcwd mktime strftime setreuid setresuid sigaction waitpid)
++
++AC_ARG_WITH([pam],
++ [AS_HELP_STRING([--without-pam], [without PAM support])])
++
++if test "x$with_pam" != xno; then
+ AC_CHECK_HEADERS(security/pam_appl.h, [
+ PAMLIB="-lpam"
+- AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support])
+-])
++ AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support])],
++ [if test "x$with_pam" = xyes; then
++ AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
++ fi])
++fi
+
+ dnl Checking for programs
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-fix-with-without-selinux.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-fix-with-without-selinux.patch
new file mode 100644
index 000000000..389af1e07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/configure-fix-with-without-selinux.patch
@@ -0,0 +1,53 @@
+From c02354af7f3d9426da31503abfae70952c699a9d Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Fri, 18 Mar 2016 03:23:11 -0400
+Subject: [PATCH] configure: fix with/without selinux
+
+Problem:
+without-selinux doesn't work since WITH_SELINUX is always be defined no
+matter which option is given: with-selinux, without-selinux.
+
+Fix:
+Disable selinux support if without-selinux is given; otherwise check
+libselinux to determine if selinux support should be enabled.
+
+Upstream-Status: Submitted [at@packages.debian.org]
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure.ac | 19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5a43419..8c9de62 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -240,10 +240,21 @@ AC_ARG_WITH(daemon_username,
+ AC_SUBST(DAEMON_USERNAME)
+
+ AC_ARG_WITH(selinux,
+-[ --with-selinux Define to run with selinux],
+-AC_DEFINE(WITH_SELINUX, 1, [Define if you are building with_selinux]),
+-)
+-AC_CHECK_LIB(selinux, is_selinux_enabled, SELINUXLIB=-lselinux)
++[ --with-selinux Define to run with selinux (default=check)],
++[],
++[with_selinux=check])
++
++if test "x$with_selinux" != xno; then
++ AC_CHECK_LIB([selinux], [is_selinux_enabled],
++ [SELINUXLIB=-lselinux
++ AC_DEFINE(WITH_SELINUX, 1, [Define if you are building with_selinux])
++ ],
++ [if test "x$with_selinux" != xcheck; then
++ AC_MSG_FAILURE([--with-selinux is given, but test for selinux failed])
++ fi
++ ]
++ )
++fi
+ AC_SUBST(SELINUXLIB)
+ AC_SUBST(WITH_SELINUX)
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch
new file mode 100644
index 000000000..d5ef0032b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [licensing]
+
+posixtm.[ch] files are replaced with gplv2 version from these locations:
+
+http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.c;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba
+http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.h;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba
+
+update the Copyright file information to reflect the replaced files.
+
+Date: 2010/08/31
+Nitin A Kamble nitin.a.kamble@intel.com
+
+Index: at-3.1.12/Copyright
+===================================================================
+--- at-3.1.12.orig/Copyright
++++ at-3.1.12/Copyright
+@@ -31,10 +31,10 @@ The files posixtm.c and posixtm.h have t
+ Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006, 2007 Free Software Foundation Inc.
+
+- This program is free software: you can redistribute it and/or modify
++ 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.
++ the Free Software Foundation; either version 2, 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
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch
new file mode 100644
index 000000000..100f8898e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/fix_parallel_build_error.patch
@@ -0,0 +1,35 @@
+make -j was failing sometimesa like this
+| ccache i586-poky-linux-gcc -march=i586 --sysroot=/home/nitin/build/build0/tmp/sysroots/i586-poky-linux -I. -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -o atd atd.o daemon.o -lfl -lpam -Wl,-O1 -Wl,--as-needed
+| parsetime.l:5:19: fatal error: y.tab.h: No such file or directory
+| compilation terminated.
+| make: *** [lex.yy.o] Error 1
+| make: *** Waiting for unfinished jobs....
+
+Fixed the issue by adding a dependency in the makefile.
+Nitin <nitin.a.kamble@intel.com>
+2010/09/02
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+---
+ Makefile.in | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index dd3c2f8..7897e45 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -82,6 +82,8 @@ y.tab.c y.tab.h: parsetime.y
+ lex.yy.c: parsetime.l
+ $(LEX) -i parsetime.l
+
++parsetime.l: y.tab.h
++
+ atd.service: atd.service.in
+ sed -e 's![@]sbindir[@]!$(sbindir)!g' < $< > $@
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch
new file mode 100644
index 000000000..932a4c0bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/makefile-fix-parallel.patch
@@ -0,0 +1,35 @@
+From 150b63a936af71b992a3a7b0fc2d2497e51fc800 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 28 Jan 2015 23:52:00 -0800
+Subject: [PATCH] Makefile: fix for parallel build
+
+Fixed:
+y.tab.c:1001:0: error: unterminated #if
+
+Let "$(YACC) -d parsetime.y" only run once will fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 2a9b918..aa7c04a 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -75,7 +75,9 @@ at: $(ATOBJECTS)
+ atd: $(RUNOBJECTS)
+ $(CC) $(LDFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(PAMLIB)
+
+-y.tab.c y.tab.h: parsetime.y
++y.tab.h: y.tab.c
++
++y.tab.c: parsetime.y
+ $(YACC) -d parsetime.y
+
+ lex.yy.c: parsetime.l
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/pam.conf.patch b/import-layers/yocto-poky/meta/recipes-extended/at/at/pam.conf.patch
new file mode 100644
index 000000000..b5ceb9ae8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/pam.conf.patch
@@ -0,0 +1,27 @@
+oe doesn't support "@include", use the concrete directive instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+Index: at-3.1.15/pam.conf
+===================================================================
+--- at-3.1.15.orig/pam.conf
++++ at-3.1.15/pam.conf
+@@ -1,10 +1,11 @@
+ #
+ # The PAM configuration file for the at daemon
+ #
++
++auth required pam_env.so
++auth include common-auth
++account include common-account
++session include common-session-noninteractive
++session required pam_limits.so
++session required pam_loginuid.so
+
+-auth required pam_env.so
+-@include common-auth
+-@include common-account
+-session required pam_loginuid.so
+-@include common-session-noninteractive
+-session required pam_limits.so
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.c b/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.c
new file mode 100644
index 000000000..5514ba4fe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.c
@@ -0,0 +1,328 @@
+/* Parse dates for touch and date.
+
+ Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004,
+ 2005, 2006, 2007 Free Software Foundation Inc.
+
+ 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 2, 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, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Yacc-based version written by Jim Kingdon and David MacKenzie.
+ Rewritten by Jim Meyering. */
+
+#include <config.h>
+
+#include "posixtm.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <string.h>
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+/* ISDIGIT differs from isdigit, as follows:
+ - Its arg may be any int or unsigned int; it need not be an unsigned char
+ or EOF.
+ - It's typically faster.
+ POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
+ isdigit unless it's important to use the locale's definition
+ of `digit' even when the host does not conform to POSIX. */
+#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+time_t mktime ();
+
+/*
+ POSIX requires:
+
+ touch -t [[CC]YY]mmddhhmm[.ss] FILE...
+ 8, 10, or 12 digits, followed by optional .ss
+ (PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS)
+
+ touch mmddhhmm[YY] FILE... (obsoleted by POSIX 1003.1-2001)
+ 8 or 10 digits, YY (if present) must be in the range 69-99
+ (PDS_TRAILING_YEAR | PDS_PRE_2000)
+
+ date mmddhhmm[[CC]YY]
+ 8, 10, or 12 digits
+ (PDS_TRAILING_YEAR | PDS_CENTURY)
+
+*/
+
+static int
+year (struct tm *tm, const int *digit_pair, size_t n, unsigned int syntax_bits)
+{
+ switch (n)
+ {
+ case 1:
+ tm->tm_year = *digit_pair;
+ /* Deduce the century based on the year.
+ POSIX requires that 00-68 be interpreted as 2000-2068,
+ and that 69-99 be interpreted as 1969-1999. */
+ if (digit_pair[0] <= 68)
+ {
+ if (syntax_bits & PDS_PRE_2000)
+ return 1;
+ tm->tm_year += 100;
+ }
+ break;
+
+ case 2:
+ if (! (syntax_bits & PDS_CENTURY))
+ return 1;
+ tm->tm_year = digit_pair[0] * 100 + digit_pair[1] - 1900;
+ break;
+
+ case 0:
+ {
+ time_t now;
+ struct tm *tmp;
+
+ /* Use current year. */
+ time (&now);
+ tmp = localtime (&now);
+ if (! tmp)
+ return 1;
+ tm->tm_year = tmp->tm_year;
+ }
+ break;
+
+ default:
+ abort ();
+ }
+
+ return 0;
+}
+
+static int
+posix_time_parse (struct tm *tm, const char *s, unsigned int syntax_bits)
+{
+ const char *dot = NULL;
+ int pair[6];
+ int *p;
+ size_t i;
+
+ size_t s_len = strlen (s);
+ size_t len = (((syntax_bits & PDS_SECONDS) && (dot = strchr (s, '.')))
+ ? (size_t) (dot - s)
+ : s_len);
+
+ if (len != 8 && len != 10 && len != 12)
+ return 1;
+
+ if (dot)
+ {
+ if (!(syntax_bits & PDS_SECONDS))
+ return 1;
+
+ if (s_len - len != 3)
+ return 1;
+ }
+
+ for (i = 0; i < len; i++)
+ if (!ISDIGIT (s[i]))
+ return 1;
+
+ len /= 2;
+ for (i = 0; i < len; i++)
+ pair[i] = 10 * (s[2*i] - '0') + s[2*i + 1] - '0';
+
+ p = pair;
+ if (syntax_bits & PDS_LEADING_YEAR)
+ {
+ if (year (tm, p, len - 4, syntax_bits))
+ return 1;
+ p += len - 4;
+ len = 4;
+ }
+
+ /* Handle 8 digits worth of `MMDDhhmm'. */
+ tm->tm_mon = *p++ - 1;
+ tm->tm_mday = *p++;
+ tm->tm_hour = *p++;
+ tm->tm_min = *p++;
+ len -= 4;
+
+ /* Handle any trailing year. */
+ if (syntax_bits & PDS_TRAILING_YEAR)
+ {
+ if (year (tm, p, len, syntax_bits))
+ return 1;
+ }
+
+ /* Handle seconds. */
+ if (!dot)
+ {
+ tm->tm_sec = 0;
+ }
+ else
+ {
+ int seconds;
+
+ ++dot;
+ if (!ISDIGIT (dot[0]) || !ISDIGIT (dot[1]))
+ return 1;
+ seconds = 10 * (dot[0] - '0') + dot[1] - '0';
+
+ tm->tm_sec = seconds;
+ }
+
+ return 0;
+}
+
+/* Parse a POSIX-style date, returning true if successful. */
+
+bool
+posixtime (time_t *p, const char *s, unsigned int syntax_bits)
+{
+ struct tm tm0
+#ifdef lint
+ /* Placate gcc-4's -Wuninitialized.
+ posix_time_parse fails to set all of tm0 only when it returns
+ nonzero (due to year() returning nonzero), and in that case,
+ this code doesn't use the tm0 at all. */
+ = { 0, }
+#endif
+ ;
+ struct tm tm1;
+ struct tm const *tm;
+ time_t t;
+
+ if (posix_time_parse (&tm0, s, syntax_bits))
+ return false;
+
+ tm1 = tm0;
+ tm1.tm_isdst = -1;
+ t = mktime (&tm1);
+
+ if (t != (time_t) -1)
+ tm = &tm1;
+ else
+ {
+ /* mktime returns -1 for errors, but -1 is also a valid time_t
+ value. Check whether an error really occurred. */
+ tm = localtime (&t);
+ if (! tm)
+ return false;
+ }
+
+ /* Reject dates like "September 31" and times like "25:61". */
+ if ((tm0.tm_year ^ tm->tm_year)
+ | (tm0.tm_mon ^ tm->tm_mon)
+ | (tm0.tm_mday ^ tm->tm_mday)
+ | (tm0.tm_hour ^ tm->tm_hour)
+ | (tm0.tm_min ^ tm->tm_min)
+ | (tm0.tm_sec ^ tm->tm_sec))
+ return false;
+
+ *p = t;
+ return true;
+}
+
+#ifdef TEST_POSIXTIME
+/*
+ Test mainly with syntax_bits == 13
+ (aka: (PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS))
+
+ This test data assumes Universal Time, e.g., TZ="UTC0".
+
+ This test data also assumes that time_t is signed and is at least
+ 39 bits wide, so that it can represent all years from 0000 through
+ 9999. A host with 32-bit signed time_t can represent only time
+ stamps in the range 1901-12-13 20:45:52 through 2038-01-18
+ 03:14:07 UTC, assuming POSIX time_t with no leap seconds, so test
+ cases outside this range will not work on such a host.
+
+ Also, the first two lines of test data assume that the current
+ year is 2002.
+
+BEGIN-DATA
+12131415.16 13 1039788916 Fri Dec 13 14:15:16 2002
+12131415.16 13 1039788916 Fri Dec 13 14:15:16 2002
+000001010000.00 13 -62167132800 Sun Jan 1 00:00:00 0000
+190112132045.52 13 -2147483648 Fri Dec 13 20:45:52 1901
+190112132045.53 13 -2147483647 Fri Dec 13 20:45:53 1901
+190112132046.52 13 -2147483588 Fri Dec 13 20:46:52 1901
+190112132145.52 13 -2147480048 Fri Dec 13 21:45:52 1901
+190112142045.52 13 -2147397248 Sat Dec 14 20:45:52 1901
+190201132045.52 13 -2144805248 Mon Jan 13 20:45:52 1902
+196912312359.59 13 -1 Wed Dec 31 23:59:59 1969
+197001010000.00 13 0 Thu Jan 1 00:00:00 1970
+197001010000.01 13 1 Thu Jan 1 00:00:01 1970
+197001010001.00 13 60 Thu Jan 1 00:01:00 1970
+197001010100.00 13 3600 Thu Jan 1 01:00:00 1970
+197001020000.00 13 86400 Fri Jan 2 00:00:00 1970
+197002010000.00 13 2678400 Sun Feb 1 00:00:00 1970
+197101010000.00 13 31536000 Fri Jan 1 00:00:00 1971
+197001000000.00 13 * *
+197000010000.00 13 * *
+197001010000.60 13 * *
+197001010060.00 13 * *
+197001012400.00 13 * *
+197001320000.00 13 * *
+197013010000.00 13 * *
+203801190314.06 13 2147483646 Tue Jan 19 03:14:06 2038
+203801190314.07 13 2147483647 Tue Jan 19 03:14:07 2038
+203801190314.08 13 2147483648 Tue Jan 19 03:14:08 2038
+999912312359.59 13 253402300799 Fri Dec 31 23:59:59 9999
+1112131415 13 1323785700 Tue Dec 13 14:15:00 2011
+1112131415.16 13 1323785716 Tue Dec 13 14:15:16 2011
+201112131415.16 13 1323785716 Tue Dec 13 14:15:16 2011
+191112131415.16 13 -1831974284 Wed Dec 13 14:15:16 1911
+203712131415.16 13 2144326516 Sun Dec 13 14:15:16 2037
+3712131415.16 13 2144326516 Sun Dec 13 14:15:16 2037
+6812131415.16 13 3122633716 Thu Dec 13 14:15:16 2068
+6912131415.16 13 -1590284 Sat Dec 13 14:15:16 1969
+7012131415.16 13 29945716 Sun Dec 13 14:15:16 1970
+1213141599 2 945094500 Mon Dec 13 14:15:00 1999
+1213141500 2 976716900 Wed Dec 13 14:15:00 2000
+END-DATA
+
+*/
+
+# define MAX_BUFF_LEN 1024
+
+int
+main (void)
+{
+ char buff[MAX_BUFF_LEN + 1];
+
+ buff[MAX_BUFF_LEN] = 0;
+ while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
+ {
+ char time_str[MAX_BUFF_LEN];
+ unsigned int syntax_bits;
+ time_t t;
+ if (sscanf (buff, "%s %u", time_str, &syntax_bits) != 2)
+ printf ("*\n");
+ else
+ {
+ printf ("%-15s %2u ", time_str, syntax_bits);
+ if (posixtime (&t, time_str, syntax_bits))
+ printf ("%12ld %s", (long int) t, ctime (&t));
+ else
+ printf ("%12s %s", "*", "*\n");
+ }
+ }
+ exit (0);
+
+}
+#endif
+
+/*
+Local Variables:
+compile-command: "gcc -DTEST_POSIXTIME -g -O -Wall -W posixtm.c"
+End:
+*/
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.h b/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.h
new file mode 100644
index 000000000..e91749d73
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at/posixtm.h
@@ -0,0 +1,37 @@
+/* Parse dates for touch and date.
+
+ Copyright (C) 1998, 2003, 2005, 2007 Free Software Foundation Inc.
+
+ 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 2, 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, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Yacc-based version written by Jim Kingdon and David MacKenzie.
+ Rewritten by Jim Meyering. */
+
+#ifndef POSIXTM_H_
+# define POSIXTM_H_
+
+# include <stdbool.h>
+# include <time.h>
+
+/* POSIX Date Syntax flags. */
+# define PDS_LEADING_YEAR 1
+# define PDS_TRAILING_YEAR 2
+# define PDS_CENTURY 4
+# define PDS_SECONDS 8
+# define PDS_PRE_2000 16
+
+bool posixtime (time_t *p, const char *s, unsigned int syntax_bits);
+
+#endif
diff --git a/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.18.bb b/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.18.bb
new file mode 100644
index 000000000..93044f53e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/at/at_3.1.18.bb
@@ -0,0 +1,70 @@
+SUMMARY = "Delayed job execution and batch processing"
+DESCRIPTION = "At allows for commands to be run at a particular time. Batch will execute commands when \
+the system load levels drop to a particular level."
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
+DEPENDS = "flex flex-native \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+RDEPENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)} \
+"
+
+PAM_DEPS = "libpam libpam-runtime pam-plugin-env pam-plugin-limits"
+
+RCONFLICTS_${PN} = "atd"
+RREPLACES_${PN} = "atd"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/a/at/at_${PV}.orig.tar.gz;subdir=${BP} \
+ file://fix_parallel_build_error.patch \
+ file://posixtm.c \
+ file://posixtm.h \
+ file://file_replacement_with_gplv2.patch \
+ file://atd.init \
+ file://atd.service \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+ file://makefile-fix-parallel.patch \
+ file://0001-remove-glibc-assumption.patch \
+ file://configure-fix-with-without-selinux.patch \
+ "
+
+PAM_SRC_URI = "file://pam.conf.patch \
+ file://configure-add-enable-pam.patch"
+
+SRC_URI[md5sum] = "f67a7aab557cd5b4a1311079a08acebe"
+SRC_URI[sha256sum] = "dbd5c8cb8edd53ef467363c3af0391c08769f1dbbd4d5002c59a4cd4cac11d52"
+
+EXTRA_OECONF += "ac_cv_path_SENDMAIL=/bin/true \
+ --with-daemon_username=root \
+ --with-daemon_groupname=root \
+ --with-jobdir=/var/spool/at/jobs \
+ --with-atspool=/var/spool/at/spool \
+ ac_cv_header_security_pam_appl_h=${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} "
+
+inherit autotools-brokensep systemd update-rc.d
+
+INITSCRIPT_NAME = "atd"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "atd.service"
+
+copy_sources() {
+ cp -f ${WORKDIR}/posixtm.[ch] ${S}
+}
+do_patch[postfuncs] += "copy_sources"
+
+do_install () {
+ oe_runmake -e "IROOT=${D}" install
+
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/atd.init ${D}${sysconfdir}/init.d/atd
+
+ # install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/atd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/atd.service
+
+ if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+ install -D -m 0644 ${WORKDIR}/${BP}/pam.conf ${D}${sysconfdir}/pam.d/atd
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas.inc b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas.inc
new file mode 100644
index 000000000..23d12cadf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas.inc
@@ -0,0 +1,30 @@
+SUMMARY = "Augeas configuration API"
+HOMEPAGE = "http://augeas.net/"
+BUGTRACKER = "https://fedorahosted.org/augeas/report/1"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbb461211a33b134d42ed5ee802b37ff"
+
+SRC_URI = "http://download.augeas.net/${BP}.tar.gz \
+ file://add-missing-argz-conditional.patch \
+ file://sepbuildfix.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ "
+
+DEPENDS = "readline libxml2"
+
+inherit autotools pkgconfig
+
+PACKAGES =+ "${PN}-lenses lib${BPN}"
+
+FILES_${PN}-lenses = "${datadir}/augeas/lenses"
+FILES_lib${BPN} = "${libdir}/lib*${SOLIBS}"
+
+RDEPENDS_lib${BPN} += "${PN}-lenses"
+RRECOMMENDS_lib${BPN} += "${PN}"
+
+LEAD_SONAME = "libaugeas.so"
+
+do_install_append() {
+ rm -fr ${D}${datadir}/vim
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..9a19876aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: augeas-1.2.0/gnulib/lib/Makefile.am
+===================================================================
+--- augeas-1.2.0.orig/gnulib/lib/Makefile.am
++++ augeas-1.2.0/gnulib/lib/Makefile.am
+@@ -463,7 +463,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch
new file mode 100644
index 000000000..abbdbaa63
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch
@@ -0,0 +1,20 @@
+Add missing GL_GENERATE_ARGZ_H conditional
+
+- GL_GENERATE_ARGZ_H is used in gnulib/lib/Makefile.am
+
+Upstream-Status: Pending
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: augeas-1.0.0/configure.ac
+===================================================================
+--- augeas-1.0.0.orig/configure.ac
++++ augeas-1.0.0/configure.ac
+@@ -55,6 +55,8 @@ AC_ARG_WITH([failmalloc],
+
+ AM_CONDITIONAL([WITH_FAILMALLOC], [test x$with_failmalloc != xno])
+
++AM_CONDITIONAL([GL_GENERATE_ARGZ_H], [test -n "$ARGZ_H"])
++
+ dnl --enable-debug=(yes|no)
+ AC_ARG_ENABLE([debug],
+ [AC_HELP_STRING([--enable-debug=no/yes],
diff --git a/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/sepbuildfix.patch b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/sepbuildfix.patch
new file mode 100644
index 000000000..b82a3ee2c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas/sepbuildfix.patch
@@ -0,0 +1,22 @@
+Ensure that builds in separate builddirs (${B} != ${S}) correctly install the
+lenses files.
+
+Upstream-Status: Pending
+
+RP 2013/4/17
+
+Index: augeas-1.0.0/Makefile.am
+===================================================================
+--- augeas-1.0.0.orig/Makefile.am 2012-11-02 15:20:11.000000000 +0000
++++ augeas-1.0.0/Makefile.am 2013-04-17 10:36:24.033400125 +0000
+@@ -5,8 +5,8 @@
+ lensdir=$(datadir)/augeas/lenses/dist
+ lenstestdir=$(datadir)/augeas/lenses/dist/tests
+
+-dist_lens_DATA=$(wildcard lenses/*.aug)
+-dist_lenstest_DATA=$(wildcard lenses/tests/*.aug)
++dist_lens_DATA=$(wildcard $(top_srcdir)/lenses/*.aug)
++dist_lenstest_DATA=$(wildcard $(top_srcdir)lenses/tests/*.aug)
+
+ EXTRA_DIST=augeas.spec build/aux/move-if-change Makefile.am HACKING
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas_1.4.0.bb b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas_1.4.0.bb
new file mode 100644
index 000000000..1064ad4f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/augeas/augeas_1.4.0.bb
@@ -0,0 +1,4 @@
+require augeas.inc
+
+SRC_URI[md5sum] = "a2536a9c3d744dc09d234228fe4b0c93"
+SRC_URI[sha256sum] = "659fae7ac229029e60a869a3b88c616cfd51cf2fba286cdfe3af3a052cb35b30"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch
new file mode 100644
index 000000000..91341ee69
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch
@@ -0,0 +1,44 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -dNaur bash-3.2.48/Makefile.in.orig bash-3.2.48/Makefile.in
+--- bash-3.2.48/Makefile.in.orig 2006-08-17 23:03:35.000000000 +0500
++++ bash-3.2.48/Makefile.in 2013-07-02 20:20:07.512709327 +0500
+@@ -803,17 +803,31 @@
+ fi
+
+ recho$(EXEEXT): $(SUPPORT_SRC)recho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) -o $@ $<
+
+ zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) -o $@ $<
+
+ printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) -o $@ $<
+
+-test tests check: force $(Program) $(TESTS_SUPPORT)
++test tests check:
++ @$(MAKE) install-test
++ @$(MAKE) runtest
++
++install-test: buildtest
++ifeq ($(origin INSTALL_TEST_DIR), undefined)
+ @-test -d tests || mkdir tests
+ @cp $(TESTS_SUPPORT) tests
++else
++ @-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
++ @cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
++ @cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
++endif
++
++buildtest: force $(Program) $(TESTS_SUPPORT)
++
++runtest:
+ @( cd $(srcdir)/tests && \
+ PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
new file mode 100644
index 000000000..ee756dc9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
@@ -0,0 +1,33 @@
+From 933bd886af49667e88e2385409449ab598813dab Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Wed, 15 Jul 2015 00:54:33 -0700
+Subject: [PATCH] dont include target CFLAGS in host LDFLAGS
+
+Building the host tool 'mkbuiltins' will fail if the target CFLAGS
+contains an option which isn't supported by the host's gcc. To prevent
+the issue, define LDFLAGS_FOR_BUILD based on CFLAGS_FOR_BUILD instead
+of CFLAGS.
+
+Upstream-Status: Inappropriate [required for bash 3.2.57 (GPLv2) recipe only]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ builtins/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builtins/Makefile.in b/builtins/Makefile.in
+index e027f7a..ebfddf3 100644
+--- a/builtins/Makefile.in
++++ b/builtins/Makefile.in
+@@ -63,7 +63,7 @@ LOCAL_DEFS = @LOCAL_DEFS@
+
+ LIBS = @LIBS@
+ LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS)
+-LDFLAGS_FOR_BUILD = $(LDFLAGS)
++LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD)
+ LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
+ #LIBS_FOR_BUILD = @LIBS_FOR_BUILD@
+ LIBS_FOR_BUILD = $(LIBS)
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch
new file mode 100644
index 000000000..c4229a7ed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch
@@ -0,0 +1,29 @@
+On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by
+the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers
+use the STRING() macro from unistd.h. A header in the bash sources overrides
+the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the
+wrappers to generate calls to 'xread' and 'xopen', which do not exist,
+resulting in a failure to link.
+
+Assume we have stringize support when cross-compiling, which works around the
+issue.
+
+It may be best for upstream to either give up on supporting compilers without
+stringize support, or to not define STRING() at all when FORTIFY_SOURCES is
+defined, letting the unistd.h one be used, instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+--- bash-4.2.orig/builtins/mkbuiltins.c
++++ bash-4.2/builtins/mkbuiltins.c
+@@ -28,6 +28,7 @@
+ # define HAVE_STDLIB_H
+
+ # define HAVE_RENAME
++# define HAVE_STRINGIZE
+ #endif /* CROSS_COMPILING */
+
+ #if defined (HAVE_UNISTD_H)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/run-ptest
new file mode 100644
index 000000000..8dd3b9981
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k THIS_SH=/bin/bash BUILD_DIR=. runtest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/test-output.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/test-output.patch
new file mode 100644
index 000000000..2b09b7d97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash-3.2.48/test-output.patch
@@ -0,0 +1,25 @@
+Add FAIL/PASS output to test output.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tests/run-all b/tests/run-all
+--- a/tests/run-all 1999-10-08 17:07:46.000000000 +0200
++++ b/tests/run-all 2012-10-27 21:04:18.663331887 +0200
+@@ -22,7 +22,15 @@
+ case $x in
+ $0|run-minimal|run-gprof) ;;
+ *.orig|*~) ;;
+- *) echo $x ; sh $x ;;
++ *) echo $x
++ output=`sh $x`
++ if [ -n "$output" ]; then
++ echo "$output"
++ echo "FAIL: $x"
++ else
++ echo "PASS: $x"
++ fi
++ ;;
+ esac
+ done
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc b/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc
new file mode 100644
index 000000000..93ca00b25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash.inc
@@ -0,0 +1,65 @@
+SUMMARY = "An sh-compatible command language interpreter"
+HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
+SECTION = "base/shell"
+
+DEPENDS = "ncurses bison-native"
+
+inherit autotools gettext texinfo update-alternatives ptest
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+EXTRA_OECONF = "--enable-job-control --without-bash-malloc"
+
+# If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
+# startup files, even if they are not interactive.
+# This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137.
+CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS"
+
+ALTERNATIVE_${PN} = "sh"
+ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
+ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash"
+ALTERNATIVE_PRIORITY = "100"
+
+RDEPENDS_${PN} += "base-files"
+RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-ptest += "make"
+
+USERADD_PACKAGES = "${PN}-ptest"
+USERADD_PARAM_${PN}-ptest = "--create-home --user-group test"
+
+do_configure_prepend () {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+ fi
+}
+
+do_compile_ptest () {
+ oe_runmake buildtest
+}
+
+do_install_append () {
+ # Move /usr/bin/bash to /bin/bash, if need
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ mkdir -p ${D}${base_bindir}
+ mv ${D}${bindir}/bash ${D}${base_bindir}
+ fi
+}
+do_install_append_class-target () {
+ # Clean host path in bashbug
+ sed -i -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
+ -e "s,-I${WORKDIR}/\S* ,,g" ${D}${bindir}/bashbug
+}
+
+do_install_ptest () {
+ make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
+ cp ${B}/Makefile ${D}${PTEST_PATH}
+ sed -i -e 's/^Makefile/_Makefile/' -e "s,--sysroot=${STAGING_DIR_TARGET},,g" \
+ -e "s,${S},,g" -e "s,${B},,g" -e "s,${STAGING_DIR_NATIVE},,g" ${D}${PTEST_PATH}/Makefile
+}
+
+pkg_postinst_${PN} () {
+ grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+ printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch
new file mode 100644
index 000000000..73a81b60d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/build-tests.patch
@@ -0,0 +1,55 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Upstream-Status: Pending
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -848,20 +848,34 @@ maybe-clean:
+ fi
+
+ recho$(EXEEXT): $(SUPPORT_SRC)recho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+ zecho$(EXEEXT): $(SUPPORT_SRC)zecho.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+ printenv$(EXEEXT): $(SUPPORT_SRC)printenv.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+ xcase$(EXEEXT): $(SUPPORT_SRC)xcase.c
+- @$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD}
++ @$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+
+-test tests check: force $(Program) $(TESTS_SUPPORT)
++test tests check:
++ @$(MAKE) install-test
++ @$(MAKE) runtest
++
++install-test: buildtest
++ifeq ($(origin INSTALL_TEST_DIR), undefined)
+ @-test -d tests || mkdir tests
+ @cp $(TESTS_SUPPORT) tests
++else
++ @-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
++ @cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
++ @cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
++endif
++
++buildtest: force $(Program) $(TESTS_SUPPORT)
++
++runtest:
+ @( cd $(srcdir)/tests && \
+ PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
+
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch
new file mode 100644
index 000000000..81f8f0a9c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/execute_cmd.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+--- execute_cmd.c.orig Fri Jun 3 13:34:42 2011
++++ execute_cmd.c Fri Jun 3 13:36:41 2011
+@@ -2202,7 +2202,11 @@
+ /* If the `lastpipe' option is set with shopt, and job control is not
+ enabled, execute the last element of non-async pipelines in the
+ current shell environment. */
+- if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
++ if (lastpipe_opt &&
++#if defined(JOB_CONTROL)
++ job_control == 0 &&
++#endif
++ asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
+ {
+ lstdin = move_to_high_fd (0, 0, 255);
+ if (lstdin > 0)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch
new file mode 100644
index 000000000..7f099ae0c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch
@@ -0,0 +1,169 @@
+From 2c30dff8ea8b17ad5ba9881e35ad1eba9c515f13 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 26 Nov 2015 22:09:07 -0500
+Subject: [PATCH] fix run-coproc/run-heredoc/run-execscript/run-test/ failed
+
+FAIL: run-coproc
+update test case:tests/coproc.right, tests/coproc.tests
+git://git.sv.gnu.org/bash.git bash-4.4-testing
+
+FAIL: run-heredoc
+update test case: tests/heredoc.right tests/heredoc3.sub
+git://git.sv.gnu.org/bash.git bash-4.4-testing
+
+FAIL: run-execscript:
+the test suite should not be run as root
+
+FAIL: run-test
+the test suite should not be run as root
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tests/coproc.right | 5 +----
+ tests/coproc.tests | 30 +++++++++++++++++++++++++-----
+ tests/heredoc.right | 5 ++---
+ tests/heredoc3.sub | 3 ++-
+ tests/run-execscript | 3 ++-
+ tests/run-test | 3 ++-
+ 6 files changed, 34 insertions(+), 15 deletions(-)
+
+diff --git a/tests/coproc.right b/tests/coproc.right
+index 6d9deaa..94b001c 100644
+--- a/tests/coproc.right
++++ b/tests/coproc.right
+@@ -1,11 +1,8 @@
+-84575
+ 63 60
+ a b c
+-84577
+ 63 60
+ flop
+-./coproc.tests: line 22: 84577 Terminated coproc REFLECT { cat -; }
+-84579
++coproc.tests: REFLECT: status 143
+ 63 60
+ FOO
+ 63 60
+diff --git a/tests/coproc.tests b/tests/coproc.tests
+index 8be3563..d347eb7 100644
+--- a/tests/coproc.tests
++++ b/tests/coproc.tests
+@@ -1,6 +1,13 @@
++: ${TMPDIR:=/tmp}
++TMPOUT=${TMPDIR}/coproc-wait-$BASHPID
++
+ coproc { echo a b c; sleep 2; }
+
+-echo $COPROC_PID
++case $COPROC_PID in
++[0-9]*) ;;
++*) echo COPROC_PID not integer ;;
++esac
++
+ echo ${COPROC[@]}
+
+ read LINE <&${COPROC[0]}
+@@ -10,7 +17,11 @@ wait $COPROC_PID
+
+ coproc REFLECT { cat - ; }
+
+-echo $REFLECT_PID
++case $REFLECT_PID in
++[0-9]*) ;;
++*) echo REFLECT_PID not integer ;;
++esac
++
+ echo ${REFLECT[@]}
+
+ echo flop >&${REFLECT[1]}
+@@ -18,12 +29,21 @@ read LINE <&${REFLECT[0]}
+
+ echo $LINE
+
+-kill $REFLECT_PID
+-wait $REFLECT_PID
++{ sleep 1; kill $REFLECT_PID; } &
++wait $REFLECT_PID >$TMPOUT 2>&1 || echo "coproc.tests: REFLECT: status $?"
++grep 'Terminated.*coproc.*REFLECT' < $TMPOUT >/dev/null 2>&1 || {
++ echo "coproc.tests: wait for REFLECT failed" >&2
++}
++rm -f $TMPOUT
++exec 2>&1
+
+ coproc xcase -n -u
+
+-echo $COPROC_PID
++case $COPROC_PID in
++[0-9]*) ;;
++*) echo COPROC_PID not integer ;;
++esac
++
+ echo ${COPROC[@]}
+
+ echo foo >&${COPROC[1]}
+diff --git a/tests/heredoc.right b/tests/heredoc.right
+index 6abaa1f..8df91c5 100644
+--- a/tests/heredoc.right
++++ b/tests/heredoc.right
+@@ -76,15 +76,14 @@ ENDEND
+ end ENDEND
+ hello
+ end hello
+-x star x
+ end x*x
+ helloEND
+ end helloEND
+ hello
+ \END
+ end hello<NL>\END
+-./heredoc3.sub: line 74: warning: here-document at line 72 delimited by end-of-file (wanted `EOF')
+-./heredoc3.sub: line 75: syntax error: unexpected end of file
++./heredoc3.sub: line 75: warning: here-document at line 73 delimited by end-of-file (wanted `EOF')
++./heredoc3.sub: line 76: syntax error: unexpected end of file
+ comsub here-string
+ ./heredoc.tests: line 105: warning: here-document at line 103 delimited by end-of-file (wanted `EOF')
+ hi
+diff --git a/tests/heredoc3.sub b/tests/heredoc3.sub
+index 73a111e..9d3d846 100644
+--- a/tests/heredoc3.sub
++++ b/tests/heredoc3.sub
+@@ -49,9 +49,10 @@ hello
+ END
+ echo end hello
+
+-cat <<x*x & touch 'x*x'
++cat <<x*x >/dev/null & touch 'x*x'
+ x star x
+ x*x
++wait $!
+ echo end 'x*x'
+ rm 'x*x'
+
+diff --git a/tests/run-execscript b/tests/run-execscript
+index f97ab21..0d00a1b 100644
+--- a/tests/run-execscript
++++ b/tests/run-execscript
+@@ -5,5 +5,6 @@ echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory"
+ echo "warning: produce diff output, please do not consider this a test failure" >&2
+ echo "warning: if diff output differing only in the location of the bash" >&2
+ echo "warning: binary appears, please do not consider this a test failure" >&2
+-${THIS_SH} ./execscript > /tmp/xx 2>&1
++rm -f /tmp/xx
++su -c "${THIS_SH} ./execscript > /tmp/xx 2>&1" test
+ diff /tmp/xx exec.right && rm -f /tmp/xx
+diff --git a/tests/run-test b/tests/run-test
+index b2482c3..2e8f049 100644
+--- a/tests/run-test
++++ b/tests/run-test
+@@ -1,4 +1,5 @@
+ unset GROUPS UID 2>/dev/null
+
+-${THIS_SH} ./test.tests >/tmp/xx 2>&1
++rm -f /tmp/xx
++su -c "${THIS_SH} ./test.tests >/tmp/xx 2>&1" test
+ diff /tmp/xx test.right && rm -f /tmp/xx
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
new file mode 100644
index 000000000..a9391d6ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
@@ -0,0 +1,26 @@
+On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by
+the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers
+use the STRING() macro from unistd.h. A header in the bash sources overrides
+the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the
+wrappers to generate calls to 'xread' and 'xopen', which do not exist,
+resulting in a failure to link.
+
+Assume we have stringize support when cross-compiling, which works around the
+issue.
+
+It may be best for upstream to either give up on supporting compilers without
+stringize support, or to not define STRING() at all when FORTIFY_SOURCES is
+defined, letting the unistd.h one be used, instead.
+
+Upstream-Status: Pending
+
+--- bash-4.2.orig/builtins/mkbuiltins.c
++++ bash-4.2/builtins/mkbuiltins.c
+@@ -28,6 +28,7 @@
+ # define HAVE_STDLIB_H
+
+ # define HAVE_RENAME
++# define HAVE_STRINGIZE
+ #endif /* CROSS_COMPILING */
+
+ #if defined (HAVE_UNISTD_H)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest
new file mode 100644
index 000000000..2098fa46b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k THIS_SH=/bin/bash BUILD_DIR=`pwd` srcdir=`pwd` runtest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch
new file mode 100644
index 000000000..2b09b7d97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash/test-output.patch
@@ -0,0 +1,25 @@
+Add FAIL/PASS output to test output.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tests/run-all b/tests/run-all
+--- a/tests/run-all 1999-10-08 17:07:46.000000000 +0200
++++ b/tests/run-all 2012-10-27 21:04:18.663331887 +0200
+@@ -22,7 +22,15 @@
+ case $x in
+ $0|run-minimal|run-gprof) ;;
+ *.orig|*~) ;;
+- *) echo $x ; sh $x ;;
++ *) echo $x
++ output=`sh $x`
++ if [ -n "$output" ]; then
++ echo "$output"
++ echo "FAIL: $x"
++ else
++ echo "PASS: $x"
++ fi
++ ;;
+ esac
+ done
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.48.bb b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.48.bb
new file mode 100644
index 000000000..d42b292b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_3.2.48.bb
@@ -0,0 +1,46 @@
+require bash.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd5d9bcabd8ed5a54a01ce8d183d592a"
+
+PR = "r11"
+
+SRC_URI = "${GNU_MIRROR}/bash/bash-${PV}.tar.gz;name=tarball \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-049;apply=yes;striplevel=0;name=patch049 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-050;apply=yes;striplevel=0;name=patch050 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-051;apply=yes;striplevel=0;name=patch051 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-052;apply=yes;striplevel=0;name=patch052 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-053;apply=yes;striplevel=0;name=patch053 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-054;apply=yes;striplevel=0;name=patch054 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-055;apply=yes;striplevel=0;name=patch055 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-056;apply=yes;striplevel=0;name=patch056 \
+ ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-057;apply=yes;striplevel=0;name=patch057 \
+ file://mkbuiltins_have_stringize.patch \
+ file://build-tests.patch \
+ file://test-output.patch \
+ file://run-ptest \
+ file://dont-include-target-CFLAGS-in-host-LDFLAGS.patch \
+ "
+
+SRC_URI[tarball.md5sum] = "338dcf975a93640bb3eaa843ca42e3f8"
+SRC_URI[tarball.sha256sum] = "128d281bd5682ba5f6953122915da71976357d7a76490d266c9173b1d0426348"
+SRC_URI[patch049.md5sum] = "af571a2d164d5abdcae4499e94e8892c"
+SRC_URI[patch049.sha256sum] = "b1217ed94bdb95dc878fa5cabbf8a164435eb0d9da23a392198f48566ee34a2f"
+SRC_URI[patch050.md5sum] = "8443d4385d73ec835abe401d90591377"
+SRC_URI[patch050.sha256sum] = "081bb03c580ecee63ba03b40beb3caf509eca29515b2e8dd3c078503609a1642"
+SRC_URI[patch051.md5sum] = "15c6653042e9814aa87120098fc7a849"
+SRC_URI[patch051.sha256sum] = "354886097cd95b4def77028f32ee01e2e088d58a98184fede9d3ce9320e218ef"
+SRC_URI[patch052.md5sum] = "691023a944bbb9003cc92ad462d91fa1"
+SRC_URI[patch052.sha256sum] = "a0eccf9ceda50871db10d21efdd74b99e35efbd55c970c400eeade012816bb61"
+SRC_URI[patch053.md5sum] = "eb97d1c9230a55283d9dac69d3de2e46"
+SRC_URI[patch053.sha256sum] = "fe6f0e96e0b966eaed9fb5e930ca12891f4380f30f9e0a773d200ff2063a864e"
+SRC_URI[patch054.md5sum] = "1107744058c43b247f597584b88ba0a6"
+SRC_URI[patch054.sha256sum] = "c6dab911e85688c542ce75afc175dbb4e5011de5102758e19a4a80dac1e79359"
+SRC_URI[patch055.md5sum] = "05d201176d3499e2dfa4a73d09d42f05"
+SRC_URI[patch055.sha256sum] = "c0e816700837942ed548da74e5917f74b70cbbbb10c9f2caf73e8e06a0713d0a"
+SRC_URI[patch056.md5sum] = "222eaa3a2c26f54a15aa5e08817a534a"
+SRC_URI[patch056.sha256sum] = "063a8d8d74e4407bf07a32b965b8ef6d213a66abdb6af26cc3584a437a56bbb4"
+SRC_URI[patch057.md5sum] = "47d98e3e042892495c5efe54ec6e5913"
+SRC_URI[patch057.sha256sum] = "5fc689394d515990f5ea74e2df765fc6e5e42ca44b4591b2c6f9be4b0cadf0f0"
+
+PARALLEL_MAKE = ""
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb
new file mode 100644
index 000000000..4426cf00a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bash/bash_4.3.30.bb
@@ -0,0 +1,47 @@
+require bash.inc
+
+# GPLv2+ (< 4.0), GPLv3+ (>= 4.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-031;apply=yes;striplevel=0;name=patch031 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-032;apply=yes;striplevel=0;name=patch032 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-033;apply=yes;striplevel=0;name=patch033 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-034;apply=yes;striplevel=0;name=patch034 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-035;apply=yes;striplevel=0;name=patch035 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-036;apply=yes;striplevel=0;name=patch036 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-037;apply=yes;striplevel=0;name=patch037 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-038;apply=yes;striplevel=0;name=patch038 \
+ ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-039;apply=yes;striplevel=0;name=patch039 \
+ file://execute_cmd.patch;striplevel=0 \
+ file://mkbuiltins_have_stringize.patch \
+ file://build-tests.patch \
+ file://test-output.patch \
+ file://fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch \
+ file://run-ptest \
+ "
+
+SRC_URI[tarball.md5sum] = "a27b3ee9be83bd3ba448c0ff52b28447"
+SRC_URI[tarball.sha256sum] = "317881019bbf2262fb814b7dd8e40632d13c3608d2f237800a8828fbb8a640dd"
+
+SRC_URI[patch031.md5sum] = "236df1ac1130a033ed0dbe2d2115f28f"
+SRC_URI[patch031.sha256sum] = "cd529f59dd0f2fdd49d619fe34691da6f0affedf87cc37cd460a9f3fe812a61d"
+SRC_URI[patch032.md5sum] = "2360f7e79cfb28526f80021025ea5909"
+SRC_URI[patch032.sha256sum] = "889357d29a6005b2c3308ca5b6286cb223b5e9c083219e5db3156282dd554f4a"
+SRC_URI[patch033.md5sum] = "b551c4ee7b8713759e4143499d0bbd48"
+SRC_URI[patch033.sha256sum] = "fb2a7787a13fbe027a7335aca6eb3c21cdbd813e9edc221274b6a9d8692eaa16"
+SRC_URI[patch034.md5sum] = "c9a56fbe0348e05a886dff97f2872b74"
+SRC_URI[patch034.sha256sum] = "f1694f04f110defe1330a851cc2768e7e57ddd2dfdb0e3e350ca0e3c214ff889"
+SRC_URI[patch035.md5sum] = "e564e8ab44ed1ca3a4e315a9f6cabdc9"
+SRC_URI[patch035.sha256sum] = "370d85e51780036f2386dc18c5efe996eba8e652fc1973f0f4f2ab55a993c1e3"
+SRC_URI[patch036.md5sum] = "b00ff66c41a7c0f06e191200981980b0"
+SRC_URI[patch036.sha256sum] = "ac5f82445b36efdb543dbfae64afed63f586d7574b833e9aa9cd5170bc5fd27c"
+SRC_URI[patch037.md5sum] = "be2a7b05f6ae560313f3c9d5f7127bda"
+SRC_URI[patch037.sha256sum] = "33f170dd7400ab3418d749c55c6391b1d161ef2de7aced1873451b3a3fca5813"
+SRC_URI[patch038.md5sum] = "61e0522830b24fbe8c0d1b010f132470"
+SRC_URI[patch038.sha256sum] = "adbeaa500ca7a82535f0e88d673661963f8a5fcdc7ad63445e68bf5b49786367"
+SRC_URI[patch039.md5sum] = "a4775487abe958536751c8ce53cdf6f9"
+SRC_URI[patch039.sha256sum] = "ab94dced2215541097691f60c3eb323cc28ef2549463e6a5334bbcc1e61e74ec"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bc/bc_1.06.bb b/import-layers/yocto-poky/meta/recipes-extended/bc/bc_1.06.bb
new file mode 100644
index 000000000..d8c8a860f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bc/bc_1.06.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Arbitrary precision calculator language"
+HOMEPAGE = "http://www.gnu.org/software/bc/bc.html"
+
+LICENSE = "GPLv2+ & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
+ file://bc/bcdefs.h;endline=31;md5=46dffdaf10a99728dd8ce358e45d46d8 \
+ file://dc/dc.h;endline=25;md5=2f9c558cdd80e31b4d904e48c2374328 \
+ file://lib/number.c;endline=31;md5=99434a0898abca7784acfd36b8191199"
+
+SECTION = "base"
+DEPENDS = "flex"
+PR = "r3"
+
+SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz \
+ file://fix-segment-fault.patch "
+
+SRC_URI[md5sum] = "d44b5dddebd8a7a7309aea6c36fda117"
+SRC_URI[sha256sum] = "4ef6d9f17c3c0d92d8798e35666175ecd3d8efac4009d6457b5c99cea72c0e33"
+
+inherit autotools texinfo update-alternatives
+
+ALTERNATIVE_${PN} = "dc"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bc/files/fix-segment-fault.patch b/import-layers/yocto-poky/meta/recipes-extended/bc/files/fix-segment-fault.patch
new file mode 100644
index 000000000..20c0da2eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bc/files/fix-segment-fault.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+when run command such as 'echo "a = 13" | bc -l', it segmentation faults.
+This patch is from http://www.mail-archive.com/blfs-support@linuxfromscratch.org/msg04602.html.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+--- bc-1.06/lib/number.c.orig 2003-09-26 21:14:02.000000000 +0000
++++ bc-1.06/lib/number.c 2003-09-26 21:14:26.000000000 +0000
+@@ -34,6 +34,7 @@
+ #include <number.h>
+ #include <assert.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <ctype.h>/* Prototypes needed for external utility routines. */
+
+ #define bc_rt_warn rt_warn
+--- bc-1.06/bc/load.c.orig 2003-09-26 21:14:14.000000000 +0000
++++ bc-1.06/bc/load.c 2003-09-26 21:14:26.000000000 +0000
+@@ -156,7 +156,7 @@
+ long label_no;
+ long vaf_name; /* variable, array or function number. */
+ long func;
+- program_counter save_adr;
++ static program_counter save_adr;
+
+ /* Initialize. */
+ str = code;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch
new file mode 100644
index 000000000..fee368dac
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch
@@ -0,0 +1,40 @@
+From 9cb1667f9d3a9bcfc3b83466cd8d3b79f0554ff0 Mon Sep 17 00:00:00 2001
+From: Azat Khuzhin <a3at.mail@gmail.com>
+Date: Wed, 8 Jul 2015 01:37:09 +0300
+Subject: [PATCH 1/3] fix typos in manpage
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ blktool.8 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/blktool.8 b/blktool.8
+index a1f5c96..45b7724 100644
+--- a/blktool.8
++++ b/blktool.8
+@@ -191,7 +191,7 @@ Query or set device bus state (0 off, 1 on, 2 tristate)
+ Query the detected (or overridden, via -t) device class.
+ Typically this will result in 'ATA' or 'SCSI' for most devices.
+ Detection is based on device major; thus your SATA device may appear as
+-'SCSI'.
++\&'SCSI'.
+
+ .TP
+ .B cd-speed
+@@ -237,7 +237,7 @@ Omitting the on/off argument will print the current state.
+
+ .TP
+ .B media
+-Lock in (or unlock) a removeable device.
++Lock in (or unlock) a removable device.
+
+ .TP
+ .B multiple-count
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch
new file mode 100644
index 000000000..d08aba5f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch
@@ -0,0 +1,31 @@
+From ddb1071da2c78d8155aab62e9f0d46f69500200f Mon Sep 17 00:00:00 2001
+From: Azat Khuzhin <a3at.mail@gmail.com>
+Date: Wed, 8 Jul 2015 01:42:24 +0300
+Subject: [PATCH 2/3] fix string error
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util.c b/util.c
+index 1f3a9ca..2ccf56a 100644
+--- a/util.c
++++ b/util.c
+@@ -28,7 +28,7 @@ void pdie(const char *msg, int perr)
+ if (perr)
+ perror(msg);
+ else
+- fprintf(stderr, msg);
++ fprintf(stderr, "%s", msg);
+ if (blkdev >= 0)
+ close(blkdev);
+ exit(1);
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch
new file mode 100644
index 000000000..d7ed0b9f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch
@@ -0,0 +1,78 @@
+From 68faa63aaad81f4a289e4a03173ab4cf798deb53 Mon Sep 17 00:00:00 2001
+From: Azat Khuzhin <a3at.mail@gmail.com>
+Date: Sat, 1 Nov 2014 22:24:32 +0300
+Subject: [PATCH 3/3] Fix 3-d argument for BLKROSET it must be 'const int *'
+
+Most of *SET ioctls have int type for 3-d argument, except BLKROSET.
+So add bc_arg_type enum, build it into bool_comand and install arg_type
+to bc_arg_int_ptr for BLKROSET only.
+
+Debian-bug-id: 641164
+Link: https://bugs.debian.org/641164
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ blktool.c | 11 +++++++++--
+ blktool.h | 7 +++++++
+ 2 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/blktool.c b/blktool.c
+index fbefecd..221a195 100644
+--- a/blktool.c
++++ b/blktool.c
+@@ -85,7 +85,7 @@ static struct bool_command bool_cmd_tbl[] = {
+ { { DEF_BOOL("pio-data"), dc_ata, DEF_HDIO(32BIT) },
+ "16-bit", "32-bit" },
+ { { DEF_BOOL("readonly"), dc_any, IOCNAME(BLKROGET), IOCNAME(BLKROSET) },
+- DEF_BOOLSTR },
++ DEF_BOOLSTR, bc_arg_int_ptr },
+ { { DEF_BOOL("unmask-irq"), dc_ata, DEF_HDIO(UNMASKINTR) },
+ DEF_BOOLSTR },
+ { { "wcache", ct_bool, handle_wcache, dc_any,
+@@ -171,7 +171,14 @@ static void handle_bool(int argc, char **argv, struct command *cmd)
+
+ } else if ((argc == 4) && (cmd->write_ioctl_name != NULL)) {
+ do_32 = parse_bool(argc, argv, bcm);
+- if (ioctl(blkdev, cmd->write_ioctl, do_32))
++
++ int ret;
++ if (bcm->arg_type == bc_arg_int_ptr) {
++ ret = ioctl(blkdev, cmd->write_ioctl, &do_32);
++ } else {
++ ret = ioctl(blkdev, cmd->write_ioctl, do_32);
++ }
++ if (ret)
+ pdie(cmd->write_ioctl_name, 1);
+ }
+ else {
+diff --git a/blktool.h b/blktool.h
+index fce4387..85add83 100644
+--- a/blktool.h
++++ b/blktool.h
+@@ -85,11 +85,18 @@ struct command {
+ const char *write_ioctl_name;
+ };
+
++enum bc_arg_type {
++ bc_arg_int,
++ bc_arg_int_ptr,
++};
++
+ struct bool_command {
+ struct command cmd;
+
+ const char *str_false;
+ const char *str_true;
++
++ enum bc_arg_type arg_type;
+ };
+
+ struct class_operations {
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool_4-7.bb b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool_4-7.bb
new file mode 100644
index 000000000..d6250a90c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/blktool/blktool_4-7.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Tune low-level block device parameters"
+DESCRIPTION = "blktool is used for querying and/or changing settings \
+of a block device. It is like hdparm but a more general tool, as it \
+works on SCSI, IDE and SATA devices."
+HOMEPAGE = "http://packages.debian.org/unstable/admin/blktool"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://blktool.c;beginline=7;endline=8;md5=a5e798ea98fd50972088968a15e5f373"
+
+DEPENDS = "glib-2.0"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/b/blktool/blktool_4.orig.tar.gz;name=tarball \
+ file://0001-fix-typos-in-manpage.patch \
+ file://0002-fix-string-error.patch \
+ file://0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch \
+ "
+
+SRC_URI[tarball.md5sum] = "62edc09c9908107e69391c87f4f3fd40"
+SRC_URI[tarball.sha256sum] = "b1e6d5912546d2a4b704ec65c2b9664aa3b4663e7d800e06803330335a2cb764"
+
+# for this package we're mostly interested in tracking debian patches,
+# and not in the upstream version where all development has effectively stopped
+UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
+
+S = "${WORKDIR}/${BPN}-4.orig"
+
+inherit autotools pkgconfig
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc
new file mode 100644
index 000000000..f9f8d6b5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Berkeley LALR Yacc parser generator"
+DESCRIPTION = "A parser generator utility that reads a grammar specification from a file and generates an LR(1) \
+parser for it. The parsers consist of a set of LALR(1) parsing tables and a driver routine written in the C \
+programming language."
+SECTION = "devel"
+LICENSE = "PD"
+
+SRC_URI = "ftp://invisible-island.net/byacc/byacc-${PV}.tgz \
+ file://byacc-open.patch"
+
+EXTRA_OECONF += "--program-transform-name='s,^,b,'"
+
+BBCLASSEXTEND = "native"
+
+inherit autotools
+
+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
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/byacc-open.patch b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/byacc-open.patch
new file mode 100644
index 000000000..005831130
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc/byacc-open.patch
@@ -0,0 +1,25 @@
+Ubuntu defaults to passing _FORTIFY_SOURCE=2 which breaks byacc as it doesn't
+pass enough arguments to open():
+
+ inlined from 'open_tmpfile' at byacc-20150711/main.c:588:5:
+ /usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:24: error: call to '__open_missing_mode' declared with attribute error:
+ open with O_CREAT in second argument needs 3 arguments
+
+Add a mode of 0666 to fix this.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/main.c b/main.c
+index 620ce3f..82071a4 100644
+--- a/main.c
++++ b/main.c
+@@ -526,7 +526,7 @@ my_mkstemp(char *temp)
+ }
+ if ((name = tempnam(dname, fname)) != 0)
+ {
+- fd = open(name, O_CREAT | O_EXCL | O_RDWR);
++ fd = open(name, O_CREAT | O_EXCL | O_RDWR, 0666);
+ strcpy(temp, name);
+ }
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20150711.bb b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20150711.bb
new file mode 100644
index 000000000..e5b5451f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/byacc/byacc_20150711.bb
@@ -0,0 +1,11 @@
+# Sigh. This is one of those places where everyone licenses it differently. Someone
+# even apply UCB to it (Free/Net/OpenBSD). The maintainer states that:
+# "I've found no reliable source which states that byacc must bear a UCB copyright."
+# Setting to PD as this is what the upstream has it as.
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://package/debian/copyright;md5=c52fb2d1b3f75b3b7534927807a1b714"
+require byacc.inc
+
+SRC_URI[md5sum] = "2700401030583c4e9169ac7ea7d08de8"
+SRC_URI[sha256sum] = "c354e4ee14c4a1bf11e55dde9275011d14887ef066406a088b6fa56caf039248"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am
new file mode 100644
index 000000000..05d389fc7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am
@@ -0,0 +1,72 @@
+
+lib_LTLIBRARIES = libbz2.la
+libbz2_la_LDFLAGS = -version-info 1:6:0
+
+libbz2_la_SOURCES = blocksort.c \
+ huffman.c \
+ crctable.c \
+ randtable.c \
+ compress.c \
+ decompress.c \
+ bzlib.c
+
+bin_PROGRAMS = bzip2 bzip2recover
+
+bzip2_SOURCES = bzip2.c
+bzip2_LDADD = libbz2.la
+bzip2_DEPENDENCIES = libbz2.la
+
+include_HEADERS = bzlib.h
+
+bzip2recover_SOURCES = bzip2recover.c
+bzip2recover_LDADD = libbz2.la
+bzip2recover_DEPENDENCIES = libbz2.la
+
+bin_SCRIPTS = bzgrep bzmore bzdiff
+
+man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1
+EXTRA_DIST = $(man_MANS)
+
+runtest:
+ ./bzip2 -1 < sample1.ref > sample1.rb2
+ ./bzip2 -2 < sample2.ref > sample2.rb2
+ ./bzip2 -3 < sample3.ref > sample3.rb2
+ ./bzip2 -d < sample1.bz2 > sample1.tst
+ ./bzip2 -d < sample2.bz2 > sample2.tst
+ ./bzip2 -ds < sample3.bz2 > sample3.tst
+ @if cmp sample1.bz2 sample1.rb2; then echo "PASS: sample1 compress";\
+ else echo "FAIL: sample1 compress"; fi
+ @if cmp sample2.bz2 sample2.rb2; then echo "PASS: sample2 compress";\
+ else echo "FAIL: sample2 compress"; fi
+ @if cmp sample3.bz2 sample3.rb2; then echo "PASS: sample3 compress";\
+ else echo "FAIL: sample3 compress"; fi
+ @if cmp sample1.tst sample1.ref; then echo "PASS: sample1 decompress";\
+ else echo "FAIL: sample1 decompress"; fi
+ @if cmp sample2.tst sample2.ref; then echo "PASS: sample2 decompress";\
+ else echo "FAIL: sample2 decompress"; fi
+ @if cmp sample3.tst sample3.ref; then echo "PASS: sample3 decompress";\
+ else echo "FAIL: sample3 decompress"; fi
+
+install-ptest:
+ cp $(srcdir)/Makefile $(DESTDIR)/
+ cp $(srcdir)/sample1.ref $(DESTDIR)/
+ cp $(srcdir)/sample2.ref $(DESTDIR)/
+ cp $(srcdir)/sample3.ref $(DESTDIR)/
+ cp $(srcdir)/sample1.bz2 $(DESTDIR)/
+ cp $(srcdir)/sample2.bz2 $(DESTDIR)/
+ cp $(srcdir)/sample3.bz2 $(DESTDIR)/
+ ln -s $(bindir)/bzip2 $(DESTDIR)/bzip2
+
+install-exec-hook:
+ ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT)
+ ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT)
+ ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT)
+ ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT)
+ ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT)
+ ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT)
+
+install-data-hook:
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1
+ echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1
+ echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1
+ echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac
new file mode 100644
index 000000000..e2bf1bf11
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac
@@ -0,0 +1,11 @@
+AC_PREREQ([2.57])
+
+AC_INIT(bzip2, 1.0.6)
+AM_INIT_AUTOMAKE(foreign)
+AM_MAINTAINER_MODE
+
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+AC_OUTPUT([Makefile])
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch
new file mode 100644
index 000000000..ece90d94e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/fix-bunzip2-qt-returns-0-for-corrupt-archives.patch
@@ -0,0 +1,55 @@
+From 8068659388127e8e63f2d2297ba2348c72b20705 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Mon, 12 Oct 2015 03:19:51 -0400
+Subject: [PATCH] bzip2: fix bunzip2 -qt returns 0 for corrupt archives
+
+"bzip2 -t FILE" returns 2 if FILE exists, but is not a valid bzip2 file.
+"bzip2 -qt FILE" returns 0 when this happens, although it does print out
+an error message as is does so.
+
+This has been fix by Debian, just port changes from Debian patch file
+"20-legacy.patch".
+
+Debian defect:
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=279025
+
+Fix item from changelog:
+http://archive.debian.net/changelogs/pool/main/b/bzip2/bzip2_1.0.2-7/changelog
+
+ * Fixed "bunzip2 -qt returns 0 for corrupt archives" (Closes: #279025).
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ bzip2.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/bzip2.c b/bzip2.c
+index 6de9d1d..f2ce668 100644
+--- a/bzip2.c
++++ b/bzip2.c
+@@ -2003,12 +2003,14 @@ IntNative main ( IntNative argc, Char *argv[] )
+ testf ( aa->name );
+ }
+ }
+- if (testFailsExist && noisy) {
+- fprintf ( stderr,
+- "\n"
+- "You can use the `bzip2recover' program to attempt to recover\n"
+- "data from undamaged sections of corrupted files.\n\n"
+- );
++ if (testFailsExist) {
++ if (noisy) {
++ fprintf ( stderr,
++ "\n"
++ "You can use the `bzip2recover' program to attempt to recover\n"
++ "data from undamaged sections of corrupted files.\n\n"
++ );
++ }
+ setExit(2);
+ exit(exitValue);
+ }
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest
new file mode 100644
index 000000000..3b20fce1e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest
diff --git a/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
new file mode 100644
index 000000000..f717d85f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Very high-quality data compression program"
+DESCRIPTION = "bzip2 compresses files using the Burrows-Wheeler block-sorting text compression algorithm, and \
+Huffman coding. Compression is generally considerably better than that achieved by more conventional \
+LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors."
+HOMEPAGE = "http://www.bzip.org/"
+SECTION = "console/utils"
+LICENSE = "bzip2"
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=8;endline=37;md5=40d9d1eb05736d1bfc86cfdd9106e6b2"
+PR = "r5"
+
+SRC_URI = "http://www.bzip.org/${PV}/${BP}.tar.gz \
+ file://fix-bunzip2-qt-returns-0-for-corrupt-archives.patch \
+ file://configure.ac;subdir=${BP} \
+ file://Makefile.am;subdir=${BP} \
+ file://run-ptest"
+
+SRC_URI[md5sum] = "00b516f4704d4a7cb50a1d97e6e8e15b"
+SRC_URI[sha256sum] = "a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd"
+
+UPSTREAM_CHECK_URI = "http://www.bzip.org/downloads.html"
+
+PACKAGES =+ "libbz2"
+
+CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64"
+
+inherit autotools update-alternatives ptest
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "bunzip2 bzcat"
+
+#install binaries to bzip2-native under sysroot for replacement-native
+EXTRA_OECONF_append_class-native = " --bindir=${STAGING_BINDIR_NATIVE}/${PN}"
+
+do_install_ptest () {
+ cp -f ${B}/Makefile ${D}${PTEST_PATH}/Makefile
+ sed -i -e "s|^Makefile:|_Makefile:|" ${D}${PTEST_PATH}/Makefile
+}
+
+FILES_libbz2 = "${libdir}/lib*${SOLIBS}"
+
+PROVIDES_append_class-native = " bzip2-replacement-native"
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
new file mode 100644
index 000000000..c0f7f1674
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
@@ -0,0 +1,44 @@
+require recipes-extended/chkconfig/chkconfig_1.3.58.bb
+
+SUMMARY = "${SUMMARY_chkconfig-alternatives}"
+DESCRIPTION = "${DESCRIPTION_chkconfig-alternatives}"
+DEPENDS = ""
+PROVIDES += "virtual/update-alternatives-native"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+# The sysroot branch is 1.3.59 + some git commits from master + --sysroot
+# support for alternatives.
+SRC_URI = "git://github.com/kergoth/chkconfig;branch=sysroot"
+S = "${WORKDIR}/git"
+UPSTREAM_CHECK_GITTAGREGEX = "chkconfig-(?P<pver>(\d+(\.\d+)+))"
+
+SRCREV = "cd437ecbd8986c894442f8fce1e0061e20f04dee"
+PV = "1.3.59+${SRCPV}"
+
+inherit native
+
+# We want our native recipes to build using the target paths rather than paths
+# into the sysroot, as we may use them to construct the rootfs. As such, we
+# only adjust the paths to match the metadata for the target, not native.
+obey_variables () {
+ sed -i 's,ALTERNATIVES_ROOT,OPKG_OFFLINE_ROOT,' alternatives.c
+}
+
+do_compile () {
+ oe_runmake alternatives
+}
+
+do_install () {
+ install -d ${D}${sysconfdir}/alternatives \
+ ${D}${localstatedir}/lib/alternatives
+
+ install -D -m 0755 alternatives ${D}${bindir}/alternatives
+ install -D -m 0644 alternatives.8 ${D}${mandir}/man8/alternatives.8
+
+ ln -s alternatives ${D}${bindir}/update-alternatives
+ ln -s alternatives.8 ${D}${mandir}/man8/update-alternatives.8
+}
+
+do_install_append_linuxstdbase() {
+ rm -rf ${D}${libdir}/lsb
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch
new file mode 100644
index 000000000..96d193879
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig/replace_caddr_t.patch
@@ -0,0 +1,33 @@
+caddr_t is a legacy BSD type which was rejected by the POSIX standard.
+Use void * instead.
+
+sys/unitstd.h is not needed and moreover its not available on all C library
+implementations e.g. musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: chkconfig-1.3.58/alternatives.c
+===================================================================
+--- chkconfig-1.3.58.orig/alternatives.c
++++ chkconfig-1.3.58/alternatives.c
+@@ -22,7 +22,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/stat.h>
+-#include <sys/unistd.h>
+ #include <unistd.h>
+
+ #define FLAGS_TEST (1 << 0)
+Index: chkconfig-1.3.58/leveldb.c
+===================================================================
+--- chkconfig-1.3.58.orig/leveldb.c
++++ chkconfig-1.3.58/leveldb.c
+@@ -442,7 +442,7 @@ int parseServiceInfo(int fd, char * name
+ fstat(fd, &sb);
+
+ bufstart = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
+- if (bufstart == ((caddr_t) -1)) {
++ if (bufstart == ((void*) -1)) {
+ close(fd);
+ return -1;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb
new file mode 100644
index 000000000..e8390264c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb
@@ -0,0 +1,67 @@
+SUMMARY = "A system tool for maintaining the /etc/rc*.d hierarchy"
+DESCRIPTION = "Chkconfig is a basic system utility. It updates and queries runlevel \
+information for system services. Chkconfig manipulates the numerous \
+symbolic links in /etc/rc.d, to relieve system administrators of some \
+of the drudgery of manually editing the symbolic links."
+
+RECIPE_NO_UPDATE_REASON = "Version 1.5 requires selinux"
+
+HOMEPAGE = "http://fedorahosted.org/releases/c/h/chkconfig"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
+
+DEPENDS = "libnewt popt"
+PROVIDES += "virtual/update-alternatives"
+
+PR = "r7"
+
+SRC_URI = "http://fedorahosted.org/releases/c/h/chkconfig/${BPN}-${PV}.tar.bz2 \
+ file://replace_caddr_t.patch \
+ "
+
+SRC_URI[md5sum] = "c2039ca67f2749fe0c06ef7c6f8ee246"
+SRC_URI[sha256sum] = "18b497d25b2cada955c72810e45fcad8280d105f17cf45e2970f18271211de68"
+
+inherit gettext
+
+# Makefile uses RPM_OPT_FLAGS to construct CFLAGS
+#
+EXTRA_OEMAKE = "\
+ 'RPM_OPT_FLAGS=${CFLAGS}' \
+ 'LDFLAGS=${LDFLAGS}' \
+ 'BINDIR=${base_sbindir}' \
+ 'SBINDIR=${sbindir}' \
+ 'MANDIR=${mandir}' \
+ 'ALTDIR=${localstatedir}/lib/alternatives' \
+ 'ALTDATADIR=${sysconfdir}/alternatives' \
+"
+
+do_unpack[postfuncs] += "obey_variables"
+do_unpack[vardeps] += "obey_variables"
+obey_variables () {
+ sed -i -e 's,/etc,${sysconfdir},; s,/lib/systemd,${base_libdir}/systemd,' ${S}/leveldb.h
+ sed -i -e 's,/etc/alternatives,${sysconfdir}/alternatives,' \
+ -e 's,/var/lib/alternatives,${localstatedir}/lib/alternatives,' \
+ -e 's,/usr/share/locale,${datadir}/locale,' ${S}/alternatives.c
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' 'INSTALLNLSDIR=${D}${datadir}/locale' \
+ 'BINDIR=${sbindir}' install
+ install -d ${D}${sysconfdir}/chkconfig.d
+}
+
+PACKAGES =+ "${PN}-alternatives ${PN}-alternatives-doc"
+SUMMARY_${PN}-alternatives = "Maintain symbolic links determining default commands"
+DESCRIPTION_${PN}-alternatives = "alternatives creates, removes, maintains and displays \
+information about the symbolic links comprising the alternatives system."
+SUMMARY_${PN}-alternatives-doc = "${SUMMARY_${PN}-alternatives} - Documentation files"
+DESCRIPTION_${PN}-alternatives-doc = "${DESCRIPTION_${PN}-alternatives} \
+This package contains documentation."
+RPROVIDES_${PN}-alternatives += "update-alternatives"
+RCONFLICTS_${PN}-alternatives = "update-alternatives-opkg update-alternatives-dpkg"
+FILES_${PN}-alternatives = "${sbindir}/alternatives ${sbindir}/update-alternatives \
+ ${sysconfdir}/alternatives ${localstatedir}/lib/alternatives"
+FILES_${PN}-alternatives-doc = "${mandir}/man8/alternatives.8 \
+ ${mandir}/man8/update-alternatives.8"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch
new file mode 100644
index 000000000..5c999197f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Fix-CVE-2015-1197.patch
@@ -0,0 +1,178 @@
+From dcee489f821c1260a0136fcdfdb6ff4dd11086ac Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 9 Dec 2015 17:58:03 +0200
+Subject: [PATCH] Fix CVE-2015-1197
+
+Apply patch by Vitezslav Cizek of SuSE to fix CVE-2015-1197.
+Upstream is dormant or no longer existing. To restore the old
+behaviour use --extract-over-symlinks (Closes: #774669)
+This issue has been discovered by Alexander Cherepanov.
+Author: Vitezslav Cizek <vcizek@suse.cz>
+Bug-Debian: https://bugs.debian.org/774669
+
+Upstream-Status: Pending
+CVE: CVE-2015-1197
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ doc/cpio.1 | 1 +
+ src/copyin.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/extern.h | 1 +
+ src/global.c | 3 +++
+ src/main.c | 7 +++++++
+ 5 files changed, 74 insertions(+)
+
+diff --git a/doc/cpio.1 b/doc/cpio.1
+index 2a68241..dc4676c 100644
+--- a/doc/cpio.1
++++ b/doc/cpio.1
+@@ -49,6 +49,7 @@ cpio \- copy files to and from archives
+ [\fB\-\-no\-preserve\-owner\fR] [\fB\-\-message=\fIMESSAGE\fR]
+ [\fB\-\-force\-local\fR] [\fB\-\-no\-absolute\-filenames\fR] [\fB\-\-sparse\fR]
+ [\fB\-\-only\-verify\-crc\fR] [\fB\-\-to\-stdout\fR] [\fB\-\-quiet\fR]
++[\fB\-\-extract\-over\-symlinks\fR]
+ [\fB\-\-rsh\-command=\fICOMMAND\fR]
+ [\fIpattern\fR...] [\fB<\fR \fIarchive\fR]
+
+diff --git a/src/copyin.c b/src/copyin.c
+index cde911e..053afe7 100644
+--- a/src/copyin.c
++++ b/src/copyin.c
+@@ -695,6 +695,51 @@ copyin_link (struct cpio_file_stat *file_hdr, int in_file_des)
+ free (link_name);
+ }
+
++
++static int
++path_contains_symlink(char *path)
++{
++ struct stat st;
++ char *slash;
++ char *nextslash;
++
++ /* we got NULL pointer or empty string */
++ if (!path || !*path) {
++ return false;
++ }
++
++ slash = path;
++
++ while ((nextslash = strchr(slash + 1, '/')) != NULL) {
++ slash = nextslash;
++ *slash = '\0';
++
++ if (lstat(path, &st) != 0) {
++ if (errno == ELOOP) {
++ /* ELOOP - too many symlinks */
++ *slash = '/';
++ return true;
++ } else if (errno == ENOMEM) {
++ /* No memory for lstat - terminate */
++ xalloc_die();
++ } else {
++ /* cannot lstat path - give up */
++ *slash = '/';
++ return false;
++ }
++ }
++
++ if (S_ISLNK(st.st_mode)) {
++ *slash = '/';
++ return true;
++ }
++
++ *slash = '/';
++ }
++
++ return false;
++}
++
+ static void
+ copyin_file (struct cpio_file_stat *file_hdr, int in_file_des)
+ {
+@@ -1468,6 +1513,23 @@ process_copy_in ()
+ {
+ /* Copy the input file into the directory structure. */
+
++ /* Can we write files over symlinks? */
++ if (!extract_over_symlinks)
++ {
++ if (path_contains_symlink(file_hdr.c_name))
++ {
++ /* skip the file */
++ /*
++ fprintf(stderr, "Can't write over symlinks. Skipping %s\n", file_hdr.c_name);
++ tape_toss_input (in_file_des, file_hdr.c_filesize);
++ tape_skip_padding (in_file_des, file_hdr.c_filesize);
++ continue;
++ */
++ /* terminate */
++ error (1, 0, _("Can't write over symlinks: %s\n"), file_hdr.c_name);
++ }
++ }
++
+ /* Do we need to rename the file? */
+ if (rename_flag || rename_batch_file)
+ {
+diff --git a/src/extern.h b/src/extern.h
+index e27d662..d864bde 100644
+--- a/src/extern.h
++++ b/src/extern.h
+@@ -96,6 +96,7 @@ extern char input_is_special;
+ extern char output_is_special;
+ extern char input_is_seekable;
+ extern char output_is_seekable;
++extern bool extract_over_symlinks;
+ extern int (*xstat) ();
+ extern void (*copy_function) ();
+ extern char *change_directory_option;
+diff --git a/src/global.c b/src/global.c
+index 57e505a..336fce4 100644
+--- a/src/global.c
++++ b/src/global.c
+@@ -187,6 +187,9 @@ bool to_stdout_option = false;
+ /* The name this program was run with. */
+ char *program_name;
+
++/* Extract files over symbolic links */
++bool extract_over_symlinks;
++
+ /* A pointer to either lstat or stat, depending on whether
+ dereferencing of symlinks is done for input files. */
+ int (*xstat) ();
+diff --git a/src/main.c b/src/main.c
+index a13861f..87cb309 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -59,6 +59,7 @@ enum cpio_options {
+ DEBUG_OPTION,
+ BLOCK_SIZE_OPTION,
+ TO_STDOUT_OPTION,
++ EXTRACT_OVER_SYMLINKS,
+ RENUMBER_INODES_OPTION,
+ IGNORE_DEVNO_OPTION,
+ DEVICE_INDEPENDENT_OPTION
+@@ -243,6 +244,8 @@ static struct argp_option options[] = {
+ N_("Create leading directories where needed"), GRID+1 },
+ {"no-preserve-owner", NO_PRESERVE_OWNER_OPTION, 0, 0,
+ N_("Do not change the ownership of the files"), GRID+1 },
++ {"extract-over-symlinks", EXTRACT_OVER_SYMLINKS, 0, 0,
++ N_("Force writing over symbolic links"), GRID+1 },
+ {"unconditional", 'u', NULL, 0,
+ N_("Replace all files unconditionally"), GRID+1 },
+ {"sparse", SPARSE_OPTION, NULL, 0,
+@@ -432,6 +435,10 @@ crc newc odc bin ustar tar (all-caps also recognized)"), arg));
+ no_chown_flag = true;
+ break;
+
++ case EXTRACT_OVER_SYMLINKS: /* --extract-over-symlinks */
++ extract_over_symlinks = true;
++ break;
++
+ case 'o': /* Copy-out mode. */
+ if (copy_function != 0)
+ USAGE_ERROR ((0, 0, _("Mode already defined")));
+--
+2.6.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..6ae213942
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.12/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: cpio-2.11/gnu/Makefile.am
+===================================================================
+--- cpio-2.11.orig/gnu/Makefile.am
++++ cpio-2.11/gnu/Makefile.am
+@@ -734,7 +734,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch
new file mode 100644
index 000000000..a31573510
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624]
+CVE: CVE-2010-0624
+
+This patch avoids heap overflow reported by :
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624
+
+This is a clean patch for the GPLv2 tar recipe.
+
+the GPLv2 tar recipe patch is also applicable to this GPLv2 cpio
+recipe, as they share code.
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25
+
+Index: tar-1.17/lib/rtapelib.c
+===================================================================
+--- tar-1.17.orig/lib/rtapelib.c
++++ tar-1.17/lib/rtapelib.c
+@@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si
+
+ sprintf (command_buffer, "R%lu\n", (unsigned long) length);
+ if (do_command (handle, command_buffer) == -1
+- || (status = get_status (handle)) == SAFE_READ_ERROR)
++ || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length))
+ return SAFE_READ_ERROR;
+
+ for (counter = 0; counter < status; counter += rlen, buffer += rlen)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch
new file mode 100644
index 000000000..0148e7079
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch
@@ -0,0 +1,217 @@
+cpio: Fix memory overrun on reading improperly created link records
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+http://git.savannah.gnu.org/cgit/cpio.git/commit/?id=746f3ff670dcfcdd28fcc990e79cd6fccc7ae48d
+
+ * src/copyin.c (get_link_name): New function.
+ (list_file, copyin_link): use get_link_name
+
+ * tests/symlink-bad-length.at: New file.
+ * tests/symlink-long.at: New file.
+ * tests/Makefile.am: Add new files.
+ * tests/testsuite.at: Likewise.
+
+ See http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
+
+Upstream-Status: Backport
+
+Signed-off-by: Sergey Poznyakoff <gray@gnu.org.ua>
+
+diff -Nurp cpio-2.8.orig/src/copyin.c cpio-2.8/src/copyin.c
+--- cpio-2.8.orig/src/copyin.c 2007-06-07 19:58:03.000000000 +0800
++++ cpio-2.8/src/copyin.c 2014-12-08 11:30:01.159791484 +0800
+@@ -126,6 +126,28 @@ tape_skip_padding (int in_file_des, int
+ }
+
+
++static char *
++get_link_name (struct cpio_file_stat *file_hdr, int in_file_des)
++{
++ off_t n = file_hdr->c_filesize + 1;
++ char *link_name;
++
++ if (n == 0 || n > SIZE_MAX)
++ {
++ error (0, 0, _("%s: stored filename length too big"), file_hdr->c_name);
++ link_name = NULL;
++ }
++ else
++ {
++ link_name = xmalloc (n);
++ tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
++ link_name[file_hdr->c_filesize] = '\0';
++ tape_skip_padding (in_file_des, file_hdr->c_filesize);
++ }
++ return link_name;
++}
++
++
+ static void
+ list_file(struct cpio_file_stat* file_hdr, int in_file_des)
+ {
+@@ -136,21 +158,16 @@ list_file(struct cpio_file_stat* file_hd
+ {
+ if (archive_format != arf_tar && archive_format != arf_ustar)
+ {
+- char *link_name = NULL; /* Name of hard and symbolic links. */
+-
+- link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
+- link_name[file_hdr->c_filesize] = '\0';
+- tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
+- long_format (file_hdr, link_name);
+- free (link_name);
+- tape_skip_padding (in_file_des, file_hdr->c_filesize);
+- return;
++ char *link_name = get_link_name (file_hdr, in_file_des);
++ if (link_name)
++ {
++ long_format (file_hdr, link_name);
++ free (link_name);
++ }
+ }
+ else
+- {
+ long_format (file_hdr, file_hdr->c_tar_linkname);
+- return;
+- }
++ return;
+ }
+ else
+ #endif
+@@ -732,10 +749,7 @@ copyin_link(struct cpio_file_stat *file_
+
+ if (archive_format != arf_tar && archive_format != arf_ustar)
+ {
+- link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
+- link_name[file_hdr->c_filesize] = '\0';
+- tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
+- tape_skip_padding (in_file_des, file_hdr->c_filesize);
++ link_name = get_link_name (file_hdr, in_file_des);
+ }
+ else
+ {
+diff -Nurp cpio-2.8.orig/tests/Makefile.am cpio-2.8/tests/Makefile.am
+--- cpio-2.8.orig/tests/Makefile.am 2006-10-24 18:32:13.000000000 +0800
++++ cpio-2.8/tests/Makefile.am 2014-12-08 11:30:52.387789482 +0800
+@@ -45,6 +45,8 @@ TESTSUITE_AT = \
+ testsuite.at\
+ inout.at\
+ symlink.at\
++ symlink-bad-length.at\
++ symlink-long.at\
+ version.at
+
+ TESTSUITE = $(srcdir)/testsuite
+diff -Nurp cpio-2.8.orig/tests/symlink-bad-length.at cpio-2.8/tests/symlink-bad-length.at
+--- cpio-2.8.orig/tests/symlink-bad-length.at 1970-01-01 08:00:00.000000000 +0800
++++ cpio-2.8/tests/symlink-bad-length.at 2014-12-08 11:33:25.283783507 +0800
+@@ -0,0 +1,49 @@
++# Process this file with autom4te to create testsuite. -*- Autotest -*-
++# Copyright (C) 2014 Free Software Foundation, Inc.
++
++# 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, 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, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301 USA.
++
++# Cpio v2.11 did segfault with badly set symlink length.
++# References:
++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
++
++AT_SETUP([symlink-bad-length])
++AT_KEYWORDS([symlink-long copyout])
++
++AT_DATA([ARCHIVE.base64],
++[x3EjAIBAtIEtJy8nAQAAAHRUYW0FAAAADQBGSUxFAABzb21lIGNvbnRlbnQKAMdxIwBgQ/+hLScv
++JwEAAAB0VEhuBQD/////TElOSwAARklMRcdxAAAAAAAAAAAAAAEAAAAAAAAACwAAAAAAVFJBSUxF
++UiEhIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
++])
++
++AT_CHECK([
++base64 -d ARCHIVE.base64 > ARCHIVE || AT_SKIP_TEST
++cpio -ntv < ARCHIVE
++test $? -eq 2
++],
++[0],
++[-rw-rw-r-- 1 10029 10031 13 Nov 25 13:52 FILE
++],[cpio: LINK: stored filename length too big
++cpio: premature end of file
++])
++
++AT_CLEANUP
+diff -Nurp cpio-2.8.orig/tests/symlink-long.at cpio-2.8/tests/symlink-long.at
+--- cpio-2.8.orig/tests/symlink-long.at 1970-01-01 08:00:00.000000000 +0800
++++ cpio-2.8/tests/symlink-long.at 2014-12-08 11:34:28.807781024 +0800
+@@ -0,0 +1,46 @@
++# Process this file with autom4te to create testsuite. -*- Autotest -*-
++# Copyright (C) 2014 Free Software Foundation, Inc.
++
++# 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, 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, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301 USA.
++
++# Cpio v2.11.90 changed the way symlink name is read from archive.
++# References:
++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
++
++AT_SETUP([symlink-long])
++AT_KEYWORDS([symlink-long copyout])
++
++AT_CHECK([
++
++# len(dirname) > READBUFSIZE
++dirname=
++for i in {1..52}; do
++ dirname="xxxxxxxxx/$dirname"
++ mkdir "$dirname"
++done
++ln -s "$dirname" x || AT_SKIP_TEST
++
++echo x | cpio -o > ar
++list=`cpio -tv < ar | sed 's|.*-> ||'`
++test "$list" = "$dirname" && echo success || echo fail
++],
++[0],
++[success
++],[2 blocks
++2 blocks
++])
++
++AT_CLEANUP
+diff -Nurp cpio-2.8.orig/tests/testsuite.at cpio-2.8/tests/testsuite.at
+--- cpio-2.8.orig/tests/testsuite.at 2006-10-24 18:32:13.000000000 +0800
++++ cpio-2.8/tests/testsuite.at 2014-12-08 11:34:56.515779942 +0800
+@@ -31,3 +31,5 @@ m4_include([version.at])
+
+ m4_include([inout.at])
+ m4_include([symlink.at])
++m4_include([symlink-bad-length.at])
++m4_include([symlink-long.at])
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch
new file mode 100644
index 000000000..e16585dd3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Define AC_USE_SYSTEM_EXTENSIONS only if it was previously undefined.
+# This is needed to configure correctly with newer versions of autoconf.
+
+diff -urN cpio-2.8.orig/m4/extensions.m4 cpio-2.8/m4/extensions.m4
+--- cpio-2.8.orig/m4/extensions.m4 2006-10-12 04:34:45.000000000 -0700
++++ cpio-2.8/m4/extensions.m4 2010-07-23 14:37:36.000000000 -0700
+@@ -1,4 +1,4 @@
+-# serial 4 -*- Autoconf -*-
++# serial 5 -*- Autoconf -*-
+ # Enable extensions on systems that normally disable them.
+
+ # Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+@@ -16,6 +16,7 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
++m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
+ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+ [
+ AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+@@ -48,7 +49,7 @@
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+-])
++])])
+
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch
new file mode 100644
index 000000000..a00799fea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio-2.8/statdef.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Avoid multiple stat definitions
+# Patch taken from cpio mailing list posting 2010-03-19
+
+diff -urN cpio-2.11.orig/src/filetypes.h cpio-2.11/src/filetypes.h
+--- cpio-2.11.orig/src/filetypes.h 2010-02-12 02:19:23.000000000 -0800
++++ cpio-2.11/src/filetypes.h 2010-07-23 13:17:25.000000000 -0700
+@@ -82,4 +82,6 @@
+ #define lstat stat
+ #endif
+ int lstat ();
++#ifndef stat
+ int stat ();
++#endif
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb
new file mode 100644
index 000000000..e7439996b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.12.bb
@@ -0,0 +1,12 @@
+include cpio_v2.inc
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
+
+SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0001-Fix-CVE-2015-1197.patch \
+ "
+
+SRC_URI[md5sum] = "fc207561a86b63862eea4b8300313e86"
+SRC_URI[sha256sum] = "08a35e92deb3c85d269a0059a27d4140a9667a6369459299d08c17f713a92e73"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb
new file mode 100644
index 000000000..624906b13
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_2.8.bb
@@ -0,0 +1,19 @@
+require cpio_v2.inc
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b7f772ea3a2489231cb4872656cac34b"
+
+PR = "r4"
+
+SRC_URI += " \
+ file://statdef.patch \
+ file://m4extensions.patch \
+ file://avoid_heap_overflow.patch \
+ file://fix-memory-overrun.patch \
+ "
+
+SRC_URI[md5sum] = "0caa356e69e149fb49b76bacc64615a1"
+SRC_URI[sha256sum] = "1b203248874c3b5a728b351f06513e5282f73e0170b7f207fbf8c39f28f6b4ad"
+
+# Required to build with gcc 4.3 and later:
+CFLAGS += "-fgnu89-inline"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_v2.inc b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_v2.inc
new file mode 100644
index 000000000..1bdc6176c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cpio/cpio_v2.inc
@@ -0,0 +1,41 @@
+SUMMARY = "GNU cpio is a program to manage archives of files"
+DESCRIPTION = "GNU cpio is a tool for creating and extracting archives, or copying files from one place to \
+another. It handles a number of cpio formats as well as reading and writing tar files."
+HOMEPAGE = "http://www.gnu.org/software/cpio/"
+SECTION = "base"
+
+DEPENDS = "texinfo-native"
+
+SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
+ "
+
+inherit autotools gettext texinfo
+
+S = "${WORKDIR}/cpio-${PV}"
+
+EXTRA_OECONF += "DEFAULT_RMT_DIR=${base_sbindir}"
+
+do_install () {
+ autotools_do_install
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ install -d ${D}${base_bindir}/
+ mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio"
+ rmdir ${D}${bindir}/
+ fi
+}
+
+PACKAGES =+ "${PN}-rmt"
+
+FILES_${PN}-rmt = "${base_sbindir}/rmt*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "cpio"
+ALTERNATIVE_${PN}-rmt = "rmt"
+
+ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio"
+
+ALTERNATIVE_PRIORITY[rmt] = "50"
+ALTERNATIVE_LINK_NAME[rmt] = "${base_sbindir}/rmt"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch b/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch
new file mode 100644
index 000000000..adbe7dfff
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch
@@ -0,0 +1,339 @@
+From 8a6e43726ad0ae41bd1cc2c248d91deb31459357 Mon Sep 17 00:00:00 2001
+From: Lei Maohui <leimaohui@cn.fujitsu.com>
+Date: Tue, 9 Jun 2015 11:11:48 +0900
+Subject: [PATCH] packlib.c: support dictionary byte order dependent
+
+The previous dict files are NOT byte-order independent, in fact they are
+probably ARCHITECTURE SPECIFIC.
+Create the dict files in big endian, and convert to host endian while
+load them. This could fix the endian issue on multiple platform.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+
+We can't use the endian.h, htobe* and be*toh functions because they are
+not available on older versions of glibc, such as that found in RHEL
+5.9.
+
+Change to checking endian and directly calling bswap_* as defined in
+byteswap.h.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
+---
+ lib/packlib.c | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 210 insertions(+), 4 deletions(-)
+
+diff --git a/lib/packlib.c b/lib/packlib.c
+index f851424..3aac805 100644
+--- a/lib/packlib.c
++++ b/lib/packlib.c
+@@ -16,6 +16,12 @@
+ #ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
++
++#ifndef _BSD_SOURCE
++#define _BSD_SOURCE /* See feature_test_macros(7) */
++#endif
++#include <endian.h>
++#include <byteswap.h>
+ #include "packer.h"
+
+ static const char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993";
+@@ -45,6 +51,185 @@ typedef struct
+ char data_get[NUMWORDS][MAXWORDLEN];
+ } PWDICT64;
+
++enum{
++ en_is32,
++ en_is64
++};
++
++static int
++IheaderHostToBigEndian(char *pHeader, int nBitType)
++{
++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader;
++
++ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic);
++ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords);
++ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen);
++ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad);
++
++#if DEBUG
++ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n",
++ pHeader64->pih_magic, pHeader64->pih_numwords,
++ pHeader64->pih_blocklen, pHeader64->pih_pad);
++#endif
++ }
++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ struct pi_header *pHeader32 = (struct pi_header*)pHeader;
++
++ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic);
++ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords);
++ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen);
++ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad);
++
++#if DEBUG
++ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n",
++ pHeader32->pih_magic, pHeader32->pih_numwords,
++ pHeader32->pih_blocklen, pHeader32->pih_pad);
++#endif
++ }
++ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++ return (-1);
++ }
++
++ return 0;
++}
++
++static int
++IheaderBigEndianToHost(char *pHeader, int nBitType)
++{
++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader;
++
++ pHeader64->pih_magic = bswap_64(pHeader64->pih_magic);
++ pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords);
++ pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen);
++ pHeader64->pih_pad = bswap_16(pHeader64->pih_pad);
++
++#if DEBUG
++ printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n",
++ pHeader64->pih_magic, pHeader64->pih_numwords,
++ pHeader64->pih_blocklen, pHeader64->pih_pad);
++#endif
++ }
++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ struct pi_header *pHeader32 = (struct pi_header*)pHeader;
++
++ pHeader32->pih_magic = bswap_32(pHeader32->pih_magic);
++ pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords);
++ pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen);
++ pHeader32->pih_pad = bswap_16(pHeader32->pih_pad);
++
++#if DEBUG
++ printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n",
++ pHeader32->pih_magic, pHeader32->pih_numwords,
++ pHeader32->pih_blocklen, pHeader32->pih_pad);
++#endif
++ }
++ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++ return (-1);
++ }
++
++ return 0;
++}
++
++static int
++HwmsHostToBigEndian(char *pHwms, int nLen,int nBitType)
++{
++ int i = 0;
++
++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ uint64_t *pHwms64 = (uint64_t*)pHwms;
++
++ for (i = 0; i < nLen / sizeof(uint64_t); i++)
++ {
++ *pHwms64 = bswap_64(*pHwms64);
++ *pHwms64++;
++ }
++
++ }
++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ uint32_t *pHwms32 = (uint32_t*)pHwms;
++
++ for (i = 0; i < nLen / sizeof(uint32_t); i++)
++ {
++ *pHwms32 = bswap_32(*pHwms32);
++ *pHwms32++;
++ }
++
++ }
++ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++ return (-1);
++ }
++
++#if DEBUG
++ for (i = 0; i < nLen; i+=8)
++ {
++ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n",
++ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF,
++ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF,
++ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF);
++ }
++#endif
++
++ return 0;
++}
++
++static int
++HwmsBigEndianToHost(char *pHwms, int nLen, int nBitType)
++{
++ int i = 0;
++
++ if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ uint64_t *pHwms64 = (uint64_t*)pHwms;
++
++ for (i = 0; i < nLen / sizeof(uint64_t); i++)
++ {
++ *pHwms64++ = bswap_64(*pHwms64);
++ }
++
++ }
++ else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ uint32_t *pHwms32 = (uint32_t*)pHwms;
++
++ for (i = 0; i < nLen / sizeof(uint32_t); i++)
++ {
++ *pHwms32 = bswap_32(*pHwms32);
++ *pHwms32++;
++ }
++
++ }
++ else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++ {
++ fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++ return (-1);
++ }
++
++#if DEBUG
++ for (i = 0; i < nLen; i+=8)
++ {
++ printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n",
++ nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF,
++ pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF,
++ pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF);
++ }
++#endif
++
++ return 0;
++}
+
+ static int
+ _PWIsBroken64(FILE *ifp)
+@@ -57,6 +242,7 @@ _PWIsBroken64(FILE *ifp)
+ return 0;
+ }
+
++ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
+ return (pdesc64.header.pih_magic == PIH_MAGIC);
+ }
+
+@@ -149,7 +335,11 @@ PWOpen(prefix, mode)
+ pdesc.header.pih_blocklen = NUMWORDS;
+ pdesc.header.pih_numwords = 0;
+
+- fwrite((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp);
++ struct pi_header tmpheader32;
++
++ memcpy(&tmpheader32, &pdesc.header, sizeof(pdesc.header));
++ IheaderHostToBigEndian((char *) &tmpheader32, en_is32);
++ fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, ifp);
+ } else
+ {
+ pdesc.flags &= ~PFOR_WRITE;
+@@ -173,6 +363,7 @@ PWOpen(prefix, mode)
+ return NULL;
+ }
+
++ IheaderBigEndianToHost((char *) &pdesc.header, en_is32);
+ if ((pdesc.header.pih_magic == 0) || (pdesc.header.pih_numwords == 0))
+ {
+ /* uh-oh. either a broken "64-bit" file or a garbage file. */
+@@ -195,6 +386,7 @@ PWOpen(prefix, mode)
+ }
+ return NULL;
+ }
++ IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
+ if (pdesc64.header.pih_magic != PIH_MAGIC)
+ {
+ /* nope, not "64-bit" after all */
+@@ -290,6 +482,7 @@ PWOpen(prefix, mode)
+ {
+ pdesc.flags &= ~PFOR_USEHWMS;
+ }
++ HwmsBigEndianToHost((char*)pdesc64.hwms, sizeof(pdesc64.hwms), en_is64);
+ for (i = 0; i < sizeof(pdesc.hwms) / sizeof(pdesc.hwms[0]); i++)
+ {
+ pdesc.hwms[i] = pdesc64.hwms[i];
+@@ -299,6 +492,7 @@ PWOpen(prefix, mode)
+ {
+ pdesc.flags &= ~PFOR_USEHWMS;
+ }
++ HwmsBigEndianToHost((char*)pdesc.hwms, sizeof(pdesc.hwms), en_is32);
+ #if DEBUG
+ for (i=1; i<=0xff; i++)
+ {
+@@ -332,7 +526,11 @@ PWClose(pwp)
+ return (-1);
+ }
+
+- if (!fwrite((char *) &pwp->header, sizeof(pwp->header), 1, pwp->ifp))
++ struct pi_header tmpheader32;
++
++ memcpy(&tmpheader32, &pwp->header, sizeof(pwp->header));
++ IheaderHostToBigEndian((char *) &tmpheader32, en_is32);
++ if (!fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, pwp->ifp))
+ {
+ fprintf(stderr, "index magic fwrite failed\n");
+ return (-1);
+@@ -351,7 +549,12 @@ PWClose(pwp)
+ printf("hwm[%02x] = %d\n", i, pwp->hwms[i]);
+ #endif
+ }
+- fwrite(pwp->hwms, 1, sizeof(pwp->hwms), pwp->wfp);
++
++ PWDICT tmp_pwp;
++
++ memcpy(&tmp_pwp, pwp, sizeof(PWDICT));
++ HwmsHostToBigEndian(tmp_pwp.hwms, sizeof(tmp_pwp.hwms), en_is32);
++ fwrite(tmp_pwp.hwms, 1, sizeof(tmp_pwp.hwms), pwp->wfp);
+ }
+ }
+
+@@ -405,7 +608,8 @@ PutPW(pwp, string)
+
+ datum = (uint32_t) ftell(pwp->dfp);
+
+- fwrite((char *) &datum, sizeof(datum), 1, pwp->ifp);
++ uint32_t tmpdatum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
++ fwrite((char *) &tmpdatum, sizeof(tmpdatum), 1, pwp->ifp);
+
+ fputs(pwp->data_put[0], pwp->dfp);
+ putc(0, pwp->dfp);
+@@ -464,6 +668,7 @@ GetPW(pwp, number)
+ perror("(index fread failed)");
+ return NULL;
+ }
++ datum64 = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_64(datum64) : datum64;
+ datum = datum64;
+ } else {
+ if (fseek(pwp->ifp, sizeof(struct pi_header) + (thisblock * sizeof(uint32_t)), 0))
+@@ -477,6 +682,7 @@ GetPW(pwp, number)
+ perror("(index fread failed)");
+ return NULL;
+ }
++ datum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
+ }
+
+ int r = 1;
+--
+1.8.4.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch b/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch
new file mode 100644
index 000000000..6210e8212
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch
@@ -0,0 +1,53 @@
+From 06f9a88b5dd5597f9198ea0cb34f5e96f180e6e3 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Sat, 27 Apr 2013 16:02:30 +0800
+Subject: [PATCH] craklib:fix testnum and teststr failed
+
+Error log:
+...
+$ ./testnum
+(null).pwd.gz: No such file or directory
+PWOpen: No such file or directory
+
+$ ./util/teststr
+(null).pwd.gz: No such file or directory
+PWOpen: No such file or directory
+...
+Set DEFAULT_CRACKLIB_DICT as the path of PWOpen
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+ util/testnum.c | 2 +-
+ util/teststr.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/util/testnum.c b/util/testnum.c
+index ae2246d..ca210ff 100644
+--- a/util/testnum.c
++++ b/util/testnum.c
+@@ -20,7 +20,7 @@ main ()
+ PWDICT *pwp;
+ char buffer[STRINGSIZE];
+
+- if (!(pwp = PWOpen (NULL, "r")))
++ if (!(pwp = PWOpen (DEFAULT_CRACKLIB_DICT, "r")))
+ {
+ perror ("PWOpen");
+ return (-1);
+diff --git a/util/teststr.c b/util/teststr.c
+index 2a31fa4..9fb9cda 100644
+--- a/util/teststr.c
++++ b/util/teststr.c
+@@ -15,7 +15,7 @@ main ()
+ PWDICT *pwp;
+ char buffer[STRINGSIZE];
+
+- if (!(pwp = PWOpen (NULL, "r")))
++ if (!(pwp = PWOpen (DEFAULT_CRACKLIB_DICT, "r")))
+ {
+ perror ("PWOpen");
+ return (-1);
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb b/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb
new file mode 100644
index 000000000..3bd3f9367
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cracklib/cracklib_2.9.5.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Password strength checker library"
+HOMEPAGE = "http://sourceforge.net/projects/cracklib"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
+
+DEPENDS = "cracklib-native zlib python"
+RDEPEND_${PN}-python += "python"
+
+PACKAGES += "${PN}-python"
+
+EXTRA_OECONF = "--with-python --libdir=${base_libdir}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/cracklib/cracklib-${PV}.tar.gz \
+ file://0001-packlib.c-support-dictionary-byte-order-dependent.patch \
+ file://0002-craklib-fix-testnum-and-teststr-failed.patch"
+
+SRC_URI[md5sum] = "376790a95c1fb645e59e6e9803c78582"
+SRC_URI[sha256sum] = "59ab0138bc8cf90cccb8509b6969a024d5e58d2d02bcbdccbb9ba9b88be3fa33"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/cracklib/files/cracklib/"
+UPSTREAM_CHECK_REGEX = "/cracklib/(?P<pver>(\d+[\.\-_]*)+)/"
+
+inherit autotools gettext pythonnative python-dir
+
+do_install_append_class-target() {
+ create-cracklib-dict -o ${D}${datadir}/cracklib/pw_dict ${D}${datadir}/cracklib/cracklib-small
+}
+
+do_install_append() {
+ src_dir="${D}${base_libdir}/${PYTHON_DIR}/site-packages"
+ rm -f $src_dir/test_cracklib.py*
+
+ if [ "${base_libdir}" != "${libdir}" ] ; then
+ # Move python files from ${base_libdir} to ${libdir} since used --libdir=${base_libdir}
+ install -d -m 0755 ${D}${PYTHON_SITEPACKAGES_DIR}/
+ mv $src_dir/* ${D}${PYTHON_SITEPACKAGES_DIR}
+ rm -fr ${D}${base_libdir}/${PYTHON_DIR}
+ fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/cracklib.py* \
+ ${PYTHON_SITEPACKAGES_DIR}/_cracklib.*"
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/_cracklib.a"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.init b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.init
new file mode 100755
index 000000000..53b8514ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.init
@@ -0,0 +1,58 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: crond crontab
+# Default-Start: 2345
+# Default-Stop: 016
+# Short-Description: run cron daemon
+# Description: cron is a standard UNIX program that runs user-specified
+# programs at periodic scheduled times. vixie cron adds a
+# number of features to the basic UNIX cron, including better
+# security and more powerful configuration options.
+### END INIT INFO
+
+CROND=/usr/sbin/crond
+CONFIG=/etc/sysconfig/crond
+
+[ -f $CONFIG ] || exit 1
+[ -x $CROND ] || exit 1
+
+. $CONFIG
+
+# Source function library.
+. /etc/init.d/functions
+
+case "$1" in
+ start)
+ echo -n "Starting crond: "
+ start-stop-daemon --start --quiet --exec $CROND -- $CRONDARGS
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ ;;
+ stop)
+ echo -n "Stopping crond: "
+ start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ] ; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ ;;
+ status)
+ status crond
+ exit $?
+ ;;
+ restart)
+ $0 stop && sleep 1 && $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/crond {start|stop|status|restart}"
+ exit 1
+esac
+
+exit 0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.service b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.service
new file mode 100644
index 000000000..d435a6eb3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Periodic Command Scheduler
+
+[Service]
+EnvironmentFile=/etc/sysconfig/crond
+ExecStart=@SBINDIR@/crond -n $CRONDARGS
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch
new file mode 100644
index 000000000..675872c3c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crond_pam_config.patch
@@ -0,0 +1,19 @@
+password-auth is the Fedora's common pam configure file, use oe common pam
+configure files instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+--- cronie-1.4.7/pam/crond.orig 2010-12-16 16:59:02.000000000 +0800
++++ cronie-1.4.7/pam/crond 2011-07-20 09:47:16.080819203 +0800
+@@ -4,7 +4,7 @@
+ #
+ # No PAM authentication called, auth modules not needed
+ account required pam_access.so
+-account include password-auth
++account include common-account
+ session required pam_loginuid.so
+-session include password-auth
+-auth include password-auth
++session include common-session-noninteractive
++auth include common-auth
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crontab b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crontab
new file mode 100644
index 000000000..22c4feb2d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie/crontab
@@ -0,0 +1,14 @@
+# /etc/crontab: system-wide crontab
+# Unlike any other crontab you don't have to run the `crontab'
+# command to install the new version when you edit this file
+# and files in /etc/cron.d. These files also have username fields,
+# that none of the other crontabs do.
+
+SHELL=/bin/sh
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+# m h dom mon dow user command
+# 1 * * * * root cd / && run-parts /etc/cron.hourly
+# 30 7 * * * root cd / && run-parts /etc/cron.daily
+# 42 7 * * 7 root cd / && run-parts /etc/cron.weekly
+# 55 7 1 * * root cd / && run-parts /etc/cron.monthly
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.0.bb b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.0.bb
new file mode 100644
index 000000000..697501ac1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cronie/cronie_1.5.0.bb
@@ -0,0 +1,81 @@
+SUMMARY = "Cron daemon for executing programs at set times"
+DESCRIPTION = "Cronie contains the standard UNIX daemon crond that runs \
+specified programs at scheduled times and related tools. It is based on the \
+original cron and has security and configuration enhancements like the \
+ability to use pam and SELinux."
+HOMEPAGE = "https://fedorahosted.org/cronie/"
+BUGTRACKER = "https://bugzilla.redhat.com"
+
+# Internet Systems Consortium License
+LICENSE = "ISC & BSD-3-Clause & BSD-2-Clause & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=dd2a592170760e1386c769e1043b3722 \
+ file://src/cron.c;endline=20;md5=b425c334265026177128353a142633b4 \
+ file://src/popen.c;beginline=3;endline=31;md5=edd50742d8def712e9472dba353668a9"
+
+SECTION = "utils"
+
+SRC_URI = "https://fedorahosted.org/releases/c/r/cronie/cronie-${PV}.tar.gz \
+ file://crond.init \
+ file://crontab \
+ file://crond.service \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
+
+PAM_SRC_URI = "file://crond_pam_config.patch"
+PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid"
+
+SRC_URI[md5sum] = "9db75e1884d83a45e002d145c6c54d45"
+SRC_URI[sha256sum] = "9cf0e3f4f5042a9c09413d62c8e0c055e12401f70b112465f0f81f2c84ebfb3f"
+
+inherit autotools update-rc.d useradd systemd
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+
+PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}"
+
+INITSCRIPT_NAME = "crond"
+INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ."
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system crontab"
+
+SYSTEMD_SERVICE_${PN} = "crond.service"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/sysconfig/
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond
+ install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond
+
+ # install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/crond.service
+
+ # below are necessary for a complete cron environment
+ install -d ${D}${localstatedir}/spool/cron
+ install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/
+ mkdir -p ${D}${sysconfdir}/cron.d
+ mkdir -p ${D}${sysconfdir}/cron.hourly
+ mkdir -p ${D}${sysconfdir}/cron.daily
+ mkdir -p ${D}${sysconfdir}/cron.weekly
+ mkdir -p ${D}${sysconfdir}/cron.monthly
+ touch ${D}${sysconfdir}/cron.deny
+
+ # below setting is necessary to allow normal user using crontab
+
+ # setgid for crontab binary
+ chown root:crontab ${D}${bindir}/crontab
+ chmod 2755 ${D}${bindir}/crontab
+
+ # allow 'crontab' group write to /var/spool/cron
+ chown root:crontab ${D}${localstatedir}/spool/cron
+ chmod 770 ${D}${localstatedir}/spool/cron
+
+ chmod 600 ${D}${sysconfdir}/crontab
+}
+
+FILES_${PN} += "${sysconfdir}/cron*"
+CONFFILES_${PN} += "${sysconfdir}/crontab"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc b/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc
new file mode 100644
index 000000000..4b2d21409
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cups/cups.inc
@@ -0,0 +1,116 @@
+SUMMARY = "An Internet printing system for Unix"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & LGPLv2"
+DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb"
+
+SRC_URI = "https://www.cups.org/software/${PV}/${BP}-source.tar.bz2 \
+ file://use_echo_only_in_init.patch \
+ file://0001-don-t-try-to-run-generated-binaries.patch \
+ file://cups_serverbin.patch \
+ "
+
+UPSTREAM_CHECK_URI = "http://www.cups.org/software.php"
+UPSTREAM_CHECK_REGEX = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
+
+LEAD_SONAME = "libcupsdriver.so"
+
+CLEANBROKEN = "1"
+
+inherit autotools-brokensep binconfig useradd systemd
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system lpadmin"
+
+SYSTEMD_SERVICE_${PN} = "org.cups.cupsd.socket org.cups.cupsd.path org.cups.cupsd.service org.cups.cups-lpd.socket org.cups.cups-lpd@.service"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
+PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam"
+PACKAGECONFIG[systemd] = "--with-systemd=${systemd_system_unitdir},--without-systemd,systemd"
+PACKAGECONFIG[xinetd] = "--with-xinetd=${sysconfdir}/xinetd.d,--without-xinetd,xinetd"
+
+EXTRA_OECONF = " \
+ --enable-gnutls \
+ --enable-dbus \
+ --enable-browsing \
+ --disable-gssapi \
+ --enable-debug \
+ --disable-relro \
+ --enable-libusb \
+ --without-php \
+ --without-perl \
+ --without-python \
+ --without-java \
+ "
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+do_compile () {
+ echo "all:" > man/Makefile
+ echo "libs:" >> man/Makefile
+ echo "install:" >> man/Makefile
+ echo "install-data:" >> man/Makefile
+ echo "install-exec:" >> man/Makefile
+ echo "install-headers:" >> man/Makefile
+ echo "install-libs:" >> man/Makefile
+
+ oe_runmake
+}
+
+do_install () {
+ oe_runmake "DSTROOT=${D}" install
+
+ # Remove /var/run from package as cupsd will populate it on startup
+ rm -fr ${D}/${localstatedir}/run
+ rmdir ${D}/${libdir}/${BPN}/driver
+
+ # Fix the pam configuration file permissions
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
+ chmod 0644 ${D}${sysconfdir}/pam.d/cups
+ fi
+
+ # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
+ rm -rf ${D}${sysconfdir}/init.d/
+ rm -rf ${D}${sysconfdir}/rc*
+ fi
+}
+
+python do_package_append() {
+ import subprocess
+ # Change permissions back the way they were, they probably had a reason...
+ workdir = d.getVar('WORKDIR', True)
+ subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True)
+}
+
+PACKAGES =+ "${PN}-lib ${PN}-libimage"
+
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
+FILES_${PN} += "${libdir}/cups/backend \
+ ${libdir}/cups/cgi-bin \
+ ${libdir}/cups/filter \
+ ${libdir}/cups/monitor \
+ ${libdir}/cups/notifier \
+ ${libdir}/cups/daemon \
+ "
+
+FILES_${PN}-lib = "${libdir}/libcups.so.*"
+
+FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
+
+#package the html for the webgui inside the main packages (~1MB uncompressed)
+
+FILES_${PN} += "${datadir}/doc/cups/images \
+ ${datadir}/doc/cups/*html \
+ ${datadir}/doc/cups/*.css \
+ ${datadir}/icons/ \
+ "
+CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
+
+SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
+cups_sysroot_preprocess () {
+ sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:'
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch b/import-layers/yocto-poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch
new file mode 100644
index 000000000..5379eb6aa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch
@@ -0,0 +1,69 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+From 90069586167b930befce7303aea57078f04b4ed8 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Sun, 30 Jan 2011 16:37:27 +0100
+Subject: [PATCH] don't try to run generated binaries
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ ppdc/Makefile | 30 +++++++++++++++---------------
+ 1 files changed, 15 insertions(+), 15 deletions(-)
+
+Index: cups-2.0.0/ppdc/Makefile
+===================================================================
+--- cups-2.0.0.orig/ppdc/Makefile
++++ cups-2.0.0/ppdc/Makefile
+@@ -242,8 +242,8 @@ genstrings: genstrings.o libcupsppdc.a
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \
+ libcupsppdc.a ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \
+ $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+- echo Generating localization strings...
+- ./genstrings >sample.c
++# echo Generating localization strings...
++# ./genstrings >sample.c
+
+
+ #
+@@ -260,9 +260,9 @@ ppdc-static: ppdc.o libcupsppdc.a ../cu
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \
+ ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
+- echo Testing PPD compiler...
+- ./ppdc-static -l en,fr -I ../data foo.drv
+- ./ppdc-static -l en,fr -z -I ../data foo.drv
++# echo Testing PPD compiler...
++# ./ppdc-static -l en,fr -I ../data foo.drv
++# ./ppdc-static -l en,fr -z -I ../data foo.drv
+
+
+ #
+@@ -288,17 +288,17 @@ ppdi-static: ppdc-static ppdi.o libcups
+ $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdi-static ppdi.o libcupsppdc.a \
+ ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
+- echo Testing PPD importer...
+- $(RM) -r ppd ppd2 sample-import.drv
+- ./ppdc-static -l en -I ../data sample.drv
+- ./ppdi-static -I ../data -o sample-import.drv ppd/*
+- ./ppdc-static -l en -I ../data -d ppd2 sample-import.drv
+- if diff -r ppd ppd2 >/dev/null; then \
+- echo PPD import OK; \
+- else \
+- echo PPD import FAILED; \
+- exit 1; \
+- fi
++# echo Testing PPD importer...
++# $(RM) -r ppd ppd2 sample-import.drv
++# ./ppdc-static -l en -I ../data sample.drv
++# ./ppdi-static -I ../data -o sample-import.drv ppd/*
++# ./ppdc-static -l en -I ../data -d ppd2 sample-import.drv
++# if diff -r ppd ppd2 >/dev/null; then \
++# echo PPD import OK; \
++# else \
++# echo PPD import FAILED; \
++# exit 1; \
++# fi
+
+
+ #
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cups/cups/cups_serverbin.patch b/import-layers/yocto-poky/meta/recipes-extended/cups/cups/cups_serverbin.patch
new file mode 100644
index 000000000..f7b44a7bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cups/cups/cups_serverbin.patch
@@ -0,0 +1,32 @@
+Make CUPS_SERVERBIN relative to libdir otherwise on 64bit arches
+e.g. ppc64 where base libdir is lib64 this does not go well
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate [OE config specific]
+
+Index: cups-1.4.6/config-scripts/cups-directories.m4
+===================================================================
+--- cups-1.4.6.orig/config-scripts/cups-directories.m4 2009-04-12 16:04:51.000000000 -0700
++++ cups-1.4.6/config-scripts/cups-directories.m4 2012-07-21 12:12:05.896405923 -0700
+@@ -397,7 +397,7 @@
+ *)
+ # All others
+ INSTALL_SYSV="install-sysv"
+- CUPS_SERVERBIN="$exec_prefix/lib/cups"
++ CUPS_SERVERBIN="$libdir/cups"
+ ;;
+ esac
+
+Index: cups-1.4.6/configure
+===================================================================
+--- cups-1.4.6.orig/configure 2012-07-21 12:13:34.512405950 -0700
++++ cups-1.4.6/configure 2012-07-21 12:14:05.724406017 -0700
+@@ -11181,7 +11181,7 @@
+ *)
+ # All others
+ INSTALL_SYSV="install-sysv"
+- CUPS_SERVERBIN="$exec_prefix/lib/cups"
++ CUPS_SERVERBIN="$libdir/cups"
+ ;;
+ esac
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch b/import-layers/yocto-poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch
new file mode 100644
index 000000000..696f1374d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: cups-1.6.1/scheduler/cups.sh.in
+===================================================================
+--- cups-1.6.1.orig/scheduler/cups.sh.in
++++ cups-1.6.1/scheduler/cups.sh.in
+@@ -67,7 +67,7 @@ case "`uname`" in
+ ECHO_ERROR=:
+ ;;
+
+- Linux*)
++ DisableLinux*)
+ IS_ON=/bin/true
+ if test -f /etc/init.d/functions; then
+ . /etc/init.d/functions
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.3.bb b/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.3.bb
new file mode 100644
index 000000000..aef211d91
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cups/cups_2.1.3.bb
@@ -0,0 +1,6 @@
+require cups.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=6c5a350596fba02754bd96eb6df3afd0"
+
+SRC_URI[md5sum] = "62b8fafd590e75f72316915790b0850a"
+SRC_URI[sha256sum] = "36a70d43584aea2617da914b9331e23341c3501a8254c4d2eae9c11ec01fd4d3"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb b/import-layers/yocto-poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb
new file mode 100644
index 000000000..65a99fc28
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Collection of autoconf m4 macros"
+SECTION = "base"
+HOMEPAGE = "http://sourceforge.net/projects/cwautomacros.berlios/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}.berlios/${BP}.tar.bz2"
+SRC_URI[md5sum] = "074afcb50d0a8bff10786a2954b2b02d"
+SRC_URI[sha256sum] = "3115603b891f3a163c0bbb5fea2f3742113a183fa6745ee5e89e5f6d0e9f6121"
+
+do_configure() {
+ :
+}
+
+do_install() {
+ oe_runmake CWAUTOMACROSPREFIX=${D}${prefix} install
+
+ # cleanup buildpaths in autogen.sh
+ sed -i -e 's,${D},,g' ${D}${prefix}/share/cwautomacros/scripts/autogen.sh
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..cc05d1dc0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.ac:90: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| /srv/home/nitin/builds/build-gcc47/tmp/work/i586-poky-linux/diffutils-2.8.1-r4/diffutils-2.8.1/m4/prereq.m4:110: jm_PREREQ_QUOTEARG is expanded from...
+| configure.ac:90: the top level
+| autom4te: m4 failed with exit status: 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: diffutils-2.8.1/m4/prereq.m4
+===================================================================
+--- diffutils-2.8.1.orig/m4/prereq.m4
++++ diffutils-2.8.1/m4/prereq.m4
+@@ -115,7 +115,6 @@ AC_DEFUN([jm_PREREQ_QUOTEARG],
+ AC_HEADER_STDC
+ AC_C_BACKSLASH_A
+ AC_MBSTATE_T
+- AM_C_PROTOTYPES
+ ])
+
+ AC_DEFUN([jm_PREREQ_REGEX],
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest
new file mode 100644
index 000000000..695c5e8a7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C tests check-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils.inc b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils.inc
new file mode 100644
index 000000000..243341aa9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils.inc
@@ -0,0 +1,18 @@
+SUMMARY = "Diffutils contains tools used for finding differences between files"
+DESCRIPTION = "Diffutils contains the GNU diff, diff3, \
+sdiff, and cmp utilities. These programs are usually \
+used for creating patch files."
+SECTION = "base"
+
+inherit autotools texinfo update-alternatives gettext
+
+# diffutils assumes non-glibc compilation with uclibc and
+# this causes it to generate its own implementations of
+# standard functionality. regex.c actually breaks compilation
+# because it uses __mempcpy, there are other things (TBD:
+# see diffutils.mk in buildroot)
+EXTRA_OECONF_libc-uclibc = "--without-included-regex"
+
+ALTERNATIVE_${PN} = "diff cmp"
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
new file mode 100644
index 000000000..bf425bbb3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
@@ -0,0 +1,16 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+require diffutils.inc
+
+PR = "r7.0"
+
+SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.gz \
+ file://diffutils_fix_for_automake-1.12.patch"
+
+SRC_URI[md5sum] = "71f9c5ae19b60608f6c7f162da86a428"
+SRC_URI[sha256sum] = "c5001748b069224dd98bf1bb9ee877321c7de8b332c8aad5af3e2a7372d23f5a"
+
+do_configure_prepend () {
+ chmod u+w ${S}/po/Makefile.in.in
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.3.bb b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.3.bb
new file mode 100644
index 000000000..5008690ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/diffutils/diffutils_3.3.bb
@@ -0,0 +1,37 @@
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+require diffutils.inc
+
+SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://run-ptest \
+"
+
+EXTRA_OECONF += "--without-libsigsegv-prefix"
+
+do_configure_prepend () {
+ # Need to remove gettext macros with weird mix of versions
+ for i in codeset.m4 gettext_gl.m4 intlmacosx.m4 inttypes-pri.m4 lib-ld_gl.m4 lib-prefix_gl.m4 po_gl.m4 ssize_t.m4 wchar_t.m4 wint_t.m4; do
+ rm -f ${S}/m4/$i
+ done
+}
+
+SRC_URI[md5sum] = "99180208ec2a82ce71f55b0d7389f1b3"
+SRC_URI[sha256sum] = "a25e89a8ab65fded1731e4186be1bb25cda967834b6df973599cdcd5abdfc19c"
+
+inherit ptest
+
+do_install_ptest() {
+ t=${D}${PTEST_PATH}
+ install -D ${S}/build-aux/test-driver $t/build-aux/test-driver
+ cp -r ${S}/tests $t/
+ install ${B}/tests/Makefile $t/tests/
+ sed -e 's|^Makefile:|_Makefile:|' \
+ -e 's|bash|sh|' \
+ -e 's|^top_srcdir = \(.*\)|top_srcdir = ..\/|' \
+ -e 's|^srcdir = \(.*\)|srcdir = .|' \
+ -e 's|"`$(built_programs)`"|diff|' \
+ -e 's|gawk|awk|g' \
+ -i $t/tests/Makefile
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb
new file mode 100644
index 000000000..e2df13f4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_0.5.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Line-oriented text editor"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6ddd5335ef96fb858a138230af773710 \
+ file://main.c;beginline=1;endline=17;md5=36d4b85e5ae9028e918d1cc775c2475e"
+
+PR = "r2"
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/ed/ed-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "4ee21e9dcc9b5b6012c23038734e1632"
+SRC_URI[sha256sum] = "edef2bbde0fbf0d88232782a0eded323f483a0519d6fde9a3b1809056fd35f3e"
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "'CC=${CC}' 'CXX=${CXX}' 'CFLAGS=${CFLAGS}' 'CXXFLAGS=${CXXFLAGS}' 'CPPFLAGS=${CPPFLAGS}' 'LDFLAGS=${LDFLAGS}'"
+
+CONFIGUREOPTS_remove = "--disable-dependency-tracking"
+CONFIGUREOPTS_remove = "--disable-silent-rules"
+EXTRA_OECONF_remove = "--disable-static"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb
new file mode 100644
index 000000000..f2ec42ad1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ed/ed_1.9.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Line-oriented text editor"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+ file://ed.h;endline=20;md5=375a20cc2545ac1115eeb7b323c60ae3 \
+ file://main.c;endline=17;md5=14dbb325c1f2d4daf50e0aa5c5038e96"
+
+SECTION = "base"
+
+# LSB states that ed should be in /bin/
+bindir = "${base_bindir}"
+
+SRC_URI = "${GNU_MIRROR}/ed/ed-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "565b6d1d5a9a8816b9b304fc4ed9405d"
+SRC_URI[sha256sum] = "d5b372cfadf073001823772272fceac2cfa87552c5cd5a8efc1c8aae61f45a88"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+inherit texinfo
+
+do_configure() {
+ ${S}/configure
+}
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch
new file mode 100644
index 000000000..bf66267e8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch
@@ -0,0 +1,19 @@
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Inappropriate
+(default automake behavior incompatible with ptest)
+
+diff -ruN a/configure.ac b/configure.ac
+--- a/configure.ac 2014-05-28 18:19:13.513980977 +0200
++++ b/configure.ac 2014-05-28 18:19:21.129660215 +0200
+@@ -2,7 +2,7 @@
+ AC_INIT(ethtool, 3.14, netdev@vger.kernel.org)
+ AC_PREREQ(2.52)
+ AC_CONFIG_SRCDIR([ethtool.c])
+-AM_INIT_AUTOMAKE([gnu])
++AM_INIT_AUTOMAKE([gnu serial-tests])
+ AC_CONFIG_HEADERS([ethtool-config.h])
+
+ AM_MAINTAINER_MODE
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/run-ptest
new file mode 100644
index 000000000..1e245da11
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.2.bb b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.2.bb
new file mode 100644
index 000000000..95df784c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ethtool/ethtool_4.2.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Display or change ethernet card settings"
+DESCRIPTION = "A small utility for examining and tuning the settings of your ethernet-based network interfaces."
+HOMEPAGE = "http://www.kernel.org/pub/software/network/ethtool/"
+SECTION = "console/network"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://ethtool.c;beginline=4;endline=17;md5=c19b30548c582577fc6b443626fc1216"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/network/ethtool/ethtool-${PV}.tar.gz \
+ file://run-ptest \
+ file://avoid_parallel_tests.patch \
+ "
+
+SRC_URI[md5sum] = "5b55f7cd76e901dfc2738ac22cab96ca"
+SRC_URI[sha256sum] = "f84226db8dd18afaf91d8d00f5cb8f87ec3d7f787d2a3605de08d6dfa95ab8ef"
+
+inherit autotools ptest
+RDEPENDS_${PN}-ptest += "make"
+
+do_compile_ptest() {
+ oe_runmake buildtest-TESTS
+}
+
+do_install_ptest () {
+ cp ${B}/Makefile ${D}${PTEST_PATH}
+ install ${B}/test-cmdline ${D}${PTEST_PATH}
+ install ${B}/test-features ${D}${PTEST_PATH}
+ install ${B}/ethtool ${D}${PTEST_PATH}/ethtool
+ sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
new file mode 100644
index 000000000..2076e4409
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
@@ -0,0 +1,53 @@
+From 33cba24cba7b0973a702e9627bd5b93962948ae4 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 17 Sep 2013 16:11:16 +0800
+Subject: [PATCH] findutils: fix doc build error
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ doc/find.texi | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/doc/find.texi b/doc/find.texi
+index 5b5f0cf..b3d9c6b 100644
+--- a/doc/find.texi
++++ b/doc/find.texi
+@@ -63,7 +63,7 @@ translation approved by the Foundation.
+
+ @page
+ @vskip 0pt plus 1filll
+-@insertcopying{}
++@insertcopying
+ @end titlepage
+
+ @contents
+@@ -1466,6 +1466,7 @@ no output is ever sent to it.
+ * Escapes::
+ * Format Directives::
+ * Time Formats::
++* Formatting Flags::
+ @end menu
+
+ @node Escapes
+@@ -1534,7 +1535,6 @@ from the novel you are reading.
+ * Size Directives::
+ * Location Directives::
+ * Time Directives::
+-* Formatting Flags::
+ @end menu
+
+ @node Name Directives
+@@ -1780,7 +1780,7 @@ setting the TZ environment variable). This is a GNU extension.
+ @end table
+
+ @node Formatting Flags
+-@subsubsection Formatting Flags
++@subsection Formatting Flags
+
+ The @samp{%m} and @samp{%d} directives support the @samp{#}, @samp{0}
+ and @samp{+} flags, but the other directives do not, even if they
+--
+1.7.4.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..2d0ddb43f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:75: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: findutils-4.2.31/configure.in
+===================================================================
+--- findutils-4.2.31.orig/configure.in
++++ findutils-4.2.31/configure.in
+@@ -72,7 +72,6 @@ dnl gl_EARLY calls AC_GNU_SOURCE anyway.
+
+
+ AC_ISC_POSIX
+-AM_C_PROTOTYPES
+
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
new file mode 100644
index 000000000..65bd64277
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
@@ -0,0 +1,56 @@
+Upstream-Status: Inappropriate [legacy version]
+
+the old AC_USE_SYSTEM_EXTENSIONS won't work with AC_GNU_SOURCE
+
+against 4.2.31
+07/08/2010 - qhe
+
+diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4
+index 143a9e5..0f27ceb 100644
+--- a/gnulib/m4/extensions.m4
++++ b/gnulib/m4/extensions.m4
+@@ -12,44 +12,6 @@
+ # enough in this area it's likely we'll need to redefine
+ # AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+- AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+- AC_REQUIRE([AC_GNU_SOURCE])
+- AC_REQUIRE([AC_AIX])
+- AC_REQUIRE([AC_MINIX])
+-
+- AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris. */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+- [ac_cv_safe_to_define___extensions__],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+-# define __EXTENSIONS__ 1
+- AC_INCLUDES_DEFAULT])],
+- [ac_cv_safe_to_define___extensions__=yes],
+- [ac_cv_safe_to_define___extensions__=no])])
+- test $ac_cv_safe_to_define___extensions__ = yes &&
+- AC_DEFINE([__EXTENSIONS__])
+- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+- AC_DEFINE([_TANDEM_SOURCE])
+-])
+-
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils.inc b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils.inc
new file mode 100644
index 000000000..bfedf874b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils.inc
@@ -0,0 +1,23 @@
+SUMMARY = "find, locate, and xargs binaries"
+DESCRIPTION = "The GNU Find Utilities are the basic directory searching utilities of the GNU operating system. \
+These programs are typically used in conjunction with other programs to provide modular and powerful directory \
+search and file locating capabilities to other commands."
+HOMEPAGE = "http://www.gnu.org/software/findutils/"
+BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils"
+SECTION = "console/utils"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz"
+
+inherit autotools gettext texinfo update-alternatives upstream-version-is-even
+
+ALTERNATIVE_${PN} = "find xargs"
+ALTERNATIVE_PRIORITY = "100"
+
+# diffutils assumes non-glibc compilation with uclibc and
+# this causes it to generate its own implementations of
+# standard functionality. regex.c actually breaks compilation
+# because it uses __mempcpy, there are other things (TBD:
+# see diffutils.mk in buildroot)
+EXTRA_OECONF_libc-uclibc = "--without-included-regex"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..8729e1b44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: findutils-4.5.14/gl/lib/Makefile.am
+===================================================================
+--- findutils-4.5.14.orig/gl/lib/Makefile.am
++++ findutils-4.5.14/gl/lib/Makefile.am
+@@ -1220,7 +1220,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb
new file mode 100644
index 000000000..7dee01883
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.2.31.bb
@@ -0,0 +1,14 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+PR = "r4"
+
+require findutils.inc
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
+ file://gnulib-extension.patch \
+ file://findutils_fix_for_automake-1.12.patch \
+ file://findutils-fix-doc-build-error.patch \
+ "
+
+SRC_URI[md5sum] = "a0e31a0f18a49709bf5a449867c8049a"
+SRC_URI[sha256sum] = "e0d34b8faca0b3cca0703f6c6b498afbe72f0ba16c35980c10ec9ef7724d6204"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.6.0.bb
new file mode 100644
index 000000000..072d3b3c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/findutils/findutils_4.6.0.bb
@@ -0,0 +1,17 @@
+require findutils.inc
+
+# GPLv2+ (<< 4.2.32), GPLv3+ (>= 4.2.32)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
+
+DEPENDS = "bison-native"
+
+SRC_URI += "file://0001-Unset-need_charset_alias-when-building-for-musl.patch"
+
+SRC_URI[md5sum] = "9936aa8009438ce185bea2694a997fc1"
+SRC_URI[sha256sum] = "ded4c9f73731cd48fec3b6bdaccce896473b6d8e337e9612e16cf1431bb1169d"
+
+# http://savannah.gnu.org/bugs/?27299
+CACHED_CONFIGUREVARS += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', 'gl_cv_func_wcwidth_works=yes', '', d)}"
+
+EXTRA_OECONF += "ac_cv_path_SORT=${bindir}/sort"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb b/import-layers/yocto-poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb
new file mode 100644
index 000000000..0cffedd66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb
@@ -0,0 +1,39 @@
+SUMMARY = "OpenPrinting printer support - filters"
+DESCRIPTION = "Foomatic is a printer database designed to make it easier to set up \
+common printers for use with UNIX-like operating systems.\
+It provides the "glue" between a print spooler (like CUPS or lpr) and \
+the printer, by processing files sent to the printer. \
+ \
+This package consists of filters used by the printer spoolers \
+to convert the incoming PostScript data into the printer's native \
+format using a printer-specific, but spooler-independent PPD file. \
+"
+
+DEPENDS += "cups perl libxml2"
+PR = "r1"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/foomatic-filters-${PV}/COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRC_URI = "http://www.openprinting.org/download/foomatic/foomatic-filters-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "b05f5dcbfe359f198eef3df5b283d896"
+SRC_URI[sha256sum] = "a2e2e53e502571e88eeb9010c45a0d54671f15707ee104f5c9c22b59ea7a33e3"
+
+UPSTREAM_CHECK_REGEX = "foomatic-filters-(?P<pver>((\d|\d\d)\.*)+)\.tar\.gz"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--disable-file-converter-check --with-file-converter=texttops"
+
+do_configure_prepend() {
+ export PERL="${bindir}/env perl"
+ export CUPS_SERVERBIN=${exec_prefix}/lib/cups # /usr/lib NOT libdir
+}
+
+do_install_append_linuxstdbase() {
+ install -d ${D}${exec_prefix}/lib/cups/filter
+ ln -sf ${bindir}/foomatic-rip ${D}${exec_prefix}/lib/cups/filter
+}
+
+FILES_${PN} += "${exec_prefix}/lib/cups/ ${exec_prefix}/lib/ppr/"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..b3e7987ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.ac:127: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| configure.ac:127: the top level
+| autom4te: m4 failed with exit status: 1
+...
+| Makefile.am:27: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: gawk-3.1.5/configure.ac
+===================================================================
+--- gawk-3.1.5.orig/configure.ac
++++ gawk-3.1.5/configure.ac
+@@ -124,7 +124,6 @@ fi
+
+ dnl check for C compiler for automake
+ AM_PROG_CC_STDC
+-AM_C_PROTOTYPES
+
+ dnl Cygwin doesn't like to get libs with full paths
+ dnl since that overrides linking against DLLs.
+Index: gawk-3.1.5/Makefile.am
+===================================================================
+--- gawk-3.1.5.orig/Makefile.am
++++ gawk-3.1.5/Makefile.am
+@@ -24,7 +24,7 @@
+ ## process this file with automake to produce Makefile.in
+
+ # Automatic de-ANSI-fication if needed, make .bz2 files also.
+-AUTOMAKE_OPTIONS = ansi2knr dist-bzip2
++AUTOMAKE_OPTIONS = dist-bzip2
+
+ # This undocumented variable insures that aclocal runs
+ # correctly after changing configure.ac
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest
new file mode 100644
index 000000000..d23f0bf6d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+cd test
+for i in `grep -vE "@|^$|#|Gt-dummy" Maketests |awk -F: '{print $1}'`; \
+ do LC_ALL=${GAWKLOCALE:-C} LANG=${GAWKLOCALE:-C} srcdir=`pwd` AWK=gawk CMP=cmp \
+ make -f Maketests $i >$i.tmp 2>&1; \
+ grep -q "Error" $i.tmp; \
+ if [ $? -eq 0 ]; then echo "FAIL: $i"; \
+ else echo "PASS: $i"; rm -f $i.tmp; fi; \
+done
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb
new file mode 100644
index 000000000..7c92bded3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_3.1.5.bb
@@ -0,0 +1,41 @@
+SUMMARY = "GNU awk text processing utility"
+DESCRIPTION = "The GNU version of awk, a text processing utility. \
+Awk interprets a special-purpose programming language to do \
+quick and easy text pattern matching and reformatting jobs."
+HOMEPAGE = "www.gnu.org/software/gawk"
+BUGTRACKER = "bug-gawk@gnu.org"
+SECTION = "console/utils"
+
+# gawk <= 3.1.5: GPLv2
+# gawk >= 3.1.6: GPLv3
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+RDEPENDS_gawk += "gawk-common"
+RDEPENDS_pgawk += "gawk-common"
+PR = "r2"
+
+SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
+ file://gawk-3.1.5_fix_for_automake-1.12.patch"
+
+SRC_URI[md5sum] = "4760325489479cac17fe0114b8f62f30"
+SRC_URI[sha256sum] = "463dcb9d0ca398b1d4f5a332f6cd9cec56441265fca616f2ea1b44d459e9f0f8"
+
+inherit autotools gettext texinfo update-alternatives
+
+PACKAGES += "gawk-common pgawk"
+
+FILES_${PN} = "${bindir}/gawk* ${bindir}/igawk"
+FILES_gawk-common += "${datadir}/awk/* ${libexecdir}/awk/*"
+FILES_pgawk = "${bindir}/pgawk*"
+
+ALTERNATIVE_${PN} = "awk"
+ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
+ALTERNATIVE_PRIORITY = "100"
+
+CFLAGS += "-D PROTOTYPES"
+
+do_install_append() {
+ # remove the link since we don't package it
+ rm ${D}${bindir}/awk
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb
new file mode 100644
index 000000000..6ca7f3ef4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gawk/gawk_4.1.3.bb
@@ -0,0 +1,46 @@
+SUMMARY = "GNU awk text processing utility"
+DESCRIPTION = "The GNU version of awk, a text processing utility. \
+Awk interprets a special-purpose programming language to do \
+quick and easy text pattern matching and reformatting jobs."
+HOMEPAGE = "https://www.gnu.org/software/gawk/"
+BUGTRACKER = "bug-gawk@gnu.org"
+SECTION = "console/utils"
+
+# gawk <= 3.1.5: GPLv2
+# gawk >= 3.1.6: GPLv3
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS += "readline"
+
+PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
+
+SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "55d37f4069502677f25d1340df8eec97"
+SRC_URI[sha256sum] = "524effa5b9ecd4ed940f2581c5d3c1df4e4bd7e6f768aa033c1916f47dfc6e29"
+
+inherit autotools gettext texinfo update-alternatives
+
+FILES_${PN} += "${datadir}/awk"
+FILES_${PN}-dev += "${libdir}/${BPN}/*.la"
+
+ALTERNATIVE_${PN} = "awk"
+ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install_append() {
+ # remove the link since we don't package it
+ rm ${D}${bindir}/awk
+}
+
+inherit ptest
+
+do_install_ptest() {
+ mkdir ${D}${PTEST_PATH}/test
+ for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests; \
+ do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch
new file mode 100644
index 000000000..d586a1d6d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch
@@ -0,0 +1,81 @@
+From 1d19998091154f89b8294e4594a05986b4c2f822 Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Wed, 13 Jan 2016 02:08:42 -0500
+Subject: [PATCH 1/2] Bug 696497: Fix support for building with no jbig2
+ decoder
+
+Author: Chris Liddell <chris.liddell@artifex.com>
+
+Upstream-Status: Backport
+http://bugs.ghostscript.com/show_bug.cgi?id=696497
+http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=b0f5a975
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ base/lib.mak | 9 +++++++++
+ psi/int.mak | 23 ++++++++++++++++++-----
+ 2 files changed, 27 insertions(+), 5 deletions(-)
+
+diff --git a/base/lib.mak b/base/lib.mak
+index 241df2f..daa7056 100644
+--- a/base/lib.mak
++++ b/base/lib.mak
+@@ -1732,6 +1732,10 @@ $(GLD)sjbig2_jbig2dec.dev : $(LIB_MAK) $(ECHOGS_XE) \
+ $(SETMOD) $(GLD)sjbig2_jbig2dec $(sjbig2_jbig2dec)
+ $(ADDMOD) $(GLD)sjbig2_jbig2dec -include $(GLD)jbig2dec.dev
+
++$(GLD)sjbig2_.dev : $(LIB_MAK) $(ECHOGS_XE) \
++ $(LIB_MAK) $(MAKEDIRS)
++ $(SETMOD) $(GLD)sjbig2_
++
+ # jbig2dec.dev is defined in jbig2.mak
+
+ $(GLOBJ)sjbig2.$(OBJ) : $(GLSRC)sjbig2.c $(AK) \
+@@ -1739,6 +1743,11 @@ $(GLOBJ)sjbig2.$(OBJ) : $(GLSRC)sjbig2.c $(AK) \
+ $(sjbig2_h) $(strimpl_h) $(MAKEDIRS)
+ $(GLJBIG2CC) $(GLO_)sjbig2.$(OBJ) $(C_) $(GLSRC)sjbig2.c
+
++$(GLOBJ)snojbig2.$(OBJ) : $(GLSRC)snojbig2.c $(AK) \
++ $(stdint__h) $(memory__h) $(stdio__h) $(gserrors_h) $(gdebug_h) \
++ $(strimpl_h) $(LIB_MAK) $(MAKEDIRS)
++ $(GLJBIG2CC) $(GLO_)snojbig2.$(OBJ) $(C_) $(GLSRC)snojbig2.c
++
+ # luratech version
+ sjbig2_luratech=$(GLOBJ)sjbig2_luratech.$(OBJ)
+
+diff --git a/psi/int.mak b/psi/int.mak
+index 6149a3b..f9d667d 100644
+--- a/psi/int.mak
++++ b/psi/int.mak
+@@ -1254,11 +1254,24 @@ $(PSOBJ)zfaes.$(OBJ) : $(PSSRC)zfaes.c $(OP) $(memory__h)\
+ # this can be turned on and off with a FEATURE_DEV
+
+ fjbig2_=$(PSOBJ)zfjbig2_$(JBIG2_LIB).$(OBJ)
+-$(PSD)jbig2.dev : $(INT_MAK) $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\
+- $(MAKEDIRS)
+- $(SETMOD) $(PSD)jbig2 $(fjbig2_)
+- $(ADDMOD) $(PSD)jbig2 -include $(GLD)sjbig2
+- $(ADDMOD) $(PSD)jbig2 -oper zfjbig2
++
++$(PSD)jbig2_jbig2dec.dev : $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\
++ $(INT_MAK) $(MAKEDIRS)
++ $(SETMOD) $(PSD)jbig2_jbig2dec $(fjbig2_)
++ $(ADDMOD) $(PSD)jbig2_jbig2dec -include $(GLD)sjbig2
++ $(ADDMOD) $(PSD)jbig2_jbig2dec -oper zfjbig2
++
++$(PSD)jbig2_luratech.dev : $(ECHOGS_XE) $(fjbig2_) $(GLD)sjbig2.dev\
++ $(INT_MAK) $(MAKEDIRS)
++ $(SETMOD) $(PSD)jbig2_luratech $(fjbig2_)
++ $(ADDMOD) $(PSD)jbig2_luratech -include $(GLD)sjbig2
++ $(ADDMOD) $(PSD)jbig2_luratech -oper zfjbig2
++
++$(PSD)jbig2_.dev : $(ECHOGS_XE) $(INT_MAK) $(MAKEDIRS)
++ $(SETMOD) $(PSD)jbig2_
++
++$(PSD)jbig2.dev : $(PSD)jbig2_$(JBIG2_LIB).dev $(INT_MAK) $(MAKEDIRS)
++ $(CP_) $(PSD)jbig2_$(JBIG2_LIB).dev $(PSD)jbig2.dev
+
+ $(PSOBJ)zfjbig2_jbig2dec.$(OBJ) : $(PSSRC)zfjbig2.c $(OP) $(memory__h)\
+ $(gsstruct_h) $(gstypes_h) $(ialloc_h) $(idict_h) $(ifilter_h)\
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch
new file mode 100644
index 000000000..fcfc479fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch
@@ -0,0 +1,48 @@
+From 3b43f93ec02611c4d554612953f5b64765b8683b Mon Sep 17 00:00:00 2001
+From: Chris Liddell <chris.liddell@artifex.com>
+Date: Wed, 13 Jan 2016 02:14:55 -0500
+Subject: [PATCH 2/2] Bug 696497 (part 2): fix support for building with a JPX
+ decoder
+
+Author: Chris Liddell <chris.liddell@artifex.com>
+
+Upstream-Status: Backport
+http://bugs.ghostscript.com/show_bug.cgi?id=696497
+http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=b0f5a975
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ base/lib.mak | 3 +++
+ psi/int.mak | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/base/lib.mak b/base/lib.mak
+index daa7056..8853dd5 100644
+--- a/base/lib.mak
++++ b/base/lib.mak
+@@ -1774,6 +1774,9 @@ $(GLOBJ)sjpx.$(OBJ) : $(GLSRC)sjpx.c $(AK) \
+ $(gdebug_h) $(strimpl_h) $(sjpx_h) $(MAKEDIRS)
+ $(GLJASCC) $(GLO_)sjpx.$(OBJ) $(C_) $(GLSRC)sjpx.c
+
++$(GLD)sjpx_.dev : $(LIB_MAK) $(ECHOGS_XE) $(LIB_MAK) $(MAKEDIRS)
++ $(SETMOD) $(GLD)sjpx_
++
+ # luratech version
+ sjpx_luratech=$(GLOBJ)sjpx_luratech.$(OBJ)
+ $(GLD)sjpx_luratech.dev : $(LIB_MAK) $(ECHOGS_XE) \
+diff --git a/psi/int.mak b/psi/int.mak
+index f9d667d..db01b65 100644
+--- a/psi/int.mak
++++ b/psi/int.mak
+@@ -1290,6 +1290,9 @@ $(PSD)jpx.dev : $(INT_MAK) $(ECHOGS_XE) $(PSD)jpx_$(JPX_LIB).dev\
+ $(MAKEDIRS)
+ $(CP_) $(PSD)jpx_$(JPX_LIB).dev $(PSD)jpx.dev
+
++$(PSD)jpx_.dev : $(ECHOGS_XE) $(INT_MAK) $(MAKEDIRS)
++ $(SETMOD) $(PSD)jpx_
++
+ fjpx_luratech=$(PSOBJ)zfjpx_luratech.$(OBJ)
+
+ $(PSOBJ)zfjpx.$(OBJ) : $(PSSRC)zfjpx.c $(OP) $(memory__h)\
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch
new file mode 100644
index 000000000..b445a6c9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/files/do-not-check-local-libpng-source.patch
@@ -0,0 +1,38 @@
+From 5ef8b85bc98f3bd9a15d5f47e24d3e23ae27c265 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 18 Jan 2016 01:00:30 -0500
+Subject: [PATCH] configure.ac: do not check local png source
+
+In oe-core, it did not need to compile local libpng
+source in ghostscript, so do not check local png
+source, and directly check the existance of shared
+libpng library.
+
+Upstream-Status: Inappropriate [OE-Core specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ab30a97..b762fd7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -955,11 +955,11 @@ AC_SUBST(ZLIBDIR)
+ AC_SUBST(FT_SYS_ZLIB)
+
+ dnl png for the png output device; it also requires zlib
+-LIBPNGDIR=src
++LIBPNGDIR=$srcdir/libpng
+ PNGDEVS=''
+ PNGDEVS_ALL='png48 png16m pnggray pngmono png256 png16 pngalpha'
+ AC_MSG_CHECKING([for local png library source])
+-if test -f $srcdir/libpng/pngread.c; then
++if false; then
+ AC_MSG_RESULT([yes])
+ SHARE_LIBPNG=0
+ LIBPNGDIR=$srcdir/libpng
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h
new file mode 100644
index 000000000..e8772cd95
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h
new file mode 100644
index 000000000..359097f35
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
new file mode 100644
index 000000000..d97d4ecd7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
@@ -0,0 +1,36 @@
+base/genht.c: add a preprocessor define to allow fopen calling
+
+The commit in upstream:
+http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=773c69e46e70bdd5482676437dafd2ca83397643
+
+Replace all fopen calls with gp_fopen and add a preprocessor define so
+that any unintential calls directly to fopen will cause an error.
+
+Only exceptions are those in the platform specific code, and mkromfs.c.
+This patch add a preprocessor define to allow fopen calling in base/genht.c.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ base/genht.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/base/genht.c b/base/genht.c
+index 4b04085..cc82fff 100644
+--- a/base/genht.c
++++ b/base/genht.c
+@@ -16,6 +16,10 @@
+
+ /* Generate C code for compiling halftones into ROM. */
+ #include "malloc_.h"
++
++/* prevent gp.h from defining fopen */
++#define fopen fopen
++
+ #include "stdio_.h"
+ #include "string_.h"
+ #include "gscdefs.h"
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch
new file mode 100644
index 000000000..a1c9368cc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch
@@ -0,0 +1,31 @@
+Subject: [PATCH] Don't build-depend on libgcrypt, as nothing is used from it
+
+Backported from http://www.cups.org/strfiles.php/3308/cups-no-gcrypt.patch
+
+This addresses the cryto dependency seen during build.
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+Rebase the patch to ghostscript-9.15
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ cups/libs/cups/http-private.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/cups/libs/cups/http-private.h b/cups/libs/cups/http-private.h
+index 99a85c3..a674852 100644
+--- a/cups/libs/cups/http-private.h
++++ b/cups/libs/cups/http-private.h
+@@ -80,7 +80,6 @@ typedef int socklen_t;
+ # elif defined HAVE_GNUTLS
+ # include <gnutls/gnutls.h>
+ # include <gnutls/x509.h>
+-# include <gcrypt.h>
+ # elif defined(HAVE_CDSASSL)
+ # include <CoreFoundation/CoreFoundation.h>
+ # include <Security/Security.h>
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch
new file mode 100644
index 000000000..e28a949bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch
@@ -0,0 +1,28 @@
+Import patch from windriver linux for cross compilation, and split patches
+into oe way under different directories such as i586, powerpc etc according
+to Richard's opinion.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+# Author: Chi Xu <chi.xu@windriver.com>
+# Date: Feb 26 2010
+# Summary: Generate arch.h for ppc32
+#
+
+diff -Nru ghostscript-8.64.orig/base/lib.mak ghostscript-8.64/base/lib.mak
+--- ghostscript-8.64.orig/base/lib.mak 2010-02-10 10:30:02.000000000 +0800
++++ ghostscript-8.64/base/lib.mak 2010-02-10 10:56:21.000000000 +0800
+@@ -67,8 +67,8 @@
+ stdpre_h=$(GLSRC)stdpre.h $(stdpn_h)
+ stdint__h=$(GLSRC)stdint_.h $(std_h)
+
+-$(GLGEN)arch.h : $(GENARCH_XE)
+- $(EXP)$(GENARCH_XE) $(GLGEN)arch.h $(TARGET_ARCH_FILE)
++##$(GLGEN)arch.h : $(GENARCH_XE)
++## $(EXP)$(GENARCH_XE) $(GLGEN)arch.h $(TARGET_ARCH_FILE)
+
+ # Platform interfaces
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch
new file mode 100644
index 000000000..bc29be507
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch
@@ -0,0 +1,100 @@
+ust use commands provided by ghostscript-native, preventing recompile them when
+compile ghostscript.
+Way to enable cross compile.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+diff --git a/base/unix-aux.mak b/base/unix-aux.mak
+index a91fb26..c991d11 100644
+--- a/base/unix-aux.mak
++++ b/base/unix-aux.mak
+@@ -69,46 +69,46 @@ $(GLOBJ)gp_sysv.$(OBJ): $(GLSRC)gp_sysv.c $(stdio__h) $(time__h) $(AK)\
+ $(MAKEDIRS)
+ $(GLCC) $(GLO_)gp_sysv.$(OBJ) $(C_) $(GLSRC)gp_sysv.c
+
+-# -------------------------- Auxiliary programs --------------------------- #
+-
+-$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS)
+-
+-# On the RS/6000 (at least), compiling genarch.c with gcc with -O
+-# produces a buggy executable.
+-$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
+-
+-$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
+-
+-$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(MAKEDIRS)
+- $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
+-
+-$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(MAKEDIRS)
+- $(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS)
+-
+-# To get GS to use the system zlib, you remove/hide the gs/zlib directory
+-# which means that the mkromfs build can't find the zlib source it needs.
+-# So it's split into two targets, one using the zlib source directly.....
+-MKROMFS_OBJS_0=$(MKROMFS_ZLIB_OBJS) $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
+- $(AUX)gscdefs.$(OBJ) $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
+- $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ)
+-
+-$(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(MAKEDIRS)
+- $(CCAUX_) $(GENOPT) $(CFLAGS) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS)
+-
+-# .... and one using the zlib library linked via the command line
+-MKROMFS_OBJS_1=$(AUX)gscdefs.$(OBJ) \
+- $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
+- $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
+- $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ)
+-
+-$(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(MAKEDIRS)
+- $(CCAUX_) $(GENOPT) $(CFLAGS) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS)
+-
+-$(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(MAKEDIRS)
+- $(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE)
++## -------------------------- Auxiliary programs --------------------------- #
++#
++#$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS)
++#
++## On the RS/6000 (at least), compiling genarch.c with gcc with -O
++## produces a buggy executable.
++#$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
++#
++#$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
++#
++#$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(MAKEDIRS)
++# $(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
++#
++#$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(MAKEDIRS)
++# $(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS)
++#
++## To get GS to use the system zlib, you remove/hide the gs/zlib directory
++## which means that the mkromfs build can't find the zlib source it needs.
++## So it's split into two targets, one using the zlib source directly.....
++#MKROMFS_OBJS_0=$(MKROMFS_ZLIB_OBJS) $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
++# $(AUX)gscdefs.$(OBJ) $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
++# $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ)
++#
++#$(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(MAKEDIRS)
++# $(CCAUX_) $(GENOPT) $(CFLAGS) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS)
++#
++## .... and one using the zlib library linked via the command line
++#MKROMFS_OBJS_1=$(AUX)gscdefs.$(OBJ) \
++# $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
++# $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
++# $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ)
++#
++#$(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(MAKEDIRS)
++# $(CCAUX_) $(GENOPT) $(CFLAGS) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS)
++#
++#$(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(MAKEDIRS)
++# $(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE)
+
+ # Query the environment to construct gconfig_.h.
+ # These are all defined conditionally (except the JasPER one), so that
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
new file mode 100644
index 000000000..797b8947c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
@@ -0,0 +1,40 @@
+From be1e1b33191afdcfe3c2ecc4ff3e361a5859e9c6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 30 Jan 2015 00:40:22 -0800
+Subject: [PATCH] contrib.mak: fix for parallel build
+
+Fixed:
+rm: cannot remove `/usr/share/ghostscript/9.15/lib': Is a directory
+
+Create lib before install to fix the race issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ contrib/contrib.mak | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/contrib/contrib.mak b/contrib/contrib.mak
+index 08a80d1..de2e20d 100644
+--- a/contrib/contrib.mak
++++ b/contrib/contrib.mak
+@@ -947,6 +947,7 @@ $(DEVOBJ)dviprlib.$(OBJ) : $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h
+ $(DEVCC) $(O_)$@ $(C_) $(JAPSRC)dviprlib.c
+
+ extra-dmprt-install:
++ mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib
+ $(INSTALL_DATA) $(JAPSRC)dmp_init.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
+ $(INSTALL_DATA) $(JAPSRC)dmp_site.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
+ $(INSTALL_DATA) $(JAPSRC)escp_24.src $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
+@@ -1088,6 +1089,7 @@ $(DEVOBJ)gdevalps.$(OBJ) : $(JAPSRC)gdevalps.c $(PDEVH)
+ ### ----------------- Additional .upp files ---------------- ###
+
+ extra-upp-install:
++ mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib
+ for f in $(CONTRIBSRC)uniprint$(D)*.upp; do \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)$(D)lib || exit 1; \
+ done
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch
new file mode 100644
index 000000000..d78648200
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch
@@ -0,0 +1,30 @@
+From 5d5c83c89be0cff29dde2267fa168e6f7146be8c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 4 May 2015 22:31:48 -0700
+Subject: [PATCH] base/gendev.c: fix for -Werror=return-type
+
+Fixed:
+base/gendev.c:80:1: error: return type defaults to 'int' [-Werror=return-type]
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ base/gendev.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/base/gendev.c b/base/gendev.c
+index 68a745f..8058b5a 100644
+--- a/base/gendev.c
++++ b/base/gendev.c
+@@ -77,6 +77,7 @@ static const char *indent_item = "";
+ /* Forward definitions */
+ void add_entry(config *, const char *, const char *, bool);
+
++int
+ main(int argc, char *argv[])
+ {
+ config conf;
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch
new file mode 100644
index 000000000..9158117d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch
@@ -0,0 +1,37 @@
+ghostscript-native:fix disable-system-libtiff
+
+Modify configure to add the check to make sure
+ghostscrip could work while system-libtiff is
+disabled.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+ configure.ac | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -1055,6 +1055,7 @@ Disabling tiff output devices.])
+ esac
+
+ if test $SHARE_LIBTIFF -eq 0; then
++ if test -e $LIBTIFFDIR/configure; then
+ echo
+ echo "Running libtiff configure script..."
+ olddir=`pwd`
+@@ -1069,6 +1070,10 @@ if test $SHARE_LIBTIFF -eq 0; then
+ cd "$olddir"
+ echo
+ echo "Continuing with Ghostscript configuration..."
++ else
++ AC_MSG_NOTICE([Could not find local copy of libtiff.
++Disabling tiff output devices.])
++ fi
+ fi
+
+ AC_SUBST(SHARE_LIBTIFF)
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h
new file mode 100644
index 000000000..5817b7a6d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h
@@ -0,0 +1,41 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i686 b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i686
new file mode 120000
index 000000000..87aaca590
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/i686
@@ -0,0 +1 @@
+i586 \ No newline at end of file
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h
new file mode 100644
index 000000000..63232fdfa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h
new file mode 100644
index 000000000..3ec810168
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h
new file mode 100644
index 000000000..b8b637cca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 4
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h
new file mode 100644
index 000000000..0d0a16bfa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h
new file mode 100644
index 000000000..0d0a16bfa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h
new file mode 100644
index 000000000..29f90ddf8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 4
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h
new file mode 100644
index 000000000..3ec810168
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/nios2/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/png_mak.patch b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/png_mak.patch
new file mode 100644
index 000000000..da900ead3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/png_mak.patch
@@ -0,0 +1,21 @@
+ghostscript: add dependency for pnglibconf.h
+
+When using parallel make jobs, we need to be sure that
+pnglibconf.h is created before we try to reference it,
+so add a rule to png.mak.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/base/png.mak
++++ b/base/png.mak
+@@ -81,6 +81,8 @@ png.config-clean :
+ $(pnglibconf_h) : $(PNGSRC)scripts$(D)pnglibconf.h.prebuilt
+ $(CP_) $(PNGSRC)scripts$(D)pnglibconf.h.prebuilt $(pnglibconf_h)
+
++$(MAKEDIRS) : $(pnglibconf_h)
++
+ PDEP=$(AK) $(pnglibconf_h) $(MAKEDIRS)
+
+ png_1=$(PNGOBJ)png.$(OBJ) $(PNGOBJ)pngmem.$(OBJ) $(PNGOBJ)pngerror.$(OBJ) $(PNGOBJ)pngset.$(OBJ)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h
new file mode 100644
index 000000000..359097f35
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h
new file mode 100644
index 000000000..0d0a16bfa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h
new file mode 100644
index 000000000..a05de29de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+ /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+ /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+ /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+ /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.18.bb b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.18.bb
new file mode 100644
index 000000000..d4222c773
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ghostscript/ghostscript_9.18.bb
@@ -0,0 +1,107 @@
+SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter"
+DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing. Usually as \
+a back-end to a program such as ghostview, it can display PostScript and PDF \
+documents in an X11 environment. \
+\
+Furthermore, it can render PostScript and PDF files as graphics to be printed \
+on non-PostScript printers. Supported printers include common \
+dot-matrix, inkjet and laser models. \
+"
+HOMEPAGE = "http://www.ghostscript.com"
+SECTION = "console/utils"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b17cea54743435ab2a581c237bea294a"
+
+DEPENDS = "ghostscript-native tiff jpeg fontconfig cups libpng"
+DEPENDS_class-native = "libpng-native"
+
+SRC_URI_BASE = "http://downloads.ghostscript.com/public/ghostscript-${PV}.tar.gz \
+ file://ghostscript-9.15-parallel-make.patch \
+ file://ghostscript-9.16-Werror-return-type.patch \
+ file://png_mak.patch \
+ file://0001-Bug-696497-Fix-support-for-building-with-no-jbig2-de.patch \
+ file://0002-Bug-696497-part-2-fix-support-for-building-with-a-JP.patch \
+ file://do-not-check-local-libpng-source.patch \
+"
+
+SRC_URI = "${SRC_URI_BASE} \
+ file://ghostscript-9.02-prevent_recompiling.patch \
+ file://ghostscript-9.02-genarch.patch \
+ file://objarch.h \
+ file://cups-no-gcrypt.patch \
+ "
+
+SRC_URI_class-native = "${SRC_URI_BASE} \
+ file://ghostscript-native-fix-disable-system-libtiff.patch \
+ file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
+ "
+
+SRC_URI[md5sum] = "33a47567d7a591c00a253caddd12a88a"
+SRC_URI[sha256sum] = "5fc93079749a250be5404c465943850e3ed5ffbc0d5c07e10c7c5ee8afbbdb1b"
+
+EXTRA_OECONF = "--without-x --with-system-libtiff --without-jbig2dec \
+ --with-fontpath=${datadir}/fonts \
+ --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
+ --with-cups-datadir=${datadir}/cups \
+ ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--enable-little-endian', '--enable-big-endian', d)} \
+ "
+
+EXTRA_OECONF_append_mips = " --with-large_color_index=0"
+EXTRA_OECONF_append_mipsel = " --with-large_color_index=0"
+
+# Explicity disable libtiff, fontconfig,
+# freetype, cups for ghostscript-native
+EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
+ --without-jbig2dec \
+ --with-fontpath=${datadir}/fonts \
+ --without-libidn --disable-fontconfig \
+ --disable-freetype --disable-cups"
+
+# This has been fixed upstream but for now we need to subvert the check for time.h
+# http://bugs.ghostscript.com/show_bug.cgi?id=692443
+# http://bugs.ghostscript.com/show_bug.cgi?id=692426
+CFLAGS += "-DHAVE_SYS_TIME_H=1"
+BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
+
+inherit autotools
+
+do_configure_prepend () {
+ mkdir -p obj
+ mkdir -p soobj
+ if [ -e ${WORKDIR}/objarch.h ]; then
+ cp ${WORKDIR}/objarch.h obj/arch.h
+ fi
+}
+
+do_configure_append () {
+ # copy tools from the native ghostscript build
+ if [ "${PN}" != "ghostscript-native" ]; then
+ mkdir -p obj/aux soobj
+ for i in genarch genconf mkromfs echogs gendev genht; do
+ cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
+ done
+ fi
+}
+
+do_install_append () {
+ mkdir -p ${D}${datadir}/ghostscript/${PV}/
+ cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
+ cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
+}
+
+do_compile_class-native () {
+ mkdir -p obj
+ for i in genarch genconf mkromfs echogs gendev genht; do
+ oe_runmake obj/aux/$i
+ done
+}
+
+do_install_class-native () {
+ install -d ${D}${bindir}/ghostscript-${PV}
+ for i in genarch genconf mkromfs echogs gendev genht; do
+ install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
+ done
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf.inc b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf.inc
new file mode 100644
index 000000000..a8ce230f6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf.inc
@@ -0,0 +1,22 @@
+DESCRIPTION = "GNU gperf is a perfect hash function generator"
+HOMEPAGE = "http://www.gnu.org/software/gperf"
+SUMMARY = "Generate a perfect hash function from a set of keywords"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://src/main.cc;beginline=8;endline=19;md5=dec8f611845d047387ed56b5b85fa99b"
+
+SRC_URI = "${GNU_MIRROR}/gperf/gperf-${PV}.tar.gz"
+
+inherit autotools
+
+# autoreconf couldn't find acinclude.m4 when stepping into subdirectory. Instead of
+# duplicating acinclude.m4 in every subdirectory, use absolute include path to aclocal
+EXTRA_AUTORECONF += " -I ${S}"
+
+do_configure_prepend() {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+ fi
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb
new file mode 100644
index 000000000..772886121
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.3.bb
@@ -0,0 +1,10 @@
+require gperf.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5f84abb0070adf8a0925d7d534b6e0a \
+ file://src/main.cc;beginline=8;endline=19;md5=72a3034a19e72f08ee48ef8244a121fd"
+
+PR = "r1"
+
+SRC_URI[md5sum] = "cc20e58975a38075440423c8fb85fd00"
+SRC_URI[sha256sum] = "63287527c8d9e27e801cf0804436f3494bd569db05d49dcdd2a942ae72fa9055"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.4.bb b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.4.bb
new file mode 100644
index 000000000..64003fc0b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gperf/gperf_3.0.4.bb
@@ -0,0 +1,5 @@
+require gperf.inc
+
+
+SRC_URI[md5sum] = "c1f1db32fb6598d6a93e6e88796a8632"
+SRC_URI[sha256sum] = "767112a204407e62dbc3106647cf839ed544f3cf5d0f0523aaa2508623aad63e"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars
new file mode 100644
index 000000000..8b09f53b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/Makevars
@@ -0,0 +1,25 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
new file mode 100644
index 000000000..5a4149cfc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [Poky Specific this is gplv2 version]
+
+Signed-off-by Saul Wold <sgw@linux.intel.com>
+
+Index: grep-2.5.1a/doc/grep.texi
+===================================================================
+--- grep-2.5.1a.orig/doc/grep.texi
++++ grep-2.5.1a/doc/grep.texi
+@@ -288,7 +288,7 @@ This version number should be included i
+ Print a usage message briefly summarizing these command-line options
+ and the bug-reporting address, then exit.
+
+-@itemx --binary-files=@var{type}
++@item --binary-files=@var{type}
+ @opindex --binary-files
+ @cindex binary files
+ If the first few bytes of a file indicate that the file contains binary
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
new file mode 100644
index 000000000..3b91520fb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
@@ -0,0 +1,17 @@
+Always use locale.h as HAVE_LOCALE_H is no longer handled by ./configure
+Upstream-Status: Inappropriate [ old version that will not be maintained ]
+Signed-off-by: Alex DAMIAN <alexandru.damian@intel.com>
+
+diff --recursive --unified grep-2.5.1a-orig/lib/hard-locale.c grep-2.5.1a/lib/hard-locale.c
+--- grep-2.5.1a-orig/lib/hard-locale.c 2001-03-04 07:33:12.000000000 +0200
++++ grep-2.5.1a/lib/hard-locale.c 2013-03-11 17:05:52.086444891 +0200
+@@ -38,9 +38,7 @@
+ # endif
+ #endif
+
+-#if HAVE_LOCALE_H
+ # include <locale.h>
+-#endif
+
+ #if HAVE_STRING_H
+ # include <string.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
new file mode 100644
index 000000000..57463355a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
@@ -0,0 +1,15 @@
+Enable operation with later versions of gettext.
+
+Upstream-Status: Inappropriate
+RP 2012/10/19
+
+Index: grep-2.5.1a/configure.in
+===================================================================
+--- grep-2.5.1a.orig/configure.in 2012-10-19 12:57:51.646970204 +0000
++++ grep-2.5.1a/configure.in 2012-10-19 12:59:49.946968803 +0000
+@@ -140,4 +140,4 @@
+ AC_CHECK_LIB(pcre, pcre_exec)
+ fi
+
+-AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h])
++AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [echo timestamp > stamp-h])
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
new file mode 100644
index 000000000..721f2a0a6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
@@ -0,0 +1,33 @@
+The patch to fix CVE-2012-5667
+Reference: https://bugzilla.redhat.com/attachment.cgi?id=686605&action=diff
+
+Multiple integer overflows in GNU Grep before 2.11 might allow
+context-dependent attackers to execute arbitrary code via vectors
+involving a long input line that triggers a heap-based buffer overflow.
+
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-5667
+
+Upstream-Status: Inappropriate [other]
+This version of GNU Grep has been abandoned upstream and they are no longer
+accepting patches. This is not a backport.
+CVE: CVE-2012-5667
+
+Signed-off-by Ming Liu <ming.liu@windriver.com>
+---
+ grep.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/src/grep.c 2013-05-15 13:39:33.359191769 +0800
++++ a/src/grep.c 2013-05-15 13:50:22.609191882 +0800
+@@ -306,6 +306,11 @@ fillbuf (size_t save, struct stats const
+ int cc = 1;
+ char *readbuf;
+ size_t readsize;
++ const size_t max_save = INT_MAX / 2;
++
++ /* Limit the amount of saved data to INT_MAX to fix CVE-2012-5667 */
++ if (save > max_save)
++ error (2, 0, _("line too long"));
+
+ /* Offset from start of buffer to start of old stuff
+ that we want to save. */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch
new file mode 100644
index 000000000..327ee5640
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch
@@ -0,0 +1,1342 @@
+From c884dd12ec062569335702848fc5f29f436c28fa Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Mon, 25 May 2015 10:15:57 +0900
+Subject: [PATCH] grep egrep fgrep: Fix LSB NG cases.
+
+The LSB core test requires grep egrep and fgrep can
+perform pattern matching in searches without regard
+to case if -i option is specified.
+
+Upstream-Status: backport.
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ lib/posix/regex.h | 4 +
+ src/dfa.c | 22 +-
+ src/grep.c | 96 ++++---
+ src/search.c | 833 +++++++++++++++++++++++++++++++++++++++++++++---------
+ 4 files changed, 768 insertions(+), 187 deletions(-)
+
+diff --git a/lib/posix/regex.h b/lib/posix/regex.h
+index 63c2fef..7bb2b0e 100644
+--- a/lib/posix/regex.h
++++ b/lib/posix/regex.h
+@@ -109,6 +109,10 @@ typedef unsigned long int reg_syntax_t;
+ If not set, \{, \}, {, and } are literals. */
+ #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
++/* If this bit is set, then ignore case when matching.
++ If not set, then case is significant. */
++#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
++
+ /* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+ #define RE_LIMITED_OPS (RE_INTERVALS << 1)
+diff --git a/src/dfa.c b/src/dfa.c
+index 590bfa7..27c876a 100644
+--- a/src/dfa.c
++++ b/src/dfa.c
+@@ -414,7 +414,7 @@ update_mb_len_index (unsigned char const *p, int len)
+
+ /* This function fetch a wide character, and update cur_mb_len,
+ used only if the current locale is a multibyte environment. */
+-static wchar_t
++static wint_t
+ fetch_wc (char const *eoferr)
+ {
+ wchar_t wc;
+@@ -423,7 +423,7 @@ fetch_wc (char const *eoferr)
+ if (eoferr != 0)
+ dfaerror (eoferr);
+ else
+- return -1;
++ return WEOF;
+ }
+
+ cur_mb_len = mbrtowc(&wc, lexptr, lexleft, &mbs);
+@@ -459,7 +459,7 @@ fetch_wc (char const *eoferr)
+ static void
+ parse_bracket_exp_mb ()
+ {
+- wchar_t wc, wc1, wc2;
++ wint_t wc, wc1, wc2;
+
+ /* Work area to build a mb_char_classes. */
+ struct mb_char_classes *work_mbc;
+@@ -496,7 +496,7 @@ parse_bracket_exp_mb ()
+ work_mbc->invert = 0;
+ do
+ {
+- wc1 = -1; /* mark wc1 is not initialized". */
++ wc1 = WEOF; /* mark wc1 is not initialized". */
+
+ /* Note that if we're looking at some other [:...:] construct,
+ we just treat it as a bunch of ordinary characters. We can do
+@@ -586,7 +586,7 @@ parse_bracket_exp_mb ()
+ work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem;
+ }
+ }
+- wc = -1;
++ wc1 = wc = WEOF;
+ }
+ else
+ /* We treat '[' as a normal character here. */
+@@ -600,7 +600,7 @@ parse_bracket_exp_mb ()
+ wc = fetch_wc(("Unbalanced ["));
+ }
+
+- if (wc1 == -1)
++ if (wc1 == WEOF)
+ wc1 = fetch_wc(_("Unbalanced ["));
+
+ if (wc1 == L'-')
+@@ -630,17 +630,17 @@ parse_bracket_exp_mb ()
+ }
+ REALLOC_IF_NECESSARY(work_mbc->range_sts, wchar_t,
+ range_sts_al, work_mbc->nranges + 1);
+- work_mbc->range_sts[work_mbc->nranges] = wc;
++ work_mbc->range_sts[work_mbc->nranges] = (wchar_t)wc;
+ REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t,
+ range_ends_al, work_mbc->nranges + 1);
+- work_mbc->range_ends[work_mbc->nranges++] = wc2;
++ work_mbc->range_ends[work_mbc->nranges++] = (wchar_t)wc2;
+ }
+- else if (wc != -1)
++ else if (wc != WEOF)
+ /* build normal characters. */
+ {
+ REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
+ work_mbc->nchars + 1);
+- work_mbc->chars[work_mbc->nchars++] = wc;
++ work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc;
+ }
+ }
+ while ((wc = wc1) != L']');
+@@ -2552,6 +2552,8 @@ match_mb_charset (struct dfa *d, int s, position pos, int index)
+ }
+
+ /* match with a character? */
++ if (case_fold)
++ wc = towlower (wc);
+ for (i = 0; i<work_mbc->nchars; i++)
+ {
+ if (wc == work_mbc->chars[i])
+diff --git a/src/grep.c b/src/grep.c
+index 2fb2fac..3fd4b47 100644
+--- a/src/grep.c
++++ b/src/grep.c
+@@ -30,6 +30,12 @@
+ # include <sys/time.h>
+ # include <sys/resource.h>
+ #endif
++#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
++/* We can handle multibyte string. */
++# define MBS_SUPPORT
++# include <wchar.h>
++# include <wctype.h>
++#endif
+ #include <stdio.h>
+ #include "system.h"
+ #include "getopt.h"
+@@ -255,19 +261,6 @@ reset (int fd, char const *file, struct stats *stats)
+ bufbeg[-1] = eolbyte;
+ bufdesc = fd;
+
+- if (fstat (fd, &stats->stat) != 0)
+- {
+- error (0, errno, "fstat");
+- return 0;
+- }
+- if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
+- return 0;
+-#ifndef DJGPP
+- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
+-#else
+- if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
+-#endif
+- return 0;
+ if (S_ISREG (stats->stat.st_mode))
+ {
+ if (file)
+@@ -558,33 +551,6 @@ prline (char const *beg, char const *lim, int sep)
+ {
+ size_t match_size;
+ size_t match_offset;
+- if(match_icase)
+- {
+- /* Yuck, this is tricky */
+- char *buf = (char*) xmalloc (lim - beg);
+- char *ibeg = buf;
+- char *ilim = ibeg + (lim - beg);
+- int i;
+- for (i = 0; i < lim - beg; i++)
+- ibeg[i] = tolower (beg[i]);
+- while ((match_offset = (*execute) (ibeg, ilim-ibeg, &match_size, 1))
+- != (size_t) -1)
+- {
+- char const *b = beg + match_offset;
+- if (b == lim)
+- break;
+- fwrite (beg, sizeof (char), match_offset, stdout);
+- printf ("\33[%sm", grep_color);
+- fwrite (b, sizeof (char), match_size, stdout);
+- fputs ("\33[00m", stdout);
+- beg = b + match_size;
+- ibeg = ibeg + match_offset + match_size;
+- }
+- fwrite (beg, 1, lim - beg, stdout);
+- free (buf);
+- lastout = lim;
+- return;
+- }
+ while (lim-beg && (match_offset = (*execute) (beg, lim - beg, &match_size, 1))
+ != (size_t) -1)
+ {
+@@ -601,6 +567,7 @@ prline (char const *beg, char const *lim, int sep)
+ fputs ("\33[00m", stdout);
+ beg = b + match_size;
+ }
++ fputs ("\33[K", stdout);
+ }
+ fwrite (beg, 1, lim - beg, stdout);
+ if (ferror (stdout))
+@@ -623,7 +590,7 @@ prpending (char const *lim)
+ size_t match_size;
+ --pending;
+ if (outleft
+- || (((*execute) (lastout, nl - lastout, &match_size, 0) == (size_t) -1)
++ || (((*execute) (lastout, nl + 1 - lastout, &match_size, 0) == (size_t) -1)
+ == !out_invert))
+ prline (lastout, nl + 1, '-');
+ else
+@@ -895,6 +862,19 @@ grepfile (char const *file, struct stats *stats)
+ }
+ else
+ {
++ if (stat (file, &stats->stat) != 0)
++ {
++ suppressible_error (file, errno);
++ return 1;
++ }
++ if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
++ return 1;
++#ifndef DJGPP
++ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode)))
++#else
++ if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
++#endif
++ return 1;
+ while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
+ continue;
+
+@@ -1681,9 +1661,6 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"))
+ out_invert ^= 1;
+ match_lines = match_words = 0;
+ }
+- else
+- /* Strip trailing newline. */
+- --keycc;
+ }
+ else
+ if (optind < argc)
+@@ -1697,6 +1674,37 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"))
+ if (!install_matcher (matcher) && !install_matcher ("default"))
+ abort ();
+
++#ifdef MBS_SUPPORT
++ if (MB_CUR_MAX != 1 && match_icase)
++ {
++ wchar_t wc;
++ mbstate_t cur_state, prev_state;
++ int i, len = strlen(keys);
++
++ memset(&cur_state, 0, sizeof(mbstate_t));
++ for (i = 0; i <= len ;)
++ {
++ size_t mbclen;
++ mbclen = mbrtowc(&wc, keys + i, len - i, &cur_state);
++ if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
++ {
++ /* An invalid sequence, or a truncated multibyte character.
++ We treat it as a singlebyte character. */
++ mbclen = 1;
++ }
++ else
++ {
++ if (iswupper((wint_t)wc))
++ {
++ wc = towlower((wint_t)wc);
++ wcrtomb(keys + i, wc, &cur_state);
++ }
++ }
++ i += mbclen;
++ }
++ }
++#endif /* MBS_SUPPORT */
++
+ (*compile)(keys, keycc);
+
+ if ((argc - optind > 1 && !no_filenames) || with_filenames)
+diff --git a/src/search.c b/src/search.c
+index 7bd233f..3c6a485 100644
+--- a/src/search.c
++++ b/src/search.c
+@@ -18,9 +18,13 @@
+
+ /* Written August 1992 by Mike Haertel. */
+
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE 1
++#endif
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
++#include <assert.h>
+ #include <sys/types.h>
+ #if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
+ /* We can handle multibyte string. */
+@@ -31,7 +35,7 @@
+
+ #include "system.h"
+ #include "grep.h"
+-#include "regex.h"
++#include <regex.h>
+ #include "dfa.h"
+ #include "kwset.h"
+ #include "error.h"
+@@ -39,6 +43,9 @@
+ #ifdef HAVE_LIBPCRE
+ # include <pcre.h>
+ #endif
++#ifdef HAVE_LANGINFO_CODESET
++# include <langinfo.h>
++#endif
+
+ #define NCHAR (UCHAR_MAX + 1)
+
+@@ -70,9 +77,10 @@ static kwset_t kwset;
+ call the regexp matcher at all. */
+ static int kwset_exact_matches;
+
+-#if defined(MBS_SUPPORT)
+-static char* check_multibyte_string PARAMS ((char const *buf, size_t size));
+-#endif
++/* UTF-8 encoding allows some optimizations that we can't otherwise
++ assume in a multibyte encoding. */
++static int using_utf8;
++
+ static void kwsinit PARAMS ((void));
+ static void kwsmusts PARAMS ((void));
+ static void Gcompile PARAMS ((char const *, size_t));
+@@ -84,6 +92,15 @@ static void Pcompile PARAMS ((char const *, size_t ));
+ static size_t Pexecute PARAMS ((char const *, size_t, size_t *, int));
+
+ void
++check_utf8 (void)
++{
++#ifdef HAVE_LANGINFO_CODESET
++ if (strcmp (nl_langinfo (CODESET), "UTF-8") == 0)
++ using_utf8 = 1;
++#endif
++}
++
++void
+ dfaerror (char const *mesg)
+ {
+ error (2, 0, mesg);
+@@ -141,38 +158,6 @@ kwsmusts (void)
+ }
+ }
+
+-#ifdef MBS_SUPPORT
+-/* This function allocate the array which correspond to "buf".
+- Then this check multibyte string and mark on the positions which
+- are not singlebyte character nor the first byte of a multibyte
+- character. Caller must free the array. */
+-static char*
+-check_multibyte_string(char const *buf, size_t size)
+-{
+- char *mb_properties = malloc(size);
+- mbstate_t cur_state;
+- int i;
+- memset(&cur_state, 0, sizeof(mbstate_t));
+- memset(mb_properties, 0, sizeof(char)*size);
+- for (i = 0; i < size ;)
+- {
+- size_t mbclen;
+- mbclen = mbrlen(buf + i, size - i, &cur_state);
+-
+- if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
+- {
+- /* An invalid sequence, or a truncated multibyte character.
+- We treat it as a singlebyte character. */
+- mbclen = 1;
+- }
+- mb_properties[i] = mbclen;
+- i += mbclen;
+- }
+-
+- return mb_properties;
+-}
+-#endif
+-
+ static void
+ Gcompile (char const *pattern, size_t size)
+ {
+@@ -181,7 +166,8 @@ Gcompile (char const *pattern, size_t size)
+ size_t total = size;
+ char const *motif = pattern;
+
+- re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE);
++ check_utf8 ();
++ re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0));
+ dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte);
+
+ /* For GNU regex compiler we have to pass the patterns separately to detect
+@@ -218,6 +204,10 @@ Gcompile (char const *pattern, size_t size)
+ motif = sep;
+ } while (sep && total != 0);
+
++ /* Strip trailing newline. */
++ if (size && pattern[size - 1] == '\n')
++ size--;
++
+ /* In the match_words and match_lines cases, we use a different pattern
+ for the DFA matcher that will quickly throw out cases that won't work.
+ Then if DFA succeeds we do some hairy stuff using the regex matcher
+@@ -233,7 +223,7 @@ Gcompile (char const *pattern, size_t size)
+ static char const line_end[] = "\\)$";
+ static char const word_beg[] = "\\(^\\|[^[:alnum:]_]\\)\\(";
+ static char const word_end[] = "\\)\\([^[:alnum:]_]\\|$\\)";
+- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
++ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
+ size_t i;
+ strcpy (n, match_lines ? line_beg : word_beg);
+ i = strlen (n);
+@@ -257,14 +247,15 @@ Ecompile (char const *pattern, size_t size)
+ size_t total = size;
+ char const *motif = pattern;
+
++ check_utf8 ();
+ if (strcmp (matcher, "awk") == 0)
+ {
+- re_set_syntax (RE_SYNTAX_AWK);
++ re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0));
+ dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte);
+ }
+ else
+ {
+- re_set_syntax (RE_SYNTAX_POSIX_EGREP);
++ re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0));
+ dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte);
+ }
+
+@@ -301,6 +292,10 @@ Ecompile (char const *pattern, size_t size)
+ motif = sep;
+ } while (sep && total != 0);
+
++ /* Strip trailing newline. */
++ if (size && pattern[size - 1] == '\n')
++ size--;
++
+ /* In the match_words and match_lines cases, we use a different pattern
+ for the DFA matcher that will quickly throw out cases that won't work.
+ Then if DFA succeeds we do some hairy stuff using the regex matcher
+@@ -316,7 +311,7 @@ Ecompile (char const *pattern, size_t size)
+ static char const line_end[] = ")$";
+ static char const word_beg[] = "(^|[^[:alnum:]_])(";
+ static char const word_end[] = ")([^[:alnum:]_]|$)";
+- char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
++ char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
+ size_t i;
+ strcpy (n, match_lines ? line_beg : word_beg);
+ i = strlen(n);
+@@ -339,15 +334,34 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ char eol = eolbyte;
+ int backref, start, len;
+ struct kwsmatch kwsm;
+- size_t i;
++ size_t i, ret_val;
++ static int use_dfa;
++ static int use_dfa_checked = 0;
+ #ifdef MBS_SUPPORT
+- char *mb_properties = NULL;
++ int mb_cur_max = MB_CUR_MAX;
++ mbstate_t mbs;
++ memset (&mbs, '\0', sizeof (mbstate_t));
+ #endif /* MBS_SUPPORT */
+
++ if (!use_dfa_checked)
++ {
++ char *grep_use_dfa = getenv ("GREP_USE_DFA");
++ if (!grep_use_dfa)
++ {
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && kwset)
+- mb_properties = check_multibyte_string(buf, size);
++ /* Turn off DFA when processing multibyte input. */
++ use_dfa = (MB_CUR_MAX == 1);
++#else
++ use_dfa = 1;
+ #endif /* MBS_SUPPORT */
++ }
++ else
++ {
++ use_dfa = atoi (grep_use_dfa);
++ }
++
++ use_dfa_checked = 1;
++ }
+
+ buflim = buf + size;
+
+@@ -358,47 +372,120 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ if (kwset)
+ {
+ /* Find a possible match using the KWset matcher. */
+- size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm);
++#ifdef MBS_SUPPORT
++ size_t bytes_left = 0;
++#endif /* MBS_SUPPORT */
++ size_t offset;
++#ifdef MBS_SUPPORT
++ /* kwsexec doesn't work with match_icase and multibyte input. */
++ if (match_icase && mb_cur_max > 1)
++ /* Avoid kwset */
++ offset = 0;
++ else
++#endif /* MBS_SUPPORT */
++ offset = kwsexec (kwset, beg, buflim - beg, &kwsm);
+ if (offset == (size_t) -1)
+- {
++ goto failure;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free(mb_properties);
+-#endif
+- return (size_t)-1;
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ bytes_left = offset;
++ while (bytes_left)
++ {
++ size_t mlen = mbrlen (beg, bytes_left, &mbs);
++ if (mlen == (size_t) -1 || mlen == 0)
++ {
++ /* Incomplete character: treat as single-byte. */
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ beg++;
++ bytes_left--;
++ continue;
++ }
++
++ if (mlen == (size_t) -2)
++ /* Offset points inside multibyte character:
++ * no good. */
++ break;
++
++ beg += mlen;
++ bytes_left -= mlen;
++ }
+ }
++ else
++#endif /* MBS_SUPPORT */
+ beg += offset;
+ /* Narrow down to the line containing the candidate, and
+ run it through DFA. */
+ end = memchr(beg, eol, buflim - beg);
+ end++;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && mb_properties[beg - buf] == 0)
++ if (mb_cur_max > 1 && bytes_left)
+ continue;
+-#endif
++#endif /* MBS_SUPPORT */
+ while (beg > buf && beg[-1] != eol)
+ --beg;
+- if (kwsm.index < kwset_exact_matches)
+- goto success;
+- if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
++ if (
++#ifdef MBS_SUPPORT
++ !(match_icase && mb_cur_max > 1) &&
++#endif /* MBS_SUPPORT */
++ (kwsm.index < kwset_exact_matches))
++ goto success_in_beg_and_end;
++ if (use_dfa &&
++ dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
+ continue;
+ }
+ else
+ {
+ /* No good fixed strings; start with DFA. */
+- size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref);
++#ifdef MBS_SUPPORT
++ size_t bytes_left = 0;
++#endif /* MBS_SUPPORT */
++ size_t offset = 0;
++ if (use_dfa)
++ offset = dfaexec (&dfa, beg, buflim - beg, &backref);
+ if (offset == (size_t) -1)
+ break;
+ /* Narrow down to the line we've found. */
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ bytes_left = offset;
++ while (bytes_left)
++ {
++ size_t mlen = mbrlen (beg, bytes_left, &mbs);
++ if (mlen == (size_t) -1 || mlen == 0)
++ {
++ /* Incomplete character: treat as single-byte. */
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ beg++;
++ bytes_left--;
++ continue;
++ }
++
++ if (mlen == (size_t) -2)
++ /* Offset points inside multibyte character:
++ * no good. */
++ break;
++
++ beg += mlen;
++ bytes_left -= mlen;
++ }
++ }
++ else
++#endif /* MBS_SUPPORT */
+ beg += offset;
+ end = memchr (beg, eol, buflim - beg);
+ end++;
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1 && bytes_left)
++ continue;
++#endif /* MBS_SUPPORT */
+ while (beg > buf && beg[-1] != eol)
+ --beg;
+ }
+ /* Successful, no backreferences encountered! */
+- if (!backref)
+- goto success;
++ if (use_dfa && !backref)
++ goto success_in_beg_and_end;
+ }
+ else
+ end = beg + size;
+@@ -413,14 +500,11 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ end - beg - 1, &(patterns[i].regs))))
+ {
+ len = patterns[i].regs.end[0] - start;
+- if (exact)
+- {
+- *match_size = len;
+- return start;
+- }
++ if (exact && !match_words)
++ goto success_in_start_and_len;
+ if ((!match_lines && !match_words)
+ || (match_lines && len == end - beg - 1))
+- goto success;
++ goto success_in_beg_and_end;
+ /* If -w, check if the match aligns with word boundaries.
+ We do this iteratively because:
+ (a) the line may contain more than one occurence of the
+@@ -431,10 +515,114 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ if (match_words)
+ while (start >= 0)
+ {
+- if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1]))
+- && (len == end - beg - 1
+- || !WCHAR ((unsigned char) beg[start + len])))
+- goto success;
++ int lword_match = 0;
++ if (start == 0)
++ lword_match = 1;
++ else
++ {
++ assert (start > 0);
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1)
++ {
++ const char *s;
++ size_t mr;
++ wchar_t pwc;
++
++ /* Locate the start of the multibyte character
++ before the match position (== beg + start). */
++ if (using_utf8)
++ {
++ /* UTF-8 is a special case: scan backwards
++ until we find a 7-bit character or a
++ lead byte. */
++ s = beg + start - 1;
++ while (s > buf
++ && (unsigned char) *s >= 0x80
++ && (unsigned char) *s <= 0xbf)
++ --s;
++ }
++ else
++ {
++ /* Scan forwards to find the start of the
++ last complete character before the
++ match position. */
++ size_t bytes_left = start - 1;
++ s = beg;
++ while (bytes_left > 0)
++ {
++ mr = mbrlen (s, bytes_left, &mbs);
++ if (mr == (size_t) -1 || mr == 0)
++ {
++ memset (&mbs, '\0', sizeof (mbs));
++ s++;
++ bytes_left--;
++ continue;
++ }
++ if (mr == (size_t) -2)
++ {
++ memset (&mbs, '\0', sizeof (mbs));
++ break;
++ }
++ s += mr;
++ bytes_left -= mr;
++ }
++ }
++ mr = mbrtowc (&pwc, s, beg + start - s, &mbs);
++ if (mr == (size_t) -2 || mr == (size_t) -1 ||
++ mr == 0)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ lword_match = 1;
++ }
++ else if (!(iswalnum (pwc) || pwc == L'_')
++ && mr == beg + start - s)
++ lword_match = 1;
++ }
++ else
++#endif /* MBS_SUPPORT */
++ if (!WCHAR ((unsigned char) beg[start - 1]))
++ lword_match = 1;
++ }
++
++ if (lword_match)
++ {
++ int rword_match = 0;
++ if (start + len == end - beg - 1)
++ rword_match = 1;
++ else
++ {
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1)
++ {
++ wchar_t nwc;
++ int mr;
++
++ mr = mbtowc (&nwc, beg + start + len,
++ end - beg - start - len - 1);
++ if (mr <= 0)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ rword_match = 1;
++ }
++ else if (!iswalnum (nwc) && nwc != L'_')
++ rword_match = 1;
++ }
++ else
++#endif /* MBS_SUPPORT */
++ if (!WCHAR ((unsigned char) beg[start + len]))
++ rword_match = 1;
++ }
++
++ if (rword_match)
++ {
++ if (!exact)
++ /* Returns the whole line. */
++ goto success_in_beg_and_end;
++ else
++ /* Returns just this word match. */
++ goto success_in_start_and_len;
++ }
++ }
+ if (len > 0)
+ {
+ /* Try a shorter length anchored at the same place. */
+@@ -461,26 +649,154 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ }
+ } /* for Regex patterns. */
+ } /* for (beg = end ..) */
+-#ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && mb_properties)
+- free (mb_properties);
+-#endif /* MBS_SUPPORT */
++
++ failure:
+ return (size_t) -1;
+
+- success:
+-#ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && mb_properties)
+- free (mb_properties);
+-#endif /* MBS_SUPPORT */
+- *match_size = end - beg;
+- return beg - buf;
++ success_in_beg_and_end:
++ len = end - beg;
++ start = beg - buf;
++ /* FALLTHROUGH */
++
++ success_in_start_and_len:
++ *match_size = len;
++ return start;
+ }
+
++#ifdef MBS_SUPPORT
++static int f_i_multibyte; /* whether we're using the new -Fi MB method */
++static struct
++{
++ wchar_t **patterns;
++ size_t count, maxlen;
++ unsigned char *match;
++} Fimb;
++#endif
++
+ static void
+ Fcompile (char const *pattern, size_t size)
+ {
++ int mb_cur_max = MB_CUR_MAX;
+ char const *beg, *lim, *err;
+
++ check_utf8 ();
++#ifdef MBS_SUPPORT
++ /* Support -F -i for UTF-8 input. */
++ if (match_icase && mb_cur_max > 1)
++ {
++ mbstate_t mbs;
++ wchar_t *wcpattern = xmalloc ((size + 1) * sizeof (wchar_t));
++ const char *patternend = pattern;
++ size_t wcsize;
++ kwset_t fimb_kwset = NULL;
++ char *starts = NULL;
++ wchar_t *wcbeg, *wclim;
++ size_t allocated = 0;
++
++ memset (&mbs, '\0', sizeof (mbs));
++# ifdef __GNU_LIBRARY__
++ wcsize = mbsnrtowcs (wcpattern, &patternend, size, size, &mbs);
++ if (patternend != pattern + size)
++ wcsize = (size_t) -1;
++# else
++ {
++ char *patterncopy = xmalloc (size + 1);
++
++ memcpy (patterncopy, pattern, size);
++ patterncopy[size] = '\0';
++ patternend = patterncopy;
++ wcsize = mbsrtowcs (wcpattern, &patternend, size, &mbs);
++ if (patternend != patterncopy + size)
++ wcsize = (size_t) -1;
++ free (patterncopy);
++ }
++# endif
++ if (wcsize + 2 <= 2)
++ {
++fimb_fail:
++ free (wcpattern);
++ free (starts);
++ if (fimb_kwset)
++ kwsfree (fimb_kwset);
++ free (Fimb.patterns);
++ Fimb.patterns = NULL;
++ }
++ else
++ {
++ if (!(fimb_kwset = kwsalloc (NULL)))
++ error (2, 0, _("memory exhausted"));
++
++ starts = xmalloc (mb_cur_max * 3);
++ wcbeg = wcpattern;
++ do
++ {
++ int i;
++ size_t wclen;
++
++ if (Fimb.count >= allocated)
++ {
++ if (allocated == 0)
++ allocated = 128;
++ else
++ allocated *= 2;
++ Fimb.patterns = xrealloc (Fimb.patterns,
++ sizeof (wchar_t *) * allocated);
++ }
++ Fimb.patterns[Fimb.count++] = wcbeg;
++ for (wclim = wcbeg;
++ wclim < wcpattern + wcsize && *wclim != L'\n'; ++wclim)
++ *wclim = towlower (*wclim);
++ *wclim = L'\0';
++ wclen = wclim - wcbeg;
++ if (wclen > Fimb.maxlen)
++ Fimb.maxlen = wclen;
++ if (wclen > 3)
++ wclen = 3;
++ if (wclen == 0)
++ {
++ if ((err = kwsincr (fimb_kwset, "", 0)) != 0)
++ error (2, 0, err);
++ }
++ else
++ for (i = 0; i < (1 << wclen); i++)
++ {
++ char *p = starts;
++ int j, k;
++
++ for (j = 0; j < wclen; ++j)
++ {
++ wchar_t wc = wcbeg[j];
++ if (i & (1 << j))
++ {
++ wc = towupper (wc);
++ if (wc == wcbeg[j])
++ continue;
++ }
++ k = wctomb (p, wc);
++ if (k <= 0)
++ goto fimb_fail;
++ p += k;
++ }
++ if ((err = kwsincr (fimb_kwset, starts, p - starts)) != 0)
++ error (2, 0, err);
++ }
++ if (wclim < wcpattern + wcsize)
++ ++wclim;
++ wcbeg = wclim;
++ }
++ while (wcbeg < wcpattern + wcsize);
++ f_i_multibyte = 1;
++ kwset = fimb_kwset;
++ free (starts);
++ Fimb.match = xmalloc (Fimb.count);
++ if ((err = kwsprep (kwset)) != 0)
++ error (2, 0, err);
++ return;
++ }
++ }
++#endif /* MBS_SUPPORT */
++
++
+ kwsinit ();
+ beg = pattern;
+ do
+@@ -499,6 +815,76 @@ Fcompile (char const *pattern, size_t size)
+ error (2, 0, err);
+ }
+
++#ifdef MBS_SUPPORT
++static int
++Fimbexec (const char *buf, size_t size, size_t *plen, int exact)
++{
++ size_t len, letter, i;
++ int ret = -1;
++ mbstate_t mbs;
++ wchar_t wc;
++ int patterns_left;
++
++ assert (match_icase && f_i_multibyte == 1);
++ assert (MB_CUR_MAX > 1);
++
++ memset (&mbs, '\0', sizeof (mbs));
++ memset (Fimb.match, '\1', Fimb.count);
++ letter = len = 0;
++ patterns_left = 1;
++ while (patterns_left && len <= size)
++ {
++ size_t c;
++
++ patterns_left = 0;
++ if (len < size)
++ {
++ c = mbrtowc (&wc, buf + len, size - len, &mbs);
++ if (c + 2 <= 2)
++ return ret;
++
++ wc = towlower (wc);
++ }
++ else
++ {
++ c = 1;
++ wc = L'\0';
++ }
++
++ for (i = 0; i < Fimb.count; i++)
++ {
++ if (Fimb.match[i])
++ {
++ if (Fimb.patterns[i][letter] == L'\0')
++ {
++ /* Found a match. */
++ *plen = len;
++ if (!exact && !match_words)
++ return 0;
++ else
++ {
++ /* For -w or exact look for longest match. */
++ ret = 0;
++ Fimb.match[i] = '\0';
++ continue;
++ }
++ }
++
++ if (Fimb.patterns[i][letter] == wc)
++ patterns_left = 1;
++ else
++ Fimb.match[i] = '\0';
++ }
++ }
++
++ len += c;
++ letter++;
++ }
++
++ return ret;
++}
++#endif /* MBS_SUPPORT */
++
+ static size_t
+ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ {
+@@ -506,88 +892,268 @@ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ register size_t len;
+ char eol = eolbyte;
+ struct kwsmatch kwsmatch;
++ size_t ret_val;
+ #ifdef MBS_SUPPORT
+- char *mb_properties;
+- if (MB_CUR_MAX > 1)
+- mb_properties = check_multibyte_string (buf, size);
++ int mb_cur_max = MB_CUR_MAX;
++ mbstate_t mbs;
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ const char *last_char = NULL;
+ #endif /* MBS_SUPPORT */
+
+- for (beg = buf; beg <= buf + size; ++beg)
++ for (beg = buf; beg < buf + size; ++beg)
+ {
+- size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
++ size_t offset;
++ offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
++
+ if (offset == (size_t) -1)
+- {
++ goto failure;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free(mb_properties);
+-#endif /* MBS_SUPPORT */
+- return offset;
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ size_t bytes_left = offset;
++ while (bytes_left)
++ {
++ size_t mlen = mbrlen (beg, bytes_left, &mbs);
++
++ last_char = beg;
++ if (mlen == (size_t) -1 || mlen == 0)
++ {
++ /* Incomplete character: treat as single-byte. */
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ beg++;
++ bytes_left--;
++ continue;
++ }
++
++ if (mlen == (size_t) -2)
++ /* Offset points inside multibyte character: no good. */
++ break;
++
++ beg += mlen;
++ bytes_left -= mlen;
++ }
++
++ if (bytes_left)
++ continue;
+ }
+-#ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0)
+- continue; /* It is a part of multibyte character. */
++ else
+ #endif /* MBS_SUPPORT */
+ beg += offset;
+- len = kwsmatch.size[0];
+- if (exact)
+- {
+- *match_size = len;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free (mb_properties);
++ /* For f_i_multibyte, the string at beg now matches first 3 chars of
++ one of the search strings (less if there are shorter search strings).
++ See if this is a real match. */
++ if (f_i_multibyte
++ && Fimbexec (beg, buf + size - beg, &kwsmatch.size[0], exact))
++ goto next_char;
+ #endif /* MBS_SUPPORT */
+- return beg - buf;
+- }
++ len = kwsmatch.size[0];
++ if (exact && !match_words)
++ goto success_in_beg_and_len;
+ if (match_lines)
+ {
+ if (beg > buf && beg[-1] != eol)
+- continue;
++ goto next_char;
+ if (beg + len < buf + size && beg[len] != eol)
+- continue;
++ goto next_char;
+ goto success;
+ }
+ else if (match_words)
+- for (try = beg; len; )
+- {
+- if (try > buf && WCHAR((unsigned char) try[-1]))
+- break;
+- if (try + len < buf + size && WCHAR((unsigned char) try[len]))
+- {
+- offset = kwsexec (kwset, beg, --len, &kwsmatch);
+- if (offset == (size_t) -1)
+- {
++ {
++ while (len)
++ {
++ int word_match = 0;
++ if (beg > buf)
++ {
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free (mb_properties);
++ if (mb_cur_max > 1)
++ {
++ const char *s;
++ int mr;
++ wchar_t pwc;
++
++ if (using_utf8)
++ {
++ s = beg - 1;
++ while (s > buf
++ && (unsigned char) *s >= 0x80
++ && (unsigned char) *s <= 0xbf)
++ --s;
++ }
++ else
++ s = last_char;
++ mr = mbtowc (&pwc, s, beg - s);
++ if (mr <= 0)
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ else if ((iswalnum (pwc) || pwc == L'_')
++ && mr == (int) (beg - s))
++ goto next_char;
++ }
++ else
+ #endif /* MBS_SUPPORT */
+- return offset;
+- }
+- try = beg + offset;
+- len = kwsmatch.size[0];
+- }
+- else
+- goto success;
+- }
++ if (WCHAR ((unsigned char) beg[-1]))
++ goto next_char;
++ }
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1)
++ {
++ wchar_t nwc;
++ int mr;
++
++ mr = mbtowc (&nwc, beg + len, buf + size - beg - len);
++ if (mr <= 0)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ word_match = 1;
++ }
++ else if (!iswalnum (nwc) && nwc != L'_')
++ word_match = 1;
++ }
++ else
++#endif /* MBS_SUPPORT */
++ if (beg + len >= buf + size || !WCHAR ((unsigned char) beg[len]))
++ word_match = 1;
++ if (word_match)
++ {
++ if (!exact)
++ /* Returns the whole line now we know there's a word match. */
++ goto success;
++ else
++ /* Returns just this word match. */
++ goto success_in_beg_and_len;
++ }
++ if (len > 0)
++ {
++ /* Try a shorter length anchored at the same place. */
++ --len;
++ offset = kwsexec (kwset, beg, len, &kwsmatch);
++
++ if (offset == -1)
++ goto next_char; /* Try a different anchor. */
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ size_t bytes_left = offset;
++ while (bytes_left)
++ {
++ size_t mlen = mbrlen (beg, bytes_left, &mbs);
++
++ last_char = beg;
++ if (mlen == (size_t) -1 || mlen == 0)
++ {
++ /* Incomplete character: treat as single-byte. */
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ beg++;
++ bytes_left--;
++ continue;
++ }
++
++ if (mlen == (size_t) -2)
++ {
++ /* Offset points inside multibyte character:
++ * no good. */
++ break;
++ }
++
++ beg += mlen;
++ bytes_left -= mlen;
++ }
++
++ if (bytes_left)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ goto next_char; /* Try a different anchor. */
++ }
++ }
++ else
++#endif /* MBS_SUPPORT */
++ beg += offset;
++#ifdef MBS_SUPPORT
++ /* The string at beg now matches first 3 chars of one of
++ the search strings (less if there are shorter search
++ strings). See if this is a real match. */
++ if (f_i_multibyte
++ && Fimbexec (beg, len - offset, &kwsmatch.size[0],
++ exact))
++ goto next_char;
++#endif /* MBS_SUPPORT */
++ len = kwsmatch.size[0];
++ }
++ }
++ }
+ else
+ goto success;
+- }
+-
++next_char:;
+ #ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free (mb_properties);
++ /* Advance to next character. For MB_CUR_MAX == 1 case this is handled
++ by ++beg above. */
++ if (mb_cur_max > 1)
++ {
++ if (using_utf8)
++ {
++ unsigned char c = *beg;
++ if (c >= 0xc2)
++ {
++ if (c < 0xe0)
++ ++beg;
++ else if (c < 0xf0)
++ beg += 2;
++ else if (c < 0xf8)
++ beg += 3;
++ else if (c < 0xfc)
++ beg += 4;
++ else if (c < 0xfe)
++ beg += 5;
++ }
++ }
++ else
++ {
++ size_t l = mbrlen (beg, buf + size - beg, &mbs);
++
++ last_char = beg;
++ if (l + 2 >= 2)
++ beg += l - 1;
++ else
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ }
++ }
+ #endif /* MBS_SUPPORT */
++ }
++
++ failure:
+ return -1;
+
+ success:
++#ifdef MBS_SUPPORT
++ if (mb_cur_max > 1 && !using_utf8)
++ {
++ end = beg + len;
++ while (end < buf + size)
++ {
++ size_t mlen = mbrlen (end, buf + size - end, &mbs);
++ if (mlen == (size_t) -1 || mlen == (size_t) -2 || mlen == 0)
++ {
++ memset (&mbs, '\0', sizeof (mbstate_t));
++ mlen = 1;
++ }
++ if (mlen == 1 && *end == eol)
++ break;
++
++ end += mlen;
++ }
++ }
++ else
++#endif /* MBS_SUPPORT */
+ end = memchr (beg + len, eol, (buf + size) - (beg + len));
++
+ end++;
+ while (buf < beg && beg[-1] != eol)
+ --beg;
+- *match_size = end - beg;
+-#ifdef MBS_SUPPORT
+- if (MB_CUR_MAX > 1)
+- free (mb_properties);
+-#endif /* MBS_SUPPORT */
++ len = end - beg;
++ /* FALLTHROUGH */
++
++ success_in_beg_and_len:
++ *match_size = len;
+ return beg - buf;
+ }
+
+@@ -701,8 +1267,9 @@ Pexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ char eol = eolbyte;
+ if (!exact)
+ {
+- end = memchr (end, eol, buflim - end);
+- end++;
++ while (end < buflim)
++ if (*end++ == eol)
++ break;
+ while (buf < beg && beg[-1] != eol)
+ --beg;
+ }
+--
+1.8.4.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..3ccce5fc3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
@@ -0,0 +1,52 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:33: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| configure.in:33: the top level
+| autom4te: m4 failed with exit status: 1
+...
+| lib/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
+| src/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
+| autoreconf: automake failed with exit status: 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: grep-2.5.1a/configure.in
+===================================================================
+--- grep-2.5.1a.orig/configure.in
++++ grep-2.5.1a/configure.in
+@@ -30,7 +30,6 @@ AC_PROG_RANLIB
+
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_SYS_LARGEFILE
+-AM_C_PROTOTYPES
+ AC_TYPE_SIZE_T
+ AC_CHECK_TYPE(ssize_t, int)
+ AC_C_CONST
+Index: grep-2.5.1a/lib/Makefile.am
+===================================================================
+--- grep-2.5.1a.orig/lib/Makefile.am
++++ grep-2.5.1a/lib/Makefile.am
+@@ -1,5 +1,5 @@
+ #
+-AUTOMAKE_OPTIONS = ../src/ansi2knr
++AUTOMAKE_OPTIONS =
+
+ SUBDIRS = posix
+
+Index: grep-2.5.1a/src/Makefile.am
+===================================================================
+--- grep-2.5.1a.orig/src/Makefile.am
++++ grep-2.5.1a/src/Makefile.am
+@@ -1,5 +1,5 @@
+ ## Process this file with automake to create Makefile.in
+-AUTOMAKE_OPTIONS = ansi2knr no-dependencies
++AUTOMAKE_OPTIONS = no-dependencies
+
+ LN = ln
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
new file mode 100644
index 000000000..de054fc75
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Fix to use mempcpy instead of __mempcpy. This is needed for uclibc which
+# doesn't define __mempcpy, only mempcpy. Since both uclibc and glibc have
+# mempcpy, we'll just use that instead.
+# Patch source: OpenEmbedded
+
+Index: grep-2.5.1/intl/localealias.c
+===================================================================
+--- grep-2.5.1.orig/intl/localealias.c 2002-03-14 00:39:06.000000000 +1100
++++ grep-2.5.1/intl/localealias.c 2007-05-17 13:53:58.000000000 +1000
+@@ -65,7 +65,7 @@
+ # define strcasecmp __strcasecmp
+
+ # ifndef mempcpy
+-# define mempcpy __mempcpy
++# error "mempcpy not detected"
+ # endif
+ # define HAVE_MEMPCPY 1
+ # define HAVE___FSETLOCKING 1
+Index: grep-2.5.1/lib/getopt.c
+===================================================================
+--- grep-2.5.1.orig/lib/getopt.c 2001-03-04 16:33:12.000000000 +1100
++++ grep-2.5.1/lib/getopt.c 2007-05-17 13:51:44.000000000 +1000
+@@ -326,7 +326,7 @@
+ nonoption_flags_len = nonoption_flags_max_len = 0;
+ else
+ {
+- memset (__mempcpy (new_str, __getopt_nonoption_flags,
++ memset (mempcpy (new_str, __getopt_nonoption_flags,
+ nonoption_flags_max_len),
+ '\0', top + 1 - nonoption_flags_max_len);
+ nonoption_flags_max_len = top + 1;
+@@ -437,7 +437,7 @@
+ if (__getopt_nonoption_flags == NULL)
+ nonoption_flags_max_len = -1;
+ else
+- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
++ memset (mempcpy (__getopt_nonoption_flags, orig_str, len),
+ '\0', nonoption_flags_max_len - len);
+ }
+ }
+Index: grep-2.5.1/lib/regex.c
+===================================================================
+--- grep-2.5.1.orig/lib/regex.c 2001-04-03 04:04:45.000000000 +1000
++++ grep-2.5.1/lib/regex.c 2007-05-17 13:51:48.000000000 +1000
+@@ -7842,7 +7842,7 @@
+ if (msg_size > errbuf_size)
+ {
+ #if defined HAVE_MEMPCPY || defined _LIBC
+- *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
++ *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
+ #else
+ memcpy (errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size - 1] = 0;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.23.bb b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.23.bb
new file mode 100644
index 000000000..13ff32dd8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.23.bb
@@ -0,0 +1,43 @@
+SUMMARY = "GNU grep utility"
+HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
+BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
+SECTION = "console/utils"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8006d9c814277c1bfc4ca22af94b59ee"
+
+SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ "
+
+SRC_URI[md5sum] = "f46aa9d0d2577b9212a104348a286787"
+SRC_URI[sha256sum] = "54fc478ee1ce17780109820ef30730c9e18715a949f7d5c6afc673adb2a56ecf"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF = "--disable-perl-regexp"
+
+do_configure_prepend () {
+ rm -f ${S}/m4/init.m4
+}
+
+do_install () {
+ autotools_do_install
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/grep ${D}${base_bindir}/grep
+ mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
+ mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
+ rmdir ${D}${bindir}/
+ fi
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "grep egrep fgrep"
+ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
+ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
+ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb
new file mode 100644
index 000000000..5a2da2832
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/grep/grep_2.5.1a.bb
@@ -0,0 +1,56 @@
+SUMMARY = "Pattern matching utilities"
+DESCRIPTION = "The GNU versions of commonly used grep utilities. The grep command searches one or more input \
+files for lines containing a match to a specified pattern."
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+PR = "r2"
+
+SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.bz2 \
+ file://uclibc-fix.patch \
+ file://grep_fix_for_automake-1.12.patch \
+ file://gettext.patch \
+ file://fix64-int-to-pointer.patch \
+ file://Makevars \
+ file://grep-CVE-2012-5667.patch \
+ file://fix-for-texinfo-5.1.patch \
+ file://grep-egrep-fgrep-Fix-LSB-NG-cases.patch \
+ "
+
+SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c"
+SRC_URI[sha256sum] = "38c8a2bb9223d1fb1b10bdd607cf44830afc92fd451ac4cd07619bf92bdd3132"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF_INCLUDED_REGEX = "--without-included-regex"
+EXTRA_OECONF_INCLUDED_REGEX_libc-musl = "--with-included-regex"
+
+EXTRA_OECONF = "--disable-perl-regexp \
+ ${EXTRA_OECONF_INCLUDED_REGEX}"
+
+CFLAGS += "-D PROTOTYPES"
+do_configure_prepend () {
+ rm -f ${S}/m4/init.m4
+ cp -f ${WORKDIR}/Makevars ${S}/po/
+}
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/grep ${D}${base_bindir}/grep
+ mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
+ mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
+ rmdir ${D}${bindir}/
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "grep egrep fgrep"
+ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
+ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
+ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch
new file mode 100644
index 000000000..559ae7289
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+---
+ Makefile.sub | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/contrib/groffer/Makefile.sub
++++ b/contrib/groffer/Makefile.sub
+@@ -38,16 +38,16 @@ groffer: groffer.sh groffer2.sh version.
+ $(RM) $@;
+ sed \
+ -e "s|@g@|$(g)|g" \
+- -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
++ -e "s|@BINDIR@|$(bindir)|g" \
+ -e "s|@libdir@|$(DESTDIR)$(libdir)|g" \
+ -e "s|@VERSION@|$(version)$(revision)|g" \
+ $(srcdir)/groffer.sh >$@;
+ chmod +x $@
+
+ install_data: groffer
+- -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
+- -$(RM) $(DESTDIR)$(bindir)/groffer
+- $(INSTALL_SCRIPT) groffer $(DESTDIR)$(bindir)/groffer
++ -test -d $(bindir) || $(mkinstalldirs) $(bindir)
++ -$(RM) $(bindir)/groffer
++ $(INSTALL_SCRIPT) groffer $(bindir)/groffer
+ -test -d $(DESTDIR)$(libdir)/groff/groffer || \
+ $(mkinstalldirs) $(DESTDIR)$(libdir)/groff/groffer
+ -$(RM) $(DESTDIR)$(libdir)/groff/groffer/groffer2.sh
+@@ -58,7 +58,7 @@ install_data: groffer
+ $(DESTDIR)$(libdir)/groff/groffer/version.sh
+
+ uninstall_sub:
+- -$(RM) $(DESTDIR)$(bindir)/groffer
++ -$(RM) $(bindir)/groffer
+ -$(RM) $(DESTDIR)$(libdir)/groff/groffer/groffer2.sh
+ -$(RM) $(DESTDIR)$(libdir)/groff/groffer/version.sh
+ -rmdir $(DESTDIR)$(libdir)/groff/groffer
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch
new file mode 100644
index 000000000..c24eff9af
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch
@@ -0,0 +1,39 @@
+
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ groff-1.18.1.4/Makefile.in | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -460,27 +460,22 @@ OTHERDIRS=\
+ src/roff/grog \
+ src/roff/nroff \
+ contrib/mm \
+ contrib/pic2graph \
+ contrib/eqn2graph \
+- contrib/groffer \
+- contrib/mom \
+- doc
++ contrib/groffer
+ ALLDIRS=$(INCDIRS) $(LIBDIRS) $(PROGDIRS) \
+ $(DEVDIRS) $(OTHERDEVDIRS) $(TTYDEVDIRS) $(OTHERDIRS)
+ EXTRADIRS=\
+ font/devps/generate \
+ font/devdvi/generate \
+ font/devlj4/generate \
+- src/xditview \
+ doc
+ NOMAKEDIRS=\
+ arch/djgpp \
+ contrib/mm/examples \
+ contrib/mm/mm \
+- contrib/mom/examples \
+- contrib/mom/momdoc \
+ src/libs/snprintf
+ DISTDIRS=\
+ $(INCDIRS) $(LIBDIRS) $(PROGDIRS) $(DEVDIRS) $(OTHERDEVDIRS) \
+ $(ALLTTYDEVDIRS) $(OTHERDIRS) $(EXTRADIRS) $(NOMAKEDIRS)
+ TARGETS=all install install_bin install_data clean distclean mostlyclean \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch
new file mode 100644
index 000000000..e3f1aa6a4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: groff-1.18.1.4/tmac/man.local
+===================================================================
+--- groff-1.18.1.4.orig/tmac/man.local 2000-10-26 22:15:17.000000000 +0800
++++ groff-1.18.1.4/tmac/man.local 2010-08-24 14:17:52.070006664 +0800
+@@ -1,2 +1,27 @@
+ .\" This file is loaded after an-old.tmac.
+ .\" Put any local modifications to an-old.tmac here.
++.
++.if n \{\
++. \" Debian: Map \(oq to ' rather than ` in nroff mode for devices other
++. \" than utf8.
++. if !'\*[.T]'utf8' \
++. tr \[oq]'
++.
++. \" Debian: Disable the use of SGR (ANSI colour) escape sequences by
++. \" grotty.
++. if '\V[GROFF_SGR]'' \
++. output x X tty: sgr 0
++.
++. \" Debian: Map \- to the Unicode HYPHEN-MINUS character, to make
++. \" searching in man pages easier.
++. if '\*[.T]'utf8' \
++. char \- \N'45'
++.
++. \" Debian: Many UTF-8 man pages use "-" instead of "\-" for dashes such
++. \" as those in command-line options. This is a bug in those pages, but
++. \" too many fonts are missing the Unicode HYPHEN character, so we render
++. \" this as the ASCII-compatible HYPHEN-MINUS instead.
++. if '\*[.T]'utf8' \
++. char - \N'45'
++.\}
++
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch
new file mode 100644
index 000000000..409c1a5a1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch
@@ -0,0 +1,36 @@
+
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: groff-1.18.1.4/tmac/mdoc.local
+===================================================================
+--- groff-1.18.1.4.orig/tmac/mdoc.local 2001-03-23 08:17:51.000000000 +0800
++++ groff-1.18.1.4/tmac/mdoc.local 2010-08-24 14:20:22.014006846 +0800
+@@ -1,2 +1,26 @@
+ .\" This file is loaded after doc.tmac.
+ .\" Put any local modifications to doc.tmac here.
++.
++.if n \{\
++. \" Debian: Map \(oq to ' rather than ` in nroff mode for devices other
++. \" than utf8.
++. if !'\*[.T]'utf8' \
++. tr \[oq]'
++.
++. \" Debian: Disable the use of SGR (ANSI colour) escape sequences by
++. \" grotty.
++. if '\V[GROFF_SGR]'' \
++. output x X tty: sgr 0
++.
++. \" Debian: Map \- to the Unicode HYPHEN-MINUS character, to make
++. \" searching in man pages easier.
++. if '\*[.T]'utf8' \
++. char \- \N'45'
++.
++. \" Debian: Many UTF-8 man pages use "-" instead of "\-" for dashes such
++. \" as those in command-line options. This is a bug in those pages, but
++. \" too many fonts are missing the Unicode HYPHEN character, so we render
++. \" this as the ASCII-compatible HYPHEN-MINUS instead.
++. if '\*[.T]'utf8' \
++. char - \N'45'
++.\}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..b61b43281
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: groff-1.22.3/src/libs/gnulib/lib/Makefile.am
+===================================================================
+--- groff-1.22.3.orig/src/libs/gnulib/lib/Makefile.am
++++ groff-1.22.3/src/libs/gnulib/lib/Makefile.am
+@@ -113,7 +113,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch
new file mode 100644
index 000000000..c73328a18
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch
@@ -0,0 +1,34 @@
+Correct the install path of man.local to fix following error:
+ /yocto/build/tmp/sysroots/x86_64-linux/usr/share/groff/1.22.2/tmac/an-old.tmac:690: warning: can't find macro file `man.local'
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+Upstream-Status: Pending
+
+diff --git a/tmac/Makefile.sub b/tmac/Makefile.sub
+index 1506232..f1468c5 100644
+--- a/tmac/Makefile.sub
++++ b/tmac/Makefile.sub
+@@ -121,9 +121,9 @@ install_data: $(NORMALFILES) $(SPECIALFILES) man.local \
+ $(RM) $(DESTDIR)$(mdocdir)/$$f; \
+ $(INSTALL_DATA) $$f-s $(DESTDIR)$(mdocdir)/$$f; \
+ done
+- -test -f $(DESTDIR)$(localtmacdir)/man.local \
++ -test -f $(DESTDIR)$(tmacdir)/man.local \
+ || $(INSTALL_DATA) $(srcdir)/man.local \
+- $(DESTDIR)$(localtmacdir)/man.local
++ $(DESTDIR)$(tmacdir)/man.local
+ -test -f $(DESTDIR)$(localtmacdir)/mdoc.local \
+ || $(INSTALL_DATA) mdoc.local-s $(DESTDIR)$(localtmacdir)/mdoc.local
+
+@@ -164,9 +164,9 @@ uninstall_sub:
+ $(RM) $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac
+ $(RM) $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac
+ $(RM) $(DESTDIR)$(tmacdir)/www.tmac
+- -if cmp -s $(DESTDIR)$(localtmacdir)/man.local \
++ -if cmp -s $(DESTDIR)$(tmacdir)/man.local \
+ $(srcdir)/man.local; then \
+- $(RM) $(DESTDIR)$(localtmacdir)/man.local; \
++ $(RM) $(DESTDIR)$(tmacdir)/man.local; \
+ fi
+ -if cmp -s $(DESTDIR)$(localtmacdir)/mdoc.local \
+ $(srcdir)/mdoc.local; then \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb
new file mode 100644
index 000000000..bd786a30a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.18.1.4.bb
@@ -0,0 +1,49 @@
+SUMMARY = "GNU Troff software"
+DESCRIPTION = "The groff (GNU troff) software is a typesetting package which reads plain text mixed with \
+formatting commands and produces formatted output."
+SECTION = "console/utils"
+HOMEPAGE = "http://www.gnu.org/software/groff/"
+LICENSE = "GPLv2"
+PR = "r1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e43fc16fccd8519fba405f0a0ff6e8a3"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/old/${BP}.tar.gz \
+ file://groff-1.18.1.4-remove-mom.patch;striplevel=1 \
+ file://man-local.patch \
+ file://mdoc-local.patch \
+ file://groff-1.18.1.4-fix-bindir.patch \
+"
+
+inherit autotools texinfo
+
+EXTRA_OECONF="--without-x --prefix=${D} --exec-prefix=${D} --bindir=${D}${bindir} --datadir=${D}${datadir} --mandir=${D}${datadir}/man --infodir=${D}${datadir}info --with-appresdir=${D}${datadir}"
+
+SRC_URI[md5sum] = "ceecb81533936d251ed015f40e5f7287"
+SRC_URI[sha256sum] = "ff3c7c3b6cae5e8cc5062a144de5eff0022e8e970e1774529cc2d5dde46ce50d"
+PARALLEL_MAKE = ""
+
+do_configure (){
+ oe_runconf
+}
+
+do_install_append() {
+ # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
+ # for target as /usr/bin/perl, so fix it to /usr/bin/perl.
+ for i in afmtodit mmroff; do
+ if [ -f ${D}${bindir}/$i ]; then
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
+ fi
+ done
+
+ mkdir -p ${D}${sysconfdir}/groff
+ cp -rf ${D}${datadir}/groff/site-tmac/* ${D}${sysconfdir}/groff/
+ cp -rf ${D}${datadir}/groff/site-tmac/* ${D}${datadir}/groff/${PV}/tmac/
+}
+
+pkg_postinst_${PN}() {
+ ln -s tbl $D${bindir}/gtbl
+ echo "export GROFF_FONT_PATH=/usr/share/groff/${PV}/font" >> $D${sysconfdir}/profile
+ echo "export GROFF_TMAC_PATH=/usr/share/groff/${PV}/tmac" >> $D${sysconfdir}/profile
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb
new file mode 100644
index 000000000..4bffa814f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/groff/groff_1.22.3.bb
@@ -0,0 +1,70 @@
+SUMMARY = "GNU Troff software"
+DESCRIPTION = "The groff (GNU troff) software is a typesetting package which reads plain text mixed with \
+formatting commands and produces formatted output."
+SECTION = "base"
+HOMEPAGE = "http://www.gnu.org/software/groff/"
+LICENSE = "GPLv3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
+ file://groff-1.22.2-correct-man.local-install-path.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+"
+
+SRC_URI[md5sum] = "cc825fa64bc7306a885f2fb2268d3ec5"
+SRC_URI[sha256sum] = "3a48a9d6c97750bfbd535feeb5be0111db6406ddb7bb79fc680809cda6d828a5"
+
+DEPENDS = "groff-native"
+DEPENDS_class-native = ""
+RDEPENDS_${PN} += "perl sed"
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "--without-x"
+PARALLEL_MAKE = ""
+
+do_configure_prepend() {
+ if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
+ sed -i \
+ -e '/^GROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/groff:' \
+ -e '/^TROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/troff:' \
+ -e '/^GROFF_BIN_PATH=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \
+ -e '/^GROFF_BIN_DIR=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \
+ ${S}/contrib/*/Makefile.sub \
+ ${S}/doc/Makefile.in \
+ ${S}/doc/Makefile.sub
+ fi
+}
+
+do_configure_append() {
+ # generate gnulib configure script
+ olddir=`pwd`
+ cd ${S}/src/libs/gnulib/
+ ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed."
+ cd ${olddir}
+}
+
+do_install_append() {
+ # Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
+ # for target as /usr/bin/perl, so fix it to /usr/bin/perl.
+ for i in afmtodit mmroff gropdf pdfmom grog; do
+ if [ -f ${D}${bindir}/$i ]; then
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
+ fi
+ done
+ if [ -e ${D}${libdir}/charset.alias ]; then
+ rm -rf ${D}${libdir}/charset.alias
+ fi
+}
+
+do_install_append_class-native() {
+ create_cmdline_wrapper ${D}/${bindir}/groff \
+ -F${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/font \
+ -M${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/tmac
+}
+
+FILES_${PN} += "${libdir}/${BPN}/site-tmac \
+ ${libdir}/${BPN}/groffer/"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
new file mode 100644
index 000000000..d9e8d212b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
@@ -0,0 +1,48 @@
+gzip uses gnulib, whose header conflict with glibc. This patch rename some function to avoid conflict.
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gzip-1.3.12/gzip.c
+===================================================================
+--- gzip-1.3.12.orig/gzip.c 2010-08-13 10:29:38.000000000 +0800
++++ gzip-1.3.12/gzip.c 2010-08-13 10:29:44.000000000 +0800
+@@ -1637,7 +1637,7 @@
+ }
+ }
+
+- if (futimens (ofd, ofname, timespec) != 0)
++ if (futimens_gnulib (ofd, ofname, timespec) != 0)
+ {
+ int e = errno;
+ WARN ((stderr, "%s: ", program_name));
+Index: gzip-1.3.12/lib/utimens.c
+===================================================================
+--- gzip-1.3.12.orig/lib/utimens.c 2010-08-13 10:33:47.000000000 +0800
++++ gzip-1.3.12/lib/utimens.c 2010-08-13 10:34:02.000000000 +0800
+@@ -75,7 +75,7 @@
+ Return 0 on success, -1 (setting errno) on failure. */
+
+ int
+-futimens (int fd ATTRIBUTE_UNUSED,
++futimens_gnulib (int fd ATTRIBUTE_UNUSED,
+ char const *file, struct timespec const timespec[2])
+ {
+ /* Some Linux-based NFS clients are buggy, and mishandle time stamps
+@@ -185,5 +185,5 @@
+ int
+ utimens (char const *file, struct timespec const timespec[2])
+ {
+- return futimens (-1, file, timespec);
++ return futimens_gnulib (-1, file, timespec);
+ }
+Index: gzip-1.3.12/lib/utimens.h
+===================================================================
+--- gzip-1.3.12.orig/lib/utimens.h 2010-08-13 10:14:57.000000000 +0800
++++ gzip-1.3.12/lib/utimens.h 2010-08-13 10:21:45.000000000 +0800
+@@ -1,3 +1,3 @@
+ #include <time.h>
+-int futimens (int, char const *, struct timespec const [2]);
++int futimens_gnulib (int, char const *, struct timespec const [2]);
+ int utimens (char const *, struct timespec const [2]);
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
new file mode 100644
index 000000000..6b2f69870
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
@@ -0,0 +1,56 @@
+remove AC_USE_SYSTEM_EXTENSIONS to fix the autoconf error "AC_REQUIRE: circular
+dependency of AC_GNU_SOURCE"
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gzip-1.3.12/m4/extensions.m4
+===================================================================
+--- gzip-1.3.12.orig/m4/extensions.m4 2010-08-16 14:18:16.000000000 +0800
++++ gzip-1.3.12/m4/extensions.m4 2010-08-16 14:21:54.000000000 +0800
+@@ -12,44 +12,6 @@
+ # enough in this area it's likely we'll need to redefine
+ # AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+- AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+- AC_REQUIRE([AC_GNU_SOURCE])
+- AC_REQUIRE([AC_AIX])
+- AC_REQUIRE([AC_MINIX])
+-
+- AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris. */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+- [ac_cv_safe_to_define___extensions__],
+- [AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM([
+-# define __EXTENSIONS__ 1
+- AC_INCLUDES_DEFAULT])],
+- [ac_cv_safe_to_define___extensions__=yes],
+- [ac_cv_safe_to_define___extensions__=no])])
+- test $ac_cv_safe_to_define___extensions__ = yes &&
+- AC_DEFINE([__EXTENSIONS__])
+- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+- AC_DEFINE([_TANDEM_SOURCE])
+-])
+-
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch
new file mode 100644
index 000000000..92863d6c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch
@@ -0,0 +1,31 @@
+fix MakeMaker issues with using wrong SHELL/GREP
+
+A set of substitution is being processed to all target scripts with sed by
+replacing some key words with the detected values at configure time, this
+is exactly not compliant with cross compling, and will cause missing path
+errors at run time like:
+"/usr/bin/zgrep: line 230: /usr/bin/grep: No such file or directory"
+
+Fixed by removing unneeded substitution and using real runtime paths
+instead.
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+Upstream-Status: Pending
+
+Index: gzip-1.3.12/Makefile.am
+===================================================================
+diff -urpN a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2013-11-30 10:06:09.402234871 +0800
++++ b/Makefile.am 2013-11-30 10:13:42.952236025 +0800
+@@ -81,9 +81,8 @@ gzip.doc.gz: gzip.doc $(bin_PROGRAMS)
+ SUFFIXES = .in
+ .in:
+ $(AM_V_GEN)sed \
+- -e 's|/bin/sh|$(SHELL)|g' \
+ -e 's|[@]bindir@|'\''$(bindir)'\''|g' \
+- -e 's|[@]GREP@|$(GREP)|g' \
++ -e 's|[@]GREP@|$(base_bindir)/grep|g' \
+ -e 's|[@]VERSION@|$(VERSION)|g' \
+ $(srcdir)/$@.in >$@-t \
+ && chmod a+x $@-t \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip.inc b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip.inc
new file mode 100644
index 000000000..6e8188347
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip.inc
@@ -0,0 +1,38 @@
+SUMMARY = "Standard GNU compressor"
+DESCRIPTION = "GNU Gzip is a popular data compression program originally written by Jean-loup Gailly for the GNU \
+project. Mark Adler wrote the decompression part"
+HOMEPAGE = "http://www.gnu.org/software/gzip/"
+SECTION = "console/utils"
+# change to GPLv3+ in 2007/07. Previous GPLv2 version is 1.3.12
+
+inherit autotools texinfo
+export DEFS="NO_ASM"
+
+EXTRA_OEMAKE_class-target = "GREP=${base_bindir}/grep"
+EXTRA_OECONF_append_libc-musl = " gl_cv_func_fflush_stdin=yes "
+
+do_install_append () {
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ # Rename and move files into /bin (FHS), which is typical place for gzip
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip
+ mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip
+ mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat
+ mv ${D}${bindir}/uncompress ${D}${base_bindir}/uncompress
+ fi
+}
+
+do_install_append_libc-musl () {
+ rm ${D}${libdir}/charset.alias
+ rmdir ${D}${libdir}
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "gunzip gzip zcat"
+ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip"
+ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip"
+ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb
new file mode 100644
index 000000000..e4062827b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.3.12.bb
@@ -0,0 +1,15 @@
+require gzip.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://gzip.h;endline=22;md5=c0934ad1900d927f86556153d4c76d23 \
+ file://lzw.h;endline=19;md5=c273e09a02edd9801cc74d39683049e9 "
+
+SRC_URI = "${GNU_MIRROR}/gzip/gzip-${PV}.tar.gz \
+ file://m4-extensions-fix.patch \
+ file://dup-def-fix.patch"
+
+SRC_URI[md5sum] = "b5bac2d21840ae077e0217bc5e4845b1"
+SRC_URI[sha256sum] = "3f565be05f7f3d1aff117c030eb7c738300510b7d098cedea796ca8e4cd587af"
+
+PR = "r2"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.6.bb b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.6.bb
new file mode 100644
index 000000000..b347f0bb8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/gzip/gzip_1.6.bb
@@ -0,0 +1,17 @@
+require gzip.inc
+
+LICENSE = "GPLv3+"
+
+SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz"
+SRC_URI_append_class-target = " file://wrong-path-fix.patch"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://gzip.h;beginline=8;endline=20;md5=6e47caaa630e0c8bf9f1bc8d94a8ed0e"
+
+PROVIDES_append_class-native = " gzip-replacement-native"
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "38603cb2843bf5681ff41aab3bcd6a20"
+SRC_URI[sha256sum] = "97eb83b763d9e5ad35f351fe5517e6b71521d7aac7acf3e3cacdb6b1496d8f7e"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb b/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb
new file mode 100644
index 000000000..ec3d26f42
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/hdparm/hdparm_9.48.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utility for viewing/manipulating IDE disk drive/driver parameters"
+DESCRIPTION = "hdparm is a Linux shell utility for viewing \
+and manipulating various IDE drive and driver parameters."
+SECTION = "console/utils"
+LICENSE = "BSD"
+LICENSE_wiper = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=910a8a42c962d238619c75fdb78bdb24 \
+ file://debian/copyright;md5=a82d7ba3ade9e8ec902749db98c592f3 \
+ file://wiper/GPLv2.txt;md5=fcb02dc552a041dee27e4b85c7396067 \
+ file://wiper/wiper.sh;beginline=7;endline=31;md5=b7bc642addc152ea307505bf1a296f09"
+
+
+PACKAGES =+ "wiper"
+
+FILES_wiper = "${bindir}/wiper.sh"
+
+RDEPENDS_wiper = "bash gawk stat"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/${BP}.tar.gz "
+
+SRC_URI[md5sum] = "213efdbe7471fad3408198918e164354"
+SRC_URI[sha256sum] = "ce97b4a71cb04146f54cf6f69787e7f97ddfda9836dc803b459d3b3df3a4fbee"
+
+EXTRA_OEMAKE = '-e MAKEFLAGS= STRIP="echo"'
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "hdparm"
+ALTERNATIVE_LINK_NAME[hdparm] = "${base_sbindir}/hdparm"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install () {
+ install -d ${D}/${base_sbindir} ${D}/${mandir}/man8 ${D}/${bindir}
+ oe_runmake 'DESTDIR=${D}' 'sbindir=${base_sbindir}' install
+ cp ${S}/wiper/wiper.sh ${D}/${bindir}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-full-cmdline.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-full-cmdline.bb
new file mode 100644
index 000000000..4d69073d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-full-cmdline.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "A console-only image with more full-featured Linux system \
+functionality installed."
+
+IMAGE_FEATURES += "splash ssh-server-openssh"
+
+IMAGE_INSTALL = "\
+ packagegroup-core-boot \
+ packagegroup-core-full-cmdline \
+ ${CORE_IMAGE_EXTRA_INSTALL} \
+ "
+
+inherit core-image
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-kernel-dev.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-kernel-dev.bb
new file mode 100644
index 000000000..26b88c9e8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-kernel-dev.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "A development image that builds the kernel and packages that are \
+sensitive to kernel updates and version changes"
+
+# Could also be core-image-basic, but we'll keep this small for now
+require recipes-core/images/core-image-minimal.bb
+
+KERNEL_DEV_UTILS ?= "dropbear connman"
+KERNEL_DEV_TOOLS ?= "packagegroup-core-tools-profile packagegroup-core-buildessential kernel-devsrc"
+KERNEL_DEV_MODULE ?= "kernel-modules"
+
+CORE_IMAGE_EXTRA_INSTALL += "${KERNEL_DEV_MODULE} \
+ ${KERNEL_DEV_UTILS} \
+ ${KERNEL_DEV_TOOLS} \
+ "
+
+# We need extra space for things like kernel builds, etc.
+IMAGE_ROOTFS_EXTRA_SPACE_append += "+ 3000000"
+
+# Let's define our own subset to test, we can later add a on-target kernel build even!
+DEFAULT_TEST_SUITES = "ping ssh df connman syslog scp date parselogs"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-dev.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-dev.bb
new file mode 100644
index 000000000..d2dc9e2b5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-dev.bb
@@ -0,0 +1,7 @@
+require core-image-lsb.bb
+
+DESCRIPTION = "Basic image without X support suitable for development work. It \
+can be used for customization and implementations that conform to Linux \
+Standard Base (LSB)."
+
+IMAGE_FEATURES += "dev-pkgs"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb
new file mode 100644
index 000000000..c3b6e7c82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb-sdk.bb
@@ -0,0 +1,9 @@
+require core-image-lsb.bb
+
+DESCRIPTION = "Basic image without X support suitable for Linux Standard Base \
+(LSB) implementations. It includes the full meta-toolchain, plus development \
+headers and libraries to form a standalone SDK."
+
+IMAGE_FEATURES += "tools-sdk dev-pkgs tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks"
+
+IMAGE_INSTALL += "kernel-devsrc"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb.bb
new file mode 100644
index 000000000..ab61c6e6d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-lsb.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "An image containing packages that are required to conform \
+to the Linux Standard Base (LSB) specification."
+
+IMAGE_FEATURES += "splash ssh-server-openssh hwcodecs package-management"
+
+IMAGE_INSTALL = "\
+ ${CORE_IMAGE_BASE_INSTALL} \
+ packagegroup-core-full-cmdline \
+ packagegroup-core-lsb \
+ "
+
+inherit core-image distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "pam"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
new file mode 100644
index 000000000..ad1407c7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "Small image capable of booting a device with custom install scripts, \
+adding a second rootfs, used for testing."
+
+# use -testfs live-install scripts
+PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install-testfs initramfs-live-install-efi-testfs busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "core-image-testmaster-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "0"
+BAD_RECOMMENDATIONS += "busybox-syslog"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster.bb b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster.bb
new file mode 100644
index 000000000..78295c5f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/images/core-image-testmaster.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "A master image to be deployed on a target useful for testing other images"
+
+IMAGE_FEATURES += "ssh-server-openssh package-management"
+
+inherit core-image
+
+# the deploy code requires bash and
+# normal linux utilities not busybox ones
+IMAGE_INSTALL += "\
+ bash coreutils util-linux tar gzip bzip2 kmod \
+ python-modules python-misc \
+ e2fsprogs e2fsprogs-mke2fs parted \
+ "
+# we need a particular initramfs for live images
+# that pulls custom install scripts which take
+# care of partitioning for us
+INITRD_IMAGE = "core-image-testmaster-initramfs"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
new file mode 100644
index 000000000..b711b7aa3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
@@ -0,0 +1,37 @@
+[PATCH] configure: Add option to enable/disable libnfnetlink
+
+This changes the configure behaviour from autodetecting
+for libnfnetlink to having an option to disable it explicitly
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur iptables-1.6.0-old/configure.ac iptables-1.6.0/configure.ac
+--- iptables-1.6.0-old/configure.ac 2015-12-28 18:40:35.255417976 +0200
++++ iptables-1.6.0/configure.ac 2015-12-29 13:01:12.388840200 +0200
+@@ -63,6 +63,9 @@
+ AC_ARG_ENABLE([nftables],
+ AS_HELP_STRING([--disable-nftables], [Do not build nftables compat]),
+ [enable_nftables="$enableval"], [enable_nftables="yes"])
++AC_ARG_ENABLE([libnfnetlink],
++ AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]),
++ [enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"])
+
+ libiptc_LDFLAGS2="";
+ AX_CHECK_LINKER_FLAGS([-Wl,--no-as-needed],
+@@ -123,9 +126,10 @@
+ AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool))
+ fi
+
+-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
+- [nfnetlink=1], [nfnetlink=0])
+-AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
++AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
++ PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0])
++ ])
++AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "x$enable_libnfnetlink" = "xyes"])
+
+ if test "x$enable_nftables" = "xyes"; then
+ PKG_CHECK_MODULES([libmnl], [libmnl >= 1.0], [mnl=1], [mnl=0])
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch
new file mode 100644
index 000000000..f1f85a6fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch
@@ -0,0 +1,46 @@
+[PATCH] fix build with musl
+
+Define additional TCOPTS if not there
+u_initX types are in sys/types.h be explicit about it
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur iptables-1.6.0-origin/extensions/libxt_TCPOPTSTRIP.c iptables-1.6.0/extensions/libxt_TCPOPTSTRIP.c
+--- iptables-1.6.0-origin/extensions/libxt_TCPOPTSTRIP.c 2015-12-09 14:55:06.000000000 +0200
++++ iptables-1.6.0/extensions/libxt_TCPOPTSTRIP.c 2015-12-29 14:44:32.585327077 +0200
+@@ -12,6 +12,21 @@
+ #ifndef TCPOPT_MD5SIG
+ # define TCPOPT_MD5SIG 19
+ #endif
++#ifndef TCPOPT_MAXSEG
++#define TCPOPT_MAXSEG 2
++#endif
++#ifndef TCPOPT_WINDOW
++#define TCPOPT_WINDOW 3
++#endif
++#ifndef TCPOPT_SACK_PERMITTED
++#define TCPOPT_SACK_PERMITTED 4
++#endif
++#ifndef TCPOPT_SACK
++#define TCPOPT_SACK 5
++#endif
++#ifndef TCPOPT_TIMESTAMP
++#define TCPOPT_TIMESTAMP 8
++#endif
+
+ enum {
+ O_STRIP_OPTION = 0,
+diff -Naur iptables-1.6.0-origin/include/linux/netfilter_ipv4/ip_tables.h iptables-1.6.0/include/linux/netfilter_ipv4/ip_tables.h
+--- iptables-1.6.0-origin/include/linux/netfilter_ipv4/ip_tables.h 2015-12-09 14:55:06.000000000 +0200
++++ iptables-1.6.0/include/linux/netfilter_ipv4/ip_tables.h 2015-12-29 14:40:21.250469195 +0200
+@@ -15,6 +15,7 @@
+ #ifndef _IPTABLES_H
+ #define _IPTABLES_H
+
++#include <sys/types.h>
+ #include <linux/types.h>
+
+ #include <linux/netfilter_ipv4.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
new file mode 100644
index 000000000..89ad8f666
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
@@ -0,0 +1,34 @@
+Package libnetfilter-conntrack depends on package libnfnetlink. iptables
+checks package libnetfilter-conntrack whatever its package config
+libnfnetlink is enabled or not. When libnfnetlink is disabled but
+package libnetfilter-conntrack exists, it fails randomly with:
+
+| In file included from .../iptables/1.4.21-r0/iptables-1.4.21/extensions/libxt_connlabel.c:8:0:
+| .../tmp/sysroots/qemumips/usr/include/libnetfilter_conntrack/libnetfilter_conntrack.h:14:42: fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory
+| compilation terminated.
+| GNUmakefile:96: recipe for target 'libxt_connlabel.oo' failed
+
+Only check libnetfilter-conntrack when libnfnetlink is enabled to fix it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index 5d7e62b..e331ee7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -88,8 +88,12 @@ if test "$ac_cv_header_linux_ip_vs_h" != "yes"; then
+ blacklist_modules="$blacklist_modules ipvs";
+ fi;
+
+-PKG_CHECK_MODULES([libnetfilter_conntrack], [libnetfilter_conntrack >= 1.0.4],
++nfconntrack=0
++AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
++ PKG_CHECK_MODULES([libnetfilter_conntrack], [libnetfilter_conntrack >= 1.0.4],
+ [nfconntrack=1], [nfconntrack=0])
++ ])
++
+ AM_CONDITIONAL([HAVE_LIBNETFILTER_CONNTRACK], [test "$nfconntrack" = 1])
+
+ if test "$nfconntrack" -ne 1; then
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch
new file mode 100644
index 000000000..24ee29e2d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch
@@ -0,0 +1,49 @@
+From 19593491f43b70c1a71c3b9b8f4ff4fd14500014 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Fri, 23 Mar 2012 14:27:20 -0400
+Subject: [PATCH] types.h: add defines that are required for if_packet.h
+
+The iptables local linux/types.h overrides the kernel/sysroot
+types.h. As such, we need to provide some defines that are required
+to build against 3.2+ kernel headers.
+
+ifndef protection is provided for the defines to ensure that
+configuration that already have these defines are still buildable.
+
+This commit is temporary until a new version of iptables can be
+used that contains the defines.
+
+This is similar to the commit in the iptables git repository:
+
+ https://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commit;h=dbe77cc974cee656eae37e75039dd1a410a4535b
+
+Upstream-Status: Backport
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+---
+ include/linux/types.h | 10 ++++++++++
+ 1 files changed, 10 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/types.h b/include/linux/types.h
+index 8b483c8..ebf6432 100644
+--- a/include/linux/types.h
++++ b/include/linux/types.h
+@@ -34,5 +34,15 @@ typedef __u64 __bitwise __be64;
+ typedef __u16 __bitwise __sum16;
+ typedef __u32 __bitwise __wsum;
+
++#ifndef __aligned_u64
++#define __aligned_u64 __u64 __attribute__((aligned(8)))
++#endif
++#ifndef __aligned_be64
++#define __aligned_be64 __be64 __attribute__((aligned(8)))
++#endif
++#ifndef __aligned_le64
++#define __aligned_le64 __le64 __attribute__((aligned(8)))
++#endif
++
+ #endif /* __ASSEMBLY__ */
+ #endif /* _LINUX_TYPES_H */
+--
+1.7.0.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb
new file mode 100644
index 000000000..fbbe4186b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iptables/iptables_1.6.0.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Tools for managing kernel packet filtering capabilities"
+DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \
+filtering code in Linux."
+HOMEPAGE = "http://www.netfilter.org/"
+BUGTRACKER = "http://bugzilla.netfilter.org/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
+ file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc"
+
+RRECOMMENDS_${PN} = "kernel-module-x-tables \
+ kernel-module-ip-tables \
+ kernel-module-iptable-filter \
+ kernel-module-iptable-nat \
+ kernel-module-nf-defrag-ipv4 \
+ kernel-module-nf-conntrack \
+ kernel-module-nf-conntrack-ipv4 \
+ kernel-module-nf-nat \
+ kernel-module-ipt-masquerade"
+FILES_${PN} =+ "${libdir}/xtables/ ${datadir}/xtables"
+
+SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
+ file://types.h-add-defines-that-are-required-for-if_packet.patch \
+ file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
+ file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \
+ "
+SRC_URI_append_libc-musl = " file://0001-fix-build-with-musl.patch"
+
+SRC_URI[md5sum] = "27ba3451cb622467fc9267a176f19a31"
+SRC_URI[sha256sum] = "4bb72a0a0b18b5a9e79e87631ddc4084528e5df236bc7624472dcaa8480f1c60"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR} \
+ "
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+ "
+
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+# libnfnetlink recipe is in meta-networking layer
+PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libnfnetlink libnetfilter-conntrack"
+
+# libnftnl recipe is in meta-networking layer(previously known as libnftables)
+PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl"
+
+do_configure_prepend() {
+ # Remove some libtool m4 files
+ # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
+ rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch
new file mode 100644
index 000000000..20ef07e44
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Fix-header-inclusion-for-musl.patch
@@ -0,0 +1,92 @@
+From be0bb81d72fea4d20da74f4f2236aa145684f332 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 6 Jan 2016 14:14:22 -0800
+Subject: [PATCH] Fix header inclusion for musl
+
+Fix errors e.g.
+
+In file included from tracepath.c:17:0:
+/usr/include/linux/errqueue.h:33:18:
+error: array type has incomplete element type 'struct timespec'
+ struct timespec ts[3];
+ ^
+tracepath.c: In function 'main':
+tracepath.c:329:16: error: 'INT_MAX' undeclared (first use in this
+function)
+ overhead, INT_MAX);
+ ^
+tracepath.c:329:16: note: each undeclared identifier is reported only
+once for each function it appears in
+Makefile:131: recipe for target 'tracepath.o' failed
+make: *** [tracepath.o] Error 1
+
+ping_common.c: In function 'main_loop':
+ping_common.c:756:15: error: 'HZ' undeclared (first use in this
+function)
+ if (1000 % HZ == 0 ? next <= 1000 / HZ : (next < INT_MAX / HZ &&
+next * HZ <= 1000)) {
+
+protocols/timed.h is not needed and is absent in musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ clockdiff.c | 1 -
+ ping_common.c | 1 +
+ tracepath.c | 2 ++
+ tracepath6.c | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/clockdiff.c b/clockdiff.c
+index 7c1ea1b..1d6341e 100644
+--- a/clockdiff.c
++++ b/clockdiff.c
+@@ -14,7 +14,6 @@
+ #include <netinet/ip.h>
+ #include <netinet/ip_icmp.h>
+ #define TSPTYPES
+-#include <protocols/timed.h>
+ #include <fcntl.h>
+ #include <netdb.h>
+ #include <arpa/inet.h>
+diff --git a/ping_common.c b/ping_common.c
+index 7f82851..3ce699d 100644
+--- a/ping_common.c
++++ b/ping_common.c
+@@ -2,6 +2,7 @@
+ #include <ctype.h>
+ #include <sched.h>
+ #include <math.h>
++#include <asm-generic/param.h>
+
+ int options;
+
+diff --git a/tracepath.c b/tracepath.c
+index 89e6d16..c9d6ddd 100644
+--- a/tracepath.c
++++ b/tracepath.c
+@@ -12,6 +12,8 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <limits.h>
++#include <time.h>
+ #include <sys/socket.h>
+ #include <linux/types.h>
+ #include <linux/errqueue.h>
+diff --git a/tracepath6.c b/tracepath6.c
+index 126fadf..9d5745c 100644
+--- a/tracepath6.c
++++ b/tracepath6.c
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <limits.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netinet/icmp6.h>
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch
new file mode 100644
index 000000000..6da01dc61
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch
@@ -0,0 +1,52 @@
+From 000629f74908a2a95f6104444c77ad93cf40d62d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 08:50:50 +0000
+Subject: [PATCH] Intialize struct elements by name
+
+makes it portable across glibc and musl
+
+Fixes errors
+
+| ping.c: In function 'send_probe':
+| ping.c:735:19: warning: initialization makes integer from pointer
+without a cast [-Wint-conversion]
+| &iov, 1, &cmsg, 0, 0 };
+| ^
+| ping.c:735:19: note: (near initialization for 'm.__pad1')
+| ping.c:735:19: error: initializer element is not computable at load
+time
+| ping.c:735:19: note: (near initialization for 'm.__pad1')
+| make: *** [ping.o] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ ping.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/ping.c b/ping.c
+index 4989760..e67f381 100644
+--- a/ping.c
++++ b/ping.c
+@@ -731,8 +731,15 @@ int send_probe()
+
+ do {
+ static struct iovec iov = {outpack, 0};
+- static struct msghdr m = { &whereto, sizeof(whereto),
+- &iov, 1, &cmsg, 0, 0 };
++ static struct msghdr m = {
++ .msg_name = &whereto,
++ .msg_namelen = sizeof(whereto),
++ .msg_iov = &iov,
++ .msg_iovlen = 1,
++ .msg_control = &cmsg,
++ .msg_controllen = 0,
++ .msg_flags= 0,
++ };
+ m.msg_controllen = cmsg_len;
+ iov.iov_len = cc;
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/targets.diff b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/targets.diff
new file mode 100644
index 000000000..2cb5576c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/targets.diff
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [disable feature]
+
+Index: iputils-s20121221/Makefile
+===================================================================
+--- iputils-s20121221.orig/Makefile
++++ iputils-s20121221/Makefile
+@@ -106,7 +106,7 @@ endif
+ endif
+
+ # -------------------------------------
+-IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
++IPV4_TARGETS=tracepath ping clockdiff arping
+ IPV6_TARGETS=tracepath6 traceroute6 ping6
+ TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff
new file mode 100644
index 000000000..d3b18868c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff
@@ -0,0 +1,31 @@
+Upstream-Status: Pending [from other distro Debian]
+
+Index: iputils-s20121221/tracepath.c
+===================================================================
+--- iputils-s20121221.orig/tracepath.c
++++ iputils-s20121221/tracepath.c
+@@ -370,9 +370,9 @@ main(int argc, char **argv)
+ }
+ #endif
+
+- he = gethostbyname(p);
++ he = gethostbyname2(argv[0], AF_INET);
+ if (he == NULL) {
+- herror("gethostbyname");
++ herror("gethostbyname2");
+ exit(1);
+ }
+
+Index: iputils-s20121221/ping.c
+===================================================================
+--- iputils-s20121221.orig/ping.c
++++ iputils-s20121221/ping.c
+@@ -279,7 +279,7 @@ main(int argc, char **argv)
+ #else
+ idn = target;
+ #endif
+- hp = gethostbyname(idn);
++ hp = gethostbyname2(idn, AF_INET);
+ if (!hp) {
+ fprintf(stderr, "ping: unknown host %s\n", target);
+ exit(2);
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch
new file mode 100644
index 000000000..92bf946f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch
@@ -0,0 +1,27 @@
+Fix nsgmls path issue
+
+Upstream-Status: Pending
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Index: iputils-s20101006/doc/Makefile
+===================================================================
+--- iputils-s20101006.orig/doc/Makefile 2011-09-13 20:42:27.000000000 +0800
++++ iputils-s20101006/doc/Makefile 2011-09-13 21:01:52.000000000 +0800
+@@ -27,10 +27,15 @@
+ # docbook2man produces utterly ugly output and I did not find
+ # any way to customize this but hacking backend perl script a little.
+ # Well, hence...
++# nsgmls seems append path to search directory according to the sysid path.
++# e.g. if input ../index.db, it would search $search_directory/../ rather than
++# $search_directory, which leads searching failure. Fixing nsgmls probably
++# introduce some side effects, so use this ugly hack: running nsgmls in current
++# directory, and running docbook2man in tmp directory.
+
+ $(MANFILES): index.db
+ @-mkdir tmp.db2man
+- @set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
++ @set -e; nsgmls $< >tmp.db2man/output; cd tmp.db2man; cat output | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
+ @-rm -rf tmp.db2man
+
+ clean:
diff --git a/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb b/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb
new file mode 100644
index 000000000..715045470
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/iputils/iputils_s20151218.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Network monitoring tools"
+DESCRIPTION = "Utilities for the IP protocol, including traceroute6, \
+tracepath, tracepath6, ping, ping6 and arping."
+HOMEPAGE = "http://www.skbuff.net/iputils"
+SECTION = "console/network"
+
+LICENSE = "BSD & GPLv2+"
+
+LIC_FILES_CHKSUM = "file://ping.c;beginline=1;endline=35;md5=f9ceb201733e9a6cf8f00766dd278d82 \
+ file://tracepath.c;beginline=1;endline=10;md5=0ecea2bf60bff2f3d840096d87647f3d \
+ file://arping.c;beginline=1;endline=11;md5=fe84301b5c2655c950f8b92a057fafa6 \
+ file://tftpd.c;beginline=1;endline=32;md5=28834bf8a91a5b8a92755dbee709ef96 "
+
+DEPENDS = "gnutls docbook-utils-native sgmlspl-native libcap libgcrypt"
+
+
+SRC_URI = "http://www.skbuff.net/iputils/${BPN}-${PV}.tar.bz2 \
+ file://debian/use_gethostbyname2.diff \
+ file://debian/targets.diff \
+ file://nsgmls-path-fix.patch \
+ file://0001-Fix-header-inclusion-for-musl.patch \
+ file://0001-Intialize-struct-elements-by-name.patch \
+ "
+
+SRC_URI[md5sum] = "8aaa7395f27dff9f57ae016d4bc753ce"
+SRC_URI[sha256sum] = "549f58d71951e52b46595829134d4e330642f522f50026917fadc349a54825a1"
+
+UPSTREAM_CHECK_REGEX = "iputils-(?P<pver>s\d+).tar"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_compile () {
+ oe_runmake 'CC=${CC} -D_GNU_SOURCE' VPATH="${STAGING_LIBDIR}:${STAGING_DIR_HOST}/${base_libdir}" all man
+}
+
+do_install () {
+ install -m 0755 -d ${D}${base_bindir} ${D}${mandir}/man8
+ # SUID root programs
+ install -m 4555 ping ${D}${base_bindir}/ping
+ install -m 4555 ping6 ${D}${base_bindir}/ping6
+ install -m 4555 traceroute6 ${D}${base_bindir}/
+ install -m 4555 clockdiff ${D}${base_bindir}/
+ # Other programgs
+ for i in arping tracepath tracepath6; do
+ install -m 0755 $i ${D}${base_bindir}/
+ done
+ # Manual pages for things we build packages for
+ for i in tracepath.8 traceroute6.8 ping.8 arping.8; do
+ install -m 0644 doc/$i ${D}${mandir}/man8/ || true
+ done
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}-ping = "ping"
+ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping"
+
+ALTERNATIVE_${PN}-ping6 = "ping6"
+ALTERNATIVE_LINK_NAME[ping6] = "${base_bindir}/ping6"
+
+PACKAGES += "${PN}-ping ${PN}-ping6 ${PN}-arping ${PN}-tracepath ${PN}-tracepath6 ${PN}-traceroute6 ${PN}-clockdiff"
+
+ALLOW_EMPTY_${PN} = "1"
+RDEPENDS_${PN} += "${PN}-ping ${PN}-ping6 ${PN}-arping ${PN}-tracepath ${PN}-tracepath6 ${PN}-traceroute6 ${PN}-clockdiff"
+
+FILES_${PN} = ""
+FILES_${PN}-ping = "${base_bindir}/ping.${BPN}"
+FILES_${PN}-ping6 = "${base_bindir}/ping6.${BPN}"
+FILES_${PN}-arping = "${base_bindir}/arping"
+FILES_${PN}-tracepath = "${base_bindir}/tracepath"
+FILES_${PN}-tracepath6 = "${base_bindir}/tracepath6"
+FILES_${PN}-traceroute6 = "${base_bindir}/traceroute6"
+FILES_${PN}-clockdiff = "${base_bindir}/clockdiff"
+FILES_${PN}-doc = "${mandir}/man8"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb b/import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb
new file mode 100644
index 000000000..0fcd81968
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/less/less_481.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Text file viewer similar to more"
+DESCRIPTION = "Less is a program similar to more, i.e. a terminal \
+based program for viewing text files and the output from other \
+programs. Less offers many features beyond those that more does."
+HOMEPAGE = "http://www.greenwoodsoftware.com/"
+SECTION = "console/utils"
+
+# (GPLv2+ (<< 418), GPLv3+ (>= 418)) | less
+# Including email author giving permissing to use BSD
+#
+# From: Mark Nudelman <markn@greenwoodsoftware.com>
+# To: Elizabeth Flanagan <elizabeth.flanagan@intel.com
+# Date: 12/19/11
+#
+# Hi Elizabeth,
+# Using a generic BSD license for less is fine with me.
+# Thanks,
+#
+# --Mark
+#
+
+LICENSE = "GPLv3+ | BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://LICENSE;md5=48c26a307f91af700e1f00585f215aaf"
+DEPENDS = "ncurses"
+
+SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \
+ "
+
+SRC_URI[md5sum] = "50ef46065c65257141a7340123527767"
+SRC_URI[sha256sum] = "3fa38f2cf5e9e040bb44fffaa6c76a84506e379e47f5a04686ab78102090dda5"
+
+UPSTREAM_CHECK_URI = "http://www.greenwoodsoftware.com/less/download.html"
+
+inherit autotools update-alternatives
+
+do_install () {
+ oe_runmake 'bindir=${D}${bindir}' 'mandir=${D}${mandir}' install
+}
+
+ALTERNATIVE_${PN} = "less"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/00_arches.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/00_arches.patch
new file mode 100644
index 000000000..9d6447d98
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/00_arches.patch
@@ -0,0 +1,607 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+from openembedded, added by Qing He <qing.he@intel.com>
+
+Index: libaio-0.3.110/src/syscall-m68k.h
+===================================================================
+--- /dev/null
++++ libaio-0.3.110/src/syscall-m68k.h
+@@ -0,0 +1,78 @@
++#define __NR_io_setup 241
++#define __NR_io_destroy 242
++#define __NR_io_getevents 243
++#define __NR_io_submit 244
++#define __NR_io_cancel 245
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a) ); \
++return (type) __res; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a,btype b) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b) \
++ ); \
++return (type) __res; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a,btype b,ctype c) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b), \
++ "d" (__c) \
++ ); \
++return (type) __res; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname (atype a, btype b, ctype c, dtype d) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b), \
++ "d" (__c), "d" (__d) \
++ ); \
++return (type) __res; \
++}
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++register long __e __asm__ ("%d5") = (long)(e); \
++__asm__ __volatile__ ("trap #0" \
++ : "+d" (__res) \
++ : "d" (__a), "d" (__b), \
++ "d" (__c), "d" (__d), "d" (__e) \
++ ); \
++return (type) __res; \
++}
++
+Index: libaio-0.3.110/src/syscall.h
+===================================================================
+--- libaio-0.3.110.orig/src/syscall.h
++++ libaio-0.3.110/src/syscall.h
+@@ -28,6 +28,12 @@
+ #include "syscall-sparc.h"
+ #elif defined(__aarch64__)
+ #include "syscall-arm64.h"
++#elif defined(__m68k__)
++#include "syscall-m68k.h"
++#elif defined(__hppa__)
++#include "syscall-parisc.h"
++#elif defined(__mips__)
++#include "syscall-mips.h"
+ #else
+ #warning "using generic syscall method"
+ #include "syscall-generic.h"
+Index: libaio-0.3.110/src/syscall-mips.h
+===================================================================
+--- /dev/null
++++ libaio-0.3.110/src/syscall-mips.h
+@@ -0,0 +1,223 @@
++/*
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License. See the file "COPYING" in the main directory of this archive
++ * for more details.
++ *
++ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
++ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
++ *
++ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
++ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
++ */
++
++#ifndef _MIPS_SIM_ABI32
++#define _MIPS_SIM_ABI32 1
++#define _MIPS_SIM_NABI32 2
++#define _MIPS_SIM_ABI64 3
++#endif
++
++#if _MIPS_SIM == _MIPS_SIM_ABI32
++
++/*
++ * Linux o32 style syscalls are in the range from 4000 to 4999.
++ */
++#define __NR_Linux 4000
++#define __NR_io_setup (__NR_Linux + 241)
++#define __NR_io_destroy (__NR_Linux + 242)
++#define __NR_io_getevents (__NR_Linux + 243)
++#define __NR_io_submit (__NR_Linux + 244)
++#define __NR_io_cancel (__NR_Linux + 245)
++
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
++
++#if _MIPS_SIM == _MIPS_SIM_ABI64
++
++/*
++ * Linux 64-bit syscalls are in the range from 5000 to 5999.
++ */
++#define __NR_Linux 5000
++#define __NR_io_setup (__NR_Linux + 200)
++#define __NR_io_destroy (__NR_Linux + 201)
++#define __NR_io_getevents (__NR_Linux + 202)
++#define __NR_io_submit (__NR_Linux + 203)
++#define __NR_io_cancel (__NR_Linux + 204)
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
++
++#if _MIPS_SIM == _MIPS_SIM_NABI32
++
++/*
++ * Linux N32 syscalls are in the range from 6000 to 6999.
++ */
++#define __NR_Linux 6000
++#define __NR_io_setup (__NR_Linux + 200)
++#define __NR_io_destroy (__NR_Linux + 201)
++#define __NR_io_getevents (__NR_Linux + 202)
++#define __NR_io_submit (__NR_Linux + 203)
++#define __NR_io_cancel (__NR_Linux + 204)
++#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a3 asm("$7"); \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %3\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "=r" (__a3) \
++ : "r" (__a0), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a, btype b) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a3 asm("$7"); \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %4\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "=r" (__a3) \
++ : "r" (__a0), "r" (__a1), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a, btype b, ctype c) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7"); \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %5\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "=r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname(atype a, btype b, ctype c, dtype d) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7") = (unsigned long) d; \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %5\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "+r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#if (_MIPS_SIM == _MIPS_SIM_ABI32)
++
++/*
++ * Using those means your brain needs more than an oil change ;-)
++ */
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname(atype a, btype b, ctype c, dtype d, etype e) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7") = (unsigned long) d; \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "lw\t$2, %6\n\t" \
++ "subu\t$29, 32\n\t" \
++ "sw\t$2, 16($29)\n\t" \
++ "li\t$2, %5\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ "addiu\t$29, 32\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "+r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname), \
++ "m" ((unsigned long)e) \
++ : "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
++
++#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++ register unsigned long __a0 asm("$4") = (unsigned long) a; \
++ register unsigned long __a1 asm("$5") = (unsigned long) b; \
++ register unsigned long __a2 asm("$6") = (unsigned long) c; \
++ register unsigned long __a3 asm("$7") = (unsigned long) d; \
++ register unsigned long __a4 asm("$8") = (unsigned long) e; \
++ unsigned long __v0; \
++ \
++ __asm__ volatile ( \
++ ".set\tnoreorder\n\t" \
++ "li\t$2, %6\t\t\t# " #fname "\n\t" \
++ "syscall\n\t" \
++ "move\t%0, $2\n\t" \
++ ".set\treorder" \
++ : "=&r" (__v0), "+r" (__a3) \
++ : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (__NR_##sname) \
++ : "$2", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++ "memory"); \
++ \
++ if (__a3 == 0) \
++ return (type) __v0; \
++ return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
++
+Index: libaio-0.3.110/src/syscall-parisc.h
+===================================================================
+--- /dev/null
++++ libaio-0.3.110/src/syscall-parisc.h
+@@ -0,0 +1,146 @@
++/*
++ * Linux system call numbers.
++ *
++ * Cary Coutant says that we should just use another syscall gateway
++ * page to avoid clashing with the HPUX space, and I think he's right:
++ * it will would keep a branch out of our syscall entry path, at the
++ * very least. If we decide to change it later, we can ``just'' tweak
++ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
++ * 1024 or something. Oh, and recompile libc. =)
++ *
++ * 64-bit HPUX binaries get the syscall gateway address passed in a register
++ * from the kernel at startup, which seems a sane strategy.
++ */
++
++#define __NR_Linux 0
++#define __NR_io_setup (__NR_Linux + 215)
++#define __NR_io_destroy (__NR_Linux + 216)
++#define __NR_io_getevents (__NR_Linux + 217)
++#define __NR_io_submit (__NR_Linux + 218)
++#define __NR_io_cancel (__NR_Linux + 219)
++
++#define SYS_ify(syscall_name) __NR_##syscall_name
++
++/* Assume all syscalls are done from PIC code just to be
++ * safe. The worst case scenario is that you lose a register
++ * and save/restore r19 across the syscall. */
++#define PIC
++
++/* Definition taken from glibc 2.3.3
++ * sysdeps/unix/sysv/linux/hppa/sysdep.h
++ */
++
++#ifdef PIC
++/* WARNING: CANNOT BE USED IN A NOP! */
++# define K_STW_ASM_PIC " copy %%r19, %%r4\n"
++# define K_LDW_ASM_PIC " copy %%r4, %%r19\n"
++# define K_USING_GR4 "%r4",
++#else
++# define K_STW_ASM_PIC " \n"
++# define K_LDW_ASM_PIC " \n"
++# define K_USING_GR4
++#endif
++
++/* GCC has to be warned that a syscall may clobber all the ABI
++ registers listed as "caller-saves", see page 8, Table 2
++ in section 2.2.6 of the PA-RISC RUN-TIME architecture
++ document. However! r28 is the result and will conflict with
++ the clobber list so it is left out. Also the input arguments
++ registers r20 -> r26 will conflict with the list so they
++ are treated specially. Although r19 is clobbered by the syscall
++ we cannot say this because it would violate ABI, thus we say
++ r4 is clobbered and use that register to save/restore r19
++ across the syscall. */
++
++#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
++ "%r20", "%r29", "%r31"
++
++#undef K_INLINE_SYSCALL
++#define K_INLINE_SYSCALL(name, nr, args...) ({ \
++ long __sys_res; \
++ { \
++ register unsigned long __res __asm__("r28"); \
++ K_LOAD_ARGS_##nr(args) \
++ /* FIXME: HACK stw/ldw r19 around syscall */ \
++ __asm__ volatile( \
++ K_STW_ASM_PIC \
++ " ble 0x100(%%sr2, %%r0)\n" \
++ " ldi %1, %%r20\n" \
++ K_LDW_ASM_PIC \
++ : "=r" (__res) \
++ : "i" (SYS_ify(name)) K_ASM_ARGS_##nr \
++ : "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \
++ ); \
++ __sys_res = (long)__res; \
++ } \
++ __sys_res; \
++})
++
++#define K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_1(r26) \
++ register unsigned long __r26 __asm__("r26") = (unsigned long)(r26); \
++ K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_2(r26,r25) \
++ register unsigned long __r25 __asm__("r25") = (unsigned long)(r25); \
++ K_LOAD_ARGS_1(r26)
++#define K_LOAD_ARGS_3(r26,r25,r24) \
++ register unsigned long __r24 __asm__("r24") = (unsigned long)(r24); \
++ K_LOAD_ARGS_2(r26,r25)
++#define K_LOAD_ARGS_4(r26,r25,r24,r23) \
++ register unsigned long __r23 __asm__("r23") = (unsigned long)(r23); \
++ K_LOAD_ARGS_3(r26,r25,r24)
++#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22) \
++ register unsigned long __r22 __asm__("r22") = (unsigned long)(r22); \
++ K_LOAD_ARGS_4(r26,r25,r24,r23)
++#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21) \
++ register unsigned long __r21 __asm__("r21") = (unsigned long)(r21); \
++ K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
++
++/* Even with zero args we use r20 for the syscall number */
++#define K_ASM_ARGS_0
++#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
++#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
++#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
++#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
++#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
++#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
++
++/* The registers not listed as inputs but clobbered */
++#define K_CLOB_ARGS_6
++#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
++#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
++#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
++#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
++#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
++#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
++
++#define io_syscall1(type,fname,sname,type1,arg1) \
++type fname(type1 arg1) \
++{ \
++ return K_INLINE_SYSCALL(sname, 1, arg1); \
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
++type fname(type1 arg1, type2 arg2) \
++{ \
++ return K_INLINE_SYSCALL(sname, 2, arg1, arg2); \
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
++type fname(type1 arg1, type2 arg2, type3 arg3) \
++{ \
++ return K_INLINE_SYSCALL(sname, 3, arg1, arg2, arg3); \
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
++{ \
++ return K_INLINE_SYSCALL(sname, 4, arg1, arg2, arg3, arg4); \
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
++{ \
++ return K_INLINE_SYSCALL(sname, 5, arg1, arg2, arg3, arg4, arg5); \
++}
++
+Index: libaio-0.3.110/src/syscall-arm.h
+===================================================================
+--- libaio-0.3.110.orig/src/syscall-arm.h
++++ libaio-0.3.110/src/syscall-arm.h
+@@ -114,3 +114,119 @@ type fname(type1 arg1, type2 arg2, type3
+ return (type) __res_r0; \
+ }
+
++/*
++ * linux/include/asm-arm/unistd.h
++ *
++ * Copyright (C) 2001-2005 Russell King
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
++ * no matter what the change is. Thanks!
++ */
++
++#define __NR_OABI_SYSCALL_BASE 0x900000
++
++#if defined(__thumb__) || defined(__ARM_EABI__)
++#define __NR_SYSCALL_BASE 0
++#else
++#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
++#endif
++
++#define __NR_io_setup (__NR_SYSCALL_BASE+243)
++#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
++#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
++#define __NR_io_submit (__NR_SYSCALL_BASE+246)
++#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
++
++#define __sys2(x) #x
++#define __sys1(x) __sys2(x)
++
++#if defined(__thumb__) || defined(__ARM_EABI__)
++#define __SYS_REG(name) register long __sysreg __asm__("r7") = __NR_##name;
++#define __SYS_REG_LIST(regs...) "r" (__sysreg) , ##regs
++#define __syscall(name) "swi\t0"
++#else
++#define __SYS_REG(name)
++#define __SYS_REG_LIST(regs...) regs
++#define __syscall(name) "swi\t" __sys1(__NR_##name) ""
++#endif
++
++#define io_syscall1(type,fname,sname,type1,arg1) \
++type fname(type1 arg1) { \
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2) \
++type fname(type1 arg1,type2 arg2) { \
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __r1 __asm__("r1") = (long)arg2; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3) \
++type fname(type1 arg1,type2 arg2,type3 arg3) { \
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __r1 __asm__("r1") = (long)arg2; \
++ register long __r2 __asm__("r2") = (long)arg3; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __r1 __asm__("r1") = (long)arg2; \
++ register long __r2 __asm__("r2") = (long)arg3; \
++ register long __r3 __asm__("r3") = (long)arg4; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) {\
++ __SYS_REG(sname) \
++ register long __r0 __asm__("r0") = (long)arg1; \
++ register long __r1 __asm__("r1") = (long)arg2; \
++ register long __r2 __asm__("r2") = (long)arg3; \
++ register long __r3 __asm__("r3") = (long)arg4; \
++ register long __r4 __asm__("r4") = (long)arg5; \
++ register long __res_r0 __asm__("r0"); \
++ __asm__ __volatile__ ( \
++ __syscall(sname) \
++ : "=r" (__res_r0) \
++ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \
++ "r" (__r3), "r" (__r4) ) \
++ : "memory" ); \
++ return (type) __res_r0; \
++}
++
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/destdir.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/destdir.patch
new file mode 100644
index 000000000..dad9601c4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/destdir.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+from openembedded, added by Qing He <qing.he@intel.com>
+
+Index: libaio-0.3.106/Makefile
+===================================================================
+--- libaio-0.3.106.orig/Makefile 2004-02-26 07:25:10.000000000 -0800
++++ libaio-0.3.106/Makefile 2006-10-14 09:19:07.000000000 -0700
+@@ -15,7 +15,7 @@
+ @$(MAKE) -C src
+
+ install:
+- @$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir)
++ @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir)
+
+
+ clean:
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch
new file mode 100644
index 000000000..bba7e554a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch
@@ -0,0 +1,65 @@
+From: Nathan Rossi <nathan.rossi@xilinx.com>
+Date: Tue, 27 Jan 2015 14:59:35 +1000
+Subject: [PATCH] Generic arch dectection for padding defines
+
+When available use the GNU C defines for endian and bitwidth to
+determine the padding required. This reduces the need to define the
+padding selection for every architecture.
+
+Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
+Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
+Upstream-Status: Backport
+---
+ src/libaio.h | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/src/libaio.h b/src/libaio.h
+index 1223146..4a4e0f5 100644
+--- a/src/libaio.h
++++ b/src/libaio.h
+@@ -52,14 +52,18 @@ typedef enum io_iocb_cmd {
+ /* little endian, 32 bits */
+ #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
+ defined(__sh__) || defined(__bfin__) || defined(__MIPSEL__) || \
+- defined(__cris__)
++ defined(__cris__) || \
++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 4)
+ #define PADDED(x, y) x; unsigned y
+ #define PADDEDptr(x, y) x; unsigned y
+ #define PADDEDul(x, y) unsigned long x; unsigned y
+
+ /* little endian, 64 bits */
+ #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \
+- (defined(__aarch64__) && defined(__AARCH64EL__))
++ (defined(__aarch64__) && defined(__AARCH64EL__)) || \
++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 8)
+ #define PADDED(x, y) x, y
+ #define PADDEDptr(x, y) x
+ #define PADDEDul(x, y) unsigned long x
+@@ -67,7 +71,9 @@ typedef enum io_iocb_cmd {
+ /* big endian, 64 bits */
+ #elif defined(__powerpc64__) || defined(__s390x__) || \
+ (defined(__sparc__) && defined(__arch64__)) || \
+- (defined(__aarch64__) && defined(__AARCH64EB__))
++ (defined(__aarch64__) && defined(__AARCH64EB__)) || \
++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 8)
+ #define PADDED(x, y) unsigned y; x
+ #define PADDEDptr(x,y) x
+ #define PADDEDul(x, y) unsigned long x
+@@ -76,7 +82,9 @@ typedef enum io_iocb_cmd {
+ #elif defined(__PPC__) || defined(__s390__) || \
+ (defined(__arm__) && defined(__ARMEB__)) || \
+ defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \
+- defined(__hppa__) || defined(__frv__) || defined(__avr32__)
++ defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \
++ (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 4)
+ #define PADDED(x, y) unsigned y; x
+ #define PADDEDptr(x, y) unsigned y; x
+ #define PADDEDul(x, y) unsigned y; unsigned long x
+--
+2.1.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch
new file mode 100644
index 000000000..9c6850c08
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch
@@ -0,0 +1,62 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Phil Staub <Phil.Staub@windriver.com>
+
+Index: libaio-0.3.109/src/syscall-mips.h
+===================================================================
+--- libaio-0.3.109.orig/src/syscall-mips.h
++++ libaio-0.3.109/src/syscall-mips.h
+@@ -76,7 +76,7 @@ type fname(atype a) \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #define io_syscall2(type,fname,sname,atype,a,btype,b) \
+@@ -100,7 +100,7 @@ type fname(atype a, btype b) \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
+@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
+@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #if (_MIPS_SIM == _MIPS_SIM_ABI32)
+@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
+@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp
+ \
+ if (__a3 == 0) \
+ return (type) __v0; \
+- return (type) -1; \
++ return (type) (-(__v0)); \
+ }
+
+ #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
new file mode 100644
index 000000000..508f5a12f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
@@ -0,0 +1,61 @@
+Upstream-Status: Pending
+
+Properly load arguments 5 an 6 for x86-64 syscall
+Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64
+syscall so that it works with both x32 and x86-64.
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/12/02
+
+--- libaio-0.3.109/src/syscall-x86_64.h.x32 2009-10-09 11:17:02.000000000 -0700
++++ libaio-0.3.109/src/syscall-x86_64.h 2011-12-02 09:09:07.537603224 -0800
+@@ -1,8 +1,18 @@
++#ifndef __NR_io_setup
+ #define __NR_io_setup 206
++#endif
++#ifndef __NR_io_destroy
+ #define __NR_io_destroy 207
++#endif
++#ifndef __NR_io_getevents
+ #define __NR_io_getevents 208
++#endif
++#ifndef __NR_io_submit
+ #define __NR_io_submit 209
++#endif
++#ifndef __NR_io_cancel
+ #define __NR_io_cancel 210
++#endif
+
+ #define __syscall_clobber "r11","rcx","memory"
+ #define __syscall "syscall"
+@@ -42,10 +52,11 @@ return __res; \
+ type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+ { \
+ long __res; \
+-__asm__ volatile ("movq %5,%%r10 ;" __syscall \
++register long __a4 asm ("r10") = (long) arg4; \
++__asm__ volatile (__syscall \
+ : "=a" (__res) \
+ : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
+- "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
++ "d" ((long)(arg3)),"r" (__a4)); \
+ return __res; \
+ }
+
+@@ -54,10 +65,11 @@ return __res; \
+ type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
+ { \
+ long __res; \
+-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \
++register long __a4 asm ("r10") = (long) arg4; \
++register long __a5 asm ("r8") = (long) arg5; \
++__asm__ volatile ( __syscall \
+ : "=a" (__res) \
+ : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \
+- "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \
+- __syscall_clobber,"r8","r10" ); \
++ "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \
+ return __res; \
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/system-linkage.patch b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/system-linkage.patch
new file mode 100644
index 000000000..0b1f47569
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio/system-linkage.patch
@@ -0,0 +1,37 @@
+From 94bba6880b1f10c6b3bf33a17ac40935d65a81ae Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Fri, 6 Nov 2015 15:19:46 +0000
+Subject: [PATCH] Don't remove the system libraries and startup files from
+ libaio, as in some build configurations these are required. For example,
+ including conf/include/security_flags.inc on PPC results in:
+
+io_queue_init.os: In function `io_queue_init':
+tmp/work/ppce300c3-poky-linux/libaio/0.3.110-r0/libaio-0.3.110/src/io_queue_init.c:33:
+undefined reference to `__stack_chk_fail_local'
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ src/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index eadb336..56ab701 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -3,10 +3,10 @@ includedir=$(prefix)/include
+ libdir=$(prefix)/lib
+
+ CFLAGS ?= -g -fomit-frame-pointer -O2
+-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
++CFLAGS += -Wall -I. -fPIC
+ SO_CFLAGS=-shared $(CFLAGS)
+ L_CFLAGS=$(CFLAGS)
+-LINK_FLAGS=
++LINK_FLAGS=$(LDFLAGS)
+ LINK_FLAGS+=$(LDFLAGS)
+
+ soname=libaio.so.1
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio_0.3.110.bb b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio_0.3.110.bb
new file mode 100644
index 000000000..2adfa0aa4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libaio/libaio_0.3.110.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Asynchronous I/O library"
+DESCRIPTION = "Asynchronous input/output library that uses the kernels native interface"
+HOMEPAGE = "http://lse.sourceforge.net/io/aio.html"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \
+ file://generic-arch-dectection-for-padding-defines.patch \
+ file://00_arches.patch \
+ file://destdir.patch \
+ file://libaio_fix_for_x32.patch \
+ file://libaio_fix_for_mips_syscalls.patch \
+ file://system-linkage.patch \
+ "
+
+SRC_URI[md5sum] = "2a35602e43778383e2f4907a4ca39ab8"
+SRC_URI[sha256sum] = "e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e"
+
+EXTRA_OEMAKE =+ "prefix=${prefix} includedir=${includedir} libdir=${libdir}"
+
+do_install () {
+ oe_runmake install DESTDIR=${D}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/0001-Set-xattrs-after-setting-times.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/0001-Set-xattrs-after-setting-times.patch
new file mode 100644
index 000000000..6d74e867e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/0001-Set-xattrs-after-setting-times.patch
@@ -0,0 +1,59 @@
+From 545ded56095c570426fe102ff2192889681ea75c Mon Sep 17 00:00:00 2001
+From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
+Date: Mon, 29 Feb 2016 14:38:25 +0200
+Subject: [PATCH] Set xattrs after setting times
+
+With Integrity Measurement Architecture (IMA) enabled in Linux
+kernel the security.ima extended attribute gets overwritten
+when setting times on a file with a futimens() call. So it's safer
+to set xattrs after times.
+
+Upstream-Status: Submitted [https://github.com/libarchive/libarchive/pull/664]
+
+Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
+
+---
+ libarchive/archive_write_disk_posix.c | 21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index 0fc6193..27c9c1e 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -1620,16 +1620,6 @@ _archive_write_disk_finish_entry(struct archive *_a)
+ }
+
+ /*
+- * Security-related extended attributes (such as
+- * security.capability on Linux) have to be restored last,
+- * since they're implicitly removed by other file changes.
+- */
+- if (a->todo & TODO_XATTR) {
+- int r2 = set_xattrs(a);
+- if (r2 < ret) ret = r2;
+- }
+-
+- /*
+ * Some flags prevent file modification; they must be restored after
+ * file contents are written.
+ */
+@@ -1648,6 +1638,17 @@ _archive_write_disk_finish_entry(struct archive *_a)
+ }
+
+ /*
++ * Security-related extended attributes (such as
++ * security.capability or security.ima on Linux) have to be restored last,
++ * since they're implicitly removed by other file changes like setting
++ * times.
++ */
++ if (a->todo & TODO_XATTR) {
++ int r2 = set_xattrs(a);
++ if (r2 < ret) ret = r2;
++ }
++
++ /*
+ * Mac extended metadata includes ACLs.
+ */
+ if (a->todo & TODO_MAC_METADATA) {
+--
+2.5.0
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch
new file mode 100644
index 000000000..19523f4b8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch
@@ -0,0 +1,39 @@
+From 2f55d6bd308ea61975558c2469ae349dba297e89 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sat, 22 Feb 2014 14:35:59 +0800
+Subject: [PATCH] Fix CVE-2013-0211
+
+This patch comes from:https://github.com/libarchive/libarchive/commit/22531545514043e04633e1c015c7540b9de9dbe4
+
+Upstream-Status: Backport
+CVE: CVE-2013-0211
+
+Signed-off-by: Baogen shang <baogen.shang@windriver.com>
+
+Update the patch because of uprev on 20140222
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libarchive/archive_write.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c
+index a3d1a33..a323588 100644
+--- a/libarchive/archive_write.c
++++ b/libarchive/archive_write.c
+@@ -671,8 +671,12 @@ static ssize_t
+ _archive_write_data(struct archive *_a, const void *buff, size_t s)
+ {
+ struct archive_write *a = (struct archive_write *)_a;
++ const size_t max_write = INT_MAX;
+ archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
+ ARCHIVE_STATE_DATA, "archive_write_data");
++ /* In particular, this catches attempts to pass negative values. */
++ if (s > max_write)
++ s = max_write;
+ archive_clear_error(&a->archive);
+ return ((a->format_write_data)(a, buff, s));
+ }
+--
+1.8.2.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2015-2304.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2015-2304.patch
new file mode 100644
index 000000000..5c2439635
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2015-2304.patch
@@ -0,0 +1,152 @@
+From 59357157706d47c365b2227739e17daba3607526 Mon Sep 17 00:00:00 2001
+From: Alessandro Ghedini <alessandro@ghedini.me>
+Date: Sun, 1 Mar 2015 12:07:45 +0100
+Subject: [PATCH] Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option
+
+This fixes a directory traversal in the cpio tool.
+
+
+Upstream-Status: backport
+CVE: CVE-2015-2304
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ cpio/bsdcpio.1 | 3 ++-
+ cpio/cpio.c | 2 ++
+ libarchive/archive.h | 2 ++
+ libarchive/archive_write_disk.3 | 3 +++
+ libarchive/archive_write_disk_posix.c | 14 +++++++++++---
+ libarchive/test/test_write_disk_secure.c | 23 +++++++++++++++++++++++
+ 6 files changed, 43 insertions(+), 4 deletions(-)
+
+diff --git a/cpio/bsdcpio.1 b/cpio/bsdcpio.1
+index f966aa0..e52546e 100644
+--- a/cpio/bsdcpio.1
++++ b/cpio/bsdcpio.1
+@@ -156,7 +156,8 @@ See above for description.
+ .It Fl Fl insecure
+ (i and p mode only)
+ Disable security checks during extraction or copying.
+-This allows extraction via symbolic links and path names containing
++This allows extraction via symbolic links, absolute paths,
++and path names containing
+ .Sq ..
+ in the name.
+ .It Fl J , Fl Fl xz
+diff --git a/cpio/cpio.c b/cpio/cpio.c
+index 0acde11..b267e9b 100644
+--- a/cpio/cpio.c
++++ b/cpio/cpio.c
+@@ -171,6 +171,7 @@ main(int argc, char *argv[])
+ cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
++ cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
+ cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
+@@ -256,6 +257,7 @@ main(int argc, char *argv[])
+ case OPTION_INSECURE:
+ cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
+ cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
++ cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
+ break;
+ case 'L': /* GNU cpio */
+ cpio->option_follow_links = 1;
+diff --git a/libarchive/archive.h b/libarchive/archive.h
+index 1f0fc38..ef635ac 100644
+--- a/libarchive/archive.h
++++ b/libarchive/archive.h
+@@ -649,6 +649,8 @@ __LA_DECL int archive_read_set_passphrase_callback(struct archive *,
+ /* Default: Do not use HFS+ compression if it was not compressed. */
+ /* This has no effect except on Mac OS v10.6 or later. */
+ #define ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED (0x8000)
++/* Default: Do not reject entries with absolute paths */
++#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000)
+
+ __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
+ int flags);
+diff --git a/libarchive/archive_write_disk.3 b/libarchive/archive_write_disk.3
+index fa925cc..a2e7afa 100644
+--- a/libarchive/archive_write_disk.3
++++ b/libarchive/archive_write_disk.3
+@@ -177,6 +177,9 @@ The default is to not refuse such paths.
+ Note that paths ending in
+ .Pa ..
+ always cause an error, regardless of this flag.
++.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
++Refuse to extract an absolute path.
++The default is to not refuse such paths.
+ .It Cm ARCHIVE_EXTRACT_SPARSE
+ Scan data for blocks of NUL bytes and try to recreate them with holes.
+ This results in sparse files, independent of whether the archive format
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index ab3bdac..c1290eb 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
+ /*
+ * Canonicalize the pathname. In particular, this strips duplicate
+ * '/' characters, '.' elements, and trailing '/'. It also raises an
+- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
+- * set) any '..' in the path.
++ * error for an empty path, a trailing '..', (if _SECURE_NODOTDOT is
++ * set) any '..' in the path or (if ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
++ * is set) if the path is absolute.
+ */
+ static int
+ cleanup_pathname(struct archive_write_disk *a)
+@@ -2529,8 +2530,15 @@ cleanup_pathname(struct archive_write_disk *a)
+ cleanup_pathname_win(a);
+ #endif
+ /* Skip leading '/'. */
+- if (*src == '/')
++ if (*src == '/') {
++ if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
++ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
++ "Path is absolute");
++ return (ARCHIVE_FAILED);
++ }
++
+ separator = *src++;
++ }
+
+ /* Scan the pathname one element at a time. */
+ for (;;) {
+diff --git a/libarchive/test/test_write_disk_secure.c b/libarchive/test/test_write_disk_secure.c
+index 31c5bfd..2c94206 100644
+--- a/libarchive/test/test_write_disk_secure.c
++++ b/libarchive/test/test_write_disk_secure.c
+@@ -178,6 +178,29 @@ DEFINE_TEST(test_write_disk_secure)
+ assert(S_ISDIR(st.st_mode));
+ archive_entry_free(ae);
+
++ /*
++ * Without security checks, we should be able to
++ * extract an absolute path.
++ */
++ assert((ae = archive_entry_new()) != NULL);
++ archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++ archive_entry_set_mode(ae, S_IFREG | 0777);
++ assert(0 == archive_write_header(a, ae));
++ assert(0 == archive_write_finish_entry(a));
++ assertFileExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++ assert(0 == unlink("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"));
++
++ /* But with security checks enabled, this should fail. */
++ assert(archive_entry_clear(ae) != NULL);
++ archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++ archive_entry_set_mode(ae, S_IFREG | 0777);
++ archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS);
++ failure("Extracting an absolute path should fail here.");
++ assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae));
++ archive_entry_free(ae);
++ assert(0 == archive_write_finish_entry(a));
++ assertFileNotExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+
+ /* Test the entries on disk. */
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/mkdir.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/mkdir.patch
new file mode 100644
index 000000000..509a2957a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/mkdir.patch
@@ -0,0 +1,45 @@
+Add missing mkdir calls so that out-of-tree builds work.
+
+Upstream-Status: Submitted (https://github.com/libarchive/libarchive/pull/534)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index 3fa2d22..5ecca52 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -508,6 +508,7 @@ libarchive_test_LDADD= $(LTLIBICONV)
+ # Building it automatically provides a sanity-check on libarchive_test_SOURCES
+ # above.
+ libarchive/test/list.h: Makefile
++ $(MKDIR_P) libarchive/test
+ cat $(top_srcdir)/libarchive/test/test_*.c | grep DEFINE_TEST > libarchive/test/list.h
+
+ libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test LRZIP=NOCONFIG
+@@ -835,6 +836,7 @@ bsdtar_test_CPPFLAGS=\
+ $(PLATFORMCPPFLAGS)
+
+ tar/test/list.h: Makefile
++ $(MKDIR_P) tar/test
+ cat $(top_srcdir)/tar/test/test_*.c | grep DEFINE_TEST > tar/test/list.h
+
+ if BUILD_BSDTAR
+@@ -975,6 +977,7 @@ bsdcpio_test_CPPFLAGS= \
+ bsdcpio_test_LDADD=libarchive_fe.la
+
+ cpio/test/list.h: Makefile
++ $(MKDIR_P) cpio/test
+ cat $(top_srcdir)/cpio/test/test_*.c | grep DEFINE_TEST > cpio/test/list.h
+
+ if BUILD_BSDCPIO
+diff --git a/configure.ac b/configure.ac
+index 38bd299..7bdb00c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,6 +102,7 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+ AC_CHECK_TOOL([STRIP],[strip])
++AC_PROG_MKDIR_P
+
+ #
+ # Options for building bsdtar.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch
new file mode 100644
index 000000000..346af9135
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch
@@ -0,0 +1,25 @@
+Use pkg-config for the libxml2 dependency, not the -config script.
+
+Upstream-Status: Pending
+
+RP 2014/5/22
+
+Index: libarchive-3.1.2/configure.ac
+===================================================================
+--- libarchive-3.1.2.orig/configure.ac 2013-02-09 17:23:03.000000000 +0000
++++ libarchive-3.1.2/configure.ac 2014-05-13 15:26:45.446499108 +0000
+@@ -329,10 +329,10 @@
+ AS_HELP_STRING([--without-expat], [Don't build support for xar through expat]))
+
+ if test "x$with_xml2" != "xno"; then
+- AC_PATH_PROG([XML2_CONFIG], [xml2-config],, [${PATH}])
+- if test "x$XML2_CONFIG" != "x"; then
+- CPPFLAGS="${CPPFLAGS} `${XML2_CONFIG} --cflags`"
+- LIBS="${LIBS} `${XML2_CONFIG} --libs`"
++ PKG_CHECK_MODULES(PKG_XML2, [libxml-2.0],,)
++ if test "x$PKG_XML2_CFLAGS" != "x"; then
++ CPPFLAGS="${CPPFLAGS} ${PKG_XML2_CFLAGS}"
++ LIBS="${LIBS} ${PKG_XML2_LIBS}"
+ AC_CHECK_LIB(xml2,xmlInitParser,[true],AC_MSG_FAILURE(Missing xml2 library))
+ else
+ AC_CHECK_LIB(xml2,xmlInitParser)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.1.2.bb b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.1.2.bb
new file mode 100644
index 000000000..ed677ac31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libarchive/libarchive_3.1.2.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Support for reading various archive formats"
+DESCRIPTION = "C library and command-line tools for reading and writing tar, cpio, zip, ISO, and other archive formats"
+HOMEPAGE = "http://www.libarchive.org/"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b4e3ffd607d6686c6cb2f63394370841"
+
+DEPENDS = "e2fsprogs-native"
+
+PACKAGECONFIG ?= "zlib bz2"
+
+PACKAGECONFIG_append_class-target = "\
+ libxml2 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
+"
+
+PACKAGECONFIG_append_class-nativesdk = " largefile"
+
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
+PACKAGECONFIG[bz2] = "--with-bz2lib,--without-bz2lib,bzip2,"
+PACKAGECONFIG[xz] = "--with-lzmadec --with-lzma,--without-lzmadec --without-lzma,xz,"
+PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
+PACKAGECONFIG[libxml2] = "--with-xml2,--without-xml2,libxml2,"
+PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat,"
+PACKAGECONFIG[lzo] = "--with-lzo2,--without-lzo2,lzo,"
+PACKAGECONFIG[nettle] = "--with-nettle,--without-nettle,nettle,"
+
+SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
+ file://libarchive-CVE-2013-0211.patch \
+ file://pkgconfig.patch \
+ file://libarchive-CVE-2015-2304.patch \
+ file://mkdir.patch \
+ file://0001-Set-xattrs-after-setting-times.patch \
+ "
+
+SRC_URI[md5sum] = "efad5a503f66329bb9d2f4308b5de98a"
+SRC_URI[sha256sum] = "eb87eacd8fe49e8d90c8fdc189813023ccc319c5e752b01fb6ad0cc7b2c53d5e"
+
+inherit autotools update-alternatives pkgconfig
+
+CPPFLAGS += "-I${WORKDIR}/extra-includes"
+
+do_configure[cleandirs] += "${WORKDIR}/extra-includes"
+do_configure_prepend() {
+ # We just need the headers for some type constants, so no need to
+ # build all of e2fsprogs for the target
+ cp -R ${STAGING_INCDIR_NATIVE}/ext2fs ${WORKDIR}/extra-includes/
+}
+
+ALTERNATIVE_PRIORITY = "100"
+
+PACKAGES =+ "bsdtar"
+FILES_bsdtar = "${bindir}/bsdtar"
+
+ALTERNATIVE_bsdtar = "tar"
+ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar"
+ALTERNATIVE_TARGET[tar] = "${bindir}/bsdtar"
+
+PACKAGES =+ "bsdcpio"
+FILES_bsdcpio = "${bindir}/bsdcpio"
+
+ALTERNATIVE_bsdcpio = "cpio"
+ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio"
+ALTERNATIVE_TARGET[cpio] = "${bindir}/bsdcpio"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch
new file mode 100644
index 000000000..3476bb959
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Inappropriate
+
+automake 1.12.x has deprecated AM_PROG_MKDIR_P , and throws a warning for that,
+and the warnings are treated as errors because of the -Werror parameter.
+
+These AM_PROG_MKDIR_P are coming from gettext, and the latest gettext code has not
+eliminated these deprecated macros yet. So disable the treatment of warnings
+as errors until gettext is updated to remove the deprecated macros.
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/07/10
+
+Index: libidn-1.24/configure.ac
+===================================================================
+--- libidn-1.24.orig/configure.ac
++++ libidn-1.24/configure.ac
+@@ -23,7 +23,7 @@ AC_COPYRIGHT([Copyright (c) 2002-2011 Si
+ AC_CONFIG_AUX_DIR([build-aux])
+ AC_CONFIG_MACRO_DIR([m4])
+ AC_CONFIG_HEADERS(config.h)
+-AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-override])
++AM_INIT_AUTOMAKE([1.10 -Wall -Wno-override])
+ AM_SILENT_RULES([yes])
+
+ # Library code modified: REVISION++
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..0863530f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurdd libidn-1.26/doc/Makefile.am libidn-1.26/doc/Makefile.am
+--- libidn-1.26/doc/Makefile.am 2012-09-18 11:25:45.000000000 +0300
++++ libidn-1.26/doc/Makefile.am 2013-02-08 07:41:24.591431462 +0200
+@@ -49,15 +49,9 @@
+
+ # Man pages.
+
+-dist_man_MANS = idn.1 $(gdoc_MANS)
++dist_man_MANS = $(gdoc_MANS)
+ MAINTAINERCLEANFILES = $(dist_man_MANS)
+
+-idn.1: $(top_srcdir)/src/idn.c $(top_srcdir)/src/idn.ggo \
+- $(top_srcdir)/configure.ac
+- $(HELP2MAN) \
+- --name="Internationalized Domain Names command line tool" \
+- --output=$@ $(top_builddir)/src/idn$(EXEEXT)
+-
+ # GDOC
+
+ GDOC_BIN = $(srcdir)/gdoc
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..20afd257b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+This patch fixes following issue with automake 1.12
+
+| automake: warnings are treated as errors
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libidn.la': linking libtool libraries using a non-POSIX
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/03
+
+Index: libidn-1.24/configure.ac
+===================================================================
+--- libidn-1.24.orig/configure.ac
++++ libidn-1.24/configure.ac
+@@ -34,6 +34,10 @@ AC_SUBST(LT_CURRENT, 17)
+ AC_SUBST(LT_REVISION, 7)
+ AC_SUBST(LT_AGE, 6)
+
++# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
++m4_pattern_allow([AM_PROG_AR])
++AM_PROG_AR
++
+ AC_PROG_CC
+ gl_EARLY
+ lgl_EARLY
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb
new file mode 100644
index 000000000..c681560d8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_0.6.14.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Internationalized Domain Name support library"
+DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group."
+HOMEPAGE = "http://www.gnu.org/software/libidn/"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+ file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+ file://lib/idna.h;beginline=6;endline=18;md5=1336e848ca7b8e25767c3c7e8fa38a89 \
+ file://src/idn.c;beginline=6;endline=18;md5=56c89e359652a71cda128d75f0ffdac4"
+PR = "r1"
+
+inherit pkgconfig autotools gettext texinfo
+
+SRC_URI = "http://alpha.gnu.org/gnu/libidn/${BPN}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "040f012a45feb56168853998bb87ad4d"
+SRC_URI[sha256sum] = "98910c2ad664bdf4eed2c2fff88e24f8882636ec9d26669366ff03b469c05ae3"
+
+do_configure_prepend() {
+ # this version of libidn copies AC_USE_SYSTEM_EXTENSIONS from
+ # autoconf CVS because atm the autoconf it uses is a bit old
+ # now with cross autotool, that macro is already there and this
+ # local definition causes circular dependency. Actually AC_GNU_SOURCE
+ # is identical to AC_USE_SYSTEM_EXTENSIONS. So remove all local
+ # references to the latter here.
+ sed -i -e "/AC_REQUIRE(\[gl_USE_SYSTEM_EXTENSIONS/d" ${S}/lib/gl/m4/gnulib-comp.m4
+ rm -f ${S}/lib/gl/m4/extensions.m4
+}
+
+do_install_append() {
+ rm -rf ${D}${libdir}/Libidn.dll
+ rm -rf ${D}${datadir}/emacs
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_1.32.bb b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_1.32.bb
new file mode 100644
index 000000000..4d6e88529
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libidn/libidn_1.32.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Internationalized Domain Name support library"
+DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group."
+HOMEPAGE = "http://www.gnu.org/software/libidn/"
+SECTION = "libs"
+LICENSE = "(LGPLv2.1+ | LGPLv3) & GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=df4be47940a91ee69556f5f71eed4aec \
+ file://COPYING.LESSERv2;md5=4fbd65380cdd255951079008b364516c \
+ file://COPYING.LESSERv3;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+ file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://lib/idna.h;endline=21;md5=7c0b3828d1b153663be9a04ad4f7975f \
+ file://src/idn.c;endline=20;md5=f4235f2a2cb2b65786b2979fb3cf7fbf"
+
+inherit pkgconfig autotools gettext texinfo
+
+SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \
+ file://libidn_fix_for_automake-1.12.patch \
+ file://avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch \
+ file://dont-depend-on-help2man.patch \
+"
+
+SRC_URI[md5sum] = "4dd8356ba577287ea7076bfa1554b534"
+SRC_URI[sha256sum] = "ba5d5afee2beff703a34ee094668da5c6ea5afa38784cebba8924105e185c4f5"
+
+# command tool is under GPLv3+, while libidn itself is under LGPLv2.1+ or LGPLv3
+# so package command into a separate package
+PACKAGES =+ "idn"
+FILES_idn = "${bindir}/*"
+
+EXTRA_OECONF = "--disable-csharp"
+
+do_install_append() {
+ rm -rf ${D}${datadir}/emacs
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch
new file mode 100644
index 000000000..972ecc9c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv/0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch
@@ -0,0 +1,37 @@
+From 280f0d37c642d68bad2a2e49ef437953474d99e6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 6 Apr 2016 23:15:02 -0700
+Subject: [PATCH] CMakeLists.txt: fix MAN_INSTALL_DIR
+
+It checks ${CMAKE_INSTALL_PREFIX}/share/man when configure, but it may
+not exist when crosscompile, for example, when CMAKE_INSTALL_PREFIX="/",
+it is OK, but when CMAKE_INSTALL_PREFIX="/some/path/else", then it
+doesn't exist, and the man dir would be set to "/usr/man" which is
+incorrect.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ CMakeLists.txt | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fd1426b..747db22 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -57,10 +57,7 @@ else (DEFINED INCLUDE)
+ ENDIF (DEFINED INCLUDE)
+ MESSAGE (STATUS "Header files will be installed in ${INCLUDE_INSTALL_DIR}")
+ SET (BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+-SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man")
+-IF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man")
+- SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man")
+-ENDIF (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/share/man" AND NOT IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/man")
++SET (MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/man")
+ MESSAGE(STATUS "Man pages will be installed in ${MAN_INSTALL_DIR}")
+
+ ####################################################################
+--
+2.7.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_git.bb b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_git.bb
new file mode 100644
index 000000000..fb81c8a5f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libsolv/libsolv_git.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Library for solving packages and reading repositories"
+HOMEPAGE = "https://github.com/openSUSE/libsolv"
+BUGTRACKER = "https://github.com/openSUSE/libsolv/issues"
+SECTION = "devel"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.BSD;md5=62272bd11c97396d4aaf1c41bc11f7d8"
+
+DEPENDS = "expat zlib"
+
+PV = "0.6.19"
+
+SRC_URI = "git://github.com/openSUSE/libsolv.git \
+ file://0001-CMakeLists.txt-fix-MAN_INSTALL_DIR.patch \
+"
+SRCREV = "4c5af401a89858d4cebbfe40c59a0031ff9db5b0"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DLIB=${baselib}"
+
+PACKAGES =+ "${PN}-tools ${PN}ext"
+
+FILES_${PN}-dev += "${datadir}/cmake/Modules/FindLibSolv.cmake"
+FILES_${PN}-tools = "${bindir}/*"
+FILES_${PN}ext = "${libdir}/${PN}ext.so.*"
+
+BBCLASSEXTEND =+ "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch
new file mode 100644
index 000000000..50613ba31
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/0001-Add-missing-rwlock_unlocks-in-xprt_register.patch
@@ -0,0 +1,62 @@
+Subject: [PATCH] Add missing rwlock_unlocks in xprt_register
+
+It looks like in b2c9430f46c4ac848957fb8adaac176a3f6ac03f when svc_run
+switched to poll, an early return was added, but the rwlock was not
+unlocked.
+
+I observed that rpcbind built against libtirpc-1.0.1 would handle only
+one request before hanging, and tracked it down to a missing
+rwlock_unlock here.
+
+Fixes: b2c9430f46c4 ('Use poll() instead of select() in svc_run()')
+
+Upstream-Status: Backport
+
+Signed-off-by: Michael Forney <mforney@mforney.org>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ src/svc.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/svc.c b/src/svc.c
+index 9c41445..b59467b 100644
+--- a/src/svc.c
++++ b/src/svc.c
+@@ -99,7 +99,7 @@ xprt_register (xprt)
+ {
+ __svc_xports = (SVCXPRT **) calloc (_rpc_dtablesize(), sizeof (SVCXPRT *));
+ if (__svc_xports == NULL)
+- return;
++ goto unlock;
+ }
+ if (sock < _rpc_dtablesize())
+ {
+@@ -120,14 +120,14 @@ xprt_register (xprt)
+ svc_pollfd[i].fd = sock;
+ svc_pollfd[i].events = (POLLIN | POLLPRI |
+ POLLRDNORM | POLLRDBAND);
+- return;
++ goto unlock;
+ }
+
+ new_svc_pollfd = (struct pollfd *) realloc (svc_pollfd,
+ sizeof (struct pollfd)
+ * (svc_max_pollfd + 1));
+ if (new_svc_pollfd == NULL) /* Out of memory */
+- return;
++ goto unlock;
+ svc_pollfd = new_svc_pollfd;
+ ++svc_max_pollfd;
+
+@@ -135,6 +135,7 @@ xprt_register (xprt)
+ svc_pollfd[svc_max_pollfd - 1].events = (POLLIN | POLLPRI |
+ POLLRDNORM | POLLRDBAND);
+ }
++unlock:
+ rwlock_unlock (&svc_fd_lock);
+ }
+
+--
+2.5.3
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch
new file mode 100644
index 000000000..f93223feb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/Use-netbsd-queue.h.patch
@@ -0,0 +1,878 @@
+musl does not provide sys/queue.h implementation. Borrow queue.h from
+the NetBSD project
+http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/queue.h?rev=1.68
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur libtirpc-1.0.1-orig/src/clnt_bcast.c libtirpc-1.0.1/src/clnt_bcast.c
+--- libtirpc-1.0.1-orig/src/clnt_bcast.c 2015-10-30 17:15:14.000000000 +0200
++++ libtirpc-1.0.1/src/clnt_bcast.c 2015-12-21 17:03:52.066008311 +0200
+@@ -40,7 +40,6 @@
+ */
+ #include <sys/socket.h>
+ #include <sys/types.h>
+-#include <sys/queue.h>
+
+ #include <net/if.h>
+ #include <netinet/in.h>
+@@ -62,6 +61,7 @@
+ #include <err.h>
+ #include <string.h>
+
++#include "queue.h"
+ #include "rpc_com.h"
+ #include "debug.h"
+
+diff -Naur libtirpc-1.0.1-orig/tirpc/queue.h libtirpc-1.0.1/tirpc/queue.h
+--- libtirpc-1.0.1-orig/tirpc/queue.h 1970-01-01 02:00:00.000000000 +0200
++++ libtirpc-1.0.1/tirpc/queue.h 2015-12-21 17:02:44.427853905 +0200
+@@ -0,0 +1,846 @@
++/* $NetBSD: queue.h,v 1.68 2014/11/19 08:10:01 uebayasi Exp $ */
++
++/*
++ * Copyright (c) 1991, 1993
++ * The Regents of the University of California. 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. Neither the name of the University nor the names of its contributors
++ * may be used to endorse or promote products derived from this software
++ * without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ *
++ * @(#)queue.h 8.5 (Berkeley) 8/20/94
++ */
++
++#ifndef _SYS_QUEUE_H_
++#define _SYS_QUEUE_H_
++
++/*
++ * This file defines five types of data structures: singly-linked lists,
++ * lists, simple queues, tail queues, and circular queues.
++ *
++ * A singly-linked list is headed by a single forward pointer. The
++ * elements are singly linked for minimum space and pointer manipulation
++ * overhead at the expense of O(n) removal for arbitrary elements. New
++ * elements can be added to the list after an existing element or at the
++ * head of the list. Elements being removed from the head of the list
++ * should use the explicit macro for this purpose for optimum
++ * efficiency. A singly-linked list may only be traversed in the forward
++ * direction. Singly-linked lists are ideal for applications with large
++ * datasets and few or no removals or for implementing a LIFO queue.
++ *
++ * A list is headed by a single forward pointer (or an array of forward
++ * pointers for a hash table header). The elements are doubly linked
++ * so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before
++ * or after an existing element or at the head of the list. A list
++ * may only be traversed in the forward direction.
++ *
++ * A simple queue is headed by a pair of pointers, one the head of the
++ * list and the other to the tail of the list. The elements are singly
++ * linked to save space, so elements can only be removed from the
++ * head of the list. New elements can be added to the list after
++ * an existing element, at the head of the list, or at the end of the
++ * list. A simple queue may only be traversed in the forward direction.
++ *
++ * A tail queue is headed by a pair of pointers, one to the head of the
++ * list and the other to the tail of the list. The elements are doubly
++ * linked so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before or
++ * after an existing element, at the head of the list, or at the end of
++ * the list. A tail queue may be traversed in either direction.
++ *
++ * A circle queue is headed by a pair of pointers, one to the head of the
++ * list and the other to the tail of the list. The elements are doubly
++ * linked so that an arbitrary element can be removed without a need to
++ * traverse the list. New elements can be added to the list before or after
++ * an existing element, at the head of the list, or at the end of the list.
++ * A circle queue may be traversed in either direction, but has a more
++ * complex end of list detection.
++ *
++ * For details on the use of these macros, see the queue(3) manual page.
++ */
++
++/*
++ * Include the definition of NULL only on NetBSD because sys/null.h
++ * is not available elsewhere. This conditional makes the header
++ * portable and it can simply be dropped verbatim into any system.
++ * The caveat is that on other systems some other header
++ * must provide NULL before the macros can be used.
++ */
++#ifdef __NetBSD__
++#include <sys/null.h>
++#endif
++
++#if defined(QUEUEDEBUG)
++# if defined(_KERNEL)
++# define QUEUEDEBUG_ABORT(...) panic(__VA_ARGS__)
++# else
++# include <err.h>
++# define QUEUEDEBUG_ABORT(...) err(1, __VA_ARGS__)
++# endif
++#endif
++
++/*
++ * Singly-linked List definitions.
++ */
++#define SLIST_HEAD(name, type) \
++struct name { \
++ struct type *slh_first; /* first element */ \
++}
++
++#define SLIST_HEAD_INITIALIZER(head) \
++ { NULL }
++
++#define SLIST_ENTRY(type) \
++struct { \
++ struct type *sle_next; /* next element */ \
++}
++
++/*
++ * Singly-linked List access methods.
++ */
++#define SLIST_FIRST(head) ((head)->slh_first)
++#define SLIST_END(head) NULL
++#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
++#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
++
++#define SLIST_FOREACH(var, head, field) \
++ for((var) = (head)->slh_first; \
++ (var) != SLIST_END(head); \
++ (var) = (var)->field.sle_next)
++
++#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
++ for ((var) = SLIST_FIRST((head)); \
++ (var) != SLIST_END(head) && \
++ ((tvar) = SLIST_NEXT((var), field), 1); \
++ (var) = (tvar))
++
++/*
++ * Singly-linked List functions.
++ */
++#define SLIST_INIT(head) do { \
++ (head)->slh_first = SLIST_END(head); \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
++ (elm)->field.sle_next = (slistelm)->field.sle_next; \
++ (slistelm)->field.sle_next = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_INSERT_HEAD(head, elm, field) do { \
++ (elm)->field.sle_next = (head)->slh_first; \
++ (head)->slh_first = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_REMOVE_AFTER(slistelm, field) do { \
++ (slistelm)->field.sle_next = \
++ SLIST_NEXT(SLIST_NEXT((slistelm), field), field); \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_REMOVE_HEAD(head, field) do { \
++ (head)->slh_first = (head)->slh_first->field.sle_next; \
++} while (/*CONSTCOND*/0)
++
++#define SLIST_REMOVE(head, elm, type, field) do { \
++ if ((head)->slh_first == (elm)) { \
++ SLIST_REMOVE_HEAD((head), field); \
++ } \
++ else { \
++ struct type *curelm = (head)->slh_first; \
++ while(curelm->field.sle_next != (elm)) \
++ curelm = curelm->field.sle_next; \
++ curelm->field.sle_next = \
++ curelm->field.sle_next->field.sle_next; \
++ } \
++} while (/*CONSTCOND*/0)
++
++
++/*
++ * List definitions.
++ */
++#define LIST_HEAD(name, type) \
++struct name { \
++ struct type *lh_first; /* first element */ \
++}
++
++#define LIST_HEAD_INITIALIZER(head) \
++ { NULL }
++
++#define LIST_ENTRY(type) \
++struct { \
++ struct type *le_next; /* next element */ \
++ struct type **le_prev; /* address of previous next element */ \
++}
++
++/*
++ * List access methods.
++ */
++#define LIST_FIRST(head) ((head)->lh_first)
++#define LIST_END(head) NULL
++#define LIST_EMPTY(head) ((head)->lh_first == LIST_END(head))
++#define LIST_NEXT(elm, field) ((elm)->field.le_next)
++
++#define LIST_FOREACH(var, head, field) \
++ for ((var) = ((head)->lh_first); \
++ (var) != LIST_END(head); \
++ (var) = ((var)->field.le_next))
++
++#define LIST_FOREACH_SAFE(var, head, field, tvar) \
++ for ((var) = LIST_FIRST((head)); \
++ (var) != LIST_END(head) && \
++ ((tvar) = LIST_NEXT((var), field), 1); \
++ (var) = (tvar))
++
++#define LIST_MOVE(head1, head2) do { \
++ LIST_INIT((head2)); \
++ if (!LIST_EMPTY((head1))) { \
++ (head2)->lh_first = (head1)->lh_first; \
++ LIST_INIT((head1)); \
++ } \
++} while (/*CONSTCOND*/0)
++
++/*
++ * List functions.
++ */
++#if defined(QUEUEDEBUG)
++#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field) \
++ if ((head)->lh_first && \
++ (head)->lh_first->field.le_prev != &(head)->lh_first) \
++ QUEUEDEBUG_ABORT("LIST_INSERT_HEAD %p %s:%d", (head), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_LIST_OP(elm, field) \
++ if ((elm)->field.le_next && \
++ (elm)->field.le_next->field.le_prev != \
++ &(elm)->field.le_next) \
++ QUEUEDEBUG_ABORT("LIST_* forw %p %s:%d", (elm), \
++ __FILE__, __LINE__); \
++ if (*(elm)->field.le_prev != (elm)) \
++ QUEUEDEBUG_ABORT("LIST_* back %p %s:%d", (elm), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) \
++ (elm)->field.le_next = (void *)1L; \
++ (elm)->field.le_prev = (void *)1L;
++#else
++#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field)
++#define QUEUEDEBUG_LIST_OP(elm, field)
++#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field)
++#endif
++
++#define LIST_INIT(head) do { \
++ (head)->lh_first = LIST_END(head); \
++} while (/*CONSTCOND*/0)
++
++#define LIST_INSERT_AFTER(listelm, elm, field) do { \
++ QUEUEDEBUG_LIST_OP((listelm), field) \
++ if (((elm)->field.le_next = (listelm)->field.le_next) != \
++ LIST_END(head)) \
++ (listelm)->field.le_next->field.le_prev = \
++ &(elm)->field.le_next; \
++ (listelm)->field.le_next = (elm); \
++ (elm)->field.le_prev = &(listelm)->field.le_next; \
++} while (/*CONSTCOND*/0)
++
++#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
++ QUEUEDEBUG_LIST_OP((listelm), field) \
++ (elm)->field.le_prev = (listelm)->field.le_prev; \
++ (elm)->field.le_next = (listelm); \
++ *(listelm)->field.le_prev = (elm); \
++ (listelm)->field.le_prev = &(elm)->field.le_next; \
++} while (/*CONSTCOND*/0)
++
++#define LIST_INSERT_HEAD(head, elm, field) do { \
++ QUEUEDEBUG_LIST_INSERT_HEAD((head), (elm), field) \
++ if (((elm)->field.le_next = (head)->lh_first) != LIST_END(head))\
++ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
++ (head)->lh_first = (elm); \
++ (elm)->field.le_prev = &(head)->lh_first; \
++} while (/*CONSTCOND*/0)
++
++#define LIST_REMOVE(elm, field) do { \
++ QUEUEDEBUG_LIST_OP((elm), field) \
++ if ((elm)->field.le_next != NULL) \
++ (elm)->field.le_next->field.le_prev = \
++ (elm)->field.le_prev; \
++ *(elm)->field.le_prev = (elm)->field.le_next; \
++ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
++} while (/*CONSTCOND*/0)
++
++#define LIST_REPLACE(elm, elm2, field) do { \
++ if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \
++ (elm2)->field.le_next->field.le_prev = \
++ &(elm2)->field.le_next; \
++ (elm2)->field.le_prev = (elm)->field.le_prev; \
++ *(elm2)->field.le_prev = (elm2); \
++ QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \
++} while (/*CONSTCOND*/0)
++
++/*
++ * Simple queue definitions.
++ */
++#define SIMPLEQ_HEAD(name, type) \
++struct name { \
++ struct type *sqh_first; /* first element */ \
++ struct type **sqh_last; /* addr of last next element */ \
++}
++
++#define SIMPLEQ_HEAD_INITIALIZER(head) \
++ { NULL, &(head).sqh_first }
++
++#define SIMPLEQ_ENTRY(type) \
++struct { \
++ struct type *sqe_next; /* next element */ \
++}
++
++/*
++ * Simple queue access methods.
++ */
++#define SIMPLEQ_FIRST(head) ((head)->sqh_first)
++#define SIMPLEQ_END(head) NULL
++#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == SIMPLEQ_END(head))
++#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next)
++
++#define SIMPLEQ_FOREACH(var, head, field) \
++ for ((var) = ((head)->sqh_first); \
++ (var) != SIMPLEQ_END(head); \
++ (var) = ((var)->field.sqe_next))
++
++#define SIMPLEQ_FOREACH_SAFE(var, head, field, next) \
++ for ((var) = ((head)->sqh_first); \
++ (var) != SIMPLEQ_END(head) && \
++ ((next = ((var)->field.sqe_next)), 1); \
++ (var) = (next))
++
++/*
++ * Simple queue functions.
++ */
++#define SIMPLEQ_INIT(head) do { \
++ (head)->sqh_first = NULL; \
++ (head)->sqh_last = &(head)->sqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \
++ if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \
++ (head)->sqh_last = &(elm)->field.sqe_next; \
++ (head)->sqh_first = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \
++ (elm)->field.sqe_next = NULL; \
++ *(head)->sqh_last = (elm); \
++ (head)->sqh_last = &(elm)->field.sqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
++ if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
++ (head)->sqh_last = &(elm)->field.sqe_next; \
++ (listelm)->field.sqe_next = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_REMOVE_HEAD(head, field) do { \
++ if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
++ (head)->sqh_last = &(head)->sqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \
++ if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \
++ == NULL) \
++ (head)->sqh_last = &(elm)->field.sqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_REMOVE(head, elm, type, field) do { \
++ if ((head)->sqh_first == (elm)) { \
++ SIMPLEQ_REMOVE_HEAD((head), field); \
++ } else { \
++ struct type *curelm = (head)->sqh_first; \
++ while (curelm->field.sqe_next != (elm)) \
++ curelm = curelm->field.sqe_next; \
++ if ((curelm->field.sqe_next = \
++ curelm->field.sqe_next->field.sqe_next) == NULL) \
++ (head)->sqh_last = &(curelm)->field.sqe_next; \
++ } \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_CONCAT(head1, head2) do { \
++ if (!SIMPLEQ_EMPTY((head2))) { \
++ *(head1)->sqh_last = (head2)->sqh_first; \
++ (head1)->sqh_last = (head2)->sqh_last; \
++ SIMPLEQ_INIT((head2)); \
++ } \
++} while (/*CONSTCOND*/0)
++
++#define SIMPLEQ_LAST(head, type, field) \
++ (SIMPLEQ_EMPTY((head)) ? \
++ NULL : \
++ ((struct type *)(void *) \
++ ((char *)((head)->sqh_last) - offsetof(struct type, field))))
++
++/*
++ * Tail queue definitions.
++ */
++#define _TAILQ_HEAD(name, type, qual) \
++struct name { \
++ qual type *tqh_first; /* first element */ \
++ qual type *qual *tqh_last; /* addr of last next element */ \
++}
++#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,)
++
++#define TAILQ_HEAD_INITIALIZER(head) \
++ { TAILQ_END(head), &(head).tqh_first }
++
++#define _TAILQ_ENTRY(type, qual) \
++struct { \
++ qual type *tqe_next; /* next element */ \
++ qual type *qual *tqe_prev; /* address of previous next element */\
++}
++#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,)
++
++/*
++ * Tail queue access methods.
++ */
++#define TAILQ_FIRST(head) ((head)->tqh_first)
++#define TAILQ_END(head) (NULL)
++#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
++#define TAILQ_LAST(head, headname) \
++ (*(((struct headname *)((head)->tqh_last))->tqh_last))
++#define TAILQ_PREV(elm, headname, field) \
++ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
++#define TAILQ_EMPTY(head) (TAILQ_FIRST(head) == TAILQ_END(head))
++
++
++#define TAILQ_FOREACH(var, head, field) \
++ for ((var) = ((head)->tqh_first); \
++ (var) != TAILQ_END(head); \
++ (var) = ((var)->field.tqe_next))
++
++#define TAILQ_FOREACH_SAFE(var, head, field, next) \
++ for ((var) = ((head)->tqh_first); \
++ (var) != TAILQ_END(head) && \
++ ((next) = TAILQ_NEXT(var, field), 1); (var) = (next))
++
++#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
++ for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));\
++ (var) != TAILQ_END(head); \
++ (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
++
++#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, prev) \
++ for ((var) = TAILQ_LAST((head), headname); \
++ (var) != TAILQ_END(head) && \
++ ((prev) = TAILQ_PREV((var), headname, field), 1); (var) = (prev))
++
++/*
++ * Tail queue functions.
++ */
++#if defined(QUEUEDEBUG)
++#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) \
++ if ((head)->tqh_first && \
++ (head)->tqh_first->field.tqe_prev != &(head)->tqh_first) \
++ QUEUEDEBUG_ABORT("TAILQ_INSERT_HEAD %p %s:%d", (head), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) \
++ if (*(head)->tqh_last != NULL) \
++ QUEUEDEBUG_ABORT("TAILQ_INSERT_TAIL %p %s:%d", (head), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_TAILQ_OP(elm, field) \
++ if ((elm)->field.tqe_next && \
++ (elm)->field.tqe_next->field.tqe_prev != \
++ &(elm)->field.tqe_next) \
++ QUEUEDEBUG_ABORT("TAILQ_* forw %p %s:%d", (elm), \
++ __FILE__, __LINE__); \
++ if (*(elm)->field.tqe_prev != (elm)) \
++ QUEUEDEBUG_ABORT("TAILQ_* back %p %s:%d", (elm), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) \
++ if ((elm)->field.tqe_next == NULL && \
++ (head)->tqh_last != &(elm)->field.tqe_next) \
++ QUEUEDEBUG_ABORT("TAILQ_PREREMOVE head %p elm %p %s:%d",\
++ (head), (elm), __FILE__, __LINE__);
++#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) \
++ (elm)->field.tqe_next = (void *)1L; \
++ (elm)->field.tqe_prev = (void *)1L;
++#else
++#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field)
++#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field)
++#define QUEUEDEBUG_TAILQ_OP(elm, field)
++#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field)
++#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field)
++#endif
++
++#define TAILQ_INIT(head) do { \
++ (head)->tqh_first = TAILQ_END(head); \
++ (head)->tqh_last = &(head)->tqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_HEAD(head, elm, field) do { \
++ QUEUEDEBUG_TAILQ_INSERT_HEAD((head), (elm), field) \
++ if (((elm)->field.tqe_next = (head)->tqh_first) != TAILQ_END(head))\
++ (head)->tqh_first->field.tqe_prev = \
++ &(elm)->field.tqe_next; \
++ else \
++ (head)->tqh_last = &(elm)->field.tqe_next; \
++ (head)->tqh_first = (elm); \
++ (elm)->field.tqe_prev = &(head)->tqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_TAIL(head, elm, field) do { \
++ QUEUEDEBUG_TAILQ_INSERT_TAIL((head), (elm), field) \
++ (elm)->field.tqe_next = TAILQ_END(head); \
++ (elm)->field.tqe_prev = (head)->tqh_last; \
++ *(head)->tqh_last = (elm); \
++ (head)->tqh_last = &(elm)->field.tqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
++ QUEUEDEBUG_TAILQ_OP((listelm), field) \
++ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != \
++ TAILQ_END(head)) \
++ (elm)->field.tqe_next->field.tqe_prev = \
++ &(elm)->field.tqe_next; \
++ else \
++ (head)->tqh_last = &(elm)->field.tqe_next; \
++ (listelm)->field.tqe_next = (elm); \
++ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
++ QUEUEDEBUG_TAILQ_OP((listelm), field) \
++ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
++ (elm)->field.tqe_next = (listelm); \
++ *(listelm)->field.tqe_prev = (elm); \
++ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_REMOVE(head, elm, field) do { \
++ QUEUEDEBUG_TAILQ_PREREMOVE((head), (elm), field) \
++ QUEUEDEBUG_TAILQ_OP((elm), field) \
++ if (((elm)->field.tqe_next) != TAILQ_END(head)) \
++ (elm)->field.tqe_next->field.tqe_prev = \
++ (elm)->field.tqe_prev; \
++ else \
++ (head)->tqh_last = (elm)->field.tqe_prev; \
++ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
++ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_REPLACE(head, elm, elm2, field) do { \
++ if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != \
++ TAILQ_END(head)) \
++ (elm2)->field.tqe_next->field.tqe_prev = \
++ &(elm2)->field.tqe_next; \
++ else \
++ (head)->tqh_last = &(elm2)->field.tqe_next; \
++ (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \
++ *(elm2)->field.tqe_prev = (elm2); \
++ QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \
++} while (/*CONSTCOND*/0)
++
++#define TAILQ_CONCAT(head1, head2, field) do { \
++ if (!TAILQ_EMPTY(head2)) { \
++ *(head1)->tqh_last = (head2)->tqh_first; \
++ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
++ (head1)->tqh_last = (head2)->tqh_last; \
++ TAILQ_INIT((head2)); \
++ } \
++} while (/*CONSTCOND*/0)
++
++/*
++ * Singly-linked Tail queue declarations.
++ */
++#define STAILQ_HEAD(name, type) \
++struct name { \
++ struct type *stqh_first; /* first element */ \
++ struct type **stqh_last; /* addr of last next element */ \
++}
++
++#define STAILQ_HEAD_INITIALIZER(head) \
++ { NULL, &(head).stqh_first }
++
++#define STAILQ_ENTRY(type) \
++struct { \
++ struct type *stqe_next; /* next element */ \
++}
++
++/*
++ * Singly-linked Tail queue access methods.
++ */
++#define STAILQ_FIRST(head) ((head)->stqh_first)
++#define STAILQ_END(head) NULL
++#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
++#define STAILQ_EMPTY(head) (STAILQ_FIRST(head) == STAILQ_END(head))
++
++/*
++ * Singly-linked Tail queue functions.
++ */
++#define STAILQ_INIT(head) do { \
++ (head)->stqh_first = NULL; \
++ (head)->stqh_last = &(head)->stqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_INSERT_HEAD(head, elm, field) do { \
++ if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
++ (head)->stqh_last = &(elm)->field.stqe_next; \
++ (head)->stqh_first = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_INSERT_TAIL(head, elm, field) do { \
++ (elm)->field.stqe_next = NULL; \
++ *(head)->stqh_last = (elm); \
++ (head)->stqh_last = &(elm)->field.stqe_next; \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
++ if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
++ (head)->stqh_last = &(elm)->field.stqe_next; \
++ (listelm)->field.stqe_next = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_REMOVE_HEAD(head, field) do { \
++ if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
++ (head)->stqh_last = &(head)->stqh_first; \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_REMOVE(head, elm, type, field) do { \
++ if ((head)->stqh_first == (elm)) { \
++ STAILQ_REMOVE_HEAD((head), field); \
++ } else { \
++ struct type *curelm = (head)->stqh_first; \
++ while (curelm->field.stqe_next != (elm)) \
++ curelm = curelm->field.stqe_next; \
++ if ((curelm->field.stqe_next = \
++ curelm->field.stqe_next->field.stqe_next) == NULL) \
++ (head)->stqh_last = &(curelm)->field.stqe_next; \
++ } \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_FOREACH(var, head, field) \
++ for ((var) = ((head)->stqh_first); \
++ (var); \
++ (var) = ((var)->field.stqe_next))
++
++#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
++ for ((var) = STAILQ_FIRST((head)); \
++ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
++ (var) = (tvar))
++
++#define STAILQ_CONCAT(head1, head2) do { \
++ if (!STAILQ_EMPTY((head2))) { \
++ *(head1)->stqh_last = (head2)->stqh_first; \
++ (head1)->stqh_last = (head2)->stqh_last; \
++ STAILQ_INIT((head2)); \
++ } \
++} while (/*CONSTCOND*/0)
++
++#define STAILQ_LAST(head, type, field) \
++ (STAILQ_EMPTY((head)) ? \
++ NULL : \
++ ((struct type *)(void *) \
++ ((char *)((head)->stqh_last) - offsetof(struct type, field))))
++
++
++#ifndef _KERNEL
++/*
++ * Circular queue definitions. Do not use. We still keep the macros
++ * for compatibility but because of pointer aliasing issues their use
++ * is discouraged!
++ */
++
++/*
++ * __launder_type(): We use this ugly hack to work around the the compiler
++ * noticing that two types may not alias each other and elide tests in code.
++ * We hit this in the CIRCLEQ macros when comparing 'struct name *' and
++ * 'struct type *' (see CIRCLEQ_HEAD()). Modern compilers (such as GCC
++ * 4.8) declare these comparisons as always false, causing the code to
++ * not run as designed.
++ *
++ * This hack is only to be used for comparisons and thus can be fully const.
++ * Do not use for assignment.
++ *
++ * If we ever choose to change the ABI of the CIRCLEQ macros, we could fix
++ * this by changing the head/tail sentinal values, but see the note above
++ * this one.
++ */
++static __inline const void * __launder_type(const void *);
++static __inline const void *
++__launder_type(const void *__x)
++{
++ __asm __volatile("" : "+r" (__x));
++ return __x;
++}
++
++#if defined(QUEUEDEBUG)
++#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field) \
++ if ((head)->cqh_first != CIRCLEQ_ENDC(head) && \
++ (head)->cqh_first->field.cqe_prev != CIRCLEQ_ENDC(head)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ head forw %p %s:%d", (head), \
++ __FILE__, __LINE__); \
++ if ((head)->cqh_last != CIRCLEQ_ENDC(head) && \
++ (head)->cqh_last->field.cqe_next != CIRCLEQ_ENDC(head)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ head back %p %s:%d", (head), \
++ __FILE__, __LINE__);
++#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field) \
++ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) { \
++ if ((head)->cqh_last != (elm)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ elm last %p %s:%d", \
++ (elm), __FILE__, __LINE__); \
++ } else { \
++ if ((elm)->field.cqe_next->field.cqe_prev != (elm)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ elm forw %p %s:%d", \
++ (elm), __FILE__, __LINE__); \
++ } \
++ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) { \
++ if ((head)->cqh_first != (elm)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ elm first %p %s:%d", \
++ (elm), __FILE__, __LINE__); \
++ } else { \
++ if ((elm)->field.cqe_prev->field.cqe_next != (elm)) \
++ QUEUEDEBUG_ABORT("CIRCLEQ elm prev %p %s:%d", \
++ (elm), __FILE__, __LINE__); \
++ }
++#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field) \
++ (elm)->field.cqe_next = (void *)1L; \
++ (elm)->field.cqe_prev = (void *)1L;
++#else
++#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field)
++#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field)
++#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field)
++#endif
++
++#define CIRCLEQ_HEAD(name, type) \
++struct name { \
++ struct type *cqh_first; /* first element */ \
++ struct type *cqh_last; /* last element */ \
++}
++
++#define CIRCLEQ_HEAD_INITIALIZER(head) \
++ { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
++
++#define CIRCLEQ_ENTRY(type) \
++struct { \
++ struct type *cqe_next; /* next element */ \
++ struct type *cqe_prev; /* previous element */ \
++}
++
++/*
++ * Circular queue functions.
++ */
++#define CIRCLEQ_INIT(head) do { \
++ (head)->cqh_first = CIRCLEQ_END(head); \
++ (head)->cqh_last = CIRCLEQ_END(head); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \
++ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
++ (elm)->field.cqe_prev = (listelm); \
++ if ((listelm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_last = (elm); \
++ else \
++ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
++ (listelm)->field.cqe_next = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \
++ (elm)->field.cqe_next = (listelm); \
++ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
++ if ((listelm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_first = (elm); \
++ else \
++ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
++ (listelm)->field.cqe_prev = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ (elm)->field.cqe_next = (head)->cqh_first; \
++ (elm)->field.cqe_prev = CIRCLEQ_END(head); \
++ if ((head)->cqh_last == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_last = (elm); \
++ else \
++ (head)->cqh_first->field.cqe_prev = (elm); \
++ (head)->cqh_first = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ (elm)->field.cqe_next = CIRCLEQ_END(head); \
++ (elm)->field.cqe_prev = (head)->cqh_last; \
++ if ((head)->cqh_first == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_first = (elm); \
++ else \
++ (head)->cqh_last->field.cqe_next = (elm); \
++ (head)->cqh_last = (elm); \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_REMOVE(head, elm, field) do { \
++ QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \
++ QUEUEDEBUG_CIRCLEQ_ELM((head), (elm), field) \
++ if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_last = (elm)->field.cqe_prev; \
++ else \
++ (elm)->field.cqe_next->field.cqe_prev = \
++ (elm)->field.cqe_prev; \
++ if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
++ (head)->cqh_first = (elm)->field.cqe_next; \
++ else \
++ (elm)->field.cqe_prev->field.cqe_next = \
++ (elm)->field.cqe_next; \
++ QUEUEDEBUG_CIRCLEQ_POSTREMOVE((elm), field) \
++} while (/*CONSTCOND*/0)
++
++#define CIRCLEQ_FOREACH(var, head, field) \
++ for ((var) = ((head)->cqh_first); \
++ (var) != CIRCLEQ_ENDC(head); \
++ (var) = ((var)->field.cqe_next))
++
++#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
++ for ((var) = ((head)->cqh_last); \
++ (var) != CIRCLEQ_ENDC(head); \
++ (var) = ((var)->field.cqe_prev))
++
++/*
++ * Circular queue access methods.
++ */
++#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
++#define CIRCLEQ_LAST(head) ((head)->cqh_last)
++/* For comparisons */
++#define CIRCLEQ_ENDC(head) (__launder_type(head))
++/* For assignments */
++#define CIRCLEQ_END(head) ((void *)(head))
++#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next)
++#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev)
++#define CIRCLEQ_EMPTY(head) \
++ (CIRCLEQ_FIRST(head) == CIRCLEQ_ENDC(head))
++
++#define CIRCLEQ_LOOP_NEXT(head, elm, field) \
++ (((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \
++ ? ((head)->cqh_first) \
++ : (elm->field.cqe_next))
++#define CIRCLEQ_LOOP_PREV(head, elm, field) \
++ (((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \
++ ? ((head)->cqh_last) \
++ : (elm->field.cqe_prev))
++#endif /* !_KERNEL */
++
++#endif /* !_SYS_QUEUE_H_ */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch
new file mode 100644
index 000000000..4a785d344
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch
@@ -0,0 +1,26 @@
+Fix a possible overflow (reported by _FORTIFY_SOURCE=2)
+
+Ported from Gentoo
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libtirpc-0.2.1/src/getrpcport.c
+===================================================================
+--- libtirpc-0.2.1.orig/src/getrpcport.c
++++ libtirpc-0.2.1/src/getrpcport.c
+@@ -54,11 +54,11 @@ getrpcport(host, prognum, versnum, proto
+
+ if ((hp = gethostbyname(host)) == NULL)
+ return (0);
++ if (hp->h_length != sizeof(addr.sin_addr.s_addr))
++ return (0);
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_port = 0;
+- if (hp->h_length > sizeof(addr))
+- hp->h_length = sizeof(addr);
+ memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
+ /* Inconsistent interfaces need casts! :-( */
+ return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
new file mode 100644
index 000000000..512e93497
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc/remove-des-functionality.patch
@@ -0,0 +1,144 @@
+uclibc and musl does not provide des functionality. Lets disable it.
+
+Upstream-Status: Inappropriate [uclibc and musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur libtirpc-1.0.1-orig/src/Makefile.am libtirpc-1.0.1/src/Makefile.am
+--- libtirpc-1.0.1-orig/src/Makefile.am 2015-10-30 17:15:14.000000000 +0200
++++ libtirpc-1.0.1/src/Makefile.am 2015-12-21 15:56:17.094702429 +0200
+@@ -22,9 +22,8 @@
+ pmap_prot.c pmap_prot2.c pmap_rmt.c rpc_prot.c rpc_commondata.c \
+ rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
+ rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
+- svc_auth_des.c \
+ svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
+- auth_time.c auth_des.c authdes_prot.c debug.c
++ debug.c
+
+ ## XDR
+ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
+@@ -41,8 +40,8 @@
+ libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
+ endif
+
+-libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
+-libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
++#libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
++#libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
+
+ CLEANFILES = cscope.* *~
+ DISTCLEANFILES = Makefile.in
+diff -Naur libtirpc-1.0.1-orig/src/rpc_soc.c libtirpc-1.0.1/src/rpc_soc.c
+--- libtirpc-1.0.1-orig/src/rpc_soc.c 2015-10-30 17:15:14.000000000 +0200
++++ libtirpc-1.0.1/src/rpc_soc.c 2015-12-21 15:56:17.095702416 +0200
+@@ -61,7 +61,6 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+-#include <rpcsvc/nis.h>
+
+ #include "rpc_com.h"
+
+@@ -522,86 +521,6 @@
+ }
+
+ /*
+- * Create the client des authentication object. Obsoleted by
+- * authdes_seccreate().
+- */
+-AUTH *
+-authdes_create(servername, window, syncaddr, ckey)
+- char *servername; /* network name of server */
+- u_int window; /* time to live */
+- struct sockaddr *syncaddr; /* optional hostaddr to sync with */
+- des_block *ckey; /* optional conversation key to use */
+-{
+- AUTH *nauth;
+- char hostname[NI_MAXHOST];
+-
+- if (syncaddr) {
+- /*
+- * Change addr to hostname, because that is the way
+- * new interface takes it.
+- */
+- switch (syncaddr->sa_family) {
+- case AF_INET:
+- if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
+- sizeof hostname, NULL, 0, 0) != 0)
+- goto fallback;
+- break;
+- case AF_INET6:
+- if (getnameinfo(syncaddr, sizeof(struct sockaddr_in6), hostname,
+- sizeof hostname, NULL, 0, 0) != 0)
+- goto fallback;
+- break;
+- default:
+- goto fallback;
+- }
+- nauth = authdes_seccreate(servername, window, hostname, ckey);
+- return (nauth);
+- }
+-fallback:
+- return authdes_seccreate(servername, window, NULL, ckey);
+-}
+-
+-/*
+- * Create the client des authentication object. Obsoleted by
+- * authdes_pk_seccreate().
+- */
+-extern AUTH *authdes_pk_seccreate(const char *, netobj *, u_int, const char *,
+- const des_block *, nis_server *);
+-
+-AUTH *
+-authdes_pk_create(servername, pkey, window, syncaddr, ckey)
+- char *servername; /* network name of server */
+- netobj *pkey; /* public key */
+- u_int window; /* time to live */
+- struct sockaddr *syncaddr; /* optional hostaddr to sync with */
+- des_block *ckey; /* optional conversation key to use */
+-{
+- AUTH *nauth;
+- char hostname[NI_MAXHOST];
+-
+- if (syncaddr) {
+- /*
+- * Change addr to hostname, because that is the way
+- * new interface takes it.
+- */
+- switch (syncaddr->sa_family) {
+- case AF_INET:
+- if (getnameinfo(syncaddr, sizeof(struct sockaddr_in), hostname,
+- sizeof hostname, NULL, 0, 0) != 0)
+- goto fallback;
+- break;
+- default:
+- goto fallback;
+- }
+- nauth = authdes_pk_seccreate(servername, pkey, window, hostname, ckey, NULL);
+- return (nauth);
+- }
+-fallback:
+- return authdes_pk_seccreate(servername, pkey, window, NULL, ckey, NULL);
+-}
+-
+-
+-/*
+ * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
+ */
+ CLIENT *
+diff -Naur libtirpc-1.0.1-orig/src/svc_auth.c libtirpc-1.0.1/src/svc_auth.c
+--- libtirpc-1.0.1-orig/src/svc_auth.c 2015-10-30 17:15:14.000000000 +0200
++++ libtirpc-1.0.1/src/svc_auth.c 2015-12-21 15:56:17.095702416 +0200
+@@ -114,9 +114,6 @@
+ case AUTH_SHORT:
+ dummy = _svcauth_short(rqst, msg);
+ return (dummy);
+- case AUTH_DES:
+- dummy = _svcauth_des(rqst, msg);
+- return (dummy);
+ #ifdef HAVE_RPCSEC_GSS
+ case RPCSEC_GSS:
+ dummy = _svcauth_gss(rqst, msg, no_dispatch);
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
new file mode 100644
index 000000000..e321d479e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libtirpc/libtirpc_1.0.1.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Transport-Independent RPC library"
+DESCRIPTION = "Libtirpc is a port of Suns Transport-Independent RPC library to Linux"
+SECTION = "libs/network"
+HOMEPAGE = "http://sourceforge.net/projects/libtirpc/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=183075&atid=903784"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f835cce8852481e4b2bbbdd23b5e47f3 \
+ file://src/netname.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24"
+
+PROVIDES = "virtual/librpc"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2;name=libtirpc \
+ ${GENTOO_MIRROR}/${BPN}-glibc-nfs.tar.xz;name=glibc-nfs \
+ file://libtirpc-0.2.1-fortify.patch \
+ file://0001-Add-missing-rwlock_unlocks-in-xprt_register.patch \
+ "
+
+SRC_URI_append_libc-uclibc = " file://remove-des-functionality.patch \
+ "
+
+SRC_URI_append_libc-musl = " file://remove-des-functionality.patch \
+ file://Use-netbsd-queue.h.patch \
+ "
+
+SRC_URI[libtirpc.md5sum] = "36ce1c0ff80863bb0839d54aa0b94014"
+SRC_URI[libtirpc.sha256sum] = "5156974f31be7ccbc8ab1de37c4739af6d9d42c87b1d5caf4835dda75fcbb89e"
+SRC_URI[glibc-nfs.md5sum] = "5ae500b9d0b6b72cb875bc04944b9445"
+SRC_URI[glibc-nfs.sha256sum] = "2677cfedf626f3f5a8f6e507aed5bb8f79a7453b589d684dbbc086e755170d83"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-gssapi"
+
+do_configure_prepend () {
+ cp -r ${S}/../tirpc ${S}
+}
+
+do_install_append() {
+ chown root:root ${D}${sysconfdir}/netconfig
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch
new file mode 100644
index 000000000..79756b9a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0001-Check-for-issetugid.patch
@@ -0,0 +1,62 @@
+From d0537cb7f2dc5877700ad78dfd191515379d4edc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 02:22:51 +0000
+Subject: [PATCH 1/2] Check for issetugid()
+
+If secure version of getenv is not there then we can use
+issetugid() as aid to call getenv()
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 1 +
+ lib/config.c | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1ded1a2..ee19e1f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -125,6 +125,7 @@ AC_TYPE_OFF_T
+ AC_TYPE_SIZE_T
+
+ AC_CHECK_FUNCS([__secure_getenv secure_getenv])
++AC_CHECK_FUNCS([issetugid])
+
+ # Modify CFLAGS after all tests are run (some of them could fail because
+ # of the -Werror).
+diff --git a/lib/config.c b/lib/config.c
+index 29e7120..30f9daf 100644
+--- a/lib/config.c
++++ b/lib/config.c
+@@ -44,8 +44,10 @@
+ # define safe_getenv(string) secure_getenv(string)
+ #elif defined(HAVE___SECURE_GETENV)
+ # define safe_getenv(string) __secure_getenv(string)
++#elif defined(HAVE_ISSETUGID)
++# define safe_getenv(string) safe_getenv_issetugid(string)
+ #else
+-# error Neither secure_getenv not __secure_getenv are available
++# error None of secure_getenv, __secure_getenv, or issetugid is available
+ #endif
+
+ struct config_config {
+@@ -59,6 +61,14 @@ struct config_key {
+ GList *values;
+ };
+
++static const char*
++safe_getenv_issetugid(const char* name)
++{
++ if (issetugid ())
++ return 0;
++ return getenv (name);
++}
++
+ /* Compare two section names */
+ static int
+ compare_section_names(gconstpointer a, gconstpointer b)
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch
new file mode 100644
index 000000000..4bc0219f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser/0002-remove-unused-execinfo.h.patch
@@ -0,0 +1,27 @@
+From 4b2f81f307ffeac12956e5c16e894e5ebb937ea5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 02:26:00 +0000
+Subject: [PATCH 2/2] remove unused execinfo.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ lib/error.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/lib/error.c b/lib/error.c
+index a5ec30a..443e601 100644
+--- a/lib/error.c
++++ b/lib/error.c
+@@ -18,7 +18,6 @@
+ #include <config.h>
+ #include <sys/types.h>
+ #include <errno.h>
+-#include <execinfo.h>
+ #include <libintl.h>
+ #include <stdarg.h>
+ #include <stdlib.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb
new file mode 100644
index 000000000..1369ae8f2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/libuser/libuser_0.62.bb
@@ -0,0 +1,31 @@
+SUMMARY = "user and group account administration library"
+DESCRIPTION = "The libuser library implements a standardized interface for manipulating and administering user \
+and group accounts"
+HOMEPAGE = "https://fedorahosted.org/libuser/"
+BUGTRACKER = "https://fedorahosted.org/libuser/newticket"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+ file://lib/user.h;endline=19;md5=76b301f63c39fa992062395efbdc9558 \
+ file://samples/testuser.c;endline=19;md5=3b87fa660fa3f4a6bb31d624afe30ba1"
+
+SECTION = "base"
+
+SRC_URI = "https://fedorahosted.org/releases/l/i/libuser/libuser-${PV}.tar.xz \
+ file://0001-Check-for-issetugid.patch \
+ file://0002-remove-unused-execinfo.h.patch \
+ "
+
+SRC_URI[md5sum] = "63e5e5c551e99dc5302b40b80bd6d4f2"
+SRC_URI[sha256sum] = "a58ff4fabb01a25043b142185a33eeea961109dd60d4b40b6a9df4fa3cace20b"
+
+DEPENDS = "popt libpam glib-2.0 docbook-utils-native linuxdoc-tools-native python"
+
+inherit autotools gettext pythonnative python-dir pkgconfig
+
+EXTRA_OEMAKE = "PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR}"
+
+PACKAGES += "${PN}-python "
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd
new file mode 100644
index 000000000..f5f1c377b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd
@@ -0,0 +1 @@
+<html><body><h1>It works!</h1></body></html>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd
new file mode 100644
index 000000000..bf89a60b7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/lighttpd
+NAME=lighttpd
+DESC="Lighttpd Web Server"
+OPTS="-f /etc/lighttpd.conf"
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ start-stop-daemon --start -x "$DAEMON" -- $OPTS
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon --stop -x "$DAEMON"
+ echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon --stop -x "$DAEMON"
+ sleep 1
+ start-stop-daemon --start -x "$DAEMON" -- $OPTS
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf
new file mode 100644
index 000000000..6e8402d24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf
@@ -0,0 +1,331 @@
+# lighttpd configuration file
+#
+# use it as a base for lighttpd 1.0.0 and above
+#
+# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $
+
+############ Options you really have to take care of ####################
+
+## modules to load
+# at least mod_access and mod_accesslog should be loaded
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+server.modules = (
+# "mod_rewrite",
+# "mod_redirect",
+# "mod_alias",
+ "mod_access",
+# "mod_cml",
+# "mod_trigger_b4_dl",
+# "mod_auth",
+# "mod_status",
+# "mod_setenv",
+# "mod_fastcgi",
+# "mod_proxy",
+# "mod_simple_vhost",
+# "mod_evhost",
+# "mod_userdir",
+# "mod_cgi",
+# "mod_compress",
+# "mod_ssi",
+# "mod_usertrack",
+# "mod_expire",
+# "mod_secdownload",
+# "mod_rrdtool",
+# "mod_webdav",
+ "mod_accesslog" )
+
+## a static document-root, for virtual-hosting take look at the
+## server.virtual-* options
+server.document-root = "/www/pages/"
+
+## where to send error-messages to
+server.errorlog = "/www/logs/lighttpd.error.log"
+
+# files to check for if .../ is requested
+index-file.names = ( "index.php", "index.html",
+ "index.htm", "default.htm" )
+
+## set the event-handler (read the performance section in the manual)
+# server.event-handler = "freebsd-kqueue" # needed on OS X
+
+# mimetype mapping
+mimetype.assign = (
+ ".pdf" => "application/pdf",
+ ".sig" => "application/pgp-signature",
+ ".spl" => "application/futuresplash",
+ ".class" => "application/octet-stream",
+ ".ps" => "application/postscript",
+ ".torrent" => "application/x-bittorrent",
+ ".dvi" => "application/x-dvi",
+ ".gz" => "application/x-gzip",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".tar" => "application/x-tar",
+ ".zip" => "application/zip",
+ ".mp3" => "audio/mpeg",
+ ".m3u" => "audio/x-mpegurl",
+ ".wma" => "audio/x-ms-wma",
+ ".wax" => "audio/x-ms-wax",
+ ".ogg" => "application/ogg",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".xbm" => "image/x-xbitmap",
+ ".xpm" => "image/x-xpixmap",
+ ".xwd" => "image/x-xwindowdump",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".asc" => "text/plain",
+ ".c" => "text/plain",
+ ".cpp" => "text/plain",
+ ".log" => "text/plain",
+ ".conf" => "text/plain",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".mpeg" => "video/mpeg",
+ ".mpg" => "video/mpeg",
+ ".mov" => "video/quicktime",
+ ".qt" => "video/quicktime",
+ ".avi" => "video/x-msvideo",
+ ".asf" => "video/x-ms-asf",
+ ".asx" => "video/x-ms-asf",
+ ".wmv" => "video/x-ms-wmv",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar"
+ )
+
+# Use the "Content-Type" extended attribute to obtain mime type if possible
+#mimetype.use-xattr = "enable"
+
+
+## send a different Server: header
+## be nice and keep it at lighttpd
+# server.tag = "lighttpd"
+
+#### accesslog module
+accesslog.filename = "/www/logs/access.log"
+debug.log-request-handling = "enable"
+
+
+
+
+## deny access the file-extensions
+#
+# ~ is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+# of the document-root
+url.access-deny = ( "~", ".inc" )
+
+$HTTP["url"] =~ "\.pdf$" {
+ server.range-requests = "disable"
+}
+
+##
+# which extensions should not be handle via static-file transfer
+#
+# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+######### Options that are good to be but not neccesary to be changed #######
+
+## bind to port (default: 80)
+#server.port = 81
+
+## bind to localhost (default: all interfaces)
+#server.bind = "grisu.home.kneschke.de"
+
+## error-handler for status 404
+#server.error-handler-404 = "/error-handler.html"
+#server.error-handler-404 = "/error-handler.php"
+
+## to help the rc.scripts
+#server.pid-file = "/var/run/lighttpd.pid"
+
+
+###### virtual hosts
+##
+## If you want name-based virtual hosting add the next three settings and load
+## mod_simple_vhost
+##
+## document-root =
+## virtual-server-root + virtual-server-default-host + virtual-server-docroot
+## or
+## virtual-server-root + http-host + virtual-server-docroot
+##
+#simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
+#simple-vhost.default-host = "grisu.home.kneschke.de"
+#simple-vhost.document-root = "/pages/"
+
+
+##
+## Format: <errorfile-prefix><status-code>.html
+## -> ..../status-404.html for 'File not found'
+#server.errorfile-prefix = "/home/weigon/projects/lighttpd/doc/status-"
+
+## virtual directory listings
+#dir-listing.activate = "enable"
+
+## enable debugging
+#debug.log-request-header = "enable"
+#debug.log-response-header = "enable"
+#debug.log-request-handling = "enable"
+#debug.log-file-not-found = "enable"
+
+### only root can use these options
+#
+# chroot() to directory (default: no chroot() )
+#server.chroot = "/"
+
+## change uid to <uid> (default: don't care)
+#server.username = "wwwrun"
+
+## change uid to <uid> (default: don't care)
+#server.groupname = "wwwrun"
+
+#### compress module
+#compress.cache-dir = "/tmp/lighttpd/cache/compress/"
+#compress.filetype = ("text/plain", "text/html")
+
+#### proxy module
+## read proxy.txt for more info
+#proxy.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "host" => "192.168.0.101",
+# "port" => 80
+# )
+# )
+# )
+
+#### fastcgi module
+## read fastcgi.txt for more info
+## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
+#fastcgi.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "socket" => "/tmp/php-fastcgi.socket",
+# "bin-path" => "/usr/local/bin/php"
+# )
+# )
+# )
+
+#### CGI module
+#cgi.assign = ( ".pl" => "/usr/bin/perl",
+# ".cgi" => "/usr/bin/perl" )
+#
+
+#### SSL engine
+#ssl.engine = "enable"
+#ssl.pemfile = "server.pem"
+
+#### status module
+#status.status-url = "/server-status"
+#status.config-url = "/server-config"
+
+#### auth module
+## read authentication.txt for more info
+#auth.backend = "plain"
+#auth.backend.plain.userfile = "lighttpd.user"
+#auth.backend.plain.groupfile = "lighttpd.group"
+
+#auth.backend.ldap.hostname = "localhost"
+#auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
+#auth.backend.ldap.filter = "(uid=$)"
+
+#auth.require = ( "/server-status" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "user=jan"
+# ),
+# "/server-config" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "valid-user"
+# )
+# )
+
+#### url handling modules (rewrite, redirect, access)
+#url.rewrite = ( "^/$" => "/server-status" )
+#url.redirect = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
+
+#### both rewrite/redirect support back reference to regex conditional using %n
+#$HTTP["host"] =~ "^www\.(.*)" {
+# url.redirect = ( "^/(.*)" => "http://%1/$1" )
+#}
+
+#
+# define a pattern for the host url finding
+# %% => % sign
+# %0 => domain name + tld
+# %1 => tld
+# %2 => domain name without tld
+# %3 => subdomain 1 name
+# %4 => subdomain 2 name
+#
+#evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
+
+#### expire module
+#expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
+
+#### ssi
+#ssi.extension = ( ".shtml" )
+
+#### rrdtool
+#rrdtool.binary = "/usr/bin/rrdtool"
+#rrdtool.db-name = "/var/www/lighttpd.rrd"
+
+#### setenv
+#setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
+#setenv.add-response-header = ( "X-Secret-Message" => "42" )
+
+## for mod_trigger_b4_dl
+# trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db"
+# trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
+# trigger-before-download.trigger-url = "^/trigger/"
+# trigger-before-download.download-url = "^/download/"
+# trigger-before-download.deny-url = "http://127.0.0.1/index.html"
+# trigger-before-download.trigger-timeout = 10
+
+## for mod_cml
+## don't forget to add index.cml to server.indexfiles
+# cml.extension = ".cml"
+# cml.memcache-hosts = ( "127.0.0.1:11211" )
+
+#### variable usage:
+## variable name without "." is auto prefixed by "var." and becomes "var.bar"
+#bar = 1
+#var.mystring = "foo"
+
+## integer add
+#bar += 1
+## string concat, with integer cast as string, result: "www.foo1.com"
+#server.name = "www." + mystring + var.bar + ".com"
+## array merge
+#index-file.names = (foo + ".php") + index-file.names
+#index-file.names += (foo + ".php")
+
+#### include
+#include /etc/lighttpd/lighttpd-inc.conf
+## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
+#include "lighttpd-inc.conf"
+
+#### include_shell
+#include_shell "echo var.a=1"
+## the above is same as:
+#var.a=1
+
+# include other config file fragments from lighttpd.d subdir
+include_shell "find /etc/lighttpd.d -maxdepth 1 -name '*.conf' -exec cat {} \;"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service
new file mode 100644
index 000000000..66a907aa1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Lightning Fast Webserver With Light System Requirements
+After=network.target
+
+[Service]
+ExecStartPre=@SBINDIR@/lighttpd -t -f @SYSCONFDIR@/lighttpd.conf
+ExecStart=@SBINDIR@/lighttpd -D -f @SYSCONFDIR@/lighttpd.conf
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch
new file mode 100644
index 000000000..e395f928c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch
@@ -0,0 +1,33 @@
+Use pkg-config for pcre dependency instead of -config script.
+
+Upstream-Status: Pending
+
+RP 2014/5/22
+
+
+Index: lighttpd-1.4.35/configure.ac
+===================================================================
+--- lighttpd-1.4.35.orig/configure.ac 2014-03-06 14:08:00.000000000 +0000
++++ lighttpd-1.4.35/configure.ac 2014-05-13 16:58:30.758471169 +0000
+@@ -309,16 +309,14 @@
+ AC_MSG_RESULT([$WITH_PCRE])
+
+ if test "$WITH_PCRE" != "no"; then
+- AC_PATH_PROG(PCRECONFIG, pcre-config)
+-
+- if test x"$PCRECONFIG" != x; then
+- PCRE_LIB=`$PCRECONFIG --libs`
+- CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
++ PKG_CHECK_MODULES(PCREPKG, [libpcre], [
++ PCRE_LIB=${PCREPKG_LIBS}
++ CPPFLAGS="$CPPFLAGS ${PCREPKG_CFLAGS}"
+ AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
+ AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
+- else
++ ], [
+ AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
+- fi
++ ])
+ fi
+
+ AC_SUBST(PCRE_LIB)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.39.bb b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.39.bb
new file mode 100644
index 000000000..378accbf1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lighttpd/lighttpd_1.4.39.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Lightweight high-performance web server"
+HOMEPAGE = "http://www.lighttpd.net/"
+BUGTRACKER = "http://redmine.lighttpd.net/projects/lighttpd/issues"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e4dac5c6ab169aa212feb5028853a579"
+
+SECTION = "net"
+DEPENDS = "zlib libpcre"
+RDEPENDS_${PN} += " \
+ lighttpd-module-access \
+ lighttpd-module-accesslog \
+ lighttpd-module-indexfile \
+ lighttpd-module-dirlisting \
+ lighttpd-module-staticfile \
+"
+
+SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.tar.xz \
+ file://index.html.lighttpd \
+ file://lighttpd.conf \
+ file://lighttpd \
+ file://lighttpd.service \
+ file://pkgconfig.patch \
+ "
+
+SRC_URI[md5sum] = "63c7563be1c7a7a9819a51f07f1af8b2"
+SRC_URI[sha256sum] = "7eb9a1853c3d6dd5851682b0733a729ba4158d6bdff80974d5ef5f1f6887365b"
+
+PACKAGECONFIG ??= "openssl"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+
+EXTRA_OECONF = " \
+ --without-bzip2 \
+ --without-ldap \
+ --without-lua \
+ --without-memcache \
+ --with-pcre \
+ --without-webdav-props \
+ --without-webdav-locks \
+ --disable-static \
+"
+
+inherit autotools pkgconfig update-rc.d gettext systemd
+
+INITSCRIPT_NAME = "lighttpd"
+INITSCRIPT_PARAMS = "defaults 70"
+
+SYSTEMD_SERVICE_${PN} = "lighttpd.service"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/lighttpd.d ${D}/www/pages/dav
+ install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/lighttpd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ ${D}${systemd_unitdir}/system/lighttpd.service
+ #For FHS compliance, create symbolic links to /var/log and /var/tmp for logs and temporary data
+ ln -sf ${localstatedir}/log ${D}/www/logs
+ ln -sf ${localstatedir}/tmp ${D}/www/var
+}
+
+FILES_${PN} += "${sysconfdir} /www"
+
+CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf"
+
+PACKAGES_DYNAMIC += "^lighttpd-module-.*"
+
+python populate_packages_prepend () {
+ lighttpd_libdir = d.expand('${libdir}')
+ do_split_packages(d, lighttpd_libdir, '^mod_(.*)\.so$', 'lighttpd-module-%s', 'Lighttpd module for %s', extra_depends='')
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
new file mode 100644
index 000000000..2e931a287
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
@@ -0,0 +1,147 @@
+From 68f29ab490cf987aa34b5f4caf1784b58a021308 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 17 Feb 2015 21:08:07 -0800
+Subject: [PATCH] Act as the "mv" command when rotate log
+
+Act as the "mv" command when rotate log, first rename, if failed, then
+read and write.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ logrotate.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 59 insertions(+), 12 deletions(-)
+
+diff --git a/logrotate.c b/logrotate.c
+index d3deb6a..cf8bf2c 100644
+--- a/logrotate.c
++++ b/logrotate.c
+@@ -1157,6 +1157,53 @@ int findNeedRotating(struct logInfo *log, int logNum, int force)
+ return 0;
+ }
+
++/* Act as the "mv" command, if rename failed, then read the old file and
++ * write to new file. The function which invokes the mvFile will use
++ * the strerror(errorno) to handle the error message, so we don't have
++ * to print the error message here */
++
++int mvFile (char *oldName, char *newName, struct logInfo *log, acl_type acl)
++{
++ struct stat sbprev;
++ int fd_old, fd_new, n;
++ char buf[BUFSIZ];
++
++ /* Do the rename first */
++ if (!rename(oldName, newName))
++ return 0;
++
++ /* If the errno is EXDEV, then read old file, write newfile and
++ * remove the oldfile */
++ if (errno == EXDEV) {
++ /* Open the old file to read */
++ if ((fd_old = open(oldName, O_RDONLY)) < 0)
++ return 1;
++
++ /* Create the file to write, keep the same attribute as the old file */
++ if (stat(oldName, &sbprev))
++ return 1;
++ else {
++ if ((fd_new = createOutputFile(newName,
++ O_WRONLY | O_CREAT | O_TRUNC, &sbprev, acl, 0)) < 0 )
++ return 1;
++ }
++
++ /* Read and write */
++ while ((n = read(fd_old, buf, BUFSIZ)) > 0)
++ if (write(fd_new, buf, n) != n)
++ return 1;
++
++ if ((close(fd_old) < 0) ||
++ removeLogFile(oldName, log) ||
++ (close(fd_new) < 0))
++ return 1;
++
++ return 0;
++ }
++
++ return 1;
++}
++
+ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ struct logNames *rotNames)
+ {
+@@ -1523,15 +1570,15 @@ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ }
+
+ message(MESS_DEBUG,
+- "renaming %s to %s (rotatecount %d, logstart %d, i %d), \n",
++ "moving %s to %s (rotatecount %d, logstart %d, i %d), \n",
+ oldName, newName, rotateCount, logStart, i);
+
+- if (!debug && rename(oldName, newName)) {
++ if (!debug && mvFile(oldName, newName, log, prev_acl)) {
+ if (errno == ENOENT) {
+ message(MESS_DEBUG, "old log %s does not exist\n",
+ oldName);
+ } else {
+- message(MESS_ERROR, "error renaming %s to %s: %s\n",
++ message(MESS_ERROR, "error moving %s to %s: %s\n",
+ oldName, newName, strerror(errno));
+ hasErrors = 1;
+ }
+@@ -1669,21 +1716,21 @@ int rotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ return 1;
+ }
+
+- message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
++ message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum],
+ tmpFilename);
+- if (!debug && !hasErrors && rename(log->files[logNum], tmpFilename)) {
+- message(MESS_ERROR, "failed to rename %s to %s: %s\n",
++ if (!debug && !hasErrors && mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
++ message(MESS_ERROR, "failed to move %s to %s: %s\n",
+ log->files[logNum], tmpFilename,
+ strerror(errno));
+ hasErrors = 1;
+ }
+ }
+ else {
+- message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
++ message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum],
+ rotNames->finalName);
+ if (!debug && !hasErrors &&
+- rename(log->files[logNum], rotNames->finalName)) {
+- message(MESS_ERROR, "failed to rename %s to %s: %s\n",
++ mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
++ message(MESS_ERROR, "failed to move %s to %s: %s\n",
+ log->files[logNum], tmpFilename,
+ strerror(errno));
+ hasErrors = 1;
+@@ -2063,7 +2110,7 @@ int rotateLogSet(struct logInfo *log, int force)
+ return hasErrors;
+ }
+
+-static int writeState(char *stateFilename)
++static int writeState(struct logInfo *log, char *stateFilename)
+ {
+ struct logState *p;
+ FILE *f;
+@@ -2227,7 +2274,7 @@ static int writeState(char *stateFilename)
+ fclose(f);
+
+ if (error == 0) {
+- if (rename(tmpFilename, stateFilename)) {
++ if (mvFile(tmpFilename, stateFilename, log, prev_acl)) {
+ unlink(tmpFilename);
+ error = 1;
+ message(MESS_ERROR, "error renaming temp state file %s\n",
+@@ -2525,7 +2572,7 @@ int main(int argc, const char **argv)
+ rc |= rotateLogSet(log, force);
+
+ if (!debug)
+- rc |= writeState(stateFile);
++ rc |= writeState(log, stateFile);
+
+ return (rc != 0);
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
new file mode 100644
index 000000000..793d70259
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
@@ -0,0 +1,32 @@
+Disable the check for different filesystems
+
+The logrotate supports rotate log across different filesystems now, so
+disable the check for different filesystems.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ config.c | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/config.c b/config.c
+index dbbf563..64e66f6 100644
+--- a/config.c
++++ b/config.c
+@@ -1493,15 +1493,6 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ goto error;
+ }
+ }
+-
+- if (sb.st_dev != sb2.st_dev
+- && !(newlog->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY | LOG_FLAG_TMPFILENAME))) {
+- message(MESS_ERROR,
+- "%s:%d olddir %s and log file %s "
+- "are on different devices\n", configFile,
+- lineNum, newlog->oldDir, newlog->files[i]);
+- goto error;
+- }
+ }
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
new file mode 100644
index 000000000..50d037d5a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
@@ -0,0 +1,38 @@
+From e0b0fe30e9c49234994a20a86aacfaf80e690087 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 17 Feb 2015 21:14:37 -0800
+Subject: [PATCH] Update the manual
+
+Update the manual for rotating on different filesystems.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ logrotate.8 | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/logrotate.8 b/logrotate.8
+index e4e5f48..84407d0 100644
+--- a/logrotate.8
++++ b/logrotate.8
+@@ -405,12 +405,10 @@ Do not rotate the log if it is empty (this overrides the \fBifempty\fR option).
+
+ .TP
+ \fBolddir \fIdirectory\fR
+-Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR must be
+-on the same physical device as the log file being rotated, unless \fBcopy\fR,
+-\fBcopytruncate\fR or \fBrenamecopy\fR option is used. The \fIdirectory\fR
+-is assumed to be relative to the directory holding the log file
+-unless an absolute path name is specified. When this option is used all
+-old versions of the log end up in \fIdirectory\fR. This option may be
++Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR
++is assumed to be relative to the directory holding the log file unless
++an absolute path name is specified. When this option is used all old
++versions of the log end up in \fIdirectory\fR. This option may be
+ overridden by the \fBnoolddir\fR option.
+
+ .TP
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb
new file mode 100644
index 000000000..5f1a601ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/logrotate/logrotate_3.9.1.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Rotates, compresses, removes and mails system log files"
+SECTION = "console/utils"
+HOMEPAGE = "https://fedorahosted.org/logrotate/"
+LICENSE = "GPLv2"
+
+# TODO: logrotate 3.8.8 adds autotools/automake support, update recipe to use it.
+# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox?
+
+DEPENDS="coreutils popt"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+SRC_URI = "https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.gz \
+ file://act-as-mv-when-rotate.patch \
+ file://update-the-manual.patch \
+ file://disable-check-different-filesystems.patch \
+ "
+
+SRC_URI[md5sum] = "4492b145b6d542e4a2f41e77fa199ab0"
+SRC_URI[sha256sum] = "022769e3288c80981559a8421703c88e8438b447235e36dd3c8e97cd94c52545"
+
+PACKAGECONFIG ?= "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
+"
+
+PACKAGECONFIG[acl] = ",,acl"
+PACKAGECONFIG[selinux] = ",,libselinux"
+
+CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \
+ ${sysconfdir}/logrotate.conf"
+
+# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
+# optimization variables, so use it rather than EXTRA_CFLAGS.
+EXTRA_OEMAKE = "\
+ LFS= \
+ OS_NAME='${OS_NAME}' \
+ 'CC=${CC}' \
+ 'RPM_OPT_FLAGS=${CFLAGS}' \
+ 'EXTRA_LDFLAGS=${LDFLAGS}' \
+ ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \
+"
+
+# OS_NAME in the makefile defaults to `uname -s`. The behavior for
+# freebsd/netbsd is questionable, so leave it as Linux, which only sets
+# INSTALL=install and BASEDIR=/usr.
+OS_NAME = "Linux"
+
+do_compile_prepend() {
+ # Make sure the recompile is OK
+ rm -f ${B}/.depend
+}
+
+do_install(){
+ oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir}
+ mkdir -p ${D}${sysconfdir}/logrotate.d
+ mkdir -p ${D}${sysconfdir}/cron.daily
+ mkdir -p ${D}${localstatedir}/lib
+ install -p -m 644 examples/logrotate-default ${D}${sysconfdir}/logrotate.conf
+ install -p -m 755 examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
+ touch ${D}${localstatedir}/lib/logrotate.status
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/init-functions b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/init-functions
new file mode 100755
index 000000000..7c1dce24c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/init-functions
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# LSB initscript functions, as defined in the LSB Spec 1.1.0
+#
+# Lawrence Lim <llim@core.com> - Tue, 26 June 2007
+# Updated to the latest LSB 3.1 spec
+# http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic_lines.txt
+
+start_daemon () {
+ /etc/core-lsb/lsb_start_daemon "$@"
+}
+
+killproc () {
+ /etc/core-lsb/lsb_killproc "$@"
+}
+
+pidofproc () {
+ /etc/core-lsb/lsb_pidofproc "$@"
+}
+
+log_success_msg () {
+ /etc/core-lsb/lsb_log_message success "$@"
+}
+
+log_failure_msg () {
+ /etc/core-lsb/lsb_log_message failure "$@"
+}
+
+log_warning_msg () {
+ /etc/core-lsb/lsb_log_message warning "$@"
+}
+
+# int log_begin_message (char *message)
+log_begin_msg () {
+ if [ -z "$1" ]; then
+ return 1
+ fi
+ echo " * $@"
+}
+
+
+log_end_msg () {
+ /etc/core-lsb/lsb_log_message end "$@"
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_killproc b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_killproc
new file mode 100755
index 000000000..866c1a9c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_killproc
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+LSB=LSB-1.1 killproc $*
+exit $?
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_log_message b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_log_message
new file mode 100755
index 000000000..10343b081
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_log_message
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+ACTION=$1
+shift
+
+case "$ACTION" in
+ success)
+ echo -n $*
+ success "$*"
+ echo
+ ;;
+ failure)
+ echo -n $*
+ failure "$*"
+ echo
+ ;;
+ warning)
+ echo -n $*
+ warning "$*"
+ echo
+ ;;
+ *)
+ ;;
+esac
+exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc
new file mode 100755
index 000000000..6d1fd0f24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_pidofproc
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+pidofproc $*
+exit $?
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon
new file mode 100755
index 000000000..de62c2344
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb/lsb_start_daemon
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+nice=
+force=
+pidfile=
+user=
+check=
+RETVAL=
+while [ "$1" != "${1##[-+]}" ]; do
+ case $1 in
+ -f)
+ force="--force"
+ shift
+ ;;
+ -n)
+ nice=$2
+ shift 2
+ ;;
+ -p)
+ pidfile="--pidfile $2"
+ shift 2
+ ;;
+ -u)
+ user="--user $2"
+ shift 2
+ ;;
+ -c)
+ check="--check $2"
+ shift 2
+ ;;
+ *)
+ echo "Unknown Option $1"
+ echo "Options are:"
+ echo "-f"
+ echo "-p {pidfile}"
+ echo "-n [+/-nicelevel]"
+ echo "-u {user}"
+ echo "-c {base}"
+ exit 1;;
+ esac
+done
+LSB=LSB-1.1 daemon ${force:-} ${nice:-} ${pidfile:-} ${user:-} ${check:-} $*
+exit $?
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb
new file mode 100644
index 000000000..ece0eab0f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -0,0 +1,132 @@
+SUMMARY = "LSB support for OpenEmbedded"
+SECTION = "console/utils"
+HOMEPAGE = "http://prdownloads.sourceforge.net/lsb"
+LICENSE = "GPLv2+"
+PR = "r2"
+
+LSB_CORE = "lsb-core-${TARGET_ARCH}"
+LSB_CORE_x86 = "lsb-core-ia32"
+LSB_CORE_x86-64 = "lsb-core-amd64"
+RPROVIDES_${PN} += "${LSB_CORE}"
+
+# lsb_release needs getopt, lsbinitscripts
+RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts"
+
+LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/lsb/lsb_release/1.4/lsb-release-1.4.tar.gz \
+ file://init-functions \
+ file://lsb_killproc \
+ file://lsb_log_message \
+ file://lsb_pidofproc \
+ file://lsb_start_daemon \
+ "
+
+SRC_URI[md5sum] = "30537ef5a01e0ca94b7b8eb6a36bb1e4"
+SRC_URI[sha256sum] = "99321288f8d62e7a1d485b7c6bdccf06766fb8ca603c6195806e4457fdf17172"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lsb/files/lsb_release/"
+UPSTREAM_CHECK_REGEX = "/lsb_release/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/lsb-release-1.4"
+
+CLEANBROKEN = "1"
+
+do_install(){
+ oe_runmake install prefix=${D} mandir=${D}/${datadir}/man/ DESTDIR=${D}
+
+ # this 2 dirs are needed by package lsb-dist-checker
+ mkdir -p ${D}${sysconfdir}/opt
+ mkdir -p ${D}${localstatedir}/opt
+
+ mkdir -p ${D}${base_bindir}
+ mkdir -p ${D}/${baselib}
+ mkdir -p ${D}${sysconfdir}/lsb-release.d
+ printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
+
+ if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+ printf "core-4.1-ia32" >> ${D}${sysconfdir}/lsb-release
+ else
+ printf "core-4.1-${TARGET_ARCH}" >> ${D}${sysconfdir}/lsb-release
+ fi
+ echo "\"" >> ${D}${sysconfdir}/lsb-release
+ echo "DISTRIB_ID=${DISTRO}" >> ${D}${sysconfdir}/lsb-release
+ echo "DISTRIB_RELEASE=${DISTRO_VERSION}" >> ${D}${sysconfdir}/lsb-release
+ if [ -n "${DISTRO_CODENAME}" ]; then
+ echo "DISTRIB_CODENAME=${DISTRO_CODENAME}" >> ${D}${sysconfdir}/lsb-release
+ fi
+ echo "DISTRIB_DESCRIPTION=\"${DISTRO_NAME} ${DISTRO_VERSION}\"" >> ${D}${sysconfdir}/lsb-release
+
+ if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+ mkdir -p ${D}${sysconfdir}/lsb-release.d
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ia32
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ia32
+ elif [ "${TARGET_ARCH}" = "x86_64" ];then
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-amd64
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-amd64
+ fi
+ if [ "${TARGET_ARCH}" = "powerpc" ];then
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc32
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc32
+ elif [ "${TARGET_ARCH}" = "powerpc64" ];then
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+ touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc64
+ touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc64
+ fi
+}
+
+do_install_append(){
+ install -d ${D}${sysconfdir}/core-lsb
+ for i in lsb_killproc lsb_log_message lsb_pidofproc lsb_start_daemon
+ do
+ install -m 0755 ${WORKDIR}/${i} ${D}${sysconfdir}/core-lsb
+ done
+
+ install -d ${D}/lib/lsb
+ install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
+
+ # creat links for LSB test
+ install -d ${D}/usr/lib/lsb
+ ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
+ ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
+
+ if [ "${TARGET_ARCH}" = "x86_64" ];then
+ cd ${D}
+ if [ "${baselib}" != "lib64" ]; then
+ ln -sf ${baselib} lib64
+ fi
+ cd ${D}/${baselib}
+ ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
+ ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
+ fi
+ if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+ cd ${D}/${baselib}
+ ln -sf ld-linux.so.2 ld-lsb.so.2
+ ln -sf ld-linux.so.2 ld-lsb.so.3
+ fi
+
+ if [ "${TARGET_ARCH}" = "powerpc64" ];then
+ cd ${D}
+ if [ "${baselib}" != "lib64" ]; then
+ ln -sf ${baselib} lib64
+ fi
+ cd ${D}/${baselib}
+ ln -sf ld64.so.1 ld-lsb-ppc64.so.2
+ ln -sf ld64.so.1 ld-lsb-ppc64.so.3
+ fi
+ if [ "${TARGET_ARCH}" = "powerpc" ];then
+ cd ${D}/${baselib}
+ ln -sf ld.so.1 ld-lsb-ppc32.so.2
+ ln -sf ld.so.1 ld-lsb-ppc32.so.3
+ fi
+}
+FILES_${PN} += "/lib64 \
+ ${base_libdir} \
+ /usr/lib/lsb \
+ ${base_libdir}/lsb/* \
+ /lib/lsb/* \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch
new file mode 100644
index 000000000..0809c9be9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Subject: functions: avoid exit 1 which causes init scripts to fail
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ rc.d/init.d/functions | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
+index 6850046..11223f7 100644
+--- a/rc.d/init.d/functions
++++ b/rc.d/init.d/functions
+@@ -597,5 +597,5 @@ if [ "$_use_systemctl" = "1" ]; then
+ fi
+ fi
+
+-strstr "$(cat /proc/cmdline)" "rc.debug" && set -x
++strstr "$(cat /proc/cmdline)" "rc.debug" && set -x || true
+
+--
+2.1.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch
new file mode 100644
index 000000000..a756d047e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts/functions.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: initscripts-9.43/rc.d/init.d/functions
+===================================================================
+--- initscripts-9.43.orig/rc.d/init.d/functions
++++ initscripts-9.43/rc.d/init.d/functions
+@@ -13,6 +13,7 @@ umask 022
+ PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+ export PATH
+
++
+ if [ $PPID -ne 1 -a -z "$SYSTEMCTL_SKIP_REDIRECT" ] && \
+ ( /bin/mountpoint -q /cgroup/systemd || /bin/mountpoint -q /sys/fs/cgroup/systemd ) ; then
+ case "$0" in
+@@ -54,7 +55,7 @@ systemctl_redirect () {
+ [ -z "${COLUMNS:-}" ] && COLUMNS=80
+
+ if [ -z "${CONSOLETYPE:-}" ]; then
+- if [ -c "/dev/stderr" -a -r "/dev/stderr" ]; then
++ if [ -c "/dev/stderr" -a -r "/dev/stderr" -a -e /sbin/consoletype ]; then
+ CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)"
+ else
+ CONSOLETYPE="serial"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb
new file mode 100644
index 000000000..727305015
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb
@@ -0,0 +1,33 @@
+SUMMARY = "SysV init scripts which are only used in an LSB image"
+SECTION = "base"
+LICENSE = "GPLv2"
+DEPENDS = "popt glib-2.0"
+
+RDEPENDS_${PN} += "util-linux"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
+
+S="${WORKDIR}/initscripts-${PV}"
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/initscripts/initscripts-${PV}.tar.bz2/9cce2ae1009750e84be37c09a028757e/initscripts-${PV}.tar.bz2 \
+ file://functions.patch \
+ file://0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch \
+ "
+
+SRC_URI[md5sum] = "9cce2ae1009750e84be37c09a028757e"
+SRC_URI[sha256sum] = "48b59ce8157cfc58bbd4b1dfa58ad1087245761ae11c2033b66ae3864ea7e1cf"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "functions"
+ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions"
+
+# Since we are only taking the patched version of functions, no need to
+# configure or compile anything so do not execute these
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install(){
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0644 ${S}/rc.d/init.d/functions ${D}${sysconfdir}/init.d/functions
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
new file mode 100644
index 000000000..b9971a17d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
@@ -0,0 +1,526 @@
+#!/bin/sh
+
+# Copyright (C) 2012 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+WORK_DIR="/opt/lsb-test"
+
+if [ `id -u` -ne 0 ]
+then
+ cat << EOF
+ In order to install and run LSB testsuite, you need administrator privileges.
+ You are currently running this script as an unprivileged user.
+
+EOF
+ exit 1
+fi
+
+ARCH=`uname -m`
+if [ ${ARCH} != "i686" ] && [ ${ARCH} != "x86_64" ] && [ ${ARCH} != "ppc" ] && [ ${ARCH} != "ppc64" ]
+then
+ echo "Error: Unsupported architecture"
+ exit 1
+fi
+
+which rpm
+if [ $? -ne 0 ]
+then
+ echo "No rpm command found"
+ exit 1
+fi
+
+RET=0
+
+cd ${WORK_DIR} || exit 1
+# Step 1: Download the LSB Packages
+echo ""
+echo "Download LSB packages..."
+echo ""
+
+if [ ! -e ./packages_list ]
+then
+ echo "Error: Could not find packages list" >&2
+ exit 1
+fi
+
+. ./packages_list
+
+PACKAGES_DIR="/var/opt/lsb/test/manager/packages/ftp.linuxfoundation.org/pub/lsb"
+
+BASE_PACKAGES_DIR="${PACKAGES_DIR}/base/${LSB_RELEASE}/binary"
+RUNTIME_BASE_PACKAGES_DIR="${PACKAGES_DIR}/test_suites/released-all/binary/runtime"
+RUNTIME_PACKAGES_DIR="${PACKAGES_DIR}/test_suites/${LSB_RELEASE}/binary/runtime"
+APP_PACKAGES_DIR="${PACKAGES_DIR}/app-battery/${LSB_RELEASE}/${LSB_ARCH}"
+APP_TESTFILES_DIR="${PACKAGES_DIR}/app-battery/tests"
+SNAPSHOTS_TESTFILES_DIR="${PACKAGES_DIR}/snapshots/appbat/tests"
+
+if [ ! -d ${PACKAGES_DIR} ]
+then
+ mkdir -p ${PACKAGES_DIR}
+fi
+
+if [ ! -d ${BASE_PACKAGES_DIR} ]
+then
+ mkdir -p ${BASE_PACKAGES_DIR}
+fi
+
+if [ ! -d ${RUNTIME_BASE_PACKAGES_DIR} ]
+then
+ mkdir -p ${RUNTIME_BASE_PACKAGES_DIR}
+fi
+
+if [ ! -d ${RUNTIME_PACKAGES_DIR} ]
+then
+ mkdir -p ${RUNTIME_PACKAGES_DIR}
+fi
+
+if [ ! -d ${APP_PACKAGES_DIR} ]
+then
+ mkdir -p ${APP_PACKAGES_DIR}
+fi
+
+if [ ! -d ${APP_TESTFILES_DIR} ]
+then
+ mkdir -p ${APP_TESTFILES_DIR}
+fi
+
+# Official download server list. You can replace them with your own server.
+SERVER_IPADDR="140.211.169.23"
+SERVER_NAME="ftp.linuxfoundation.org"
+
+if ! `grep -F -q "${SERVER_NAME}" /etc/hosts`; then
+ echo "${SERVER_IPADDR} ${SERVER_NAME} ${SERVER_NAME}" >> /etc/hosts
+fi
+
+#ping -c 5 ${SERVER_NAME}
+#if [ $? -ne 0 ]
+#then
+# echo "The server: ${SERVER_NAME} is unreachable"
+# exit 1
+#fi
+
+SERVER1="\
+ http://${SERVER_NAME}/pub/lsb/base/${LSB_RELEASE}/binary"
+SERVER2="\
+ http://${SERVER_NAME}/pub/lsb/test_suites/released-all/binary/runtime"
+SERVER3="\
+ http://${SERVER_NAME}/pub/lsb/test_suites/${LSB_RELEASE}/binary/runtime"
+SERVER4="\
+ http://${SERVER_NAME}/pub/lsb/app-battery/${LSB_RELEASE}/${LSB_ARCH}"
+SERVER5="\
+ http://${SERVER_NAME}/pub/lsb/app-battery/tests"
+
+# We using "curl" as a download tool, "wget" is an alternative.
+CURL=`which curl`
+WGET=`which wget`
+if [ ! -z ${CURL} ]
+then
+ DOWNLOAD_CMD="${CURL} -R -L -f --retry 3 --retry-delay 4 --connect-timeout 180 --compressed -C - -o"
+elif [ ! -z ${WGET} ]
+then
+ DOWNLOAD_CMD="${WGET} -c -t 5 -O"
+else
+ echo "Can not find a download tool, please install curl or wget."
+ exit 1
+fi
+
+cd ${BASE_PACKAGES_DIR}
+for pkg in ${BASE_PACKAGES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER1}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER1}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+cd ${RUNTIME_BASE_PACKAGES_DIR}
+for pkg in ${RUNTIME_BASE_PACKAGES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER2}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER2}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+cd ${RUNTIME_PACKAGES_DIR}
+for pkg in ${RUNTIME_PACKAGES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER3}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER3}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+cd ${APP_PACKAGES_DIR}
+for pkg in ${APP_PACKAGES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER4}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER4}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+cd ${APP_TESTFILES_DIR}
+for pkg in ${APP_TESTFILES_LIST}; do
+ if [ ! -f ${pkg} ]
+ then
+ #${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER5}/${pkg} > /dev/null 2>&1
+ ${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER5}/${pkg}
+ if [ $? -eq 0 ]
+ then
+ mv -f ${pkg}".#part" ${pkg}
+ echo "Download ${pkg} successfully."
+ else
+ echo "Download ${pkg} failed."
+ RET=1
+ fi
+ fi
+done
+
+if [ ${RET} -ne 0 ]
+then
+ echo "Download some packages failed. Please download them again."
+ exit 1
+fi
+
+# Step 2: Install the LSB Packages
+echo ""
+echo "Install LSB packages..."
+echo ""
+
+# Kill lighttpd
+ps aux | grep "lighttpd" | grep -v -q "grep"
+if [ $? -eq 0 ]
+then
+ killall lighttpd >/dev/null 2>&1
+fi
+
+# Start avahi-daemon
+ps aux | grep "avahi-daemon" | grep -v -q "grep"
+if [ $? -ne 0 ]
+then
+ /etc/init.d/avahi-daemon start >/dev/null 2>&1
+fi
+
+LSB_START_CMD="/opt/lsb/test/manager/bin/dist-checker-start.pl"
+LSB_STOP_CMD="/opt/lsb/test/manager/bin/dist-checker-stop.pl"
+
+PLATFORM_FILE="/etc/rpm/platform"
+
+RPM_INSTALL_CMD="rpm --quiet --nodeps --replacepkgs --nosignature -i"
+RPM_INSTALL_CMD_NOSCRIPTS="rpm --quiet --nodeps --replacepkgs --noscripts --nosignature -i"
+
+# If the lsb has been started, stop it first.
+if [ -x ${LSB_STOP_CMD} ]
+then
+ ${LSB_STOP_CMD}
+fi
+
+if [ ! -d /etc/rpm ]
+then
+ mkdir -p /etc/rpm
+fi
+
+if [ ! -f ${PLATFORM_FILE} ]
+then
+ touch ${PLATFORM_FILE}
+fi
+
+if ! `grep -F -q "noarch-suse" ${PLATFORM_FILE}`; then
+ if [ ${ARCH} = i686 ];then
+ echo "i486-suse" >> ${PLATFORM_FILE}
+ echo "i486-noarch" >> ${PLATFORM_FILE}
+ echo "i486-pc" >> ${PLATFORM_FILE}
+ echo "noarch-suse" >> ${PLATFORM_FILE}
+ elif [ ${ARCH} = x86_64 ]; then
+ echo "i486-suse" >> ${PLATFORM_FILE}
+ echo "i486-noarch" >> ${PLATFORM_FILE}
+ echo "i486-pc" >> ${PLATFORM_FILE}
+ echo "i486-.*-linux.*" >> ${PLATFORM_FILE}
+ echo "noarch-suse" >> ${PLATFORM_FILE}
+ echo "${ARCH}-suse" >> ${PLATFORM_FILE}
+ echo "${ARCH}-noarch" >> ${PLATFORM_FILE}
+ echo "${ARCH}-pc" >> ${PLATFORM_FILE}
+ else
+ echo "${ARCH}-suse" >> ${PLATFORM_FILE}
+ echo "${ARCH}-noarch" >> ${PLATFORM_FILE}
+ echo "${ARCH}-pc" >> ${PLATFORM_FILE}
+ echo "noarch-suse" >> ${PLATFORM_FILE}
+ fi
+fi
+
+if [ -d ${BASE_PACKAGES_DIR} ]
+then
+ cd ${BASE_PACKAGES_DIR}
+ for pkg in ${BASE_PACKAGES_LIST}
+ do
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD ${pkg}
+ fi
+ done
+fi
+
+if [ -d ${RUNTIME_BASE_PACKAGES_DIR} ]
+then
+ cd ${RUNTIME_BASE_PACKAGES_DIR}
+ for pkg in ${RUNTIME_BASE_PACKAGES_LIST}
+ do
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD ${pkg}
+ fi
+ done
+fi
+
+if [ -d ${RUNTIME_PACKAGES_DIR} ]
+then
+ cd ${RUNTIME_PACKAGES_DIR}
+ for pkg in ${RUNTIME_PACKAGES_LIST}
+ do
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD ${pkg}
+ fi
+ done
+fi
+
+if [ -d ${APP_PACKAGES_DIR} ]
+then
+ cd ${APP_PACKAGES_DIR}
+ for pkg in ${APP_PACKAGES_LIST}
+ do
+ echo "${pkg}" | grep -q "apache\|xpdf"
+ if [ $? -eq 0 ]
+ then
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD_NOSCRIPTS ${pkg}
+ fi
+ else
+ rpm --quiet -q ${pkg%\.*}
+ if [ $? -ne 0 ]; then
+ $RPM_INSTALL_CMD ${pkg}
+ fi
+ fi
+ done
+fi
+
+if [ ! -d ${SNAPSHOTS_TESTFILES_DIR} ]
+then
+ mkdir -p ${SNAPSHOTS_TESTFILES_DIR}
+fi
+
+if [ -d ${APP_TESTFILES_DIR} ]
+then
+ cd ${APP_TESTFILES_DIR}
+ for pkg in ${APP_TESTFILES_LIST}
+ do
+ cp -f ${pkg} ${SNAPSHOTS_TESTFILES_DIR}
+ done
+fi
+
+cd ${WORK_DIR}
+
+# Step 3: Set environment
+echo ""
+echo "Set environment..."
+echo ""
+
+check ()
+{
+ if [ $? -eq 0 ]
+ then
+ echo "PASS"
+ else
+ echo "FAIL"
+ exit 1
+ fi
+}
+
+echo ""
+echo "---------------------------------"
+echo "Create the Dirnames on target"
+
+if [ ! -d /etc/rpm/sysinfo ]
+then
+ mkdir -p /etc/rpm/sysinfo
+fi
+
+cat > /etc/rpm/sysinfo/Dirnames << EOF
+/etc/opt/lsb
+/home/tet/LSB.tools
+/opt/lsb-tet3-lite/lib/ksh
+/opt/lsb-tet3-lite/lib/perl
+/opt/lsb-tet3-lite/lib/posix_sh
+/opt/lsb-tet3-lite/lib/tet3
+/opt/lsb-tet3-lite/lib/xpg3sh
+/opt/lsb/appbat/lib/python2.4/site-packages/qm
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/external
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/external/DocumentTemplate
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/test
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/test/classes
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/test/web
+/opt/lsb/test/doc
+/opt/lsb/test/lib
+/opt/lsb/test/qm/diagnostics
+/opt/lsb/test/qm/doc
+/opt/lsb/test/qm/doc/test/html
+/opt/lsb/test/qm/doc/test/print
+/opt/lsb/test/qm/dtml
+/opt/lsb/test/qm/dtml/test
+/opt/lsb/test/qm/messages/test
+/opt/lsb/test/qm/tutorial/test/tdb
+/opt/lsb/test/qm/tutorial/test/tdb/QMTest
+/opt/lsb/test/qm/web
+/opt/lsb/test/qm/web/images
+/opt/lsb/test/qm/web/stylesheets
+/opt/lsb/test/qm/xml
+/opt/lsb/test/share
+/usr/share/doc/lsb-runtime-test
+/var/opt/lsb
+/opt/lsb/test/desktop
+/opt/lsb/test/desktop/fontconfig
+/opt/lsb/test/desktop/freetype
+/opt/lsb/test/desktop/gtkvts
+/opt/lsb/test/desktop/libpng
+/opt/lsb/test/desktop/qt3
+/opt/lsb/test/desktop/xft
+/opt/lsb/test/desktop/xml
+/opt/lsb/test/desktop/xrender
+
+
+EOF
+
+if [ -f /etc/rpm/sysinfo/Dirnames ]
+then
+ echo "Success to creat Dirnames file"
+else
+ echo "Fail to creat Dirnames file"
+fi
+
+[ -x /sbin/ldconfig ] && {
+echo ""
+echo "---------------------------------"
+echo "Update cache"
+/sbin/ldconfig
+check;
+}
+
+# Check loop device
+if [ ! -b /dev/loop0 ]
+then
+ insmod /lib/modules/`uname -r`/kernel/drivers/block/loop.ko
+ if [ $? != 0 ];then
+ echo "Insmod loop.ko failed."
+ fi
+fi
+
+# Resolve localhost
+LOCALHOST=`hostname`
+if ! `grep -F -q "$LOCALHOST" /etc/hosts`; then
+ echo "127.0.0.1 $LOCALHOST" >> /etc/hosts
+fi
+
+# Workaround to add part of locales for LSB test
+localedef -i de_DE -f ISO-8859-1 de_DE
+localedef -i de_DE -f ISO-8859-15 de_DE.ISO-8859-15
+localedef -i de_DE -f UTF-8 de_DE.UTF-8
+localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
+localedef -i en_HK -f ISO-8859-1 en_HK
+localedef -i en_PH -f ISO-8859-1 en_PH
+localedef -i en_US -f ISO-8859-15 en_US.ISO-8859-15
+localedef -i en_US -f ISO-8859-1 en_US.ISO-8859-1
+localedef -i en_US -f ISO-8859-1 en_US
+localedef -i en_US -f UTF-8 en_US.UTF-8
+localedef -i en_US -f ISO-8859-1 en_US.ISO8859-1
+localedef -i es_MX -f ISO-8859-1 es_MX
+localedef -i fr_FR -f ISO-8859-1 fr_FR
+localedef -i it_IT -f ISO-8859-1 it_IT
+localedef -i ja_JP -f EUC-JP ja_JP.eucjp
+localedef -i se_NO -f UTF-8 se_NO.UTF-8
+localedef -i ta_IN -f UTF-8 ta_IN
+localedef -i es_ES -f ISO-8859-1 es_ES
+localedef -i fr_FR@euro -f ISO-8859-1 fr_FR@euro
+localedef -i is_IS -f UTF-8 is_IS.UTF-8
+localedef -i zh_TW -f BIG5 zh_TW.BIG5
+localedef -i en_US -f ISO-8859-15 en_US.ISO-8859-15
+
+echo ""
+echo "Installation done!"
+echo ""
+
+# Step 4: Start LSB test
+if [ -x ${LSB_START_CMD} ]
+then
+ ${LSB_START_CMD}
+fi
+
+echo "---------------------------------"
+echo "Run all the certification version of LSB Tests"
+echo "---------------------------------"
+
+LSB_DIST_CHECKER="/opt/lsb/test/manager/utils/dist-checker.pl"
+SESSION="${WORK_DIR}/session"
+if [ ! -e ${SESSION} ]
+then
+ echo "Error: Could not find session file."
+ echo "You must run LSB test from webbrower."
+ exit 1
+fi
+
+if [ -x ${LSB_DIST_CHECKER} ]
+then
+ ${LSB_DIST_CHECKER} -v2 -f ${SESSION}
+ check
+fi
+
+echo ""
+echo "LSB test complete. Please check the log file in /var/opt/lsb/test/manager/results/"
+echo ""
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/packages_list b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/packages_list
new file mode 100644
index 000000000..27d8352d9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/packages_list
@@ -0,0 +1,50 @@
+LSB_RELEASE="released-4.1.0"
+LSB_ARCH="lsbarch"
+
+BASE_PACKAGES_LIST="lsb-setup-4.1.0-1.noarch.rpm"
+
+RUNTIME_BASE_PACKAGES_LIST="lsb-dist-checker-5.0.0.1-1.targetarch.rpm \
+ lsb-tet3-lite-3.7-27.lsb5.targetarch.rpm \
+ lsb-tet3-lite-devel-3.7-27.lsb5.targetarch.rpm \
+ lsb-xvfb-1.2.0-22.targetarch.rpm \
+ "
+
+RUNTIME_PACKAGES_LIST="lsb-cmdchk-4.1.4-5.targetarch.rpm \
+ lsb-libchk-4.1.4-5.targetarch.rpm \
+ lsb-qm-2.2-12.lsb4.targetarch.rpm \
+ lsb-task-dist-testkit-4.1.9-1.noarch.rpm \
+ lsb-test-core-4.1.15-1.targetarch.rpm \
+ lsb-test-cpp-t2c-4.1.0-1.targetarch.rpm \
+ lsb-test-desktop-4.1.9-1.targetarch.rpm \
+ lsb-test-desktop-t2c-4.1.3-3.targetarch.rpm \
+ lsb-test-libstdcpp-4.1.0-18.lsb4.targetarch.rpm \
+ lsb-test-olver-core-4.1.4-1.targetarch.rpm \
+ lsb-test-perl-4.1.8-1.noarch.rpm \
+ lsb-test-printing-4.1.2-1.targetarch.rpm \
+ lsb-test-python-4.1.5-1.targetarch.rpm \
+ lsb-test-qt3-azov-4.1.1-3.targetarch.rpm \
+ lsb-test-qt4-azov-4.1.3-1.targetarch.rpm \
+ lsb-test-xts5-5.1.5-45.lsb4.targetarch.rpm \
+ lsb-test-alsa-t2c-4.1.0-1.targetarch.rpm \
+ lsb-test-core-t2c-4.1.2-3.targetarch.rpm \
+ lsb-test-xml2-azov-4.1.0-1.targetarch.rpm \
+ "
+
+APP_PACKAGES_LIST="lsb-python-2.4.6-7.lsb4.targetarch.rpm \
+ lsb-apache-2.2.14-8.lsb4.targetarch.rpm \
+ lsb-tcl-8.5.7-8.lsb4.targetarch.rpm \
+ lsb-expect-5.43.0-13.lsb4.targetarch.rpm \
+ lsb-groff-1.20.1-7.lsb4.targetarch.rpm \
+ lsb-raptor-1.4.19-5.lsb4.targetarch.rpm \
+ lsb-xpdf-1.01-14.lsb4.targetarch.rpm \
+ lsb-samba-3.4.3-9.lsb4.targetarch.rpm \
+ lsb-rsync-3.0.6-6.lsb4.targetarch.rpm \
+ "
+
+APP_TESTFILES_LIST="expect-tests.tar \
+ tcl-tests.tar \
+ raptor-tests.tar \
+ test1.pdf \
+ test2.pdf \
+ "
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/session b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/session
new file mode 100644
index 000000000..85ca2efe9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest/session
@@ -0,0 +1,194 @@
+[GENERAL]
+VERBOSE_LEVEL: 1
+ARCHITECTURE: targetarch
+USE_INTERNET: 1
+STD_VERSION: LSB 4.1
+STD_PROFILE: no
+[cmdchk]
+RUN: 1
+VERSION: local|*
+
+[libchk]
+RUN: 1
+VERSION: local|*
+
+[alsa-t2c]
+RUN: 1
+VERSION: local|*
+
+[alsa-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/alsa-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/alsa-t2c/results
+
+[core]
+RUN: 1
+VERSION: local|*
+
+[core|local|*]
+AUTOREPLY_PROVIDES_BASH: n
+AUTOREPLY_TESTRUN_PATH: /home/tet/test_sets
+AUTOREPLY_PERSON: Automated
+AUTOREPLY_KERNEL_NAME: vmlinuz
+AUTOREPLY_INSTALL_LSBPAM_CONF: y
+AUTOREPLY_PROVIDES_C_SHELL: n
+AUTOREPLY_ORGANISATION: N/A
+AUTOREPLY_SET_PASS_MIN_DAYS: y
+AUTOREPLY_PROVIDES_SYSV_INIT:
+AUTOREPLY_ISNTALL_DEVS: y
+AUTOREPLY_SUPPORTS_FILE_CMD: y
+AUTOREPLY_TEST_SYSTEM: Distribution Checker
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/core/tet/test_sets
+AUTOREPLY_SUPPORTS_NLS: n
+AUTOREPLY_SUPPORTS_PROCESS_ACCOUNTING: n
+AUTOREPLY_PATH_TO_RC.D:
+AUTOREPLY_ALLOWS_MAKEDEV: n
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/core/tet/test_sets/results
+
+[core-t2c]
+RUN: 1
+VERSION: local|*
+
+[core-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/core-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/core-t2c/results
+
+[cpp-t2c]
+RUN: 1
+VERSION: local|*
+
+[cpp-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/cpp-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/cpp-t2c/results
+
+[desktop]
+RUN: 1
+VERSION: local|*
+
+[desktop|local|*]
+AUTOREPLY_DESKTOP_ENVIRONMENT: [default]
+AUTOREPLY_PERSON: Automated
+AUTOREPLY_X_CLIENT_HOSTNAME:
+AUTOREPLY_TEST_SYSTEM: Distribution Checker
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/desktop
+AUTOREPLY_X11_FONT_PATH: [default]
+AUTOREPLY_SHOW_SUMMARY_REPORT:
+AUTOREPLY_ORGANISATION: N/A
+AUTOREPLY_XVFB_DISPLAY: [default]
+
+[desktop-t2c]
+RUN: 1
+VERSION: local|*
+
+[desktop-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/desktop-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/desktop-t2c/results
+
+[libstdcpp]
+RUN: 1
+VERSION: local|*
+
+[libstdcpp|local|*]
+AUTOREPLY_TEST_SYSTEM: Distribution Checker
+AUTOREPLY_PERSON: Automated
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/libstdcpp_4.1.0
+AUTOREPLY_ORGANISATION: N/A
+AUTOREPLY_GNU_TRIPLET:
+
+[olver]
+RUN: 1
+VERSION: local|*
+
+[olver|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/olver-core
+AUTOREPLY_RESULTS_DIR: /var/opt/lsb/test/olver-core
+
+[perl]
+RUN: 1
+VERSION: local|*
+
+[perl|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/perl
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/perl/results
+
+[printing]
+RUN: 1
+VERSION: local|*
+
+[printing|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/printing
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/printing/results
+
+[python]
+RUN: 1
+VERSION: local|*
+
+[python|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/python
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/python/results
+
+[qt3-azov]
+RUN: 1
+VERSION: local|*
+
+[qt3-azov|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/qt3-azov
+AUTOREPLY_X11_FONT_PATH: [default]
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/qt3-azov/results
+
+[qt4-azov]
+RUN: 1
+VERSION: local|*
+
+[qt4-azov|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/qt4-azov
+AUTOREPLY_X11_FONT_PATH: [default]
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/qt4-azov/results
+
+[xml2-azov]
+RUN: 1
+VERSION: local|*
+
+[xts5]
+RUN: 1
+VERSION: local|*
+
+[xts5|local|*]
+AUTOREPLY_XT_FONTPATH_GOOD: [default]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/xts5
+AUTOREPLY_XVFB_DISPLAY: [default]
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/xts5/xts5/results
+AUTOREPLY_XT_FONTPATH: [default]
+AUTOREPLY_X_CLIENT_HOSTNAME:
+
+[apache]
+RUN: 1
+VERSION: local|*
+
+[expect]
+RUN: 1
+VERSION: local|*
+
+[groff]
+RUN: 1
+VERSION: local|*
+
+[raptor]
+RUN: 1
+VERSION: local|*
+
+[rsync]
+RUN: 1
+VERSION: local|*
+
+[samba]
+RUN: 1
+VERSION: local|*
+
+[tcl]
+RUN: 1
+VERSION: local|*
+
+[xpdf]
+RUN: 1
+VERSION: local|*
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest_1.0.bb b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest_1.0.bb
new file mode 100644
index 000000000..ea12502dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsb/lsbtest_1.0.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Automates Linux Standard Base (LSB) tests"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://LSB_Test.sh;beginline=3;endline=16;md5=7063bb54b04719df0716b513447f4fc0"
+
+SRC_URI = "file://LSB_Test.sh \
+ file://packages_list \
+ file://session \
+ "
+RDEPENDS_${PN} = "rpm"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/LSB_Test.sh ${D}${bindir}
+ install -d ${D}/opt/lsb-test
+ install -m 0644 ${S}/packages_list ${D}/opt/lsb-test/packages_list
+ install -m 0644 ${S}/session ${D}/opt/lsb-test/session
+ if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+ sed -i -e 's/lsbarch/ia32/g' -e 's/targetarch/i486/g' ${D}/opt/lsb-test/packages_list
+ sed -i -e 's/targetarch/x86/g' ${D}/opt/lsb-test/session
+ fi
+ if [ "${TARGET_ARCH}" = "x86_64" ];then
+ sed -i -e 's/lsbarch/amd64/g' -e 's/targetarch/x86_64/g' ${D}/opt/lsb-test/packages_list
+ sed -i -e 's/targetarch/x86-64/g' ${D}/opt/lsb-test/session
+ fi
+ if [ "${TARGET_ARCH}" = "powerpc" ];then
+ sed -i -e 's/lsbarch/ppc32/g' -e 's/targetarch/ppc/g' ${D}/opt/lsb-test/packages_list
+ sed -i -e 's/targetarch/PPC32/g' ${D}/opt/lsb-test/session
+ fi
+
+ # For a ppc64 target. the default userspace is 32b.
+ # Therefore, only change the lsbarch and targetarch
+ # in the package_list when MLIB=lib64 is being used.
+ # Otherwise, by default, the ppc32 LSB packages
+ # will be downloaded by LSB_Test.sh
+ if [ "${TARGET_ARCH}" = "powerpc64" ];then
+ if [ "${PN}" != "${BPN}" ];then
+ sed -i -e 's/lsbarch/ppc64/g' -e 's/targetarch/ppc64/g' ${D}/opt/lsb-test/packages_list
+ sed -i -e 's/targetarch/PPC64/g' ${D}/opt/lsb-test/session
+ fi
+ fi
+}
+
+FILES_${PN} += "/opt/lsb-test/* \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-extended/lsof/lsof_4.89.bb b/import-layers/yocto-poky/meta/recipes-extended/lsof/lsof_4.89.bb
new file mode 100644
index 000000000..c10337beb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/lsof/lsof_4.89.bb
@@ -0,0 +1,60 @@
+SUMMARY = "LiSt Open Files tool"
+DESCRIPTION = "Lsof is a Unix-specific diagnostic tool. \
+Its name stands for LiSt Open Files, and it does just that."
+SECTION = "devel"
+LICENSE = "BSD"
+
+SRC_URI = "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "1b9cd34f3fb86856a125abbf2be3a386"
+SRC_URI[sha256sum] = "81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718"
+
+UPSTREAM_CHECK_URI = "http://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof"
+
+LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar"
+S = "${WORKDIR}/lsof_${PV}_src"
+
+LIC_FILES_CHKSUM = "file://${S}/00README;beginline=645;endline=679;md5=964df275d26429ba3b39dbb9f205172a"
+
+python do_unpack () {
+ # temporarily change S for unpack
+ # of lsof_${PV}
+ s = d.getVar('S', False)
+ d.setVar('S', '${WORKDIR}/lsof_${PV}')
+ bb.build.exec_func('base_do_unpack', d)
+ # temporarily change SRC_URI for unpack
+ # of lsof_${PV}_src
+ src_uri = d.getVar('SRC_URI', False)
+ d.setVar('SRC_URI', '${LOCALSRC}')
+ d.setVar('S', s)
+ bb.build.exec_func('base_do_unpack', d)
+ d.setVar('SRC_URI', src_uri)
+}
+
+export LSOF_INCLUDE = "${STAGING_INCDIR}"
+
+do_configure () {
+ export LSOF_AR="${AR} cr"
+ export LSOF_RANLIB="${RANLIB}"
+ if [ "x${GLIBCVERSION}" != "x" ];then
+ LINUX_CLIB=`echo ${GLIBCVERSION} |sed -e 's,\.,,g'`
+ LINUX_CLIB="-DGLIBCV=${LINUX_CLIB}"
+ export LINUX_CLIB
+ fi
+ yes | ./Configure linux
+}
+
+export I = "${STAGING_INCDIR}"
+export L = "${STAGING_INCDIR}"
+
+EXTRA_OEMAKE = ""
+
+do_compile () {
+ oe_runmake 'CC=${CC}' 'CFGL=${LDFLAGS} -L./lib -llsof' 'DEBUG=' 'INCL=${CFLAGS}'
+}
+
+do_install () {
+ install -d ${D}${sbindir} ${D}${mandir}/man8
+ install -m 4755 lsof ${D}${sbindir}/lsof
+ install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
new file mode 100644
index 000000000..585b7cbc6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0001-ltp-Don-t-link-against-libfl.patch
@@ -0,0 +1,30 @@
+From 14985fccf7428eaa0b45decc22bfd20fd780f621 Mon Sep 17 00:00:00 2001
+From: Chong Lu <Chong.Lu@windriver.com>
+Date: Tue, 11 Mar 2014 14:47:22 +0800
+Subject: [PATCH 01/32] ltp: Don't link against libfl
+
+We have already defined yywrap function in scan.l file. After this, we no longer need to
+link against libfl and so no longer get errors about undefined references to yylex.
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ pan/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pan/Makefile b/pan/Makefile
+index 4cc6466..a4b575b 100644
+--- a/pan/Makefile
++++ b/pan/Makefile
+@@ -31,7 +31,7 @@ CPPFLAGS += -Wno-error
+
+ CPPFLAGS += -I$(abs_srcdir)
+
+-LDLIBS += -lm $(LEXLIB)
++LDLIBS += -lm
+
+ LFLAGS += -l
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch
new file mode 100644
index 000000000..68725dc7a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0002-Add-knob-to-control-whether-numa-support-should-be-c.patch
@@ -0,0 +1,43 @@
+From 867ad5d5d64b9b27ee32148027532db0a00f6433 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Thu, 7 Jan 2016 17:33:26 +0000
+Subject: [PATCH 02/32] Add knob to control whether numa support should be
+ checked
+
+otherwise undeterministic dependency will be generated
+during build depending upong numa being staged or not
+
+signed-off-by: Roy.Li <rongqing.li@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ m4/ltp-numa.m4 | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4
+index 60ae07b..ed7078d 100644
+--- a/m4/ltp-numa.m4
++++ b/m4/ltp-numa.m4
+@@ -24,7 +24,13 @@ dnl ----------------------------
+ dnl
+ AC_DEFUN([LTP_CHECK_SYSCALL_NUMA],
+ [dnl
+-AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
++AC_MSG_CHECKING([for numa])
++AC_ARG_WITH(
++ [numa],
++ AC_HELP_STRING([--without-numa],
++ [without numa support]),
++ [],
++ [AC_CHECK_HEADERS([linux/mempolicy.h numa.h numaif.h],[
+ LTP_SYSCALL_NUMA_HEADERS=yes
+ AC_CHECK_LIB(numa,numa_alloc_onnode,[have_numa_alloc_onnode="yes"])
+ if test "x$have_numa_alloc_onnode" = "xyes"; then
+@@ -48,3 +54,5 @@ if test "x$have_mpol_constants" = "xyes"; then
+ AC_DEFINE(HAVE_MPOL_CONSTANTS,1,[define to 1 if you have all constants required to use mbind tests])
+ fi
+ )])
++AC_MSG_RESULT([$with_numa])
++])
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch
new file mode 100644
index 000000000..bf1176fc4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0003-Add-knob-to-control-tirpc-support.patch
@@ -0,0 +1,45 @@
+From b193011da301b3d944e8fddcf4817513c31c5b88 Mon Sep 17 00:00:00 2001
+From: Fathi Boudra <fathi.boudra@linaro.org>
+Date: Thu, 7 Jan 2016 17:36:19 +0000
+Subject: [PATCH 03/32] Add knob to control tirpc support
+
+allow to disable tirpc. Helps to disable it at top level for eg. musl it
+does not yet work.
+
+Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index cc50397..9e2936b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -98,6 +98,13 @@ if test "x$with_python" = xyes; then
+ else
+ AC_SUBST([WITH_PYTHON],["no"])
+ fi
++
++# TI RPC
++AC_ARG_WITH([tirpc],
++ AC_HELP_STRING([--without-tirpc],
++ [without libtirpc support]),
++ [],[with_tirpc=yes],
++)
+ # END tools knobs
+
+ # Testsuites knobs
+@@ -169,7 +176,9 @@ LTP_CHECK_RENAMEAT2
+ LTP_CHECK_FALLOCATE
+ LTP_CHECK_SYSCALL_FCNTL
+ LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
++if test "x$with_tirpc" = xyes; then
+ LTP_CHECK_TIRPC
++fi
+ LTP_CHECK_TEE
+ LTP_CHECK_SPLICE
+ LTP_CHECK_VMSPLICE
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
new file mode 100644
index 000000000..2de936304
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0004-build-Add-option-to-select-libc-implementation.patch
@@ -0,0 +1,147 @@
+From 53acddddf1b324e06af886ee4639b774e5c8c8bc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 18:19:03 +0000
+Subject: [PATCH 04/32] build: Add option to select libc implementation
+
+There are more than glibc for C library implementation available on
+linux now a days, uclibc cloaked like glibc but musl e.g. is very
+different and does not implement all GNU extentions
+
+Disable tests specifically not building _yet_ on musl based systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 5 +++++
+ testcases/kernel/Makefile | 5 ++++-
+ testcases/kernel/sched/Makefile | 4 +++-
+ testcases/kernel/syscalls/Makefile | 5 +++++
+ testcases/network/nfsv4/acl/Makefile | 4 ++++
+ testcases/network/rpc/basic_tests/Makefile | 5 +++++
+ testcases/realtime/func/pi-tests/Makefile | 4 ++++
+ testcases/realtime/stress/pi-tests/Makefile | 5 +++++
+ 8 files changed, 35 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 297f8e7..906b280 100644
+--- a/Makefile
++++ b/Makefile
+@@ -49,6 +49,11 @@ SKIP_IDCHECK ?= 0
+ UCLINUX ?= 0
+ export UCLINUX
+
++# System C library implementation (glibc,uclibc,musl etc.)
++# default to glibc if not set
++LIBC ?= glibc
++export LIBC
++
+ # CLEAN_TARGETS: Targets which exist solely in clean.
+ # COMMON_TARGETS: Targets which exist in all, clean, and install.
+ # INSTALL_TARGETS: Targets which exist in clean and install (contains
+diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
+index 50a12fa..4f1987f 100644
+--- a/testcases/kernel/Makefile
++++ b/testcases/kernel/Makefile
+@@ -47,13 +47,16 @@ SUBDIRS += connectors \
+ logging \
+ mem \
+ numa \
+- pty \
+ sched \
+ security \
+ timers \
+ tracing \
+ module \
+
++ifneq ($(LIBC),musl)
++SUBDIRS += pty
++endif
++
+ ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
+ SUBDIRS += power_management
+ endif
+diff --git a/testcases/kernel/sched/Makefile b/testcases/kernel/sched/Makefile
+index 6245ed0..aa4eb7f 100644
+--- a/testcases/kernel/sched/Makefile
++++ b/testcases/kernel/sched/Makefile
+@@ -23,5 +23,7 @@
+ top_srcdir ?= ../../..
+
+ include $(top_srcdir)/include/mk/env_pre.mk
+-
++ifeq ($(LIBC),musl)
++ FILTER_OUT_DIRS += process_stress
++endif
+ include $(top_srcdir)/include/mk/generic_trunk_target.mk
+diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
+index 8acb395..b749126 100644
+--- a/testcases/kernel/syscalls/Makefile
++++ b/testcases/kernel/syscalls/Makefile
+@@ -28,5 +28,10 @@ ifeq ($(UCLINUX),1)
+ FILTER_OUT_DIRS += capget capset chmod chown clone fork getcontext llseek \
+ mincore mprotect nftw profil remap_file_pages sbrk
+ endif
++ifeq ($(LIBC),musl)
++FILTER_OUT_DIRS += confstr fmtmsg getcontext ioctl mallopt profil \
++ rt_sigsuspend setdomainname sethostname sigsuspend \
++ ustat
++endif
+
+ include $(top_srcdir)/include/mk/generic_trunk_target.mk
+diff --git a/testcases/network/nfsv4/acl/Makefile b/testcases/network/nfsv4/acl/Makefile
+index 8bc78c2..c36cf50 100644
+--- a/testcases/network/nfsv4/acl/Makefile
++++ b/testcases/network/nfsv4/acl/Makefile
+@@ -26,4 +26,8 @@ include $(top_srcdir)/include/mk/env_pre.mk
+
+ LDLIBS += $(ACL_LIBS)
+
++ifeq ($(LIBC),musl)
++FILTER_OUT_MAKE_TARGETS := acl1
++endif
++
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+diff --git a/testcases/network/rpc/basic_tests/Makefile b/testcases/network/rpc/basic_tests/Makefile
+index 3160813..9bdf5d0 100644
+--- a/testcases/network/rpc/basic_tests/Makefile
++++ b/testcases/network/rpc/basic_tests/Makefile
+@@ -23,4 +23,9 @@
+ top_srcdir ?= ../../../..
+
+ include $(top_srcdir)/include/mk/env_pre.mk
++
++ifeq ($(LIBC),musl)
++FILTER_OUT_DIRS += rpc01
++endif
++
+ include $(top_srcdir)/include/mk/generic_trunk_target.mk
+diff --git a/testcases/realtime/func/pi-tests/Makefile b/testcases/realtime/func/pi-tests/Makefile
+index 7a7a57a..5808866 100644
+--- a/testcases/realtime/func/pi-tests/Makefile
++++ b/testcases/realtime/func/pi-tests/Makefile
+@@ -27,5 +27,9 @@ include $(top_srcdir)/include/mk/env_pre.mk
+ include $(abs_srcdir)/../../config.mk
+
+ MAKE_TARGETS := testpi-0 testpi-1 testpi-2 testpi-4 testpi-5 testpi-6 testpi-7 sbrk_mutex
++ifeq ($(LIBC),musl)
++FILTER_OUT_MAKE_TARGETS := testpi-5 testpi-6 sbrk_mutex
++endif
++
+
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+diff --git a/testcases/realtime/stress/pi-tests/Makefile b/testcases/realtime/stress/pi-tests/Makefile
+index 5edc3b4..aa5987a 100644
+--- a/testcases/realtime/stress/pi-tests/Makefile
++++ b/testcases/realtime/stress/pi-tests/Makefile
+@@ -24,4 +24,9 @@ top_srcdir ?= ../../../..
+
+ include $(top_srcdir)/include/mk/env_pre.mk
+ include $(abs_srcdir)/../../config.mk
++
++ifeq ($(LIBC),musl)
++FILTER_OUT_MAKE_TARGETS := testpi-3
++endif
++
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch
new file mode 100644
index 000000000..8dab1ed2e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch
@@ -0,0 +1,45 @@
+From 6e3058521b50d91d4b0569c4d491c5af5ff798b2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 18:22:38 +0000
+Subject: [PATCH 05/32] kernel/controllers: Link with libfts explicitly on musl
+
+musl does not implement fts like glibc and therefore it depends on
+external implementation for all fts APIs
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/controllers/Makefile.inc | 3 +++
+ testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc
+index b106283..ef5fc0c 100644
+--- a/testcases/kernel/controllers/Makefile.inc
++++ b/testcases/kernel/controllers/Makefile.inc
+@@ -36,6 +36,9 @@ MAKE_DEPS := $(LIB)
+ CPPFLAGS += -I$(abs_srcdir)/../$(LIBDIR)
+
+ LDFLAGS += -L$(abs_builddir)/../$(LIBDIR)
++ifeq ($(LIBC),musl)
++LDLIBS += -lfts
++endif
+
+ INSTALL_TARGETS ?= *.sh
+
+diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc
+index 9e002f4..e0fcb9c 100644
+--- a/testcases/kernel/controllers/cpuset/Makefile.inc
++++ b/testcases/kernel/controllers/cpuset/Makefile.inc
+@@ -42,6 +42,9 @@ MAKE_DEPS := $(LIBCONTROLLERS) $(LIBCPUSET)
+ LDFLAGS += -L$(abs_builddir)/$(LIBCPUSET_DIR) -L$(abs_builddir)/$(LIBCONTROLLERS_DIR)
+
+ LDLIBS += -lcpu_set -lcontrollers -lltp
++ifeq ($(LIBC),musl)
++LDLIBS += -lfts
++endif
+
+ INSTALL_TARGETS ?= *.sh
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
new file mode 100644
index 000000000..56a48abcc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0006-sendfile-Use-off64_t-instead-of-__off64_t.patch
@@ -0,0 +1,31 @@
+From fb8b895385a641d74f2186fe5f20a872209692ed Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 18:24:20 +0000
+Subject: [PATCH 06/32] sendfile: Use off64_t instead of __off64_t
+
+__off64_t is specific to glibc where as off64_t is widely available
+Add _GNU_SOURCE for off64_t defines from sys/types.h
+Fixes
+<command-line>:0:7: error: unknown type name 'off64_t'
+sendfile02.c:97:18: note: in expansion of macro 'OFF_T'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/sendfile/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/syscalls/sendfile/Makefile b/testcases/kernel/syscalls/sendfile/Makefile
+index df7b63f..1bd1b57 100644
+--- a/testcases/kernel/syscalls/sendfile/Makefile
++++ b/testcases/kernel/syscalls/sendfile/Makefile
+@@ -21,6 +21,6 @@ top_srcdir ?= ../../../..
+ include $(top_srcdir)/include/mk/testcases.mk
+ include $(abs_srcdir)/../utils/newer_64.mk
+
+-%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t
++%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=off64_t -D_GNU_SOURCE
+
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
new file mode 100644
index 000000000..4be906ec7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0007-replace-SIGCLD-with-SIGCHLD.patch
@@ -0,0 +1,394 @@
+From 405c03171e4bf0edd698cb602cf7bd7fe1d0401a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:33:53 +0000
+Subject: [PATCH 07/32] replace SIGCLD with SIGCHLD
+
+its defined to use SIGCHLD anyway in
+
+bits/signum.h:#define SIGCLD SIGCHLD /* Same as SIGCHLD
+(System V). */
+
+plus it helps these tests compile with musl which adheres to posix
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/tst_sig.c | 8 ++++----
+ testcases/kernel/connectors/pec/pec_listener.c | 1 +
+ testcases/kernel/fs/doio/doio.c | 4 ++--
+ testcases/kernel/fs/doio/growfiles.c | 2 +-
+ testcases/kernel/syscalls/fcntl/fcntl11.c | 8 ++++----
+ testcases/kernel/syscalls/fcntl/fcntl17.c | 8 ++++----
+ testcases/kernel/syscalls/fcntl/fcntl19.c | 8 ++++----
+ testcases/kernel/syscalls/fcntl/fcntl20.c | 8 ++++----
+ testcases/kernel/syscalls/fcntl/fcntl21.c | 8 ++++----
+ testcases/kernel/syscalls/kill/kill02.c | 6 +++---
+ testcases/kernel/syscalls/kill/kill12.c | 8 ++++----
+ testcases/kernel/syscalls/mkdir/mkdir09.c | 12 ++++++------
+ testcases/kernel/syscalls/sighold/sighold02.c | 2 +-
+ testcases/network/tcp_cmds/perf_lan/pingpong.c | 2 +-
+ testcases/network/tcp_cmds/perf_lan/pingpong6.c | 2 +-
+ 15 files changed, 44 insertions(+), 43 deletions(-)
+
+diff --git a/lib/tst_sig.c b/lib/tst_sig.c
+index 3af5ffd..36565e1 100644
+--- a/lib/tst_sig.c
++++ b/lib/tst_sig.c
+@@ -49,7 +49,7 @@
+ fork_flag - set to FORK or NOFORK depending upon whether the
+ calling program executes a fork() system call. It
+ is normally the case that the calling program treats
+- SIGCLD as an expected signal if fork() is being used.
++ SIGCHLD as an expected signal if fork() is being used.
+
+ handler - a pointer to the unexpected signal handler to
+ be executed after an unexpected signal has been
+@@ -82,7 +82,7 @@ static void (*tst_setup_signal(int, void (*)(int))) (int);
+
+ /****************************************************************************
+ * tst_sig() : set-up to catch unexpected signals. fork_flag is set to NOFORK
+- * if SIGCLD is to be an "unexpected signal", otherwise it is set to
++ * if SIGCHLD is to be an "unexpected signal", otherwise it is set to
+ * FORK. cleanup points to a cleanup routine to be executed before
+ * tst_exit is called (cleanup is set to NULL if no cleanup is desired).
+ * handler is a pointer to the signal handling routine (if handler is
+@@ -117,7 +117,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
+ for (sig = 1; sig < NSIG; sig++) {
+ /*
+ * SIGKILL is never unexpected.
+- * SIGCLD is only unexpected when
++ * SIGCHLD is only unexpected when
+ * no forking is being done.
+ * SIGINFO is used for file quotas and should be expected
+ */
+@@ -205,7 +205,7 @@ void tst_sig(int fork_flag, void (*handler) (), void (*cleanup) ())
+ #endif
+ break;
+
+- case SIGCLD:
++ case SIGCHLD:
+ if (fork_flag == FORK)
+ continue;
+
+diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c
+index a1beb13..002750a 100644
+--- a/testcases/kernel/connectors/pec/pec_listener.c
++++ b/testcases/kernel/connectors/pec/pec_listener.c
+@@ -20,6 +20,7 @@
+ /* */
+ /******************************************************************************/
+
++#define _GNU_SOURCE
+ #include <sys/socket.h>
+ #include <sys/poll.h>
+ #include <sys/types.h>
+diff --git a/testcases/kernel/fs/doio/doio.c b/testcases/kernel/fs/doio/doio.c
+index 4b0dec5..5f65ef9 100644
+--- a/testcases/kernel/fs/doio/doio.c
++++ b/testcases/kernel/fs/doio/doio.c
+@@ -573,7 +573,7 @@ int main(int argc, char **argv)
+ case SIGTSTP:
+ case SIGSTOP:
+ case SIGCONT:
+- case SIGCLD:
++ case SIGCHLD:
+ case SIGBUS:
+ case SIGSEGV:
+ case SIGQUIT:
+@@ -615,7 +615,7 @@ int main(int argc, char **argv)
+ }
+
+ sigemptyset(&block_mask);
+- sigaddset(&block_mask, SIGCLD);
++ sigaddset(&block_mask, SIGCHLD);
+ sigprocmask(SIG_BLOCK, &block_mask, &omask);
+
+ /*
+diff --git a/testcases/kernel/fs/doio/growfiles.c b/testcases/kernel/fs/doio/growfiles.c
+index 09e7f35..bbad230 100644
+--- a/testcases/kernel/fs/doio/growfiles.c
++++ b/testcases/kernel/fs/doio/growfiles.c
+@@ -1640,7 +1640,7 @@ int set_sig(void)
+ #ifdef SIGRESTART
+ case SIGRESTART:
+ #endif /* SIGRESTART */
+- case SIGCLD:
++ case SIGCHLD:
+ break;
+
+ default:
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c
+index fa6ce53..2de2b6c 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl11.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl11.c
+@@ -105,10 +105,10 @@ void setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if ((sigaction(SIGCLD, &act, NULL)) < 0)
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if ((sigaction(SIGCHLD, &act, NULL)) < 0)
+ tst_brkm(TBROK | TERRNO, cleanup,
+- "sigaction(SIGCLD, ..) failed");
++ "sigaction(SIGCHLD, ..) failed");
+ }
+
+ void do_child(void)
+@@ -227,7 +227,7 @@ void stop_child(void)
+ {
+ struct flock fl;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ fl.l_type = STOP;
+ parent_put(&fl);
+ wait(0);
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl17.c b/testcases/kernel/syscalls/fcntl/fcntl17.c
+index 5b03e39..6598b20 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl17.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl17.c
+@@ -150,9 +150,9 @@ int setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if (sigaction(SIGCLD, &act, NULL) < 0) {
+- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if (sigaction(SIGCHLD, &act, NULL) < 0) {
++ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
+ return 1;
+ }
+ return 0;
+@@ -381,7 +381,7 @@ void stop_children(void)
+ {
+ int arg;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ arg = STOP;
+ child_free(child_pipe1[1], arg);
+ child_free(child_pipe2[1], arg);
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c
+index a542cfc..88c91d6 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl19.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl19.c
+@@ -112,9 +112,9 @@ void setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if ((sigaction(SIGCLD, &act, NULL)) < 0) {
+- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
++ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
+ fail = 1;
+ }
+ }
+@@ -265,7 +265,7 @@ void stop_child(void)
+ {
+ struct flock fl;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ fl.l_type = STOP;
+ parent_put(&fl);
+ wait(0);
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c
+index aa06bab..99fd783 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl20.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl20.c
+@@ -109,9 +109,9 @@ void setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if (sigaction(SIGCLD, &act, NULL) == -1)
+- tst_brkm(TFAIL | TERRNO, cleanup, "SIGCLD signal setup failed");
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if (sigaction(SIGCHLD, &act, NULL) == -1)
++ tst_brkm(TFAIL | TERRNO, cleanup, "SIGCHLD signal setup failed");
+ }
+
+ void cleanup(void)
+@@ -264,7 +264,7 @@ void stop_child(void)
+ {
+ struct flock fl;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ fl.l_type = STOP;
+ parent_put(&fl);
+ wait(0);
+diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c
+index 5307021..8f1a67c 100644
+--- a/testcases/kernel/syscalls/fcntl/fcntl21.c
++++ b/testcases/kernel/syscalls/fcntl/fcntl21.c
+@@ -110,9 +110,9 @@ void setup(void)
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = catch_child;
+ sigemptyset(&act.sa_mask);
+- sigaddset(&act.sa_mask, SIGCLD);
+- if ((sigaction(SIGCLD, &act, NULL)) < 0) {
+- tst_resm(TFAIL, "SIGCLD signal setup failed, errno: %d", errno);
++ sigaddset(&act.sa_mask, SIGCHLD);
++ if ((sigaction(SIGCHLD, &act, NULL)) < 0) {
++ tst_resm(TFAIL, "SIGCHLD signal setup failed, errno: %d", errno);
+ fail = 1;
+ }
+ }
+@@ -272,7 +272,7 @@ void stop_child(void)
+ {
+ struct flock fl;
+
+- signal(SIGCLD, SIG_DFL);
++ signal(SIGCHLD, SIG_DFL);
+ fl.l_type = STOP;
+ parent_put(&fl);
+ wait(0);
+diff --git a/testcases/kernel/syscalls/kill/kill02.c b/testcases/kernel/syscalls/kill/kill02.c
+index 9d6cc68..08360dd 100644
+--- a/testcases/kernel/syscalls/kill/kill02.c
++++ b/testcases/kernel/syscalls/kill/kill02.c
+@@ -701,7 +701,7 @@ void setup(void)
+
+ /*
+ * Set to catch unexpected signals.
+- * SIGCLD is set to be ignored because we do not wait for termination status.
++ * SIGCHLD is set to be ignored because we do not wait for termination status.
+ * SIGUSR1 is set to be ignored because this is the signal we are using for
+ * the test and we are not concerned with the parent getting it.
+ */
+@@ -713,9 +713,9 @@ void setup(void)
+ "signal(SIGUSR1, SIG_IGN) failed");
+ }
+
+- if (signal(SIGCLD, SIG_IGN) == SIG_ERR) {
++ if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) {
+ tst_brkm(TBROK | TERRNO, NULL,
+- "signal(SIGCLD, SIG_IGN) failed");
++ "signal(SIGCHLD, SIG_IGN) failed");
+ }
+
+ TEST_PAUSE;
+diff --git a/testcases/kernel/syscalls/kill/kill12.c b/testcases/kernel/syscalls/kill/kill12.c
+index 7a47a4a..d7c4147 100644
+--- a/testcases/kernel/syscalls/kill/kill12.c
++++ b/testcases/kernel/syscalls/kill/kill12.c
+@@ -98,7 +98,7 @@ int main(int argc, char **argv)
+
+ exno = 1;
+
+- if (sigset(SIGCLD, chsig) == SIG_ERR) {
++ if (sigset(SIGCHLD, chsig) == SIG_ERR) {
+ fprintf(temp, "\tsigset failed, errno = %d\n", errno);
+ fail_exit();
+ }
+@@ -128,7 +128,7 @@ int main(int argc, char **argv)
+ sleep(1);
+
+ kill(pid, sig); /* child should ignroe this sig */
+- kill(pid, SIGCLD); /* child should exit */
++ kill(pid, SIGCHLD); /* child should exit */
+
+ #ifdef BCS
+ while ((npid = wait(&status)) != pid
+@@ -222,14 +222,14 @@ void do_child(void)
+ int exno = 1;
+
+ #ifdef UCLINUX
+- if (sigset(SIGCLD, chsig) == SIG_ERR) {
++ if (sigset(SIGCHLD, chsig) == SIG_ERR) {
+ fprintf(temp, "\tsigset failed, errno = %d\n", errno);
+ fail_exit();
+ }
+ #endif
+
+ sigset(sig, SIG_IGN); /* set to ignore signal */
+- kill(getppid(), SIGCLD); /* tell parent we are ready */
++ kill(getppid(), SIGCHLD); /* tell parent we are ready */
+ while (!chflag)
+ sleep(1); /* wait for parent */
+
+diff --git a/testcases/kernel/syscalls/mkdir/mkdir09.c b/testcases/kernel/syscalls/mkdir/mkdir09.c
+index 41c20e9..07b4fb8 100644
+--- a/testcases/kernel/syscalls/mkdir/mkdir09.c
++++ b/testcases/kernel/syscalls/mkdir/mkdir09.c
+@@ -122,10 +122,10 @@ int main(int argc, char *argv[])
+
+ }
+
+- /* Set up to catch SIGCLD signal */
+- if (signal(SIGCLD, chld) == SIG_ERR) {
++ /* Set up to catch SIGCHLD signal */
++ if (signal(SIGCHLD, chld) == SIG_ERR) {
+ tst_brkm(TFAIL, cleanup,
+- "Error setting up SIGCLD signal, ERRNO = %d", errno);
++ "Error setting up SIGCHLD signal, ERRNO = %d", errno);
+
+ }
+
+@@ -236,9 +236,9 @@ int runtest(void)
+ tst_brkm(TFAIL, cleanup,
+ "Error resetting SIGTERM signal, ERRNO = %d", errno);
+ }
+- if (signal(SIGCLD, SIG_DFL) == SIG_ERR) {
++ if (signal(SIGCHLD, SIG_DFL) == SIG_ERR) {
+ tst_brkm(TFAIL, cleanup,
+- "Error resetting SIGCLD signal, ERRNO = %d", errno);
++ "Error resetting SIGCHLD signal, ERRNO = %d", errno);
+ }
+
+ if (test_time) {
+@@ -372,7 +372,7 @@ void term(int sig)
+
+ void chld(int sig)
+ {
+- /* Routine to handle SIGCLD signal. */
++ /* Routine to handle SIGCHLD signal. */
+
+ sigchld++;
+ if (jump) {
+diff --git a/testcases/kernel/syscalls/sighold/sighold02.c b/testcases/kernel/syscalls/sighold/sighold02.c
+index e3076fb..be01874 100644
+--- a/testcases/kernel/syscalls/sighold/sighold02.c
++++ b/testcases/kernel/syscalls/sighold/sighold02.c
+@@ -77,7 +77,7 @@ static int sigs_map[NUMSIGS];
+ static int skip_sig(int sig)
+ {
+ switch (sig) {
+- case SIGCLD:
++ case SIGCHLD:
+ case SIGKILL:
+ case SIGALRM:
+ case SIGSTOP:
+diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong.c b/testcases/network/tcp_cmds/perf_lan/pingpong.c
+index 1196312..5b06798 100644
+--- a/testcases/network/tcp_cmds/perf_lan/pingpong.c
++++ b/testcases/network/tcp_cmds/perf_lan/pingpong.c
+@@ -182,7 +182,7 @@ int main(int argc, char *argv[])
+
+ /* Setup traps */
+ signal(SIGINT, finish);
+- signal(SIGCLD, finish);
++ signal(SIGCHLD, finish);
+
+ /* Fork a child process to continue sending packets */
+ tst_resm(TINFO, "Create a child process to continue to send packets");
+diff --git a/testcases/network/tcp_cmds/perf_lan/pingpong6.c b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
+index 9747f58..0a0fb1d 100644
+--- a/testcases/network/tcp_cmds/perf_lan/pingpong6.c
++++ b/testcases/network/tcp_cmds/perf_lan/pingpong6.c
+@@ -153,7 +153,7 @@ char *argv[];
+
+ /* Setup traps */
+ signal(SIGINT, finish);
+- signal(SIGCLD, finish);
++ signal(SIGCHLD, finish);
+
+ /* Fork a child process to continue sending packets */
+ printf("Create a child process to continue to send packets \n");
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
new file mode 100644
index 000000000..d12307420
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
@@ -0,0 +1,285 @@
+From a3cbee31daae2466bc8dcac36b33a01352693346 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:40:08 +0000
+Subject: [PATCH 01/26] Check if __GLIBC_PREREQ is defined before using it
+
+__GLIBC_PREREQ is specific to glibc so it should be checked if it is
+defined or not.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ testcases/kernel/syscalls/accept4/accept4_01.c | 9 ++++-
+ testcases/kernel/syscalls/getcpu/getcpu01.c | 40 +++++++++++++++++++++-
+ .../sched_getaffinity/sched_getaffinity01.c | 26 ++++++++++++++
+ 3 files changed, 73 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c
+index 6072bfa..2b090cb 100644
+--- a/testcases/kernel/syscalls/accept4/accept4_01.c
++++ b/testcases/kernel/syscalls/accept4/accept4_01.c
+@@ -64,6 +64,7 @@ static void cleanup(void)
+ tst_rmdir();
+ }
+
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if !(__GLIBC_PREREQ(2, 10))
+ static int
+ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
+@@ -82,7 +83,6 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
+ }
+ tst_resm(TINFO, "\n");
+ #endif
+-
+ #if USE_SOCKETCALL
+ long args[6];
+
+@@ -97,6 +97,7 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags)
+ #endif
+ }
+ #endif
++#endif
+
+ static void
+ do_test(int lfd, struct sockaddr_in *conn_addr,
+@@ -119,9 +120,15 @@ do_test(int lfd, struct sockaddr_in *conn_addr,
+ die("Connect Error");
+
+ addrlen = sizeof(struct sockaddr_in);
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if !(__GLIBC_PREREQ(2, 10))
+ acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen,
+ closeonexec_flag | nonblock_flag);
++
++#else
++ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen,
++ closeonexec_flag | nonblock_flag);
++#endif
+ #else
+ acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen,
+ closeonexec_flag | nonblock_flag);
+diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c
+index c927512..921b107 100644
+--- a/testcases/kernel/syscalls/getcpu/getcpu01.c
++++ b/testcases/kernel/syscalls/getcpu/getcpu01.c
+@@ -62,6 +62,7 @@
+ #include <dirent.h>
+
+ #if defined(__i386__) || defined(__x86_64__)
++#if defined(__GLIBC__)
+ #if __GLIBC_PREREQ(2,6)
+ #if defined(__x86_64__)
+ #include <utmpx.h>
+@@ -75,10 +76,17 @@ int sys_support = 0;
+ #else
+ int sys_support = 0;
+ #endif
++#else
++int sys_support = 0;
++#endif
+
++#if defined(__GLIBC__)
+ #if !(__GLIBC_PREREQ(2, 7))
+ #define CPU_FREE(ptr) free(ptr)
+ #endif
++#else
++#define CPU_FREE(ptr) free(ptr)
++#endif
+
+ void cleanup(void);
+ void setup(void);
+@@ -164,9 +172,14 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id,
+ {
+ #if defined(__i386__)
+ return syscall(318, cpu_id, node_id, cache_struct);
+-#elif __GLIBC_PREREQ(2,6)
++#if defined(__GLIBC__)
++#if __GLIBC_PREREQ(2,6)
++ *cpu_id = sched_getcpu();
++#endif
++#else
+ *cpu_id = sched_getcpu();
+ #endif
++#endif
+ return 0;
+ }
+
+@@ -191,15 +204,20 @@ unsigned int set_cpu_affinity(void)
+ cpu_set_t *set;
+ size_t size;
+ int nrcpus = 1024;
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ realloc:
+ set = CPU_ALLOC(nrcpus);
+ #else
+ set = malloc(sizeof(cpu_set_t));
+ #endif
++#else
++ set = malloc(sizeof(cpu_set_t));
++#endif
+ if (set == NULL) {
+ tst_brkm(TFAIL, NULL, "CPU_ALLOC:errno:%d", errno);
+ }
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ size = CPU_ALLOC_SIZE(nrcpus);
+ CPU_ZERO_S(size, set);
+@@ -207,8 +225,13 @@ realloc:
+ size = sizeof(cpu_set_t);
+ CPU_ZERO(set);
+ #endif
++#else
++ size = sizeof(cpu_set_t);
++ CPU_ZERO(set);
++#endif
+ if (sched_getaffinity(0, size, set) < 0) {
+ CPU_FREE(set);
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ if (errno == EINVAL && nrcpus < (1024 << 8)) {
+ nrcpus = nrcpus << 2;
+@@ -220,10 +243,17 @@ realloc:
+ "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)");
+ else
+ #endif
++#else
++ if (errno == EINVAL)
++ tst_resm(TFAIL,
++ "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)");
++ else
++#endif
+ tst_resm(TFAIL, "sched_getaffinity:errno:%d", errno);
+ tst_exit();
+ }
+ cpu_max = max_cpuid(size, set);
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ CPU_ZERO_S(size, set);
+ CPU_SET_S(cpu_max, size, set);
+@@ -231,6 +261,10 @@ realloc:
+ CPU_ZERO(set);
+ CPU_SET(cpu_max, set);
+ #endif
++#else
++ CPU_ZERO(set);
++ CPU_SET(cpu_max, set);
++#endif
+ if (sched_setaffinity(0, size, set) < 0) {
+ CPU_FREE(set);
+ tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno);
+@@ -247,11 +281,15 @@ unsigned int max_cpuid(size_t size, cpu_set_t * set)
+ {
+ unsigned int index, max = 0;
+ for (index = 0; index < size * BITS_PER_BYTE; index++)
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ if (CPU_ISSET_S(index, size, set))
+ #else
+ if (CPU_ISSET(index, set))
+ #endif
++#else
++ if (CPU_ISSET(index, set))
++#endif
+ max = index;
+ return max;
+ }
+diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
+index 9d6a81a..4ed13b2 100644
+--- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
++++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
+@@ -66,9 +66,11 @@ do { \
+ tst_resm((TEST_RETURN == -1 ? TPASS : TFAIL) | TTERRNO, #t); \
+ } while (0)
+
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if !(__GLIBC_PREREQ(2, 7))
+ #define CPU_FREE(ptr) free(ptr)
+ #endif
++#endif
+
+ int main(int ac, char **av)
+ {
+@@ -95,14 +97,19 @@ static void do_test(void)
+ pid_t unused_pid;
+ unsigned len;
+
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ realloc:
+ mask = CPU_ALLOC(nrcpus);
+ #else
+ mask = malloc(sizeof(cpu_set_t));
+ #endif
++#else
++ mask = malloc(sizeof(cpu_set_t));
++#endif
+ if (mask == NULL)
+ tst_brkm(TFAIL | TTERRNO, cleanup, "fail to get enough memory");
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ len = CPU_ALLOC_SIZE(nrcpus);
+ CPU_ZERO_S(len, mask);
+@@ -110,10 +117,15 @@ realloc:
+ len = sizeof(cpu_set_t);
+ CPU_ZERO(mask);
+ #endif
++#else
++ len = sizeof(cpu_set_t);
++ CPU_ZERO(mask);
++#endif
+ /* positive test */
+ TEST(sched_getaffinity(0, len, mask));
+ if (TEST_RETURN == -1) {
+ CPU_FREE(mask);
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ if (errno == EINVAL && nrcpus < (1024 << 8)) {
+ nrcpus = nrcpus << 2;
+@@ -125,17 +137,27 @@ realloc:
+ "newer glibc(>= 2.7)");
+ else
+ #endif
++#else
++ if (errno == EINVAL)
++ tst_resm(TFAIL, "NR_CPUS > 1024, we'd better use a "
++ "newer glibc(>= 2.7)");
++ else
++#endif
+ tst_resm(TFAIL | TTERRNO, "fail to get cpu affinity");
+ cleanup();
+ } else {
+ tst_resm(TINFO, "cpusetsize is %d", len);
+ tst_resm(TINFO, "mask.__bits[0] = %lu ", mask->__bits[0]);
+ for (i = 0; i < num; i++) {
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ TEST(CPU_ISSET_S(i, len, mask));
+ #else
+ TEST(CPU_ISSET(i, mask));
+ #endif
++#else
++ TEST(CPU_ISSET(i, mask));
++#endif
+ if (TEST_RETURN != -1)
+ tst_resm(TPASS, "sched_getaffinity() succeed, "
+ "this process %d is running "
+@@ -143,11 +165,15 @@ realloc:
+ }
+ }
+
++#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 7)
+ CPU_ZERO_S(len, mask);
+ #else
+ CPU_ZERO(mask);
+ #endif
++#else
++ CPU_ZERO(mask);
++#endif
+ /* negative tests */
+ QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *) - 1));
+ QUICK_TEST(sched_getaffinity(0, 0, mask));
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
new file mode 100644
index 000000000..e58e5a96b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0009-Guard-error.h-with-__GLIBC__.patch
@@ -0,0 +1,270 @@
+From 4ba19d64e95a874995d0b554b891b5ec35bd9495 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:45:35 +0000
+Subject: [PATCH 09/32] Guard error.h with __GLIBC__
+
+error API is specific to glibc so use the guard to make it conditional
+on glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/faccessat/faccessat01.c | 2 ++
+ testcases/kernel/syscalls/fallocate/fallocate01.c | 2 ++
+ testcases/kernel/syscalls/fchmodat/fchmodat01.c | 2 ++
+ testcases/kernel/syscalls/fchownat/fchownat01.c | 2 ++
+ testcases/kernel/syscalls/fchownat/fchownat02.c | 2 ++
+ testcases/kernel/syscalls/fstatat/fstatat01.c | 2 ++
+ testcases/kernel/syscalls/futimesat/futimesat01.c | 2 ++
+ testcases/kernel/syscalls/linkat/linkat01.c | 2 ++
+ testcases/kernel/syscalls/linkat/linkat02.c | 2 ++
+ testcases/kernel/syscalls/mkdirat/mkdirat01.c | 2 ++
+ testcases/kernel/syscalls/mknodat/mknodat01.c | 2 ++
+ testcases/kernel/syscalls/mknodat/mknodat02.c | 2 ++
+ testcases/kernel/syscalls/openat/openat01.c | 2 ++
+ testcases/kernel/syscalls/readlinkat/readlinkat01.c | 2 ++
+ testcases/kernel/syscalls/renameat/renameat01.c | 2 ++
+ testcases/kernel/syscalls/symlinkat/symlinkat01.c | 2 ++
+ testcases/kernel/syscalls/unlinkat/unlinkat01.c | 2 ++
+ 17 files changed, 34 insertions(+)
+
+diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
+index 7f0e87a..c72dcf0 100644
+--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
++++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/fallocate/fallocate01.c b/testcases/kernel/syscalls/fallocate/fallocate01.c
+index e72b123..643c0e2 100644
+--- a/testcases/kernel/syscalls/fallocate/fallocate01.c
++++ b/testcases/kernel/syscalls/fallocate/fallocate01.c
+@@ -96,7 +96,9 @@
+ #include <fcntl.h>
+ #include <sys/syscall.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <inttypes.h>
+ #include <sys/utsname.h>
+
+diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
+index 19e9ad5..ae6d807 100644
+--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
++++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/fchownat/fchownat01.c b/testcases/kernel/syscalls/fchownat/fchownat01.c
+index b361253..a5218af 100644
+--- a/testcases/kernel/syscalls/fchownat/fchownat01.c
++++ b/testcases/kernel/syscalls/fchownat/fchownat01.c
+@@ -28,7 +28,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/fchownat/fchownat02.c b/testcases/kernel/syscalls/fchownat/fchownat02.c
+index 6b0304c..8d2863f 100644
+--- a/testcases/kernel/syscalls/fchownat/fchownat02.c
++++ b/testcases/kernel/syscalls/fchownat/fchownat02.c
+@@ -26,7 +26,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/fstatat/fstatat01.c b/testcases/kernel/syscalls/fstatat/fstatat01.c
+index 61531c6..e99fbd2 100644
+--- a/testcases/kernel/syscalls/fstatat/fstatat01.c
++++ b/testcases/kernel/syscalls/fstatat/fstatat01.c
+@@ -48,7 +48,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/futimesat/futimesat01.c b/testcases/kernel/syscalls/futimesat/futimesat01.c
+index ae8d4fe..316dd78 100644
+--- a/testcases/kernel/syscalls/futimesat/futimesat01.c
++++ b/testcases/kernel/syscalls/futimesat/futimesat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c
+index fc0687b..83cbfe7 100644
+--- a/testcases/kernel/syscalls/linkat/linkat01.c
++++ b/testcases/kernel/syscalls/linkat/linkat01.c
+@@ -49,7 +49,9 @@
+ #include <sys/time.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/linkat/linkat02.c b/testcases/kernel/syscalls/linkat/linkat02.c
+index e9a752a..8d7e431 100644
+--- a/testcases/kernel/syscalls/linkat/linkat02.c
++++ b/testcases/kernel/syscalls/linkat/linkat02.c
+@@ -23,7 +23,9 @@
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
+index 7e15947..1dbc038 100644
+--- a/testcases/kernel/syscalls/mkdirat/mkdirat01.c
++++ b/testcases/kernel/syscalls/mkdirat/mkdirat01.c
+@@ -30,7 +30,9 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/mknodat/mknodat01.c b/testcases/kernel/syscalls/mknodat/mknodat01.c
+index 26e5538..f034f05 100644
+--- a/testcases/kernel/syscalls/mknodat/mknodat01.c
++++ b/testcases/kernel/syscalls/mknodat/mknodat01.c
+@@ -29,7 +29,9 @@
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/mknodat/mknodat02.c b/testcases/kernel/syscalls/mknodat/mknodat02.c
+index f6368fa..7d0f7c0 100644
+--- a/testcases/kernel/syscalls/mknodat/mknodat02.c
++++ b/testcases/kernel/syscalls/mknodat/mknodat02.c
+@@ -29,7 +29,9 @@
+ #include <sys/types.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/openat/openat01.c b/testcases/kernel/syscalls/openat/openat01.c
+index 85f9a91..4ee0117 100644
+--- a/testcases/kernel/syscalls/openat/openat01.c
++++ b/testcases/kernel/syscalls/openat/openat01.c
+@@ -29,7 +29,9 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/readlinkat/readlinkat01.c b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
+index 97a49e8..b162853 100644
+--- a/testcases/kernel/syscalls/readlinkat/readlinkat01.c
++++ b/testcases/kernel/syscalls/readlinkat/readlinkat01.c
+@@ -29,7 +29,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/renameat/renameat01.c b/testcases/kernel/syscalls/renameat/renameat01.c
+index f4cd51b..105a05b 100644
+--- a/testcases/kernel/syscalls/renameat/renameat01.c
++++ b/testcases/kernel/syscalls/renameat/renameat01.c
+@@ -42,7 +42,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/symlinkat/symlinkat01.c b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
+index 5c238d8..cb7a7e8 100644
+--- a/testcases/kernel/syscalls/symlinkat/symlinkat01.c
++++ b/testcases/kernel/syscalls/symlinkat/symlinkat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/testcases/kernel/syscalls/unlinkat/unlinkat01.c b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
+index 31fe4e7..26f6d9a 100644
+--- a/testcases/kernel/syscalls/unlinkat/unlinkat01.c
++++ b/testcases/kernel/syscalls/unlinkat/unlinkat01.c
+@@ -37,7 +37,9 @@
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <fcntl.h>
++#ifdef __GLIBC__
+ #include <error.h>
++#endif
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch
new file mode 100644
index 000000000..5b0c444be
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch
@@ -0,0 +1,73 @@
+From 0130f4146ced320aadb01b22e36b13d269a8ebba Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:48:14 +0000
+Subject: [PATCH 10/32] replace __BEGIN_DECLS and __END_DECLS
+
+They are not portable across libc implementations
+therefore replace them with expanded macros
+
+Include <asm-generic/types.h> to get __s32 definitions
+its not a generally available typedef
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/epoll2/include/epoll.h | 8 ++++++--
+ utils/sctp/include/netinet/sctp.h | 9 +++++++--
+ 2 files changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/epoll2/include/epoll.h b/testcases/kernel/syscalls/epoll2/include/epoll.h
+index be599c7..8cc5e7e 100644
+--- a/testcases/kernel/syscalls/epoll2/include/epoll.h
++++ b/testcases/kernel/syscalls/epoll2/include/epoll.h
+@@ -85,7 +85,9 @@ struct epoll_event
+ } EPOLL_PACKED;
+
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* Creates an epoll instance. Returns an fd for the new instance.
+ The "size" parameter is a hint specifying the number of file
+@@ -114,6 +116,8 @@ extern int epoll_ctl (int __epfd, int __op, int __fd,
+ extern int epoll_wait (int __epfd, struct epoll_event *__events,
+ int __maxevents, int __timeout) __THROW;
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* sys/epoll.h */
+diff --git a/utils/sctp/include/netinet/sctp.h b/utils/sctp/include/netinet/sctp.h
+index 51f5bfb..c61aef3 100644
+--- a/utils/sctp/include/netinet/sctp.h
++++ b/utils/sctp/include/netinet/sctp.h
+@@ -35,9 +35,12 @@
+
+ #include <stdint.h>
+ #include <linux/types.h>
++#include <asm-generic/types.h>
+ #include <sys/socket.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ typedef __s32 sctp_assoc_t;
+
+@@ -862,6 +865,8 @@ int sctp_recvmsg(int s, void *msg, size_t len, struct sockaddr *from,
+ /* Return the address length for an address family. */
+ int sctp_getaddrlen(sa_family_t family);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* __linux_sctp_h__ */
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
new file mode 100644
index 000000000..945280c62
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0011-Rename-sigset-variable-to-sigset1.patch
@@ -0,0 +1,136 @@
+From aff0e2a8f011fa80b472355355a7e8cdacd50189 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:53:30 +0000
+Subject: [PATCH 11/32] Rename sigset variable to sigset1
+
+sigset API from signal.h is shadowed by this name conflict
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/mem/shmt/shmt04.c | 10 +++++-----
+ testcases/kernel/mem/shmt/shmt06.c | 10 +++++-----
+ testcases/kernel/syscalls/sigprocmask/sigprocmask01.c | 10 +++++-----
+ 3 files changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/testcases/kernel/mem/shmt/shmt04.c b/testcases/kernel/mem/shmt/shmt04.c
+index 7203e9e..fce87d6 100644
+--- a/testcases/kernel/mem/shmt/shmt04.c
++++ b/testcases/kernel/mem/shmt/shmt04.c
+@@ -56,7 +56,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */
+ /**************/
+
+ key_t key;
+-sigset_t sigset;
++sigset_t sigset1;
+
+ #define SIZE 16*1024
+
+@@ -71,9 +71,9 @@ int main(void)
+
+ key = (key_t) getpid();
+
+- sigemptyset(&sigset);
+- sigaddset(&sigset, SIGUSR1);
+- sigprocmask(SIG_BLOCK, &sigset, NULL);
++ sigemptyset(&sigset1);
++ sigaddset(&sigset1, SIGUSR1);
++ sigprocmask(SIG_BLOCK, &sigset1, NULL);
+
+ pid = fork();
+ switch (pid) {
+@@ -148,7 +148,7 @@ int child(void)
+ char *cp;
+ int sig;
+
+- sigwait(&sigset, &sig);
++ sigwait(&sigset1, &sig);
+ chld_pid = getpid();
+ /*--------------------------------------------------------*/
+
+diff --git a/testcases/kernel/mem/shmt/shmt06.c b/testcases/kernel/mem/shmt/shmt06.c
+index a3c9ca3..77b0fc9 100644
+--- a/testcases/kernel/mem/shmt/shmt06.c
++++ b/testcases/kernel/mem/shmt/shmt06.c
+@@ -57,7 +57,7 @@ int TST_TOTAL = 2; /* Total number of test cases. */
+ /**************/
+
+ key_t key;
+-sigset_t sigset;
++sigset_t sigset1;
+
+ int child();
+ static int rm_shm(int);
+@@ -70,9 +70,9 @@ int main(void)
+
+ key = (key_t) getpid();
+
+- sigemptyset(&sigset);
+- sigaddset(&sigset, SIGUSR1);
+- sigprocmask(SIG_BLOCK, &sigset, NULL);
++ sigemptyset(&sigset1);
++ sigaddset(&sigset1, SIGUSR1);
++ sigprocmask(SIG_BLOCK, &sigset1, NULL);
+
+ pid = fork();
+ switch (pid) {
+@@ -147,7 +147,7 @@ int child(void)
+ char *cp;
+ int sig;
+
+- sigwait(&sigset, &sig);
++ sigwait(&sigset1, &sig);
+ chld_pid = getpid();
+
+ if ((shmid = shmget(key, SIZE, 0)) < 0) {
+diff --git a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
+index 20fca52..6fb1d57 100644
+--- a/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
++++ b/testcases/kernel/syscalls/sigprocmask/sigprocmask01.c
+@@ -91,7 +91,7 @@ int TST_TOTAL = 1;
+ int sig_catch = 0; /* variable to blocked/unblocked signals */
+
+ struct sigaction sa_new; /* struct to hold signal info */
+-sigset_t sigset; /* signal set to hold signal lists */
++sigset_t sigset1; /* signal set to hold signal lists */
+ sigset_t sigset2;
+
+ int main(int ac, char **av)
+@@ -112,7 +112,7 @@ int main(int ac, char **av)
+ * so that, signal will not be delivered to
+ * the test process.
+ */
+- TEST(sigprocmask(SIG_BLOCK, &sigset, 0));
++ TEST(sigprocmask(SIG_BLOCK, &sigset1, 0));
+
+ /* Get the process id of test process */
+ my_pid = getpid();
+@@ -165,7 +165,7 @@ int main(int ac, char **av)
+ */
+ errno = 0;
+ if (sigprocmask(SIG_UNBLOCK,
+- &sigset, 0) == -1) {
++ &sigset1, 0) == -1) {
+ tst_brkm(TFAIL, cleanup,
+ "sigprocmask() failed "
+ "to unblock signal, "
+@@ -212,7 +212,7 @@ void setup(void)
+ * Initialise the signal sets with the list that
+ * excludes/includes all system-defined signals.
+ */
+- if (sigemptyset(&sigset) == -1) {
++ if (sigemptyset(&sigset1) == -1) {
+ tst_brkm(TFAIL, cleanup,
+ "sigemptyset() failed, errno=%d : %s",
+ errno, strerror(errno));
+@@ -235,7 +235,7 @@ void setup(void)
+ * Add specified signal (SIGINT) to the signal set
+ * which excludes system-defined signals.
+ */
+- if (sigaddset(&sigset, SIGINT) == -1) {
++ if (sigaddset(&sigset1, SIGINT) == -1) {
+ tst_brkm(TFAIL, cleanup,
+ "sigaddset() failed, errno=%d : %s",
+ errno, strerror(errno));
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
new file mode 100644
index 000000000..e1532c1fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch
@@ -0,0 +1,351 @@
+From 54e098a366a1d773c4d7d4124f2f5aab976681c3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 19:58:08 +0000
+Subject: [PATCH 12/32] fsstress.c: Replace __int64_t with int64_t
+
+int64_t is defined in ISO C99
+include limits.h to get defintions of PATH_MAX
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/fs/fsstress/fsstress.c | 31 +++++++++---------
+ testcases/network/nfs/nfs_fsstress/fsstress.c | 47 ++++++++++++++-------------
+ 2 files changed, 40 insertions(+), 38 deletions(-)
+
+diff --git a/testcases/kernel/fs/fsstress/fsstress.c b/testcases/kernel/fs/fsstress/fsstress.c
+index 2f89903..89f0b19 100644
+--- a/testcases/kernel/fs/fsstress/fsstress.c
++++ b/testcases/kernel/fs/fsstress/fsstress.c
+@@ -36,6 +36,7 @@
+ #ifdef HAVE_SYS_PRCTL_H
+ # include <sys/prctl.h>
+ #endif
++#include <limits.h>
+
+ #define XFS_ERRTAG_MAX 17
+
+@@ -1572,7 +1573,7 @@ void bulkstat_f(int opno, long r)
+ __u64 last;
+ __s32 nent;
+ xfs_bstat_t *t;
+- __int64_t total;
++ int64_t total;
+ xfs_fsop_bulkreq_t bsr;
+
+ last = 0;
+@@ -1764,14 +1765,14 @@ int setdirect(int fd)
+
+ void dread_f(int opno, long r)
+ {
+- __int64_t align;
++ int64_t align;
+ char *buf = NULL;
+ struct dioattr diob;
+ int e;
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1835,8 +1836,8 @@ void dread_f(int opno, long r)
+ return;
+ }
+ #endif
+- align = (__int64_t) diob.d_miniosz;
+- lr = ((__int64_t) random() << 32) + random();
++ align = (int64_t) diob.d_miniosz;
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % stb.st_size);
+ off -= (off % align);
+ lseek64(fd, off, SEEK_SET);
+@@ -1865,14 +1866,14 @@ void dread_f(int opno, long r)
+
+ void dwrite_f(int opno, long r)
+ {
+- __int64_t align;
++ int64_t align;
+ char *buf = NULL;
+ struct dioattr diob;
+ int e;
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1925,8 +1926,8 @@ void dwrite_f(int opno, long r)
+ return;
+ }
+ #endif
+- align = (__int64_t) diob.d_miniosz;
+- lr = ((__int64_t) random() << 32) + random();
++ align = (int64_t) diob.d_miniosz;
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off -= (off % align);
+ lseek64(fd, off, SEEK_SET);
+@@ -2224,7 +2225,7 @@ void read_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2262,7 +2263,7 @@ void read_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % stb.st_size);
+ lseek64(fd, off, SEEK_SET);
+ len = (random() % (getpagesize() * 32)) + 1;
+@@ -2509,7 +2510,7 @@ void truncate_f(int opno, long r)
+ {
+ int e;
+ pathname_t f;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2530,7 +2531,7 @@ void truncate_f(int opno, long r)
+ free_pathname(&f);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
+ off %= maxfsize;
+ e = truncate64_path(&f, off) < 0 ? errno : 0;
+@@ -2626,7 +2627,7 @@ void write_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2656,7 +2657,7 @@ void write_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ lseek64(fd, off, SEEK_SET);
+diff --git a/testcases/network/nfs/nfs_fsstress/fsstress.c b/testcases/network/nfs/nfs_fsstress/fsstress.c
+index ac91262..a34c416 100644
+--- a/testcases/network/nfs/nfs_fsstress/fsstress.c
++++ b/testcases/network/nfs/nfs_fsstress/fsstress.c
+@@ -31,6 +31,7 @@
+ */
+
+ #include "global.h"
++#include <limits.h>
+
+ #define XFS_ERRTAG_MAX 17
+
+@@ -1368,7 +1369,7 @@ void allocsp_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ struct flock64 fl;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1398,7 +1399,7 @@ void allocsp_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fl.l_whence = SEEK_SET;
+@@ -1519,7 +1520,7 @@ void bulkstat_f(int opno, long r)
+ __uint64_t last;
+ int nent;
+ xfs_bstat_t *t;
+- __int64_t total;
++ int64_t total;
+ xfs_fsop_bulkreq_t bsr;
+
+ last = 0;
+@@ -1708,14 +1709,14 @@ int setdirect(int fd)
+
+ void dread_f(int opno, long r)
+ {
+- __int64_t align;
++ int64_t align;
+ char *buf;
+ struct dioattr diob;
+ int e;
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1775,8 +1776,8 @@ void dread_f(int opno, long r)
+ return;
+ }
+ #endif
+- align = (__int64_t) diob.d_miniosz;
+- lr = ((__int64_t) random() << 32) + random();
++ align = (int64_t) diob.d_miniosz;
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % stb.st_size);
+ off -= (off % align);
+ lseek64(fd, off, SEEK_SET);
+@@ -1798,14 +1799,14 @@ void dread_f(int opno, long r)
+
+ void dwrite_f(int opno, long r)
+ {
+- __int64_t align;
++ int64_t align;
+ char *buf;
+ struct dioattr diob;
+ int e;
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1854,8 +1855,8 @@ void dwrite_f(int opno, long r)
+ return;
+ }
+ #endif
+- align = (__int64_t) diob.d_miniosz;
+- lr = ((__int64_t) random() << 32) + random();
++ align = (int64_t) diob.d_miniosz;
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off -= (off % align);
+ lseek64(fd, off, SEEK_SET);
+@@ -1917,7 +1918,7 @@ void freesp_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ struct flock64 fl;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -1947,7 +1948,7 @@ void freesp_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fl.l_whence = SEEK_SET;
+@@ -2145,7 +2146,7 @@ void read_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2183,7 +2184,7 @@ void read_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % stb.st_size);
+ lseek64(fd, off, SEEK_SET);
+ len = (random() % (getpagesize() * 32)) + 1;
+@@ -2281,7 +2282,7 @@ void resvsp_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ struct flock64 fl;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2311,7 +2312,7 @@ void resvsp_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fl.l_whence = SEEK_SET;
+@@ -2428,7 +2429,7 @@ void truncate_f(int opno, long r)
+ {
+ int e;
+ pathname_t f;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2449,7 +2450,7 @@ void truncate_f(int opno, long r)
+ free_pathname(&f);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ e = truncate64_path(&f, off) < 0 ? errno : 0;
+@@ -2491,7 +2492,7 @@ void unresvsp_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ struct flock64 fl;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2521,7 +2522,7 @@ void unresvsp_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ fl.l_whence = SEEK_SET;
+@@ -2543,7 +2544,7 @@ void write_f(int opno, long r)
+ pathname_t f;
+ int fd;
+ size_t len;
+- __int64_t lr;
++ int64_t lr;
+ off64_t off;
+ struct stat64 stb;
+ int v;
+@@ -2573,7 +2574,7 @@ void write_f(int opno, long r)
+ close(fd);
+ return;
+ }
+- lr = ((__int64_t) random() << 32) + random();
++ lr = ((int64_t) random() << 32) + random();
+ off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+ off %= maxfsize;
+ lseek64(fd, off, SEEK_SET);
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
new file mode 100644
index 000000000..4266e4fc3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0013-include-fcntl.h-for-getting-O_-definitions.patch
@@ -0,0 +1,67 @@
+From 1ef8c32317064438ec3b37a114f5d82957f4e0c6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:05:54 +0000
+Subject: [PATCH 13/32] include fcntl.h for getting O_* definitions
+
+musl exposes this issue, with glibc fcntl.h is included via some other
+header and this problem remained latent
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/ipc/ipc_stress/shmem_test_03.c | 1 +
+ testcases/kernel/syscalls/mq_notify/mq_notify01.c | 1 +
+ testcases/network/tcp_cmds/sendfile/testsf_c.c | 1 +
+ testcases/network/tcp_cmds/sendfile/testsf_s.c | 1 +
+ 4 files changed, 4 insertions(+)
+
+diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
+index c1b11fd..8be156f 100644
+--- a/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
++++ b/testcases/kernel/ipc/ipc_stress/shmem_test_03.c
+@@ -72,6 +72,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <limits.h>
++#include <fcntl.h>
+ #include <sys/file.h>
+ #include <sys/ipc.h>
+ #include <sys/mman.h>
+diff --git a/testcases/kernel/syscalls/mq_notify/mq_notify01.c b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
+index 4728c70..5c7846c 100644
+--- a/testcases/kernel/syscalls/mq_notify/mq_notify01.c
++++ b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
+@@ -41,6 +41,7 @@
+ #include <mqueue.h>
+ #include <signal.h>
+ #include <stdlib.h>
++#include <fcntl.h>
+
+ #include "../utils/include_j_h.h"
+
+diff --git a/testcases/network/tcp_cmds/sendfile/testsf_c.c b/testcases/network/tcp_cmds/sendfile/testsf_c.c
+index 449784f..38d3274 100644
+--- a/testcases/network/tcp_cmds/sendfile/testsf_c.c
++++ b/testcases/network/tcp_cmds/sendfile/testsf_c.c
+@@ -9,6 +9,7 @@
+ #include <sys/types.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <fcntl.h>
+ #include <sys/file.h>
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
+diff --git a/testcases/network/tcp_cmds/sendfile/testsf_s.c b/testcases/network/tcp_cmds/sendfile/testsf_s.c
+index 17e98ad..bce8dd1 100644
+--- a/testcases/network/tcp_cmds/sendfile/testsf_s.c
++++ b/testcases/network/tcp_cmds/sendfile/testsf_s.c
+@@ -6,6 +6,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ #include <sys/file.h>
+ #include <errno.h>
+ #include <sys/signal.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
new file mode 100644
index 000000000..84d81e9f9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch
@@ -0,0 +1,56 @@
+From d63fefa86dac437c47b9ebbea0a82a1240aaba2c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:09:56 +0000
+Subject: [PATCH 14/32] hyperthreading: Include sys/types.h for pid_t
+ definition
+
+If sys/types.h is not included then it will not define pid_t_needed
+and therefore typedef wont be included and we get errors about pid_t
+being not known
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h | 1 +
+ testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h | 1 +
+ testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
+index 1ec9794..9084aa7 100644
+--- a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
++++ b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.h
+@@ -3,6 +3,7 @@
+ #define _HTUTILS_H_
+
+ #include <stdlib.h>
++#include <sys/types.h>
+
+ int is_cmdline_para(const char *para);
+
+diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
+index 1ec9794..c03a124 100644
+--- a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
++++ b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.h
+@@ -2,6 +2,7 @@
+ #ifndef _HTUTILS_H_
+ #define _HTUTILS_H_
+
++#include <sys/types.h>
+ #include <stdlib.h>
+
+ int is_cmdline_para(const char *para);
+diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
+index 2977ad0..6b484e1 100644
+--- a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
++++ b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
+@@ -3,6 +3,7 @@
+ #define _HTUTILS_H_
+
+ #include <stdlib.h>
++#include <sys/types.h>
+
+ int is_cmdline_para(const char *para);
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
new file mode 100644
index 000000000..963536f99
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0015-mincore01-Rename-PAGESIZE-to-pagesize.patch
@@ -0,0 +1,64 @@
+From f091839532f3afe0a58e8ba0b45615c899a43a47 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:12:09 +0000
+Subject: [PATCH 15/32] mincore01: Rename PAGESIZE to pagesize
+
+PAGESIZE conflicts with system headers on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/mincore/mincore01.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/mincore/mincore01.c b/testcases/kernel/syscalls/mincore/mincore01.c
+index 97a3d95..fa426d1 100644
+--- a/testcases/kernel/syscalls/mincore/mincore01.c
++++ b/testcases/kernel/syscalls/mincore/mincore01.c
+@@ -45,7 +45,7 @@
+ #include "test.h"
+ #include "safe_macros.h"
+
+-static int PAGESIZE;
++static int pagesize;
+ static rlim_t STACK_LIMIT = 10485760;
+
+ static void cleanup(void);
+@@ -146,7 +146,7 @@ static void setup4(struct test_case_t *tc)
+ }
+
+ tc->addr = global_pointer;
+- tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + PAGESIZE;
++ tc->len = as_lim.rlim_cur - (rlim_t)global_pointer + pagesize;
+ tc->vector = global_vec;
+
+ /*
+@@ -161,7 +161,7 @@ static void setup(void)
+ char *buf;
+ int fd;
+
+- PAGESIZE = getpagesize();
++ pagesize = getpagesize();
+
+ tst_sig(NOFORK, DEF_HANDLER, cleanup);
+
+@@ -170,7 +170,7 @@ static void setup(void)
+ TEST_PAUSE;
+
+ /* global_pointer will point to a mmapped area of global_len bytes */
+- global_len = PAGESIZE * 2;
++ global_len = pagesize * 2;
+
+ buf = SAFE_MALLOC(cleanup, global_len);
+ memset(buf, 42, global_len);
+@@ -186,7 +186,7 @@ static void setup(void)
+ PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+
+ global_vec = SAFE_MALLOC(cleanup,
+- (global_len + PAGESIZE - 1) / PAGESIZE);
++ (global_len + pagesize - 1) / pagesize);
+
+ SAFE_CLOSE(cleanup, fd);
+ }
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
new file mode 100644
index 000000000..1b5b93a4e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch
@@ -0,0 +1,45 @@
+From 2b9be924bbad8a1f84ae553fdd1aa8391aa8d2f4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:15:07 +0000
+Subject: [PATCH 16/32] ustat: Change header from ustat.h to sys/ustat.h
+
+makes it portable for musl, on glibc ustat.h is just including
+sys/ustat.h too
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/ustat/ustat01.c | 2 +-
+ testcases/kernel/syscalls/ustat/ustat02.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/ustat/ustat01.c b/testcases/kernel/syscalls/ustat/ustat01.c
+index 01b7688..494647b 100644
+--- a/testcases/kernel/syscalls/ustat/ustat01.c
++++ b/testcases/kernel/syscalls/ustat/ustat01.c
+@@ -20,8 +20,8 @@
+ */
+
+ #include <unistd.h>
+-#include <ustat.h>
+ #include <errno.h>
++#include <sys/ustat.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include "test.h"
+diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c
+index 4e66236..edada31 100644
+--- a/testcases/kernel/syscalls/ustat/ustat02.c
++++ b/testcases/kernel/syscalls/ustat/ustat02.c
+@@ -21,8 +21,8 @@
+ */
+
+ #include <unistd.h>
+-#include <ustat.h>
+ #include <errno.h>
++#include <sys/ustat.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include "test.h"
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
new file mode 100644
index 000000000..ed25802a0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0017-replace-sigval_t-with-union-sigval.patch
@@ -0,0 +1,88 @@
+From c882bcd18820b44a685f0d5edd7aaff77a88c912 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Jan 2016 20:17:55 +0000
+Subject: [PATCH 17/32] replace sigval_t with union sigval
+
+This makes it compatible across musl and glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c | 2 +-
+ testcases/kernel/syscalls/timer_gettime/timer_gettime01.c | 2 +-
+ testcases/kernel/timers/timer_create/timer_create02.c | 4 ++--
+ testcases/kernel/timers/timer_create/timer_create03.c | 4 ++--
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
+index d186c1f..bc03544 100644
+--- a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
++++ b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c
+@@ -54,7 +54,7 @@ int main(int ac, char **av)
+
+ setup();
+
+- ev.sigev_value = (sigval_t) 0;
++ ev.sigev_value = (union sigval) 0;
+ ev.sigev_signo = SIGALRM;
+ ev.sigev_notify = SIGEV_SIGNAL;
+ TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
+diff --git a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
+index b583aee..9371a6a 100644
+--- a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
++++ b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c
+@@ -55,7 +55,7 @@ int main(int ac, char **av)
+
+ setup();
+
+- ev.sigev_value = (sigval_t) 0;
++ ev.sigev_value = (union sigval) 0;
+ ev.sigev_signo = SIGALRM;
+ ev.sigev_notify = SIGEV_SIGNAL;
+ TEST(ltp_syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &timer));
+diff --git a/testcases/kernel/timers/timer_create/timer_create02.c b/testcases/kernel/timers/timer_create/timer_create02.c
+index 7f528ed..1127400 100644
+--- a/testcases/kernel/timers/timer_create/timer_create02.c
++++ b/testcases/kernel/timers/timer_create/timer_create02.c
+@@ -142,7 +142,7 @@ void setup_test(int option)
+ {
+ switch (option) {
+ case 0:
+- evp.sigev_value = (sigval_t) 0;
++ evp.sigev_value = (union sigval) 0;
+ evp.sigev_signo = SIGALRM;
+ evp.sigev_notify = SIGEV_SIGNAL;
+ evp_ptr = &evp;
+@@ -151,7 +151,7 @@ void setup_test(int option)
+ evp_ptr = NULL;
+ break;
+ case 2:
+- evp.sigev_value = (sigval_t) 0;
++ evp.sigev_value = (union sigval) 0;
+ evp.sigev_signo = SIGALRM; /* any will do */
+ evp.sigev_notify = SIGEV_NONE;
+ evp_ptr = &evp;
+diff --git a/testcases/kernel/timers/timer_create/timer_create03.c b/testcases/kernel/timers/timer_create/timer_create03.c
+index 291fcfa..8b01bf7 100644
+--- a/testcases/kernel/timers/timer_create/timer_create03.c
++++ b/testcases/kernel/timers/timer_create/timer_create03.c
+@@ -129,7 +129,7 @@ void setup_test(int option)
+ {
+ switch (option) {
+ case 0:
+- evp.sigev_value = (sigval_t) 0;
++ evp.sigev_value = (union sigval) 0;
+ evp.sigev_signo = SIGALRM;
+ evp.sigev_notify = SIGEV_SIGNAL;
+ evp_ptr = &evp;
+@@ -138,7 +138,7 @@ void setup_test(int option)
+ evp_ptr = NULL;
+ break;
+ case 2:
+- evp.sigev_value = (sigval_t) 0;
++ evp.sigev_value = (union sigval) 0;
+ evp.sigev_signo = SIGALRM; /* any will do */
+ evp.sigev_notify = SIGEV_NONE;
+ evp_ptr = &evp;
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch
new file mode 100644
index 000000000..5198fe9f4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0018-guard-mallocopt-with-__GLIBC__.patch
@@ -0,0 +1,32 @@
+From f42b060e80c9f40627c712d4d56d45221bd7d9fa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 06:51:20 +0000
+Subject: [PATCH 18/32] guard mallocopt() with __GLIBC__
+
+mallocopt is not available on non glibc implementations
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/benchmark/ebizzy-0.3/ebizzy.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/utils/benchmark/ebizzy-0.3/ebizzy.c b/utils/benchmark/ebizzy-0.3/ebizzy.c
+index 5bb8eff..934d951 100644
+--- a/utils/benchmark/ebizzy-0.3/ebizzy.c
++++ b/utils/benchmark/ebizzy-0.3/ebizzy.c
+@@ -215,10 +215,10 @@ static void read_options(int argc, char *argv[])
+ "\"never mmap\" option specified\n");
+ usage();
+ }
+-
++#ifdef __GLIBC__
+ if (never_mmap)
+ mallopt(M_MMAP_MAX, 0);
+-
++#endif
+ if (chunk_size < record_size) {
+ fprintf(stderr, "Chunk size %u smaller than record size %u\n",
+ chunk_size, record_size);
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
new file mode 100644
index 000000000..0a4c5f0b3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch
@@ -0,0 +1,32 @@
+From 721e94985b9cff3e2724af7ea5be7d005bc12dec Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 06:55:27 +0000
+Subject: [PATCH 19/32] tomoyo: Replace canonicalize_file_name() with
+ realpath()
+
+canonicalize_file_name() API is specific to glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
+index da4af0f..5c1a3ca 100644
+--- a/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
++++ b/testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c
+@@ -274,9 +274,9 @@ int main(int argc, char *argv[])
+ /* Test mount(). */
+ {
+ static char buf[4096];
+- char *dev_ram_path = canonicalize_file_name("/dev/ram0");
++ char *dev_ram_path = realpath("/dev/ram0", NULL);
+ if (!dev_ram_path)
+- dev_ram_path = canonicalize_file_name("/dev/ram");
++ dev_ram_path = realpath("/dev/ram", NULL);
+ if (!dev_ram_path) {
+ dev_ram_path = "/dev/ram0";
+ mknod(dev_ram_path, S_IFBLK, MKDEV(1, 0));
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch
new file mode 100644
index 000000000..0e4e4586c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0020-getdents-define-getdents-getdents64-only-for-glibc.patch
@@ -0,0 +1,48 @@
+From aa3568e6ac28f377e75ce16b11e3c7738a373e53 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 06:57:04 +0000
+Subject: [PATCH 20/32] getdents: define getdents/getdents64 only for glibc
+
+getdents/getdents64 are implemented in musl and when we define static
+functions with same name, it errors out.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/getdents/getdents.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h
+index abea655..db63d89 100644
+--- a/testcases/kernel/syscalls/getdents/getdents.h
++++ b/testcases/kernel/syscalls/getdents/getdents.h
+@@ -34,12 +34,13 @@ struct linux_dirent {
+ char d_name[];
+ };
+
++#ifdef __GLIBC__
+ static inline int
+ getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size)
+ {
+ return ltp_syscall(__NR_getdents, fd, dirp, size);
+ }
+-
++#endif
+ struct linux_dirent64 {
+ uint64_t d_ino;
+ int64_t d_off;
+@@ -48,10 +49,11 @@ struct linux_dirent64 {
+ char d_name[];
+ };
+
++#ifdef __GLIBC__
+ static inline int
+ getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size)
+ {
+ return ltp_syscall(__NR_getdents64, fd, dirp64, size);
+ }
+-
++#endif
+ #endif /* GETDENTS_H */
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
new file mode 100644
index 000000000..c8cbe580c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch
@@ -0,0 +1,71 @@
+From b216435bb362df10c45f544b78d8c884eaa901fd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:01:02 +0000
+Subject: [PATCH 21/32] Define _GNU_SOURCE for MREMAP_MAYMOVE definition
+
+musl guards MREMAP_MAYMOVE with _GNU_SOURCE unlike glibc which uses
+__USE_GNU
+
+Fixes errors like
+error: 'MREMAP_MAYMOVE' undeclared (first use in this function)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/mremap/mremap01.c | 4 +++-
+ testcases/kernel/syscalls/mremap/mremap02.c | 2 ++
+ testcases/kernel/syscalls/mremap/mremap03.c | 2 ++
+ 3 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/syscalls/mremap/mremap01.c b/testcases/kernel/syscalls/mremap/mremap01.c
+index d63d1e4..24ca174 100644
+--- a/testcases/kernel/syscalls/mremap/mremap01.c
++++ b/testcases/kernel/syscalls/mremap/mremap01.c
+@@ -76,10 +76,12 @@
+ */
+ #include <unistd.h>
+ #include <errno.h>
++#include <fcntl.h>
++#define _GNU_SOURCE
+ #define __USE_GNU
+ #include <sys/mman.h>
+ #undef __USE_GNU
+-#include <fcntl.h>
++#undef _GNU_SOURCE
+
+ #include "test.h"
+
+diff --git a/testcases/kernel/syscalls/mremap/mremap02.c b/testcases/kernel/syscalls/mremap/mremap02.c
+index 5a51b9a..a530a6b 100644
+--- a/testcases/kernel/syscalls/mremap/mremap02.c
++++ b/testcases/kernel/syscalls/mremap/mremap02.c
+@@ -75,9 +75,11 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#define _GNU_SOURCE
+ #define __USE_GNU
+ #include <sys/mman.h>
+ #undef __USE_GNU
++#undef _GNU_SOURCE
+
+ #include "test.h"
+
+diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
+index 12e3829..9b39f8b 100644
+--- a/testcases/kernel/syscalls/mremap/mremap03.c
++++ b/testcases/kernel/syscalls/mremap/mremap03.c
+@@ -76,9 +76,11 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#define _GNU_SOURCE
+ #define __USE_GNU
+ #include <sys/mman.h>
+ #undef __USE_GNU
++#undef _GNU_SOURCE
+
+ #include "test.h"
+
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
new file mode 100644
index 000000000..413b44ac7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0022-include-sys-types.h.patch
@@ -0,0 +1,29 @@
+From 7ac6fd51991ac61d1d7594f601d87842060ee284 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:06:11 +0000
+Subject: [PATCH 22/32] include sys/types.h
+
+Fixes
+
+error: unknown type name 'uint'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/ipc/ipc_stress/shmem_test_04.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
+index 72c2e60..e7e5f61 100644
+--- a/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
++++ b/testcases/kernel/ipc/ipc_stress/shmem_test_04.c
+@@ -65,6 +65,7 @@
+ #include <signal.h>
+ #include <stdint.h>
+ #include <sys/mman.h>
++#include <sys/types.h>
+
+ #ifdef _LINUX_
+ typedef unsigned long ulong_t;
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch
new file mode 100644
index 000000000..4680c03d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch
@@ -0,0 +1,48 @@
+From 560347f77236616a635b4a997a0596b8da4d0799 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:08:25 +0000
+Subject: [PATCH 23/32] ptrace: Use int instead of enum __ptrace_request
+
+__ptrace_request is only available with glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/ptrace/ptrace03.c | 4 ++++
+ testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/testcases/kernel/syscalls/ptrace/ptrace03.c b/testcases/kernel/syscalls/ptrace/ptrace03.c
+index a4028fc..f1880cd 100644
+--- a/testcases/kernel/syscalls/ptrace/ptrace03.c
++++ b/testcases/kernel/syscalls/ptrace/ptrace03.c
+@@ -102,7 +102,11 @@ static pid_t unused_pid;
+ static pid_t zero_pid;
+
+ struct test_case_t {
++#ifdef __GLIBC__
+ enum __ptrace_request request;
++#else
++ int request;
++#endif
+ pid_t *pid;
+ int exp_errno;
+ } test_cases[] = {
+diff --git a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
+index ae538e9..85aa89d 100644
+--- a/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
++++ b/testcases/kernel/syscalls/ptrace/spawn_ptrace_child.h
+@@ -130,7 +130,11 @@ static char *strings[] = {
+ SPT(KILL)
+ SPT(SINGLESTEP)
+ };
++#ifdef __GLIBC__
+ static inline char *strptrace(enum __ptrace_request request)
++#else
++static inline char *strptrace(int request)
++#endif
+ {
+ return strings[request];
+ }
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch
new file mode 100644
index 000000000..03c67a52f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch
@@ -0,0 +1,68 @@
+From e01e9862c248dc90a8ec6f2d06f8469d7a50cd8e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:14:58 +0000
+Subject: [PATCH 24/32] rt_sigaction/rt_sigprocmark: Define _GNU_SOURCE
+
+Fixes musl build failure e.g.
+error: 'SA_NOMASK' undeclared here (not in a function)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c | 1 +
+ testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +-
+ testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c | 1 +
+ testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c | 1 +
+ 4 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
+index 5cf89cc..bdcb91a 100644
+--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
++++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c
+@@ -28,6 +28,7 @@
+ /* sigset_t type. */
+ /******************************************************************************/
+
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+index a1da743..8a27a0f 100644
+--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
++++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+@@ -23,7 +23,7 @@
+ /* Description: This tests the rt_sigaction() syscall */
+ /* rt_sigaction Expected EFAULT error check */
+ /******************************************************************************/
+-
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+index 175d220..e7627cd 100644
+--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
++++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+@@ -24,6 +24,7 @@
+ /* rt_sigaction Expected EINVAL error check */
+ /******************************************************************************/
+
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+diff --git a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
+index 74e5a61..75c57fc 100644
+--- a/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
++++ b/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c
+@@ -39,6 +39,7 @@
+ /* sigsetsize should indicate the size of a sigset_t type. */
+ /******************************************************************************/
+
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <signal.h>
+ #include <errno.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch
new file mode 100644
index 000000000..aad3cb037
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0025-mc_gethost-include-sys-types.h.patch
@@ -0,0 +1,28 @@
+From 9d14edfc12eefac900dd54729a88b3ccf91c1c43 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:18:15 +0000
+Subject: [PATCH 25/32] mc_gethost: include sys/types.h
+
+Fix build on musl
+error: unknown type name 'u_char'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/network/multicast/mc_gethost/mc_gethost.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c
+index 5b9a790..c799e2a 100644
+--- a/testcases/network/multicast/mc_gethost/mc_gethost.c
++++ b/testcases/network/multicast/mc_gethost/mc_gethost.c
+@@ -6,6 +6,7 @@
+
+ #include <sys/param.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <arpa/nameser.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch
new file mode 100644
index 000000000..58b8ed4d4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0026-crash01-Define-_GNU_SOURCE.patch
@@ -0,0 +1,29 @@
+From 0133a2b29d6f48d8e2bba6a3be581cdfa91311a6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:21:05 +0000
+Subject: [PATCH 26/32] crash01: Define _GNU_SOURCE
+
+Fixes musl build errors like
+error: 'SA_NOMASK' undeclared (first use in this function)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/misc/crash/crash01.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/misc/crash/crash01.c b/testcases/misc/crash/crash01.c
+index 0574521..08a02e7 100644
+--- a/testcases/misc/crash/crash01.c
++++ b/testcases/misc/crash/crash01.c
+@@ -49,7 +49,7 @@ stress test at the same time you run other tests, like a multi-user
+ benchmark.
+
+ */
+-
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
new file mode 100644
index 000000000..b47d0977e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch
@@ -0,0 +1,29 @@
+From 4a74b275acc8158850f2500928a1467c3482c986 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:23:11 +0000
+Subject: [PATCH 27/32] sysconf01: Use _SC_2_C_VERSION conditionally
+
+_SC_2_C_VERSION is not available on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/syscalls/sysconf/sysconf01.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/testcases/kernel/syscalls/sysconf/sysconf01.c b/testcases/kernel/syscalls/sysconf/sysconf01.c
+index 8542e77..e806943 100644
+--- a/testcases/kernel/syscalls/sysconf/sysconf01.c
++++ b/testcases/kernel/syscalls/sysconf/sysconf01.c
+@@ -102,7 +102,9 @@ int main(void)
+ test_sysconf(_SC_ATEXIT_MAX);
+ test_sysconf(_SC_2_C_BIND);
+ test_sysconf(_SC_2_C_DEV);
++#ifdef __GLIBC__
+ test_sysconf(_SC_2_C_VERSION);
++#endif
+ /* 21 - 25 */
+ test_sysconf(_SC_2_CHAR_TERM);
+ test_sysconf(_SC_2_FORT_DEV);
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
new file mode 100644
index 000000000..fc82ff923
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch
@@ -0,0 +1,43 @@
+From 94557fb7e1293c61145c959b8c5ffecf4a2b1069 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:24:44 +0000
+Subject: [PATCH 28/32] rt_sigaction.h: Use sighandler_t instead of
+ __sighandler_t
+
+When _GNU_SOURCE is used then both typedefs are same and using
+sighandler_t makes it work on musl too
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/lapi/rt_sigaction.h | 2 +-
+ testcases/kernel/syscalls/rt_sigsuspend/Makefile | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h
+index 3a5a763..870918c 100644
+--- a/include/lapi/rt_sigaction.h
++++ b/include/lapi/rt_sigaction.h
+@@ -34,7 +34,7 @@
+ #define INVAL_SA_PTR ((void *)-1)
+
+ struct kernel_sigaction {
+- __sighandler_t k_sa_handler;
++ sighandler_t k_sa_handler;
+ unsigned long sa_flags;
+ void (*sa_restorer) (void);
+ sigset_t sa_mask;
+diff --git a/testcases/kernel/syscalls/rt_sigsuspend/Makefile b/testcases/kernel/syscalls/rt_sigsuspend/Makefile
+index 37bc3a9..2ca7f7c 100644
+--- a/testcases/kernel/syscalls/rt_sigsuspend/Makefile
++++ b/testcases/kernel/syscalls/rt_sigsuspend/Makefile
+@@ -19,4 +19,7 @@
+ top_srcdir ?= ../../../..
+
+ include $(top_srcdir)/include/mk/testcases.mk
++
++CFLAGS += -D_GNU_SOURCE
++
+ include $(top_srcdir)/include/mk/generic_leaf_target.mk
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
new file mode 100644
index 000000000..f7ece9e18
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0029-trace_shed-Fix-build-with-musl.patch
@@ -0,0 +1,32 @@
+From 2f8a57f66a94210d34dd0361659a8297cf3d813f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:29:24 +0000
+Subject: [PATCH 29/32] trace_shed: Fix build with musl
+
+Errors on musl are
+
+trace_sched.c:425:16: error: invalid operands to binary & (have
+'thread_sched_t * {aka struct <anonymous> *}' and 'int')
+ thrd_ndx, WEXITSTATUS(status));
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/sched/tool/trace_sched.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/sched/tool/trace_sched.c b/testcases/kernel/sched/tool/trace_sched.c
+index 7815686..30dca5f 100644
+--- a/testcases/kernel/sched/tool/trace_sched.c
++++ b/testcases/kernel/sched/tool/trace_sched.c
+@@ -422,7 +422,7 @@ int main(int argc, /* number of input parameters. */
+ if (status == (thread_sched_t *) - 1) {
+ fprintf(stderr,
+ "thread [%d] - process exited with errors %d\n",
+- thrd_ndx, WEXITSTATUS(status));
++ thrd_ndx, WEXITSTATUS((int)status));
+ exit(-1);
+ } else {
+ exp_prio[thrd_ndx] = status->exp_prio;
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
new file mode 100644
index 000000000..d2d6d76fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch
@@ -0,0 +1,33 @@
+From 77c95dacffe90382a1f131c801ac569120d95949 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:32:24 +0000
+Subject: [PATCH 30/32] lib: Use PTHREAD_MUTEX_RECURSIVE in place of
+ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP for non-glibc
+
+e.g. musl does not implement the _NP mutex types
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/tst_res.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/lib/tst_res.c b/lib/tst_res.c
+index 5c1c58c..3244b5e 100644
+--- a/lib/tst_res.c
++++ b/lib/tst_res.c
+@@ -104,8 +104,11 @@ int TEST_ERRNO;
+ assert(strlen(buf) > 0); \
+ } while (0)
+
++#ifdef __GLIBC__
+ static pthread_mutex_t tmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+-
++#else
++static pthread_mutex_t tmutex = { PTHREAD_MUTEX_RECURSIVE };
++#endif
+ /*
+ * Define local function prototypes.
+ */
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
new file mode 100644
index 000000000..473ca4c65
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch
@@ -0,0 +1,33 @@
+From 293ff1da06748ed4c69be6ece262d42e562e7298 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 07:36:19 +0000
+Subject: [PATCH 31/32] vma03: fix page size offset as per page size alignment
+
+the offset the param of mmap2() doesn't align the page size, but,
+this param allow must be a multiple of the page size as returned
+by sysconf(_SC_PAGE_SIZE).meanwhile offset * 4096 must be a
+multiple of the system page size, so modify the input param of offset
+pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
+
+Signed-off-by: Chuang Dong <Chuang.Dong@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/mem/vma/vma03.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/mem/vma/vma03.c b/testcases/kernel/mem/vma/vma03.c
+index ad8a7b4..a539233 100644
+--- a/testcases/kernel/mem/vma/vma03.c
++++ b/testcases/kernel/mem/vma/vma03.c
+@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
+ if (fd == -1)
+ tst_brkm(TBROK | TERRNO, NULL, "open %s", TESTFILE);
+
+- pgoff = ULONG_MAX - 1;
++ pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
+ map = mmap2(NULL, pgsz, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+ fd, pgoff);
+ if (map == MAP_FAILED)
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
new file mode 100644
index 000000000..5c6bf919f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0032-regen.sh-Include-asm-unistd.h-explicitly.patch
@@ -0,0 +1,30 @@
+From 4f1905ff09c730091674818bd1b48ee221347101 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 8 Jan 2016 08:30:29 +0000
+Subject: [PATCH 32/32] regen.sh: Include asm/unistd.h explicitly
+
+on musl this is not included indirectly and it results in errors like
+testcases/kernel/include/linux_syscall_numbers.h:1035:25: error:
+'__NR_SYSCALL_BASE' undeclared (first use in this function)
+| # define __NR_readdir (__NR_SYSCALL_BASE+ 89)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ testcases/kernel/include/regen.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/testcases/kernel/include/regen.sh b/testcases/kernel/include/regen.sh
+index f93f49b..ee790af 100755
+--- a/testcases/kernel/include/regen.sh
++++ b/testcases/kernel/include/regen.sh
+@@ -32,6 +32,7 @@ cat << EOF > "${output_pid}"
+
+ #include <errno.h>
+ #include <sys/syscall.h>
++#include <asm/unistd.h>
+ #include "cleanup.c"
+
+ #define ltp_syscall(NR, ...) ({ \\
+--
+2.7.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch
new file mode 100644
index 000000000..868e1cf1f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch
@@ -0,0 +1,41 @@
+From 5e3dea669e5b0b769f322d54a3bb9f320b5327da Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Mar 2016 15:47:14 +0000
+Subject: [PATCH 26/26] shmat1: Cover GNU specific code under __USE_GNU
+
+on x86, we use uc_mcontext element from sigcontext
+which is marked gnu-specific in glibc, this patch
+adds this condition around the code
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ testcases/kernel/mem/mtest06/shmat1.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/kernel/mem/mtest06/shmat1.c b/testcases/kernel/mem/mtest06/shmat1.c
+index 0d6d7a4..bee69f6 100644
+--- a/testcases/kernel/mem/mtest06/shmat1.c
++++ b/testcases/kernel/mem/mtest06/shmat1.c
+@@ -111,7 +111,7 @@ int done_shmat = 0; /* disallow read and writes before shmat */
+ static void sig_handler(int signal, /* signal number, set to handle SIGALRM */
+ int code, struct ucontext *ut)
+ { /* contains pointer to sigcontext structure */
+-#ifdef __i386__
++#if defined(__i386__) && defined(__USE_GNU)
+ unsigned long except; /* exception type. */
+ int ret = 0; /* exit code from signal handler. */
+ struct sigcontext *scp = /* pointer to sigcontext structure */
+@@ -122,7 +122,7 @@ static void sig_handler(int signal, /* signal number, set to handle SIGALRM
+ fprintf(stdout, "Test ended, success\n");
+ exit(0);
+ }
+-#ifdef __i386__
++#if defined(__i386__) && defined(__USE_GNU)
+ else {
+ except = scp->trapno;
+ fprintf(stderr, "signal caught - [%d] ", signal);
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch
new file mode 100644
index 000000000..59caefe43
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0034-periodic_output.patch
@@ -0,0 +1,43 @@
+Add periodic output for long time test.
+
+This is needed in context of having scripts running ltp tests and
+waiting with a timeout for the output of the tests.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
+--- a/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh 2013-11-08 15:54:09.515049081 +0100
++++ b/testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh 2013-11-08 22:32:15.587370406 +0100
+@@ -37,7 +37,8 @@
+ exit 0
+ fi
+
+-RUN_TIME=$(( 60 * 60 ))
++ONE_MINUTE=60
++RUN_TIME=60
+
+ cleanup()
+ {
+@@ -62,7 +63,7 @@
+ # $1 - Number of cgroups
+ # $2 - Allocated how much memory in one process? in MB
+ # $3 - The interval to touch memory in a process
+-# $4 - How long does this test run ? in second
++# $4 - How long does this test run ? in minutes
+ run_stress()
+ {
+ do_mount;
+@@ -81,7 +82,11 @@
+ eval /bin/kill -s SIGUSR1 \$pid$i 2> /dev/null
+ done
+
+- sleep $4
++ for i in $(seq 0 $(($4-1)))
++ do
++ eval echo "Started $i min ago. Still alive... "
++ sleep $ONE_MINUTE
++ done
+
+ for i in $(seq 0 $(($1-1)))
+ do
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
new file mode 100644
index 000000000..32ae8aa27
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp/0035-fix-test_proc_kill-hang.patch
@@ -0,0 +1,23 @@
+Fix test_proc_kill hanging
+
+Sometimes the signal is delivered to memcg_process before the framework took
+into consideration its pid entered in the tasks. Fixed by delaying the signal
+send command.
+
+Signed-off-by: George Nita <george.nita@enea.com>
+Upstream-Status: Pending
+
+diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+index ffbe006..e81bf74 100755
+--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
++++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+@@ -220,8 +220,8 @@ test_proc_kill()
+
+ $TEST_PATH/memcg_process $2 -s $3 &
+ pid=$!
+- sleep 1
+ echo $pid > tasks
++ sleep 1
+
+ kill -s USR1 $pid 2> /dev/null
+ sleep 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb
new file mode 100644
index 000000000..097c16d57
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/ltp/ltp_20160126.bb
@@ -0,0 +1,109 @@
+SUMMARY = "Linux Test Project"
+DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features."
+HOMEPAGE = "http://ltp.sourceforge.net"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & GPLv2+ & LGPLv2+ & LGPLv2.1+ & BSD-2-Clause"
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://testcases/kernel/controllers/freezer/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://testcases/kernel/controllers/freezer/run_freezer.sh;beginline=5;endline=17;md5=86a61d2c042d59836ffb353a21456498 \
+ file://testcases/kernel/hotplug/memory_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
+ file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
+ file://testcases/open_posix_testsuite/COPYING;md5=216e43b72efbe4ed9017cc19c4c68b01 \
+ file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://tools/netpipe-2.4/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
+ file://tools/netpipe-2.4-ipv6/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
+ file://tools/top-LTP/proc/COPYING;md5=aefc88eb8a41672fbfcfe6b69ab8c49c \
+ file://tools/pounder21/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \
+"
+
+DEPENDS = "attr libaio libcap acl openssl zip-native"
+DEPENDS_append_libc-musl = " fts "
+EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
+CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
+CFLAGS_append_mips64 = " -D__SANE_USERSPACE_TYPES__"
+SRCREV = "fce797676b14f50406718e7ef640b50da66c9b36"
+
+SRC_URI = "git://github.com/linux-test-project/ltp.git \
+ file://0001-ltp-Don-t-link-against-libfl.patch \
+ file://0002-Add-knob-to-control-whether-numa-support-should-be-c.patch \
+ file://0003-Add-knob-to-control-tirpc-support.patch \
+ file://0004-build-Add-option-to-select-libc-implementation.patch \
+ file://0005-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
+ file://0006-sendfile-Use-off64_t-instead-of-__off64_t.patch \
+ file://0007-replace-SIGCLD-with-SIGCHLD.patch \
+ file://0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
+ file://0009-Guard-error.h-with-__GLIBC__.patch \
+ file://0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch \
+ file://0011-Rename-sigset-variable-to-sigset1.patch \
+ file://0012-fsstress.c-Replace-__int64_t-with-int64_t.patch \
+ file://0013-include-fcntl.h-for-getting-O_-definitions.patch \
+ file://0014-hyperthreading-Include-sys-types.h-for-pid_t-definit.patch \
+ file://0015-mincore01-Rename-PAGESIZE-to-pagesize.patch \
+ file://0016-ustat-Change-header-from-ustat.h-to-sys-ustat.h.patch \
+ file://0017-replace-sigval_t-with-union-sigval.patch \
+ file://0018-guard-mallocopt-with-__GLIBC__.patch \
+ file://0019-tomoyo-Replace-canonicalize_file_name-with-realpath.patch \
+ file://0020-getdents-define-getdents-getdents64-only-for-glibc.patch \
+ file://0021-Define-_GNU_SOURCE-for-MREMAP_MAYMOVE-definition.patch \
+ file://0022-include-sys-types.h.patch \
+ file://0023-ptrace-Use-int-instead-of-enum-__ptrace_request.patch \
+ file://0024-rt_sigaction-rt_sigprocmark-Define-_GNU_SOURCE.patch \
+ file://0025-mc_gethost-include-sys-types.h.patch \
+ file://0026-crash01-Define-_GNU_SOURCE.patch \
+ file://0027-sysconf01-Use-_SC_2_C_VERSION-conditionally.patch \
+ file://0028-rt_sigaction.h-Use-sighandler_t-instead-of-__sighand.patch \
+ file://0029-trace_shed-Fix-build-with-musl.patch \
+ file://0030-lib-Use-PTHREAD_MUTEX_RECURSIVE-in-place-of-PTHREAD_.patch \
+ file://0031-vma03-fix-page-size-offset-as-per-page-size-alignmen.patch \
+ file://0032-regen.sh-Include-asm-unistd.h-explicitly.patch \
+ file://0033-shmat1-Cover-GNU-specific-code-under-__USE_GNU.patch \
+ file://0034-periodic_output.patch \
+ file://0035-fix-test_proc_kill-hang.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+export prefix = "/opt/ltp"
+export exec_prefix = "/opt/ltp"
+
+PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl,"
+EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4"
+EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite "
+# ltp network/rpc test cases ftbfs when libtirpc is found
+EXTRA_OECONF += " --without-tirpc "
+
+# The makefiles make excessive use of make -C and several include testcases.mk
+# which triggers a build of the syscall header. To reproduce, build ltp,
+# then delete the header, then "make -j XX" and watch regen.sh run multiple
+# times. Its easier to generate this once here instead.
+do_compile_prepend () {
+ ( make -C ${B}/testcases/kernel include/linux_syscall_numbers.h )
+}
+
+do_install(){
+ install -d ${D}/opt/ltp/
+ oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install
+
+ # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual
+ cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases
+}
+
+RDEPENDS_${PN} = "perl e2fsprogs-mke2fs python-core libaio bash gawk expect ldd"
+
+FILES_${PN}-staticdev += "/opt/ltp/lib/libmem.a"
+
+FILES_${PN} += "/opt/ltp/* /opt/ltp/runtest/* /opt/ltp/scenario_groups/* /opt/ltp/testcases/bin/* /opt/ltp/testcases/bin/*/bin/* /opt/ltp/testscripts/* /opt/ltp/testcases/open_posix_testsuite/* /opt/ltp/testcases/open_posix_testsuite/conformance/* /opt/ltp/testcases/open_posix_testsuite/Documentation/* /opt/ltp/testcases/open_posix_testsuite/functional/* /opt/ltp/testcases/open_posix_testsuite/include/* /opt/ltp/testcases/open_posix_testsuite/scripts/* /opt/ltp/testcases/open_posix_testsuite/stress/* /opt/ltp/testcases/open_posix_testsuite/tools/*"
+
+# Avoid generated binaries stripping. Otherwise some of the ltp tests such as ldd01 & nm01 fails
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+# However, test_arch_stripped is already stripped, so...
+INSANE_SKIP_${PN} += "already-stripped"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch
new file mode 100644
index 000000000..77da33321
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch
@@ -0,0 +1,59 @@
+From: Luk Claes <luk@debian.org>
+Date: Sat, 4 Jul 2009 10:54:53 +0200
+Subject: Don't reuse weak symbol optopt to fix FTBFS on mips*
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ getopt.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/getopt.c b/getopt.c
+index 83ce628..82e983c 100644
+--- a/getopt.c
++++ b/getopt.c
+@@ -43,7 +43,7 @@ typedef int ssize_t;
+ char *optarg;
+ int optind = 1;
+ int opterr = 1;
+-int optopt;
++int optoptc;
+
+ static void
+ error(const char *s, int c)
+@@ -69,7 +69,7 @@ error(const char *s, int c)
+ *bp++ = *s++;
+ while (*msg)
+ *bp++ = *msg++;
+- *bp++ = optopt;
++ *bp++ = optoptc;
+ *bp++ = '\n';
+ write(2, buf, bp - buf);
+ ac_free(buf);
+@@ -101,13 +101,13 @@ getopt(int argc, char *const argv[], const char *optstring)
+ }
+ curp = &argv[optind][1];
+ }
+- optopt = curp[0] & 0377;
++ optoptc = curp[0] & 0377;
+ while (optstring[0]) {
+ if (optstring[0] == ':') {
+ optstring++;
+ continue;
+ }
+- if ((optstring[0] & 0377) == optopt) {
++ if ((optstring[0] & 0377) == optoptc) {
+ if (optstring[1] == ':') {
+ if (curp[1] != '\0') {
+ optarg = (char *)&curp[1];
+@@ -127,7 +127,7 @@ getopt(int argc, char *const argv[], const char *optstring)
+ optind++;
+ optarg = 0;
+ }
+- return optopt;
++ return optoptc;
+ }
+ optstring++;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch
new file mode 100644
index 000000000..6bad433ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch
@@ -0,0 +1,41 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Wed, 27 Apr 2011 00:18:42 +0200
+Subject: Patched out SSL2 support since it is no longer supported by OpenSSL.
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ mailx.1 | 2 +-
+ openssl.c | 4 +---
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/mailx.1 b/mailx.1
+index 417ea04..a02e430 100644
+--- a/mailx.1
++++ b/mailx.1
+@@ -3575,7 +3575,7 @@ Only applicable if SSL/TLS support is built using OpenSSL.
+ .TP
+ .B ssl-method
+ Selects a SSL/TLS protocol version;
+-valid values are `ssl2', `ssl3', and `tls1'.
++valid values are `ssl3', and `tls1'.
+ If unset, the method is selected automatically,
+ if possible.
+ .TP
+diff --git a/openssl.c b/openssl.c
+index b4e33fc..44fe4e5 100644
+--- a/openssl.c
++++ b/openssl.c
+@@ -216,9 +216,7 @@ ssl_select_method(const char *uhp)
+
+ cp = ssl_method_string(uhp);
+ if (cp != NULL) {
+- if (equal(cp, "ssl2"))
+- method = SSLv2_client_method();
+- else if (equal(cp, "ssl3"))
++ if (equal(cp, "ssl3"))
+ method = SSLv3_client_method();
+ else if (equal(cp, "tls1"))
+ method = TLSv1_client_method();
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch
new file mode 100644
index 000000000..13b73ae59
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch
@@ -0,0 +1,25 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Sat, 14 Apr 2012 20:22:43 +0200
+Subject: Fixed Lintian warning (warning: macro `N' not defined)
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ mailx.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mailx.1 b/mailx.1
+index a02e430..b0723bd 100644
+--- a/mailx.1
++++ b/mailx.1
+@@ -3781,7 +3781,7 @@ you could examine the first message by giving the command:
+ .sp
+ .fi
+ which might cause
+-.N mailx
++.I mailx
+ to respond with, for example:
+ .nf
+ .sp
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch
new file mode 100644
index 000000000..13b955c4b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch
@@ -0,0 +1,71 @@
+From 9984ae5cb0ea0d61df1612b06952a61323c083d9 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 11:13:38 +0100
+Subject: [PATCH 1/4] outof: Introduce expandaddr flag
+
+Document that address expansion is disabled unless the expandaddr
+binary option is set.
+
+This has been assigned CVE-2014-7844 for BSD mailx, but it is not
+a vulnerability in Heirloom mailx because this feature was documented.
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+CVE: CVE-2014-7844
+---
+ mailx.1 | 14 ++++++++++++++
+ names.c | 3 +++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/mailx.1 b/mailx.1
+index 70a7859..22a171b 100644
+--- a/mailx.1
++++ b/mailx.1
+@@ -656,6 +656,14 @@ but any reply returned to the machine
+ will have the system wide alias expanded
+ as all mail goes through sendmail.
+ .SS "Recipient address specifications"
++If the
++.I expandaddr
++option is not set (the default), recipient addresses must be names of
++local mailboxes or Internet mail addresses.
++.PP
++If the
++.I expandaddr
++option is set, the following rules apply:
+ When an address is used to name a recipient
+ (in any of To, Cc, or Bcc),
+ names of local mail folders
+@@ -2391,6 +2399,12 @@ and exits immediately.
+ If this option is set,
+ \fImailx\fR starts even with an empty mailbox.
+ .TP
++.B expandaddr
++Causes
++.I mailx
++to expand message recipient addresses, as explained in the section,
++Recipient address specifications.
++.TP
+ .B flipr
+ Exchanges the
+ .I Respond
+diff --git a/names.c b/names.c
+index 66e976b..c69560f 100644
+--- a/names.c
++++ b/names.c
+@@ -268,6 +268,9 @@ outof(struct name *names, FILE *fo, struct header *hp)
+ FILE *fout, *fin;
+ int ispipe;
+
++ if (value("expandaddr") == NULL)
++ return names;
++
+ top = names;
+ np = names;
+ time(&now);
+--
+1.9.3
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch
new file mode 100644
index 000000000..8cdbfd8b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch
@@ -0,0 +1,79 @@
+From e34e2ac67b80497080ebecccec40c3b61456167d Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 11:14:06 +0100
+Subject: [PATCH 2/4] unpack: Disable option processing for email addresses
+ when calling sendmail
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ extern.h | 2 +-
+ names.c | 8 ++++++--
+ sendout.c | 2 +-
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/extern.h b/extern.h
+index 6b85ba0..8873fe8 100644
+--- a/extern.h
++++ b/extern.h
+@@ -396,7 +396,7 @@ struct name *outof(struct name *names, FILE *fo, struct header *hp);
+ int is_fileaddr(char *name);
+ struct name *usermap(struct name *names);
+ struct name *cat(struct name *n1, struct name *n2);
+-char **unpack(struct name *np);
++char **unpack(struct name *smopts, struct name *np);
+ struct name *elide(struct name *names);
+ int count(struct name *np);
+ struct name *delete_alternates(struct name *np);
+diff --git a/names.c b/names.c
+index c69560f..45bbaed 100644
+--- a/names.c
++++ b/names.c
+@@ -549,7 +549,7 @@ cat(struct name *n1, struct name *n2)
+ * Return an error if the name list won't fit.
+ */
+ char **
+-unpack(struct name *np)
++unpack(struct name *smopts, struct name *np)
+ {
+ char **ap, **top;
+ struct name *n;
+@@ -564,7 +564,7 @@ unpack(struct name *np)
+ * the terminating 0 pointer. Additional spots may be needed
+ * to pass along -f to the host mailer.
+ */
+- extra = 2;
++ extra = 3 + count(smopts);
+ extra++;
+ metoo = value("metoo") != NULL;
+ if (metoo)
+@@ -581,6 +581,10 @@ unpack(struct name *np)
+ *ap++ = "-m";
+ if (verbose)
+ *ap++ = "-v";
++ for (; smopts != NULL; smopts = smopts->n_flink)
++ if ((smopts->n_type & GDEL) == 0)
++ *ap++ = smopts->n_name;
++ *ap++ = "--";
+ for (; n != NULL; n = n->n_flink)
+ if ((n->n_type & GDEL) == 0)
+ *ap++ = n->n_name;
+diff --git a/sendout.c b/sendout.c
+index 7b7f2eb..c52f15d 100644
+--- a/sendout.c
++++ b/sendout.c
+@@ -835,7 +835,7 @@ start_mta(struct name *to, struct name *mailargs, FILE *input,
+ #endif /* HAVE_SOCKETS */
+
+ if ((smtp = value("smtp")) == NULL) {
+- args = unpack(cat(mailargs, to));
++ args = unpack(mailargs, to);
+ if (debug || value("debug")) {
+ printf(catgets(catd, CATSET, 181,
+ "Sendmail arguments:"));
+--
+1.9.3
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch
new file mode 100644
index 000000000..5558d8639
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch
@@ -0,0 +1,113 @@
+From 2bae8ecf04ec2ba6bb9f0af5b80485dd0edb427d Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 12:48:25 +0100
+Subject: [PATCH 3/4] fio.c: Unconditionally require wordexp support
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ fio.c | 67 +++++--------------------------------------------------------------
+ 1 file changed, 5 insertions(+), 62 deletions(-)
+
+diff --git a/fio.c b/fio.c
+index 65e8f10..1529236 100644
+--- a/fio.c
++++ b/fio.c
+@@ -43,12 +43,15 @@ static char sccsid[] = "@(#)fio.c 2.76 (gritter) 9/16/09";
+ #endif /* not lint */
+
+ #include "rcv.h"
++
++#ifndef HAVE_WORDEXP
++#error wordexp support is required
++#endif
++
+ #include <sys/stat.h>
+ #include <sys/file.h>
+ #include <sys/wait.h>
+-#ifdef HAVE_WORDEXP
+ #include <wordexp.h>
+-#endif /* HAVE_WORDEXP */
+ #include <unistd.h>
+
+ #if defined (USE_NSS)
+@@ -481,7 +484,6 @@ next:
+ static char *
+ globname(char *name)
+ {
+-#ifdef HAVE_WORDEXP
+ wordexp_t we;
+ char *cp;
+ sigset_t nset;
+@@ -527,65 +529,6 @@ globname(char *name)
+ }
+ wordfree(&we);
+ return cp;
+-#else /* !HAVE_WORDEXP */
+- char xname[PATHSIZE];
+- char cmdbuf[PATHSIZE]; /* also used for file names */
+- int pid, l;
+- char *cp, *shell;
+- int pivec[2];
+- extern int wait_status;
+- struct stat sbuf;
+-
+- if (pipe(pivec) < 0) {
+- perror("pipe");
+- return name;
+- }
+- snprintf(cmdbuf, sizeof cmdbuf, "echo %s", name);
+- if ((shell = value("SHELL")) == NULL)
+- shell = SHELL;
+- pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NULL);
+- if (pid < 0) {
+- close(pivec[0]);
+- close(pivec[1]);
+- return NULL;
+- }
+- close(pivec[1]);
+-again:
+- l = read(pivec[0], xname, sizeof xname);
+- if (l < 0) {
+- if (errno == EINTR)
+- goto again;
+- perror("read");
+- close(pivec[0]);
+- return NULL;
+- }
+- close(pivec[0]);
+- if (wait_child(pid) < 0 && WTERMSIG(wait_status) != SIGPIPE) {
+- fprintf(stderr, catgets(catd, CATSET, 81,
+- "\"%s\": Expansion failed.\n"), name);
+- return NULL;
+- }
+- if (l == 0) {
+- fprintf(stderr, catgets(catd, CATSET, 82,
+- "\"%s\": No match.\n"), name);
+- return NULL;
+- }
+- if (l == sizeof xname) {
+- fprintf(stderr, catgets(catd, CATSET, 83,
+- "\"%s\": Expansion buffer overflow.\n"), name);
+- return NULL;
+- }
+- xname[l] = 0;
+- for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--)
+- ;
+- cp[1] = '\0';
+- if (strchr(xname, ' ') && stat(xname, &sbuf) < 0) {
+- fprintf(stderr, catgets(catd, CATSET, 84,
+- "\"%s\": Ambiguous.\n"), name);
+- return NULL;
+- }
+- return savestr(xname);
+-#endif /* !HAVE_WORDEXP */
+ }
+
+ /*
+--
+1.9.3
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch
new file mode 100644
index 000000000..ae14b8acf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch
@@ -0,0 +1,31 @@
+From 73fefa0c1ac70043ec84f2d8b8f9f683213f168d Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 13:11:32 +0100
+Subject: [PATCH 4/4] globname: Invoke wordexp with WRDE_NOCMD (CVE-2004-2771)
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+CVE: CVE-2004-2771
+---
+ fio.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fio.c b/fio.c
+index 1529236..774a204 100644
+--- a/fio.c
++++ b/fio.c
+@@ -497,7 +497,7 @@ globname(char *name)
+ sigemptyset(&nset);
+ sigaddset(&nset, SIGCHLD);
+ sigprocmask(SIG_BLOCK, &nset, NULL);
+- i = wordexp(name, &we, 0);
++ i = wordexp(name, &we, WRDE_NOCMD);
+ sigprocmask(SIG_UNBLOCK, &nset, NULL);
+ switch (i) {
+ case 0:
+--
+1.9.3
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch
new file mode 100644
index 000000000..2b5991425
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch
@@ -0,0 +1,38 @@
+Description: Sendmail is at /usr/sbin/sendmail
+ As per Debian Policy §11.6
+Author: Ryan Kavanagh <rak@debian.org>
+Origin: Debian
+Forwarded: no
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: heirloom-mailx-12.5/Makefile
+===================================================================
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+
+--- heirloom-mailx-12.5.orig/Makefile 2011-04-26 17:23:22.000000000 -0400
++++ heirloom-mailx-12.5/Makefile 2015-01-27 13:20:04.733542801 -0500
+@@ -13,7 +13,7 @@
+
+ MAILRC = $(SYSCONFDIR)/nail.rc
+ MAILSPOOL = /var/mail
+-SENDMAIL = /usr/lib/sendmail
++SENDMAIL = /usr/sbin/sendmail
+
+ DESTDIR =
+
+Index: heirloom-mailx-12.5/mailx.1
+===================================================================
+--- heirloom-mailx-12.5.orig/mailx.1 2015-01-27 13:18:49.000000000 -0500
++++ heirloom-mailx-12.5/mailx.1 2015-01-27 13:20:32.382336867 -0500
+@@ -4922,7 +4922,7 @@
+ which just acts as a proxy.
+ .PP
+ \fIMailx\fR immediately contacts the SMTP server (or
+-.IR \%/usr/lib/sendmail )
++.IR \%/usr/sbin/sendmail )
+ even when operating in
+ .I disconnected
+ mode.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch
new file mode 100644
index 000000000..b74fd0472
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch
@@ -0,0 +1,46 @@
+krb5 support is autodetected from sysroot making builds undeterministic
+feel free to improve this to support explicitly enabling/disabling it
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- a/makeconfig 2013-07-21 15:06:11.177792334 +0200
++++ b/makeconfig 2013-07-21 15:07:20.028793994 +0200
+@@ -424,36 +424,6 @@
+ }
+ !
+
+-<$tmp2.c link_check gssapi 'for GSSAPI in libgss' \
+- '#define USE_GSSAPI' '-lgss' ||
+- <$tmp2.c link_check gssapi 'for GSSAPI in libgssapi_krb5' \
+- '#define USE_GSSAPI' '-lgssapi_krb5' ||
+- link_check gssapi 'for GSSAPI in libgssapi_krb5, old-style' \
+- '#define USE_GSSAPI
+-#define GSSAPI_OLD_STYLE' '-lgssapi_krb5' <<\! || \
+- link_check gssapi 'for GSSAPI in libgssapi' \
+- '#define USE_GSSAPI
+-#define GSSAPI_REG_INCLUDE' '-lgssapi' <<\%
+-#include <gssapi/gssapi.h>
+-#include <gssapi/gssapi_generic.h>
+-
+-int main(void)
+-{
+- gss_import_name(0, 0, gss_nt_service_name, 0);
+- gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
+- return 0;
+-}
+-!
+-#include <gssapi.h>
+-
+-int main(void)
+-{
+- gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
+- gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
+- return 0;
+-}
+-%
+-
+ cat >$tmp2.c <<\!
+ #include "config.h"
+ #ifdef HAVE_NL_LANGINFO
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mailx/mailx_12.5-5.bb b/import-layers/yocto-poky/meta/recipes-extended/mailx/mailx_12.5-5.bb
new file mode 100644
index 000000000..4a32d2f68
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mailx/mailx_12.5-5.bb
@@ -0,0 +1,52 @@
+SUMMARY = "mailx is the traditional command-line-mode mail user agent"
+
+DESCRIPTION = "Mailx is derived from Berkeley Mail and is intended provide the \
+functionality of the POSIX mailx command with additional support \
+for MIME, IMAP, POP3, SMTP, and S/MIME."
+
+HOMEPAGE = "http://heirloom.sourceforge.net/mailx.html"
+SECTION = "console/network"
+LICENSE = "BSD & MPL-1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4202a0a62910cf94f7af8a3436a2a2dd"
+
+DEPENDS = "openssl"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/h/heirloom-mailx/heirloom-mailx_12.5.orig.tar.gz;name=archive \
+ file://0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch \
+ file://0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch \
+ file://0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch \
+ file://0011-outof-Introduce-expandaddr-flag.patch \
+ file://0012-unpack-Disable-option-processing-for-email-addresses.patch \
+ file://0013-fio.c-Unconditionally-require-wordexp-support.patch \
+ file://0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch \
+ file://0015-usr-sbin-sendmail.patch \
+ file://explicitly.disable.krb5.support.patch \
+ "
+
+SRC_URI[archive.md5sum] = "29a6033ef1412824d02eb9d9213cb1f2"
+SRC_URI[archive.sha256sum] = "015ba4209135867f37a0245d22235a392b8bbed956913286b887c2e2a9a421ad"
+
+# for this package we're mostly interested in tracking debian patches,
+# and not in the upstream version where all development has effectively stopped
+UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
+
+S = "${WORKDIR}/heirloom-mailx-12.5"
+
+inherit autotools-brokensep
+
+CFLAGS_append = " -D_BSD_SOURCE -DDEBIAN -I${S}/EXT"
+
+# "STRIP=true" means that 'true' command will be used to 'strip' files which will achieve the effect of not stripping them
+# mailx's Makefile doesn't allow a more straightforward way to avoid stripping
+EXTRA_OEMAKE = "SENDMAIL=${sbindir}/sendmail IPv6=-DHAVE_IPv6_FUNCS PREFIX=/usr UCBINSTALL=/usr/bin/install STRIP=true"
+
+# The makeconfig can't run parallelly, otherwise the checking results
+# might be incorrect and lead to errors:
+# fio.c:56:17: fatal error: ssl.h: No such file or directory
+# #include <ssl.h>
+PARALLEL_MAKE = ""
+
+# Causes gcc to get stuck and eat all available memory in qemuarm builds
+# http://errors.yoctoproject.org/Errors/Details/20488/
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.04.bb b/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.04.bb
new file mode 100644
index 000000000..65df0aad3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man-pages/man-pages_4.04.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Linux man-pages"
+DESCRIPTION = "The Linux man-pages project documents the Linux kernel and C library interfaces that are employed by user programs"
+SECTION = "console/utils"
+HOMEPAGE = "http://www.kernel.org/pub/linux/docs/man-pages"
+LICENSE = "GPLv2+"
+
+LIC_FILES_CHKSUM = "file://README;md5=8f2a3d43057d458e5066714980567a60"
+SRC_URI = "${KERNELORG_MIRROR}/linux/docs/${BPN}/Archive/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "901cd52e0ee2a9d7508ae1ab15d5e835"
+SRC_URI[sha256sum] = "bff072462baea8d1b8e4568759324c5ed6c760716fe830bca71129cc09e00668"
+
+RDEPENDS_${PN} = "man"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+}
+
+# Only deliveres man-pages so FILES_${PN} gets everything
+FILES_${PN}-doc = ""
+FILES_${PN} = "${mandir}/*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "passwd.5 getspnam.3"
+ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
+ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/configure_sed.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/configure_sed.patch
new file mode 100644
index 000000000..d49e6831d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/configure_sed.patch
@@ -0,0 +1,32 @@
+man: replace ',' with '#'
+
+Sometimes, the parameters of CC/BUILD_CC contains the ',', which
+cause the sed command failed, so replace the ',' with '#'
+
+Upstream-Status: Pending
+
+Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 9f62cf9..9a565ae 100755
+--- a/configure
++++ b/configure
+@@ -1321,9 +1321,9 @@ do
+ echo "Creating $infile from $infile.in"
+ sed -e '
+ s,@version@,$version,
+-s,@CC@,$CC,
++s#@CC@#$CC#
+ s,@EXEEXT@,$EXEEXT,
+-s,@BUILD_CC@,$BUILD_CC,
++s#@BUILD_CC@#$BUILD_CC#
+ s,@INSTALL@,$INSTALL,
+ s,@DEFS@,$DEFS,
+ s,@LIBS@,$LIBS,
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch
new file mode 100644
index 000000000..6f834bd01
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -u -r man-1.5g.old/configure man-1.5g/configure
+--- man-1.5g.old/configure Wed Apr 7 04:16:05 1999
++++ man-1.5g/configure Mon May 15 15:22:44 2000
+@@ -791,7 +791,7 @@
+ read mode
+ if test "$mode" != ""; then man_mode=$mode; fi
+ fi
+- man_install_flags="-m $man_mode -o $man_user -g $man_group"
++ man_install_flags=""
+ fi
+
+ # What sections do we anticipate?
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-gencat.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-gencat.patch
new file mode 100644
index 000000000..044b14c50
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-gencat.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- gencat/genlib.c 2006-08-02 20:11:44.000000000 +0200
++++ gencat/genlib.c.oden 2008-12-21 19:18:50.000000000 +0100
+@@ -47,6 +47,7 @@ up-to-date. Many thanks.
+ 01/14/91 4 nazgul Off by one on number specified entries
+ */
+
++#undef _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #ifdef SYSV
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-make.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-make.patch
new file mode 100644
index 000000000..8631eb2c5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5h1-make.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5g/man/Makefile.in.mike Fri Apr 9 13:35:54 1999
++++ man-1.5g/man/Makefile.in Fri Apr 9 13:36:45 1999
+@@ -1,8 +1,8 @@
+ # only executed from a subdir
+ MAN1 = man whatis apropos
+-MAN5 = man.conf
++MAN5 = man.config
+ MAN8 = makewhatis
+-ALL = man.1 whatis.1 apropos.1 man.conf.5
++ALL = man.1 whatis.1 apropos.1 man.config.5
+ MAYBE8 = makewhatis
+
+ .SUFFIXES: .man .1 .5 .8
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-initial.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-initial.patch
new file mode 100644
index 000000000..fe56c0706
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-initial.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5i2/src/makewhatis.sh.initial Tue Jul 3 15:38:39 2001
++++ man-1.5i2/src/makewhatis.sh Tue Jul 3 15:39:39 2001
+@@ -81,8 +81,10 @@
+ continue;;
+ -s) setsections=1
+ continue;;
+- -u) findarg="-newer /var/cache/man/whatis"
+- update=1
++ -u) if [ -e /var/cache/man/whatis ]; then
++ findarg="-newer /var/cache/man/whatis"
++ update=1
++ fi
+ continue;;
+ -v) verbose=1
+ continue;;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-newline.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-newline.patch
new file mode 100644
index 000000000..611df5d25
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-newline.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- src/man.c 2008-12-21 19:17:31.000000000 +0100
++++ src/man.c.oden 2008-12-21 19:17:38.000000000 +0100
+@@ -391,7 +391,7 @@ again:
+ beg++;
+
+ end = beg;
+- while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0')
++ while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0' && (end-buf)<BUFSIZE)
+ end++; /* note that buf is NUL-terminated */
+ *end = '\0';
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-overflow.patch
new file mode 100644
index 000000000..52d2881a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5i2-overflow.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5i2/src/man.c.overflow Mon Jun 25 00:01:45 2001
++++ man-1.5i2/src/man.c Mon Jun 25 00:01:45 2001
+@@ -381,6 +381,9 @@
+ strcat(name, "/");
+ strcat(name, beg);
+ }
++ /* If this is too long, bad things have already happened. *
++ * we should quit IMMEDIATELY. */
++ if(strlen(name)>sizeof(ultname)) _exit(1);
+
+ goto again;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-i18n.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-i18n.patch
new file mode 100644
index 000000000..2ae09c0ea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-i18n.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/msgs/inst.sh.i18n Wed Apr 25 10:40:50 2001
++++ man-1.5j/msgs/inst.sh Wed Apr 25 10:41:17 2001
+@@ -27,8 +27,7 @@
+ for j in $M; do
+ if [ -f $j ]; then
+ i=`echo $j | sed -e 's/mess.//; s/.cat//'`
+- dest=`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
+- dest=${PREFIX}$dest
++ dest=${PREFIX}/`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
+ echo "mkdir -p `dirname $dest`"
+ mkdir -p `dirname $dest`;
+ echo "install -c -m 644 $j $dest"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-nocache.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-nocache.patch
new file mode 100644
index 000000000..751dddd53
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-nocache.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/src/man.conf.in.nocache Thu Nov 22 15:07:12 2001
++++ man-1.5j/src/man.conf.in Thu Nov 22 15:07:12 2001
+@@ -81,6 +81,9 @@
+ #
+ #NOCACHE
+ #
++# NOCACHE keeps man from creating cache pages
++NOCACHE
++#
+ # Useful paths - note that COL should not be defined when
+ # NROFF is defined as "groff -Tascii" or "groff -Tlatin1";
+ # not only is it superfluous, but it actually damages the output.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-utf8.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-utf8.patch
new file mode 100644
index 000000000..33d3e4c97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5j-utf8.patch
@@ -0,0 +1,61 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/configure.utf8 Thu Nov 22 15:02:35 2001
++++ man-1.5j/configure Thu Nov 22 15:03:15 2001
+@@ -408,9 +408,9 @@
+ Fgawk=/bin/gawk
+ Fawk=/bin/gawk
+ Fmawk=missing
+- troff=""
+- nroff=""
+- jnroff=""
++ troff=/usr/bin/troff
++ nroff=/usr/bin/nroff
++ jnroff=/usr/bin/nroff
+ eqn=""
+ neqn=""
+ jneqn=""
+@@ -453,6 +453,8 @@
+ done
+ done
+ Fgroff=/usr/bin/groff
++ Fnroff=/usr/bin/nroff
++ Fjnroff=/usr/bin/nroff
+ Fgeqn=/usr/bin/geqn
+ Fgtbl=/usr/bin/gtbl
+ Fcol=/usr/bin/col
+@@ -485,25 +487,25 @@
+ then
+ if test $Fnroff = "missing"
+ then
+- nroff="nroff -Tlatin1 -mandoc"
++ nroff="nroff -Tutf8 -mandoc"
+ else
+- nroff="$Fnroff -Tlatin1 -mandoc"
++ nroff="$Fnroff -Tutf8 -mandoc"
+ fi
+ troff="troff -mandoc"
+ echo "Warning: could not find groff"
+ else
+ if test $Fnroff = "missing"
+ then
+- nroff="$Fgroff -Tlatin1 -mandoc"
++ nroff="$Fgroff -Tutf8 -mandoc"
+ else
+- nroff="$Fnroff -Tlatin1 -mandoc"
++ nroff="$Fnroff -Tutf8 -mandoc"
+ fi
+ troff="$Fgroff -Tps -mandoc"
+- jnroff="$Fgroff -Tnippon -mandocj"
++ jnroff="$Fjnroff -Tutf8 -mandocj"
+ fi
+ eqn="$Fgeqn -Tps"
+- neqn="$Fgeqn -Tlatin1"
+- jneqn="$Fgeqn -Tnippon"
++ neqn="$Fgeqn -Tutf8"
++ jneqn="$Fgeqn -Tutf8"
+ tbl="$Fgtbl"
+ col="$Fcol"
+ vgrind="$Fvgrind"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-confpath.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-confpath.patch
new file mode 100644
index 000000000..b5746c2df
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-confpath.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- configure 2006-05-01 19:56:14.000000000 +0200
++++ configure.oden 2008-12-21 19:16:50.000000000 +0100
+@@ -198,7 +198,7 @@
+ confdir="${confprefix}/share/misc"
+ fi
+ fi
+-conffilename="man.conf"
++conffilename="man.config"
+
+ if test "$RANDOM" = "$RANDOM"; then
+ # Plain old Bourne shell.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-nonascii.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-nonascii.patch
new file mode 100644
index 000000000..d662d9b6a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-nonascii.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- ./src/apropos.sh.nonascii 2001-11-23 00:30:42.000000000 +0100
++++ ./src/apropos.sh 2002-08-13 15:44:53.000000000 +0200
+@@ -18,9 +18,9 @@
+
+ # When man pages in your favorite locale look to grep like binary files
+ # (and you use GNU grep) you may want to add the 'a' option to *grepopt1.
+-aproposgrepopt1='i'
++aproposgrepopt1='ia'
+ aproposgrepopt2=''
+-whatisgrepopt1='iw'
++whatisgrepopt1='iwa'
+ whatisgrepopt2='^'
+ grepopt1=$%apropos_or_whatis%grepopt1
+ grepopt2=$%apropos_or_whatis%grepopt2
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-sofix.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-sofix.patch
new file mode 100644
index 000000000..50b925288
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5k-sofix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/src/man.c.sofix Thu Nov 22 14:51:44 2001
++++ man-1.5j/src/man.c Thu Nov 22 14:52:44 2001
+@@ -300,7 +300,7 @@
+
+ if (strlen(name0) >= sizeof(ultname))
+ return name0;
+- strcpy(ultname, name0);
++ strncpy(ultname, name0, BUFSIZE-32);
+ name = ultname;
+
+ again:
+@@ -332,7 +332,7 @@
+ * .so files - we could glob for all possible extensions,
+ * for now: only try .gz
+ */
+- else if (fp == NULL && get_expander(".gz") &&
++ if (fp == NULL && get_expander(".gz") &&
+ strlen(name)+strlen(".gz") < BUFSIZE) {
+ strcat(name, ".gz");
+ fp = fopen (name, "r");
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch
new file mode 100644
index 000000000..051299906
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- ./configure.ad 2003-12-11 19:17:10.000000000 +0100
++++ ./configure 2003-12-11 19:17:27.000000000 +0100
+@@ -26,7 +26,7 @@
+ # (Indeed, -r may cause the terminal to get into funny states.
+ # Very inconvenient. For viewing pages in strange locales, set LC_*.)
+ #
+-DEFAULTLESSOPT="-is"
++DEFAULTLESSOPT="-isr"
+ #
+ # Note that not creating any cat directories (/var/cache/man or so)
+ # and not making man suid or sgid is recommended.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch
new file mode 100644
index 000000000..bc97f56b9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch
@@ -0,0 +1,52 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- ./configure.less 2003-12-11 19:18:15.000000000 +0100
++++ ./configure 2003-12-11 19:20:03.000000000 +0100
+@@ -401,18 +401,13 @@
+
+ if test "$ans" = "false"
+ then
+- for i in more less cmp cat awk gawk mawk
+- do
+- eval F$i="missing"
+- for j in $DEFPATH
+- do
+- if test -f $j/$i
+- then
+- eval F$i=$j/$i
+- break
+- fi
+- done
+- done
++ Fmore=/bin/more
++ Fless=/usr/bin/less
++ Fcmp=/usr/bin/cmp
++ Fcat=/bin/cat
++ Fgawk=/bin/gawk
++ Fawk=/bin/gawk
++ Fmawk=missing
+ troff=""
+ nroff=""
+ jnroff=""
+@@ -457,6 +452,19 @@
+ fi
+ done
+ done
++ Fgroff=/usr/bin/groff
++ Fgeqn=/usr/bin/geqn
++ Fgtbl=/usr/bin/gtbl
++ Fcol=/usr/bin/col
++ Fgrefer=/usr/bin/grefer
++ Fgpic=/usr/bin/gpic
++ Fmore=/bin/more
++ Fless=/usr/bin/less
++ Fcmp=/usr/bin/cmp
++ Fcat=/bin/cat
++ Fgawk=/bin/gawk
++
++
+ for i in eqn tbl refer pic
+ do
+ if test `eval echo \\$Fg$i` = "missing"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch
new file mode 100644
index 000000000..c85ff1d8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5m2/configure.color 2006-09-16 18:27:37.000000000 +0200
++++ man-1.5m2/configure 2006-09-16 18:28:44.000000000 +0200
+@@ -539,6 +539,8 @@
+ troff="$troff -c"
+ nroff="$nroff -c"
+ jnroff="$jnroff -c"
++else
++ troff="$troff -c"
+ fi
+
+ if [ x$default = x ]; then
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch
new file mode 100644
index 000000000..8af78eab7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5m2/src/util.c_sigpipe 2006-12-09 13:43:21.000000000 +0100
++++ man-1.5m2/src/util.c 2006-12-09 13:53:13.000000000 +0100
+@@ -116,11 +116,14 @@
+ static int
+ system1 (const char *command) {
+ void (*prev_handler)(int) = signal (SIGINT,catch_int);
++ signal (SIGPIPE,SIG_IGN);
+ int ret = system(command);
+
+ /* child terminated with signal? */
+ if (WIFSIGNALED(ret) &&
+- (WTERMSIG(ret) == SIGINT || WTERMSIG(ret) == SIGQUIT))
++ (WTERMSIG(ret) == SIGINT ||
++ WTERMSIG(ret) == SIGPIPE ||
++ WTERMSIG(ret) == SIGQUIT))
+ exit(1);
+
+ /* or we caught an interrupt? */
+@@ -128,6 +131,7 @@
+ exit(1);
+
+ signal(SIGINT,prev_handler);
++ signal(SIGPIPE,SIG_DFL);
+ return ret;
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch
new file mode 100644
index 000000000..e321325d6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch
@@ -0,0 +1,145 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Naur man-1.6e.orig/src/apropos.sh man-1.6e/src/apropos.sh
+--- man-1.6e.orig/src/apropos.sh 2007-05-18 13:49:31.000000000 -0300
++++ man-1.6e/src/apropos.sh 2007-05-18 14:24:33.000000000 -0300
+@@ -60,16 +60,56 @@
+ esac
+ done
+
++# list of languages to look for
++LANG_LIST=`echo $LANGUAGE:$LC_ALL:$LC_MESSAGES:$LANG | tr ':' ' '`
++DIR_LIST=""
++for d in /var/cache/man $manpath /usr/lib
++do
++ for l in $LANG_LIST
++ do
++ if [ -d $d/$l ]
++ then
++ # check that the path is not already in the list
++ if ! echo "$DIR_LIST" | grep " $d/$l\b" > /dev/null
++ then
++ DIR_LIST="$DIR_LIST $d/$l"
++ fi
++ fi
++ done
++ DIR_LIST="$DIR_LIST $d"
++ # check that the path is not already in the list
++ if ! echo "$DIR_LIST" | grep " $d\b" > /dev/null
++ then
++ DIR_LIST="$DIR_LIST $d/$l"
++ fi
++done
++
+ while [ "$1" != "" ]
+ do
+ found=0
+- for d in /var/cache/man $manpath /usr/lib
++ # in order not to display lines in more than one language for
++ # a same man page; we check that a given man page name
++ # hasn't already been displayed
++ BAZ=""
++ for d in $DIR_LIST
+ do
+ if [ -f $d/whatis ]
+ then
+- if grep -"$grepopt1" "$grepopt2""$1" $d/whatis
++ if FOO=`grep -"$grepopt1" "$grepopt2""$1" $d/whatis`
+ then
+- found=1
++ # the LC_ALL=C is needed in case the text is
++ # in a different encoding than the locale
++ BAR=`echo -e "$FOO" | LC_ALL=C sed 's/ - .*$//' | tr ' []' '_' | sort -u`
++ for i in $BAR
++ do
++ if ! echo "$BAZ" | grep "$i" > /dev/null
++ then
++ BAZ="$BAZ $i"
++ i="^`echo $i | sed 's:_\+:\\\(\[_ \]\\\|\\\[\\\|\\\]\\\)\\\+:g'`"
++ echo -e "$FOO" | grep "$i"
++ found=1
++ fi
++ done
+ # Some people are satisfied with a single occurrence
+ # But it is better to give all
+ # break
+diff -Naur man-1.6e.orig/src/makewhatis.sh man-1.6e/src/makewhatis.sh
+--- man-1.6e.orig/src/makewhatis.sh 2007-05-18 13:49:31.000000000 -0300
++++ man-1.6e/src/makewhatis.sh 2007-05-18 13:50:07.000000000 -0300
+@@ -41,12 +41,32 @@
+
+ program=`basename $0`
+
++# this allows to define language specific values fro NAME, DESCRIPTION
++# if not defined, using those default values
++if [ -z "$MAN_NAME" ]
++then
++ MAN_NAME="ĐМЕ|NOM|JMÉNO|NAVN|ΟΝΟΜΑ|NOMBRE|NIME|IZENA|NIMI|IME|\
++NÉV|NOME|ĺŤĺ‰Ť|이름|NAAM|NAZWA|NUME|ĐМЯ|MENO|ĐťĐĐ—Đ’Đ|ĺŤç§°|ĺŤç¨±"
++fi
++if [ -z "$MAN_DESCRIPTION" ]
++then
++ MAN_DESCRIPTION="ОПĐСĐĐťĐĐ•|DESCRIPCIĂ“|POPIS|BESKRIVELSE|BESCHREIBUNG|\
++ΠΕΡΙΓΡΑΦΗ|DESCRIPCIĂ“N|KIRJELDUS|AZALPENA|KUVAUS|OPIS|LEĂŤRĂS|DESCRIZIONE|\
++説ćŽ|설명|BESCHRIJVING|DESCRIÇĂO|DESCRIERE|ОПĐС|描述"
++fi
++# make them into awk regexp
++MAN_NAME="^(${MAN_NAME})";
++MAN_DESCRIPTION="^(${MAN_DESCRIPTION})";
++
+ # In case both /usr/man and /usr/share/man exist, the former is local
+ # and should be first.
+ # It is a bug to add /var/cache/man to DEFCATPATH.
+ dm=
+ for d in /usr/share/man /usr/man /usr/X11R6/man /usr/local/man
+ do
++ if [ -n "$LANG" -a -d "$d/$LANG" ]; then
++ if [ x$dm = x ]; then dm="$d/$LANG"; else dm=$dm:"$d/$LANG"; fi
++ fi
+ if [ -d $d ]; then
+ if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi
+ fi
+@@ -55,6 +75,9 @@
+ dc=
+ for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat /usr/share/man /usr/man
+ do
++ if [ -n "$LANG" -a -d "$d/$LANG" ]; then
++ if [ x$dc = x ]; then dm="$d/$LANG"; else dm=$dc:"$d/$LANG"; fi
++ fi
+ if [ -d $d ]; then
+ if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
+ fi
+@@ -194,7 +217,7 @@
+ section=$i
+ curdir=$mandir/${pages}$i
+ export section verbose curdir
+- find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
++ find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | LC_ALL=C $AWK -v MAN_NAME="$MAN_NAME" -v MAN_DESCRIPTION="$MAN_DESCRIPTION" '
+
+ function readline() {
+ if (use_zcat || use_bzcat) {
+@@ -261,13 +284,7 @@
+ gsub(/.\b/, "");
+ if (($1 ~ /^\.[Ss][Hh]/ &&
+ ($2 ~ /[Nn][Aa][Mm][Ee]/ ||
+- $2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
+- $2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
+- $2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
+- $2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^ĚľÁ°/ ||
+- $2 ~ /^ĚľľÎ/ || $2 ~ /^Ŕ̸§/ || $2 ~ /^NAZWA/ ||
+- $2 ~ /^îáú÷áîéĺ/ || $2 ~ /^ĂűłĆ/ || $2 ~ /^¦WşŮ/ ||
+- $2 ~ /^NOME/ || $2 ~ /^NAAM/ || $2 ~ /^ČĚĹ/)) ||
++ $2 ~ MAN_NAME )) ||
+ (pages == "cat" && $1 ~ /^NAME/)) {
+ if (!insh) {
+ insh = 1;
+@@ -278,6 +295,7 @@
+ if ($1 ~ /^\.[Ss][HhYS]/ ||
+ (pages == "cat" &&
+ ($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
++ $1 ~ MAN_DESCRIPTION ||
+ $1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
+ $1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
+ $0 ~ /^[^ ]/))) {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-mandirs.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-mandirs.patch
new file mode 100644
index 000000000..b240064c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-mandirs.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.6e.orig/src/man.conf.in 2005-08-20 20:26:06.000000000 -0300
++++ man-1.6e/src/man.conf.in 2007-05-18 10:30:29.000000000 -0300
+@@ -36,11 +36,12 @@
+ #
+ # Every automatically generated MANPATH includes these fields
+ #
+-MANPATH /usr/man
+ MANPATH /usr/share/man
++MANPATH /usr/X11R6/man
+ MANPATH /usr/local/man
+ MANPATH /usr/local/share/man
+-MANPATH /usr/X11R6/man
++MANPATH /usr/kerberos/man
++MANPATH /usr/man
+ #
+ # Uncomment if you want to include one of these by default
+ #
+@@ -67,6 +68,9 @@
+ MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man
+ MANPATH_MAP /usr/bin/X11 /usr/X11R6/man
+ MANPATH_MAP /usr/bin/mh /usr/share/man
++MANPATH_MAP /usr/kerberos/bin /usr/kerberos/man
++MANPATH_MAP /usr/kerberos/sbin /usr/kerberos/man
++
+ #
+ # NOAUTOPATH keeps man from automatically adding directories that look like
+ # manual page directories to the path.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-new_sections.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-new_sections.patch
new file mode 100644
index 000000000..fb9773c64
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-new_sections.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.6e.orig/configure 2006-05-01 14:56:14.000000000 -0300
++++ man-1.6e/configure 2007-05-18 14:35:43.000000000 -0300
+@@ -960,7 +960,7 @@
+
+ # What sections do we anticipate?
+
+-tmpsections="1 1p 8 2 3 3p 4 5 6 7 9 0p tcl n l p o"
++tmpsections="1 1p 8 2 3 3p 3pm 4 5 6 7 9 0p tcl n l p o"
+
+ if [ x$default = x ]; then
+ echo ""
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch
new file mode 100644
index 000000000..1d1cb0c72
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: man-1.6f/src/makewhatis.sh
+===================================================================
+--- man-1.6f.orig/src/makewhatis.sh 2010-12-29 13:42:34.000000000 -0800
++++ man-1.6f/src/makewhatis.sh 2010-12-29 13:42:35.667428347 -0800
+@@ -124,7 +124,7 @@
+ continue;;
+ -s) setsections=1
+ continue;;
+- -u) findarg="-ctime 0"
++ -u) findarg="-newer /var/cache/man/whatis"
+ update=1
+ continue;;
+ -v) verbose=1
+@@ -165,14 +165,7 @@
+ # first truncate all the whatis files that will be created new,
+ # then only update - we might visit the same directory twice
+ if [ x$update = x ]; then
+- for pages in man cat
+- do
+- eval path="\$$pages"path
+- for mandir in $path
+- do
+- cp /dev/null $mandir/whatis
+- done
+- done
++ cp /dev/null /var/cache/man/whatis
+ fi
+
+ for pages in man cat
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-security.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-security.patch
new file mode 100644
index 000000000..312a882f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-security.patch
@@ -0,0 +1,62 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Naur man-1.6e.orig/src/makewhatis.sh man-1.6e/src/makewhatis.sh
+--- man-1.6e.orig/src/makewhatis.sh 2006-07-19 01:58:08.000000000 -0300
++++ man-1.6e/src/makewhatis.sh 2007-05-18 10:18:31.000000000 -0300
+@@ -45,7 +45,7 @@
+ # and should be first.
+ # It is a bug to add /var/cache/man to DEFCATPATH.
+ dm=
+-for d in /usr/man /usr/share/man /usr/X11R6/man /usr/local/man
++for d in /usr/share/man /usr/man /usr/X11R6/man /usr/local/man
+ do
+ if [ -d $d ]; then
+ if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi
+@@ -53,7 +53,7 @@
+ done
+ DEFMANPATH=$dm
+ dc=
+-for d in /usr/man/preformat /usr/man /usr/share/man/preformat /usr/share/man
++for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat /usr/share/man /usr/man
+ do
+ if [ -d $d ]; then
+ if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
+@@ -76,12 +76,12 @@
+ # We try here to be careful (and avoid preconstructed symlinks)
+ # in case makewhatis is run as root, by creating a subdirectory of /tmp.
+
+-TMPFILEDIR=/tmp/whatis.tmp.dir.$$
+-rm -rf $TMPFILEDIR
+-if ! mkdir -m 0700 $TMPFILEDIR; then
+- echo Could not create $TMPFILEDIR
+- exit 1;
++TMPFILEDIR=`mktemp -d /tmp/makewhatisXXXXXX`
++if [ $? -ne 0 ]; then
++ echo "$0: Can't create temp file, exiting..."
++ exit 1
+ fi
++chmod 0700 $TMPFILEDIR
+ TMPFILE=$TMPFILEDIR/w
+
+ # make sure TMPFILEDIR is deleted if program is killed or terminates
+diff -Naur man-1.6e.orig/src/man.c man-1.6e/src/man.c
+--- man-1.6e.orig/src/man.c 2006-05-01 17:34:22.000000000 -0300
++++ man-1.6e/src/man.c 2007-05-18 10:11:33.000000000 -0300
+@@ -1234,7 +1234,6 @@
+ #endif
+
+
+-#if 0
+ {
+ /* There are no known cases of buffer overflow caused by
+ excessively long environment variables. In case you find one,
+@@ -1257,7 +1256,6 @@
+ MAN_ICONV_PATH, MAN_ICONV_OPT, MAN_ICONV_INPUT_CHARSET,
+ MAN_ICONV_OUTPUT_CHARSET, NLSPATH, PATH */
+ }
+-#endif
+
+
+ #ifndef __FreeBSD__
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch
new file mode 100644
index 000000000..568f74210
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch
@@ -0,0 +1,160 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Naur man-1.6e.orig/catopen/catopen.c man-1.6e/catopen/catopen.c
+--- man-1.6e.orig/catopen/catopen.c 2005-08-20 20:26:06.000000000 -0300
++++ man-1.6e/catopen/catopen.c 2007-05-18 11:31:05.000000000 -0300
+@@ -9,22 +9,63 @@
+ extern char *index (const char *, int); /* not always in <string.h> */
+ extern char *my_malloc(int); /* in util.c */
+
++/* if the program has sgid/suid privileges then getenv doesn't return
++ * NLSPATH; so we set here a good default value.
++ */
+ #ifndef DEFAULT_NLSPATH
+ # if __GLIBC__ >= 2
+-# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N"
++# define DEFAULT_NLSPATH "/usr/share/locale/%L/%N:/usr/share/locale/%l_%t/%N:/usr/share/locale/%l/%N"
+ # else
+ # define DEFAULT_NLSPATH "/usr/lib/locale/%N/%L"
+ # endif
+ #endif
+
+-static nl_catd my_catopenpath(char *name, char *path);
++static nl_catd my_catopenpath(char *name, char *path, char *lang);
+
+ static /* this source included in gripes.c */
+ nl_catd
+ my_catopen(char *name, int oflag) {
+- nl_catd fd;
++ nl_catd fd = (nl_catd) -1;
++
++ /* using first the my_catopenpath, which looks with LANGUAGE
++ * and only if it fails ressort to catopen, it gives better i18n
++ */
++ {
++ char *nlspath, *lang, *s;
+
+- fd = catopen(name, oflag);
++ /*
++ * "If NLSPATH does not exist in the environment, or if a
++ * message catalog cannot be opened in any of the paths specified
++ * by NLSPATH, then an implementation defined default path is used"
++ */
++ nlspath = getenv("NLSPATH");
++ if (!nlspath)
++ nlspath = DEFAULT_NLSPATH;
++
++ lang = getenv("LANGUAGE");
++ if (!lang)
++ lang = getenv("LC_ALL");
++ if (!lang)
++ lang = getenv("LC_MESSAGES");
++ if (!lang)
++ lang = getenv("LANG");
++ if (!lang)
++ lang = "";
++
++ while(*lang && (fd == (nl_catd) -1)) {
++ s = index(lang, ':');
++ if (s) *s = 0;
++ fd = my_catopenpath(name, nlspath, lang);
++ if (s) lang=s+1;
++ else lang = "";
++ }
++ if (fd == (nl_catd) -1)
++ fd = my_catopenpath(name, nlspath, "en");
++ }
++
++ /* still not found, use the system catopen */
++ if (fd == (nl_catd) -1)
++ fd = catopen(name, oflag);
+
+ if (fd == (nl_catd) -1 && oflag) {
+ oflag = 0;
+@@ -32,8 +73,6 @@
+ }
+
+ if (fd == (nl_catd) -1) {
+- char *nlspath;
+-
+ /* The libc catopen fails - let us see if we can do better */
+ /* The quotes below are from X/Open, XPG 1987, Vol. 3. */
+
+@@ -58,17 +97,6 @@
+ #endif
+ }
+
+- /*
+- * "If NLSPATH does not exist in the environment, or if a
+- * message catalog cannot be opened in any of the paths specified
+- * by NLSPATH, then an implementation defined default path is used"
+- */
+-
+- nlspath = getenv("NLSPATH");
+- if (nlspath)
+- fd = my_catopenpath(name, nlspath);
+- if (fd == (nl_catd) -1)
+- fd = my_catopenpath(name, DEFAULT_NLSPATH);
+ }
+ return fd;
+ }
+@@ -90,15 +118,13 @@
+ *
+ */
+ static nl_catd
+-my_catopenpath(char *name, char *nlspath) {
+- int fd;
++my_catopenpath(char *name, char *nlspath, char *lang) {
+ nl_catd cfd = (nl_catd) -1;
+- char *path0, *path, *s, *file, *lang, *lang_l, *lang_t, *lang_c;
++ char *path0, *path, *s, *file, *lang_l, *lang_t, *lang_c;
+ int langsz, namesz, sz, lang_l_sz, lang_t_sz, lang_c_sz;
+
+ namesz = strlen(name);
+
+- lang = getenv("LANG");
+ if (!lang)
+ lang = "";
+ langsz = strlen(lang);
+@@ -194,14 +220,9 @@
+ path = s+1;
+ } else
+ path = 0;
+- fd = open(file, O_RDONLY);
+- if (fd != -1) {
+- /* we found the right catalog - but we don't know the
+- type of nl_catd, so close it again and ask libc */
+- close(fd);
+- cfd = catopen(file, 0);
+- break;
+- }
++ cfd = catopen(file, 0);
++ if (cfd != (nl_catd) -1)
++ break;
+ }
+
+ free(path0);
+diff -Naur man-1.6e.orig/src/manpath.c man-1.6e/src/manpath.c
+--- man-1.6e.orig/src/manpath.c 2006-08-03 18:18:33.000000000 -0300
++++ man-1.6e/src/manpath.c 2007-05-18 11:02:48.000000000 -0300
+@@ -282,13 +282,14 @@
+ /* We cannot use "lang = setlocale(LC_MESSAGES, NULL)" or so:
+ the return value of setlocale is an opaque string. */
+ /* POSIX prescribes the order: LC_ALL, LC_MESSAGES, LANG */
+- if((lang = getenv("LC_ALL")) != NULL)
++ /* LANGUAGE is GNU/Linux and overrules all */
++ if((lang = getenv("LANGUAGE")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+- if((lang = getenv("LC_MESSAGES")) != NULL)
++ else if((lang = getenv("LC_ALL")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+- if((lang = getenv("LANG")) != NULL)
++ else if((lang = getenv("LC_MESSAGES")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+- if((lang = getenv("LANGUAGE")) != NULL)
++ else if((lang = getenv("LANG")) != NULL)
+ split2(dir, lang, add_to_mandirlist_x, perrs);
+ add_to_mandirlist_x(dir, 0, perrs);
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-whatis2.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-whatis2.patch
new file mode 100644
index 000000000..fc4ed3135
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6e-whatis2.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: man-1.6f/src/makewhatis.sh
+===================================================================
+--- man-1.6f.orig/src/makewhatis.sh 2010-12-29 13:51:45.000000000 -0800
++++ man-1.6f/src/makewhatis.sh 2010-12-29 13:59:35.399799412 -0800
+@@ -164,10 +164,15 @@
+ fi
+ catpath=`echo ${catpath} | tr : ' '`
+
++#WHATIS_DIR=$DESTDIR/var/cache/man/`echo $here|sed -e 's!.*/man/!!g'`
++WHATIS_DIR=$DESTDIR/var/cache/man/$LANG
++[[ -d $WHATIS_DIR ]] || mkdir -p $WHATIS_DIR/
++
+ # first truncate all the whatis files that will be created new,
+ # then only update - we might visit the same directory twice
+ if [ x$update = x ]; then
+- cp /dev/null /var/cache/man/whatis
++ mkdir -p $WHATIS_DIR/
++ /bin/echo -n > $WHATIS_DIR/whatis
+ fi
+
+ for pages in man cat
+@@ -180,13 +185,7 @@
+ echo "about to enter $mandir" > /dev/stderr
+ fi
+
+- # kludge for Slackware's /usr/man/preformat
+- if [ $mandir = /usr/man/preformat ]
+- then
+- mandir1=/usr/man
+- else
+- mandir1=$mandir
+- fi
++ mandir1=$WHATIS_DIR
+
+ # if $mandir is on a readonly partition, and the whatis file
+ # is not a symlink, then let's skip trying to update it
+@@ -207,11 +206,6 @@
+ fi
+ fi
+
+- if [ -s ${mandir}/whatis -a $pages = man -a x$update = x ]; then
+- if [ x$verbose != x ]; then
+- echo skipping $mandir - we did it already > /dev/stderr
+- fi
+- else
+ here=`pwd`
+ cd $mandir
+ for i in $sections
+@@ -447,7 +447,6 @@
+
+ chmod 644 ${mandir1}/whatis
+ rm $TMPFILE
+- fi
+ done
+ done
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-compile-warnings.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-compile-warnings.patch
new file mode 100644
index 000000000..4631d2d06
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-compile-warnings.patch
@@ -0,0 +1,105 @@
+Fix a build error when building man.config.5 (a remnant of a long
+ago previous patch). Optimized the manpages Makefile for parallel
+builds. Also, fix compile warnings in a couple other files.
+
+Upstream-Status: Pending
+
+Signed-off-by: Bill Randle <william.c.randle@intel.com>
+
+--- man-1.6g/man/Makefile.in.orig 2016-03-28 17:31:08.723949180 -0700
++++ man-1.6g/man/Makefile.in 2016-03-28 17:46:12.866910386 -0700
+@@ -5,6 +5,13 @@
+ ALL = man.1 whatis.1 apropos.1 man.config.5
+ MAYBE8 = makewhatis
+
++SUBDIRS := $(shell echo @languages@)
++
++.PHONY: subdirs $(SUBDIRS)
++
++man.config.man: man.conf.man
++ @cp $< $@
++
+ .SUFFIXES: .man .1 .5 .8
+
+ .man.1:
+@@ -19,11 +26,11 @@
+ INSTALL = @INSTALL@ -c -m 644
+
+ # Where to put the manual pages.
+-mandir = $(DESTDIR)$(PREFIX)@mandir@$(SLANG)
++mandir := $(DESTDIR)$(PREFIX)@mandir@$(SLANG)
+
+ all: $(ALL)
+ for i in $(MAYBE8); \
+- do if test -f $$i.man; then make -f ../Makefile $$i.8; fi; done
++ do if test -f $$i.man; then $(MAKE) -f ../Makefile $$i.8; fi; done
+
+ install: $(ALL)
+ mkdir -p $(mandir)/man1 $(mandir)/man5 $(mandir)/man8
+@@ -38,24 +45,27 @@
+ rm -f core *.in *.@man1ext@ *.@man5ext@ *.@man8ext@ *~
+
+ spotless:
++ rm -f man.config.man
+
+ subdirs:
+- @for i in @languages@; do if test -d $$i; then echo; \
+- echo "==== Making the `cat $$i.txt` man pages. ===="; \
+- cd $$i; make -f ../Makefile; cd ..; \
+- else echo "==== No $$i man pages found. ===="; fi; done
++subdirs: $(SUBDIRS)
++$(SUBDIRS):
++ if test -d $@; then echo; \
++ echo "==== Making the `cat $@.txt` man pages. ===="; \
++ $(MAKE) -C $@ -f ../Makefile all; \
++ else echo "==== No $@ man pages found. ===="; fi
+
+ installsubdirs:
+ @for i in @languages@; do if test -d $$i; then echo; \
+ echo "==== Installing the `cat $$i.txt` man pages. ===="; \
+ cd $$i; SLANG=/$$i; if test $$SLANG = /en; then SLANG= ; fi; \
+- export SLANG; make -f ../Makefile install; cd ..; \
++ export SLANG; $(MAKE) -f ../Makefile install; cd ..; \
+ else echo "==== No $$i man pages found. ===="; fi; done
+
+ cleansubdirs:
+- @for i in ??; do cd $$i; make -f ../Makefile clean; cd ..; done
++ @for i in ??; do $(MAKE) -C $$i -f ../Makefile clean; done
+ rm -f core *~
+
+ spotlesssubdirs:
+- for i in ??; do cd $$i; make -f ../Makefile spotless; cd ..; done
++ for i in ??; do $(MAKE) -C $$i -f ../Makefile spotless; done
+ rm -f Makefile
+
+--- man-1.6g/src/gripes.c.orig 2006-11-21 11:53:44.000000000 -0800
++++ man-1.6g/src/gripes.c 2016-03-30 16:32:31.601103487 -0700
+@@ -7,8 +7,6 @@
+
+ extern char *msg[];
+
+-static char *mantexts = "man"; /* e.g. /usr/lib/locale/%L/man.cat */
+-
+ #ifdef NONLS
+
+ static char *
+@@ -30,6 +28,8 @@
+ #include <nl_types.h>
+ #include "../catopen/catopen.c"
+
++static char *mantexts = "man"; /* e.g. /usr/lib/locale/%L/man.cat */
++
+ nl_catd catfd = (nl_catd) -1;
+ int cat_is_open = 0;
+
+--- man-1.6g/src/manfile.c.orig 2005-08-20 16:26:06.000000000 -0700
++++ man-1.6g/src/manfile.c 2016-03-29 09:10:21.527841285 -0700
+@@ -299,7 +299,7 @@
+ const char *((*tocat)(const char *man_filename, const char *ext,
+ int flags))) {
+ char **sl;
+- struct manpage *res;
++ struct manpage *res = 0;
+
+ standards = (flags & (FHS | FSSTND | DO_HP | DO_IRIX));
+ to_cat_filename = tocat;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-configure.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-configure.patch
new file mode 100644
index 000000000..106cc9878
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-configure.patch
@@ -0,0 +1,68 @@
+Use BUILD_CC and target include files for configuration tests.
+If cross-compiling, force pathnames for helper programs, since
+autodiscovery by the configure script will not work.
+
+Upstream-Status: Pending
+
+Signed-off-by: Bill Randle <william.c.randle at intel.com>
+
+--- man-1.6g/configure.orig 2016-03-28 17:46:12.734910976 -0700
++++ man-1.6g/configure 2016-03-30 21:47:45.110572908 -0700
+@@ -216,7 +216,8 @@
+ INCLUDEDIR=${INCLUDEDIR-/usr/include}
+
+ rm -f conftest conftest.c
+-compile="$CC $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1"
++# since we are interested in target feature support, use that sysroot
++compile="$BUILD_CC -isystem/${PKG_CONFIG_SYSROOT_DIR}/usr/include $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1"
+
+ # Check for various header files.
+
+@@ -455,19 +456,23 @@
+ fi
+ done
+ done
+- Fgroff=/usr/bin/groff
+- Fnroff=/usr/bin/nroff
+- Fjnroff=/usr/bin/nroff
+- Fgeqn=/usr/bin/geqn
+- Fgtbl=/usr/bin/gtbl
+- Fcol=/usr/bin/col
+- Fgrefer=/usr/bin/grefer
+- Fgpic=/usr/bin/gpic
+- Fmore=/bin/more
+- Fless=/usr/bin/less
+- Fcmp=/usr/bin/cmp
+- Fcat=/bin/cat
+- Fgawk=/bin/gawk
++ if [ $BUILD_CC != $CC ]; then
++ # cross compiling => target fs not available, so force defaults
++ Fgroff=/usr/bin/groff
++ Fnroff=/usr/bin/nroff
++ Fjnroff=/usr/bin/nroff
++ Fgeqn=/usr/bin/eqn
++ Fgneqn=/usr/bin/neqn
++ Fgtbl=/usr/bin/tbl
++ Fcol=/usr/bin/col
++ Fgrefer=/usr/bin/refer
++ Fgpic=/usr/bin/pic
++ Fmore=/bin/more
++ Fless=/usr/bin/less
++ Fcmp=/usr/bin/cmp
++ Fcat=/bin/cat
++ Fgawk=/usr/bin/gawk
++ fi
+
+
+ for i in eqn tbl refer pic
+@@ -507,8 +512,8 @@
+ jnroff="$Fjnroff -Tutf8 -mandocj"
+ fi
+ eqn="$Fgeqn -Tps"
+- neqn="$Fgeqn -Tutf8"
+- jneqn="$Fgeqn -Tutf8"
++ neqn="$Fgneqn -Tutf8"
++ jneqn="$Fgneqn -Tutf8"
+ tbl="$Fgtbl"
+ col="$Fcol"
+ vgrind="$Fvgrind"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-parallel.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-parallel.patch
new file mode 100644
index 000000000..72a88b898
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-parallel.patch
@@ -0,0 +1,30 @@
+The Makefile for man has a rule to create two generated targets with
+a program run from the shell. Because the rule was run twice, with
+parallel make, the generated files were being overwritten at the same
+time they were being compiled. This patch forces the rule to be run
+only once.
+
+Upstream-Status: Pending
+
+Signed-off-by: Bill Randle <william.c.randle at intel.com>
+
+--- man-1.6g/src/Makefile.in.orig 2010-12-31 12:28:46.000000000 -0800
++++ man-1.6g/src/Makefile.in 2016-03-28 09:09:16.845458798 -0700
+@@ -43,8 +43,10 @@
+ makemsg:
+ $(BUILD_CC) -o makemsg makemsg.c
+
+-msg.c gripedefs.h: ../msgs/mess.en makemsg
++msg.c gripedefs.h: genfiles-stamp
++genfiles-stamp: ../msgs/mess.en makemsg
+ ./makemsg ../msgs/mess.en gripedefs.h msg.c
++ touch genfiles-stamp
+
+ # glob.c does not have prototypes
+ glob.o: glob.c ndir.h
+@@ -117,4 +119,4 @@
+
+ spotless: clean
+ rm -f Makefile config.status paths.h version.h man.conf
+- rm -f gripedefs.h msg.c mess.*.cat
++ rm -f gripedefs.h msg.c mess.*.cat genfiles-stamp
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-whatis3.patch b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-whatis3.patch
new file mode 100644
index 000000000..633445685
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man-1.6g-whatis3.patch
@@ -0,0 +1,20 @@
+Do not use absolute path for awk while getting the path of awk
+when running makewhatis.
+This can avoid errors if path of awk changes.
+
+Upstream-Status: Submitted [man-1.6g]
+
+Signed-off-by: Jian Liu <jian.liu@windriver.com>
+
+diff -Nur man-1.6g.orig/src/makewhatis.sh man-1.6g/src/makewhatis.sh
+--- man-1.6g.orig/src/makewhatis.sh 2015-02-25 16:13:12.657611419 +0800
++++ man-1.6g/src/makewhatis.sh 2015-02-25 16:14:49.334694815 +0800
+@@ -67,7 +67,7 @@
+ # but that leads to problems and bugs.
+
+ # AWK=/usr/bin/gawk
+-AWK=@awk@
++AWK=`which awk`
+
+ # Find a place for our temporary files. If security is not a concern, use
+ # TMPFILE=/tmp/whatis$$; TMPFILEDIR=none
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man.1.gz b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.1.gz
new file mode 100644
index 000000000..c36804515
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.1.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man.7.gz b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.7.gz
new file mode 100644
index 000000000..e85af8242
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.7.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/man.conf b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.conf
new file mode 100644
index 000000000..fc10be275
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/man.conf
@@ -0,0 +1,141 @@
+#
+# Generated automatically from man.conf.in by the
+# configure script.
+#
+# man.conf from man-1.5p
+#
+# For more information about this file, see the man pages man(1)
+# and man.conf(5).
+#
+# This file is read by man to configure the default manpath (also used
+# when MANPATH contains an empty substring), to find out where the cat
+# pages corresponding to given man pages should be stored,
+# and to map each PATH element to a manpath element.
+# It may also record the pathname of the man binary. [This is unused.]
+# The format is:
+#
+# MANBIN pathname
+# MANPATH manpath_element [corresponding_catdir]
+# MANPATH_MAP path_element manpath_element
+#
+# If no catdir is given, it is assumed to be equal to the mandir
+# (so that this dir has both man1 etc. and cat1 etc. subdirs).
+# This is the traditional Unix setup.
+# Certain versions of the FSSTND recommend putting formatted versions
+# of /usr/.../man/manx/page.x into /var/catman/.../catx/page.x.
+# The keyword FSSTND will cause this behaviour.
+# Certain versions of the FHS recommend putting formatted versions of
+# /usr/.../share/man/[locale/]manx/page.x into
+# /var/cache/man/.../[locale/]catx/page.x.
+# The keyword FHS will cause this behaviour (and overrides FSSTND).
+# Explicitly given catdirs override.
+#
+# FSSTND
+FHS
+#
+# This file is also read by man in order to find how to call nroff, less, etc.,
+# and to determine the correspondence between extensions and decompressors.
+#
+# MANBIN /usr/local/bin/man
+#
+# Every automatically generated MANPATH includes these fields
+#
+MANPATH /usr/man
+MANPATH /usr/share/man
+MANPATH /usr/local/man
+MANPATH /usr/local/share/man
+MANPATH /usr/X11R6/man
+#
+# Uncomment if you want to include one of these by default
+#
+# MANPATH /opt/*/man
+# MANPATH /usr/lib/*/man
+# MANPATH /usr/share/*/man
+# MANPATH /usr/kerberos/man
+#
+# Set up PATH to MANPATH mapping
+#
+# If people ask for "man foo" and have "/dir/bin/foo" in their PATH
+# and the docs are found in "/dir/man", then no mapping is required.
+#
+# The below mappings are superfluous when the right hand side is
+# in the mandatory manpath already, but will keep man from statting
+# lots of other nearby files and directories.
+#
+MANPATH_MAP /bin /usr/share/man
+MANPATH_MAP /sbin /usr/share/man
+MANPATH_MAP /usr/bin /usr/share/man
+MANPATH_MAP /usr/sbin /usr/share/man
+MANPATH_MAP /usr/local/bin /usr/local/share/man
+MANPATH_MAP /usr/local/sbin /usr/local/share/man
+MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man
+MANPATH_MAP /usr/bin/X11 /usr/X11R6/man
+MANPATH_MAP /usr/bin/mh /usr/share/man
+#
+# NOAUTOPATH keeps man from automatically adding directories that look like
+# manual page directories to the path.
+#
+#NOAUTOPATH
+#
+# NOCACHE keeps man from creating cache pages ("cat pages")
+# (generally one enables/disable cat page creation by creating/deleting
+# the directory they would live in - man never does mkdir)
+#
+#NOCACHE
+#
+# Useful paths - note that COL should not be defined when
+# NROFF is defined as "groff -Tascii" or "groff -Tlatin1";
+# not only is it superfluous, but it actually damages the output.
+# For use with utf-8, NROFF should be "nroff -mandoc" without -T option.
+# (Maybe - but today I need -Tlatin1 to prevent double conversion to utf8.)
+#
+# If you have a new troff (version 1.18.1?) and its colored output
+# causes problems, add the -c option to TROFF, NROFF, JNROFF.
+#
+TROFF /usr/bin/groff -Tps -mandoc
+NROFF /usr/bin/nroff -Tlatin1 -mandoc
+JNROFF /usr/bin/groff -Tnippon -mandocj
+EQN /usr/bin/eqn -Tps
+NEQN /usr/bin/eqn -Tlatin1
+JNEQN /usr/bin/eqn -Tnippon
+TBL /usr/bin/tbl
+# COL /usr/bin/col
+REFER /usr/bin/refer
+PIC /usr/bin/pic
+VGRIND
+GRAP
+PAGER /usr/bin/less -isR
+CAT /bin/cat
+#
+# The command "man -a xyzzy" will show all man pages for xyzzy.
+# When CMP is defined man will try to avoid showing the same
+# text twice. (But compressed pages compare unequal.)
+#
+CMP /usr/bin/cmp -s
+#
+# Compress cat pages
+#
+COMPRESS /bin/bzip2
+COMPRESS_EXT .bz2
+#
+# Default manual sections (and order) to search if -S is not specified
+# and the MANSECT environment variable is not set.
+#
+MANSECT 1:1p:8:2:3:3p:4:5:6:7:9:0p:tcl:n:l:p:o
+#
+# Default options to use when man is invoked without options
+# This is mainly for the benefit of those that think -a should be the default
+# Note that some systems have /usr/man/allman, causing pages to be shown twice.
+#
+#MANDEFOPTIONS -a
+#
+# Decompress with given decompressor when input file has given extension
+# The command given must act as a filter.
+#
+.gz /bin/gunzip -c
+.bz2 /usr/bin/bunzip2 -c
+.xz /usr/bin/unxz -c
+.z
+.Z /bin/zcat
+.F
+.Y
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man/manpath.5.gz b/import-layers/yocto-poky/meta/recipes-extended/man/man/manpath.5.gz
new file mode 100644
index 000000000..c012ff897
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man/manpath.5.gz
Binary files differ
diff --git a/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb b/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb
new file mode 100644
index 000000000..e78aa18cb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/man/man_1.6g.bb
@@ -0,0 +1,86 @@
+SUMMARY = "Online documentation tools"
+DESCRIPTION = "A set of documentation tools: man, apropos and whatis"
+SECTION = "console/utils"
+HOMEPAGE = "http://primates.ximian.com/~flucifredi/man"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+PR = "r1"
+
+DEPENDS = "groff less"
+
+def compress_pkg(d):
+ if "compress_doc" in (d.getVar("INHERIT", True) or "").split():
+ compress = d.getVar("DOC_COMPRESS", True)
+ if compress == "gz":
+ return "gzip"
+ elif compress == "bz2":
+ return "bzip2"
+ elif compress == "xz":
+ return "xz"
+ return ""
+
+RDEPENDS_${PN} += "${@compress_pkg(d)}"
+
+SRC_URI = "http://pkgs.fedoraproject.org/lookaside/pkgs/man2html/${BP}.tar.gz/ba154d5796928b841c9c69f0ae376660/${BP}.tar.gz \
+ file://man-1.5k-confpath.patch;striplevel=0 \
+ file://man-1.5h1-make.patch \
+ file://man-1.5k-nonascii.patch \
+ file://man-1.6e-security.patch \
+ file://man-1.6e-mandirs.patch \
+ file://man-1.5m2-bug11621.patch \
+ file://man-1.5k-sofix.patch \
+ file://man-1.5m2-buildroot.patch \
+ file://man-1.6e-ro_usr.patch \
+ file://man-1.5i2-newline.patch;striplevel=0 \
+ file://man-1.5j-utf8.patch \
+ file://man-1.5i2-overflow.patch \
+ file://man-1.5j-nocache.patch \
+ file://man-1.5i2-initial.patch \
+ file://man-1.5h1-gencat.patch;striplevel=0 \
+ file://man-1.5g-nonrootbuild.patch \
+ file://man-1.5j-i18n.patch \
+ file://man-1.6e-whatis2.patch \
+ file://man-1.6e-use_i18n_vars_in_a_std_way.patch \
+ file://man-1.5m2-no-color-for-printing.patch \
+ file://man-1.5m2-sigpipe.patch \
+ file://man-1.6e-i18n_whatis.patch \
+ file://man-1.6e-new_sections.patch \
+ file://man.1.gz;unpack=false \
+ file://man.7.gz;unpack=false \
+ file://man.conf \
+ file://manpath.5.gz;unpack=false \
+ file://man-1.6g-whatis3.patch \
+ file://configure_sed.patch \
+ file://man-1.6g-parallel.patch \
+ file://man-1.6g-compile-warnings.patch \
+ file://man-1.6g-configure.patch \
+"
+
+SRC_URI[md5sum] = "ba154d5796928b841c9c69f0ae376660"
+SRC_URI[sha256sum] = "ccdcb8c3f4e0080923d7e818f0e4a202db26c46415eaef361387c20995b8959f"
+
+CFLAGS += "-DSYSV"
+
+do_configure () {
+ ${S}/configure -default -confdir /etc +sgid +fhs +lang all
+}
+
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+}
+
+do_install_append(){
+ mkdir -p ${D}${sysconfdir}
+ mkdir -p ${D}${datadir}/man/man5
+ mkdir -p ${D}${datadir}/man/man7
+ cp ${WORKDIR}/man.conf ${D}${sysconfdir}/man.config
+ cp ${WORKDIR}/man.1.gz ${D}${datadir}/man/man1/
+ cp ${WORKDIR}/man.7.gz ${D}${datadir}/man/man7/
+ cp ${WORKDIR}/manpath.5.gz ${D}${datadir}/man/man5/
+}
+
+
+RDEPENDS_${PN} = "less groff"
+FILES_${PN} += "${datadir}/locale ${sysconfdir}/man.config"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch b/import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch
new file mode 100644
index 000000000..ee4ba9f26
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mc/mc/mc-CTRL.patch
@@ -0,0 +1,31 @@
+Fix build with musl by ensuring CTRL is defined.
+
+musl does not define CTRL in <termios.h>, we could include <sys/ttydefaults.h>
+explicitly but it's easier just to ensure CTRL is defined.
+
+This patch is taken from Sabotage Linux, the license statement for patches and
+build scripts in Sabotage Linux says:
+
+ To the extent possible under law, Christian Neukirchen has waived
+ all copyright and related or neighboring rights to this work.
+
+ http://creativecommons.org/publicdomain/zero/1.0/
+
+Therefore this should be good to include in OpenEmbedded.
+
+Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
+
+Upstream-Status: Accepted (should be included in v4.8.14)
+
+diff -u mc-4.8.1.7.org/lib/tty/tty-ncurses.c mc-4.8.1.7/lib/tty/tty-ncurses.c
+--- mc-4.8.1.7.org/lib/tty/tty-ncurses.c
++++ mc-4.8.1.7/lib/tty/tty-ncurses.c
+@@ -65,7 +65,7 @@
+
+ /*** file scope macro definitions ****************************************************************/
+
+-#if defined(_AIX) && !defined(CTRL)
++#if !defined(CTRL)
+ #define CTRL(x) ((x) & 0x1f)
+ #endif
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb
new file mode 100644
index 000000000..b38964d82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.7.5.2.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Midnight Commander is an ncurses based file manager"
+HOMEPAGE = "http://www.midnight-commander.org/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+SECTION = "console/utils"
+DEPENDS = "ncurses glib-2.0"
+RDEPENDS_${PN} = "ncurses-terminfo"
+
+PR = "r3"
+
+SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
+ file://mc-CTRL.patch \
+ "
+
+SRC_URI[md5sum] = "bdae966244496cd4f6d282d80c9cf3c6"
+SRC_URI[sha256sum] = "a68338862bb30017eb65ed569a58e80ab66ae8cef11c886440c9e9f4d1efc6ab"
+
+inherit autotools gettext pkgconfig
+
+EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x --without-samba"
+
+do_install_append () {
+ sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
+ sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
+}
+
+PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${BPN}-helpers ${BPN}-fish"
+
+SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts"
+FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \
+ ${libexecdir}/mc/extfs.d/deb ${libexecdir}/mc/extfs.d/deba \
+ ${libexecdir}/mc/extfs.d/debd ${libexecdir}/mc/extfs.d/dpkg+ \
+ ${libexecdir}/mc/extfs.d/mailfs ${libexecdir}/mc/extfs.d/patchfs \
+ ${libexecdir}/mc/extfs.d/rpms+ ${libexecdir}/mc/extfs.d/ulib \
+ ${libexecdir}/mc/extfs.d/uzip"
+RDEPENDS_${BPN}-helpers-perl = "perl"
+
+SUMMARY_${BPN}-helpers-python = "Midnight Commander Python-based helper scripts"
+FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541"
+RDEPENDS_${BPN}-helpers-python = "python"
+
+SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts"
+FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*"
+
+SUMMARY_${BPN}-fish = "Midnight Commander Fish scripts"
+FILES_${BPN}-fish = "${libexecdir}/mc/fish"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.15.bb b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.15.bb
new file mode 100644
index 000000000..6c3a16aab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mc/mc_4.8.15.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Midnight Commander is an ncurses based file manager"
+HOMEPAGE = "http://www.midnight-commander.org/"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=270bbafe360e73f9840bd7981621f9c2"
+SECTION = "console/utils"
+DEPENDS = "ncurses glib-2.0 util-linux"
+RDEPENDS_${PN} = "ncurses-terminfo"
+
+SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
+ "
+SRC_URI[md5sum] = "db48ce26ba425a61edc51930e94227fd"
+SRC_URI[sha256sum] = "f74e3da70410975cdeb27ee9a66d1dd812250b6d3ede364bca728dd5a48e5471"
+
+inherit autotools gettext pkgconfig
+
+#
+# Both Samba (smb) and sftp require package delivered from meta-openembedded
+#
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[smb] = "--enable-vfs-smb,--disable-vfs-smb,samba,"
+PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2,"
+
+EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x"
+
+do_install_append () {
+ sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
+ sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
+}
+
+PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${BPN}-helpers ${BPN}-fish"
+
+SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts"
+FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \
+ ${libexecdir}/mc/extfs.d/deb ${libexecdir}/mc/extfs.d/deba \
+ ${libexecdir}/mc/extfs.d/debd ${libexecdir}/mc/extfs.d/dpkg+ \
+ ${libexecdir}/mc/extfs.d/mailfs ${libexecdir}/mc/extfs.d/patchfs \
+ ${libexecdir}/mc/extfs.d/rpms+ ${libexecdir}/mc/extfs.d/ulib \
+ ${libexecdir}/mc/extfs.d/uzip"
+RDEPENDS_${BPN}-helpers-perl = "perl"
+
+SUMMARY_${BPN}-helpers-python = "Midnight Commander Python-based helper scripts"
+FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541"
+RDEPENDS_${BPN}-helpers-python = "python"
+
+SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts"
+FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*"
+
+SUMMARY_${BPN}-fish = "Midnight Commander Fish scripts"
+FILES_${BPN}-fish = "${libexecdir}/mc/fish"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch
new file mode 100644
index 000000000..ee482b5ca
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-some-type-comparison-problems.patch
@@ -0,0 +1,50 @@
+From 835baf02fd42012bbc0603dffb1f80c6ecf0fb9e Mon Sep 17 00:00:00 2001
+From: Xiao Ni <xni@redhat.com>
+Date: Mon, 8 Feb 2016 11:18:52 +0200
+Subject: [PATCH] Fix some type comparison problems
+
+As 26714713cd2bad9e0bf7f4669f6cc4659ceaab6c said, 32 bit signed
+timestamps will overflow in the year 2038. It already changed the
+utime and ctime in struct mdu_array_info_s from int to unsigned
+int. So we need to change the values that compared with them to
+unsigned int too.
+
+Upstream-Status: Backport
+
+Signed-off-by : Xiao Ni <xni@redhat.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+
+ Monitor.c | 2 +-
+ util.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Monitor.c b/Monitor.c
+index f19c2e5..6df80f9 100644
+--- a/Monitor.c
++++ b/Monitor.c
+@@ -33,7 +33,7 @@
+ struct state {
+ char *devname;
+ char devnm[32]; /* to sync with mdstat info */
+- long utime;
++ unsigned int utime;
+ int err;
+ char *spare_group;
+ int active, working, failed, spare, raid;
+diff --git a/util.c b/util.c
+index 3e6d293..96a806d 100644
+--- a/util.c
++++ b/util.c
+@@ -1267,7 +1267,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
+ */
+ struct superswitch *ss;
+ struct supertype *st;
+- time_t besttime = 0;
++ unsigned int besttime = 0;
+ int bestsuper = -1;
+ int i;
+
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
new file mode 100644
index 000000000..deb748638
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch
@@ -0,0 +1,33 @@
+From 1f5baf3ad95ae4c39efe4d8ad8b2e642b3a351da Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Tue, 9 Feb 2016 11:44:01 +0200
+Subject: [PATCH] Fix the path of corosync and dlm header files check
+
+Original Makefile will check headers on host instead of sysroot.
+Fix it.
+
+Upstream-Status: Inappropriate [Yocto specific]
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index fd79cfb..34150a9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -80,8 +80,8 @@ MDMON_DIR = $(RUN_DIR)
+ FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots
+ SYSTEMD_DIR=/lib/systemd/system
+
+-COROSYNC:=$(shell [ -d /usr/include/corosync ] || echo -DNO_COROSYNC)
+-DLM:=$(shell [ -f /usr/include/libdlm.h ] || echo -DNO_DLM)
++COROSYNC:=$(shell [ -d $(SYSROOT)/usr/include/corosync ] || echo -DNO_COROSYNC)
++DLM:=$(shell [ -f $(SYSROOT)/usr/include/libdlm.h ] || echo -DNO_DLM)
+
+ DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\"
+ DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\"
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
new file mode 100644
index 000000000..df70b1cf4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
@@ -0,0 +1,86 @@
+From 18d360d74271a066a849bc1fba4f10dbb23ed251 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Sep 2015 08:17:42 +0000
+Subject: [PATCH] Fix typo in comparision
+
+error: comparison of array 'devnm' equal to a null pointer is always false
+
+User bitwise '&' operator as it is a mask
+
+Fixes
+error: use of logical '&&' with constant operand
+
+Remove extraneous parens
+
+error: equality comparison with extraneous parentheses
+
+Remove dead code
+
+restripe.c:465:21: error: explicitly assigning value of variable of type 'int' to itself
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ mdmon.h | 2 +-
+ mdopen.c | 2 +-
+ restripe.c | 3 ---
+ super-intel.c | 2 +-
+ 4 files changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/mdmon.h b/mdmon.h
+index aa750c6..0b08c3d 100644
+--- a/mdmon.h
++++ b/mdmon.h
+@@ -101,7 +101,7 @@ static inline int is_resync_complete(struct mdinfo *array)
+ break;
+ case 10:
+ l = array->array.layout;
+- ncopies = (l & 0xff) * ((l >> 8) && 0xff);
++ ncopies = (l & 0xff) * ((l >> 8) & 0xff);
+ sync_size = array->component_size * array->array.raid_disks;
+ sync_size /= ncopies;
+ break;
+diff --git a/mdopen.c b/mdopen.c
+index 28410f4..c5ee2a6 100644
+--- a/mdopen.c
++++ b/mdopen.c
+@@ -318,7 +318,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
+ else if (num < 0) {
+ /* need to choose a free number. */
+ char *_devnm = find_free_devnm(use_mdp);
+- if (devnm == NULL) {
++ if (_devnm == NULL) {
+ pr_err("No avail md devices - aborting\n");
+ return -1;
+ }
+diff --git a/restripe.c b/restripe.c
+index 4d92190..cfe9666 100644
+--- a/restripe.c
++++ b/restripe.c
+@@ -461,9 +461,6 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
+ curr_broken_disk = diskD;
+ }
+
+- if((Px == 0) && (Qx == 0))
+- curr_broken_disk = curr_broken_disk;
+-
+ if(curr_broken_disk >= data_disks + 2)
+ broken_status = 2;
+
+diff --git a/super-intel.c b/super-intel.c
+index 3f812d6..1838012 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -10027,7 +10027,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
+ geo->size = max_size;
+ }
+
+- if ((direction == ROLLBACK_METADATA_CHANGES)) {
++ if (direction == ROLLBACK_METADATA_CHANGES) {
+ /* accept size for rollback only
+ */
+ } else {
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch
new file mode 100644
index 000000000..139547398
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch
@@ -0,0 +1,55 @@
+From cf14a9987ea1040457ce53bc2ab7d096818cb780 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Fri, 5 Feb 2016 18:06:32 +0200
+Subject: [PATCH] mdadm.h: bswap is already defined in uclibc
+
+Fixes this build error:
+
+| In file included from mdadm.c:28:0:
+| mdadm.h:142:0: error: "bswap_16" redefined [-Werror]
+| #define bswap_16(x) (((x) & 0x00ffU) << 8 | \
+| ^
+
+Upstream-Status: Submitted
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ mdadm.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/mdadm.h b/mdadm.h
+index dd02be7..230e60f 100755
+--- a/mdadm.h
++++ b/mdadm.h
+@@ -139,12 +139,20 @@ struct dlm_lksb {
+ * and there is no standard conversion function so... */
+ /* And dietlibc doesn't think byteswap is ok, so.. */
+ /* #include <byteswap.h> */
++
++#ifndef bswap_16
+ #define bswap_16(x) (((x) & 0x00ffU) << 8 | \
+ ((x) & 0xff00U) >> 8)
++#endif
++
++#ifndef bswap_32
+ #define bswap_32(x) (((x) & 0x000000ffU) << 24 | \
+ ((x) & 0xff000000U) >> 24 | \
+ ((x) & 0x0000ff00U) << 8 | \
+ ((x) & 0x00ff0000U) >> 8)
++#endif
++
++#ifndef bswap_64
+ #define bswap_64(x) (((x) & 0x00000000000000ffULL) << 56 | \
+ ((x) & 0xff00000000000000ULL) >> 56 | \
+ ((x) & 0x000000000000ff00ULL) << 40 | \
+@@ -153,6 +161,7 @@ struct dlm_lksb {
+ ((x) & 0x0000ff0000000000ULL) >> 24 | \
+ ((x) & 0x00000000ff000000ULL) << 8 | \
+ ((x) & 0x000000ff00000000ULL) >> 8)
++#endif
+
+ #if !defined(__KLIBC__)
+ #if BYTE_ORDER == LITTLE_ENDIAN
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch
new file mode 100644
index 000000000..d5cf00374
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/0001-util.c-include-poll.h-instead-of-sys-poll.h.patch
@@ -0,0 +1,45 @@
+From 2645673a7ea948a1297d5b8f0daab29b898f044f Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Fri, 5 Feb 2016 17:14:04 +0200
+Subject: [PATCH] util.c: include poll.h instead of sys/poll.h
+
+This fixes a compile warning when building with musl:
+
+ In file included from util.c:27:0:
+ |
+ qemux86-64/usr/include/sys/poll.h:1:2:
+ error: #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+ [-Werror=cpp]
+ | #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+ | ^
+
+Upstream-Status: Accepted
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util.c b/util.c
+index 970d484..3e6d293 100644
+--- a/util.c
++++ b/util.c
+@@ -24,7 +24,6 @@
+
+ #include "mdadm.h"
+ #include "md_p.h"
+-#include <sys/poll.h>
+ #include <sys/socket.h>
+ #include <sys/utsname.h>
+ #include <sys/wait.h>
+@@ -32,6 +31,7 @@
+ #include <sys/resource.h>
+ #include <sys/vfs.h>
+ #include <linux/magic.h>
++#include <poll.h>
+ #include <ctype.h>
+ #include <dirent.h>
+ #include <signal.h>
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch
new file mode 100644
index 000000000..54bf1d79a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/gcc-4.9.patch
@@ -0,0 +1,22 @@
+super-intel.c:5063:2: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
+ snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
+ ^
+cc1: all warnings being treated as errors
+make: *** [super-intel.o] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: mdadm-3.3/super-intel.c
+===================================================================
+--- mdadm-3.3.orig/super-intel.c 2014-05-02 15:08:21.154319651 -0700
++++ mdadm-3.3/super-intel.c 2014-05-02 15:09:31.470985794 -0700
+@@ -5060,7 +5060,7 @@
+ spare->cache_size = mpb->cache_size,
+ spare->pwr_cycle_count = __cpu_to_le32(1),
+
+- snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
++ (void)snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
+ MPB_SIGNATURE MPB_VERSION_RAID0);
+
+ for (d = super->disks; d; d = d->next) {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
new file mode 100644
index 000000000..40acc148e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Accepted
+
+By hardcoding CC's definition in the Makefile, all the gcc parameters
+set by tune settings are lost. Causing compile failure with x32 toolchain
+
+As the bitbake defined CC is good, there is no need to redfine CC in the
+make file, hence making the CC definition in the Makefile conditional.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/07
+
+Index: mdadm-3.3/Makefile
+===================================================================
+--- mdadm-3.3.orig/Makefile 2013-09-03 07:47:47.000000000 +0300
++++ mdadm-3.3/Makefile 2013-10-16 16:44:23.542295487 +0300
+@@ -41,7 +41,7 @@
+
+ KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
+
+-CC = $(CROSS_COMPILE)gcc
++CC ?= $(CROSS_COMPILE)gcc
+ CXFLAGS ?= -ggdb
+ CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
new file mode 100644
index 000000000..c656d073e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
@@ -0,0 +1,25 @@
+When try to print time_t values as a long int it causes an error because time_t
+data type in x32 ABI is long long int.
+
+Upstream-Status: Pending
+
+Signed-off-by: AnĂ­bal LimĂłn <anibal.limon@linux.intel.com>
+
+Index: mdadm-3.3.4/monitor.c
+===================================================================
+--- mdadm-3.3.4.orig/monitor.c
++++ mdadm-3.3.4/monitor.c
+@@ -257,9 +257,12 @@ static int read_and_act(struct active_ar
+ mdi->curr_state = read_dev_state(mdi->state_fd);
+ }
+ }
+-
+ gettimeofday(&tv, NULL);
++#if defined(__x86_64__) && defined(__ILP32__)
++ dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
++#else
+ dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
++#endif
+ a->info.container_member,
+ tv.tv_sec, tv.tv_usec,
+ array_states[a->curr_state],
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
new file mode 100644
index 000000000..267c007c2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch
@@ -0,0 +1,45 @@
+From c65898b9da82df94e1bae7937e415a7eb80355d5 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Wed, 10 Feb 2016 17:28:05 +0200
+Subject: [PATCH] mdadm-fix-ptest-build-errors
+
+builds fail with ptest enabled:
+
+| restripe.c: In function 'test_stripes':
+| restripe.c:845:4: error: ignoring return value of 'read', declared with
+| attribute warn_unused_result [-Werror=unused-result]
+| read(source[i], stripes[i], chunk_size);
+| ^
+| cc1: all warnings being treated as errors
+| Makefile:214: recipe for target 'test_stripe' failed
+
+Upstream-Status: Pending
+
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ restripe.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/restripe.c b/restripe.c
+index 56dca73..d24b2b4 100644
+--- a/restripe.c
++++ b/restripe.c
+@@ -842,10 +842,14 @@ int test_stripes(int *source, unsigned long long *offsets,
+
+ while (length > 0) {
+ int disk;
++ ssize_t ret;
+
+ for (i = 0 ; i < raid_disks ; i++) {
+ lseek64(source[i], offsets[i]+start, 0);
+- read(source[i], stripes[i], chunk_size);
++ ret = read(source[i], stripes[i], chunk_size);
++ if (ret == -1) {
++ printf("Read Failed\n");
++ }
+ }
+ for (i = 0 ; i < data_disks ; i++) {
+ int disk = geo_map(i, start/chunk_size, raid_disks,
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest
new file mode 100644
index 000000000..5b276090f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/files/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+./test &>./test.log
+if [ $? -eq 0 ]
+then
+ echo "PASS: mdadm"
+ rm test.log
+else
+ echo "FAIL: mdadm"
+fi
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb b/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb
new file mode 100644
index 000000000..142dfddbf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mdadm/mdadm_3.4.bb
@@ -0,0 +1,75 @@
+SUMMARY = "Tool for managing software RAID under Linux"
+HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/"
+
+# Some files are GPLv2+ while others are GPLv2.
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \
+ file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161"
+
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
+ file://mdadm-3.2.2_fix_for_x32.patch \
+ file://gcc-4.9.patch \
+ file://mdadm-3.3.2_x32_abi_time_t.patch \
+ file://0001-Fix-typo-in-comparision.patch \
+ file://mdadm-fix-ptest-build-errors.patch \
+ file://0001-util.c-include-poll.h-instead-of-sys-poll.h.patch \
+ file://0001-mdadm.h-bswap-is-already-defined-in-uclibc.patch \
+ file://0001-Fix-some-type-comparison-problems.patch \
+ file://0001-Fix-the-path-of-corosync-and-dlm-header-files-check.patch \
+ file://run-ptest \
+ "
+SRC_URI[md5sum] = "04b8b21f637540350f8517c7e68d3c63"
+SRC_URI[sha256sum] = "27d0be4627d38a12ddcd1c1c3721d649d4e89e1093914497e22b57245cda8808"
+
+CFLAGS += "-fno-strict-aliasing"
+inherit autotools-brokensep
+
+EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"'
+# PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h
+# prevents 64-bit userland from seeing this definition, instead defaulting
+# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get
+# int-ll64.h included
+CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__'
+CFLAGS_append_mips64 = ' -D__SANE_USERSPACE_TYPES__'
+CFLAGS_append_mips64n32 = ' -D__SANE_USERSPACE_TYPES__'
+
+do_compile() {
+ oe_runmake SYSROOT="${STAGING_DIR_TARGET}"
+}
+
+do_install() {
+ export STRIP=""
+ autotools_do_install
+}
+
+FILES_${PN} += "${base_libdir}/udev/rules.d/*.rules"
+
+inherit ptest
+
+do_compile_ptest() {
+ oe_runmake test
+}
+
+do_install_ptest() {
+ cp -a ${S}/tests ${D}${PTEST_PATH}/tests
+ cp ${S}/test ${D}${PTEST_PATH}
+ sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
+ ln -s /sbin/mdadm ${D}${PTEST_PATH}/mdadm
+ for prg in test_stripe swap_super raid6check
+ do
+ install -D -m 755 $prg ${D}${PTEST_PATH}/
+ done
+}
+RDEPENDS_${PN}-ptest += "bash"
+RRECOMMENDS_${PN}-ptest += " \
+ coreutils \
+ util-linux \
+ kernel-module-loop \
+ kernel-module-linear \
+ kernel-module-raid0 \
+ kernel-module-raid1 \
+ kernel-module-raid10 \
+ kernel-module-raid456 \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mingetty/mingetty_1.08.bb b/import-layers/yocto-poky/meta/recipes-extended/mingetty/mingetty_1.08.bb
new file mode 100644
index 000000000..3c16228b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mingetty/mingetty_1.08.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Compact getty terminal handler for virtual consoles only"
+SECTION = "console/utils"
+HOMEPAGE = "http://sourceforge.net/projects/mingetty/"
+LICENSE = "GPLv2"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e"
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "2a75ad6487ff271424ffc00a64420990"
+SRC_URI[sha256sum] = "0f55c90ba4faa913d91ef99cbf5cb2eb4dbe2780314c3bb17953f849c8cddd17"
+
+# substitute our CFLAGS for "-O2 -Wall -W -pipe"
+#
+EXTRA_OEMAKE = "CC='${CC}' \
+ CFLAGS='${CFLAGS} -D_GNU_SOURCE'"
+
+do_install(){
+ install -d ${D}${mandir}/man8 ${D}/${base_sbindir}
+ oe_runmake install DESTDIR=${D}
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "getty"
+ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty"
+ALTERNATIVE_TARGET[getty] = "${base_sbindir}/mingetty"
+ALTERNATIVE_PRIORITY = "10"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch
new file mode 100644
index 000000000..fec67fdd3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch
@@ -0,0 +1,47 @@
+From d62a5862e26ed3fc58d789efe9c40ca6c911d36b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 22:35:31 +0000
+Subject: [PATCH] Fix build issus surfaced due to musl
+
+src/getsdir.h:28:14: error: 'MAXNAMLEN' undeclared here (not in a function)
+ char fname[MAXNAMLEN + 1]; /* filename + terminating null */
+
+src/dial.c:352:22: error: 'KIOCSOUND' undeclared (first use in this function)
+| ioctl(consolefd, KIOCSOUND, k);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/dial.c | 2 +-
+ src/getsdir.c | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/dial.c b/src/dial.c
+index a90c1d2..bf02574 100644
+--- a/src/dial.c
++++ b/src/dial.c
+@@ -39,7 +39,7 @@
+ #include "intl.h"
+
+ #ifdef VC_MUSIC
+-# if defined(__GLIBC__)
++# if defined(__GLIBC__) || defined(__linux__)
+ # include <sys/ioctl.h>
+ # include <sys/kd.h>
+ # include <sys/time.h>
+diff --git a/src/getsdir.c b/src/getsdir.c
+index 2195b27..b61a361 100644
+--- a/src/getsdir.c
++++ b/src/getsdir.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/param.h>
+ #include <errno.h>
+
+ #include "getsdir.h"
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch
new file mode 100644
index 000000000..bd8261c97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch
@@ -0,0 +1,35 @@
+Subject: [PATCH] fix minicom -h/-v return value is not 0
+
+Upstream-Status: Pending
+
+Signed-off-by: Lu Chong <Chong.Lu@windriver.com>
+
+---
+ src/minicom.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/minicom.c b/src/minicom.c
+index e1a557b..730da7c 100644
+--- a/src/minicom.c
++++ b/src/minicom.c
+@@ -1166,15 +1166,13 @@ int main(int argc, char **argv)
+ "modify it under the terms of the GNU General Public License\n"
+ "as published by the Free Software Foundation; either version\n"
+ "2 of the License, or (at your option) any later version.\n\n");
+- exit(1);
+- break;
++ exit(0);
+ case 's': /* setup mode */
+ dosetup = 1;
+ break;
+ case 'h':
+ helpthem();
+- exit(1);
+- break;
++ exit(0);
+ case 'p': /* Pseudo terminal to use. */
+ if (strncmp(optarg, "/dev/", 5) == 0)
+ optarg += 5;
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch
new file mode 100644
index 000000000..f5c08896f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- a/configure.in 2013-02-06 18:18:13.000000000 +0100
++++ b/configure.in 2013-07-21 15:31:27.614828894 +0200
+@@ -40,7 +40,13 @@
+ fi
+
+ PKG_PROG_PKG_CONFIG
+-if test -n "$PKG_CONFIG"; then
++
++AC_ARG_ENABLE([lockdev],
++ AS_HELP_STRING([--enable-lockdev],
++ [Enable lockdev support (def: enabled)]),
++ [], [enable_lockdev="yes"])
++
++if test -n "$PKG_CONFIG" && test "x$enable_lockdev" = xyes; then
+ PKG_CHECK_MODULES([LOCKDEV], [lockdev], AC_DEFINE([HAVE_LOCKDEV],[1],[Define if you have lockdev]),[:])
+ fi
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom_2.7.bb b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom_2.7.bb
new file mode 100644
index 000000000..3118686e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/minicom/minicom_2.7.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Text-based modem control and terminal emulation program"
+DESCRIPTION = "Minicom is a text-based modem control and terminal emulation program for Unix-like operating systems"
+SECTION = "console/network"
+DEPENDS = "ncurses virtual/libiconv"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=420477abc567404debca0a2a1cb6b645 \
+ file://src/minicom.h;beginline=1;endline=12;md5=a58838cb709f0db517f4e42730c49e81"
+
+SRC_URI = "https://alioth.debian.org/frs/download.php/latestfile/3/${BP}.tar.gz \
+ file://allow.to.disable.lockdev.patch \
+ file://0001-fix-minicom-h-v-return-value-is-not-0.patch \
+ file://0001-Fix-build-issus-surfaced-due-to-musl.patch \
+ "
+
+SRC_URI[md5sum] = "7044ca3e291268c33294f171d426dc2d"
+SRC_URI[sha256sum] = "9ac3a663b82f4f5df64114b4792b9926b536c85f59de0f2d2b321c7626a904f4"
+
+UPSTREAM_CHECK_URI = "https://alioth.debian.org/frs/?group_id=30018"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lockdev] = "--enable-lockdev,--disable-lockdev,lockdev"
+
+inherit autotools gettext pkgconfig
+
+do_install() {
+ for d in doc extras man lib src; do make -C $d DESTDIR=${D} install; done
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/disable-strip.patch b/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/disable-strip.patch
new file mode 100644
index 000000000..e06869e3a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/disable-strip.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff --git a/Makefile.in b/Makefile.in
+index 37b3cc9..f1026f3 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -95,7 +95,7 @@ install-dirs:
+ $(DESTDIR)$(mandir)/man1
+
+ install-binaries: $(PROG)
+- $(INSTALL) -m 0555 -s $(PROG) $(DESTDIR)$(bindir)/$(PROG)
++ $(INSTALL) -m 0555 $(PROG) $(DESTDIR)$(bindir)/$(PROG)
+
+ install-man:
+ $(INSTALL) -m 0444 $(srcdir)/mktemp.$(mantype) \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch b/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch
new file mode 100644
index 000000000..f3b6dcc34
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mktemp/files/fix-parallel-make.patch
@@ -0,0 +1,24 @@
+This fixes the parallel make install failure
+
+Upstream-Status: Accepted
+http://www.gratisoft.us/bugzilla/show_bug.cgi?id=528
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: mktemp-1.7/Makefile.in
+===================================================================
+--- mktemp-1.7.orig/Makefile.in
++++ mktemp-1.7/Makefile.in
+@@ -94,10 +94,10 @@ install-dirs:
+ $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
+ $(DESTDIR)$(mandir)/man1
+
+-install-binaries: $(PROG)
++install-binaries: install-dirs $(PROG)
+ $(INSTALL) -m 0555 $(PROG) $(DESTDIR)$(bindir)/$(PROG)
+
+-install-man:
++install-man: install-dirs
+ $(INSTALL) -m 0444 $(srcdir)/mktemp.$(mantype) \
+ $(DESTDIR)$(mandir)/man1/mktemp.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb b/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb
new file mode 100644
index 000000000..9accc6eed
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/mktemp/mktemp_1.7.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Enables safe temporary file creation from shell scripts"
+HOMEPAGE = "http://www.mktemp.org/"
+BUGTRACKER = "http://www.mktemp.org/bugs"
+SECTION = "console/utils"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=430680f6322a1eb87199b5e01a82c0d4"
+
+PR = "r3"
+
+SRC_URI = "ftp://ftp.mktemp.org/pub/mktemp/${BPN}-${PV}.tar.gz \
+ file://disable-strip.patch \
+ file://fix-parallel-make.patch \
+ "
+
+SRC_URI[md5sum] = "787bbed9fa2ee8e7645733c0e8e65172"
+SRC_URI[sha256sum] = "8e94b9e1edf866b2609545da65b627996ac5d158fda071e492bddb2f4a482675"
+
+inherit autotools update-alternatives
+
+EXTRA_OECONF = "--with-libc"
+
+do_install_append () {
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
+ rmdir ${D}${bindir}
+}
+
+ALTERNATIVE_${PN} = "mktemp"
+ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
+ALTERNATIVE_PRIORITY = "60"
+
+ALTERNATIVE_${PN}-doc = "mktemp.1"
+ALTERNATIVE_PRIORITY_${PN}-doc = "300"
+ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.3.bb b/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.3.bb
new file mode 100644
index 000000000..6dbd78f9f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/msmtp/msmtp_1.6.3.bb
@@ -0,0 +1,30 @@
+SUMMARY = "msmtp is an SMTP client"
+DESCRIPTION = "A sendmail replacement for use in MTAs like mutt"
+HOMEPAGE = "http://msmtp.sourceforge.net/"
+SECTION = "console/network"
+
+LICENSE = "GPLv3"
+DEPENDS = "zlib gnutls"
+
+#COPYING or Licence
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "http://sourceforge.net/projects/msmtp/files/msmtp/${PV}/${BPN}-${PV}.tar.xz \
+ "
+
+SRC_URI[md5sum] = "6d9384c09405db9476beaa2237c56705"
+SRC_URI[sha256sum] = "f982be069c0772c3ee83925f552f5dac5fb307d2d1c68202f9926bb13b757355"
+
+inherit gettext autotools update-alternatives pkgconfig
+
+EXTRA_OECONF += "--without-libsecret --without-libgsasl --without-libidn"
+
+ALTERNATIVE_${PN} = "sendmail"
+ALTERNATIVE_TARGET[sendmail] = "${bindir}/msmtp"
+ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
+ALTERNATIVE_PRIORITY = "100"
+
+pkg_postinst_${PN}_linuxstdbase () {
+ # /usr/lib/sendmial is required by LSB core test
+ [ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
new file mode 100644
index 000000000..06f81420e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
@@ -0,0 +1,32 @@
+From 81814dc2b14843009193efd307d814c26baa61f0 Mon Sep 17 00:00:00 2001
+From: Jiri Popelka <jpopelka@redhat.com>
+Date: Wed, 7 Dec 2011 19:14:09 +0100
+Subject: [PATCH] ifconfig interface:0 del <IP> will remove the aliased IP on IA64
+
+Upstream-Status: Backport
+
+commit 81814dc2b14843009193efd307d814c26baa61f0 from
+git://git.code.sf.net/p/net-tools/code
+
+---
+ ifconfig.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/ifconfig.c b/ifconfig.c
+index bc405c6..dae8922 100644
+--- a/ifconfig.c
++++ b/ifconfig.c
+@@ -890,7 +890,9 @@ int main(int argc, char **argv)
+ continue;
+ }
+
+- memcpy(&ip, &sin.sin_addr.s_addr, sizeof(unsigned long));
++ /* Clear "ip" in case sizeof(unsigned long) > sizeof(sin.sin_addr.s_addr) */
++ ip = 0;
++ memcpy(&ip, &sin.sin_addr.s_addr, sizeof(sin.sin_addr.s_addr));
+
+ if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
+ fprintf(stderr, _("Interface %s not initialized\n"),
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
new file mode 100644
index 000000000..f694d594b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
@@ -0,0 +1,100 @@
+Adjust headers for non-glibc cases
+especially exposed by musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: net-tools-1.60/lib/inet6_gr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet6_gr.c
++++ net-tools-1.60/lib/inet6_gr.c
+@@ -23,7 +23,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifndef __GLIBC__
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h> /* glibc doesn't have this */
+ #endif
+ #include "version.h"
+Index: net-tools-1.60/lib/inet6_sr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet6_sr.c
++++ net-tools-1.60/lib/inet6_sr.c
+@@ -23,10 +23,10 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifdef __GLIBC__
+-#include <net/route.h>
+-#else
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h> /* glibc does not have this */
++#else
++#include <net/route.h>
+ #endif
+ #include "version.h"
+ #include "net-support.h"
+Index: net-tools-1.60/lib/inet_sr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet_sr.c
++++ net-tools-1.60/lib/inet_sr.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
++#include <asm-generic/param.h>
+ #include "version.h"
+ #include "net-support.h"
+ #include "pathnames.h"
+Index: net-tools-1.60/lib/util-ank.c
+===================================================================
+--- net-tools-1.60.orig/lib/util-ank.c
++++ net-tools-1.60/lib/util-ank.c
+@@ -14,6 +14,7 @@
+ * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses
+ */
+
++#include <limits.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+Index: net-tools-1.60/mii-tool.c
+===================================================================
+--- net-tools-1.60.orig/mii-tool.c
++++ net-tools-1.60/mii-tool.c
+@@ -47,10 +47,6 @@ static char Version[] = "$Id: mii-tool.c
+ #include <net/if.h>
+ #include <linux/sockios.h>
+
+-#ifndef __GLIBC__
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ #include "mii.h"
+ #include "version.h"
+
+Index: net-tools-1.60/netstat.c
+===================================================================
+--- net-tools-1.60.orig/netstat.c
++++ net-tools-1.60/netstat.c
+@@ -87,6 +87,7 @@
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <asm-generic/param.h>
+
+ #include "net-support.h"
+ #include "pathnames.h"
+Index: net-tools-1.60/slattach.c
+===================================================================
+--- net-tools-1.60.orig/slattach.c
++++ net-tools-1.60/slattach.c
+@@ -44,6 +44,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <getopt.h>
++#include <termios.h>
+ #include <linux/if_slip.h>
+
+ #if defined(__GLIBC__)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch
new file mode 100644
index 000000000..12eed17af
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch
@@ -0,0 +1,638 @@
+From 23276afe270009420cfbc52bffafdd25ac0817fe Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Thu, 14 Jan 2016 17:01:29 +0800
+Subject: [PATCH 1/3] net-tools: add SCTP support for netstat
+
+Upstream-Status: pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ netstat.c | 411 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ statistics.c | 68 +++++++++-
+ 2 files changed, 465 insertions(+), 14 deletions(-)
+
+diff --git a/netstat.c b/netstat.c
+index 1fb9e0c..5d1a4a1 100644
+--- a/netstat.c
++++ b/netstat.c
+@@ -58,6 +58,7 @@
+ *
+ *990420 {1.38} Tuan Hoang removed a useless assignment from igmp_do_one()
+ *20010404 {1.39} Arnaldo Carvalho de Melo - use setlocale
++ *20050516 {1.40} Ivan Skytte Joergensen:Added SCTP support
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+@@ -105,7 +106,7 @@
+ #endif
+
+ /* prototypes for statistics.c */
+-void parsesnmp(int, int, int);
++void parsesnmp(int, int, int, int);
+ void inittab(void);
+ void parsesnmp6(int, int, int);
+ void inittab6(void);
+@@ -118,6 +119,28 @@ typedef enum {
+ SS_DISCONNECTING /* in process of disconnecting */
+ } socket_state;
+
++#define SCTP_NSTATES 9 /* The number of states in array*/
++
++static const char *sctp_state[] = {
++ N_("EMPTY"),
++ N_("CLOSED"),
++ N_("COOKIE_WAIT"),
++ N_("COOKIE_ECHOED"),
++ N_("ESTABLISHED"),
++ N_("SHUTDOWN_PENDING"),
++ N_("SHUTDOWN_SENT"),
++ N_("SHUTDOWN_RECEIVED"),
++ N_("SHUTDOWN_ACK_SENT")
++};
++
++#define SCTP_NTYPES 3 /* The number of types in array */
++
++static const char *sctp_type[] = {
++ N_("udp"),
++ N_("udp-high-bw"),
++ N_("tcp")
++};
++
+ #define SO_ACCEPTCON (1<<16) /* performed a listen */
+ #define SO_WAITDATA (1<<17) /* wait data to read */
+ #define SO_NOSPACE (1<<18) /* no space to write */
+@@ -148,6 +171,7 @@ int flag_opt = 0;
+ int flag_raw = 0;
+ int flag_tcp = 0;
+ int flag_udp = 0;
++int flag_sctp= 0;
+ int flag_igmp= 0;
+ int flag_rom = 0;
+ int flag_exp = 1;
+@@ -990,6 +1014,365 @@ static int udp_info(void)
+ udp_do_one);
+ }
+
++static const char *sctp_socket_type_str(int type) {
++ if(type>=0 && type<SCTP_NTYPES)
++ return sctp_type[type];
++ else {
++ static char type_str_buf[64];
++ sprintf(type_str_buf,"UNKNOWN(%d)",type);
++ return type_str_buf;
++ }
++}
++
++static const char *sctp_state_str(int state)
++{
++ if(state>=0 && state<SCTP_NSTATES)
++ return sctp_state[state];
++ else {
++ static char state_str_buf[64];
++ sprintf(state_str_buf,"UNKNOWN(%d)",state);
++ return state_str_buf;
++ }
++}
++
++static const char *sctp_socket_state_str(int state)
++{
++ if(state>=0 && state<=10)
++ return tcp_state[state];
++ else {
++ static char state_str_buf[64];
++ sprintf(state_str_buf,"UNKNOWN(%d)",state);
++ return state_str_buf;
++ }
++}
++
++static struct aftype *process_sctp_addr_str(const char *addr_str, struct sockaddr *sa)
++{
++ if (strchr(addr_str,':')) {
++#if HAVE_AFINET6
++ extern struct aftype inet6_aftype;
++ /* Demangle what the kernel gives us */
++ struct in6_addr in6;
++ char addr6_str[INET6_ADDRSTRLEN];
++ unsigned u0,u1,u2,u3,u4,u5,u6,u7;
++ sscanf(addr_str, "%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X",
++ &u0, &u1, &u2, &u3, &u4, &u5, &u6, &u7);
++ in6.s6_addr16[0] = htons(u0);
++ in6.s6_addr16[1] = htons(u1);
++ in6.s6_addr16[2] = htons(u2);
++ in6.s6_addr16[3] = htons(u3);
++ in6.s6_addr16[4] = htons(u4);
++ in6.s6_addr16[5] = htons(u5);
++ in6.s6_addr16[6] = htons(u6);
++ in6.s6_addr16[7] = htons(u7);
++
++ inet_ntop(AF_INET6, &in6, addr6_str, sizeof(addr6_str));
++ inet6_aftype.input(1, addr6_str, sa);
++ sa->sa_family = AF_INET6;
++#endif
++ } else {
++ ((struct sockaddr_in*)sa)->sin_addr.s_addr = inet_addr(addr_str);
++ sa->sa_family = AF_INET;
++ }
++ return get_afntype(sa->sa_family);
++}
++
++static void sctp_eps_do_one(int lnr, char *line)
++{
++ char buffer[1024];
++ int type, state, port;
++ int uid;
++ unsigned long inode;
++
++ struct aftype *ap;
++#if HAVE_AFINET6
++ struct sockaddr_in6 localaddr;
++#else
++ struct sockaddr_in localaddr;
++#endif
++ const char *sty_str;
++ const char *sst_str;
++ const char *lport_str;
++ const char *uid_str;
++ const char *inode_str;
++ const char *pladdr_str;
++ char *laddrs_str;
++
++ if(lnr == 0) {
++ /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/
++ return;
++ }
++
++ strtok(line," \t\n"); /*skip ptr*/
++ strtok(0," \t\n"); /*skip ptr*/
++ sty_str = strtok(0," \t\n");
++ sst_str = strtok(0," \t\n");
++ strtok(0," \t\n"); /*skip hash bucket*/
++ lport_str=strtok(0," \t\n");
++ uid_str = strtok(0," \t\n");
++ inode_str = strtok(0," \t\n");
++ pladdr_str = strtok(0," \t\n");
++ laddrs_str=strtok(0,"\t\n");
++
++ type = atoi(sty_str);
++ state = atoi(sst_str);
++ port = atoi(lport_str);
++ uid = atoi(uid_str);
++ inode = strtoul(inode_str,0,0);
++
++ if(flag_sctp<=1) {
++ /* only print the primary address */
++ char local_addr[64];
++ char local_port[16];
++
++ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(port), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ printf("sctp ");
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ printf("%-47s", buffer);
++ printf(" %-12s", sctp_socket_state_str(state));
++ } else {
++ /*print all addresses*/
++ const char *this_local_addr;
++ int first=1;
++ char local_port[16];
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(port), "sctp",
++ flag_not & FLAG_NUM_PORT));
++ for(this_local_addr=strtok(laddrs_str," \t\n");
++ this_local_addr;
++ this_local_addr=strtok(0," \t\n"))
++ {
++ char local_addr[64];
++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++
++ if(!first) printf("\n");
++ if(first)
++ printf("sctp ");
++ else
++ printf(" ");
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ printf("%-47s", buffer);
++ printf(" %-12s", first?sctp_socket_state_str(state):"");
++ first = 0;
++ }
++ }
++
++ finish_this_one(uid,inode,"");
++}
++
++static void sctp_assoc_do_one(int lnr, char *line)
++{
++ char buffer[1024];
++ int type, state, state2, lport,rport;
++ int uid;
++ unsigned rxqueue,txqueue;
++ unsigned long inode;
++
++ struct aftype *ap;
++#if HAVE_AFINET6
++ struct sockaddr_in6 localaddr,remoteaddr;
++#else
++ struct sockaddr_in localaddr,remoteaddr;
++#endif
++ const char *sty_str;
++ const char *sst_str;
++ const char *st_str;
++ const char *txqueue_str;
++ const char *rxqueue_str;
++ const char *lport_str,*rport_str;
++ const char *uid_str;
++ const char *inode_str;
++ const char *pladdr_str;
++ char *laddrs_str;
++ const char *praddr_str;
++ char *raddrs_str;
++
++ if(lnr == 0) {
++ /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/
++ return;
++ }
++
++ strtok(line," \t\n"); /*skip ptr*/
++ strtok(0," \t\n"); /*skip ptr*/
++ sty_str = strtok(0," \t\n");
++ sst_str = strtok(0," \t\n");
++ st_str = strtok(0," \t\n");
++ strtok(0," \t\n"); /*skip hash bucket*/
++ txqueue_str = strtok(0," \t\n");
++ rxqueue_str = strtok(0," \t\n");
++ uid_str = strtok(0," \t\n");
++ inode_str = strtok(0," \t\n");
++ lport_str=strtok(0," \t\n");
++ rport_str=strtok(0," \t\n");
++ pladdr_str = strtok(0," \t\n");
++ praddr_str = strtok(0," \t\n");
++ laddrs_str=strtok(0,"<->\t\n");
++ raddrs_str=strtok(0,"<->\t\n");
++
++ type = atoi(sty_str);
++ state = atoi(sst_str);
++ state2 = atoi(st_str);
++ txqueue = atoi(txqueue_str);
++ rxqueue = atoi(rxqueue_str);
++ uid = atoi(uid_str);
++ inode = strtoul(inode_str,0,0);
++ lport = atoi(lport_str);
++ rport = atoi(rport_str);
++
++ if(flag_sctp<=1) {
++ /* only print the primary addresses */
++ char local_addr[64];
++ char local_port[16];
++ char remote_addr[64];
++ char remote_port[16];
++
++ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(lport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr);
++ if(ap)
++ safe_strncpy(remote_addr,
++ ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
++ sizeof(remote_addr));
++ else
++ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
++
++ snprintf(remote_port, sizeof(remote_port), "%s",
++ get_sname(htons(rport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ printf("sctp");
++ printf(" %6u %6u ", rxqueue, txqueue);
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ printf("%-23s", buffer);
++ printf(" ");
++ sprintf(buffer,"%s:%s", remote_addr, remote_port);
++ printf("%-23s", buffer);
++ printf(" %-12s", sctp_socket_state_str(state));
++ } else {
++ /*print all addresses*/
++ const char *this_local_addr;
++ const char *this_remote_addr;
++ char *ss1,*ss2;
++ int first=1;
++ char local_port[16];
++ char remote_port[16];
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(lport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++ snprintf(remote_port, sizeof(remote_port), "%s",
++ get_sname(htons(rport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
++ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
++ while(this_local_addr || this_remote_addr) {
++ char local_addr[64];
++ char remote_addr[64];
++ if(this_local_addr) {
++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++ }
++ if(this_remote_addr) {
++ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
++ if(ap)
++ safe_strncpy(remote_addr,
++ ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
++ sizeof(remote_addr));
++ else
++ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
++ }
++
++ if(!first) printf("\n");
++ if(first)
++ printf("sctp %6u %6u ", rxqueue, txqueue);
++ else
++ printf(" ");
++ if(this_local_addr) {
++ if(first)
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ else
++ sprintf(buffer,"%s", local_addr);
++ printf("%-23s", buffer);
++ } else
++ printf("%-23s", "");
++ printf(" ");
++ if(this_remote_addr) {
++ if(first)
++ sprintf(buffer,"%s:%s", remote_addr, remote_port);
++ else
++ sprintf(buffer,"%s", remote_addr);
++ printf("%-23s", buffer);
++ } else
++ printf("%-23s", "");
++
++ printf(" %-12s", first?sctp_socket_state_str(state):"");
++
++ first = 0;
++ this_local_addr=strtok_r(0," \t\n",&ss1);
++ this_remote_addr=strtok_r(0," \t\n",&ss2);
++ }
++ }
++
++ finish_this_one(uid,inode,"");
++}
++
++static int sctp_info_eps(void)
++{
++#if !defined(_PATH_PROCNET_SCTP_EPS)
++#define _PATH_PROCNET_SCTP_EPS "/proc/net/sctp/eps"
++#endif
++ INFO_GUTS(_PATH_PROCNET_SCTP_EPS, "AF INET (sctp)",
++ sctp_eps_do_one);
++}
++
++static int sctp_info_assocs(void)
++{
++#if !defined(_PATH_PROCNET_SCTP_ASSOCS)
++#define _PATH_PROCNET_SCTP_ASSOCS "/proc/net/sctp/assocs"
++#endif
++ INFO_GUTS(_PATH_PROCNET_SCTP_ASSOCS, "AF INET (sctp)",
++ sctp_assoc_do_one);
++}
++
++static int sctp_info(void)
++{
++ if(flag_all)
++ sctp_info_eps();
++ return sctp_info_assocs();
++}
++
+ static void raw_do_one(int lnr, const char *line)
+ {
+ char buffer[8192], local_addr[64], rem_addr[64];
+@@ -1549,7 +1932,7 @@ static void usage(void)
+ fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n"));
+ fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n"));
+
+- fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
++ fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n"));
+ fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF);
+ fprintf(stderr, _(" List of possible address families (which support routing):\n"));
+ print_aflist(1); /* 1 = routeable */
+@@ -1574,6 +1957,7 @@ int main
+ {"protocol", 1, 0, 'A'},
+ {"tcp", 0, 0, 't'},
+ {"udp", 0, 0, 'u'},
++ {"sctp", 0, 0, 'S' },
+ {"raw", 0, 0, 'w'},
+ {"unix", 0, 0, 'x'},
+ {"listening", 0, 0, 'l'},
+@@ -1604,7 +1988,7 @@ int main
+ getroute_init(); /* Set up AF routing support */
+
+ afname[0] = '\0';
+- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuWVv?wxl64", longopts, &lop)) != EOF)
++ while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuSWVv?wxl64", longopts, &lop)) != EOF)
+ switch (i) {
+ case -1:
+ break;
+@@ -1696,10 +2080,12 @@ int main
+ case 't':
+ flag_tcp++;
+ break;
+-
+ case 'u':
+ flag_udp++;
+ break;
++ case 'S':
++ flag_sctp++;
++ break;
+ case 'w':
+ flag_raw++;
+ break;
+@@ -1717,13 +2103,13 @@ int main
+ if (flag_int + flag_rou + flag_mas + flag_sta > 1)
+ usage();
+
+- if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_raw))
+- flag_tcp = flag_udp = flag_raw = 1;
++ if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw))
++ flag_tcp = flag_udp = flag_sctp = flag_raw = 1;
+
+- if ((flag_tcp || flag_udp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
++ if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
+ flag_inet = flag_inet6 = 1;
+
+- flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
++ flag_arg = flag_tcp + flag_udp + flag_sctp + flag_raw + flag_unx + flag_ipx
+ + flag_ax25 + flag_netrom + flag_igmp + flag_x25;
+
+ if (flag_mas) {
+@@ -1751,7 +2137,7 @@ int main
+ char buf[256];
+ if (!afname[0]) {
+ inittab();
+- parsesnmp(flag_raw, flag_tcp, flag_udp);
++ parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp);
+ } else {
+ safe_strncpy(buf, afname, sizeof(buf));
+ tmp1 = buf;
+@@ -1804,7 +2190,7 @@ int main
+ return (i);
+ }
+ for (;;) {
+- if (!flag_arg || flag_tcp || flag_udp || flag_raw) {
++ if (!flag_arg || flag_tcp || flag_udp || flag_sctp || flag_raw) {
+ #if HAVE_AFINET
+ prg_cache_load();
+ printf(_("Active Internet connections ")); /* xxx */
+@@ -1843,6 +2229,11 @@ int main
+ if (i)
+ return (i);
+ }
++ if (!flag_arg || flag_sctp) {
++ i = sctp_info();
++ if (i)
++ return (i);
++ }
+ if (!flag_arg || flag_raw) {
+ i = raw_info();
+ if (i)
+diff --git a/statistics.c b/statistics.c
+index 03600d7..eb8d7dc 100644
+--- a/statistics.c
++++ b/statistics.c
+@@ -21,7 +21,7 @@
+ #define UFWARN(x)
+ #endif
+
+-int print_static,f_raw,f_tcp,f_udp,f_unknown = 1;
++int print_static,f_raw,f_tcp,f_udp,f_sctp,f_unknown = 1;
+
+ enum State {
+ number = 0, opt_number, i_forward, i_inp_icmp, i_outp_icmp, i_rto_alg,
+@@ -297,6 +297,27 @@ struct entry Tcpexttab[] =
+ { "TCPRenoRecoveryFail", N_("%u classic Reno fast retransmits failed"), opt_number },
+ };
+
++struct entry Sctptab[] =
++{
++ {"SctpCurrEstab", N_("%u Current Associations"), number},
++ {"SctpActiveEstabs", N_("%u Active Associations"), number},
++ {"SctpPassiveEstabs", N_("%u Passive Associations"), number},
++ {"SctpAborteds", N_("%u Number of Aborteds "), number},
++ {"SctpShutdowns", N_("%u Number of Graceful Terminations"), number},
++ {"SctpOutOfBlues", N_("%u Number of Out of Blue packets"), number},
++ {"SctpChecksumErrors", N_("%u Number of Packets with invalid Checksum"), number},
++ {"SctpOutCtrlChunks", N_("%u Number of control chunks sent"), number},
++ {"SctpOutOrderChunks", N_("%u Number of ordered chunks sent"), number},
++ {"SctpOutUnorderChunks", N_("%u Number of Unordered chunks sent"), number},
++ {"SctpInCtrlChunks", N_("%u Number of control chunks received"), number},
++ {"SctpInOrderChunks", N_("%u Number of ordered chunks received"), number},
++ {"SctpInUnorderChunks", N_("%u Number of Unordered chunks received"), number},
++ {"SctpFragUsrMsgs", N_("%u Number of messages fragmented"), number},
++ {"SctpReasmUsrMsgs", N_("%u Number of messages reassembled "), number},
++ {"SctpOutSCTPPacks", N_("%u Number of SCTP packets sent"), number},
++ {"SctpInSCTPPacks", N_("%u Number of SCTP packets received"), number},
++};
++
+ struct tabtab {
+ char *title;
+ struct entry *tab;
+@@ -310,6 +331,7 @@ struct tabtab snmptabs[] =
+ {"Icmp", Icmptab, sizeof(Icmptab), &f_raw},
+ {"Tcp", Tcptab, sizeof(Tcptab), &f_tcp},
+ {"Udp", Udptab, sizeof(Udptab), &f_udp},
++ {"Sctp", Sctptab, sizeof(Sctptab), &f_sctp},
+ {"TcpExt", Tcpexttab, sizeof(Tcpexttab), &f_tcp},
+ {NULL}
+ };
+@@ -499,12 +521,40 @@ void process6_fd(FILE *f)
+
+ }
+
+-void parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
++/* Process a file with name-value lines (like /proc/net/sctp/snmp) */
++void process_fd2(FILE *f, const char *filename)
++{
++ char buf1[1024];
++ char *sp;
++ struct tabtab *tab;
++
++ tab = newtable(snmptabs, "Sctp");
++
++ while (fgets(buf1, sizeof buf1, f)) {
++ sp = buf1 + strcspn(buf1, " \t\n");
++ if (!sp)
++ goto formaterr;
++ *sp = '\0';
++ sp++;
++
++ sp += strspn(sp, " \t\n");
++
++ if (*sp != '\0' && *(tab->flag))
++ printval(tab, buf1, strtoul(sp, 0, 10));
++ }
++ return;
++
++formaterr:
++ fprintf(stderr,_("error parsing %s\n"), filename);
++ return;
++}
++
++void parsesnmp(int flag_raw, int flag_tcp, int flag_udp, int flag_sctp)
+ {
+ FILE *f;
+
+- f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp;
+-
++ f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; f_sctp = flag_sctp;
++
+ f = proc_fopen("/proc/net/snmp");
+ if (!f) {
+ perror(_("cannot open /proc/net/snmp"));
+@@ -530,6 +580,16 @@ void parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
+
+ fclose(f);
+ }
++
++ f = fopen("/proc/net/sctp/snmp", "r");
++ if (f) {
++ process_fd2(f,"/proc/net/sctp/snmp");
++ if (ferror(f))
++ perror("/proc/net/sctp/snmp");
++
++ fclose(f);
++ }
++
+ return;
+ }
+
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch
new file mode 100644
index 000000000..d34e65132
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch
@@ -0,0 +1,28 @@
+From 14287b594e1f02b811f889fb515c1a51b72c08d4 Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Thu, 14 Jan 2016 17:07:48 +0800
+Subject: [PATCH 2/3] net-tools: add SCTP support for netstat
+
+Upstream-Status: pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ netstat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/netstat.c b/netstat.c
+index 5d1a4a1..56a15c2 100644
+--- a/netstat.c
++++ b/netstat.c
+@@ -2104,7 +2104,7 @@ int main
+ usage();
+
+ if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw))
+- flag_tcp = flag_udp = flag_sctp = flag_raw = 1;
++ flag_tcp = flag_udp = flag_raw = 1;
+
+ if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6))
+ flag_inet = flag_inet6 = 1;
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch
new file mode 100644
index 000000000..8b2ecab70
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch
@@ -0,0 +1,363 @@
+From 1d386279a449a1a6b96b88a71f35bf13b14b2c2c Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Thu, 14 Jan 2016 17:11:24 +0800
+Subject: [PATCH 3/3] net-tools: add SCTP support for netstat
+
+Upstream-Status: pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ netstat.c | 282 ++++++++++++++++++++++++--------------------------------------
+ 1 file changed, 108 insertions(+), 174 deletions(-)
+
+diff --git a/netstat.c b/netstat.c
+index 56a15c2..86adadb 100644
+--- a/netstat.c
++++ b/netstat.c
+@@ -1095,23 +1095,21 @@ static void sctp_eps_do_one(int lnr, char *line)
+ const char *lport_str;
+ const char *uid_str;
+ const char *inode_str;
+- const char *pladdr_str;
+ char *laddrs_str;
+
+ if(lnr == 0) {
+- /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/
++ /* ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS */
+ return;
+ }
+
+- strtok(line," \t\n"); /*skip ptr*/
+- strtok(0," \t\n"); /*skip ptr*/
++ strtok(line," \t\n"); /*skip endpt*/
++ strtok(0," \t\n"); /*skip sock*/
+ sty_str = strtok(0," \t\n");
+ sst_str = strtok(0," \t\n");
+ strtok(0," \t\n"); /*skip hash bucket*/
+ lport_str=strtok(0," \t\n");
+ uid_str = strtok(0," \t\n");
+ inode_str = strtok(0," \t\n");
+- pladdr_str = strtok(0," \t\n");
+ laddrs_str=strtok(0,"\t\n");
+
+ type = atoi(sty_str);
+@@ -1119,61 +1117,35 @@ static void sctp_eps_do_one(int lnr, char *line)
+ port = atoi(lport_str);
+ uid = atoi(uid_str);
+ inode = strtoul(inode_str,0,0);
+-
+- if(flag_sctp<=1) {
+- /* only print the primary address */
+- char local_addr[64];
+- char local_port[16];
+-
+- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
+- if(ap)
+- safe_strncpy(local_addr,
+- ap->sprint((struct sockaddr *) &localaddr, flag_not),
+- sizeof(local_addr));
+- else
+- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+-
+- snprintf(local_port, sizeof(local_port), "%s",
+- get_sname(htons(port), "sctp",
+- flag_not & FLAG_NUM_PORT));
+-
+- printf("sctp ");
+- sprintf(buffer,"%s:%s", local_addr, local_port);
+- printf("%-47s", buffer);
+- printf(" %-12s", sctp_socket_state_str(state));
+- } else {
+- /*print all addresses*/
+- const char *this_local_addr;
+- int first=1;
+- char local_port[16];
+- snprintf(local_port, sizeof(local_port), "%s",
+- get_sname(htons(port), "sctp",
+- flag_not & FLAG_NUM_PORT));
+- for(this_local_addr=strtok(laddrs_str," \t\n");
+- this_local_addr;
+- this_local_addr=strtok(0," \t\n"))
+- {
+- char local_addr[64];
+- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
+- if(ap)
+- safe_strncpy(local_addr,
+- ap->sprint((struct sockaddr *) &localaddr, flag_not),
+- sizeof(local_addr));
+- else
+- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+
+- if(!first) printf("\n");
+- if(first)
+- printf("sctp ");
+- else
+- printf(" ");
+- sprintf(buffer,"%s:%s", local_addr, local_port);
+- printf("%-47s", buffer);
+- printf(" %-12s", first?sctp_socket_state_str(state):"");
+- first = 0;
+- }
++ const char *this_local_addr;
++ int first=1;
++ char local_port[16];
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(port), "sctp", flag_not & FLAG_NUM_PORT));
++ for(this_local_addr=strtok(laddrs_str," \t\n");
++ this_local_addr;
++ this_local_addr=strtok(0," \t\n"))
++ {
++ char local_addr[64];
++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not),
++ sizeof(local_addr));
++ else
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++
++ if(!first) printf("\n");
++ if(first)
++ printf("sctp ");
++ else
++ printf(" ");
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ printf("%-55s", buffer);
++ printf(" %-12s", first?sctp_socket_state_str(state):"");
++ first = 0;
+ }
+-
+ finish_this_one(uid,inode,"");
+ }
+
+@@ -1199,32 +1171,29 @@ static void sctp_assoc_do_one(int lnr, char *line)
+ const char *lport_str,*rport_str;
+ const char *uid_str;
+ const char *inode_str;
+- const char *pladdr_str;
+ char *laddrs_str;
+- const char *praddr_str;
+ char *raddrs_str;
+-
++
+ if(lnr == 0) {
+- /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/
++ /* ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS */
+ return;
+ }
+-
+- strtok(line," \t\n"); /*skip ptr*/
+- strtok(0," \t\n"); /*skip ptr*/
++
++ strtok(line," \t\n"); /*skip assoc*/
++ strtok(0," \t\n"); /*skip sock*/
+ sty_str = strtok(0," \t\n");
+ sst_str = strtok(0," \t\n");
+ st_str = strtok(0," \t\n");
+ strtok(0," \t\n"); /*skip hash bucket*/
++ strtok(0," \t\n"); /*skip hash assoc-id*/
+ txqueue_str = strtok(0," \t\n");
+ rxqueue_str = strtok(0," \t\n");
+ uid_str = strtok(0," \t\n");
+ inode_str = strtok(0," \t\n");
+ lport_str=strtok(0," \t\n");
+ rport_str=strtok(0," \t\n");
+- pladdr_str = strtok(0," \t\n");
+- praddr_str = strtok(0," \t\n");
+- laddrs_str=strtok(0,"<->\t\n");
+- raddrs_str=strtok(0,"<->\t\n");
++ laddrs_str = strtok(0,"<->\t\n");
++ raddrs_str = strtok(0,"<->\t\n");
+
+ type = atoi(sty_str);
+ state = atoi(sst_str);
+@@ -1235,116 +1204,81 @@ static void sctp_assoc_do_one(int lnr, char *line)
+ inode = strtoul(inode_str,0,0);
+ lport = atoi(lport_str);
+ rport = atoi(rport_str);
+-
+- if(flag_sctp<=1) {
+- /* only print the primary addresses */
+- char local_addr[64];
+- char local_port[16];
+- char remote_addr[64];
+- char remote_port[16];
+-
+- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr);
+- if(ap)
+- safe_strncpy(local_addr,
+- ap->sprint((struct sockaddr *) &localaddr, flag_not),
+- sizeof(local_addr));
+- else
+- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+-
+- snprintf(local_port, sizeof(local_port), "%s",
+- get_sname(htons(lport), "sctp",
+- flag_not & FLAG_NUM_PORT));
+-
+- ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr);
+- if(ap)
+- safe_strncpy(remote_addr,
+- ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
+- sizeof(remote_addr));
+- else
+- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
+-
+- snprintf(remote_port, sizeof(remote_port), "%s",
+- get_sname(htons(rport), "sctp",
+- flag_not & FLAG_NUM_PORT));
+-
+- printf("sctp");
+- printf(" %6u %6u ", rxqueue, txqueue);
+- sprintf(buffer,"%s:%s", local_addr, local_port);
+- printf("%-23s", buffer);
+- printf(" ");
+- sprintf(buffer,"%s:%s", remote_addr, remote_port);
+- printf("%-23s", buffer);
+- printf(" %-12s", sctp_socket_state_str(state));
+- } else {
+- /*print all addresses*/
+- const char *this_local_addr;
+- const char *this_remote_addr;
+- char *ss1,*ss2;
+- int first=1;
+- char local_port[16];
+- char remote_port[16];
+- snprintf(local_port, sizeof(local_port), "%s",
+- get_sname(htons(lport), "sctp",
+- flag_not & FLAG_NUM_PORT));
+- snprintf(remote_port, sizeof(remote_port), "%s",
+- get_sname(htons(rport), "sctp",
+- flag_not & FLAG_NUM_PORT));
+-
+- this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
+- this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
+- while(this_local_addr || this_remote_addr) {
+- char local_addr[64];
+- char remote_addr[64];
+- if(this_local_addr) {
+- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
+- if(ap)
+- safe_strncpy(local_addr,
+- ap->sprint((struct sockaddr *) &localaddr, flag_not),
+- sizeof(local_addr));
+- else
+- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
+- }
+- if(this_remote_addr) {
+- ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
+- if(ap)
+- safe_strncpy(remote_addr,
+- ap->sprint((struct sockaddr *) &remoteaddr, flag_not),
+- sizeof(remote_addr));
+- else
+- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
+- }
+
+- if(!first) printf("\n");
+- if(first)
+- printf("sctp %6u %6u ", rxqueue, txqueue);
+- else
+- printf(" ");
+- if(this_local_addr) {
+- if(first)
+- sprintf(buffer,"%s:%s", local_addr, local_port);
++ /*print all addresses*/
++ const char *this_local_addr;
++ const char *this_remote_addr;
++ char *ss1,*ss2;
++ int first=1;
++ char local_port[16];
++ char remote_port[16];
++ snprintf(local_port, sizeof(local_port), "%s",
++ get_sname(htons(lport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++ snprintf(remote_port, sizeof(remote_port), "%s",
++ get_sname(htons(rport), "sctp",
++ flag_not & FLAG_NUM_PORT));
++
++ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1);
++ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2);
++ while(this_local_addr || this_remote_addr) {
++ char local_addr[64];
++ char remote_addr[64];
++
++ if(this_local_addr) {
++ if (this_local_addr[0] == '*') {
++ /* skip * */
++ this_local_addr++;
++ }
++ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr);
++ if(ap)
++ safe_strncpy(local_addr,
++ ap->sprint((struct sockaddr *) &localaddr, flag_not), sizeof(local_addr));
+ else
+- sprintf(buffer,"%s", local_addr);
+- printf("%-23s", buffer);
+- } else
+- printf("%-23s", "");
+- printf(" ");
+- if(this_remote_addr) {
+- if(first)
+- sprintf(buffer,"%s:%s", remote_addr, remote_port);
++ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family);
++ }
++ if(this_remote_addr) {
++ if (this_remote_addr[0] == '*') {
++ /* skip * */
++ this_remote_addr++;
++ }
++ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr);
++ if(ap)
++ safe_strncpy(remote_addr,
++ ap->sprint((struct sockaddr *) &remoteaddr, flag_not), sizeof(remote_addr));
+ else
+- sprintf(buffer,"%s", remote_addr);
+- printf("%-23s", buffer);
+- } else
+- printf("%-23s", "");
+-
+- printf(" %-12s", first?sctp_socket_state_str(state):"");
++ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family);
++ }
+
+- first = 0;
+- this_local_addr=strtok_r(0," \t\n",&ss1);
+- this_remote_addr=strtok_r(0," \t\n",&ss2);
+- }
++ if(!first) printf("\n");
++ if(first)
++ printf("sctp %6u %6u ", rxqueue, txqueue);
++ else
++ printf(" ");
++ if(this_local_addr) {
++ if(first)
++ sprintf(buffer,"%s:%s", local_addr, local_port);
++ else
++ sprintf(buffer,"%s", local_addr);
++ printf("%-27s", buffer);
++ } else
++ printf("%-27s", "");
++ printf(" ");
++ if(this_remote_addr) {
++ if(first)
++ sprintf(buffer,"%s:%s", remote_addr, remote_port);
++ else
++ sprintf(buffer,"%s", remote_addr);
++ printf("%-27s", buffer);
++ } else
++ printf("%-27s", "");
++
++ printf(" %-12s", first?sctp_socket_state_str(state):"");
++
++ first = 0;
++ this_local_addr=strtok_r(0," \t\n",&ss1);
++ this_remote_addr=strtok_r(0," \t\n",&ss2);
+ }
+-
+ finish_this_one(uid,inode,"");
+ }
+
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h
new file mode 100644
index 000000000..6d39c2a8c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.h
@@ -0,0 +1,75 @@
+/*
+* config.h Automatically generated configuration includefile
+*
+* NET-TOOLS A collection of programs that form the base set of the
+* NET-3 Networking Distribution for the LINUX operating
+* system.
+*
+* DO NOT EDIT DIRECTLY
+*
+*/
+
+/*
+ *
+ * Internationalization
+ *
+ * The net-tools package has currently been translated to French,
+ * German and Brazilian Portugese. Other translations are, of
+ * course, welcome. Answer `n' here if you have no support for
+ * internationalization on your system.
+ *
+ */
+#define I18N 1
+
+/*
+ *
+ * Protocol Families.
+ *
+ */
+#define HAVE_AFUNIX 1
+#define HAVE_AFINET 1
+#define HAVE_AFINET6 1
+#define HAVE_AFIPX 0
+#define HAVE_AFATALK 0
+#define HAVE_AFAX25 0
+#define HAVE_AFNETROM 1
+#define HAVE_AFROSE 0
+#define HAVE_AFX25 0
+#define HAVE_AFECONET 0
+#define HAVE_AFDECnet 0
+#define HAVE_AFASH 0
+
+/*
+ *
+ * Device Hardware types.
+ *
+ */
+#define HAVE_HWETHER 1
+#define HAVE_HWARC 1
+#define HAVE_HWSLIP 1
+#define HAVE_HWPPP 1
+#define HAVE_HWTUNNEL 1
+#define HAVE_HWSTRIP 0
+#define HAVE_HWTR 0
+#define HAVE_HWAX25 0
+#define HAVE_HWROSE 0
+#define HAVE_HWNETROM 1
+#define HAVE_HWX25 0
+#define HAVE_HWFR 1
+#define HAVE_HWSIT 0
+#define HAVE_HWFDDI 0
+#define HAVE_HWHIPPI 0
+#define HAVE_HWASH 0
+#define HAVE_HWHDLCLAPB 0
+#define HAVE_HWIRDA 1
+#define HAVE_HWEC 0
+#define HAVE_HWIB 0
+
+/*
+ *
+ * Other Features.
+ *
+ */
+#define HAVE_FW_MASQUERADE 1
+#define HAVE_IP_TOOLS 1
+#define HAVE_MII 1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make
new file mode 100644
index 000000000..ec516f27e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools/net-tools-config.make
@@ -0,0 +1,36 @@
+I18N=1
+HAVE_AFUNIX=1
+HAVE_AFINET=1
+HAVE_AFINET6=1
+# HAVE_AFIPX=0
+# HAVE_AFATALK=0
+# HAVE_AFAX25=0
+HAVE_AFNETROM=1
+# HAVE_AFROSE=0
+# HAVE_AFX25=0
+# HAVE_AFECONET=0
+# HAVE_AFDECnet=0
+# HAVE_AFASH=0
+HAVE_HWETHER=1
+HAVE_HWARC=1
+HAVE_HWSLIP=1
+HAVE_HWPPP=1
+HAVE_HWTUNNEL=1
+HAVE_HWSTRIP=1
+HAVE_HWTR=1
+# HAVE_HWAX25=0
+# HAVE_HWROSE=0
+HAVE_HWNETROM=1
+# HAVE_HWX25=0
+HAVE_HWFR=1
+# HAVE_HWSIT=0
+# HAVE_HWFDDI=0
+# HAVE_HWHIPPI=0
+# HAVE_HWASH=0
+# HAVE_HWHDLCLAPB=0
+HAVE_HWIRDA=1
+# HAVE_HWEC=0
+# HAVE_HWIB=0
+HAVE_FW_MASQUERADE=1
+HAVE_IP_TOOLS=1
+HAVE_MII=1
diff --git a/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
new file mode 100644
index 000000000..63b2051ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
@@ -0,0 +1,109 @@
+SUMMARY = "Basic networking tools"
+DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system"
+HOMEPAGE = "http://net-tools.berlios.de/"
+BUGTRACKER = "http://bugs.debian.org/net-tools"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/n/${BPN}/${BPN}_1.60.orig.tar.gz;name=tarball \
+ http://snapshot.debian.org/archive/debian//20150831T093342Z/pool/main/n/${BPN}/${BPN}_${PV}.diff.gz;apply=no;name=patch \
+ file://net-tools-config.h \
+ file://net-tools-config.make \
+ file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \
+ file://musl-fixes.patch \
+ file://net-tools-1.60-sctp1.patch \
+ file://net-tools-1.60-sctp2-quiet.patch \
+ file://net-tools-1.60-sctp3-addrs.patch \
+ "
+
+# for this package we're mostly interested in tracking debian patches,
+# and not in the upstream version where all development has effectively stopped
+UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
+
+S = "${WORKDIR}/net-tools-1.60"
+
+SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d"
+SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5"
+
+SRC_URI[patch.md5sum] = "ea3592f49ac8380962bc4d9b66c7e7e9"
+SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e46585022fc76c"
+
+# the package is taken from snapshots.debian.org; that source is static and goes stale
+# so we check the latest upstream from a directory that does get updated
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/net-tools/"
+
+inherit gettext
+
+do_patch[depends] = "quilt-native:do_populate_sysroot"
+
+LDFLAGS_append_libc-uclibc = " -lintl "
+
+# The Makefile is lame, no parallel build
+PARALLEL_MAKE = ""
+
+# Unlike other Debian packages, net-tools *.diff.gz contains another series of
+# patches maintained by quilt. So manually apply them before applying other local
+# patches. Also remove all temp files before leaving, because do_patch() will pop
+# up all previously applied patches in the start
+nettools_do_patch() {
+ cd ${S}
+ quilt pop -a || true
+ if [ -d ${S}/.pc-nettools ]; then
+ rm -rf ${S}/.pc
+ mv ${S}/.pc-nettools ${S}/.pc
+ QUILT_PATCHES=${S}/debian/patches quilt pop -a
+ rm -rf ${S}/.pc ${S}/debian
+ fi
+ patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff
+ QUILT_PATCHES=${S}/debian/patches quilt push -a
+ mv ${S}/.pc ${S}/.pc-nettools
+}
+
+do_unpack[cleandirs] += "${S}"
+
+# We invoke base do_patch at end, to incorporate any local patch
+python do_patch() {
+ bb.build.exec_func('nettools_do_patch', d)
+ bb.build.exec_func('patch_do_patch', d)
+}
+
+do_configure() {
+ # net-tools has its own config mechanism requiring "make config"
+ # we pre-generate desired options and copy to source directory instead
+ cp ${WORKDIR}/net-tools-config.h ${S}/config.h
+ cp ${WORKDIR}/net-tools-config.make ${S}/config.make
+}
+
+do_compile() {
+ # net-tools use COPTS/LOPTS to allow adding custom options
+ export COPTS="$CFLAGS"
+ export LOPTS="$LDFLAGS"
+ unset CFLAGS
+ unset LDFLAGS
+
+ oe_runmake
+}
+
+do_install() {
+ export COPTS="$CFLAGS"
+ export LOPTS="$LDFLAGS"
+ unset CFLAGS
+ unset LDFLAGS
+ oe_runmake 'BASEDIR=${D}' install
+}
+
+inherit update-alternatives
+
+base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach"
+base_bindir_progs = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname"
+
+ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}"
+python __anonymous() {
+ for prog in d.getVar('base_sbindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
+ for prog in d.getVar('base_bindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+}
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch b/import-layers/yocto-poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch
new file mode 100644
index 000000000..bc55582fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/files/Makefile.in-Add-tinfo-library-to-the-linking-librari.patch
@@ -0,0 +1,26 @@
+From fad40cfc18a42946a9a9e440c3434cd6b847ff9d Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Mon, 18 Jan 2016 17:05:19 +0000
+Subject: [PATCH] Makefile.in: Add tinfo library to the linking libraries
+Organization: O.S. Systems Software LTDA.
+
+Upstream-Status: Pending
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index a85d00f..98b85f9 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1,4 +1,4 @@
+-LIBS = -lslang @LIBS@
++LIBS = -lslang -ltinfo @LIBS@
+ LIBTCL = @TCL_LIB_FLAG@
+
+ CC = @CC@
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/files/cross_ar.patch b/import-layers/yocto-poky/meta/recipes-extended/newt/files/cross_ar.patch
new file mode 100644
index 000000000..03007aa4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/files/cross_ar.patch
@@ -0,0 +1,58 @@
+Fix cross link using autoconf detected AR
+
+If building on 32bit host and creating 64bit libraries, the target
+package builds should not invoke the 32bit hosts's ar. Specifically
+you will get an error message like:
+
+x86_64-linux-gcc -m64 --sysroot=/opt/qemux86-64/tmp/sysroots/qemux86-64 -g -o test test.o libnewt.a -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lslang
+libnewt.a: could not read symbols: Archive has no index; run ranlib to add one
+collect2: error: ld returned 1 exit status
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 3 ++-
+ configure.ac | 4 ++++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -7,6 +7,7 @@ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+ CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@
+ GNU_LD = @GNU_LD@
++AR = @AR@
+
+ VERSION = @VERSION@
+ TAG = r$(subst .,-,$(VERSION))
+@@ -109,7 +110,7 @@ whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNEWTSH)
+ $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.$(SOEXT) $(WHIPTCLOBJS) -L. -lnewt $(LIBTCL) -lpopt $(LIBS)
+
+ $(LIBNEWT): $(LIBOBJS)
+- ar rv $@ $^
++ $(AR) rv $@ $^
+
+ newt.o $(SHAREDDIR)/newt.o: newt.c Makefile
+
+diff --git a/configure.ac b/configure.ac
+index 92e6da8..cd83d57 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -15,6 +15,10 @@ AC_PROG_INSTALL
+ AC_PROG_LN_S
+ AC_PROG_GREP
+ AC_SYS_LARGEFILE
++AN_MAKEVAR([AR], [AC_PROG_AR])
++AN_PROGRAM([ar], [AC_PROG_AR])
++AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
++AC_PROG_AR
+
+ # Are we using GNU ld?
+ AC_MSG_CHECKING([for GNU ld])
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch b/import-layers/yocto-poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch
new file mode 100644
index 000000000..b0a1e8c10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+Author: dexuan.cui@intel.com
+Date: Fri Apr 15 16:17:39 CST 2011
+
+The patch fixes a parallel-make issue: when generating $(SHAREDDIR)/%.o, we should
+ensure the directory ${SHAREDDIR} exists.
+
+We need to push the patch to upstream.
+
+Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -128,12 +128,12 @@ $(SHAREDDIR):
+
+ sharedlib: $(LIBNEWTSH)
+
+-$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
++$(LIBNEWTSH): $(SHAREDOBJS)
+ $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) $(SHAREDOBJS) $(LDFLAGS) $(LIBS)
+ ln -fs $(LIBNEWTSONAME) libnewt.$(SOEXT)
+ ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME)
+
+-$(SHAREDDIR)/%.o : %.c
++$(SHAREDDIR)/%.o : %.c $(SHAREDDIR)
+ $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
+
+ install: $(LIBNEWT) install-sh whiptail
+--
+1.8.1.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/files/pie-flags.patch b/import-layers/yocto-poky/meta/recipes-extended/newt/files/pie-flags.patch
new file mode 100644
index 000000000..8883e26ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/files/pie-flags.patch
@@ -0,0 +1,36 @@
+specify -fPIC after CFLAGS so it can override the CFLAGS containing -pie and -fpie
+this makes sure the objects that go into shared objects are compiled with -fPIC
+and not with -fpie. We can not use -fpie on objects which will go into .so files
+Fixes errors like
+
+| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: shared/newt.o: relocation R_X86_64_PC32 against undefined symbol `SLtt_Screen_Rows@@SLANG2' can not be used when making a shared object; recompile with -fPIC
+| /mnt/oe/build/tmp-glibc/sysroots/x86_64-linux/usr/libexec/x86_64-oe-linux/gcc/x86_64-oe-linux/5.3.0/ld: final link failed: Bad value
+| collect2: error: ld returned 1 exit status
+| make: *** [libnewt.so.0.52.18] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: newt-0.52.18/Makefile.in
+===================================================================
+--- newt-0.52.18.orig/Makefile.in
++++ newt-0.52.18/Makefile.in
+@@ -96,8 +96,8 @@ _snack.$(SOEXT): snack.c $(LIBNEWTSH)
+ PIFLAGS=`$$pyconfig --includes`; \
+ PLDFLAGS=`$$pyconfig --ldflags`; \
+ PLFLAGS=`$$pyconfig --libs`; \
+- echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
+- $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
++ echo $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
++ $(CC) $(CPPFLAGS) $(SHCFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snack.o snack.c; \
+ echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
+ $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snack.$(SOEXT) $$ver/snack.o -L. -lnewt $(LIBS); \
+ done || :
+@@ -135,7 +135,7 @@ $(LIBNEWTSH): $(SHAREDOBJS)
+ ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME)
+
+ $(SHAREDDIR)/%.o : %.c $(SHAREDDIR)
+- $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
++ $(CC) -c $(CFLAGS) $(CPPFLAGS) $(SHCFLAGS) -o $@ $<
+
+ install: $(LIBNEWT) install-sh whiptail
+ [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/files/remove_slang_include.patch b/import-layers/yocto-poky/meta/recipes-extended/newt/files/remove_slang_include.patch
new file mode 100644
index 000000000..a2634ec75
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/files/remove_slang_include.patch
@@ -0,0 +1,16 @@
+
+Upstream-Status: Pending
+
+Index: git/Makefile.in
+===================================================================
+--- git.orig/Makefile.in
++++ git/Makefile.in
+@@ -5,7 +5,7 @@ CC = @CC@
+ CPP = @CPP@
+ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+-CPPFLAGS = -D_GNU_SOURCE -I/usr/include/slang @CPPFLAGS@
++CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@
+ GNU_LD = @GNU_LD@
+
+ VERSION = @VERSION@
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt-python_0.52.18.bb b/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt-python_0.52.18.bb
new file mode 100644
index 000000000..ba047574f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt-python_0.52.18.bb
@@ -0,0 +1,28 @@
+require recipes-extended/newt/libnewt_${PV}.bb
+
+SUMMARY .= " - python"
+DEPENDS = "libnewt python"
+RDEPENDS_${PN} += "python-core"
+
+inherit pythonnative python-dir
+
+EXTRA_OECONF += "--with-python"
+EXTRA_OEMAKE += "PYTHONVERS=${PYTHON_DIR}"
+
+
+do_compile () {
+ VERSION="$(sed -n 's/^VERSION = //p' Makefile)"
+ oe_runmake _snack.so
+}
+
+do_install () {
+ install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+ install -m 0755 ${PYTHON_DIR}/_snack.so ${D}${PYTHON_SITEPACKAGES_DIR}/
+ install -m 0644 snack.py ${D}${PYTHON_SITEPACKAGES_DIR}/
+}
+
+PACKAGES_remove = "whiptail"
+
+FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR}/*"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt_0.52.18.bb b/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt_0.52.18.bb
new file mode 100644
index 000000000..9a2964be1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/newt/libnewt_0.52.18.bb
@@ -0,0 +1,59 @@
+SUMMARY = "A library for text mode user interfaces"
+
+DESCRIPTION = "Newt is a programming library for color text mode, widget based user \
+interfaces. Newt can be used to add stacked windows, entry widgets, \
+checkboxes, radio buttons, labels, plain text fields, scrollbars, \
+etc., to text mode user interfaces. This package also contains the \
+shared library needed by programs built with newt, as well as a \
+/usr/bin/dialog replacement called whiptail. Newt is based on the \
+slang library."
+
+HOMEPAGE = "https://fedorahosted.org/newt/"
+SECTION = "libs"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+# slang needs to be >= 2.2
+DEPENDS = "slang popt"
+
+SRC_URI = "https://fedorahosted.org/releases/n/e/newt/newt-${PV}.tar.gz \
+ file://remove_slang_include.patch \
+ file://fix_SHAREDDIR.patch \
+ file://cross_ar.patch \
+ file://Makefile.in-Add-tinfo-library-to-the-linking-librari.patch \
+ file://pie-flags.patch \
+"
+
+SRC_URI[md5sum] = "685721bee1a318570704b19dcf31d268"
+SRC_URI[sha256sum] = "771b0e634ede56ae6a6acd910728bb5832ac13ddb0d1d27919d2498dab70c91e"
+
+S = "${WORKDIR}/newt-${PV}"
+
+EXTRA_OECONF = "--without-tcl --without-python"
+
+inherit autotools-brokensep
+
+CLEANBROKEN = "1"
+
+export STAGING_INCDIR
+export STAGING_LIBDIR
+export CPPFLAGS
+
+export BUILD_SYS
+export HOST_SYS
+
+PACKAGES_prepend = "whiptail "
+
+do_configure_prepend() {
+ sh autogen.sh
+}
+
+do_compile_prepend() {
+ # Make sure the recompile is OK
+ rm -f ${B}/.depend
+}
+
+FILES_whiptail = "${bindir}/whiptail"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
new file mode 100644
index 000000000..1d7e6089e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
@@ -0,0 +1,162 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Standard full-featured Linux system"
+DESCRIPTION = "Package group bringing in packages needed for a more traditional full-featured Linux system"
+PR = "r6"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+ packagegroup-core-full-cmdline \
+ packagegroup-core-full-cmdline-libs \
+ packagegroup-core-full-cmdline-utils \
+ packagegroup-core-full-cmdline-extended \
+ packagegroup-core-full-cmdline-dev-utils \
+ packagegroup-core-full-cmdline-multiuser \
+ packagegroup-core-full-cmdline-initscripts \
+ packagegroup-core-full-cmdline-sys-services \
+ "
+
+python __anonymous () {
+ # For backwards compatibility after rename
+ namemap = {}
+ namemap["packagegroup-core-full-cmdline"] = "packagegroup-core-basic"
+ namemap["packagegroup-core-full-cmdline-libs"] = "packagegroup-core-basic-libs"
+ namemap["packagegroup-core-full-cmdline-utils"] = "packagegroup-core-basic-utils"
+ namemap["packagegroup-core-full-cmdline-extended"] = "packagegroup-core-basic-extended"
+ namemap["packagegroup-core-full-cmdline-dev-utils"] = "packagegroup-core-dev-utils"
+ namemap["packagegroup-core-full-cmdline-multiuser"] = "packagegroup-core-multiuser"
+ namemap["packagegroup-core-full-cmdline-initscripts"] = "packagegroup-core-initscripts"
+ namemap["packagegroup-core-full-cmdline-sys-services"] = "packagegroup-core-sys-services"
+
+ packages = d.getVar("PACKAGES", True).split()
+ for pkg in packages:
+ if pkg.endswith('-dev'):
+ mapped = namemap.get(pkg[:-4], None)
+ if mapped:
+ mapped += '-dev'
+ elif pkg.endswith('-dbg'):
+ mapped = namemap.get(pkg[:-4], None)
+ if mapped:
+ mapped += '-dbg'
+ else:
+ mapped = namemap.get(pkg, None)
+
+ if mapped:
+ oldtaskname = mapped.replace("packagegroup-core", "task-core")
+ mapstr = " %s %s" % (mapped, oldtaskname)
+ d.appendVar("RPROVIDES_%s" % pkg, mapstr)
+ d.appendVar("RREPLACES_%s" % pkg, mapstr)
+ d.appendVar("RCONFLICTS_%s" % pkg, mapstr)
+}
+
+
+RDEPENDS_packagegroup-core-full-cmdline = "\
+ packagegroup-core-full-cmdline-libs \
+ packagegroup-core-full-cmdline-utils \
+ packagegroup-core-full-cmdline-extended \
+ packagegroup-core-full-cmdline-dev-utils \
+ packagegroup-core-full-cmdline-multiuser \
+ packagegroup-core-full-cmdline-initscripts \
+ packagegroup-core-full-cmdline-sys-services \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-libs = "\
+ glib-2.0 \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-utils = "\
+ bash \
+ acl \
+ attr \
+ bc \
+ coreutils \
+ cpio \
+ e2fsprogs \
+ ed \
+ file \
+ findutils \
+ gawk \
+ gmp \
+ grep \
+ makedevs \
+ mc \
+ mc-fish \
+ mc-helpers \
+ mc-helpers-perl \
+ mc-helpers-python \
+ mktemp \
+ ncurses \
+ net-tools \
+ pax \
+ popt \
+ procps \
+ psmisc \
+ sed \
+ tar \
+ time \
+ util-linux \
+ zlib \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-extended = "\
+ iproute2 \
+ iputils \
+ iptables \
+ module-init-tools \
+ openssl \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-dev-utils = "\
+ byacc \
+ diffutils \
+ m4 \
+ make \
+ patch \
+ "
+
+VIRTUAL-RUNTIME_initscripts ?= "initscripts"
+VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
+VIRTUAL-RUNTIME_login_manager ?= "busybox"
+VIRTUAL-RUNTIME_syslog ?= "sysklogd"
+RDEPENDS_packagegroup-core-full-cmdline-initscripts = "\
+ ${VIRTUAL-RUNTIME_initscripts} \
+ ${VIRTUAL-RUNTIME_init_manager} \
+ ethtool \
+ ${VIRTUAL-RUNTIME_login_manager} \
+ ${VIRTUAL-RUNTIME_syslog} \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-multiuser = "\
+ cracklib \
+ gzip \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libuser', '', d)} \
+ shadow \
+ sudo \
+ "
+
+RDEPENDS_packagegroup-core-full-cmdline-sys-services = "\
+ at \
+ bzip2 \
+ cronie \
+ dbus \
+ dbus-glib \
+ python-dbus \
+ elfutils \
+ gzip \
+ less \
+ libcap \
+ libevent \
+ logrotate \
+ nfs-utils \
+ pciutils \
+ libpcre \
+ rpcbind \
+ sysfsutils \
+ tcp-wrappers \
+ tzdata \
+ "
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
new file mode 100644
index 000000000..a29c3d762
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
@@ -0,0 +1,283 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Linux Standard Base (LSB)"
+DESCRIPTION = "Packages required to satisfy the Linux Standard Base (LSB) specification"
+PR = "r10"
+LICENSE = "MIT"
+
+inherit packagegroup distro_features_check
+
+# The libxt, libxtst and others require x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+#
+# We will skip parsing this packagegeoup for non-glibc systems
+#
+python __anonymous () {
+ if d.getVar('TCLIBC', True) != "glibc":
+ raise bb.parse.SkipPackage("incompatible with %s C library" %
+ d.getVar('TCLIBC', True))
+}
+
+PACKAGES = "\
+ packagegroup-core-lsb \
+ packagegroup-core-sys-extended \
+ packagegroup-core-db \
+ packagegroup-core-perl \
+ packagegroup-core-python \
+ packagegroup-core-tcl \
+ packagegroup-core-lsb-misc \
+ packagegroup-core-lsb-core \
+ packagegroup-core-lsb-perl \
+ packagegroup-core-lsb-python \
+ packagegroup-core-lsb-desktop \
+ packagegroup-core-lsb-runtime-add \
+ "
+
+
+RDEPENDS_packagegroup-core-lsb = "\
+ packagegroup-core-sys-extended \
+ packagegroup-core-db \
+ packagegroup-core-perl \
+ packagegroup-core-python \
+ packagegroup-core-tcl \
+ packagegroup-core-lsb-misc \
+ packagegroup-core-lsb-core \
+ packagegroup-core-lsb-perl \
+ packagegroup-core-lsb-python \
+ packagegroup-core-lsb-desktop \
+ packagegroup-core-lsb-runtime-add \
+ "
+
+
+RDEPENDS_packagegroup-core-sys-extended = "\
+ curl \
+ dhcp-client \
+ hdparm \
+ lighttpd \
+ libaio \
+ lrzsz \
+ lzo \
+ mc \
+ mc-fish \
+ mc-helpers \
+ mc-helpers-perl \
+ mc-helpers-python \
+ mdadm \
+ minicom \
+ neon \
+ parted \
+ quota \
+ screen \
+ setserial \
+ sysstat \
+ udev-extraconf \
+ unzip \
+ watchdog \
+ wget \
+ which \
+ xinetd \
+ zip \
+ "
+
+RDEPENDS_packagegroup-core-db = "\
+ db \
+ sqlite3 \
+ "
+
+RDEPENDS_packagegroup-core-perl = "\
+ gdbm \
+ perl \
+ zlib \
+ "
+
+
+RDEPENDS_packagegroup-core-python = "\
+ expat \
+ gdbm \
+ gmp \
+ ncurses \
+ openssl \
+ python \
+ readline \
+ zip \
+ "
+
+RDEPENDS_packagegroup-core-tcl = "\
+ tcl \
+ "
+
+# Miscellaneous packages required by LSB (or LSB tests)
+RDEPENDS_packagegroup-core-lsb-misc = "\
+ chkconfig \
+ gettext \
+ gettext-runtime \
+ groff \
+ lsbinitscripts \
+ lsbtest \
+ lsof \
+ strace \
+ libusb1 \
+ usbutils \
+ rpm \
+ "
+
+SUMMARY_packagegroup-core-lsb-core = "LSB Core"
+DESCRIPTION_packagegroup-core-lsb-core = "Packages required to support commands/libraries \
+ specified in the LSB Core specification"
+RDEPENDS_packagegroup-core-lsb-core = "\
+ at \
+ bash \
+ bc \
+ binutils \
+ binutils-symlinks \
+ coreutils \
+ cpio \
+ cronie \
+ cups \
+ diffutils \
+ ed \
+ glibc-utils \
+ elfutils \
+ file \
+ findutils \
+ fontconfig-utils \
+ foomatic-filters \
+ gawk \
+ ghostscript \
+ grep \
+ gzip \
+ localedef \
+ lsb \
+ m4 \
+ mailx \
+ make \
+ man \
+ man-pages \
+ mktemp \
+ msmtp \
+ patch \
+ pax \
+ procps \
+ psmisc \
+ sed \
+ shadow \
+ tar \
+ time \
+ util-linux \
+ xdg-utils \
+ \
+ glibc \
+ libgcc \
+ libpam \
+ libxml2 \
+ ncurses \
+ zlib \
+ nspr \
+ libpng12 \
+ nss \
+"
+
+SUMMARY_packagegroup-core-lsb-perl = "LSB Runtime Languages (Perl)"
+DESCRIPTION_packagegroup-core-lsb-perl = "Packages required to support libraries \
+ specified in the LSB Runtime languages specification (Perl parts)"
+RDEPENDS_packagegroup-core-lsb-perl = "\
+ perl \
+ perl-modules \
+ perl-misc \
+ perl-pod \
+ perl-dev \
+ perl-doc \
+"
+
+SUMMARY_packagegroup-core-lsb-python = "LSB Runtime Languages (Python)"
+DESCRIPTION_packagegroup-core-lsb-python = "Packages required to support libraries \
+ specified in the LSB Runtime languages specification (Python parts)"
+RDEPENDS_packagegroup-core-lsb-python = "\
+ python \
+ python-modules \
+ python-misc \
+"
+
+def get_libqt3(d):
+ if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) or "":
+ if 'qt3' in d.getVar('BBFILE_COLLECTIONS', False) or "":
+ return 'libqt-mt3'
+
+ bb.warn('The meta-qt3 layer should be added, this layer provides Qt 3.x' \
+ 'libraries. Its intended use is for passing LSB tests as Qt3 is' \
+ 'a requirement for LSB.')
+ return ''
+
+QT4PKGS = " \
+ libqtcore4 \
+ libqtgui4 \
+ libqtsql4 \
+ libqtsvg4 \
+ libqtxml4 \
+ libqtnetwork4 \
+ qt4-plugin-sqldriver-sqlite \
+ ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "libqtopengl4", "", d)} \
+ "
+QT4PKGS_mips64 = ""
+QT4PKGS_mips64n32 = ""
+
+def get_libqt4(d):
+ if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) or "":
+ if 'qt4' in d.getVar('BBFILE_COLLECTIONS', False) or "":
+ return d.getVar('QT4PKGS', False)
+
+ bb.warn('The meta-qt4 layer should be added, this layer provides Qt 4.x' \
+ 'libraries. Its intended use is for passing LSB tests as Qt4 is' \
+ 'a requirement for LSB.')
+ return ''
+
+SUMMARY_packagegroup-core-lsb-desktop = "LSB Desktop"
+DESCRIPTION_packagegroup-core-lsb-desktop = "Packages required to support libraries \
+ specified in the LSB Desktop specification"
+RDEPENDS_packagegroup-core-lsb-desktop = "\
+ libxt \
+ libxxf86vm \
+ libdrm \
+ libglu \
+ libxi \
+ libxtst \
+ libx11-locale \
+ xorg-minimal-fonts \
+ gdk-pixbuf-loader-ico \
+ gdk-pixbuf-loader-bmp \
+ gdk-pixbuf-loader-ani \
+ gdk-pixbuf-xlib \
+ liberation-fonts \
+ gtk+ \
+ atk \
+ libasound \
+ ${@get_libqt4(d)} \
+ ${@get_libqt3(d)} \
+"
+
+RDEPENDS_packagegroup-core-lsb-runtime-add = "\
+ ldd \
+ pam-plugin-wheel \
+ e2fsprogs-mke2fs \
+ mkfontdir \
+ liburi-perl \
+ libxml-parser-perl \
+ libxml-perl \
+ libxml-sax-perl \
+ glibc-localedatas \
+ glibc-gconvs \
+ glibc-charmaps \
+ glibc-binaries \
+ glibc-localedata-posix \
+ glibc-extra-nss \
+ glibc-pcprofile \
+ libclass-isa-perl \
+ libenv-perl \
+ libdumpvalue-perl \
+ libfile-checktree-perl \
+ libi18n-collate-perl \
+ libpod-plainer-perl \
+"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch
new file mode 100644
index 000000000..c55b64813
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/0001-Add-support-for-defining-missing-funcitonality.patch
@@ -0,0 +1,68 @@
+From 45d1ed58927593968faead7dbb295f3922f41a2f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Aug 2015 14:16:43 -0700
+Subject: [PATCH] Add support for defining missing funcitonality
+
+In order to support alternative libc on linux ( musl, bioninc ) etc we
+need to check for glibc-only features and provide alternatives, in this
+list strndupa is first one, when configure detects that its not included
+in system C library then the altrnative implementation from missing.h is
+used
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 3 +++
+ libpam/include/missing.h | 12 ++++++++++++
+ modules/pam_exec/pam_exec.c | 1 +
+ 3 files changed, 16 insertions(+)
+ create mode 100644 libpam/include/missing.h
+
+diff --git a/configure.ac b/configure.ac
+index 9e1257f..cbed979 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -599,6 +599,9 @@ dnl
+ AC_CHECK_DECL(__NR_keyctl, [have_key_syscalls=1],[have_key_syscalls=0],[#include <sys/syscall.h>])
+ AC_CHECK_DECL(ENOKEY, [have_key_errors=1],[have_key_errors=0],[#include <errno.h>])
+
++# musl and bionic don't have strndupa
++AC_CHECK_DECLS_ONCE([strndupa])
++
+ HAVE_KEY_MANAGEMENT=0
+ if test $have_key_syscalls$have_key_errors = 11
+ then
+diff --git a/libpam/include/missing.h b/libpam/include/missing.h
+new file mode 100644
+index 0000000..3cf011c
+--- /dev/null
++++ b/libpam/include/missing.h
+@@ -0,0 +1,12 @@
++#pragma once
++
++#if !HAVE_DECL_STRNDUPA
++#define strndupa(s, n) \
++ ({ \
++ const char *__old = (s); \
++ size_t __len = strnlen(__old, (n)); \
++ char *__new = alloca(__len + 1); \
++ __new[__len] = '\0'; \
++ memcpy(__new, __old, __len); \
++ })
++#endif
+diff --git a/modules/pam_exec/pam_exec.c b/modules/pam_exec/pam_exec.c
+index 17ba6ca..3aa2694 100644
+--- a/modules/pam_exec/pam_exec.c
++++ b/modules/pam_exec/pam_exec.c
+@@ -59,6 +59,7 @@
+ #include <security/pam_modutil.h>
+ #include <security/pam_ext.h>
+ #include <security/_pam_macros.h>
++#include <missing.h>
+
+ #define ENV_ITEM(n) { (n), #n }
+ static struct {
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/99_pam b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/99_pam
new file mode 100644
index 000000000..97e990d10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/99_pam
@@ -0,0 +1 @@
+d root root 0755 /var/run/sepermit none
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/crypt_configure.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/crypt_configure.patch
new file mode 100644
index 000000000..bec82a5f1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/crypt_configure.patch
@@ -0,0 +1,31 @@
+This patch fixes a case where it find crypt defined in libc (musl) but
+not in specified libraries then it ends up assigning
+
+LIBCRYPT="-l" which then goes into makefile cause all sort of problems
+e.g.
+
+ld: cannot find -l-m32
+| collect2: error: ld returned 1 exit status
+
+The reason is that -l appears on commandline with out any library and
+compiler treats the next argument as library name whatever it is.
+
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: Linux-PAM-1.1.6/configure.in
+===================================================================
+--- Linux-PAM-1.1.6.org/configure.ac
++++ Linux-PAM-1.1.6/configure.ac
+@@ -400,7 +400,9 @@ AS_IF([test "x$ac_cv_header_xcrypt_h" =
+ [crypt_libs="crypt"])
+
+ BACKUP_LIBS=$LIBS
+-AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
++AC_SEARCH_LIBS([crypt],[$crypt_libs],
++ [test "$ac_cv_search_crypt" = "none required" ||
++ LIBCRYPT="$ac_cv_search_crypt"])
+ AC_CHECK_FUNCS(crypt_r crypt_gensalt_r)
+ LIBS=$BACKUP_LIBS
+ AC_SUBST(LIBCRYPT)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch
new file mode 100644
index 000000000..8a9c3b2fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/fixsepbuild.patch
@@ -0,0 +1,24 @@
+Fix the build error when a separate build directory is used:
+
+Making install in xtestsmake[1]: Entering directory `/media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/build/xtests'/usr/bin/install -c -d /media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/image/usr/share/Linux-PAM/xtestsfor file in run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd tst-pam_dispatch5.pamd tst-pam_cracklib1.pamd tst-pam_cracklib2.pamd tst-pam_unix1.pamd tst-pam_unix2.pamd tst-pam_unix3.pamd tst-pam_unix4.pamd tst-pam_unix1.sh tst-pam_unix2.sh tst-pam_unix3.sh tst-pam_unix4.sh access.conf tst-pam_access1.pamd tst-pam_access1.sh tst-pam_access2.pamd tst-pam_access2.sh tst-pam_access3.pamd tst-pam_access3.sh tst-pam_access4.pamd tst-pam_access4.sh limits.conf tst-pam_limits1.pamd tst-pam_limits1.sh tst-pam_succeed_if1.pamd tst-pam_succeed_if1.sh group.conf tst-pam_group1.pamd tst-pam_group1.sh tst-pam_authfail.pamd tst-pam_authsucceed.pamd tst-pam_substack1.pamd tst-pam_substack1a.pamd tst-pam_substack1.sh tst-pam_substack2.pamd tst-pam_substack2a.pamd tst-pam_substack2.sh tst-pam_substack3.pamd tst-pam_substack3a.pamd tst-pam_substack3.sh tst-pam_substack4.pamd tst-pam_substack4a.pamd tst-pam_substack4.sh tst-pam_substack5.pamd tst-pam_substack5a.pamd tst-pam_substack5.sh tst-pam_assemble_line1.pamd tst-pam_assemble_line1.sh tst-pam_pwhistory1.pamd tst-pam_pwhistory1.sh tst-pam_time1.pamd time.conf ; do \/usr/bin/install -c $file /media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/image/usr/share/Linux-PAM/xtests ; \ done
+/usr/bin/install: cannot stat `run-xtests.sh': No such file or directory
+/usr/bin/install: cannot stat `tst-pam_dispatch1.pamd': No such file or directory
+/usr/bin/install: cannot stat `tst-pam_dispatch2.pamd': No such file or directory
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Index: Linux-PAM-1.1.6/xtests/Makefile.am
+===================================================================
+--- Linux-PAM-1.1.6.orig/xtests/Makefile.am 2013-03-08 12:26:30.360266000 +0000
++++ Linux-PAM-1.1.6/xtests/Makefile.am 2013-03-21 11:39:58.557166650 +0000
+@@ -59,7 +59,7 @@
+ install_xtests:
+ $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests
+ for file in $(EXTRA_DIST) ; do \
+- $(INSTALL) $$file $(DESTDIR)$(pkgdatadir)/xtests ; \
++ $(INSTALL) $(srcdir)/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
+ done
+ for file in $(XTESTS); do \
+ $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/include_paths_header.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/include_paths_header.patch
new file mode 100644
index 000000000..e4eb95669
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/include_paths_header.patch
@@ -0,0 +1,59 @@
+This patch adds missing include for paths.h which should provide
+_PATH_LASTLOG definition
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Linux-PAM-1.1.6/modules/pam_lastlog/pam_lastlog.c
+===================================================================
+--- Linux-PAM-1.1.6.orig/modules/pam_lastlog/pam_lastlog.c
++++ Linux-PAM-1.1.6/modules/pam_lastlog/pam_lastlog.c
+@@ -23,9 +23,11 @@
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <sys/file.h>
+ #include <sys/types.h>
+ #include <syslog.h>
+ #include <unistd.h>
++#include <paths.h>
+
+ #if defined(hpux) || defined(sunos) || defined(solaris)
+ # ifndef _PATH_LASTLOG
+@@ -332,6 +334,23 @@ last_login_read(pam_handle_t *pamh, int
+ return retval;
+ }
+
++#ifndef __GLIBC__
++static void logwtmp(const char * line, const char * name, const char * host)
++{
++ struct utmp u;
++ memset(&u, 0, sizeof(u));
++
++ u.ut_pid = getpid();
++ u.ut_type = name[0] ? USER_PROCESS : DEAD_PROCESS;
++ strncpy(u.ut_line, line, sizeof(u.ut_line));
++ strncpy(u.ut_name, name, sizeof(u.ut_name));
++ strncpy(u.ut_host, host, sizeof(u.ut_host));
++ gettimeofday(&(u.ut_tv), NULL);
++
++ updwtmp(_PATH_WTMP, &u);
++}
++#endif /* __GLIBC__ */
++
+ static int
+ last_login_write(pam_handle_t *pamh, int announce, int last_fd,
+ uid_t uid, const char *user)
+Index: Linux-PAM-1.1.6/modules/Makefile.am
+===================================================================
+--- Linux-PAM-1.1.6.orig/modules/Makefile.am
++++ Linux-PAM-1.1.6/modules/Makefile.am
+@@ -7,7 +7,7 @@ SUBDIRS = pam_access pam_cracklib pam_de
+ pam_group pam_issue pam_keyinit pam_lastlog pam_limits \
+ pam_listfile pam_localuser pam_loginuid pam_mail \
+ pam_mkhomedir pam_motd pam_namespace pam_nologin \
+- pam_permit pam_pwhistory pam_rhosts pam_rootok pam_securetty \
++ pam_permit pam_pwhistory pam_rootok pam_securetty \
+ pam_selinux pam_sepermit pam_shells pam_stress \
+ pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \
+ pam_tty_audit pam_umask \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch
new file mode 100644
index 000000000..680029ae0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch
@@ -0,0 +1,226 @@
+From 555407ff6e2f742df64ae93859f14a0fc1397829 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Fri, 12 Sep 2014 05:35:05 -0400
+Subject: [PATCH] libpam/xtests: remove bash dependency
+
+There's not bash specific syntax in the xtest scripts:
+
+ # after below patches applied:
+ $ cd Linux-PAM-1.1.6/xtests
+ $ checkbashisms *.sh
+ No output
+
+Just remove the runtime dependency to bash.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ xtests/run-xtests.sh | 2 +-
+ xtests/tst-pam_access1.sh | 2 +-
+ xtests/tst-pam_access2.sh | 2 +-
+ xtests/tst-pam_access3.sh | 2 +-
+ xtests/tst-pam_access4.sh | 2 +-
+ xtests/tst-pam_assemble_line1.sh | 2 +-
+ xtests/tst-pam_group1.sh | 2 +-
+ xtests/tst-pam_limits1.sh | 2 +-
+ xtests/tst-pam_pwhistory1.sh | 2 +-
+ xtests/tst-pam_substack1.sh | 2 +-
+ xtests/tst-pam_substack2.sh | 2 +-
+ xtests/tst-pam_substack3.sh | 2 +-
+ xtests/tst-pam_substack4.sh | 2 +-
+ xtests/tst-pam_substack5.sh | 2 +-
+ xtests/tst-pam_succeed_if1.sh | 2 +-
+ xtests/tst-pam_unix1.sh | 2 +-
+ xtests/tst-pam_unix2.sh | 2 +-
+ xtests/tst-pam_unix3.sh | 2 +-
+ xtests/tst-pam_unix4.sh | 2 +-
+ 19 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/xtests/run-xtests.sh b/xtests/run-xtests.sh
+index 3a89057..1cf8684 100755
+--- a/xtests/run-xtests.sh
++++ b/xtests/run-xtests.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ SRCDIR=$1
+ shift 1
+diff --git a/xtests/tst-pam_access1.sh b/xtests/tst-pam_access1.sh
+index 180d256..70521d2 100755
+--- a/xtests/tst-pam_access1.sh
++++ b/xtests/tst-pam_access1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/groupadd tstpamaccess
+ /usr/sbin/useradd -G tstpamaccess -p '!!' tstpamaccess1
+diff --git a/xtests/tst-pam_access2.sh b/xtests/tst-pam_access2.sh
+index 0a30275..7e3e60f 100755
+--- a/xtests/tst-pam_access2.sh
++++ b/xtests/tst-pam_access2.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/groupadd tstpamaccess
+ /usr/sbin/useradd -p '!!' tstpamaccess2
+diff --git a/xtests/tst-pam_access3.sh b/xtests/tst-pam_access3.sh
+index 348e0c3..3630e2e 100755
+--- a/xtests/tst-pam_access3.sh
++++ b/xtests/tst-pam_access3.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamaccess3
+ ./tst-pam_access3
+diff --git a/xtests/tst-pam_access4.sh b/xtests/tst-pam_access4.sh
+index 61e7b44..4538df4 100755
+--- a/xtests/tst-pam_access4.sh
++++ b/xtests/tst-pam_access4.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamaccess4
+ ./tst-pam_access4
+diff --git a/xtests/tst-pam_assemble_line1.sh b/xtests/tst-pam_assemble_line1.sh
+index 248d47e..dc2a675 100755
+--- a/xtests/tst-pam_assemble_line1.sh
++++ b/xtests/tst-pam_assemble_line1.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authfail tst-pam_assemble_line1
+diff --git a/xtests/tst-pam_group1.sh b/xtests/tst-pam_group1.sh
+index b76377f..44faca9 100755
+--- a/xtests/tst-pam_group1.sh
++++ b/xtests/tst-pam_group1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/groupadd tstpamgrpg
+ /usr/sbin/useradd -p '!!' tstpamgrp
+diff --git a/xtests/tst-pam_limits1.sh b/xtests/tst-pam_limits1.sh
+index 4faa822..32c021d 100755
+--- a/xtests/tst-pam_limits1.sh
++++ b/xtests/tst-pam_limits1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamlimits
+ ./tst-pam_limits1
+diff --git a/xtests/tst-pam_pwhistory1.sh b/xtests/tst-pam_pwhistory1.sh
+index ddb3b8b..0f212e2 100644
+--- a/xtests/tst-pam_pwhistory1.sh
++++ b/xtests/tst-pam_pwhistory1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd tstpampwhistory
+ ./tst-pam_pwhistory1
+diff --git a/xtests/tst-pam_substack1.sh b/xtests/tst-pam_substack1.sh
+index 5260175..f1b72a7 100755
+--- a/xtests/tst-pam_substack1.sh
++++ b/xtests/tst-pam_substack1.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authfail tst-pam_substack1
+diff --git a/xtests/tst-pam_substack2.sh b/xtests/tst-pam_substack2.sh
+index c02f597..3804fa7 100755
+--- a/xtests/tst-pam_substack2.sh
++++ b/xtests/tst-pam_substack2.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authsucceed tst-pam_substack2
+diff --git a/xtests/tst-pam_substack3.sh b/xtests/tst-pam_substack3.sh
+index 0e572aa..aa48e8e 100755
+--- a/xtests/tst-pam_substack3.sh
++++ b/xtests/tst-pam_substack3.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authsucceed tst-pam_substack3
+diff --git a/xtests/tst-pam_substack4.sh b/xtests/tst-pam_substack4.sh
+index a3ef08a..958a07a 100755
+--- a/xtests/tst-pam_substack4.sh
++++ b/xtests/tst-pam_substack4.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authsucceed tst-pam_substack4
+diff --git a/xtests/tst-pam_substack5.sh b/xtests/tst-pam_substack5.sh
+index e2714fd..7e0da74 100755
+--- a/xtests/tst-pam_substack5.sh
++++ b/xtests/tst-pam_substack5.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+
+ exec ./tst-pam_authfail tst-pam_substack5
+diff --git a/xtests/tst-pam_succeed_if1.sh b/xtests/tst-pam_succeed_if1.sh
+index a643b2e..58e57b4 100755
+--- a/xtests/tst-pam_succeed_if1.sh
++++ b/xtests/tst-pam_succeed_if1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamtest
+ /usr/sbin/useradd -p '!!' pamtest
+diff --git a/xtests/tst-pam_unix1.sh b/xtests/tst-pam_unix1.sh
+index f75bd84..72deac0 100755
+--- a/xtests/tst-pam_unix1.sh
++++ b/xtests/tst-pam_unix1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ /usr/sbin/useradd -p '!!' tstpamunix
+ ./tst-pam_unix1
+diff --git a/xtests/tst-pam_unix2.sh b/xtests/tst-pam_unix2.sh
+index 7093155..c04d6e6 100755
+--- a/xtests/tst-pam_unix2.sh
++++ b/xtests/tst-pam_unix2.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # pamunix0 = 0aXKZztA.d1KY
+ /usr/sbin/useradd -p 0aXKZztA.d1KY tstpamunix
+diff --git a/xtests/tst-pam_unix3.sh b/xtests/tst-pam_unix3.sh
+index ef4a07c..b52db2b 100755
+--- a/xtests/tst-pam_unix3.sh
++++ b/xtests/tst-pam_unix3.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # pamunix01 = 0aXKZztA.d1KYIuFXArmd2jU
+ /usr/sbin/useradd -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix
+diff --git a/xtests/tst-pam_unix4.sh b/xtests/tst-pam_unix4.sh
+index 787c2f9..e7976fd 100755
+--- a/xtests/tst-pam_unix4.sh
++++ b/xtests/tst-pam_unix4.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # pamunix01 = 0aXKZztA.d1KYIuFXArmd2jU
+ /usr/sbin/useradd -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch
new file mode 100644
index 000000000..be687457f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/libpam-xtests.patch
@@ -0,0 +1,35 @@
+This patch is used to create a new sub package libpam-xtests to do more checks.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+--- Linux-PAM-1.1.4/xtests/Makefile.am.orig 2011-07-19 17:00:09.619980001 +0800
++++ Linux-PAM-1.1.4/xtests/Makefile.am 2011-07-19 16:54:00.229979998 +0800
+@@ -7,7 +7,7 @@
+ AM_LDFLAGS = -L$(top_builddir)/libpam -lpam \
+ -L$(top_builddir)/libpam_misc -lpam_misc
+
+-CLEANFILES = *~ $(XTESTS)
++CLEANFILES = *~
+
+ EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \
+ tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \
+@@ -51,3 +51,18 @@
+
+ xtests: $(XTESTS) run-xtests.sh
+ "$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS}
++
++all: $(XTESTS)
++
++install: install_xtests
++
++install_xtests:
++ $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests
++ for file in $(EXTRA_DIST) ; do \
++ $(INSTALL) $$file $(DESTDIR)$(pkgdatadir)/xtests ; \
++ done
++ for file in $(XTESTS); do \
++ $(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
++ done
++
++.PHONY: all install_xtests
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch
new file mode 100644
index 000000000..5e551ac48
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch
@@ -0,0 +1,97 @@
+innetgr may not be there so make sure that when innetgr is not present
+then we inform about it and not use it.
+
+-Khem
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: Linux-PAM-1.1.3/modules/pam_group/pam_group.c
+===================================================================
+--- Linux-PAM-1.1.3.orig/modules/pam_group/pam_group.c
++++ Linux-PAM-1.1.3/modules/pam_group/pam_group.c
+@@ -659,7 +659,11 @@ static int check_account(pam_handle_t *p
+ }
+ /* If buffer starts with @, we are using netgroups */
+ if (buffer[0] == '@')
+- good &= innetgr (&buffer[1], NULL, user, NULL);
++#ifdef HAVE_INNETGR
++ good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_group does not have netgroup support");
++#endif
+ /* otherwise, if the buffer starts with %, it's a UNIX group */
+ else if (buffer[0] == '%')
+ good &= pam_modutil_user_in_group_nam_nam(pamh, user, &buffer[1]);
+Index: Linux-PAM-1.1.3/modules/pam_time/pam_time.c
+===================================================================
+--- Linux-PAM-1.1.3.orig/modules/pam_time/pam_time.c
++++ Linux-PAM-1.1.3/modules/pam_time/pam_time.c
+@@ -555,9 +555,13 @@ check_account(pam_handle_t *pamh, const
+ }
+ /* If buffer starts with @, we are using netgroups */
+ if (buffer[0] == '@')
+- good &= innetgr (&buffer[1], NULL, user, NULL);
++#ifdef HAVE_INNETGR
++ good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_time does not have netgroup support");
++#endif
+ else
+- good &= logic_field(pamh, user, buffer, count, is_same);
++ good &= logic_field(pamh, user, buffer, count, is_same);
+ D(("with user: %s", good ? "passes":"fails" ));
+
+ /* here we get the time field */
+Index: Linux-PAM-1.1.3/modules/pam_succeed_if/pam_succeed_if.c
+===================================================================
+--- Linux-PAM-1.1.3.orig/modules/pam_succeed_if/pam_succeed_if.c
++++ Linux-PAM-1.1.3/modules/pam_succeed_if/pam_succeed_if.c
+@@ -231,18 +231,27 @@ evaluate_notingroup(pam_handle_t *pamh,
+ }
+ /* Return PAM_SUCCESS if the (host,user) is in the netgroup. */
+ static int
+-evaluate_innetgr(const char *host, const char *user, const char *group)
++evaluate_innetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ if (innetgr(group, host, user, NULL) == 1)
+ return PAM_SUCCESS;
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
++#endif
++
+ return PAM_AUTH_ERR;
+ }
+ /* Return PAM_SUCCESS if the (host,user) is NOT in the netgroup. */
+ static int
+-evaluate_notinnetgr(const char *host, const char *user, const char *group)
++evaluate_notinnetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ if (innetgr(group, host, user, NULL) == 0)
+ return PAM_SUCCESS;
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
++#endif
+ return PAM_AUTH_ERR;
+ }
+
+@@ -361,14 +370,14 @@ evaluate(pam_handle_t *pamh, int debug,
+ const void *rhost;
+ if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
+ rhost = NULL;
+- return evaluate_innetgr(rhost, user, right);
++ return evaluate_innetgr(pamh, rhost, user, right);
+ }
+ /* (Rhost, user) is not in this group. */
+ if (strcasecmp(qual, "notinnetgr") == 0) {
+ const void *rhost;
+ if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
+ rhost = NULL;
+- return evaluate_notinnetgr(rhost, user, right);
++ return evaluate_notinnetgr(pamh, rhost, user, right);
+ }
+ /* Fail closed. */
+ return PAM_SERVICE_ERR;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch
new file mode 100644
index 000000000..f1834f6ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch
@@ -0,0 +1,200 @@
+Description: extract the securetty logic for use with the "nullok_secure" option
+ introduced in the "055_pam_unix_nullok_secure" patch.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+===================================================================
+diff -urpN a/modules/pam_securetty/Makefile.am b/modules/pam_securetty/Makefile.am
+--- a/modules/pam_securetty/Makefile.am 2013-07-05 11:08:23.224483237 +0800
++++ b/modules/pam_securetty/Makefile.am 2013-07-05 11:15:21.304486456 +0800
+@@ -24,6 +24,10 @@ endif
+ securelib_LTLIBRARIES = pam_securetty.la
+ pam_securetty_la_LIBADD = -L$(top_builddir)/libpam -lpam
+
++pam_securetty_la_SOURCES = \
++ pam_securetty.c \
++ tty_secure.c
++
+ if ENABLE_REGENERATE_MAN
+ noinst_DATA = README
+ README: pam_securetty.8.xml
+diff -urpN a/modules/pam_securetty/pam_securetty.c b/modules/pam_securetty/pam_securetty.c
+--- a/modules/pam_securetty/pam_securetty.c 2013-07-05 11:07:50.064483568 +0800
++++ b/modules/pam_securetty/pam_securetty.c 2013-07-05 11:12:23.994483344 +0800
+@@ -1,7 +1,5 @@
+ /* pam_securetty module */
+
+-#define SECURETTY_FILE "/etc/securetty"
+-#define TTY_PREFIX "/dev/"
+ #define CMDLINE_FILE "/proc/cmdline"
+ #define CONSOLEACTIVE_FILE "/sys/class/tty/console/active"
+
+@@ -40,6 +38,9 @@
+ #include <security/pam_modutil.h>
+ #include <security/pam_ext.h>
+
++extern int _pammodutil_tty_secure(const pam_handle_t *pamh,
++ const char *uttyname);
++
+ #define PAM_DEBUG_ARG 0x0001
+ #define PAM_NOCONSOLE_ARG 0x0002
+
+@@ -73,11 +74,7 @@ securetty_perform_check (pam_handle_t *p
+ const char *username;
+ const char *uttyname;
+ const void *void_uttyname;
+- char ttyfileline[256];
+- char ptname[256];
+- struct stat ttyfileinfo;
+ struct passwd *user_pwd;
+- FILE *ttyfile;
+
+ /* log a trail for debugging */
+ if (ctrl & PAM_DEBUG_ARG) {
+@@ -105,50 +102,7 @@ securetty_perform_check (pam_handle_t *p
+ return PAM_SERVICE_ERR;
+ }
+
+- /* The PAM_TTY item may be prefixed with "/dev/" - skip that */
+- if (strncmp(TTY_PREFIX, uttyname, sizeof(TTY_PREFIX)-1) == 0) {
+- uttyname += sizeof(TTY_PREFIX)-1;
+- }
+-
+- if (stat(SECURETTY_FILE, &ttyfileinfo)) {
+- pam_syslog(pamh, LOG_NOTICE, "Couldn't open %s: %m", SECURETTY_FILE);
+- return PAM_SUCCESS; /* for compatibility with old securetty handling,
+- this needs to succeed. But we still log the
+- error. */
+- }
+-
+- if ((ttyfileinfo.st_mode & S_IWOTH) || !S_ISREG(ttyfileinfo.st_mode)) {
+- /* If the file is world writable or is not a
+- normal file, return error */
+- pam_syslog(pamh, LOG_ERR,
+- "%s is either world writable or not a normal file",
+- SECURETTY_FILE);
+- return PAM_AUTH_ERR;
+- }
+-
+- ttyfile = fopen(SECURETTY_FILE,"r");
+- if (ttyfile == NULL) { /* Check that we opened it successfully */
+- pam_syslog(pamh, LOG_ERR, "Error opening %s: %m", SECURETTY_FILE);
+- return PAM_SERVICE_ERR;
+- }
+-
+- if (isdigit(uttyname[0])) {
+- snprintf(ptname, sizeof(ptname), "pts/%s", uttyname);
+- } else {
+- ptname[0] = '\0';
+- }
+-
+- retval = 1;
+-
+- while ((fgets(ttyfileline, sizeof(ttyfileline)-1, ttyfile) != NULL)
+- && retval) {
+- if (ttyfileline[strlen(ttyfileline) - 1] == '\n')
+- ttyfileline[strlen(ttyfileline) - 1] = '\0';
+-
+- retval = ( strcmp(ttyfileline, uttyname)
+- && (!ptname[0] || strcmp(ptname, uttyname)) );
+- }
+- fclose(ttyfile);
++ retval = _pammodutil_tty_secure(pamh, uttyname);
+
+ if (retval && !(ctrl & PAM_NOCONSOLE_ARG)) {
+ FILE *cmdlinefile;
+diff -urpN a/modules/pam_securetty/tty_secure.c b/modules/pam_securetty/tty_secure.c
+--- a/modules/pam_securetty/tty_secure.c 1970-01-01 08:30:00.000000000 +0830
++++ b/modules/pam_securetty/tty_secure.c 2013-07-05 11:14:21.534482900 +0800
+@@ -0,0 +1,90 @@
++/*
++ * A function to determine if a particular line is in /etc/securetty
++ */
++
++
++#define SECURETTY_FILE "/etc/securetty"
++#define TTY_PREFIX "/dev/"
++
++/* This function taken out of pam_securetty by Sam Hartman
++ * <hartmans@debian.org>*/
++/*
++ * by Elliot Lee <sopwith@redhat.com>, Red Hat Software.
++ * July 25, 1996.
++ * Slight modifications AGM. 1996/12/3
++ */
++
++#include <unistd.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <security/pam_modules.h>
++#include <stdarg.h>
++#include <syslog.h>
++#include <sys/syslog.h>
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <ctype.h>
++#include <security/pam_modutil.h>
++#include <security/pam_ext.h>
++
++extern int _pammodutil_tty_secure(const pam_handle_t *pamh,
++ const char *uttyname);
++
++int _pammodutil_tty_secure(const pam_handle_t *pamh, const char *uttyname)
++{
++ int retval = PAM_AUTH_ERR;
++ char ttyfileline[256];
++ char ptname[256];
++ struct stat ttyfileinfo;
++ FILE *ttyfile;
++ /* The PAM_TTY item may be prefixed with "/dev/" - skip that */
++ if (strncmp(TTY_PREFIX, uttyname, sizeof(TTY_PREFIX)-1) == 0)
++ uttyname += sizeof(TTY_PREFIX)-1;
++
++ if (stat(SECURETTY_FILE, &ttyfileinfo)) {
++ pam_syslog(pamh, LOG_NOTICE, "Couldn't open %s: %m",
++ SECURETTY_FILE);
++ return PAM_SUCCESS; /* for compatibility with old securetty handling,
++ this needs to succeed. But we still log the
++ error. */
++ }
++
++ if ((ttyfileinfo.st_mode & S_IWOTH) || !S_ISREG(ttyfileinfo.st_mode)) {
++ /* If the file is world writable or is not a
++ normal file, return error */
++ pam_syslog(pamh, LOG_ERR,
++ "%s is either world writable or not a normal file",
++ SECURETTY_FILE);
++ return PAM_AUTH_ERR;
++ }
++
++ ttyfile = fopen(SECURETTY_FILE,"r");
++ if(ttyfile == NULL) { /* Check that we opened it successfully */
++ pam_syslog(pamh, LOG_ERR, "Error opening %s: %m", SECURETTY_FILE);
++ return PAM_SERVICE_ERR;
++ }
++
++ if (isdigit(uttyname[0])) {
++ snprintf(ptname, sizeof(ptname), "pts/%s", uttyname);
++ } else {
++ ptname[0] = '\0';
++ }
++
++ retval = 1;
++
++ while ((fgets(ttyfileline,sizeof(ttyfileline)-1, ttyfile) != NULL)
++ && retval) {
++ if(ttyfileline[strlen(ttyfileline) - 1] == '\n')
++ ttyfileline[strlen(ttyfileline) - 1] = '\0';
++ retval = ( strcmp(ttyfileline,uttyname)
++ && (!ptname[0] || strcmp(ptname, uttyname)) );
++ }
++ fclose(ttyfile);
++
++ if(retval) {
++ retval = PAM_AUTH_ERR;
++ }
++
++ return retval;
++}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch
new file mode 100644
index 000000000..3241e8295
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch
@@ -0,0 +1,240 @@
+From 9bdc197474795f2d000c2bc04f58f7cef8898f21 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 15 Jul 2015 13:07:20 +0300
+Subject: [PATCH] Debian patch to add a new 'nullok_secure' option to pam_unix,
+ which accepts users with null passwords only when the applicant is connected
+ from a tty listed in /etc/securetty.
+
+Authors: Sam Hartman <hartmans@debian.org>,
+ Steve Langasek <vorlon@debian.org>
+
+Upstream-Status: Pending
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+v2:
+ - Forward ported from v1.1.6 to v1.2.1
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ modules/pam_unix/Makefile.am | 3 ++-
+ modules/pam_unix/README | 11 ++++++++++-
+ modules/pam_unix/pam_unix.8 | 9 ++++++++-
+ modules/pam_unix/pam_unix.8.xml | 19 ++++++++++++++++++-
+ modules/pam_unix/support.c | 40 +++++++++++++++++++++++++++++++++++-----
+ modules/pam_unix/support.h | 8 ++++++--
+ 6 files changed, 79 insertions(+), 11 deletions(-)
+
+diff --git a/modules/pam_unix/Makefile.am b/modules/pam_unix/Makefile.am
+index 56ed591..9a372ac 100644
+--- a/modules/pam_unix/Makefile.am
++++ b/modules/pam_unix/Makefile.am
+@@ -30,7 +30,8 @@ if HAVE_VERSIONING
+ pam_unix_la_LDFLAGS += -Wl,--version-script=$(srcdir)/../modules.map
+ endif
+ pam_unix_la_LIBADD = $(top_builddir)/libpam/libpam.la \
+- @LIBCRYPT@ @LIBSELINUX@ $(NIS_LIBS)
++ @LIBCRYPT@ @LIBSELINUX@ $(NIS_LIBS) \
++ ../pam_securetty/tty_secure.lo
+
+ securelib_LTLIBRARIES = pam_unix.la
+
+diff --git a/modules/pam_unix/README b/modules/pam_unix/README
+index 3935dba..7880d91 100644
+--- a/modules/pam_unix/README
++++ b/modules/pam_unix/README
+@@ -67,7 +67,16 @@ nullok
+
+ The default action of this module is to not permit the user access to a
+ service if their official password is blank. The nullok argument overrides
+- this default.
++ this default and allows any user with a blank password to access the
++ service.
++
++nullok_secure
++
++ The default action of this module is to not permit the user access to a
++ service if their official password is blank. The nullok_secure argument
++ overrides this default and allows any user with a blank password to access
++ the service as long as the value of PAM_TTY is set to one of the values
++ found in /etc/securetty.
+
+ try_first_pass
+
+diff --git a/modules/pam_unix/pam_unix.8 b/modules/pam_unix/pam_unix.8
+index 339178b..a4bd906 100644
+--- a/modules/pam_unix/pam_unix.8
++++ b/modules/pam_unix/pam_unix.8
+@@ -92,7 +92,14 @@ Turns off informational messages namely messages about session open and close vi
+ .RS 4
+ The default action of this module is to not permit the user access to a service if their official password is blank\&. The
+ \fBnullok\fR
+-argument overrides this default\&.
++argument overrides this default and allows any user with a blank password to access the service\&.
++.RE
++.PP
++\fBnullok_secure\fR
++.RS 4
++The default action of this module is to not permit the user access to a service if their official password is blank\&. The
++\fBnullok_secure\fR
++argument overrides this default and allows any user with a blank password to access the service as long as the value of PAM_TTY is set to one of the values found in /etc/securetty\&.
+ .RE
+ .PP
+ \fBtry_first_pass\fR
+diff --git a/modules/pam_unix/pam_unix.8.xml b/modules/pam_unix/pam_unix.8.xml
+index a8b64bb..1ced6f4 100644
+--- a/modules/pam_unix/pam_unix.8.xml
++++ b/modules/pam_unix/pam_unix.8.xml
+@@ -159,7 +159,24 @@
+ <para>
+ The default action of this module is to not permit the
+ user access to a service if their official password is blank.
+- The <option>nullok</option> argument overrides this default.
++ The <option>nullok</option> argument overrides this default
++ and allows any user with a blank password to access the
++ service.
++ </para>
++ </listitem>
++ </varlistentry>
++ <varlistentry>
++ <term>
++ <option>nullok_secure</option>
++ </term>
++ <listitem>
++ <para>
++ The default action of this module is to not permit the
++ user access to a service if their official password is blank.
++ The <option>nullok_secure</option> argument overrides this
++ default and allows any user with a blank password to access
++ the service as long as the value of PAM_TTY is set to one of
++ the values found in /etc/securetty.
+ </para>
+ </listitem>
+ </varlistentry>
+diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c
+index abccd82..2361957 100644
+--- a/modules/pam_unix/support.c
++++ b/modules/pam_unix/support.c
+@@ -189,13 +189,22 @@ int _set_ctrl(pam_handle_t *pamh, int flags, int *remember, int *rounds,
+ /* now parse the arguments to this module */
+
+ for (; argc-- > 0; ++argv) {
++ int sl;
+
+ D(("pam_unix arg: %s", *argv));
+
+ for (j = 0; j < UNIX_CTRLS_; ++j) {
+- if (unix_args[j].token
+- && !strncmp(*argv, unix_args[j].token, strlen(unix_args[j].token))) {
+- break;
++ if (unix_args[j].token) {
++ sl = strlen(unix_args[j].token);
++ if (unix_args[j].token[sl-1] == '=') {
++ /* exclude argument from comparison */
++ if (!strncmp(*argv, unix_args[j].token, sl))
++ break;
++ } else {
++ /* compare full strings */
++ if (!strcmp(*argv, unix_args[j].token))
++ break;
++ }
+ }
+ }
+
+@@ -566,6 +575,7 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd,
+ if (child == 0) {
+ static char *envp[] = { NULL };
+ const char *args[] = { NULL, NULL, NULL, NULL };
++ int nullok = off(UNIX__NONULL, ctrl);
+
+ /* XXX - should really tidy up PAM here too */
+
+@@ -593,7 +603,16 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd,
+ /* exec binary helper */
+ args[0] = CHKPWD_HELPER;
+ args[1] = user;
+- if (off(UNIX__NONULL, ctrl)) { /* this means we've succeeded */
++ if (on(UNIX_NULLOK_SECURE, ctrl)) {
++ const void *uttyname;
++ retval = pam_get_item(pamh, PAM_TTY, &uttyname);
++ if (retval != PAM_SUCCESS || uttyname == NULL
++ || _pammodutil_tty_secure(pamh, (const char *)uttyname) != PAM_SUCCESS) {
++ nullok = 0;
++ }
++ }
++
++ if (nullok) {
+ args[2]="nullok";
+ } else {
+ args[2]="nonull";
+@@ -678,6 +697,17 @@ _unix_blankpasswd (pam_handle_t *pamh, unsigned int ctrl, const char *name)
+ if (on(UNIX__NONULL, ctrl))
+ return 0; /* will fail but don't let on yet */
+
++ if (on(UNIX_NULLOK_SECURE, ctrl)) {
++ int retval2;
++ const void *uttyname;
++ retval2 = pam_get_item(pamh, PAM_TTY, &uttyname);
++ if (retval2 != PAM_SUCCESS || uttyname == NULL)
++ return 0;
++
++ if (_pammodutil_tty_secure(pamh, (const char *)uttyname) != PAM_SUCCESS)
++ return 0;
++ }
++
+ /* UNIX passwords area */
+
+ retval = get_pwd_hash(pamh, name, &pwd, &salt);
+@@ -764,7 +794,7 @@ int _unix_verify_password(pam_handle_t * pamh, const char *name
+ }
+ }
+ } else {
+- retval = verify_pwd_hash(p, salt, off(UNIX__NONULL, ctrl));
++ retval = verify_pwd_hash(p, salt, _unix_blankpasswd(pamh, ctrl, name));
+ }
+
+ if (retval == PAM_SUCCESS) {
+diff --git a/modules/pam_unix/support.h b/modules/pam_unix/support.h
+index 3729ce0..43cdbea 100644
+--- a/modules/pam_unix/support.h
++++ b/modules/pam_unix/support.h
+@@ -99,8 +99,9 @@ typedef struct {
+ #define UNIX_MIN_PASS_LEN 27 /* min length for password */
+ #define UNIX_QUIET 28 /* Don't print informational messages */
+ #define UNIX_DES 29 /* DES, default */
++#define UNIX_NULLOK_SECURE 30 /* NULL passwords allowed only on secure ttys */
+ /* -------------- */
+-#define UNIX_CTRLS_ 30 /* number of ctrl arguments defined */
++#define UNIX_CTRLS_ 31 /* number of ctrl arguments defined */
+
+ #define UNIX_DES_CRYPT(ctrl) (off(UNIX_MD5_PASS,ctrl)&&off(UNIX_BIGCRYPT,ctrl)&&off(UNIX_SHA256_PASS,ctrl)&&off(UNIX_SHA512_PASS,ctrl)&&off(UNIX_BLOWFISH_PASS,ctrl))
+
+@@ -118,7 +119,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] =
+ /* UNIX_NOT_SET_PASS */ {"not_set_pass", _ALL_ON_, 0100, 0},
+ /* UNIX__PRELIM */ {NULL, _ALL_ON_^(0600), 0200, 0},
+ /* UNIX__UPDATE */ {NULL, _ALL_ON_^(0600), 0400, 0},
+-/* UNIX__NONULL */ {NULL, _ALL_ON_, 01000, 0},
++/* UNIX__NONULL */ {NULL, _ALL_ON_^(02000000000), 01000, 0},
+ /* UNIX__QUIET */ {NULL, _ALL_ON_, 02000, 0},
+ /* UNIX_USE_AUTHTOK */ {"use_authtok", _ALL_ON_, 04000, 0},
+ /* UNIX_SHADOW */ {"shadow", _ALL_ON_, 010000, 0},
+@@ -139,6 +140,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] =
+ /* UNIX_MIN_PASS_LEN */ {"minlen=", _ALL_ON_, 0400000000, 0},
+ /* UNIX_QUIET */ {"quiet", _ALL_ON_, 01000000000, 0},
+ /* UNIX_DES */ {"des", _ALL_ON_^(0260420000), 0, 1},
++/* UNIX_NULLOK_SECURE */ {"nullok_secure", _ALL_ON_^(01000), 02000000000, 0},
+ };
+
+ #define UNIX_DEFAULTS (unix_args[UNIX__NONULL].flag)
+@@ -171,6 +173,8 @@ extern int _unix_read_password(pam_handle_t * pamh
+ ,const char *prompt2
+ ,const char *data_name
+ ,const void **pass);
++extern int _pammodutil_tty_secure(const pam_handle_t *pamh,
++ const char *uttyname);
+
+ extern int _unix_run_verify_binary(pam_handle_t *pamh,
+ unsigned int ctrl, const char *user, int *daysleft);
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-account b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-account
new file mode 100644
index 000000000..316b17337
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-account
@@ -0,0 +1,25 @@
+#
+# /etc/pam.d/common-account - authorization settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authorization modules that define
+# the central access policy for use on the system. The default is to
+# only deny service to users whose accounts are expired in /etc/shadow.
+#
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules. See
+# pam-auth-update(8) for details.
+#
+
+# here are the per-package modules (the "Primary" block)
+account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
+# here's the fallback if no module succeeds
+account requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+account required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+# end of pam-auth-update config
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-auth b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-auth
new file mode 100644
index 000000000..460b69f19
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-auth
@@ -0,0 +1,18 @@
+#
+# /etc/pam.d/common-auth - authentication settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authentication modules that define
+# the central authentication scheme for use on the system
+# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
+# traditional Unix authentication mechanisms.
+
+# here are the per-package modules (the "Primary" block)
+auth [success=1 default=ignore] pam_unix.so nullok_secure
+# here's the fallback if no module succeeds
+auth requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+auth required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-password b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-password
new file mode 100644
index 000000000..389605732
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-password
@@ -0,0 +1,26 @@
+#
+# /etc/pam.d/common-password - password-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define the services to be
+# used to change user passwords. The default is pam_unix.
+
+# Explanation of pam_unix options:
+#
+# The "sha512" option enables salted SHA512 passwords. Without this option,
+# the default is Unix crypt. Prior releases used the option "md5".
+#
+# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in
+# login.defs.
+#
+# See the pam_unix manpage for other options.
+
+# here are the per-package modules (the "Primary" block)
+password [success=1 default=ignore] pam_unix.so obscure sha512
+# here's the fallback if no module succeeds
+password requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+password required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session
new file mode 100644
index 000000000..a4a551f71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session
@@ -0,0 +1,19 @@
+#
+# /etc/pam.d/common-session - session-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of sessions of *any* kind (both interactive and
+# non-interactive).
+#
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+session required pam_unix.so
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive
new file mode 100644
index 000000000..b110bb2b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive
@@ -0,0 +1,19 @@
+#
+# /etc/pam.d/common-session-noninteractive - session-related modules
+# common to all non-interactive services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of all non-interactive sessions.
+#
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+session required pam_unix.so
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/other b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/other
new file mode 100644
index 000000000..ec970ecbe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/pam.d/other
@@ -0,0 +1,24 @@
+#
+# /etc/pam.d/other - specify the PAM fallback behaviour
+#
+# Note that this file is used for any unspecified service; for example
+#if /etc/pam.d/cron specifies no session modules but cron calls
+#pam_open_session, the session module out of /etc/pam.d/other is
+#used.
+
+# We use pam_warn.so to generate syslog notes that the 'other'
+#fallback rules are being used (as a hint to suggest you should setup
+#specific PAM rules for the service and aid to debugging). Then to be
+#secure, deny access to all services by default.
+
+auth required pam_warn.so
+auth required pam_deny.so
+
+account required pam_warn.so
+account required pam_deny.so
+
+password required pam_warn.so
+password required pam_deny.so
+
+session required pam_warn.so
+session required pam_deny.so
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/use-utmpx.patch b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/use-utmpx.patch
new file mode 100644
index 000000000..dd04bbb84
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam/use-utmpx.patch
@@ -0,0 +1,233 @@
+utmp() may not be configured in and use posix compliant utmpx always
+UTMP is SVID legacy, UTMPX is mandated by POSIX
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Linux-PAM-1.2.1/libpam/pam_modutil_getlogin.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/libpam/pam_modutil_getlogin.c
++++ Linux-PAM-1.2.1/libpam/pam_modutil_getlogin.c
+@@ -10,8 +10,7 @@
+
+ #include <stdlib.h>
+ #include <unistd.h>
+-#include <utmp.h>
+-
++#include <utmpx.h>
+ #define _PAMMODUTIL_GETLOGIN "_pammodutil_getlogin"
+
+ const char *
+@@ -22,7 +21,7 @@ pam_modutil_getlogin(pam_handle_t *pamh)
+ const void *void_curr_tty;
+ const char *curr_tty;
+ char *curr_user;
+- struct utmp *ut, line;
++ struct utmpx *ut, line;
+
+ status = pam_get_data(pamh, _PAMMODUTIL_GETLOGIN, &logname);
+ if (status == PAM_SUCCESS) {
+@@ -48,10 +47,10 @@ pam_modutil_getlogin(pam_handle_t *pamh)
+ }
+ logname = NULL;
+
+- setutent();
++ setutxent();
+ strncpy(line.ut_line, curr_tty, sizeof(line.ut_line));
+
+- if ((ut = getutline(&line)) == NULL) {
++ if ((ut = getutxline(&line)) == NULL) {
+ goto clean_up_and_go_home;
+ }
+
+@@ -74,7 +73,7 @@ pam_modutil_getlogin(pam_handle_t *pamh)
+
+ clean_up_and_go_home:
+
+- endutent();
++ endutxent();
+
+ return logname;
+ }
+Index: Linux-PAM-1.2.1/modules/pam_issue/pam_issue.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_issue/pam_issue.c
++++ Linux-PAM-1.2.1/modules/pam_issue/pam_issue.c
+@@ -25,7 +25,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <sys/utsname.h>
+-#include <utmp.h>
++#include <utmpx.h>
+ #include <time.h>
+ #include <syslog.h>
+
+@@ -246,13 +246,13 @@ read_issue_quoted(pam_handle_t *pamh, FI
+ case 'U':
+ {
+ unsigned int users = 0;
+- struct utmp *ut;
+- setutent();
+- while ((ut = getutent())) {
++ struct utmpx *ut;
++ setutxent();
++ while ((ut = getutxent())) {
+ if (ut->ut_type == USER_PROCESS)
+ ++users;
+ }
+- endutent();
++ endutxent();
+ if (c == 'U')
+ snprintf (buf, sizeof buf, "%u %s", users,
+ (users == 1) ? "user" : "users");
+Index: Linux-PAM-1.2.1/modules/pam_lastlog/pam_lastlog.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_lastlog/pam_lastlog.c
++++ Linux-PAM-1.2.1/modules/pam_lastlog/pam_lastlog.c
+@@ -15,8 +15,9 @@
+ #include <errno.h>
+ #ifdef HAVE_UTMP_H
+ # include <utmp.h>
+-#else
+-# include <lastlog.h>
++#endif
++#ifdef HAVE_UTMPX_H
++# include <utmpx.h>
+ #endif
+ #include <pwd.h>
+ #include <stdlib.h>
+@@ -27,6 +28,12 @@
+ #include <syslog.h>
+ #include <unistd.h>
+
++#ifndef HAVE_UTMP_H
++#define UT_LINESIZE 32
++#define UT_HOSTSIZE 32
++#define UT_NAMESIZE 256
++#endif
++
+ #if defined(hpux) || defined(sunos) || defined(solaris)
+ # ifndef _PATH_LASTLOG
+ # define _PATH_LASTLOG "/usr/adm/lastlog"
+@@ -38,7 +45,7 @@
+ # define UT_LINESIZE 12
+ # endif /* UT_LINESIZE */
+ #endif
+-#if defined(hpux)
++#if defined(hpux) || !defined HAVE_UTMP_H
+ struct lastlog {
+ time_t ll_time;
+ char ll_line[UT_LINESIZE];
+@@ -447,8 +454,8 @@ last_login_failed(pam_handle_t *pamh, in
+ {
+ int retval;
+ int fd;
+- struct utmp ut;
+- struct utmp utuser;
++ struct utmpx ut;
++ struct utmpx utuser;
+ int failed = 0;
+ char the_time[256];
+ char *date = NULL;
+Index: Linux-PAM-1.2.1/modules/pam_limits/pam_limits.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_limits/pam_limits.c
++++ Linux-PAM-1.2.1/modules/pam_limits/pam_limits.c
+@@ -33,7 +33,7 @@
+ #include <sys/resource.h>
+ #include <limits.h>
+ #include <glob.h>
+-#include <utmp.h>
++#include <utmpx.h>
+ #ifndef UT_USER /* some systems have ut_name instead of ut_user */
+ #define UT_USER ut_user
+ #endif
+@@ -227,7 +227,7 @@ static int
+ check_logins (pam_handle_t *pamh, const char *name, int limit, int ctrl,
+ struct pam_limit_s *pl)
+ {
+- struct utmp *ut;
++ struct utmpx *ut;
+ int count;
+
+ if (ctrl & PAM_DEBUG_ARG) {
+@@ -242,7 +242,7 @@ check_logins (pam_handle_t *pamh, const
+ return LOGIN_ERR;
+ }
+
+- setutent();
++ setutxent();
+
+ /* Because there is no definition about when an application
+ actually adds a utmp entry, some applications bizarrely do the
+@@ -260,7 +260,7 @@ check_logins (pam_handle_t *pamh, const
+ count = 1;
+ }
+
+- while((ut = getutent())) {
++ while((ut = getutxent())) {
+ #ifdef USER_PROCESS
+ if (ut->ut_type != USER_PROCESS) {
+ continue;
+@@ -296,7 +296,7 @@ check_logins (pam_handle_t *pamh, const
+ break;
+ }
+ }
+- endutent();
++ endutxent();
+ if (count > limit) {
+ if (name) {
+ pam_syslog(pamh, LOG_WARNING,
+Index: Linux-PAM-1.2.1/modules/pam_timestamp/pam_timestamp.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_timestamp/pam_timestamp.c
++++ Linux-PAM-1.2.1/modules/pam_timestamp/pam_timestamp.c
+@@ -56,7 +56,7 @@
+ #include <time.h>
+ #include <sys/time.h>
+ #include <unistd.h>
+-#include <utmp.h>
++#include <utmpx.h>
+ #include <syslog.h>
+ #include <paths.h>
+ #include "hmacsha1.h"
+@@ -197,15 +197,15 @@ timestamp_good(time_t then, time_t now,
+ static int
+ check_login_time(const char *ruser, time_t timestamp)
+ {
+- struct utmp utbuf, *ut;
++ struct utmpx utbuf, *ut;
+ time_t oldest_login = 0;
+
+- setutent();
++ setutxent();
+ while(
+ #ifdef HAVE_GETUTENT_R
+- !getutent_r(&utbuf, &ut)
++ !getutxent_r(&utbuf, &ut)
+ #else
+- (ut = getutent()) != NULL
++ (ut = getutxent()) != NULL
+ #endif
+ ) {
+ if (ut->ut_type != USER_PROCESS) {
+@@ -218,7 +218,7 @@ check_login_time(const char *ruser, time
+ oldest_login = ut->ut_tv.tv_sec;
+ }
+ }
+- endutent();
++ endutxent();
+ if(oldest_login == 0 || timestamp < oldest_login) {
+ return PAM_AUTH_ERR;
+ }
+Index: Linux-PAM-1.2.1/modules/pam_unix/support.c
+===================================================================
+--- Linux-PAM-1.2.1.orig/modules/pam_unix/support.c
++++ Linux-PAM-1.2.1/modules/pam_unix/support.c
+@@ -13,7 +13,6 @@
+ #include <pwd.h>
+ #include <shadow.h>
+ #include <limits.h>
+-#include <utmp.h>
+ #include <errno.h>
+ #include <signal.h>
+ #include <ctype.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.2.1.bb b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.2.1.bb
new file mode 100644
index 000000000..341ea2411
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pam/libpam_1.2.1.bb
@@ -0,0 +1,171 @@
+SUMMARY = "Linux-PAM (Pluggable Authentication Modules)"
+DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users"
+HOMEPAGE = "https://fedorahosted.org/linux-pam/"
+BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket"
+SECTION = "base"
+# PAM is dual licensed under GPL and BSD.
+# /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time
+# libpam-runtime-1.0.1 is GPLv2+), by openembedded
+LICENSE = "GPLv2+ | BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3"
+
+SRC_URI = "http://linux-pam.org/library/Linux-PAM-${PV}.tar.bz2 \
+ file://99_pam \
+ file://pam.d/common-account \
+ file://pam.d/common-auth \
+ file://pam.d/common-password \
+ file://pam.d/common-session \
+ file://pam.d/common-session-noninteractive \
+ file://pam.d/other \
+ file://libpam-xtests.patch \
+ file://fixsepbuild.patch \
+ file://pam-security-abstract-securetty-handling.patch \
+ file://pam-unix-nullok-secure.patch \
+ file://libpam-xtests-remove-bash-dependency.patch \
+ file://crypt_configure.patch \
+ "
+
+SRC_URI[md5sum] = "9dc53067556d2dd567808fd509519dd6"
+SRC_URI[sha256sum] = "342b1211c0d3b203a7df2540a5b03a428a087bd8a48c17e49ae268f992b334d9"
+
+SRC_URI_append_libc-uclibc = " file://pam-no-innetgr.patch \
+ file://use-utmpx.patch"
+
+SRC_URI_append_libc-musl = " file://pam-no-innetgr.patch \
+ file://0001-Add-support-for-defining-missing-funcitonality.patch \
+ file://include_paths_header.patch \
+ "
+
+DEPENDS = "bison flex flex-native cracklib"
+
+EXTRA_OECONF = "--with-db-uniquename=_pam \
+ --includedir=${includedir}/security \
+ --libdir=${base_libdir} \
+ --disable-nis \
+ --disable-regenerate-docu \
+ --disable-prelude"
+
+CFLAGS_append = " -fPIC "
+
+PR = "r5"
+
+S = "${WORKDIR}/Linux-PAM-${PV}"
+
+inherit autotools gettext pkgconfig
+
+PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"
+
+PACKAGES += "${PN}-runtime ${PN}-xtests"
+FILES_${PN} = "${base_libdir}/lib*${SOLIBS}"
+FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-runtime = "${sysconfdir}"
+FILES_${PN}-xtests = "${datadir}/Linux-PAM/xtests"
+
+PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*"
+
+def get_multilib_bit(d):
+ baselib = d.getVar('baselib', True) or ''
+ return baselib.replace('lib', '')
+
+libpam_suffix = "suffix${@get_multilib_bit(d)}"
+
+RPROVIDES_${PN} += "${PN}-${libpam_suffix}"
+RPROVIDES_${PN}-runtime += "${PN}-runtime-${libpam_suffix}"
+
+RDEPENDS_${PN}-runtime = "${PN}-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \
+ "
+RDEPENDS_${PN}-xtests = "${PN}-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-access-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-cracklib-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \
+ ${MLPREFIX}pam-plugin-time-${libpam_suffix} \
+ coreutils"
+
+# FIXME: Native suffix breaks here, disable it for now
+RRECOMMENDS_${PN} = "${PN}-runtime-${libpam_suffix}"
+RRECOMMENDS_${PN}_class-native = ""
+
+python populate_packages_prepend () {
+ def pam_plugin_append_file(pn, dir, file):
+ nf = os.path.join(dir, file)
+ of = d.getVar('FILES_' + pn, True)
+ if of:
+ nf = of + " " + nf
+ d.setVar('FILES_' + pn, nf)
+
+ def pam_plugin_hook(file, pkg, pattern, format, basename):
+ pn = d.getVar('PN', True)
+ libpam_suffix = d.getVar('libpam_suffix', True)
+
+ rdeps = d.getVar('RDEPENDS_' + pkg, True)
+ if rdeps:
+ rdeps = rdeps + " " + pn + "-" + libpam_suffix
+ else:
+ rdeps = pn + "-" + libpam_suffix
+ d.setVar('RDEPENDS_' + pkg, rdeps)
+
+ provides = d.getVar('RPROVIDES_' + pkg, True)
+ if provides:
+ provides = provides + " " + pkg + "-" + libpam_suffix
+ else:
+ provides = pkg + "-" + libpam_suffix
+ d.setVar('RPROVIDES_' + pkg, provides)
+
+ mlprefix = d.getVar('MLPREFIX', True) or ''
+ dvar = bb.data.expand('${WORKDIR}/package', d, True)
+ pam_libdir = d.expand('${base_libdir}/security')
+ pam_sbindir = d.expand('${sbindir}')
+ pam_filterdir = d.expand('${base_libdir}/security/pam_filter')
+ pam_pkgname = mlprefix + 'pam-plugin%s'
+
+ do_split_packages(d, pam_libdir, '^pam(.*)\.so$', pam_pkgname,
+ 'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='')
+ pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_chkpwd')
+ pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_update')
+ pam_plugin_append_file('%spam-plugin-tally' % mlprefix, pam_sbindir, 'pam_tally')
+ pam_plugin_append_file('%spam-plugin-tally2' % mlprefix, pam_sbindir, 'pam_tally2')
+ pam_plugin_append_file('%spam-plugin-timestamp' % mlprefix, pam_sbindir, 'pam_timestamp_check')
+ pam_plugin_append_file('%spam-plugin-mkhomedir' % mlprefix, pam_sbindir, 'mkhomedir_helper')
+ pam_plugin_append_file('%spam-plugin-console' % mlprefix, pam_sbindir, 'pam_console_apply')
+ do_split_packages(d, pam_filterdir, '^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='')
+}
+
+do_install() {
+ autotools_do_install
+
+ # don't install /var/run when populating rootfs. Do it through volatile
+ rm -rf ${D}${localstatedir}
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/99_pam ${D}${sysconfdir}/default/volatiles
+
+ install -d ${D}${sysconfdir}/pam.d/
+ install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
+
+ # The lsb requires unix_chkpwd has setuid permission
+ chmod 4755 ${D}${sbindir}/unix_chkpwd
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session
+ fi
+}
+
+python do_pam_sanity () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'pam', True, False, d):
+ bb.warn("Building libpam but 'pam' isn't in DISTRO_FEATURES, PAM won't work correctly")
+}
+addtask pam_sanity before do_configure
+
+BBCLASSEXTEND = "nativesdk native"
+
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-auth"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-password"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-account"
+CONFFILES_${PN}-runtime += "${sysconfdir}/security/limits.conf"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch
new file mode 100644
index 000000000..b0376cefc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch
@@ -0,0 +1,29 @@
+From d78dd087c4ec4715aab5fe115668e726046ecd76 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 18:16:05 -0700
+Subject: [PATCH] Include fcntl.h in /platform_defs.h
+
+exposed when compiling using musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libparted/fs/xfs/platform_defs.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libparted/fs/xfs/platform_defs.h b/libparted/fs/xfs/platform_defs.h
+index 2b55752..32bd3d3 100644
+--- a/libparted/fs/xfs/platform_defs.h
++++ b/libparted/fs/xfs/platform_defs.h
+@@ -42,6 +42,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/Makefile b/import-layers/yocto-poky/meta/recipes-extended/parted/files/Makefile
new file mode 100644
index 000000000..ee90be081
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/Makefile
@@ -0,0 +1,285 @@
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+
+am__tty_colors = \
+$(am__tty_colors_dummy); \
+test "X$(AM_COLOR_TESTS)" != Xno \
+&& test "X$$TERM" != Xdumb \
+&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
+&& { \
+ am__color_tests=yes; \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+}
+
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+am__rst_section = { sed 'p;s/./=/g;' && echo; }
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`; \
+test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:.log=.log)
+TEST_LOGS = $(am__test_logs2:.sh.log=.log)
+SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+SH_LOG_COMPILE = $(SH_LOG_COMPILER)
+
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+
+MKDIR_P = /bin/mkdir -p
+SHELL = /bin/bash
+VERSION = 3.1
+PACKAGE_STRING = GNU parted 3.1
+PACKAGE_BUGREPORT = bug-parted@gnu.org
+abs_srcdir = $(PWD)
+abs_top_builddir = $(PWD)/..
+abs_top_srcdir = $(PWD)/..
+srcdir = .
+top_srcdir = ..
+subdir = tests
+SH_LOG_COMPILER = $(SHELL)
+
+TESTS = \
+ help-version.sh \
+ t0000-basic.sh \
+ t0001-tiny.sh \
+ t0010-script-no-ctrl-chars.sh \
+ t0100-print.sh \
+ t0101-print-empty.sh \
+ t0200-gpt.sh \
+ t0201-gpt.sh \
+ t0202-gpt-pmbr.sh \
+ t0203-gpt-tiny-device-abort.sh \
+ t0203-gpt-shortened-device-primary-valid.sh \
+ t0205-gpt-list-clobbers-pmbr.sh \
+ t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh \
+ t0207-IEC-binary-notation.sh \
+ t0208-mkpart-end-in-IEC.sh \
+ t0209-gpt-pmbr_boot.sh \
+ t0210-gpt-resized-partition-entry-array.sh \
+ t0211-gpt-rewrite-header.sh \
+ t0212-gpt-many-partitions.sh \
+ t0220-gpt-msftres.sh \
+ t0250-gpt.sh \
+ t0280-gpt-corrupt.sh \
+ t0300-dos-on-gpt.sh \
+ t0400-loop-clobber-infloop.sh \
+ t0500-dup-clobber.sh \
+ t0501-duplicate.sh \
+ t1100-busy-label.sh \
+ t1101-busy-partition.sh \
+ t1700-probe-fs.sh \
+ t2200-dos-label-recog.sh \
+ t2201-pc98-label-recog.sh \
+ t2300-dos-label-extended-bootcode.sh \
+ t2310-dos-extended-2-sector-min-offset.sh \
+ t2400-dos-hfs-partition-type.sh \
+ t2500-probe-corrupt-hfs.sh \
+ t3000-resize-fs.sh \
+ t3200-type-change.sh \
+ t3300-palo-prep.sh \
+ t3310-flags.sh \
+ t3400-whole-disk-FAT-partition.sh \
+ t4000-sun-raid-type.sh \
+ t4001-sun-vtoc.sh \
+ t4100-msdos-partition-limits.sh \
+ t4100-dvh-partition-limits.sh \
+ t4100-msdos-starting-sector.sh \
+ t4200-partprobe.sh \
+ t4300-nilfs2-tiny.sh \
+ t5000-tags.sh \
+ t6000-dm.sh \
+ t6001-psep.sh \
+ t6100-mdraid-partitions.sh \
+ t7000-scripting.sh \
+ t8000-loop.sh \
+ t8001-loop-blkpg.sh \
+ t9010-big-sector.sh \
+ t9020-alignment.sh \
+ t9021-maxima.sh \
+ t9022-one-unit-snap.sh \
+ t9023-value-lt-one.sh \
+ t9030-align-check.sh \
+ t9040-many-partitions.sh \
+ t9041-undetected-in-use-16th-partition.sh \
+ t9042-dos-partition-limit.sh \
+ t9050-partition-table-types.sh
+
+TESTS_ENVIRONMENT = \
+ export \
+ abs_top_builddir='$(abs_top_builddir)' \
+ abs_top_srcdir='$(abs_top_srcdir)' \
+ abs_srcdir='$(abs_srcdir)' \
+ built_programs=parted \
+ srcdir='$(srcdir)' \
+ top_srcdir='$(top_srcdir)' \
+ VERSION=$(VERSION) \
+ ; 9>&2
+
+.SUFFIXES: .log
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for i in $$bases; do \
+ if grep "^$$ws*:copy-in-global-log:$$ws*no$$ws*$$" $$i.trs \
+ >/dev/null; then continue; \
+ fi; \
+ glob_res=`sed -n -e "s/$$ws*$$//" \
+ -e "s/^$$ws*:global-test-result:$$ws*//p" \
+ $$i.trs`; \
+ test -n "$$glob_res" || glob_res=RUN; \
+ echo "$$glob_res: $$i" | $(am__rst_section); \
+ if test ! -r $$i.log; then \
+ echo "fatal: making $@: $$i.log is unreadable" >&2; \
+ exit 1; \
+ fi; \
+ cat $$i.log; echo; \
+ done; \
+ } >$(TEST_SUITE_LOG).tmp; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @if test $@ != recheck; then \
+ list='$(RECHECK_LOGS)'; \
+ test -z "$$list" || rm -f $$list; \
+ fi
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @ws='[ ]'; \
+ log_list='' trs_list=''; $(am__set_TESTS_bases); \
+ for i in $$bases; do \
+ if test -z "$$log_list"; then \
+ log_list="$$i.log"; \
+ else \
+ log_list="$$log_list $$i.log"; \
+ fi; \
+ if test -z "$$trs_list"; then \
+ trs_list="$$i.trs"; \
+ else \
+ trs_list="$$trs_list $$i.trs"; \
+ fi; \
+ done; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"
+
+.sh.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) -- $(SH_LOG_COMPILE) "$$tst"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
new file mode 100644
index 000000000..68ab715f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
@@ -0,0 +1,57 @@
+From 060e74354774d36d2c11ef08e3e7ea9b9b6e23fb Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 13 Nov 2014 11:29:33 +0800
+Subject: [PATCH] libparted/arch/linux.c: fix compile failure while
+ --disable-device-mapper
+
+While --disable-device-mapper, the MACRO ENABLE_DEVICE_MAPPER is
+undef, but it missed to scope some device mapper functions.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libparted/arch/linux.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
+index 6fd73c5..2afa479 100644
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -2320,6 +2320,7 @@ zasprintf (const char *format, ...)
+ static char *
+ dm_canonical_path (PedDevice const *dev)
+ {
++#ifdef ENABLE_DEVICE_MAPPER
+ LinuxSpecific const *arch_specific = LINUX_SPECIFIC (dev);
+
+ /* Get map name from devicemapper */
+@@ -2337,6 +2338,7 @@ dm_canonical_path (PedDevice const *dev)
+ dm_task_destroy (task);
+ return dev_name;
+ err:
++#endif
+ return NULL;
+ }
+
+@@ -2957,13 +2959,15 @@ _disk_sync_part_table (PedDisk* disk)
+ unsigned long long *start,
+ unsigned long long *length);
+
+-
++#ifdef ENABLE_DEVICE_MAPPER
+ if (disk->dev->type == PED_DEVICE_DM) {
+ add_partition = _dm_add_partition;
+ remove_partition = _dm_remove_partition;
+ resize_partition = _dm_resize_partition;
+ get_partition_start_and_length = _dm_get_partition_start_and_length;
+- } else {
++ } else
++#endif
++ {
+ add_partition = _blkpg_add_partition;
+ remove_partition = _blkpg_remove_partition;
+ #ifdef BLKPG_RESIZE_PARTITION
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch
new file mode 100644
index 000000000..0711d4e29
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/fix-doc-mandir.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Submitted [bug-parted@gnu.org]
+
+| for po in `ls -1 ./*.pt_BR.po 2>/dev/null`; do \
+| make $(basename ${po%.pt_BR.po}); \
+| done
+| Makefile:904: *** Recursive variable `mandir' references itself (eventually). Stop.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+--- parted-3.1/doc/po4a.mk.orig 2012-03-15 14:09:11.555831872 +0100
++++ parted-3.1/doc/po4a.mk 2012-03-15 14:10:44.243830985 +0100
+@@ -23,7 +23,7 @@
+ # threshold is 80%), it won't be distributed, and the build won't fail.
+ #
+
+-mandir = $(mandir)/$(lang)
++mandir := $(mandir)/$(lang)
+
+ # Inform automake that we want to install some man pages in section 1, 5
+ # and 8.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/no_check.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/no_check.patch
new file mode 100644
index 000000000..58d8db442
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/no_check.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [configuration]
+
+If check is detected, it makes the builds non-determinstic so just force
+it to be disabled.
+
+RP - 4/11/08
+
+Index: parted-1.9.0/configure.ac
+===================================================================
+--- parted-1.9.0.orig/configure.ac 2009-07-23 18:52:08.000000000 +0100
++++ parted-1.9.0/configure.ac 2010-02-02 14:13:56.013905093 +0000
+@@ -477,7 +477,7 @@
+ AM_CONDITIONAL([BUILD_LINUX], [test "$OS" = linux])
+
+ dnl check for "check", unit testing library/header
+-PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
++have_check=no
+ if test "$have_check" != "yes"; then
+ AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building])
+ fi
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/parted/files/run-ptest
new file mode 100644
index 000000000..695c5e8a7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C tests check-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/files/syscalls.patch b/import-layers/yocto-poky/meta/recipes-extended/parted/files/syscalls.patch
new file mode 100644
index 000000000..e9bbe9a95
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/files/syscalls.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Pending
+
+---
+ libparted/arch/linux.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+Index: parted-1.9.0/libparted/arch/linux.c
+===================================================================
+--- parted-1.9.0.orig/libparted/arch/linux.c 2009-07-23 18:52:08.000000000 +0100
++++ parted-1.9.0/libparted/arch/linux.c 2010-02-02 14:14:16.523904768 +0000
+@@ -17,6 +17,8 @@
+
+ #define PROC_DEVICES_BUFSIZ 16384
+
++#include <linux/version.h>
++
+ #include <config.h>
+ #include <arch/linux.h>
+
+@@ -1477,12 +1479,14 @@
+
+ #if SIZEOF_OFF_T < 8
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+ static _syscall5(int,_llseek,
+ unsigned int, fd,
+ unsigned long, offset_high,
+ unsigned long, offset_low,
+ loff_t*, result,
+ unsigned int, origin)
++#endif
+
+ loff_t
+ llseek (unsigned int fd, loff_t offset, unsigned int whence)
+@@ -1490,11 +1494,20 @@
+ loff_t result;
+ int retval;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+ retval = _llseek(fd,
+ ((unsigned long long)offset) >> 32,
+ ((unsigned long long)offset) & 0xffffffff,
+ &result,
+ whence);
++#else
++ retval = syscall(__NR__llseek, fd,
++ ((unsigned long long)offset) >> 32,
++ ((unsigned long long)offset) & 0xffffffff,
++ &result,
++ whence);
++#endif
++
+ return (retval==-1 ? (loff_t) retval : result);
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb b/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb
new file mode 100644
index 000000000..30c00c861
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/parted/parted_3.2.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Disk partition editing/resizing utility"
+HOMEPAGE = "http://www.gnu.org/software/parted/parted.html"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c"
+SECTION = "console/tools"
+DEPENDS = "ncurses readline util-linux virtual/libiconv"
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
+ file://no_check.patch \
+ file://syscalls.patch \
+ file://fix-doc-mandir.patch \
+ file://fix-compile-failure-while-dis.patch \
+ file://0001-Include-fcntl.h-in-platform_defs.h.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://run-ptest \
+ file://Makefile \
+"
+
+SRC_URI[md5sum] = "0247b6a7b314f8edeb618159fa95f9cb"
+SRC_URI[sha256sum] = "858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4"
+
+EXTRA_OECONF = "--disable-device-mapper"
+LDFLAGS_append_libc-uclibc = " -liconv "
+
+inherit autotools pkgconfig gettext texinfo ptest
+
+BBCLASSEXTEND = "native"
+
+do_compile_ptest() {
+ oe_runmake -C tests print-align print-max dup-clobber duplicate fs-resize
+}
+
+do_install_ptest() {
+ t=${D}${PTEST_PATH}
+ mkdir $t/build-aux
+ cp ${S}/build-aux/test-driver $t/build-aux/
+ cp -r ${S}/tests $t
+ cp ${WORKDIR}/Makefile $t/tests/
+ sed -i "s|^VERSION.*|VERSION = ${PV}|g" $t/tests/Makefile
+ for i in print-align print-max dup-clobber duplicate fs-resize; \
+ do cp ${B}/tests/.libs/$i $t/tests/; \
+ done
+ sed -e 's| ../parted||' -i $t/tests/*.sh
+}
+
+RDEPENDS_${PN}-ptest = "bash coreutils perl util-linux-losetup python"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..61bf2de5e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-Fix-build-with-musl.patch
@@ -0,0 +1,1287 @@
+From 47c4db8d37248d968fac7ee4a71ca64398890723 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 6 Jan 2016 11:57:21 -0800
+Subject: [PATCH] Fix build with musl
+
+Remove BSDisms
+Remove fts, and link to libfts thats provided externally
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate[musl specific]
+
+ lib/Makefile.am | 4 +-
+ lib/fts.c | 1025 -------------------------------------------------------
+ lib/fts.h | 131 -------
+ lib/vis.h | 13 +-
+ src/Makefile.am | 2 +-
+ src/extern.h | 2 -
+ src/file_subs.c | 2 +-
+ src/tables.c | 2 +-
+ 8 files changed, 14 insertions(+), 1167 deletions(-)
+ delete mode 100644 lib/fts.c
+ delete mode 100644 lib/fts.h
+
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index 56d0859..7f5045a 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -8,8 +8,8 @@ AUTOMAKE_OPTIONS = 1.7 gnits
+ CLEANFILES = *~
+
+ noinst_LIBRARIES = libbsdfunc.a
+-noinst_HEADERS = vis.h bsdfunc.h fts.h
++noinst_HEADERS = vis.h bsdfunc.h
+
+ AM_CFLAGS = @EXTRA_CFLAGS@
+
+-libbsdfunc_a_SOURCES = vis.c strlcpy.c strmode.c fts.c
++libbsdfunc_a_SOURCES = vis.c strlcpy.c strmode.c
+diff --git a/lib/fts.c b/lib/fts.c
+deleted file mode 100644
+index 45e90ca..0000000
+--- a/lib/fts.c
++++ /dev/null
+@@ -1,1025 +0,0 @@
+-/*-
+- * Copyright (c) 1990, 1993, 1994
+- * The Regents of the University of California. 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.
+- * 4. Neither the name of the University nor the names of its contributors
+- * may be used to endorse or promote products derived from this software
+- * without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- */
+-
+-#ifdef HAVE_CONFIG_H
+-#include <config.h>
+-#endif
+-
+-#include <sys/stat.h>
+-#include <fcntl.h>
+-#include <dirent.h>
+-#include <errno.h>
+-#include <fts.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include <unistd.h>
+-
+-/* Largest alignment size needed, minus one.
+- Usually long double is the worst case. */
+-#ifndef ALIGNBYTES
+-#define ALIGNBYTES (__alignof__ (long double) - 1)
+-#endif
+-/* Align P to that size. */
+-#ifndef ALIGN
+-#define ALIGN(p) (((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)
+-#endif
+-
+-
+-static FTSENT *fts_alloc (FTS *, const char *, int);
+-static FTSENT *fts_build (FTS *, int);
+-static void fts_lfree (FTSENT *);
+-static void fts_load (FTS *, FTSENT *);
+-static size_t fts_maxarglen (char * const *);
+-static void fts_padjust (FTS *, FTSENT *);
+-static int fts_palloc (FTS *, size_t);
+-static FTSENT *fts_sort (FTS *, FTSENT *, int);
+-static u_short fts_stat (FTS *, FTSENT *, int);
+-static int fts_safe_changedir (FTS *, FTSENT *, int, const char *);
+-
+-#ifndef MAX
+-#define MAX(a, b) (a > b ? a : b)
+-#endif
+-
+-#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
+-
+-#define CLR(opt) (sp->fts_options &= ~(opt))
+-#define ISSET(opt) (sp->fts_options & (opt))
+-#define SET(opt) (sp->fts_options |= (opt))
+-
+-#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
+-
+-#define BREAD 3 /* fts_read */
+-
+-FTS *
+-fts_open(argv, koptions, compar)
+- char * const *argv;
+- register int koptions;
+- int (*compar) (const FTSENT **, const FTSENT **);
+-{
+- register FTS *sp;
+- register FTSENT *p, *root;
+- register int nitems;
+- FTSENT *parent, *tmp;
+- int len;
+-
+-tmp = NULL; /* stop compiler whinging */
+- /* Options check. */
+- if (koptions & ~FTS_OPTIONMASK) {
+- errno = EINVAL;
+- return (NULL);
+- }
+-
+- /* Allocate/initialize the stream */
+- if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
+- return (NULL);
+- memset(sp, 0, sizeof(FTS));
+- sp->fts_compar = (int (*) (const void *, const void *)) compar;
+- sp->fts_options = koptions;
+-
+- /* Logical walks turn on NOCHDIR; symbolic links are too hard. */
+- if (ISSET(FTS_LOGICAL))
+- SET(FTS_NOCHDIR);
+-
+- /*
+- * Start out with 1K of path space, and enough, in any case,
+- * to hold the user's paths.
+- */
+-#ifndef MAXPATHLEN
+-#define MAXPATHLEN 1024
+-#endif
+- if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
+- goto mem1;
+-
+- /* Allocate/initialize root's parent. */
+- if ((parent = fts_alloc(sp, "", 0)) == NULL)
+- goto mem2;
+- parent->fts_level = FTS_ROOTPARENTLEVEL;
+-
+- /* Allocate/initialize root(s). */
+- for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
+- /* Don't allow zero-length paths. */
+- if ((len = strlen(*argv)) == 0) {
+- errno = ENOENT;
+- goto mem3;
+- }
+-
+- p = fts_alloc(sp, *argv, len);
+- p->fts_level = FTS_ROOTLEVEL;
+- p->fts_parent = parent;
+- p->fts_accpath = p->fts_name;
+- p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
+-
+- /* Command-line "." and ".." are real directories. */
+- if (p->fts_info == FTS_DOT)
+- p->fts_info = FTS_D;
+-
+- /*
+- * If comparison routine supplied, traverse in sorted
+- * order; otherwise traverse in the order specified.
+- */
+- if (compar) {
+- p->fts_link = root;
+- root = p;
+- } else {
+- p->fts_link = NULL;
+- if (root == NULL)
+- tmp = root = p;
+- else {
+- tmp->fts_link = p;
+- tmp = p;
+- }
+- }
+- }
+- if (compar && nitems > 1)
+- root = fts_sort(sp, root, nitems);
+-
+- /*
+- * Allocate a dummy pointer and make fts_read think that we've just
+- * finished the node before the root(s); set p->fts_info to FTS_INIT
+- * so that everything about the "current" node is ignored.
+- */
+- if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
+- goto mem3;
+- sp->fts_cur->fts_link = root;
+- sp->fts_cur->fts_info = FTS_INIT;
+-
+- /*
+- * If using chdir(2), grab a file descriptor pointing to dot to ensure
+- * that we can get back here; this could be avoided for some paths,
+- * but almost certainly not worth the effort. Slashes, symbolic links,
+- * and ".." are all fairly nasty problems. Note, if we can't get the
+- * descriptor we run anyway, just more slowly.
+- */
+- if (!ISSET(FTS_NOCHDIR)
+- && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
+- SET(FTS_NOCHDIR);
+-
+- return (sp);
+-
+-mem3: fts_lfree(root);
+- free(parent);
+-mem2: free(sp->fts_path);
+-mem1: free(sp);
+- return (NULL);
+-}
+-
+-static void
+-fts_load(sp, p)
+- FTS *sp;
+- register FTSENT *p;
+-{
+- register int len;
+- register char *cp;
+-
+- /*
+- * Load the stream structure for the next traversal. Since we don't
+- * actually enter the directory until after the preorder visit, set
+- * the fts_accpath field specially so the chdir gets done to the right
+- * place and the user can access the first node. From fts_open it's
+- * known that the path will fit.
+- */
+- len = p->fts_pathlen = p->fts_namelen;
+- memmove(sp->fts_path, p->fts_name, len + 1);
+- if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
+- len = strlen(++cp);
+- memmove(p->fts_name, cp, len + 1);
+- p->fts_namelen = len;
+- }
+- p->fts_accpath = p->fts_path = sp->fts_path;
+- sp->fts_dev = p->fts_dev;
+-}
+-
+-int
+-fts_close(sp)
+- FTS *sp;
+-{
+- register FTSENT *freep, *p;
+- int saved_errno;
+-
+- /*
+- * This still works if we haven't read anything -- the dummy structure
+- * points to the root list, so we step through to the end of the root
+- * list which has a valid parent pointer.
+- */
+- if (sp->fts_cur) {
+- for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
+- freep = p;
+- p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
+- free(freep);
+- }
+- free(p);
+- }
+-
+- /* Free up child linked list, sort array, path buffer. */
+- if (sp->fts_child)
+- fts_lfree(sp->fts_child);
+- if (sp->fts_array)
+- free(sp->fts_array);
+- free(sp->fts_path);
+-
+- /* Return to original directory, save errno if necessary. */
+- if (!ISSET(FTS_NOCHDIR)) {
+- saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
+- (void)close(sp->fts_rfd);
+-
+- /* Set errno and return. */
+- if (saved_errno != 0) {
+- /* Free up the stream pointer. */
+- free(sp);
+- errno = saved_errno;
+- return (-1);
+- }
+- }
+-
+- /* Free up the stream pointer. */
+- free(sp);
+- return (0);
+-}
+-
+-/*
+- * Special case of "/" at the end of the path so that slashes aren't
+- * appended which would cause paths to be written as "....//foo".
+- */
+-#define NAPPEND(p) \
+- (p->fts_path[p->fts_pathlen - 1] == '/' \
+- ? p->fts_pathlen - 1 : p->fts_pathlen)
+-
+-FTSENT *
+-fts_read(sp)
+- register FTS *sp;
+-{
+- register FTSENT *p, *tmp;
+- register int instr;
+- register char *t;
+- int saved_errno;
+-
+- /* If finished or unrecoverable error, return NULL. */
+- if (sp->fts_cur == NULL || ISSET(FTS_STOP))
+- return (NULL);
+-
+- /* Set current node pointer. */
+- p = sp->fts_cur;
+-
+- /* Save and zero out user instructions. */
+- instr = p->fts_instr;
+- p->fts_instr = FTS_NOINSTR;
+-
+- /* Any type of file may be re-visited; re-stat and re-turn. */
+- if (instr == FTS_AGAIN) {
+- p->fts_info = fts_stat(sp, p, 0);
+- return (p);
+- }
+-
+- /*
+- * Following a symlink -- SLNONE test allows application to see
+- * SLNONE and recover. If indirecting through a symlink, have
+- * keep a pointer to current location. If unable to get that
+- * pointer, follow fails.
+- */
+- if (instr == FTS_FOLLOW &&
+- (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
+- p->fts_info = fts_stat(sp, p, 1);
+- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+- if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
+- p->fts_errno = errno;
+- p->fts_info = FTS_ERR;
+- } else
+- p->fts_flags |= FTS_SYMFOLLOW;
+- }
+- return (p);
+- }
+-
+- /* Directory in pre-order. */
+- if (p->fts_info == FTS_D) {
+- /* If skipped or crossed mount point, do post-order visit. */
+- if (instr == FTS_SKIP ||
+- (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
+- if (p->fts_flags & FTS_SYMFOLLOW)
+- (void)close(p->fts_symfd);
+- if (sp->fts_child) {
+- fts_lfree(sp->fts_child);
+- sp->fts_child = NULL;
+- }
+- p->fts_info = FTS_DP;
+- return (p);
+- }
+-
+- /* Rebuild if only read the names and now traversing. */
+- if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
+- CLR(FTS_NAMEONLY);
+- fts_lfree(sp->fts_child);
+- sp->fts_child = NULL;
+- }
+-
+- /*
+- * Cd to the subdirectory.
+- *
+- * If have already read and now fail to chdir, whack the list
+- * to make the names come out right, and set the parent errno
+- * so the application will eventually get an error condition.
+- * Set the FTS_DONTCHDIR flag so that when we logically change
+- * directories back to the parent we don't do a chdir.
+- *
+- * If haven't read do so. If the read fails, fts_build sets
+- * FTS_STOP or the fts_info field of the node.
+- */
+- if (sp->fts_child != NULL) {
+- if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
+- p->fts_errno = errno;
+- p->fts_flags |= FTS_DONTCHDIR;
+- for (p = sp->fts_child; p != NULL;
+- p = p->fts_link)
+- p->fts_accpath =
+- p->fts_parent->fts_accpath;
+- }
+- } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
+- if (ISSET(FTS_STOP))
+- return (NULL);
+- return (p);
+- }
+- p = sp->fts_child;
+- sp->fts_child = NULL;
+- goto name;
+- }
+-
+- /* Move to the next node on this level. */
+-next: tmp = p;
+- if ((p = p->fts_link) != NULL) {
+- free(tmp);
+-
+- /*
+- * If reached the top, return to the original directory (or
+- * the root of the tree), and load the paths for the next root.
+- */
+- if (p->fts_level == FTS_ROOTLEVEL) {
+- if (FCHDIR(sp, sp->fts_rfd)) {
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- fts_load(sp, p);
+- return (sp->fts_cur = p);
+- }
+-
+- /*
+- * User may have called fts_set on the node. If skipped,
+- * ignore. If followed, get a file descriptor so we can
+- * get back if necessary.
+- */
+- if (p->fts_instr == FTS_SKIP)
+- goto next;
+- if (p->fts_instr == FTS_FOLLOW) {
+- p->fts_info = fts_stat(sp, p, 1);
+- if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
+- if ((p->fts_symfd =
+- open(".", O_RDONLY, 0)) < 0) {
+- p->fts_errno = errno;
+- p->fts_info = FTS_ERR;
+- } else
+- p->fts_flags |= FTS_SYMFOLLOW;
+- }
+- p->fts_instr = FTS_NOINSTR;
+- }
+-
+-name: t = sp->fts_path + NAPPEND(p->fts_parent);
+- *t++ = '/';
+- memmove(t, p->fts_name, p->fts_namelen + 1);
+- return (sp->fts_cur = p);
+- }
+-
+- /* Move up to the parent node. */
+- p = tmp->fts_parent;
+- free(tmp);
+-
+- if (p->fts_level == FTS_ROOTPARENTLEVEL) {
+- /*
+- * Done; free everything up and set errno to 0 so the user
+- * can distinguish between error and EOF.
+- */
+- free(p);
+- errno = 0;
+- return (sp->fts_cur = NULL);
+- }
+-
+- /* NUL terminate the pathname. */
+- sp->fts_path[p->fts_pathlen] = '\0';
+-
+- /*
+- * Return to the parent directory. If at a root node or came through
+- * a symlink, go back through the file descriptor. Otherwise, cd up
+- * one directory.
+- */
+- if (p->fts_level == FTS_ROOTLEVEL) {
+- if (FCHDIR(sp, sp->fts_rfd)) {
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- } else if (p->fts_flags & FTS_SYMFOLLOW) {
+- if (FCHDIR(sp, p->fts_symfd)) {
+- saved_errno = errno;
+- (void)close(p->fts_symfd);
+- errno = saved_errno;
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- (void)close(p->fts_symfd);
+- } else if (!(p->fts_flags & FTS_DONTCHDIR) &&
+- fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
+- SET(FTS_STOP);
+- return (NULL);
+- }
+- p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
+- return (sp->fts_cur = p);
+-}
+-
+-/*
+- * Fts_set takes the stream as an argument although it's not used in this
+- * implementation; it would be necessary if anyone wanted to add global
+- * semantics to fts using fts_set. An error return is allowed for similar
+- * reasons.
+- */
+-/* ARGSUSED */
+-int
+-fts_set(sp, p, instr)
+- FTS __attribute__((__unused__)) *sp;
+- FTSENT *p;
+- int instr;
+-{
+-sp = NULL; /* stop compiler whinging */
+- if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
+- instr != FTS_NOINSTR && instr != FTS_SKIP) {
+- errno = EINVAL;
+- return (1);
+- }
+- p->fts_instr = instr;
+- return (0);
+-}
+-
+-/*
+- * This is the tricky part -- do not casually change *anything* in here. The
+- * idea is to build the linked list of entries that are used by fts_children
+- * and fts_read. There are lots of special cases.
+- *
+- * The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is
+- * set and it's a physical walk (so that symbolic links can't be directories),
+- * we can do things quickly. First, if it's a 4.4BSD file system, the type
+- * of the file is in the directory entry. Otherwise, we assume that the number
+- * of subdirectories in a node is equal to the number of links to the parent.
+- * The former skips all stat calls. The latter skips stat calls in any leaf
+- * directories and for any files after the subdirectories in the directory have
+- * been found, cutting the stat calls by about 2/3.
+- */
+-static FTSENT *
+-fts_build(sp, type)
+- register FTS *sp;
+- int type;
+-{
+- register struct dirent *dp;
+- register FTSENT *p, *head;
+- register int nitems;
+- FTSENT *cur, *tail;
+- DIR *dirp;
+- void *oldaddr;
+- int cderrno, descend, len, level, nlinks, saved_errno,
+- nostat, doadjust;
+- size_t maxlen;
+- char *cp;
+-
+- /* Set current node pointer. */
+- cur = sp->fts_cur;
+-
+- /*
+- * Open the directory for reading. If this fails, we're done.
+- * If being called from fts_read, set the fts_info field.
+- */
+- if ((dirp = opendir(cur->fts_accpath)) == NULL) {
+- if (type == BREAD) {
+- cur->fts_info = FTS_DNR;
+- cur->fts_errno = errno;
+- }
+- return (NULL);
+- }
+-
+- /*
+- * Nlinks is the number of possible entries of type directory in the
+- * directory if we're cheating on stat calls, 0 if we're not doing
+- * any stat calls at all, -1 if we're doing stats on everything.
+- */
+- nlinks = -1;
+- nostat = 0;
+-
+- /*
+- * If we're going to need to stat anything or we want to descend
+- * and stay in the directory, chdir. If this fails we keep going,
+- * but set a flag so we don't chdir after the post-order visit.
+- * We won't be able to stat anything, but we can still return the
+- * names themselves. Note, that since fts_read won't be able to
+- * chdir into the directory, it will have to return different path
+- * names than before, i.e. "a/b" instead of "b". Since the node
+- * has already been visited in pre-order, have to wait until the
+- * post-order visit to return the error. There is a special case
+- * here, if there was nothing to stat then it's not an error to
+- * not be able to stat. This is all fairly nasty. If a program
+- * needed sorted entries or stat information, they had better be
+- * checking FTS_NS on the returned nodes.
+- */
+- cderrno = 0;
+- if (nlinks || type == BREAD) {
+- if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
+- if (nlinks && type == BREAD)
+- cur->fts_errno = errno;
+- cur->fts_flags |= FTS_DONTCHDIR;
+- descend = 0;
+- cderrno = errno;
+- (void)closedir(dirp);
+- dirp = NULL;
+- } else
+- descend = 1;
+- } else
+- descend = 0;
+-
+- /*
+- * Figure out the max file name length that can be stored in the
+- * current path -- the inner loop allocates more path as necessary.
+- * We really wouldn't have to do the maxlen calculations here, we
+- * could do them in fts_read before returning the path, but it's a
+- * lot easier here since the length is part of the dirent structure.
+- *
+- * If not changing directories set a pointer so that can just append
+- * each new name into the path.
+- */
+- len = NAPPEND(cur);
+- if (ISSET(FTS_NOCHDIR)) {
+- cp = sp->fts_path + len;
+- *cp++ = '/';
+- } else {
+- /* GCC, you're too verbose. */
+- cp = NULL;
+- }
+- len++;
+- maxlen = sp->fts_pathlen - len;
+-
+- level = cur->fts_level + 1;
+-
+- /* Read the directory, attaching each entry to the `link' pointer. */
+- doadjust = 0;
+- for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) {
+- if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
+- continue;
+-
+- if ((p = fts_alloc(sp, dp->d_name, (int)_D_EXACT_NAMLEN (dp))) == NULL)
+- goto mem1;
+- if (_D_EXACT_NAMLEN (dp) >= maxlen) {/* include space for NUL */
+- oldaddr = sp->fts_path;
+- if (fts_palloc(sp, _D_EXACT_NAMLEN (dp) + len + 1)) {
+- /*
+- * No more memory for path or structures. Save
+- * errno, free up the current structure and the
+- * structures already allocated.
+- */
+-mem1: saved_errno = errno;
+- if (p)
+- free(p);
+- fts_lfree(head);
+- (void)closedir(dirp);
+- cur->fts_info = FTS_ERR;
+- SET(FTS_STOP);
+- errno = saved_errno;
+- return (NULL);
+- }
+- /* Did realloc() change the pointer? */
+- if (oldaddr != sp->fts_path) {
+- doadjust = 1;
+- if (ISSET(FTS_NOCHDIR))
+- cp = sp->fts_path + len;
+- }
+- maxlen = sp->fts_pathlen - len;
+- }
+-
+- if (len + _D_EXACT_NAMLEN (dp) >= 0x10000) {
+- /*
+- * In an FTSENT, fts_pathlen is a u_short so it is
+- * possible to wraparound here. If we do, free up
+- * the current structure and the structures already
+- * allocated, then error out with ENAMETOOLONG.
+- */
+- free(p);
+- fts_lfree(head);
+- (void)closedir(dirp);
+- cur->fts_info = FTS_ERR;
+- SET(FTS_STOP);
+- errno = ENAMETOOLONG;
+- return (NULL);
+- }
+- p->fts_level = level;
+- p->fts_parent = sp->fts_cur;
+- p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
+-
+-#if defined FTS_WHITEOUT && 0
+- if (dp->d_type == DT_WHT)
+- p->fts_flags |= FTS_ISW;
+-#endif
+-
+- if (cderrno) {
+- if (nlinks) {
+- p->fts_info = FTS_NS;
+- p->fts_errno = cderrno;
+- } else
+- p->fts_info = FTS_NSOK;
+- p->fts_accpath = cur->fts_accpath;
+- } else if (nlinks == 0
+-#if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
+- || (nostat &&
+- dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
+-#endif
+- ) {
+- p->fts_accpath =
+- ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
+- p->fts_info = FTS_NSOK;
+- } else {
+- /* Build a file name for fts_stat to stat. */
+- if (ISSET(FTS_NOCHDIR)) {
+- p->fts_accpath = p->fts_path;
+- memmove(cp, p->fts_name, p->fts_namelen + 1);
+- } else
+- p->fts_accpath = p->fts_name;
+- /* Stat it. */
+- p->fts_info = fts_stat(sp, p, 0);
+-
+- /* Decrement link count if applicable. */
+- if (nlinks > 0 && (p->fts_info == FTS_D ||
+- p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
+- --nlinks;
+- }
+-
+- /* We walk in directory order so "ls -f" doesn't get upset. */
+- p->fts_link = NULL;
+- if (head == NULL)
+- head = tail = p;
+- else {
+- tail->fts_link = p;
+- tail = p;
+- }
+- ++nitems;
+- }
+- if (dirp)
+- (void)closedir(dirp);
+-
+- /*
+- * If realloc() changed the address of the path, adjust the
+- * addresses for the rest of the tree and the dir list.
+- */
+- if (doadjust)
+- fts_padjust(sp, head);
+-
+- /*
+- * If not changing directories, reset the path back to original
+- * state.
+- */
+- if (ISSET(FTS_NOCHDIR)) {
+- if (len == sp->fts_pathlen || nitems == 0)
+- --cp;
+- *cp = '\0';
+- }
+-
+- /*
+- * If descended after called from fts_children or after called from
+- * fts_read and nothing found, get back. At the root level we use
+- * the saved fd; if one of fts_open()'s arguments is a relative path
+- * to an empty directory, we wind up here with no other way back. If
+- * can't get back, we're done.
+- */
+- if (descend && nitems == 0 &&
+- (cur->fts_level == FTS_ROOTLEVEL ?
+- FCHDIR(sp, sp->fts_rfd) :
+- fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
+- cur->fts_info = FTS_ERR;
+- SET(FTS_STOP);
+- return (NULL);
+- }
+-
+- /* If didn't find anything, return NULL. */
+- if (!nitems) {
+- if (type == BREAD)
+- cur->fts_info = FTS_DP;
+- return (NULL);
+- }
+-
+- /* Sort the entries. */
+- if (sp->fts_compar && nitems > 1)
+- head = fts_sort(sp, head, nitems);
+- return (head);
+-}
+-
+-static u_short
+-fts_stat(sp, p, follow)
+- FTS *sp;
+- register FTSENT *p;
+- int follow;
+-{
+- register FTSENT *t;
+- register dev_t dev;
+- register ino_t ino;
+- struct stat *sbp;
+- int saved_errno;
+-
+- /* If user needs stat info, stat buffer already allocated. */
+- sbp = p->fts_statp;
+-
+-#if defined FTS_WHITEOUT && 0
+- /* check for whiteout */
+- if (p->fts_flags & FTS_ISW) {
+- if (sbp != &sb) {
+- memset(sbp, '\0', sizeof (*sbp));
+- sbp->st_mode = S_IFWHT;
+- }
+- return (FTS_W);
+- }
+-#endif
+-
+- /*
+- * If doing a logical walk, or application requested FTS_FOLLOW, do
+- * a stat(2). If that fails, check for a non-existent symlink. If
+- * fail, set the errno from the stat call.
+- */
+- if (ISSET(FTS_LOGICAL) || follow) {
+- if (stat(p->fts_accpath, sbp)) {
+- saved_errno = errno;
+- if (!lstat(p->fts_accpath, sbp)) {
+- errno = 0;
+- return (FTS_SLNONE);
+- }
+- p->fts_errno = saved_errno;
+- goto err;
+- }
+- } else if (lstat(p->fts_accpath, sbp)) {
+- p->fts_errno = errno;
+-err: memset(sbp, 0, sizeof(struct stat));
+- return (FTS_NS);
+- }
+-
+- if (S_ISDIR(sbp->st_mode)) {
+- /*
+- * Set the device/inode. Used to find cycles and check for
+- * crossing mount points. Also remember the link count, used
+- * in fts_build to limit the number of stat calls. It is
+- * understood that these fields are only referenced if fts_info
+- * is set to FTS_D.
+- */
+- dev = p->fts_dev = sbp->st_dev;
+- ino = p->fts_ino = sbp->st_ino;
+- p->fts_nlink = sbp->st_nlink;
+-
+- if (ISDOT(p->fts_name))
+- return (FTS_DOT);
+-
+- /*
+- * Cycle detection is done by brute force when the directory
+- * is first encountered. If the tree gets deep enough or the
+- * number of symbolic links to directories is high enough,
+- * something faster might be worthwhile.
+- */
+- for (t = p->fts_parent;
+- t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
+- if (ino == t->fts_ino && dev == t->fts_dev) {
+- p->fts_cycle = t;
+- return (FTS_DC);
+- }
+- return (FTS_D);
+- }
+- if (S_ISLNK(sbp->st_mode))
+- return (FTS_SL);
+- if (S_ISREG(sbp->st_mode))
+- return (FTS_F);
+- return (FTS_DEFAULT);
+-}
+-
+-static FTSENT *
+-fts_sort(sp, head, nitems)
+- FTS *sp;
+- FTSENT *head;
+- register int nitems;
+-{
+- register FTSENT **ap, *p;
+-
+- /*
+- * Construct an array of pointers to the structures and call qsort(3).
+- * Reassemble the array in the order returned by qsort. If unable to
+- * sort for memory reasons, return the directory entries in their
+- * current order. Allocate enough space for the current needs plus
+- * 40 so don't realloc one entry at a time.
+- */
+- if (nitems > sp->fts_nitems) {
+- struct _ftsent **a;
+-
+- sp->fts_nitems = nitems + 40;
+- if ((a = realloc(sp->fts_array,
+- (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) {
+- free(sp->fts_array);
+- sp->fts_array = NULL;
+- sp->fts_nitems = 0;
+- return (head);
+- }
+- sp->fts_array = a;
+- }
+- for (ap = sp->fts_array, p = head; p; p = p->fts_link)
+- *ap++ = p;
+- qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
+- for (head = *(ap = sp->fts_array); --nitems; ++ap)
+- ap[0]->fts_link = ap[1];
+- ap[0]->fts_link = NULL;
+- return (head);
+-}
+-
+-static FTSENT *
+-fts_alloc(sp, name, namelen)
+- FTS *sp;
+- const char *name;
+- register int namelen;
+-{
+- register FTSENT *p;
+- size_t len;
+-
+- /*
+- * The file name is a variable length array and no stat structure is
+- * necessary if the user has set the nostat bit. Allocate the FTSENT
+- * structure, the file name and the stat structure in one chunk, but
+- * be careful that the stat structure is reasonably aligned. Since the
+- * fts_name field is declared to be of size 1, the fts_name pointer is
+- * namelen + 2 before the first possible address of the stat structure.
+- */
+- len = sizeof(FTSENT) + namelen;
+- len += sizeof(struct stat) + ALIGNBYTES;
+- if ((p = malloc(len)) == NULL)
+- return (NULL);
+-
+- /* Copy the name and guarantee NUL termination. */
+- memmove(p->fts_name, name, namelen);
+- p->fts_name[namelen] = '\0';
+-
+- p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2);
+- p->fts_namelen = namelen;
+- p->fts_path = sp->fts_path;
+- p->fts_errno = 0;
+- p->fts_flags = 0;
+- p->fts_instr = FTS_NOINSTR;
+- p->fts_number = 0;
+- p->fts_pointer = NULL;
+- return (p);
+-}
+-
+-static void
+-fts_lfree(head)
+- register FTSENT *head;
+-{
+- register FTSENT *p;
+-
+- /* Free a linked list of structures. */
+- while ((p = head)) {
+- head = head->fts_link;
+- free(p);
+- }
+-}
+-
+-/*
+- * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
+- * Most systems will allow creation of paths much longer than MAXPATHLEN, even
+- * though the kernel won't resolve them. Add the size (not just what's needed)
+- * plus 256 bytes so don't realloc the path 2 bytes at a time.
+- */
+-static int
+-fts_palloc(sp, more)
+- FTS *sp;
+- size_t more;
+-{
+- char *p;
+-
+- sp->fts_pathlen += more + 256;
+- /*
+- * Check for possible wraparound. In an FTS, fts_pathlen is
+- * a signed int but in an FTSENT it is an unsigned short.
+- * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
+- */
+- if (sp->fts_pathlen < 0 || sp->fts_pathlen >= 0x10000) {
+- if (sp->fts_path) {
+- free(sp->fts_path);
+- sp->fts_path = NULL;
+- }
+- sp->fts_path = NULL;
+- errno = ENAMETOOLONG;
+- return (1);
+- }
+- p = realloc(sp->fts_path, sp->fts_pathlen);
+- if (p == NULL) {
+- free(sp->fts_path);
+- sp->fts_path = NULL;
+- return 1;
+- }
+- sp->fts_path = p;
+- return 0;
+-}
+-
+-/*
+- * When the path is realloc'd, have to fix all of the pointers in structures
+- * already returned.
+- */
+-static void
+-fts_padjust(sp, head)
+- FTS *sp;
+- FTSENT *head;
+-{
+- FTSENT *p;
+- char *addr = sp->fts_path;
+-
+-#define ADJUST(p) do { \
+- if ((p)->fts_accpath != (p)->fts_name) { \
+- (p)->fts_accpath = \
+- (char *)addr + ((p)->fts_accpath - (p)->fts_path); \
+- } \
+- (p)->fts_path = addr; \
+-} while (0)
+- /* Adjust the current set of children. */
+- for (p = sp->fts_child; p; p = p->fts_link)
+- ADJUST(p);
+-
+- /* Adjust the rest of the tree, including the current level. */
+- for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
+- ADJUST(p);
+- p = p->fts_link ? p->fts_link : p->fts_parent;
+- }
+-}
+-
+-static size_t
+-fts_maxarglen(argv)
+- char * const *argv;
+-{
+- size_t len, max;
+-
+- for (max = 0; *argv; ++argv)
+- if ((len = strlen(*argv)) > max)
+- max = len;
+- return (max + 1);
+-}
+-
+-/*
+- * Change to dir specified by fd or p->fts_accpath without getting
+- * tricked by someone changing the world out from underneath us.
+- * Assumes p->fts_dev and p->fts_ino are filled in.
+- */
+-static int
+-fts_safe_changedir(sp, p, fd, path)
+- FTS *sp;
+- FTSENT *p;
+- int fd;
+- const char *path;
+-{
+- int ret, oerrno, newfd;
+- struct stat sb;
+-
+- newfd = fd;
+- if (ISSET(FTS_NOCHDIR))
+- return (0);
+- if (fd < 0 && (newfd = open(path, O_RDONLY, 0)) < 0)
+- return (-1);
+- if (fstat(newfd, &sb)) {
+- ret = -1;
+- goto bail;
+- }
+- if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
+- errno = ENOENT; /* disinformation */
+- ret = -1;
+- goto bail;
+- }
+- ret = fchdir(newfd);
+-bail:
+- oerrno = errno;
+- if (fd < 0)
+- (void)close(newfd);
+- errno = oerrno;
+- return (ret);
+-}
+diff --git a/lib/fts.h b/lib/fts.h
+deleted file mode 100644
+index 58846b9..0000000
+--- a/lib/fts.h
++++ /dev/null
+@@ -1,131 +0,0 @@
+-/*
+- * Copyright (c) 1989, 1993
+- * The Regents of the University of California. 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.
+- * 4. Neither the name of the University nor the names of its contributors
+- * may be used to endorse or promote products derived from this software
+- * without specific prior written permission.
+- *
+- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+- * SUCH DAMAGE.
+- *
+- * @(#)fts.h 8.3 (Berkeley) 8/14/94
+- */
+-
+-#ifndef _FTS_H
+-#define _FTS_H 1
+-
+-#include <features.h>
+-#include <sys/types.h>
+-
+-typedef struct {
+- struct _ftsent *fts_cur; /* current node */
+- struct _ftsent *fts_child; /* linked list of children */
+- struct _ftsent **fts_array; /* sort array */
+- dev_t fts_dev; /* starting device # */
+- char *fts_path; /* path for this descent */
+- int fts_rfd; /* fd for root */
+- int fts_pathlen; /* sizeof(path) */
+- int fts_nitems; /* elements in the sort array */
+- int (*fts_compar) (const void *, const void *); /* compare fn */
+-
+-#define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */
+-#define FTS_LOGICAL 0x0002 /* logical walk */
+-#define FTS_NOCHDIR 0x0004 /* don't change directories */
+-#define FTS_NOSTAT 0x0008 /* don't get stat info */
+-#define FTS_PHYSICAL 0x0010 /* physical walk */
+-#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */
+-#define FTS_XDEV 0x0040 /* don't cross devices */
+-#define FTS_WHITEOUT 0x0080 /* return whiteout information */
+-#define FTS_OPTIONMASK 0x00ff /* valid user option mask */
+-
+-#define FTS_NAMEONLY 0x0100 /* (private) child names only */
+-#define FTS_STOP 0x0200 /* (private) unrecoverable error */
+- int fts_options; /* fts_open options, global flags */
+-} FTS;
+-
+-typedef struct _ftsent {
+- struct _ftsent *fts_cycle; /* cycle node */
+- struct _ftsent *fts_parent; /* parent directory */
+- struct _ftsent *fts_link; /* next file in directory */
+- long fts_number; /* local numeric value */
+- void *fts_pointer; /* local address value */
+- char *fts_accpath; /* access path */
+- char *fts_path; /* root path */
+- int fts_errno; /* errno for this node */
+- int fts_symfd; /* fd for symlink */
+- u_short fts_pathlen; /* strlen(fts_path) */
+- u_short fts_namelen; /* strlen(fts_name) */
+-
+- ino_t fts_ino; /* inode */
+- dev_t fts_dev; /* device */
+- nlink_t fts_nlink; /* link count */
+-
+-#define FTS_ROOTPARENTLEVEL -1
+-#define FTS_ROOTLEVEL 0
+- short fts_level; /* depth (-1 to N) */
+-
+-#define FTS_D 1 /* preorder directory */
+-#define FTS_DC 2 /* directory that causes cycles */
+-#define FTS_DEFAULT 3 /* none of the above */
+-#define FTS_DNR 4 /* unreadable directory */
+-#define FTS_DOT 5 /* dot or dot-dot */
+-#define FTS_DP 6 /* postorder directory */
+-#define FTS_ERR 7 /* error; errno is set */
+-#define FTS_F 8 /* regular file */
+-#define FTS_INIT 9 /* initialized only */
+-#define FTS_NS 10 /* stat(2) failed */
+-#define FTS_NSOK 11 /* no stat(2) requested */
+-#define FTS_SL 12 /* symbolic link */
+-#define FTS_SLNONE 13 /* symbolic link without target */
+-#define FTS_W 14 /* whiteout object */
+- u_short fts_info; /* user flags for FTSENT structure */
+-
+-#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
+-#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
+- u_short fts_flags; /* private flags for FTSENT structure */
+-
+-#define FTS_AGAIN 1 /* read node again */
+-#define FTS_FOLLOW 2 /* follow symbolic link */
+-#define FTS_NOINSTR 3 /* no instructions */
+-#define FTS_SKIP 4 /* discard node */
+- u_short fts_instr; /* fts_set() instructions */
+-
+- struct stat *fts_statp; /* stat(2) information */
+- char fts_name[1]; /* file name */
+-} FTSENT;
+-
+-__BEGIN_DECLS
+-
+-#define fts_children pax_fts_children
+-#define fts_close pax_fts_close
+-#define fts_open pax_fts_open
+-#define fts_read pax_fts_read
+-#define fts_set pax_fts_set
+-
+-FTSENT *fts_children (FTS *, int);
+-int fts_close (FTS *);
+-FTS *fts_open (char * const *, int,
+- int (*)(const FTSENT **, const FTSENT **));
+-FTSENT *fts_read (FTS *);
+-int fts_set (FTS *, FTSENT *, int) __THROW;
+-__END_DECLS
+-
+-#endif /* fts.h */
+diff --git a/lib/vis.h b/lib/vis.h
+index d34d342..71fa5f4 100644
+--- a/lib/vis.h
++++ b/lib/vis.h
+@@ -73,14 +73,19 @@
+ */
+ #define UNVIS_END 1 /* no more characters */
+
+-#include <sys/cdefs.h>
++#ifndef __P
++#define __P(x) x
++#endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+ char *vis __P((char *, int, int, int));
+ int strvis __P((char *, const char *, int));
+ int strvisx __P((char *, const char *, size_t, int));
+ int strunvis __P((char *, const char *));
+ int unvis __P((char *, char, int *, int));
+-__END_DECLS
+-
++#ifdef __cplusplus
++}
++#endif
+ #endif /* !_VIS_H_ */
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 5ef52a3..227cdef 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -22,4 +22,4 @@ pax_SOURCES = ar_io.c ar_subs.c buf_subs.c cache.c cpio.c\
+ file_subs.c ftree.c gen_subs.c getoldopt.c options.c\
+ pat_rep.c pax.c sel_subs.c tables.c tar.c tty_subs.c
+
+-pax_LDADD = $(top_builddir)/lib/libbsdfunc.a
++pax_LDADD = $(top_builddir)/lib/libbsdfunc.a -lfts
+diff --git a/src/extern.h b/src/extern.h
+index 361fa81..3ed365d 100644
+--- a/src/extern.h
++++ b/src/extern.h
+@@ -37,8 +37,6 @@
+ * External references from each source file
+ */
+
+-#include <sys/cdefs.h>
+-
+ /*
+ * ar_io.c
+ */
+diff --git a/src/file_subs.c b/src/file_subs.c
+index 5590ff1..15bc339 100644
+--- a/src/file_subs.c
++++ b/src/file_subs.c
+@@ -52,7 +52,7 @@
+ #include "extern.h"
+
+ static int
+-mk_link __P((register char *,register struct stat *,register char *, int));
++mk_link (register char *,register struct stat *,register char *, int);
+
+ /*
+ * routines that deal with file operations such as: creating, removing;
+diff --git a/src/tables.c b/src/tables.c
+index 2275bf7..8fddca4 100644
+--- a/src/tables.c
++++ b/src/tables.c
+@@ -39,7 +39,7 @@
+ #include <sys/time.h>
+ #include <sys/stat.h>
+ #include <sys/param.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch
new file mode 100644
index 000000000..58ac9ce4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/0001-use-strtoll-instead-of-strtoq.patch
@@ -0,0 +1,33 @@
+From b1f50320332c9c90fa33ab136ef0ec2d12cda461 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 6 Jan 2016 12:30:52 -0800
+Subject: [PATCH] use strtoll instead of strtoq
+
+Use LLONG_MAX instead of LONG_LONG_MAX
+LONG_LONG_MAX is GNU specific
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/options.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/options.c b/src/options.c
+index da8b4cf..c663b4e 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -1547,8 +1547,8 @@ str_offt (char *val)
+
+ #if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
+ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+- num = strtoq (val, &expr, 0);
+- if ((num == LONG_LONG_MAX) || (num <= 0) || (expr == val))
++ num = strtoll (val, &expr, 0);
++ if ((num == LLONG_MAX) || (num <= 0) || (expr == val))
+ #else
+ num = strtol (val, &expr, 0);
+ if ((num == LONG_MAX) || (num <= 0) || (expr == val))
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch
new file mode 100644
index 000000000..88779c3bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+This patch fixes this compiler error with gcc 4.6.0
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/05/08
+
+| fts.c: In function 'pax_fts_set':
+| fts.c:469:7: error: parameter 'sp' set but not used [-Werror=unused-but-set-parameter]
+| cc1: all warnings being treated as errors
+|
+| make[2]: *** [fts.o] Error 1
+
+Index: pax-3.4/lib/fts.c
+===================================================================
+--- pax-3.4.orig/lib/fts.c
++++ pax-3.4/lib/fts.c
+@@ -466,7 +466,7 @@ name: t = sp->fts_path + NAPPEND(p->fts
+ /* ARGSUSED */
+ int
+ fts_set(sp, p, instr)
+- FTS *sp;
++ FTS __attribute__((__unused__)) *sp;
+ FTSENT *p;
+ int instr;
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch
new file mode 100644
index 000000000..80878f38b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch
@@ -0,0 +1,185 @@
+Upstream-Status: Pending
+
+Author: H.J. Lu <hjl.tools@gmail.com>
+Date: Tue Dec 6 10:34:53 2011 -0800
+
+ Fix pax-3.4 build for x32
+
+ off_t is 8byte for x32. We need to check both _FILE_OFFSET_BITS and
+ size of off_t to see if file offset is 64bit. This patch adds
+ AC_CHECK_SIZEOF(off_t) and checks SIZEOF_OFF_T == 8.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/06
+
+Index: pax-3.4/configure.in
+===================================================================
+--- pax-3.4.orig/configure.in
++++ pax-3.4/configure.in
+@@ -33,4 +33,7 @@ dnl Checks for header files.
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+
++AC_CHECK_SIZEOF(off_t)
++AC_CHECK_SIZEOF(long)
++
+ AC_OUTPUT([Makefile lib/Makefile src/Makefile])
+Index: pax-3.4/src/ar_io.c
+===================================================================
+--- pax-3.4.orig/src/ar_io.c
++++ pax-3.4/src/ar_io.c
+@@ -378,7 +378,8 @@ ar_close(void)
+ * could have written anything yet.
+ */
+ if (frmt == NULL) {
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ (void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n",
+ #else
+ (void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
+@@ -391,7 +392,8 @@ ar_close(void)
+
+ if (strcmp(NM_CPIO, argv0) == 0)
+ (void)fprintf(listf,
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ "%qu blocks\n",
+ #else
+ "%lu blocks\n",
+@@ -399,7 +401,8 @@ ar_close(void)
+ (rdcnt ? rdcnt : wrcnt) / 5120);
+ else if (strcmp(NM_TAR, argv0) != 0)
+ (void)fprintf(listf,
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ "%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n",
+ #else
+ "%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
+Index: pax-3.4/src/cpio.c
+===================================================================
+--- pax-3.4.orig/src/cpio.c
++++ pax-3.4/src/cpio.c
+@@ -218,7 +218,8 @@ rd_ln_nm (ARCHD *arcn)
+ */
+ if ((arcn->sb.st_size == 0) ||
+ (arcn->sb.st_size >= (off_t) sizeof(arcn->ln_name))) {
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ paxwarn (1, "Cpio link name length is invalid: %qu",
+ arcn->sb.st_size);
+ #else
+Index: pax-3.4/src/gen_subs.c
+===================================================================
+--- pax-3.4.orig/src/gen_subs.c
++++ pax-3.4/src/gen_subs.c
+@@ -133,7 +133,8 @@ ls_list (ARCHD *arcn, time_t now, FILE *
+ * print device id's for devices, or sizes for other nodes
+ */
+ if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK))
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ (void) fprintf (fp, "%4lu,%4lu ", (unsigned long) MAJOR (sbp->st_rdev),
+ (unsigned long) MINOR (sbp->st_rdev));
+ #else
+@@ -142,7 +143,8 @@ ls_list (ARCHD *arcn, time_t now, FILE *
+ #endif
+ else
+ {
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ (void) fprintf (fp, "%9qu ", sbp->st_size);
+ #else
+ (void) fprintf (fp, "%9lu ", sbp->st_size);
+@@ -334,7 +336,8 @@ ul_asc (u_long val, char *str, int len,
+ return (0);
+ }
+
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ /*
+ * asc_uqd()
+ * convert hex/octal character string into a u_quad_t. We do not have to
+Index: pax-3.4/src/options.c
+===================================================================
+--- pax-3.4.orig/src/options.c
++++ pax-3.4/src/options.c
+@@ -1545,7 +1545,8 @@ str_offt (char *val)
+ char *expr;
+ off_t num, t;
+
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ num = strtoq (val, &expr, 0);
+ if ((num == LONG_LONG_MAX) || (num <= 0) || (expr == val))
+ #else
+Index: pax-3.4/src/tar.c
+===================================================================
+--- pax-3.4.orig/src/tar.c
++++ pax-3.4/src/tar.c
+@@ -58,7 +58,8 @@
+ static unsigned long tar_chksm (char *, int);
+ static char *name_split (char *, int);
+ static int ul_oct (u_long, char *, int, int);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ static int uqd_oct (u_quad_t, char *, int, int);
+ #endif
+
+@@ -196,7 +197,8 @@ ul_oct (u_long val, register char *str,
+ return (0);
+ }
+
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ /*
+ * uqd_oct()
+ * convert an u_quad_t to an octal string. one of many oddball field
+@@ -427,7 +429,8 @@ tar_rd (ARCHD *arcn, char *buf)
+ 0xfff);
+ arcn->sb.st_uid = (uid_t) asc_ul (hd->uid, sizeof (hd->uid), OCT);
+ arcn->sb.st_gid = (gid_t) asc_ul (hd->gid, sizeof (hd->gid), OCT);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ arcn->sb.st_size = (off_t) asc_uqd (hd->size, sizeof (hd->size), OCT);
+ #else
+ arcn->sb.st_size = (off_t) asc_ul (hd->size, sizeof (hd->size), OCT);
+@@ -659,7 +662,8 @@ tar_wr (register ARCHD * arcn)
+ * data follows this file, so set the pad
+ */
+ hd->linkflag = AREGTYPE;
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ if (uqd_oct ((u_quad_t) arcn->sb.st_size, hd->size,
+ sizeof (hd->size), 1))
+ #else
+@@ -834,7 +838,8 @@ ustar_rd (ARCHD *arcn, char *buf)
+ */
+ arcn->sb.st_mode = (mode_t) (asc_ul (hd->mode, sizeof (hd->mode), OCT) &
+ 0xfff);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ arcn->sb.st_size = (off_t) asc_uqd (hd->size, sizeof (hd->size), OCT);
+ #else
+ arcn->sb.st_size = (off_t) asc_ul (hd->size, sizeof (hd->size), OCT);
+@@ -1081,7 +1086,8 @@ ustar_wr (register ARCHD * arcn)
+ else
+ hd->typeflag = REGTYPE;
+ arcn->pad = TAR_PAD (arcn->sb.st_size);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++ || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ if (uqd_oct ((u_quad_t) arcn->sb.st_size, hd->size,
+ sizeof (hd->size), 3))
+ {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb b/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb
new file mode 100644
index 000000000..9d1abfbb5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pax/pax_3.4.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Portable Archive eXchange"
+DESCRIPTION = "pax (Portable Archive eXchange) is the POSIX standard archive tool"
+HOMEPAGE = "http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/pax/"
+BUGTRACKER = "http://www.openbsd.org/query-pr.html"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4b0b674dfdc56daa3832d4069b820ea0 \
+ file://src/pax.h;endline=40;md5=309d3e241c1d82069228e5a51e9b8d60 \
+ file://src/cpio.h;endline=40;md5=c3b4bbff6133a83387968617bbae8ac4 \
+ file://lib/vis.h;endline=40;md5=b283f759abd4a5ad7e014b80f51fc053"
+
+SECTION = "base"
+PR = "r2"
+
+DEPENDS_append_libc-musl = " fts "
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
+ file://fix_for_compile_with_gcc-4.6.0.patch \
+ file://pax-3.4_fix_for_x32.patch"
+
+SRC_URI_append_libc-musl = " file://0001-Fix-build-with-musl.patch \
+ file://0001-use-strtoll-instead-of-strtoq.patch \
+ "
+
+SRC_URI[md5sum] = "fbd9023b590b45ac3ade95870702a0d6"
+SRC_URI[sha256sum] = "ac3c06048e02828077cf7757d3d142241429238893b91d529af29a2e8cc5623b"
+
+inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb b/import-layers/yocto-poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb
new file mode 100644
index 000000000..06d37adc3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb
@@ -0,0 +1,28 @@
+SUMMARY = "PBZIP2 is a parallel implementation of bzip2"
+DESCRIPTION = "PBZIP2 is a parallel implementation of the bzip2 block-sorting \
+file compressor that uses pthreads and achieves near-linear speedup on SMP \
+machines. The output of this version is fully compatible with bzip2 v1.0.2 or \
+newer (ie: anything compressed with pbzip2 can be decompressed with bzip2)."
+HOMEPAGE = "http://compression.ca/pbzip2/"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=398b8832c6f840cfebd20ab2be6a3743"
+
+DEPENDS = "bzip2"
+DEPENDS_append_class-native = " bzip2-replacement-native"
+
+SRC_URI = "https://launchpad.net/${BPN}/1.1/${PV}/+download/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "4cb87da2dba05540afce162f34b3a9a6"
+SRC_URI[sha256sum] = "8fd13eaaa266f7ee91f85c1ea97c86d9c9cc985969db9059cdebcb1e1b7bdbe6"
+
+UPSTREAM_CHECK_URI = "http://compression.ca/pbzip2/"
+
+EXTRA_OEMAKE = "CXX='${CXX} ${CXXFLAGS}' LDFLAGS='${LDFLAGS}'"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 pbzip2 ${D}${bindir}/
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb
new file mode 100644
index 000000000..170e7ecde
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Convert::ASN1 - Perl ASN.1 Encode/Decode library"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README.md;beginline=91;endline=97;md5=ceff7fd286eb6d8e8e0d3d23e096a63f"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Convert-ASN1-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "68723e96be0b258a9e20480276e8a62c"
+SRC_URI[sha256sum] = "74a4a78ae0c5e973100ac0a8f203a110f76fb047b79dae4fc1fd7d6814d3d58a"
+
+S = "${WORKDIR}/Convert-ASN1-${PV}"
+
+inherit cpan
+
+EXTRA_PERLFLAGS = "-I ${PERLHOSTLIB}"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb
new file mode 100644
index 000000000..c8fcde45f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/perl/libtimedate-perl_2.30.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Perl modules useful for manipulating date and time information"
+SECTION = "libs"
+# You can redistribute it and/or modify it under the same terms as Perl itself.
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=21;md5=576b7cb41e5e821501a01ed66f0f9d9e"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/TimeDate-${PV}.tar.gz"
+
+S = "${WORKDIR}/TimeDate-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
+
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN} += "perl-module-carp perl-module-exporter perl-module-strict perl-module-time-local"
+
+SRC_URI[md5sum] = "b1d91153ac971347aee84292ed886c1c"
+SRC_URI[sha256sum] = "75bd254871cb5853a6aa0403ac0be270cdd75c9d1b6639f18ecba63c15298e86"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb
new file mode 100644
index 000000000..9a9e71011
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Perl module for supporting simple generic namespaces"
+DESCRIPTION = "XML::NamespaceSupport offers a simple way to process namespace-based XML names. \
+ It also helps maintain a prefix-to-namespace URI map, and provides a number of \
+ basic checks. "
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://META.yml;beginline=22;endline=22;md5=3b2b564dae8b9af9e8896e85c07dcbe5"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-${PV}.tar.gz"
+SRC_URI[md5sum] = "222cca76161cd956d724286d36b607da"
+SRC_URI[sha256sum] = "6d8151f0a3f102313d76b64bfd1c2d9ed46bfe63a16f038e7d860fda287b74ea"
+
+
+S = "${WORKDIR}/XML-NamespaceSupport-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND="native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb
new file mode 100644
index 000000000..14a337057
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Base class SAX Drivers and Filters"
+DESCRIPTION = "This module has a very simple task - to be a base class for \
+PerlSAX drivers and filters. It's default behaviour is to pass \
+the input directly to the output unchanged. It can be useful to \
+use this module as a base class so you don't have to, for example, \
+implement the characters() callback."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+RDEPENDS_${PN} += "perl-module-extutils-makemaker"
+
+LIC_FILES_CHKSUM = "file://dist.ini;endline=5;md5=8f9c9a55340aefaee6e9704c88466446"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GR/GRANTM/XML-SAX-Base-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "38c8c3247dfd080712596118d70dbe32"
+SRC_URI[sha256sum] = "666270318b15f88b8427e585198abbc19bc2e6ccb36dc4c0a4f2d9807330219e"
+
+S = "${WORKDIR}/XML-SAX-Base-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb
new file mode 100644
index 000000000..45d396639
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Perl module for using and building Perl SAX2 XML processors"
+DESCRIPTION = "XML::SAX consists of several framework classes for using and \
+building Perl SAX2 XML parsers, filters, and drivers. It is designed \
+around the need to be able to "plug in" different SAX parsers to an \
+application without requiring programmer intervention. Those of you \
+familiar with the DBI will be right at home. Some of the designs \
+come from the Java JAXP specification (SAX part), only without the \
+javaness."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+DEPENDS += "libxml-namespacesupport-perl-native"
+RDEPENDS_${PN} += "libxml-namespacesupport-perl libxml-sax-base-perl perl-module-file-temp"
+PR = "r2"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=65c4cd8f39c24c7135ed70dacbcb09e3"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GR/GRANTM/XML-SAX-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "290f5375ae87fdebfdb5bc3854019f24"
+SRC_URI[sha256sum] = "32b04b8e36b6cc4cfc486de2d859d87af5386dd930f2383c49347050d6f5ad84"
+
+S = "${WORKDIR}/XML-SAX-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc
new file mode 100644
index 000000000..86f434c10
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz.inc
@@ -0,0 +1,41 @@
+SUMMARY = "A parallel implementation of gzip"
+DESCRIPTION = "pigz, which stands for parallel implementation of gzip, is a \
+fully functional replacement for gzip that exploits multiple processors and \
+multiple cores to the hilt when compressing data. pigz was written by Mark \
+Adler, and uses the zlib and pthread libraries."
+HOMEPAGE = "http://zlib.net/pigz/"
+SECTION = "console/utils"
+LICENSE = "Zlib & Apache-2.0"
+
+SRC_URI = "http://zlib.net/${BPN}/${BP}.tar.gz"
+
+PROVIDES_class-native += "gzip-native"
+
+DEPENDS = "zlib"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+inherit update-alternatives
+
+do_install_class-target() {
+ # Install files into /bin (FHS), which is typical place for gzip
+ install -d ${D}${base_bindir}
+ install ${B}/pigz ${D}${base_bindir}/pigz
+ ln -nsf pigz ${D}${base_bindir}/unpigz
+ ln -nsf pigz ${D}${base_bindir}/pigzcat
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install ${B}/pigz ${D}${bindir}/gzip
+ ln -nsf gzip ${D}${bindir}/gunzip
+ ln -nsf gzip ${D}${bindir}/zcat
+}
+
+ALTERNATIVE_PRIORITY = "80"
+ALTERNATIVE_${PN} = "gunzip gzip zcat"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip"
+ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip"
+ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat"
+ALTERNATIVE_TARGET = "${base_bindir}/pigz"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch
new file mode 100644
index 000000000..4becc0e3f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz/link-order.patch
@@ -0,0 +1,38 @@
+This patch avoids underlinking issues since we pass -lz via LDFLAGS but it appears
+before pigz.o which needs symbols from libz however due to order linker happily discards libz
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: pigz-2.3.3/Makefile
+===================================================================
+--- pigz-2.3.3.orig/Makefile 2015-01-19 20:12:31.000000000 -0800
++++ pigz-2.3.3/Makefile 2015-01-28 09:11:50.266669184 -0800
+@@ -5,7 +5,7 @@
+ # use gcc and gmake on Solaris
+
+ pigz: pigz.o yarn.o try.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
+- $(CC) $(LDFLAGS) -o pigz $^ -lpthread -lm
++ $(CC) -o pigz $^ $(LDFLAGS) -lz -lpthread -lm
+ ln -f pigz unpigz
+
+ pigz.o: pigz.c yarn.h try.h ${ZOPFLI}deflate.h ${ZOPFLI}util.h
+@@ -35,7 +35,7 @@
+ dev: pigz pigzt pigzn
+
+ pigzt: pigzt.o yarnt.o try.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
+- $(CC) $(LDFLAGS) -o pigzt $^ -lpthread -lm
++ $(CC) -o pigzt $^ $(LDFLAGS) -lz -lpthread -lm
+
+ pigzt.o: pigz.c yarn.h try.h
+ $(CC) $(CFLAGS) -DDEBUG -g -c -o pigzt.o pigz.c
+@@ -44,7 +44,7 @@
+ $(CC) $(CFLAGS) -DDEBUG -g -c -o yarnt.o yarn.c
+
+ pigzn: pigzn.o tryn.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
+- $(CC) $(LDFLAGS) -o pigzn $^ -lm
++ $(CC) -o pigzn $^ $(LDFLAGS) -lz -lm
+
+ pigzn.o: pigz.c try.h
+ $(CC) $(CFLAGS) -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb
new file mode 100644
index 000000000..080be2bbc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pigz/pigz_2.3.3.bb
@@ -0,0 +1,12 @@
+require pigz.inc
+LIC_FILES_CHKSUM = "file://pigz.c;beginline=7;endline=21;md5=a21d4075cb00ab4ca17fce5e7534ca95"
+
+SRC_URI += "file://link-order.patch"
+
+SRC_URI[md5sum] = "01d7a16cce77929cc1a78aa1bdfb68cb"
+SRC_URI[sha256sum] = "4e8b67b432ce7907575a549f3e1cac4709781ba0f6b48afea9f59369846b509c"
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch
new file mode 100644
index 000000000..12bae28dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0001-configure-Detect-headers-before-using-them.patch
@@ -0,0 +1,51 @@
+From c84480be8df6966c538d1fb67ccae2f42cc46421 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Mar 2016 07:36:54 +0000
+Subject: [PATCH 1/2] configure: Detect headers before using them
+
+Current logic does not work when system does not have
+sys/endian.h, since it tried to reuse the cached results
+from first try of detecting htole64 in sys/endian.h which is
+'no' and hence the second try to look into endian.h also
+comes out negative.
+
+So we check for header and then run the test for symbols
+and these symbols are not standard and we need to define _GNU_SOURCE
+for it to work, this issue is exposed by systems using musl e.g.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ configure.ac | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4cb56bc..5e23c50 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -69,12 +69,17 @@ AC_FUNC_MALLOC
+ AC_FUNC_REALLOC
+ AC_FUNC_STRTOD
+ AC_CHECK_FUNCS([memchr memmove memset strerror strtol])
+-AC_CHECK_DECLS([htole64, le64toh],
+- [],
++AC_CHECK_HEADER([sys/endian.h],
+ [
+- AC_CHECK_DECLS([htole64, le64toh], [], [], [#include <endian.h>])
++ AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <sys/endian.h>])
+ ],
+- [#include <sys/endian.h>])
++ [], [])
++
++AC_CHECK_HEADER([endian.h],
++ [
++ AC_CHECK_DECLS([htole64, le64toh], [], [], [#define _GNU_SOURCE 1 #include <endian.h>])
++ ],
++ [], [])
+
+ AC_CONFIG_FILES([Makefile
+ src/Makefile
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch
new file mode 100644
index 000000000..6b615988d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch
@@ -0,0 +1,47 @@
+From 5f3a535987bae4c3e3d9e9079c7526e399f7aecd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Mar 2016 07:42:39 +0000
+Subject: [PATCH 2/2] endian: Use macro bswap_64 instead of __bswap_64
+
+byteswap.h defines then as public APIs on all libc
+on linux including musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+ src/endian.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/endian.c b/src/endian.c
+index b7724f3..51aea58 100644
+--- a/src/endian.c
++++ b/src/endian.c
+@@ -15,6 +15,7 @@ void xle64enc(uint8_t *d, uint64_t n) {
+ #include <stdint.h>
+ #ifdef __linux__
+ #include <endian.h>
++ #include <byteswap.h>
+ #else
+ #include <sys/endian.h>
+ #endif
+@@ -23,7 +24,7 @@ void xle64enc(uint8_t *d, uint64_t n) {
+ # if __BYTE_ORDER == __LITTLE_ENDIAN
+ # define htole64(x) (x)
+ # else
+-# define htole64(x) __bswap_64 (x)
++# define htole64(x) bswap_64 (x)
+ # endif
+ #endif
+
+@@ -31,7 +32,7 @@ void xle64enc(uint8_t *d, uint64_t n) {
+ # if __BYTE_ORDER == __LITTLE_ENDIAN
+ # define le64toh(x) (x)
+ # else
+-# define le64toh(x) __bswap_64 (x)
++# define le64toh(x) bswap_64 (x)
+ # endif
+ #endif
+
+--
+1.8.3.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch
new file mode 100644
index 000000000..e3489db5b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz/936d8068ae19d95260d3058f41dd6cf718101cd6.patch
@@ -0,0 +1,68 @@
+From 936d8068ae19d95260d3058f41dd6cf718101cd6 Mon Sep 17 00:00:00 2001
+From: Christian Krause <kizkizzbangbang@googlemail.com>
+Date: Sat, 26 Dec 2015 14:36:17 +0100
+Subject: [PATCH] option to not build man page
+
+fixes #56
+---
+ configure.ac | 23 +++++++++++++++++++----
+ src/Makefile.am | 2 ++
+ 2 files changed, 21 insertions(+), 4 deletions(-)
+
+Upstream-Status: Backport
+RP 2016/01/22
+
+diff --git a/configure.ac b/configure.ac
+index b437e56..4cb56bc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,13 +20,28 @@ AC_CHECK_FILE(
+ [src/pixz.1],
+ [],
+ [
+- AC_CHECK_PROG(A2X, a2x, a2x, [])
+- if test "x$A2X" = x ; then
+- AC_MSG_ERROR([AsciiDoc not found, not able to generate the man page.])
+- fi
++ AC_ARG_WITH(
++ [manpage],
++ [ --without-manpage don't build man page],
++ [case ${withval} in
++ yes) manpage=true ;;
++ no) manpage=false ;;
++ *) AC_MSG_ERROR([bad value ${withval} for --with-manpage]) ;;
++ esac],
++ [manpage=true]
++ )
+ ]
+ )
+
++AM_CONDITIONAL([MANPAGE], [test x$manpage = xtrue])
++
++if test x$manpage = xtrue ; then
++ AC_CHECK_PROG(A2X, a2x, a2x, [])
++ if test "x$A2X" = x ; then
++ AC_MSG_ERROR([AsciiDoc not found, not able to generate the man page.])
++ fi
++fi
++
+ # Checks for libraries.
+ AC_CHECK_LIB([m], [ceil])
+ AX_PTHREAD
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 600ec90..b98f450 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -15,6 +15,7 @@ pixz_SOURCES = \
+ read.c \
+ write.c
+
++if MANPAGE
+ # TODO remove when possible: This is a hack because a2x is not able to output the man pages to a
+ # specific directory, only to where the source is.
+ pixz.1: pixz.1.asciidoc
+@@ -26,3 +27,4 @@ man_MANS = pixz.1
+ CLEANFILES = pixz.1
+
+ EXTRA_DIST = $(man_MANS) pixz.1.asciidoc
++endif
diff --git a/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb
new file mode 100644
index 000000000..0e51472ae
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/pixz/pixz_1.0.6.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Parallel, indexed xz compressor"
+
+DEPENDS = "xz libarchive"
+
+SRC_URI = "https://github.com/vasi/pixz/releases/download/v${PV}/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "f6dc5909c9a31b192f69aa397ae8df48"
+SRC_URI[sha256sum] = "02c50746b134fa1b1aae41fcc314d7c6f1919b3d48bcdea01bf11769f83f72e8"
+
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5cf6d164086105f1512ccb81bfff1926"
+
+SRC_URI += "file://936d8068ae19d95260d3058f41dd6cf718101cd6.patch \
+ file://0001-configure-Detect-headers-before-using-them.patch \
+ file://0002-endian-Use-macro-bswap_64-instead-of-__bswap_64.patch \
+"
+UPSTREAM_CHECK_URI = "https://github.com/vasi/pixz/releases"
+
+EXTRA_OECONF += "--without-manpage"
+CFLAGS_append_libc-musl = " -D_GNU_SOURCE"
+CACHED_CONFIGUREVARS += "ac_cv_file_src_pixz_1=no"
+
+inherit autotools pkgconfig
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/procps/procps/sysctl.conf b/import-layers/yocto-poky/meta/recipes-extended/procps/procps/sysctl.conf
new file mode 100644
index 000000000..34e7488bf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/procps/procps/sysctl.conf
@@ -0,0 +1,64 @@
+# This configuration file is taken from Debian.
+#
+# /etc/sysctl.conf - Configuration file for setting system variables
+# See sysctl.conf (5) for information.
+#
+
+#kernel.domainname = example.com
+
+# Uncomment the following to stop low-level messages on console
+#kernel.printk = 4 4 1 7
+
+##############################################################3
+# Functions previously found in netbase
+#
+
+# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
+# Turn on Source Address Verification in all interfaces to
+# prevent some spoofing attacks
+net.ipv4.conf.default.rp_filter=1
+net.ipv4.conf.all.rp_filter=1
+
+# Uncomment the next line to enable TCP/IP SYN cookies
+#net.ipv4.tcp_syncookies=1
+
+# Uncomment the next line to enable packet forwarding for IPv4
+#net.ipv4.ip_forward=1
+
+# Uncomment the next line to enable packet forwarding for IPv6
+#net.ipv6.conf.all.forwarding=1
+
+
+###################################################################
+# Additional settings - these settings can improve the network
+# security of the host and prevent against some network attacks
+# including spoofing attacks and man in the middle attacks through
+# redirection. Some network environments, however, require that these
+# settings are disabled so review and enable them as needed.
+#
+# Ignore ICMP broadcasts
+#net.ipv4.icmp_echo_ignore_broadcasts = 1
+#
+# Ignore bogus ICMP errors
+#net.ipv4.icmp_ignore_bogus_error_responses = 1
+#
+# Do not accept ICMP redirects (prevent MITM attacks)
+#net.ipv4.conf.all.accept_redirects = 0
+#net.ipv6.conf.all.accept_redirects = 0
+# _or_
+# Accept ICMP redirects only for gateways listed in our default
+# gateway list (enabled by default)
+# net.ipv4.conf.all.secure_redirects = 1
+#
+# Do not send ICMP redirects (we are not a router)
+#net.ipv4.conf.all.send_redirects = 0
+#
+# Do not accept IP source route packets (we are not a router)
+#net.ipv4.conf.all.accept_source_route = 0
+#net.ipv6.conf.all.accept_source_route = 0
+#
+# Log Martian Packets
+#net.ipv4.conf.all.log_martians = 1
+#
+
+#kernel.shmmax = 141762560
diff --git a/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.11.bb b/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.11.bb
new file mode 100644
index 000000000..c6dccc677
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/procps/procps_3.3.11.bb
@@ -0,0 +1,66 @@
+SUMMARY = "System and process monitoring utilities"
+DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \
+the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill."
+HOMEPAGE = "https://gitorious.org/procps"
+SECTION = "base"
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \
+ "
+
+DEPENDS = "ncurses"
+
+inherit autotools gettext pkgconfig update-alternatives
+
+SRC_URI = "http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-${PV}.tar.xz \
+ file://sysctl.conf \
+ "
+
+SRC_URI[md5sum] = "6cc5b94c1c5b8cbc89ad345a7b522f74"
+SRC_URI[sha256sum] = "e9493169a2d2adc0bc045538707310c8e877b385e4e296143b62607d2bb044ed"
+
+S = "${WORKDIR}/procps-ng-${PV}"
+
+EXTRA_OECONF = "--enable-skill --disable-modern-top"
+
+CPPFLAGS += "-I${S}"
+
+do_install_append () {
+ install -d ${D}${base_bindir}
+ [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
+ install -d ${D}${base_sbindir}
+ [ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done
+ if [ "${base_sbindir}" != "${sbindir}" ]; then
+ rmdir ${D}${sbindir}
+ fi
+
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${sysconfdir}/sysctl.d
+ ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf
+ fi
+}
+
+CONFFILES_${PN} = "${sysconfdir}/sysctl.conf"
+
+bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime"
+base_bindir_progs += "kill pidof ps watch"
+base_sbindir_progs += "sysctl"
+
+ALTERNATIVE_PRIORITY = "200"
+
+ALTERNATIVE_${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}"
+
+ALTERNATIVE_${PN}-doc = "kill.1 uptime.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
+
+python __anonymous() {
+ for prog in d.getVar('base_bindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+
+ for prog in d.getVar('base_sbindir_progs', True).split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch b/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch
new file mode 100644
index 000000000..e57d60f6a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch
@@ -0,0 +1,46 @@
+From 3638cc55b4d08851faba46635d737b24d016665b Mon Sep 17 00:00:00 2001
+From: Brad Jorsch <anomie@users.sourceforge.net>
+Date: Fri, 28 Feb 2014 21:55:02 +1100
+Subject: [PATCH] Typo in fuser makes -M on all the time
+
+Brad found that fuser had the -M option on all the time.
+A simple but significant typo caused this, thanks the the patch.
+
+Bug-Debian: http://bugs.debian.org/740275
+
+Upstream-Status: Backport
+
+Signed-off-by: Craig Small <csmall@enc.com.au>
+---
+ ChangeLog | 4 ++++
+ src/fuser.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index fd1cccf..e5f784c 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++Changes in 22.22
++================
++ * Fixed typo in fuser which has -M on Debian #740275
++
+ Changes in 22.21
+ ================
+ * Missing comma in fuser(1) added Debian #702391
+diff --git a/src/fuser.c b/src/fuser.c
+index b485f65..389b302 100644
+--- a/src/fuser.c
++++ b/src/fuser.c
+@@ -1174,7 +1174,7 @@ int main(int argc, char *argv[])
+ usage(_("No process specification given"));
+
+ /* Check if -M flag was used and if so check mounts */
+- if (opts * OPT_ISMOUNTPOINT) {
++ if (opts & OPT_ISMOUNTPOINT) {
+ check_mountpoints(&mounts, &names_head, &names_tail);
+ }
+
+--
+1.8.4.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch b/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch
new file mode 100644
index 000000000..c8afcac8a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch
@@ -0,0 +1,29 @@
+From aa66afecd8ba9cc4139f25ab15ec315173413a7d Mon Sep 17 00:00:00 2001
+From: Paul Barker <paul@paulbarker.me.uk>
+Date: Wed, 20 Aug 2014 10:31:37 +0000
+Subject: [PATCH] Include <limits.h> for PATH_MAX
+
+When building against musl libc, PATH_MAX is defined in <limits.h>.
+
+Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
+
+Upstream-Status: Accepted (Should be in next release after 22.21)
+---
+ src/pstree.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/pstree.c b/src/pstree.c
+index 071e6c4..0d28260 100644
+--- a/src/pstree.c
++++ b/src/pstree.c
+@@ -41,6 +41,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
++#include <limits.h>
+
+ #include "i18n.h"
+ #include "comm.h"
+--
+2.0.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc
new file mode 100644
index 000000000..68e06561f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc.inc
@@ -0,0 +1,44 @@
+SUMMARY = "Utilities for managing processes on your system"
+DESCRIPTION = "The psmisc package contains utilities for managing processes on your \
+system: pstree, killall and fuser. The pstree command displays a tree \
+structure of all of the running processes on your system. The killall \
+command sends a specified signal (SIGTERM if nothing is specified) to \
+processes identified by name. The fuser command identifies the PIDs \
+of processes that are using specified files or filesystems."
+SECTION = "base"
+DEPENDS = "ncurses virtual/libintl"
+LICENSE = "GPLv2"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz"
+
+S = "${WORKDIR}/psmisc-${PV}"
+
+inherit autotools gettext
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "fuser fuser-doc killall killall-doc pstree pstree-doc"
+PACKAGES += "psmisc-extras"
+
+FILES_${PN} = ""
+RDEPENDS_${PN} = "fuser killall pstree"
+
+FILES_fuser = "${bindir}/fuser.${BPN}"
+FILES_fuser-doc = "${mandir}/man1/fuser*"
+
+FILES_killall = "${bindir}/killall.${BPN}"
+FILES_killall-doc = "${mandir}/man1/killall*"
+
+FILES_pstree = "${bindir}/pstree"
+FILES_pstree-doc = "${mandir}/man1/pstree*"
+
+FILES_psmisc-extras = "${bindir}"
+FILES_psmisc-extras-doc = "${mandir}"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "90"
+
+ALTERNATIVE_killall = "killall"
+
+ALTERNATIVE_fuser = "fuser"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
new file mode 100644
index 000000000..b57a006bc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
@@ -0,0 +1,51 @@
+From 5dc872bb2fba6421cb8e1ee578f7bd4aaed55f61 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 24 Mar 2016 15:46:14 +0000
+Subject: [PATCH] Use UINTPTR_MAX instead of __WORDSIZE
+
+Do not include sys/user.h since it conflicts with
+pt_regs struct from kernel APIs in asm/ptrace.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/peekfd.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/src/peekfd.c b/src/peekfd.c
+index cba2130..0d39878 100644
+--- a/src/peekfd.c
++++ b/src/peekfd.c
+@@ -30,8 +30,11 @@
+ #include <asm/ptrace.h>
+ #include <byteswap.h>
+ #include <endian.h>
++#ifdef __GLIBC__
+ #include <sys/user.h>
++#endif
+ #include <stdlib.h>
++#include <stdint.h>
+ #include <getopt.h>
+ #include <ctype.h>
+
+@@ -228,11 +231,11 @@ int main(int argc, char **argv)
+ if (WIFSTOPPED(status)) {
+ #ifdef PPC
+ struct pt_regs regs;
+- regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R0, 0);
+- regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R3, 0);
+- regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R4, 0);
+- regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R5, 0);
+- regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_ORIG_R3, 0);
++ regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R0, 0);
++ regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R3, 0);
++ regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R4, 0);
++ regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R5, 0);
++ regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_ORIG_R3, 0);
+ #elif defined(ARM)
+ struct pt_regs regs;
+ ptrace(PTRACE_GETREGS, pid, 0, &regs);
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc_22.21.bb b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc_22.21.bb
new file mode 100644
index 000000000..1c6473ebf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/psmisc/psmisc_22.21.bb
@@ -0,0 +1,12 @@
+require psmisc.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+SRC_URI[md5sum] = "935c0fd6eb208288262b385fa656f1bf"
+SRC_URI[sha256sum] = "97323cad619210845b696d7d722c383852b2acb5c49b5b0852c4f29c77a8145a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz \
+ file://0001-Typo-in-fuser-makes-M-on-all-the-time.patch \
+ file://0002-Include-limits.h-for-PATH_MAX.patch \
+ file://0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch \
+ "
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch
new file mode 100644
index 000000000..6add4708a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch
@@ -0,0 +1,33 @@
+From 776757a23e9930588950c7fcbc7827ec7a3e51c4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tchvatal@suse.com>
+Date: Mon, 4 Jan 2016 15:48:19 +0100
+Subject: [PATCH] Do not accidentaly override commandline passed CFLAGS.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Backport
+
+Signed-off-by: Tomáš Chvátal <tchvatal@suse.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3ba1386..1552c15 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -53,7 +53,7 @@ AS_IF([test "x${prefix}" = "xNONE"], [
+ # ================
+ # Check for cflags
+ # ================
+-CFLAGS="-D_GNU_SOURCE -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
++CFLAGS="$CFLAGS -D_GNU_SOURCE -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
+ AC_ARG_ENABLE([werror],
+ [AS_HELP_STRING([--enable-werror], [Treat all warnings as errors, useful for development])],
+ [enable_werror="$enableval"],
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Fix-build-with-disabled-ldap.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Fix-build-with-disabled-ldap.patch
new file mode 100644
index 000000000..a79e47796
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/0001-Fix-build-with-disabled-ldap.patch
@@ -0,0 +1,93 @@
+From 39fd30ce57e3c34c3649866bf9345a71f0b78667 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Mon, 4 Jan 2016 15:10:53 +0100
+Subject: [PATCH] Fix build with disabled ldap
+
+Upstream-Status: Backport
+
+Reported-by: Tomas Chvatal <tchvatal@suse.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ warnquota.c | 36 ++++++++++++++++++------------------
+ 1 file changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/warnquota.c b/warnquota.c
+index 3734f0e..e9868c1 100644
+--- a/warnquota.c
++++ b/warnquota.c
+@@ -109,13 +109,13 @@ struct configparams {
+ char *user_signature;
+ char *group_message;
+ char *group_signature;
++ time_t cc_before;
++#ifdef USE_LDAP_MAIL_LOOKUP
+ int use_ldap_mail; /* 0 */
++ int ldap_is_setup; /* 0 */
+ int ldap_starttls; /* 0 */
+ int ldap_tls; /* LDAP_OPT_X_TLS_NEVER */
+ int ldap_vers; /* LDAP_VERSION3 */
+- time_t cc_before;
+-#ifdef USE_LDAP_MAIL_LOOKUP
+- int ldap_is_setup; /* 0 */
+ char ldap_host[CNF_BUFFER];
+ int ldap_port;
+ char ldap_uri[CNF_BUFFER];
+@@ -729,13 +729,13 @@ static int readconfigfile(const char *filename, struct configparams *config)
+ }
+ maildev[0] = 0;
+ config->user_signature = config->user_message = config->group_signature = config->group_message = NULL;
++ config->cc_before = -1;
++
++#ifdef USE_LDAP_MAIL_LOOKUP
+ config->use_ldap_mail = 0;
+ config->ldap_starttls = 0;
+ config->ldap_tls = LDAP_OPT_X_TLS_NEVER;
+ config->ldap_vers = LDAP_VERSION3;
+- config->cc_before = -1;
+-
+-#ifdef USE_LDAP_MAIL_LOOKUP
+ config->ldap_port = config->ldap_is_setup = 0;
+ config->ldap_host[0] = 0;
+ config->ldap_uri[0] = 0;
+@@ -820,6 +820,18 @@ static int readconfigfile(const char *filename, struct configparams *config)
+ create_eoln(config->group_signature);
+ verify_format(config->group_signature, "GROUP_SIGNATURE");
+ }
++ else if (!strcmp(var, "CC_BEFORE")) {
++ int num;
++ char unit[10];
++
++ if (sscanf(value, "%d%s", &num, unit) != 2)
++ goto cc_parse_err;
++ if (str2timeunits(num, unit, &config->cc_before) < 0) {
++cc_parse_err:
++ die(1, _("Cannot parse time at CC_BEFORE variable (line %d).\n"), line);
++ }
++ }
++#ifdef USE_LDAP_MAIL_LOOKUP
+ else if (!strcmp(var, "LDAP_MAIL")) {
+ if(strcasecmp(value, "true") == 0)
+ config->use_ldap_mail = 1;
+@@ -846,18 +858,6 @@ static int readconfigfile(const char *filename, struct configparams *config)
+ else
+ config->ldap_starttls = 0;
+ }
+- else if (!strcmp(var, "CC_BEFORE")) {
+- int num;
+- char unit[10];
+-
+- if (sscanf(value, "%d%s", &num, unit) != 2)
+- goto cc_parse_err;
+- if (str2timeunits(num, unit, &config->cc_before) < 0) {
+-cc_parse_err:
+- die(1, _("Cannot parse time at CC_BEFORE variable (line %d).\n"), line);
+- }
+- }
+-#ifdef USE_LDAP_MAIL_LOOKUP
+ else if (!strcmp(var, "LDAP_HOST"))
+ sstrncpy(config->ldap_host, value, CNF_BUFFER);
+ else if (!strcmp(var, "LDAP_PORT"))
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota/fcntl.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/fcntl.patch
new file mode 100644
index 000000000..27e60fd07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/fcntl.patch
@@ -0,0 +1,113 @@
+Include fcntl.h to pacify compiler errors on musl
+like
+
+error: unknown type name 'loff_t'
+Cover rpc headers under proper conditional
+Dont use __P its undefined
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ndex: quota-tools/quota.h
+===================================================================
+Index: quota-tools/quota.h
+===================================================================
+--- quota-tools.orig/quota.h
++++ quota-tools/quota.h
+@@ -165,6 +165,6 @@ enum {
+ #endif
+ #endif
+
+-long quotactl __P((int, const char *, qid_t, caddr_t));
++long quotactl (int, const char *, qid_t, caddr_t);
+
+ #endif /* _QUOTA_ */
+Index: quota-tools/quotacheck.c
+===================================================================
+--- quota-tools.orig/quotacheck.c
++++ quota-tools/quotacheck.c
+@@ -19,6 +19,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <errno.h>
++#include <fcntl.h>
+
+ #include <sys/stat.h>
+ #include <sys/types.h>
+Index: quota-tools/quotaio.c
+===================================================================
+--- quota-tools.orig/quotaio.c
++++ quota-tools/quotaio.c
+@@ -12,6 +12,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+Index: quota-tools/dqblk_v2.h
+===================================================================
+--- quota-tools.orig/dqblk_v2.h
++++ quota-tools/dqblk_v2.h
+@@ -7,6 +7,7 @@
+ #ifndef GUARD_DQBLK_V2_H
+ #define GUARD_DQBLK_V2_H
+
++#include <fcntl.h>
+ #include <sys/types.h>
+ #include "quota_tree.h"
+
+Index: quota-tools/quotaops.c
+===================================================================
+--- quota-tools.orig/quotaops.c
++++ quota-tools/quotaops.c
+@@ -34,7 +34,9 @@
+
+ #include "config.h"
+
++#if defined(RPC)
+ #include <rpc/rpc.h>
++#endif
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+Index: quota-tools/rquota_client.c
+===================================================================
+--- quota-tools.orig/rquota_client.c
++++ quota-tools/rquota_client.c
+@@ -19,7 +19,9 @@
+
+ #include "config.h"
+
++#if defined(RPC)
+ #include <rpc/rpc.h>
++#endif
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+@@ -35,7 +37,9 @@
+ #include <stdint.h>
+
+ #include "mntopt.h"
++#if defined(RPC)
+ #include "rquota.h"
++#endif
+ #include "common.h"
+ #include "quotaio.h"
+ #include "quotasys.h"
+Index: quota-tools/setquota.c
+===================================================================
+--- quota-tools.orig/setquota.c
++++ quota-tools/setquota.c
+@@ -7,7 +7,9 @@
+
+ #include "config.h"
+
++#if defined(RPC)
+ #include <rpc/rpc.h>
++#endif
+ #include <sys/types.h>
+ #include <errno.h>
+ #include <stdio.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch
new file mode 100644
index 000000000..06ff13cb9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/remove_non_posix_types.patch
@@ -0,0 +1,198 @@
+Use proper C99 integer types
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: quota-tools/bylabel.c
+===================================================================
+--- quota-tools.orig/bylabel.c
++++ quota-tools/bylabel.c
+@@ -20,6 +20,7 @@
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include <stdint.h>
+
+ #include "bylabel.h"
+ #include "common.h"
+@@ -37,32 +38,32 @@ static struct uuidCache_s {
+
+ #define EXT2_SUPER_MAGIC 0xEF53
+ struct ext2_super_block {
+- u_char s_dummy1[56];
+- u_char s_magic[2];
+- u_char s_dummy2[46];
+- u_char s_uuid[16];
+- u_char s_volume_name[16];
++ uint8_t s_dummy1[56];
++ uint8_t s_magic[2];
++ uint8_t s_dummy2[46];
++ uint8_t s_uuid[16];
++ uint8_t s_volume_name[16];
+ };
+
+-#define ext2magic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8))
++#define ext2magic(s) ((uint32_t) s.s_magic[0] + (((uint32_t) s.s_magic[1]) << 8))
+
+ #define XFS_SUPER_MAGIC "XFSB"
+ #define XFS_SUPER_MAGIC2 "BSFX"
+ struct xfs_super_block {
+- u_char s_magic[4];
+- u_char s_dummy[28];
+- u_char s_uuid[16];
+- u_char s_dummy2[60];
+- u_char s_fsname[12];
++ uint8_t s_magic[4];
++ uint8_t s_dummy[28];
++ uint8_t s_uuid[16];
++ uint8_t s_dummy2[60];
++ uint8_t s_fsname[12];
+ };
+
+ #define REISER_SUPER_MAGIC "ReIsEr2Fs"
+ struct reiserfs_super_block {
+- u_char s_dummy1[52];
+- u_char s_magic[10];
+- u_char s_dummy2[22];
+- u_char s_uuid[16];
+- u_char s_volume_name[16];
++ uint8_t s_dummy1[52];
++ uint8_t s_magic[10];
++ uint8_t s_dummy2[22];
++ uint8_t s_uuid[16];
++ uint8_t s_volume_name[16];
+ };
+
+ static inline unsigned short swapped(unsigned short a)
+@@ -222,7 +223,7 @@ static char *get_spec_by_x(int n, const
+ return NULL;
+ }
+
+-static u_char fromhex(char c)
++static uint8_t fromhex(char c)
+ {
+ if (isdigit(c))
+ return (c - '0');
+@@ -234,7 +235,7 @@ static u_char fromhex(char c)
+
+ static char *get_spec_by_uuid(const char *s)
+ {
+- u_char uuid[16];
++ uint8_t uuid[16];
+ int i;
+
+ if (strlen(s) != 36 || s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-')
+Index: quota-tools/quot.c
+===================================================================
+--- quota-tools.orig/quot.c
++++ quota-tools/quot.c
+@@ -47,6 +47,7 @@
+ #include <utmp.h>
+ #include <pwd.h>
+ #include <grp.h>
++#include <stdint.h>
+
+ #include "pot.h"
+ #include "quot.h"
+@@ -56,8 +57,8 @@
+ #include "quotasys.h"
+
+ #define TSIZE 500
+-static __uint64_t sizes[TSIZE];
+-static __uint64_t overflow;
++static uint64_t sizes[TSIZE];
++static uint64_t overflow;
+
+ static int aflag;
+ static int cflag;
+@@ -72,7 +73,7 @@ static time_t now;
+ char *progname;
+
+ static void mounttable(void);
+-static char *idname(__uint32_t, int);
++static char *idname(uint32_t, int);
+ static void report(const char *, const char *, int);
+ static void creport(const char *, const char *);
+
+@@ -173,7 +174,7 @@ static int qcmp(du_t * p1, du_t * p2)
+ static void creport(const char *file, const char *fsdir)
+ {
+ int i;
+- __uint64_t t = 0;
++ uint64_t t = 0;
+
+ printf(_("%s (%s):\n"), file, fsdir);
+ for (i = 0; i < TSIZE - 1; i++)
+@@ -219,7 +220,7 @@ static void report(const char *file, con
+ }
+ }
+
+-static idcache_t *getnextent(int type, __uint32_t id, int byid)
++static idcache_t *getnextent(int type, uint32_t id, int byid)
+ {
+ struct passwd *pw;
+ struct group *gr;
+@@ -240,7 +241,7 @@ static idcache_t *getnextent(int type, _
+ return &idc;
+ }
+
+-static char *idname(__uint32_t id, int type)
++static char *idname(uint32_t id, int type)
+ {
+ idcache_t *ncp, *idp;
+ static idcache_t nc[2][NID];
+@@ -286,8 +287,8 @@ static void acctXFS(xfs_bstat_t *p)
+ {
+ register du_t *dp;
+ du_t **hp;
+- __uint64_t size;
+- __uint32_t i, id;
++ uint64_t size;
++ uint32_t i, id;
+
+ if ((p->bs_mode & S_IFMT) == 0)
+ return;
+Index: quota-tools/quot.h
+===================================================================
+--- quota-tools.orig/quot.h
++++ quota-tools/quot.h
+@@ -35,18 +35,18 @@
+ #define SEC24HR (60*60*24) /* seconds per day */
+
+ typedef struct {
+- __uint32_t id;
++ uint32_t id;
+ char name[UT_NAMESIZE + 1];
+ } idcache_t;
+
+ typedef struct du {
+ struct du *next;
+- __uint64_t blocks;
+- __uint64_t blocks30;
+- __uint64_t blocks60;
+- __uint64_t blocks90;
+- __uint64_t nfiles;
+- __uint32_t id;
++ uint64_t blocks;
++ uint64_t blocks30;
++ uint64_t blocks60;
++ uint64_t blocks90;
++ uint64_t nfiles;
++ uint32_t id;
+ } du_t;
+
+ #define NDU 60000
+Index: quota-tools/rquota_server.c
+===================================================================
+--- quota-tools.orig/rquota_server.c
++++ quota-tools/rquota_server.c
+@@ -60,7 +60,7 @@ extern char nfs_pseudoroot[PATH_MAX];
+ */
+ extern struct authunix_parms *unix_cred;
+
+-int in_group(gid_t * gids, u_int len, gid_t gid)
++int in_group(gid_t * gids, uint32_t len, gid_t gid)
+ {
+ gid_t *gidsp = gids + len;
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch
new file mode 100644
index 000000000..9ca2ffc0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch
@@ -0,0 +1,20 @@
+Replace getrpcbynumber_r with getrpcbynumber
+musl and uclibc dont implement it
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: quota-tools/svc_socket.c
+===================================================================
+--- quota-tools.orig/svc_socket.c
++++ quota-tools/svc_socket.c
+@@ -55,7 +55,8 @@ static int svc_socket (u_long number, in
+ addr.sin_family = AF_INET;
+
+ if (!port) {
+- ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof(rpcdata), &rpcp);
++ rpcp = getrpcbynumber(number);
++ ret = 0;
+ if (ret == 0 && rpcp != NULL) {
+ /* First try name */
+ ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata,
diff --git a/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb b/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb
new file mode 100644
index 000000000..4a980464b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/quota/quota_4.03.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Tools for monitoring & limiting user disk usage per filesystem"
+SECTION = "base"
+HOMEPAGE = "http://sourceforge.net/projects/linuxquota/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=18136&atid=118136"
+LICENSE = "BSD & GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://quota.c;beginline=1;endline=33;md5=331c7d77744bfe0ad24027f0651028ec \
+ file://rquota_server.c;beginline=1;endline=20;md5=fe7e0d7e11c6f820f8fa62a5af71230f \
+ file://svc_socket.c;beginline=1;endline=17;md5=24d5a8792da45910786eeac750be8ceb"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV}.tar.gz \
+ file://0001-Fix-build-with-disabled-ldap.patch \
+ file://0001-Do-not-accidentaly-override-commandline-passed-CFLAG.patch \
+ file://fcntl.patch \
+ file://remove_non_posix_types.patch \
+ "
+SRC_URI_append_libc-musl = " file://replace_getrpcbynumber_r.patch"
+
+SRC_URI[md5sum] = "6b09f9c93515c25a528be5754cdfb6f5"
+SRC_URI[sha256sum] = "9c6c4d9ae7bf30506dd2aa3d8056c4ff2f8d087930d7c721616f5c093bdc674b"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/linuxquota/files/quota-tools/"
+UPSTREAM_CHECK_REGEX = "/quota-tools/(?P<pver>(\d+[\.\-_]*)+)/"
+
+DEPENDS = "gettext-native e2fsprogs libnl dbus"
+
+inherit autotools-brokensep gettext pkgconfig
+
+CFLAGS += "-I${STAGING_INCDIR}/tirpc"
+LDFLAGS += "-ltirpc"
+ASNEEDED = ""
+
+PACKAGECONFIG ??= "tcp-wrappers rpc bsd"
+PACKAGECONFIG_libc-musl = "tcp-wrappers rpc"
+
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+PACKAGECONFIG[rpc] = "--enable-rpc,--disable-rpc,libtirpc"
+PACKAGECONFIG[bsd] = "--enable-bsd_behaviour=yes,--enable-bsd_behaviour=no,"
+PACKAGECONFIG[ldapmail] = "--enable-ldapmail,--disable-ldapmail,openldap"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
new file mode 100644
index 000000000..eeef9f152
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
@@ -0,0 +1,221 @@
+From 2a44d862233f2126581e290d568e1c8b8f2eb9f5 Mon Sep 17 00:00:00 2001
+From: Carlo Landmeter <clandmeter@gmail.com>
+Date: Thu, 19 Feb 2015 15:28:45 +0000
+Subject: [PATCH] Avoid use of glibc sys/cdefs.h header
+
+Upstream-Status: Pending
+---
+ src/check_bound.c | 2 +-
+ src/pmap_svc.c | 10 +++++-----
+ src/rpcb_svc.c | 10 +++++-----
+ src/rpcb_svc_4.c | 14 +++++++-------
+ src/rpcb_svc_com.c | 46 +++++++++++++++++++++++-----------------------
+ src/rpcbind.c | 12 ++++++------
+ src/util.c | 2 +-
+ src/warmstart.c | 4 ++--
+ 8 files changed, 50 insertions(+), 50 deletions(-)
+
+diff --git a/src/check_bound.c b/src/check_bound.c
+index c70b845..5d21730 100644
+--- a/src/check_bound.c
++++ b/src/check_bound.c
+@@ -70,7 +70,7 @@ static struct fdlist *fdhead; /* Link list of the check fd's */
+ static struct fdlist *fdtail;
+ static char *nullstring = "";
+
+-static bool_t check_bound __P((struct fdlist *, char *uaddr));
++static bool_t check_bound (struct fdlist *, char *uaddr);
+
+ /*
+ * Returns 1 if the given address is bound for the given addr & transport
+diff --git a/src/pmap_svc.c b/src/pmap_svc.c
+index ad28b93..9c7d409 100644
+--- a/src/pmap_svc.c
++++ b/src/pmap_svc.c
+@@ -60,11 +60,11 @@ static char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro";
+ #include "rpcbind.h"
+ #include "xlog.h"
+ #include <rpc/svc_soc.h> /* svc_getcaller routine definition */
+-static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t,
+- rpcprot_t));
+-static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long));
+-static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *));
+-static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *));
++static struct pmaplist *find_service_pmap (rpcprog_t, rpcvers_t,
++ rpcprot_t);
++static bool_t pmapproc_change (struct svc_req *, SVCXPRT *, u_long);
++static bool_t pmapproc_getport (struct svc_req *, SVCXPRT *);
++static bool_t pmapproc_dump (struct svc_req *, SVCXPRT *);
+
+ /*
+ * Called for all the version 2 inquiries.
+diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
+index bd92201..6c7f7fe 100644
+--- a/src/rpcb_svc.c
++++ b/src/rpcb_svc.c
+@@ -53,10 +53,10 @@
+ #include "rpcbind.h"
+ #include "xlog.h"
+
+-static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *,
+- rpcvers_t));
+-static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *,
+- rpcvers_t));
++static void *rpcbproc_getaddr_3_local (void *, struct svc_req *, SVCXPRT *,
++ rpcvers_t);
++static void *rpcbproc_dump_3_local (void *, struct svc_req *, SVCXPRT *,
++ rpcvers_t);
+
+ /*
+ * Called by svc_getreqset. There is a separate server handle for
+@@ -75,7 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
+ } argument;
+ char *result;
+ xdrproc_t xdr_argument, xdr_result;
+- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++ void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ rpcprog_t setprog = 0;
+
+ rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc);
+diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
+index b673452..6764c0a 100644
+--- a/src/rpcb_svc_4.c
++++ b/src/rpcb_svc_4.c
+@@ -54,13 +54,13 @@
+ #include "rpcbind.h"
+ #include "xlog.h"
+
+-static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *,
+- rpcvers_t));
+-static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++static void *rpcbproc_getaddr_4_local (void *, struct svc_req *, SVCXPRT *,
++ rpcvers_t);
++static void *rpcbproc_getversaddr_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ static void *rpcbproc_getaddrlist_4_local
+- __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
+-static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *));
+-static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++ (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
++static void free_rpcb_entry_list (rpcb_entry_list_ptr *);
++static void *rpcbproc_dump_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+
+ /*
+ * Called by svc_getreqset. There is a separate server handle for
+@@ -78,7 +78,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
+ } argument;
+ char *result;
+ xdrproc_t xdr_argument, xdr_result;
+- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++ void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ rpcprog_t setprog = 0;
+
+ rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc);
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index ff9ce6b..8aef9e5 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -100,29 +100,29 @@ struct finfo {
+ static struct finfo FINFO[NFORWARD];
+
+
+-static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *));
+-static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *));
+-static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *));
+-static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *));
+-static int find_rmtcallfd_by_netid __P((char *));
+-static SVCXPRT *find_rmtcallxprt_by_fd __P((int));
+-static int forward_register __P((u_int32_t, struct netbuf *, int, char *,
+- rpcproc_t, rpcvers_t, u_int32_t *));
+-static struct finfo *forward_find __P((u_int32_t));
+-static int free_slot_by_xid __P((u_int32_t));
+-static int free_slot_by_index __P((int));
+-static int netbufcmp __P((struct netbuf *, struct netbuf *));
+-static struct netbuf *netbufdup __P((struct netbuf *));
+-static void netbuffree __P((struct netbuf *));
+-static int check_rmtcalls __P((struct pollfd *, int));
+-static void xprt_set_caller __P((SVCXPRT *, struct finfo *));
+-static void send_svcsyserr __P((SVCXPRT *, struct finfo *));
+-static void handle_reply __P((int, SVCXPRT *));
+-static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *));
+-static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *));
+-static char *getowner __P((SVCXPRT *, char *, size_t));
+-static int add_pmaplist __P((RPCB *));
+-static int del_pmaplist __P((RPCB *));
++static bool_t xdr_encap_parms (XDR *, struct encap_parms *);
++static bool_t xdr_rmtcall_args (XDR *, struct r_rmtcall_args *);
++static bool_t xdr_rmtcall_result (XDR *, struct r_rmtcall_args *);
++static bool_t xdr_opaque_parms (XDR *, struct r_rmtcall_args *);
++static int find_rmtcallfd_by_netid (char *);
++static SVCXPRT *find_rmtcallxprt_by_fd (int);
++static int forward_register (u_int32_t, struct netbuf *, int, char *,
++ rpcproc_t, rpcvers_t, u_int32_t *);
++static struct finfo *forward_find (u_int32_t);
++static int free_slot_by_xid (u_int32_t);
++static int free_slot_by_index (int);
++static int netbufcmp (struct netbuf *, struct netbuf *);
++static struct netbuf *netbufdup (struct netbuf *);
++static void netbuffree (struct netbuf *);
++static int check_rmtcalls (struct pollfd *, int);
++static void xprt_set_caller (SVCXPRT *, struct finfo *);
++static void send_svcsyserr (SVCXPRT *, struct finfo *);
++static void handle_reply (int, SVCXPRT *);
++static void find_versions (rpcprog_t, char *, rpcvers_t *, rpcvers_t *);
++static rpcblist_ptr find_service (rpcprog_t, rpcvers_t, char *);
++static char *getowner (SVCXPRT *, char *, size_t);
++static int add_pmaplist (RPCB *);
++static int del_pmaplist (RPCB *);
+
+ /*
+ * Set a mapping of program, version, netid
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index 045daa1..137011b 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -135,13 +135,13 @@ char *tcp_uaddr; /* Universal TCP address */
+ static char servname[] = "rpcbind";
+ static char superuser[] = "superuser";
+
+-int main __P((int, char *[]));
++int main (int, char *[]);
+
+-static int init_transport __P((struct netconfig *));
+-static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *,
+- struct netbuf *));
+-static void terminate __P((int));
+-static void parseargs __P((int, char *[]));
++static int init_transport (struct netconfig *);
++static void rbllist_add (rpcprog_t, rpcvers_t, struct netconfig *,
++ struct netbuf *);
++static void terminate (int);
++static void parseargs (int, char *[]);
+
+ int
+ main(int argc, char *argv[])
+diff --git a/src/util.c b/src/util.c
+index a6c835b..33b9e4f 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -70,7 +70,7 @@ static struct sockaddr_in *local_in4;
+ static struct sockaddr_in6 *local_in6;
+ #endif
+
+-static int bitmaskcmp __P((void *, void *, void *, int));
++static int bitmaskcmp (void *, void *, void *, int);
+
+ /*
+ * For all bits set in "mask", compare the corresponding bits in
+diff --git a/src/warmstart.c b/src/warmstart.c
+index b6eb73e..42dd3af 100644
+--- a/src/warmstart.c
++++ b/src/warmstart.c
+@@ -58,8 +58,8 @@
+ #define PMAPFILE RPCBIND_STATEDIR "/portmap.xdr"
+ #endif
+
+-static bool_t write_struct __P((char *, xdrproc_t, void *));
+-static bool_t read_struct __P((char *, xdrproc_t, void *));
++static bool_t write_struct (char *, xdrproc_t, void *);
++static bool_t read_struct (char *, xdrproc_t, void *);
+
+ static bool_t
+ write_struct(char *filename, xdrproc_t structproc, void *list)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch
new file mode 100644
index 000000000..16b763ef0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch
@@ -0,0 +1,43 @@
+From 9194122389f2a56b1cd1f935e64307e2e963c2da Mon Sep 17 00:00:00 2001
+From: Steve Dickson <steved@redhat.com>
+Date: Mon, 2 Nov 2015 17:05:18 -0500
+Subject: [PATCH] handle_reply: Don't use the xp_auth pointer directly
+
+In the latest libtirpc version to access the xp_auth
+one must use the SVC_XP_AUTH macro. To be backwards
+compatible a couple ifdefs were added to use the
+macro when it exists.
+
+Upstream-Status: Backport
+
+Signed-off-by: Steve Dickson <steved@redhat.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ src/rpcb_svc_com.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index 4ae93f1..22d6c84 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -1295,10 +1295,17 @@ handle_reply(int fd, SVCXPRT *xprt)
+ a.rmt_localvers = fi->versnum;
+
+ xprt_set_caller(xprt, fi);
++#if defined(SVC_XP_AUTH)
++ SVC_XP_AUTH(xprt) = svc_auth_none;
++#else
+ xprt->xp_auth = &svc_auth_none;
++#endif
+ svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a);
++#if !defined(SVC_XP_AUTH)
+ SVCAUTH_DESTROY(xprt->xp_auth);
+ xprt->xp_auth = NULL;
++#endif
++
+ done:
+ if (buffer)
+ free(buffer);
+--
+2.4.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch
new file mode 100644
index 000000000..741a99035
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/cve-2015-7236.patch
@@ -0,0 +1,84 @@
+commit 06f7ebb1dade2f0dbf872ea2bedf17cff4734bdd
+Author: Olaf Kirch <okir@...e.de>
+Date: Thu Aug 6 16:27:20 2015 +0200
+
+ Fix memory corruption in PMAP_CALLIT code
+
+ - A PMAP_CALLIT call comes in on IPv4 UDP
+ - rpcbind duplicates the caller's address to a netbuf and stores it in
+ FINFO[0].caller_addr. caller_addr->buf now points to a memory region A
+ with a size of 16 bytes
+ - rpcbind forwards the call to the local service, receives a reply
+ - when processing the reply, it does this in xprt_set_caller:
+ xprt->xp_rtaddr = *FINFO[0].caller_addr
+ It sends out the reply, and then frees the netbuf caller_addr and
+ caller_addr.buf.
+ However, it does not clear xp_rtaddr, so xp_rtaddr.buf now refers
+ to memory region A, which is free.
+ - When the next call comes in on the UDP/IPv4 socket, svc_dg_recv will
+ be called, which will set xp_rtaddr to the client's address.
+ It will reuse the buffer inside xp_rtaddr, ie it will write a
+ sockaddr_in to region A
+
+ Some time down the road, an incoming TCP connection is accepted,
+ allocating a fresh SVCXPRT. The memory region A is inside the
+ new SVCXPRT
+
+ - While processing the TCP call, another UDP call comes in, again
+ overwriting region A with the client's address
+ - TCP client closes connection. In svc_destroy, we now trip over
+ the garbage left in region A
+
+ We ran into the case where a commercial scanner was triggering
+ occasional rpcbind segfaults. The core file that was captured showed
+ a corrupted xprt->xp_netid pointer that was really a sockaddr_in.
+
+ Signed-off-by: Olaf Kirch <okir@...e.de>
+
+ Upstream-Status: Backport
+ CVE: CVE-2015-7236
+
+ Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ src/rpcb_svc_com.c | 23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
+
+Index: rpcbind-0.1.6+git20080930/src/rpcb_svc_com.c
+===================================================================
+--- rpcbind-0.1.6+git20080930.orig/src/rpcb_svc_com.c
++++ rpcbind-0.1.6+git20080930/src/rpcb_svc_com.c
+@@ -1298,12 +1298,33 @@ check_rmtcalls(struct pollfd *pfds, int
+ return (ncallbacks_found);
+ }
+
++/*
++ * This is really a helper function defined in libtirpc, but unfortunately, it hasn't
++ * been exported yet.
++ */
++static struct netbuf *
++__rpc_set_netbuf(struct netbuf *nb, const void *ptr, size_t len)
++{
++ if (nb->len != len) {
++ if (nb->len)
++ mem_free(nb->buf, nb->len);
++ nb->buf = mem_alloc(len);
++ if (nb->buf == NULL)
++ return NULL;
++
++ nb->maxlen = nb->len = len;
++ }
++ memcpy(nb->buf, ptr, len);
++ return nb;
++}
++
+ static void
+ xprt_set_caller(SVCXPRT *xprt, struct finfo *fi)
+ {
++ const struct netbuf *caller = fi->caller_addr;
+ u_int32_t *xidp;
+
+- *(svc_getrpccaller(xprt)) = *(fi->caller_addr);
++ __rpc_set_netbuf(svc_getrpccaller(xprt), caller->buf, caller->len);
+ xidp = __rpcb_get_dg_xidp(xprt);
+ *xidp = fi->caller_xid;
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/init.d b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/init.d
new file mode 100644
index 000000000..67499aa82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/init.d
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# start/stop rpcbind daemon.
+
+### BEGIN INIT INFO
+# Provides: rpcbind
+# Required-Start: $network
+# Required-Stop: $network
+# Default-Start: S 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: RPC portmapper replacement
+# Description: rpcbind is a server that converts RPC (Remote
+# Procedure Call) program numbers into DARPA
+# protocol port numbers. It must be running in
+# order to make RPC calls. Services that use
+# RPC include NFS and NIS.
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+test -f /sbin/rpcbind || exit 0
+
+OPTIONS=""
+if [ -f /etc/default/rpcbind ]
+then
+ . /etc/default/rpcbind
+elif [ -f /etc/rpcbind.conf ]
+then
+ . /etc/rpcbind.conf
+fi
+
+start ()
+{
+ echo -n "Starting rpcbind daemon..."
+ if pidof /sbin/rpcbind >/dev/null; then
+ echo "already running."
+ exit 0
+ fi
+ start-stop-daemon --start --quiet --exec /sbin/rpcbind -- "$@"
+ if [ $? -eq 0 ]; then
+ echo "done."
+ else
+ echo "failed."
+ fi
+}
+
+stop ()
+{
+ echo "Stopping rpcbind daemon..."
+ if ! pidof /sbin/rpcbind >/dev/null; then
+ echo "not running."
+ return 0
+ fi
+ start-stop-daemon --stop --quiet --exec /sbin/rpcbind
+ if [ $? -eq 0 ]; then
+ echo "done."
+ else
+ echo "failed."
+ fi
+}
+
+case "$1" in
+ start)
+ start $OPTIONS
+ ;;
+ stop)
+ stop
+ ;;
+ force-reload)
+ stop
+ start $OPTIONS
+ ;;
+ restart)
+ stop
+ start $OPTIONS
+ ;;
+ status)
+ status /sbin/rpcbind
+ ;;
+ *)
+ echo "Usage: /etc/init.d/rpcbind {start|stop|force-reload|restart|status}"
+ exit 1
+ ;;
+esac
+
+exit $?
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
new file mode 100644
index 000000000..6fbc6364c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
@@ -0,0 +1,30 @@
+The musl implementation of getaddrinfo and getservbyname does not
+aliases. As a workaround we use "sunprc" instead of "portmapper"
+
+ported from alpine linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: rpcbind-0.2.2/src/rpcbind.c
+===================================================================
+--- rpcbind-0.2.2.orig/src/rpcbind.c
++++ rpcbind-0.2.2/src/rpcbind.c
+@@ -491,7 +491,7 @@ init_transport(struct netconfig *nconf)
+ if ((aicode = getaddrinfo(hosts[nhostsbak],
+ servname, &hints, &res)) != 0) {
+ if ((aicode = getaddrinfo(hosts[nhostsbak],
+- "portmapper", &hints, &res)) != 0) {
++ "sunrpc", &hints, &res)) != 0) {
+ syslog(LOG_ERR,
+ "cannot get local address for %s: %s",
+ nconf->nc_netid, gai_strerror(aicode));
+@@ -564,7 +564,7 @@ init_transport(struct netconfig *nconf)
+ if ((strcmp(nconf->nc_netid, "local") != 0) &&
+ (strcmp(nconf->nc_netid, "unix") != 0)) {
+ if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) {
+- if ((aicode = getaddrinfo(NULL, "portmapper", &hints, &res))!= 0) {
++ if ((aicode = getaddrinfo(NULL, "sunrpc", &hints, &res))!= 0) {
+ printf("cannot get local address for %s: %s", nconf->nc_netid, gai_strerror(aicode));
+ syslog(LOG_ERR,
+ "cannot get local address for %s: %s",
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch
new file mode 100644
index 000000000..84fc974fd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch
@@ -0,0 +1,22 @@
+musl does not provide this header and here is reasoning
+http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_sys.2Fqueue.h_not_included_.3F
+
+So include it only when __GLIBC__ is defined which is true for uclibc and glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: rpcbind-0.2.2/src/util.c
+===================================================================
+--- rpcbind-0.2.2.orig/src/util.c
++++ rpcbind-0.2.2/src/util.c
+@@ -41,7 +41,9 @@
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#ifdef __GLIBC__
+ #include <sys/queue.h>
++#endif
+ #include <net/if.h>
+ #include <netinet/in.h>
+ #include <ifaddrs.h>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf
new file mode 100644
index 000000000..2a4dfbcfb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf
@@ -0,0 +1,3 @@
+# Optional arguments passed to rpcbind.
+#
+RPCBIND_OPTS=""
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
new file mode 100644
index 000000000..9cdade495
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=RPC Bind Service
+Requires=rpcbind.socket
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf
+ExecStart=@SBINDIR@/rpcbind $RPCBIND_OPTS
+SuccessExitStatus=2
+
+[Install]
+Also=rpcbind.socket
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
new file mode 100644
index 000000000..d63c1d972
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=RPCbind Server Activation Socket
+
+[Socket]
+ListenStream=/var/run/rpcbind.sock
+
+[Install]
+WantedBy=sockets.target
diff --git a/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb
new file mode 100644
index 000000000..c19a1976a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb
@@ -0,0 +1,73 @@
+SUMMARY = "Universal Addresses to RPC Program Number Mapper"
+DESCRIPTION = "The rpcbind utility is a server that converts RPC \
+ program numbers into universal addresses."
+SECTION = "console/network"
+HOMEPAGE = "http://sourceforge.net/projects/rpcbind/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=201237&atid=976751"
+DEPENDS = "libtirpc quota"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \
+ file://src/rpcinfo.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
+ file://init.d \
+ file://0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch \
+ file://remove-sys-queue.patch \
+ file://0001-handle_reply-Don-t-use-the-xp_auth-pointer-directly.patch \
+ ${UCLIBCPATCHES} \
+ ${MUSLPATCHES} \
+ file://rpcbind.conf \
+ file://rpcbind.socket \
+ file://rpcbind.service \
+ file://cve-2015-7236.patch \
+ "
+MUSLPATCHES_libc-musl = "file://musl-sunrpc.patch"
+
+UCLIBCPATCHES ?= ""
+MUSLPATCHES ?= ""
+
+SRC_URI[md5sum] = "c8875246b2688a1adfbd6ad43480278d"
+SRC_URI[sha256sum] = "9897823a9d820ea011d9ea02054d5ab99469b9ca5346265fee380713c8fed27b"
+
+inherit autotools update-rc.d systemd pkgconfig
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+
+INITSCRIPT_NAME = "rpcbind"
+INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ."
+
+SYSTEMD_SERVICE_${PN} = "rpcbind.service"
+
+inherit useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --home-dir / \
+ --shell /bin/false --user-group rpc"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, \
+ --without-systemdsystemunitdir, \
+ systemd \
+"
+
+EXTRA_OECONF += " --enable-warmstarts --with-rpcuser=rpc"
+
+do_install_append () {
+ mv ${D}${bindir} ${D}${sbindir}
+
+ install -d ${D}${sysconfdir}/init.d
+ sed -e 's,/etc/,${sysconfdir}/,g' \
+ -e 's,/sbin/,${sbindir}/,g' \
+ ${WORKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind
+ chmod 0755 ${D}${sysconfdir}/init.d/rpcbind
+
+ install -m 0755 ${WORKDIR}/rpcbind.conf ${D}${sysconfdir}
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/rpcbind.socket ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/rpcbind.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ ${D}${systemd_unitdir}/system/rpcbind.service
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-Fix-stack-overflow-due-to-too-deep-recursion.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-Fix-stack-overflow-due-to-too-deep-recursion.patch
new file mode 100644
index 000000000..4ac820fde
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-Fix-stack-overflow-due-to-too-deep-recursion.patch
@@ -0,0 +1,58 @@
+Bug: 45713
+
+How to reproduce:
+Run this command inside screen
+$ printf '\x1b[10000000T'
+
+screen will recursively call MScrollV to depth n/256.
+This is time consuming and will overflow stack if n is huge.
+
+Fixes CVE-2015-6806
+
+Upstream-Status: Backport
+CVE: CVE-2015-6806
+
+Signed-off-by: Kuang-che Wu <kcwu@csie.org>
+Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+diff -Naur screen-4.3.1-orig/ansi.c screen-4.3.1/ansi.c
+--- screen-4.3.1-orig/ansi.c 2015-06-29 00:22:55.000000000 +0300
++++ screen-4.3.1/ansi.c 2015-10-06 13:13:58.297648039 +0300
+@@ -2502,13 +2502,13 @@
+ return;
+ if (n > 0)
+ {
++ if (ye - ys + 1 < n)
++ n = ye - ys + 1;
+ if (n > 256)
+ {
+ MScrollV(p, n - 256, ys, ye, bce);
+ n = 256;
+ }
+- if (ye - ys + 1 < n)
+- n = ye - ys + 1;
+ #ifdef COPY_PASTE
+ if (compacthist)
+ {
+@@ -2562,15 +2562,15 @@
+ }
+ else
+ {
+- if (n < -256)
+- {
+- MScrollV(p, n + 256, ys, ye, bce);
+- n = -256;
+- }
+ n = -n;
+ if (ye - ys + 1 < n)
+ n = ye - ys + 1;
+
++ if (n > 256)
++ {
++ MScrollV(p, - (n - 256), ys, ye, bce);
++ n = 256;
++ }
+ ml = p->w_mlines + ye;
+ /* Clear lines */
+ for (i = ye; i > ye - n; i--, ml--)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch
new file mode 100644
index 000000000..40ecef00b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch
@@ -0,0 +1,58 @@
+Upstream-Status: Backport
+
+Backport patch to fix parallel build failure and update context to make patch
+coulde be applied.
+
+http://git.savannah.gnu.org/cgit/screen.git/commit?id=c0de6dd
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From c0de6dd7970b2c7b426a5c39dcbc31c2bef87232 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= <amade@asmblr.net>
+Date: Thu, 2 Jan 2014 18:18:06 +0100
+Subject: [PATCH] fix for multijob build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+make sure that comm.sh script generates comm.h header before doing
+anything else
+
+Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
+---
+ Makefile.in | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index ce86cbc..dea16d8 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -298,7 +298,7 @@ search.o: layout.h viewport.h canvas.h search.c config.h screen.h os.h osdef.h a
+ comm.h layer.h term.h image.h display.h window.h mark.h extern.h
+ tty.o: layout.h viewport.h canvas.h tty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
+ layer.h term.h image.h display.h window.h extern.h
+-term.o: layout.h viewport.h canvas.h term.c term.h
++term.o: layout.h viewport.h canvas.h term.c term.h comm.h
+ window.o: layout.h viewport.h canvas.h window.c config.h screen.h os.h osdef.h ansi.h acls.h \
+ comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
+ utmp.o: layout.h viewport.h canvas.h utmp.c config.h screen.h os.h osdef.h ansi.h acls.h \
+@@ -324,7 +324,7 @@ canvas.o: layout.h viewport.h canvas.h canvas.c config.h screen.h os.h osdef.h a
+ comm.h layer.h term.h image.h display.h window.h extern.h \
+ braille.h
+ comm.o: layout.h viewport.h canvas.h comm.c config.h acls.h comm.h
+-kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h
++kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h comm.h
+ acls.o: layout.h viewport.h canvas.h acls.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
+ layer.h term.h image.h display.h window.h extern.h
+ braille.o: layout.h viewport.h canvas.h braille.c config.h screen.h os.h osdef.h ansi.h acls.h \
+@@ -350,7 +350,7 @@ layout.o: layout.h viewport.h canvas.h layout.c config.h screen.h os.h osdef.h a
+ viewport.o: layout.h viewport.h canvas.h viewport.c config.h screen.h os.h osdef.h ansi.h acls.h \
+ comm.h layer.h term.h image.h display.h window.h extern.h \
+ braille.h
+-list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h
+-list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h
+-list_window.o: list_generic.h list_window.c window.h layer.h screen.h osdef.h
++list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h comm.h
++list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h comm.h
++list_window.o: list_generic.h list_window.c window.h layer.h screen.h osdef.h comm.h
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch
new file mode 100644
index 000000000..b5d71cc1b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Backport
+
+Backport from:
+
+http://git.savannah.gnu.org/cgit/screen.git/commit/?id=39c5f1c
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 39c5f1c76f1fcef4b5958bf828a63f53426b6984 Mon Sep 17 00:00:00 2001
+From: Mike Gerwitz <mike@mikegerwitz.com>
+Date: Tue, 24 Dec 2013 22:16:31 -0500
+Subject: [PATCH] comm.h now depends on term.h
+
+---
+ src/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index e791e79..d4f7c0b 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -113,7 +113,7 @@ term.h: term.c term.sh
+
+ kmapdef.c: term.h
+
+-comm.h: comm.c comm.sh config.h
++comm.h: comm.c comm.sh config.h term.h
+ AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
+
+ docs:
+--
+2.4.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch
new file mode 100644
index 000000000..e184aa1f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch
@@ -0,0 +1,57 @@
+From 79afb676904653403145fda9e1a6a9d3ea1cb22a Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 11:10:32 +0300
+Subject: [PATCH 4/4] Avoid mis-identifying systems as SVR4
+
+Linux can be misdetected as SVR4 because it has
+libelf installed. This leads to linking with libelf, even though no
+symbols from that library were actually used, and to a workaround for
+a buggy getlogin() being enabled.
+
+It is not documented which exact SVR4 system had the bug that the
+workaround was added for, so all I could do is make an educated guess
+at the #defines its compiler would be likely to set.
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index dc928ae..65439ce 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -179,14 +179,24 @@ AC_EGREP_CPP(yes,
+ #endif
+ ], LIBS="$LIBS -lsocket -linet";seqptx=1)
+
++AC_CHECKING(SVR4)
++AC_EGREP_CPP(yes,
++[main () {
++#if defined(SVR4) || defined(__SVR4)
++ yes;
++#endif
++], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1)
++if test -n "$svr4" ; then
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lelf"
+ AC_CHECKING(SVR4)
+ AC_TRY_LINK([#include <utmpx.h>
+ ],,
+-[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
+-[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
++[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(BUGGYGETLOGIN),
++[AC_CHECK_HEADER(elf.h, AC_DEFINE(BUGGYGETLOGIN))])]
+ ,LIBS="$oldlibs")
++fi
++
+ AC_CHECK_HEADERS([stropts.h string.h strings.h])
+
+ AC_CHECKING(for Solaris 2.x)
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch
new file mode 100644
index 000000000..248bf087e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch
@@ -0,0 +1,137 @@
+From cd0f7f10a3fffbc60fe55eb200474d13fe1da65b Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 10:34:29 +0300
+Subject: [PATCH 2/4] Provide cross compile alternatives for AC_TRY_RUN
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 32 ++++++++++++++++++++------------
+ 1 file changed, 20 insertions(+), 12 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 27690a6..ce89f56 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -348,7 +348,8 @@ main()
+ exit(0);
+ }
+ ], AC_NOTE(- your fifos are usable) fifo=1,
+-AC_NOTE(- your fifos are not usable))
++AC_NOTE(- your fifos are not usable),
++AC_NOTE(- skipping check because we are cross compiling; assuming fifos are usable) fifo=1)
+ rm -f /tmp/conftest*
+
+ if test -n "$fifo"; then
+@@ -396,7 +397,8 @@ main()
+ exit(0);
+ }
+ ], AC_NOTE(- your implementation is ok),
+-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
++AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1,
++AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok))
+ rm -f /tmp/conftest*
+ fi
+
+@@ -458,7 +460,8 @@ main()
+ exit(0);
+ }
+ ], AC_NOTE(- your sockets are usable) sock=1,
+-AC_NOTE(- your sockets are not usable))
++AC_NOTE(- your sockets are not usable),
++AC_NOTE(- skipping check because we are cross compiling; assuming sockets are usable) sock=1)
+ rm -f /tmp/conftest*
+
+ if test -n "$sock"; then
+@@ -497,7 +500,8 @@ main()
+ }
+ ],AC_NOTE(- you are normal),
+ AC_NOTE(- unix domain sockets are not kept in the filesystem)
+-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
++AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1,
++AC_NOTE(- skipping check because we are cross compiling; assuming sockets are normal))
+ rm -f /tmp/conftest*
+ fi
+
+@@ -624,7 +628,8 @@ main()
+ exit(0);
+ }
+ ],AC_NOTE(- select is ok),
+-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
++AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN),
++AC_NOTE(- skipping check because we are cross compiling; assuming select is ok))
+
+ dnl
+ dnl **** termcap or terminfo ****
+@@ -666,7 +671,8 @@ main()
+ {
+ exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
+ }], AC_NOTE(- you use the termcap database),
+-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
++AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO),
++AC_NOTE(- skipping check because we are cross compiling; assuming terminfo database is used) AC_DEFINE(TERMINFO))
+ AC_CHECKING(ospeed)
+ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
+
+@@ -801,7 +807,8 @@ main()
+ else
+ AC_NOTE(- can't determine - assume ptys are world accessable)
+ fi
+- ]
++ ],
++ AC_NOTE(- skipping check because we are cross compiling; assuming ptys are world accessable)
+ )
+ rm -f conftest_grp
+ fi
+@@ -885,7 +892,7 @@ AC_EGREP_CPP(yes,
+ #endif
+ ], load=1)
+ fi
+-if test -z "$load" ; then
++if test -z "$load" && test "$cross_compiling" = no ; then
+ AC_CHECKING(for kernelfile)
+ for core in /unix /vmunix /dynix /hp-ux /xelos /dev/ksyms /kernel/unix /kernel/genunix /unicos /mach /netbsd /386bsd /dgux /bsd /stand/vmunix; do
+ if test -f $core || test -c $core; then
+@@ -1078,7 +1085,7 @@ main()
+ #endif
+ exit(0);
+ }
+-],,AC_DEFINE(SYSVSIGS))
++],,AC_DEFINE(SYSVSIGS),:)
+
+ fi
+
+@@ -1158,7 +1165,7 @@ main() {
+ if (strncmp(buf, "cdedef", 6))
+ exit(1);
+ exit(0); /* libc version works properly. */
+-}], AC_DEFINE(USEBCOPY))
++}], AC_DEFINE(USEBCOPY),,:)
+
+ AC_TRY_RUN([
+ #define bcopy(s,d,l) memmove(d,s,l)
+@@ -1173,7 +1180,8 @@ main() {
+ if (strncmp(buf, "cdedef", 6))
+ exit(1);
+ exit(0); /* libc version works properly. */
+-}], AC_DEFINE(USEMEMMOVE))
++}], AC_DEFINE(USEMEMMOVE),,
++ AC_NOTE(- skipping check because we are cross compiling; use memmove) AC_DEFINE(USEMEMMOVE))
+
+
+ AC_TRY_RUN([
+@@ -1189,7 +1197,7 @@ main() {
+ if (strncmp(buf, "cdedef", 6))
+ exit(1);
+ exit(0); /* libc version works properly. */
+-}], AC_DEFINE(USEMEMCPY))
++}], AC_DEFINE(USEMEMCPY),,:)
+
+ AC_SYS_LONG_FILE_NAMES
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch
new file mode 100644
index 000000000..cc62c12e0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch
@@ -0,0 +1,65 @@
+From 73b726c25f94c1b15514ed9249b927afdfbbfb94 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 10:30:40 +0300
+Subject: [PATCH 1/4] Remove redundant compiler sanity checks
+
+AC_PROG_CC already performs sanity checks. And unlike the removed
+checks, it does so in a way that supports cross compilation.
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 27 ---------------------------
+ 1 file changed, 27 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ffe2e37..27690a6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -48,31 +48,6 @@ AC_PROG_GCC_TRADITIONAL
+ AC_ISC_POSIX
+ AC_USE_SYSTEM_EXTENSIONS
+
+-AC_TRY_RUN(main(){exit(0);},,[
+-if test $CC != cc ; then
+-AC_NOTE(Your $CC failed - restarting with CC=cc)
+-AC_NOTE()
+-CC=cc
+-export CC
+-exec $0 $configure_args
+-fi
+-])
+-
+-AC_TRY_RUN(main(){exit(0);},,
+-exec 5>&2
+-eval $ac_link
+-AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
+-AC_NOTE($ac_compile)
+-AC_MSG_ERROR(Can't run the compiler - sorry))
+-
+-AC_TRY_RUN([
+-main()
+-{
+- int __something_strange_();
+- __something_strange_(0);
+-}
+-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
+-
+ AC_PROG_AWK
+
+ AC_PROG_INSTALL
+@@ -1300,8 +1275,6 @@ fi
+ dnl Ptx bug workaround -- insert -lc after -ltermcap
+ test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"
+
+-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
+-
+ ETCSCREENRC=
+ AC_MSG_CHECKING(for the global screenrc file)
+ AC_ARG_WITH(sys-screenrc, [ --with-sys-screenrc=path to the global screenrc file], [ ETCSCREENRC="${withval}" ])
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch
new file mode 100644
index 000000000..d7e55a445
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch
@@ -0,0 +1,135 @@
+From d0b20e4cacc60ad62a2150ce07388cb5a25c2040 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 11:09:01 +0300
+Subject: [PATCH 3/4] Skip host file system checks when cross-compiling
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ce89f56..dc928ae 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -85,7 +85,7 @@ AC_ARG_ENABLE(socket-dir,
+ dnl
+ dnl **** special unix variants ****
+ dnl
+-if test -n "$ISC"; then
++if test "$cross_compiling" = no && test -n "$ISC" ; then
+ AC_DEFINE(ISC) LIBS="$LIBS -linet"
+ fi
+
+@@ -96,10 +96,11 @@ dnl AC_DEFINE(OSF1) # this disables MIPS again....
+ dnl fi
+ dnl fi
+
+-if test -f /sysV68 ; then
++if test "$cross_compiling" = no && test -f /sysV68 ; then
+ AC_DEFINE(sysV68)
+ fi
+
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for MIPS)
+ if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
+ oldlibs="$LIBS"
+@@ -123,6 +124,7 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
+ ))
+ fi
+ fi
++fi
+
+
+ AC_CHECKING(for Ultrix)
+@@ -132,7 +134,7 @@ AC_EGREP_CPP(yes,
+ #endif
+ ], ULTRIX=1)
+
+-if test -f /usr/lib/libpyr.a ; then
++if test "$cross_compiling" = no && test -f /usr/lib/libpyr.a ; then
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lpyr"
+ AC_CHECKING(Pyramid OSX)
+@@ -679,17 +681,21 @@ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
+ dnl
+ dnl **** PTY specific things ****
+ dnl
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for /dev/ptc)
+ if test -r /dev/ptc; then
+ AC_DEFINE(HAVE_DEV_PTC)
+ fi
++fi
+
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for SVR4 ptys)
+ sysvr4ptys=
+ if test -c /dev/ptmx ; then
+ AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
+ sysvr4ptys=1])
+ fi
++fi
+
+ AC_CHECK_FUNCS(getpt)
+
+@@ -699,6 +705,7 @@ AC_CHECK_FUNCS(openpty,,
+ [AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])])
+ fi
+
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for ptyranges)
+ if test -d /dev/ptym ; then
+ pdir='/dev/ptym'
+@@ -722,6 +729,7 @@ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\
+ AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
+ AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
+ fi
++fi
+
+ dnl **** pty mode/group handling ****
+ dnl
+@@ -869,14 +877,16 @@ fi
+ dnl
+ dnl **** loadav ****
+ dnl
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for libutil(s))
+ test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
+ test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
++fi
+
+ AC_CHECKING(getloadavg)
+ AC_TRY_LINK(,[getloadavg((double *)0, 0);],
+ AC_DEFINE(LOADAV_GETLOADAVG) load=1,
+-if test -f /usr/lib/libkvm.a ; then
++if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
+ olibs="$LIBS"
+ LIBS="$LIBS -lkvm"
+ AC_CHECKING(getloadavg with -lkvm)
+@@ -1094,13 +1104,18 @@ dnl **** libraries ****
+ dnl
+
+ AC_CHECKING(for crypt and sec libraries)
++if test "$cross_compiling" = no ; then
+ test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
++fi
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lcrypt"
+ AC_CHECKING(crypt)
+ AC_TRY_LINK(,,,LIBS="$oldlibs")
++if test "$cross_compiling" = no ; then
+ test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
+ test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
++fi
++
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lsun"
+ AC_CHECKING(IRIX sun library)
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/fix-parallel-make.patch b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/fix-parallel-make.patch
new file mode 100644
index 000000000..e0caf5d83
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/fix-parallel-make.patch
@@ -0,0 +1,19 @@
+This fixes the parallel make install failure
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: screen-4.0.3/Makefile.in
+===================================================================
+--- screen-4.0.3.orig/Makefile.in
++++ screen-4.0.3/Makefile.in
+@@ -70,7 +70,7 @@ screen: $(OFILES)
+ .c.o:
+ $(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
+
+-install_bin: .version screen
++install_bin: .version screen installdirs
+ -if [ -f $(DESTDIR)$(bindir)/$(SCREEN) ] && [ ! -f $(DESTDIR)$(bindir)/$(SCREEN).old ]; \
+ then mv $(DESTDIR)$(bindir)/$(SCREEN) $(DESTDIR)$(bindir)/$(SCREEN).old; fi
+ $(INSTALL_PROGRAM) screen $(DESTDIR)$(bindir)/$(SCREEN)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen/screen.pam b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/screen.pam
new file mode 100644
index 000000000..ff657fa07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen/screen.pam
@@ -0,0 +1,2 @@
+#%PAM-1.0
+auth include common-auth
diff --git a/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.3.1.bb b/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.3.1.bb
new file mode 100644
index 000000000..00d878b2c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/screen/screen_4.3.1.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Multiplexing terminal manager"
+DESCRIPTION = "Screen is a full-screen window manager \
+that multiplexes a physical terminal between several \
+processes, typically interactive shells."
+HOMEPAGE = "http://www.gnu.org/software/screen/"
+BUGTRACKER = "https://savannah.gnu.org/bugs/?func=additem&group=screen"
+
+SECTION = "console/utils"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://screen.h;endline=26;md5=3971142989289a8198a544220703c2bf"
+
+DEPENDS = "ncurses \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} = "base-files"
+
+SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \
+ file://fix-parallel-make.patch \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://screen.pam', '', d)} \
+ file://Remove-redundant-compiler-sanity-checks.patch \
+ file://Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch \
+ file://Skip-host-file-system-checks-when-cross-compiling.patch \
+ file://Avoid-mis-identifying-systems-as-SVR4.patch \
+ file://0001-fix-for-multijob-build.patch \
+ file://0002-comm.h-now-depends-on-term.h.patch \
+ file://0001-Fix-stack-overflow-due-to-too-deep-recursion.patch \
+ "
+
+SRC_URI[md5sum] = "5bb3b0ff2674e29378c31ad3411170ad"
+SRC_URI[sha256sum] = "fa4049f8aee283de62e283d427f2cfd35d6c369b40f7f45f947dbfd915699d63"
+
+inherit autotools texinfo
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[utempter] = "ac_cv_header_utempter_h=yes,ac_cv_header_utempter_h=no,libutempter,"
+
+EXTRA_OECONF = "--with-pty-mode=0620 --with-pty-group=5 \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
+
+do_install_append () {
+ if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+ install -D -m 644 ${WORKDIR}/screen.pam ${D}/${sysconfdir}/pam.d/screen
+ fi
+}
+
+pkg_postinst_${PN} () {
+ grep -q "^${bindir}/screen$" $D${sysconfdir}/shells || echo ${bindir}/screen >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+ printf "$(grep -v "^${bindir}/screen$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars
new file mode 100644
index 000000000..8b09f53b0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/Makevars
@@ -0,0 +1,25 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
new file mode 100644
index 000000000..836551ea1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Change the getline return type to match its declaration.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -urN sed-4.1.2-orig/lib/getline.c sed-4.1.2/lib/getline.c
+--- sed-4.1.2-orig/lib/getline.c 2010-08-31 08:47:50.070094024 +0800
++++ sed-4.1.2/lib/getline.c 2010-08-31 08:48:50.982178172 +0800
+@@ -30,7 +30,7 @@
+ necessary. Returns the number of characters read (not including the
+ null terminator), or -1 on error or EOF. */
+
+-size_t
++ssize_t
+ getline (lineptr, n, stream)
+ char **lineptr;
+ size_t *n;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch
new file mode 100644
index 000000000..80594068a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+automake-1.12.x has deprecated use of @mkdir_p@, fix the issue by using @MKDIR_P@ instead.
+
+Avoid this build issue:
+| make[1]: mkdir_p@: Command not found
+| make[1]: *** [install-data-yes] Error 127
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/07/13
+
+Index: sed-4.1.2/intl/Makefile.in
+===================================================================
+--- sed-4.1.2.orig/intl/Makefile.in
++++ sed-4.1.2/intl/Makefile.in
+@@ -40,7 +40,7 @@ subdir = intl
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ mkinstalldirs = $(mkdir_p)
+-mkdir_p = @mkdir_p@
++mkdir_p = @MKDIR_P@
+
+ l = @INTL_LIBTOOL_SUFFIX_PREFIX@
+
+Index: sed-4.1.2/po/Makefile.in.in
+===================================================================
+--- sed-4.1.2.orig/po/Makefile.in.in
++++ sed-4.1.2/po/Makefile.in.in
+@@ -29,7 +29,7 @@ gettextsrcdir = $(datadir)/gettext/po
+ INSTALL = /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/bin/install -c
+ INSTALL_DATA = ${INSTALL} -m 644
+ mkinstalldirs = $(mkdir_p)
+-mkdir_p = @mkdir_p@
++mkdir_p = @MKDIR_P@
+
+ CC = i586-poky-linux-gcc -m32 -march=i586 --sysroot=/srv/home/nitin/builds2/build0/tmp/sysroots/qemux86
+ GMSGFMT = /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/bin/msgfmt
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..ba1a4bab4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest
new file mode 100644
index 000000000..7c0f62770
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C testsuite -k runtest-TESTS
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch
new file mode 100644
index 000000000..105e8b745
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch
@@ -0,0 +1,66 @@
+sed: add ptest
+
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+And fix following error after add serial-tests.
+
+[snip]
+help2man: can't get `--help' info from ../sed/sed
+make[2]: *** [sed.1] Error 2
+[snip]
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ configure.ac | 2 +-
+ doc/Makefile.am | 2 +-
+ testsuite/Makefile.am | 6 ++++++
+ 3 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9d33ec9..4f0c532 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4,7 +4,7 @@ AC_CONFIG_AUX_DIR(build-aux)
+ AC_CONFIG_SRCDIR([sed/sed.c])
+ AM_CONFIG_HEADER(config.h:config_h.in)
+ AC_PREREQ(2.60)
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([serial-tests])
+
+ SED_FEATURE_VERSION=4.2.2
+ AC_DEFINE_UNQUOTED(SED_FEATURE_VERSION, "$SED_FEATURE_VERSION",
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index af6975c..6fd8c9a 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -25,7 +25,7 @@ $(srcdir)/s-texi: sed-in.texi $(srcdir)/groupify.sed
+ fi
+ echo stamp > $(srcdir)/s-texi
+
+-sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x
++_sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x
+ $(HELP2MAN) --name "stream editor for filtering and transforming text" \
+ -p sed --include $(srcdir)/sed.x -o $(srcdir)/sed.1 $(SED)
+
+diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
+index d80e72c..b05f01e 100644
+--- a/testsuite/Makefile.am
++++ b/testsuite/Makefile.am
+@@ -99,5 +99,11 @@ EXTRA_DIST = \
+ # automake makes `check' depend on $(TESTS). Declare
+ # dummy targets for $(TESTS) so that make does not complain.
+
++install-ptest:
++ cd $(BUILDDIR); tar -cf - $(TESTDIR) --exclude *.o | ( cd $(DESTDIR) && tar -xf - )
++ for i in $(EXTRA_DIST) tst-regex2.c; do install $(srcdir)/$$i $(DESTDIR)/$(TESTDIR); done
++ sed -e 's/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/bash/sh/' -i $(DESTDIR)/$(TESTDIR)/Makefile
++ for i in `grep -rl "../sed/sed" $(DESTDIR)/$(TESTDIR)`; do sed -e 's/..\/sed\/sed/sed/' -i $$i; done
++
+ .PHONY: $(SEDTESTS)
+ $(SEDTESTS):
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb b/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb
new file mode 100644
index 000000000..40e3a53ce
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.1.2.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Stream EDitor (text filtering utility)"
+HOMEPAGE = "http://www.gnu.org/software/sed/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://sed/sed.h;beginline=1;endline=17;md5=e00ffd1837f298439a214fd197f6a407"
+SECTION = "console/utils"
+PR = "r7"
+
+SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \
+ file://fix_return_type.patch \
+ file://sed-4.1.2_fix_for_automake-1.12.patch \
+ file://Makevars"
+
+SRC_URI[md5sum] = "928f0e06422f414091917401f1a834d0"
+SRC_URI[sha256sum] = "638e837ba765d5da0a30c98b57c2953cecea96827882f594612acace93ceeeab"
+
+inherit autotools texinfo update-alternatives gettext
+
+do_configure_prepend () {
+ cp ${WORKDIR}/Makevars ${S}/po/
+}
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${base_bindir}
+ if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+ mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+ rmdir ${D}${bindir}/
+ fi
+}
+
+ALTERNATIVE_${PN} = "sed"
+ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed"
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.2.2.bb b/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.2.2.bb
new file mode 100644
index 000000000..5aa7d8a07
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sed/sed_4.2.2.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Stream EDitor (text filtering utility)"
+HOMEPAGE = "http://www.gnu.org/software/sed/"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+ file://sed/sed.h;beginline=1;endline=17;md5=767ab3a06d7584f6fd0469abaec4412f"
+SECTION = "console/utils"
+
+SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \
+ file://sed-add-ptest.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "4111de4faa3b9848a0686b2f260c5056"
+SRC_URI[sha256sum] = "fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff"
+
+inherit autotools texinfo update-alternatives gettext ptest
+RDEPENDS_${PN}-ptest += "make ${PN}"
+RRECOMMENDS_${PN}-ptest_append_libc-glibc = " locale-base-ru-ru"
+
+EXTRA_OECONF = "--disable-acl \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-regex-tests', '', d)}"
+
+do_install () {
+ autotools_do_install
+ install -d ${D}${base_bindir}
+ if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+ mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+ rmdir ${D}${bindir}/
+ fi
+}
+
+ALTERNATIVE_${PN} = "sed"
+ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed"
+ALTERNATIVE_PRIORITY = "100"
+
+TESTDIR = "testsuite"
+
+do_compile_ptest() {
+ oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+ oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
+}
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch
new file mode 100644
index 000000000..a6f604b65
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Disable-use-of-syslog-for-sysroot.patch
@@ -0,0 +1,124 @@
+From 8cf3454d567f77233023be49a39a33e9f0836f89 Mon Sep 17 00:00:00 2001
+From: Scott Garman <scott.a.garman@intel.com>
+Date: Thu, 14 Apr 2016 12:28:57 +0200
+Subject: [PATCH] Disable use of syslog for sysroot
+
+Disable use of syslog to prevent sysroot user and group additions from
+writing entries to the host's syslog. This patch should only be used
+with the shadow-native recipe.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ src/groupadd.c | 3 +++
+ src/groupdel.c | 3 +++
+ src/groupmems.c | 3 +++
+ src/groupmod.c | 3 +++
+ src/useradd.c | 3 +++
+ src/userdel.c | 3 +++
+ src/usermod.c | 3 +++
+ 7 files changed, 21 insertions(+)
+
+diff --git a/src/groupadd.c b/src/groupadd.c
+index 39b4ec0..f716f57 100644
+--- a/src/groupadd.c
++++ b/src/groupadd.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <getopt.h>
+diff --git a/src/groupdel.c b/src/groupdel.c
+index da99347..46a679c 100644
+--- a/src/groupdel.c
++++ b/src/groupdel.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <grp.h>
+diff --git a/src/groupmems.c b/src/groupmems.c
+index e4f107f..95cb073 100644
+--- a/src/groupmems.c
++++ b/src/groupmems.c
+@@ -32,6 +32,9 @@
+
+ #include <config.h>
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <fcntl.h>
+ #include <getopt.h>
+ #include <grp.h>
+diff --git a/src/groupmod.c b/src/groupmod.c
+index d9d3807..6229737 100644
+--- a/src/groupmod.c
++++ b/src/groupmod.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <getopt.h>
+diff --git a/src/useradd.c b/src/useradd.c
+index e1ebf50..25679d8 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
+diff --git a/src/userdel.c b/src/userdel.c
+index 19b12bc..a083929 100644
+--- a/src/userdel.c
++++ b/src/userdel.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <getopt.h>
+diff --git a/src/usermod.c b/src/usermod.c
+index 685b50a..28e5cfc 100644
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -34,6 +34,9 @@
+
+ #ident "$Id$"
+
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <ctype.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--
+2.1.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch
new file mode 100644
index 000000000..828b95a57
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch
@@ -0,0 +1,46 @@
+From 170c25c8e0b5c3dc2615d1db94c8d24a13ff99bf Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Thu, 11 Sep 2014 15:11:23 +0200
+Subject: [PATCH] Do not read login.defs before doing chroot()
+
+If "useradd --root <root> ..." was used, the login.defs file would still
+be read from /etc/login.defs instead of <root>/etc/login.defs. This was
+due to getdef_ulong() being called before process_root_flag().
+
+Upstream-Status: Submitted [http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2014-September/010446.html]
+
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ src/useradd.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/useradd.c b/src/useradd.c
+index a8a1f76..e1ebf50 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -1993,9 +1993,11 @@ int main (int argc, char **argv)
+ #endif /* USE_PAM */
+ #endif /* ACCT_TOOLS_SETUID */
+
++#ifdef ENABLE_SUBIDS
+ /* Needed for userns check */
+- uid_t uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL);
+- uid_t uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL);
++ uid_t uid_min;
++ uid_t uid_max;
++#endif
+
+ /*
+ * Get my name so that I can use it to report errors.
+@@ -2026,6 +2028,8 @@ int main (int argc, char **argv)
+ is_shadow_grp = sgr_file_present ();
+ #endif
+ #ifdef ENABLE_SUBIDS
++ uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL);
++ uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL);
+ is_sub_uid = sub_uid_file_present () && !rflg &&
+ (!user_id || (user_id <= uid_max && user_id >= uid_min));
+ is_sub_gid = sub_gid_file_present () && !rflg &&
+--
+1.9.0
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
new file mode 100644
index 000000000..85dde8e1b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
@@ -0,0 +1,109 @@
+Upstream-Status: Inappropriate [OE specific]
+
+Subject: useradd.c: create parent directories when necessary
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/useradd.c | 72 +++++++++++++++++++++++++++++++++++++++------------------
+ 1 file changed, 49 insertions(+), 23 deletions(-)
+
+diff --git a/src/useradd.c b/src/useradd.c
+index 4bd969d..cb5dd6c 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -1893,6 +1893,35 @@ static void usr_update (void)
+ }
+
+ /*
++ * mkdir_p - create directories, including parent directories when needed
++ *
++ * similar to `mkdir -p'
++ */
++void mkdir_p(const char *path) {
++ int len = strlen(path);
++ char newdir[len + 1];
++ mode_t mode = 0755;
++ int i = 0;
++
++ if (path[i] == '\0') {
++ return;
++ }
++
++ /* skip the leading '/' */
++ i++;
++
++ while(path[i] != '\0') {
++ if (path[i] == '/') {
++ strncpy(newdir, path, i);
++ newdir[i] = '\0';
++ mkdir(newdir, mode);
++ }
++ i++;
++ }
++ mkdir(path, mode);
++}
++
++/*
+ * create_home - create the user's home directory
+ *
+ * create_home() creates the user's home directory if it does not
+@@ -1907,36 +1936,33 @@ static void create_home (void)
+ fail_exit (E_HOMEDIR);
+ }
+ #endif
+- /* XXX - create missing parent directories. --marekm */
+- if (mkdir (user_home, 0) != 0) {
+- fprintf (stderr,
+- _("%s: cannot create directory %s\n"),
+- Prog, user_home);
+-#ifdef WITH_AUDIT
+- audit_logger (AUDIT_ADD_USER, Prog,
+- "adding home directory",
+- user_name, (unsigned int) user_id,
+- SHADOW_AUDIT_FAILURE);
+-#endif
+- fail_exit (E_HOMEDIR);
+- }
+- chown (user_home, user_id, user_gid);
+- chmod (user_home,
+- 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
+- home_added = true;
++ mkdir_p(user_home);
++ }
++ if (access (user_home, F_OK) != 0) {
+ #ifdef WITH_AUDIT
+ audit_logger (AUDIT_ADD_USER, Prog,
+ "adding home directory",
+ user_name, (unsigned int) user_id,
+- SHADOW_AUDIT_SUCCESS);
++ SHADOW_AUDIT_FAILURE);
+ #endif
+-#ifdef WITH_SELINUX
+- /* Reset SELinux to create files with default contexts */
+- if (reset_selinux_file_context () != 0) {
+- fail_exit (E_HOMEDIR);
+- }
++ fail_exit (E_HOMEDIR);
++ }
++ chown (user_home, user_id, user_gid);
++ chmod (user_home,
++ 0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
++ home_added = true;
++#ifdef WITH_AUDIT
++ audit_logger (AUDIT_ADD_USER, Prog,
++ "adding home directory",
++ user_name, (unsigned int) user_id,
++ SHADOW_AUDIT_SUCCESS);
+ #endif
++#ifdef WITH_SELINUX
++ /* Reset SELinux to create files with default contexts */
++ if (reset_selinux_file_context () != 0) {
++ fail_exit (E_HOMEDIR);
+ }
++#endif
+ }
+
+ /*
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
new file mode 100644
index 000000000..68da25f40
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
@@ -0,0 +1,201 @@
+Upstream-Status: Inappropriate [OE specific]
+
+Allow for setting password in clear text.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/Makefile.am | 8 ++++----
+ src/groupadd.c | 8 +++++++-
+ src/groupmod.c | 8 +++++++-
+ src/useradd.c | 9 +++++++--
+ src/usermod.c | 8 +++++++-
+ 5 files changed, 32 insertions(+), 9 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 25e288d..856b087 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -88,10 +88,10 @@ chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT)
+ chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
+ chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
+ gpasswd_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
+-groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
++groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
+ groupdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
+ groupmems_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX)
+-groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
++groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
+ grpck_LDADD = $(LDADD) $(LIBSELINUX)
+ grpconv_LDADD = $(LDADD) $(LIBSELINUX)
+ grpunconv_LDADD = $(LDADD) $(LIBSELINUX)
+@@ -111,9 +111,9 @@ su_SOURCES = \
+ suauth.c
+ su_LDADD = $(LDADD) $(LIBPAM) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
+ sulogin_LDADD = $(LDADD) $(LIBCRYPT)
+-useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
++useradd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT)
+ userdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE)
+-usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
++usermod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT)
+ vipw_LDADD = $(LDADD) $(LIBSELINUX)
+
+ install-am: all-am
+diff --git a/src/groupadd.c b/src/groupadd.c
+index f716f57..4e28c26 100644
+--- a/src/groupadd.c
++++ b/src/groupadd.c
+@@ -124,6 +124,7 @@ static /*@noreturn@*/void usage (int status)
+ (void) fputs (_(" -o, --non-unique allow to create groups with duplicate\n"
+ " (non-unique) GID\n"), usageout);
+ (void) fputs (_(" -p, --password PASSWORD use this encrypted password for the new group\n"), usageout);
++ (void) fputs (_(" -P, --clear-password PASSWORD use this clear password for the new group\n"), usageout);
+ (void) fputs (_(" -r, --system create a system account\n"), usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs ("\n", usageout);
+@@ -387,12 +388,13 @@ static void process_flags (int argc, char **argv)
+ {"key", required_argument, NULL, 'K'},
+ {"non-unique", no_argument, NULL, 'o'},
+ {"password", required_argument, NULL, 'p'},
++ {"clear-password", required_argument, NULL, 'P'},
+ {"system", no_argument, NULL, 'r'},
+ {"root", required_argument, NULL, 'R'},
+ {NULL, 0, NULL, '\0'}
+ };
+
+- while ((c = getopt_long (argc, argv, "fg:hK:op:rR:",
++ while ((c = getopt_long (argc, argv, "fg:hK:op:P:rR:",
+ long_options, NULL)) != -1) {
+ switch (c) {
+ case 'f':
+@@ -444,6 +446,10 @@ static void process_flags (int argc, char **argv)
+ pflg = true;
+ group_passwd = optarg;
+ break;
++ case 'P':
++ pflg = true;
++ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++ break;
+ case 'r':
+ rflg = true;
+ break;
+diff --git a/src/groupmod.c b/src/groupmod.c
+index d9d3807..68f49d1 100644
+--- a/src/groupmod.c
++++ b/src/groupmod.c
+@@ -127,6 +127,7 @@ static void usage (int status)
+ (void) fputs (_(" -o, --non-unique allow to use a duplicate (non-unique) GID\n"), usageout);
+ (void) fputs (_(" -p, --password PASSWORD change the password to this (encrypted)\n"
+ " PASSWORD\n"), usageout);
++ (void) fputs (_(" -P, --clear-password PASSWORD change the password to this clear PASSWORD\n"), usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs ("\n", usageout);
+ exit (status);
+@@ -375,10 +376,11 @@ static void process_flags (int argc, char **argv)
+ {"new-name", required_argument, NULL, 'n'},
+ {"non-unique", no_argument, NULL, 'o'},
+ {"password", required_argument, NULL, 'p'},
++ {"clear-password", required_argument, NULL, 'P'},
+ {"root", required_argument, NULL, 'R'},
+ {NULL, 0, NULL, '\0'}
+ };
+- while ((c = getopt_long (argc, argv, "g:hn:op:R:",
++ while ((c = getopt_long (argc, argv, "g:hn:op:P:R:",
+ long_options, NULL)) != -1) {
+ switch (c) {
+ case 'g':
+@@ -405,6 +407,10 @@ static void process_flags (int argc, char **argv)
+ group_passwd = optarg;
+ pflg = true;
+ break;
++ case 'P':
++ group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++ pflg = true;
++ break;
+ case 'R': /* no-op, handled in process_root_flag () */
+ break;
+ default:
+diff --git a/src/useradd.c b/src/useradd.c
+index b3bd451..4416f90 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -773,6 +773,7 @@ static void usage (int status)
+ (void) fputs (_(" -o, --non-unique allow to create users with duplicate\n"
+ " (non-unique) UID\n"), usageout);
+ (void) fputs (_(" -p, --password PASSWORD encrypted password of the new account\n"), usageout);
++ (void) fputs (_(" -P, --clear-password PASSWORD clear password of the new account\n"), usageout);
+ (void) fputs (_(" -r, --system create a system account\n"), usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs (_(" -s, --shell SHELL login shell of the new account\n"), usageout);
+@@ -1047,6 +1048,7 @@ static void process_flags (int argc, char **argv)
+ {"no-user-group", no_argument, NULL, 'N'},
+ {"non-unique", no_argument, NULL, 'o'},
+ {"password", required_argument, NULL, 'p'},
++ {"clear-password", required_argument, NULL, 'P'},
+ {"system", no_argument, NULL, 'r'},
+ {"root", required_argument, NULL, 'R'},
+ {"shell", required_argument, NULL, 's'},
+@@ -1059,9 +1061,9 @@ static void process_flags (int argc, char **argv)
+ };
+ while ((c = getopt_long (argc, argv,
+ #ifdef WITH_SELINUX
+- "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:UZ:",
++ "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:UZ:",
+ #else /* !WITH_SELINUX */
+- "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:U",
++ "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:U",
+ #endif /* !WITH_SELINUX */
+ long_options, NULL)) != -1) {
+ switch (c) {
+@@ -1227,6 +1229,9 @@ static void process_flags (int argc, char **argv)
+ }
+ user_pass = optarg;
+ break;
++ case 'P': /* set clear text password */
++ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++ break;
+ case 'r':
+ rflg = true;
+ break;
+diff --git a/src/usermod.c b/src/usermod.c
+index e7d4351..b79f7a3 100644
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -419,6 +419,7 @@ static /*@noreturn@*/void usage (int status)
+ " new location (use only with -d)\n"), usageout);
+ (void) fputs (_(" -o, --non-unique allow using duplicate (non-unique) UID\n"), usageout);
+ (void) fputs (_(" -p, --password PASSWORD use encrypted password for the new password\n"), usageout);
++ (void) fputs (_(" -P, --clear-password PASSWORD use clear password for the new password\n"), usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
+ (void) fputs (_(" -s, --shell SHELL new login shell for the user account\n"), usageout);
+ (void) fputs (_(" -u, --uid UID new UID for the user account\n"), usageout);
+@@ -996,6 +997,7 @@ static void process_flags (int argc, char **argv)
+ {"move-home", no_argument, NULL, 'm'},
+ {"non-unique", no_argument, NULL, 'o'},
+ {"password", required_argument, NULL, 'p'},
++ {"clear-password", required_argument, NULL, 'P'},
+ {"root", required_argument, NULL, 'R'},
+ {"shell", required_argument, NULL, 's'},
+ {"uid", required_argument, NULL, 'u'},
+@@ -1012,7 +1014,7 @@ static void process_flags (int argc, char **argv)
+ {NULL, 0, NULL, '\0'}
+ };
+ while ((c = getopt_long (argc, argv,
+- "ac:d:e:f:g:G:hl:Lmop:R:s:u:U"
++ "ac:d:e:f:g:G:hl:Lmop:P:R:s:u:U"
+ #ifdef ENABLE_SUBIDS
+ "v:w:V:W:"
+ #endif /* ENABLE_SUBIDS */
+@@ -1112,6 +1114,10 @@ static void process_flags (int argc, char **argv)
+ user_pass = optarg;
+ pflg = true;
+ break;
++ case 'P':
++ user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++ pflg = true;
++ break;
+ case 'R': /* no-op, handled in process_root_flag () */
+ break;
+ case 's':
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch
new file mode 100644
index 000000000..185590cab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch
@@ -0,0 +1,41 @@
+From 2cb54158b80cdbd97ca3b36df83f9255e923ae3f Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@aura-online.co.uk>
+Date: Sat, 23 Aug 2014 09:46:39 +0100
+Subject: [PATCH] Check size of uid_t and gid_t using AC_CHECK_SIZEOF
+
+This built-in check is simpler than the previous method and, most
+importantly, works when cross-compiling.
+
+Upstream-Status: Accepted
+[https://github.com/shadow-maint/shadow/commit/2cb54158b80cdbd97ca3b36df83f9255e923ae3f]
+
+Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
+---
+ configure.in | 14 ++++----------
+ 1 file changed, 4 insertions(+), 10 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 1a3f841..4a4d6d0 100644
+--- a/configure.in
++++ b/configure.in
+@@ -335,16 +335,10 @@ if test "$enable_subids" != "no"; then
+ dnl
+ dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc
+ dnl
+- AC_RUN_IFELSE([AC_LANG_SOURCE([
+-#include <sys/types.h>
+-int main(void) {
+- uid_t u;
+- gid_t g;
+- return (sizeof u < 4) || (sizeof g < 4);
+-}
+- ])], [id32bit="yes"], [id32bit="no"])
+-
+- if test "x$id32bit" = "xyes"; then
++ AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"])
++ AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"])
++
++ if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then
+ AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.])
+ enable_subids="yes"
+ else
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
new file mode 100644
index 000000000..4fa3d184e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Inappropriate [OE specific]
+
+commonio.c: fix unexpected open failure in chroot environment
+
+When using commands with '-R <newroot>' option in our pseudo environment,
+we would usually get the 'Pemission Denied' error. This patch serves as
+a workaround to this problem.
+
+Note that this patch doesn't change the logic in the code, it just expands
+the codes.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ lib/commonio.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/lib/commonio.c b/lib/commonio.c
+index cc536bf..51cafd9 100644
+--- a/lib/commonio.c
++++ b/lib/commonio.c
+@@ -613,10 +613,18 @@ int commonio_open (struct commonio_db *db, int mode)
+ db->cursor = NULL;
+ db->changed = false;
+
+- fd = open (db->filename,
+- (db->readonly ? O_RDONLY : O_RDWR)
+- | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
+- saved_errno = errno;
++ if (db->readonly) {
++ fd = open (db->filename,
++ (true ? O_RDONLY : O_RDWR)
++ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
++ saved_errno = errno;
++ } else {
++ fd = open (db->filename,
++ (false ? O_RDONLY : O_RDWR)
++ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
++ saved_errno = errno;
++ }
++
+ db->fp = NULL;
+ if (fd >= 0) {
+ #ifdef WITH_TCB
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch
new file mode 100644
index 000000000..02cb91aaf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+Subject: fix installation failure with subids disabled
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/Makefile.am | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 25e288d..076f8ef 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -52,7 +52,10 @@ usbin_PROGRAMS = \
+ noinst_PROGRAMS = id sulogin
+
+ suidbins = su
+-suidubins = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap
++suidubins = chage chfn chsh expiry gpasswd newgrp passwd
++if ENABLE_SUBIDS
++suidubins += newgidmap newuidmap
++endif
+ if ACCT_TOOLS_SETUID
+ suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod
+ endif
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot
new file mode 100644
index 000000000..8a68dd341
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot
@@ -0,0 +1,386 @@
+#
+# /etc/login.defs - Configuration control definitions for the shadow package.
+#
+# $Id: login.defs 3038 2009-07-23 20:41:35Z nekral-guest $
+#
+
+#
+# Delay in seconds before being allowed another attempt after a login failure
+# Note: When PAM is used, some modules may enfore a minimal delay (e.g.
+# pam_unix enforces a 2s delay)
+#
+FAIL_DELAY 3
+
+#
+# Enable logging and display of /var/log/faillog login failure info.
+#
+#FAILLOG_ENAB yes
+
+#
+# Enable display of unknown usernames when login failures are recorded.
+#
+LOG_UNKFAIL_ENAB no
+
+#
+# Enable logging of successful logins
+#
+LOG_OK_LOGINS no
+
+#
+# Enable logging and display of /var/log/lastlog login time info.
+#
+#LASTLOG_ENAB yes
+
+#
+# Enable checking and display of mailbox status upon login.
+#
+# Disable if the shell startup files already check for mail
+# ("mailx -e" or equivalent).
+#
+##MAIL_CHECK_ENAB yes
+
+#
+# Enable additional checks upon password changes.
+#
+#OBSCURE_CHECKS_ENAB yes
+
+#
+# Enable checking of time restrictions specified in /etc/porttime.
+#
+#PORTTIME_CHECKS_ENAB yes
+
+#
+# Enable setting of ulimit, umask, and niceness from passwd gecos field.
+#
+#QUOTAS_ENAB yes
+
+#
+# Enable "syslog" logging of su activity - in addition to sulog file logging.
+# SYSLOG_SG_ENAB does the same for newgrp and sg.
+#
+SYSLOG_SU_ENAB yes
+SYSLOG_SG_ENAB yes
+
+#
+# If defined, either full pathname of a file containing device names or
+# a ":" delimited list of device names. Root logins will be allowed only
+# upon these devices.
+#
+CONSOLE /etc/securetty
+#CONSOLE console:tty01:tty02:tty03:tty04
+
+#
+# If defined, all su activity is logged to this file.
+#
+#SULOG_FILE /var/log/sulog
+
+#
+# If defined, ":" delimited list of "message of the day" files to
+# be displayed upon login.
+#
+#MOTD_FILE /etc/motd
+#MOTD_FILE /etc/motd:/usr/lib/news/news-motd
+
+#
+# If defined, this file will be output before each login prompt.
+#
+#ISSUE_FILE /etc/issue
+
+#
+# If defined, file which maps tty line to TERM environment parameter.
+# Each line of the file is in a format something like "vt100 tty01".
+#
+#TTYTYPE_FILE /etc/ttytype
+
+#
+# If defined, login failures will be logged here in a utmp format.
+# last, when invoked as lastb, will read /var/log/btmp, so...
+#
+#FTMP_FILE /var/log/btmp
+
+#
+# If defined, name of file whose presence which will inhibit non-root
+# logins. The contents of this file should be a message indicating
+# why logins are inhibited.
+#
+#NOLOGINS_FILE /etc/nologin
+
+#
+# If defined, the command name to display when running "su -". For
+# example, if this is defined as "su" then a "ps" will display the
+# command is "-su". If not defined, then "ps" would display the
+# name of the shell actually being run, e.g. something like "-sh".
+#
+SU_NAME su
+
+#
+# *REQUIRED*
+# Directory where mailboxes reside, _or_ name of file, relative to the
+# home directory. If you _do_ define both, #MAIL_DIR takes precedence.
+#
+#MAIL_DIR /var/spool/mail
+MAIL_FILE .mail
+
+#
+# If defined, file which inhibits all the usual chatter during the login
+# sequence. If a full pathname, then hushed mode will be enabled if the
+# user's name or shell are found in the file. If not a full pathname, then
+# hushed mode will be enabled if the file exists in the user's home directory.
+#
+HUSHLOGIN_FILE .hushlogin
+#HUSHLOGIN_FILE /etc/hushlogins
+
+#
+# If defined, either a TZ environment parameter spec or the
+# fully-rooted pathname of a file containing such a spec.
+#
+#ENV_TZ TZ=CST6CDT
+#ENV_TZ /etc/tzname
+
+#
+# If defined, an HZ environment parameter spec.
+#
+# for Linux/x86
+#ENV_HZ HZ=100
+# For Linux/Alpha...
+#ENV_HZ HZ=1024
+
+#
+# *REQUIRED* The default PATH settings, for superuser and normal users.
+#
+# (they are minimal, add the rest in the shell startup files)
+ENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ENV_PATH PATH=/bin:/usr/bin
+
+#
+# Terminal permissions
+#
+# TTYGROUP Login tty will be assigned this group ownership.
+# TTYPERM Login tty will be set to this permission.
+#
+# If you have a "write" program which is "setgid" to a special group
+# which owns the terminals, define TTYGROUP to the group number and
+# TTYPERM to 0620. Otherwise leave TTYGROUP commented out and assign
+# TTYPERM to either 622 or 600.
+#
+TTYGROUP tty
+TTYPERM 0600
+
+#
+# Login configuration initializations:
+#
+# ERASECHAR Terminal ERASE character ('\010' = backspace).
+# KILLCHAR Terminal KILL character ('\025' = CTRL/U).
+# ULIMIT Default "ulimit" value.
+#
+# The ERASECHAR and KILLCHAR are used only on System V machines.
+# The ULIMIT is used only if the system supports it.
+# (now it works with setrlimit too; ulimit is in 512-byte units)
+#
+# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
+#
+ERASECHAR 0177
+KILLCHAR 025
+#ULIMIT 2097152
+
+# Default initial "umask" value for non-PAM enabled systems.
+# UMASK is also used by useradd and newusers to set the mode of new home
+# directories.
+# 022 is the default value, but 027, or even 077, could be considered
+# better for privacy. There is no One True Answer here: each sysadmin
+# must make up her mind.
+UMASK 022
+
+#
+# Password aging controls:
+#
+# PASS_MAX_DAYS Maximum number of days a password may be used.
+# PASS_MIN_DAYS Minimum number of days allowed between password changes.
+# PASS_MIN_LEN Minimum acceptable password length.
+# PASS_WARN_AGE Number of days warning given before a password expires.
+#
+PASS_MAX_DAYS 99999
+PASS_MIN_DAYS 0
+#PASS_MIN_LEN 5
+PASS_WARN_AGE 7
+
+#
+# If "yes", the user must be listed as a member of the first gid 0 group
+# in /etc/group (called "root" on most Linux systems) to be able to "su"
+# to uid 0 accounts. If the group doesn't exist or is empty, no one
+# will be able to "su" to uid 0.
+#
+#SU_WHEEL_ONLY no
+
+#
+# If compiled with cracklib support, where are the dictionaries
+#
+#CRACKLIB_DICTPATH /var/cache/cracklib/cracklib_dict
+
+#
+# Min/max values for automatic uid selection in useradd
+#
+UID_MIN 1000
+UID_MAX 60000
+# System accounts
+SYS_UID_MIN 101
+SYS_UID_MAX 999
+
+#
+# Min/max values for automatic gid selection in groupadd
+#
+GID_MIN 1000
+GID_MAX 60000
+# System accounts
+SYS_GID_MIN 101
+SYS_GID_MAX 999
+
+#
+# Max number of login retries if password is bad
+#
+LOGIN_RETRIES 5
+
+#
+# Max time in seconds for login
+#
+LOGIN_TIMEOUT 60
+
+#
+# Maximum number of attempts to change password if rejected (too easy)
+#
+#PASS_CHANGE_TRIES 5
+
+#
+# Warn about weak passwords (but still allow them) if you are root.
+#
+#PASS_ALWAYS_WARN yes
+
+#
+# Number of significant characters in the password for crypt().
+# Default is 8, don't change unless your crypt() is better.
+# Ignored if MD5_CRYPT_ENAB set to "yes".
+#
+#PASS_MAX_LEN 8
+
+#
+# Require password before chfn/chsh can make any changes.
+#
+#CHFN_AUTH yes
+
+#
+# Which fields may be changed by regular users using chfn - use
+# any combination of letters "frwh" (full name, room number, work
+# phone, home phone). If not defined, no changes are allowed.
+# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
+#
+CHFN_RESTRICT rwh
+
+#
+# Password prompt (%s will be replaced by user name).
+#
+# XXX - it doesn't work correctly yet, for now leave it commented out
+# to use the default which is just "Password: ".
+#LOGIN_STRING "%s's Password: "
+
+#
+# Only works if compiled with MD5_CRYPT defined:
+# If set to "yes", new passwords will be encrypted using the MD5-based
+# algorithm compatible with the one used by recent releases of FreeBSD.
+# It supports passwords of unlimited length and longer salt strings.
+# Set to "no" if you need to copy encrypted passwords to other systems
+# which don't understand the new algorithm. Default is "no".
+#
+# Note: If you use PAM, it is recommended to use a value consistent with
+# the PAM modules configuration.
+#
+# This variable is deprecated. You should use ENCRYPT_METHOD.
+#
+#MD5_CRYPT_ENAB no
+
+#
+# Only works if compiled with ENCRYPTMETHOD_SELECT defined:
+# If set to MD5 , MD5-based algorithm will be used for encrypting password
+# If set to SHA256, SHA256-based algorithm will be used for encrypting password
+# If set to SHA512, SHA512-based algorithm will be used for encrypting password
+# If set to DES, DES-based algorithm will be used for encrypting password (default)
+# Overrides the MD5_CRYPT_ENAB option
+#
+# Note: If you use PAM, it is recommended to use a value consistent with
+# the PAM modules configuration.
+#
+#ENCRYPT_METHOD DES
+
+#
+# Only works if ENCRYPT_METHOD is set to SHA256 or SHA512.
+#
+# Define the number of SHA rounds.
+# With a lot of rounds, it is more difficult to brute forcing the password.
+# But note also that it more CPU resources will be needed to authenticate
+# users.
+#
+# If not specified, the libc will choose the default number of rounds (5000).
+# The values must be inside the 1000-999999999 range.
+# If only one of the MIN or MAX values is set, then this value will be used.
+# If MIN > MAX, the highest value will be used.
+#
+# SHA_CRYPT_MIN_ROUNDS 5000
+# SHA_CRYPT_MAX_ROUNDS 5000
+
+#
+# List of groups to add to the user's supplementary group set
+# when logging in on the console (as determined by the CONSOLE
+# setting). Default is none.
+#
+# Use with caution - it is possible for users to gain permanent
+# access to these groups, even when not logged in on the console.
+# How to do it is left as an exercise for the reader...
+#
+#CONSOLE_GROUPS floppy:audio:cdrom
+
+#
+# Should login be allowed if we can't cd to the home directory?
+# Default in no.
+#
+DEFAULT_HOME yes
+
+#
+# If this file exists and is readable, login environment will be
+# read from it. Every line should be in the form name=value.
+#
+#ENVIRON_FILE /etc/environment
+
+#
+# If defined, this command is run when removing a user.
+# It should remove any at/cron/print jobs etc. owned by
+# the user to be removed (passed as the first argument).
+#
+#USERDEL_CMD /usr/sbin/userdel_local
+
+#
+# Enable setting of the umask group bits to be the same as owner bits
+# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
+# the same as gid, and username is the same as the primary group name.
+#
+# This also enables userdel to remove user groups if no members exist.
+#
+USERGROUPS_ENAB yes
+
+#
+# If set to a non-nul number, the shadow utilities will make sure that
+# groups never have more than this number of users on one line.
+# This permit to support split groups (groups split into multiple lines,
+# with the same group ID, to avoid limitation of the line length in the
+# group file).
+#
+# 0 is the default value and disables this feature.
+#
+#MAX_MEMBERS_PER_GROUP 0
+
+#
+# If useradd should create home directories for users by default (non
+# system users only)
+# This option is overridden with the -M or -m flags on the useradd command
+# line.
+#
+CREATE_HOME yes
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login_defs_pam.sed b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login_defs_pam.sed
new file mode 100644
index 000000000..0a1f3be4a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/login_defs_pam.sed
@@ -0,0 +1,32 @@
+/^FAILLOG_ENAB/b comment
+/^LASTLOG_ENAB/b comment
+/^MAIL_CHECK_ENAB/b comment
+/^OBSCURE_CHECKS_ENAB/b comment
+/^PORTTIME_CHECKS_ENAB/b comment
+/^QUOTAS_ENAB/b comment
+/^MOTD_FILE/b comment
+/^FTMP_FILE/b comment
+/^NOLOGINS_FILE/b comment
+/^ENV_HZ/b comment
+/^ENV_TZ/b comment
+/^PASS_MIN_LEN/b comment
+/^SU_WHEEL_ONLY/b comment
+/^CRACKLIB_DICTPATH/b comment
+/^PASS_CHANGE_TRIES/b comment
+/^PASS_ALWAYS_WARN/b comment
+/^PASS_MAX_LEN/b comment
+/^PASS_MIN_LEN/b comment
+/^CHFN_AUTH/b comment
+/^CHSH_AUTH/b comment
+/^ISSUE_FILE/b comment
+/^LOGIN_STRING/b comment
+/^ULIMIT/b comment
+/^ENVIRON_FILE/b comment
+
+b exit
+
+: comment
+ s:^:#:
+
+: exit
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chfn b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chfn
new file mode 100644
index 000000000..baf7698bb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chfn
@@ -0,0 +1,14 @@
+#
+# The PAM configuration file for the Shadow `chfn' service
+#
+
+# This allows root to change user infomation without being
+# prompted for a password
+auth sufficient pam_rootok.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth include common-auth
+account include common-account
+session include common-session
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chpasswd b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chpasswd
new file mode 100644
index 000000000..9e3efa68b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chpasswd
@@ -0,0 +1,4 @@
+# The PAM configuration file for the Shadow 'chpasswd' service
+#
+
+password include common-password
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chsh b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chsh
new file mode 100644
index 000000000..8fb169f64
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/chsh
@@ -0,0 +1,19 @@
+#
+# The PAM configuration file for the Shadow `chsh' service
+#
+
+# This will not allow a user to change their shell unless
+# their current one is listed in /etc/shells. This keeps
+# accounts with special shells from changing them.
+auth required pam_shells.so
+
+# This allows root to change user shell without being
+# prompted for a password
+auth sufficient pam_rootok.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth include common-auth
+account include common-account
+session include common-session
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/login b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/login
new file mode 100644
index 000000000..b34005853
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/login
@@ -0,0 +1,81 @@
+#
+# The PAM configuration file for the Shadow `login' service
+#
+
+# Enforce a minimal delay in case of failure (in microseconds).
+# (Replaces the `FAIL_DELAY' setting from login.defs)
+# Note that other modules may require another minimal delay. (for example,
+# to disable any delay, you should add the nodelay option to pam_unix)
+auth optional pam_faildelay.so delay=3000000
+
+# Outputs an issue file prior to each login prompt (Replaces the
+# ISSUE_FILE option from login.defs). Uncomment for use
+# auth required pam_issue.so issue=/etc/issue
+
+# Disallows root logins except on tty's listed in /etc/securetty
+# (Replaces the `CONSOLE' setting from login.defs)
+# Note that it is included as a "requisite" module. No password prompts will
+# be displayed if this module fails to avoid having the root password
+# transmitted on unsecure ttys.
+# You can change it to a "required" module if you think it permits to
+# guess valid user names of your system (invalid user names are considered
+# as possibly being root).
+auth [success=ok ignore=ignore user_unknown=ignore default=die] pam_securetty.so
+
+# Disallows other than root logins when /etc/nologin exists
+# (Replaces the `NOLOGINS_FILE' option from login.defs)
+auth requisite pam_nologin.so
+
+# This module parses environment configuration file(s)
+# and also allows you to use an extended config
+# file /etc/security/pam_env.conf.
+#
+# parsing /etc/environment needs "readenv=1"
+session required pam_env.so readenv=1
+
+# Standard Un*x authentication.
+auth include common-auth
+
+# This allows certain extra groups to be granted to a user
+# based on things like time of day, tty, service, and user.
+# Please edit /etc/security/group.conf to fit your needs
+# (Replaces the `CONSOLE_GROUPS' option in login.defs)
+auth optional pam_group.so
+
+# Uncomment and edit /etc/security/time.conf if you need to set
+# time restrainst on logins.
+# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
+# as well as /etc/porttime)
+# account requisite pam_time.so
+
+# Uncomment and edit /etc/security/access.conf if you need to
+# set access limits.
+# (Replaces /etc/login.access file)
+# account required pam_access.so
+
+# Sets up user limits according to /etc/security/limits.conf
+# (Replaces the use of /etc/limits in old login)
+session required pam_limits.so
+
+# Prints the last login info upon succesful login
+# (Replaces the `LASTLOG_ENAB' option from login.defs)
+session optional pam_lastlog.so
+
+# Prints the motd upon succesful login
+# (Replaces the `MOTD_FILE' option in login.defs)
+session optional pam_motd.so
+
+# Prints the status of the user's mailbox upon succesful login
+# (Replaces the `MAIL_CHECK_ENAB' option from login.defs).
+#
+# This also defines the MAIL environment variable
+# However, userdel also needs MAIL_DIR and MAIL_FILE variables
+# in /etc/login.defs to make sure that removing a user
+# also removes the user's mail spool file.
+# See comments in /etc/login.defs
+session optional pam_mail.so standard
+
+# Standard Un*x account and session
+account include common-account
+password include common-password
+session include common-session
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/newusers b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/newusers
new file mode 100644
index 000000000..4aa3dde48
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/newusers
@@ -0,0 +1,4 @@
+# The PAM configuration file for the Shadow 'newusers' service
+#
+
+password include common-password
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/passwd b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/passwd
new file mode 100644
index 000000000..f53499243
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/passwd
@@ -0,0 +1,5 @@
+#
+# The PAM configuration file for the Shadow `passwd' service
+#
+
+password include common-password
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/su b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/su
new file mode 100644
index 000000000..8d590a32e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/pam.d/su
@@ -0,0 +1,57 @@
+#
+# The PAM configuration file for the Shadow `su' service
+#
+
+# This allows root to su without passwords (normal operation)
+auth sufficient pam_rootok.so
+
+# Uncomment this to force users to be a member of group root
+# before they can use `su'. You can also add "group=foo"
+# to the end of this line if you want to use a group other
+# than the default "root" (but this may have side effect of
+# denying "root" user, unless she's a member of "foo" or explicitly
+# permitted earlier by e.g. "sufficient pam_rootok.so").
+# (Replaces the `SU_WHEEL_ONLY' option from login.defs)
+# auth required pam_wheel.so
+
+# Uncomment this if you want wheel members to be able to
+# su without a password.
+# auth sufficient pam_wheel.so trust
+
+# Uncomment this if you want members of a specific group to not
+# be allowed to use su at all.
+# auth required pam_wheel.so deny group=nosu
+
+# Uncomment and edit /etc/security/time.conf if you need to set
+# time restrainst on su usage.
+# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
+# as well as /etc/porttime)
+# account requisite pam_time.so
+
+# This module parses environment configuration file(s)
+# and also allows you to use an extended config
+# file /etc/security/pam_env.conf.
+#
+# parsing /etc/environment needs "readenv=1"
+session required pam_env.so readenv=1
+
+# Defines the MAIL environment variable
+# However, userdel also needs MAIL_DIR and MAIL_FILE variables
+# in /etc/login.defs to make sure that removing a user
+# also removes the user's mail spool file.
+# See comments in /etc/login.defs
+#
+# "nopen" stands to avoid reporting new mail when su'ing to another user
+session optional pam_mail.so nopen
+
+# Sets up user limits, please uncomment and read /etc/security/limits.conf
+# to enable this functionality.
+# (Replaces the use of /etc/limits in old login)
+# session required pam_limits.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth include common-auth
+account include common-account
+session include common-session
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/securetty b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/securetty
new file mode 100644
index 000000000..2be341a21
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/securetty
@@ -0,0 +1,238 @@
+# /etc/securetty: list of terminals on which root is allowed to login.
+# See securetty(5) and login(1).
+console
+
+# Standard serial ports
+ttyS0
+ttyS1
+ttyS2
+ttyS3
+
+# ARM AMBA SoCs
+ttyAM0
+ttyAM1
+ttyAM2
+ttyAM3
+ttyAMA0
+ttyAMA1
+ttyAMA2
+ttyAMA3
+
+# QCOM Socs
+ttyHSL0
+ttyHSL1
+ttyHSL2
+ttyHSL3
+ttyMSM0
+ttyMSM1
+ttyMSM2
+
+# Samsung ARM SoCs
+ttySAC0
+ttySAC1
+ttySAC2
+ttySAC3
+
+# STM SoCs
+ttyAS0
+ttyAS1
+ttyAS2
+ttyAS3
+
+# TI OMAP SoCs
+ttyO0
+ttyO1
+ttyO2
+ttyO3
+
+# Xilinx Zynq SoC
+ttyPS0
+ttyPS1
+
+# USB dongles
+ttyUSB0
+ttyUSB1
+ttyUSB2
+
+# USB serial gadget
+ttyGS0
+
+# PowerMac
+ttyPZ0
+ttyPZ1
+ttyPZ2
+ttyPZ3
+
+# Embedded MPC platforms
+ttyPSC0
+ttyPSC1
+ttyPSC2
+ttyPSC3
+ttyPSC4
+ttyPSC5
+
+# PA-RISC mux ports
+ttyB0
+ttyB1
+
+# Standard hypervisor virtual console
+hvc0
+
+# Oldstyle Xen console
+xvc0
+
+# Standard consoles
+tty1
+tty2
+tty3
+tty4
+tty5
+tty6
+tty7
+tty8
+tty9
+tty10
+tty11
+tty12
+tty13
+tty14
+tty15
+tty16
+tty17
+tty18
+tty19
+tty20
+tty21
+tty22
+tty23
+tty24
+tty25
+tty26
+tty27
+tty28
+tty29
+tty30
+tty31
+tty32
+tty33
+tty34
+tty35
+tty36
+tty37
+tty38
+tty39
+tty40
+tty41
+tty42
+tty43
+tty44
+tty45
+tty46
+tty47
+tty48
+tty49
+tty50
+tty51
+tty52
+tty53
+tty54
+tty55
+tty56
+tty57
+tty58
+tty59
+tty60
+tty61
+tty62
+tty63
+
+# Local X displays (allows empty passwords with pam_unix's nullok_secure)
+pts/0
+pts/1
+pts/2
+pts/3
+
+# Embedded Freescale i.MX ports
+ttymxc0
+ttymxc1
+ttymxc2
+ttymxc3
+ttymxc4
+ttymxc5
+
+# Freescale lpuart ports
+ttyLP0
+ttyLP1
+ttyLP2
+ttyLP3
+ttyLP4
+ttyLP5
+
+# Standard serial ports, with devfs
+tts/0
+tts/1
+
+# Standard consoles, with devfs
+vc/1
+vc/2
+vc/3
+vc/4
+vc/5
+vc/6
+vc/7
+vc/8
+vc/9
+vc/10
+vc/11
+vc/12
+vc/13
+vc/14
+vc/15
+vc/16
+vc/17
+vc/18
+vc/19
+vc/20
+vc/21
+vc/22
+vc/23
+vc/24
+vc/25
+vc/26
+vc/27
+vc/28
+vc/29
+vc/30
+vc/31
+vc/32
+vc/33
+vc/34
+vc/35
+vc/36
+vc/37
+vc/38
+vc/39
+vc/40
+vc/41
+vc/42
+vc/43
+vc/44
+vc/45
+vc/46
+vc/47
+vc/48
+vc/49
+vc/50
+vc/51
+vc/52
+vc/53
+vc/54
+vc/55
+vc/56
+vc/57
+vc/58
+vc/59
+vc/60
+vc/61
+vc/62
+vc/63
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
new file mode 100644
index 000000000..a7bb0a929
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
@@ -0,0 +1,27 @@
+# commit message copied from openembedded:
+# commit 246c80637b135f3a113d319b163422f98174ee6c
+# Author: Khem Raj <raj.khem@gmail.com>
+# Date: Wed Jun 9 13:37:03 2010 -0700
+#
+# shadow-4.1.4.2: Add patches to support dots in login id.
+#
+# Signed-off-by: Khem Raj <raj.khem@gmail.com>
+#
+# comment added by Kevin Tian <kevin.tian@intel.com>, 2010-08-11
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: shadow-4.1.4.2/libmisc/chkname.c
+===================================================================
+--- shadow-4.1.4.2.orig/libmisc/chkname.c 2009-04-28 12:14:04.000000000 -0700
++++ shadow-4.1.4.2/libmisc/chkname.c 2010-06-03 17:43:20.638973857 -0700
+@@ -61,6 +61,7 @@ static bool is_valid_name (const char *n
+ ( ('0' <= *name) && ('9' >= *name) ) ||
+ ('_' == *name) ||
+ ('-' == *name) ||
++ ('.' == *name) ||
+ ( ('$' == *name) && ('\0' == *(name + 1)) )
+ )) {
+ return false;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
new file mode 100644
index 000000000..15f8044fa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
@@ -0,0 +1,91 @@
+The system-auth in the configure files is from Fedora which put all the 4 pam type rules
+in one file.
+In yocto it obey the way with Debian/Ubuntu, and the names are common-auth, common-account,
+common-password and common-session.
+So update them with oe way.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/chage shadow-4.1.4.3/etc/pam.d/chage
+--- shadow-4.1.4.3/etc/pam.d.orig/chage 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/chage 2011-07-20 19:03:08.964844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/chgpasswd shadow-4.1.4.3/etc/pam.d/chgpasswd
+--- shadow-4.1.4.3/etc/pam.d.orig/chgpasswd 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/chgpasswd 2011-07-20 19:03:26.544844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupadd shadow-4.1.4.3/etc/pam.d/groupadd
+--- shadow-4.1.4.3/etc/pam.d.orig/groupadd 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupadd 2011-07-20 19:04:08.124844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupdel shadow-4.1.4.3/etc/pam.d/groupdel
+--- shadow-4.1.4.3/etc/pam.d.orig/groupdel 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupdel 2011-07-20 19:04:26.114844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupmems shadow-4.1.4.3/etc/pam.d/groupmems
+--- shadow-4.1.4.3/etc/pam.d.orig/groupmems 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupmems 2011-07-20 19:04:35.074844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupmod shadow-4.1.4.3/etc/pam.d/groupmod
+--- shadow-4.1.4.3/etc/pam.d.orig/groupmod 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupmod 2011-07-20 19:04:44.864844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/useradd shadow-4.1.4.3/etc/pam.d/useradd
+--- shadow-4.1.4.3/etc/pam.d.orig/useradd 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/useradd 2011-07-20 19:07:26.244844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/userdel shadow-4.1.4.3/etc/pam.d/userdel
+--- shadow-4.1.4.3/etc/pam.d.orig/userdel 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/userdel 2011-07-20 19:07:35.734844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/usermod shadow-4.1.4.3/etc/pam.d/usermod
+--- shadow-4.1.4.3/etc/pam.d.orig/usermod 2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/usermod 2011-07-20 19:07:42.024844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth sufficient pam_rootok.so
+ account required pam_permit.so
+-password include system-auth
++password include common-password
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch
new file mode 100644
index 000000000..37dc153fc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+usermod: fix compilation failure with subids disabled
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/usermod.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/usermod.c b/src/usermod.c
+index e7d4351..685b50a 100644
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -1360,7 +1360,7 @@ static void process_flags (int argc, char **argv)
+ Prog, (unsigned long) user_newid);
+ exit (E_UID_IN_USE);
+ }
+-
++#ifdef ENABLE_SUBIDS
+ if ( (vflg || Vflg)
+ && !is_sub_uid) {
+ fprintf (stderr,
+@@ -1376,6 +1376,7 @@ static void process_flags (int argc, char **argv)
+ Prog, sub_gid_dbname (), "-w", "-W");
+ exit (E_USAGE);
+ }
++#endif
+ }
+
+ /*
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
new file mode 100644
index 000000000..c78f888cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Provider of the machine specific securetty file"
+SECTION = "base utils"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+PR = "r3"
+
+SRC_URI = "file://securetty"
+
+S = "${WORKDIR}"
+
+# Since SERIAL_CONSOLES is likely to be set from the machine configuration
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install () {
+ # Ensure we add a suitable securetty file to the package that has
+ # most common embedded TTYs defined.
+ install -d ${D}${sysconfdir}
+ install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty
+ if [ ! -z "${SERIAL_CONSOLES}" ]; then
+ # Our SERIAL_CONSOLES contains a baud rate and sometimes extra
+ # options as well. The following pearl :) takes that and converts
+ # it into newline-separated tty's and appends them into
+ # securetty. So if a machine has a weird looking console device
+ # node (e.g. ttyAMA0) that securetty does not know, it will get
+ # appended to securetty and root logins will be allowed on that
+ # console.
+ tmp="${SERIAL_CONSOLES}"
+ for entry in $tmp ; do
+ ttydev=`echo "$entry" | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
+ if ! grep -q $ttydev ${D}${sysconfdir}/securetty; then
+ echo $ttydev >> ${D}${sysconfdir}/securetty
+ fi
+ done
+ fi
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
new file mode 100644
index 000000000..697569c47
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Shadow utils requirements for useradd.bbclass"
+HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
+BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
+SECTION = "base utils"
+LICENSE = "BSD | Artistic-1.0"
+LIC_FILES_CHKSUM = "file://login.defs_shadow-sysroot;md5=25e2f2de4dfc8f966ac5cdfce45cd7d5"
+
+DEPENDS = "base-passwd"
+
+PR = "r3"
+
+# The sole purpose of this recipe is to provide the /etc/login.defs
+# file for the target sysroot - needed so the shadow-native utilities
+# can add custom users/groups for recipes that use inherit useradd.
+SRC_URI = "file://login.defs_shadow-sysroot"
+
+SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"
+SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -p -m 755 ${S}/login.defs_shadow-sysroot ${D}${sysconfdir}/login.defs
+}
+
+sysroot_stage_all() {
+ sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
+}
+
+# don't create any packages
+# otherwise: dbus-dev depends on shadow-sysroot-dev which depends on shadow-sysroot
+# and this has another copy of /etc/login.defs already provided by shadow
+PACKAGES = ""
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc
new file mode 100644
index 000000000..d024b01dc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow.inc
@@ -0,0 +1,196 @@
+SUMMARY = "Tools to change and administer password and group data"
+HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
+BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
+SECTION = "base/utils"
+LICENSE = "BSD | Artistic-1.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ed80ff1c2b40843cf5768e5229cf16e5 \
+ file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661"
+
+DEPENDS = "shadow-native"
+DEPENDS_class-native = ""
+DEPENDS_class-nativesdk = ""
+
+SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.xz \
+ file://shadow-4.1.3-dots-in-usernames.patch \
+ file://usermod-fix-compilation-failure-with-subids-disabled.patch \
+ file://fix-installation-failure-with-subids-disabled.patch \
+ file://0001-Do-not-read-login.defs-before-doing-chroot.patch \
+ file://check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch \
+ ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \
+ "
+
+SRC_URI_append_class-target = " \
+ file://login_defs_pam.sed \
+ file://shadow-update-pam-conf.patch \
+ "
+
+SRC_URI_append_class-native = " \
+ file://0001-Disable-use-of-syslog-for-sysroot.patch \
+ file://allow-for-setting-password-in-clear-text.patch \
+ file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \
+ file://0001-useradd.c-create-parent-directories-when-necessary.patch \
+ "
+SRC_URI_append_class-nativesdk = " \
+ file://0001-Disable-use-of-syslog-for-sysroot.patch \
+ "
+
+SRC_URI[md5sum] = "2bfafe7d4962682d31b5eba65dba4fc8"
+SRC_URI[sha256sum] = "3b0893d1476766868cd88920f4f1231c4795652aa407569faff802bcda0f3d41"
+
+# Additional Policy files for PAM
+PAM_SRC_URI = "file://pam.d/chfn \
+ file://pam.d/chpasswd \
+ file://pam.d/chsh \
+ file://pam.d/login \
+ file://pam.d/newusers \
+ file://pam.d/passwd \
+ file://pam.d/su"
+
+inherit autotools gettext
+
+EXTRA_OECONF += "--without-audit \
+ --without-libcrack \
+ --without-selinux \
+ --with-group-name-max-length=24 \
+ --enable-subordinate-ids=yes \
+ ${NSCDOPT}"
+
+NSCDOPT = ""
+NSCDOPT_class-native = "--without-nscd"
+NSCDOPT_class-nativesdk = "--without-nscd"
+NSCDOPT_libc-uclibc = " --without-nscd"
+NSCDOPT_libc-glibc = "${@bb.utils.contains('DISTRO_FEATURES', 'libc-spawn', '--with-nscd', '--without-nscd', d)}"
+
+PAM_PLUGINS = "libpam-runtime \
+ pam-plugin-faildelay \
+ pam-plugin-securetty \
+ pam-plugin-nologin \
+ pam-plugin-env \
+ pam-plugin-group \
+ pam-plugin-limits \
+ pam-plugin-lastlog \
+ pam-plugin-motd \
+ pam-plugin-mail \
+ pam-plugin-shells \
+ pam-plugin-rootok"
+
+PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,${PAM_PLUGINS}"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+
+RDEPENDS_${PN} = "shadow-securetty \
+ base-passwd \
+ util-linux-sulogin"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+
+do_install() {
+ oe_runmake DESTDIR="${D}" sbindir="${base_sbindir}" usbindir="${sbindir}" install
+
+ # Info dir listing isn't interesting at this point so remove it if it exists.
+ if [ -e "${D}${infodir}/dir" ]; then
+ rm -f ${D}${infodir}/dir
+ fi
+
+ # Enable CREATE_HOME by default.
+ sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs
+
+ # As we are on an embedded system, ensure the users mailbox is in
+ # ~/ not /var/spool/mail by default, as who knows where or how big
+ # /var is. The system MDA will set this later anyway.
+ sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs
+ sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs
+
+ # Disable checking emails.
+ sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs
+
+ # Comment out SU_NAME to work correctly with busybox
+ # See Bug#5359 and Bug#7173
+ sed -i 's:^SU_NAME:#SU_NAME:g' ${D}${sysconfdir}/login.defs
+
+ # Use proper encryption for passwords
+ sed -i 's/^#ENCRYPT_METHOD.*$/ENCRYPT_METHOD SHA512/' ${D}${sysconfdir}/login.defs
+
+ # Now we don't have a mail system. Disable mail creation for now.
+ sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd
+ sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd
+
+ # Use users group by default
+ sed -i 's,^GROUP=1000,GROUP=100,g' ${D}${sysconfdir}/default/useradd
+}
+
+do_install_append() {
+ # Ensure that the image has as a /var/spool/mail dir so shadow can
+ # put mailboxes there if the user reconfigures shadow to its
+ # defaults (see sed below).
+ install -d ${D}${localstatedir}/spool/mail
+
+ if [ -e ${WORKDIR}/pam.d ]; then
+ install -d ${D}${sysconfdir}/pam.d/
+ install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
+ # Remove defaults that are not used when supporting PAM.
+ sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs
+ fi
+
+ install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir}
+
+ # Move binaries to the locations we want
+ rm ${D}${sbindir}/vigr
+ ln -sf vipw.${BPN} ${D}${base_sbindir}/vigr
+ if [ "${sbindir}" != "${base_sbindir}" ]; then
+ mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw
+ fi
+ if [ "${bindir}" != "${base_bindir}" ]; then
+ mv ${D}${bindir}/login ${D}${base_bindir}/login
+ mv ${D}${bindir}/su ${D}${base_bindir}/su
+ fi
+
+ # Handle link properly after rename, otherwise missing files would
+ # lead rpm failed dependencies.
+ ln -sf newgrp.${BPN} ${D}${bindir}/sg
+}
+
+PACKAGES =+ "${PN}-base"
+FILES_${PN}-base = "\
+ ${base_bindir}/login.shadow \
+ ${base_bindir}/su.shadow \
+ ${bindir}/sg \
+ ${bindir}/newgrp.shadow \
+ ${bindir}/groups.shadow \
+ ${sysconfdir}/pam.d/login \
+ ${sysconfdir}/pam.d/su \
+ ${sysconfdir}/login.defs \
+"
+RDEPENDS_${PN} += "${PN}-base"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "200"
+
+ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr"
+ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
+ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
+ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
+
+ALTERNATIVE_${PN}-base = "newgrp groups login su"
+ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
+ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
+
+ALTERNATIVE_${PN}-doc = "passwd.5 getspnam.3 groups.1"
+ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
+ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
+ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
+
+pkg_postinst_${PN} () {
+ if [ "x$D" != "x" ]; then
+ rootarg="--root $D"
+ else
+ rootarg=""
+ fi
+
+ pwconv $rootarg || exit 1
+ grpconv $rootarg || exit 1
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow_4.2.1.bb b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow_4.2.1.bb
new file mode 100644
index 000000000..5675cb8cc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/shadow/shadow_4.2.1.bb
@@ -0,0 +1,10 @@
+require shadow.inc
+
+# Build falsely assumes that if --enable-libpam is set, we don't need to link against
+# libcrypt. This breaks chsh.
+BUILD_LDFLAGS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', bb.utils.contains('DISTRO_FEATURES', 'libc-crypt', '-lcrypt', '', d), '', d)}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch
new file mode 100644
index 000000000..57ebfe432
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch
@@ -0,0 +1,39 @@
+From 96eb7e29822151823a66a1eb59f1fa4aead5ae08 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 06:33:21 +0000
+Subject: [PATCH] Fix error: conflicting types for 'posix_close'
+
+Exposed while compiling on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/slposio.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/slposio.c b/src/slposio.c
+index 9ce9697..9ff9bfe 100644
+--- a/src/slposio.c
++++ b/src/slposio.c
+@@ -363,7 +363,7 @@ static int posix_close_fd (int *fd)
+ return 0;
+ }
+
+-static int posix_close (SLFile_FD_Type *f)
++static int posix_closex (SLFile_FD_Type *f)
+ {
+ int status = do_close (f);
+
+@@ -1001,7 +1001,7 @@ static SLang_Intrin_Fun_Type Fd_Name_Table [] =
+ MAKE_INTRINSIC_2("write", posix_write, V, F, B),
+ MAKE_INTRINSIC_1("dup_fd", posix_dup, V, F),
+ MAKE_INTRINSIC_2("dup2_fd", posix_dup2, I, F, I),
+- MAKE_INTRINSIC_1("close", posix_close, I, F),
++ MAKE_INTRINSIC_1("close", posix_closex, I, F),
+ MAKE_INTRINSIC_1("_close", posix_close_fd, I, I),
+ #if defined(TTYNAME_R)
+ MAKE_INTRINSIC_0("ttyname", posix_ttyname, V),
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch
new file mode 100644
index 000000000..2ea1ffda5
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch
@@ -0,0 +1,218 @@
+slang: change char type to signed char in macros
+
+C language has 3 distinct char types:
+ char
+ unsigned char
+ signed char
+A char has the same range of values as signed char on X86,
+but same as unsigned char on ARM which made Slang's typecast()
+and array_sort() unable to work for char value on ARM, since
+Slang is assuming "char" as "signed char".
+
+Now we change "char" as "signed char" explicitly in
+util/mkslarith2.sl, and use it to regenerate src/slarith2.inc
+
+Upstream-Status: Submitted
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ src/slarith2.inc | 72 ++++++++++++++++++++++++-------------------------
+ src/util/mkslarith2.sl | 2 -
+ 2 files changed, 37 insertions(+), 37 deletions(-)
+
+--- a/src/util/mkslarith2.sl
++++ b/src/util/mkslarith2.sl
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env slsh
+
+ private variable CTypes =
+- ["char", "unsigned char", "short", "unsigned short", "int", "unsigned int",
++ ["signed char", "unsigned char", "short", "unsigned short", "int", "unsigned int",
+ "long", "unsigned long", "long long", "unsigned long long",
+ "float", "double", "long double"];
+ private variable Is_Int_Type =
+--- a/src/slarith2.inc
++++ b/src/slarith2.inc
+@@ -1,43 +1,43 @@
+ /* DO NOT EDIT -- this file was generated by src/util/mkslarith2.sl */
+-/* ------------ char ---------- */
+-DEFUN_1(copy_char_to_char,char,char)
++/* ------------ signed char ---------- */
++DEFUN_1(copy_char_to_char,signed char,signed char)
+ #define char_to_char NULL
+ #define copy_char_to_uchar copy_char_to_char
+ #define char_to_uchar NULL
+-DEFUN_1(copy_char_to_short,char,short)
++DEFUN_1(copy_char_to_short,signed char,short)
+ #define char_to_short NULL
+-DEFUN_1(copy_char_to_ushort,char,unsigned short)
++DEFUN_1(copy_char_to_ushort,signed char,unsigned short)
+ #define char_to_ushort NULL
+-DEFUN_1(copy_char_to_int,char,int)
+-DEFUN_2(char_to_int,char,int,copy_char_to_int)
+-DEFUN_1(copy_char_to_uint,char,unsigned int)
+-DEFUN_2(char_to_uint,char,unsigned int,copy_char_to_uint)
+-DEFUN_1(copy_char_to_long,char,long)
+-DEFUN_2(char_to_long,char,long,copy_char_to_long)
+-DEFUN_1(copy_char_to_ulong,char,unsigned long)
+-DEFUN_2(char_to_ulong,char,unsigned long,copy_char_to_ulong)
++DEFUN_1(copy_char_to_int,signed char,int)
++DEFUN_2(char_to_int,signed char,int,copy_char_to_int)
++DEFUN_1(copy_char_to_uint,signed char,unsigned int)
++DEFUN_2(char_to_uint,signed char,unsigned int,copy_char_to_uint)
++DEFUN_1(copy_char_to_long,signed char,long)
++DEFUN_2(char_to_long,signed char,long,copy_char_to_long)
++DEFUN_1(copy_char_to_ulong,signed char,unsigned long)
++DEFUN_2(char_to_ulong,signed char,unsigned long,copy_char_to_ulong)
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_char_to_llong,char,long long)
+-DEFUN_2(char_to_llong,char,long long,copy_char_to_llong)
++DEFUN_1(copy_char_to_llong,signed char,long long)
++DEFUN_2(char_to_llong,signed char,long long,copy_char_to_llong)
+ #endif /* defined(HAVE_LONG_LONG) */
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_char_to_ullong,char,unsigned long long)
+-DEFUN_2(char_to_ullong,char,unsigned long long,copy_char_to_ullong)
++DEFUN_1(copy_char_to_ullong,signed char,unsigned long long)
++DEFUN_2(char_to_ullong,signed char,unsigned long long,copy_char_to_ullong)
+ #endif /* defined(HAVE_LONG_LONG) */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_char_to_float,char,float)
+-DEFUN_2(char_to_float,char,float,copy_char_to_float)
++DEFUN_1(copy_char_to_float,signed char,float)
++DEFUN_2(char_to_float,signed char,float,copy_char_to_float)
+ #endif /* SLANG_HAS_FLOAT */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_char_to_double,char,double)
+-DEFUN_2(char_to_double,char,double,copy_char_to_double)
++DEFUN_1(copy_char_to_double,signed char,double)
++DEFUN_2(char_to_double,signed char,double,copy_char_to_double)
+ #endif /* SLANG_HAS_FLOAT */
+ #if defined(HAVE_LONG_DOUBLE)
+-DEFUN_1(copy_char_to_ldouble,char,long double)
+-DEFUN_2(char_to_ldouble,char,long double,copy_char_to_ldouble)
++DEFUN_1(copy_char_to_ldouble,signed char,long double)
++DEFUN_2(char_to_ldouble,signed char,long double,copy_char_to_ldouble)
+ #endif /* defined(HAVE_LONG_DOUBLE) */
+ #if SLANG_HAS_FLOAT
+-TO_DOUBLE_FUN(char_to_one_double,char)
++TO_DOUBLE_FUN(char_to_one_double,signed char)
+ #endif
+
+ /* ------------ unsigned char ---------- */
+@@ -82,7 +82,7 @@ TO_DOUBLE_FUN(uchar_to_one_double,unsign
+ #endif
+
+ /* ------------ short ---------- */
+-DEFUN_1(copy_short_to_char,short,char)
++DEFUN_1(copy_short_to_char,short,signed char)
+ #define short_to_char NULL
+ DEFUN_1(copy_short_to_uchar,short,unsigned char)
+ #define short_to_uchar NULL
+@@ -123,7 +123,7 @@ TO_DOUBLE_FUN(short_to_one_double,short)
+ #endif
+
+ /* ------------ unsigned short ---------- */
+-DEFUN_1(copy_ushort_to_char,unsigned short,char)
++DEFUN_1(copy_ushort_to_char,unsigned short,signed char)
+ #define ushort_to_char NULL
+ DEFUN_1(copy_ushort_to_uchar,unsigned short,unsigned char)
+ #define ushort_to_uchar NULL
+@@ -164,7 +164,7 @@ TO_DOUBLE_FUN(ushort_to_one_double,unsig
+ #endif
+
+ /* ------------ int ---------- */
+-DEFUN_1(copy_int_to_char,int,char)
++DEFUN_1(copy_int_to_char,int,signed char)
+ #define int_to_char NULL
+ DEFUN_1(copy_int_to_uchar,int,unsigned char)
+ #define int_to_uchar NULL
+@@ -205,7 +205,7 @@ TO_DOUBLE_FUN(int_to_one_double,int)
+ #endif
+
+ /* ------------ unsigned int ---------- */
+-DEFUN_1(copy_uint_to_char,unsigned int,char)
++DEFUN_1(copy_uint_to_char,unsigned int,signed char)
+ #define uint_to_char NULL
+ DEFUN_1(copy_uint_to_uchar,unsigned int,unsigned char)
+ #define uint_to_uchar NULL
+@@ -246,7 +246,7 @@ TO_DOUBLE_FUN(uint_to_one_double,unsigne
+ #endif
+
+ /* ------------ long ---------- */
+-DEFUN_1(copy_long_to_char,long,char)
++DEFUN_1(copy_long_to_char,long,signed char)
+ #define long_to_char NULL
+ DEFUN_1(copy_long_to_uchar,long,unsigned char)
+ #define long_to_uchar NULL
+@@ -287,7 +287,7 @@ TO_DOUBLE_FUN(long_to_one_double,long)
+ #endif
+
+ /* ------------ unsigned long ---------- */
+-DEFUN_1(copy_ulong_to_char,unsigned long,char)
++DEFUN_1(copy_ulong_to_char,unsigned long,signed char)
+ #define ulong_to_char NULL
+ DEFUN_1(copy_ulong_to_uchar,unsigned long,unsigned char)
+ #define ulong_to_uchar NULL
+@@ -329,7 +329,7 @@ TO_DOUBLE_FUN(ulong_to_one_double,unsign
+
+ /* ------------ long long ---------- */
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_llong_to_char,long long,char)
++DEFUN_1(copy_llong_to_char,long long,signed char)
+ #define llong_to_char NULL
+ DEFUN_1(copy_llong_to_uchar,long long,unsigned char)
+ #define llong_to_uchar NULL
+@@ -372,7 +372,7 @@ TO_DOUBLE_FUN(llong_to_one_double,long l
+
+ /* ------------ unsigned long long ---------- */
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_ullong_to_char,unsigned long long,char)
++DEFUN_1(copy_ullong_to_char,unsigned long long,signed char)
+ #define ullong_to_char NULL
+ DEFUN_1(copy_ullong_to_uchar,unsigned long long,unsigned char)
+ #define ullong_to_uchar NULL
+@@ -415,7 +415,7 @@ TO_DOUBLE_FUN(ullong_to_one_double,unsig
+
+ /* ------------ float ---------- */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_float_to_char,float,char)
++DEFUN_1(copy_float_to_char,float,signed char)
+ #define float_to_char NULL
+ DEFUN_1(copy_float_to_uchar,float,unsigned char)
+ #define float_to_uchar NULL
+@@ -458,7 +458,7 @@ TO_DOUBLE_FUN(float_to_one_double,float)
+
+ /* ------------ double ---------- */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_double_to_char,double,char)
++DEFUN_1(copy_double_to_char,double,signed char)
+ #define double_to_char NULL
+ DEFUN_1(copy_double_to_uchar,double,unsigned char)
+ #define double_to_uchar NULL
+@@ -501,7 +501,7 @@ TO_DOUBLE_FUN(double_to_one_double,doubl
+
+ /* ------------ long double ---------- */
+ #if defined(HAVE_LONG_DOUBLE)
+-DEFUN_1(copy_ldouble_to_char,long double,char)
++DEFUN_1(copy_ldouble_to_char,long double,signed char)
+ #define ldouble_to_char NULL
+ DEFUN_1(copy_ldouble_to_uchar,long double,unsigned char)
+ #define ldouble_to_uchar NULL
+@@ -545,7 +545,7 @@ TO_DOUBLE_FUN(ldouble_to_one_double,long
+ #if SLANG_HAS_FLOAT
+ static To_Double_Fun_Table_Type To_Double_Fun_Table [MAX_ARITHMETIC_TYPES] =
+ {
+- {sizeof(char), char_to_one_double},
++ {sizeof(signed char), char_to_one_double},
+ {sizeof(unsigned char), uchar_to_one_double},
+ {sizeof(short), short_to_one_double},
+ {sizeof(unsigned short), ushort_to_one_double},
+@@ -583,7 +583,7 @@ static To_Double_Fun_Table_Type To_Doubl
+
+ static Binary_Matrix_Type Binary_Matrix [MAX_ARITHMETIC_TYPES][MAX_ARITHMETIC_TYPES] =
+ {
+- /* char */
++ /* signed char */
+ {
+ {(FVOID_STAR)copy_char_to_char, char_to_char},
+ {(FVOID_STAR)copy_char_to_uchar, char_to_uchar},
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch
new file mode 100644
index 000000000..0c1553a66
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/fix-check-pcre.patch
@@ -0,0 +1,108 @@
+fix the pcre existence checking
+
+when check if there is pcre, the configure file always check
+the host dir. now we make it work by adding correct prefix for
+cross-compile environment.
+
+When enable pcre-module, we see a QA warning because rpaths
+hardcoded into the build, rpaths are not needed, so lets turn
+this off.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ configure | 60 ++++++------------------------------------------------------
+ 1 files changed, 6 insertions(+), 54 deletions(-)
+
+diff --git a/configure b/configure
+index f1586c3..d22814f 100755
+--- a/configure
++++ b/configure
+@@ -6991,6 +6991,7 @@ $as_echo_n "checking for the pcre library and header files ... " >&6; }
+ /usr/include/pcre,/usr/lib \
+ /usr/pcre/include,/usr/pcre/lib \
+ /usr/include,/usr/lib \
++ /usr/include,/usr/lib64 \
+ /opt/include/pcre,/opt/lib \
+ /opt/pcre/include,/opt/pcre/lib \
+ /opt/include,/opt/lib"
+@@ -7021,14 +7022,14 @@ $as_echo_n "checking for the pcre library and header files ... " >&6; }
+ xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'`
+ xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'`
+ found=0
+- if test -r $xincdir/$xincfile
++ if test -r $PKG_CONFIG_SYSROOT_DIR/$xincdir/$xincfile
+ then
+ for E in $exts
+ do
+- if test -r "$xlibdir/$xlibfile.$E"
++ if test -r "$PKG_CONFIG_SYSROOT_DIR/$xlibdir/$xlibfile.$E"
+ then
+- jd_pcre_include_dir="$xincdir"
+- jd_pcre_library_dir="$xlibdir"
++ jd_pcre_include_dir="$PKG_CONFIG_SYSROOT_DIR/$xincdir"
++ jd_pcre_library_dir="$PKG_CONFIG_SYSROOT_DIR/$xlibdir"
+ jd_with_pcre_library="yes"
+ found=1
+ break
+@@ -7054,56 +7055,7 @@ $as_echo "yes: $jd_pcre_library_dir and $jd_pcre_include_dir" >&6; }
+ then
+ PCRE_LIB=""
+ else
+-
+-if test "X$jd_pcre_library_dir" != "X"
+-then
+- if test "X$RPATH" = "X"
+- then
+-
+-case "$host_os" in
+- *linux*|*solaris* )
+- if test "X$GCC" = Xyes
+- then
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-Wl,-R,"
+- else
+- RPATH="-Wl,-R"
+- fi
+- else
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-R "
+- else
+- RPATH="-R"
+- fi
+- fi
+- ;;
+- *osf*|*openbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-rpath,"
+- else
+- RPATH="-rpath "
+- fi
+- ;;
+- *netbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-R"
+- fi
+- ;;
+-esac
+-
+- if test "X$RPATH" != "X"
+- then
+- RPATH="$RPATH$jd_pcre_library_dir"
+- fi
+- else
+- RPATH="$RPATH:$jd_pcre_library_dir"
+- fi
+-fi
+-
++ RPATH=""
+ fi
+
+ PCRE_INC=-I$jd_pcre_include_dir
+--
+1.7.4.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch
new file mode 100644
index 000000000..50cac9264
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/rpathfix.patch
@@ -0,0 +1,70 @@
+Without this patch we see rpaths hardcoded into the build which results in QA
+warnings. These rpaths are not needed so lets turn this off.
+
+Upstream-Status: Inappropriate
+(but could be turned into a proper configure option)
+
+RP 2012/03/14
+
+Index: slang-2.2.4/configure
+===================================================================
+--- slang-2.2.4.orig/configure 2012-03-14 23:40:01.283560679 +0000
++++ slang-2.2.4/configure 2012-03-14 23:41:18.023558900 +0000
+@@ -6081,56 +6081,7 @@
+ ELF_CFLAGS="$ELF_CFLAGS $IEEE_CFLAGS"
+ CFLAGS="$CFLAGS $IEEE_CFLAGS"
+
+-
+-if test "X$libdir" != "X"
+-then
+- if test "X$RPATH" = "X"
+- then
+-
+-case "$host_os" in
+- *linux*|*solaris* )
+- if test "X$GCC" = Xyes
+- then
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-Wl,-R,"
+- else
+- RPATH="-Wl,-R"
+- fi
+- else
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-R "
+- else
+- RPATH="-R"
+- fi
+- fi
+- ;;
+- *osf*|*openbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-rpath,"
+- else
+- RPATH="-rpath "
+- fi
+- ;;
+- *netbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-R"
+- fi
+- ;;
+-esac
+-
+- if test "X$RPATH" != "X"
+- then
+- RPATH="$RPATH$libdir"
+- fi
+- else
+- RPATH="$RPATH:$libdir"
+- fi
+-fi
+-
++RPATH=""
+
+ # The cast to long int works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch
new file mode 100644
index 000000000..958fe983c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch
@@ -0,0 +1,116 @@
+From 4588f4a0287787788eb86fb16f326cbaa7454e1d Mon Sep 17 00:00:00 2001
+From: Zheng Junling <zhengjunling@huawei.com>
+Date: Mon, 16 Jun 2014 12:51:25 +0000
+Subject: [PATCH] slang: fix the iconv existence checking
+
+When checking whether there is iconv, the configure file always check
+the host env.
+
+Now we make it working properly by adding correct prefix for cross-
+compiling environment.
+
+When enabling iconv-module, we see a QA warning because rpaths hardcoded
+into the build. And rpaths are not needed, so let's turn this off.
+
+This patch is generated by referencing the existing "fix-check-pcre"
+patch.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Zheng Junling <zhengjunling@huawei.com>
+---
+ configure | 60 ++++++------------------------------------------------------
+ 1 file changed, 6 insertions(+), 54 deletions(-)
+
+diff --git a/configure b/configure
+index 7a96256..91632f3 100755
+--- a/configure
++++ b/configure
+@@ -7909,6 +7909,7 @@ $as_echo_n "checking for the iconv library and header files ... " >&6; }
+ /usr/include/iconv,/usr/lib \
+ /usr/iconv/include,/usr/iconv/lib \
+ /usr/include,/usr/lib \
++ /usr/include,/usr/lib64 \
+ /opt/include/iconv,/opt/lib \
+ /opt/iconv/include,/opt/iconv/lib \
+ /opt/include,/opt/lib"
+@@ -7939,14 +7940,14 @@ $as_echo_n "checking for the iconv library and header files ... " >&6; }
+ xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'`
+ xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'`
+ found=0
+- if test -r $xincdir/$xincfile
++ if test -r $PKG_CONFIG_SYSROOT_DIR/$xincdir/$xincfile
+ then
+ for E in $exts
+ do
+- if test -r "$xlibdir/$xlibfile.$E"
++ if test -r "$PKG_CONFIG_SYSROOT_DIR/$xlibdir/$xlibfile.$E"
+ then
+- jd_iconv_include_dir="$xincdir"
+- jd_iconv_library_dir="$xlibdir"
++ jd_iconv_include_dir="$PKG_CONFIG_SYSROOT_DIR/$xincdir"
++ jd_iconv_library_dir="$PKG_CONFIG_SYSROOT_DIR/$xlibdir"
+ jd_with_iconv_library="yes"
+ found=1
+ break
+@@ -7972,56 +7973,7 @@ $as_echo "yes: $jd_iconv_library_dir and $jd_iconv_include_dir" >&6; }
+ then
+ ICONV_LIB=""
+ else
+-
+-if test "X$jd_iconv_library_dir" != "X"
+-then
+- if test "X$RPATH" = "X"
+- then
+-
+-case "$host_os" in
+- *linux*|*solaris* )
+- if test "X$GCC" = Xyes
+- then
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-Wl,-R,"
+- else
+- RPATH="-Wl,-R"
+- fi
+- else
+- if test "X$ac_R_nospace" = "Xno"
+- then
+- RPATH="-R "
+- else
+- RPATH="-R"
+- fi
+- fi
+- ;;
+- *osf*|*openbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-rpath,"
+- else
+- RPATH="-rpath "
+- fi
+- ;;
+- *netbsd*)
+- if test "X$GCC" = Xyes
+- then
+- RPATH="-Wl,-R"
+- fi
+- ;;
+-esac
+-
+- if test "X$RPATH" != "X"
+- then
+- RPATH="$RPATH$jd_iconv_library_dir"
+- fi
+- else
+- RPATH="$RPATH:$jd_iconv_library_dir"
+- fi
+-fi
+-
++ RPATH=""
+ fi
+
+ ICONV_INC=-I$jd_iconv_include_dir
+--
+1.8.3.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch
new file mode 100644
index 000000000..420001b08
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Backport
+
+From 3a05d1a920140e9f2c72791c12f664213feb46df Mon Sep 17 00:00:00 2001
+From: Manfred Hanke <Manfred.Hanke@tngtech.com>
+Date: Thu, 20 Jun 2013 10:24:12 +0200
+Subject: [PATCH] sprintf bug (concerning %c for 8-bit character in non-UTF8
+ mode) fixed
+
+char *str points to SLuchar_Type utf8_buf[], which had too small scope
+
+src/test/strops.sl failed in the following environment:
+ - compiler: gcc (Debian 4.7.2-5) 4.7.2
+ - CFLAGS: -g -O2
+ - libc: GNU C Library (Debian EGLIBC 2.13-38) stable release version 2.13
+ - kernel: 3.2.0-4-686-pae #1 SMP Debian 3.2.39-2 i686 GNU/Linux
+---
+ src/slstrops.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/slstrops.c b/src/slstrops.c
+index ce6acb0..cbbbb01 100644
+--- a/src/slstrops.c
++++ b/src/slstrops.c
+@@ -1884,6 +1884,7 @@ static char *SLdo_sprintf (char *fmt) /*{{{*/
+ #endif
+ unsigned char uch;
+ int use_long = 0, use_alt_format = 0;
++ SLuchar_Type utf8_buf[SLUTF8_MAX_MBLEN+1];
+
+ while (1)
+ {
+@@ -2071,7 +2072,6 @@ static char *SLdo_sprintf (char *fmt) /*{{{*/
+ #endif
+ {
+ SLwchar_Type wc;
+- SLuchar_Type utf8_buf[SLUTF8_MAX_MBLEN+1];
+
+ if (-1 == SLang_pop_wchar (&wc))
+ return out;
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.2.4.bb b/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.2.4.bb
new file mode 100644
index 000000000..237e9f252
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/slang/slang_2.2.4.bb
@@ -0,0 +1,54 @@
+SUMMARY = "The shared library for the S-Lang extension language"
+
+DESCRIPTION = "S-Lang is an interpreted language and a programming library. The \
+S-Lang language was designed so that it can be easily embedded into \
+a program to provide the program with a powerful extension language. \
+The S-Lang library, provided in this package, provides the S-Lang \
+extension language. S-Lang's syntax resembles C, which makes it easy \
+to recode S-Lang procedures in C if you need to."
+
+HOMEPAGE = "http://www.jedsoft.org/slang/"
+SECTION = "libs"
+DEPENDS = "pcre ncurses"
+PR = "r12"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a52a18a472d4f7e45479b06563717c02"
+
+
+SRC_URI = "http://www.jedsoft.org/releases/slang/old/slang-${PV}.tar.bz2 \
+ file://rpathfix.patch \
+ file://fix-check-pcre.patch \
+ file://change-char-type-to-signed-char-in-macros.patch \
+ file://sprintf-bug-concerning-8-bit-characters.patch \
+ file://slang-fix-the-iconv-existence-checking.patch \
+ file://0001-Fix-error-conflicting-types-for-posix_close.patch \
+ "
+UPSTREAM_CHECK_URI = "http://www.jedsoft.org/releases/slang/"
+
+inherit autotools-brokensep
+
+CLEANBROKEN = "1"
+
+SRC_URI[md5sum] = "7fcfd447e378f07dd0c0bae671fe6487"
+SRC_URI[sha256sum] = "9a8257a9a2a55099af858b13338dc8f3a06dd2069f46f0df2c9c3bb84a01d5db"
+
+EXTRA_OECONF += " --without-z --without-png --without-onig --x-includes=${STAGING_DIR_HOST}/usr/include/X11 --x-libraries=${STAGING_DIR_HOST}/usr/lib"
+
+do_configure_prepend() {
+ # slang keeps configure.ac and rest of autoconf files in autoconf/ directory
+ # we have to go there to be able to run gnu-configize cause it expects configure.{in,ac}
+ # to be present. Resulting files land in autoconf/autoconf/ so we need to move them.
+ cd ${S}/autoconf && gnu-configize --force && mv autoconf/config.* .
+ cd ${B}
+}
+
+do_install() {
+ oe_runmake install DESTDIR=${D} -e 'INST_LIB_DIR=${STAGING_DIR_HOST}/usr/lib'
+}
+
+FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/"
+
+PARALLEL_MAKE = ""
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch b/import-layers/yocto-poky/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch
new file mode 100644
index 000000000..032995db8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch
@@ -0,0 +1,16 @@
+This patch fixies the wrong return code of stat -h.
+
+Upstream-Status: Pending
+Signed-off-by: Zhangle Yang <zhangle.yang@windriver.com>
+
+--- stat-3.3/stat.c.orig 2013-08-22 10:49:45.000000000 +0800
++++ stat-3.3/stat.c 2013-08-22 10:50:31.000000000 +0800
+@@ -845,7 +845,7 @@
+ fprintf(stderr, "\t\t%%S - Security ID in SE-Linux\n");
+ fprintf(stderr, "\t\t%%C - Security context in SE-Linux\n");
+ fprintf(stderr, "\t\t%%d - Free file nodes in file system\n");
+- exit(1);
++ exit(0);
+ }
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/stat/stat_3.3.bb b/import-layers/yocto-poky/meta/recipes-extended/stat/stat_3.3.bb
new file mode 100644
index 000000000..a5ece0744
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/stat/stat_3.3.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Command line file status display utility"
+DESCRIPTION = "Displays all information about a file that the stat() call provides and all information about a filesystem that statfs() provides."
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=39886b077fd072e876e5c4c16310b631 \
+ file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://www.ibiblio.org/pub/Linux/utils/file/${BP}.tar.gz \
+ file://fix-error-return.patch"
+
+SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
+SRC_URI[sha256sum] = "7071f0384a423a938dd542c1f08547a02824f6359acd3ef3f944b2c4c2d1ee09"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+ install -d ${D}${base_bindir} ${D}${mandir}/man1
+ install -m 755 stat ${D}${base_bindir}/stat.stat
+ install -m 644 stat.1 ${D}${mandir}/man1
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "stat"
+ALTERNATIVE_PRIORITY[stat] = "200"
+ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
+ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
+
+ALTERNATIVE_${PN}-doc = "stat.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+BBCLASSEXTEND = "native"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/stress/files/texinfo.patch b/import-layers/yocto-poky/meta/recipes-extended/stress/files/texinfo.patch
new file mode 100644
index 000000000..5ac595192
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/stress/files/texinfo.patch
@@ -0,0 +1,79 @@
+--- a/doc/stress.texi
++++ b/doc/stress.texi
+@@ -62,47 +62,47 @@
+
+ @table @samp
+ @item -?
+-@itemx --help
++@item --help
+ Show help information.
+
+-@itemx --version
++@item --version
+ Show version information.
+
+ @item -v
+-@itemx --verbose
++@item --verbose
+ Turn up verbosity.
+
+ @item -q
+-@itemx --quiet
++@item --quiet
+ Turn down verbosity.
+
+ @item -n
+-@itemx --dry-run
++@item --dry-run
+ Show what would have been done.
+
+ @item -t @var{secs}
+-@itemx --timeout @var{secs}
++@item --timeout @var{secs}
+ Time out after @var{secs} seconds.
+
+-@itemx --backoff @var{usecs}
++@item --backoff @var{usecs}
+ Wait for factor of @var{usecs} microseconds before starting work.
+
+ @item -c @var{forks}
+-@itemx --cpu @var{forks}
++@item --cpu @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{sqrt()}.
+
+ @item -i @var{forks}
+-@itemx --io @var{forks}
++@item --io @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{sync()}.
+
+ @item -m @var{forks}
+-@itemx --vm @var{forks}
++@item --vm @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{malloc()}.
+
+-@itemx --vm-bytes @var{bytes}
++@item --vm-bytes @var{bytes}
+ Allocate @var{bytes} number of bytes. The default is 1.
+
+-@itemx --vm-hang
++@item --vm-hang
+ Instruct each vm hog process to go to sleep after allocating memory. This
+ contrasts with their normal behavior, which is to free the memory and
+ reallocate @emph{ad infinitum}. This is useful for simulating low memory
+@@ -114,13 +114,13 @@
+ @end example
+
+ @item -d @var{forks}
+-@itemx --hdd @var{forks}
++@item --hdd @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{write()}.
+
+-@itemx --hdd-bytes @var{bytes}
++@item --hdd-bytes @var{bytes}
+ Write @var{bytes} number of bytes. The default is 1GB.
+
+-@itemx --hdd-noclean
++@item --hdd-noclean
+ Do not unlink file(s) to which random ASCII data is written.
+
+ @end table
diff --git a/import-layers/yocto-poky/meta/recipes-extended/stress/stress_1.0.4.bb b/import-layers/yocto-poky/meta/recipes-extended/stress/stress_1.0.4.bb
new file mode 100644
index 000000000..e9179d3e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/stress/stress_1.0.4.bb
@@ -0,0 +1,15 @@
+SUMMARY = "System load testing utility"
+DESCRIPTION = "Deliberately simple workload generator for POSIX systems. It \
+imposes a configurable amount of CPU, memory, I/O, and disk stress on the system."
+HOMEPAGE = "http://people.seas.harvard.edu/~apw/stress/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "http://people.seas.harvard.edu/~apw/${BPN}/${BP}.tar.gz \
+ file://texinfo.patch \
+ "
+
+SRC_URI[md5sum] = "890a4236dd1656792f3ef9a190cf99ef"
+SRC_URI[sha256sum] = "057e4fc2a7706411e1014bf172e4f94b63a12f18412378fca8684ca92408825b"
+
+inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sudo/files/sudo.pam b/import-layers/yocto-poky/meta/recipes-extended/sudo/files/sudo.pam
new file mode 100644
index 000000000..515eab0c6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sudo/files/sudo.pam
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth include common-auth
+account include common-account
+password include common-password
+session optional pam_keyinit.so revoke
+session required pam_limits.so
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc
new file mode 100644
index 000000000..a25876b7f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo.inc
@@ -0,0 +1,40 @@
+SUMMARY = "Provide limited super user privileges to specific users"
+DESCRIPTION = "Sudo (superuser do) allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root while logging all commands and arguments."
+HOMEPAGE = "http://www.sudo.ws"
+BUGTRACKER = "http://www.sudo.ws/bugs/"
+SECTION = "admin"
+LICENSE = "ISC & BSD & Zlib"
+LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=c16e542408abda013d672be8eb88d174 \
+ file://plugins/sudoers/redblack.c;beginline=1;endline=41;md5=cfe41112f96c19a074934d128f45c693 \
+ file://lib/util/reallocarray.c;beginline=3;endline=16;md5=85b0905b795d4d58bf2e00635649eec6 \
+ file://lib/util/fnmatch.c;beginline=3;endline=27;md5=67f83ee9bd456557397082f8f1be0efd \
+ file://lib/util/getcwd.c;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \
+ file://lib/util/glob.c;beginline=6;endline=31;md5=5872733146b9eb0deb79e1f664815b85 \
+ file://lib/util/snprintf.c;beginline=6;endline=34;md5=c82c1b3a5c32e08545c9ec5d71e41e50 \
+ file://include/sudo_queue.h;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \
+ file://lib/util/inet_pton.c;beginline=3;endline=17;md5=3970ab0518ab79cbd0bafb697f10b33a"
+
+inherit autotools
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
+
+CONFFILES_${PN} = "${sysconfdir}/sudoers"
+
+EXTRA_OECONF = "--with-editor=/bin/vi --with-env-editor"
+
+EXTRA_OECONF_append_libc-musl = " --disable-hardening "
+
+# mksigname/mksiglist are used on build host to generate source files
+do_compile_prepend () {
+ oe_runmake SSP_CFLAGS="" SSP_LDFLAGS="" CC="$BUILD_CC" CFLAGS="$BUILD_CFLAGS" CPPFLAGS="$BUILD_CPPFLAGS -I${S}/include -I${S} -I${B}" -C lib/util mksigname mksiglist
+}
+
+# Explicitly create ${localstatedir}/lib before do_install to ensure
+# the directory is accessible by all users. Otherwise the mkinstalldirs
+# script (from sudo) will recursively create ${localstatedir}/lib/sudo
+# and then chmod each directory with 0700 permissions, which isn't what
+# we want (i.e, users would not be able to access /var/lib).
+do_install_prepend (){
+ mkdir -p ${D}/${localstatedir}/lib
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch
new file mode 100644
index 000000000..eb36cd49b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch
@@ -0,0 +1,34 @@
+From 386e2c2fa2ab2e02ef71c268a57205139be329ab Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 07:07:49 +0000
+Subject: [PATCH] Include sys/types.h for id_t definition
+
+/sudo_util.h:219:14: error: unknown type name 'id_t'
+ __dso_public id_t sudo_strtoid_v1(const char *str, const char *sep,
+ char **endp, const char **errstr);
+ ^
+ make[1]: *** [preserve_fds.o] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ include/sudo_util.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/sudo_util.h b/include/sudo_util.h
+index 89c9f89..ac0855a 100644
+--- a/include/sudo_util.h
++++ b/include/sudo_util.h
+@@ -17,6 +17,8 @@
+ #ifndef SUDO_UTIL_H
+ #define SUDO_UTIL_H
+
++#include <sys/types.h>
++
+ #ifdef HAVE_STDBOOL_H
+ # include <stdbool.h>
+ #else
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.15.bb b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.15.bb
new file mode 100644
index 000000000..042043ece
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sudo/sudo_1.8.15.bb
@@ -0,0 +1,36 @@
+require sudo.inc
+
+SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+ file://0001-Include-sys-types.h-for-id_t-definition.patch \
+ "
+
+PAM_SRC_URI = "file://sudo.pam"
+
+SRC_URI[md5sum] = "7cf6b9b76d0478a572432bed481dd7b5"
+SRC_URI[sha256sum] = "4316381708324da8b6cb151f655c1a11855207c7c02244d8ffdea5104d7cc308"
+
+DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}"
+
+EXTRA_OECONF += " \
+ ac_cv_type_rsize_t=no \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-tmpfiles.d=${libdir}/tmpfiles.d', '--disable-tmpfiles.d', d)} \
+ "
+
+do_install_append () {
+ if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+ install -D -m 644 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo
+ fi
+
+ chmod 4111 ${D}${bindir}/sudo
+ chmod 0440 ${D}${sysconfdir}/sudoers
+
+ # Explicitly remove the ${localstatedir}/run directory to avoid QA error
+ rmdir -p --ignore-fail-on-non-empty ${D}${localstatedir}/run/sudo
+}
+
+FILES_${PN} += "${libdir}/tmpfiles.d"
+FILES_${PN}-dev += "${libexecdir}/${BPN}/lib*${SOLIBSDEV} ${libexecdir}/${BPN}/*.la \
+ ${libexecdir}/lib*${SOLIBSDEV} ${libexecdir}/*.la"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
new file mode 100644
index 000000000..9567946c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/0001-Fix-build-with-musl.patch
@@ -0,0 +1,132 @@
+From f0af5bcfd753691652eac35efbcb208c933253f1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 05:11:53 +0000
+Subject: [PATCH] Fix build with musl
+
+Explicitly include fcntl.h since with glibc is comes in as indirect
+include but not with musl
+
+linux/time.h inclusion is not required on musl so using !__GLIBC__ is
+not right for musl here
+
+wait type is glibc specific
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ klogd.c | 10 +---------
+ ksym_mod.c | 5 +----
+ pidfile.c | 1 +
+ syslog.c | 3 ++-
+ syslogd.c | 4 +---
+ 5 files changed, 6 insertions(+), 17 deletions(-)
+
+diff --git a/klogd.c b/klogd.c
+index 6cc80ed..9219671 100644
+--- a/klogd.c
++++ b/klogd.c
+@@ -260,11 +260,8 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdlib.h>
+@@ -277,13 +274,8 @@
+
+ #define __LIBRARY__
+ #include <linux/unistd.h>
+-#if !defined(__GLIBC__)
+-# define __NR_ksyslog __NR_syslog
+-_syscall3(int,ksyslog,int, type, char *, buf, int, len);
+-#else
+ #include <sys/klog.h>
+ #define ksyslog klogctl
+-#endif
+
+ #define LOG_BUFFER_SIZE 4096
+ #define LOG_LINE_LENGTH 1000
+diff --git a/ksym_mod.c b/ksym_mod.c
+index 68cd6b6..6e26da1 100644
+--- a/ksym_mod.c
++++ b/ksym_mod.c
+@@ -113,12 +113,9 @@
+ #include <unistd.h>
+ #include <signal.h>
+ #include <errno.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+ #include "module.h"
+-#if !defined(__GLIBC__)
+-#include <linux/time.h>
+-#endif /* __GLIBC__ */
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <linux/version.h>
+diff --git a/pidfile.c b/pidfile.c
+index e0959a0..6daa2e0 100644
+--- a/pidfile.c
++++ b/pidfile.c
+@@ -31,6 +31,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <signal.h>
++#include <fcntl.h>
+
+ /* read_pid
+ *
+diff --git a/syslog.c b/syslog.c
+index bdb3ff2..ef7b34e 100644
+--- a/syslog.c
++++ b/syslog.c
+@@ -55,7 +55,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90";
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/file.h>
+-#include <sys/signal.h>
++//#include <sys/signal.h>
+ #include <sys/syslog.h>
+ #if 0
+ #include "syslog.h"
+@@ -72,6 +72,7 @@ static char sccsid[] = "@(#)syslog.c 5.28 (Berkeley) 6/27/90";
+ #include <stdarg.h>
+ #include <paths.h>
+ #include <stdio.h>
++#include <fcntl.h>
+
+ #define _PATH_LOGNAME "/dev/log"
+
+diff --git a/syslogd.c b/syslogd.c
+index ea73ea5..1ca0595 100644
+--- a/syslogd.c
++++ b/syslogd.c
+@@ -818,9 +818,7 @@ void doexit(int sig);
+ void init();
+ void cfline(char *line, register struct filed *f);
+ int decode(char *name, struct code *codetab);
+-#if defined(__GLIBC__)
+ #define dprintf mydprintf
+-#endif /* __GLIBC__ */
+ static void dprintf(char *, ...);
+ static void allocate_log(void);
+ void sighup_handler();
+@@ -2094,7 +2092,7 @@ void reapchild()
+ (void) signal(SIGCHLD, reapchild); /* reset signal handler -ASP */
+ wait ((int *)0);
+ #else
+- union wait status;
++ int status;
+
+ while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0)
+ ;
+--
+2.5.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch
new file mode 100644
index 000000000..00fba7101
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-strip-install.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: sysklogd-1.5/Makefile
+===================================================================
+--- sysklogd-1.5.orig/Makefile 2009-06-09 13:02:41.000000000 +0200
++++ sysklogd-1.5/Makefile 2009-06-09 13:03:06.000000000 +0200
+@@ -127,8 +127,8 @@
+ rm -f syslogd klogd ksym syslog_tst oops_test TAGS tsyslogd tklogd
+
+ install_exec: syslogd klogd
+- ${INSTALL} -m 500 -s syslogd ${BINDIR}/syslogd
+- ${INSTALL} -m 500 -s klogd ${BINDIR}/klogd
++ ${INSTALL} -m 500 syslogd ${BINDIR}/syslogd
++ ${INSTALL} -m 500 klogd ${BINDIR}/klogd
+
+ install_man:
+ ${INSTALL} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch
new file mode 100644
index 000000000..c1cc042c9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/no-vectorization.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate
+
+The compiler should not be generating vectorized instructions on this target.
+This is a work around until I can determine why this is occuring on this
+particular recipe
+
+Index: sysklogd-1.5/Makefile
+===================================================================
+--- sysklogd-1.5.orig/Makefile
++++ sysklogd-1.5/Makefile
+@@ -20,7 +20,8 @@
+ CC= gcc
+ #SKFLAGS= -g -DSYSV -Wall
+ #LDFLAGS= -g
+-SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
++SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce \
++ -fno-tree-vectorize
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+ # $(shell getconf LFS_SKFLAGS)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd
new file mode 100755
index 000000000..258f88280
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/sysklogd
@@ -0,0 +1,151 @@
+#! /bin/sh
+# /etc/init.d/sysklogd: start the system log daemon.
+
+### BEGIN INIT INFO
+# Provides: sysklogd
+# Required-Start: $remote_fs $time
+# Required-Stop: $remote_fs $time
+# Should-Start: $network
+# Should-Stop: $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: System logger
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+pidfile_syslogd=/var/run/syslogd.pid
+pidfile_klogd=/var/run/klogd.pid
+binpath_syslogd=/sbin/syslogd
+binpath_klogd=/sbin/klogd
+
+test -x $binpath || exit 0
+
+test ! -r /etc/default/syslogd || . /etc/default/syslogd
+
+create_xconsole()
+{
+ # Only proceed if /dev/xconsole is used at all
+ if ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf
+ then
+ return
+ fi
+
+ if [ ! -e /dev/xconsole ]; then
+ mknod -m 640 /dev/xconsole p
+ else
+ chmod 0640 /dev/xconsole
+ fi
+ chown root:adm /dev/xconsole
+ test ! -x /sbin/restorecon || /sbin/restorecon /dev/xconsole
+}
+
+log_begin_msg () {
+ echo -n $1
+}
+
+log_end_msg () {
+ echo $1
+}
+
+log_success_msg () {
+ echo $1
+}
+
+running()
+{
+ # No pidfile, probably no daemon present
+ #
+ if [ ! -f $pidfile ]
+ then
+ return 1
+ fi
+
+ pid=`cat $pidfile_syslogd`
+
+ # No pid, probably no daemon present
+ #
+ if [ -z "$pid" ]
+ then
+ return 1
+ fi
+
+ if [ ! -d /proc/$pid ]
+ then
+ return 1
+ fi
+
+ cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1`
+
+ # No syslogd?
+ #
+ if [ "$cmd" != "$binpath" ]
+ then
+ return 1
+ fi
+
+ return 0
+}
+
+case "$1" in
+ start)
+ log_begin_msg "Starting system log daemon..."
+ create_xconsole
+ start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD
+ log_end_msg $?
+ log_begin_msg "Starting kernel log daemon..."
+ start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+ log_end_msg $?
+ ;;
+ stop)
+ log_begin_msg "Stopping system log daemon..."
+ start-stop-daemon --stop --quiet --pidfile $pidfile_syslogd --name syslogd
+ log_end_msg $?
+ log_begin_msg "Stopping kernel log daemon..."
+ start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+ log_end_msg $?
+ ;;
+ reload|force-reload)
+ log_begin_msg "Reloading system log daemon..."
+ start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile_syslogd --name syslogd
+ log_end_msg $?
+ log_begin_msg "Reloading kernel log daemon..."
+ start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+ start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+ log_end_msg $?
+ ;;
+ restart)
+ log_begin_msg "Restarting system log daemon..."
+ start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile_syslogd --name syslogd
+ start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD
+ log_end_msg $?
+ log_begin_msg "Reloading kernel log daemon..."
+ start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+ start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+ log_end_msg $?
+ ;;
+ reload-or-restart)
+ if running
+ then
+ $0 reload
+ else
+ $0 start
+ fi
+ ;;
+ status)
+ status syslogd
+ RETVAL=$?
+ status klogd
+ rval=$?
+ [ $RETVAL -eq 0 ] && exit $rval
+ exit $RETVAL
+ ;;
+ *)
+ log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart|status}"
+ exit 1
+esac
+
+exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf
new file mode 100644
index 000000000..0849de126
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/files/syslog.conf
@@ -0,0 +1,71 @@
+# /etc/syslog.conf Configuration file for syslogd.
+#
+# Ported from debian by Yu Ke <ke.yu@intel.com>
+#
+
+#
+# First some standard logfiles. Log by facility.
+#
+
+auth,authpriv.* /var/log/auth.log
+*.*;auth,authpriv.none -/var/log/syslog
+#cron.* /var/log/cron.log
+daemon.* -/var/log/daemon.log
+kern.* -/var/log/kern.log
+lpr.* -/var/log/lpr.log
+mail.* -/var/log/mail.log
+user.* -/var/log/user.log
+
+#
+# Logging for the mail system. Split it up so that
+# it is easy to write scripts to parse these files.
+#
+mail.info -/var/log/mail.info
+mail.warn -/var/log/mail.warn
+mail.err /var/log/mail.err
+
+# Logging for INN news system
+#
+news.crit /var/log/news.crit
+news.err /var/log/news.err
+news.notice -/var/log/news.notice
+
+#
+# Some `catch-all' logfiles.
+#
+*.=debug;\
+auth,authpriv.none;\
+news.none;mail.none -/var/log/debug
+
+*.=info;*.=notice;*.=warn;\
+auth,authpriv.none;\
+cron,daemon.none;\
+mail,news.none -/var/log/messages
+
+#
+# Emergencies are sent to everybody logged in.
+#
+*.emerg *
+
+#
+# I like to have messages displayed on the console, but only on a virtual
+# console I usually leave idle.
+#
+#daemon,mail.*;\
+#news.=crit;news.=err;news.=notice;\
+#*.=debug;*.=info;\
+#*.=notice;*.=warn /dev/tty8
+
+# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
+# you must invoke `xconsole' with the `-file' option:
+#
+# $ xconsole -file /dev/xconsole [...]
+#
+# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
+# busy site..
+#
+daemon.*;mail.*;\
+news.err;\
+*.=debug;*.=info;\
+*.=notice;*.=warn |/dev/xconsole
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc
new file mode 100644
index 000000000..1e363db6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -0,0 +1,66 @@
+SUMMARY = "System Log Daemons"
+DESCRIPTION = "The sysklogd package implements two system log daemons: syslogd, klogd"
+HOMEPAGE = "http://www.infodrom.org/projects/sysklogd/"
+SECTION = "base"
+
+LICENSE = "GPLv2+ & BSD"
+LICENSE_syslogd = "BSD"
+LICENSE_klogd = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+ file://syslogd.c;beginline=2;endline=15;md5=77ffb2fec48c46d7ca0abb2d5813e7fd \
+ file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \
+ "
+
+inherit update-rc.d update-alternatives
+
+SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \
+ file://no-strip-install.patch \
+ file://0001-Fix-build-with-musl.patch \
+ file://sysklogd \
+ file://syslog.conf \
+ "
+
+SRC_URI_append_e500v2 = " file://no-vectorization.patch"
+
+INITSCRIPT_NAME = "syslog"
+CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+CFLAGS_append = " -DSYSV"
+
+do_install () {
+ install -d ${D}${mandir}/man8 \
+ ${D}${mandir}/man5 \
+ ${D}${base_sbindir}
+ oe_runmake 'BINDIR=${D}${base_sbindir}' \
+ 'MANDIR=${D}${mandir}' install
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
+}
+
+# sysklogd package has no internal systemd support, so we weigh busybox's
+# sysklogd utility over it in case of systemd
+ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}"
+
+ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
+
+ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
+ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd"
+ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog"
+ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
+
+pkg_prerm_${PN} () {
+ if test "x$D" = "x"; then
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ /etc/init.d/syslog stop
+ fi
+ fi
+}
+
+python () {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb
new file mode 100644
index 000000000..975ecc2b6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb
@@ -0,0 +1,4 @@
+require sysklogd.inc
+
+SRC_URI[md5sum] = "c70599ab0d037fde724f7210c2c8d7f8"
+SRC_URI[sha256sum] = "5166c185ae23c92e8b9feee66a6e3d0bc944bf673112f53e3ecf62e08ce7c201"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat.inc b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat.inc
new file mode 100644
index 000000000..c35329193
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat.inc
@@ -0,0 +1,57 @@
+SUMMARY = "System performance tools"
+DESCRIPTION = "The sysstat utilities are a collection of performance monitoring tools for Linux."
+HOMEPAGE = "http://sebastien.godard.pagesperso-orange.fr/"
+LICENSE = "GPLv2+"
+SECTION = "console/utils"
+
+SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/sysstat-${PV}.tar.xz \
+ file://99_sysstat \
+ file://sysstat.service \
+ "
+
+UPSTREAM_CHECK_URI = "http://sebastien.godard.pagesperso-orange.fr/download.html"
+UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.tar"
+
+DEPENDS += "base-passwd"
+
+inherit autotools-brokensep gettext systemd
+
+EXTRA_OECONF += "--disable-sensors"
+EXTRA_OEMAKE += 'LFLAGS=""'
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "sysstat.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+do_configure_prepend() {
+ export sa_lib_dir=${libdir}/sa
+}
+
+do_install() {
+ autotools_do_install
+
+ # don't install /var/log/sa when populating rootfs. Do it through volatile
+
+ rm -rf ${D}/var
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@LIBDIR@#${libdir}#g' ${D}${systemd_unitdir}/system/sysstat.service
+}
+
+pkg_postinst_${PN} () {
+ if [ -n "$D" ]; then
+ exit 0
+ fi
+ if [ -e /etc/init.d/populate-volatile.sh ]; then
+ /etc/init.d/populate-volatile.sh update
+ fi
+}
+
+
+FILES_${PN} += "${libdir}/sa"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+LDFLAGS_append_libc-uclibc = " -lintl"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch
new file mode 100644
index 000000000..c12652307
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/0001-Include-needed-headers-explicitly.patch
@@ -0,0 +1,62 @@
+From 42325faa88d64cce799977d611b2792beb154643 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 14 Sep 2015 08:36:59 +0000
+Subject: [PATCH] Include needed headers explicitly
+
+on glibc these headers get pulled in indirectly via other .h files
+but right fix is to include them directly when used
+
+fixes
+
+error: use of undeclared identifier 'PATH_MAX'
+error: called object type 'unsigned int' is not a function or function pointer
+dm_major = major(aux.st_rdev);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ common.c | 1 +
+ ioconf.c | 1 +
+ sa_common.c | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/common.c b/common.c
+index a23155b..ad86446 100644
+--- a/common.c
++++ b/common.c
+@@ -20,6 +20,7 @@
+ */
+
+ #include <stdio.h>
++#include <limits.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <time.h>
+diff --git a/ioconf.c b/ioconf.c
+index 7d88c5d..6d67691 100644
+--- a/ioconf.c
++++ b/ioconf.c
+@@ -27,6 +27,7 @@
+ #include <errno.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
++#include <sys/types.h>
+
+ #include "ioconf.h"
+ #include "common.h"
+diff --git a/sa_common.c b/sa_common.c
+index b7351d9..c9e3299 100644
+--- a/sa_common.c
++++ b/sa_common.c
+@@ -20,6 +20,7 @@
+ */
+
+ #include <stdio.h>
++#include <limits.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <time.h>
+--
+2.5.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/99_sysstat b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/99_sysstat
new file mode 100644
index 000000000..0b0ec30de
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/99_sysstat
@@ -0,0 +1 @@
+d root root 0755 /var/log/sa none
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/sysstat.service b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/sysstat.service
new file mode 100644
index 000000000..aff07109f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat/sysstat.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Resets System Activity Logs
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+User=root
+ExecStart=@LIBDIR@/sa/sa1 --boot
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.2.0.bb b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.2.0.bb
new file mode 100644
index 000000000..7a8eb96ad
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/sysstat/sysstat_11.2.0.bb
@@ -0,0 +1,8 @@
+require sysstat.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+SRC_URI += "file://0001-Include-needed-headers-explicitly.patch"
+
+SRC_URI[md5sum] = "e8b615775ad98780e3f0675b91eddb19"
+SRC_URI[sha256sum] = "9806b9a662568796d3fb93ecd01ecea10d815e668337a646494953bff4bc4155"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch
new file mode 100644
index 000000000..af5026f52
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624]
+CVE: CVE-2010-0624
+
+This patch avoids heap overflow reported by :
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624
+
+This is a clean patch for the GPLv2 tar recipe.
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25
+
+Index: tar-1.17/lib/rtapelib.c
+===================================================================
+--- tar-1.17.orig/lib/rtapelib.c
++++ tar-1.17/lib/rtapelib.c
+@@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si
+
+ sprintf (command_buffer, "R%lu\n", (unsigned long) length);
+ if (do_command (handle, command_buffer) == -1
+- || (status = get_status (handle)) == SAFE_READ_ERROR)
++ || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length))
+ return SAFE_READ_ERROR;
+
+ for (counter = 0; counter < status; counter += rlen, buffer += rlen)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch
new file mode 100644
index 000000000..f8059a0a8
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/gcc43build.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Fix errors when built with gcc 4.3
+# Patch taken from Debian bug #452096
+
+diff -urN tar-1.17.orig/lib/argp-fmtstream.h tar-1.17/lib/argp-fmtstream.h
+--- tar-1.17.orig/lib/argp-fmtstream.h 2006-01-11 12:24:05.000000000 -0800
++++ tar-1.17/lib/argp-fmtstream.h 2010-07-22 22:36:12.000000000 -0700
+@@ -198,7 +198,11 @@
+ #endif
+
+ #ifndef ARGP_FS_EI
+-#define ARGP_FS_EI extern inline
++ #if defined __GNUC_STDC_INLINE__
++ #define ARGP_FS_EI extern inline __attribute__((__gnu_inline__))
++ #else
++ #define ARGP_FS_EI extern inline
++ #endif
+ #endif
+
+ ARGP_FS_EI size_t
+diff -urN tar-1.17.orig/lib/argp.h tar-1.17/lib/argp.h
+--- tar-1.17.orig/lib/argp.h 2007-03-30 00:09:11.000000000 -0700
++++ tar-1.17/lib/argp.h 2010-07-22 22:38:44.000000000 -0700
+@@ -580,7 +580,11 @@
+ # endif
+
+ # ifndef ARGP_EI
+-# define ARGP_EI extern __inline__
++# if defined __GNUC_STDC_INLINE__
++# define ARGP_EI extern __inline__ __attribute__((__gnu_inline__))
++# else
++# define ARGP_EI extern __inline__
++# endif
+ # endif
+
+ ARGP_EI void
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch
new file mode 100644
index 000000000..30534c29c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar-1.17/m4extensions.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Define AC_USE_SYSTEM_EXTENSIONS only if it was previously undefined.
+# This is needed to configure correctly with newer versions of autoconf.
+
+--- tar-1.17/m4/extensions.m4.orig 2010-07-22 22:21:35.000000000 -0700
++++ tar-1.17/m4/extensions.m4 2010-07-22 22:23:41.000000000 -0700
+@@ -1,4 +1,4 @@
+-# serial 4 -*- Autoconf -*-
++# serial 5 -*- Autoconf -*-
+ # Enable extensions on systems that normally disable them.
+
+ # Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+@@ -16,6 +16,7 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
++m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
+ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+ [
+ AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+@@ -48,7 +49,7 @@
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+-])
++])])
+
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar.inc b/import-layers/yocto-poky/meta/recipes-extended/tar/tar.inc
new file mode 100644
index 000000000..93e4da114
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar.inc
@@ -0,0 +1,52 @@
+SUMMARY = "GNU file archiving program"
+DESCRIPTION = "GNU tar saves many files together into a single tape \
+or disk archive, and can restore individual files from the archive."
+HOMEPAGE = "http://www.gnu.org/software/tar/"
+SECTION = "base"
+
+SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF += "DEFAULT_RMT_DIR=${base_sbindir}"
+
+# Let aclocal use the relative path for the m4 file rather than the
+# absolute since tar has a lot of m4 files, otherwise there might
+# be an "Argument list too long" error when it is built in a long/deep
+# directory.
+acpaths = "-I ./m4"
+
+do_install () {
+ autotools_do_install
+ ln -s tar ${D}${bindir}/gtar
+}
+
+do_install_append_class-target() {
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ install -d ${D}${base_bindir}
+ mv ${D}${bindir}/tar ${D}${base_bindir}/tar
+ mv ${D}${bindir}/gtar ${D}${base_bindir}/gtar
+ rmdir ${D}${bindir}/
+ fi
+}
+
+PACKAGES =+ "${PN}-rmt"
+
+FILES_${PN}-rmt = "${base_sbindir}/rmt*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "tar"
+ALTERNATIVE_${PN}-rmt = "rmt"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_${PN}-rmt_class-nativesdk = ""
+
+ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar"
+ALTERNATIVE_LINK_NAME[rmt] = "${base_sbindir}/rmt"
+
+PROVIDES_append_class-native = " tar-replacement-native"
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar/musl_dirent.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar/musl_dirent.patch
new file mode 100644
index 000000000..b0dc16c3d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar/musl_dirent.patch
@@ -0,0 +1,19 @@
+musl has valid d_ino implementation
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: tar-1.28/m4/d-ino.m4
+===================================================================
+--- tar-1.28.orig/m4/d-ino.m4
++++ tar-1.28/m4/d-ino.m4
+@@ -40,7 +40,8 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_
+ [gl_cv_struct_dirent_d_ino=no],
+ [case "$host_os" in
+ # Guess yes on glibc systems with Linux kernel.
+- linux*-gnu*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
++ linux*-gnu*|linux*-musl*)
++ gl_cv_struct_dirent_d_ino="guessing yes" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_struct_dirent_d_ino="guessing no" ;;
+ esac
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar/remove-gets.patch b/import-layers/yocto-poky/meta/recipes-extended/tar/tar/remove-gets.patch
new file mode 100644
index 000000000..0b8be39ee
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar/remove-gets.patch
@@ -0,0 +1,22 @@
+ISO C11 removes the specification of gets() from the C language, eglibc 2.16+ removed it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: tar-1.27/gnu/stdio.in.h
+===================================================================
+--- tar-1.27.orig/gnu/stdio.in.h 2013-06-29 08:54:26.000000000 +0300
++++ tar-1.27/gnu/stdio.in.h 2013-10-16 15:22:46.977204737 +0300
+@@ -710,10 +710,12 @@
+ /* It is very rare that the developer ever has full control of stdin,
+ so any use of gets warrants an unconditional warning; besides, C11
+ removed it. */
++#if defined gets
+ #undef gets
+ #if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+
+
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb b/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb
new file mode 100644
index 000000000..b9ca2063d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.17.bb
@@ -0,0 +1,14 @@
+require tar.inc
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+PR = "r3"
+
+SRC_URI += "file://m4extensions.patch \
+ file://gcc43build.patch \
+ file://avoid_heap_overflow.patch \
+ "
+
+SRC_URI[md5sum] = "c6c4f1c075dbf0f75c29737faa58f290"
+SRC_URI[sha256sum] = "19f9021dda51a16295e4706e80870e71f87107675e51c176a491eba0fc4ca492"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.28.bb b/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.28.bb
new file mode 100644
index 000000000..518e62206
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tar/tar_1.28.bb
@@ -0,0 +1,18 @@
+require tar.inc
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[acl] = "--with-posix-acls, --without-posix-acls, acl,"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI += "file://remove-gets.patch \
+ file://musl_dirent.patch \
+ "
+SRC_URI[md5sum] = "8f32b2bc1ed7ddf4cf4e4a39711341b0"
+SRC_URI[sha256sum] = "60e4bfe0602fef34cd908d91cf638e17eeb09394d7b98c2487217dc4d3147562"
+
+do_install_append_libc-musl() {
+ rm -f ${D}${libdir}/charset.alias
+ rmdir ${D}${libdir}
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff
new file mode 100644
index 000000000..16d6719cb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff
@@ -0,0 +1,77 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 1995-01-30 19:51:47.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-09 16:59:45.000000000 +0200
+@@ -173,7 +173,7 @@
+ Patterns like these can be used when the machine has different internet
+ addresses with different internet hostnames. Service providers can use
+ this facility to offer FTP, GOPHER or WWW archives with internet names
+-that may even belong to different organizations. See also the `twist'
++that may even belong to different organizations. See also the `twist\'
+ option in the hosts_options(5) document. Some systems (Solaris,
+ FreeBSD) can have more than one internet address on one physical
+ interface; with other systems you may have to resort to SLIP or PPP
+@@ -236,10 +236,10 @@
+ Before accepting a client request, the wrappers can use the IDENT
+ service to find out that the client did not send the request at all.
+ When the client host provides IDENT service, a negative IDENT lookup
+-result (the client matches `UNKNOWN@host') is strong evidence of a host
++result (the client matches `UNKNOWN@host\') is strong evidence of a host
+ spoofing attack.
+ .PP
+-A positive IDENT lookup result (the client matches `KNOWN@host') is
++A positive IDENT lookup result (the client matches `KNOWN@host\') is
+ less trustworthy. It is possible for an intruder to spoof both the
+ client connection and the IDENT lookup, although doing so is much
+ harder than spoofing just a client connection. It may also be that
+diff -ruN tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5
+--- tcp_wrappers_7.6.orig/hosts_options.5 1994-12-28 17:42:29.000000000 +0100
++++ tcp_wrappers_7.6/hosts_options.5 2004-04-09 16:59:49.000000000 +0200
+@@ -124,7 +124,7 @@
+ value is taken.
+ .SH MISCELLANEOUS
+ .IP "banners /some/directory"
+-Look for a file in `/some/directory' with the same name as the daemon
++Look for a file in `/some/directory\' with the same name as the daemon
+ process (for example in.telnetd for the telnet service), and copy its
+ contents to the client. Newline characters are replaced by
+ carriage-return newline, and %<letter> sequences are expanded (see
+diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8
+--- tcp_wrappers_7.6.orig/tcpdmatch.8 1996-02-11 17:01:36.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.8 2004-04-09 17:00:49.000000000 +0200
+@@ -26,7 +26,7 @@
+ A daemon process name. Typically, the last component of a daemon
+ executable pathname.
+ .IP client
+-A host name or network address, or one of the `unknown' or `paranoid'
++A host name or network address, or one of the `unknown\' or `paranoid\'
+ wildcard patterns.
+ .sp
+ When a client host name is specified, \fItcpdmatch\fR gives a
+@@ -37,13 +37,13 @@
+ .PP
+ Optional information specified with the \fIdaemon@server\fR form:
+ .IP server
+-A host name or network address, or one of the `unknown' or `paranoid'
+-wildcard patterns. The default server name is `unknown'.
++A host name or network address, or one of the `unknown\' or `paranoid\'
++wildcard patterns. The default server name is `unknown\'.
+ .PP
+ Optional information specified with the \fIuser@client\fR form:
+ .IP user
+ A client user identifier. Typically, a login name or a numeric userid.
+-The default user name is `unknown'.
++The default user name is `unknown\'.
+ .SH OPTIONS
+ .IP -d
+ Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current
+@@ -70,7 +70,7 @@
+ .ti +5
+ tcpdmatch in.telnetd paranoid
+ .PP
+-On some systems, daemon names have no `in.' prefix, or \fItcpdmatch\fR
++On some systems, daemon names have no `in.\' prefix, or \fItcpdmatch\fR
+ may need some help to locate the inetd configuration file.
+ .SH FILES
+ .PP
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch
new file mode 100644
index 000000000..9a735bff6
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch
@@ -0,0 +1,250 @@
+Upstream-Status: Backport
+
+diff -ruNp tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3
+--- tcp_wrappers_7.6.orig/hosts_access.3 2005-03-09 18:30:25.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.3 2005-03-09 18:27:03.000000000 +0100
+@@ -3,7 +3,7 @@
+ hosts_access, hosts_ctl, request_init, request_set \- access control library
+ .SH SYNOPSIS
+ .nf
+-#include "tcpd.h"
++#include <tcpd.h>
+
+ extern int allow_severity;
+ extern int deny_severity;
+diff -ruNp tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2005-03-09 18:30:25.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5 2005-03-09 18:30:18.000000000 +0100
+@@ -8,9 +8,9 @@ name, host name/address) patterns. Exam
+ impatient reader is encouraged to skip to the EXAMPLES section for a
+ quick introduction.
+ .PP
+-An extended version of the access control language is described in the
+-\fIhosts_options\fR(5) document. The extensions are turned on at
+-program build time by building with -DPROCESS_OPTIONS.
++The extended version of the access control language is described in the
++\fIhosts_options\fR(5) document. \fBNote that this language supersedes
++the meaning of \fIshell_command\fB as documented below.\fR
+ .PP
+ In the following text, \fIdaemon\fR is the the process name of a
+ network daemon process, and \fIclient\fR is the name and/or address of
+@@ -346,8 +346,8 @@ in.tftpd: LOCAL, .my.domain
+ /etc/hosts.deny:
+ .in +3
+ .nf
+-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
+- /usr/ucb/mail -s %d-%h root) &
++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
++ /usr/bin/mail -s %d-%h root) &
+ .fi
+ .PP
+ The safe_finger command comes with the tcpd wrapper and should be
+@@ -383,6 +383,7 @@ that shouldn\'t. All problems are repor
+ .fi
+ .SH SEE ALSO
+ .nf
++hosts_options(5) extended syntax.
+ tcpd(8) tcp/ip daemon wrapper program.
+ tcpdchk(8), tcpdmatch(8), test programs.
+ .SH BUGS
+diff -ruNp tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5
+--- tcp_wrappers_7.6.orig/hosts_options.5 2005-03-09 18:30:24.000000000 +0100
++++ tcp_wrappers_7.6/hosts_options.5 2005-03-09 18:27:03.000000000 +0100
+@@ -2,10 +2,8 @@
+ .SH NAME
+ hosts_options \- host access control language extensions
+ .SH DESCRIPTION
+-This document describes optional extensions to the language described
+-in the hosts_access(5) document. The extensions are enabled at program
+-build time. For example, by editing the Makefile and turning on the
+-PROCESS_OPTIONS compile-time option.
++This document describes extensions to the language described
++in the hosts_access(5) document.
+ .PP
+ The extensible language uses the following format:
+ .sp
+@@ -58,12 +56,12 @@ Notice the leading dot on the domain nam
+ Execute, in a child process, the specified shell command, after
+ performing the %<letter> expansions described in the hosts_access(5)
+ manual page. The command is executed with stdin, stdout and stderr
+-connected to the null device, so that it won\'t mess up the
++connected to the null device, so that it won't mess up the
+ conversation with the client host. Example:
+ .sp
+ .nf
+ .ti +3
+-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
+ .fi
+ .sp
+ executes, in a background child process, the shell command "safe_finger
+diff -ruNp tcp_wrappers_7.6.orig/inetcf.c tcp_wrappers_7.6/inetcf.c
+--- tcp_wrappers_7.6.orig/inetcf.c 1997-02-12 02:13:24.000000000 +0100
++++ tcp_wrappers_7.6/inetcf.c 2005-03-09 18:27:03.000000000 +0100
+@@ -26,13 +26,17 @@ extern void exit();
+ * guesses. Shorter names follow longer ones.
+ */
+ char *inet_files[] = {
++#if 0
+ "/private/etc/inetd.conf", /* NEXT */
+ "/etc/inet/inetd.conf", /* SYSV4 */
+ "/usr/etc/inetd.conf", /* IRIX?? */
++#endif
+ "/etc/inetd.conf", /* BSD */
++#if 0
+ "/etc/net/tlid.conf", /* SYSV4?? */
+ "/etc/saf/tlid.conf", /* SYSV4?? */
+ "/etc/tlid.conf", /* SYSV4?? */
++#endif
+ 0,
+ };
+
+diff -ruNp tcp_wrappers_7.6.orig/tcpd.8 tcp_wrappers_7.6/tcpd.8
+--- tcp_wrappers_7.6.orig/tcpd.8 1996-02-21 16:39:16.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.8 2005-03-09 18:27:03.000000000 +0100
+@@ -12,7 +12,11 @@ The program supports both 4.3BSD-style s
+ TLI. Functionality may be limited when the protocol underneath TLI is
+ not an internet protocol.
+ .PP
+-Operation is as follows: whenever a request for service arrives, the
++There are two possible modes of operation: execution of \fItcpd\fP
++before a service started by \fIinetd\fP, or linking a daemon with
++the \fIlibwrap\fP shared library as documented in the \fIhosts_access\fR(3)
++manual page. Operation when started by \fIinetd\fP
++is as follows: whenever a request for service arrives, the
+ \fIinetd\fP daemon is tricked into running the \fItcpd\fP program
+ instead of the desired server. \fItcpd\fP logs the request and does
+ some additional checks. When all is well, \fItcpd\fP runs the
+@@ -88,11 +92,11 @@ configuration files.
+ .sp
+ .in +5
+ # mkdir /other/place
+-# mv /usr/etc/in.fingerd /other/place
+-# cp tcpd /usr/etc/in.fingerd
++# mv /usr/sbin/in.fingerd /other/place
++# cp tcpd /usr/sbin/in.fingerd
+ .fi
+ .PP
+-The example assumes that the network daemons live in /usr/etc. On some
++The example assumes that the network daemons live in /usr/sbin. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, or have
+ no `in.\' prefix to their name.
+ .SH EXAMPLE 2
+@@ -101,35 +105,34 @@ are left in their original place.
+ .PP
+ In order to monitor access to the \fIfinger\fR service, perform the
+ following edits on the \fIinetd\fR configuration file (usually
+-\fI/etc/inetd.conf\fR or \fI/etc/inet/inetd.conf\fR):
++\fI/etc/inetd.conf\fR):
+ .nf
+ .sp
+ .ti +5
+-finger stream tcp nowait nobody /usr/etc/in.fingerd in.fingerd
++finger stream tcp nowait nobody /usr/sbin/in.fingerd in.fingerd
+ .sp
+ becomes:
+ .sp
+ .ti +5
+-finger stream tcp nowait nobody /some/where/tcpd in.fingerd
++finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd
+ .sp
+ .fi
+ .PP
+-The example assumes that the network daemons live in /usr/etc. On some
++The example assumes that the network daemons live in /usr/sbin. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, the
+ daemons have no `in.\' prefix to their name, or there is no userid
+ field in the inetd configuration file.
+ .PP
+ Similar changes will be needed for the other services that are to be
+ covered by \fItcpd\fR. Send a `kill -HUP\' to the \fIinetd\fR(8)
+-process to make the changes effective. AIX users may also have to
+-execute the `inetimp\' command.
++process to make the changes effective.
+ .SH EXAMPLE 3
+ In the case of daemons that do not live in a common directory ("secret"
+ or otherwise), edit the \fIinetd\fR configuration file so that it
+ specifies an absolute path name for the process name field. For example:
+ .nf
+ .sp
+- ntalk dgram udp wait root /some/where/tcpd /usr/local/lib/ntalkd
++ ntalk dgram udp wait root /usr/sbin/tcpd /usr/local/lib/ntalkd
+ .sp
+ .fi
+ .PP
+@@ -164,6 +167,7 @@ The default locations of the host access
+ .SH SEE ALSO
+ .na
+ .nf
++hosts_access(3), functions provided by the libwrap library.
+ hosts_access(5), format of the tcpd access control tables.
+ syslog.conf(5), format of the syslogd control file.
+ inetd.conf(5), format of the inetd control file.
+diff -ruNp tcp_wrappers_7.6.orig/tcpdchk.8 tcp_wrappers_7.6/tcpdchk.8
+--- tcp_wrappers_7.6.orig/tcpdchk.8 1995-01-08 17:00:31.000000000 +0100
++++ tcp_wrappers_7.6/tcpdchk.8 2005-03-09 18:27:03.000000000 +0100
+@@ -9,8 +9,8 @@ tcpdchk [-a] [-d] [-i inet_conf] [-v]
+ potential and real problems it can find. The program examines the
+ \fItcpd\fR access control files (by default, these are
+ \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR), and compares the
+-entries in these files against entries in the \fIinetd\fR or \fItlid\fR
+-network configuration files.
++entries in these files against entries in the \fIinetd\fR
++network configuration file.
+ .PP
+ \fItcpdchk\fR reports problems such as non-existent pathnames; services
+ that appear in \fItcpd\fR access control rules, but are not controlled
+@@ -26,14 +26,13 @@ problem.
+ .SH OPTIONS
+ .IP -a
+ Report access control rules that permit access without an explicit
+-ALLOW keyword. This applies only when the extended access control
+-language is enabled (build with -DPROCESS_OPTIONS).
++ALLOW keyword.
+ .IP -d
+ Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current
+ directory instead of the default ones.
+ .IP "-i inet_conf"
+ Specify this option when \fItcpdchk\fR is unable to find your
+-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when
++\fIinetd.conf\fR network configuration file, or when
+ you suspect that the program uses the wrong one.
+ .IP -v
+ Display the contents of each access control rule. Daemon lists, client
+@@ -54,7 +53,6 @@ tcpdmatch(8), explain what tcpd would do
+ hosts_access(5), format of the tcpd access control tables.
+ hosts_options(5), format of the language extensions.
+ inetd.conf(5), format of the inetd control file.
+-tlid.conf(5), format of the tlid control file.
+ .SH AUTHORS
+ .na
+ .nf
+diff -ruNp tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8
+--- tcp_wrappers_7.6.orig/tcpdmatch.8 2005-03-09 18:30:24.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.8 2005-03-09 18:27:03.000000000 +0100
+@@ -13,7 +13,7 @@ request for service. Examples are given
+ The program examines the \fItcpd\fR access control tables (default
+ \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR) and prints its
+ conclusion. For maximal accuracy, it extracts additional information
+-from your \fIinetd\fR or \fItlid\fR network configuration file.
++from your \fIinetd\fR network configuration file.
+ .PP
+ When \fItcpdmatch\fR finds a match in the access control tables, it
+ identifies the matched rule. In addition, it displays the optional
+@@ -50,7 +50,7 @@ Examine \fIhosts.allow\fR and \fIhosts.d
+ directory instead of the default ones.
+ .IP "-i inet_conf"
+ Specify this option when \fItcpdmatch\fR is unable to find your
+-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when
++\fIinetd.conf\fR network configuration file, or when
+ you suspect that the program uses the wrong one.
+ .SH EXAMPLES
+ To predict how \fItcpd\fR would handle a telnet request from the local
+@@ -86,7 +86,6 @@ tcpdchk(8), tcpd configuration checker
+ hosts_access(5), format of the tcpd access control tables.
+ hosts_options(5), format of the language extensions.
+ inetd.conf(5), format of the inetd control file.
+-tlid.conf(5), format of the tlid control file.
+ .SH AUTHORS
+ .na
+ .nf
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch
new file mode 100644
index 000000000..9e188027f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch
@@ -0,0 +1,105 @@
+Upstream-Status: Backport
+
+See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=17847
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 18:54:33.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 18:54:27.000000000 +0200
+@@ -89,6 +89,10 @@
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
++.IP \(bu
++Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This
++method of matching cannot be used in conjunction with `net/mask\' matching,
++hostname matching beginning with `.\' or IP address matching ending with `.\'.
+ .SH WILDCARDS
+ The access control language supports explicit wildcards:
+ .IP ALL
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 1997-02-12 02:13:23.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 18:52:21.000000000 +0200
+@@ -289,6 +289,11 @@
+ {
+ int n;
+
++#ifndef DISABLE_WILDCARD_MATCHING
++ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */
++ return (match_pattern_ylo(string,tok));
++ } else
++#endif
+ if (tok[0] == '.') { /* suffix */
+ n = strlen(string) - strlen(tok);
+ return (n > 0 && STR_EQ(tok, string + n));
+@@ -329,3 +334,71 @@
+ }
+ return ((addr & mask) == net);
+ }
++
++#ifndef DISABLE_WILDCARD_MATCHING
++/* Note: this feature has been adapted in a pretty straightforward way
++ from Tatu Ylonen's last SSH version under free license by
++ Pekka Savola <pekkas@netcore.fi>.
++
++ Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
++*/
++
++/* Returns true if the given string matches the pattern (which may contain
++ ? and * as wildcards), and zero if it does not match. */
++
++int match_pattern_ylo(const char *s, const char *pattern)
++{
++ while (1)
++ {
++ /* If at end of pattern, accept if also at end of string. */
++ if (!*pattern)
++ return !*s;
++
++ /* Process '*'. */
++ if (*pattern == '*')
++ {
++ /* Skip the asterisk. */
++ pattern++;
++
++ /* If at end of pattern, accept immediately. */
++ if (!*pattern)
++ return 1;
++
++ /* If next character in pattern is known, optimize. */
++ if (*pattern != '?' && *pattern != '*')
++ {
++ /* Look instances of the next character in pattern, and try
++ to match starting from those. */
++ for (; *s; s++)
++ if (*s == *pattern &&
++ match_pattern_ylo(s + 1, pattern + 1))
++ return 1;
++ /* Failed. */
++ return 0;
++ }
++
++ /* Move ahead one character at a time and try to match at each
++ position. */
++ for (; *s; s++)
++ if (match_pattern_ylo(s, pattern))
++ return 1;
++ /* Failed. */
++ return 0;
++ }
++
++ /* There must be at least one more character in the string. If we are
++ at the end, fail. */
++ if (!*s)
++ return 0;
++
++ /* Check if the next character of the string is acceptable. */
++ if (*pattern != '?' && *pattern != *s)
++ return 0;
++
++ /* Move to the next character, both in string and in pattern. */
++ s++;
++ pattern++;
++ }
++ /*NOTREACHED*/
++}
++#endif /* DISABLE_WILDCARD_MATCHING */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
new file mode 100644
index 000000000..725f4b595
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+
+* Mon Feb 5 2001 Preston Brown <pbrown@redhat.com>
+- fix gethostbyname to work better with dot "." notation (#16949)
+
+--- tcp_wrappers_7.6/socket.c.fixgethostbyname Fri Mar 21 13:27:25 1997
++++ tcp_wrappers_7.6/socket.c Mon Feb 5 14:09:40 2001
+@@ -52,7 +52,8 @@
+ char *name;
+ {
+ char dot_name[MAXHOSTNAMELEN + 1];
+-
++ struct hostent *hp;
++
+ /*
+ * Don't append dots to unqualified names. Such names are likely to come
+ * from local hosts files or from NIS.
+@@ -61,8 +62,12 @@
+ if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) {
+ return (gethostbyname(name));
+ } else {
+- sprintf(dot_name, "%s.", name);
+- return (gethostbyname(dot_name));
++ sprintf(dot_name, "%s.", name);
++ hp = gethostbyname(dot_name);
++ if (hp)
++ return hp;
++ else
++ return (gethostbyname(name));
+ }
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch
new file mode 100644
index 000000000..96d47c39f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch
@@ -0,0 +1,1255 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/fix_options.c tcp_wrappers_7.6/fix_options.c
+--- tcp_wrappers_7.6.orig/fix_options.c 1997-04-08 02:29:19.000000000 +0200
++++ tcp_wrappers_7.6/fix_options.c 2004-04-10 19:07:43.000000000 +0200
+@@ -11,6 +11,9 @@
+
+ #include <sys/types.h>
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <netinet/in_systm.h>
+ #include <netinet/ip.h>
+@@ -41,6 +44,22 @@
+ unsigned int opt;
+ int optlen;
+ struct in_addr dummy;
++#ifdef INET6
++ struct sockaddr_storage ss;
++ int sslen;
++
++ /*
++ * check if this is AF_INET socket
++ * XXX IPv6 support?
++ */
++ sslen = sizeof(ss);
++ if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) {
++ syslog(LOG_ERR, "getpeername: %m");
++ clean_exit(request);
++ }
++ if (ss.ss_family != AF_INET)
++ return;
++#endif
+
+ if ((ip = getprotobyname("ip")) != 0)
+ ipproto = ip->p_proto;
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:07:43.000000000 +0200
+@@ -85,11 +85,18 @@
+ for daemon process names or for client user names.
+ .IP \(bu
+ An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
+-`net/mask\' pair. A host address is matched if `net\' is equal to the
++`net/mask\' pair. An IPv4 host address is matched if `net\' is equal to the
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
+ .IP \(bu
++An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a
++`[net]/prefixlen\' pair. An IPv6 host address is matched if
++`prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the
++address. For example, the [net]/prefixlen pattern
++`[3ffe:505:2:1::]/64\' matches every address in the range
++`3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'.
++.IP \(bu
+ Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This
+ method of matching cannot be used in conjunction with `net/mask\' matching,
+ hostname matching beginning with `.\' or IP address matching ending with `.\'.
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:07:43.000000000 +0200
+@@ -24,7 +24,13 @@
+ /* System libraries. */
+
+ #include <sys/types.h>
++#ifdef INT32_T
++ typedef uint32_t u_int32_t;
++#endif
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -33,6 +39,9 @@
+ #include <errno.h>
+ #include <setjmp.h>
+ #include <string.h>
++#ifdef INET6
++#include <netdb.h>
++#endif
+
+ extern char *fgets();
+ extern int errno;
+@@ -82,6 +91,10 @@
+ static int host_match();
+ static int string_match();
+ static int masked_match();
++#ifdef INET6
++static int masked_match4();
++static int masked_match6();
++#endif
+
+ /* Size of logical line buffer. */
+
+@@ -289,6 +302,13 @@
+ {
+ int n;
+
++#ifdef INET6
++ /* convert IPv4 mapped IPv6 address to IPv4 address */
++ if (STRN_EQ(string, "::ffff:", 7)
++ && dot_quad_addr(string + 7) != INADDR_NONE) {
++ string += 7;
++ }
++#endif
+ #ifndef DISABLE_WILDCARD_MATCHING
+ if (strchr(tok, '*') || strchr(tok,'?')) { /* contains '*' or '?' */
+ return (match_pattern_ylo(string,tok));
+@@ -304,20 +324,72 @@
+ } else if (tok[(n = strlen(tok)) - 1] == '.') { /* prefix */
+ return (STRN_EQ(tok, string, n));
+ } else { /* exact match */
++#ifdef INET6
++ struct addrinfo hints, *res;
++ struct sockaddr_in6 pat, addr;
++ int len, ret;
++ char ch;
++
++ len = strlen(tok);
++ if (*tok == '[' && tok[len - 1] == ']') {
++ ch = tok[len - 1];
++ tok[len - 1] = '\0';
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if ((ret = getaddrinfo(tok + 1, NULL, &hints, &res)) == 0) {
++ memcpy(&pat, res->ai_addr, sizeof(pat));
++ freeaddrinfo(res);
++ }
++ tok[len - 1] = ch;
++ if (ret != 0 || getaddrinfo(string, NULL, &hints, &res) != 0)
++ return NO;
++ memcpy(&addr, res->ai_addr, sizeof(addr));
++ freeaddrinfo(res);
++#ifdef NI_WITHSCOPEID
++ if (pat.sin6_scope_id != 0 &&
++ addr.sin6_scope_id != pat.sin6_scope_id)
++ return NO;
++#endif
++ return (!memcmp(&pat.sin6_addr, &addr.sin6_addr,
++ sizeof(struct in6_addr)));
++ return (ret);
++ }
++#endif
+ return (STR_EQ(tok, string));
+ }
+ }
+
+ /* masked_match - match address against netnumber/netmask */
+
++#ifdef INET6
+ static int masked_match(net_tok, mask_tok, string)
+ char *net_tok;
+ char *mask_tok;
+ char *string;
+ {
++ return (masked_match4(net_tok, mask_tok, string) ||
++ masked_match6(net_tok, mask_tok, string));
++}
++
++static int masked_match4(net_tok, mask_tok, string)
++#else
++static int masked_match(net_tok, mask_tok, string)
++#endif
++char *net_tok;
++char *mask_tok;
++char *string;
++{
++#ifdef INET6
++ u_int32_t net;
++ u_int32_t mask;
++ u_int32_t addr;
++#else
+ unsigned long net;
+ unsigned long mask;
+ unsigned long addr;
++#endif
+
+ /*
+ * Disallow forms other than dotted quad: the treatment that inet_addr()
+@@ -329,12 +401,78 @@
+ return (NO);
+ if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+ || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++#ifndef INET6
+ tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
++#endif
+ return (NO); /* not tcpd_jump() */
+ }
+ return ((addr & mask) == net);
+ }
+
++#ifdef INET6
++static int masked_match6(net_tok, mask_tok, string)
++char *net_tok;
++char *mask_tok;
++char *string;
++{
++ struct addrinfo hints, *res;
++ struct sockaddr_in6 net, addr;
++ u_int32_t mask;
++ int len, mask_len, i = 0;
++ char ch;
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(string, NULL, &hints, &res) != 0)
++ return NO;
++ memcpy(&addr, res->ai_addr, sizeof(addr));
++ freeaddrinfo(res);
++
++ if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) {
++ if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE
++ || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE)
++ return (NO);
++ return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]);
++ }
++
++ /* match IPv6 address against netnumber/prefixlen */
++ len = strlen(net_tok);
++ if (*net_tok != '[' || net_tok[len - 1] != ']')
++ return NO;
++ ch = net_tok[len - 1];
++ net_tok[len - 1] = '\0';
++ if (getaddrinfo(net_tok + 1, NULL, &hints, &res) != 0) {
++ net_tok[len - 1] = ch;
++ return NO;
++ }
++ memcpy(&net, res->ai_addr, sizeof(net));
++ freeaddrinfo(res);
++ net_tok[len - 1] = ch;
++ if ((mask_len = atoi(mask_tok)) < 0 || mask_len > 128)
++ return NO;
++
++#ifdef NI_WITHSCOPEID
++ if (net.sin6_scope_id != 0 && addr.sin6_scope_id != net.sin6_scope_id)
++ return NO;
++#endif
++ while (mask_len > 0) {
++ if (mask_len < 32) {
++ mask = htonl(~(0xffffffff >> mask_len));
++ if ((*(u_int32_t *)&addr.sin6_addr.s6_addr[i] & mask) != (*(u_int32_t *)&net.sin6_addr.s6_addr[i] & mask))
++ return NO;
++ break;
++ }
++ if (*(u_int32_t *)&addr.sin6_addr.s6_addr[i] != *(u_int32_t *)&net.sin6_addr.s6_addr[i])
++ return NO;
++ i += 4;
++ mask_len -= 32;
++ }
++ return YES;
++}
++#endif /* INET6 */
++
+ #ifndef DISABLE_WILDCARD_MATCHING
+ /* Note: this feature has been adapted in a pretty straightforward way
+ from Tatu Ylonen's last SSH version under free license by
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile 1997-03-21 19:27:21.000000000 +0100
++++ tcp_wrappers_7.6/Makefile 2004-04-10 19:22:44.000000000 +0200
+@@ -21,7 +21,7 @@
+ @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
+ @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
+ @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
+- @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
++ @echo " sunos40 sunos5 solaris8 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
+ @echo " uts215 uxp"
+ @echo
+ @echo "If none of these match your environment, edit the system"
+@@ -131,20 +131,34 @@
+ NETGROUP=-DNETGROUP TLI= SYSTYPE="-systype bsd43" all
+
+ # Freebsd and linux by default have no NIS.
+-386bsd netbsd bsdos:
++386bsd bsdos:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+ EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
+
+ freebsd:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS="-L/usr/local/v6/lib -linet6" \
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+- EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" \
++ VSYSLOG= all
++
++netbsd:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" VSYSLOG= all
+
+ linux:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
+- NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
++
++gnu:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all
+
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -196,6 +210,13 @@
+ NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
+ BUGS="$(BUGS) -DSOLARIS_24_GETHOSTBYNAME_BUG" all
+
++# SunOS 5.8 is another SYSV4 variant, but has IPv6 support
++solaris8:
++ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++ LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv VSYSLOG= \
++ NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
++ EXTRA_CFLAGS="-DINET6 -DNO_CLONE_DEVICE -DINT32_T" all
++
+ # Generic SYSV40
+ esix sysv4:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c
+--- tcp_wrappers_7.6.orig/misc.c 1996-02-11 17:01:30.000000000 +0100
++++ tcp_wrappers_7.6/misc.c 2004-04-10 19:07:43.000000000 +0200
+@@ -58,9 +58,31 @@
+ {
+ char *cp;
+
++#ifdef INET6
++ int bracket = 0;
++
++ for (cp = string; cp && *cp; cp++) {
++ switch (*cp) {
++ case '[':
++ bracket++;
++ break;
++ case ']':
++ bracket--;
++ break;
++ default:
++ if (bracket == 0 && *cp == delimiter) {
++ *cp++ = 0;
++ return cp;
++ }
++ break;
++ }
++ }
++ return (NULL);
++#else
+ if ((cp = strchr(string, delimiter)) != 0)
+ *cp++ = 0;
+ return (cp);
++#endif
+ }
+
+ /* dot_quad_addr - convert dotted quad to internal form */
+diff -ruN tcp_wrappers_7.6.orig/refuse.c tcp_wrappers_7.6/refuse.c
+--- tcp_wrappers_7.6.orig/refuse.c 1994-12-28 17:42:40.000000000 +0100
++++ tcp_wrappers_7.6/refuse.c 2004-04-10 19:07:43.000000000 +0200
+@@ -25,7 +25,12 @@
+ void refuse(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ syslog(deny_severity, "refused connect from %s (%s)",
++ eval_client(request), eval_hostaddr(request->client));
++#else
+ syslog(deny_severity, "refused connect from %s", eval_client(request));
++#endif
+ clean_exit(request);
+ /* NOTREACHED */
+ }
+diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c 1995-01-02 16:11:34.000000000 +0100
++++ tcp_wrappers_7.6/rfc931.c 2004-04-10 19:07:43.000000000 +0200
+@@ -68,20 +68,50 @@
+ /* rfc931 - return remote user name, given socket structures */
+
+ void rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
+ struct sockaddr_in *rmt_sin;
+ struct sockaddr_in *our_sin;
++#endif
+ char *dest;
+ {
+ unsigned rmt_port;
+ unsigned our_port;
++#ifdef INET6
++ struct sockaddr_storage rmt_query_sin;
++ struct sockaddr_storage our_query_sin;
++ int alen;
++#else
+ struct sockaddr_in rmt_query_sin;
+ struct sockaddr_in our_query_sin;
++#endif
+ char user[256]; /* XXX */
+ char buffer[512]; /* XXX */
+ char *cp;
+ char *result = unknown;
+ FILE *fp;
+
++#ifdef INET6
++ /* address family must be the same */
++ if (rmt_sin->sa_family != our_sin->sa_family) {
++ STRN_CPY(dest, result, STRING_LENGTH);
++ return;
++ }
++ switch (our_sin->sa_family) {
++ case AF_INET:
++ alen = sizeof(struct sockaddr_in);
++ break;
++ case AF_INET6:
++ alen = sizeof(struct sockaddr_in6);
++ break;
++ default:
++ STRN_CPY(dest, result, STRING_LENGTH);
++ return;
++ }
++#endif
++
+ /*
+ * Use one unbuffered stdio stream for writing to and for reading from
+ * the RFC931 etc. server. This is done because of a bug in the SunOS
+@@ -92,7 +122,11 @@
+ * sockets.
+ */
+
++#ifdef INET6
++ if ((fp = fsocket(our_sin->sa_family, SOCK_STREAM, 0)) != 0) {
++#else
+ if ((fp = fsocket(AF_INET, SOCK_STREAM, 0)) != 0) {
++#endif
+ setbuf(fp, (char *) 0);
+
+ /*
+@@ -112,6 +146,25 @@
+ * addresses from the query socket.
+ */
+
++#ifdef INET6
++ memcpy(&our_query_sin, our_sin, alen);
++ memcpy(&rmt_query_sin, rmt_sin, alen);
++ switch (our_sin->sa_family) {
++ case AF_INET:
++ ((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT);
++ ((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC931_PORT);
++ break;
++ case AF_INET6:
++ ((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT);
++ ((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC931_PORT);
++ break;
++ }
++
++ if (bind(fileno(fp), (struct sockaddr *) & our_query_sin,
++ alen) >= 0 &&
++ connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
++ alen) >= 0) {
++#else
+ our_query_sin = *our_sin;
+ our_query_sin.sin_port = htons(ANY_PORT);
+ rmt_query_sin = *rmt_sin;
+@@ -121,6 +174,7 @@
+ sizeof(our_query_sin)) >= 0 &&
+ connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
+ sizeof(rmt_query_sin)) >= 0) {
++#endif
+
+ /*
+ * Send query to server. Neglect the risk that a 13-byte
+@@ -129,8 +183,13 @@
+ */
+
+ fprintf(fp, "%u,%u\r\n",
++#ifdef INET6
++ ntohs(((struct sockaddr_in *)rmt_sin)->sin_port),
++ ntohs(((struct sockaddr_in *)our_sin)->sin_port));
++#else
+ ntohs(rmt_sin->sin_port),
+ ntohs(our_sin->sin_port));
++#endif
+ fflush(fp);
+
+ /*
+@@ -144,8 +203,13 @@
+ && ferror(fp) == 0 && feof(fp) == 0
+ && sscanf(buffer, "%u , %u : USERID :%*[^:]:%255s",
+ &rmt_port, &our_port, user) == 3
++#ifdef INET6
++ && ntohs(((struct sockaddr_in *)rmt_sin)->sin_port) == rmt_port
++ && ntohs(((struct sockaddr_in *)our_sin)->sin_port) == our_port) {
++#else
+ && ntohs(rmt_sin->sin_port) == rmt_port
+ && ntohs(our_sin->sin_port) == our_port) {
++#endif
+
+ /*
+ * Strip trailing carriage return. It is part of the
+diff -ruN tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
+--- tcp_wrappers_7.6.orig/scaffold.c 1997-03-21 19:27:24.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.c 2004-04-10 19:07:43.000000000 +0200
+@@ -25,7 +25,9 @@
+ #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
+ #endif
+
++#ifndef INET6
+ extern char *malloc();
++#endif
+
+ /* Application-specific. */
+
+@@ -39,6 +41,7 @@
+ int deny_severity = LOG_WARNING;
+ int rfc931_timeout = RFC931_TIMEOUT;
+
++#ifndef INET6
+ /* dup_hostent - create hostent in one memory block */
+
+ static struct hostent *dup_hostent(hp)
+@@ -73,9 +76,46 @@
+ }
+ return (&hb->host);
+ }
++#endif
+
+ /* find_inet_addr - find all addresses for this host, result to free() */
+
++#ifdef INET6
++struct addrinfo *find_inet_addr(host)
++char *host;
++{
++ struct addrinfo hints, *res;
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(host, NULL, &hints, &res) == 0)
++ return (res);
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = PF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++ if (getaddrinfo(host, NULL, &hints, &res) != 0) {
++ tcpd_warn("%s: host not found", host);
++ return (0);
++ }
++ if (res->ai_family != AF_INET6 && res->ai_family != AF_INET) {
++ tcpd_warn("%d: not an internet host", res->ai_family);
++ freeaddrinfo(res);
++ return (0);
++ }
++ if (!res->ai_canonname) {
++ tcpd_warn("%s: hostname alias", host);
++ tcpd_warn("(cannot obtain official name)", res->ai_canonname);
++ } else if (STR_NE(host, res->ai_canonname)) {
++ tcpd_warn("%s: hostname alias", host);
++ tcpd_warn("(official name: %.*s)", STRING_LENGTH, res->ai_canonname);
++ }
++ return (res);
++}
++#else
+ struct hostent *find_inet_addr(host)
+ char *host;
+ {
+@@ -118,6 +158,7 @@
+ }
+ return (dup_hostent(hp));
+ }
++#endif
+
+ /* check_dns - give each address thorough workout, return address count */
+
+@@ -125,8 +166,13 @@
+ char *host;
+ {
+ struct request_info request;
++#ifdef INET6
++ struct sockaddr_storage sin;
++ struct addrinfo *hp, *res;
++#else
+ struct sockaddr_in sin;
+ struct hostent *hp;
++#endif
+ int count;
+ char *addr;
+
+@@ -134,11 +180,18 @@
+ return (0);
+ request_init(&request, RQ_CLIENT_SIN, &sin, 0);
+ sock_methods(&request);
++#ifndef INET6
+ memset((char *) &sin, 0, sizeof(sin));
+ sin.sin_family = AF_INET;
++#endif
+
++#ifdef INET6
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&sin, res->ai_addr, res->ai_addrlen);
++#else
+ for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ memcpy((char *) &sin.sin_addr, addr, sizeof(sin.sin_addr));
++#endif
+
+ /*
+ * Force host name and address conversions. Use the request structure
+@@ -151,7 +204,11 @@
+ tcpd_warn("host address %s->name lookup failed",
+ eval_hostaddr(request.client));
+ }
++#ifdef INET6
++ freeaddrinfo(hp);
++#else
+ free((char *) hp);
++#endif
+ return (count);
+ }
+
+diff -ruN tcp_wrappers_7.6.orig/scaffold.h tcp_wrappers_7.6/scaffold.h
+--- tcp_wrappers_7.6.orig/scaffold.h 1994-12-31 18:19:20.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.h 2004-04-10 19:07:43.000000000 +0200
+@@ -4,6 +4,10 @@
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
++#ifdef INET6
++extern struct addrinfo *find_inet_addr();
++#else
+ extern struct hostent *find_inet_addr();
++#endif
+ extern int check_dns();
+ extern int check_path();
+diff -ruN tcp_wrappers_7.6.orig/socket.c tcp_wrappers_7.6/socket.c
+--- tcp_wrappers_7.6.orig/socket.c 2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/socket.c 2004-04-10 19:07:43.000000000 +0200
+@@ -24,13 +24,22 @@
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
++#ifdef INT32_T
++typedef uint32_t u_int32_t;
++#endif
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+
++#ifdef INET6
++#ifndef NI_WITHSCOPEID
++#define NI_WITHSCOPEID 0
++#endif
++#else
+ extern char *inet_ntoa();
++#endif
+
+ /* Local stuff. */
+
+@@ -79,8 +88,13 @@
+ void sock_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ static struct sockaddr_storage client;
++ static struct sockaddr_storage server;
++#else
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
++#endif
+ int len;
+ char buf[BUFSIZ];
+ int fd = request->fd;
+@@ -109,7 +123,11 @@
+ memset(buf, 0 sizeof(buf));
+ #endif
+ }
++#ifdef INET6
++ request->client->sin = (struct sockaddr *)&client;
++#else
+ request->client->sin = &client;
++#endif
+
+ /*
+ * Determine the server binding. This is used for client username
+@@ -122,7 +140,11 @@
+ tcpd_warn("getsockname: %m");
+ return;
+ }
++#ifdef INET6
++ request->server->sin = (struct sockaddr *)&server;
++#else
+ request->server->sin = &server;
++#endif
+ }
+
+ /* sock_hostaddr - map endpoint address to printable form */
+@@ -130,10 +152,26 @@
+ void sock_hostaddr(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++ struct sockaddr *sin = host->sin;
++ int salen;
++
++ if (!sin)
++ return;
++#ifdef SIN6_LEN
++ salen = sin->sa_len;
++#else
++ salen = (sin->sa_family == AF_INET) ? sizeof(struct sockaddr_in)
++ : sizeof(struct sockaddr_in6);
++#endif
++ getnameinfo(sin, salen, host->addr, sizeof(host->addr),
++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++#else
+ struct sockaddr_in *sin = host->sin;
+
+ if (sin != 0)
+ STRN_CPY(host->addr, inet_ntoa(sin->sin_addr), sizeof(host->addr));
++#endif
+ }
+
+ /* sock_hostname - map endpoint address to host name */
+@@ -141,6 +179,160 @@
+ void sock_hostname(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++ struct sockaddr *sin = host->sin;
++ struct sockaddr_in sin4;
++ struct addrinfo hints, *res, *res0 = NULL;
++ int salen, alen, err = 1;
++ char *ap = NULL, *rap, hname[NI_MAXHOST];
++
++ if (sin != NULL) {
++ if (sin->sa_family == AF_INET6) {
++ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sin;
++
++ if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
++ memset(&sin4, 0, sizeof(sin4));
++#ifdef SIN6_LEN
++ sin4.sin_len = sizeof(sin4);
++#endif
++ sin4.sin_family = AF_INET;
++ sin4.sin_port = sin6->sin6_port;
++ sin4.sin_addr.s_addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12];
++ sin = (struct sockaddr *)&sin4;
++ }
++ }
++ switch (sin->sa_family) {
++ case AF_INET:
++ ap = (char *)&((struct sockaddr_in *)sin)->sin_addr;
++ alen = sizeof(struct in_addr);
++ salen = sizeof(struct sockaddr_in);
++ break;
++ case AF_INET6:
++ ap = (char *)&((struct sockaddr_in6 *)sin)->sin6_addr;
++ alen = sizeof(struct in6_addr);
++ salen = sizeof(struct sockaddr_in6);
++ break;
++ default:
++ break;
++ }
++ if (ap)
++ err = getnameinfo(sin, salen, hname, sizeof(hname),
++ NULL, 0, NI_WITHSCOPEID | NI_NAMEREQD);
++ }
++ if (!err) {
++
++ STRN_CPY(host->name, hname, sizeof(host->name));
++
++ /* reject numeric addresses */
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = sin->sa_family;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
++ if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) {
++ freeaddrinfo(res0);
++ res0 = NULL;
++ tcpd_warn("host name/name mismatch: "
++ "reverse lookup results in non-FQDN %s",
++ host->name);
++ strcpy(host->name, paranoid); /* name is bad, clobber it */
++ }
++ err = !err;
++ }
++ if (!err) {
++ /* we are now sure that this is non-numeric */
++
++ /*
++ * Verify that the address is a member of the address list returned
++ * by gethostbyname(hostname).
++ *
++ * Verify also that gethostbyaddr() and gethostbyname() return the same
++ * hostname, or rshd and rlogind may still end up being spoofed.
++ *
++ * On some sites, gethostbyname("localhost") returns "localhost.domain".
++ * This is a DNS artefact. We treat it as a special case. When we
++ * can't believe the address list from gethostbyname("localhost")
++ * we're in big trouble anyway.
++ */
++
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = sin->sa_family;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++ if (getaddrinfo(host->name, NULL, &hints, &res0) != 0) {
++
++ /*
++ * Unable to verify that the host name matches the address. This
++ * may be a transient problem or a botched name server setup.
++ */
++
++ tcpd_warn("can't verify hostname: getaddrinfo(%s, %s) failed",
++ host->name,
++ (sin->sa_family == AF_INET) ? "AF_INET" : "AF_INET6");
++
++ } else if ((res0->ai_canonname == NULL
++ || STR_NE(host->name, res0->ai_canonname))
++ && STR_NE(host->name, "localhost")) {
++
++ /*
++ * The gethostbyaddr() and gethostbyname() calls did not return
++ * the same hostname. This could be a nameserver configuration
++ * problem. It could also be that someone is trying to spoof us.
++ */
++
++ tcpd_warn("host name/name mismatch: %s != %.*s",
++ host->name, STRING_LENGTH,
++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++
++ } else {
++
++ /*
++ * The address should be a member of the address list returned by
++ * gethostbyname(). We should first verify that the h_addrtype
++ * field is AF_INET, but this program has already caused too much
++ * grief on systems with broken library code.
++ */
++
++ for (res = res0; res; res = res->ai_next) {
++ if (res->ai_family != sin->sa_family)
++ continue;
++ switch (res->ai_family) {
++ case AF_INET:
++ rap = (char *)&((struct sockaddr_in *)res->ai_addr)->sin_addr;
++ break;
++ case AF_INET6:
++ /* need to check scope_id */
++ if (((struct sockaddr_in6 *)sin)->sin6_scope_id !=
++ ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id) {
++ continue;
++ }
++ rap = (char *)&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
++ break;
++ default:
++ continue;
++ }
++ if (memcmp(rap, ap, alen) == 0) {
++ freeaddrinfo(res0);
++ return; /* name is good, keep it */
++ }
++ }
++
++ /*
++ * The host name does not map to the initial address. Perhaps
++ * someone has messed up. Perhaps someone compromised a name
++ * server.
++ */
++
++ getnameinfo(sin, salen, hname, sizeof(hname),
++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++ tcpd_warn("host name/address mismatch: %s != %.*s",
++ hname, STRING_LENGTH,
++ (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++ }
++ strcpy(host->name, paranoid); /* name is bad, clobber it */
++ if (res0)
++ freeaddrinfo(res0);
++ }
++#else /* INET6 */
+ struct sockaddr_in *sin = host->sin;
+ struct hostent *hp;
+ int i;
+@@ -220,6 +412,7 @@
+ }
+ strcpy(host->name, paranoid); /* name is bad, clobber it */
+ }
++#endif /* INET6 */
+ }
+
+ /* sock_sink - absorb unreceived IP datagram */
+@@ -228,7 +421,11 @@
+ int fd;
+ {
+ char buf[BUFSIZ];
++#ifdef INET6
++ struct sockaddr_storage sin;
++#else
+ struct sockaddr_in sin;
++#endif
+ int size = sizeof(sin);
+
+ /*
+diff -ruN tcp_wrappers_7.6.orig/tcpd.c tcp_wrappers_7.6/tcpd.c
+--- tcp_wrappers_7.6.orig/tcpd.c 1996-02-11 17:01:33.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.c 2004-04-10 19:07:43.000000000 +0200
+@@ -120,7 +120,12 @@
+
+ /* Report request and invoke the real daemon program. */
+
++#ifdef INET6
++ syslog(allow_severity, "connect from %s (%s)",
++ eval_client(&request), eval_hostaddr(request.client));
++#else
+ syslog(allow_severity, "connect from %s", eval_client(&request));
++#endif
+ closelog();
+ (void) execv(path, argv);
+ syslog(LOG_ERR, "error: cannot execute %s: %m", path);
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 1997-02-12 02:13:25.000000000 +0100
++++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:07:43.000000000 +0200
+@@ -22,6 +22,9 @@
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -397,6 +400,31 @@
+ }
+ }
+
++#ifdef INET6
++static int is_inet6_addr(pat)
++ char *pat;
++{
++ struct addrinfo hints, *res;
++ int len, ret;
++ char ch;
++
++ if (*pat != '[')
++ return (0);
++ len = strlen(pat);
++ if ((ch = pat[len - 1]) != ']')
++ return (0);
++ pat[len - 1] = '\0';
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if ((ret = getaddrinfo(pat + 1, NULL, &hints, &res)) == 0)
++ freeaddrinfo(res);
++ pat[len - 1] = ch;
++ return (ret == 0);
++}
++#endif
++
+ /* check_host - criticize host pattern */
+
+ static int check_host(pat)
+@@ -423,14 +451,27 @@
+ #endif
+ #endif
+ } else if (mask = split_at(pat, '/')) { /* network/netmask */
++#ifdef INET6
++ int mask_len;
++
++ if ((dot_quad_addr(pat) == INADDR_NONE
++ || dot_quad_addr(mask) == INADDR_NONE)
++ && (!is_inet6_addr(pat)
++ || ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
++#else
+ if (dot_quad_addr(pat) == INADDR_NONE
+ || dot_quad_addr(mask) == INADDR_NONE)
++#endif
+ tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
+ } else if (STR_EQ(pat, "FAIL")) { /* obsolete */
+ tcpd_warn("FAIL is no longer recognized");
+ tcpd_warn("(use EXCEPT or DENY instead)");
+ } else if (reserved_name(pat)) { /* other reserved */
+ /* void */ ;
++#ifdef INET6
++ } else if (is_inet6_addr(pat)) { /* IPv6 address */
++ addr_count = 1;
++#endif
+ } else if (NOT_INADDR(pat)) { /* internet name */
+ if (pat[strlen(pat) - 1] == '.') {
+ tcpd_warn("%s: domain or host name ends in dot", pat);
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 1996-03-19 16:22:25.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h 2004-04-10 19:07:43.000000000 +0200
+@@ -11,7 +11,11 @@
+ struct host_info {
+ char name[STRING_LENGTH]; /* access via eval_hostname(host) */
+ char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */
++#ifdef INET6
++ struct sockaddr *sin; /* socket address or 0 */
++#else
+ struct sockaddr_in *sin; /* socket address or 0 */
++#endif
+ struct t_unitdata *unit; /* TLI transport address or 0 */
+ struct request_info *request; /* for shared information */
+ };
+diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.c tcp_wrappers_7.6/tcpdmatch.c
+--- tcp_wrappers_7.6.orig/tcpdmatch.c 1996-02-11 17:01:36.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.c 2004-04-10 19:07:43.000000000 +0200
+@@ -57,7 +57,11 @@
+ int argc;
+ char **argv;
+ {
++#ifdef INET6
++ struct addrinfo hints, *hp, *res;
++#else
+ struct hostent *hp;
++#endif
+ char *myname = argv[0];
+ char *client;
+ char *server;
+@@ -68,8 +72,13 @@
+ int ch;
+ char *inetcf = 0;
+ int count;
++#ifdef INET6
++ struct sockaddr_storage server_sin;
++ struct sockaddr_storage client_sin;
++#else
+ struct sockaddr_in server_sin;
+ struct sockaddr_in client_sin;
++#endif
+ struct stat st;
+
+ /*
+@@ -172,13 +181,20 @@
+ if (NOT_INADDR(server) == 0 || HOSTNAME_KNOWN(server)) {
+ if ((hp = find_inet_addr(server)) == 0)
+ exit(1);
++#ifndef INET6
+ memset((char *) &server_sin, 0, sizeof(server_sin));
+ server_sin.sin_family = AF_INET;
++#endif
+ request_set(&request, RQ_SERVER_SIN, &server_sin, 0);
+
++#ifdef INET6
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&server_sin, res->ai_addr, res->ai_addrlen);
++#else
+ for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ memcpy((char *) &server_sin.sin_addr, addr,
+ sizeof(server_sin.sin_addr));
++#endif
+
+ /*
+ * Force evaluation of server host name and address. Host name
+@@ -194,7 +210,11 @@
+ fprintf(stderr, "Please specify an address instead\n");
+ exit(1);
+ }
++#ifdef INET6
++ freeaddrinfo(hp);
++#else
+ free((char *) hp);
++#endif
+ } else {
+ request_set(&request, RQ_SERVER_NAME, server, 0);
+ }
+@@ -208,6 +228,18 @@
+ tcpdmatch(&request);
+ exit(0);
+ }
++#ifdef INET6
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_family = AF_INET6;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++ if (getaddrinfo(client, NULL, &hints, &res) == 0) {
++ freeaddrinfo(res);
++ request_set(&request, RQ_CLIENT_ADDR, client, 0);
++ tcpdmatch(&request);
++ exit(0);
++ }
++#endif
+
+ /*
+ * Perhaps they are testing special client hostname patterns that aren't
+@@ -229,6 +261,34 @@
+ */
+ if ((hp = find_inet_addr(client)) == 0)
+ exit(1);
++#ifdef INET6
++ request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
++
++ for (res = hp, count = 0; res; res = res->ai_next, count++) {
++ memcpy(&client_sin, res->ai_addr, res->ai_addrlen);
++
++ /*
++ * getnameinfo() doesn't do reverse lookup against link-local
++ * address. So, we pass through host name evaluation against
++ * such addresses.
++ */
++ if (res->ai_family != AF_INET6 ||
++ !IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr)) {
++ /*
++ * Force evaluation of client host name and address. Host name
++ * conflicts will be reported while eval_hostname() does its job.
++ */
++ request_set(&request, RQ_CLIENT_NAME, "", RQ_CLIENT_ADDR, "", 0);
++ if (STR_EQ(eval_hostname(request.client), unknown))
++ tcpd_warn("host address %s->name lookup failed",
++ eval_hostaddr(request.client));
++ }
++ tcpdmatch(&request);
++ if (res->ai_next)
++ printf("\n");
++ }
++ freeaddrinfo(hp);
++#else
+ memset((char *) &client_sin, 0, sizeof(client_sin));
+ client_sin.sin_family = AF_INET;
+ request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
+@@ -250,6 +310,7 @@
+ printf("\n");
+ }
+ free((char *) hp);
++#endif
+ exit(0);
+ }
+
+diff -ruN tcp_wrappers_7.6.orig/tli.c tcp_wrappers_7.6/tli.c
+--- tcp_wrappers_7.6.orig/tli.c 1997-03-21 19:27:26.000000000 +0100
++++ tcp_wrappers_7.6/tli.c 2004-04-10 19:07:43.000000000 +0200
+@@ -65,8 +65,13 @@
+ void tli_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++ static struct sockaddr_storage client;
++ static struct sockaddr_storage server;
++#else
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
++#endif
+
+ /*
+ * If we discover that we are using an IP transport, pretend we never
+@@ -76,14 +81,29 @@
+
+ tli_endpoints(request);
+ if ((request->config = tli_transport(request->fd)) != 0
++#ifdef INET6
++ && (STR_EQ(request->config->nc_protofmly, "inet") ||
++ STR_EQ(request->config->nc_protofmly, "inet6"))) {
++#else
+ && STR_EQ(request->config->nc_protofmly, "inet")) {
++#endif
+ if (request->client->unit != 0) {
++#ifdef INET6
++ client = *(struct sockaddr_storage *) request->client->unit->addr.buf;
++ request->client->sin = (struct sockaddr *) &client;
++#else
+ client = *(struct sockaddr_in *) request->client->unit->addr.buf;
+ request->client->sin = &client;
++#endif
+ }
+ if (request->server->unit != 0) {
++#ifdef INET6
++ server = *(struct sockaddr_storage *) request->server->unit->addr.buf;
++ request->server->sin = (struct sockaddr *) &server;
++#else
+ server = *(struct sockaddr_in *) request->server->unit->addr.buf;
+ request->server->sin = &server;
++#endif
+ }
+ tli_cleanup(request);
+ sock_methods(request);
+@@ -187,7 +207,15 @@
+ }
+ while (config = getnetconfig(handlep)) {
+ if (stat(config->nc_device, &from_config) == 0) {
++#ifdef NO_CLONE_DEVICE
++ /*
++ * If the network devices are not cloned (as is the case for
++ * Solaris 8 Beta), we must compare the major device numbers.
++ */
++ if (major(from_config.st_rdev) == major(from_client.st_rdev))
++#else
+ if (minor(from_config.st_rdev) == major(from_client.st_rdev))
++#endif
+ break;
+ }
+ }
+diff -ruN tcp_wrappers_7.6.orig/update.c tcp_wrappers_7.6/update.c
+--- tcp_wrappers_7.6.orig/update.c 1994-12-28 17:42:56.000000000 +0100
++++ tcp_wrappers_7.6/update.c 2004-04-10 19:07:43.000000000 +0200
+@@ -46,10 +46,18 @@
+ request->fd = va_arg(ap, int);
+ continue;
+ case RQ_CLIENT_SIN:
++#ifdef INET6
++ request->client->sin = va_arg(ap, struct sockaddr *);
++#else
+ request->client->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ continue;
+ case RQ_SERVER_SIN:
++#ifdef INET6
++ request->server->sin = va_arg(ap, struct sockaddr *);
++#else
+ request->server->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ continue;
+
+ /*
+diff -ruN tcp_wrappers_7.6.orig/workarounds.c tcp_wrappers_7.6/workarounds.c
+--- tcp_wrappers_7.6.orig/workarounds.c 1996-03-19 16:22:26.000000000 +0100
++++ tcp_wrappers_7.6/workarounds.c 2004-04-10 19:07:43.000000000 +0200
+@@ -166,11 +166,22 @@
+ int *len;
+ {
+ int ret;
++#ifdef INET6
++ struct sockaddr *sin = sa;
++#else
+ struct sockaddr_in *sin = (struct sockaddr_in *) sa;
++#endif
+
+ if ((ret = getpeername(sock, sa, len)) >= 0
++#ifdef INET6
++ && ((sin->su_si.si_family == AF_INET6
++ && IN6_IS_ADDR_UNSPECIFIED(&sin->su_sin6.sin6_addr))
++ || (sin->su_si.si_family == AF_INET
++ && sin->su_sin.sin_addr.s_addr == 0))) {
++#else
+ && sa->sa_family == AF_INET
+ && sin->sin_addr.s_addr == 0) {
++#endif
+ errno = ENOTCONN;
+ return (-1);
+ } else {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch
new file mode 100644
index 000000000..226106f4f
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch
@@ -0,0 +1,153 @@
+Upstream-Status: Backport
+
+Path: news.porcupine.org!news.porcupine.org!not-for-mail
+From: Wietse Venema <wietse@((no)(spam)(please))wzv.win.tue.nl>
+Newsgroups: comp.mail.sendmail,comp.security.unix
+Subject: TCP Wrapper Blacklist Extension
+Followup-To: poster
+Date: 8 Sep 1997 18:53:13 -0400
+Organization: Wietse's hangout while on sabattical in the USA
+Lines: 147
+Sender: wietse@spike.porcupine.org
+Message-ID: <5v1vkp$h4f$1@spike.porcupine.org>
+NNTP-Posting-Host: spike.porcupine.org
+Xref: news.porcupine.org comp.mail.sendmail:3541 comp.security.unix:7158
+
+The patch below adds a new host pattern to the TCP Wrapper access
+control language. Instead of a host name or address pattern, you
+can specify an external /file/name with host name or address
+patterns. The feature can be used recursively.
+
+The /file/name extension makes it easy to blacklist bad sites, for
+example, to block unwanted electronic mail when libwrap is linked
+into sendmail. Adding hosts to a simple text file is much easier
+than having to edit a more complex hosts.allow/deny file.
+
+I developed this a year or so ago as a substitute for NIS netgroups.
+At that time, I did not consider it of sufficient interest for
+inclusion in the TCP Wrapper distribution. How times have changed.
+
+The patch is relative to TCP Wrappers version 7.6. The main archive
+site is ftp://ftp.win.tue.nl/pub/security/tcp_wrappers_7.6.tar.gz
+
+Thanks to the Debian LINUX folks for expressing their interest in
+this patch.
+
+ Wietse
+
+
+[diff updated by Md]
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-10 19:28:01.000000000 +0200
+@@ -97,6 +97,13 @@
+ `[3ffe:505:2:1::]/64\' matches every address in the range
+ `3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'.
+ .IP \(bu
++A string that begins with a `/\' character is treated as a file
++name. A host name or address is matched if it matches any host name
++or address pattern listed in the named file. The file format is
++zero or more lines with zero or more host name or address patterns
++separated by whitespace. A file name pattern can be used anywhere
++a host name or address pattern can be used.
++.IP \(bu
+ Wildcards `*\' and `?\' can be used to match hostnames or IP addresses. This
+ method of matching cannot be used in conjunction with `net/mask\' matching,
+ hostname matching beginning with `.\' or IP address matching ending with `.\'.
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c 2004-04-10 19:27:05.000000000 +0200
+@@ -253,6 +253,26 @@
+ }
+ }
+
++/* hostfile_match - look up host patterns from file */
++
++static int hostfile_match(path, host)
++char *path;
++struct hosts_info *host;
++{
++ char tok[BUFSIZ];
++ int match = NO;
++ FILE *fp;
++
++ if ((fp = fopen(path, "r")) != 0) {
++ while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
++ /* void */ ;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", path);
++ }
++ return (match);
++}
++
+ /* host_match - match host name and/or address against pattern */
+
+ static int host_match(tok, host)
+@@ -280,6 +300,8 @@
+ tcpd_warn("netgroup support is disabled"); /* not tcpd_jump() */
+ return (NO);
+ #endif
++ } else if (tok[0] == '/') { /* /file hack */
++ return (hostfile_match(tok, host));
+ } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */
+ char *name = eval_hostname(host);
+ return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c 2004-04-10 19:27:05.000000000 +0200
+@@ -353,6 +353,8 @@
+ {
+ if (pat[0] == '@') {
+ tcpd_warn("%s: daemon name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: daemon name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: daemon name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -385,6 +387,8 @@
+ {
+ if (pat[0] == '@') { /* @netgroup */
+ tcpd_warn("%s: user name begins with \"@\"", pat);
++ } else if (pat[0] == '/') {
++ tcpd_warn("%s: user name begins with \"/\"", pat);
+ } else if (pat[0] == '.') {
+ tcpd_warn("%s: user name begins with dot", pat);
+ } else if (pat[strlen(pat) - 1] == '.') {
+@@ -430,8 +434,13 @@
+ static int check_host(pat)
+ char *pat;
+ {
++ char buf[BUFSIZ];
+ char *mask;
+ int addr_count = 1;
++ FILE *fp;
++ struct tcpd_context saved_context;
++ char *cp;
++ char *wsp = " \t\r\n";
+
+ if (pat[0] == '@') { /* @netgroup */
+ #ifdef NO_NETGRENT
+@@ -450,6 +459,21 @@
+ tcpd_warn("netgroup support disabled");
+ #endif
+ #endif
++ } else if (pat[0] == '/') { /* /path/name */
++ if ((fp = fopen(pat, "r")) != 0) {
++ saved_context = tcpd_context;
++ tcpd_context.file = pat;
++ tcpd_context.line = 0;
++ while (fgets(buf, sizeof(buf), fp)) {
++ tcpd_context.line++;
++ for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
++ check_host(cp);
++ }
++ tcpd_context = saved_context;
++ fclose(fp);
++ } else if (errno != ENOENT) {
++ tcpd_warn("open %s: %m", pat);
++ }
+ } else if (mask = split_at(pat, '/')) { /* network/netmask */
+ #ifdef INET6
+ int mask_len;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch
new file mode 100644
index 000000000..260e8d313
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Backport
+
+diff -uN tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.new/hosts_access.c
+--- tcp_wrappers_7.6/hosts_access.c Mon May 20 14:00:56 2002
++++ tcp_wrappers_7.6.new/hosts_access.c Mon May 20 14:25:05 2002
+@@ -448,6 +448,15 @@
+ int len, mask_len, i = 0;
+ char ch;
+
++ /*
++ * Behavior of getaddrinfo() against IPv4-mapped IPv6 address is
++ * different between KAME and Solaris8. While KAME returns
++ * AF_INET6, Solaris8 returns AF_INET. So, we avoid this here.
++ */
++ if (STRN_EQ(string, "::ffff:", 7)
++ && dot_quad_addr(string + 7) != INADDR_NONE)
++ return (masked_match4(net_tok, mask_tok, string + 7));
++
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET6;
+ hints.ai_socktype = SOCK_STREAM;
+@@ -457,13 +466,6 @@
+ memcpy(&addr, res->ai_addr, sizeof(addr));
+ freeaddrinfo(res);
+
+- if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) {
+- if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE
+- || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE)
+- return (NO);
+- return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]);
+- }
+-
+ /* match IPv6 address against netnumber/prefixlen */
+ len = strlen(net_tok);
+ if (*net_tok != '[' || net_tok[len - 1] != ']')
+diff -uN tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.new/socket.c
+--- tcp_wrappers_7.6/socket.c Mon May 20 13:48:35 2002
++++ tcp_wrappers_7.6.new/socket.c Mon May 20 14:22:27 2002
+@@ -228,7 +228,7 @@
+ hints.ai_family = sin->sa_family;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
+- if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) {
++ if ((err = getaddrinfo(host->name, NULL, &hints, &res0)) == 0) {
+ freeaddrinfo(res0);
+ res0 = NULL;
+ tcpd_warn("host name/name mismatch: "
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
new file mode 100644
index 000000000..e8289e44d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
@@ -0,0 +1,83 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile 2003-08-21 01:43:39.000000000 +0200
++++ tcp_wrappers_7.6/Makefile 2003-08-21 01:43:35.000000000 +0200
+@@ -45,7 +45,7 @@
+ #
+ # SysV.4 Solaris 2.x OSF AIX
+ #REAL_DAEMON_DIR=/usr/sbin
+-#
++REAL_DAEMON_DIR=/usr/sbin
+ # BSD 4.4
+ #REAL_DAEMON_DIR=/usr/libexec
+ #
+@@ -512,6 +519,7 @@
+ # (examples: allow, deny, banners, twist and spawn).
+ #
+ #STYLE = -DPROCESS_OPTIONS # Enable language extensions.
++STYLE = -DPROCESS_OPTIONS
+
+ ################################################################
+ # Optional: Changing the default disposition of logfile records
+@@ -535,6 +543,7 @@
+ # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
+
+ FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use
++FACILITY= LOG_DAEMON
+
+ # The syslog priority at which successful connections are logged.
+
+@@ -631,6 +640,7 @@
+ # lookups altogether, see the next section.
+
+ PARANOID= -DPARANOID
++PARANOID=
+
+ ########################################
+ # Optional: turning off hostname lookups
+@@ -644,6 +654,7 @@
+ # mode (see previous section) and comment out the following definition.
+
+ HOSTNAME= -DALWAYS_HOSTNAME
++HOSTNAME=
+
+ #############################################
+ # Optional: Turning on host ADDRESS checking
+@@ -670,6 +681,7 @@
+ # Solaris 2.x, and Linux. See your system documentation for details.
+ #
+ # KILL_OPT= -DKILL_IP_OPTIONS
++KILL_OPT= -DKILL_IP_OPTIONS
+
+ ## End configuration options
+ ############################
+@@ -677,9 +689,10 @@
+ # Protection against weird shells or weird make programs.
+
+ SHELL = /bin/sh
+-.c.o:; $(CC) $(CFLAGS) -c $*.c
++.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c
+
+-CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
++COPTS = -O2 -g
++CFLAGS = $(COPTS) -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
+ $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+@@ -712,10 +725,11 @@
+
+ config-check:
+ @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
+- @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
+- if cmp cflags /tmp/cflags.$$$$ ; \
+- then rm /tmp/cflags.$$$$ ; \
+- else mv /tmp/cflags.$$$$ cflags ; \
++ @set +e; echo $(CFLAGS) >cflags.new ; \
++ if cmp cflags cflags.new ; \
++ then rm cflags.new ; \
++ else mv cflags.new cflags ; \
+ fi >/dev/null 2>/dev/null
++ @if [ ! -d shared ]; then mkdir shared; fi
+
+ $(LIB): $(LIB_OBJ)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch
new file mode 100644
index 000000000..bd1396bc7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch
@@ -0,0 +1,255 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile 2004-05-02 15:37:59.000000000 +0200
++++ tcp_wrappers_7.6/Makefile 2004-05-02 15:31:09.000000000 +0200
+@@ -150,15 +150,15 @@
+
+ linux:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
+ NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \
+- EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
+
+ gnu:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+- LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++ LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
+ NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \
+- EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all
++ EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" all
+
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -713,7 +713,22 @@
+
+ LIB = libwrap.a
+
+-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
++shared/%.o: %.c
++ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
++
++SOMAJOR = 0
++SOMINOR = 7.6
++
++SHLIB = shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
++SHLIBSOMAJ = shared/libwrap.so.$(SOMAJOR)
++SHLIBSO = shared/libwrap.so
++SHLIBFLAGS = -Lshared -lwrap
++
++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
++SHCFLAGS = -fPIC -shared -D_REENTRANT
++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
++
++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+
+@@ -731,27 +746,33 @@
+ $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
+ -$(RANLIB) $(LIB)
+
+-tcpd: tcpd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
++$(SHLIB): $(SHLIB_OBJ)
++ rm -f $(SHLIB)
++ $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++ ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
++ ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
++
++tcpd: tcpd.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+
+ miscd: miscd.o $(LIB)
+ $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
+
+-safe_finger: safe_finger.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
++safe_finger: safe_finger.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+
+-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+
+-try-from: try-from.o fakelog.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
++try-from: try-from.o fakelog.o $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+
+-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
++ $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
+
+ shar: $(KIT)
+ @shar $(KIT)
+@@ -767,7 +788,9 @@
+
+ clean:
+ rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
++ libwrap*.so* \
+ cflags
++ rm -rf shared/
+
+ tidy: clean
+ chmod -R a+r .
+@@ -913,5 +936,6 @@
+ update.o: mystdarg.h
+ update.o: tcpd.h
+ vfprintf.o: cflags
++weak_symbols.o: tcpd.h
+ workarounds.o: cflags
+ workarounds.o: tcpd.h
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2004-05-02 15:37:59.000000000 +0200
++++ tcp_wrappers_7.6/tcpd.h 2004-05-02 15:37:49.000000000 +0200
+@@ -4,6 +4,15 @@
+ * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+ */
+
++#ifndef _TCPWRAPPERS_TCPD_H
++#define _TCPWRAPPERS_TCPD_H
++
++/* Need definitions of struct sockaddr_in and FILE. */
++#include <netinet/in.h>
++#include <stdio.h>
++
++__BEGIN_DECLS
++
+ /* Structure to describe one communications endpoint. */
+
+ #define STRING_LENGTH 128 /* hosts, users, processes */
+@@ -29,10 +38,10 @@
+ char pid[10]; /* access via eval_pid(request) */
+ struct host_info client[1]; /* client endpoint info */
+ struct host_info server[1]; /* server endpoint info */
+- void (*sink) (); /* datagram sink function or 0 */
+- void (*hostname) (); /* address to printable hostname */
+- void (*hostaddr) (); /* address to printable address */
+- void (*cleanup) (); /* cleanup function or 0 */
++ void (*sink) (int); /* datagram sink function or 0 */
++ void (*hostname) (struct host_info *); /* address to printable hostname */
++ void (*hostaddr) (struct host_info *); /* address to printable address */
++ void (*cleanup) (struct request_info *); /* cleanup function or 0 */
+ struct netconfig *config; /* netdir handle */
+ };
+
+@@ -70,20 +79,27 @@
+ #define fromhost sock_host /* no TLI support needed */
+ #endif
+
+-extern int hosts_access(); /* access control */
+-extern void shell_cmd(); /* execute shell command */
+-extern char *percent_x(); /* do %<char> expansion */
+-extern void rfc931(); /* client name from RFC 931 daemon */
+-extern void clean_exit(); /* clean up and exit */
+-extern void refuse(); /* clean up and exit */
+-extern char *xgets(); /* fgets() on steroids */
+-extern char *split_at(); /* strchr() and split */
+-extern unsigned long dot_quad_addr(); /* restricted inet_addr() */
++extern int hosts_access(struct request_info *request); /* access control */
++extern void shell_cmd(char *); /* execute shell command */
++extern char *percent_x(char *, int, char *, struct request_info *);
++ /* do %<char> expansion */
++extern void rfc931(struct sockaddr *, struct sockaddr *, char *);
++ /* client name from RFC 931 daemon */
++extern void clean_exit(struct request_info *); /* clean up and exit */
++extern void refuse(struct request_info *); /* clean up and exit */
++extern char *xgets(char *, int, FILE *); /* fgets() on steroids */
++extern char *split_at(char *, int); /* strchr() and split */
++extern unsigned long dot_quad_addr(char *); /* restricted inet_addr() */
+
+ /* Global variables. */
+
++#ifdef HAVE_WEAKSYMS
++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
++#else
+ extern int allow_severity; /* for connection logging */
+ extern int deny_severity; /* for connection logging */
++#endif
+ extern char *hosts_allow_table; /* for verification mode redirection */
+ extern char *hosts_deny_table; /* for verification mode redirection */
+ extern int hosts_access_verbose; /* for verbose matching mode */
+@@ -98,6 +114,8 @@
+ #ifdef __STDC__
+ extern struct request_info *request_init(struct request_info *,...);
+ extern struct request_info *request_set(struct request_info *,...);
++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
++ char *client_user);
+ #else
+ extern struct request_info *request_init(); /* initialize request */
+ extern struct request_info *request_set(); /* update request structure */
+@@ -121,20 +139,23 @@
+ * host_info structures serve as caches for the lookup results.
+ */
+
+-extern char *eval_user(); /* client user */
+-extern char *eval_hostname(); /* printable hostname */
+-extern char *eval_hostaddr(); /* printable host address */
+-extern char *eval_hostinfo(); /* host name or address */
+-extern char *eval_client(); /* whatever is available */
+-extern char *eval_server(); /* whatever is available */
++extern char *eval_user(struct request_info *); /* client user */
++extern char *eval_hostname(struct host_info *); /* printable hostname */
++extern char *eval_hostaddr(struct host_info *); /* printable host address */
++extern char *eval_hostinfo(struct host_info *); /* host name or address */
++extern char *eval_client(struct request_info *);/* whatever is available */
++extern char *eval_server(struct request_info *);/* whatever is available */
+ #define eval_daemon(r) ((r)->daemon) /* daemon process name */
+ #define eval_pid(r) ((r)->pid) /* process id */
+
+ /* Socket-specific methods, including DNS hostname lookups. */
+
+-extern void sock_host(); /* look up endpoint addresses */
+-extern void sock_hostname(); /* translate address to hostname */
+-extern void sock_hostaddr(); /* address to printable address */
++/* look up endpoint addresses */
++extern void sock_host(struct request_info *);
++/* translate address to hostname */
++extern void sock_hostname(struct host_info *);
++/* address to printable address */
++extern void sock_hostaddr(struct host_info *);
+ #define sock_methods(r) \
+ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
+
+@@ -182,7 +203,7 @@
+ * behavior.
+ */
+
+-extern void process_options(); /* execute options */
++extern void process_options(char *, struct request_info *);/* execute options */
+ extern int dry_run; /* verification flag */
+
+ /* Bug workarounds. */
+@@ -221,3 +242,7 @@
+ #define strtok my_strtok
+ extern char *my_strtok();
+ #endif
++
++__END_DECLS
++
++#endif
+diff -ruN tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c
+--- tcp_wrappers_7.6.orig/weak_symbols.c 1970-01-01 01:00:00.000000000 +0100
++++ tcp_wrappers_7.6/weak_symbols.c 2004-05-02 15:31:09.000000000 +0200
+@@ -0,0 +1,11 @@
++ /*
++ * @(#) weak_symbols.h 1.5 99/12/29 23:50
++ *
++ * Author: Anthony Towns <ajt@debian.org>
++ */
++
++#ifdef HAVE_WEAKSYMS
++#include <syslog.h>
++int deny_severity = LOG_WARNING;
++int allow_severity = SEVERITY;
++#endif
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch
new file mode 100644
index 000000000..eb5685c57
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch
@@ -0,0 +1,68 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2003-08-21 03:15:31.000000000 +0200
+@@ -90,6 +90,10 @@
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
+ .IP \(bu
++An expression of the form `n.n.n.n/mm' is interpreted as a
++`net/masklength' pair, where `mm' is the number of consecutive `1'
++bits in the netmask applied to the `n.n.n.n' address.
++.IP \(bu
+ An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a
+ `[net]/prefixlen\' pair. An IPv6 host address is matched if
+ `prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c 2003-08-21 03:09:30.000000000 +0200
+@@ -417,7 +417,8 @@
+ if ((addr = dot_quad_addr(string)) == INADDR_NONE)
+ return (NO);
+ if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+- || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++ || ((mask = dot_quad_addr(mask_tok)) == INADDR_NONE
++ && (mask = cidr_mask_addr(mask_tok)) == 0)) {
+ #ifndef INET6
+ tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
+ #endif
+diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c
+--- tcp_wrappers_7.6.orig/misc.c 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/misc.c 2003-08-21 03:09:30.000000000 +0200
+@@ -107,3 +107,17 @@
+ }
+ return (runs == 4 ? inet_addr(str) : INADDR_NONE);
+ }
++
++/* cidr_mask_addr - convert cidr netmask length to internal form */
++
++unsigned long cidr_mask_addr(str)
++char *str;
++{
++ int maskbits;
++
++ maskbits = atoi(str);
++ if (maskbits < 1 || maskbits > 32)
++ return (0);
++ return htonl(0xFFFFFFFF << (32 - maskbits));
++}
++
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 03:09:30.000000000 +0200
+@@ -497,12 +497,12 @@
+ int mask_len;
+
+ if ((dot_quad_addr(pat) == INADDR_NONE
+- || dot_quad_addr(mask) == INADDR_NONE)
++ || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0)
+ && (!is_inet6_addr(pat)
+ || ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
+ #else
+ if (dot_quad_addr(pat) == INADDR_NONE
+- || dot_quad_addr(mask) == INADDR_NONE)
++ || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0)
+ #endif
+ tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
+ } else if (STR_EQ(pat, "FAIL")) { /* obsolete */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch
new file mode 100644
index 000000000..3ca687411
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-04-25 12:17:59.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5 2004-04-25 12:17:53.000000000 +0200
+@@ -89,6 +89,8 @@
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
++`255.255.255.255\' is not a valid mask value, so a single host can be
++matched just by its IP.
+ .IP \(bu
+ An expression of the form `n.n.n.n/mm' is interpreted as a
+ `net/masklength' pair, where `mm' is the number of consecutive `1'
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch
new file mode 100644
index 000000000..308737797
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch
@@ -0,0 +1,73 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/eval.c tcp_wrappers_7.6/eval.c
+--- tcp_wrappers_7.6.orig/eval.c 1995-01-30 19:51:46.000000000 +0100
++++ tcp_wrappers_7.6/eval.c 2004-11-04 13:59:01.000000000 +0100
+@@ -98,6 +98,28 @@
+ }
+ }
+
++/* eval_port - return string with the port */
++char *eval_port(saddr)
++#ifdef INET6
++struct sockaddr *saddr;
++#else
++struct sockaddr_in *saddr;
++#endif
++{
++ static char port[16];
++ if (saddr != 0) {
++ sprintf(port, "%u",
++#ifdef INET6
++ ntohs(((struct sockaddr_in *)saddr)->sin_port));
++#else
++ ntohs(saddr->sin_port));
++#endif
++ } else {
++ strcpy(port, "0");
++ }
++ return (port);
++}
++
+ /* eval_client - return string with as much about the client as we know */
+
+ char *eval_client(request)
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5 2004-11-04 13:17:45.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5 2004-11-04 13:55:32.000000000 +0100
+@@ -175,6 +175,8 @@
+ unavailable.
+ .IP "%n (%N)"
+ The client (server) host name (or "unknown" or "paranoid").
++.IP "%r (%R)"
++The clients (servers) port number (or "0").
+ .IP %p
+ The daemon process id.
+ .IP %s
+diff -ruN tcp_wrappers_7.6.orig/percent_x.c tcp_wrappers_7.6/percent_x.c
+--- tcp_wrappers_7.6.orig/percent_x.c 1994-12-28 17:42:38.000000000 +0100
++++ tcp_wrappers_7.6/percent_x.c 2004-11-04 13:19:29.000000000 +0100
+@@ -63,6 +63,8 @@
+ ch == 'n' ? eval_hostname(request->client) :
+ ch == 'N' ? eval_hostname(request->server) :
+ ch == 'p' ? eval_pid(request) :
++ ch == 'r' ? eval_port(request->client->sin) :
++ ch == 'R' ? eval_port(request->server->sin) :
+ ch == 's' ? eval_server(request) :
+ ch == 'u' ? eval_user(request) :
+ ch == '%' ? "%" : (tcpd_warn("unrecognized %%%c", ch), "");
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2004-11-04 13:17:45.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h 2004-11-04 13:19:13.000000000 +0100
+@@ -145,6 +145,11 @@
+ extern char *eval_hostinfo(struct host_info *); /* host name or address */
+ extern char *eval_client(struct request_info *);/* whatever is available */
+ extern char *eval_server(struct request_info *);/* whatever is available */
++#ifdef INET6
++extern char *eval_port(struct sockaddr *);
++#else
++extern char *eval_port(struct sockaddr_in *);
++#endif
+ #define eval_daemon(r) ((r)->daemon) /* daemon process name */
+ #define eval_pid(r) ((r)->pid) /* process id */
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch
new file mode 100644
index 000000000..4cc554fc3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/percent_m.c tcp_wrappers_7.6/percent_m.c
+--- tcp_wrappers_7.6.orig/percent_m.c 1994-12-28 17:42:37.000000000 +0100
++++ tcp_wrappers_7.6/percent_m.c 2003-08-21 02:45:31.000000000 +0200
+@@ -29,11 +29,15 @@
+
+ while (*bp = *cp)
+ if (*cp == '%' && cp[1] == 'm') {
++#ifdef HAVE_STRERROR
++ strcpy(bp, strerror(errno));
++#else
+ if (errno < sys_nerr && errno > 0) {
+ strcpy(bp, sys_errlist[errno]);
+ } else {
+ sprintf(bp, "Unknown error %d", errno);
+ }
++#endif
+ bp += strlen(bp);
+ cp += 2;
+ } else {
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
new file mode 100644
index 000000000..3ba214d24
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
@@ -0,0 +1,45 @@
+Upstream-Status: Backport
+
+Index: tcp_wrappers_7.6.orig/Makefile
+===================================================================
+--- tcp_wrappers_7.6.orig.orig/Makefile 2009-04-06 10:55:47.000000000 +0000
++++ tcp_wrappers_7.6.orig/Makefile 2009-04-06 10:57:04.000000000 +0000
+@@ -748,31 +748,31 @@
+
+ $(SHLIB): $(SHLIB_OBJ)
+ rm -f $(SHLIB)
+- $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++ $(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
+ ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
+ ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
+
+ tcpd: tcpd.o $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+
+ miscd: miscd.o $(LIB)
+- $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
+
+ safe_finger: safe_finger.o $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+
+ tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+
+ try-from: try-from.o fakelog.o $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+
+ tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
+- $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
+
+ shar: $(KIT)
+ @shar $(KIT)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch
new file mode 100644
index 000000000..797352579
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch
@@ -0,0 +1,54 @@
+From daf89d272e51b2153015ce7f54ab0b86182e64c1 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 28 Jan 2015 18:50:23 -0800
+Subject: [PATCH] Makefile: fix for parallel build
+
+Fixed:
+make: *** No rule to make target `cflags', needed by `tcpd.o'. Stop.
+
+Let "cflags" depend on config-check which generates cflgas will fix the
+problem.
+
+Also fixed:
+Fatal error: can't create shared/hosts_access.o: No such file or directory
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index fe5e732..f468751 100644
+--- a/Makefile
++++ b/Makefile
+@@ -714,6 +714,7 @@ KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
+ LIB = libwrap.a
+
+ shared/%.o: %.c
++ [ -d shared ] || mkdir -p shared
+ $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
+
+ SOMAJOR = 0
+@@ -730,6 +731,8 @@ SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
+
+ all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+
++cflags: config-check
++
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+
+ config-check:
+@@ -739,7 +742,7 @@ config-check:
+ then rm cflags.new ; \
+ else mv cflags.new cflags ; \
+ fi >/dev/null 2>/dev/null
+- @if [ ! -d shared ]; then mkdir shared; fi
++ @[ -d shared ] || mkdir -p shared
+
+ $(LIB): $(LIB_OBJ)
+ rm -f $(LIB)
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch
new file mode 100644
index 000000000..19bd7d3c0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3
+--- tcp_wrappers_7.6.orig/hosts_access.3 2004-04-25 00:10:48.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.3 2004-04-25 00:09:36.000000000 +0200
+@@ -14,6 +14,9 @@
+ struct request_info *request_set(request, key, value, ..., 0)
+ struct request_info *request;
+
++void fromhost(request)
++struct request_info *request;
++
+ int hosts_access(request)
+ struct request_info *request;
+
+@@ -60,6 +63,7 @@
+ is available, host names and client user names are looked up on demand,
+ using the request structure as a cache. hosts_access() returns zero if
+ access should be denied.
++fromhost() must be called before hosts_access().
+ .PP
+ hosts_ctl() is a wrapper around the request_init() and hosts_access()
+ routines with a perhaps more convenient interface (though it does not
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
new file mode 100644
index 000000000..eee640e8a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/musl-decls.patch
@@ -0,0 +1,31 @@
+__BEGIN_DECLS/__END_DECLS are BSD specific and not defined in musl
+glibc and uclibc had sys/cdefs.h doing it.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: tcp_wrappers_7.6/tcpd.h
+===================================================================
+--- tcp_wrappers_7.6.orig/tcpd.h
++++ tcp_wrappers_7.6/tcpd.h
+@@ -11,7 +11,9 @@
+ #include <netinet/in.h>
+ #include <stdio.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /* Structure to describe one communications endpoint. */
+
+@@ -252,6 +254,8 @@ extern char *fix_strtok();
+ extern char *my_strtok();
+ #endif
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch
new file mode 100644
index 000000000..7650600ab
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch
@@ -0,0 +1,35 @@
+STRINGS name conflicts with variable for strings tools (e.g. i586-oe-linux-strings)
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- tcp_wrappers_7.6/Makefile.orig 2013-04-18 23:41:58.277981740 +0200
++++ tcp_wrappers_7.6/Makefile 2013-04-18 23:42:42.513978966 +0200
+@@ -309,7 +309,7 @@
+ pyramid:
+ @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+ LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ="environ.o vfprintf.o" \
+- STRINGS="-Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy" \
++ STRINGS_FLAGS="-Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy" \
+ NETGROUP="-DNETGROUP -DUSE_GETDOMAIN" TLI= all
+
+ # Untested.
+@@ -419,7 +419,7 @@
+ # Uncomment the following if your C library does not provide the
+ # strchr/strrchr/memcmp routines, but comes with index/rindex/bcmp.
+ #
+-#STRINGS= -Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy
++#STRINGS_FLAGS= -Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy
+
+ #################################################################
+ # System dependencies: selection of non-default object libraries.
+@@ -690,7 +690,7 @@
+ $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+- $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
++ $(UCHAR) $(TABLES) $(STRINGS_FLAGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
+ $(VSYSLOG) $(HOSTNAME)
+
+ LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
new file mode 100644
index 000000000..5875b81b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:40:08.000000000 +0200
++++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:40:02.000000000 +0200
+@@ -92,6 +92,8 @@
+ char *cp;
+ char *result = unknown;
+ FILE *fp;
++ unsigned saved_timeout;
++ struct sigaction nact, oact;
+
+ #ifdef INET6
+ /* address family must be the same */
+@@ -134,7 +136,12 @@
+ */
+
+ if (setjmp(timebuf) == 0) {
+- signal(SIGALRM, timeout);
++ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
++ saved_timeout = alarm(0);
++ nact.sa_handler = timeout;
++ nact.sa_flags = 0;
++ (void) sigemptyset(&nact.sa_mask);
++ (void) sigaction(SIGALRM, &nact, &oact);
+ alarm(rfc931_timeout);
+
+ /*
+@@ -223,6 +230,10 @@
+ }
+ alarm(0);
+ }
++ /* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
++ (void) sigaction(SIGALRM, &oact, NULL);
++ if (saved_timeout > 0)
++ alarm(saved_timeout);
+ fclose(fp);
+ }
+ STRN_CPY(dest, result, STRING_LENGTH);
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff
new file mode 100644
index 000000000..723f4f136
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff
@@ -0,0 +1,41 @@
+Upstream-Status: Backport
+
+diff -ruNp tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
+--- tcp_wrappers_7.6.orig/scaffold.c 2005-03-09 18:22:04.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.c 2005-03-09 18:20:47.000000000 +0100
+@@ -237,10 +237,17 @@ struct request_info *request;
+
+ /* ARGSUSED */
+
+-void rfc931(request)
+-struct request_info *request;
++void rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
++struct sockaddr_in *rmt_sin;
++struct sockaddr_in *our_sin;
++#endif
++char *dest;
+ {
+- strcpy(request->user, unknown);
++ strcpy(dest, unknown);
+ }
+
+ /* check_path - examine accessibility */
+diff -ruNp tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h 2005-03-09 18:22:04.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h 2005-03-09 18:21:23.000000000 +0100
+@@ -83,7 +83,11 @@ extern int hosts_access(struct request_i
+ extern void shell_cmd(char *); /* execute shell command */
+ extern char *percent_x(char *, int, char *, struct request_info *);
+ /* do %<char> expansion */
++#ifdef INET6
+ extern void rfc931(struct sockaddr *, struct sockaddr *, char *);
++#else
++extern void rfc931(struct sockaddr_in *, struct sockaddr_in *, char *);
++#endif
+ /* client name from RFC 931 daemon */
+ extern void clean_exit(struct request_info *); /* clean up and exit */
+ extern void refuse(struct request_info *); /* clean up and exit */
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8 b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8
new file mode 100644
index 000000000..875616b9e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8
@@ -0,0 +1,34 @@
+.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+safe_finger \- finger client wrapper that protects against nasty stuff
+from finger servers
+.SH SYNOPSIS
+.B safe_finger [finger_options]
+.SH DESCRIPTION
+The
+.B safe_finger
+command protects against nasty stuff from finger servers. Use this
+program for automatic reverse finger probes from the
+.B tcp_wrapper
+.B (tcpd)
+, not the raw finger command. The
+.B safe_finger
+command makes sure that the finger client is not run with root
+privileges. It also runs the finger client with a defined PATH
+environment.
+.B safe_finger
+will also protect you from problems caused by the output of some
+finger servers. The problem: some programs may react to stuff in
+the first column. Other programs may get upset by thrash anywhere
+on a line. File systems may fill up as the finger server keeps
+sending data. Text editors may bomb out on extremely long lines.
+The finger server may take forever because it is somehow wedged.
+.B safe_finger
+takes care of all this badness.
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch
new file mode 100644
index 000000000..fc2afeef1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Backport
+
+--- tcp-wrappers-7.6-ipv6.1.orig/safe_finger.c
++++ tcp-wrappers-7.6-ipv6.1/safe_finger.c
+@@ -26,21 +26,24 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <pwd.h>
++#include <syslog.h>
+
+ extern void exit();
+
+ /* Local stuff */
+
+-char path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
++char path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
+
+ #define TIME_LIMIT 60 /* Do not keep listinging forever */
+ #define INPUT_LENGTH 100000 /* Do not keep listinging forever */
+ #define LINE_LENGTH 128 /* Editors can choke on long lines */
+ #define FINGER_PROGRAM "finger" /* Most, if not all, UNIX systems */
+ #define UNPRIV_NAME "nobody" /* Preferred privilege level */
+-#define UNPRIV_UGID 32767 /* Default uid and gid */
++#define UNPRIV_UGID 65534 /* Default uid and gid */
+
+ int finger_pid;
++int allow_severity = SEVERITY;
++int deny_severity = LOG_WARNING;
+
+ void cleanup(sig)
+ int sig;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch
new file mode 100644
index 000000000..9d7ea042b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Backport
+
+* Mon Feb 10 2003 Harald Hoyer <harald@redhat.de> 7.6-29
+- added security patch tcp_wrappers-7.6-sig.patch
+
+--- tcp_wrappers_7.6/hosts_access.c.sig 2003-02-10 16:18:31.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.c 2003-02-10 16:50:38.000000000 +0100
+@@ -66,6 +66,7 @@
+
+ #define YES 1
+ #define NO 0
++#define ERR -1
+
+ /*
+ * These variables are globally visible so that they can be redirected in
+@@ -129,9 +129,9 @@
+ return (verdict == AC_PERMIT);
+ if (table_match(hosts_allow_table, request))
+ return (YES);
+- if (table_match(hosts_deny_table, request))
+- return (NO);
+- return (YES);
++ if (table_match(hosts_deny_table, request) == NO)
++ return (YES);
++ return (NO);
+ }
+
+ /* table_match - match table entries with (daemon, client) pair */
+@@ -175,6 +175,7 @@
+ (void) fclose(fp);
+ } else if (errno != ENOENT) {
+ tcpd_warn("cannot open %s: %m", table);
++ match = ERR;
+ }
+ if (match) {
+ if (hosts_access_verbose > 1)
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch
new file mode 100644
index 000000000..76dd6340b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+
+diff -ruNp tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c 2004-08-29 18:42:25.000000000 +0200
++++ tcp_wrappers_7.6/rfc931.c 2004-08-29 18:41:04.000000000 +0200
+@@ -33,7 +33,7 @@ static char sccsid[] = "@(#) rfc931.c 1.
+
+ int rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
+
+-static jmp_buf timebuf;
++static sigjmp_buf timebuf;
+
+ /* fsocket - open stdio stream on top of socket */
+
+@@ -62,7 +62,7 @@ int protocol;
+ static void timeout(sig)
+ int sig;
+ {
+- longjmp(timebuf, sig);
++ siglongjmp(timebuf, sig);
+ }
+
+ /* rfc931 - return remote user name, given socket structures */
+@@ -135,7 +135,7 @@ char *dest;
+ * Set up a timer so we won't get stuck while waiting for the server.
+ */
+
+- if (setjmp(timebuf) == 0) {
++ if (sigsetjmp(timebuf, 0) == 0) {
+ /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
+ saved_timeout = alarm(0);
+ nact.sa_handler = timeout;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch
new file mode 100644
index 000000000..8e46df8e1
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch
@@ -0,0 +1,59 @@
+commit 88b6984ef0bf3b703c1c851092662b95e91db1ff
+Author: farrah rashid <farrah.rashid@windriver.com>
+Date: Tue Feb 12 09:53:50 2013 -0500
+
+ tcp-wrappers Support for building with glibc
+
+ Added support for socklen_t type to len argument passed to socket related
+ calls. This fixes a bug that causes tcp wrappers to fail when using sshd.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: farrah rashid <farrah.rashid@windriver.com>
+
+diff --git a/fix_options.c b/fix_options.c
+index 7473adf..fe2b442 100644
+--- a/fix_options.c
++++ b/fix_options.c
+@@ -38,7 +38,12 @@ struct request_info *request;
+ #ifdef IP_OPTIONS
+ unsigned char optbuf[BUFFER_SIZE / 3], *cp;
+ char lbuf[BUFFER_SIZE], *lp;
+- int optsize = sizeof(optbuf), ipproto;
++#ifdef __GLIBC__
++ socklen_t optsize = sizeof(optbuf);
++#else
++ int optsize = sizeof(optbuf);
++#endif
++ int ipproto;
+ struct protoent *ip;
+ int fd = request->fd;
+ unsigned int opt;
+diff --git a/socket.c b/socket.c
+index 4b2c575..a0d2987 100644
+--- a/socket.c
++++ b/socket.c
+@@ -95,7 +95,11 @@ struct request_info *request;
+ static struct sockaddr_in client;
+ static struct sockaddr_in server;
+ #endif
++#ifdef __GLIBC__
++ socklen_t len;
++#else
+ int len;
++#endif
+ char buf[BUFSIZ];
+ int fd = request->fd;
+
+@@ -426,7 +430,11 @@ int fd;
+ #else
+ struct sockaddr_in sin;
+ #endif
++#ifdef __GLIBC__
++ socklen_t size = sizeof(sin);
++#else
+ int size = sizeof(sin);
++#endif
+
+ /*
+ * Eat up the not-yet received datagram. Some systems insist on a
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch
new file mode 100644
index 000000000..be29bdcfa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c 2003-08-21 02:50:37.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c 2003-08-21 02:50:33.000000000 +0200
+@@ -53,6 +53,24 @@
+ #include "inetcf.h"
+ #include "scaffold.h"
+
++/* list of programs which are known to be linked with libwrap in debian */
++static const char *const libwrap_programs[] = {
++ "portmap", "mountd", "statd", "ugidd",
++ "redir", "rlinetd",
++ "sshd",
++ "atftpd",
++ "diald",
++ "esound",
++ "gdm", "gnome-session",
++ "icecast", "icecast_admin", "icecast_client", "icecast_source",
++ "mysqld",
++ "ntop",
++ "pptpd",
++ "rquotad",
++ "sendmail", "smail",
++ NULL
++};
++
+ /*
+ * Stolen from hosts_access.c...
+ */
+@@ -147,8 +165,8 @@
+ /*
+ * These are not run from inetd but may have built-in access control.
+ */
+- inet_set("portmap", WR_NOT);
+- inet_set("rpcbind", WR_NOT);
++ for (c = 0; libwrap_programs[c]; c++)
++ inet_set(libwrap_programs[c], WR_YES);
+
+ /*
+ * Check accessibility of access control files.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8 b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8
new file mode 100644
index 000000000..9c8f30543
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8
@@ -0,0 +1,28 @@
+.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+try-from \- test program for the tcp_wrapper
+.SH SYNOPSIS
+.B try-from
+.SH DESCRIPTION
+The
+.B try-from
+command can be called via a remote shell command to find out
+if the hostname and address are properly recognized
+by the
+.B tcp_wrapper
+library, if username lookup works, and (SysV only) if the TLI
+on top of IP heuristics work. Diagnostics are reported through
+.BR syslog (3)
+and redirected to stderr.
+
+Example:
+
+rsh host /some/where/try-from
+
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
new file mode 100644
index 000000000..5fdbbced7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
@@ -0,0 +1,132 @@
+SUMMARY = "Security tool that is a wrapper for TCP daemons"
+DESCRIPTION = "Tools for monitoring and filtering incoming requests for tcp \
+ services."
+SECTION = "console/network"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://DISCLAIMER;md5=071bd69cb78b18888ea5e3da5c3127fa"
+PR ="r10"
+
+
+PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev libwrap-staticdev ${PN} ${PN}-doc"
+FILES_libwrap = "${base_libdir}/lib*${SOLIBS}"
+FILES_libwrap-doc = "${mandir}/man3 ${mandir}/man5"
+FILES_libwrap-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
+FILES_libwrap-staticdev = "${libdir}/lib*.a"
+FILES_${PN} = "${sbindir}"
+FILES_${PN}-doc = "${mandir}/man8"
+
+SRC_URI = "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
+ file://00_man_quoting.diff \
+ file://01_man_portability.patch \
+ file://05_wildcard_matching.patch \
+ file://06_fix_gethostbyname.patch \
+ file://10_usagi-ipv6.patch \
+ file://11_tcpd_blacklist.patch \
+ file://11_usagi_fix.patch \
+ file://12_makefile_config.patch \
+ file://13_shlib_weaksym.patch \
+ file://14_cidr_support.patch \
+ file://15_match_clarify.patch \
+ file://expand_remote_port.patch \
+ file://have_strerror.patch \
+ file://man_fromhost.patch \
+ file://restore_sigalarm.patch \
+ file://rfc931.diff \
+ file://safe_finger.patch \
+ file://sig_fix.patch \
+ file://siglongjmp.patch \
+ file://socklen_t.patch \
+ file://tcpdchk_libwrapped.patch \
+ file://ldflags.patch \
+ file://rename_strings_variable.patch \
+ file://try-from.8 \
+ file://safe_finger.8 \
+ file://makefile-fix-parallel.patch \
+ file://musl-decls.patch \
+ "
+
+SRC_URI[md5sum] = "e6fa25f71226d090f34de3f6b122fb5a"
+SRC_URI[sha256sum] = "9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d"
+
+S = "${WORKDIR}/tcp_wrappers_${PV}"
+
+EXTRA_OEMAKE = "'CC=${CC}' \
+ 'AR=${AR}' \
+ 'RANLIB=${RANLIB}' \
+ 'REAL_DAEMON_DIR=${sbindir}' \
+ 'STYLE=-DPROCESS_OPTIONS' \
+ 'FACILITY=LOG_DAEMON' \
+ 'SEVERITY=LOG_INFO' \
+ 'BUGS=' \
+ 'VSYSLOG=' \
+ 'RFC931_TIMEOUT=10' \
+ 'ACCESS=-DHOSTS_ACCESS' \
+ 'KILL_OPT=-DKILL_IP_OPTIONS' \
+ 'UMASK=-DDAEMON_UMASK=022' \
+ 'NETGROUP=${EXTRA_OEMAKE_NETGROUP}' \
+ 'LIBS=-lnsl' \
+ 'ARFLAGS=rv' \
+ 'AUX_OBJ=weak_symbols.o' \
+ 'TLI=' \
+ 'COPTS=' \
+ 'EXTRA_CFLAGS=${CFLAGS} -DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len'"
+
+EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN"
+EXTRA_OEMAKE_NETGROUP_libc-uclibc = "-DUSE_GETDOMAIN"
+EXTRA_OEMAKE_NETGROUP_libc-musl = "-DUSE_GETDOMAIN"
+
+EXTRA_OEMAKE_append_libc-musl = " 'LIBS='"
+
+do_compile () {
+ oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \
+ all
+}
+
+BINS = "safe_finger tcpd tcpdchk try-from tcpdmatch"
+MANS3 = "hosts_access"
+MANS5 = "hosts_options"
+MANS8 = "tcpd tcpdchk tcpdmatch"
+do_install () {
+ oe_libinstall -a libwrap ${D}${libdir}
+ oe_libinstall -C shared -so libwrap ${D}${base_libdir}
+
+ if [ "${libdir}" != "${base_libdir}" ] ; then
+ rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
+ libname=`readlink ${D}${base_libdir}/libwrap.so | xargs basename`
+ ln -s ${rel_lib_prefix}${base_libdir}/${libname} ${D}${libdir}/libwrap.so
+ rm -f ${D}${base_libdir}/libwrap.so
+ fi
+
+ install -d ${D}${sbindir}
+ for b in ${BINS}; do
+ install -m 0755 $b ${D}${sbindir}/ || exit 1
+ done
+
+ install -d ${D}${mandir}/man3
+ for m in ${MANS3}; do
+ install -m 0644 $m.3 ${D}${mandir}/man3/ || exit 1
+ done
+
+ install -d ${D}${mandir}/man5
+ for m in ${MANS5}; do
+ install -m 0644 $m.5 ${D}${mandir}/man5/ || exit 1
+ done
+
+ install -d ${D}${mandir}/man8
+ for m in ${MANS8}; do
+ install -m 0644 $m.8 ${D}${mandir}/man8/ || exit 1
+ done
+
+ install -m 0644 ${WORKDIR}/try-from.8 ${D}${mandir}/man8/
+ install -m 0644 ${WORKDIR}/safe_finger.8 ${D}${mandir}/man8/
+
+ install -d ${D}${includedir}
+ install -m 0644 tcpd.h ${D}${includedir}/
+
+ install -d ${D}${sysconfdir}
+ touch ${D}${sysconfdir}/hosts.allow
+ touch ${D}${sysconfdir}/hosts.deny
+}
+
+FILES_${PN} += "${sysconfdir}/hosts.allow ${sysconfdir}/hosts.deny"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb b/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb
new file mode 100644
index 000000000..eac289e3b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texi2html/texi2html_5.0.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Perl script that converts Texinfo to HTML"
+HOMEPAGE = "http://www.nongnu.org/texi2html/"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+PR = "r2"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/texi2html/${BPN}-${PV}.tar.bz2 \
+ "
+
+SRC_URI[md5sum] = "f15ac876fcdc8be865b16535f480aa54"
+SRC_URI[sha256sum] = "e8a98b0ee20c495a6ab894398a065ef580272dbd5a15b1b19e8bd1bc89d9f9fa"
+
+inherit autotools gettext texinfo
+
+do_configure_prepend() {
+ # autotools_do_configure updates po/Makefile.in.in, we also need
+ # update po_document.
+ cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/
+ cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_messages/
+}
+
+do_install_append () {
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2html
+}
+
+FILES_${PN}-doc += "${datadir}/texinfo"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb
new file mode 100644
index 000000000..1254bc89b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Fake version of the texinfo utility suite"
+SECTION = "console/utils"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d6bb62e73ca8b901d3f2e9d71542f4bb"
+DEPENDS = ""
+PV = "1.0"
+
+SRC_URI = "file://template.py file://COPYING"
+
+S = "${WORKDIR}"
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+inherit native
+
+do_install_name() {
+ FILENAME="${D}${bindir}/$1"
+ # Using ln causes problems with rm_work
+ cp -T "${S}/template.py" "$FILENAME"
+ chmod +x $FILENAME
+}
+
+do_install() {
+ mkdir -p "${D}${bindir}"
+ for i in makeinfo pod2texi texi2dvi pdftexi2dvi texindex texi2pdf \
+ txixml2texi texi2any install-info ginstall-info \
+ update-info-dir; do
+ do_install_name $i
+ done
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING
new file mode 100644
index 000000000..531cbe723
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING
@@ -0,0 +1,19 @@
+Copyright (c) 2014 Intel Corp.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py
new file mode 100644
index 000000000..8b7033ecc
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py
@@ -0,0 +1,122 @@
+#! /usr/bin/env python2.7
+
+# template.py (and other filenames)
+# By Max Eliaser (max.eliaser@intel.com)
+
+# Copyright (c) 2014 Intel Corp.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# This program acts like a dummy version of the texinfo utilities, creating
+# the right output files but leaving them blank. It will parse out the name
+# of the executable from argv[0] and emulate the corresponding program, so
+# multiple copies of this script will exist under different names.
+
+import sys, os
+
+olong = "--output="
+Elong = "--macro-expand="
+
+
+this_binary = sys.argv[0].split ("/")[-1]
+
+# To be outputted if functionality that hasn't been stubbed yet is invoked.
+stub_msg = """
+This stand-in version of %s is not yet fully capable of emulating the real
+version from the GNU texinfo suite. If you see this message, file a bug report
+with details on the recipe that failed.
+""" % this_binary
+
+# Autotools setups query the version, so this is actually necessary. Some of
+# them (lookin' at you, glibc) actually look for the substring "GNU texinfo,"
+# so we put that substring in there without actually telling a lie.
+version_str = """ %s (fake texinfo, emulating GNU texinfo) 5.2
+
+Super amazing version which is totally not fake in any way whatsoever.
+Copyright (C) 2014 Intel Corp. Distributed under the terms of the MIT
+license.
+""" % this_binary
+
+simple_binaries = "pod2texi texi2dvi pdftexi2dvi texindex texi2pdf \
+ txixml2texi install-info ginstall-info \
+ update-info-dir".split ()
+
+# These utilities use a slightly different set of options and flags.
+complex_binaries = "makeinfo texi2any".split ()
+
+valid_binaries = simple_binaries + complex_binaries
+
+# For generating blank output files.
+def touch_file (path):
+ f = open (path, "w")
+ f.close ()
+
+assert this_binary in valid_binaries, \
+ this_binary + " is not one of " + ', '.join (valid_binaries)
+
+if "--version" in sys.argv:
+ print version_str
+ sys.exit (0)
+
+# For debugging
+log_interceptions = False
+if log_interceptions:
+ f = open ("/tmp/intercepted_" + this_binary, "a")
+ f.write (' '.join ([this_binary] + sys.argv[1:]) + '\n')
+ f.close ()
+
+# Look through the options and flags, and if necessary, touch any output
+# files.
+arg_idx = 1
+while arg_idx < len (sys.argv):
+ arg = sys.argv [arg_idx]
+
+ if arg == "--":
+ break
+
+ # Something like -I . can result in a need for this (specifically the .)
+ elif len (arg) < 2:
+ pass
+
+ # Check if -o or --output is specified. These can be used at most once.
+ elif arg[0] == '-' and arg[1] != '-' and arg[len (arg) - 1] == 'o':
+ touch_file (sys.argv[arg_idx + 1])
+ sys.exit (0)
+ elif arg.startswith (olong):
+ touch_file (arg.split ("=")[1])
+ sys.exit (0)
+
+ # Check for functionality that isn't implemented yet.
+ else:
+ assert arg[0] != '-' or arg[1] == '-' or 'E' not in arg or \
+ this_binary in simple_binaries, \
+ "-E option not yet supported" + stub_msg
+
+ assert not arg.startswith (Elong), \
+ Elong[:-1] + " option not yet supported" + stub_msg
+
+ arg_idx += 1
+
+# The -o/--output option overrides the default. For makeinfo and texi2any,
+# that default is to look for a @setfilename command in the input file.
+# Otherwise, printing nothing to stdout and then exiting should suffice.
+assert this_binary in simple_binaries, \
+ "Don't know how to get default output file name from input file!" + \
+ stub_msg
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch
new file mode 100644
index 000000000..f4d66600a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch
@@ -0,0 +1,28 @@
+fix the macro check
+
+Upstream-Status: Pending
+
+configure does not check if locale.h exists, but check setlocale,
+if setlocale exist, the locale.h should exist.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ lib/system.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/system.h b/lib/system.h
+index 946eb3c..c70037b 100644
+--- a/lib/system.h
++++ b/lib/system.h
+@@ -42,7 +42,7 @@ extern char *substring (const char *, const char *);
+ #include <ctype.h>
+
+ /* All systems nowadays probably have these functions, but ... */
+-#ifdef HAVE_LOCALE_H
++#ifdef HAVE_SETLOCALE
+ #include <locale.h>
+ #endif
+ #ifndef HAVE_SETLOCALE
+--
+1.7.10.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch
new file mode 100644
index 000000000..81ebe26cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch
@@ -0,0 +1,49 @@
+From 458e9450cecf703f55536e609365162719585900 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Wed, 10 Sep 2014 17:03:29 +0800
+Subject: [PATCH] do not compile host tools, since we have native
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ configure.ac | 23 +----------------------
+ 1 file changed, 1 insertion(+), 22 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b46130d..cf58654 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -90,28 +90,7 @@ AC_CANONICAL_BUILD
+ # $native_tools is also added to SUBDIRS in the main Makefile.am,
+ # so that make compiles the native tools first.
+ #
+-if test "$cross_compiling" = no; then
+- native_tools=
+-else
+- native_tools=tools
+- test -d "$native_tools" || mkdir "$native_tools"
+- confdir=`(cd "$srcdir";pwd)`
+- # Make sure the secondary configure won't fail with
+- # "error: source directory already configured".
+- rm -f config.status
+- AC_MSG_NOTICE([[Doing configure of native tools (${build}).]])
+- cd "$native_tools" || exit 1
+- # Run secondary configure in alternate environment or
+- # it gets the wrong CC etc. env -i gives this build host configure
+- # a clean environment.
+- env -i CC="${BUILD_CC}" AR="${BUILD_AR}" RANLIB="${BUILD_RANLIB}" \
+- PATH="${PATH}" \
+- tools_only=1 \
+- ${confdir}/configure --build=${build} --host=${build} \
+- --disable-rpath --disable-nls
+- cd .. || exit 1
+- AC_MSG_NOTICE([[Continuing with main configure (${host}).]])
+-fi
++native_tools=
+ AC_SUBST(native_tools)
+ AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]])
+
+--
+1.9.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch
new file mode 100644
index 000000000..2297051dd
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch
@@ -0,0 +1,24 @@
+From 9b0df7d6d3c18cfac82c291d60a5357d1bc8d9d0 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Wed, 10 Sep 2014 17:10:03 +0800
+Subject: [PATCH] using native makeinfo
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ doc/Makefile.am | 2 +-
+
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index 63df818..b6ceb34 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -19,7 +19,7 @@ man_MANS = info.1 infokey.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 \
+
+ # Use the programs built in our distribution, taking account of possible
+ # cross-compiling.
+-MAKEINFO = $(top_builddir)/$(native_tools)/makeinfo/makeinfo
++MAKEINFO = makeinfo
+ INSTALL_INFO = $(top_builddir)/$(native_tools)/util/install-info
+
+ TXI_XLATE = txi-cs.tex txi-de.tex txi-en.tex txi-es.tex txi-fr.tex \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..c7338aa47
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: texinfo-5.2/gnulib/lib/Makefile.am
+===================================================================
+--- texinfo-5.2.orig/gnulib/lib/Makefile.am
++++ texinfo-5.2/gnulib/lib/Makefile.am
+@@ -378,7 +378,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch
new file mode 100644
index 000000000..ab6f1658a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch
@@ -0,0 +1,43 @@
+We already DEPEND on the native texinfo being present before building so
+there isn't any need to try and build the required native texinfo binaries
+before cross-compiling. This simplifies the recipe somewhat!
+
+Upstream-Status: Inappropriate oe specific
+
+Signed-off-by: Joshua Lock <josh@linux.intel.com>
+
+Index: texinfo-4.13/configure.ac
+===================================================================
+--- texinfo-4.13.orig/configure.ac
++++ texinfo-4.13/configure.ac
+@@ -100,29 +100,7 @@ AC_CANONICAL_BUILD
+ # $native_tools is also added to SUBDIRS in the main Makefile.am,
+ # so that make compiles the native tools first.
+ #
+-if test "$cross_compiling" = no; then
+- native_tools=
+-else
+- native_tools=tools
+- test -d "$native_tools" || mkdir "$native_tools"
+- confdir=`(cd "$srcdir";pwd)`
+- # Make sure the secondary configure won't fail with
+- # "error: source directory already configured".
+- rm -f config.status
+- AC_MSG_NOTICE([[Doing configure of native tools (${build}).]])
+- cd "$native_tools" || exit 1
+- # Run secondary configure in alternate environment or
+- # it gets the wrong CC etc.
+- # env -i gives this build host configure a clean environment;
+- # consequently, we have to re-initialize $PATH.
+- env -i CC="$BUILD_CC" AR="$BUILD_AR" RANLIB="$BUILD_RANLIB" \
+- PATH="$PATH" \
+- tools_only=1 \
+- ${confdir}/configure --build=${build} --host=${build} \
+- --disable-rpath --disable-nls
+- cd .. || exit 1
+- AC_MSG_NOTICE([[Continuing with main configure (${host}).]])
+-fi
++native_tools=
+ AC_SUBST(native_tools)
+ AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]])
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
new file mode 100644
index 000000000..0ce47ecdb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
@@ -0,0 +1,64 @@
+From 6f1f3912fcb900b3a3e6cbe3360306fade333497 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 6 Aug 2015 14:55:08 +0300
+Subject: [PATCH] dont-depend-on-help2man
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+---
+ doc/Makefile.am | 2 +-
+ man/Makefile.am | 12 ++++++------
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index 7198a6b..4bba550 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -40,7 +40,7 @@ refcard_files = refcard/Makefile refcard/txicmdcheck \
+ # Include our texinfo.tex, not Automake's.
+ EXTRA_DIST = epsf.tex texinfo.tex \
+ fdl.texi \
+- $(man_MANS) $(TXI_XLATE) \
++ $(TXI_XLATE) \
+ $(refcard_files)
+
+ if INSTALL_WARNINGS
+diff --git a/man/Makefile.am b/man/Makefile.am
+index a08d603..bdfc9a4 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -13,24 +13,24 @@
+ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ # These are generated using help2man.
+-man_MANS = install-info.1 makeinfo.1 texindex.1 texi2dvi.1
++#man_MANS = install-info.1 makeinfo.1 texindex.1 texi2dvi.1
+
+ # These require the build in info/, thus can't do if we failed to find a
+ # terminal library.
+ if HAVE_TERMLIBS
+-man_MANS += info.1
++#man_MANS += info.1
+ endif
+
+ # These are hand-written.
+-man_MANS += info.5 texinfo.5
++#man_MANS += info.5 texinfo.5
+
+ # This is generated by pod2man, but let's just run it by hand.
+-man_MANS += pod2texi.1
++#man_MANS += pod2texi.1
+
+ # These are just .so's to the common program.
+-man_MANS += texi2any.1 texi2pdf.1 pdftexi2dvi.1
++#man_MANS += texi2any.1 texi2pdf.1 pdftexi2dvi.1
+
+-EXTRA_DIST = $(man_MANS) ginfo.h2m
++EXTRA_DIST = ginfo.h2m
+
+ # Maintainers should be able to regenerate.
+ MAINTAINERCLEANFILES = $(man_MANS)
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch
new file mode 100644
index 000000000..0b6e9fd7e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/link-zip.patch
@@ -0,0 +1,16 @@
+install-info uses symbols from zlib so must link against it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joshua Lock <josh@linux.intel.com>
+
+Index: texinfo-5.1/install-info/Makefile.am
+===================================================================
+--- texinfo-5.1.orig/install-info/Makefile.am
++++ texinfo-5.1/install-info/Makefile.am
+@@ -34,4 +34,4 @@ AM_CPPFLAGS = \
+ -I$(top_srcdir)/gnulib/lib \
+ -I$(top_builddir)/gnulib/lib \
+ -DLOCALEDIR=\"$(localedir)\"
+-LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL)
++LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL) -lz
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
new file mode 100644
index 000000000..41bd220ba
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
@@ -0,0 +1,233 @@
+From 20e1d8a9481dc13dd1d4d168b90e0ed2ff097b98 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 6 Aug 2015 14:29:57 +0300
+Subject: [PATCH] texinfo-4.12-zlib
+
+Upstream-Status: Pending
+---
+ install-info/Makefile.in | 2 +-
+ install-info/install-info.c | 67 +++++++++++++++++++++++++++------------------
+ 2 files changed, 42 insertions(+), 27 deletions(-)
+
+diff --git a/install-info/Makefile.in b/install-info/Makefile.in
+index ad73abb..eaa2153 100644
+--- a/install-info/Makefile.in
++++ b/install-info/Makefile.in
+@@ -241,7 +241,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
+ PROGRAMS = $(bin_PROGRAMS)
+ am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
+ ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)
+-ginstall_info_LDADD = $(LDADD)
++ginstall_info_LDADD = $(LDADD) -lz
+ am__DEPENDENCIES_1 =
+ ginstall_info_DEPENDENCIES = $(top_builddir)/gnulib/lib/libgnu.a \
+ $(am__DEPENDENCIES_1)
+diff --git a/install-info/install-info.c b/install-info/install-info.c
+index b454c15..4e39122 100644
+--- a/install-info/install-info.c
++++ b/install-info/install-info.c
+@@ -22,6 +22,7 @@
+ #include <getopt.h>
+ #include <regex.h>
+ #include <argz.h>
++#include <zlib.h>
+
+ #define TAB_WIDTH 8
+
+@@ -684,15 +685,15 @@ The first time you invoke Info you start off looking at this node.\n\
+
+ Return either stdin reading the file, or a non-stdin pipe reading
+ the output of the compression program. */
+-FILE *
++void *
+ open_possibly_compressed_file (char *filename,
+ void (*create_callback) (char *),
+- char **opened_filename, char **compression_program)
++ char **opened_filename, char **compression_program, int *is_pipe)
+ {
+ char *local_opened_filename, *local_compression_program;
+ int nread;
+ char data[13];
+- FILE *f;
++ gzFile *f;
+
+ /* We let them pass NULL if they don't want this info, but it's easier
+ to always determine it. */
+@@ -700,48 +701,48 @@ open_possibly_compressed_file (char *filename,
+ opened_filename = &local_opened_filename;
+
+ *opened_filename = filename;
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ if (!f)
+ {
+ *opened_filename = concat (filename, ".gz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".xz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".bz2", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".lz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".lzma", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ #ifdef __MSDOS__
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".igz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ if (!f)
+ {
+ free (*opened_filename);
+ *opened_filename = concat (filename, ".inz", "");
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ }
+ #endif /* __MSDOS__ */
+ if (!f)
+@@ -757,7 +758,7 @@ open_possibly_compressed_file (char *filename,
+ (*create_callback) (filename);
+
+ /* And try opening it again. */
+- f = fopen (*opened_filename, FOPEN_RBIN);
++ f = gzopen (*opened_filename, FOPEN_RBIN);
+ if (!f)
+ return 0;
+ }
+@@ -767,12 +768,12 @@ open_possibly_compressed_file (char *filename,
+
+ /* Read first few bytes of file rather than relying on the filename.
+ If the file is shorter than this it can't be usable anyway. */
+- nread = fread (data, sizeof (data), 1, f);
+- if (nread != 1)
++ nread = gzread (f, data, sizeof (data));
++ if (nread != sizeof (data))
+ {
+ /* Empty files don't set errno. Calling code can check for
+ this, so make sure errno == 0 just in case it isn't already. */
+- if (nread == 0)
++ if (nread >= 0)
+ errno = 0;
+ return 0;
+ }
+@@ -838,35 +839,40 @@ open_possibly_compressed_file (char *filename,
+ *compression_program = NULL;
+
+ /* Seek back over the magic bytes. */
+- if (fseek (f, 0, 0) < 0)
++ if (gzseek (f, 0, SEEK_SET) == -1)
+ return 0;
+
+ if (*compression_program)
+ { /* It's compressed, so open a pipe. */
++ FILE *p;
+ char *command = concat (*compression_program, " -d", "");
+
+- if (fclose (f) < 0)
++ if (gzclose (f) < 0)
+ return 0;
+- f = freopen (*opened_filename, FOPEN_RBIN, stdin);
+- if (!f)
++ p = freopen (*opened_filename, FOPEN_RBIN, stdin);
++ if (!p)
+ return 0;
+- f = popen (command, "r");
+- if (!f)
++ p = popen (command, "r");
++ if (!p)
+ {
+ /* Used for error message in calling code. */
+ *opened_filename = command;
+ return 0;
+ }
++ else
++ *is_pipe = 1;
++ return p;
+ }
+ else
+ {
+-#if O_BINARY
++#if 0 && O_BINARY
+ /* Since this is a text file, and we opened it in binary mode,
+ switch back to text mode. */
+ f = freopen (*opened_filename, "r", f);
+ if (! f)
+ return 0;
+ #endif
++ *is_pipe = 0;
+ }
+
+ return f;
+@@ -885,7 +891,8 @@ readfile (char *filename, int *sizep,
+ void (*create_callback) (char *), char **opened_filename,
+ char **compression_program)
+ {
+- FILE *f;
++ void *f;
++ int pipe_p;
+ int filled = 0;
+ int data_size = 8192;
+ char *data = xmalloc (data_size);
+@@ -893,14 +900,20 @@ readfile (char *filename, int *sizep,
+ /* If they passed the space for the file name to return, use it. */
+ f = open_possibly_compressed_file (filename, create_callback,
+ opened_filename,
+- compression_program);
++ compression_program,
++ &pipe_p);
+
+ if (!f)
+ return 0;
+
+ for (;;)
+ {
+- int nread = fread (data + filled, 1, data_size - filled, f);
++ int nread;
++
++ if (pipe_p)
++ nread = fread (data + filled, 1, data_size - filled, f);
++ else
++ nread = gzread (f, data + filled, data_size - filled);
+ if (nread < 0)
+ return 0;
+ if (nread == 0)
+@@ -919,8 +932,10 @@ readfile (char *filename, int *sizep,
+ /* We need to close the stream, since on some systems the pipe created
+ by popen is simulated by a temporary file which only gets removed
+ inside pclose. */
+- if (f != stdin)
++ if (pipe_p)
+ pclose (f);
++ else
++ gzclose (f);
+
+ *sizep = filled;
+ return data;
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch
new file mode 100644
index 000000000..5b7f32d9a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [cross build specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: texinfo-5.1/info/Makefile.am
+===================================================================
+--- texinfo-5.1.orig/info/Makefile.am
++++ texinfo-5.1/info/Makefile.am
+@@ -76,7 +76,7 @@ cmd_sources = $(srcdir)/session.c $(srcd
+ # more than once.
+ funs.h: makedoc$(EXEEXT) $(cmd_sources)
+ rm -f $(generated_sources)
+- $(top_builddir)/$(native_tools)/info/makedoc $(cmd_sources)
++ makedoc $(cmd_sources)
+
+ # The following hack is necessary to hint make before the automatic
+ # dependencies are built.
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb
new file mode 100644
index 000000000..13678e093
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_4.8.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Documentation system for on-line information and printed output"
+DESCRIPTION = "Texinfo is a documentation system that can produce both \
+online information and printed output from a single source file. The \
+GNU Project uses the Texinfo file format for most of its documentation."
+HOMEPAGE = "http://www.gnu.org/software/texinfo/"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+PROVIDES_append_class-native = " texinfo-4.8-replacement-native"
+
+DEPENDS = "zlib ncurses texinfo-4.8-replacement-native"
+DEPENDS_class-native = "zlib-native ncurses-native"
+
+TARGET_PATCH = "file://use_host_makedoc.patch \
+ file://using-native-makeinfo.patch \
+"
+TARGET_PATCH_class-native = ""
+
+SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \
+ file://check-locale-h.patch \
+ file://do-compile-native-tools.patch \
+ ${TARGET_PATCH} \
+ "
+
+SRC_URI[md5sum] = "4e9a1a591ed236003d0d4b008bf07eef"
+SRC_URI[sha256sum] = "1f3cdeebe65fdf510f55d765ab1031b54416aa5bc2635b6a54ef9bcb2367c917"
+
+tex_texinfo = "texmf/tex/texinfo"
+
+inherit gettext autotools
+
+do_install_append() {
+ mkdir -p ${D}${datadir}/${tex_texinfo}
+ install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo}
+}
+
+do_install_append_class-native() {
+ install -m 755 info/makedoc ${D}${bindir}
+ install -m 755 makeinfo/makeinfo ${D}${bindir}
+}
+
+PACKAGES += "info info-doc"
+
+FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info"
+FILES_info-doc = "${infodir}/info.info ${infodir}/dir ${infodir}/info-*.info \
+ ${mandir}/man1/info.1* ${mandir}/man5/info.5* \
+ ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*"
+
+FILES_${PN} = "${bindir}/makeinfo ${bindir}/texi* ${bindir}/pdftexi2dvi ${bindir}/pod2texi ${datadir}/texinfo"
+FILES_${PN}-doc = "${infodir}/texinfo* \
+ ${datadir}/${tex_texinfo} \
+ ${mandir}/man1 ${mandir}/man5"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb
new file mode 100644
index 000000000..8638bb1d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/texinfo/texinfo_6.0.bb
@@ -0,0 +1,82 @@
+SUMMARY = "Documentation system for on-line information and printed output"
+DESCRIPTION = "Texinfo is a documentation system that can produce both \
+online information and printed output from a single source file. The \
+GNU Project uses the Texinfo file format for most of its documentation."
+HOMEPAGE = "http://www.gnu.org/software/texinfo/"
+SECTION = "console/utils"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+PROVIDES_append_class-native = " texinfo-replacement-native"
+
+def compress_pkg(d):
+ if bb.data.inherits_class('compress_doc', d):
+ compress = d.getVar("DOC_COMPRESS", True)
+ if compress == "gz":
+ return "gzip"
+ elif compress == "bz2":
+ return "bzip2"
+ elif compress == "xz":
+ return "xz"
+ return ""
+
+RDEPENDS_info += "${@compress_pkg(d)}"
+
+DEPENDS = "zlib ncurses texinfo-replacement-native"
+DEPENDS_class-native = "zlib-native ncurses-native"
+
+TARGET_PATCH = "file://use_host_makedoc.patch"
+TARGET_PATCH_class-native = ""
+
+SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \
+ file://texinfo-4.12-zlib.patch \
+ file://disable-native-tools.patch \
+ file://link-zip.patch \
+ file://dont-depend-on-help2man.patch \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ ${TARGET_PATCH} \
+ "
+
+SRC_URI[md5sum] = "e1a2ef5dce5018b53f0f6eed45b247a7"
+SRC_URI[sha256sum] = "83d3183290f34e7f958d209d0b20022c6fe9e921eb6fe94c27d988827d4878d2"
+
+tex_texinfo = "texmf/tex/texinfo"
+
+inherit gettext autotools
+
+do_configure_prepend () {
+ # autotools_do_configure updates po/Makefile.in.in, we also need
+ # update po_document.
+ cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/
+}
+
+do_compile_prepend() {
+ if [ -d tools ];then
+ oe_runmake -C tools/gnulib/lib
+ fi
+}
+
+do_install_append() {
+ mkdir -p ${D}${datadir}/${tex_texinfo}
+ install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo}
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2any ${D}${bindir}/pod2texi
+}
+
+do_install_append_class-native() {
+ install -m 755 info/makedoc ${D}${bindir}
+}
+
+PACKAGES += "info info-doc"
+
+FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info"
+FILES_info-doc = "${infodir}/info.info* ${infodir}/dir ${infodir}/info-*.info* \
+ ${mandir}/man1/info.1* ${mandir}/man5/info.5* \
+ ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*"
+
+FILES_${PN} = "${bindir}/makeinfo ${bindir}/texi* ${bindir}/pdftexi2dvi ${bindir}/pod2texi ${datadir}/texinfo"
+RDEPENDS_${PN} = "perl"
+FILES_${PN}-doc = "${infodir}/texinfo* \
+ ${datadir}/${tex_texinfo} \
+ ${mandir}/man1 ${mandir}/man5"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/time/time-1.7/debian.patch b/import-layers/yocto-poky/meta/recipes-extended/time/time-1.7/debian.patch
new file mode 100644
index 000000000..23ea0e3eb
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/time/time-1.7/debian.patch
@@ -0,0 +1,1301 @@
+Upstream-Status: Backport
+
+--- time-1.7.orig/configure.in
++++ time-1.7/configure.in
+@@ -1,11 +1,8 @@
+ dnl Process this file with autoconf to produce a configure script.
+ AC_INIT(time.c)
+-VERSION=1.7
+-AC_SUBST(VERSION)
+-PACKAGE=time
+-AC_SUBST(PACKAGE)
++AM_INIT_AUTOMAKE(time, 1.7)
+
+-AC_ARG_PROGRAM
++AM_MAINTAINER_MODE
+
+ dnl Checks for programs.
+ AC_PROG_CC
+@@ -15,7 +12,7 @@
+ dnl Checks for header files.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
+-AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h)
++AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h sys/resource.h)
+
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+--- time-1.7.orig/version.texi
++++ time-1.7/version.texi
+@@ -1,3 +1,3 @@
+-@set UPDATED 12 June 1996
++@set UPDATED 9 May 2002
+ @set EDITION 1.7
+ @set VERSION 1.7
+--- time-1.7.orig/time.c
++++ time-1.7/time.c
+@@ -147,6 +147,10 @@
+ NULL
+ };
+
++
++/* If true, do not show the exit message */
++static boolean quiet;
++
+ /* If true, show an English description next to each statistic. */
+ static boolean verbose;
+
+@@ -172,6 +176,7 @@
+ {"help", no_argument, NULL, 'h'},
+ {"output-file", required_argument, NULL, 'o'},
+ {"portability", no_argument, NULL, 'p'},
++ {"quiet", no_argument,NULL, 'q'},
+ {"verbose", no_argument, NULL, 'v'},
+ {"version", no_argument, NULL, 'V'},
+ {NULL, no_argument, NULL, 0}
+@@ -333,7 +338,8 @@
+ else if (WIFSIGNALED (resp->waitstatus))
+ fprintf (fp, "Command terminated by signal %d\n",
+ WTERMSIG (resp->waitstatus));
+- else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus))
++ else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus)
++ && !quiet)
+ fprintf (fp, "Command exited with non-zero status %d\n",
+ WEXITSTATUS (resp->waitstatus));
+
+@@ -523,6 +529,7 @@
+ char *format; /* Format found in environment. */
+
+ /* Initialize the option flags. */
++ quiet = false;
+ verbose = false;
+ outfile = NULL;
+ outfp = stderr;
+@@ -536,7 +543,7 @@
+ if (format)
+ output_format = format;
+
+- while ((optc = getopt_long (argc, argv, "+af:o:pvV", longopts, (int *) 0))
++ while ((optc = getopt_long (argc, argv, "+af:o:pqvV", longopts, (int *) 0))
+ != EOF)
+ {
+ switch (optc)
+@@ -555,6 +562,9 @@
+ case 'p':
+ output_format = posix_format;
+ break;
++ case 'q':
++ quiet = true;
++ break;
+ case 'v':
+ verbose = true;
+ break;
+@@ -642,9 +652,9 @@
+ fflush (outfp);
+
+ if (WIFSTOPPED (res.waitstatus))
+- exit (WSTOPSIG (res.waitstatus));
++ exit (WSTOPSIG (res.waitstatus) + 128);
+ else if (WIFSIGNALED (res.waitstatus))
+- exit (WTERMSIG (res.waitstatus));
++ exit (WTERMSIG (res.waitstatus) + 128);
+ else if (WIFEXITED (res.waitstatus))
+ exit (WEXITSTATUS (res.waitstatus));
+ }
+@@ -657,7 +667,7 @@
+ fprintf (stream, "\
+ Usage: %s [-apvV] [-f format] [-o file] [--append] [--verbose]\n\
+ [--portability] [--format=format] [--output=file] [--version]\n\
+- [--help] command [arg...]\n",
++ [--quiet] [--help] command [arg...]\n",
+ program_name);
+ exit (status);
+ }
+--- time-1.7.orig/resuse.h
++++ time-1.7/resuse.h
+@@ -36,19 +36,8 @@
+ # include <sys/rusage.h>
+ #else
+ # define TV_MSEC tv_usec / 1000
+-# if HAVE_WAIT3
++# if HAVE_SYS_RESOURCE_H
+ # include <sys/resource.h>
+-# else
+-/* Process resource usage structure. */
+-struct rusage
+-{
+- struct timeval ru_utime; /* User time used. */
+- struct timeval ru_stime; /* System time used. */
+- int ru_maxrss, ru_ixrss, ru_idrss, ru_isrss,
+- ru_minflt, ru_majflt, ru_nswap, ru_inblock,
+- ru_oublock, ru_msgsnd, ru_msgrcv, ru_nsignals,
+- ru_nvcsw, ru_nivcsw;
+-};
+ # endif
+ #endif
+
+--- time-1.7.orig/time.texi
++++ time-1.7/time.texi
+@@ -11,6 +11,12 @@
+ @finalout
+ @end iftex
+
++@dircategory Individual utilities
++@direntry
++* time: (time). Run programs and summarize
++ system resource usage.
++@end direntry
++
+ @ifinfo
+ This file documents the the GNU @code{time} command for running programs
+ and summarizing the system resources they use.
+@@ -185,6 +191,10 @@
+ sys %S
+ @end example
+
++@item -q
++@itemx --quiet
++Suppress non-zero error code from the executed program.
++
+ @item -v
+ @itemx --verbose
+ @cindex format
+--- time-1.7.orig/time.info
++++ time-1.7/time.info
+@@ -1,5 +1,10 @@
+-This is Info file ./time.info, produced by Makeinfo-1.55 from the input
+-file time.texi.
++This is time.info, produced by makeinfo version 4.1 from time.texi.
++
++INFO-DIR-SECTION Individual utilities
++START-INFO-DIR-ENTRY
++* time: (time). Run programs and summarize
++ system resource usage.
++END-INFO-DIR-ENTRY
+
+ This file documents the the GNU `time' command for running programs
+ and summarizing the system resources they use.
+@@ -31,7 +36,7 @@
+
+ * Resource Measurement:: Measuring program resource use.
+
+- -- The Detailed Node Listing --
++ --- The Detailed Node Listing ---
+
+ Measuring Program Resource Use
+
+@@ -58,14 +63,14 @@
+ The `time' command runs another program, then displays information
+ about the resources used by that program, collected by the system while
+ the program was running. You can select which information is reported
+-and the format in which it is shown (*note Setting Format::.), or have
++and the format in which it is shown (*note Setting Format::), or have
+ `time' save the information in a file instead of displaying it on the
+-screen (*note Redirecting::.).
++screen (*note Redirecting::).
+
+ The resources that `time' can report on fall into the general
+ categories of time, memory, and I/O and IPC calls. Some systems do not
+ provide much information about program resource use; `time' reports
+-unavailable information as zero values (*note Accuracy::.).
++unavailable information as zero values (*note Accuracy::).
+
+ The format of the `time' command is:
+
+@@ -132,6 +137,10 @@
+ user %U
+ sys %S
+
++`-q'
++`--quiet'
++ Suppress non-zero error code from the executed program.
++
+ `-v'
+ `--verbose'
+ Use the built-in verbose format, which displays each available
+@@ -174,7 +183,7 @@
+ The resource specifiers, which are a superset of those recognized by
+ the `tcsh' builtin `time' command, are listed below. Not all resources
+ are measured by all versions of Unix, so some of the values might be
+-reported as zero (*note Accuracy::.).
++reported as zero (*note Accuracy::).
+
+ * Menu:
+
+@@ -308,11 +317,11 @@
+ `-o FILE'
+ `--output=FILE'
+ Write the resource use statistics to FILE. By default, this
+- *overwrites* the file, destroying the file's previous contents.
++ _overwrites_ the file, destroying the file's previous contents.
+
+ `-a'
+ `--append'
+- *Append* the resource use information to the output file instead
++ _Append_ the resource use information to the output file instead
+ of overwriting it. This option is only useful with the `-o' or
+ `--output' option.
+
+@@ -437,7 +446,7 @@
+
+ `-a'
+ `--append'
+- *Append* the resource use information to the output file instead
++ _Append_ the resource use information to the output file instead
+ of overwriting it.
+
+ `-f FORMAT'
+@@ -462,17 +471,17 @@
+
+ 
+ Tag Table:
+-Node: Top934
+-Node: Resource Measurement1725
+-Node: Setting Format3678
+-Node: Format String4907
+-Node: Time Resources6214
+-Node: Memory Resources6844
+-Node: I/O Resources7549
+-Node: Command Info8747
+-Node: Redirecting8964
+-Node: Examples9754
+-Node: Accuracy12064
+-Node: Invoking time13586
++Node: Top1115
++Node: Resource Measurement1908
++Node: Setting Format3858
++Node: Format String5164
++Node: Time Resources6470
++Node: Memory Resources7100
++Node: I/O Resources7805
++Node: Command Info9003
++Node: Redirecting9220
++Node: Examples10010
++Node: Accuracy12320
++Node: Invoking time13842
+ 
+ End Tag Table
+--- time-1.7.orig/time.html
++++ time-1.7/time.html
+@@ -0,0 +1,1021 @@
++<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
++ "http://www.w3.org/TR/html40/loose.dtd">
++<HTML>
++<!-- Created on September, 1 2003 by texi2html 1.66 -->
++<!--
++Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
++ Karl Berry <karl@freefriends.org>
++ Olaf Bachmann <obachman@mathematik.uni-kl.de>
++ and many others.
++Maintained by: Many creative people <dev@texi2html.cvshome.org>
++Send bugs and suggestions to <users@texi2html.cvshome.org>
++
++-->
++<HEAD>
++<TITLE>Measuring Program Resource Use</TITLE>
++
++<META NAME="description" CONTENT="Measuring Program Resource Use">
++<META NAME="keywords" CONTENT="Measuring Program Resource Use">
++<META NAME="resource-type" CONTENT="document">
++<META NAME="distribution" CONTENT="global">
++<META NAME="Generator" CONTENT="texi2html 1.66">
++
++</HEAD>
++
++<BODY LANG="en" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
++
++<A NAME="SEC_Top"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>Measuring Program Resource Use</H1>
++
++<P>
++
++This file documents the the GNU <CODE>time</CODE> command for running programs
++and summarizing the system resources they use.
++This is edition 1.7, for version 1.7.
++</P>
++<P>
++
++</P>
++<TABLE BORDER="0" CELLSPACING="0">
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC1">1. Measuring Program Resource Use</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Measuring program resource use.</TD></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP"> -- The Detailed Node Listing ---
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">Measuring Program Resource Use
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC2">1.1 Setting the Output Format</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Selecting the information reported by <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC3">1.2 The Format String</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The information <CODE>time</CODE> can report.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC8">1.3 Redirecting Output</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Writing the information to a file.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC9">1.4 Examples</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Examples of using <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC10">1.5 Accuracy</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Limitations on the accuracy of <CODE>time</CODE> output.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Summary of the options to the <CODE>time</CODE> command.</TD></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">The Format String
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC4">1.2.1 Time Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC5">1.2.2 Memory Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC6">1.2.3 I/O Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC7">1.2.4 Command Info</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++</TABLE>
++<P>
++
++<HR SIZE=1>
++<A NAME="SEC1"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC2"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<A NAME="Resource Measurement"></A>
++<H1> 1. Measuring Program Resource Use </H1>
++<!--docid::SEC1::-->
++<P>
++
++The <CODE>time</CODE> command runs another program, then displays information
++about the resources used by that program, collected by the system while
++the program was running. You can select which information is reported
++and the format in which it is shown (see section <A HREF="time.html#SEC2">1.1 Setting the Output Format</A>), or have
++<CODE>time</CODE> save the information in a file instead of displaying it on the
++screen (see section <A HREF="time.html#SEC8">1.3 Redirecting Output</A>).
++</P>
++<P>
++
++The resources that <CODE>time</CODE> can report on fall into the general
++categories of time, memory, and I/O and IPC calls. Some systems do not
++provide much information about program resource use; <CODE>time</CODE>
++reports unavailable information as zero values (see section <A HREF="time.html#SEC10">1.5 Accuracy</A>).
++</P>
++<P>
++
++The format of the <CODE>time</CODE> command is:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>time [option<small>...</small>] <VAR>command</VAR> [<VAR>arg</VAR><small>...</small>]
++</pre></td></tr></table><P>
++
++<A NAME="IDX1"></A>
++<CODE>time</CODE> runs the program <VAR>command</VAR>, with any given arguments
++<VAR>arg</VAR><small>...</small>. When <VAR>command</VAR> finishes, <CODE>time</CODE> displays
++information about resources used by <VAR>command</VAR>.
++</P>
++<P>
++
++Here is an example of using <CODE>time</CODE> to measure the time and other
++resources used by running the program <CODE>grep</CODE>:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time grep nobody /etc/aliases
++nobody:/dev/null
++etc-files:nobody
++misc-group:nobody
++0.07user 0.50system 0:06.69elapsed 8%CPU (0avgtext+489avgdata 324maxresident)k
++46inputs+7outputs (43major+251minor)pagefaults 0swaps
++</pre></td></tr></table><P>
++
++Mail suggestions and bug reports for GNU <CODE>time</CODE> to
++<CODE>bug-gnu-utils@prep.ai.mit.edu</CODE>. Please include the version of
++<CODE>time</CODE>, which you can get by running `<SAMP>time --version</SAMP>', and the
++operating system and C compiler you used.
++</P>
++<P>
++
++<TABLE BORDER="0" CELLSPACING="0">
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC2">1.1 Setting the Output Format</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Selecting the information reported by <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC3">1.2 The Format String</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The information <CODE>time</CODE> can report.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC8">1.3 Redirecting Output</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Writing the information to a file.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC9">1.4 Examples</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Examples of using <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC10">1.5 Accuracy</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Limitations on the accuracy of <CODE>time</CODE> output.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Summary of the options to the <CODE>time</CODE> command.</TD></TR>
++</TABLE>
++<P>
++
++<A NAME="Setting Format"></A>
++<HR SIZE="6">
++<A NAME="SEC2"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC3"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.1 Setting the Output Format </H2>
++<!--docid::SEC2::-->
++<P>
++
++<CODE>time</CODE> uses a <EM>format string</EM> to determine which information to
++display about the resources used by the command it runs. See section <A HREF="time.html#SEC3">1.2 The Format String</A>, for the interpretation of the format string contents.
++</P>
++<P>
++
++You can specify a format string with the command line options listed
++below. If no format is specified on the command line, but the
++<CODE>TIME</CODE> environment variable is set, its value is used as the format
++string. Otherwise, the default format built into <CODE>time</CODE> is used:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
++%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps
++</pre></td></tr></table><P>
++
++The command line options to set the format are:
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>-f <VAR>format</VAR></CODE>
++<DD><DT><CODE>--format=<VAR>format</VAR></CODE>
++<DD>Use <VAR>format</VAR> as the format string.
++<P>
++
++</P>
++<DT><CODE>-p</CODE>
++<DD><DT><CODE>--portability</CODE>
++<DD>Use the following format string, for conformance with POSIX standard
++1003.2:
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>real %e
++user %U
++sys %S
++</pre></td></tr></table><P>
++
++</P>
++<DT><CODE>-q</CODE>
++<DD><DT><CODE>--quiet</CODE>
++<DD>Suppress non-zero error code from the executed program.
++<P>
++
++</P>
++<DT><CODE>-v</CODE>
++<DD><DT><CODE>--verbose</CODE>
++<DD><A NAME="IDX2"></A>
++Use the built-in verbose format, which displays each available piece of
++information on the program's resource use on its own line, with an
++English description of its meaning.
++</DL>
++<P>
++
++<A NAME="Format String"></A>
++<HR SIZE="6">
++<A NAME="SEC3"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC2"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC4"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.2 The Format String </H2>
++<!--docid::SEC3::-->
++<P>
++
++<A NAME="IDX3"></A>
++<A NAME="IDX4"></A>
++The <EM>format string</EM> controls the contents of the <CODE>time</CODE> output.
++It consists of <EM>resource specifiers</EM> and <EM>escapes</EM>, interspersed
++with plain text.
++</P>
++<P>
++
++A backslash introduces an <EM>escape</EM>, which is translated
++into a single printing character upon output. The valid escapes are
++listed below. An invalid escape is output as a question mark followed
++by a backslash.
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>\t</CODE>
++<DD>a tab character
++<P>
++
++</P>
++<DT><CODE>\n</CODE>
++<DD>a newline
++<P>
++
++</P>
++<DT><CODE>\\</CODE>
++<DD>a literal backslash
++</DL>
++<P>
++
++<CODE>time</CODE> always prints a newline after printing the resource use
++information, so normally format strings do not end with a newline
++character (or `<SAMP>\n</SAMP>').
++</P>
++<P>
++
++A resource specifier consists of a percent sign followed by another
++character. An invalid resource specifier is output as a question mark
++followed by the invalid character. Use `<SAMP>%%</SAMP>' to output a literal
++percent sign.
++</P>
++<P>
++
++The resource specifiers, which are a superset of those recognized by the
++<CODE>tcsh</CODE> builtin <CODE>time</CODE> command, are listed below. Not all
++resources are measured by all versions of Unix, so some of the values
++might be reported as zero (see section <A HREF="time.html#SEC10">1.5 Accuracy</A>).
++</P>
++<P>
++
++<TABLE BORDER="0" CELLSPACING="0">
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC4">1.2.1 Time Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC5">1.2.2 Memory Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC6">1.2.3 I/O Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC7">1.2.4 Command Info</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++</TABLE>
++<P>
++
++<A NAME="Time Resources"></A>
++<HR SIZE="6">
++<A NAME="SEC4"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC3"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC5"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.1 Time Resources </H3>
++<!--docid::SEC4::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>E</CODE>
++<DD>Elapsed real (wall clock) time used by the process, in
++[hours:]minutes:seconds.
++<P>
++
++</P>
++<DT><CODE>e</CODE>
++<DD>Elapsed real (wall clock) time used by the process, in
++seconds.
++<P>
++
++</P>
++<DT><CODE>S</CODE>
++<DD>Total number of CPU-seconds used by the system on behalf of the process
++(in kernel mode), in seconds.
++<P>
++
++</P>
++<DT><CODE>U</CODE>
++<DD>Total number of CPU-seconds that the process used directly (in user
++mode), in seconds.
++<P>
++
++</P>
++<DT><CODE>P</CODE>
++<DD>Percentage of the CPU that this job got. This is just user + system
++times divied by the total running time.
++</DL>
++<P>
++
++<A NAME="Memory Resources"></A>
++<HR SIZE="6">
++<A NAME="SEC5"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC4"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC6"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.2 Memory Resources </H3>
++<!--docid::SEC5::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>M</CODE>
++<DD>Maximum resident set size of the process during its lifetime, in
++Kilobytes.
++<P>
++
++</P>
++<DT><CODE>t</CODE>
++<DD>Average resident set size of the process, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>K</CODE>
++<DD>Average total (data+stack+text) memory use of the process, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>D</CODE>
++<DD>Average size of the process's unshared data area, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>p</CODE>
++<DD>Average size of the process's unshared stack, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>X</CODE>
++<DD>Average size of the process's shared text, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>Z</CODE>
++<DD>System's page size, in bytes. This is a per-system constant, but
++varies between systems.
++</DL>
++<P>
++
++<A NAME="I/O Resources"></A>
++<HR SIZE="6">
++<A NAME="SEC6"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC5"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC7"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.3 I/O Resources </H3>
++<!--docid::SEC6::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>F</CODE>
++<DD>Number of major, or I/O-requiring, page faults that occurred while the
++process was running. These are faults where the page has actually
++migrated out of primary memory.
++<P>
++
++</P>
++<DT><CODE>R</CODE>
++<DD>Number of minor, or recoverable, page faults. These are pages that are
++not valid (so they fault) but which have not yet been claimed by other
++virtual pages. Thus the data in the page is still valid but the system
++tables must be updated.
++<P>
++
++</P>
++<DT><CODE>W</CODE>
++<DD>Number of times the process was swapped out of main memory.
++<P>
++
++</P>
++<DT><CODE>c</CODE>
++<DD>Number of times the process was context-switched involuntarily (because
++the time slice expired).
++<P>
++
++</P>
++<DT><CODE>w</CODE>
++<DD>Number of times that the program was context-switched voluntarily, for
++instance while waiting for an I/O operation to complete.
++<P>
++
++</P>
++<DT><CODE>I</CODE>
++<DD>Number of file system inputs by the process.
++<P>
++
++</P>
++<DT><CODE>O</CODE>
++<DD>Number of file system outputs by the process.
++<P>
++
++</P>
++<DT><CODE>r</CODE>
++<DD>Number of socket messages received by the process.
++<P>
++
++</P>
++<DT><CODE>s</CODE>
++<DD>Number of socket messages sent by the process.
++<P>
++
++</P>
++<DT><CODE>k</CODE>
++<DD>Number of signals delivered to the process.
++</DL>
++<P>
++
++<A NAME="Command Info"></A>
++<HR SIZE="6">
++<A NAME="SEC7"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC6"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC8"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.4 Command Info </H3>
++<!--docid::SEC7::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>C</CODE>
++<DD>Name and command line arguments of the command being timed.
++<P>
++
++</P>
++<DT><CODE>x</CODE>
++<DD>Exit status of the command.
++</DL>
++<P>
++
++<A NAME="Redirecting"></A>
++<HR SIZE="6">
++<A NAME="SEC8"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC7"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC9"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.3 Redirecting Output </H2>
++<!--docid::SEC8::-->
++<P>
++
++By default, <CODE>time</CODE> writes the resource use statistics to the
++standard error stream. The options below make it write the statistics
++to a file instead. Doing this can be useful if the program you're
++running writes to the standard error or you're running <CODE>time</CODE>
++noninteractively or in the background.
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>-o <VAR>file</VAR></CODE>
++<DD><DT><CODE>--output=<VAR>file</VAR></CODE>
++<DD>Write the resource use statistics to <VAR>file</VAR>. By default, this
++<EM>overwrites</EM> the file, destroying the file's previous contents.
++<P>
++
++</P>
++<DT><CODE>-a</CODE>
++<DD><DT><CODE>--append</CODE>
++<DD><EM>Append</EM> the resource use information to the output file instead
++of overwriting it. This option is only useful with the `<SAMP>-o</SAMP>' or
++`<SAMP>--output</SAMP>' option.
++</DL>
++<P>
++
++<A NAME="Examples"></A>
++<HR SIZE="6">
++<A NAME="SEC9"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC8"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC10"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.4 Examples </H2>
++<!--docid::SEC9::-->
++<P>
++
++Run the command `<SAMP>wc /etc/hosts</SAMP>' and show the default information:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time wc /etc/hosts
++ 35 111 1134 /etc/hosts
++0.00user 0.01system 0:00.04elapsed 25%CPU (0avgtext+0avgdata 0maxresident)k
++1inputs+1outputs (0major+0minor)pagefaults 0swaps
++</pre></td></tr></table><P>
++
++Run the command `<SAMP>ls -Fs</SAMP>' and show just the user, system, and
++wall-clock time:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time -f &quot;\t%E real,\t%U user,\t%S sys&quot; ls -Fs
++total 16
++1 account/ 1 db/ 1 mail/ 1 run/
++1 backups/ 1 emacs/ 1 msgs/ 1 rwho/
++1 crash/ 1 games/ 1 preserve/ 1 spool/
++1 cron/ 1 log/ 1 quotas/ 1 tmp/
++ 0:00.03 real, 0.00 user, 0.01 sys
++</pre></td></tr></table><P>
++
++Edit the file `<TT>.bashrc</TT>' and have <CODE>time</CODE> append the elapsed time
++and number of signals to the file `<TT>log</TT>', reading the format string
++from the environment variable <CODE>TIME</CODE>:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ export TIME=&quot;\t%E,\t%k&quot; # If using bash or ksh
++eg$ setenv TIME &quot;\t%E,\t%k&quot; # If using csh or tcsh
++eg$ time -a -o log emacs .bashrc
++eg$ cat log
++ 0:16.55, 726
++</pre></td></tr></table><P>
++
++Run the command `<SAMP>sleep 4</SAMP>' and show all of the information about it
++verbosely:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time -v sleep 4
++ Command being timed: &quot;sleep 4&quot;
++ User time (seconds): 0.00
++ System time (seconds): 0.05
++ Percent of CPU this job got: 1%
++ Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.26
++ Average shared text size (kbytes): 36
++ Average unshared data size (kbytes): 24
++ Average stack size (kbytes): 0
++ Average total size (kbytes): 60
++ Maximum resident set size (kbytes): 32
++ Average resident set size (kbytes): 24
++ Major (requiring I/O) page faults: 3
++ Minor (reclaiming a frame) page faults: 0
++ Voluntary context switches: 11
++ Involuntary context switches: 0
++ Swaps: 0
++ File system inputs: 3
++ File system outputs: 1
++ Socket messages sent: 0
++ Socket messages received: 0
++ Signals delivered: 1
++ Page size (bytes): 4096
++ Exit status: 0
++</pre></td></tr></table><P>
++
++<A NAME="Accuracy"></A>
++<HR SIZE="6">
++<A NAME="SEC10"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC9"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC11"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.5 Accuracy </H2>
++<!--docid::SEC10::-->
++<P>
++
++The elapsed time is not collected atomically with the execution of the
++program; as a result, in bizarre circumstances (if the <CODE>time</CODE>
++command gets stopped or swapped out in between when the program being
++timed exits and when <CODE>time</CODE> calculates how long it took to run), it
++could be much larger than the actual execution time.
++</P>
++<P>
++
++When the running time of a command is very nearly zero, some values
++(e.g., the percentage of CPU used) may be reported as either zero (which
++is wrong) or a question mark.
++</P>
++<P>
++
++Most information shown by <CODE>time</CODE> is derived from the <CODE>wait3</CODE>
++system call. The numbers are only as good as those returned by
++<CODE>wait3</CODE>. Many systems do not measure all of the resources that
++<CODE>time</CODE> can report on; those resources are reported as zero. The
++systems that measure most or all of the resources are based on 4.2 or
++4.3BSD. Later BSD releases use different memory management code that
++measures fewer resources.
++</P>
++<P>
++
++On systems that do not have a <CODE>wait3</CODE> call that returns status
++information, the <CODE>times</CODE> system call is used instead. It provides
++much less information than <CODE>wait3</CODE>, so on those systems <CODE>time</CODE>
++reports most of the resources as zero.
++</P>
++<P>
++
++The `<SAMP>%I</SAMP>' and `<SAMP>%O</SAMP>' values are allegedly only &quot;real&quot; input
++and output and do not include those supplied by caching devices. The
++meaning of &quot;real&quot; I/O reported by `<SAMP>%I</SAMP>' and `<SAMP>%O</SAMP>' may be
++muddled for workstations, especially diskless ones.
++</P>
++<P>
++
++<A NAME="Invoking time"></A>
++<HR SIZE="6">
++<A NAME="SEC11"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC10"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.6 Running the <CODE>time</CODE> Command </H2>
++<!--docid::SEC11::-->
++<P>
++
++The format of the <CODE>time</CODE> command is:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>time [option<small>...</small>] <VAR>command</VAR> [<VAR>arg</VAR><small>...</small>]
++</pre></td></tr></table><P>
++
++<A NAME="IDX5"></A>
++<CODE>time</CODE> runs the program <VAR>command</VAR>, with any given arguments
++<VAR>arg</VAR><small>...</small>. When <VAR>command</VAR> finishes, <CODE>time</CODE> displays
++information about resources used by <VAR>command</VAR> (on the standard error
++output, by default). If <VAR>command</VAR> exits with non-zero status or is
++terminated by a signal, <CODE>time</CODE> displays a warning message and the
++exit status or signal number.
++</P>
++<P>
++
++Options to <CODE>time</CODE> must appear on the command line before
++<VAR>command</VAR>. Anything on the command line after <VAR>command</VAR> is
++passed as arguments to <VAR>command</VAR>.
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>-o <VAR>file</VAR></CODE>
++<DD><DT><CODE>--output=<VAR>file</VAR></CODE>
++<DD>Write the resource use statistics to <VAR>file</VAR>.
++<P>
++
++</P>
++<DT><CODE>-a</CODE>
++<DD><DT><CODE>--append</CODE>
++<DD><EM>Append</EM> the resource use information to the output file instead
++of overwriting it.
++<P>
++
++</P>
++<DT><CODE>-f <VAR>format</VAR></CODE>
++<DD><DT><CODE>--format=<VAR>format</VAR></CODE>
++<DD>Use <VAR>format</VAR> as the format string.
++<P>
++
++</P>
++<DT><CODE>--help</CODE>
++<DD>Print a summary of the command line options to <CODE>time</CODE> and exit.
++<P>
++
++</P>
++<DT><CODE>-p</CODE>
++<DD><DT><CODE>--portability</CODE>
++<DD>Use the POSIX format.
++<P>
++
++</P>
++<DT><CODE>-v</CODE>
++<DD><DT><CODE>--verbose</CODE>
++<DD><A NAME="IDX6"></A>
++Use the built-in verbose format.
++<P>
++
++</P>
++<DT><CODE>-V</CODE>
++<DD><DT><CODE>--version</CODE>
++<DD><A NAME="IDX7"></A>
++Print the version number of <CODE>time</CODE> and exit.
++</DL>
++<P>
++
++<HR SIZE="6">
++<A NAME="SEC_Contents"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>Table of Contents</H1>
++<BLOCKQUOTE>
++<A NAME="TOC1" HREF="time.html#SEC1">1. Measuring Program Resource Use</A>
++<BR>
++<BLOCKQUOTE>
++<A NAME="TOC2" HREF="time.html#SEC2">1.1 Setting the Output Format</A>
++<BR>
++<A NAME="TOC3" HREF="time.html#SEC3">1.2 The Format String</A>
++<BR>
++<BLOCKQUOTE>
++<A NAME="TOC4" HREF="time.html#SEC4">1.2.1 Time Resources</A>
++<BR>
++<A NAME="TOC5" HREF="time.html#SEC5">1.2.2 Memory Resources</A>
++<BR>
++<A NAME="TOC6" HREF="time.html#SEC6">1.2.3 I/O Resources</A>
++<BR>
++<A NAME="TOC7" HREF="time.html#SEC7">1.2.4 Command Info</A>
++<BR>
++</BLOCKQUOTE>
++<A NAME="TOC8" HREF="time.html#SEC8">1.3 Redirecting Output</A>
++<BR>
++<A NAME="TOC9" HREF="time.html#SEC9">1.4 Examples</A>
++<BR>
++<A NAME="TOC10" HREF="time.html#SEC10">1.5 Accuracy</A>
++<BR>
++<A NAME="TOC11" HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A>
++<BR>
++</BLOCKQUOTE>
++</BLOCKQUOTE>
++<HR SIZE=1>
++<A NAME="SEC_OVERVIEW"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>Short Table of Contents</H1>
++<BLOCKQUOTE>
++<A NAME="TOC1" HREF="time.html#SEC1">1. Measuring Program Resource Use</A>
++<BR>
++
++</BLOCKQUOTE>
++<HR SIZE=1>
++<A NAME="SEC_About"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>About this document</H1>
++This document was generated
++by
++using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
++<P></P>
++The buttons in the navigation panels have the following meaning:
++<P></P>
++<table border = "1">
++<TR>
++<TH> Button </TH>
++<TH> Name </TH>
++<TH> Go to </TH>
++<TH> From 1.2.3 go to</TH>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &lt; ] </TD>
++<TD ALIGN="CENTER">
++Back
++</TD>
++<TD>
++previous section in reading order
++</TD>
++<TD>
++1.2.2
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &gt; ] </TD>
++<TD ALIGN="CENTER">
++Forward
++</TD>
++<TD>
++next section in reading order
++</TD>
++<TD>
++1.2.4
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &lt;&lt; ] </TD>
++<TD ALIGN="CENTER">
++FastBack
++</TD>
++<TD>
++beginning of this chapter or previous chapter
++</TD>
++<TD>
++1
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ Up ] </TD>
++<TD ALIGN="CENTER">
++Up
++</TD>
++<TD>
++up section
++</TD>
++<TD>
++1.2
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &gt;&gt; ] </TD>
++<TD ALIGN="CENTER">
++FastForward
++</TD>
++<TD>
++next chapter
++</TD>
++<TD>
++2
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [Top] </TD>
++<TD ALIGN="CENTER">
++Top
++</TD>
++<TD>
++cover (top) of document
++</TD>
++<TD>
++ &nbsp;
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [Contents] </TD>
++<TD ALIGN="CENTER">
++Contents
++</TD>
++<TD>
++table of contents
++</TD>
++<TD>
++ &nbsp;
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [Index] </TD>
++<TD ALIGN="CENTER">
++Index
++</TD>
++<TD>
++concept index
++</TD>
++<TD>
++ &nbsp;
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ ? ] </TD>
++<TD ALIGN="CENTER">
++About
++</TD>
++<TD>
++this page
++</TD>
++<TD>
++ &nbsp;
++</TD>
++</TR>
++</TABLE>
++ <P>
++ where the <STRONG> Example </STRONG> assumes that the current position
++ is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of
++ the following structure:</P>
++ <UL>
++ <LI> 1. Section One
++ <UL>
++ <LI>1.1 Subsection One-One
++ <UL>
++ <LI>...</LI>
++ </UL>
++ <LI>1.2 Subsection One-Two
++ <UL>
++ <LI>1.2.1 Subsubsection One-Two-One</LI>
++ <LI>1.2.2 Subsubsection One-Two-Two</LI>
++ <LI>1.2.3 Subsubsection One-Two-Three &nbsp; &nbsp;
++ <STRONG>&lt;== Current Position </STRONG></LI>
++ <LI>1.2.4 Subsubsection One-Two-Four</LI>
++ </UL>
++ </LI>
++ <LI>1.3 Subsection One-Three
++ <UL>
++ <LI>...</LI>
++ </UL>
++ </LI>
++ <LI>1.4 Subsection One-Four</LI>
++ </UL>
++ </LI>
++ </UL>
++
++<HR SIZE=1>
++<BR>
++<FONT SIZE="-1">
++This document was generated
++by <I>root</I> on <I>September, 1 2003</I>
++using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
++</FONT>
++
++</BODY>
++</HTML>
diff --git a/import-layers/yocto-poky/meta/recipes-extended/time/time.inc b/import-layers/yocto-poky/meta/recipes-extended/time/time.inc
new file mode 100644
index 000000000..85862177b
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/time/time.inc
@@ -0,0 +1,12 @@
+SUMMARY = "Tool that measures CPU resources"
+DESCRIPTION = "time measures many of the CPU resources, such as time and \
+memory, that other programs use."
+HOMEPAGE = "http://www.gnu.org/software/time/"
+SECTION = "utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+inherit texinfo update-alternatives
+
+ALTERNATIVE_${PN} = "time"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/time/time_1.7.bb b/import-layers/yocto-poky/meta/recipes-extended/time/time_1.7.bb
new file mode 100644
index 000000000..92c5353d0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/time/time_1.7.bb
@@ -0,0 +1,11 @@
+require time.inc
+
+PR = "r2"
+
+SRC_URI = "${GNU_MIRROR}/time/time-${PV}.tar.gz \
+ file://debian.patch"
+
+SRC_URI[md5sum] = "e38d2b8b34b1ca259cf7b053caac32b3"
+SRC_URI[sha256sum] = "e37ea79a253bf85a85ada2f7c632c14e481a5fd262a362f6f4fd58e68601496d"
+
+inherit autotools
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2016c.bb b/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2016c.bb
new file mode 100644
index 000000000..06b92ea6e
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tzcode/tzcode-native_2016c.bb
@@ -0,0 +1,25 @@
+# note that we allow for us to use data later than our code version
+#
+SUMMARY = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+LICENSE = "PD & BSD & BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=76ae2becfcb9a685041c6f166b44c2c2"
+
+SRC_URI =" http://www.iana.org/time-zones/repository/releases/tzcode${PV}.tar.gz;name=tzcode \
+ http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
+
+SRC_URI[tzcode.md5sum] = "ffb82ab0b588138759902b4627a6a80d"
+SRC_URI[tzcode.sha256sum] = "344b1bd486935bca2b7baa47db3b99b32211c45f31ec0d1ead8bacd103c5a416"
+SRC_URI[tzdata.md5sum] = "0330ccd16140d3b6438a18dae9b34b93"
+SRC_URI[tzdata.sha256sum] = "8700d981e6f2007ac037dabb5d2b12f390e8629bbc30e564bc21cf0c069a2d48"
+
+S = "${WORKDIR}"
+
+inherit native
+
+do_install () {
+ install -d ${D}${bindir}/
+ install -m 755 zic ${D}${bindir}/
+ install -m 755 zdump ${D}${bindir}/
+ install -m 755 tzselect ${D}${bindir}/
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2016c.bb b/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2016c.bb
new file mode 100644
index 000000000..5eb85b7e9
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/tzdata/tzdata_2016c.bb
@@ -0,0 +1,212 @@
+SUMMARY = "Timezone data"
+HOMEPAGE = "http://www.iana.org/time-zones"
+SECTION = "base"
+LICENSE = "PD & BSD & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=76ae2becfcb9a685041c6f166b44c2c2"
+
+DEPENDS = "tzcode-native"
+
+SRC_URI = "http://www.iana.org/time-zones/repository/releases/tzdata${PV}.tar.gz;name=tzdata"
+
+SRC_URI[tzdata.md5sum] = "0330ccd16140d3b6438a18dae9b34b93"
+SRC_URI[tzdata.sha256sum] = "8700d981e6f2007ac037dabb5d2b12f390e8629bbc30e564bc21cf0c069a2d48"
+
+inherit allarch
+
+RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \
+ timezone-arctic timezone-asia timezone-atlantic \
+ timezone-australia timezone-europe timezone-indian \
+ timezone-iso3166.tab timezone-pacific timezone-zone.tab"
+
+S = "${WORKDIR}"
+
+DEFAULT_TIMEZONE ?= "Universal"
+INSTALL_TIMEZONE_FILE ?= "1"
+
+TZONES= "africa antarctica asia australasia europe northamerica southamerica \
+ factory etcetera backward systemv \
+ "
+# pacificnew
+
+do_compile () {
+ for zone in ${TZONES}; do \
+ ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \
+ -y ${S}/yearistype.sh ${S}/${zone} ; \
+ ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \
+ -y ${S}/yearistype.sh ${S}/${zone} ; \
+ ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \
+ -y ${S}/yearistype.sh ${S}/${zone} ; \
+ done
+}
+
+do_install () {
+ install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo
+ cp -pPR ${S}/$exec_prefix ${D}/
+ # libc is removing zoneinfo files from package
+ cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo
+ cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
+
+ # Install default timezone
+ if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
+ install -d ${D}${sysconfdir}
+ if [ "${INSTALL_TIMEZONE_FILE}" = "1" ]; then
+ echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
+ fi
+ ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
+ else
+ bberror "DEFAULT_TIMEZONE is set to an invalid value."
+ exit 1
+ fi
+
+ chown -R root:root ${D}
+}
+
+pkg_postinst_${PN} () {
+ etc_lt="$D${sysconfdir}/localtime"
+ src="$D${sysconfdir}/timezone"
+
+ if [ -e ${src} ] ; then
+ tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
+ fi
+
+ if [ -z "${tz}" ] ; then
+ exit 0
+ fi
+
+ if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
+ echo "You have an invalid TIMEZONE setting in ${src}"
+ echo "Your ${etc_lt} has been reset to Universal; enjoy!"
+ tz="Universal"
+ echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
+ if [ -L ${etc_lt} ] ; then
+ rm -f "${etc_lt}"
+ fi
+ ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}"
+ fi
+}
+
+# Packages primarily organized by directory with a major city
+# in most time zones in the base package
+
+PACKAGES = "tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \
+ tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
+ tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific"
+
+FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*"
+RPROVIDES_tzdata-africa = "tzdata-africa"
+
+FILES_tzdata-americas += "${datadir}/zoneinfo/America/* \
+ ${datadir}/zoneinfo/US/* \
+ ${datadir}/zoneinfo/Brazil/* \
+ ${datadir}/zoneinfo/Canada/* \
+ ${datadir}/zoneinfo/Mexico/* \
+ ${datadir}/zoneinfo/Chile/*"
+RPROVIDES_tzdata-americas = "tzdata-americas"
+
+FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*"
+RPROVIDES_tzdata-antarctica = "tzdata-antarctica"
+
+FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*"
+RPROVIDES_tzdata-arctic = "tzdata-arctic"
+
+FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/* \
+ ${datadir}/zoneinfo/Indian/* \
+ ${datadir}/zoneinfo/Mideast/*"
+RPROVIDES_tzdata-asia = "tzdata-asia"
+
+FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*"
+RPROVIDES_tzdata-atlantic = "tzdata-atlantic"
+
+FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*"
+RPROVIDES_tzdata-australia = "tzdata-australia"
+
+FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*"
+RPROVIDES_tzdata-europe = "tzdata-europe"
+
+FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*"
+RPROVIDES_tzdata-pacific = "tzdata-pacific"
+
+FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*"
+RPROVIDES_tzdata-posix = "tzdata-posix"
+
+FILES_tzdata-right += "${datadir}/zoneinfo/right/*"
+RPROVIDES_tzdata-right = "tzdata-right"
+
+
+FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba \
+ ${datadir}/zoneinfo/Egypt \
+ ${datadir}/zoneinfo/Eire \
+ ${datadir}/zoneinfo/Factory \
+ ${datadir}/zoneinfo/GB-Eire \
+ ${datadir}/zoneinfo/Hongkong \
+ ${datadir}/zoneinfo/Iceland \
+ ${datadir}/zoneinfo/Iran \
+ ${datadir}/zoneinfo/Israel \
+ ${datadir}/zoneinfo/Jamaica \
+ ${datadir}/zoneinfo/Japan \
+ ${datadir}/zoneinfo/Kwajalein \
+ ${datadir}/zoneinfo/Libya \
+ ${datadir}/zoneinfo/Navajo \
+ ${datadir}/zoneinfo/Poland \
+ ${datadir}/zoneinfo/Portugal \
+ ${datadir}/zoneinfo/Singapore \
+ ${datadir}/zoneinfo/Turkey"
+RPROVIDES_tzdata-misc = "tzdata-misc"
+
+
+FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu \
+ ${datadir}/zoneinfo/America/Anchorage \
+ ${datadir}/zoneinfo/America/Los_Angeles \
+ ${datadir}/zoneinfo/America/Denver \
+ ${datadir}/zoneinfo/America/Chicago \
+ ${datadir}/zoneinfo/America/New_York \
+ ${datadir}/zoneinfo/America/Caracas \
+ ${datadir}/zoneinfo/America/Sao_Paulo \
+ ${datadir}/zoneinfo/Europe/London \
+ ${datadir}/zoneinfo/Europe/Paris \
+ ${datadir}/zoneinfo/Africa/Cairo \
+ ${datadir}/zoneinfo/Europe/Moscow \
+ ${datadir}/zoneinfo/Asia/Dubai \
+ ${datadir}/zoneinfo/Asia/Karachi \
+ ${datadir}/zoneinfo/Asia/Dhaka \
+ ${datadir}/zoneinfo/Asia/Bankok \
+ ${datadir}/zoneinfo/Asia/Hong_Kong \
+ ${datadir}/zoneinfo/Asia/Tokyo \
+ ${datadir}/zoneinfo/Australia/Darwin \
+ ${datadir}/zoneinfo/Australia/Adelaide \
+ ${datadir}/zoneinfo/Australia/Brisbane \
+ ${datadir}/zoneinfo/Australia/Sydney \
+ ${datadir}/zoneinfo/Pacific/Noumea \
+ ${datadir}/zoneinfo/CET \
+ ${datadir}/zoneinfo/CST6CDT \
+ ${datadir}/zoneinfo/EET \
+ ${datadir}/zoneinfo/EST \
+ ${datadir}/zoneinfo/EST5EDT \
+ ${datadir}/zoneinfo/GB \
+ ${datadir}/zoneinfo/GMT \
+ ${datadir}/zoneinfo/GMT+0 \
+ ${datadir}/zoneinfo/GMT-0 \
+ ${datadir}/zoneinfo/GMT0 \
+ ${datadir}/zoneinfo/Greenwich \
+ ${datadir}/zoneinfo/HST \
+ ${datadir}/zoneinfo/MET \
+ ${datadir}/zoneinfo/MST \
+ ${datadir}/zoneinfo/MST7MDT \
+ ${datadir}/zoneinfo/NZ \
+ ${datadir}/zoneinfo/NZ-CHAT \
+ ${datadir}/zoneinfo/PRC \
+ ${datadir}/zoneinfo/PST8PDT \
+ ${datadir}/zoneinfo/ROC \
+ ${datadir}/zoneinfo/ROK \
+ ${datadir}/zoneinfo/UCT \
+ ${datadir}/zoneinfo/UTC \
+ ${datadir}/zoneinfo/Universal \
+ ${datadir}/zoneinfo/W-SU \
+ ${datadir}/zoneinfo/WET \
+ ${datadir}/zoneinfo/Zulu \
+ ${datadir}/zoneinfo/zone.tab \
+ ${datadir}/zoneinfo/iso3166.tab \
+ ${datadir}/zoneinfo/Etc/*"
+
+CONFFILES_${PN} += "${@ "${sysconfdir}/timezone" if bb.utils.to_boolean(d.getVar('INSTALL_TIMEZONE_FILE', True)) else "" }"
+CONFFILES_${PN} += "${sysconfdir}/localtime"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch
new file mode 100644
index 000000000..afc4c734a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch
@@ -0,0 +1,403 @@
+From: Giovanni Scafora <giovanni.archlinux.org>
+Subject: unzip files encoded with non-latin, non-unicode file names
+Last-Update: 2015-02-11
+
+Upstream-Status: Backport
+CVE: CVE-2015-1315
+
+Updated 2015-02-11 by Marc Deslauriers <marc.deslauriers@canonical.com>
+to fix buffer overflow in charset_to_intern()
+
+Signed-off-by: Marc Deslauriers <marc.deslauriers@canonical.com>
+
+Index: unzip-6.0/unix/unix.c
+===================================================================
+--- unzip-6.0.orig/unix/unix.c 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unix/unix.c 2015-02-11 09:18:04.902081319 -0500
+@@ -30,6 +30,9 @@
+ #define UNZIP_INTERNAL
+ #include "unzip.h"
+
++#include <iconv.h>
++#include <langinfo.h>
++
+ #ifdef SCO_XENIX
+ # define SYSNDIR
+ #else /* SCO Unix, AIX, DNIX, TI SysV, Coherent 4.x, ... */
+@@ -1874,3 +1877,102 @@
+ }
+ }
+ #endif /* QLZIP */
++
++
++typedef struct {
++ char *local_charset;
++ char *archive_charset;
++} CHARSET_MAP;
++
++/* A mapping of local <-> archive charsets used by default to convert filenames
++ * of DOS/Windows Zip archives. Currently very basic. */
++static CHARSET_MAP dos_charset_map[] = {
++ { "ANSI_X3.4-1968", "CP850" },
++ { "ISO-8859-1", "CP850" },
++ { "CP1252", "CP850" },
++ { "UTF-8", "CP866" },
++ { "KOI8-R", "CP866" },
++ { "KOI8-U", "CP866" },
++ { "ISO-8859-5", "CP866" }
++};
++
++char OEM_CP[MAX_CP_NAME] = "";
++char ISO_CP[MAX_CP_NAME] = "";
++
++/* Try to guess the default value of OEM_CP based on the current locale.
++ * ISO_CP is left alone for now. */
++void init_conversion_charsets()
++{
++ const char *local_charset;
++ int i;
++
++ /* Make a guess only if OEM_CP not already set. */
++ if(*OEM_CP == '\0') {
++ local_charset = nl_langinfo(CODESET);
++ for(i = 0; i < sizeof(dos_charset_map)/sizeof(CHARSET_MAP); i++)
++ if(!strcasecmp(local_charset, dos_charset_map[i].local_charset)) {
++ strncpy(OEM_CP, dos_charset_map[i].archive_charset,
++ sizeof(OEM_CP));
++ break;
++ }
++ }
++}
++
++/* Convert a string from one encoding to the current locale using iconv().
++ * Be as non-intrusive as possible. If error is encountered during covertion
++ * just leave the string intact. */
++static void charset_to_intern(char *string, char *from_charset)
++{
++ iconv_t cd;
++ char *s,*d, *buf;
++ size_t slen, dlen, buflen;
++ const char *local_charset;
++
++ if(*from_charset == '\0')
++ return;
++
++ buf = NULL;
++ local_charset = nl_langinfo(CODESET);
++
++ if((cd = iconv_open(local_charset, from_charset)) == (iconv_t)-1)
++ return;
++
++ slen = strlen(string);
++ s = string;
++
++ /* Make sure OUTBUFSIZ + 1 never ends up smaller than FILNAMSIZ
++ * as this function also gets called with G.outbuf in fileio.c
++ */
++ buflen = FILNAMSIZ;
++ if (OUTBUFSIZ + 1 < FILNAMSIZ)
++ {
++ buflen = OUTBUFSIZ + 1;
++ }
++
++ d = buf = malloc(buflen);
++ if(!d)
++ goto cleanup;
++
++ bzero(buf,buflen);
++ dlen = buflen - 1;
++
++ if(iconv(cd, &s, &slen, &d, &dlen) == (size_t)-1)
++ goto cleanup;
++ strncpy(string, buf, buflen);
++
++ cleanup:
++ free(buf);
++ iconv_close(cd);
++}
++
++/* Convert a string from OEM_CP to the current locale charset. */
++inline void oem_intern(char *string)
++{
++ charset_to_intern(string, OEM_CP);
++}
++
++/* Convert a string from ISO_CP to the current locale charset. */
++inline void iso_intern(char *string)
++{
++ charset_to_intern(string, ISO_CP);
++}
+Index: unzip-6.0/unix/unxcfg.h
+===================================================================
+--- unzip-6.0.orig/unix/unxcfg.h 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unix/unxcfg.h 2015-02-11 08:46:43.671324260 -0500
+@@ -228,4 +228,30 @@
+ /* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */
+ /* and notfirstcall are used by do_wild(). */
+
++
++#define MAX_CP_NAME 25
++
++#ifdef SETLOCALE
++# undef SETLOCALE
++#endif
++#define SETLOCALE(category, locale) setlocale(category, locale)
++#include <locale.h>
++
++#ifdef _ISO_INTERN
++# undef _ISO_INTERN
++#endif
++#define _ISO_INTERN(str1) iso_intern(str1)
++
++#ifdef _OEM_INTERN
++# undef _OEM_INTERN
++#endif
++#ifndef IZ_OEM2ISO_ARRAY
++# define IZ_OEM2ISO_ARRAY
++#endif
++#define _OEM_INTERN(str1) oem_intern(str1)
++
++void iso_intern(char *);
++void oem_intern(char *);
++void init_conversion_charsets(void);
++
+ #endif /* !__unxcfg_h */
+Index: unzip-6.0/unzip.c
+===================================================================
+--- unzip-6.0.orig/unzip.c 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unzip.c 2015-02-11 08:46:43.675324290 -0500
+@@ -327,11 +327,21 @@
+ -2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\
+ -v verbose, multi-page format\n";
+
++#ifndef UNIX
+ static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\
+ -h print header line -t print totals for listed files or for all\n\
+ -z print zipfile comment -T print file times in sortable decimal format\
+ \n -C be case-insensitive %s\
+ -x exclude filenames that follow from listing\n";
++#else /* UNIX */
++static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\
++ -h print header line -t print totals for listed files or for all\n\
++ -z print zipfile comment %c-T%c print file times in sortable decimal format\
++\n %c-C%c be case-insensitive %s\
++ -x exclude filenames that follow from listing\n\
++ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\
++ -I CHARSET specify a character encoding for UNIX and other archives\n";
++#endif /* !UNIX */
+ #ifdef MORE
+ static ZCONST char Far ZipInfoUsageLine4[] =
+ " -M page output through built-in \"more\"\n";
+@@ -664,6 +674,17 @@
+ -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\
+ -C match filenames case-insensitively -L make (some) names \
+ lowercase\n %-42s -V retain VMS version numbers\n%s";
++#elif (defined UNIX)
++static ZCONST char Far UnzipUsageLine4[] = "\
++modifiers:\n\
++ -n never overwrite existing files -q quiet mode (-qq => quieter)\n\
++ -o overwrite files WITHOUT prompting -a auto-convert any text files\n\
++ -j junk paths (do not make directories) -aa treat ALL files as text\n\
++ -U use escapes for all non-ASCII Unicode -UU ignore any Unicode fields\n\
++ -C match filenames case-insensitively -L make (some) names \
++lowercase\n %-42s -V retain VMS version numbers\n%s\
++ -O CHARSET specify a character encoding for DOS, Windows and OS/2 archives\n\
++ -I CHARSET specify a character encoding for UNIX and other archives\n\n";
+ #else /* !VMS */
+ static ZCONST char Far UnzipUsageLine4[] = "\
+ modifiers:\n\
+@@ -802,6 +823,10 @@
+ #endif /* UNICODE_SUPPORT */
+
+
++#ifdef UNIX
++ init_conversion_charsets();
++#endif
++
+ #if (defined(__IBMC__) && defined(__DEBUG_ALLOC__))
+ extern void DebugMalloc(void);
+
+@@ -1335,6 +1360,11 @@
+ argc = *pargc;
+ argv = *pargv;
+
++#ifdef UNIX
++ extern char OEM_CP[MAX_CP_NAME];
++ extern char ISO_CP[MAX_CP_NAME];
++#endif
++
+ while (++argv, (--argc > 0 && *argv != NULL && **argv == '-')) {
+ s = *argv + 1;
+ while ((c = *s++) != 0) { /* "!= 0": prevent Turbo C warning */
+@@ -1516,6 +1546,35 @@
+ }
+ break;
+ #endif /* MACOS */
++#ifdef UNIX
++ case ('I'):
++ if (negative) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: encodings can't be negated"));
++ return(PK_PARAM);
++ } else {
++ if(*s) { /* Handle the -Icharset case */
++ /* Assume that charsets can't start with a dash to spot arguments misuse */
++ if(*s == '-') {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ strncpy(ISO_CP, s, sizeof(ISO_CP));
++ } else { /* -I charset */
++ ++argv;
++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ s = *argv;
++ strncpy(ISO_CP, s, sizeof(ISO_CP));
++ }
++ while(*(++s)); /* No params straight after charset name */
++ }
++ break;
++#endif /* ?UNIX */
+ case ('j'): /* junk pathnames/directory structure */
+ if (negative)
+ uO.jflag = FALSE, negative = 0;
+@@ -1591,6 +1650,35 @@
+ } else
+ ++uO.overwrite_all;
+ break;
++#ifdef UNIX
++ case ('O'):
++ if (negative) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: encodings can't be negated"));
++ return(PK_PARAM);
++ } else {
++ if(*s) { /* Handle the -Ocharset case */
++ /* Assume that charsets can't start with a dash to spot arguments misuse */
++ if(*s == '-') {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ strncpy(OEM_CP, s, sizeof(OEM_CP));
++ } else { /* -O charset */
++ ++argv;
++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -O argument"));
++ return(PK_PARAM);
++ }
++ s = *argv;
++ strncpy(OEM_CP, s, sizeof(OEM_CP));
++ }
++ while(*(++s)); /* No params straight after charset name */
++ }
++ break;
++#endif /* ?UNIX */
+ case ('p'): /* pipes: extract to stdout, no messages */
+ if (negative) {
+ uO.cflag = FALSE;
+Index: unzip-6.0/unzpriv.h
+===================================================================
+--- unzip-6.0.orig/unzpriv.h 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unzpriv.h 2015-02-11 08:46:43.675324290 -0500
+@@ -3008,7 +3008,7 @@
+ !(((islochdr) || (isuxatt)) && \
+ ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
+ (hostnum) == FS_HPFS_ || \
+- ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \
++ ((hostnum) == FS_NTFS_ /* && (hostver) == 50 */ )) { \
+ _OEM_INTERN((string)); \
+ } else { \
+ _ISO_INTERN((string)); \
+Index: unzip-6.0/zipinfo.c
+===================================================================
+--- unzip-6.0.orig/zipinfo.c 2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/zipinfo.c 2015-02-11 08:46:43.675324290 -0500
+@@ -457,6 +457,10 @@
+ int tflag_slm=TRUE, tflag_2v=FALSE;
+ int explicit_h=FALSE, explicit_t=FALSE;
+
++#ifdef UNIX
++ extern char OEM_CP[MAX_CP_NAME];
++ extern char ISO_CP[MAX_CP_NAME];
++#endif
+
+ #ifdef MACOS
+ uO.lflag = LFLAG; /* reset default on each call */
+@@ -501,6 +505,35 @@
+ uO.lflag = 0;
+ }
+ break;
++#ifdef UNIX
++ case ('I'):
++ if (negative) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: encodings can't be negated"));
++ return(PK_PARAM);
++ } else {
++ if(*s) { /* Handle the -Icharset case */
++ /* Assume that charsets can't start with a dash to spot arguments misuse */
++ if(*s == '-') {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ strncpy(ISO_CP, s, sizeof(ISO_CP));
++ } else { /* -I charset */
++ ++argv;
++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ s = *argv;
++ strncpy(ISO_CP, s, sizeof(ISO_CP));
++ }
++ while(*(++s)); /* No params straight after charset name */
++ }
++ break;
++#endif /* ?UNIX */
+ case 'l': /* longer form of "ls -l" type listing */
+ if (negative)
+ uO.lflag = -2, negative = 0;
+@@ -521,6 +554,35 @@
+ G.M_flag = TRUE;
+ break;
+ #endif
++#ifdef UNIX
++ case ('O'):
++ if (negative) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: encodings can't be negated"));
++ return(PK_PARAM);
++ } else {
++ if(*s) { /* Handle the -Ocharset case */
++ /* Assume that charsets can't start with a dash to spot arguments misuse */
++ if(*s == '-') {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -I argument"));
++ return(PK_PARAM);
++ }
++ strncpy(OEM_CP, s, sizeof(OEM_CP));
++ } else { /* -O charset */
++ ++argv;
++ if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++ Info(slide, 0x401, ((char *)slide,
++ "error: a valid character encoding should follow the -O argument"));
++ return(PK_PARAM);
++ }
++ s = *argv;
++ strncpy(OEM_CP, s, sizeof(OEM_CP));
++ }
++ while(*(++s)); /* No params straight after charset name */
++ }
++ break;
++#endif /* ?UNIX */
+ case 's': /* default: shorter "ls -l" type listing */
+ if (negative)
+ uO.lflag = -2, negative = 0;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch
new file mode 100644
index 000000000..0e497cc65
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch
@@ -0,0 +1,53 @@
+From: sms
+Subject: Fix CVE-2014-8139: CRC32 verification heap-based overflow
+Bug-Debian: http://bugs.debian.org/773722
+
+The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz
+
+Upstream-Status: Backport
+CVE: CVE-2014-8139
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+--- a/extract.c
++++ b/extract.c
+@@ -298,6 +298,8 @@
+ #ifndef SFX
+ static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \
+ EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n";
++ static ZCONST char Far TooSmallEBlength[] = "bad extra-field entry:\n \
++ EF block length (%u bytes) invalid (< %d)\n";
+ static ZCONST char Far InvalidComprDataEAs[] =
+ " invalid compressed data for EAs\n";
+ # if (defined(WIN32) && defined(NTSD_EAS))
+@@ -2023,7 +2025,8 @@
+ ebID = makeword(ef);
+ ebLen = (unsigned)makeword(ef+EB_LEN);
+
+- if (ebLen > (ef_len - EB_HEADSIZE)) {
++ if (ebLen > (ef_len - EB_HEADSIZE))
++ {
+ /* Discovered some extra field inconsistency! */
+ if (uO.qflag)
+ Info(slide, 1, ((char *)slide, "%-22s ",
+@@ -2158,11 +2161,19 @@
+ }
+ break;
+ case EF_PKVMS:
+- if (makelong(ef+EB_HEADSIZE) !=
++ if (ebLen < 4)
++ {
++ Info(slide, 1,
++ ((char *)slide, LoadFarString(TooSmallEBlength),
++ ebLen, 4));
++ }
++ else if (makelong(ef+EB_HEADSIZE) !=
+ crc32(CRCVAL_INITIAL, ef+(EB_HEADSIZE+4),
+ (extent)(ebLen-4)))
++ {
+ Info(slide, 1, ((char *)slide,
+ LoadFarString(BadCRC_EAs)));
++ }
+ break;
+ case EF_PKW32:
+ case EF_PKUNIX:
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch
new file mode 100644
index 000000000..c989df189
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch
@@ -0,0 +1,34 @@
+From: sms
+Subject: Fix CVE-2014-8140: out-of-bounds write issue in test_compr_eb()
+Bug-Debian: http://bugs.debian.org/773722
+
+The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz
+
+Upstream-Status: Backport
+CVE: CVE-2014-8140
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+--- a/extract.c
++++ b/extract.c
+@@ -2232,10 +2232,17 @@
+ if (compr_offset < 4) /* field is not compressed: */
+ return PK_OK; /* do nothing and signal OK */
+
++ /* Return no/bad-data error status if any problem is found:
++ * 1. eb_size is too small to hold the uncompressed size
++ * (eb_ucsize). (Else extract eb_ucsize.)
++ * 2. eb_ucsize is zero (invalid). 2014-12-04 SMS.
++ * 3. eb_ucsize is positive, but eb_size is too small to hold
++ * the compressed data header.
++ */
+ if ((eb_size < (EB_UCSIZE_P + 4)) ||
+- ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
+- eb_size <= (compr_offset + EB_CMPRHEADLEN)))
+- return IZ_EF_TRUNC; /* no compressed data! */
++ ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
++ ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
++ return IZ_EF_TRUNC; /* no/bad compressed data! */
+
+ if (
+ #ifdef INT_16BIT
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch
new file mode 100644
index 000000000..c48c23f30
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch
@@ -0,0 +1,145 @@
+From: sms
+Subject: Fix CVE-2014-8141: out-of-bounds read issues in getZip64Data()
+Bug-Debian: http://bugs.debian.org/773722
+
+The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz
+
+Upstream-Status: Backport
+CVE: CVE-2014-8141
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+
+--- a/fileio.c
++++ b/fileio.c
+@@ -176,6 +176,8 @@
+ #endif
+ static ZCONST char Far ExtraFieldTooLong[] =
+ "warning: extra field too long (%d). Ignoring...\n";
++static ZCONST char Far ExtraFieldCorrupt[] =
++ "warning: extra field (type: 0x%04x) corrupt. Continuing...\n";
+
+ #ifdef WINDLL
+ static ZCONST char Far DiskFullQuery[] =
+@@ -2295,7 +2297,12 @@
+ if (readbuf(__G__ (char *)G.extra_field, length) == 0)
+ return PK_EOF;
+ /* Looks like here is where extra fields are read */
+- getZip64Data(__G__ G.extra_field, length);
++ if (getZip64Data(__G__ G.extra_field, length) != PK_COOL)
++ {
++ Info(slide, 0x401, ((char *)slide,
++ LoadFarString( ExtraFieldCorrupt), EF_PKSZ64));
++ error = PK_WARN;
++ }
+ #ifdef UNICODE_SUPPORT
+ G.unipath_filename = NULL;
+ if (G.UzO.U_flag < 2) {
+--- a/process.c
++++ b/process.c
+@@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
++ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
+
+ See the accompanying file LICENSE, version 2009-Jan-02 or later
+ (the contents of which are also included in unzip.h) for terms of use.
+@@ -1901,48 +1901,82 @@
+ and a 4-byte version of disk start number.
+ Sets both local header and central header fields. Not terribly clever,
+ but it means that this procedure is only called in one place.
++
++ 2014-12-05 SMS.
++ Added checks to ensure that enough data are available before calling
++ makeint64() or makelong(). Replaced various sizeof() values with
++ simple ("4" or "8") constants. (The Zip64 structures do not depend
++ on our variable sizes.) Error handling is crude, but we should now
++ stay within the buffer.
+ ---------------------------------------------------------------------------*/
+
++#define Z64FLGS 0xffff
++#define Z64FLGL 0xffffffff
++
+ if (ef_len == 0 || ef_buf == NULL)
+ return PK_COOL;
+
+ Trace((stderr,"\ngetZip64Data: scanning extra field of length %u\n",
+ ef_len));
+
+- while (ef_len >= EB_HEADSIZE) {
++ while (ef_len >= EB_HEADSIZE)
++ {
+ eb_id = makeword(EB_ID + ef_buf);
+ eb_len = makeword(EB_LEN + ef_buf);
+
+- if (eb_len > (ef_len - EB_HEADSIZE)) {
+- /* discovered some extra field inconsistency! */
++ if (eb_len > (ef_len - EB_HEADSIZE))
++ {
++ /* Extra block length exceeds remaining extra field length. */
+ Trace((stderr,
+ "getZip64Data: block length %u > rest ef_size %u\n", eb_len,
+ ef_len - EB_HEADSIZE));
+ break;
+ }
+- if (eb_id == EF_PKSZ64) {
+-
++ if (eb_id == EF_PKSZ64)
++ {
+ int offset = EB_HEADSIZE;
+
+- if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){
+- G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf);
+- offset += sizeof(G.crec.ucsize);
++ if ((G.crec.ucsize == Z64FLGL) || (G.lrec.ucsize == Z64FLGL))
++ {
++ if (offset+ 8 > ef_len)
++ return PK_ERR;
++
++ G.crec.ucsize = G.lrec.ucsize = makeint64(offset + ef_buf);
++ offset += 8;
+ }
+- if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){
+- G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf);
+- offset += sizeof(G.crec.csize);
++
++ if ((G.crec.csize == Z64FLGL) || (G.lrec.csize == Z64FLGL))
++ {
++ if (offset+ 8 > ef_len)
++ return PK_ERR;
++
++ G.csize = G.crec.csize = G.lrec.csize = makeint64(offset + ef_buf);
++ offset += 8;
+ }
+- if (G.crec.relative_offset_local_header == 0xffffffff){
++
++ if (G.crec.relative_offset_local_header == Z64FLGL)
++ {
++ if (offset+ 8 > ef_len)
++ return PK_ERR;
++
+ G.crec.relative_offset_local_header = makeint64(offset + ef_buf);
+- offset += sizeof(G.crec.relative_offset_local_header);
++ offset += 8;
+ }
+- if (G.crec.disk_number_start == 0xffff){
++
++ if (G.crec.disk_number_start == Z64FLGS)
++ {
++ if (offset+ 4 > ef_len)
++ return PK_ERR;
++
+ G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf);
+- offset += sizeof(G.crec.disk_number_start);
++ offset += 4;
+ }
++#if 0
++ break; /* Expect only one EF_PKSZ64 block. */
++#endif /* 0 */
+ }
+
+- /* Skip this extra field block */
++ /* Skip this extra field block. */
+ ef_buf += (eb_len + EB_HEADSIZE);
+ ef_len -= (eb_len + EB_HEADSIZE);
+ }
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch
new file mode 100644
index 000000000..87eed965d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7696.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Backport
+CVE: CVE-2015-7696
+Signed-off-by: Tudor Florea <tudor.flore@enea.com>
+
+From 68efed87fabddd450c08f3112f62a73f61d493c9 Mon Sep 17 00:00:00 2001
+From: Petr Stodulka <pstodulk@redhat.com>
+Date: Mon, 14 Sep 2015 18:23:17 +0200
+Subject: [PATCH 1/2] upstream fix for heap overflow
+
+https://bugzilla.redhat.com/attachment.cgi?id=1073002
+---
+ crypt.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/crypt.c b/crypt.c
+index 784e411..a8975f2 100644
+--- a/crypt.c
++++ b/crypt.c
+@@ -465,7 +465,17 @@ int decrypt(__G__ passwrd)
+ GLOBAL(pInfo->encrypted) = FALSE;
+ defer_leftover_input(__G);
+ for (n = 0; n < RAND_HEAD_LEN; n++) {
+- b = NEXTBYTE;
++ /* 2012-11-23 SMS. (OUSPG report.)
++ * Quit early if compressed size < HEAD_LEN. The resulting
++ * error message ("unable to get password") could be improved,
++ * but it's better than trying to read nonexistent data, and
++ * then continuing with a negative G.csize. (See
++ * fileio.c:readbyte()).
++ */
++ if ((b = NEXTBYTE) == (ush)EOF)
++ {
++ return PK_ERR;
++ }
+ h[n] = (uch)b;
+ Trace((stdout, " (%02x)", h[n]));
+ }
+--
+2.4.6
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch
new file mode 100644
index 000000000..a8f293674
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/CVE-2015-7697.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+CVE: CVE-2015-7697
+Signed-off-by: Tudor Florea <tudor.flore@enea.com>
+
+From bd8a743ee0a77e65ad07ef4196c4cd366add3f26 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka@redhat.com>
+Date: Mon, 14 Sep 2015 18:24:56 +0200
+Subject: [PATCH 2/2] fix infinite loop when extracting empty bzip2 data
+
+---
+ extract.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/extract.c b/extract.c
+index 7134bfe..29db027 100644
+--- a/extract.c
++++ b/extract.c
+@@ -2733,6 +2733,12 @@ __GDEF
+ int repeated_buf_err;
+ bz_stream bstrm;
+
++ if (G.incnt <= 0 && G.csize <= 0L) {
++ /* avoid an infinite loop */
++ Trace((stderr, "UZbunzip2() got empty input\n"));
++ return 2;
++ }
++
+ #if (defined(DLL) && !defined(NO_SLIDE_REDIR))
+ if (G.redirect_slide)
+ wsize = G.redirect_size, redirSlide = G.redirect_buffer;
+--
+2.4.6
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch
new file mode 100644
index 000000000..8f30e4267
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/avoid-strip.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Pending
+
+unix/Makefile: remove hard coded strip commands
+
+Remove the hard coded strip commands, both LF2 (used in linking) and
+STRIP used alone.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur unzip60.orig/unix/configure unzip60/unix/configure
+--- unzip60.orig/unix/configure 2009-04-16 14:25:12.000000000 -0500
++++ unzip60/unix/configure 2011-06-21 11:23:36.822849960 -0500
+@@ -17,7 +17,7 @@
+ IZ_BZIP2=${3}
+ CFLAGS="${CFLAGS} -I. -DUNIX"
+ LFLAGS1=""
+-LFLAGS2="-s"
++LFLAGS2=""
+ LN="ln -s"
+
+ CFLAGS_OPT=''
+diff -ur unzip60.orig/unix/Makefile unzip60/unix/Makefile
+--- unzip60.orig/unix/Makefile 2009-01-18 16:41:18.000000000 -0600
++++ unzip60/unix/Makefile 2011-06-21 11:12:22.900003388 -0500
+@@ -52,7 +52,7 @@
+ CF = $(CFLAGS) $(CF_NOOPT)
+ LFLAGS1 =
+ LF = -o unzip$E $(LFLAGS1)
+-LF2 = -s
++LF2 =
+
+ # UnZipSFX flags
+ SL = -o unzipsfx$E $(LFLAGS1)
+@@ -70,7 +70,7 @@
+ CHMOD = chmod
+ BINPERMS = 755
+ MANPERMS = 644
+-STRIP = strip
++STRIP =
+ E =
+ O = .o
+ M = unix
+@@ -776,7 +776,6 @@
+ #
+ gcc: unix_make
+ $(MAKE) unzips CC=gcc LD=gcc CFLAGS="-O3" LF2=""
+- $(STRIP) $(UNZIPS)
+
+ # Heurikon HK68 (68010), UniPlus+ System V 5.0, Green Hills C-68000
+ hk68: unix_make
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch
new file mode 100644
index 000000000..5fcd318b2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/cve-2014-9636.patch
@@ -0,0 +1,46 @@
+From 190040ebfcf5395a6ccedede2cc9343d34f0a108 Mon Sep 17 00:00:00 2001
+From: mancha <mancha1 AT zoho DOT com>
+Date: Wed, 11 Feb 2015
+Subject: Info-ZIP UnZip buffer overflow
+
+Upstream-Status: Backport
+CVE: CVE-2014-9636
+
+By carefully crafting a corrupt ZIP archive with "extra fields" that
+purport to have compressed blocks larger than the corresponding
+uncompressed blocks in STORED no-compression mode, an attacker can
+trigger a heap overflow that can result in application crash or
+possibly have other unspecified impact.
+
+This patch ensures that when extra fields use STORED mode, the
+"compressed" and uncompressed block sizes match.
+
+Signed-off-by: mancha <mancha1 AT zoho DOT com>
+---
+ extract.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/extract.c
++++ b/extract.c
+@@ -2217,6 +2217,7 @@ static int test_compr_eb(__G__ eb, eb_si
+ ulg eb_ucsize;
+ uch *eb_ucptr;
+ int r;
++ ush method;
+
+ if (compr_offset < 4) /* field is not compressed: */
+ return PK_OK; /* do nothing and signal OK */
+@@ -2226,6 +2227,13 @@ static int test_compr_eb(__G__ eb, eb_si
+ eb_size <= (compr_offset + EB_CMPRHEADLEN)))
+ return IZ_EF_TRUNC; /* no compressed data! */
+
++ method = makeword(eb + (EB_HEADSIZE + compr_offset));
++ if ((method == STORED) &&
++ (eb_size - compr_offset - EB_CMPRHEADLEN != eb_ucsize))
++ return PK_ERR; /* compressed & uncompressed
++ * should match in STORED
++ * method */
++
+ if (
+ #ifdef INT_16BIT
+ (((ulg)(extent)eb_ucsize) != eb_ucsize) ||
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch
new file mode 100644
index 000000000..659c6e331
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip/define-ldflags.patch
@@ -0,0 +1,18 @@
+Pass LDFLAGS to the linker
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikhail Durnev <Mikhail_Durnev@mentor.com>
+
+diff -Naur old/unix/configure new/unix/configure
+--- old/unix/configure 2014-01-13 21:59:27.000000000 +1100
++++ new/unix/configure 2014-01-14 16:36:02.000000000 +1100
+@@ -16,7 +16,7 @@
+ CFLAGSR=${CFLAGS}
+ IZ_BZIP2=${3}
+ CFLAGS="${CFLAGS} -I. -DUNIX"
+-LFLAGS1=""
++LFLAGS1=${LDFLAGS}
+ LFLAGS2=""
+ LN="ln -s"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb
new file mode 100644
index 000000000..9efe75628
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/unzip/unzip_6.0.bb
@@ -0,0 +1,57 @@
+SUMMARY = "Utilities for extracting and viewing files in .zip archives"
+HOMEPAGE = "http://www.info-zip.org"
+SECTION = "console/utils"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=94caec5a51ef55ef711ee4e8b1c69e29"
+PE = "1"
+PR = "r5"
+
+SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/unzip60.tgz \
+ file://avoid-strip.patch \
+ file://define-ldflags.patch \
+ file://06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch \
+ file://cve-2014-9636.patch \
+ file://09-cve-2014-8139-crc-overflow.patch \
+ file://10-cve-2014-8140-test-compr-eb.patch \
+ file://11-cve-2014-8141-getzip64data.patch \
+ file://CVE-2015-7696.patch \
+ file://CVE-2015-7697.patch \
+"
+
+SRC_URI[md5sum] = "62b490407489521db863b523a7f86375"
+SRC_URI[sha256sum] = "036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37"
+
+# exclude version 5.5.2 which triggers a false positive
+UPSTREAM_CHECK_REGEX = "unzip(?P<pver>(?!552).+)\.tgz"
+
+S = "${WORKDIR}/unzip60"
+
+# Makefile uses CF_NOOPT instead of CFLAGS. We lifted the values from
+# Makefile and add CFLAGS. Optimization will be overriden by unzip
+# configure to be -O3.
+#
+EXTRA_OEMAKE = "-e MAKEFLAGS= STRIP=true LF2='' \
+ 'CF_NOOPT=-I. -Ibzip2 -DUNIX ${CFLAGS}'"
+
+export LD = "${CC}"
+LD_class-native = "${CC}"
+
+do_compile() {
+ oe_runmake -f unix/Makefile generic
+}
+
+do_install() {
+ oe_runmake -f unix/Makefile install prefix=${D}${prefix}
+ install -d ${D}${mandir}
+ mv ${D}${prefix}/man/* ${D}${mandir}
+ rmdir ${D}${prefix}/man/
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "unzip"
+ALTERNATIVE_LINK_NAME[unzip] = "${bindir}/unzip"
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch
new file mode 100644
index 000000000..8afed5c0d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch
@@ -0,0 +1,99 @@
+From 83ec34df357218a1c9cfc13a23d3367d333652c3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Dec 2015 01:01:15 +0000
+Subject: [PATCH] Fix build issues found with non glibc C libraries
+
+Add time.h for getting time_t definition
+limits.h for PATH_MAX
+linux/param.h for EXEC_PAGESIZE
+Replace deprecated MNTTAB with _PATH_MNTTAB
+include ext2_mnt.h for MNTOPT_USRQUOTA and MNTOPT_GRPQUOTA and
+MNTTYPE_EXT2
+Include sys/types.h for u_char definition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+
+Upstream-Status: Submitted
+
+ include/extern.h | 1 +
+ src/configfile.c | 1 +
+ src/memory.c | 3 +++
+ src/net.c | 1 +
+ src/shutdown.c | 3 ++-
+ 5 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/include/extern.h b/include/extern.h
+index 21db11b..04b16bc 100644
+--- a/include/extern.h
++++ b/include/extern.h
+@@ -3,6 +3,7 @@
+
+ #include <netinet/in.h>
+ #include <stdio.h>
++#include <time.h>
+
+ #include "logmessage.h"
+ #include "xmalloc.h"
+diff --git a/src/configfile.c b/src/configfile.c
+index be5d7b3..7c1d1dd 100644
+--- a/src/configfile.c
++++ b/src/configfile.c
+@@ -16,6 +16,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <dirent.h>
++#include <limits.h>
+ #include <sys/stat.h>
+
+ #include "extern.h"
+diff --git a/src/memory.c b/src/memory.c
+index e9607e4..b5e08aa 100644
+--- a/src/memory.c
++++ b/src/memory.c
+@@ -21,6 +21,9 @@
+ #include <sys/stat.h>
+ #include <sys/param.h>
+ #include <sys/mman.h>
++#ifdef __linux__
++#include <linux/param.h>
++#endif
+
+ #include "extern.h"
+ #include "watch_err.h"
+diff --git a/src/net.c b/src/net.c
+index 21823ae..8930caf 100644
+--- a/src/net.c
++++ b/src/net.c
+@@ -17,6 +17,7 @@
+ #include <string.h>
+ #include <unistd.h> /* for gethostname() etc */
+ #include <netdb.h> /* for gethostbyname() */
++#include <sys/types.h>
+ #include <sys/param.h> /* for MAXHOSTNAMELEN */
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+diff --git a/src/shutdown.c b/src/shutdown.c
+index 74aafa5..46b99cf 100644
+--- a/src/shutdown.c
++++ b/src/shutdown.c
+@@ -25,6 +25,7 @@
+
+ #include "watch_err.h"
+ #include "extern.h"
++#include "ext2_mnt.h"
+
+ #if defined __GLIBC__
+ #include "ext2_mnt.h"
+@@ -123,7 +124,7 @@ static void mnt_off()
+ FILE *fp;
+ struct mntent *mnt;
+
+- fp = setmntent(MNTTAB, "r");
++ fp = setmntent(_PATH_MNTTAB, "r");
+ /* in some rare cases fp might be NULL so be careful */
+ while (fp != NULL && ((mnt = getmntent(fp)) != (struct mntent *)0)) {
+ /* First check if swap */
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch
new file mode 100644
index 000000000..14ab9c56a
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch
@@ -0,0 +1,79 @@
+Fix ping mode failure
+
+Upstream-Status: Pending
+
+When watchdog works on ping mode, the system will be rebooted since
+watchdog can not receive the expected ECOREPLY on a setting interval.
+
+Ping mode uses a raw socket to send a ECO packet, then uses select()
+to wait and recvfrom() to receive the ECOREPLY packet, if select()
+shows the data is ready, and the data is not the expected ECOREPLY,
+and waiting time is not overdue, it will continue use select() and
+recvfrom().
+
+Problem is that the raw socket can receive any icmp packets, if we do
+not set filters, and there are many icmp packets on socket, this
+program will not find its interested ECOREPLY packet in a special
+interval, which makes the ping mode fail.
+
+
+Other program is that watchdog sometime can not reach the call of
+recvfrom to try to receive packets since tv_sec of struct timeval
+of select parameter is 0.
+
+The timeout of select() is the result of ping interval minusing the
+time of calling gettimeofday spending, when ping interval is 1 second,
+and the call of gettimeofday() spends several useconds, the tv_sec of
+struct timeval of select parameter must be 0, at that condition, we
+should it is valid of tv_sec of struct timeval of select parameter be 0
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ src/net.c | 2 +-
+ src/watchdog.c | 5 ++++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+Index: watchdog-5.14/src/watchdog.c
+===================================================================
+--- watchdog-5.14.orig/src/watchdog.c
++++ watchdog-5.14/src/watchdog.c
+@@ -24,6 +24,7 @@
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <linux/oom.h>
++#include <linux/icmp.h>
+ #include <linux/watchdog.h>
+ #include <string.h>
+
+Index: watchdog-5.14/src/net.c
+===================================================================
+--- watchdog-5.14.orig/src/net.c
++++ watchdog-5.14/src/net.c
+@@ -11,7 +11,8 @@
+ #include <errno.h>
+ #include <sys/time.h>
+ #include <netinet/ip.h>
+-#include <netinet/ip_icmp.h>
++#include <linux/icmp.h>
++//#include <netinet/ip_icmp.h>
+ #include <fcntl.h>
+ #include <string.h>
+ #include <unistd.h> /* for gethostname() etc */
+@@ -179,6 +180,9 @@ int open_netcheck(struct list *tlist)
+ {
+ struct list *act;
+ int hold = 0;
++ struct icmp_filter filt;
++ filt.data = ~(1<<ICMP_ECHOREPLY);
++
+
+ if (tlist != NULL) {
+ for (act = tlist; act != NULL; act = act->next) {
+@@ -202,6 +206,7 @@ int open_netcheck(struct list *tlist)
+ fatal_error(EX_SYSERR, "error opening socket (%s)", strerror(errno));
+ }
+
++ setsockopt(net->sock_fp, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt));
+ /* this is necessary for broadcast pings to work */
+ (void)setsockopt(net->sock_fp, SOL_SOCKET, SO_BROADCAST, (char *)&hold, sizeof(hold));
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch
new file mode 100644
index 000000000..2fad3a112
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch
@@ -0,0 +1,27 @@
+Fix out of tree build support:
+
+| installing /etc/watchdog.conf
+| /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5'
+| /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8'
+| /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.conf.5 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5'
+| /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_keepalive.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_identify.8 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8'
+| /usr/bin/install: cannot stat `watchdog.conf': No such file or directory
+| make[2]: *** [install-etc-local] Error 1
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Index: watchdog-5.13/Makefile.am
+===================================================================
+--- watchdog-5.13.orig/Makefile.am 2013-02-01 11:15:44.000000000 +0000
++++ watchdog-5.13/Makefile.am 2013-03-21 11:59:35.637139031 +0000
+@@ -16,7 +16,7 @@
+ else \
+ echo "installing $(CONFIG_FILENAME)"; \
+ $(mkinstalldirs) `dirname $(DESTDIR)$(CONFIG_FILENAME)`; \
+- $(INSTALL_DATA) watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \
++ $(INSTALL_DATA) $(srcdir)/watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \
+ fi
+
+ install-data-local: install-etc-local
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch
new file mode 100644
index 000000000..e68ad545c
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch
@@ -0,0 +1,14 @@
+Signed-off-by: Diego Rondini <diego.ml@zoho.com>
+Upstream-Status: Inappropriate
+
+--- watchdog-5.13.orig/watchdog.conf 2013-02-01 12:15:44.000000000 +0100
++++ watchdog-5.13/watchdog.conf 2014-11-13 10:59:43.233943000 +0100
+@@ -20,7 +20,7 @@
+ #test-binary =
+ #test-timeout =
+
+-#watchdog-device = /dev/watchdog
++watchdog-device = /dev/watchdog
+
+ # Defaults compiled into the binary
+ #temperature-device =
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch
new file mode 100644
index 000000000..b2765f190
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch
@@ -0,0 +1,56 @@
+Signed-off-by: Diego Rondini <diego.ml@zoho.com>
+Upstream-Status: Inappropriate
+
+--- watchdog-5.13.orig/redhat/watchdog.init 2014-11-12 17:18:39.125943000 +0100
++++ watchdog-5.13/redhat/watchdog.init 2014-11-12 18:27:36.189943000 +0100
+@@ -7,7 +7,7 @@
+ # Henning P. Schmiedehausen <hps@tanstaafl.de>
+
+ # Source function library.
+-. /etc/rc.d/init.d/functions
++. /etc/init.d/functions
+
+ [ -x /usr/sbin/watchdog -a -e /etc/watchdog.conf ] || exit 0
+
+@@ -23,22 +23,22 @@
+
+ start() {
+
+- echo -n $"Starting $prog: "
++ echo -n "Starting $prog: "
+ if [ -n "$(pidofproc $prog)" ]; then
+- echo -n $"$prog: already running"
+- echo_failure
++ echo -n "$prog: already running "
++ failure
+ echo
+ return 1
+ fi
+ if [ "$VERBOSE" = "yes" ]; then
+- daemon /usr/sbin/${prog} -v
++ /usr/sbin/${prog} -v
+ else
+- daemon /usr/sbin/${prog}
++ /usr/sbin/${prog}
+ fi
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch $lockfile
+- [ $RETVAL -eq 0 ] && echo_success
+- [ $RETVAL -ne 0 ] && echo_failure
++ [ $RETVAL -eq 0 ] && success
++ [ $RETVAL -ne 0 ] && failure
+ echo
+ return $RETVAL
+ }
+@@ -50,8 +50,10 @@
+ # and reboot the box.
+ killproc $prog -TERM
+ RETVAL=$?
+- echo
+ [ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile
++ [ $RETVAL -eq 0 ] && success
++ [ $RETVAL -ne 0 ] && failure
++ echo
+ return $RETVAL
+ }
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.14.bb b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.14.bb
new file mode 100644
index 000000000..733023897
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/watchdog/watchdog_5.14.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Software watchdog"
+DESCRIPTION = "Watchdog is a daemon that checks if your system is still \
+working. If programs in user space are not longer executed \
+it will reboot the system."
+HOMEPAGE = "http://watchdog.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194"
+
+LICENSE = "GPL-2.0+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ecc0551bf54ad97f6b541720f84d6569"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \
+ file://fixsepbuild.patch \
+ file://fix-ping-failure.patch \
+ file://watchdog-init.patch \
+ file://watchdog-conf.patch \
+ file://0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch \
+"
+
+SRC_URI[md5sum] = "5b2dba0c593942f4acc100bca0d560c4"
+SRC_URI[sha256sum] = "620b2f49e9879f2e85c73d4c1f422f9101e6b38e824fea2414befd8bb6866ad1"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/watchdog/files/watchdog/"
+UPSTREAM_CHECK_REGEX = "/watchdog/(?P<pver>(\d+[\.\-_]*)+)/"
+
+inherit autotools
+inherit update-rc.d
+
+DEPENDS_append_libc-musl = " libtirpc "
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc "
+LDFLAGS_append_libc-musl = " -ltirpc "
+EXTRA_OECONF_append_libc-musl = " --disable-nfs "
+
+INITSCRIPT_NAME = "watchdog.sh"
+INITSCRIPT_PARAMS = "start 15 1 2 3 4 5 . stop 85 0 6 ."
+
+RRECOMMENDS_${PN} = "kernel-module-softdog"
+
+do_install_append() {
+ install -D ${S}/redhat/watchdog.init ${D}/${sysconfdir}/init.d/watchdog.sh
+}
diff --git a/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc b/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc
new file mode 100644
index 000000000..dc381a628
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/wget/wget.inc
@@ -0,0 +1,29 @@
+SUMMARY = "Console URL download utility supporting HTTP, FTP, etc"
+HOMEPAGE = "https://www.gnu.org/software/wget/"
+SECTION = "console/network"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "gnutls zlib libpcre"
+
+INC_PR = "r16"
+
+inherit autotools gettext texinfo update-alternatives pkgconfig
+
+EXTRA_OECONF = "--enable-ipv6 --with-ssl=gnutls --disable-rpath --disable-iri \
+ --without-libgnutls-prefix ac_cv_header_uuid_uuid_h=no"
+
+ALTERNATIVE_${PN} = "wget"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_PRIORITY = "100"
+
+RRECOMMENDS_${PN} += "ca-certificates"
+
+BBCLASSEXTEND += "nativesdk"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libuuid] = "--with-libuuid, --without-libuuid,util-linux"
+
+# Let aclocal use the relative path for the m4 file rather than
+# absolute, otherwise there might be an "Argument list too long" error
+# when it is built in a long/deep directory.
+acpaths = "-I ./m4"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch b/import-layers/yocto-poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 000000000..0b3c6f555
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: wget-1.16.3/lib/Makefile.am
+===================================================================
+--- wget-1.16.3.orig/lib/Makefile.am
++++ wget-1.16.3/lib/Makefile.am
+@@ -846,7 +846,7 @@ install-exec-localcharset: all-local
+ case '$(host_os)' in \
+ darwin[56]*) \
+ need_charset_alias=true ;; \
+- darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ need_charset_alias=false ;; \
+ *) \
+ need_charset_alias=true ;; \
diff --git a/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.17.1.bb b/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.17.1.bb
new file mode 100644
index 000000000..dca5d1f71
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/wget/wget_1.17.1.bb
@@ -0,0 +1,8 @@
+SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
+ file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ "
+
+SRC_URI[md5sum] = "a6a908c9ae0e6a4194c628974cc3f05a"
+SRC_URI[sha256sum] = "029fbb93bdc1c0c5a7507b6076a6ec2f8d34204a85aa87e5b2f61a9405b290f5"
+
+require wget.inc
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch
new file mode 100644
index 000000000..495cdc6cf
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/automake-foreign.patch
@@ -0,0 +1,28 @@
+Subject: [PATCH] automake foreign strictness
+
+Use foreign strictness to avoid automake errors.
+
+Upstream-Status: Inappropriate [upstream no longer active]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b30b6f5..bd3222c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,6 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+-AC_INIT(which.c)
+-AM_INIT_AUTOMAKE(which, 2.18)
++AC_INIT([which],[2.18])
++AC_CONFIG_SRCDIR(which.c)
++AM_INIT_AUTOMAKE([foreign])
+ AM_CONFIG_HEADER(config.h)
+ AM_MAINTAINER_MODE
+
+--
+1.7.1
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
new file mode 100644
index 000000000..fb9b1a408
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
@@ -0,0 +1,53 @@
+Upstream-Status: Inappropriate [this is 2.18(GPLv2) specific]
+
+# glibc also implements the function group_member. To avoid name conflict,
+# here let us append a "_" to which's version.
+#
+# Signed-off-by Dexuan Cui <dexuan.cui@intel.com>, 2010-08-20
+# (this patch is licensed under GPLv2)
+
+--- which-2.18/bash.c
++++ which-2.18/bash.c
+@@ -45,7 +45,12 @@
+ * - changed all occurences of 'gid_t' into 'GID_T'.
+ * - exported functions needed in which.c
+ */
+-static int group_member (GID_T gid);
++
++/*
++ * glibc also implements the function group_member. To avoid name conflict,
++ * here let us append a "_" to which's version.
++ */
++static int _group_member (GID_T gid);
+ static char* extract_colon_unit (char const* string, int *p_index);
+
+ /*===========================================================================
+@@ -200,8 +205,8 @@
+
+ /* From bash-2.05b / general.c / line 805 */
+ /* Return non-zero if GID is one that we have in our groups list. */
+-int
+-group_member (GID_T gid)
++static int
++_group_member (GID_T gid)
+ {
+ #if defined (HAVE_GETGROUPS)
+ register int i;
+@@ -290,7 +295,7 @@
+ return (X_BIT (u_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
+
+ /* Otherwise, if we are in the owning group, the group permissions apply. */
+- if (group_member (finfo.st_gid))
++ if (_group_member (finfo.st_gid))
+ return (X_BIT (g_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
+
+ /* Otherwise, if we are in the other group, the other permissions apply. */
+@@ -331,7 +336,7 @@
+ /* Given a string containing units of information separated by colons,
+ return the next one pointed to by (P_INDEX), or NULL if there are no more.
+ Advance (P_INDEX) to the character after the colon. */
+-char*
++static char*
+ extract_colon_unit (char const* string, int* p_index)
+ {
+ int i, start, len;
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which-2.21/automake.patch b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.21/automake.patch
new file mode 100644
index 000000000..4d0f2e4d7
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which-2.21/automake.patch
@@ -0,0 +1,19 @@
+Update autoconf prologue to use "foreign" strictness.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index d974461..a20dfa8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,7 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+ AC_INIT([which], [2.21])
+ AC_CONFIG_SRCDIR(which.c)
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+ AM_CONFIG_HEADER(config.h)
+ AM_MAINTAINER_MODE
+
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb
new file mode 100644
index 000000000..eb6cc9967
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.18.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Displays the full path of shell commands"
+DESCRIPTION = "Which is a utility that prints out the full path of the \
+executables that bash(1) would execute when the passed \
+program names would have been entered on the shell prompt. \
+It does this by using the exact same algorithm as bash."
+SECTION = "libs"
+HOMEPAGE = "http://carlo17.home.xs4all.nl/which/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+PR = "r2"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/which/which-2.18.tar.gz/42d51938e48b91f6e19fabf216f5c3e9/which-${PV}.tar.gz \
+ file://fix_name_conflict_group_member.patch \
+ file://automake-foreign.patch \
+"
+
+SRC_URI[md5sum] = "42d51938e48b91f6e19fabf216f5c3e9"
+SRC_URI[sha256sum] = "9445cd7e02ec0c26a44fd56098464ded064ba5d93dd2e15ec12410ba56b2e544"
+
+DEPENDS = "cwautomacros-native"
+
+inherit autotools texinfo update-alternatives
+
+do_configure_prepend() {
+ OLD="@ACLOCAL_CWFLAGS@"
+ NEW="-I ${STAGING_DIR_NATIVE}/${datadir}/cwautomacros/m4"
+ sed -i "s#${OLD}#${NEW}#g" `grep -rl ${OLD} ${S}`
+}
+
+ALTERNATIVE_${PN} = "which"
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb
new file mode 100644
index 000000000..a7687f6fe
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/which/which_2.21.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Displays the full path of shell commands"
+DESCRIPTION = "Which is a utility that prints out the full path of the \
+executables that bash(1) would execute when the passed \
+program names would have been entered on the shell prompt. \
+It does this by using the exact same algorithm as bash."
+SECTION = "libs"
+HOMEPAGE = "http://carlo17.home.xs4all.nl/which/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+ file://which.c;beginline=1;endline=17;md5=a9963693af2272e7a8df6f231164e7a2"
+DEPENDS = "cwautomacros-native"
+
+inherit autotools texinfo update-alternatives
+
+PR = "r3"
+
+EXTRA_OECONF = "--disable-iberty"
+
+SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \
+ file://automake.patch \
+ "
+
+SRC_URI[md5sum] = "097ff1a324ae02e0a3b0369f07a7544a"
+SRC_URI[sha256sum] = "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad"
+
+do_configure_prepend() {
+ sed -i -e 's%@ACLOCAL_CWFLAGS@%-I ${STAGING_DIR_NATIVE}/usr/share/cwautomacros/m4%g' ${S}/Makefile.am ${S}/tilde/Makefile.am
+}
+
+ALTERNATIVE_${PN} = "which"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch b/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch
new file mode 100644
index 000000000..14160bf8d
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Don-t-build-the-in-script-manual.patch
@@ -0,0 +1,30 @@
+From 33f42aa8d190b40be18cd0541b5881d46978b572 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 17 Dec 2015 11:50:05 +0200
+Subject: [PATCH] Don't build the in-script manual
+
+Building the contents for "--manual" option requires a web browser
+or java (these are the two options for "xmlto txt" support).
+That's bonkers so don't do it: the man pages are still available
+and contain the same info.
+
+Upstream-Status: Inappropriate [disables in-script docs]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ scripts/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/Makefile.in b/scripts/Makefile.in
+index 430032d..85359bc 100644
+--- a/scripts/Makefile.in
++++ b/scripts/Makefile.in
+@@ -112,5 +112,5 @@ html/%.html: desc/%.xml
+ (cd html;$(XMLTO) html-nochunks ../$<)
+
+ %.txt: desc/%.xml
+- $(XMLTO) txt $<
++ echo "Please see the man pages." > $@
+
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch b/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch
new file mode 100644
index 000000000..e9defadea
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch
@@ -0,0 +1,29 @@
+From 37e227ae1766568d8de55e268bb69bc15eee3529 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 26 Nov 2015 16:01:47 +0200
+Subject: [PATCH] Enable xdg-terminal
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ scripts/Makefile.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/scripts/Makefile.in b/scripts/Makefile.in
+index d167393..430032d 100644
+--- a/scripts/Makefile.in
++++ b/scripts/Makefile.in
+@@ -20,7 +20,8 @@ SCRIPTS = \
+ xdg-open \
+ xdg-email \
+ xdg-screensaver \
+- xdg-settings
++ xdg-settings \
++ xdg-terminal
+ # xdg-su
+ # xdg-copy \
+ # xdg-file-dialog
+--
+2.1.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.1.bb b/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.1.bb
new file mode 100644
index 000000000..c1472cf97
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xdg-utils/xdg-utils_1.1.1.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Basic desktop integration functions"
+
+DESCRIPTION = "The xdg-utils package is a set of simple scripts that provide basic \
+desktop integration functions for any Free Desktop, such as Linux. \
+They are intended to provide a set of defacto standards. \
+The following scripts are provided at this time: \
+xdg-desktop-icon \
+xdg-desktop-menu \
+xdg-email \
+xdg-icon-resource \
+xdg-mime \
+xdg-open \
+xdg-screensaver \
+xdg-terminal \
+"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a5367a90934098d6b05af3b746405014"
+
+SRC_URI = "http://portland.freedesktop.org/download/${BPN}-${PV}.tar.gz \
+ file://0001-Reinstate-xdg-terminal.patch \
+ file://0001-Don-t-build-the-in-script-manual.patch \
+ "
+
+SRC_URI[md5sum] = "2d0aec6037769a5f138ff404b1bb4b15"
+SRC_URI[sha256sum] = "b0dd63a2576e0bb16f1aa78d6ddf7d6784784a098d4df17161cd6a17c7bc4125"
+
+UPSTREAM_CHECK_REGEX = "xdg-utils-(?P<pver>((\d+[\.\-_]*)+)((rc|alpha|beta)\d+)?)\.(tar\.gz|tgz)"
+
+inherit autotools-brokensep distro_features_check
+
+# The xprop requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+DEPENDS = "xmlto-native libxslt-native"
+RDEPENDS_${PN} += "xprop"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch
new file mode 100644
index 000000000..3c1b2f6f0
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch
@@ -0,0 +1,100 @@
+From e8b0ffc7ea04cc71dba97a38e1a134aaf2285c2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Dec 2015 07:14:50 +0000
+Subject: [PATCH] configure: Use HAVE_SYS_RESOURCE_H to guard sys/resource.h
+ inclusion
+
+HAVE_RLIM_T check will not let sys/resource.h to be checked and
+rlim_t is defined in sys/resource.h so the check would fail.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ aclocal.m4 | 2 +-
+ configure | 14 +++++++-------
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 6e6f32c..70e7076 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -11,7 +11,7 @@ AC_CACHE_VAL(xinetd_cv_type_$1,
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+diff --git a/configure b/configure
+index b507d38..bec56ea 100755
+--- a/configure
++++ b/configure
+@@ -7640,7 +7640,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7686,7 +7686,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7732,7 +7732,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7778,7 +7778,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7824,7 +7824,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7870,7 +7870,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+@@ -7916,7 +7916,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #if HAVE_NETDB_H
+ #include <netdb.h>
+ #endif
+-#if HAVE_RLIM_T
++#if HAVE_SYS_RESOURCE_H
+ #include <sys/resource.h>
+ #endif
+ #if HAVE_STDINT_H
+--
+2.6.4
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch
new file mode 100644
index 000000000..cd6e6c107
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch
@@ -0,0 +1,86 @@
+Upstream-Status: Pending [from other distro Debian]
+
+From d588b6530e1382a624898b3f4307f636c72c80a9 Mon Sep 17 00:00:00 2001
+From: Pierre Habouzit <madcoder@debian.org>
+Date: Wed, 28 Nov 2007 10:13:08 +0100
+Subject: [PATCH] Disable services from inetd.conf if a service with the same id exists.
+
+ This way, if a service is enabled in /etc/xinetd* _and_ in
+/etc/inetd.conf, the one (even if disabled) from /etc/xinetd* takes
+precedence.
+
+Signed-off-by: Pierre Habouzit <madcoder@debian.org>
+---
+ xinetd/inet.c | 22 +++++++++++++++++++---
+ 1 files changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/xinetd/inet.c b/xinetd/inet.c
+index 1cb2ba2..8caab45 100644
+--- a/xinetd/inet.c
++++ b/xinetd/inet.c
+@@ -23,6 +23,8 @@
+ #include "parsesup.h"
+ #include "nvlists.h"
+
++static psi_h iter ;
++
+ static int get_next_inet_entry( int fd, pset_h sconfs,
+ struct service_config *defaults);
+
+@@ -32,12 +34,15 @@ void parse_inet_conf_file( int fd, struct configuration *confp )
+ struct service_config *default_config = CNF_DEFAULTS( confp );
+
+ line_count = 0;
++ iter = psi_create (sconfs);
+
+ for( ;; )
+ {
+ if (get_next_inet_entry(fd, sconfs, default_config) == -2)
+ break;
+ }
++
++ psi_destroy(iter);
+ }
+
+ static int get_next_inet_entry( int fd, pset_h sconfs,
+@@ -46,7 +51,7 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+ char *p;
+ str_h strp;
+ char *line = next_line(fd);
+- struct service_config *scp;
++ struct service_config *scp, *tmp;
+ unsigned u, i;
+ const char *func = "get_next_inet_entry";
+ char *name = NULL, *rpcvers = NULL, *rpcproto = NULL;
+@@ -405,7 +410,16 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+ SC_SPECIFY( scp, A_SOCKET_TYPE );
+ SC_SPECIFY( scp, A_WAIT );
+
+- if( ! pset_add(sconfs, scp) )
++ for ( tmp = SCP( psi_start( iter ) ) ; tmp ; tmp = SCP( psi_next(iter)) ){
++ if (EQ(SC_ID(scp), SC_ID(tmp))) {
++ parsemsg(LOG_DEBUG, func, "removing duplicate service %s", SC_NAME(scp));
++ sc_free(scp);
++ scp = NULL;
++ break;
++ }
++ }
++
++ if( scp && ! pset_add(sconfs, scp) )
+ {
+ out_of_memory( func );
+ pset_destroy(args);
+@@ -414,7 +428,9 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+ }
+
+ pset_destroy(args);
+- parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp));
++ if (scp) {
++ parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp));
++ }
+ return 0;
+ }
+
+--
+1.5.3.6.2040.g15e6
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch
new file mode 100644
index 000000000..8e59cdcaa
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch
@@ -0,0 +1,79 @@
+Upstream-Status: Pending [from other distro Debian]
+
+From a3410b0bc81ab03a889d9ffc14e351badf8372f1 Mon Sep 17 00:00:00 2001
+From: Pierre Habouzit <madcoder@debian.org>
+Date: Mon, 26 Nov 2007 16:02:04 +0100
+Subject: [PATCH] Various fixes from the previous maintainer.
+
+---
+ xinetd/child.c | 20 +++++++++++++++++---
+ xinetd/service.c | 8 ++++----
+ 2 files changed, 21 insertions(+), 7 deletions(-)
+
+diff --git a/xinetd/child.c b/xinetd/child.c
+index 89ee54c..48e9615 100644
+--- a/xinetd/child.c
++++ b/xinetd/child.c
+@@ -284,6 +284,7 @@ void child_process( struct server *serp )
+ connection_s *cp = SERVER_CONNECTION( serp ) ;
+ struct service_config *scp = SVC_CONF( sp ) ;
+ const char *func = "child_process" ;
++ int fd, null_fd;
+
+ signal_default_state();
+
+@@ -296,9 +297,22 @@ void child_process( struct server *serp )
+ signals_pending[0] = -1;
+ signals_pending[1] = -1;
+
+- Sclose(0);
+- Sclose(1);
+- Sclose(2);
++ if ( ( null_fd = open( "/dev/null", O_RDONLY ) ) == -1 )
++ {
++ msg( LOG_ERR, func, "open('/dev/null') failed: %m") ;
++ _exit( 1 ) ;
++ }
++
++ for ( fd = 0 ; fd <= MAX_PASS_FD ; fd++ )
++ {
++ if ( fd != null_fd && dup2( null_fd, fd ) == -1 )
++ {
++ msg( LOG_ERR, func, "dup2(%d, %d) failed: %m") ;
++ _exit( 1 ) ;
++ }
++ }
++ if ( null_fd > MAX_PASS_FD )
++ (void) Sclose( null_fd ) ;
+
+
+ #ifdef DEBUG_SERVER
+diff --git a/xinetd/service.c b/xinetd/service.c
+index 3d68d78..0132d6c 100644
+--- a/xinetd/service.c
++++ b/xinetd/service.c
+@@ -745,8 +745,8 @@ static status_e failed_service(struct service *sp,
+ return FAILED;
+
+ if ( last == NULL ) {
+- last = SAIN( calloc( 1, sizeof(union xsockaddr) ) );
+- SVC_LAST_DGRAM_ADDR(sp) = (union xsockaddr *)last;
++ SVC_LAST_DGRAM_ADDR(sp) = SAIN( calloc( 1, sizeof(union xsockaddr) ) );
++ last = SAIN( SVC_LAST_DGRAM_ADDR(sp) );
+ }
+
+ (void) time( &current_time ) ;
+@@ -772,8 +772,8 @@ static status_e failed_service(struct service *sp,
+ return FAILED;
+
+ if( last == NULL ) {
+- last = SAIN6(calloc( 1, sizeof(union xsockaddr) ) );
+- SVC_LAST_DGRAM_ADDR( sp ) = (union xsockaddr *)last;
++ SVC_LAST_DGRAM_ADDR(sp) = SAIN6(calloc( 1, sizeof(union xsockaddr) ) );
++ last = SAIN6(SVC_LAST_DGRAM_ADDR(sp));
+ }
+
+ (void) time( &current_time ) ;
+--
+1.5.3.6.2040.g15e6
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch
new file mode 100644
index 000000000..c44c5a113
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch
@@ -0,0 +1,33 @@
+xinetd: CVE-2013-4342
+
+xinetd does not enforce the user and group configuration directives
+for TCPMUX services, which causes these services to be run as root
+and makes it easier for remote attackers to gain privileges by
+leveraging another vulnerability in a service.
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4342
+
+the patch come from:
+https://bugzilla.redhat.com/attachment.cgi?id=799732&action=diff
+
+CVE: CVE-2013-4342
+Signed-off-by: Li Wang <li.wang@windriver.com>
+---
+ xinetd/builtins.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xinetd/builtins.c b/xinetd/builtins.c
+index 3b85579..34a5bac 100644
+--- a/xinetd/builtins.c
++++ b/xinetd/builtins.c
+@@ -617,7 +617,7 @@ static void tcpmux_handler( const struct server *serp )
+ if( SC_IS_INTERNAL( scp ) ) {
+ SC_INTERNAL(scp, nserp);
+ } else {
+- exec_server(nserp);
++ child_process(nserp);
+ }
+ }
+
+--
+1.7.9.5
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch
new file mode 100644
index 000000000..2365ca123
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch
@@ -0,0 +1,112 @@
+Upstream-Status: Pending [from other distro Debian]
+
+From f44b218ccc779ab3f4aed072390ccf129d94b58d Mon Sep 17 00:00:00 2001
+From: David Madore <david@pleiades.stars>
+Date: Mon, 24 Mar 2008 12:45:36 +0100
+Subject: [PATCH] xinetd should be able to listen on IPv6 even in -inetd_compat mode
+
+xinetd does not bind to IPv6 addresses (and does not seem to have an
+option to do so) when used in -inetd_compat mode. As current inetd's
+are IPv6-aware, this is a problem: this means xinetd cannot be used as
+a drop-in inetd replacement.
+
+The attached patch is a suggestion: it adds a -inetd_ipv6 global
+option that, if used, causes inetd-compatibility lines to have an
+implicit "IPv6" option. Perhaps this is not the best solution, but
+there should definitely be a way to get inetd.conf to be read in
+IPv6-aware mode.
+---
+ xinetd/confparse.c | 1 +
+ xinetd/inet.c | 17 +++++++++++++++++
+ xinetd/options.c | 3 +++
+ xinetd/xinetd.man | 6 ++++++
+ 4 files changed, 27 insertions(+), 0 deletions(-)
+
+diff --git a/xinetd/confparse.c b/xinetd/confparse.c
+index db9f431..d7b0bcc 100644
+--- a/xinetd/confparse.c
++++ b/xinetd/confparse.c
+@@ -40,6 +40,7 @@
+ #include "inet.h"
+ #include "main.h"
+
++extern int inetd_ipv6;
+ extern int inetd_compat;
+
+ /*
+diff --git a/xinetd/inet.c b/xinetd/inet.c
+index 8caab45..2e617ae 100644
+--- a/xinetd/inet.c
++++ b/xinetd/inet.c
+@@ -25,6 +25,8 @@
+
+ static psi_h iter ;
+
++extern int inetd_ipv6;
++
+ static int get_next_inet_entry( int fd, pset_h sconfs,
+ struct service_config *defaults);
+
+@@ -360,6 +362,21 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+ }
+ SC_SERVER_ARGV(scp)[u] = p;
+ }
++
++ /* Set the IPv6 flag if we were passed the -inetd_ipv6 option */
++ if ( inetd_ipv6 )
++ {
++ nvp = nv_find_value( service_flags, "IPv6" );
++ if ( nvp == NULL )
++ {
++ parsemsg( LOG_WARNING, func, "inetd.conf - Bad foo %s", name ) ;
++ pset_destroy(args);
++ sc_free(scp);
++ return -1;
++ }
++ M_SET(SC_XFLAGS(scp), nvp->value);
++ }
++
+ /* Set the reuse flag, as this is the default for inetd */
+ nvp = nv_find_value( service_flags, "REUSE" );
+ if ( nvp == NULL )
+diff --git a/xinetd/options.c b/xinetd/options.c
+index b058b6a..dc2f3a0 100644
+--- a/xinetd/options.c
++++ b/xinetd/options.c
+@@ -30,6 +30,7 @@ int logprocs_option ;
+ unsigned logprocs_option_arg ;
+ int stayalive_option=0;
+ char *program_name ;
++int inetd_ipv6 = 0 ;
+ int inetd_compat = 0 ;
+ int dont_fork = 0;
+
+@@ -128,6 +129,8 @@ int opt_recognize( int argc, char *argv[] )
+ fprintf(stderr, "\n");
+ exit(0);
+ }
++ else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_ipv6" ) == 0 )
++ inetd_ipv6 = 1;
+ else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_compat" ) == 0 )
+ inetd_compat = 1;
+ }
+diff --git a/xinetd/xinetd.man b/xinetd/xinetd.man
+index c76c3c6..c9dd803 100644
+--- a/xinetd/xinetd.man
++++ b/xinetd/xinetd.man
+@@ -106,6 +106,12 @@ This option causes xinetd to read /etc/inetd.conf in addition to the
+ standard xinetd config files. /etc/inetd.conf is read after the
+ standard xinetd config files.
+ .TP
++.BI \-inetd_ipv6
++This option causes xinetd to bind to IPv6 (AF_INET6) addresses for
++inetd compatibility lines (see previous option). This only affects
++how /etc/inetd.conf is interpreted and thus only has any effect if
++the \-inetd_compat option is also used.
++.TP
+ .BI \-cc " interval"
+ This option instructs
+ .B xinetd
+--
+1.5.5.rc0.127.gb4337
+
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf
new file mode 100644
index 000000000..9e6ea2577
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.conf
@@ -0,0 +1,11 @@
+# Simple configuration file for xinetd
+#
+# Some defaults, and include /etc/xinetd.d/
+
+defaults
+{
+
+
+}
+
+includedir /etc/xinetd.d
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.default b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.default
new file mode 100644
index 000000000..20a38e3f3
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.default
@@ -0,0 +1,12 @@
+# Default settings for xinetd. This file is sourced by /bin/sh from
+# /etc/init.d/xinetd
+
+# enable xinetd Inetd compat mode
+INETD_COMPAT=Yes
+
+# Options to pass to xinetd
+#
+# -stayalive comes by default : it can be removed if xinetd is expected
+# not to start when no service is configured
+#
+XINETD_OPTS="-stayalive"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.init b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.init
new file mode 100644
index 000000000..777c2c8b4
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.init
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# /etc/init.d/xinetd -- script to start and stop xinetd.
+
+# Source function library.
+. /etc/init.d/functions
+
+if test -f /etc/default/xinetd; then
+ . /etc/default/xinetd
+fi
+
+
+test -x /usr/sbin/xinetd || exit 0
+
+checkportmap () {
+ if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then
+ if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then
+ echo
+ echo "WARNING: portmapper inactive - RPC services unavailable!"
+ echo " Commenting out or removing the RPC services from"
+ echo " the /etc/xinetd.conf file will remove this message."
+ echo
+ fi
+ fi
+}
+
+case "$1" in
+ start)
+ checkportmap
+ echo -n "Starting internet superserver: xinetd"
+ start-stop-daemon --start --quiet --background --exec /usr/sbin/xinetd -- -pidfile /var/run/xinetd.pid $XINETD_OPTS
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping internet superserver: xinetd"
+ start-stop-daemon --stop --signal 3 --quiet --exec /usr/sbin/xinetd
+ echo "."
+ ;;
+ status)
+ status /usr/sbin/xinetd;
+ exit $?
+ ;;
+ reload)
+ echo -n "Reloading internet superserver configuration: xinetd"
+ start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
+ echo "."
+ ;;
+ force-reload)
+ echo "$0 force-reload: Force Reload is deprecated"
+ echo -n "Forcefully reloading internet superserver configuration: xinetd"
+ start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
+ echo "."
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/xinetd {start|stop|status|reload|force-reload|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.service b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.service
new file mode 100644
index 000000000..d5fdc5bc2
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd/xinetd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Xinetd A Powerful Replacement For Inetd
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/xinetd.pid
+EnvironmentFile=-/etc/sysconfig/xinetd
+ExecStart=@SBINDIR@/xinetd -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS"
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
new file mode 100644
index 000000000..6bfaabe82
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
@@ -0,0 +1,77 @@
+SUMMARY = "Socket-based service activation daemon"
+HOMEPAGE = "https://github.com/xinetd-org/xinetd"
+
+# xinetd is a BSD-like license
+# Apple and Gentoo say BSD here.
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8ad8615198542444f84d28a6cf226dd8"
+
+DEPENDS = ""
+DEPENDS_append_libc-musl = " libtirpc "
+PR = "r2"
+
+# Blacklist a bogus tag in upstream check
+UPSTREAM_CHECK_GITTAGREGEX = "xinetd-(?P<pver>(?!20030122).+)"
+
+SRC_URI = "git://github.com/xinetd-org/xinetd.git;protocol=https \
+ file://xinetd.init \
+ file://xinetd.conf \
+ file://xinetd.default \
+ file://Various-fixes-from-the-previous-maintainer.patch \
+ file://Disable-services-from-inetd.conf-if-a-service-with-t.patch \
+ file://xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch \
+ file://xinetd-CVE-2013-4342.patch \
+ file://0001-configure-Use-HAVE_SYS_RESOURCE_H-to-guard-sys-resou.patch \
+ file://xinetd.service \
+ "
+
+SRCREV = "68bb9ab9e9f214ad8a2322f28ac1d6733e70bc24"
+
+S = "${WORKDIR}/git"
+
+inherit autotools update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "xinetd.service"
+
+INITSCRIPT_NAME = "xinetd"
+INITSCRIPT_PARAMS = "defaults"
+
+EXTRA_OECONF="--disable-nls"
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--with-libwrap,,tcp-wrappers"
+
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc "
+LDFLAGS_append_libc-musl = " -ltirpc "
+
+do_configure() {
+ # Looks like configure.in is broken, so we are skipping
+ # rebuilding configure and are just using the shipped one
+ ( cd ${S}; gnu-configize --force )
+ oe_runconf
+}
+
+do_install() {
+ # Same here, the Makefile does some really stupid things,
+ # but since we only want two files why not override
+ # do_install from autotools and doing it ourselfs?
+ install -d "${D}${sbindir}"
+ install -d "${D}${sysconfdir}/init.d"
+ install -d "${D}${sysconfdir}/xinetd.d"
+ install -d "${D}${sysconfdir}/default"
+ install -m 644 "${WORKDIR}/xinetd.conf" "${D}${sysconfdir}"
+ install -m 755 "${WORKDIR}/xinetd.init" "${D}${sysconfdir}/init.d/xinetd"
+ install -m 644 "${WORKDIR}/xinetd.default" "${D}${sysconfdir}/default/xinetd"
+ install -m 755 "${B}/xinetd/xinetd" "${D}${sbindir}"
+ install -m 755 "${B}/xinetd/itox" "${D}${sbindir}"
+ install -m 664 ${S}/contrib/xinetd.d/* ${D}${sysconfdir}/xinetd.d
+
+ # Install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/xinetd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/xinetd.service
+}
+
+CONFFILES_${PN} = "${sysconfdir}/xinetd.conf"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb b/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb
new file mode 100644
index 000000000..d118f3a74
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/xz/xz_5.2.2.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utilities for managing LZMA compressed files"
+HOMEPAGE = "http://tukaani.org/xz/"
+SECTION = "base"
+
+# The source includes bits of PD, GPLv2, GPLv3, LGPLv2.1+, but the only file
+# which is GPLv3 is an m4 macro which isn't shipped in any of our packages,
+# and the LGPL bits are under lib/, which appears to be used for libgnu, which
+# appears to be used for DOS builds. So we're left with GPLv2+ and PD.
+LICENSE = "GPLv2+ & GPL-3.0-with-autoconf-exception & LGPLv2.1+ & PD"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_${PN}-dev = "GPLv2+"
+LICENSE_${PN}-staticdev = "GPLv2+"
+LICENSE_${PN}-doc = "GPLv2+"
+LICENSE_${PN}-dbg = "GPLv2+"
+LICENSE_${PN}-locale = "GPLv2+"
+LICENSE_liblzma = "PD"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c475b6c7dca236740ace4bba553e8e1c \
+ file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \
+ file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 "
+
+SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.gz"
+SRC_URI[md5sum] = "7cf6a8544a7dae8e8106fdf7addfa28c"
+SRC_URI[sha256sum] = "73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2"
+
+inherit autotools gettext
+
+PACKAGES =+ "liblzma"
+
+FILES_liblzma = "${libdir}/liblzma*${SOLIBS}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/zip/zip.inc b/import-layers/yocto-poky/meta/recipes-extended/zip/zip.inc
new file mode 100644
index 000000000..6221c5e13
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/zip/zip.inc
@@ -0,0 +1,26 @@
+SUMMARY = "Compressor/archiver for creating and modifying .zip files"
+HOMEPAGE = "http://www.info-zip.org"
+SECTION = "console/utils"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=04d43c5d70b496c032308106e26ae17d"
+
+SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'BIND=${CC}' 'AS=${CC} -c' 'CPP=${CPP}' \
+ 'CFLAGS=-I. -DUNIX ${CFLAGS}' 'INSTALL=install' \
+ 'BINFLAGS=0755' 'INSTALL_D=install -d'"
+
+do_compile() {
+ oe_runmake -f unix/Makefile flags IZ_BZIP2=no_such_directory
+ sed -i 's#LFLAGS1=""#LFLAGS1="${LDFLAGS}"#' flags
+ oe_runmake -f unix/Makefile generic IZ_BZIP2=no_such_directory
+}
+
+do_install() {
+ oe_runmake -f unix/Makefile prefix=${D}${prefix} \
+ BINDIR=${D}${bindir} MANDIR=${D}${mandir}/man1 \
+ install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/yocto-poky/meta/recipes-extended/zip/zip_3.0.bb b/import-layers/yocto-poky/meta/recipes-extended/zip/zip_3.0.bb
new file mode 100644
index 000000000..383da4b89
--- /dev/null
+++ b/import-layers/yocto-poky/meta/recipes-extended/zip/zip_3.0.bb
@@ -0,0 +1,18 @@
+require zip.inc
+
+PR="r2"
+
+# zip-2.32 still uses directory name of zip-2.30
+S = "${WORKDIR}/zip30"
+
+SRC_URI[md5sum] = "7b74551e63f8ee6aab6fbc86676c0d37"
+SRC_URI[sha256sum] = "f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369"
+
+# exclude version 2.3.2 which triggers a false positive
+UPSTREAM_CHECK_REGEX = "^zip(?P<pver>(?!232).+)\.tgz"
+
+# zip.inc sets CFLAGS, but what Makefile actually uses is
+# CFLAGS_NOOPT. It will also force -O3 optimization, overriding
+# whatever we set.
+#
+EXTRA_OEMAKE_append = " 'CFLAGS_NOOPT=-I. -DUNIX ${CFLAGS}'"
OpenPOWER on IntegriCloud