summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/recipes-core
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/recipes-core')
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/filesystems8
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/fstab11
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/host.conf2
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/issue0
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/issue.net0
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/licenses/GPL-2340
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/motd0
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/nsswitch.conf19
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/profile32
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/rotation1
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/share/dot.bashrc16
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/share/dot.profile11
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/shells2
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files/usbd0
-rw-r--r--external/poky/meta/recipes-core/base-files/base-files_3.0.14.bb181
-rw-r--r--external/poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch19
-rw-r--r--external/poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch24
-rw-r--r--external/poky/meta/recipes-core/base-passwd/base-passwd/input.patch22
-rw-r--r--external/poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch15
-rw-r--r--external/poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch14
-rw-r--r--external/poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb115
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox-inittab_1.29.3.bb32
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox.inc458
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch114
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/CVE-2018-20679.patch142
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/CVE-2019-5747.patch60
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch71
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch143
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/defconfig1177
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch32
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/getopts.cfg3
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/init.cfg8
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/login-utilities.cfg13
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/makefile-libbb-race.patch34
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/mdev.cfg11
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg9
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/musl.cfg11
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch21
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/resize.cfg2
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/sha1sum.cfg1
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/sha256sum.cfg1
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox/syslog.cfg11
-rw-r--r--external/poky/meta/recipes-core/busybox/busybox_1.29.3.bb50
-rwxr-xr-xexternal/poky/meta/recipes-core/busybox/files/busybox-cron39
-rwxr-xr-xexternal/poky/meta/recipes-core/busybox/files/busybox-httpd44
-rw-r--r--external/poky/meta/recipes-core/busybox/files/busybox-klogd.service.in8
-rw-r--r--external/poky/meta/recipes-core/busybox/files/busybox-syslog.default25
-rw-r--r--external/poky/meta/recipes-core/busybox/files/busybox-syslog.service.in13
-rwxr-xr-xexternal/poky/meta/recipes-core/busybox/files/busybox-udhcpd43
-rw-r--r--external/poky/meta/recipes-core/busybox/files/default.script4
-rw-r--r--external/poky/meta/recipes-core/busybox/files/find-touchscreen.sh6
-rw-r--r--external/poky/meta/recipes-core/busybox/files/hwclock.sh83
-rw-r--r--external/poky/meta/recipes-core/busybox/files/inetd33
-rw-r--r--external/poky/meta/recipes-core/busybox/files/inetd.conf20
-rw-r--r--external/poky/meta/recipes-core/busybox/files/inittab24
-rwxr-xr-xexternal/poky/meta/recipes-core/busybox/files/mdev21
-rw-r--r--external/poky/meta/recipes-core/busybox/files/mdev-mount.sh63
-rw-r--r--external/poky/meta/recipes-core/busybox/files/mdev.conf44
-rwxr-xr-xexternal/poky/meta/recipes-core/busybox/files/mount.busybox3
-rw-r--r--external/poky/meta/recipes-core/busybox/files/rcK26
-rw-r--r--external/poky/meta/recipes-core/busybox/files/rcS27
-rw-r--r--external/poky/meta/recipes-core/busybox/files/run-ptest7
-rw-r--r--external/poky/meta/recipes-core/busybox/files/simple.script88
-rw-r--r--external/poky/meta/recipes-core/busybox/files/syslog77
-rw-r--r--external/poky/meta/recipes-core/busybox/files/syslog-startup.conf13
-rw-r--r--external/poky/meta/recipes-core/busybox/files/syslog.conf1
-rwxr-xr-xexternal/poky/meta/recipes-core/busybox/files/umount.busybox3
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch51
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch57
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch44
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars41
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch17
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch12
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch29
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch56
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch75
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m424
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch19
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch22
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch49
-rw-r--r--external/poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb48
-rw-r--r--external/poky/meta/recipes-core/coreutils/coreutils/0001-local.mk-fix-cross-compiling-problem.patch26
-rw-r--r--external/poky/meta/recipes-core/coreutils/coreutils/0001-uname-report-processor-and-hardware-correctly.patch64
-rw-r--r--external/poky/meta/recipes-core/coreutils/coreutils/disable-ls-output-quoting.patch49
-rw-r--r--external/poky/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch39
-rw-r--r--external/poky/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch31
-rw-r--r--external/poky/meta/recipes-core/coreutils/coreutils_8.30.bb139
-rw-r--r--external/poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb18
-rw-r--r--external/poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch17
-rw-r--r--external/poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch57
-rw-r--r--external/poky/meta/recipes-core/dbus/dbus-glib_0.110.bb39
-rw-r--r--external/poky/meta/recipes-core/dbus/dbus-test_1.12.10.bb83
-rw-r--r--external/poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch104
-rw-r--r--external/poky/meta/recipes-core/dbus/dbus/dbus-1.init123
-rw-r--r--external/poky/meta/recipes-core/dbus/dbus/python-config.patch34
-rwxr-xr-xexternal/poky/meta/recipes-core/dbus/dbus/run-ptest24
-rw-r--r--external/poky/meta/recipes-core/dbus/dbus/tmpdir.patch44
-rw-r--r--external/poky/meta/recipes-core/dbus/dbus_1.12.10.bb176
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear.inc111
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch23
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch42
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch33
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear/CVE-2018-15599.patch236
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear/dropbear4
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear/dropbear.default2
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear/dropbear.socket10
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear/dropbear@.service12
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service13
-rwxr-xr-xexternal/poky/meta/recipes-core/dropbear/dropbear/init79
-rw-r--r--external/poky/meta/recipes-core/dropbear/dropbear_2018.76.bb5
-rw-r--r--external/poky/meta/recipes-core/expat/expat/CVE-2018-20843.patch26
-rw-r--r--external/poky/meta/recipes-core/expat/expat/autotools.patch25
-rw-r--r--external/poky/meta/recipes-core/expat/expat/libtool-tag.patch30
-rw-r--r--external/poky/meta/recipes-core/expat/expat_2.2.6.bb24
-rw-r--r--external/poky/meta/recipes-core/fts/fts.bb22
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/add-with-bisonlocaledir.patch58
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch87
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/parallel.patch23
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/use-pkgconfig.patch321
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch38
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/COPYING4
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/Makefile.in.in483
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/aclocal.tgzbin0 -> 40014 bytes
-rwxr-xr-xexternal/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/config.rpath684
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/remove-potcdate.sin19
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.8.1.bb31
-rw-r--r--external/poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb127
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch39
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch29
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch43
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch46
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-12450.patch59
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-9633_p1.patch316
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-9633_p2.patch231
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch80
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch44
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/date-lt.patch20
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch50
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest6
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch22
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib-2.0_2.58.0.bb25
-rw-r--r--external/poky/meta/recipes-core/glib-2.0/glib.inc170
-rw-r--r--external/poky/meta/recipes-core/glib-networking/glib-networking_2.54.1.bb29
-rw-r--r--external/poky/meta/recipes-core/glibc/cross-localedef-native_2.28.bb51
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-collateral.inc23
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-common.inc10
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-initial.inc57
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-initial_2.28.bb9
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-ld.inc20
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-locale.inc97
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-locale_2.28.bb1
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-mtrace.inc13
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-mtrace_2.28.bb1
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-package.inc232
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-scripts.inc20
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-scripts_2.28.bb1
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc-testing.inc95
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc.inc81
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch65
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch46
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch136
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch31
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch67
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0006-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch1581
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0007-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch29
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0008-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch205
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0009-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch384
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0010-Quote-from-bug-1443-which-explains-what-the-patch-do.patch58
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0011-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch33
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0012-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch58
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch39
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch31
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch260
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch42
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch72
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch616
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch97
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Clear-cache-lines-on-ppc8xx.patch80
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Resolve-__fpscr_values-on-SH4.patch53
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch563
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0023-Define-DUMMY_LOCALE_T-if-not-defined.patch29
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch53
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0025-locale-fix-hard-coded-reference-to-gcc-E.patch35
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch66
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch89
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0030-intl-Emit-no-lines-in-bison-generated-files.patch31
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch258
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch100
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch68
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/0034-inject-file-assembly-directives.patch272
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/CVE-2016-10739.patch232
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/CVE-2018-19591.patch48
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/CVE-2019-9169.patch63
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf1
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc/generate-supported.mk11
-rwxr-xr-xexternal/poky/meta/recipes-core/glibc/glibc/makedbs.sh177
-rw-r--r--external/poky/meta/recipes-core/glibc/glibc_2.28.bb136
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch331
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README8
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch116
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch454
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch47
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch113
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch24
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch37
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2bin0 -> 21491 bytes
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch471
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch36
-rw-r--r--external/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb34
-rw-r--r--external/poky/meta/recipes-core/glibc/site_config/funcs474
-rw-r--r--external/poky/meta/recipes-core/glibc/site_config/headers155
-rw-r--r--external/poky/meta/recipes-core/glibc/site_config/types21
-rw-r--r--external/poky/meta/recipes-core/ifupdown/files/99_network1
-rw-r--r--external/poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch57
-rw-r--r--external/poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch406
-rw-r--r--external/poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb46
-rw-r--r--external/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt75
-rw-r--r--external/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt78
-rw-r--r--external/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx46
-rw-r--r--external/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf8
-rw-r--r--external/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb138
-rw-r--r--external/poky/meta/recipes-core/images/core-image-base.bb8
-rw-r--r--external/poky/meta/recipes-core/images/core-image-minimal-dev.bb7
-rw-r--r--external/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb31
-rw-r--r--external/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb7
-rw-r--r--external/poky/meta/recipes-core/images/core-image-minimal.bb12
-rw-r--r--external/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb43
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright11
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init90
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces31
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot39
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces5
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces5
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces5
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces5
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces8
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces8
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces8
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces8
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces8
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces8
-rw-r--r--external/poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb41
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/files/init-boot.sh10
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh199
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh299
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh220
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/files/init-install.sh343
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/files/init-live.sh239
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb16
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-framework/debug82
-rwxr-xr-xexternal/poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs28
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-framework/exec29
-rwxr-xr-xexternal/poky/meta/recipes-core/initrdscripts/initramfs-framework/finish27
-rwxr-xr-xexternal/poky/meta/recipes-core/initrdscripts/initramfs-framework/init145
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev30
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs48
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-framework/rootfs67
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-framework/setup-live64
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-framework/udev47
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb100
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-live-boot-tiny_1.0.bb21
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb21
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb16
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb25
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb16
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb25
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bb18
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-module-install_1.0.bb23
-rw-r--r--external/poky/meta/recipes-core/initrdscripts/initramfs-module-setup-live_1.0.bb20
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch347
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh13
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh24
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh81
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh50
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh148
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts5
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh28
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh17
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/functions91
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/halt29
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh22
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf9
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh39
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh91
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh273
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh43
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/reboot15
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh20
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh13
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs21
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/single24
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/sushell5
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh31
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs24
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh33
-rwxr-xr-xexternal/poky/meta/recipes-core/initscripts/initscripts-1.0/urandom49
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles37
-rw-r--r--external/poky/meta/recipes-core/initscripts/initscripts_1.0.bb186
-rw-r--r--external/poky/meta/recipes-core/kbd/kbd/run-ptest4
-rw-r--r--external/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch56
-rw-r--r--external/poky/meta/recipes-core/kbd/kbd_2.0.4.bb64
-rw-r--r--external/poky/meta/recipes-core/libcgroup/libcgroup/CVE-2018-14348.patch37
-rw-r--r--external/poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch235
-rw-r--r--external/poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb46
-rw-r--r--external/poky/meta/recipes-core/libxcrypt/libxcrypt_4.1.1.bb27
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/0001-Fix-infinite-loop-in-LZMA-decompression.patch55
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch96
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch65
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/fix-CVE-2018-14404.patch45
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch21
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch22
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch204
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch30
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/run-ptest4
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2/runtest.patch818
-rw-r--r--external/poky/meta/recipes-core/libxml/libxml2_2.9.8.bb113
-rw-r--r--external/poky/meta/recipes-core/meta/build-sysroots.bb38
-rw-r--r--external/poky/meta/recipes-core/meta/buildtools-tarball.bb87
-rw-r--r--external/poky/meta/recipes-core/meta/dummy-sdk-package.inc26
-rw-r--r--external/poky/meta/recipes-core/meta/meta-environment-extsdk.bb12
-rw-r--r--external/poky/meta/recipes-core/meta/meta-environment.bb78
-rw-r--r--external/poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb26
-rw-r--r--external/poky/meta/recipes-core/meta/meta-go-toolchain.bb12
-rw-r--r--external/poky/meta/recipes-core/meta/meta-ide-support.bb15
-rw-r--r--external/poky/meta/recipes-core/meta/meta-toolchain.bb6
-rw-r--r--external/poky/meta/recipes-core/meta/meta-world-pkgdata.bb53
-rw-r--r--external/poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb31
-rw-r--r--external/poky/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb14
-rw-r--r--external/poky/meta/recipes-core/meta/package-index.bb25
-rw-r--r--external/poky/meta/recipes-core/meta/signing-keys.bb83
-rw-r--r--external/poky/meta/recipes-core/meta/target-sdk-provides-dummy.bb52
-rw-r--r--external/poky/meta/recipes-core/meta/testexport-tarball.bb70
-rw-r--r--external/poky/meta/recipes-core/meta/uninative-tarball.bb69
-rw-r--r--external/poky/meta/recipes-core/meta/wic-tools.bb26
-rw-r--r--external/poky/meta/recipes-core/musl/bsd-headers.bb31
-rw-r--r--external/poky/meta/recipes-core/musl/bsd-headers/sys-cdefs.h26
-rw-r--r--external/poky/meta/recipes-core/musl/bsd-headers/sys-queue.h846
-rw-r--r--external/poky/meta/recipes-core/musl/bsd-headers/sys-tree.h761
-rw-r--r--external/poky/meta/recipes-core/musl/libssp-nonshared.bb39
-rw-r--r--external/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c45
-rw-r--r--external/poky/meta/recipes-core/musl/musl-utils.bb27
-rw-r--r--external/poky/meta/recipes-core/musl/musl.inc33
-rw-r--r--external/poky/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch76
-rw-r--r--external/poky/meta/recipes-core/musl/musl_git.bb89
-rw-r--r--external/poky/meta/recipes-core/ncurses/files/0001-tic-hang.patch43
-rw-r--r--external/poky/meta/recipes-core/ncurses/files/0002-configure-reproducible.patch35
-rw-r--r--external/poky/meta/recipes-core/ncurses/files/config.cache4
-rw-r--r--external/poky/meta/recipes-core/ncurses/ncurses.inc319
-rw-r--r--external/poky/meta/recipes-core/ncurses/ncurses_6.1+20180630.bb11
-rw-r--r--external/poky/meta/recipes-core/ncurses/site_config/headers5
-rw-r--r--external/poky/meta/recipes-core/netbase/netbase/hosts8
-rw-r--r--external/poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch48
-rw-r--r--external/poky/meta/recipes-core/netbase/netbase_5.4.bb25
-rw-r--r--external/poky/meta/recipes-core/newlib/libgloss/fix-rs6000-crt0.patch41
-rw-r--r--external/poky/meta/recipes-core/newlib/libgloss/fix_makefile_include_arm_h.patch30
-rw-r--r--external/poky/meta/recipes-core/newlib/libgloss_3.0.0.bb33
-rw-r--r--external/poky/meta/recipes-core/newlib/newlib.inc58
-rw-r--r--external/poky/meta/recipes-core/newlib/newlib_3.0.0.bb19
-rw-r--r--external/poky/meta/recipes-core/os-release/os-release.bb50
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf-shell-image.bb20
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch71
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch46
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/0002-BaseTools-header.makefile-add-Wno-restrict.patch102
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch33
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-header.makefile-revert-gcc-8-Wno-xxx-optio.patch53
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch39
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/0004-BaseTools-GenVtf-silence-false-stringop-overflow-war.patch66
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-enable-long-path-file.patch18
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch1124
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch33
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch20
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks4
-rw-r--r--external/poky/meta/recipes-core/ovmf/ovmf_git.bb252
-rw-r--r--external/poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb35
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-base.bb364
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb50
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb28
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb9
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb20
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb80
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb6
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb6
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb19
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb19
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb76
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb53
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb18
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb12
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb11
-rw-r--r--external/poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb197
-rwxr-xr-xexternal/poky/meta/recipes-core/psplash/files/psplash-init35
-rw-r--r--external/poky/meta/recipes-core/psplash/files/psplash-poky-img.h1259
-rw-r--r--external/poky/meta/recipes-core/psplash/psplash_git.bb123
-rw-r--r--external/poky/meta/recipes-core/readline/files/inputrc61
-rw-r--r--external/poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch35
-rw-r--r--external/poky/meta/recipes-core/readline/readline-7.0/norpath.patch21
-rw-r--r--external/poky/meta/recipes-core/readline/readline.inc45
-rw-r--r--external/poky/meta/recipes-core/readline/readline_7.0.bb7
-rw-r--r--external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch15
-rw-r--r--external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch65
-rw-r--r--external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch23
-rw-r--r--external/poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb33
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd-boot_239.bb70
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd-bootconf_1.00.bb31
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd-compat-units.bb47
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd-conf.bb53
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd-machine-units_1.0.bb13
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd-serialgetty.bb50
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service37
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd-systemctl-native.bb17
-rwxr-xr-xexternal/poky/meta/recipes-core/systemd/systemd-systemctl/systemctl196
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd.inc21
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf7
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch62
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch33
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch36
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch33
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch81
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch219
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-core-when-deserializing-state-always-use-read_line-L.patch250
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch39
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch110
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-meson-rename-Ddebug-to-Ddebug-extra.patch45
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch175
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch31
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0001-timesync-changes-type-of-drift_freq-to-int64_t.patch49
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0002-core-Fix-use-after-free-case-in-load_from_path.patch43
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch183
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch64
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch40
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch43
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch432
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch33
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch70
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch29
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch63
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch118
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch96
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch43
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch29
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch153
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch50
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch43
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch38
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch48
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch45
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch90
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch30
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch28
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch42
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch99
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch34
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch39
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch62
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch34
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch109
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch58
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0024-journald-do-not-store-the-iovec-entry-for-process-co.patch208
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0025-journald-set-a-limit-on-the-number-of-fields.patch139
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch49
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/CVE-2019-6454.patch210
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/init104
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch61
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd/touchscreen.rules18
-rw-r--r--external/poky/meta/recipes-core/systemd/systemd_239.bb666
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch71
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch25
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch83
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch189
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab30
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty43
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb93
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch52
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd1
-rwxr-xr-xexternal/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init98
-rwxr-xr-xexternal/poky/meta/recipes-core/sysvinit/sysvinit/rc182
-rwxr-xr-xexternal/poky/meta/recipes-core/sysvinit/sysvinit/rcS34
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default29
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch78
-rw-r--r--external/poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb110
-rw-r--r--external/poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch28
-rw-r--r--external/poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch364
-rw-r--r--external/poky/meta/recipes-core/udev/eudev/devfs-udev.rules108
-rw-r--r--external/poky/meta/recipes-core/udev/eudev/init93
-rw-r--r--external/poky/meta/recipes-core/udev/eudev/links.conf21
-rw-r--r--external/poky/meta/recipes-core/udev/eudev/local.rules19
-rw-r--r--external/poky/meta/recipes-core/udev/eudev/permissions.rules131
-rw-r--r--external/poky/meta/recipes-core/udev/eudev/run.rules14
-rw-r--r--external/poky/meta/recipes-core/udev/eudev/udev.rules116
-rw-r--r--external/poky/meta/recipes-core/udev/eudev_3.2.7.bb96
-rw-r--r--external/poky/meta/recipes-core/udev/udev-extraconf/automount.rules19
-rw-r--r--external/poky/meta/recipes-core/udev/udev-extraconf/autonet.rules19
-rw-r--r--external/poky/meta/recipes-core/udev/udev-extraconf/localextra.rules23
-rw-r--r--external/poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist5
-rw-r--r--external/poky/meta/recipes-core/udev/udev-extraconf/mount.sh151
-rw-r--r--external/poky/meta/recipes-core/udev/udev-extraconf/network.sh54
-rw-r--r--external/poky/meta/recipes-core/udev/udev-extraconf_1.1.bb45
-rw-r--r--external/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb26
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux.inc357
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch20
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch23
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch25
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/ptest.patch23
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/run-ptest25
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd3
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/runuser.pamd4
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch33
-rw-r--r--external/poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb28
-rw-r--r--external/poky/meta/recipes-core/volatile-binds/files/COPYING.MIT17
-rwxr-xr-xexternal/poky/meta/recipes-core/volatile-binds/files/mount-copybind56
-rw-r--r--external/poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in19
-rw-r--r--external/poky/meta/recipes-core/volatile-binds/volatile-binds.bb80
-rw-r--r--external/poky/meta/recipes-core/zlib/site_config/headers1
-rw-r--r--external/poky/meta/recipes-core/zlib/zlib/ldflags-tests.patch45
-rw-r--r--external/poky/meta/recipes-core/zlib/zlib/run-ptest7
-rw-r--r--external/poky/meta/recipes-core/zlib/zlib_1.2.11.bb52
516 files changed, 42468 insertions, 0 deletions
diff --git a/external/poky/meta/recipes-core/base-files/base-files/filesystems b/external/poky/meta/recipes-core/base-files/base-files/filesystems
new file mode 100644
index 00000000..7e6c41c3
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/filesystems
@@ -0,0 +1,8 @@
+ext4
+ext3
+ext2
+vfat
+fat
+btrfs
+minix
+*
diff --git a/external/poky/meta/recipes-core/base-files/base-files/fstab b/external/poky/meta/recipes-core/base-files/base-files/fstab
new file mode 100644
index 00000000..d79a0160
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/fstab
@@ -0,0 +1,11 @@
+# stock fstab - you probably want to override this with a machine specific one
+
+/dev/root / auto defaults 1 1
+proc /proc proc defaults 0 0
+devpts /dev/pts devpts mode=0620,gid=5 0 0
+tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0
+tmpfs /var/volatile tmpfs defaults 0 0
+
+# uncomment this if your device has a SD/MMC/Transflash slot
+#/dev/mmcblk0p1 /media/card auto defaults,sync,noauto 0 0
+
diff --git a/external/poky/meta/recipes-core/base-files/base-files/host.conf b/external/poky/meta/recipes-core/base-files/base-files/host.conf
new file mode 100644
index 00000000..1a8c1e15
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/host.conf
@@ -0,0 +1,2 @@
+order hosts,bind
+multi on
diff --git a/external/poky/meta/recipes-core/base-files/base-files/issue b/external/poky/meta/recipes-core/base-files/base-files/issue
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/issue
diff --git a/external/poky/meta/recipes-core/base-files/base-files/issue.net b/external/poky/meta/recipes-core/base-files/base-files/issue.net
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/issue.net
diff --git a/external/poky/meta/recipes-core/base-files/base-files/licenses/GPL-2 b/external/poky/meta/recipes-core/base-files/base-files/licenses/GPL-2
new file mode 100644
index 00000000..d60c31a9
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/licenses/GPL-2
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/external/poky/meta/recipes-core/base-files/base-files/motd b/external/poky/meta/recipes-core/base-files/base-files/motd
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/motd
diff --git a/external/poky/meta/recipes-core/base-files/base-files/nsswitch.conf b/external/poky/meta/recipes-core/base-files/base-files/nsswitch.conf
new file mode 100644
index 00000000..06f03d22
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/nsswitch.conf
@@ -0,0 +1,19 @@
+# /etc/nsswitch.conf
+#
+# Example configuration of GNU Name Service Switch functionality.
+# If you have the `glibc-doc' and `info' packages installed, try:
+# `info libc "Name Service Switch"' for information about this file.
+
+passwd: compat
+group: compat
+shadow: compat
+
+hosts: files dns
+networks: files
+
+protocols: db files
+services: db files
+ethers: db files
+rpc: db files
+
+netgroup: nis
diff --git a/external/poky/meta/recipes-core/base-files/base-files/profile b/external/poky/meta/recipes-core/base-files/base-files/profile
new file mode 100644
index 00000000..9e4283e0
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/profile
@@ -0,0 +1,32 @@
+# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
+# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
+
+PATH="/usr/local/bin:/usr/bin:/bin"
+EDITOR="vi" # needed for packages like cron, git-commit
+[ "$TERM" ] || TERM="vt100" # Basic terminal capab. For screen etc.
+
+# Add /sbin & co to $PATH for the root user
+[ "$HOME" != "ROOTHOME" ] || PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
+
+# Set the prompt for bash and ash (no other shells known to be in use here)
+[ -z "$PS1" ] || PS1='\u@\h:\w\$ '
+
+if [ -d /etc/profile.d ]; then
+ for i in /etc/profile.d/*.sh; do
+ if [ -f $i -a -r $i ]; then
+ . $i
+ fi
+ done
+ unset i
+fi
+
+# Make sure we are on a serial console (i.e. the device used starts with
+# /dev/tty[A-z]), otherwise we confuse e.g. the eclipse launcher which tries do
+# use ssh
+case $(tty 2>/dev/null) in
+ /dev/tty[A-z]*) [ -x @BINDIR@/resize ] && @BINDIR@/resize >/dev/null;;
+esac
+
+export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
+
+umask 022
diff --git a/external/poky/meta/recipes-core/base-files/base-files/rotation b/external/poky/meta/recipes-core/base-files/base-files/rotation
new file mode 100644
index 00000000..c2270834
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/rotation
@@ -0,0 +1 @@
+0 \ No newline at end of file
diff --git a/external/poky/meta/recipes-core/base-files/base-files/share/dot.bashrc b/external/poky/meta/recipes-core/base-files/base-files/share/dot.bashrc
new file mode 100644
index 00000000..4be63686
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/share/dot.bashrc
@@ -0,0 +1,16 @@
+# ~/.bashrc: executed by bash(1) for non-login shells.
+
+export PS1='\h:\w\$ '
+umask 022
+
+# You may uncomment the following lines if you want `ls' to be colorized:
+# export LS_OPTIONS='--color=auto'
+# eval `dircolors`
+# alias ls='ls $LS_OPTIONS'
+# alias ll='ls $LS_OPTIONS -l'
+# alias l='ls $LS_OPTIONS -lA'
+#
+# Some more alias to avoid making mistakes:
+# alias rm='rm -i'
+# alias cp='cp -i'
+# alias mv='mv -i'
diff --git a/external/poky/meta/recipes-core/base-files/base-files/share/dot.profile b/external/poky/meta/recipes-core/base-files/base-files/share/dot.profile
new file mode 100644
index 00000000..a8731607
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/share/dot.profile
@@ -0,0 +1,11 @@
+# ~/.profile: executed by Bourne-compatible login shells.
+
+if [ -f ~/.bashrc ]; then
+ . ~/.bashrc
+fi
+
+# path set by /etc/profile
+# export PATH
+
+# Might fail after "su - myuser" when /dev/tty* is not writable by "myuser".
+mesg n 2>/dev/null
diff --git a/external/poky/meta/recipes-core/base-files/base-files/shells b/external/poky/meta/recipes-core/base-files/base-files/shells
new file mode 100644
index 00000000..3f639874
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/shells
@@ -0,0 +1,2 @@
+# /etc/shells: valid login shells
+/bin/sh
diff --git a/external/poky/meta/recipes-core/base-files/base-files/usbd b/external/poky/meta/recipes-core/base-files/base-files/usbd
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files/usbd
diff --git a/external/poky/meta/recipes-core/base-files/base-files_3.0.14.bb b/external/poky/meta/recipes-core/base-files/base-files_3.0.14.bb
new file mode 100644
index 00000000..6e75652f
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -0,0 +1,181 @@
+SUMMARY = "Miscellaneous files for the base system"
+DESCRIPTION = "The base-files package creates the basic system directory structure and provides a small set of key configuration files for the system."
+SECTION = "base"
+PR = "r89"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f"
+# Removed all license related tasks in this recipe as license.bbclass
+# now deals with this. In order to get accurate licensing on to the image:
+# Set COPY_LIC_MANIFEST to just copy just the license.manifest to the image
+# For the manifest and the license text for each package:
+# Set COPY_LIC_MANIFEST and COPY_LIC_DIRS
+
+SRC_URI = "file://rotation \
+ file://nsswitch.conf \
+ file://motd \
+ file://host.conf \
+ file://profile \
+ file://shells \
+ file://fstab \
+ file://filesystems \
+ file://issue.net \
+ file://issue \
+ file://usbd \
+ file://share/dot.bashrc \
+ file://share/dot.profile \
+ file://licenses/GPL-2 \
+ "
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+docdir_append = "/${P}"
+dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
+dirs2775 = ""
+dirs555 = "/sys /proc"
+dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
+ ${sysconfdir} ${sysconfdir}/default \
+ ${sysconfdir}/skel ${nonarch_base_libdir} /mnt ${ROOT_HOME} /run \
+ ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
+ ${libdir} ${sbindir} ${datadir} \
+ ${datadir}/common-licenses ${datadir}/dict ${infodir} \
+ ${mandir} ${datadir}/misc ${localstatedir} \
+ ${localstatedir}/backups ${localstatedir}/lib \
+ ${localstatedir}/lib/misc ${localstatedir}/spool \
+ ${localstatedir}/volatile \
+ ${localstatedir}/${@'volatile/' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''}log \
+ /home ${prefix}/src ${localstatedir}/local \
+ /media"
+
+dirs755-lsb = "/srv \
+ ${prefix}/local ${prefix}/local/bin ${prefix}/local/games \
+ ${prefix}/local/include ${prefix}/local/lib ${prefix}/local/sbin \
+ ${prefix}/local/share ${prefix}/local/src \
+ ${prefix}/lib/locale"
+dirs2775-lsb = "/var/mail"
+
+volatiles = "${@'log' if oe.types.boolean('${VOLATILE_LOG_DIR}') else ''} tmp"
+conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
+ ${sysconfdir}/issue /${sysconfdir}/issue.net \
+ ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
+ ${sysconfdir}/default"
+
+# By default the hostname is the machine name. If the hostname is unset then a
+# /etc/hostname file isn't written, suitable for environments with dynamic
+# hostnames.
+#
+# The hostname can be changed outside of this recipe by using
+# hostname_pn-base-files = "my-host-name".
+hostname = "${MACHINE}"
+
+BASEFILESISSUEINSTALL ?= "do_install_basefilesissue"
+
+# In previous versions of base-files, /run was a softlink to /var/run and the
+# directory was located in /var/volatlie/run. Also, /var/lock was a softlink
+# to /var/volatile/lock which is where the real directory was located. Now,
+# /run and /run/lock are the real directories. If we are upgrading, we may
+# need to remove the symbolic links first before we create the directories.
+# Otherwise the directory creation will fail and we will have circular symbolic
+# links.
+#
+pkg_preinst_${PN} () {
+ #!/bin/sh -e
+ if [ x"$D" = "x" ]; then
+ if [ -h "/var/lock" ]; then
+ # Remove the symbolic link
+ rm -f /var/lock
+ fi
+
+ if [ -h "/run" ]; then
+ # Remove the symbolic link
+ rm -f /run
+ fi
+ fi
+}
+
+do_install () {
+ for d in ${dirs555}; do
+ install -m 0555 -d ${D}$d
+ done
+ for d in ${dirs755}; do
+ install -m 0755 -d ${D}$d
+ done
+ for d in ${dirs1777}; do
+ install -m 1777 -d ${D}$d
+ done
+ for d in ${dirs2775}; do
+ install -m 2775 -d ${D}$d
+ done
+ for d in ${volatiles}; do
+ ln -sf volatile/$d ${D}${localstatedir}/$d
+ done
+
+ ln -snf ../run ${D}${localstatedir}/run
+ ln -snf ../run/lock ${D}${localstatedir}/lock
+
+ ${BASEFILESISSUEINSTALL}
+
+ rotation=`cat ${WORKDIR}/rotation`
+ if [ "$rotation" != "0" ]; then
+ install -m 0644 ${WORKDIR}/rotation ${D}${sysconfdir}/rotation
+ fi
+
+ install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab
+ install -m 0644 ${WORKDIR}/filesystems ${D}${sysconfdir}/filesystems
+ install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
+ install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
+ sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
+ sed -i 's#@BINDIR@#${bindir}#g' ${D}${sysconfdir}/profile
+ install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
+ install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
+ install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc
+ install -m 0644 ${WORKDIR}/nsswitch.conf ${D}${sysconfdir}/nsswitch.conf
+ install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf
+ install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd
+
+ ln -sf /proc/mounts ${D}${sysconfdir}/mtab
+}
+
+DISTRO_VERSION[vardepsexclude] += "DATE"
+do_install_basefilesissue () {
+ if [ "${hostname}" ]; then
+ echo ${hostname} > ${D}${sysconfdir}/hostname
+ fi
+
+ install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir}
+ if [ -n "${DISTRO_NAME}" ]; then
+ printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
+ printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
+ if [ -n "${DISTRO_VERSION}" ]; then
+ distro_version_nodate=${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot').replace('${DATE}','')}
+ printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue
+ printf "%s " $distro_version_nodate >> ${D}${sysconfdir}/issue.net
+ fi
+ printf "\\\n \\\l\n" >> ${D}${sysconfdir}/issue
+ echo >> ${D}${sysconfdir}/issue
+ echo "%h" >> ${D}${sysconfdir}/issue.net
+ echo >> ${D}${sysconfdir}/issue.net
+ fi
+}
+do_install_basefilesissue[vardepsexclude] += "DATE"
+
+do_install_append_linuxstdbase() {
+ for d in ${dirs755-lsb}; do
+ install -m 0755 -d ${D}$d
+ done
+
+ for d in ${dirs2775-lsb}; do
+ install -m 2775 -d ${D}$d
+ done
+}
+
+SYSROOT_DIRS += "${sysconfdir}/skel"
+
+PACKAGES = "${PN}-doc ${PN} ${PN}-dev ${PN}-dbg"
+FILES_${PN} = "/"
+FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname') != '')]} ${sysconfdir}/shells"
+CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"
diff --git a/external/poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch b/external/poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch
new file mode 100644
index 00000000..5f357d88
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch
@@ -0,0 +1,19 @@
+
+We need to have a shutdown group to allow the shutdown icon
+to work correctly. Any users that want to use shutdown like
+the xuser should be added to this group.
+
+Upstream-Status: Inappropriate [Embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Index: base-passwd-3.5.26/group.master
+===================================================================
+--- base-passwd-3.5.26.orig/group.master
++++ base-passwd-3.5.26/group.master
+@@ -36,5 +36,6 @@ sasl:*:45:
+ plugdev:*:46:
+ staff:*:50:
+ games:*:60:
++shutdown:*:70:
+ users:*:100:
+ nogroup:*:65534:
diff --git a/external/poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch b/external/poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch
new file mode 100644
index 00000000..14c08b74
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch
@@ -0,0 +1,24 @@
+Disable documentation for now as it uses tools currently not supported
+by OE-Core. It uses sgmltools and po4a.
+
+Upstream-Status: Inappropriate [OE-Core specific]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: base-passwd-3.5.28/Makefile.in
+===================================================================
+--- base-passwd-3.5.28.orig/Makefile.in
++++ base-passwd-3.5.28/Makefile.in
+@@ -25,13 +25,10 @@ gen_configure = config.cache config.stat
+ confdefhs.h config.h Makefile
+
+ all: update-passwd
+- $(MAKE) -C doc all
+- $(MAKE) -C man all
+
+ install: all
+ mkdir -p $(DESTDIR)$(sbindir)
+ $(INSTALL) update-passwd $(DESTDIR)$(sbindir)/
+- $(MAKE) -C man install
+
+ update-passwd.o: version.h
+
diff --git a/external/poky/meta/recipes-core/base-passwd/base-passwd/input.patch b/external/poky/meta/recipes-core/base-passwd/base-passwd/input.patch
new file mode 100644
index 00000000..3abbcad5
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-passwd/base-passwd/input.patch
@@ -0,0 +1,22 @@
+Add an input group for the /dev/input/* devices.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+
+---
+ group.master | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: base-passwd-3.5.26/group.master
+===================================================================
+--- base-passwd-3.5.26.orig/group.master
++++ base-passwd-3.5.26/group.master
+@@ -12,6 +12,7 @@ uucp:*:10:
+ man:*:12:
+ proxy:*:13:
+ kmem:*:15:
++input:*:19:
+ dialout:*:20:
+ fax:*:21:
+ voice:*:22:
diff --git a/external/poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch b/external/poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch
new file mode 100644
index 00000000..b5a69229
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-passwd/base-passwd/nobash.patch
@@ -0,0 +1,15 @@
+use /bin/sh instead of /bin/bash, since the latter may not be included in
+some images such as minimal
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- base-passwd/passwd.master~nobash
++++ base-passwd/passwd.master
+@@ -1,4 +1,4 @@
+-root:*:0:0:root:/root:/bin/bash
++root:*:0:0:root:/root:/bin/sh
+ daemon:*:1:1:daemon:/usr/sbin:/bin/sh
+ bin:*:2:2:bin:/bin:/bin/sh
+ sys:*:3:3:sys:/dev:/bin/sh
diff --git a/external/poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch b/external/poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch
new file mode 100644
index 00000000..e27bf7d9
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-passwd/base-passwd/noshadow.patch
@@ -0,0 +1,14 @@
+remove "*" for root since we don't have a /etc/shadow so far.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- base-passwd/passwd.master~nobash
++++ base-passwd/passwd.master
+@@ -1,4 +1,4 @@
+-root:*:0:0:root:/root:/bin/sh
++root::0:0:root:/root:/bin/sh
+ daemon:*:1:1:daemon:/usr/sbin:/bin/sh
+ bin:*:2:2:bin:/bin:/bin/sh
+ sys:*:3:3:sys:/dev:/bin/sh
diff --git a/external/poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/external/poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
new file mode 100644
index 00000000..c6be1c1d
--- /dev/null
+++ b/external/poky/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -0,0 +1,115 @@
+SUMMARY = "Base system master password/group files"
+DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group). The update-passwd tool is also provided to keep the system databases synchronized with these master files."
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+RECIPE_NO_UPDATE_REASON = "Version 3.5.38 requires cdebconf for update-passwd utility"
+
+SRC_URI = "https://launchpad.net/debian/+archive/primary/+files/${BPN}_${PV}.tar.gz \
+ file://add_shutdown.patch \
+ file://nobash.patch \
+ file://noshadow.patch \
+ file://input.patch \
+ file://disable-docs.patch \
+ "
+
+SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421"
+SRC_URI[sha256sum] = "f0b66388b2c8e49c15692439d2bee63bcdd4bbbf7a782c7f64accc55986b6a36"
+
+# the package is taken from launchpad; 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/b/base-passwd/"
+
+inherit autotools
+
+do_install () {
+ install -d -m 755 ${D}${sbindir}
+ install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/
+ install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8
+ install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/
+ install -p -m 644 ${S}/man/update-passwd.pl.8 \
+ ${D}${mandir}/pl/man8/update-passwd.8
+ gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/*
+ install -d -m 755 ${D}${datadir}/base-passwd
+ install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/
+ sed -i 's#:/root:#:${ROOT_HOME}:#' ${D}${datadir}/base-passwd/passwd.master
+ install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/
+
+ install -d -m 755 ${D}${docdir}/${BPN}
+ install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/
+ gzip -9 ${D}${docdir}/${BPN}/*
+ install -p -m 644 ${S}/README ${D}${docdir}/${BPN}/
+ install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/
+}
+
+basepasswd_sysroot_postinst() {
+#!/bin/sh
+
+# Install passwd.master and group.master to sysconfdir
+install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
+for i in passwd group; do
+ install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/\$i.master \
+ ${STAGING_DIR_TARGET}${sysconfdir}/\$i
+done
+
+# Run any useradd postinsts
+for script in ${STAGING_DIR_TARGET}${bindir}/postinst-useradd-*; do
+ if [ -f \$script ]; then
+ \$script
+ fi
+done
+}
+
+SYSROOT_DIRS += "${sysconfdir}"
+SYSROOT_PREPROCESS_FUNCS += "base_passwd_tweaksysroot"
+
+base_passwd_tweaksysroot () {
+ mkdir -p ${SYSROOT_DESTDIR}${bindir}
+ dest=${SYSROOT_DESTDIR}${bindir}/postinst-${PN}
+ echo "${basepasswd_sysroot_postinst}" > $dest
+ chmod 0755 $dest
+}
+
+python populate_packages_prepend() {
+ # Add in the preinst function for ${PN}
+ # We have to do this here as prior to this, passwd/group.master
+ # would be unavailable. We need to create these files at preinst
+ # time before the files from the package may be available, hence
+ # storing the data from the files in the preinst directly.
+
+ f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r')
+ passwd = "".join(f.readlines())
+ f.close()
+ f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r')
+ group = "".join(f.readlines())
+ f.close()
+
+ preinst = """#!/bin/sh
+mkdir -p $D${sysconfdir}
+if [ ! -e $D${sysconfdir}/passwd ]; then
+\tcat << 'EOF' > $D${sysconfdir}/passwd
+""" + passwd + """EOF
+fi
+if [ ! -e $D${sysconfdir}/group ]; then
+\tcat << 'EOF' > $D${sysconfdir}/group
+""" + group + """EOF
+fi
+"""
+ d.setVar(d.expand('pkg_preinst_${PN}'), preinst)
+}
+
+addtask do_package after do_populate_sysroot
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "${PN}-update"
+FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}"
+
+pkg_postinst_${PN}-update () {
+#!/bin/sh
+if [ -n "$D" ]; then
+ exit 0
+fi
+${sbindir}/update-passwd
+}
diff --git a/external/poky/meta/recipes-core/busybox/busybox-inittab_1.29.3.bb b/external/poky/meta/recipes-core/busybox/busybox-inittab_1.29.3.bb
new file mode 100644
index 00000000..a83620e8
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox-inittab_1.29.3.bb
@@ -0,0 +1,32 @@
+SUMMARY = "inittab configuration for BusyBox"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI = "file://inittab"
+
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -D -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+ tmp="${SERIAL_CONSOLES}"
+ for i in $tmp
+ do
+ j=`echo ${i} | sed s/\;/\ /g`
+ id=`echo ${i} | sed -e 's/^.*;//' -e 's/;.*//'`
+ echo "$id::respawn:${base_sbindir}/getty ${j}" >> ${D}${sysconfdir}/inittab
+ done
+}
+
+# SERIAL_CONSOLES is generally defined by the MACHINE .conf.
+# Set PACKAGE_ARCH appropriately.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} = "${sysconfdir}/inittab"
+CONFFILES_${PN} = "${sysconfdir}/inittab"
diff --git a/external/poky/meta/recipes-core/busybox/busybox.inc b/external/poky/meta/recipes-core/busybox/busybox.inc
new file mode 100644
index 00000000..0c0d26ed
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox.inc
@@ -0,0 +1,458 @@
+SUMMARY = "Tiny versions of many common UNIX utilities in a single small executable"
+DESCRIPTION = "BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete POSIX environment for any small or embedded system."
+HOMEPAGE = "http://www.busybox.net"
+BUGTRACKER = "https://bugs.busybox.net/"
+
+DEPENDS += "kern-tools-native virtual/crypt"
+
+# bzip2 applet in busybox is based on lightly-modified bzip2 source
+# the GPL is version 2 only
+LICENSE = "GPLv2 & bzip2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb"
+
+SECTION = "base"
+
+# Whether to split the suid apps into a seperate binary
+BUSYBOX_SPLIT_SUID ?= "1"
+
+export EXTRA_CFLAGS = "${CFLAGS}"
+export EXTRA_LDFLAGS = "${LDFLAGS}"
+
+EXTRA_OEMAKE = "CC='${CC}' LD='${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y HOSTCC='${BUILD_CC}' HOSTCPP='${BUILD_CPP}'"
+
+PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
+
+FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog"
+FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfdir}/mdev/*"
+FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
+FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
+FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
+
+INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
+
+INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
+INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
+INITSCRIPT_NAME_${PN}-mdev = "mdev"
+INITSCRIPT_PARAMS_${PN}-mdev = "start 04 S ."
+INITSCRIPT_NAME_${PN}-syslog = "syslog"
+INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
+
+SYSTEMD_PACKAGES = "${PN}-syslog"
+SYSTEMD_SERVICE_${PN}-syslog = "${@bb.utils.contains('SRC_URI', 'file://syslog.cfg', 'busybox-syslog.service', '', d)}"
+
+RDEPENDS_${PN}-syslog = "busybox"
+CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf"
+RCONFLICTS_${PN}-syslog = "rsyslog sysklogd syslog-ng"
+
+CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
+
+RRECOMMENDS_${PN} = "${PN}-udhcpc"
+
+RDEPENDS_${PN} = "${@["", "busybox-inittab"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]}"
+
+inherit cml1 systemd update-rc.d ptest
+
+# internal helper
+def busybox_cfg(feature, tokens, cnf, rem):
+ if type(tokens) == type(""):
+ tokens = [tokens]
+ rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
+ if feature:
+ cnf.extend([token + '=y' for token in tokens])
+ else:
+ cnf.extend(['# ' + token + ' is not set' for token in tokens])
+
+# Map distro features to config settings
+def features_to_busybox_settings(d):
+ cnf, rem = ([], [])
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IPV6', cnf, rem)
+ busybox_cfg(True, 'CONFIG_LFS', cnf, rem)
+ busybox_cfg(True, 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'nls', True, False, d), 'CONFIG_LOCALE_SUPPORT', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv4', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'wifi', True, False, d), 'CONFIG_RFKILL', cnf, rem)
+ busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'bluetooth', True, False, d), 'CONFIG_RFKILL', cnf, rem)
+ return "\n".join(cnf), "\n".join(rem)
+
+# X, Y = ${@features_to_busybox_settings(d)}
+# unfortunately doesn't seem to work with bitbake, workaround:
+def features_to_busybox_conf(d):
+ cnf, rem = features_to_busybox_settings(d)
+ return cnf
+def features_to_busybox_del(d):
+ cnf, rem = features_to_busybox_settings(d)
+ return rem
+
+configmangle = '/CONFIG_EXTRA_CFLAGS/d; \
+ '
+OE_FEATURES := "${@features_to_busybox_conf(d)}"
+OE_DEL := "${@features_to_busybox_del(d)}"
+DO_IPv4 := "${@bb.utils.contains('DISTRO_FEATURES', 'ipv4', 1, 0, d)}"
+DO_IPv6 := "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 1, 0, d)}"
+
+python () {
+ if "${OE_DEL}":
+ d.setVar('configmangle_append', "${OE_DEL}" + "\n")
+ if "${OE_FEATURES}":
+ d.setVar('configmangle_append',
+ "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
+ ("\\n".join((d.expand("${OE_FEATURES}").split("\n")))))
+ d.setVar('configmangle_append',
+ "/^### CROSS$/a\\\n%s\n" %
+ ("\\n".join(["CONFIG_EXTRA_CFLAGS=\"${CFLAGS} ${HOST_CC_ARCH}\""
+ ])
+ ))
+}
+
+do_prepare_config () {
+ if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
+ export KCONFIG_NOTIMESTAMP=1
+ fi
+ sed -e '/CONFIG_STATIC/d' \
+ < ${WORKDIR}/defconfig > ${S}/.config
+ echo "# CONFIG_STATIC is not set" >> .config
+ for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
+ ${S}/.config
+ sed -i -e '${configmangle}' ${S}/.config
+ if test ${DO_IPv4} -eq 0 && test ${DO_IPv6} -eq 0; then
+ # disable networking applets
+ mv ${S}/.config ${S}/.config.oe-tmp
+ awk 'BEGIN{net=0}
+ /^# Networking Utilities/{net=1}
+ /^#$/{if(net){net=net+1}}
+ {if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \
+ ${S}/.config.oe-tmp > ${S}/.config
+ fi
+ sed -i 's/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b"/' ${S}/.config
+ sed -i 's|${DEBUG_PREFIX_MAP}||g' ${S}/.config
+}
+
+# returns all the elements from the src uri that are .cfg files
+def find_cfgs(d):
+ sources=src_patches(d, True)
+ sources_list=[]
+ for s in sources:
+ if s.endswith('.cfg'):
+ sources_list.append(s)
+
+ return sources_list
+
+do_configure () {
+ do_prepare_config
+ merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
+ cml1_do_configure
+}
+
+do_compile() {
+ unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+ if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
+ export KCONFIG_NOTIMESTAMP=1
+ fi
+ if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
+ # split the .config into two parts, and make two busybox binaries
+ if [ -e .config.orig ]; then
+ # Need to guard again an interrupted do_compile - restore any backup
+ cp .config.orig .config
+ fi
+ cp .config .config.orig
+ oe_runmake busybox.cfg.suid
+ oe_runmake busybox.cfg.nosuid
+
+ # workaround for suid bug 10346
+ if ! grep -q "CONFIG_SH_IS_NONE" busybox.cfg.nosuid; then
+ echo "CONFIG_SH_IS_NONE" >> busybox.cfg.suid
+ fi
+
+ for i in `cat busybox.cfg.suid busybox.cfg.nosuid`; do
+ echo "# $i is not set" >> .config.disable.apps
+ done
+ merge_config.sh -m .config.orig .config.disable.apps
+ cp .config .config.nonapps
+ for s in suid nosuid; do
+ cat busybox.cfg.$s | while read item; do
+ grep -w "$item" .config.orig
+ done > .config.app.$s
+
+ # workaround for suid bug 10346
+ if [ "$s" = "suid" ] ; then
+ sed "s/.*CONFIG_SH_IS_NONE.*$/CONFIG_SH_IS_NONE=y/" -i .config.app.suid
+ fi
+
+ merge_config.sh -m .config.nonapps .config.app.$s
+ oe_runmake busybox_unstripped
+ mv busybox_unstripped busybox.$s
+ oe_runmake busybox.links
+ sort busybox.links > busybox.links.$s
+ rm busybox.links
+ done
+
+ # hard fail if sh is being linked to the suid busybox (detects bug 10346)
+ if grep -q -x "/bin/sh" busybox.links.suid; then
+ bbfatal "busybox suid binary incorrectly provides /bin/sh"
+ fi
+
+ # copy .config.orig back to .config, because the install process may check this file
+ cp .config.orig .config
+ # cleanup
+ rm .config.orig .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
+ else
+ oe_runmake busybox_unstripped
+ cp busybox_unstripped busybox
+ oe_runmake busybox.links
+ fi
+}
+
+do_install () {
+ sed -i "s:^/bin/:BASE_BINDIR/:" busybox.links*
+ sed -i "s:^/sbin/:BASE_SBINDIR/:" busybox.links*
+ sed -i "s:^/usr/bin/:BINDIR/:" busybox.links*
+ sed -i "s:^/usr/sbin/:SBINDIR/:" busybox.links*
+
+ # Move arch/link to BINDIR to match coreutils
+ sed -i "s:^BASE_BINDIR/arch:BINDIR/arch:" busybox.links*
+ sed -i "s:^BASE_BINDIR/link:BINDIR/link:" busybox.links*
+
+ sed -i "s:^BASE_BINDIR/:${base_bindir}/:" busybox.links*
+ sed -i "s:^BASE_SBINDIR/:${base_sbindir}/:" busybox.links*
+ sed -i "s:^BINDIR/:${bindir}/:" busybox.links*
+ sed -i "s:^SBINDIR/:${sbindir}/:" busybox.links*
+
+ install -d ${D}${sysconfdir}/init.d
+
+ if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then
+ # Install ${base_bindir}/busybox, and the ${base_bindir}/sh link so the postinst script
+ # can run. Let update-alternatives handle the rest.
+ install -d ${D}${base_bindir}
+ if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then
+ install -m 4755 ${B}/busybox.suid ${D}${base_bindir}
+ install -m 0755 ${B}/busybox.nosuid ${D}${base_bindir}
+ install -m 0644 ${S}/busybox.links.suid ${D}${sysconfdir}
+ install -m 0644 ${S}/busybox.links.nosuid ${D}${sysconfdir}
+ if grep -q "CONFIG_SH_IS_ASH=y" ${B}/.config; then
+ ln -sf busybox.nosuid ${D}${base_bindir}/sh
+ fi
+ # Keep a default busybox for people who want to invoke busybox directly.
+ # This is also useful for the on device upgrade. Because we want
+ # to use the busybox command in postinst.
+ ln -sf busybox.nosuid ${D}${base_bindir}/busybox
+ else
+ if grep -q "CONFIG_FEATURE_SUID=y" ${B}/.config; then
+ install -m 4755 ${B}/busybox ${D}${base_bindir}
+ else
+ install -m 0755 ${B}/busybox ${D}${base_bindir}
+ fi
+ install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
+ if grep -q "CONFIG_SH_IS_ASH=y" ${B}/.config; then
+ ln -sf busybox ${D}${base_bindir}/sh
+ fi
+ # We make this symlink here to eliminate the error when upgrading together
+ # with busybox-syslog. Without this symlink, the opkg may think of the
+ # busybox.nosuid as obsolete and remove it, resulting in dead links like
+ # ${base_bindir}/sed -> ${base_bindir}/busybox.nosuid. This will make upgrading busybox-syslog fail.
+ # This symlink will be safely deleted in postinst, thus no negative effect.
+ ln -sf busybox ${D}${base_bindir}/busybox.nosuid
+ fi
+ else
+ install -d ${D}${base_bindir} ${D}${bindir} ${D}${libdir}
+ cat busybox.links | while read FILE; do
+ NAME=`basename "$FILE"`
+ install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}"
+ done
+ # add suid bit where needed
+ for i in `grep -E "APPLET.*BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do
+ find ${D} -name $i.${BPN} -exec chmod a+s {} \;
+ done
+ install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
+ ln -sf sh.${BPN} ${D}${base_bindir}/sh
+ ln -sf ln.${BPN} ${D}${base_bindir}/ln
+ ln -sf test.${BPN} ${D}${bindir}/test
+ if [ -f ${D}/linuxrc.${BPN} ]; then
+ mv ${D}/linuxrc.${BPN} ${D}/linuxrc
+ fi
+ install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
+ fi
+
+ if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog
+ install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf
+ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
+ fi
+ if grep -q "CONFIG_CROND=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
+ fi
+ if grep -q "CONFIG_HTTPD=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
+ install -d ${D}/srv/www
+ fi
+ if grep -q "CONFIG_UDHCPD=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
+ fi
+ if grep -q "CONFIG_HWCLOCK=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
+ fi
+ if grep -q "CONFIG_UDHCPC=y" ${B}/.config; then
+ install -d ${D}${sysconfdir}/udhcpc.d
+ install -d ${D}${datadir}/udhcpc
+ install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default
+ sed -i "s:/SBIN_DIR/:${base_sbindir}/:" ${D}${sysconfdir}/udhcpc.d/50default
+ install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
+ fi
+ if grep -q "CONFIG_INETD=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${BPN}
+ sed -i "s:/usr/sbin/:${sbindir}/:" ${D}${sysconfdir}/init.d/inetd.${BPN}
+ install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/
+ fi
+ if grep -q "CONFIG_MDEV=y" ${B}/.config; then
+ install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev
+ if grep "CONFIG_FEATURE_MDEV_CONF=y" ${B}/.config; then
+ install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
+ install -d ${D}${sysconfdir}/mdev
+ install -m 0755 ${WORKDIR}/find-touchscreen.sh ${D}${sysconfdir}/mdev
+ install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev
+ fi
+ fi
+ if grep -q "CONFIG_INIT=y" ${B}/.config; then
+ install -D -m 0777 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d/rcS
+ install -D -m 0777 ${WORKDIR}/rcK ${D}${sysconfdir}/init.d/rcK
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ if grep -q "CONFIG_KLOGD=y" ${B}/.config; then
+ install -d ${D}${systemd_unitdir}/system
+ sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \
+ > ${D}${systemd_unitdir}/system/busybox-klogd.service
+ fi
+
+ if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
+ install -d ${D}${systemd_unitdir}/system
+ sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
+ > ${D}${systemd_unitdir}/system/busybox-syslog.service
+ if [ ! -e ${D}${systemd_unitdir}/system/busybox-klogd.service ] ; then
+ sed -i '/klog/d' ${D}${systemd_unitdir}/system/busybox-syslog.service
+ fi
+ if [ -f ${WORKDIR}/busybox-syslog.default ] ; then
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog
+ fi
+ fi
+ fi
+
+ # Remove the sysvinit specific configuration file for systemd systems to avoid confusion
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then
+ rm -f ${D}${sysconfdir}/syslog-startup.conf
+ fi
+}
+
+do_install_ptest () {
+ cp -r ${B}/testsuite ${D}${PTEST_PATH}/
+ cp ${B}/.config ${D}${PTEST_PATH}/
+ ln -s /bin/busybox ${D}${PTEST_PATH}/busybox
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "50"
+
+python do_package_prepend () {
+ # We need to load the full set of busybox provides from the /etc/busybox.links
+ # Use this to see the update-alternatives with the right information
+
+ dvar = d.getVar('D')
+ pn = d.getVar('PN')
+ def set_alternative_vars(links, target):
+ links = d.expand(links)
+ target = d.expand(target)
+ f = open('%s%s' % (dvar, links), 'r')
+ for alt_link_name in f:
+ alt_link_name = alt_link_name.strip()
+ alt_name = os.path.basename(alt_link_name)
+ # Match coreutils
+ if alt_name == '[':
+ alt_name = 'lbracket'
+ if alt_name == 'klogd' or alt_name == 'syslogd':
+ d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' ' + alt_name)
+ else:
+ d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
+ if os.path.exists('%s%s' % (dvar, target)):
+ d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
+ f.close()
+ return
+
+ if os.path.exists('%s/etc/busybox.links' % (dvar)):
+ set_alternative_vars("${sysconfdir}/busybox.links", "${base_bindir}/busybox")
+ else:
+ set_alternative_vars("${sysconfdir}/busybox.links.nosuid", "${base_bindir}/busybox.nosuid")
+ set_alternative_vars("${sysconfdir}/busybox.links.suid", "${base_bindir}/busybox.suid")
+}
+
+pkg_postinst_${PN} () {
+ # This part of code is dedicated to the on target upgrade problem.
+ # It's known that if we don't make appropriate symlinks before update-alternatives calls,
+ # there will be errors indicating missing commands such as 'sed'.
+ # These symlinks will later be updated by update-alternatives calls.
+ test -n 2 > /dev/null || alias test='busybox test'
+ if test "x$D" = "x"; then
+ # Remove busybox.nosuid if it's a symlink, because this situation indicates
+ # that we're installing or upgrading to a one-binary busybox.
+ if test -h ${base_bindir}/busybox.nosuid; then
+ rm -f ${base_bindir}/busybox.nosuid
+ fi
+ for suffix in "" ".nosuid" ".suid"; do
+ if test -e ${sysconfdir}/busybox.links$suffix; then
+ while read link; do
+ if test ! -e "$link"; then
+ # we can use busybox here because even if we are using splitted busybox
+ # we've made a symlink from /bin/busybox to /bin/busybox.nosuid.
+ busybox rm -f $link
+ busybox ln -s "${base_bindir}/busybox$suffix" $link
+ fi
+ done < ${sysconfdir}/busybox.links$suffix
+ fi
+ done
+ fi
+ if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links*; then
+ grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
+ fi
+}
+
+pkg_prerm_${PN} () {
+ # This is so you can make busybox commit suicide - removing busybox with no other packages
+ # providing its files, this will make update-alternatives work, but the update-rc.d part
+ # for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
+ tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
+ ln -s ${base_bindir}/busybox $tmpdir/[
+ ln -s ${base_bindir}/busybox $tmpdir/test
+ ln -s ${base_bindir}/busybox $tmpdir/head
+ ln -s ${base_bindir}/busybox $tmpdir/sh
+ ln -s ${base_bindir}/busybox $tmpdir/basename
+ ln -s ${base_bindir}/busybox $tmpdir/echo
+ ln -s ${base_bindir}/busybox $tmpdir/mv
+ ln -s ${base_bindir}/busybox $tmpdir/ln
+ ln -s ${base_bindir}/busybox $tmpdir/dirname
+ ln -s ${base_bindir}/busybox $tmpdir/rm
+ ln -s ${base_bindir}/busybox $tmpdir/sed
+ ln -s ${base_bindir}/busybox $tmpdir/sort
+ ln -s ${base_bindir}/busybox $tmpdir/grep
+ ln -s ${base_bindir}/busybox $tmpdir/tail
+ export PATH=$PATH:$tmpdir
+}
+
+pkg_postrm_${PN} () {
+ if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links* && [ ! -e $D${base_bindir}/bash ]; then
+ printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+ fi
+}
+
+pkg_prerm_${PN}-syslog () {
+ # remove syslog
+ if test "x$D" = "x"; then
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ ${sysconfdir}/init.d/syslog stop || :
+ fi
+ fi
+}
+
+RPROVIDES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', '/bin/sh', '', d)}"
diff --git a/external/poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch b/external/poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch
new file mode 100644
index 00000000..2bf2b91c
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch
@@ -0,0 +1,114 @@
+From a9333eb6a7b8dbda735947cd5bc981ff9352a2c9 Mon Sep 17 00:00:00 2001
+From: Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
+Date: Thu, 10 Mar 2011 00:27:08 -0500
+Subject: [PATCH 1/2] Use $(CC) when linking instead of $(LD) and use $(CFLAGS)
+ and $(EXTRA_CFLAGS) when linking.
+
+This fixes the issue where LDFLAGS escaped with -Wl are ignored during
+compilation. It also simplifies using CFLAGS or EXTRA_CFLAGS (such as
+-m32 on x86_64 or -flto) which apply to both compilation and linking
+situations.
+
+Signed-off-by: Nathan Phillip Brink <ohnobinki@ohnopublishing.net>
+---
+Upstream-Status: Pending
+
+ Makefile | 7 ++++---
+ scripts/Makefile.build | 8 ++++----
+ scripts/Makefile.lib | 13 +++----------
+ 3 files changed, 11 insertions(+), 17 deletions(-)
+
+Index: busybox-1.23.2/Makefile
+===================================================================
+--- busybox-1.23.2.orig/Makefile
++++ busybox-1.23.2/Makefile
+@@ -309,7 +309,8 @@ CHECKFLAGS := -D__linux__ -Dlinux -D
+ MODFLAGS = -DMODULE
+ CFLAGS_MODULE = $(MODFLAGS)
+ AFLAGS_MODULE = $(MODFLAGS)
+-LDFLAGS_MODULE = -r
++LDFLAGS_RELOCATABLE = -r -nostdlib
++LDFLAGS_MODULE = $(LDFLAGS_RELOCATABLE)
+ CFLAGS_KERNEL =
+ AFLAGS_KERNEL =
+
+@@ -331,7 +332,7 @@ KERNELVERSION = $(VERSION).$(PATCHLEVEL)
+ export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION \
+ ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
+ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
+- HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
++ HOSTCXX HOSTCXXFLAGS LDFLAGS_RELOCATABLE LDFLAGS_MODULE CHECK CHECKFLAGS
+
+ export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
+ export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
+@@ -610,7 +611,7 @@ quiet_cmd_busybox__ ?= LINK $@
+ cmd_busybox__ ?= $(srctree)/scripts/trylink \
+ "$@" \
+ "$(CC)" \
+- "$(CFLAGS) $(CFLAGS_busybox)" \
++ "$(CFLAGS) $(CFLAGS_busybox) $(EXTRA_CFLAGS)" \
+ "$(LDFLAGS) $(EXTRA_LDFLAGS)" \
+ "$(core-y)" \
+ "$(libs-y)" \
+Index: busybox-1.23.2/scripts/Makefile.build
+===================================================================
+--- busybox-1.23.2.orig/scripts/Makefile.build
++++ busybox-1.23.2/scripts/Makefile.build
+@@ -174,7 +174,7 @@ cmd_modversions = \
+ | $(GENKSYMS) -a $(ARCH) \
+ > $(@D)/.tmp_$(@F:.o=.ver); \
+ \
+- $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
++ $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(@D)/.tmp_$(@F) \
+ -T $(@D)/.tmp_$(@F:.o=.ver); \
+ rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver); \
+ else \
+@@ -257,7 +257,7 @@ quiet_cmd_link_o_target = LD $@
+ # If the list of objects to link is empty, just create an empty built-in.o
+ # -nostdlib is added to make "make LD=gcc ..." work (some people use that)
+ cmd_link_o_target = $(if $(strip $(obj-y)),\
+- $(LD) -nostdlib $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
++ $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(filter $(obj-y), $^),\
+ rm -f $@; $(AR) rcs $@)
+
+ $(builtin-target): $(obj-y) FORCE
+@@ -292,10 +292,10 @@ $($(subst $(obj)/,,$(@:.o=-objs))) \
+ $($(subst $(obj)/,,$(@:.o=-y)))), $^)
+
+ quiet_cmd_link_multi-y = LD $@
+-cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
++cmd_link_multi-y = $(CC) $(ld_flags_partial) $(LDFLAGS_RELOCATABLE) -o $@ $(link_multi_deps)
+
+ quiet_cmd_link_multi-m = LD [M] $@
+-cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
++cmd_link_multi-m = $(CC) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
+
+ # We would rather have a list of rules like
+ # foo.o: $(foo-objs)
+Index: busybox-1.23.2/scripts/Makefile.lib
+===================================================================
+--- busybox-1.23.2.orig/scripts/Makefile.lib
++++ busybox-1.23.2/scripts/Makefile.lib
+@@ -121,7 +121,8 @@ cpp_flags = -Wp,-MD,$(depfile) $(NO
+ # yet ld_flags is fed to ld.
+ #ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
+ # Remove the -Wl, prefix from linker options normally passed through gcc
+-ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS))
++ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS) $(CFLAGS) $(EXTRA_CFLAGS))
++ld_flags_partial = $($(filter-out -shared%, $(filter-out -pie%,$(ld_flags))))
+
+
+ # Finds the multi-part object the current object will be linked into
+@@ -151,10 +152,8 @@ $(obj)/%:: $(src)/%_shipped
+ # Linking
+ # ---------------------------------------------------------------------------
+
+-# TODO: LDFLAGS usually is supposed to contain gcc's flags, not ld's.
+-# but here we feed them to ld!
+-quiet_cmd_ld = LD $@
+-cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
++quiet_cmd_ld = CC $@
++cmd_ld = $(CC) $(ld_flags) $(LDFLAGS_$(@F)) \
+ $(filter-out FORCE,$^) -o $@
+
+ # Objcopy
diff --git a/external/poky/meta/recipes-core/busybox/busybox/CVE-2018-20679.patch b/external/poky/meta/recipes-core/busybox/busybox/CVE-2018-20679.patch
new file mode 100644
index 00000000..e4693768
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/CVE-2018-20679.patch
@@ -0,0 +1,142 @@
+From 6d3b4bb24da9a07c263f3c1acf8df85382ff562c Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Mon, 17 Dec 2018 18:07:18 +0100
+Subject: [PATCH] udhcpc: check that 4-byte options are indeed 4-byte, closes
+ 11506
+
+function old new delta
+udhcp_get_option32 - 27 +27
+udhcp_get_option 231 248 +17
+------------------------------------------------------------------------------
+(add/remove: 1/0 grow/shrink: 1/0 up/down: 44/0) Total: 44 bytes
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+
+Upstream-Status: Backport
+CVE: CVE-2018-20679
+
+Affects < 1.30.0
+
+signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ networking/udhcp/common.c | 19 +++++++++++++++++++
+ networking/udhcp/common.h | 4 ++++
+ networking/udhcp/dhcpc.c | 6 +++---
+ networking/udhcp/dhcpd.c | 6 +++---
+ 4 files changed, 29 insertions(+), 6 deletions(-)
+
+Index: busybox-1.29.3/networking/udhcp/common.c
+===================================================================
+--- busybox-1.29.3.orig/networking/udhcp/common.c
++++ busybox-1.29.3/networking/udhcp/common.c
+@@ -270,6 +270,15 @@ uint8_t* FAST_FUNC udhcp_get_option(stru
+ goto complain; /* complain and return NULL */
+
+ if (optionptr[OPT_CODE] == code) {
++ if (optionptr[OPT_LEN] == 0) {
++ /* So far no valid option with length 0 known.
++ * Having this check means that searching
++ * for DHCP_MESSAGE_TYPE need not worry
++ * that returned pointer might be unsafe
++ * to dereference.
++ */
++ goto complain; /* complain and return NULL */
++ }
+ log_option("option found", optionptr);
+ return optionptr + OPT_DATA;
+ }
+@@ -287,6 +296,16 @@ uint8_t* FAST_FUNC udhcp_get_option(stru
+ return NULL;
+ }
+
++uint8_t* FAST_FUNC udhcp_get_option32(struct dhcp_packet *packet, int code)
++{
++ uint8_t *r = udhcp_get_option(packet, code);
++ if (r) {
++ if (r[-1] != 4)
++ r = NULL;
++ }
++ return r;
++}
++
+ /* Return the position of the 'end' option (no bounds checking) */
+ int FAST_FUNC udhcp_end_option(uint8_t *optionptr)
+ {
+Index: busybox-1.29.3/networking/udhcp/common.h
+===================================================================
+--- busybox-1.29.3.orig/networking/udhcp/common.h
++++ busybox-1.29.3/networking/udhcp/common.h
+@@ -204,6 +204,10 @@ extern const uint8_t dhcp_option_lengths
+ unsigned FAST_FUNC udhcp_option_idx(const char *name, const char *option_strings);
+
+ uint8_t *udhcp_get_option(struct dhcp_packet *packet, int code) FAST_FUNC;
++/* Same as above + ensures that option length is 4 bytes
++ * (returns NULL if size is different)
++ */
++uint8_t *udhcp_get_option32(struct dhcp_packet *packet, int code) FAST_FUNC;
+ int udhcp_end_option(uint8_t *optionptr) FAST_FUNC;
+ void udhcp_add_binary_option(struct dhcp_packet *packet, uint8_t *addopt) FAST_FUNC;
+ #if ENABLE_UDHCPC || ENABLE_UDHCPD
+Index: busybox-1.29.3/networking/udhcp/dhcpc.c
+===================================================================
+--- busybox-1.29.3.orig/networking/udhcp/dhcpc.c
++++ busybox-1.29.3/networking/udhcp/dhcpc.c
+@@ -1694,7 +1694,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ * They say ISC DHCP client supports this case.
+ */
+ server_addr = 0;
+- temp = udhcp_get_option(&packet, DHCP_SERVER_ID);
++ temp = udhcp_get_option32(&packet, DHCP_SERVER_ID);
+ if (!temp) {
+ bb_error_msg("no server ID, using 0.0.0.0");
+ } else {
+@@ -1721,7 +1721,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ struct in_addr temp_addr;
+ uint8_t *temp;
+
+- temp = udhcp_get_option(&packet, DHCP_LEASE_TIME);
++ temp = udhcp_get_option32(&packet, DHCP_LEASE_TIME);
+ if (!temp) {
+ bb_error_msg("no lease time with ACK, using 1 hour lease");
+ lease_seconds = 60 * 60;
+@@ -1817,7 +1817,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ uint32_t svid;
+ uint8_t *temp;
+
+- temp = udhcp_get_option(&packet, DHCP_SERVER_ID);
++ temp = udhcp_get_option32(&packet, DHCP_SERVER_ID);
+ if (!temp) {
+ non_matching_svid:
+ log1("received DHCP NAK with wrong"
+Index: busybox-1.29.3/networking/udhcp/dhcpd.c
+===================================================================
+--- busybox-1.29.3.orig/networking/udhcp/dhcpd.c
++++ busybox-1.29.3/networking/udhcp/dhcpd.c
+@@ -640,7 +640,7 @@ static void add_server_options(struct dh
+ static uint32_t select_lease_time(struct dhcp_packet *packet)
+ {
+ uint32_t lease_time_sec = server_config.max_lease_sec;
+- uint8_t *lease_time_opt = udhcp_get_option(packet, DHCP_LEASE_TIME);
++ uint8_t *lease_time_opt = udhcp_get_option32(packet, DHCP_LEASE_TIME);
+ if (lease_time_opt) {
+ move_from_unaligned32(lease_time_sec, lease_time_opt);
+ lease_time_sec = ntohl(lease_time_sec);
+@@ -987,7 +987,7 @@ int udhcpd_main(int argc UNUSED_PARAM, c
+ }
+
+ /* Get SERVER_ID if present */
+- server_id_opt = udhcp_get_option(&packet, DHCP_SERVER_ID);
++ server_id_opt = udhcp_get_option32(&packet, DHCP_SERVER_ID);
+ if (server_id_opt) {
+ uint32_t server_id_network_order;
+ move_from_unaligned32(server_id_network_order, server_id_opt);
+@@ -1011,7 +1011,7 @@ int udhcpd_main(int argc UNUSED_PARAM, c
+ }
+
+ /* Get REQUESTED_IP if present */
+- requested_ip_opt = udhcp_get_option(&packet, DHCP_REQUESTED_IP);
++ requested_ip_opt = udhcp_get_option32(&packet, DHCP_REQUESTED_IP);
+ if (requested_ip_opt) {
+ move_from_unaligned32(requested_nip, requested_ip_opt);
+ }
diff --git a/external/poky/meta/recipes-core/busybox/busybox/CVE-2019-5747.patch b/external/poky/meta/recipes-core/busybox/busybox/CVE-2019-5747.patch
new file mode 100644
index 00000000..4225b11e
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/CVE-2019-5747.patch
@@ -0,0 +1,60 @@
+From 74d9f1ba37010face4bd1449df4d60dd84450b06 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Mon, 7 Jan 2019 15:33:42 +0100
+Subject: [PATCH] udhcpc: when decoding DHCP_SUBNET, ensure it is 4 bytes long
+
+function old new delta
+udhcp_run_script 795 801 +6
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+
+Upstream-Status: Backport
+CVE: CVE-2019-5747
+Affects < 1.30.0
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ networking/udhcp/common.c | 2 +-
+ networking/udhcp/common.h | 2 +-
+ networking/udhcp/dhcpc.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+Index: busybox-1.29.3/networking/udhcp/common.c
+===================================================================
+--- busybox-1.29.3.orig/networking/udhcp/common.c
++++ busybox-1.29.3/networking/udhcp/common.c
+@@ -300,7 +300,7 @@ uint8_t* FAST_FUNC udhcp_get_option32(st
+ {
+ uint8_t *r = udhcp_get_option(packet, code);
+ if (r) {
+- if (r[-1] != 4)
++ if (r[-OPT_DATA + OPT_LEN] != 4)
+ r = NULL;
+ }
+ return r;
+Index: busybox-1.29.3/networking/udhcp/common.h
+===================================================================
+--- busybox-1.29.3.orig/networking/udhcp/common.h
++++ busybox-1.29.3/networking/udhcp/common.h
+@@ -119,7 +119,7 @@ enum {
+ //#define DHCP_TIME_SERVER 0x04 /* RFC 868 time server (32-bit, 0 = 1.1.1900) */
+ //#define DHCP_NAME_SERVER 0x05 /* IEN 116 _really_ ancient kind of NS */
+ //#define DHCP_DNS_SERVER 0x06
+-//#define DHCP_LOG_SERVER 0x07 /* port 704 UDP log (not syslog)
++//#define DHCP_LOG_SERVER 0x07 /* port 704 UDP log (not syslog) */
+ //#define DHCP_COOKIE_SERVER 0x08 /* "quote of the day" server */
+ //#define DHCP_LPR_SERVER 0x09
+ #define DHCP_HOST_NAME 0x0c /* either client informs server or server gives name to client */
+Index: busybox-1.29.3/networking/udhcp/dhcpc.c
+===================================================================
+--- busybox-1.29.3.orig/networking/udhcp/dhcpc.c
++++ busybox-1.29.3/networking/udhcp/dhcpc.c
+@@ -526,7 +526,7 @@ static char **fill_envp(struct dhcp_pack
+ temp = udhcp_get_option(packet, code);
+ *curr = xmalloc_optname_optval(temp, &dhcp_optflags[i], opt_name);
+ putenv(*curr++);
+- if (code == DHCP_SUBNET) {
++ if (code == DHCP_SUBNET && temp[-OPT_DATA + OPT_LEN] == 4) {
+ /* Subnet option: make things like "$ip/$mask" possible */
+ uint32_t subnet;
+ move_from_unaligned32(subnet, temp);
diff --git a/external/poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch b/external/poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch
new file mode 100644
index 00000000..6faca227
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch
@@ -0,0 +1,71 @@
+From: Jason Wessel <jason.wessel@windriver.com>
+Date: Sun, 3 Mar 2013 12:31:40 -0600
+Subject: [PATCH] menuconfig,check-lxdiaglog.sh: Allow specification of ncurses location
+
+Upstream-Status: Submitted
+
+[ based on: https://lkml.org/lkml/2013/3/3/103 ]
+
+This patch syncs up with the way the menuconfig ncurses / curses
+is detected and the HOST_EXTRACFLAGS works in the Linux kernel
+and it allows the menuconfig to work with a sysroot version
+of the curses libraries.
+
+---
+
+In some cross build environments such as the Yocto Project build
+environment it provides an ncurses library that is compiled
+differently than the host's version. This causes display corruption
+problems when the host's curses includes are used instead of the
+includes from the provided compiler are overridden. There is a second
+case where there is no curses libraries at all on the host system and
+menuconfig will just fail entirely.
+
+The solution is simply to allow an override variable in
+check-lxdialog.sh for environments such as the Yocto Project. Adding
+a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing
+compiling and linking against the right headers and libraries.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+cc: Michal Marek <mmarek@suse.cz>
+cc: linux-kbuild@vger.kernel.org
+---
+ scripts/kconfig/lxdialog/Makefile | 2 +-
+ scripts/kconfig/lxdialog/check-lxdialog.sh | 8 ++++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
+@@ -4,6 +4,10 @@
+ # What library to link
+ ldflags()
+ {
++ if [ x"$CROSS_CURSES_LIB" != x ]; then
++ echo "$CROSS_CURSES_LIB"
++ exit
++ fi
+ pkg-config --libs ncursesw 2>/dev/null && exit
+ pkg-config --libs ncurses 2>/dev/null && exit
+ for ext in so a dll.a dylib ; do
+@@ -21,6 +25,10 @@
+ # Where is ncurses.h?
+ ccflags()
+ {
++ if [ x"$CROSS_CURSES_INC" != x ]; then
++ echo "$CROSS_CURSES_INC"
++ exit
++ fi
+ if pkg-config --cflags ncursesw 2>/dev/null; then
+ echo '-DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=1'
+ elif pkg-config --cflags ncurses 2>/dev/null; then
+--- a/scripts/kconfig/lxdialog/Makefile
++++ b/scripts/kconfig/lxdialog/Makefile
+@@ -5,7 +5,7 @@
+
+ # Use reursively expanded variables so we do not call gcc unless
+ # we really need to do so. (Do not call gcc as part of make mrproper)
+-HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
++HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
+ HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
+
+ HOST_EXTRACFLAGS += -DLOCALE
diff --git a/external/poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch b/external/poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
new file mode 100644
index 00000000..76daaf1f
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
@@ -0,0 +1,143 @@
+From 53626cd06a3ef05ed847daea802ef0aa9661caa7 Mon Sep 17 00:00:00 2001
+From: Anders Darander <anders@chargestorm.se>
+Date: Thu, 3 Nov 2011 08:51:31 +0100
+Subject: [PATCH] busybox-udhcpc-no_deconfig.patch
+
+Upstream-Status: Pending
+
+Add a new option -D to the udhcpc client that allows for
+dhcp renewal to occur without having to down the interface
+in the process.
+
+Signed-off-by: Greg Moffatt <greg.moffatt@windriver.com>
+
+Updated to latest Busybox 1.17.3
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Updated to Busybox 1.18.4
+option spec is changed
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+Updated to Busybox 1.19.3
+
+Signed-off-by: Anders Darander <anders@chargestorm.se>
+
+Fixed options -b, -a and -P.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+---
+ networking/udhcp/dhcpc.c | 29 ++++++++++++++++------
+ 1 file changed, 21 insertions(+), 8 deletions(-)
+
+Index: busybox-1.29.1/networking/udhcp/dhcpc.c
+===================================================================
+--- busybox-1.29.1.orig/networking/udhcp/dhcpc.c
++++ busybox-1.29.1/networking/udhcp/dhcpc.c
+@@ -48,6 +48,8 @@
+ };
+ #endif
+
++/* option whether to down the interface when reconfiguring */
++static int allow_deconfig = 1;
+
+ /* "struct client_config_t client_config" is in bb_common_bufsiz1 */
+
+@@ -103,8 +105,9 @@
+ OPT_x = 1 << 18,
+ OPT_f = 1 << 19,
+ OPT_B = 1 << 20,
++ OPT_D = 1 << 21,
+ /* The rest has variable bit positions, need to be clever */
+- OPTBIT_B = 20,
++ OPTBIT_D = 21,
+ USE_FOR_MMU( OPTBIT_b,)
+ IF_FEATURE_UDHCPC_ARPING(OPTBIT_a,)
+ IF_FEATURE_UDHCP_PORT( OPTBIT_P,)
+@@ -1116,7 +1119,8 @@
+ state = RENEW_REQUESTED;
+ break;
+ case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+ case REQUESTING:
+ case RELEASED:
+ change_listen_mode(LISTEN_RAW);
+@@ -1152,7 +1156,8 @@
+ * Users requested to be notified in all cases, even if not in one
+ * of the states above.
+ */
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+
+ change_listen_mode(LISTEN_NONE);
+ state = RELEASED;
+@@ -1265,7 +1270,7 @@
+ /* Parse command line */
+ opt = getopt32long(argv, "^"
+ /* O,x: list; -T,-t,-A take numeric param */
+- "CV:H:h:F:i:np:qRr:s:T:+t:+SA:+O:*ox:*fB"
++ "CV:H:h:F:i:np:qRr:s:T:+t:+SA:+O:*ox:*fBD"
+ USE_FOR_MMU("b")
+ IF_FEATURE_UDHCPC_ARPING("a::")
+ IF_FEATURE_UDHCP_PORT("P:")
+@@ -1376,6 +1381,10 @@
+ logmode |= LOGMODE_SYSLOG;
+ }
+
++ if (opt & OPT_D) {
++ allow_deconfig = 0;
++ }
++
+ /* Make sure fd 0,1,2 are open */
+ bb_sanitize_stdio();
+ /* Create pidfile */
+@@ -1388,7 +1397,8 @@
+ srand(monotonic_us());
+
+ state = INIT_SELECTING;
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+ change_listen_mode(LISTEN_RAW);
+ packet_num = 0;
+ timeout = 0;
+@@ -1555,7 +1565,8 @@
+ }
+ /* Timed out, enter init state */
+ bb_error_msg("lease lost, entering init state");
+- udhcp_run_script(NULL, "deconfig");
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
+ state = INIT_SELECTING;
+ client_config.first_secs = 0; /* make secs field count from 0 */
+ /*timeout = 0; - already is */
+@@ -1748,8 +1759,10 @@
+ "(got ARP reply), declining");
+ send_decline(/*xid,*/ server_addr, packet.yiaddr);
+
+- if (state != REQUESTING)
+- udhcp_run_script(NULL, "deconfig");
++ if (state != REQUESTING) {
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
++ }
+ change_listen_mode(LISTEN_RAW);
+ state = INIT_SELECTING;
+ client_config.first_secs = 0; /* make secs field count from 0 */
+@@ -1818,8 +1831,10 @@
+ /* return to init state */
+ bb_error_msg("received %s", "DHCP NAK");
+ udhcp_run_script(&packet, "nak");
+- if (state != REQUESTING)
+- udhcp_run_script(NULL, "deconfig");
++ if (state != REQUESTING) {
++ if (allow_deconfig)
++ udhcp_run_script(NULL, "deconfig");
++ }
+ change_listen_mode(LISTEN_RAW);
+ sleep(3); /* avoid excessive network traffic */
+ state = INIT_SELECTING;
diff --git a/external/poky/meta/recipes-core/busybox/busybox/defconfig b/external/poky/meta/recipes-core/busybox/busybox/defconfig
new file mode 100644
index 00000000..32213c06
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/defconfig
@@ -0,0 +1,1177 @@
+#
+# Automatically generated make config: don't edit
+# Busybox version: 1.29.1
+# Thu Jul 19 11:09:46 2018
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Settings
+#
+# CONFIG_DESKTOP is not set
+# CONFIG_EXTRA_COMPAT is not set
+# CONFIG_FEDORA_COMPAT is not set
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_USE_PORTABLE_CODE is not set
+CONFIG_SHOW_USAGE=y
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+CONFIG_FEATURE_COMPRESS_USAGE=y
+CONFIG_BUSYBOX=y
+# CONFIG_FEATURE_INSTALLER is not set
+# CONFIG_INSTALL_NO_USR is not set
+# CONFIG_PAM is not set
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_DEVPTS=y
+# CONFIG_FEATURE_CLEAN_UP is not set
+CONFIG_FEATURE_UTMP=y
+# CONFIG_FEATURE_WTMP is not set
+CONFIG_FEATURE_PIDFILE=y
+CONFIG_PID_FILE_PATH="/var/run"
+CONFIG_FEATURE_SUID=y
+CONFIG_FEATURE_SUID_CONFIG=y
+CONFIG_FEATURE_SUID_CONFIG_QUIET=y
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_PREFER_APPLETS is not set
+CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
+CONFIG_FEATURE_SYSLOG=y
+# CONFIG_FEATURE_HAVE_RPC is not set
+CONFIG_PLATFORM_LINUX=y
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+# CONFIG_PIE is not set
+# CONFIG_NOMMU is not set
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_INDIVIDUAL is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_LFS=y
+CONFIG_CROSS_COMPILER_PREFIX=""
+CONFIG_SYSROOT=""
+CONFIG_EXTRA_CFLAGS=""
+CONFIG_EXTRA_LDFLAGS=""
+CONFIG_EXTRA_LDLIBS=""
+
+#
+# Installation Options ("make install" behavior)
+#
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
+# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
+# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
+CONFIG_PREFIX="./_install"
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_DEBUG_SANITIZE is not set
+# CONFIG_UNIT_TEST is not set
+# CONFIG_WERROR is not set
+CONFIG_NO_DEBUG_LIB=y
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+
+#
+# Library Tuning
+#
+# CONFIG_FEATURE_USE_BSS_TAIL is not set
+CONFIG_FEATURE_RTMINMAX=y
+CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+CONFIG_PASSWORD_MINLEN=6
+CONFIG_MD5_SMALL=1
+CONFIG_SHA3_SMALL=1
+CONFIG_FEATURE_FAST_TOP=y
+# CONFIG_FEATURE_ETC_NETWORKS is not set
+# CONFIG_FEATURE_ETC_SERVICES is not set
+CONFIG_FEATURE_EDITING=y
+CONFIG_FEATURE_EDITING_MAX_LEN=1024
+# CONFIG_FEATURE_EDITING_VI is not set
+CONFIG_FEATURE_EDITING_HISTORY=15
+CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
+# CONFIG_FEATURE_REVERSE_SEARCH is not set
+CONFIG_FEATURE_TAB_COMPLETION=y
+CONFIG_FEATURE_USERNAME_COMPLETION=y
+CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+# CONFIG_LOCALE_SUPPORT is not set
+# CONFIG_UNICODE_SUPPORT is not set
+# CONFIG_UNICODE_USING_LOCALE is not set
+# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
+CONFIG_SUBST_WCHAR=0
+CONFIG_LAST_SUPPORTED_WCHAR=0
+# CONFIG_UNICODE_COMBINING_WCHARS is not set
+# CONFIG_UNICODE_WIDE_WCHARS is not set
+# CONFIG_UNICODE_BIDI_SUPPORT is not set
+# CONFIG_UNICODE_NEUTRAL_TABLE is not set
+# CONFIG_UNICODE_PRESERVE_BROKEN is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
+# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
+CONFIG_FEATURE_USE_SENDFILE=y
+CONFIG_FEATURE_COPYBUF_KB=4
+CONFIG_FEATURE_SKIP_ROOTFS=y
+CONFIG_MONOTONIC_SYSCALL=y
+CONFIG_IOCTL_HEX2STR_ERROR=y
+CONFIG_FEATURE_HWIB=y
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+CONFIG_FEATURE_SEAMLESS_XZ=y
+CONFIG_FEATURE_SEAMLESS_LZMA=y
+CONFIG_FEATURE_SEAMLESS_BZ2=y
+CONFIG_FEATURE_SEAMLESS_GZ=y
+CONFIG_FEATURE_SEAMLESS_Z=y
+# CONFIG_AR is not set
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+# CONFIG_FEATURE_AR_CREATE is not set
+# CONFIG_UNCOMPRESS is not set
+CONFIG_GUNZIP=y
+CONFIG_ZCAT=y
+CONFIG_FEATURE_GUNZIP_LONG_OPTIONS=y
+CONFIG_BUNZIP2=y
+CONFIG_BZCAT=y
+# CONFIG_UNLZMA is not set
+CONFIG_LZCAT=y
+# CONFIG_LZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+# CONFIG_UNXZ is not set
+CONFIG_XZCAT=y
+# CONFIG_XZ is not set
+# CONFIG_BZIP2 is not set
+CONFIG_FEATURE_BZIP2_DECOMPRESS=y
+CONFIG_CPIO=y
+# CONFIG_FEATURE_CPIO_O is not set
+# CONFIG_FEATURE_CPIO_P is not set
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+CONFIG_GZIP=y
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+CONFIG_GZIP_FAST=0
+# CONFIG_FEATURE_GZIP_LEVELS is not set
+CONFIG_FEATURE_GZIP_DECOMPRESS=y
+# CONFIG_LZOP is not set
+# CONFIG_UNLZOP is not set
+# CONFIG_LZOPCAT is not set
+# CONFIG_LZOP_COMPR_HIGH is not set
+# CONFIG_RPM is not set
+# CONFIG_RPM2CPIO is not set
+CONFIG_TAR=y
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+CONFIG_FEATURE_TAR_CREATE=y
+CONFIG_FEATURE_TAR_AUTODETECT=y
+CONFIG_FEATURE_TAR_FROM=y
+CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
+# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
+CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
+# CONFIG_FEATURE_TAR_TO_COMMAND is not set
+# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
+CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
+# CONFIG_FEATURE_TAR_SELINUX is not set
+CONFIG_UNZIP=y
+CONFIG_FEATURE_UNZIP_CDF=y
+# CONFIG_FEATURE_UNZIP_BZIP2 is not set
+# CONFIG_FEATURE_UNZIP_LZMA is not set
+# CONFIG_FEATURE_UNZIP_XZ is not set
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+CONFIG_CAT=y
+# CONFIG_FEATURE_CATV is not set
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
+CONFIG_CHROOT=y
+# CONFIG_CKSUM is not set
+# CONFIG_COMM is not set
+CONFIG_CP=y
+# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
+CONFIG_CUT=y
+CONFIG_DATE=y
+# CONFIG_FEATURE_DATE_ISOFMT is not set
+# CONFIG_FEATURE_DATE_NANO is not set
+CONFIG_FEATURE_DATE_COMPAT=y
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
+# CONFIG_FEATURE_DD_IBS_OBS is not set
+# CONFIG_FEATURE_DD_STATUS is not set
+CONFIG_DF=y
+# CONFIG_FEATURE_DF_FANCY is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+CONFIG_DU=y
+CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+CONFIG_FEATURE_ENV_LONG_OPTIONS=y
+# CONFIG_EXPAND is not set
+# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
+# CONFIG_UNEXPAND is not set
+# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
+CONFIG_EXPR=y
+CONFIG_EXPR_MATH_SUPPORT_64=y
+# CONFIG_FACTOR is not set
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+# CONFIG_FSYNC is not set
+CONFIG_HEAD=y
+# CONFIG_FEATURE_FANCY_HEAD is not set
+# CONFIG_HOSTID is not set
+CONFIG_ID=y
+CONFIG_GROUPS=y
+# CONFIG_INSTALL is not set
+# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
+# CONFIG_LINK is not set
+CONFIG_LN=y
+CONFIG_LOGNAME=y
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_WIDTH=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+CONFIG_FEATURE_LS_COLOR=y
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
+CONFIG_MD5SUM=y
+# CONFIG_SHA1SUM is not set
+# CONFIG_SHA256SUM is not set
+# CONFIG_SHA512SUM is not set
+# CONFIG_SHA3SUM is not set
+
+#
+# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum
+#
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
+CONFIG_MKDIR=y
+CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
+CONFIG_MKFIFO=y
+CONFIG_MKNOD=y
+CONFIG_MKTEMP=y
+CONFIG_MV=y
+# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
+# CONFIG_NICE is not set
+# CONFIG_NL is not set
+CONFIG_NOHUP=y
+CONFIG_NPROC=y
+CONFIG_OD=y
+# CONFIG_PASTE is not set
+# CONFIG_PRINTENV is not set
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_REALPATH=y
+CONFIG_RM=y
+CONFIG_RMDIR=y
+# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
+CONFIG_SEQ=y
+# CONFIG_SHRED is not set
+CONFIG_SHUF=y
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+CONFIG_FEATURE_FLOAT_SLEEP=y
+CONFIG_SORT=y
+CONFIG_FEATURE_SORT_BIG=y
+# CONFIG_SPLIT is not set
+# CONFIG_FEATURE_SPLIT_FANCY is not set
+CONFIG_STAT=y
+CONFIG_FEATURE_STAT_FORMAT=y
+CONFIG_FEATURE_STAT_FILESYSTEM=y
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+CONFIG_SYNC=y
+# CONFIG_FEATURE_SYNC_FANCY is not set
+# CONFIG_TAC is not set
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
+CONFIG_TEST=y
+CONFIG_TEST1=y
+CONFIG_TEST2=y
+CONFIG_FEATURE_TEST_64=y
+# CONFIG_TIMEOUT is not set
+CONFIG_TOUCH=y
+CONFIG_FEATURE_TOUCH_NODEREF=y
+CONFIG_FEATURE_TOUCH_SUSV3=y
+CONFIG_TR=y
+CONFIG_FEATURE_TR_CLASSES=y
+# CONFIG_FEATURE_TR_EQUIV is not set
+CONFIG_TRUE=y
+# CONFIG_TRUNCATE is not set
+CONFIG_TTY=y
+CONFIG_UNAME=y
+CONFIG_UNAME_OSNAME="GNU/Linux"
+# CONFIG_BB_ARCH is not set
+CONFIG_UNIQ=y
+CONFIG_UNLINK=y
+CONFIG_USLEEP=y
+# CONFIG_UUDECODE is not set
+# CONFIG_BASE64 is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WC=y
+# CONFIG_FEATURE_WC_LARGE is not set
+CONFIG_WHO=y
+# CONFIG_W is not set
+CONFIG_USERS=y
+CONFIG_WHOAMI=y
+CONFIG_YES=y
+
+#
+# Common options
+#
+CONFIG_FEATURE_VERBOSE=y
+
+#
+# Common options for cp and mv
+#
+# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Console Utilities
+#
+CONFIG_CHVT=y
+CONFIG_CLEAR=y
+CONFIG_DEALLOCVT=y
+CONFIG_DUMPKMAP=y
+# CONFIG_FGCONSOLE is not set
+# CONFIG_KBD_MODE is not set
+CONFIG_LOADFONT=y
+# CONFIG_SETFONT is not set
+# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
+CONFIG_DEFAULT_SETFONT_DIR=""
+
+#
+# Common options for loadfont and setfont
+#
+# CONFIG_FEATURE_LOADFONT_PSF2 is not set
+# CONFIG_FEATURE_LOADFONT_RAW is not set
+CONFIG_LOADKMAP=y
+CONFIG_OPENVT=y
+CONFIG_RESET=y
+# CONFIG_RESIZE is not set
+# CONFIG_FEATURE_RESIZE_PRINT is not set
+CONFIG_SETCONSOLE=y
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+# CONFIG_SHOWKEY is not set
+
+#
+# Debian Utilities
+#
+# CONFIG_PIPE_PROGRESS is not set
+CONFIG_RUN_PARTS=y
+CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
+# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+CONFIG_START_STOP_DAEMON=y
+CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
+CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
+CONFIG_WHICH=y
+
+#
+# klibc-utils
+#
+# CONFIG_MINIPS is not set
+# CONFIG_NUKE is not set
+# CONFIG_RESUME is not set
+# CONFIG_RUN_INIT is not set
+
+#
+# Editors
+#
+CONFIG_AWK=y
+CONFIG_FEATURE_AWK_LIBM=y
+CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y
+CONFIG_CMP=y
+CONFIG_DIFF=y
+# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
+CONFIG_FEATURE_DIFF_DIR=y
+# CONFIG_ED is not set
+CONFIG_PATCH=y
+CONFIG_SED=y
+CONFIG_VI=y
+CONFIG_FEATURE_VI_MAX_LEN=1024
+CONFIG_FEATURE_VI_8BIT=y
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+# CONFIG_FEATURE_VI_DOT_CMD is not set
+# CONFIG_FEATURE_VI_READONLY is not set
+# CONFIG_FEATURE_VI_SETOPTS is not set
+# CONFIG_FEATURE_VI_SET is not set
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
+CONFIG_FEATURE_VI_UNDO=y
+CONFIG_FEATURE_VI_UNDO_QUEUE=y
+CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256
+CONFIG_FEATURE_ALLOW_EXEC=y
+
+#
+# Finding Utilities
+#
+CONFIG_FIND=y
+CONFIG_FEATURE_FIND_PRINT0=y
+CONFIG_FEATURE_FIND_MTIME=y
+CONFIG_FEATURE_FIND_MMIN=y
+CONFIG_FEATURE_FIND_PERM=y
+CONFIG_FEATURE_FIND_TYPE=y
+CONFIG_FEATURE_FIND_XDEV=y
+CONFIG_FEATURE_FIND_MAXDEPTH=y
+CONFIG_FEATURE_FIND_NEWER=y
+# CONFIG_FEATURE_FIND_INUM is not set
+CONFIG_FEATURE_FIND_EXEC=y
+CONFIG_FEATURE_FIND_EXEC_PLUS=y
+CONFIG_FEATURE_FIND_USER=y
+CONFIG_FEATURE_FIND_GROUP=y
+CONFIG_FEATURE_FIND_NOT=y
+CONFIG_FEATURE_FIND_DEPTH=y
+CONFIG_FEATURE_FIND_PAREN=y
+CONFIG_FEATURE_FIND_SIZE=y
+CONFIG_FEATURE_FIND_PRUNE=y
+# CONFIG_FEATURE_FIND_DELETE is not set
+CONFIG_FEATURE_FIND_PATH=y
+CONFIG_FEATURE_FIND_REGEX=y
+# CONFIG_FEATURE_FIND_CONTEXT is not set
+# CONFIG_FEATURE_FIND_LINKS is not set
+CONFIG_GREP=y
+CONFIG_EGREP=y
+CONFIG_FGREP=y
+CONFIG_FEATURE_GREP_CONTEXT=y
+CONFIG_XARGS=y
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
+
+#
+# Init Utilities
+#
+# CONFIG_BOOTCHARTD is not set
+# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
+# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
+# CONFIG_HALT is not set
+# CONFIG_POWEROFF is not set
+CONFIG_REBOOT=y
+# CONFIG_FEATURE_CALL_TELINIT is not set
+# CONFIG_TELINIT_PATH is not set
+# CONFIG_INIT is not set
+# CONFIG_LINUXRC is not set
+# CONFIG_FEATURE_USE_INITTAB is not set
+# CONFIG_FEATURE_KILL_REMOVED is not set
+# CONFIG_FEATURE_KILL_DELAY is not set
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_INIT_SYSLOG is not set
+# CONFIG_FEATURE_INIT_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+# CONFIG_INIT_TERMINAL_TYPE is not set
+# CONFIG_FEATURE_INIT_MODIFY_CMDLINE is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_USE_BB_SHADOW is not set
+CONFIG_USE_BB_CRYPT=y
+# CONFIG_USE_BB_CRYPT_SHA is not set
+# CONFIG_ADD_SHELL is not set
+# CONFIG_REMOVE_SHELL is not set
+# CONFIG_ADDGROUP is not set
+# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
+# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
+# CONFIG_FEATURE_CHECK_NAMES is not set
+CONFIG_LAST_ID=60000
+CONFIG_FIRST_SYSTEM_ID=100
+CONFIG_LAST_SYSTEM_ID=999
+# CONFIG_CHPASSWD is not set
+CONFIG_FEATURE_DEFAULT_PASSWD_ALGO=""
+# CONFIG_CRYPTPW is not set
+# CONFIG_MKPASSWD is not set
+# CONFIG_DELUSER is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
+# CONFIG_GETTY is not set
+# CONFIG_LOGIN is not set
+# CONFIG_LOGIN_SESSION_AS_CHILD is not set
+# CONFIG_LOGIN_SCRIPTS is not set
+# CONFIG_FEATURE_NOLOGIN is not set
+# CONFIG_FEATURE_SECURETTY is not set
+# CONFIG_PASSWD is not set
+# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
+# CONFIG_SU is not set
+# CONFIG_FEATURE_SU_SYSLOG is not set
+# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
+# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+CONFIG_CHATTR=y
+CONFIG_FSCK=y
+# CONFIG_LSATTR is not set
+# CONFIG_TUNE2FS is not set
+
+#
+# Linux Module Utilities
+#
+# CONFIG_MODPROBE_SMALL is not set
+CONFIG_DEPMOD=y
+CONFIG_INSMOD=y
+CONFIG_LSMOD=y
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+# CONFIG_MODINFO is not set
+CONFIG_MODPROBE=y
+# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+CONFIG_RMMOD=y
+
+#
+# Options common to multiple modutils
+#
+CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS=y
+# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
+# CONFIG_FEATURE_2_4_MODULES is not set
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
+# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
+CONFIG_FEATURE_MODUTILS_ALIAS=y
+CONFIG_FEATURE_MODUTILS_SYMBOLS=y
+CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
+CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
+
+#
+# Linux System Utilities
+#
+# CONFIG_ACPID is not set
+# CONFIG_FEATURE_ACPID_COMPAT is not set
+# CONFIG_BLKDISCARD is not set
+# CONFIG_BLKID is not set
+# CONFIG_FEATURE_BLKID_TYPE is not set
+# CONFIG_BLOCKDEV is not set
+# CONFIG_CAL is not set
+CONFIG_DMESG=y
+CONFIG_FEATURE_DMESG_PRETTY=y
+# CONFIG_FALLOCATE is not set
+# CONFIG_FATATTR is not set
+CONFIG_FBSET=y
+CONFIG_FEATURE_FBSET_FANCY=y
+CONFIG_FEATURE_FBSET_READMODE=y
+# CONFIG_FDFORMAT is not set
+CONFIG_FDISK=y
+# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
+CONFIG_FEATURE_FDISK_WRITABLE=y
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_GPT_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FINDFS is not set
+CONFIG_FLOCK=y
+# CONFIG_FDFLUSH is not set
+# CONFIG_FREERAMDISK is not set
+# CONFIG_FSCK_MINIX is not set
+# CONFIG_FSFREEZE is not set
+CONFIG_FSTRIM=y
+# CONFIG_GETOPT is not set
+# CONFIG_FEATURE_GETOPT_LONG is not set
+CONFIG_HEXDUMP=y
+# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
+# CONFIG_HD is not set
+# CONFIG_XXD is not set
+CONFIG_HWCLOCK=y
+CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
+CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+CONFIG_LOSETUP=y
+# CONFIG_LSPCI is not set
+# CONFIG_LSUSB is not set
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_RENAME is not set
+# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+CONFIG_MESG=y
+# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set
+# CONFIG_MKE2FS is not set
+# CONFIG_MKFS_EXT2 is not set
+# CONFIG_MKFS_MINIX is not set
+# CONFIG_FEATURE_MINIX2 is not set
+# CONFIG_MKFS_REISER is not set
+# CONFIG_MKDOSFS is not set
+# CONFIG_MKFS_VFAT is not set
+CONFIG_MKSWAP=y
+# CONFIG_FEATURE_MKSWAP_UUID is not set
+CONFIG_MORE=y
+CONFIG_MOUNT=y
+# CONFIG_FEATURE_MOUNT_FAKE is not set
+# CONFIG_FEATURE_MOUNT_VERBOSE is not set
+# CONFIG_FEATURE_MOUNT_HELPERS is not set
+# CONFIG_FEATURE_MOUNT_LABEL is not set
+# CONFIG_FEATURE_MOUNT_NFS is not set
+# CONFIG_FEATURE_MOUNT_CIFS is not set
+CONFIG_FEATURE_MOUNT_FLAGS=y
+CONFIG_FEATURE_MOUNT_FSTAB=y
+# CONFIG_FEATURE_MOUNT_OTHERTAB is not set
+# CONFIG_NSENTER is not set
+# CONFIG_FEATURE_NSENTER_LONG_OPTS is not set
+CONFIG_PIVOT_ROOT=y
+CONFIG_RDATE=y
+# CONFIG_RDEV is not set
+# CONFIG_READPROFILE is not set
+CONFIG_RENICE=y
+# CONFIG_REV is not set
+# CONFIG_RTCWAKE is not set
+# CONFIG_SCRIPT is not set
+# CONFIG_SCRIPTREPLAY is not set
+# CONFIG_SETARCH is not set
+# CONFIG_LINUX32 is not set
+# CONFIG_LINUX64 is not set
+# CONFIG_SETPRIV is not set
+CONFIG_SWAPON=y
+CONFIG_FEATURE_SWAPON_DISCARD=y
+CONFIG_FEATURE_SWAPON_PRI=y
+CONFIG_SWAPOFF=y
+CONFIG_SWITCH_ROOT=y
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
+# CONFIG_UEVENT is not set
+CONFIG_UMOUNT=y
+CONFIG_FEATURE_UMOUNT_ALL=y
+# CONFIG_UNSHARE is not set
+# CONFIG_WALL is not set
+
+#
+# Common options for mount/umount
+#
+CONFIG_FEATURE_MOUNT_LOOP=y
+CONFIG_FEATURE_MOUNT_LOOP_CREATE=y
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+# CONFIG_VOLUMEID is not set
+
+#
+# Filesystem/Volume identification
+#
+# CONFIG_FEATURE_VOLUMEID_BCACHE is not set
+# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
+# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
+# CONFIG_FEATURE_VOLUMEID_EXFAT is not set
+# CONFIG_FEATURE_VOLUMEID_EXT is not set
+# CONFIG_FEATURE_VOLUMEID_F2FS is not set
+# CONFIG_FEATURE_VOLUMEID_FAT is not set
+# CONFIG_FEATURE_VOLUMEID_HFS is not set
+# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
+# CONFIG_FEATURE_VOLUMEID_JFS is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
+# CONFIG_FEATURE_VOLUMEID_LUKS is not set
+# CONFIG_FEATURE_VOLUMEID_NILFS is not set
+# CONFIG_FEATURE_VOLUMEID_NTFS is not set
+# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
+# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
+# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
+# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set
+# CONFIG_FEATURE_VOLUMEID_SYSV is not set
+# CONFIG_FEATURE_VOLUMEID_UBIFS is not set
+# CONFIG_FEATURE_VOLUMEID_UDF is not set
+# CONFIG_FEATURE_VOLUMEID_XFS is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CONSPY is not set
+# CONFIG_CROND is not set
+# CONFIG_FEATURE_CROND_D is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_FEATURE_CROND_DIR=""
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_HEXEDIT is not set
+# CONFIG_I2CGET is not set
+# CONFIG_I2CSET is not set
+# CONFIG_I2CDUMP is not set
+# CONFIG_I2CDETECT is not set
+CONFIG_LESS=y
+CONFIG_FEATURE_LESS_MAXLINES=9999999
+CONFIG_FEATURE_LESS_BRACKETS=y
+CONFIG_FEATURE_LESS_FLAGS=y
+# CONFIG_FEATURE_LESS_TRUNCATE is not set
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_FEATURE_LESS_WINCH is not set
+# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set
+# CONFIG_FEATURE_LESS_DASHCMD is not set
+# CONFIG_FEATURE_LESS_LINENUMS is not set
+# CONFIG_LSSCSI is not set
+# CONFIG_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
+# CONFIG_PARTPROBE is not set
+CONFIG_RFKILL=y
+# CONFIG_SETSERIAL is not set
+# CONFIG_UBIATTACH is not set
+# CONFIG_UBIDETACH is not set
+# CONFIG_UBIMKVOL is not set
+# CONFIG_UBIRMVOL is not set
+# CONFIG_UBIRSVOL is not set
+# CONFIG_UBIUPDATEVOL is not set
+# CONFIG_UBIRENAME is not set
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CHAT is not set
+# CONFIG_FEATURE_CHAT_NOFAIL is not set
+# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
+# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
+# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
+# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
+# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
+# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
+# CONFIG_CHRT is not set
+# CONFIG_CRONTAB is not set
+CONFIG_DC=y
+# CONFIG_FEATURE_DC_LIBM is not set
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_DEVMEM is not set
+# CONFIG_EJECT is not set
+# CONFIG_FEATURE_EJECT_SCSI is not set
+# CONFIG_FBSPLASH is not set
+# CONFIG_FLASHCP is not set
+# CONFIG_FLASH_LOCK is not set
+# CONFIG_FLASH_UNLOCK is not set
+# CONFIG_FLASH_ERASEALL is not set
+# CONFIG_IONICE is not set
+# CONFIG_INOTIFYD is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MAN is not set
+CONFIG_MICROCOM=y
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_RAIDAUTORUN is not set
+# CONFIG_READAHEAD is not set
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+# CONFIG_SETSID is not set
+# CONFIG_SETFATTR is not set
+CONFIG_STRINGS=y
+CONFIG_TIME=y
+# CONFIG_TIMEOUT is not set
+# CONFIG_TTYSIZE is not set
+# CONFIG_VOLNAME is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+CONFIG_FEATURE_IPV6=y
+# CONFIG_FEATURE_UNIX_LOCAL is not set
+CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
+# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
+# CONFIG_ARP is not set
+# CONFIG_ARPING is not set
+# CONFIG_BRCTL is not set
+# CONFIG_FEATURE_BRCTL_FANCY is not set
+# CONFIG_FEATURE_BRCTL_SHOW is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FTPD is not set
+# CONFIG_FEATURE_FTPD_WRITE is not set
+# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
+# CONFIG_FEATURE_FTPD_AUTHENTICATION is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+CONFIG_HOSTNAME=y
+CONFIG_DNSDOMAINNAME=y
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_RANGES is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
+# CONFIG_FEATURE_HTTPD_PROXY is not set
+# CONFIG_FEATURE_HTTPD_GZIP is not set
+CONFIG_IFCONFIG=y
+CONFIG_FEATURE_IFCONFIG_STATUS=y
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+CONFIG_FEATURE_IFCONFIG_HW=y
+# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
+# CONFIG_IFENSLAVE is not set
+# CONFIG_IFPLUGD is not set
+CONFIG_IFUP=y
+CONFIG_IFDOWN=y
+CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
+CONFIG_FEATURE_IFUPDOWN_IP=y
+CONFIG_FEATURE_IFUPDOWN_IPV4=y
+CONFIG_FEATURE_IFUPDOWN_IPV6=y
+CONFIG_FEATURE_IFUPDOWN_MAPPING=y
+CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP=y
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+CONFIG_IP=y
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPRULE is not set
+# CONFIG_IPNEIGH is not set
+CONFIG_FEATURE_IP_ADDRESS=y
+CONFIG_FEATURE_IP_LINK=y
+CONFIG_FEATURE_IP_ROUTE=y
+CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2"
+CONFIG_FEATURE_IP_TUNNEL=y
+# CONFIG_FEATURE_IP_RULE is not set
+# CONFIG_FEATURE_IP_NEIGH is not set
+# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_NAMEIF is not set
+# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
+# CONFIG_NBDCLIENT is not set
+CONFIG_NC=y
+# CONFIG_NC_SERVER is not set
+# CONFIG_NC_EXTRA is not set
+# CONFIG_NC_110_COMPAT is not set
+CONFIG_NETSTAT=y
+# CONFIG_FEATURE_NETSTAT_WIDE is not set
+# CONFIG_FEATURE_NETSTAT_PRG is not set
+CONFIG_NSLOOKUP=y
+# CONFIG_NTPD is not set
+# CONFIG_FEATURE_NTPD_SERVER is not set
+# CONFIG_FEATURE_NTPD_CONF is not set
+CONFIG_PING=y
+CONFIG_PING6=y
+CONFIG_FEATURE_FANCY_PING=y
+# CONFIG_PSCAN is not set
+CONFIG_ROUTE=y
+# CONFIG_SLATTACH is not set
+# CONFIG_SSL_CLIENT is not set
+# CONFIG_TC is not set
+# CONFIG_FEATURE_TC_INGRESS is not set
+# CONFIG_TCPSVD is not set
+# CONFIG_UDPSVD is not set
+CONFIG_TELNET=y
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+CONFIG_FEATURE_TELNET_AUTOLOGIN=y
+CONFIG_FEATURE_TELNET_WIDTH=y
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_STANDALONE is not set
+# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
+CONFIG_TFTP=y
+# CONFIG_TFTPD is not set
+
+#
+# Common options for tftp/tftpd
+#
+CONFIG_FEATURE_TFTP_GET=y
+CONFIG_FEATURE_TFTP_PUT=y
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
+# CONFIG_TFTP_DEBUG is not set
+CONFIG_TLS=y
+CONFIG_TRACEROUTE=y
+# CONFIG_TRACEROUTE6 is not set
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+# CONFIG_TUNCTL is not set
+# CONFIG_FEATURE_TUNCTL_UG is not set
+# CONFIG_VCONFIG is not set
+CONFIG_WGET=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_TIMEOUT=y
+CONFIG_FEATURE_WGET_HTTPS=y
+# CONFIG_FEATURE_WGET_OPENSSL is not set
+# CONFIG_WHOIS is not set
+# CONFIG_ZCIP is not set
+CONFIG_UDHCPD=y
+# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
+# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
+CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases"
+CONFIG_DUMPLEASES=y
+# CONFIG_DHCPRELAY is not set
+CONFIG_UDHCPC=y
+CONFIG_FEATURE_UDHCPC_ARPING=y
+CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y
+CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
+# CONFIG_UDHCPC6 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC4833 is not set
+# CONFIG_FEATURE_UDHCPC6_RFC5970 is not set
+
+#
+# Common options for DHCP applets
+#
+# CONFIG_FEATURE_UDHCP_PORT is not set
+CONFIG_UDHCP_DEBUG=0
+# CONFIG_FEATURE_UDHCP_RFC3397 is not set
+# CONFIG_FEATURE_UDHCP_8021Q is not set
+CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b"
+
+#
+# Print Utilities
+#
+# CONFIG_LPD is not set
+# CONFIG_LPR is not set
+# CONFIG_LPQ is not set
+
+#
+# Mail Utilities
+#
+# CONFIG_MAKEMIME is not set
+# CONFIG_POPMAILDIR is not set
+# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
+# CONFIG_REFORMIME is not set
+# CONFIG_FEATURE_REFORMIME_COMPAT is not set
+# CONFIG_SENDMAIL is not set
+CONFIG_FEATURE_MIME_CHARSET=""
+
+#
+# Process Utilities
+#
+CONFIG_FREE=y
+CONFIG_FUSER=y
+# CONFIG_IOSTAT is not set
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+# CONFIG_KILLALL5 is not set
+# CONFIG_LSOF is not set
+# CONFIG_MPSTAT is not set
+# CONFIG_NMETER is not set
+# CONFIG_PGREP is not set
+# CONFIG_PKILL is not set
+CONFIG_PIDOF=y
+# CONFIG_FEATURE_PIDOF_SINGLE is not set
+# CONFIG_FEATURE_PIDOF_OMIT is not set
+# CONFIG_PMAP is not set
+# CONFIG_POWERTOP is not set
+# CONFIG_FEATURE_POWERTOP_INTERACTIVE is not set
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+CONFIG_FEATURE_PS_LONG=y
+# CONFIG_FEATURE_PS_TIME is not set
+# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
+# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
+# CONFIG_PSTREE is not set
+# CONFIG_PWDX is not set
+# CONFIG_SMEMCAP is not set
+CONFIG_BB_SYSCTL=y
+CONFIG_TOP=y
+# CONFIG_FEATURE_TOP_INTERACTIVE is not set
+CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
+CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
+# CONFIG_FEATURE_TOP_SMP_CPU is not set
+# CONFIG_FEATURE_TOP_DECIMALS is not set
+# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
+# CONFIG_FEATURE_TOPMEM is not set
+CONFIG_UPTIME=y
+# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
+CONFIG_WATCH=y
+# CONFIG_FEATURE_SHOW_THREADS is not set
+
+#
+# Runit Utilities
+#
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
+# CONFIG_SV is not set
+CONFIG_SV_DEFAULT_SERVICE_DIR=""
+# CONFIG_SVC is not set
+# CONFIG_SVOK is not set
+# CONFIG_SVLOGD is not set
+# CONFIG_CHCON is not set
+# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
+# CONFIG_GETENFORCE is not set
+# CONFIG_GETSEBOOL is not set
+# CONFIG_LOAD_POLICY is not set
+# CONFIG_MATCHPATHCON is not set
+# CONFIG_RUNCON is not set
+# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_SESTATUS is not set
+# CONFIG_SETENFORCE is not set
+# CONFIG_SETFILES is not set
+# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
+# CONFIG_RESTORECON is not set
+# CONFIG_SETSEBOOL is not set
+
+#
+# Shells
+#
+CONFIG_SH_IS_ASH=y
+# CONFIG_SH_IS_HUSH is not set
+# CONFIG_SH_IS_NONE is not set
+# CONFIG_BASH_IS_ASH is not set
+# CONFIG_BASH_IS_HUSH is not set
+CONFIG_BASH_IS_NONE=y
+CONFIG_ASH=y
+CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
+CONFIG_ASH_INTERNAL_GLOB=y
+CONFIG_ASH_BASH_COMPAT=y
+CONFIG_ASH_JOB_CONTROL=y
+CONFIG_ASH_ALIAS=y
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+CONFIG_ASH_EXPAND_PRMT=y
+# CONFIG_ASH_IDLE_TIMEOUT is not set
+# CONFIG_ASH_MAIL is not set
+CONFIG_ASH_ECHO=y
+CONFIG_ASH_PRINTF=y
+CONFIG_ASH_TEST=y
+CONFIG_ASH_HELP=y
+CONFIG_ASH_GETOPTS=y
+CONFIG_ASH_CMDCMD=y
+# CONFIG_CTTYHACK is not set
+# CONFIG_HUSH is not set
+# CONFIG_HUSH_BASH_COMPAT is not set
+# CONFIG_HUSH_BRACE_EXPANSION is not set
+# CONFIG_HUSH_INTERACTIVE is not set
+# CONFIG_HUSH_SAVEHISTORY is not set
+# CONFIG_HUSH_JOB is not set
+# CONFIG_HUSH_TICK is not set
+# CONFIG_HUSH_IF is not set
+# CONFIG_HUSH_LOOPS is not set
+# CONFIG_HUSH_CASE is not set
+# CONFIG_HUSH_FUNCTIONS is not set
+# CONFIG_HUSH_LOCAL is not set
+# CONFIG_HUSH_RANDOM_SUPPORT is not set
+# CONFIG_HUSH_MODE_X is not set
+# CONFIG_HUSH_ECHO is not set
+# CONFIG_HUSH_PRINTF is not set
+# CONFIG_HUSH_TEST is not set
+# CONFIG_HUSH_HELP is not set
+# CONFIG_HUSH_EXPORT is not set
+# CONFIG_HUSH_EXPORT_N is not set
+# CONFIG_HUSH_KILL is not set
+# CONFIG_HUSH_WAIT is not set
+# CONFIG_HUSH_TRAP is not set
+# CONFIG_HUSH_TYPE is not set
+# CONFIG_HUSH_READ is not set
+# CONFIG_HUSH_SET is not set
+# CONFIG_HUSH_UNSET is not set
+# CONFIG_HUSH_ULIMIT is not set
+# CONFIG_HUSH_UMASK is not set
+# CONFIG_HUSH_MEMLEAK is not set
+# CONFIG_MSH is not set
+
+#
+# Options common to all shells
+#
+CONFIG_FEATURE_SH_MATH=y
+# CONFIG_FEATURE_SH_MATH_64 is not set
+CONFIG_FEATURE_SH_EXTRA_QUIET=y
+# CONFIG_FEATURE_SH_STANDALONE is not set
+# CONFIG_FEATURE_SH_NOFORK is not set
+CONFIG_FEATURE_SH_HISTFILESIZE=y
+
+#
+# System Logging Utilities
+#
+CONFIG_KLOGD=y
+
+#
+# klogd should not be used together with syslog to kernel printk buffer
+#
+CONFIG_FEATURE_KLOGD_KLOGCTL=y
+CONFIG_LOGGER=y
+# CONFIG_LOGREAD is not set
+# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
+# CONFIG_SYSLOGD is not set
+# CONFIG_FEATURE_ROTATE_LOGFILE is not set
+# CONFIG_FEATURE_REMOTE_LOG is not set
+# CONFIG_FEATURE_SYSLOGD_DUP is not set
+# CONFIG_FEATURE_SYSLOGD_CFG is not set
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0
+# CONFIG_FEATURE_IPC_SYSLOG is not set
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
+# CONFIG_FEATURE_KMSG_SYSLOG is not set
diff --git a/external/poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch b/external/poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch
new file mode 100644
index 00000000..820acc26
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/fail_on_no_media.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Denied
+[https://www.mail-archive.com/busybox@busybox.net/msg22354.html]
+
+The current behaviour of busybox is to try all fstype when automounting
+even when no media exists. The util-linux mount command bails when no
+media exists, so change the behaviour of busybox to do the same.
+
+It could also be argued that the KERN_INFO message from btrfs could be
+removed, but that would be harder to accomplish.
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: busybox-1.20.2/util-linux/mount.c
+===================================================================
+--- busybox-1.20.2.orig/util-linux/mount.c
++++ busybox-1.20.2/util-linux/mount.c
+@@ -598,7 +598,13 @@ static int mount_it_now(struct mntent *m
+ break;
+ errno = errno_save;
+ }
+-
++ /*
++ * Break if there is no media, no point retrying for all
++ * fs types since there is no media available
++ */
++ if (rc == -1 && errno == ENOMEDIUM) {
++ bb_perror_msg_and_die("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
++ }
+ if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS))
+ break;
+ if (!(vfsflags & MS_SILENT))
diff --git a/external/poky/meta/recipes-core/busybox/busybox/getopts.cfg b/external/poky/meta/recipes-core/busybox/busybox/getopts.cfg
new file mode 100644
index 00000000..8db0a4a8
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/getopts.cfg
@@ -0,0 +1,3 @@
+CONFIG_GETOPT=y
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_GETOPT_LONG=y
diff --git a/external/poky/meta/recipes-core/busybox/busybox/init.cfg b/external/poky/meta/recipes-core/busybox/busybox/init.cfg
new file mode 100644
index 00000000..e9670068
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/init.cfg
@@ -0,0 +1,8 @@
+CONFIG_INIT=y
+CONFIG_RUNLEVEL=y
+CONFIG_FEATURE_USE_INITTAB=y
+CONFIG_HALT=y
+CONFIG_POWEROFF=y
+CONFIG_FEATURE_KILL_DELAY=0
+CONFIG_TELINIT_PATH=""
+CONFIG_INIT_TERMINAL_TYPE=""
diff --git a/external/poky/meta/recipes-core/busybox/busybox/login-utilities.cfg b/external/poky/meta/recipes-core/busybox/busybox/login-utilities.cfg
new file mode 100644
index 00000000..cc9b2db5
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/login-utilities.cfg
@@ -0,0 +1,13 @@
+CONFIG_FEATURE_SHADOWPASSWDS=y
+CONFIG_ADDUSER=y
+CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y
+CONFIG_ADDGROUP=y
+CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS=y
+CONFIG_DELUSER=y
+CONFIG_DELGROUP=y
+CONFIG_GETTY=y
+CONFIG_LOGIN=y
+CONFIG_PASSWD=y
+CONFIG_SU=y
+CONFIG_SULOGIN=y
+CONFIG_VLOCK=y
diff --git a/external/poky/meta/recipes-core/busybox/busybox/makefile-libbb-race.patch b/external/poky/meta/recipes-core/busybox/busybox/makefile-libbb-race.patch
new file mode 100644
index 00000000..97278ab9
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/makefile-libbb-race.patch
@@ -0,0 +1,34 @@
+There is a potential race when building libbb, as some header files
+needed by libbb are not generated yet (or are being modified) at the time
+libbb is compiled.
+This patch avoids this scenario by building libbb as the last directory.
+
+Upstream-Status: Submitted
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+Index: busybox-1.24.1/Makefile
+===================================================================
+diff --git a/Makefile b/Makefile
+index 5cfc763..69f3831 100644
+--- a/Makefile
++++ b/Makefile
+@@ -738,9 +738,18 @@ $(sort $(busybox-all)): $(busybox-dirs) ;
+ # Error messages still appears in the original language
+
+ PHONY += $(busybox-dirs)
+-$(busybox-dirs): prepare scripts
++
++libbb-dir = $(filter libbb,$(busybox-dirs))
++busybox-dirs1 = $(filter-out libbb,$(busybox-dirs))
++
++$(busybox-dirs1): prepare scripts
+ $(Q)$(MAKE) $(build)=$@
+
++ifneq ($(libbb-dir),)
++$(libbb-dir): | $(busybox-dirs1)
++ $(Q)$(MAKE) $(build)=$@
++endif
++
+ # Build the kernel release string
+ # The KERNELRELEASE is stored in a file named .kernelrelease
+ # to be used when executing for example make install or make modules_install
diff --git a/external/poky/meta/recipes-core/busybox/busybox/mdev.cfg b/external/poky/meta/recipes-core/busybox/busybox/mdev.cfg
new file mode 100644
index 00000000..6aefe90e
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/mdev.cfg
@@ -0,0 +1,11 @@
+CONFIG_MDEV=y
+CONFIG_FEATURE_MDEV_CONF=y
+CONFIG_FEATURE_MDEV_RENAME=y
+CONFIG_FEATURE_MDEV_RENAME_REGEXP=y
+CONFIG_FEATURE_MDEV_EXEC=y
+CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
+
+CONFIG_SETSID=y
+CONFIG_CTTYHACK=y
+
+CONFIG_FEATURE_SHADOWPASSWDS=y
diff --git a/external/poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg b/external/poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg
new file mode 100644
index 00000000..2fe7ab2e
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/mount-via-label.cfg
@@ -0,0 +1,9 @@
+CONFIG_BLKID=y
+CONFIG_FEATURE_BLKID_TYPE=y
+CONFIG_FEATURE_MOUNT_LABEL=y
+CONFIG_VOLUMEID=y
+CONFIG_FEATURE_VOLUMEID_BTRFS=y
+CONFIG_FEATURE_VOLUMEID_EXT=y
+CONFIG_FEATURE_VOLUMEID_F2FS=y
+CONFIG_FEATURE_VOLUMEID_FAT=y
+CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
diff --git a/external/poky/meta/recipes-core/busybox/busybox/musl.cfg b/external/poky/meta/recipes-core/busybox/busybox/musl.cfg
new file mode 100644
index 00000000..6fffc910
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/musl.cfg
@@ -0,0 +1,11 @@
+# CONFIG_EXTRA_COMPAT is not set
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_HAVE_RPC is not set
+# CONFIG_WERROR is not set
+# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+# CONFIG_PAM is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_FEATURE_MOUNT_NFS is not set
+# CONFIG_FEATURE_UTMP is not set
+
diff --git a/external/poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch b/external/poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch
new file mode 100644
index 00000000..f42c74ca
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/recognize_connmand.patch
@@ -0,0 +1,21 @@
+This adds connmand to the list of know dhcp clients
+
+Upstream-Status: Inappropriate [OE-Core]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: busybox-1.22.1/networking/ifupdown.c
+===================================================================
+--- busybox-1.22.1.orig/networking/ifupdown.c
++++ busybox-1.22.1/networking/ifupdown.c
+@@ -521,6 +521,10 @@ struct dhcp_client_t {
+ };
+
+ static const struct dhcp_client_t ext_dhcp_clients[] = {
++ { "connmand",
++ "true",
++ "true",
++ },
+ { "dhcpcd",
+ "dhcpcd[[ -h %hostname%]][[ -i %vendor%]][[ -I %client%]][[ -l %leasetime%]] %iface%",
+ "dhcpcd -k %iface%",
diff --git a/external/poky/meta/recipes-core/busybox/busybox/resize.cfg b/external/poky/meta/recipes-core/busybox/busybox/resize.cfg
new file mode 100644
index 00000000..a1d9c95b
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/resize.cfg
@@ -0,0 +1,2 @@
+CONFIG_RESIZE=y
+CONFIG_FEATURE_RESIZE_PRINT=y
diff --git a/external/poky/meta/recipes-core/busybox/busybox/sha1sum.cfg b/external/poky/meta/recipes-core/busybox/busybox/sha1sum.cfg
new file mode 100644
index 00000000..20e72d92
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/sha1sum.cfg
@@ -0,0 +1 @@
+CONFIG_SHA1SUM=y
diff --git a/external/poky/meta/recipes-core/busybox/busybox/sha256sum.cfg b/external/poky/meta/recipes-core/busybox/busybox/sha256sum.cfg
new file mode 100644
index 00000000..ce652ae4
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/sha256sum.cfg
@@ -0,0 +1 @@
+CONFIG_SHA256SUM=y
diff --git a/external/poky/meta/recipes-core/busybox/busybox/syslog.cfg b/external/poky/meta/recipes-core/busybox/busybox/syslog.cfg
new file mode 100644
index 00000000..e2425ed8
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox/syslog.cfg
@@ -0,0 +1,11 @@
+CONFIG_SYSLOGD=y
+CONFIG_FEATURE_ROTATE_LOGFILE=y
+CONFIG_FEATURE_REMOTE_LOG=y
+CONFIG_FEATURE_SYSLOGD_DUP=y
+CONFIG_FEATURE_SYSLOGD_CFG=y
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
+CONFIG_FEATURE_IPC_SYSLOG=y
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=64
+CONFIG_LOGREAD=y
+CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
+CONFIG_FEATURE_KMSG_SYSLOG=y
diff --git a/external/poky/meta/recipes-core/busybox/busybox_1.29.3.bb b/external/poky/meta/recipes-core/busybox/busybox_1.29.3.bb
new file mode 100644
index 00000000..5714d707
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/busybox_1.29.3.bb
@@ -0,0 +1,50 @@
+require busybox.inc
+
+SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
+ file://busybox-udhcpc-no_deconfig.patch \
+ file://find-touchscreen.sh \
+ file://busybox-cron \
+ file://busybox-httpd \
+ file://busybox-udhcpd \
+ file://default.script \
+ file://simple.script \
+ file://hwclock.sh \
+ file://mount.busybox \
+ file://syslog \
+ file://syslog-startup.conf \
+ file://syslog.conf \
+ file://busybox-syslog.default \
+ file://mdev \
+ file://mdev.conf \
+ file://mdev-mount.sh \
+ file://umount.busybox \
+ file://defconfig \
+ file://busybox-syslog.service.in \
+ file://busybox-klogd.service.in \
+ file://fail_on_no_media.patch \
+ file://run-ptest \
+ file://inetd.conf \
+ file://inetd \
+ file://login-utilities.cfg \
+ file://recognize_connmand.patch \
+ file://busybox-cross-menuconfig.patch \
+ file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \
+ file://mount-via-label.cfg \
+ file://sha1sum.cfg \
+ file://sha256sum.cfg \
+ file://getopts.cfg \
+ file://resize.cfg \
+ ${@["", "file://init.cfg"][(d.getVar('VIRTUAL-RUNTIME_init_manager') == 'busybox')]} \
+ ${@["", "file://mdev.cfg"][(d.getVar('VIRTUAL-RUNTIME_dev_manager') == 'busybox-mdev')]} \
+ file://syslog.cfg \
+ file://inittab \
+ file://rcS \
+ file://rcK \
+ file://makefile-libbb-race.patch \
+ file://CVE-2018-20679.patch \
+ file://CVE-2019-5747.patch \
+"
+SRC_URI_append_libc-musl = " file://musl.cfg "
+
+SRC_URI[tarball.md5sum] = "0a367e19cdfd157e8258d87f893ee516"
+SRC_URI[tarball.sha256sum] = "97648636e579462296478e0218e65e4bc1e9cd69089a3b1aeb810bff7621efb7"
diff --git a/external/poky/meta/recipes-core/busybox/files/busybox-cron b/external/poky/meta/recipes-core/busybox/files/busybox-cron
new file mode 100755
index 00000000..f0e6b156
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/busybox-cron
@@ -0,0 +1,39 @@
+#!/bin/sh
+DAEMON=/usr/sbin/crond
+NAME=crond
+DESC="Busybox Periodic Command Scheduler"
+ARGS="-c /etc/cron/crontabs"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ start-stop-daemon -K -n $NAME
+ echo "done."
+ ;;
+ restart)
+ echo -n "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/external/poky/meta/recipes-core/busybox/files/busybox-httpd b/external/poky/meta/recipes-core/busybox/files/busybox-httpd
new file mode 100755
index 00000000..c8348e54
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/busybox-httpd
@@ -0,0 +1,44 @@
+#!/bin/sh
+DAEMON=/usr/sbin/httpd
+NAME=httpd
+DESC="Busybox HTTP Daemon"
+HTTPROOT="/srv/www"
+ARGS="-h $HTTPROOT"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ if [ ! -d $HTTPROOT ]; then
+ echo "$HTTPROOT is missing."
+ exit 1
+ fi
+ start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ start-stop-daemon -K -n $NAME
+ echo "done."
+ ;;
+ restart)
+ echo "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/external/poky/meta/recipes-core/busybox/files/busybox-klogd.service.in b/external/poky/meta/recipes-core/busybox/files/busybox-klogd.service.in
new file mode 100644
index 00000000..d7c77558
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/busybox-klogd.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Kernel Logging Service
+
+[Service]
+ExecStart=@base_sbindir@/klogd -n
+
+[Install]
+WantedBy=multi-user.target
diff --git a/external/poky/meta/recipes-core/busybox/files/busybox-syslog.default b/external/poky/meta/recipes-core/busybox/files/busybox-syslog.default
new file mode 100644
index 00000000..2dced802
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/busybox-syslog.default
@@ -0,0 +1,25 @@
+#OPTIONS="-C"
+# The above option means syslogd will log to 16K shm circular buffer.
+# You could use `logread' to read it.
+
+# All available options are:
+# -O FILE : Log to FILE (default:/var/log/messages)
+# -l N : Log only messages more urgent than prio N (1-8)
+# -S : Smaller output
+# -s SIZE : Max size (KB) before rotation (default:200KB, 0=off)
+# -b N : N rotated logs to keep (default:1, max=99, 0=purge)
+# -R HOST[:PORT]: Log to HOST:PORT (default PORT:514)
+# -L : Log locally and via network
+# -D : Drop duplicates
+# -C[size_kb] : Log to shared mem buffer (use logread to read it)
+# -f FILE : Use FILE as config (default:/etc/syslog.conf)
+# -m MIN : Minutes between mark lines (default:20, 0=off)
+# -K : Log to kernel printk buffer (use dmesg to read it)
+
+# Example 1:
+# Log to local file /var/log/mylog
+# OPTIONS="-O /var/log/mylog"
+#
+# Example 2:
+# Log to remote host
+# OPTIONS="-R 192.168.1.1:601"
diff --git a/external/poky/meta/recipes-core/busybox/files/busybox-syslog.service.in b/external/poky/meta/recipes-core/busybox/files/busybox-syslog.service.in
new file mode 100644
index 00000000..2e043213
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/busybox-syslog.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=System Logging Service
+Wants=busybox-klogd.service
+
+[Service]
+EnvironmentFile=-/etc/default/busybox-syslog
+ExecStart=@base_sbindir@/syslogd -n $OPTIONS
+Sockets=syslog.socket
+
+[Install]
+WantedBy=multi-user.target
+Also=busybox-klogd.service
+Alias=syslog.service
diff --git a/external/poky/meta/recipes-core/busybox/files/busybox-udhcpd b/external/poky/meta/recipes-core/busybox/files/busybox-udhcpd
new file mode 100755
index 00000000..c43903e8
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/busybox-udhcpd
@@ -0,0 +1,43 @@
+#!/bin/sh
+DAEMON=/usr/sbin/udhcpd
+NAME=udhcpd
+DESC="Busybox UDHCP Server"
+ARGS="/etc/udhcpd.conf"
+
+test -f $DAEMON || exit 1
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ if [ ! -f /etc/udhcpd.conf ]; then
+ echo "error: /etc/udhcpd.conf is missing."
+ exit 1
+ fi
+ /sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ /sbin/start-stop-daemon -K -n $NAME
+ echo "done."
+ ;;
+ restart)
+ echo "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/external/poky/meta/recipes-core/busybox/files/default.script b/external/poky/meta/recipes-core/busybox/files/default.script
new file mode 100644
index 00000000..f2ac987a
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/default.script
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec run-parts -a "$1" /etc/udhcpc.d
+
diff --git a/external/poky/meta/recipes-core/busybox/files/find-touchscreen.sh b/external/poky/meta/recipes-core/busybox/files/find-touchscreen.sh
new file mode 100644
index 00000000..52c5e7a0
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/find-touchscreen.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if grep -q "input:.*-e0.*,3,.*a0,1,\|ads7846" /sys/class/$MDEV/device/modalias ; then
+ ln -sf /dev/$MDEV /dev/input/touchscreen0
+fi
+
diff --git a/external/poky/meta/recipes-core/busybox/files/hwclock.sh b/external/poky/meta/recipes-core/busybox/files/hwclock.sh
new file mode 100644
index 00000000..be5f94d8
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/hwclock.sh
@@ -0,0 +1,83 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: hwclock
+# Required-Start:
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Set system clock
+# Description: Set system clock to hardware clock, according to the UTC
+# setting in /etc/default/rcS (see also rcS(5)).
+### END INIT INFO
+#
+# WARNING: If your hardware clock is not in UTC/GMT, this script
+# must know the local time zone. This information is
+# stored in /etc/localtime. This might be a problem if
+# your /etc/localtime is a symlink to something in
+# /usr/share/zoneinfo AND /usr isn't in the root
+# partition! The workaround is to define TZ either
+# in /etc/default/rcS, or in the proper place below.
+
+[ ! -x /sbin/hwclock ] && exit 0
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+[ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime"
+case "$1" in
+ start)
+ if [ "$VERBOSE" != no ]
+ then
+ echo "System time was `date`."
+ echo "Setting the System Clock using the Hardware Clock as reference..."
+ fi
+
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ if [ -z "$TZ" ]
+ then
+ hwclock $tz --hctosys
+ else
+ TZ="$TZ" hwclock $tz --hctosys
+ fi
+ fi
+
+ if [ "$VERBOSE" != no ]
+ then
+ echo "System Clock set. System local time is now `date`."
+ fi
+ ;;
+ stop|restart|reload|force-reload)
+ #
+ # Updates the Hardware Clock with the System Clock time.
+ # This will *override* any changes made to the Hardware Clock.
+ #
+ # WARNING: If you disable this, any changes to the system
+ # clock will not be carried across reboots.
+ #
+ if [ "$VERBOSE" != no ]
+ then
+ echo "Saving the System Clock time to the Hardware Clock..."
+ fi
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ hwclock $tz --systohc
+ fi
+ if [ "$VERBOSE" != no ]
+ then
+ echo "Hardware Clock updated to `date`."
+ fi
+ exit 0
+ ;;
+ show)
+ if [ "$HWCLOCKACCESS" != no ]
+ then
+ hwclock $tz --show
+ fi
+ ;;
+ *)
+ echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2
+ echo " start sets kernel (system) clock from hardware (RTC) clock" >&2
+ echo " stop and reload set hardware (RTC) clock from kernel (system) clock" >&2
+ exit 1
+ ;;
+esac
diff --git a/external/poky/meta/recipes-core/busybox/files/inetd b/external/poky/meta/recipes-core/busybox/files/inetd
new file mode 100644
index 00000000..cf50bcd5
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/inetd
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# start/stop inetd super server.
+
+if ! [ -x /usr/sbin/inetd ]; then
+ exit 0
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting internet superserver:"
+ echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping internet superserver:"
+ echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null
+ echo "."
+ ;;
+ restart)
+ echo -n "Restarting internet superserver:"
+ echo -n " inetd "
+ killall -HUP inetd
+ echo "."
+ ;;
+ *)
+ echo "Usage: /etc/init.d/inetd {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/external/poky/meta/recipes-core/busybox/files/inetd.conf b/external/poky/meta/recipes-core/busybox/files/inetd.conf
new file mode 100644
index 00000000..b02fe850
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/inetd.conf
@@ -0,0 +1,20 @@
+# /etc/inetd.conf: see inetd(8) for further informations.
+#
+# Internet server configuration database
+#
+# If you want to disable an entry so it isn't touched during
+# package updates just comment it out with a single '#' character.
+#
+# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
+#
+#:INTERNAL: Internal services
+#echo stream tcp nowait root internal
+#echo dgram udp wait root internal
+#chargen stream tcp nowait root internal
+#chargen dgram udp wait root internal
+#discard stream tcp nowait root internal
+#discard dgram udp wait root internal
+#daytime stream tcp nowait root internal
+#daytime dgram udp wait root internal
+#time stream tcp nowait root internal
+#time dgram udp wait root internal
diff --git a/external/poky/meta/recipes-core/busybox/files/inittab b/external/poky/meta/recipes-core/busybox/files/inittab
new file mode 100644
index 00000000..2bc831c7
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/inittab
@@ -0,0 +1,24 @@
+# This is run first except when booting in single-user mode.
+
+# Startup the system
+::sysinit:/bin/mount -t proc proc /proc
+::sysinit:/bin/mount -t sysfs sysfs /sys
+::sysinit:/bin/mount -t devtmpfs devtmpfs /dev
+::sysinit:/bin/mount -o remount,rw /
+::sysinit:/bin/mkdir -p /dev/pts
+::sysinit:/bin/mount -t devpts devpts /dev/pts
+::sysinit:/bin/mount -a
+
+::sysinit:/etc/init.d/rcS
+
+# Stuff to do before rebooting
+::ctrlaltdel:/sbin/reboot
+::shutdown:/etc/init.d/rcK
+::shutdown:/sbin/swapoff -a
+::shutdown:/bin/umount -a -r
+
+# Stuff to do when restarting the init process
+::restart:/sbin/init
+
+# set hostname
+null::sysinit:/bin/busybox hostname -F /etc/hostname
diff --git a/external/poky/meta/recipes-core/busybox/files/mdev b/external/poky/meta/recipes-core/busybox/files/mdev
new file mode 100755
index 00000000..8c9c06e9
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/mdev
@@ -0,0 +1,21 @@
+#!/bin/sh
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+mount -t tmpfs tmpfs /dev -o size=64k,mode=0755
+mkdir /dev/pts /dev/shm
+chmod 777 /dev/shm
+mount -t devpts devpts /dev/pts
+touch /dev/mdev.seq
+#sysctl -w kernel.hotplug=/sbin/mdev
+echo "/sbin/mdev" > /proc/sys/kernel/hotplug
+mdev -s
+
+#
+# We might have mounted something over /dev, see if /dev/initctl is there.
+#
+if test ! -p /dev/initctl
+then
+ rm -f /dev/initctl
+ mknod -m 600 /dev/initctl p
+fi
+
diff --git a/external/poky/meta/recipes-core/busybox/files/mdev-mount.sh b/external/poky/meta/recipes-core/busybox/files/mdev-mount.sh
new file mode 100644
index 00000000..130e9472
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/mdev-mount.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+MDEV_AUTOMOUNT=y
+MDEV_AUTOMOUNT_ROOT=/run/media
+[ -f /etc/default/mdev ] && . /etc/default/mdev
+if [ "${MDEV_AUTOMOUNT}" = "n" ] ; then
+ exit 0
+fi
+
+case "$ACTION" in
+ add|"")
+ ACTION="add"
+ # check if already mounted
+ if grep -q "^/dev/${MDEV} " /proc/mounts ; then
+ # Already mounted
+ exit 0
+ fi
+ DEVBASE=`expr substr $MDEV 1 3`
+ if [ "${DEVBASE}" = "mmc" ] ; then
+ DEVBASE=`expr substr $MDEV 1 7`
+ fi
+ # check for "please don't mount it" file
+ if [ -f "/dev/nomount.${DEVBASE}" ] ; then
+ # blocked
+ exit 0
+ fi
+ # check for full-disk partition
+ if [ "${DEVBASE}" = "${MDEV}" ] ; then
+ if [ -f /sys/block/${DEVBASE}/${DEVBASE}*1/partition ] ; then
+ # Partition detected, just quit
+ exit 0
+ fi
+ if [ ! -f /sys/block/${DEVBASE}/size ] ; then
+ # No size at all
+ exit 0
+ fi
+ if [ "`cat /sys/block/${DEVBASE}/size`" = "0" ] ; then
+ # empty device, bail out
+ exit 0
+ fi
+ fi
+ # first allow fstab to determine the mountpoint
+ if ! mount /dev/$MDEV > /dev/null 2>&1
+ then
+ MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV"
+ mkdir -p "$MOUNTPOINT"
+ mount -t auto /dev/$MDEV "$MOUNTPOINT" || rmdir "$MOUNTPOINT"
+ fi
+ ;;
+ remove)
+ MOUNTPOINT=`grep "^/dev/$MDEV\s" /proc/mounts | cut -d' ' -f 2`
+ if [ ! -z "$MOUNTPOINT" ]
+ then
+ umount "$MOUNTPOINT"
+ rmdir "$MOUNTPOINT"
+ else
+ umount /dev/$MDEV
+ fi
+ ;;
+ *)
+ # Unexpected keyword
+ exit 1
+ ;;
+esac
diff --git a/external/poky/meta/recipes-core/busybox/files/mdev.conf b/external/poky/meta/recipes-core/busybox/files/mdev.conf
new file mode 100644
index 00000000..4e9c23f1
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/mdev.conf
@@ -0,0 +1,44 @@
+$MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"
+
+console 0:0 0600
+cpu_dma_latency 0:0 0660
+fb0:0 44 0660
+full 0:0 0666
+initctl 0:0 0600
+ircomm[0-9].* 0:20 0660
+kmem 0:15 0640
+kmsg 0:0 0660
+log 0:0 0666
+loop[0-9].* 0:6 0640
+mem 0:15 0640
+network_latency 0:0 0660
+network_throughput 0:0 0660
+null 0:0 0666
+port 0:15 0640
+ptmx 0:5 0666
+ram[0-9].* 0:6 0640
+random 0:0 0666
+sda 0:6 0640
+tty 0:5 0666
+tty.* 0:0 0620
+urandom 0:0 0666
+usbdev.* 0:0 0660 */etc/mdev/usb.sh
+vcs.* 0:5 0660
+zero 0:0 0666
+
+snd/pcm.* 0:0 0660
+snd/control.* 0:0 0660
+snd/timer 0:0 0660
+snd/seq 0:0 0660
+snd/mini.* 0:00 0660
+
+input/event.* 0:0 0660 @/etc/mdev/find-touchscreen.sh
+input/mice 0:0 0660
+input/mouse.* 0:0 0660
+
+tun[0-9]* 0:0 0660 =net/
+
+[hs]d[a-z][0-9]? 0:0 660 */etc/mdev/mdev-mount.sh
+mmcblk[0-9]rpmb 0:0 660
+mmcblk[0-9]boot[0-9] 0:0 660
+mmcblk[0-9].* 0:0 660 */etc/mdev/mdev-mount.sh
diff --git a/external/poky/meta/recipes-core/busybox/files/mount.busybox b/external/poky/meta/recipes-core/busybox/files/mount.busybox
new file mode 100755
index 00000000..fef945b7
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/mount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox mount $@
diff --git a/external/poky/meta/recipes-core/busybox/files/rcK b/external/poky/meta/recipes-core/busybox/files/rcK
new file mode 100644
index 00000000..f8a63e13
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/rcK
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Stop all init scripts in /etc/rc6.d
+# executing them in numerical order.
+#
+for i in /etc/rc6.d/K??*; do
+
+ # Ignore dangling symlinks (if any).
+ [ ! -f "$i" ] && continue
+
+ case "$i" in
+ *.sh)
+ # Source shell script for speed.
+ (
+ trap - INT QUIT TSTP
+ set stop
+ . $i
+ )
+ ;;
+ *)
+ # No sh extension, so fork subprocess.
+ $i stop
+ ;;
+ esac
+done
+
diff --git a/external/poky/meta/recipes-core/busybox/files/rcS b/external/poky/meta/recipes-core/busybox/files/rcS
new file mode 100644
index 00000000..bb03eb60
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/rcS
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Start all init scripts in /etc/rcS.d and /etc/rc5.d
+# executing them in numerical order.
+#
+
+for i in /etc/rcS.d/S??* /etc/rc5.d/S??* ;do
+
+ # Ignore dangling symlinks (if any).
+ [ ! -f "$i" ] && continue
+
+ case "$i" in
+ *.sh)
+ # Source shell script for speed.
+ (
+ trap - INT QUIT TSTP
+ set start
+ . $i
+ )
+ ;;
+ *)
+ # No sh extension, so fork subprocess.
+ $i start
+ ;;
+ esac
+done
+
diff --git a/external/poky/meta/recipes-core/busybox/files/run-ptest b/external/poky/meta/recipes-core/busybox/files/run-ptest
new file mode 100644
index 00000000..3608a8eb
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+current_dir=$(readlink -f $0)
+export bindir=$(dirname $current_dir)
+
+cd testsuite || exit 1
+./runtest -v | sed -r 's/^(SKIPPED|UNTESTED):/SKIP:/'
diff --git a/external/poky/meta/recipes-core/busybox/files/simple.script b/external/poky/meta/recipes-core/busybox/files/simple.script
new file mode 100644
index 00000000..6ed02935
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/simple.script
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+# udhcpc script edited by Tim Riker <Tim@Rikers.org>
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+RESOLV_CONF="/etc/resolv.conf"
+[ -n "$subnet" ] && NETMASK="netmask $subnet"
+
+# return 0 if root is mounted on a network filesystem
+root_is_nfs() {
+ sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
+ grep -q "^/ \(nfs\|smbfs\|ncp\|coda\)$"
+}
+
+have_bin_ip=0
+if [ -x /SBIN_DIR/ip ]; then
+ have_bin_ip=1
+ BROADCAST="broadcast +"
+fi
+
+[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+
+case "$1" in
+ deconfig)
+ if [ -x /SBIN_DIR/resolvconf ]; then
+ /SBIN_DIR/resolvconf -d "${interface}.udhcpc"
+ fi
+ if ! root_is_nfs ; then
+ if [ $have_bin_ip -eq 1 ]; then
+ /SBIN_DIR/ip addr flush dev $interface
+ /SBIN_DIR/ip link set dev $interface up
+ else
+ /SBIN_DIR/ifconfig $interface 0.0.0.0
+ fi
+ fi
+ ;;
+
+ renew|bound)
+ if [ $have_bin_ip -eq 1 ]; then
+ /SBIN_DIR/ip addr add dev $interface local $ip/$mask $BROADCAST
+ else
+ /SBIN_DIR/ifconfig $interface $ip $BROADCAST $NETMASK
+ fi
+
+ if [ -n "$router" ] ; then
+ if ! root_is_nfs ; then
+ if [ $have_bin_ip -eq 1 ]; then
+ while /SBIN_DIR/ip route del default dev $interface 2>/dev/null ; do
+ :
+ done
+ else
+ while /SBIN_DIR/route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
+ :
+ done
+ fi
+ fi
+
+ metric=10
+ for i in $router ; do
+ if [ $have_bin_ip -eq 1 ]; then
+ /SBIN_DIR/ip route add default via $i metric $metric
+ else
+ /SBIN_DIR/route add default gw $i dev $interface metric $metric 2>/dev/null
+ fi
+ metric=$(($metric + 1))
+ done
+ fi
+
+ # Update resolver configuration file
+ R=""
+ [ -n "$domain" ] && R="domain $domain
+"
+ for i in $dns; do
+ echo "$0: Adding DNS $i"
+ R="${R}nameserver $i
+"
+ done
+
+ if [ -x /SBIN_DIR/resolvconf ]; then
+ echo -n "$R" | /SBIN_DIR/resolvconf -a "${interface}.udhcpc"
+ else
+ echo -n "$R" > "$RESOLV_CONF"
+ fi
+ ;;
+esac
+
+exit 0
diff --git a/external/poky/meta/recipes-core/busybox/files/syslog b/external/poky/meta/recipes-core/busybox/files/syslog
new file mode 100644
index 00000000..89c4d12e
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/syslog
@@ -0,0 +1,77 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: sysklogd
+# Required-Start: $remote_fs $time
+# Required-Stop: $remote_fs $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: System logger
+### END INIT INFO
+
+set -e
+
+if [ -f /etc/syslog-startup.conf ]; then
+ . /etc/syslog-startup.conf
+ LOG_LOCAL=0
+ LOG_REMOTE=0
+ for D in $DESTINATION; do
+ if [ "$D" = "buffer" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
+ LOG_LOCAL=1
+ elif [ "$D" = "file" ]; then
+ if [ -n "$LOGFILE" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
+ fi
+ if [ -n "$ROTATESIZE" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
+ fi
+ if [ -n "$ROTATEGENS" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
+ fi
+ LOG_LOCAL=1
+ elif [ "$D" = "remote" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
+ LOG_REMOTE=1
+ fi
+ done
+ if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -L"
+ fi
+ if [ "$REDUCE" = "yes" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -S"
+ fi
+ if [ "$DROPDUPLICATES" = "yes" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -D"
+ fi
+ if [ -n "$LOGLEVEL" ]; then
+ SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
+ fi
+else
+ # default: log to 16K shm circular buffer
+ SYSLOG_ARGS="-C"
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting syslogd/klogd: "
+ start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
+ start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
+ echo "done"
+ ;;
+ stop)
+ echo -n "Stopping syslogd/klogd: "
+ start-stop-daemon -K -n syslogd
+ start-stop-daemon -K -n klogd
+ echo "done"
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: syslog { start | stop | restart }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/external/poky/meta/recipes-core/busybox/files/syslog-startup.conf b/external/poky/meta/recipes-core/busybox/files/syslog-startup.conf
new file mode 100644
index 00000000..fda450aa
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/syslog-startup.conf
@@ -0,0 +1,13 @@
+# This configuration file is used by the busybox syslog init script,
+# /etc/init.d/syslog[.busybox] to set syslog configuration at start time.
+
+DESTINATION=file # log destinations (buffer file remote)
+LOGFILE=/var/log/messages # where to log (file)
+REMOTE=loghost:514 # where to log (syslog remote)
+REDUCE=no # reduce-size logging
+DROPDUPLICATES=no # whether to drop duplicate log entries
+#ROTATESIZE=0 # rotate log if grown beyond X [kByte]
+#ROTATEGENS=3 # keep X generations of rotated logs
+BUFFERSIZE=64 # size of circular buffer [kByte]
+FOREGROUND=no # run in foreground (don't use!)
+#LOGLEVEL=5 # local log level (between 1 and 8)
diff --git a/external/poky/meta/recipes-core/busybox/files/syslog.conf b/external/poky/meta/recipes-core/busybox/files/syslog.conf
new file mode 100644
index 00000000..75bb6309
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/syslog.conf
@@ -0,0 +1 @@
+# /etc/syslog.conf Configuration file for busybox's syslogd utility
diff --git a/external/poky/meta/recipes-core/busybox/files/umount.busybox b/external/poky/meta/recipes-core/busybox/files/umount.busybox
new file mode 100755
index 00000000..f3731626
--- /dev/null
+++ b/external/poky/meta/recipes-core/busybox/files/umount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox umount $@
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch
new file mode 100644
index 00000000..ace4bf0a
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Cover-the-else-with-__GLIBC__.patch
@@ -0,0 +1,51 @@
+From b6a59b05f1fa514c6b387c9544bd63b1bfcf2eed Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 05:38:29 +0000
+Subject: [PATCH] Cover the else with __GLIBC__
+
+Fixes build errors on musl/x86
+
+| In file included from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/asm/termios.h:1:0,
+| from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/linux/termios.h:5,
+| from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/console-tools/0.3.2-r8/console-tools-0.3.2/vttools/resizecons.c:86:
+|
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/asm-generic/termios.h:14:8:
+error: redefinition of 'struct winsize'
+| struct winsize {
+| ^
+| In file included from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/sys/ioctl.h:7:0,
+| from
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/console-tools/0.3.2-r8/console-tools-0.3.2/vttools/resizecons.c:81:
+|
+/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/sysroots/qemux86/usr/include/bits/ioctl.h:90:8:
+note: originally defined here
+| struct winsize {
+| ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ vttools/resizecons.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vttools/resizecons.c b/vttools/resizecons.c
+index f0a7055..e8753b1 100644
+--- a/vttools/resizecons.c
++++ b/vttools/resizecons.c
+@@ -81,7 +81,7 @@
+ #include <sys/ioctl.h>
+ #if (__GNU_LIBRARY__ >= 6)
+ # include <sys/perm.h>
+-#else
++#elif defined __GLIBC__
+ # include <linux/types.h>
+ # include <linux/termios.h>
+ #endif
+--
+2.7.0
+
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch
new file mode 100644
index 00000000..6e72ec66
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-Fix-format-security-compilation-error.patch
@@ -0,0 +1,57 @@
+Subject: Fix 'format-security' compilation error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ kbdtools/kbd_mode.c | 6 +++---
+ kbdtools/setmetamode.c | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/kbdtools/kbd_mode.c b/kbdtools/kbd_mode.c
+index 02dca38..8dbcd39 100644
+--- a/kbdtools/kbd_mode.c
++++ b/kbdtools/kbd_mode.c
+@@ -120,7 +120,7 @@ int main(int argc, char *argv[])
+ /* report mode */
+ if (ioctl(fd, KDGKBMODE, &mode))
+ {
+- fprintf(stderr, progname);
++ fprintf(stderr, "%s", progname);
+ perror(_(": error reading keyboard mode\n"));
+ exit(1);
+ }
+@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
+ kbd_rep.period = rate;
+ if (ioctl(fd, KDKBDREP, &kbd_rep))
+ {
+- fprintf(stderr, progname);
++ fprintf(stderr, "%s", progname);
+ perror(_(": error setting keyboard repeat mode\n"));
+ exit(1);
+ }
+@@ -160,7 +160,7 @@ int main(int argc, char *argv[])
+
+ if (ioctl(fd, KDSKBMODE, mode))
+ {
+- fprintf(stderr, progname);
++ fprintf(stderr, "%s", progname);
+ perror(_(": error setting keyboard mode\n"));
+ exit(1);
+ }
+diff --git a/kbdtools/setmetamode.c b/kbdtools/setmetamode.c
+index 5bed945..0ba7676 100644
+--- a/kbdtools/setmetamode.c
++++ b/kbdtools/setmetamode.c
+@@ -42,7 +42,7 @@ void report(int meta)
+ default:
+ s = N_("Strange mode for Meta key?\n");
+ }
+- printf(_(s));
++ printf("%s", _(s));
+ }
+
+ struct meta
+--
+2.8.3
+
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch
new file mode 100644
index 00000000..64b5b044
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch
@@ -0,0 +1,44 @@
+From 0fd5dda51d68e1ec2a87e27b5ed0dff3503b4681 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 08:12:38 +0000
+Subject: [PATCH] kbdtools: Include sys/types.h for u_char and u_short
+ definition
+
+on musl this gets exposed since sys/types.h is not
+included via some other indirect inclusion as is the case with glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ kbdtools/dumpkeys.c | 1 +
+ kbdtools/loadkeys.y | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/kbdtools/dumpkeys.c b/kbdtools/dumpkeys.c
+index 6159d49..c19fb21 100644
+--- a/kbdtools/dumpkeys.c
++++ b/kbdtools/dumpkeys.c
+@@ -26,6 +26,7 @@
+ #include <errno.h>
+ #include <sysexits.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
+ #include <linux/types.h>
+ #include <linux/kd.h>
+ #include <linux/keyboard.h>
+diff --git a/kbdtools/loadkeys.y b/kbdtools/loadkeys.y
+index b6a8e01..4468f77 100644
+--- a/kbdtools/loadkeys.y
++++ b/kbdtools/loadkeys.y
+@@ -71,6 +71,7 @@
+ #include <linux/kd.h>
+ #include <linux/keyboard.h>
+ #include <sys/ioctl.h>
++#include <sys/types.h>
+ #include <ctype.h>
+ #include <sysexits.h>
+ #include <signal.h>
+--
+2.6.4
+
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars
new file mode 100644
index 00000000..32692ab4
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars
@@ -0,0 +1,41 @@
+# 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 email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS =
+
+# 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/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch
new file mode 100644
index 00000000..c2870147
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- console-tools-0.3.2/contrib/codepage.c~codepage
++++ console-tools-0.3.2/contrib/codepage.c
+@@ -229,7 +229,7 @@
+ return 0;
+
+ fprintf(stderr, "\
+-Warning: CP format is a hack!\n
++Warning: CP format is a hack!\n\
+ The files produced may or may not be usable!\n");
+
+ sprintf(outfile, "%d.cp", CPEntryHeader.codepage);
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch
new file mode 100644
index 00000000..c93f5119
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch
@@ -0,0 +1,12 @@
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/kbdtools/showkey.c~compile 1999-08-25 17:20:08.000000000 -0400
++++ console-tools-0.3.2/kbdtools/showkey.c 2004-05-09 03:03:23.000000000 -0400
+@@ -264,7 +264,6 @@
+ break;
+ case cmd_keymap:
+ printf(")\n");
+- default:
+ }
+ }
+
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch
new file mode 100644
index 00000000..15c100c9
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/configure.in~configure
++++ console-tools-0.3.2/configure.in
+@@ -2,13 +2,14 @@
+ dnl Process this file with autoconf to produce a configure script.
+
+ # Initialize
+-AC_INIT(kbdtools/loadkeys.y)
++AC_INIT
++AC_CONFIG_SRCDIR([kbdtools/loadkeys.y])
+
+ define(ct_unicodedata_default,/usr/share/unidata/UnicodeData-2.txt)
+ ct_localdatadir_default=/usr/local/share # iff --enable-localdatadir without specific dir
+
+ #AC_CONFIG_AUX_DIR(autoconf)
+-AC_CANONICAL_SYSTEM
++AC_CANONICAL_TARGET([])
+ AM_INIT_AUTOMAKE(console-tools, 0.3.2)
+
+ # Defaults
+@@ -25,7 +26,6 @@
+ # i18n stuff
+ ALL_LINGUAS="cs de ru ga fr"
+ AM_GNU_GETTEXT
+-AC_OUTPUT_COMMANDS([sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
+
+ AC_DEFINE_UNQUOTED(LOCALEDIR, "/usr/share/locale")
+
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch
new file mode 100644
index 00000000..be61eb84
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch
@@ -0,0 +1,56 @@
+Fix the following error detected with i586-pokymllib32-linux-gcc (the
+multilib x86-64 lib32 compiler):
+ ../lib/ctutils/.libs/libctutils.so: undefined reference to `get_kernel_sfm'
+ collect2: error: ld returned 1 exit status
+
+It seems that libctutils.so (the library that uses get_kernel_sfm) must
+be stated before libconsole.so (the library that exports the function) when
+using multilib gcc
+
+Upstream-Status: Pending
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: console-tools-0.3.2/fontfiletools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/fontfiletools/Makefile.am
++++ console-tools-0.3.2/fontfiletools/Makefile.am
+@@ -10,5 +10,5 @@ EXTRA_DIST = fonts2virfont.c virfont.h
+
+ # libconsole is needed by ctutils
+ LDADD = ../lib/ctlocal/libctlocal.a ../lib/cfont/libcfont.la \
+- ../lib/console/libconsole.la \
+- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
++ ../lib/ctutils/libctutils.la \
++ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+Index: console-tools-0.3.2/vttools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/vttools/Makefile.am
++++ console-tools-0.3.2/vttools/Makefile.am
+@@ -7,9 +7,9 @@ bin_PROGRAMS = chvt deallocvt writevt fg
+ vcstime vt-is-UTF8 openvt @RESIZECONS@
+ EXTRA_PROGRAMS = resizecons
+
+-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \
++LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \
+ ../lib/cfont/libcfont.la \
+- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
++ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+
+ vcstime_LDADD = ../lib/ctlocal/libctlocal.a
+ screendump_LDADD = ../lib/ctlocal/libctlocal.a
+Index: console-tools-0.3.2/kbdtools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/kbdtools/Makefile.am
++++ console-tools-0.3.2/kbdtools/Makefile.am
+@@ -15,9 +15,9 @@ EXTRA_PROGRAMS = getkeycodes setkeycodes
+ loadkeys_SOURCES = loadkeys.y analyze.l
+
+ YFLAGS = -d
+-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \
++LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \
+ ../lib/cfont/libcfont.la \
+- ../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
++ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+
+ loadkeys_LDADD = $(LDADD) @LEXLIB@
+
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch
new file mode 100644
index 00000000..f370be85
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch
@@ -0,0 +1,75 @@
+Patch from Matthias Goebl <oe@m.goebl.net>
+Added via OE bugtracker: bug #478
+
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/kbdtools/kbd_mode.c.orig
++++ console-tools-0.3.2/kbdtools/kbd_mode.c
+@@ -29,11 +29,16 @@
+ OPT("-u --unicode ", _("UTF-8 mode (UNICODE)"));
+ OPT("-s --scancode ", _("scancode mode (RAW)"));
+ OPT(" --mode={8bit,keycode,unicode,scancode} ", _("set mode"));
++ OPT("-r --rate=RATE ", _("set repeat rate (default: 33)"));
++ OPT("-d --delay=DELAY ", _("set repeat delay (default: 250)"));
+
+ OPT("-h --help ", HELPDESC);
+ OPT("-V --version ", VERSIONDESC);
+ }
+
++int rate=-1;
++int delay=-1;
++
+ static int parse_cmdline (int argc, char *argv[])
+ {
+ int mode = -1;
+@@ -46,11 +51,13 @@
+ { "mode" , required_argument, NULL, 'm' },
+ { "scancode" , no_argument, NULL, 's' },
+ { "unicode" , no_argument, NULL, 'u' },
++ { "rate" , required_argument, NULL, 'r' },
++ { "delay" , required_argument, NULL, 'd' },
+ { NULL, 0, NULL, 0 }
+ };
+ int c;
+
+- while ( (c = getopt_long (argc, argv, "Vhaksu", long_opts, NULL)) != EOF)
++ while ( (c = getopt_long (argc, argv, "Vhaksur:d:", long_opts, NULL)) != EOF)
+ switch (c) {
+ case 'h':
+ usage ();
+@@ -58,6 +65,14 @@
+ case 'V':
+ version ();
+ exit(0);
++ case 'r':
++ rate = atoi(optarg);
++ mode = -2;
++ break;
++ case 'd':
++ delay = atoi(optarg);
++ mode = -2;
++ break;
+ case 'a':
+ mode = K_XLATE;
+ break;
+@@ -129,6 +144,20 @@
+ exit(0);
+ }
+
++ if ( rate != -1 || delay != -1 )
++ {
++ struct kbd_repeat kbd_rep;
++ kbd_rep.delay = delay;
++ kbd_rep.period = rate;
++ if (ioctl(fd, KDKBDREP, &kbd_rep))
++ {
++ fprintf(stderr, progname);
++ perror(_(": error setting keyboard repeat mode\n"));
++ exit(1);
++ }
++ if(mode==-2) exit(0);
++ }
++
+ if (ioctl(fd, KDSKBMODE, mode))
+ {
+ fprintf(stderr, progname);
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4 b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4
new file mode 100644
index 00000000..18d47a94
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4
@@ -0,0 +1,24 @@
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file can be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU General Public
+# License or the GNU Library General Public License but which still want
+# to provide support for the GNU gettext functionality.
+# Please note that the actual code of the GNU gettext library is covered
+# by the GNU Library General Public License, and the rest of the GNU
+# gettext package package is covered by the GNU General Public License.
+# They are *not* in the public domain.
+
+# serial 2
+
+AC_DEFUN([AM_LC_MESSAGES],
+ [if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+ fi])
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch
new file mode 100644
index 00000000..a6735a53
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch
@@ -0,0 +1,19 @@
+No reason to link with libfl since 'loadkeys' implements
+its own yywrap()/yylex() functions.
+
+Upstream-Status: Pending
+Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
+
+Index: console-tools-0.3.2/kbdtools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/kbdtools/Makefile.am
++++ console-tools-0.3.2/kbdtools/Makefile.am
+@@ -19,8 +19,6 @@ LDADD = ../lib/ctlocal/libctlocal.a ../l
+ ../lib/cfont/libcfont.la \
+ ../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+
+-loadkeys_LDADD = $(LDADD) @LEXLIB@
+-
+ bin_SCRIPTS = mk_modmap
+
+ noinst_HEADERS = loadkeys.h
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch
new file mode 100644
index 00000000..2ed60921
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch
@@ -0,0 +1,22 @@
+The docs need tools we don't have to build so disable them.
+
+Also remove intl since the Makefile doesn't work with 3.82 and we
+don't want to build libintl anyway.
+
+Upstream-Status: Inappropriate [configuration]
+RP 2012/10/17
+
+Index: console-tools-0.3.2/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/Makefile.am 1999-04-15 01:33:24.000000000 +0000
++++ console-tools-0.3.2/Makefile.am 2012-10-17 11:48:14.107069145 +0000
+@@ -1,7 +1,7 @@
+ # -*- makefile -*-
+ AUTOMAKE_OPTIONS = foreign
+
+-SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib doc \
+- compat include examples po intl
++SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib \
++ compat include examples po
+
+ EXTRA_DIST = BUGS RELEASE CREDITS COPYING.kbd local-scripts/* debian/* *.lsm
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch
new file mode 100644
index 00000000..0c95068a
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch
@@ -0,0 +1,49 @@
+Fixing the locale issues isn't enough, console-tools also does a couple of
+other pretty stupid things (like FILE *f; f->_fileno instead of fileno(f)),
+
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/lib/cfont/fontstruct.c.ark 2005-05-22 19:12:38.000000000 +0000
++++ console-tools-0.3.2/lib/cfont/fontstruct.c 2005-05-22 19:13:23.000000000 +0000
+@@ -50,8 +50,7 @@
+ * get filesize
+ */
+
+- /* FIXME: should not use _fileno ! */
+- if (fstat(fontfile->_fileno, &stbuf) == -1)
++ if (fstat(fileno(fontfile), &stbuf) == -1)
+ goto rsf_return_error;
+
+ if (S_ISREG(stbuf.st_mode))
+@@ -211,8 +210,7 @@
+ * get filesize
+ */
+
+- /* FIXME: should not use _fileno ! */
+- if (fstat(fontfile->_fileno, &stbuf) == -1)
++ if (fstat(fileno(fontfile), &stbuf) == -1)
+ goto rfg_return_error;
+
+ if (S_ISREG(stbuf.st_mode))
+--- console-tools-0.3.2/lib/console/acm.c.ark 2005-05-22 19:17:15.000000000 +0000
++++ console-tools-0.3.2/lib/console/acm.c 2005-05-22 19:17:23.000000000 +0000
+@@ -30,7 +30,7 @@
+ lct_boolean parse_failed = False;
+ lct_boolean is_unicode;
+
+- if (fstat(fp->_fileno, &stbuf))
++ if (fstat(fileno(fp), &stbuf))
+ perror(_("Cannot stat ACM file")), exit(1);
+
+ /* first try a wg15-charmap (glibc) file format */
+--- console-tools-0.3.2/include/lct/local.h.ark 2005-05-22 19:08:54.000000000 +0000
++++ console-tools-0.3.2/include/lct/local.h 2005-05-22 19:09:12.000000000 +0000
+@@ -8,7 +8,7 @@
+ #include <locale.h>
+
+
+-#ifdef HAVE_LOCALE_H
++#if defined(HAVE_LOCALE_H) && defined(HAVE_LIBINTL_H)
+ # include <libintl.h>
+ # define _(String) gettext (String)
+ # ifdef gettext_noop
diff --git a/external/poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb b/external/poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb
new file mode 100644
index 00000000..ba44fbe6
--- /dev/null
+++ b/external/poky/meta/recipes-core/console-tools/console-tools_0.3.2.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Allows you to set-up and manipulate the Linux console"
+DESCRIPTION = "Provides tools that enable the set-up and manipulation of the linux console and console-font files."
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING.kbd;md5=9b2d91511d3d80d4d20ac6e6b0137fe9"
+DEPENDS = "flex-native bison-native"
+PR = "r8"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lct/console-tools-${PV}.tar.gz \
+ file://codepage.patch \
+ file://configure.patch \
+ file://compile.patch \
+ file://kbdrate.patch \
+ file://uclibc-fileno.patch \
+ file://nodocs.patch \
+ file://fix-libconsole-linking.patch \
+ file://no-dep-on-libfl.patch \
+ file://0001-kbdtools-Include-sys-types.h-for-u_char-and-u_short-.patch \
+ file://0001-Cover-the-else-with-__GLIBC__.patch \
+ file://0001-Fix-format-security-compilation-error.patch \
+ file://lcmessage.m4 \
+ file://Makevars"
+
+SRC_URI[md5sum] = "bf21564fc38b3af853ef724babddbacd"
+SRC_URI[sha256sum] = "eea6b441672dacd251079fc85ed322e196282e0e66c16303ec64c3a2b1c126c2"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lct/files/console-tools-devel/"
+UPSTREAM_CHECK_REGEX = "/console-tools-devel/(?P<pver>(\d\d?\.)+\d\d?)/"
+
+inherit autotools gettext update-alternatives
+
+CFLAGS_append_aarch64 = " -D_USE_TERMIOS "
+
+ASNEEDED = ""
+
+do_configure_prepend () {
+ mkdir -p ${S}/m4
+ cp ${WORKDIR}/lcmessage.m4 ${S}/m4/
+ rm -f ${S}/acinclude.m4
+ cp ${WORKDIR}/Makevars ${S}/po/
+}
+
+ALTERNATIVE_PRIORITY = "30"
+
+bindir_progs = "chvt deallocvt fgconsole openvt"
+ALTERNATIVE_${PN} = "${bindir_progs}"
+
+RDEPENDS_${PN} = "bash"
diff --git a/external/poky/meta/recipes-core/coreutils/coreutils/0001-local.mk-fix-cross-compiling-problem.patch b/external/poky/meta/recipes-core/coreutils/coreutils/0001-local.mk-fix-cross-compiling-problem.patch
new file mode 100644
index 00000000..66f9a716
--- /dev/null
+++ b/external/poky/meta/recipes-core/coreutils/coreutils/0001-local.mk-fix-cross-compiling-problem.patch
@@ -0,0 +1,26 @@
+Subject: local.mk: fix cross compiling problem
+
+We meet the following error when cross compiling.
+| Makefile:3418: *** Recursive variable 'INSTALL' references itself (eventually). Stop.
+This patch fixes this problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/local.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/local.mk b/src/local.mk
+index 36dfa4e..c5898cc 100644
+--- a/src/local.mk
++++ b/src/local.mk
+@@ -649,4 +649,4 @@ cu_install_program = @INSTALL_PROGRAM@
+ else
+ cu_install_program = src/ginstall
+ endif
+-INSTALL = $(cu_install_program) -c
++INSTALL_PROGRAM = $(cu_install_program)
+--
+2.1.0
+
diff --git a/external/poky/meta/recipes-core/coreutils/coreutils/0001-uname-report-processor-and-hardware-correctly.patch b/external/poky/meta/recipes-core/coreutils/coreutils/0001-uname-report-processor-and-hardware-correctly.patch
new file mode 100644
index 00000000..3c43e1d5
--- /dev/null
+++ b/external/poky/meta/recipes-core/coreutils/coreutils/0001-uname-report-processor-and-hardware-correctly.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Denied
+
+Subject: uname: report processor and hardware correctly
+
+This patch is rejected by coreutils upstream, but distros like debian and fedora
+uses this patch to make `uname -i' and `uname -p' to not report 'unknown'.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/uname.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/src/uname.c b/src/uname.c
+index 39bd28c..c84582d 100644
+--- a/src/uname.c
++++ b/src/uname.c
+@@ -299,13 +299,19 @@ main (int argc, char **argv)
+
+ if (toprint & PRINT_PROCESSOR)
+ {
+- char const *element = unknown;
++ char *element = unknown;
+ #if HAVE_SYSINFO && defined SI_ARCHITECTURE
+ {
+ static char processor[257];
+ if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
+ element = processor;
+ }
++#else
++ {
++ static struct utsname u;
++ uname(&u);
++ element = u.machine;
++ }
+ #endif
+ #ifdef UNAME_PROCESSOR
+ if (element == unknown)
+@@ -343,7 +349,7 @@ main (int argc, char **argv)
+
+ if (toprint & PRINT_HARDWARE_PLATFORM)
+ {
+- char const *element = unknown;
++ char *element = unknown;
+ #if HAVE_SYSINFO && defined SI_PLATFORM
+ {
+ static char hardware_platform[257];
+@@ -361,6 +367,14 @@ main (int argc, char **argv)
+ if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
+ element = hardware_platform;
+ }
++#else
++ {
++ static struct utsname u;
++ uname(&u);
++ element = u.machine;
++ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
++ element[1]='3';
++ }
+ #endif
+ if (! (toprint == UINT_MAX && element == unknown))
+ print_element (element);
+--
+1.9.1
+
diff --git a/external/poky/meta/recipes-core/coreutils/coreutils/disable-ls-output-quoting.patch b/external/poky/meta/recipes-core/coreutils/coreutils/disable-ls-output-quoting.patch
new file mode 100644
index 00000000..e68c2135
--- /dev/null
+++ b/external/poky/meta/recipes-core/coreutils/coreutils/disable-ls-output-quoting.patch
@@ -0,0 +1,49 @@
+Subject: revert inconsistent ls quoting
+
+This is a revert of upstream commit 109b9220cead6e979d22d16327c4d9f8350431cc.
+
+Bug-Debian: https://bugs.debian.org/813164
+
+Upstream-Status: Submitted
+
+Originally-by: Adam Borowski <kilobyte@angband.pl>
+[PG: patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813164#78 ]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+---
+
+--- coreutils-8.25.orig/NEWS
++++ coreutils-8.25/NEWS
+@@ -71,9 +71,6 @@ GNU coreutils NEWS
+ df now prefers sources towards the root of a device when
+ eliding duplicate bind mounted entries.
+
+- ls now quotes file names unambiguously and appropriate for use in a shell,
+- when outputting to a terminal.
+-
+ join, sort, uniq with --zero-terminated, now treat '\n' as a field delimiter.
+
+ ** Improvements
+--- coreutils-8.25.orig/doc/coreutils.texi
++++ coreutils-8.25/doc/coreutils.texi
+@@ -7750,8 +7750,8 @@ this"} in the default C locale. This lo
+
+ You can specify the default value of the @option{--quoting-style} option
+ with the environment variable @env{QUOTING_STYLE}@. If that environment
+-variable is not set, the default value is @samp{shell-escape} when the
+-output is a terminal, and @samp{literal} otherwise.
++variable is not set, the default value is @samp{literal}, but this
++default may change to @samp{shell} in a future version of this package.
+
+ @item --show-control-chars
+ @opindex --show-control-chars
+--- coreutils-8.25.orig/src/ls.c
++++ coreutils-8.25/src/ls.c
+@@ -1581,7 +1581,6 @@ decode_switches (int argc, char **argv)
+ if (isatty (STDOUT_FILENO))
+ {
+ format = many_per_line;
+- set_quoting_style (NULL, shell_escape_quoting_style);
+ /* See description of qmark_funny_chars, above. */
+ qmark_funny_chars = true;
+ }
diff --git a/external/poky/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch b/external/poky/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch
new file mode 100644
index 00000000..9d1ae55d
--- /dev/null
+++ b/external/poky/meta/recipes-core/coreutils/coreutils/fix-selinux-flask.patch
@@ -0,0 +1,39 @@
+From a1d360509fa3a4aff57eedcd528cc0347a87531d Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 16 Sep 2014 01:59:08 -0700
+Subject: [PATCH] gnulib-comp.m4: selinux/flask.h should respect to
+ with_selinux
+
+Fixed when build with meta-selinux even when --without-selinux:
+runcon.c:49:28: fatal error: selinux/flask.h: No such file or directory
+ # include <selinux/flask.h>
+ ^
+compilation terminated.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ m4/gnulib-comp.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
+index 472d3a0..5f09734 100644
+--- a/m4/gnulib-comp.m4
++++ b/m4/gnulib-comp.m4
+@@ -1730,11 +1730,11 @@ AC_DEFUN([gl_INIT],
+ AC_LIBOBJ([select])
+ fi
+ gl_SYS_SELECT_MODULE_INDICATOR([select])
+- AC_CHECK_HEADERS([selinux/flask.h])
+ AC_LIBOBJ([selinux-at])
+ gl_HEADERS_SELINUX_SELINUX_H
+ gl_HEADERS_SELINUX_CONTEXT_H
+ if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
++ AC_CHECK_HEADERS([selinux/flask.h])
+ AC_LIBOBJ([getfilecon])
+ fi
+ gl_SERVENT
+--
+1.7.9.5
+
diff --git a/external/poky/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch b/external/poky/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch
new file mode 100644
index 00000000..2ef8a548
--- /dev/null
+++ b/external/poky/meta/recipes-core/coreutils/coreutils/remove-usr-local-lib-from-m4.patch
@@ -0,0 +1,31 @@
+We have problem using hardcoded directories like /usr/local here
+which will be checked for cross builds. This is a special case which
+is valid for AIX only. We do not have AIX as one of our supported
+build host or target. Therefore we get rid of the hardcoded paths
+and make life easier for cross compilation process.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [Upstream does care for AIX while we may not]
+
+Index: coreutils-8.14/m4/getloadavg.m4
+===================================================================
+--- coreutils-8.14.orig/m4/getloadavg.m4 2011-09-19 08:09:24.000000000 -0700
++++ coreutils-8.14/m4/getloadavg.m4 2011-10-19 21:42:00.385533357 -0700
+@@ -41,16 +41,6 @@
+ [LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
+ fi
+
+- if test $gl_func_getloadavg_done = no; then
+- # There is a commonly available library for RS/6000 AIX.
+- # Since it is not a standard part of AIX, it might be installed locally.
+- gl_getloadavg_LIBS=$LIBS
+- LIBS="-L/usr/local/lib $LIBS"
+- AC_CHECK_LIB([getloadavg], [getloadavg],
+- [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
+- [LIBS=$gl_getloadavg_LIBS])
+- fi
+-
+ # Set up the replacement function if necessary.
+ if test $gl_func_getloadavg_done = no; then
+ HAVE_GETLOADAVG=0
diff --git a/external/poky/meta/recipes-core/coreutils/coreutils_8.30.bb b/external/poky/meta/recipes-core/coreutils/coreutils_8.30.bb
new file mode 100644
index 00000000..8f4ee557
--- /dev/null
+++ b/external/poky/meta/recipes-core/coreutils/coreutils_8.30.bb
@@ -0,0 +1,139 @@
+SUMMARY = "The basic file, shell and text manipulation utilities"
+DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
+manipulation utilities. These are the core utilities which are expected to exist on \
+every system."
+HOMEPAGE = "http://www.gnu.org/software/coreutils/"
+BUGTRACKER = "http://debbugs.gnu.org/coreutils"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+ file://src/ls.c;beginline=1;endline=15;md5=dbe356a88b09c29232b083d1ff8ac82a"
+DEPENDS = "gmp libcap"
+DEPENDS_class-native = ""
+
+inherit autotools gettext texinfo
+
+SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \
+ file://remove-usr-local-lib-from-m4.patch \
+ file://fix-selinux-flask.patch \
+ file://0001-uname-report-processor-and-hardware-correctly.patch \
+ file://disable-ls-output-quoting.patch \
+ file://0001-local.mk-fix-cross-compiling-problem.patch \
+ "
+
+SRC_URI[md5sum] = "ab06d68949758971fe744db66b572816"
+SRC_URI[sha256sum] = "e831b3a86091496cdba720411f9748de81507798f6130adeaef872d206e1b057"
+
+EXTRA_OECONF_class-native = "--without-gmp"
+EXTRA_OECONF_class-target = "--enable-install-program=arch,hostname --libexecdir=${libdir}"
+EXTRA_OECONF_class-nativesdk = "--enable-install-program=arch,hostname"
+
+# acl and xattr are not default features
+#
+PACKAGECONFIG_class-target ??= "\
+ ${@bb.utils.filter('DISTRO_FEATURES', 'acl xattr', d)} \
+"
+
+# The lib/oe/path.py requires xattr
+PACKAGECONFIG_class-native ??= "xattr"
+
+# with, without, depends, rdepends
+#
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+PACKAGECONFIG[single-binary] = "--enable-single-binary,--disable-single-binary,,"
+
+# [ df mktemp nice printenv base64 gets a special treatment and is not included in this
+bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
+ env expand expr factor fmt fold groups head hostid id install \
+ join link logname md5sum mkfifo nl nohup nproc od paste pathchk \
+ pinky pr printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
+ sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout \
+ tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
+
+# hostname gets a special treatment and is not included in this
+base_bindir_progs = "cat chgrp chmod chown cp date dd echo false hostname kill ln ls mkdir \
+ mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
+
+sbindir_progs= "chroot"
+
+# Let aclocal use the relative path for the m4 file rather than the
+# absolute since coreutils 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"
+
+# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
+do_compile_prepend () {
+ mkdir -p ${B}/src
+}
+
+do_install_class-native() {
+ autotools_do_install
+ # remove groups to fix conflict with shadow-native
+ rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
+ # The return is a must since native doesn't need the
+ # do_install_append() in the below.
+ return
+}
+
+do_install_append() {
+ for i in df mktemp nice printenv base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
+
+ install -d ${D}${base_bindir}
+ [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
+
+ install -d ${D}${sbindir}
+ [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
+
+ # [ requires special handling because [.coreutils will cause the sed stuff
+ # in update-alternatives to fail, therefore use lbracket - the name used
+ # for the actual source file.
+ mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+# Make hostname's priority higher than busybox but lower than net-tools
+ALTERNATIVE_PRIORITY[hostname] = "90"
+ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 nice printenv mktemp df"
+ALTERNATIVE_${PN}-doc = "base64.1 nice.1 mktemp.1 df.1 groups.1 kill.1 uptime.1 stat.1 hostname.1"
+
+ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
+
+ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
+ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
+ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
+
+ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
+ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
+ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
+
+ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
+ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
+ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
+
+ALTERNATIVE_LINK_NAME[nice] = "${base_bindir}/nice"
+ALTERNATIVE_TARGET[nice] = "${bindir}/nice.${BPN}"
+ALTERNATIVE_LINK_NAME[nice.1] = "${mandir}/man1/nice.1"
+
+ALTERNATIVE_LINK_NAME[printenv] = "${base_bindir}/printenv"
+ALTERNATIVE_TARGET[printenv] = "${bindir}/printenv.${BPN}"
+
+ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
+ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
+
+ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
+ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+python __anonymous() {
+ for prog in d.getVar('base_bindir_progs').split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog))
+
+ for prog in d.getVar('sbindir_progs').split():
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir'), prog))
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb b/external/poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb
new file mode 100644
index 00000000..c24295b5
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus-wait/dbus-wait_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "A simple tool to wait for a specific signal over DBus"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "dbus"
+
+SRCREV = "6cc6077a36fe2648a5f993fe7c16c9632f946517"
+PV = "0.1+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/external/poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch b/external/poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch
new file mode 100644
index 00000000..32e76117
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus-glib/no-examples.patch
@@ -0,0 +1,17 @@
+Disable compiling examples
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Kevin Tian <kevin.tian@intel.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: dbus-glib-0.108/dbus/Makefile.am
+===================================================================
+--- dbus-glib-0.108.orig/dbus/Makefile.am
++++ dbus-glib-0.108/dbus/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . examples
++SUBDIRS = .
+
+ AM_CPPFLAGS = \
+ -I$(top_srcdir) \
diff --git a/external/poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch b/external/poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch
new file mode 100644
index 00000000..027c82b2
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch
@@ -0,0 +1,57 @@
+Change Makefile.am to install regression tests for test package purpose.
+
+Upstream-Status: Inappropriate [test not install is for purpose from upstream]
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ test/Makefile.am | 3 ++-
+ test/core/Makefile.am | 3 ++-
+ test/interfaces/Makefile.am | 3 ++-
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 379c8c3..6580927 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -48,7 +48,8 @@ TESTS = \
+ $(test_scripts) \
+ $(NULL)
+
+-noinst_PROGRAMS = \
++testdir = $(datadir)/@PACKAGE@/tests
++test_PROGRAMS = \
+ $(test_programs) \
+ $(test_related_programs) \
+ $(NULL)
+diff --git a/test/core/Makefile.am b/test/core/Makefile.am
+index e4bceb4..54b077d 100644
+--- a/test/core/Makefile.am
++++ b/test/core/Makefile.am
+@@ -64,7 +64,8 @@ endif
+
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = \
++testdir = $(datadir)/@PACKAGE@/tests/core
++test_PROGRAMS = \
+ test-dbus-glib \
+ test-error-mapping \
+ test-service-glib \
+diff --git a/test/interfaces/Makefile.am b/test/interfaces/Makefile.am
+index a94d08d..707dcac 100644
+--- a/test/interfaces/Makefile.am
++++ b/test/interfaces/Makefile.am
+@@ -57,7 +57,8 @@ if DBUS_BUILD_TESTS
+
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = test-service test-client
++testdir = $(datadir)/@PACKAGE@/tests/interfaces
++test_PROGRAMS = test-service test-client
+
+ test_service_SOURCES = \
+ test-interfaces.c \
+--
+1.9.1
+
diff --git a/external/poky/meta/recipes-core/dbus/dbus-glib_0.110.bb b/external/poky/meta/recipes-core/dbus/dbus-glib_0.110.bb
new file mode 100644
index 00000000..b7383bd2
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus-glib_0.110.bb
@@ -0,0 +1,39 @@
+SUMMARY = "High level language (GLib) binding for D-Bus"
+DESCRIPTION = "GLib bindings for the D-Bus message bus that integrate \
+the D-Bus library with the GLib thread abstraction and main loop."
+HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cf5b3a2f7083750d504333114e738656 \
+ file://dbus/dbus-glib.h;beginline=7;endline=21;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+SECTION = "base"
+
+DEPENDS = "expat glib-2.0 virtual/libintl dbus-glib-native dbus"
+DEPENDS_class-native = "glib-2.0-native dbus-native"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-${PV}.tar.gz \
+ file://no-examples.patch \
+ file://test-install-makefile.patch \
+"
+SRC_URI[md5sum] = "d7cebf1d69445cbd28b4983392145192"
+SRC_URI[sha256sum] = "7ce4760cf66c69148f6bd6c92feaabb8812dee30846b24cd0f7395c436d7e825"
+
+inherit autotools pkgconfig gettext bash-completion gtk-doc
+
+#default disable regression tests, some unit test code in non testing code
+#PACKAGECONFIG_pn-${PN} = "tests" enable regression tests local.conf
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[tests] = "--enable-tests,,,"
+
+EXTRA_OECONF_class-target = "--with-dbus-binding-tool=${STAGING_BINDIR_NATIVE}/dbus-binding-tool"
+
+PACKAGES += "${PN}-tests"
+
+FILES_${PN} = "${libdir}/lib*${SOLIBS}"
+FILES_${PN}-bash-completion += "${libexecdir}/dbus-bash-completion-helper"
+FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
+FILES_${PN}-dev += "${bindir}/dbus-binding-tool"
+
+RDEPENDS_${PN}-tests += "dbus-x11"
+FILES_${PN}-tests = "${datadir}/${BPN}/tests"
+
+BBCLASSEXTEND = "native"
diff --git a/external/poky/meta/recipes-core/dbus/dbus-test_1.12.10.bb b/external/poky/meta/recipes-core/dbus/dbus-test_1.12.10.bb
new file mode 100644
index 00000000..25b93951
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus-test_1.12.10.bb
@@ -0,0 +1,83 @@
+SUMMARY = "D-Bus test package (for D-bus functionality testing only)"
+HOMEPAGE = "http://dbus.freedesktop.org"
+SECTION = "base"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
+ file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+
+DEPENDS = "dbus glib-2.0"
+
+RDEPENDS_${PN} += "make"
+RDEPENDS_${PN}-dev = ""
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+ file://tmpdir.patch \
+ file://run-ptest \
+ file://python-config.patch \
+ file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+ "
+
+SRC_URI[md5sum] = "c3e12b4206e2a7da39d7cc42567790ef"
+SRC_URI[sha256sum] = "4b693d24976258c3f2fa9cc33ad9288c5fbfa7a16481dbd9a8a429f7aa8cdcf7"
+
+S="${WORKDIR}/dbus-${PV}"
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/dbus:"
+
+inherit autotools pkgconfig gettext ptest upstream-version-is-even
+
+EXTRA_OECONF_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
+EXTRA_OECONF_X_class-native = "--without-x"
+
+EXTRA_OECONF = "--enable-tests \
+ --enable-modular-tests \
+ --enable-installed-tests \
+ --enable-checks \
+ --enable-asserts \
+ --enable-verbose-mode \
+ --enable-largefile \
+ --disable-xml-docs \
+ --disable-doxygen-docs \
+ --disable-libaudit \
+ --with-dbus-test-dir=${PTEST_PATH} \
+ ${EXTRA_OECONF_X}"
+
+EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)}"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
+PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
+PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
+
+do_install() {
+ :
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/test
+ l="shell printf refs syslog marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay \
+ variant uid-permissions syntax spawn sd-activation names monitor message fdpass "
+ for i in $l; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
+
+ l="bus bus-system bus-launch-helper"
+ for i in $l; do install ${B}/bus/.libs/test-$i ${D}${PTEST_PATH}/test; done
+
+ cp -r ${B}/test/data ${D}${PTEST_PATH}/test
+ install ${B}/dbus/.libs/test-dbus ${D}${PTEST_PATH}/test
+
+ install -d ${D}${PTEST_PATH}/test/.libs
+ cp -a ${B}/dbus/.libs/*.so* ${D}${PTEST_PATH}/test/.libs
+
+ # Remove build host references...
+ find "${D}${PTEST_PATH}/test/data" \( -name *.service -o -name *.conf -o -name "*.aaprofile" \) -type f -exec \
+ sed -i \
+ -e 's:${B}:${PTEST_PATH}:g' \
+ {} +
+ sed -i -e 's;@PTEST_PATH@;${PTEST_PATH};g' ${D}${PTEST_PATH}/run-ptest
+}
+
+RDEPENDS_${PN}-ptest += "bash"
+
+PRIVATE_LIBS_${PN}-ptest = "libdbus-1.so.3"
diff --git a/external/poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch b/external/poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
new file mode 100644
index 00000000..6bb6d9c8
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
@@ -0,0 +1,104 @@
+From b8f84bd39485d3977625c9a8b8e8cff5d23be56f Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Thu, 27 Feb 2014 09:05:02 +0800
+Subject: [PATCH] dbus: clear guid_from_server if send_negotiate_unix_fd
+ failed
+
+Upstream-Status: Submitted
+
+bus-test dispatch test failed with below information:
+ ./bus/bus-test: Running message dispatch test
+ Activating service name='org.freedesktop.DBus.TestSuiteEchoService'
+ Successfully activated service 'org.freedesktop.DBus.TestSuiteEchoService'
+ 6363: assertion failed "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0" file "dbus-auth.c" line 1545 function process_ok
+ ./bus/bus-test(_dbus_print_backtrace+0x29) [0x80cb969]
+ ./bus/bus-test(_dbus_abort+0x14) [0x80cfb44]
+ ./bus/bus-test(_dbus_real_assert+0x53) [0x80b52c3]
+ ./bus/bus-test() [0x80e24da]
+ ./bus/bus-test(_dbus_auth_do_work+0x388) [0x80e3848]
+ ./bus/bus-test() [0x80aea49]
+ ./bus/bus-test() [0x80affde]
+ ./bus/bus-test(_dbus_transport_handle_watch+0xb1) [0x80ad841]
+ ./bus/bus-test(_dbus_connection_handle_watch+0x104) [0x8089174]
+ ./bus/bus-test(dbus_watch_handle+0xd8) [0x80b15e8]
+ ./bus/bus-test(_dbus_loop_iterate+0x4a9) [0x80d1509]
+ ./bus/bus-test(bus_test_run_clients_loop+0x5d) [0x808129d]
+ ./bus/bus-test() [0x806cab0]
+ ./bus/bus-test() [0x806e0ca]
+ ./bus/bus-test() [0x806da6f]
+ ./bus/bus-test(_dbus_test_oom_handling+0x18c) [0x80b5c8c]
+ ./bus/bus-test() [0x806f723]
+ ./bus/bus-test(bus_dispatch_test+0x3c) [0x8071aac]
+ ./bus/bus-test(main+0x1b7) [0x805acc7]
+ /lib/libc.so.6(__libc_start_main+0xf3) [0x45f919b3]
+ ./bus/bus-test() [0x805ae39]
+
+The stack is below:
+ #0 0xffffe425 in __kernel_vsyscall ()
+ #1 0x45fa62d6 in raise () from /lib/libc.so.6
+ #2 0x45fa9653 in abort () from /lib/libc.so.6
+ #3 0x080cfb65 in _dbus_abort () at dbus-sysdeps.c:94
+ #4 0x080b52c3 in _dbus_real_assert (condition=0,
+ condition_text=condition_text@entry=0x8117a38 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
+ file=file@entry=0x8117273 "dbus-auth.c", line=line@entry=1545,
+ func=func@entry=0x8117f8e <__FUNCTION__.3492> "process_ok")
+ data=0x8157290) at dbus-connection.c:1515
+ #0 0x00000033fee353e9 in raise () from /lib64/libc.so.6
+ #1 0x00000033fee38508 in abort () from /lib64/libc.so.6
+ #2 0x000000000047d585 in _dbus_abort () at dbus-sysdeps.c:94
+ #3 0x0000000000466486 in _dbus_real_assert (condition=<optimized out>,
+ condition_text=condition_text@entry=0x4c2988 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
+ file=file@entry=0x4c21a5 "dbus-auth.c", line=line@entry=1546,
+ func=func@entry=0x4c2fce <__FUNCTION__.3845> "process_ok")
+ at dbus-internals.c:931
+ #4 0x000000000048d424 in process_ok (args_from_ok=0x7fffffffe480,
+ auth=0x6ff340) at dbus-auth.c:1546
+ #5 handle_client_state_waiting_for_data (auth=0x6ff340,
+ command=<optimized out>, args=0x7fffffffe480) at dbus-auth.c:1996
+ #6 0x000000000048e789 in process_command (auth=0x6ff340) at dbus-auth.c:2208
+ #7 _dbus_auth_do_work (auth=0x6ff340) at dbus-auth.c:2458
+ #8 0x000000000046091d in do_authentication (
+ transport=transport@entry=0x6ffaa0, do_reading=do_reading@entry=1,
+ do_writing=do_writing@entry=0,
+ auth_completed=auth_completed@entry=0x7fffffffe55c)
+ at dbus-transport-socket.c:442
+ #9 0x0000000000461d08 in socket_handle_watch (transport=0x6ffaa0,
+ watch=0x6f4190, flags=1) at dbus-transport-socket.c:921
+ #10 0x000000000045fa3a in _dbus_transport_handle_watch (transport=0x6ffaa0,
+
+Once send_negotiate_unix_fd failed, this failure will happen, since
+auth->guid_from_server has been set to some value before
+send_negotiate_unix_fd. send_negotiate_unix_fd failure will lead to
+this auth be handled by process_ok again, but this auth->guid_from_server
+is not zero.
+
+So we should clear auth->guid_from_server if send_negotiate_unix_fd failed
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ dbus/dbus-auth.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
+index d2c37a7..37b45c6 100644
+--- a/dbus/dbus-auth.c
++++ b/dbus/dbus-auth.c
+@@ -1571,8 +1571,13 @@ process_ok(DBusAuth *auth,
+ _dbus_verbose ("Got GUID '%s' from the server\n",
+ _dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server));
+
+- if (auth->unix_fd_possible)
+- return send_negotiate_unix_fd(auth);
++ if (auth->unix_fd_possible) {
++ if (!send_negotiate_unix_fd(auth)) {
++ _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
++ return FALSE;
++ }
++ return TRUE;
++ }
+
+ _dbus_verbose("Not negotiating unix fd passing, since not possible\n");
+ return send_begin (auth);
+--
+1.7.10.4
+
diff --git a/external/poky/meta/recipes-core/dbus/dbus/dbus-1.init b/external/poky/meta/recipes-core/dbus/dbus/dbus-1.init
new file mode 100644
index 00000000..42c86297
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus/dbus-1.init
@@ -0,0 +1,123 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: dbus
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: D-Bus systemwide message bus
+# Description: D-Bus is a simple interprocess messaging system, used
+# for sending messages between applications.
+### END INIT INFO
+#
+# -*- coding: utf-8 -*-
+# Debian init.d script for D-BUS
+# Copyright © 2003 Colin Walters <walters@debian.org>
+
+# set -e
+
+# Source function library.
+. /etc/init.d/functions
+
+DAEMON=@bindir@/dbus-daemon
+NAME=dbus
+DAEMONUSER=messagebus # must match /etc/dbus-1/system.conf
+PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
+UUIDDIR=/var/lib/dbus
+DESC="system message bus"
+EVENTDIR=/etc/dbus-1/event.d
+
+test -x $DAEMON || exit 0
+
+# Source defaults file; edit that file to configure this script.
+ENABLED=1
+PARAMS=""
+if [ -e /etc/default/dbus ]; then
+ . /etc/default/dbus
+fi
+
+test "$ENABLED" != "0" || exit 0
+
+start_it_up()
+{
+ mkdir -p "`dirname $PIDFILE`"
+ if [ -e $PIDFILE ]; then
+ PIDDIR=/proc/$(cat $PIDFILE)
+ if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
+ echo "$DESC already started; not starting."
+ else
+ echo "Removing stale PID file $PIDFILE."
+ rm -f $PIDFILE
+ fi
+ fi
+
+ if [ ! -d $UUIDDIR ]; then
+ mkdir -p $UUIDDIR
+ chown $DAEMONUSER $UUIDDIR
+ chgrp $DAEMONUSER $UUIDDIR
+ fi
+
+ dbus-uuidgen --ensure
+
+ echo -n "Starting $DESC: "
+ start-stop-daemon -o --start --quiet --pidfile $PIDFILE \
+ --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
+ echo "$NAME."
+ if [ -d $EVENTDIR ]; then
+ run-parts --arg=start $EVENTDIR
+ fi
+}
+
+shut_it_down()
+{
+ if [ -d $EVENTDIR ]; then
+ # TODO: --reverse when busybox supports it
+ run-parts --arg=stop $EVENTDIR
+ fi
+ echo -n "Stopping $DESC: "
+ start-stop-daemon -o --stop --quiet --pidfile $PIDFILE \
+ --user $DAEMONUSER
+ # We no longer include these arguments so that start-stop-daemon
+ # can do its job even given that we may have been upgraded.
+ # We rely on the pidfile being sanely managed
+ # --exec $DAEMON -- --system $PARAMS
+ echo "$NAME."
+ rm -f $PIDFILE
+}
+
+reload_it()
+{
+ echo -n "Reloading $DESC config: "
+ dbus-send --print-reply --system --type=method_call \
+ --dest=org.freedesktop.DBus \
+ / org.freedesktop.DBus.ReloadConfig > /dev/null
+ # hopefully this is enough time for dbus to reload it's config file.
+ echo "done."
+}
+
+case "$1" in
+ start)
+ start_it_up
+ ;;
+ stop)
+ shut_it_down
+ ;;
+ status)
+ status $DAEMON
+ exit $?
+ ;;
+ reload|force-reload)
+ reload_it
+ ;;
+ restart)
+ shut_it_down
+ sleep 1
+ start_it_up
+ ;;
+ *)
+ echo "Usage: /etc/init.d/$NAME {start|stop|status|restart|reload|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/external/poky/meta/recipes-core/dbus/dbus/python-config.patch b/external/poky/meta/recipes-core/dbus/dbus/python-config.patch
new file mode 100644
index 00000000..da2f10c7
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus/python-config.patch
@@ -0,0 +1,34 @@
+When building the dbus-ptest package, we have to enable python. However
+checking if the host-system python has the necessary library isn't useful.
+
+Disable the python module check for cross compiling.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+---
+ configure.ac | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 80d27b4..becc1cc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -279,13 +279,6 @@ if test "x$enable_tests" = xyes; then
+ # full test coverage is required, Python is a hard dependency
+ AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygi])
+ AM_PATH_PYTHON([2.6])
+- AC_MSG_CHECKING([for Python modules for full test coverage])
+- if "$PYTHON" -c "import dbus, gi.repository.GObject, dbus.mainloop.glib"; then
+- AC_MSG_RESULT([yes])
+- else
+- AC_MSG_RESULT([no])
+- AC_MSG_ERROR([cannot import dbus, gi.repository.GObject, dbus.mainloop.glib Python modules])
+- fi
+ else
+ # --enable-tests not given: do not abort if Python is missing
+ AM_PATH_PYTHON([2.6], [], [:])
+--
+1.9.1
+
diff --git a/external/poky/meta/recipes-core/dbus/dbus/run-ptest b/external/poky/meta/recipes-core/dbus/dbus/run-ptest
new file mode 100755
index 00000000..353ba1e9
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus/run-ptest
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+output() {
+ retcode=$?
+ if [ $retcode -eq 0 ]
+ then echo "PASS: $i"
+ elif [ $retcode -eq 77 ]
+ then echo "SKIP: $i"
+ else echo "FAIL: $i"
+ fi
+}
+
+export DBUS_TEST_HOMEDIR=./test
+export XDG_RUNTIME_DIR=./test
+export LD_LIBRARY_PATH=@PTEST_PATH@/test/.libs
+
+files=`ls test/test-*`
+
+for i in $files
+ do
+ ./$i ./test/data >/dev/null
+ output
+ done
+
diff --git a/external/poky/meta/recipes-core/dbus/dbus/tmpdir.patch b/external/poky/meta/recipes-core/dbus/dbus/tmpdir.patch
new file mode 100644
index 00000000..bf086e17
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus/tmpdir.patch
@@ -0,0 +1,44 @@
+From 5105fedd7fa13dadd2d0d864fb77873b83b79a4b Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Thu, 23 Jun 2011 13:52:09 +0200
+Subject: [PATCH] buildsys: hardcode socketdir to /tmp
+
+the TMPDIR env var isn't always pointing to the right target path
+
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+
+Original comment:
+
+ avoid to check tmp dir at build time. instead uses hard coded /tmp here
+ comment added by Kevin Tian <kevin.tian@intel.com>
+---
+ configure.ac | 11 +----------
+ 1 files changed, 1 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 408054b..6d26180 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1483,16 +1483,7 @@ AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
+ AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY",
+ [Full path to the launch helper test program in the builddir])
+
+-#### Find socket directories
+-if ! test -z "$TMPDIR" ; then
+- DEFAULT_SOCKET_DIR=$TMPDIR
+-elif ! test -z "$TEMP" ; then
+- DEFAULT_SOCKET_DIR=$TEMP
+-elif ! test -z "$TMP" ; then
+- DEFAULT_SOCKET_DIR=$TMP
+-else
+- DEFAULT_SOCKET_DIR=/tmp
+-fi
++DEFAULT_SOCKET_DIR=/tmp
+
+ DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
+
+--
+1.6.6.1
+
diff --git a/external/poky/meta/recipes-core/dbus/dbus_1.12.10.bb b/external/poky/meta/recipes-core/dbus/dbus_1.12.10.bb
new file mode 100644
index 00000000..d71f7f70
--- /dev/null
+++ b/external/poky/meta/recipes-core/dbus/dbus_1.12.10.bb
@@ -0,0 +1,176 @@
+SUMMARY = "D-Bus message bus"
+DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a \"single instance\" application or daemon, and to launch applications and daemons on demand when their services are needed."
+HOMEPAGE = "http://dbus.freedesktop.org"
+SECTION = "base"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
+ file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+DEPENDS = "expat virtual/libintl autoconf-archive"
+RDEPENDS_dbus_class-native = ""
+RDEPENDS_dbus_class-nativesdk = ""
+PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
+ALLOW_EMPTY_dbus-ptest = "1"
+RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+ file://tmpdir.patch \
+ file://dbus-1.init \
+ file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+"
+
+SRC_URI[md5sum] = "c3e12b4206e2a7da39d7cc42567790ef"
+SRC_URI[sha256sum] = "4b693d24976258c3f2fa9cc33ad9288c5fbfa7a16481dbd9a8a429f7aa8cdcf7"
+
+inherit useradd autotools pkgconfig gettext update-rc.d upstream-version-is-even
+
+INITSCRIPT_NAME = "dbus-1"
+INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
+
+python __anonymous() {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-r netdev"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
+ --no-create-home --shell /bin/false \
+ --user-group messagebus"
+
+CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
+
+DEBIANNAME_${PN} = "dbus-1"
+
+PACKAGES =+ "${PN}-lib"
+
+OLDPKGNAME = "dbus-x11"
+OLDPKGNAME_class-nativesdk = ""
+
+# for compatibility
+RPROVIDES_${PN} = "${OLDPKGNAME}"
+RREPLACES_${PN} += "${OLDPKGNAME}"
+
+FILES_${PN} = "${bindir}/dbus-daemon* \
+ ${bindir}/dbus-uuidgen \
+ ${bindir}/dbus-cleanup-sockets \
+ ${bindir}/dbus-send \
+ ${bindir}/dbus-monitor \
+ ${bindir}/dbus-launch \
+ ${bindir}/dbus-run-session \
+ ${bindir}/dbus-update-activation-environment \
+ ${libexecdir}/dbus* \
+ ${sysconfdir} \
+ ${localstatedir} \
+ ${datadir}/dbus-1/services \
+ ${datadir}/dbus-1/system-services \
+ ${datadir}/dbus-1/session.d \
+ ${datadir}/dbus-1/session.conf \
+ ${datadir}/dbus-1/system.d \
+ ${datadir}/dbus-1/system.conf \
+ ${datadir}/xml/dbus-1 \
+ ${systemd_system_unitdir} \
+ ${systemd_user_unitdir} \
+ ${nonarch_libdir}/sysusers.d/dbus.conf \
+ ${nonarch_libdir}/tmpfiles.d/dbus.conf \
+"
+FILES_${PN}-lib = "${libdir}/lib*.so.*"
+RRECOMMENDS_${PN}-lib = "${PN}"
+FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${libdir}/cmake/DBus1 ${bindir}/dbus-test-tool"
+
+PACKAGE_WRITE_DEPS += "${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','systemd-systemctl-native','',d)}"
+pkg_postinst_dbus() {
+ # If both systemd and sysvinit are enabled, mask the dbus-1 init script
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+ systemctl $OPTS mask dbus-1.service
+ fi
+
+ if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
+ /etc/init.d/populate-volatile.sh update
+ fi
+}
+
+EXTRA_OECONF = "--disable-tests \
+ --disable-xml-docs \
+ --disable-doxygen-docs \
+ --disable-libaudit \
+ --enable-largefile \
+ "
+
+EXTRA_OECONF_append_class-target = " SYSTEMCTL=${base_bindir}/systemctl"
+EXTRA_OECONF_append_class-native = " --disable-selinux"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
+ user-session \
+ "
+
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--disable-systemd --without-systemdsystemunitdir,systemd"
+PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
+PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session"
+
+do_install() {
+ autotools_do_install
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/init.d
+ sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
+ install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
+ install -d ${D}${systemd_system_unitdir}/$i; done
+ install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_system_unitdir}/
+ ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/dbus.target.wants/dbus.socket
+ ln -fs ../dbus.socket ${D}${systemd_system_unitdir}/sockets.target.wants/dbus.socket
+ ln -fs ../dbus.service ${D}${systemd_system_unitdir}/multi-user.target.wants/dbus.service
+ fi
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
+ > ${D}${sysconfdir}/default/volatiles/99_dbus
+
+
+ mkdir -p ${D}${localstatedir}/lib/dbus
+
+ chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
+
+ chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
+ chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
+
+ # Remove Red Hat initscript
+ rm -rf ${D}${sysconfdir}/rc.d
+
+ # Remove empty testexec directory as we don't build tests
+ rm -rf ${D}${libdir}/dbus-1.0/test
+
+ # Remove /var/run as it is created on startup
+ rm -rf ${D}${localstatedir}/run
+}
+
+do_install_class-native() {
+ autotools_do_install
+
+ # dbus-launch has no X support so lets not install it in case the host
+ # has a more featured and useful version
+ rm -f ${D}${bindir}/dbus-launch
+}
+
+do_install_class-nativesdk() {
+ autotools_do_install
+
+ # dbus-launch has no X support so lets not install it in case the host
+ # has a more featured and useful version
+ rm -f ${D}${bindir}/dbus-launch
+
+ # Remove /var/run to avoid QA error
+ rm -rf ${D}${localstatedir}/run
+}
+BBCLASSEXTEND = "native nativesdk"
+
+INSANE_SKIP_${PN}-ptest += "build-deps"
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear.inc b/external/poky/meta/recipes-core/dropbear/dropbear.inc
new file mode 100644
index 00000000..d92a2f39
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear.inc
@@ -0,0 +1,111 @@
+SUMMARY = "A lightweight SSH and SCP implementation"
+HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
+SECTION = "console/network"
+
+# some files are from other projects and have others license terms:
+# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY
+LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a5ec40cafba26fc4396d0b550f824e01"
+
+DEPENDS = "zlib virtual/crypt"
+RPROVIDES_${PN} = "ssh sshd"
+
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
+ file://CVE-2018-15599.patch \
+ file://0001-urandom-xauth-changes-to-options.h.patch \
+ file://init \
+ file://dropbearkey.service \
+ file://dropbear@.service \
+ file://dropbear.socket \
+ file://dropbear.default \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} "
+
+PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
+ file://0006-dropbear-configuration-file.patch \
+ file://dropbear"
+
+PAM_PLUGINS = "libpam-runtime \
+ pam-plugin-deny \
+ pam-plugin-permit \
+ pam-plugin-unix \
+ "
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}"
+
+inherit autotools update-rc.d systemd
+
+INITSCRIPT_NAME = "dropbear"
+INITSCRIPT_PARAMS = "defaults 10"
+
+SYSTEMD_SERVICE_${PN} = "dropbear.socket"
+
+SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
+BINCOMMANDS = "dbclient ssh scp"
+EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt"
+
+EXTRA_OECONF += "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
+
+# This option appends to CFLAGS and LDFLAGS from OE
+# This is causing [textrel] QA warning
+EXTRA_OECONF += "--disable-harden"
+
+do_install() {
+ install -d ${D}${sysconfdir} \
+ ${D}${sysconfdir}/init.d \
+ ${D}${sysconfdir}/default \
+ ${D}${sysconfdir}/dropbear \
+ ${D}${bindir} \
+ ${D}${sbindir} \
+ ${D}${localstatedir}
+
+ install -m 0644 ${WORKDIR}/dropbear.default ${D}${sysconfdir}/default/dropbear
+
+ install -m 0755 dropbearmulti ${D}${sbindir}/
+ ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient
+
+ for i in ${SBINCOMMANDS}
+ do
+ ln -s ./dropbearmulti ${D}${sbindir}/$i
+ done
+ sed -e 's,/etc,${sysconfdir},g' \
+ -e 's,/usr/sbin,${sbindir},g' \
+ -e 's,/var,${localstatedir},g' \
+ -e 's,/usr/bin,${bindir},g' \
+ -e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear
+ chmod 755 ${D}${sysconfdir}/init.d/dropbear
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -d ${D}${sysconfdir}/pam.d
+ install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
+ fi
+
+ # deal with systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@BINDIR@,${bindir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ ${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "20"
+ALTERNATIVE_${PN} = "scp ssh"
+
+ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti"
+
+pkg_postrm_append_${PN} () {
+ if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then
+ rm ${sysconfdir}/dropbear/dropbear_rsa_host_key
+ fi
+ if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then
+ rm ${sysconfdir}/dropbear/dropbear_dss_host_key
+ fi
+}
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch b/external/poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
new file mode 100644
index 00000000..684641dc
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
@@ -0,0 +1,23 @@
+Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h
+
+Upstream-Status: Inappropriate [configuration]
+---
+ default_options.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/default_options.h b/default_options.h
+index 3b75eb8..1fd8082 100644
+--- a/default_options.h
++++ b/default_options.h
+@@ -243,7 +243,7 @@ Homedir is prepended unless path begins with / */
+
+ /* The command to invoke for xauth when using X11 forwarding.
+ * "-q" for quiet */
+-#define XAUTH_COMMAND "/usr/bin/xauth -q"
++#define XAUTH_COMMAND "xauth -q"
+
+
+ /* if you want to enable running an sftp server (such as the one included with
+--
+1.7.11.7
+
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch b/external/poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
new file mode 100644
index 00000000..85768152
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
@@ -0,0 +1,42 @@
+From b8cece92ba19aa77ac013ea161bfe4c7147747c9 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 2 Dec 2015 11:36:02 +0200
+Subject: Enable pam
+
+We need modify file default_options.h besides enabling pam in
+configure if we want dropbear to support pam.
+
+Upstream-Status: Pending
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ default_options.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/default_options.h b/default_options.h
+index 3b75eb8..8617cd0 100644
+--- a/default_options.h
++++ b/default_options.h
+@@ -179,7 +179,7 @@ group1 in Dropbear server too */
+
+ /* Authentication Types - at least one required.
+ RFC Draft requires pubkey auth, and recommends password */
+-#define DROPBEAR_SVR_PASSWORD_AUTH 1
++#define DROPBEAR_SVR_PASSWORD_AUTH 0
+
+ /* Note: PAM auth is quite simple and only works for PAM modules which just do
+ * a simple "Login: " "Password: " (you can edit the strings in svr-authpam.c).
+@@ -187,7 +187,7 @@ group1 in Dropbear server too */
+ * but there's an interface via a PAM module. It won't work for more complex
+ * PAM challenge/response.
+ * You can't enable both PASSWORD and PAM. */
+-#define DROPBEAR_SVR_PAM_AUTH 0
++#define DROPBEAR_SVR_PAM_AUTH 1
+
+ /* ~/.ssh/authorized_keys authentication */
+ #define DROPBEAR_SVR_PUBKEY_AUTH 1
+
+--
+2.1.4
+
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch b/external/poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
new file mode 100644
index 00000000..deed78ff
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
@@ -0,0 +1,33 @@
+From e3a5db1b6d3f6382a15b2266458c26c645a10f18 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Thu, 6 Sep 2018 15:54:00 +0800
+Subject: [PATCH] dropbear configuration file
+
+dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \
+to "/etc/pam.d/dropbear for dropbear when enabling pam supporting"
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+---
+ svr-authpam.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/svr-authpam.c b/svr-authpam.c
+index d201bc9..165ec5c 100644
+--- a/svr-authpam.c
++++ b/svr-authpam.c
+@@ -223,7 +223,7 @@ void svr_auth_pam(int valid_user) {
+ }
+
+ /* Init pam */
+- if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
++ if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
+ dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s",
+ rc, pam_strerror(pamHandlep, rc));
+ goto cleanup;
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/CVE-2018-15599.patch b/external/poky/meta/recipes-core/dropbear/dropbear/CVE-2018-15599.patch
new file mode 100644
index 00000000..912545c9
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/CVE-2018-15599.patch
@@ -0,0 +1,236 @@
+From 256e2abb8150f9fea33cd026597dbe70f0379296 Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt@ucc.asn.au>
+Date: Thu, 23 Aug 2018 23:43:12 +0800
+Subject: [PATCH] Wait to fail invalid usernames
+
+Wait to fail invalid usernames
+
+Upstream-Status: Backport [https://secure.ucc.asn.au/hg/dropbear/rev/5d2d1021ca00]
+CVE: CVE-2018-15599
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+---
+ auth.h | 6 +++---
+ svr-auth.c | 19 +++++--------------
+ svr-authpam.c | 26 ++++++++++++++++++++++----
+ svr-authpasswd.c | 27 ++++++++++++++-------------
+ svr-authpubkey.c | 11 ++++++++++-
+ 5 files changed, 54 insertions(+), 35 deletions(-)
+
+diff --git a/auth.h b/auth.h
+index da498f5..98f5468 100644
+--- a/auth.h
++++ b/auth.h
+@@ -37,9 +37,9 @@ void recv_msg_userauth_request(void);
+ void send_msg_userauth_failure(int partial, int incrfail);
+ void send_msg_userauth_success(void);
+ void send_msg_userauth_banner(const buffer *msg);
+-void svr_auth_password(void);
+-void svr_auth_pubkey(void);
+-void svr_auth_pam(void);
++void svr_auth_password(int valid_user);
++void svr_auth_pubkey(int valid_user);
++void svr_auth_pam(int valid_user);
+
+ #if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
+ int svr_pubkey_allows_agentfwd(void);
+diff --git a/svr-auth.c b/svr-auth.c
+index 64d97aa..1f364ca 100644
+--- a/svr-auth.c
++++ b/svr-auth.c
+@@ -149,10 +149,8 @@ void recv_msg_userauth_request() {
+ if (methodlen == AUTH_METHOD_PASSWORD_LEN &&
+ strncmp(methodname, AUTH_METHOD_PASSWORD,
+ AUTH_METHOD_PASSWORD_LEN) == 0) {
+- if (valid_user) {
+- svr_auth_password();
+- goto out;
+- }
++ svr_auth_password(valid_user);
++ goto out;
+ }
+ }
+ #endif
+@@ -164,10 +162,8 @@ void recv_msg_userauth_request() {
+ if (methodlen == AUTH_METHOD_PASSWORD_LEN &&
+ strncmp(methodname, AUTH_METHOD_PASSWORD,
+ AUTH_METHOD_PASSWORD_LEN) == 0) {
+- if (valid_user) {
+- svr_auth_pam();
+- goto out;
+- }
++ svr_auth_pam(valid_user);
++ goto out;
+ }
+ }
+ #endif
+@@ -177,12 +173,7 @@ void recv_msg_userauth_request() {
+ if (methodlen == AUTH_METHOD_PUBKEY_LEN &&
+ strncmp(methodname, AUTH_METHOD_PUBKEY,
+ AUTH_METHOD_PUBKEY_LEN) == 0) {
+- if (valid_user) {
+- svr_auth_pubkey();
+- } else {
+- /* pubkey has no failure delay */
+- send_msg_userauth_failure(0, 0);
+- }
++ svr_auth_pubkey(valid_user);
+ goto out;
+ }
+ #endif
+diff --git a/svr-authpam.c b/svr-authpam.c
+index 05e4f3e..d201bc9 100644
+--- a/svr-authpam.c
++++ b/svr-authpam.c
+@@ -178,13 +178,14 @@ pamConvFunc(int num_msg,
+ * Keyboard interactive would be a lot nicer, but since PAM is synchronous, it
+ * gets very messy trying to send the interactive challenges, and read the
+ * interactive responses, over the network. */
+-void svr_auth_pam() {
++void svr_auth_pam(int valid_user) {
+
+ struct UserDataS userData = {NULL, NULL};
+ struct pam_conv pamConv = {
+ pamConvFunc,
+ &userData /* submitted to pamvConvFunc as appdata_ptr */
+ };
++ const char* printable_user = NULL;
+
+ pam_handle_t* pamHandlep = NULL;
+
+@@ -204,12 +205,23 @@ void svr_auth_pam() {
+
+ password = buf_getstring(ses.payload, &passwordlen);
+
++ /* We run the PAM conversation regardless of whether the username is valid
++ in case the conversation function has an inherent delay.
++ Use ses.authstate.username rather than ses.authstate.pw_name.
++ After PAM succeeds we then check the valid_user flag too */
++
+ /* used to pass data to the PAM conversation function - don't bother with
+ * strdup() etc since these are touched only by our own conversation
+ * function (above) which takes care of it */
+- userData.user = ses.authstate.pw_name;
++ userData.user = ses.authstate.username;
+ userData.passwd = password;
+
++ if (ses.authstate.pw_name) {
++ printable_user = ses.authstate.pw_name;
++ } else {
++ printable_user = "<invalid username>";
++ }
++
+ /* Init pam */
+ if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
+ dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s",
+@@ -242,7 +254,7 @@ void svr_auth_pam() {
+ rc, pam_strerror(pamHandlep, rc));
+ dropbear_log(LOG_WARNING,
+ "Bad PAM password attempt for '%s' from %s",
+- ses.authstate.pw_name,
++ printable_user,
+ svr_ses.addrstring);
+ send_msg_userauth_failure(0, 1);
+ goto cleanup;
+@@ -253,12 +265,18 @@ void svr_auth_pam() {
+ rc, pam_strerror(pamHandlep, rc));
+ dropbear_log(LOG_WARNING,
+ "Bad PAM password attempt for '%s' from %s",
+- ses.authstate.pw_name,
++ printable_user,
+ svr_ses.addrstring);
+ send_msg_userauth_failure(0, 1);
+ goto cleanup;
+ }
+
++ if (!valid_user) {
++ /* PAM auth succeeded but the username isn't allowed in for another reason
++ (checkusername() failed) */
++ send_msg_userauth_failure(0, 1);
++ }
++
+ /* successful authentication */
+ dropbear_log(LOG_NOTICE, "PAM password auth succeeded for '%s' from %s",
+ ses.authstate.pw_name,
+diff --git a/svr-authpasswd.c b/svr-authpasswd.c
+index bdee2aa..69c7d8a 100644
+--- a/svr-authpasswd.c
++++ b/svr-authpasswd.c
+@@ -48,22 +48,14 @@ static int constant_time_strcmp(const char* a, const char* b) {
+
+ /* Process a password auth request, sending success or failure messages as
+ * appropriate */
+-void svr_auth_password() {
++void svr_auth_password(int valid_user) {
+
+ char * passwdcrypt = NULL; /* the crypt from /etc/passwd or /etc/shadow */
+ char * testcrypt = NULL; /* crypt generated from the user's password sent */
+- char * password;
++ char * password = NULL;
+ unsigned int passwordlen;
+-
+ unsigned int changepw;
+
+- passwdcrypt = ses.authstate.pw_passwd;
+-
+-#ifdef DEBUG_HACKCRYPT
+- /* debugging crypt for non-root testing with shadows */
+- passwdcrypt = DEBUG_HACKCRYPT;
+-#endif
+-
+ /* check if client wants to change password */
+ changepw = buf_getbool(ses.payload);
+ if (changepw) {
+@@ -73,12 +65,21 @@ void svr_auth_password() {
+ }
+
+ password = buf_getstring(ses.payload, &passwordlen);
+-
+- /* the first bytes of passwdcrypt are the salt */
+- testcrypt = crypt(password, passwdcrypt);
++ if (valid_user) {
++ /* the first bytes of passwdcrypt are the salt */
++ passwdcrypt = ses.authstate.pw_passwd;
++ testcrypt = crypt(password, passwdcrypt);
++ }
+ m_burn(password, passwordlen);
+ m_free(password);
+
++ /* After we have got the payload contents we can exit if the username
++ is invalid. Invalid users have already been logged. */
++ if (!valid_user) {
++ send_msg_userauth_failure(0, 1);
++ return;
++ }
++
+ if (testcrypt == NULL) {
+ /* crypt() with an invalid salt like "!!" */
+ dropbear_log(LOG_WARNING, "User account '%s' is locked",
+diff --git a/svr-authpubkey.c b/svr-authpubkey.c
+index aa6087c..ff481c8 100644
+--- a/svr-authpubkey.c
++++ b/svr-authpubkey.c
+@@ -79,7 +79,7 @@ static int checkfileperm(char * filename);
+
+ /* process a pubkey auth request, sending success or failure message as
+ * appropriate */
+-void svr_auth_pubkey() {
++void svr_auth_pubkey(int valid_user) {
+
+ unsigned char testkey; /* whether we're just checking if a key is usable */
+ char* algo = NULL; /* pubkey algo */
+@@ -102,6 +102,15 @@ void svr_auth_pubkey() {
+ keybloblen = buf_getint(ses.payload);
+ keyblob = buf_getptr(ses.payload, keybloblen);
+
++ if (!valid_user) {
++ /* Return failure once we have read the contents of the packet
++ required to validate a public key.
++ Avoids blind user enumeration though it isn't possible to prevent
++ testing for user existence if the public key is known */
++ send_msg_userauth_failure(0, 0);
++ goto out;
++ }
++
+ /* check if the key is valid */
+ if (checkpubkey(algo, algolen, keyblob, keybloblen) == DROPBEAR_FAILURE) {
+ send_msg_userauth_failure(0, 0);
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/dropbear b/external/poky/meta/recipes-core/dropbear/dropbear/dropbear
new file mode 100644
index 00000000..47e787fb
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/dropbear
@@ -0,0 +1,4 @@
+#%PAM-1.0
+
+auth include common-auth
+account include common-account
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/dropbear.default b/external/poky/meta/recipes-core/dropbear/dropbear/dropbear.default
new file mode 100644
index 00000000..522453a8
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/dropbear.default
@@ -0,0 +1,2 @@
+# Disallow root logins by default
+DROPBEAR_EXTRA_ARGS="-w"
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/dropbear.socket b/external/poky/meta/recipes-core/dropbear/dropbear/dropbear.socket
new file mode 100644
index 00000000..e5c61b75
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/dropbear.socket
@@ -0,0 +1,10 @@
+[Unit]
+Conflicts=dropbear.service
+
+[Socket]
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
+Also=dropbearkey.service
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/dropbear@.service b/external/poky/meta/recipes-core/dropbear/dropbear/dropbear@.service
new file mode 100644
index 00000000..b420bcdd
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/dropbear@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=SSH Per-Connection Server
+Wants=dropbearkey.service
+After=syslog.target dropbearkey.service
+
+[Service]
+Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
+EnvironmentFile=-/etc/default/dropbear
+ExecStart=-@SBINDIR@/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/external/poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service
new file mode 100644
index 00000000..c49053d5
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/dropbearkey.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=SSH Key Generation
+RequiresMountsFor=/var /var/lib
+ConditionPathExists=!/etc/dropbear/dropbear_rsa_host_key
+ConditionPathExists=!/var/lib/dropbear/dropbear_rsa_host_key
+
+[Service]
+Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
+EnvironmentFile=-/etc/default/dropbear
+Type=oneshot
+ExecStart=@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR}
+ExecStart=@SBINDIR@/dropbearkey -t rsa -f ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key
+RemainAfterExit=yes
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear/init b/external/poky/meta/recipes-core/dropbear/dropbear/init
new file mode 100755
index 00000000..ffab7a23
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear/init
@@ -0,0 +1,79 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: sshd
+# Required-Start: $remote_fs $syslog $networking
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: Dropbear Secure Shell server
+### END INIT INFO
+#
+# Do not configure this file. Edit /etc/default/dropbear instead!
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/dropbear
+NAME=dropbear
+DESC="Dropbear SSH server"
+PIDFILE=/var/run/dropbear.pid
+
+# These values may be replaced by those from /etc/default/dropbear
+DROPBEAR_RSAKEY_DIR="/etc/dropbear"
+DROPBEAR_PORT=22
+DROPBEAR_EXTRA_ARGS=
+DROPBEAR_RSAKEY_ARGS=
+NO_START=0
+
+set -e
+
+test ! -r /etc/default/dropbear || . /etc/default/dropbear
+test "$NO_START" = "0" || exit 0
+test -x "$DAEMON" || exit 0
+test ! -h /var/service/dropbear || exit 0
+
+test -z "$DROPBEAR_BANNER" || \
+ DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
+test -n "$DROPBEAR_RSAKEY" || \
+ DROPBEAR_RSAKEY="${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key"
+
+gen_keys() {
+ if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
+ rm $DROPBEAR_RSAKEY || true
+ fi
+ if [ ! -f "$DROPBEAR_RSAKEY" ]; then
+ mkdir -p ${DROPBEAR_RSAKEY%/*}
+ dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS
+ fi
+}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ gen_keys
+ start-stop-daemon -S -p $PIDFILE \
+ -x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
+ -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
+ echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
+ sleep 1
+ start-stop-daemon -S -p $PIDFILE \
+ -x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
+ -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/external/poky/meta/recipes-core/dropbear/dropbear_2018.76.bb b/external/poky/meta/recipes-core/dropbear/dropbear_2018.76.bb
new file mode 100644
index 00000000..36a58d5c
--- /dev/null
+++ b/external/poky/meta/recipes-core/dropbear/dropbear_2018.76.bb
@@ -0,0 +1,5 @@
+require dropbear.inc
+
+SRC_URI[md5sum] = "c3912f7fcdcc57c99937e4a79480d2c2"
+SRC_URI[sha256sum] = "f2fb9167eca8cf93456a5fc1d4faf709902a3ab70dd44e352f3acbc3ffdaea65"
+
diff --git a/external/poky/meta/recipes-core/expat/expat/CVE-2018-20843.patch b/external/poky/meta/recipes-core/expat/expat/CVE-2018-20843.patch
new file mode 100644
index 00000000..af6641ef
--- /dev/null
+++ b/external/poky/meta/recipes-core/expat/expat/CVE-2018-20843.patch
@@ -0,0 +1,26 @@
+From 11f8838bf99ea0a6f0b76f9760c43704d00c4ff6 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Wed, 12 Jun 2019 15:42:22 +0200
+Subject: [PATCH] xmlparse.c: Fix extraction of namespace prefix from XML name
+ (#186)
+
+Upstream-Status: Backport
+CVE: CVE-2018-20843
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+---
+ expat/lib/xmlparse.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
+index 30d55c5c..737d7cd2 100644
+--- a/expat/lib/xmlparse.c
++++ b/expat/lib/xmlparse.c
+@@ -6071,7 +6071,7 @@ setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType)
+ else
+ poolDiscard(&dtd->pool);
+ elementType->prefix = prefix;
+-
++ break;
+ }
+ }
+ return 1;
diff --git a/external/poky/meta/recipes-core/expat/expat/autotools.patch b/external/poky/meta/recipes-core/expat/expat/autotools.patch
new file mode 100644
index 00000000..104717ea
--- /dev/null
+++ b/external/poky/meta/recipes-core/expat/expat/autotools.patch
@@ -0,0 +1,25 @@
+Avoid using expat's m4 files
+
+Upstream-Status: Inappropriate [Other]
+Workaround specific to our build system.
+
+Signed-off-by: Kevin Tian <kevin.tian@intel.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Updated to apply over expat 2.1.0
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+Index: expat-2.2.5/configure.ac
+===================================================================
+--- expat-2.2.5.orig/configure.ac
++++ expat-2.2.5/configure.ac
+@@ -53,8 +53,6 @@ LIBAGE=6 # CMakeLists.txt!
+ CPPFLAGS="${CPPFLAGS} -DHAVE_EXPAT_CONFIG_H"
+ AC_CONFIG_HEADER(expat_config.h)
+
+-sinclude(conftools/ac_c_bigendian_cross.m4)
+-
+ AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+
diff --git a/external/poky/meta/recipes-core/expat/expat/libtool-tag.patch b/external/poky/meta/recipes-core/expat/expat/libtool-tag.patch
new file mode 100644
index 00000000..0a0aed23
--- /dev/null
+++ b/external/poky/meta/recipes-core/expat/expat/libtool-tag.patch
@@ -0,0 +1,30 @@
+From 10342e6b600858b091bc7771e454d9e06af06410 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 2 Nov 2017 18:20:57 +0800
+Subject: [PATCH] Add CC tag to build
+
+Add CC tag to build
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 9560a95..d444bd6 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -319,7 +319,7 @@ LIBCURRENT = @LIBCURRENT@
+ LIBOBJS = @LIBOBJS@
+ LIBREVISION = @LIBREVISION@
+ LIBS = @LIBS@
+-LIBTOOL = @LIBTOOL@
++LIBTOOL = @LIBTOOL@ --tag CC
+ LIPO = @LIPO@
+ LN_S = @LN_S@
+ LTLIBOBJS = @LTLIBOBJS@
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/expat/expat_2.2.6.bb b/external/poky/meta/recipes-core/expat/expat_2.2.6.bb
new file mode 100644
index 00000000..0cef7055
--- /dev/null
+++ b/external/poky/meta/recipes-core/expat/expat_2.2.6.bb
@@ -0,0 +1,24 @@
+SUMMARY = "A stream-oriented XML parser library"
+DESCRIPTION = "Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags)"
+HOMEPAGE = "http://expat.sourceforge.net/"
+SECTION = "libs"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5b8620d98e49772d95fc1d291c26aa79"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.bz2 \
+ file://autotools.patch \
+ file://libtool-tag.patch \
+ file://CVE-2018-20843.patch;striplevel=2 \
+ "
+
+SRC_URI[md5sum] = "ca047ae951b40020ac831c28859161b2"
+SRC_URI[sha256sum] = "17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2"
+
+inherit autotools lib_package
+
+do_configure_prepend () {
+ rm -f ${S}/conftools/libtool.m4
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-core/fts/fts.bb b/external/poky/meta/recipes-core/fts/fts.bb
new file mode 100644
index 00000000..02f54086
--- /dev/null
+++ b/external/poky/meta/recipes-core/fts/fts.bb
@@ -0,0 +1,22 @@
+# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "POSIX file tree stream operations library"
+HOMEPAGE = "https://sites.google.com/a/bostic.com/keithbostic"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5ffe358174aad383f1b69ce3b53da982"
+SECTION = "libs"
+
+SRCREV = "944333aed9dc24cfa76cc64bfe70c75d25652753"
+PV = "1.2+git${SRCPV}"
+
+SRC_URI = "git://github.com/voidlinux/musl-fts \
+"
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
+
diff --git a/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/add-with-bisonlocaledir.patch b/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/add-with-bisonlocaledir.patch
new file mode 100644
index 00000000..35a13106
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/add-with-bisonlocaledir.patch
@@ -0,0 +1,58 @@
+From 04bd40fe2c48c6e01ab418a04d27c4aff644ad96 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 17 Feb 2016 23:54:02 -0500
+Subject: [PATCH] m4/bison-i18n.m4: add --with-bisonlocaledir to assign
+ BISON_LOCALEDIR
+
+The variable BISON_LOCALEDIR is assigned only by the output of
+'bison --print-localedir', we add option --with-bisonlocaledir
+to assign it explicitly. It is helpful for user to split the
+native compile and cross compile.
+
+For backward compatibility, if option not used, it still
+make use of the output of 'bison --print-localedir'.
+
+Upstream-Status: Submitted [bison-patches@gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gettext-tools/gnulib-m4/bison-i18n.m4 | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/gettext-tools/gnulib-m4/bison-i18n.m4 b/gettext-tools/gnulib-m4/bison-i18n.m4
+index f5cfd3a..fb6ac4d 100644
+--- a/gettext-tools/gnulib-m4/bison-i18n.m4
++++ b/gettext-tools/gnulib-m4/bison-i18n.m4
+@@ -14,11 +14,16 @@ dnl sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files
+ dnl and defines YYENABLE_NLS if there are bison-runtime.mo files at all.
+ AC_DEFUN([BISON_I18N],
+ [
++ dnl Default is not to set bisonlocaledir
++ AC_ARG_WITH([bisonlocaledir],
++ [ --with-bisonlocaledir sets BISON_LOCALEDIR to indicate where to find the bison-runtime.mo files],
++ BISON_LOCALEDIR=$withval,
++ BISON_LOCALEDIR=)
++
+ if test -z "$USE_NLS"; then
+ echo "The BISON-I18N macro is used without being preceded by AM-GNU-GETTEXT." 1>&2
+ exit 1
+ fi
+- BISON_LOCALEDIR=
+ BISON_USE_NLS=no
+ if test "$USE_NLS" = yes; then
+ dnl Determine bison's localedir.
+@@ -26,9 +31,10 @@ AC_DEFUN([BISON_I18N],
+ dnl But even is YACC is called "yacc", it may be a script that invokes bison
+ dnl and accepts the --print-localedir option.
+ dnl YACC's default value is empty; BISON's default value is :.
+- if (${YACC-${BISON-:}} --print-localedir) >/dev/null 2>&1; then
++ if test -z "$BISON_LOCALEDIR" -a ${YACC-${BISON-:}} --print-localedir >/dev/null 2>&1; then
+ BISON_LOCALEDIR=`${YACC-${BISON-:}} --print-localedir`
+ fi
++ AC_MSG_RESULT([$BISON_LOCALEDIR])
+ AC_SUBST([BISON_LOCALEDIR])
+ if test -n "$BISON_LOCALEDIR"; then
+ dnl There is no need to enable internationalization if the user doesn't
+--
+1.9.1
+
diff --git a/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch b/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch
new file mode 100644
index 00000000..6af16041
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch
@@ -0,0 +1,87 @@
+From e546de65a333789e83f5485757967cee29ee3681 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 19 Feb 2017 23:32:46 -0800
+Subject: [PATCH] cr-statement.c/timsort.h: fix formatting issues
+
+Fixed when compile with "-Wformat -Wformat-security -Werror=format-security":
+| gettext-tools/gnulib-lib/libcroco/cr-statement.c: In function 'cr_statement_dump_charset':
+| gettext-tools/gnulib-lib/libcroco/cr-statement.c:2661:17: error: format not a string literal and no format arguments [-Werror=format-security]
+| fprintf (a_fp, str) ;
+
+And:
+gettext-tools/gnulib-lib/libxml/timsort.h:326:80: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
+ fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size);
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ gettext-tools/gnulib-lib/libcroco/cr-statement.c | 10 +++++-----
+ gettext-tools/gnulib-lib/libxml/timsort.h | 2 +-
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/gettext-tools/gnulib-lib/libcroco/cr-statement.c b/gettext-tools/gnulib-lib/libcroco/cr-statement.c
+index 617520f..100104b 100644
+--- a/gettext-tools/gnulib-lib/libcroco/cr-statement.c
++++ b/gettext-tools/gnulib-lib/libcroco/cr-statement.c
+@@ -2607,7 +2607,7 @@ cr_statement_dump_ruleset (CRStatement * a_this, FILE * a_fp, glong a_indent)
+ g_return_if_fail (a_fp && a_this);
+ str = cr_statement_ruleset_to_string (a_this, a_indent);
+ if (str) {
+- fprintf (a_fp, str);
++ fprintf (a_fp, "%s", str);
+ g_free (str);
+ str = NULL;
+ }
+@@ -2658,7 +2658,7 @@ cr_statement_dump_charset (CRStatement * a_this, FILE * a_fp, gulong a_indent)
+ str = cr_statement_charset_to_string (a_this,
+ a_indent) ;
+ if (str) {
+- fprintf (a_fp, str) ;
++ fprintf (a_fp, "%s", str) ;
+ g_free (str) ;
+ str = NULL ;
+ }
+@@ -2685,7 +2685,7 @@ cr_statement_dump_page (CRStatement * a_this, FILE * a_fp, gulong a_indent)
+
+ str = cr_statement_at_page_rule_to_string (a_this, a_indent) ;
+ if (str) {
+- fprintf (a_fp, str);
++ fprintf (a_fp, "%s", str);
+ g_free (str) ;
+ str = NULL ;
+ }
+@@ -2711,7 +2711,7 @@ cr_statement_dump_media_rule (CRStatement * a_this,
+
+ str = cr_statement_media_rule_to_string (a_this, a_indent) ;
+ if (str) {
+- fprintf (a_fp, str) ;
++ fprintf (a_fp, "%s", str) ;
+ g_free (str) ;
+ str = NULL ;
+ }
+@@ -2737,7 +2737,7 @@ cr_statement_dump_import_rule (CRStatement * a_this, FILE * a_fp,
+
+ str = cr_statement_import_rule_to_string (a_this, a_indent) ;
+ if (str) {
+- fprintf (a_fp, str) ;
++ fprintf (a_fp, "%s", str) ;
+ g_free (str) ;
+ str = NULL ;
+ }
+diff --git a/gettext-tools/gnulib-lib/libxml/timsort.h b/gettext-tools/gnulib-lib/libxml/timsort.h
+index 795f272..443918a 100644
+--- a/gettext-tools/gnulib-lib/libxml/timsort.h
++++ b/gettext-tools/gnulib-lib/libxml/timsort.h
+@@ -323,7 +323,7 @@ static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size)
+ SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
+ if (tempstore == NULL)
+ {
+- fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size);
++ fprintf(stderr, "Error allocating temporary storage for tim sort: need %zu bytes", sizeof(SORT_TYPE) * new_size);
+ exit(1);
+ }
+ store->storage = tempstore;
+--
+2.10.2
+
diff --git a/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/parallel.patch b/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/parallel.patch
new file mode 100644
index 00000000..c8e2c94a
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/parallel.patch
@@ -0,0 +1,23 @@
+instal libgettextlib.a before removing it
+
+In a multiple job build, Makefile can simultaneously
+be installing and removing libgettextlib.a. We serialize
+the operations.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/gettext-tools/gnulib-lib/Makefile.am
++++ b/gettext-tools/gnulib-lib/Makefile.am
+@@ -57,6 +57,10 @@ endif
+ # Rules generated and collected by gnulib-tool.
+ include Makefile.gnulib
+
++# defined in Makefile.gnulib but missing this dependency
++#
++install-exec-clean: install-libLTLIBRARIES
++
+ # Which classes to export from the shared library.
+ MOOPPFLAGS += --dllexport=styled_ostream
+
diff --git a/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/use-pkgconfig.patch b/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/use-pkgconfig.patch
new file mode 100644
index 00000000..6156a153
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-0.19.8.1/use-pkgconfig.patch
@@ -0,0 +1,321 @@
+For reasons which I just can't fathom gnulib doesn't use the expected tools to
+find libraries but badly reinvents the wheel. This will trivially lead to host
+contamination (explicit searches of /usr/lib) or incorrect RPATHs (bad
+canonicalisation resulting in relative paths).
+
+Simply delete all the crazy, and replace with a single call to pkg-config.
+
+Upstream-Status: Inappropriate (upstream still refuse to consider pkg-config)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/gnulib-local/m4/libcroco.m4 b/gnulib-local/m4/libcroco.m4
+index f79ea82f1..1f67274db 100644
+--- a/gettext-tools/gnulib-m4/libcroco.m4
++++ b/gettext-tools/gnulib-m4/libcroco.m4
+@@ -8,6 +8,7 @@ dnl From Bruno Haible.
+
+ AC_DEFUN([gl_LIBCROCO],
+ [
++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ dnl libcroco depends on libglib.
+ AC_REQUIRE([gl_LIBGLIB])
+
+@@ -23,65 +24,10 @@ AC_DEFUN([gl_LIBCROCO],
+ LTLIBCROCO=
+ INCCROCO=
+ if test "$gl_cv_libcroco_use_included" != yes; then
+- dnl Figure out whether we can use a preinstalled libcroco-0.6, or have to
+- dnl use the included one.
+- AC_CACHE_VAL([gl_cv_libcroco], [
+- gl_cv_libcroco=no
+- gl_cv_LIBCROCO=
+- gl_cv_LTLIBCROCO=
+- gl_cv_INCCROCO=
+- gl_save_LIBS="$LIBS"
+- dnl Search for libcroco and define LIBCROCO_0_6, LTLIBCROCO_0_6 and
+- dnl INCCROCO_0_6 accordingly.
+- dnl Don't use croco-0.6-config nor pkg-config, since it doesn't work when
+- dnl cross-compiling or when the C compiler in use is different from the
+- dnl one that built the library.
+- AC_LIB_LINKFLAGS_BODY([croco-0.6], [glib-2.0])
+- LIBS="$gl_save_LIBS $LIBCROCO_0_6"
+- AC_TRY_LINK([#include <libcroco-config.h>],
+- [const char *version = LIBCROCO_VERSION; return !version;],
+- [gl_cv_libcroco=yes
+- gl_cv_LIBCROCO="$LIBCROCO_0_6"
+- gl_cv_LTLIBCROCO="$LTLIBCROCO_0_6"
+- ])
+- if test "$gl_cv_libcroco" != yes; then
+- gl_save_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="$CPPFLAGS $INCCROCO_0_6"
+- AC_TRY_LINK([#include <libcroco-config.h>],
+- [const char *version = LIBCROCO_VERSION; return !version;],
+- [gl_cv_libcroco=yes
+- gl_cv_LIBCROCO="$LIBCROCO_0_6"
+- gl_cv_LTLIBCROCO="$LTLIBCROCO_0_6"
+- gl_cv_INCCROCO="$INCCROCO_0_6"
+- ])
+- if test "$gl_cv_libcroco" != yes; then
+- dnl Often the include files are installed in
+- dnl /usr/include/libcroco-0.6/libcroco.
+- AC_TRY_LINK([#include <libcroco-0.6/libcroco/libcroco-config.h>],
+- [const char *version = LIBCROCO_VERSION; return !version;],
+- [gl_ABSOLUTE_HEADER([libcroco-0.6/libcroco/libcroco-config.h])
+- libcroco_include_dir=`echo "$gl_cv_absolute_libcroco_0_6_libcroco_libcroco_config_h" | sed -e 's,.libcroco-config\.h$,,'`
+- if test -d "$libcroco_include_dir"; then
+- gl_cv_libcroco=yes
+- gl_cv_LIBCROCO="$LIBCROCO_0_6"
+- gl_cv_LTLIBCROCO="$LTLIBCROCO_0_6"
+- gl_cv_INCCROCO="-I$libcroco_include_dir"
+- fi
+- ])
+- fi
+- CPPFLAGS="$gl_save_CPPFLAGS"
+- fi
+- LIBS="$gl_save_LIBS"
+- ])
+- AC_MSG_CHECKING([for libcroco])
+- AC_MSG_RESULT([$gl_cv_libcroco])
+- if test $gl_cv_libcroco = yes; then
+- LIBCROCO="$gl_cv_LIBCROCO"
+- LTLIBCROCO="$gl_cv_LTLIBCROCO"
+- INCCROCO="$gl_cv_INCCROCO"
+- else
+- gl_cv_libcroco_use_included=yes
+- fi
++ PKG_CHECK_MODULES([CROCO], [libcroco-0.6])
++ LIBCROCO=$CROCO_LIBS
++ LTLIBCROCO=$CROCO_LIBS
++ INCCROCO=$CROCO_CFLAGS
+ fi
+ AC_SUBST([LIBCROCO])
+ AC_SUBST([LTLIBCROCO])
+diff --git a/gnulib-local/m4/libglib.m4 b/gnulib-local/m4/libglib.m4
+index 42e55e6fd..ab25a5b22 100644
+--- a/gettext-tools/gnulib-m4/libglib.m4
++++ b/gettext-tools/gnulib-m4/libglib.m4
+@@ -8,6 +8,7 @@ dnl From Bruno Haible.
+
+ AC_DEFUN([gl_LIBGLIB],
+ [
++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ AC_MSG_CHECKING([whether included glib is requested])
+ AC_ARG_WITH([included-glib],
+ [ --with-included-glib use the glib2 included here],
+@@ -20,76 +21,10 @@ AC_DEFUN([gl_LIBGLIB],
+ LTLIBGLIB=
+ INCGLIB=
+ if test "$gl_cv_libglib_use_included" != yes; then
+- dnl Figure out whether we can use a preinstalled libglib-2.0, or have to use
+- dnl the included one.
+- AC_CACHE_VAL([gl_cv_libglib], [
+- gl_cv_libglib=no
+- gl_cv_LIBGLIB=
+- gl_cv_LTLIBGLIB=
+- gl_cv_INCGLIB=
+- gl_save_LIBS="$LIBS"
+- dnl Search for libglib2 and define LIBGLIB_2_0, LTLIBGLIB_2_0 and
+- dnl INCGLIB_2_0 accordingly.
+- dnl Don't use glib-config nor pkg-config, since it doesn't work when
+- dnl cross-compiling or when the C compiler in use is different from the
+- dnl one that built the library.
+- AC_LIB_LINKFLAGS_BODY([glib-2.0])
+- LIBS="$gl_save_LIBS $LIBGLIB_2_0"
+- AC_TRY_LINK([#include <glib.h>
+-#ifndef G_BEGIN_DECLS
+-error this glib.h includes a glibconfig.h from a glib version 1.x
+-#endif
+-],
+- [g_string_new ("foo");],
+- [gl_cv_libglib=yes
+- gl_cv_LIBGLIB="$LIBGLIB_2_0"
+- gl_cv_LTLIBGLIB="$LTLIBGLIB_2_0"
+- ])
+- if test "$gl_cv_libglib" != yes; then
+- gl_save_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="$CPPFLAGS $INCGLIB_2_0"
+- AC_TRY_LINK([#include <glib.h>
+-#ifndef G_BEGIN_DECLS
+-error this glib.h includes a glibconfig.h from a glib version 1.x
+-#endif
+-],
+- [g_string_new ("foo");],
+- [gl_cv_libglib=yes
+- gl_cv_LIBGLIB="$LIBGLIB_2_0"
+- gl_cv_LTLIBGLIB="$LTLIBGLIB_2_0"
+- gl_cv_INCGLIB="$INCGLIB_2_0"
+- ])
+- if test "$gl_cv_libglib" != yes; then
+- dnl Often the include files are installed in /usr/include/glib-2.0
+- dnl and /usr/lib/glib-2.0/include.
+- if test -n "$LIBGLIB_2_0_PREFIX"; then
+- CPPFLAGS="$gl_save_CPPFLAGS -I$LIBGLIB_2_0_PREFIX/include/glib-2.0 -I$LIBGLIB_2_0_PREFIX/$acl_libdirstem/glib-2.0/include"
+- AC_TRY_LINK([#include <glib.h>
+-#ifndef G_BEGIN_DECLS
+-error this glib.h includes a glibconfig.h from a glib version 1.x
+-#endif
+-],
+- [g_string_new ("foo");],
+- [gl_cv_libglib=yes
+- gl_cv_LIBGLIB="$LIBGLIB_2_0"
+- gl_cv_LTLIBGLIB="$LTLIBGLIB_2_0"
+- gl_cv_INCGLIB="-I$LIBGLIB_2_0_PREFIX/include/glib-2.0 -I$LIBGLIB_2_0_PREFIX/$acl_libdirstem/glib-2.0/include"
+- ])
+- fi
+- fi
+- CPPFLAGS="$gl_save_CPPFLAGS"
+- fi
+- LIBS="$gl_save_LIBS"
+- ])
+- AC_MSG_CHECKING([for glib])
+- AC_MSG_RESULT([$gl_cv_libglib])
+- if test $gl_cv_libglib = yes; then
+- LIBGLIB="$gl_cv_LIBGLIB"
+- LTLIBGLIB="$gl_cv_LTLIBGLIB"
+- INCGLIB="$gl_cv_INCGLIB"
+- else
+- gl_cv_libglib_use_included=yes
+- fi
++ PKG_CHECK_MODULES([GLIB], [glib-2.0])
++ LIBGLIB="$GLIB_LIBS"
++ LTLIBGLIB="$GLIB_LIBS"
++ INCGLIB="$GLIB_CFLAGS"
+ fi
+ AC_SUBST([LIBGLIB])
+ AC_SUBST([LTLIBGLIB])
+diff --git a/gnulib-local/m4/libxml.m4 b/gnulib-local/m4/libxml.m4
+index 480c700d2..cb39309d5 100644
+--- a/gettext-tools/gnulib-m4/libxml.m4
++++ b/gettext-tools/gnulib-m4/libxml.m4
+@@ -8,6 +8,7 @@ dnl From Bruno Haible.
+
+ AC_DEFUN([gl_LIBXML],
+ [
++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ AC_REQUIRE([AM_ICONV_LINK])
+
+ AC_MSG_CHECKING([whether included libxml is requested])
+@@ -22,100 +22,10 @@ AC_DEFUN([gl_LIBXML],
+ LTLIBXML=
+ INCXML=
+ if test "$gl_cv_libxml_use_included" != yes; then
+- dnl Figure out whether we can use a preinstalled libxml2, or have to use
+- dnl the included one.
+- AC_CACHE_VAL([gl_cv_libxml], [
+- gl_cv_libxml=no
+- gl_cv_LIBXML=
+- gl_cv_LTLIBXML=
+- gl_cv_INCXML=
+- gl_save_LIBS="$LIBS"
+- LIBS="$LIBS $LIBICONV"
+- dnl Search for libxml2 and define LIBXML2, LTLIBXML2 and INCXML2
+- dnl accordingly.
+- dnl Don't use xml2-config nor pkg-config, since it doesn't work when
+- dnl cross-compiling or when the C compiler in use is different from the
+- dnl one that built the library.
+- dnl Use a test program that tries to invoke xmlFree. On Cygwin 1.7.x,
+- dnl libxml2 is built in such a way that uses of xmlFree work fine with
+- dnl -Wl,--enable-auto-import but lead to a link error with
+- dnl -Wl,--disable-auto-import.
+- AC_LIB_LINKFLAGS_BODY([xml2])
+- LIBS="$gl_save_LIBS $LIBXML2 $LIBICONV"
+- AC_TRY_LINK([#include <libxml/xmlversion.h>
+- #include <libxml/xmlmemory.h>
+- #include <libxml/xpath.h>
+- ],
+- [xmlCheckVersion (0);
+- xmlFree ((void *) 0);
+- xmlXPathSetContextNode ((void *)0, (void *)0);
+- ],
+- [gl_cv_libxml=yes
+- gl_cv_LIBXML="$LIBXML2 $LIBICONV"
+- gl_cv_LTLIBXML="$LTLIBXML2 $LTLIBICONV"
+- ])
+- if test "$gl_cv_libxml" != yes; then
+- gl_save_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="$CPPFLAGS $INCXML2"
+- AC_TRY_LINK([#include <libxml/xmlversion.h>
+- #include <libxml/xmlmemory.h>
+- #include <libxml/xpath.h>
+- ],
+- [xmlCheckVersion (0);
+- xmlFree ((void *) 0);
+- xmlXPathSetContextNode ((void *)0, (void *)0);
+- ],
+- [gl_cv_libxml=yes
+- gl_cv_LIBXML="$LIBXML2 $LIBICONV"
+- gl_cv_LTLIBXML="$LTLIBXML2 $LTLIBICONV"
+- gl_cv_INCXML="$INCXML2"
+- ])
+- if test "$gl_cv_libxml" != yes; then
+- dnl Often the include files are installed in /usr/include/libxml2.
+- dnl In libxml2-2.5, <libxml/xmlversion.h> is self-contained.
+- dnl In libxml2-2.6, it includes <libxml/xmlexports.h> which is
+- dnl self-contained.
+- libxml2_include_dir=
+- AC_TRY_CPP([#include <libxml2/libxml/xmlexports.h>],
+- [gl_ABSOLUTE_HEADER([libxml2/libxml/xmlexports.h])
+- libxml2_include_dir=`echo "$gl_cv_absolute_libxml2_libxml_xmlexports_h" | sed -e 's,.libxml.xmlexports\.h$,,'`
+- ])
+- if test -z "$libxml2_include_dir"; then
+- AC_TRY_CPP([#include <libxml2/libxml/xmlversion.h>],
+- [gl_ABSOLUTE_HEADER([libxml2/libxml/xmlversion.h])
+- libxml2_include_dir=`echo "$gl_cv_absolute_libxml2_libxml_xmlversion_h" | sed -e 's,.libxml.xmlversion\.h$,,'`
+- ])
+- fi
+- if test -n "$libxml2_include_dir" && test -d "$libxml2_include_dir"; then
+- CPPFLAGS="$gl_save_CPPFLAGS -I$libxml2_include_dir"
+- AC_TRY_LINK([#include <libxml/xmlversion.h>
+- #include <libxml/xmlmemory.h>
+- #include <libxml/xpath.h>
+- ],
+- [xmlCheckVersion (0);
+- xmlFree ((void *) 0);
+- xmlXPathSetContextNode ((void *)0, (void *)0);
+- ],
+- [gl_cv_libxml=yes
+- gl_cv_LIBXML="$LIBXML2 $LIBICONV"
+- gl_cv_LTLIBXML="$LTLIBXML2 $LTLIBICONV"
+- gl_cv_INCXML="-I$libxml2_include_dir"
+- ])
+- fi
+- fi
+- CPPFLAGS="$gl_save_CPPFLAGS"
+- fi
+- LIBS="$gl_save_LIBS"
+- ])
+- AC_MSG_CHECKING([for libxml])
+- AC_MSG_RESULT([$gl_cv_libxml])
+- if test $gl_cv_libxml = yes; then
+- LIBXML="$gl_cv_LIBXML"
+- LTLIBXML="$gl_cv_LTLIBXML"
+- INCXML="$gl_cv_INCXML"
+- else
+- gl_cv_libxml_use_included=yes
+- fi
++ PKG_CHECK_MODULES([XML], [libxml-2.0])
++ LIBXML=$XML_LIBS
++ LTLIBXML=$XML_LIBS
++ INCXML=$XML_CFLAGS
+ fi
+ AC_SUBST([LIBXML])
+ AC_SUBST([LTLIBXML])
+diff --git a/gnulib-local/lib/term-styled-ostream.oo.c b/gnulib-local/lib/term-styled-ostream.oo.c
+index 81a407467..218565329 100644
+--- a/gettext-tools/gnulib-lib/term-styled-ostream.oo.c
++++ b/gettext-tools/gnulib-lib/term-styled-ostream.oo.c
+@@ -25,4 +25,4 @@
+-#include <cr-om-parser.h>
+-#include <cr-sel-eng.h>
+-#include <cr-style.h>
+-#include <cr-rgb.h>
++#include <libcroco/cr-om-parser.h>
++#include <libcroco/cr-sel-eng.h>
++#include <libcroco/cr-style.h>
++#include <libcroco/cr-rgb.h>
+@@ -31 +31 @@
+-# include <cr-fonts.h>
++# include <libcroco/cr-fonts.h>
+@@ -33 +33 @@
+-#include <cr-string.h>
++#include <libcroco/cr-string.h>
diff --git a/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch
new file mode 100644
index 00000000..29ef2a5a
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch
@@ -0,0 +1,38 @@
+[PATCH] Disable the test to convert euc-jp
+
+Remove the test "Test against HP-UX 11.11 bug:
+No converter from EUC-JP to UTF-8 is provided"
+since we don't support HP-UX and if the euc-jp is not
+installed on the host, the dependence will be built without
+iconv support and will cause guile-native building fail.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ iconv.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/iconv.m4 b/iconv.m4
+index 4e37363..35f54bd 100644
+--- a/iconv.m4
++++ b/iconv.m4
+@@ -165,6 +165,7 @@ AC_DEFUN([AM_ICONV_LINK],
+ }
+ }
+ #endif
++#if 0
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+@@ -176,6 +177,7 @@ AC_DEFUN([AM_ICONV_LINK],
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ result |= 16;
++#endif
+ return result;
+ ]])],
+ [am_cv_func_iconv_works=yes], ,
+--
+2.0.1
+
diff --git a/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/COPYING b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/COPYING
new file mode 100644
index 00000000..3671ab69
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/COPYING
@@ -0,0 +1,4 @@
+dnl Copyright (C) 1995-2016 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
diff --git a/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/Makefile.in.in b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/Makefile.in.in
new file mode 100644
index 00000000..38c293d2
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/Makefile.in.in
@@ -0,0 +1,483 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+#
+# Origin: gettext-0.19.8
+GETTEXT_MACRO_VERSION = 0.19
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SED = @SED@
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+# When building gettext-tools, we prefer to use the built programs
+# rather than installed programs. However, we can't do that when we
+# are cross compiling.
+CROSS_COMPILING = @CROSS_COMPILING@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
+POFILESDEPS_yes = $(POFILESDEPS_)
+POFILESDEPS_no =
+POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
+
+DISTFILESDEPS_ = update-po
+DISTFILESDEPS_yes = $(DISTFILESDEPS_)
+DISTFILESDEPS_no =
+DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+ @echo "$(MSGFMT) -c -o $@ $<"; \
+ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+ @lang=`echo $* | sed -e 's,.*/,,'`; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+ sed -e '/^#/d' $< > t-$@
+ mv t-$@ $@
+
+
+all: all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# Ensure that the gettext macros and this Makefile.in.in are in sync.
+CHECK_MACRO_VERSION = \
+ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
+ exit 1; \
+ }
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+ @$(CHECK_MACRO_VERSION)
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ echo "touch stamp-po" && \
+ echo timestamp > stamp-poT && \
+ mv stamp-poT stamp-po; \
+ }
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+# The determination of whether the package xyz is a GNU one is based on the
+# heuristic whether some file in the top level directory mentions "GNU xyz".
+# If GNU 'find' is available, we avoid grepping through monster files.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ package_gnu="$(PACKAGE_GNU)"; \
+ test -n "$$package_gnu" || { \
+ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
+ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \
+ -size -10000000c -exec grep 'GNU @PACKAGE@' \
+ /dev/null '{}' ';' 2>/dev/null; \
+ else \
+ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
+ fi; \
+ } | grep -v 'libtool:' >/dev/null; then \
+ package_gnu=yes; \
+ else \
+ package_gnu=no; \
+ fi; \
+ }; \
+ if test "$$package_gnu" = "yes"; then \
+ package_prefix='GNU '; \
+ else \
+ package_prefix=''; \
+ fi; \
+ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+ else \
+ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+ fi; \
+ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ *) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --package-name="$${package_prefix}@PACKAGE@" \
+ --package-version='@VERSION@' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ esac
+ test ! -f $(DOMAIN).po || { \
+ if test -f $(srcdir)/$(DOMAIN).pot-header; then \
+ sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \
+ cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po; \
+ rm -f $(DOMAIN).1po; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+ else \
+ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ else \
+ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+ fi; \
+ }
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+ $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(POFILESDEPS)
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) \
+ && { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+ esac; \
+ }; \
+ else \
+ $(MAKE) $${lang}.po-create; \
+ fi
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ $(INSTALL_DATA) $(srcdir)/$$file \
+ $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ for file in Makevars; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+install-data-no: all
+install-data-yes: all
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+ fi; \
+ done; \
+ done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(DESTDIR)$$dir; \
+ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+ if test -n "$$lc"; then \
+ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+ for file in *; do \
+ if test -f $$file; then \
+ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+ fi; \
+ done); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+ else \
+ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+ :; \
+ else \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+ fi; \
+ fi; \
+ fi; \
+ done; \
+ done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ for file in $(DISTFILES.common) Makevars.template; do \
+ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+uninstall-data-no:
+uninstall-data-yes:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+ done; \
+ done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+ rm -f remove-potcdate.sed
+ rm -f stamp-poT
+ rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ dists="$$dists $(DOMAIN).pot stamp-po"; \
+ fi; \
+ if test -f $(srcdir)/ChangeLog; then \
+ dists="$$dists ChangeLog"; \
+ fi; \
+ for i in 0 1 2 3 4 5 6 7 8 9; do \
+ if test -f $(srcdir)/ChangeLog.$$i; then \
+ dists="$$dists ChangeLog.$$i"; \
+ fi; \
+ done; \
+ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+ for file in $$dists; do \
+ if test -f $$file; then \
+ cp -p $$file $(distdir) || exit 1; \
+ else \
+ cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+ fi; \
+ done
+
+update-po: Makefile
+ $(MAKE) $(DOMAIN).pot-update
+ test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+ $(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+ @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+ exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+ @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
+ echo "$$lang:"; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ esac; \
+ }; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.po failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
+# because execution permission bits may not work on the current file system.
+# Use @SHELL@, which is the shell determined by autoconf for the use by its
+# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && @SHELL@ ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/aclocal.tgz b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/aclocal.tgz
new file mode 100644
index 00000000..9b2d1f56
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/aclocal.tgz
Binary files differ
diff --git a/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/config.rpath b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/config.rpath
new file mode 100755
index 00000000..98183ff2
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/config.rpath
@@ -0,0 +1,684 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2016 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
+ wl='-Wl,'
+ ;;
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ haiku*)
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd2.[01]*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ *nto* | *qnx*)
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix[4-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd[23].*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ freebsd* | dragonfly*)
+ library_names_spec='$libname$shrext'
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ *nto* | *qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/remove-potcdate.sin b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/remove-potcdate.sin
new file mode 100644
index 00000000..2436c49e
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-minimal-0.19.8.1/remove-potcdate.sin
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/external/poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.8.1.bb b/external/poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.8.1.bb
new file mode 100644
index 00000000..26ff1997
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext-minimal-native_0.19.8.1.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Minimal gettext for supporting native autoconf/automake"
+DESCRIPTION = "Contains the m4 macros sufficient to support building \
+autoconf/automake. This provides a significant build time speedup by \
+the removal of gettext-native from most dependency chains (now only \
+needed for gettext for the target)."
+SRC_URI = "file://aclocal.tgz \
+ file://config.rpath \
+ file://Makefile.in.in \
+ file://remove-potcdate.sin \
+ file://COPYING \
+ file://0001-PATCH-Disable-the-test-to-convert-euc-jp.patch \
+"
+
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+LICENSE = "FSF-Unlimited"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4bd090a20bfcd1a18f1f79837b5e3e91"
+
+inherit native
+
+S = "${WORKDIR}"
+
+do_install () {
+ install -d ${D}${datadir}/aclocal/
+ cp ${WORKDIR}/*.m4 ${D}${datadir}/aclocal/
+ install -d ${D}${datadir}/gettext/po/
+ cp ${WORKDIR}/config.rpath ${D}${datadir}/gettext/
+ cp ${WORKDIR}/Makefile.in.in ${D}${datadir}/gettext/po/
+ cp ${WORKDIR}/remove-potcdate.sin ${D}${datadir}/gettext/po/
+}
diff --git a/external/poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb b/external/poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb
new file mode 100644
index 00000000..68f5cc32
--- /dev/null
+++ b/external/poky/meta/recipes-core/gettext/gettext_0.19.8.1.bb
@@ -0,0 +1,127 @@
+SUMMARY = "Utilities and libraries for producing multi-lingual messages"
+DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. \
+These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file \
+naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and \
+a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
+HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
+SECTION = "libs"
+LICENSE = "GPLv3+ & LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "gettext-native virtual/libiconv"
+DEPENDS_class-native = "gettext-minimal-native"
+PROVIDES = "virtual/libintl virtual/gettext"
+PROVIDES_class-native = "virtual/gettext-native"
+RCONFLICTS_${PN} = "proxy-libintl"
+SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
+ file://parallel.patch \
+ file://add-with-bisonlocaledir.patch \
+ file://cr-statement.c-timsort.h-fix-formatting-issues.patch \
+ file://use-pkgconfig.patch \
+"
+
+SRC_URI[md5sum] = "97e034cf8ce5ba73a28ff6c3c0638092"
+SRC_URI[sha256sum] = "ff942af0e438ced4a8b0ea4b0b6e0d6d657157c5e2364de57baa279c1c125c43"
+
+inherit autotools texinfo pkgconfig
+
+EXTRA_OECONF += "--without-lispdir \
+ --disable-csharp \
+ --disable-libasprintf \
+ --disable-java \
+ --disable-native-java \
+ --disable-openmp \
+ --disable-acl \
+ --without-emacs \
+ --without-cvs \
+ --without-git \
+ "
+EXTRA_OECONF_append_class-target = " \
+ --with-bisonlocaledir=${datadir}/locale \
+"
+
+PACKAGECONFIG ??= "croco glib libxml"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+PACKAGECONFIG[croco] = "--without-included-libcroco,--with-included-libcroco,libcroco"
+PACKAGECONFIG[glib] = "--without-included-glib,--with-included-glib,glib-2.0"
+PACKAGECONFIG[libxml] = "--without-included-libxml,--with-included-libxml,libxml2"
+# Need paths here to avoid host contamination but this can cause RPATH warnings
+# or problems if $libdir isn't $prefix/lib.
+PACKAGECONFIG[libunistring] = "--with-libunistring-prefix=${STAGING_LIBDIR}/..,--with-included-libunistring,libunistring"
+PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
+
+acpaths = '-I ${S}/gettext-runtime/m4 \
+ -I ${S}/gettext-tools/m4'
+
+do_install_append_libc-musl () {
+ rm -f ${D}${libdir}/charset.alias
+ rm -f ${D}${includedir}/libintl.h
+ rm -f ${D}${libdir}/libintl.la
+}
+
+# these lack the .x behind the .so, but shouldn't be in the -dev package
+# Otherwise you get the following results:
+# 7.4M glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
+# 25M uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
+# because gettext depends on gettext-dev, which pulls in more -dev packages:
+# 15228 KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk
+# 1300 KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk
+# 140 KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk
+# 4 KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
+
+PACKAGES =+ "libgettextlib libgettextsrc"
+FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
+FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
+
+PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-doc"
+
+FILES_${PN} += "${libdir}/${BPN}/*"
+
+# The its/Makefile.am has defined:
+# itsdir = $(pkgdatadir)$(PACKAGE_SUFFIX)/its
+# not itsdir = $(pkgdatadir), so use wildcard to match the version.
+FILES_${PN} += "${datadir}/${BPN}-*/*"
+
+FILES_gettext-runtime = "${bindir}/gettext \
+ ${bindir}/ngettext \
+ ${bindir}/envsubst \
+ ${bindir}/gettext.sh \
+ ${libdir}/libasprintf.so* \
+ ${libdir}/GNU.Gettext.dll \
+ "
+FILES_gettext-runtime-dev += "${libdir}/libasprintf.a \
+ ${includedir}/autosprintf.h \
+ "
+FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
+ ${mandir}/man1/ngettext.* \
+ ${mandir}/man1/envsubst.* \
+ ${mandir}/man1/.* \
+ ${mandir}/man3/* \
+ ${docdir}/gettext/gettext.* \
+ ${docdir}/gettext/ngettext.* \
+ ${docdir}/gettext/envsubst.* \
+ ${docdir}/gettext/*.3.html \
+ ${datadir}/gettext/ABOUT-NLS \
+ ${docdir}/gettext/csharpdoc/* \
+ ${docdir}/libasprintf/autosprintf.html \
+ ${infodir}/autosprintf.info \
+ "
+
+do_install_append() {
+ rm -f ${D}${libdir}/preloadable_libintl.so
+}
+
+do_install_append_class-native () {
+ rm ${D}${datadir}/aclocal/*
+ rm ${D}${datadir}/gettext/config.rpath
+ rm ${D}${datadir}/gettext/po/Makefile.in.in
+ rm ${D}${datadir}/gettext/po/remove-potcdate.sin
+
+ create_wrapper ${D}${bindir}/msgfmt \
+ GETTEXTDATADIR="${STAGING_DATADIR_NATIVE}/gettext-0.19.8/"
+
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch
new file mode 100644
index 00000000..0ebf138d
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch
@@ -0,0 +1,39 @@
+From d250652782b65b071b7cc8f01f2db833df104e0e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 16 Apr 2016 13:28:59 -0700
+Subject: [PATCH] Do not ignore return value of write()
+
+gcc warns about ignoring return value when compiling
+with fortify turned on.
+
+assert when write() fails
+
+Upstream-Status: Submitted
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ glib/tests/unix.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/glib/tests/unix.c b/glib/tests/unix.c
+index 9d55a6c..a07f945 100644
+--- a/glib/tests/unix.c
++++ b/glib/tests/unix.c
+@@ -32,14 +32,15 @@ test_pipe (void)
+ GError *error = NULL;
+ int pipefd[2];
+ char buf[1024];
+- gssize bytes_read;
++ gssize bytes_read, bytes_written;
+ gboolean res;
+
+ res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error);
+ g_assert (res);
+ g_assert_no_error (error);
+
+- write (pipefd[1], "hello", sizeof ("hello"));
++ bytes_written = write (pipefd[1], "hello", sizeof ("hello"));
++ g_assert (bytes_written != -1 && "write() failed");
+ memset (buf, 0, sizeof (buf));
+ bytes_read = read (pipefd[0], buf, sizeof(buf) - 1);
+ g_assert_cmpint (bytes_read, >, 0);
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch
new file mode 100644
index 00000000..97d0aff5
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Install-gio-querymodules-as-libexec_PROGRAM.patch
@@ -0,0 +1,29 @@
+From 856045927b9ab391165c0ebabf401835f8439eab Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 22 Mar 2016 15:14:58 +0200
+Subject: [PATCH] Install gio-querymodules as libexec_PROGRAM
+
+We want to install this binary with the gio library, and debian
+renamer does not cope with library packages with files in ${bindir}
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Inappropriate [OE specific]
+
+---
+ gio/Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/gio/Makefile.am b/gio/Makefile.am
+index e14cad2..bf2bcc7 100644
+--- a/gio/Makefile.am
++++ b/gio/Makefile.am
+@@ -835,7 +835,8 @@ gio.def: libgio-2.0.la
+ gio-2.0.lib: libgio-2.0.la gio.def
+ $(AM_V_GEN) lib.exe -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:$(builddir)/gio.def -out:$@
+
+-bin_PROGRAMS = gio-querymodules glib-compile-schemas glib-compile-resources gsettings gio-launch-desktop
++bin_PROGRAMS = glib-compile-schemas glib-compile-resources gsettings gio-launch-desktop
++libexec_PROGRAMS = gio-querymodules
+
+ glib_compile_resources_LDADD = libgio-2.0.la \
+ $(top_builddir)/gobject/libgobject-2.0.la \
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch
new file mode 100644
index 00000000..67ca6240
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch
@@ -0,0 +1,43 @@
+From 2acf40361eecd17c6981743dabd06e25a9934258 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 12 Jun 2015 17:08:46 +0300
+Subject: [PATCH 05/10] Remove the warning about deprecated paths in schemas
+
+Some schemas in gsettings-desktop-schemas (such as proxy and locale)
+are still using deprecated paths, as of 3.16.1. This causes warning
+messages, and meta/lib/oe/rootfs.py complaints about them.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ gio/glib-compile-schemas.c | 13 -------------
+ 1 file changed, 13 deletions(-)
+
+diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
+index b8de090..130f89b 100644
+--- a/gio/glib-compile-schemas.c
++++ b/gio/glib-compile-schemas.c
+@@ -1219,19 +1219,6 @@ parse_state_start_schema (ParseState *state,
+ return;
+ }
+
+- if (path && (g_str_has_prefix (path, "/apps/") ||
+- g_str_has_prefix (path, "/desktop/") ||
+- g_str_has_prefix (path, "/system/")))
+- {
+- gchar *message = NULL;
+- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. "
+- "Paths starting with "
+- "“/apps/”, “/desktop/” or “/system/” are deprecated."),
+- id, path);
+- g_printerr ("%s\n", message);
+- g_free (message);
+- }
+-
+ state->schema_state = schema_state_new (path, gettext_domain,
+ extends, extends_name, list_of);
+
+--
+2.14.1
+
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch
new file mode 100644
index 00000000..697d63d5
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/0010-Do-not-hardcode-python-path-into-various-tools.patch
@@ -0,0 +1,46 @@
+From b9160d951b9af647b97766c57295ca4f45cf9521 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 3 Oct 2017 10:45:55 +0300
+Subject: [PATCH 10/10] Do not hardcode python path into various tools
+
+Upstream-Status: Inappropriate [oe-core specific]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ gio/gdbus-2.0/codegen/gdbus-codegen.in | 2 +-
+ gobject/glib-genmarshal.in | 2 +-
+ gobject/glib-mkenums.in | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+index 8050981..e693ef3 100644
+--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
++++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env @PYTHON@
++#!/usr/bin/env python3
+
+ # GDBus - GLib D-Bus Library
+ #
+diff --git a/gobject/glib-genmarshal.in b/gobject/glib-genmarshal.in
+index 09e8408..b2f9d99 100755
+--- a/gobject/glib-genmarshal.in
++++ b/gobject/glib-genmarshal.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env @PYTHON@
++#!/usr/bin/env python3
+
+ # pylint: disable=too-many-lines, missing-docstring, invalid-name
+
+diff --git a/gobject/glib-mkenums.in b/gobject/glib-mkenums.in
+index d4bfd11..051fce4 100755
+--- a/gobject/glib-mkenums.in
++++ b/gobject/glib-mkenums.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env @PYTHON@
++#!/usr/bin/env python3
+
+ # If the code below looks horrible and unpythonic, do not panic.
+ #
+--
+2.14.1
+
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-12450.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-12450.patch
new file mode 100644
index 00000000..37ad5808
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-12450.patch
@@ -0,0 +1,59 @@
+From d8f8f4d637ce43f8699ba94c9b7648beda0ca174 Mon Sep 17 00:00:00 2001
+From: Ondrej Holy <oholy@redhat.com>
+Date: Thu, 23 May 2019 10:41:53 +0200
+Subject: [PATCH] gfile: Limit access to files when copying
+
+file_copy_fallback creates new files with default permissions and
+set the correct permissions after the operation is finished. This
+might cause that the files can be accessible by more users during
+the operation than expected. Use G_FILE_CREATE_PRIVATE for the new
+files to limit access to those files.
+
+Upstream-Status: Backport
+https://gitlab.gnome.org/GNOME/glib/commit/d8f8f4d637ce43f8699ba94c9b7648beda0ca174
+CVE: CVE-2019-12450
+Signed-off-by: Armin kuster <akuster@mvista.com>
+
+---
+ gio/gfile.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/gio/gfile.c b/gio/gfile.c
+index 24b136d..74b5804 100644
+--- a/gio/gfile.c
++++ b/gio/gfile.c
+@@ -3284,12 +3284,12 @@ file_copy_fallback (GFile *source,
+ out = (GOutputStream*)_g_local_file_output_stream_replace (_g_local_file_get_filename (G_LOCAL_FILE (destination)),
+ FALSE, NULL,
+ flags & G_FILE_COPY_BACKUP,
+- G_FILE_CREATE_REPLACE_DESTINATION,
+- info,
++ G_FILE_CREATE_REPLACE_DESTINATION |
++ G_FILE_CREATE_PRIVATE, info,
+ cancellable, error);
+ else
+ out = (GOutputStream*)_g_local_file_output_stream_create (_g_local_file_get_filename (G_LOCAL_FILE (destination)),
+- FALSE, 0, info,
++ FALSE, G_FILE_CREATE_PRIVATE, info,
+ cancellable, error);
+ }
+ else if (flags & G_FILE_COPY_OVERWRITE)
+@@ -3297,12 +3297,13 @@ file_copy_fallback (GFile *source,
+ out = (GOutputStream *)g_file_replace (destination,
+ NULL,
+ flags & G_FILE_COPY_BACKUP,
+- G_FILE_CREATE_REPLACE_DESTINATION,
++ G_FILE_CREATE_REPLACE_DESTINATION |
++ G_FILE_CREATE_PRIVATE,
+ cancellable, error);
+ }
+ else
+ {
+- out = (GOutputStream *)g_file_create (destination, 0, cancellable, error);
++ out = (GOutputStream *)g_file_create (destination, G_FILE_CREATE_PRIVATE, cancellable, error);
+ }
+
+ if (!out)
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-9633_p1.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-9633_p1.patch
new file mode 100644
index 00000000..f95716ae
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-9633_p1.patch
@@ -0,0 +1,316 @@
+From c1e32b90576af11556c8a9178e43902f3394a4b0 Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Mon, 29 Oct 2018 09:53:07 -0400
+Subject: [PATCH] gsocketclient: Improve handling of slow initial connections
+
+Currently a new connection will not be attempted until the previous
+one has timed out and as the current API only exposes a single
+timeout value in practice it often means that it will wait 30 seconds
+(or forever with 0 (the default)) on each connection.
+
+This is unacceptable so we are now trying to follow the behavior
+RFC 8305 recommends by making multiple connection attempts if
+the connection takes longer than 250ms. The first connection
+to make it to completion then wins.
+
+Upstream-Status: Backport
+CVE: CVE-2019-9633 patch 1
+Affects: < 2.59.2
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ gio/gsocketclient.c | 176 ++++++++++++++++++++++++++++++++++++++++++++--------
+ 1 file changed, 151 insertions(+), 25 deletions(-)
+
+diff --git a/gio/gsocketclient.c b/gio/gsocketclient.c
+index ddd1497..5c6513c 100644
+--- a/gio/gsocketclient.c
++++ b/gio/gsocketclient.c
+@@ -2,6 +2,7 @@
+ *
+ * Copyright © 2008, 2009 codethink
+ * Copyright © 2009 Red Hat, Inc
++ * Copyright © 2018 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+@@ -49,6 +50,10 @@
+ #include <gio/ginetaddress.h>
+ #include "glibintl.h"
+
++/* As recommended by RFC 8305 this is the time it waits
++ * on a connection before starting another concurrent attempt.
++ */
++#define HAPPY_EYEBALLS_CONNECTION_ATTEMPT_TIMEOUT_MS 250
+
+ /**
+ * SECTION:gsocketclient
+@@ -1328,28 +1333,82 @@ typedef struct
+ GSocketConnectable *connectable;
+ GSocketAddressEnumerator *enumerator;
+ GProxyAddress *proxy_addr;
+- GSocketAddress *current_addr;
+- GSocket *current_socket;
++ GSocket *socket;
+ GIOStream *connection;
+
++ GSList *connection_attempts;
+ GError *last_error;
+ } GSocketClientAsyncConnectData;
+
++static void connection_attempt_unref (gpointer attempt);
++
+ static void
+ g_socket_client_async_connect_data_free (GSocketClientAsyncConnectData *data)
+ {
+ g_clear_object (&data->connectable);
+ g_clear_object (&data->enumerator);
+ g_clear_object (&data->proxy_addr);
+- g_clear_object (&data->current_addr);
+- g_clear_object (&data->current_socket);
++ g_clear_object (&data->socket);
+ g_clear_object (&data->connection);
++ g_slist_free_full (data->connection_attempts, connection_attempt_unref);
+
+ g_clear_error (&data->last_error);
+
+ g_slice_free (GSocketClientAsyncConnectData, data);
+ }
+
++typedef struct
++{
++ GSocketAddress *address;
++ GSocket *socket;
++ GIOStream *connection;
++ GSocketClientAsyncConnectData *data; /* unowned */
++ GSource *timeout_source;
++ GCancellable *cancellable;
++ grefcount ref;
++} ConnectionAttempt;
++
++static ConnectionAttempt *
++connection_attempt_new (void)
++{
++ ConnectionAttempt *attempt = g_new0 (ConnectionAttempt, 1);
++ g_ref_count_init (&attempt->ref);
++ return attempt;
++}
++
++static ConnectionAttempt *
++connection_attempt_ref (ConnectionAttempt *attempt)
++{
++ g_ref_count_inc (&attempt->ref);
++ return attempt;
++}
++
++static void
++connection_attempt_unref (gpointer pointer)
++{
++ ConnectionAttempt *attempt = pointer;
++ if (g_ref_count_dec (&attempt->ref))
++ {
++ g_clear_object (&attempt->address);
++ g_clear_object (&attempt->socket);
++ g_clear_object (&attempt->connection);
++ g_clear_object (&attempt->cancellable);
++ if (attempt->timeout_source)
++ {
++ g_source_destroy (attempt->timeout_source);
++ g_source_unref (attempt->timeout_source);
++ }
++ g_free (attempt);
++ }
++}
++
++static void
++connection_attempt_remove (ConnectionAttempt *attempt)
++{
++ attempt->data->connection_attempts = g_slist_remove (attempt->data->connection_attempts, attempt);
++ connection_attempt_unref (attempt);
++}
++
+ static void
+ g_socket_client_async_connect_complete (GSocketClientAsyncConnectData *data)
+ {
+@@ -1359,8 +1418,7 @@ g_socket_client_async_connect_complete (GSocketClientAsyncConnectData *data)
+ {
+ GSocketConnection *wrapper_connection;
+
+- wrapper_connection = g_tcp_wrapper_connection_new (data->connection,
+- data->current_socket);
++ wrapper_connection = g_tcp_wrapper_connection_new (data->connection, data->socket);
+ g_object_unref (data->connection);
+ data->connection = (GIOStream *)wrapper_connection;
+ }
+@@ -1389,8 +1447,7 @@ static void
+ enumerator_next_async (GSocketClientAsyncConnectData *data)
+ {
+ /* We need to cleanup the state */
+- g_clear_object (&data->current_socket);
+- g_clear_object (&data->current_addr);
++ g_clear_object (&data->socket);
+ g_clear_object (&data->proxy_addr);
+ g_clear_object (&data->connection);
+
+@@ -1485,34 +1542,68 @@ g_socket_client_connected_callback (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
+ {
+- GSocketClientAsyncConnectData *data = user_data;
++ ConnectionAttempt *attempt = user_data;
++ GSocketClientAsyncConnectData *data = attempt->data;
++ GSList *l;
+ GError *error = NULL;
+ GProxy *proxy;
+ const gchar *protocol;
+
+- if (g_task_return_error_if_cancelled (data->task))
++ /* data is NULL once the task is completed */
++ if (data && g_task_return_error_if_cancelled (data->task))
+ {
+ g_object_unref (data->task);
++ connection_attempt_unref (attempt);
+ return;
+ }
+
++ if (attempt->timeout_source)
++ {
++ g_source_destroy (attempt->timeout_source);
++ g_clear_pointer (&attempt->timeout_source, g_source_unref);
++ }
++
+ if (!g_socket_connection_connect_finish (G_SOCKET_CONNECTION (source),
+ result, &error))
+ {
+- clarify_connect_error (error, data->connectable,
+- data->current_addr);
+- set_last_error (data, error);
++ if (!g_cancellable_is_cancelled (attempt->cancellable))
++ {
++ clarify_connect_error (error, data->connectable, attempt->address);
++ set_last_error (data, error);
++ }
++ else
++ g_clear_error (&error);
++
++ if (data)
++ {
++ connection_attempt_remove (attempt);
++ enumerator_next_async (data);
++ }
++ else
++ connection_attempt_unref (attempt);
+
+- /* try next one */
+- enumerator_next_async (data);
+ return;
+ }
+
++ data->socket = g_steal_pointer (&attempt->socket);
++ data->connection = g_steal_pointer (&attempt->connection);
++
++ for (l = data->connection_attempts; l; l = g_slist_next (l))
++ {
++ ConnectionAttempt *attempt_entry = l->data;
++ g_cancellable_cancel (attempt_entry->cancellable);
++ attempt_entry->data = NULL;
++ connection_attempt_unref (attempt_entry);
++ }
++ g_slist_free (data->connection_attempts);
++ data->connection_attempts = NULL;
++ connection_attempt_unref (attempt);
++
+ g_socket_connection_set_cached_remote_address ((GSocketConnection*)data->connection, NULL);
+ g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_CONNECTED, data->connectable, data->connection);
+
+ /* wrong, but backward compatible */
+- g_socket_set_blocking (data->current_socket, TRUE);
++ g_socket_set_blocking (data->socket, TRUE);
+
+ if (!data->proxy_addr)
+ {
+@@ -1565,6 +1656,26 @@ g_socket_client_connected_callback (GObject *source,
+ }
+ }
+
++static gboolean
++on_connection_attempt_timeout (gpointer data)
++{
++ ConnectionAttempt *attempt = data;
++
++ enumerator_next_async (attempt->data);
++
++ g_clear_pointer (&attempt->timeout_source, g_source_unref);
++ return G_SOURCE_REMOVE;
++}
++
++static void
++on_connection_cancelled (GCancellable *cancellable,
++ gpointer data)
++{
++ GCancellable *attempt_cancellable = data;
++
++ g_cancellable_cancel (attempt_cancellable);
++}
++
+ static void
+ g_socket_client_enumerator_callback (GObject *object,
+ GAsyncResult *result,
+@@ -1573,6 +1684,7 @@ g_socket_client_enumerator_callback (GObject *object,
+ GSocketClientAsyncConnectData *data = user_data;
+ GSocketAddress *address = NULL;
+ GSocket *socket;
++ ConnectionAttempt *attempt;
+ GError *error = NULL;
+
+ if (g_task_return_error_if_cancelled (data->task))
+@@ -1585,6 +1697,9 @@ g_socket_client_enumerator_callback (GObject *object,
+ result, &error);
+ if (address == NULL)
+ {
++ if (data->connection_attempts)
++ return;
++
+ g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_COMPLETE, data->connectable, NULL);
+ if (!error)
+ {
+@@ -1621,16 +1736,27 @@ g_socket_client_enumerator_callback (GObject *object,
+ return;
+ }
+
+- data->current_socket = socket;
+- data->current_addr = address;
+- data->connection = (GIOStream *) g_socket_connection_factory_create_connection (socket);
+-
+- g_socket_connection_set_cached_remote_address ((GSocketConnection*)data->connection, address);
+- g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_CONNECTING, data->connectable, data->connection);
+- g_socket_connection_connect_async (G_SOCKET_CONNECTION (data->connection),
++ attempt = connection_attempt_new ();
++ attempt->data = data;
++ attempt->socket = socket;
++ attempt->address = address;
++ attempt->cancellable = g_cancellable_new ();
++ attempt->connection = (GIOStream *)g_socket_connection_factory_create_connection (socket);
++ attempt->timeout_source = g_timeout_source_new (HAPPY_EYEBALLS_CONNECTION_ATTEMPT_TIMEOUT_MS);
++ g_source_set_callback (attempt->timeout_source, on_connection_attempt_timeout, attempt, NULL);
++ g_source_attach (attempt->timeout_source, g_main_context_get_thread_default ());
++ data->connection_attempts = g_slist_append (data->connection_attempts, attempt);
++
++ if (g_task_get_cancellable (data->task))
++ g_cancellable_connect (g_task_get_cancellable (data->task), G_CALLBACK (on_connection_cancelled),
++ g_object_ref (attempt->cancellable), g_object_unref);
++
++ g_socket_connection_set_cached_remote_address ((GSocketConnection *)attempt->connection, address);
++ g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_CONNECTING, data->connectable, attempt->connection);
++ g_socket_connection_connect_async (G_SOCKET_CONNECTION (attempt->connection),
+ address,
+- g_task_get_cancellable (data->task),
+- g_socket_client_connected_callback, data);
++ attempt->cancellable,
++ g_socket_client_connected_callback, connection_attempt_ref (attempt));
+ }
+
+ /**
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-9633_p2.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-9633_p2.patch
new file mode 100644
index 00000000..3bb2f5d9
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/CVE-2019-9633_p2.patch
@@ -0,0 +1,231 @@
+From d553d92d6e9f53cbe5a34166fcb919ba652c6a8e Mon Sep 17 00:00:00 2001
+From: Patrick Griffis <pgriffis@igalia.com>
+Date: Tue, 29 Jan 2019 10:07:06 -0500
+Subject: [PATCH] gsocketclient: Fix criticals
+
+This ensures the parent GTask is kept alive as long as an enumeration
+is running and trying to connect.
+
+Closes #1646
+Closes #1649
+
+Upstream-Status: Backport
+CVE: CVE-2019-9633 patch 2
+Affects: < 2.59.2
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ gio/gsocketclient.c | 74 +++++++++++++++++++++++++++++-------------
+ gio/tests/gsocketclient-slow.c | 55 ++++++++++++++++++++++++++++++-
+ 2 files changed, 106 insertions(+), 23 deletions(-)
+
+Index: glib-2.58.0/gio/gsocketclient.c
+===================================================================
+--- glib-2.58.0.orig/gio/gsocketclient.c
++++ glib-2.58.0/gio/gsocketclient.c
+@@ -1327,7 +1327,7 @@ g_socket_client_connect_to_uri (GSocketC
+
+ typedef struct
+ {
+- GTask *task;
++ GTask *task; /* unowned */
+ GSocketClient *client;
+
+ GSocketConnectable *connectable;
+@@ -1345,6 +1345,7 @@ static void connection_attempt_unref (gp
+ static void
+ g_socket_client_async_connect_data_free (GSocketClientAsyncConnectData *data)
+ {
++ data->task = NULL;
+ g_clear_object (&data->connectable);
+ g_clear_object (&data->enumerator);
+ g_clear_object (&data->proxy_addr);
+@@ -1444,13 +1445,19 @@ set_last_error (GSocketClientAsyncConnec
+ }
+
+ static void
+-enumerator_next_async (GSocketClientAsyncConnectData *data)
++enumerator_next_async (GSocketClientAsyncConnectData *data,
++ gboolean add_task_ref)
+ {
+ /* We need to cleanup the state */
+ g_clear_object (&data->socket);
+ g_clear_object (&data->proxy_addr);
+ g_clear_object (&data->connection);
+
++ /* Each enumeration takes a ref. This arg just avoids repeated unrefs when
++ an enumeration starts another enumeration */
++ if (add_task_ref)
++ g_object_ref (data->task);
++
+ g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_RESOLVING, data->connectable, NULL);
+ g_socket_address_enumerator_next_async (data->enumerator,
+ g_task_get_cancellable (data->task),
+@@ -1478,7 +1485,7 @@ g_socket_client_tls_handshake_callback (
+ else
+ {
+ g_object_unref (object);
+- enumerator_next_async (data);
++ enumerator_next_async (data, FALSE);
+ }
+ }
+
+@@ -1509,7 +1516,7 @@ g_socket_client_tls_handshake (GSocketCl
+ }
+ else
+ {
+- enumerator_next_async (data);
++ enumerator_next_async (data, FALSE);
+ }
+ }
+
+@@ -1530,13 +1537,24 @@ g_socket_client_proxy_connect_callback (
+ }
+ else
+ {
+- enumerator_next_async (data);
++ enumerator_next_async (data, FALSE);
+ return;
+ }
+
+ g_socket_client_tls_handshake (data);
+ }
+
++static gboolean
++task_completed_or_cancelled (GTask *task)
++{
++ if (g_task_get_completed (task))
++ return TRUE;
++ else if (g_task_return_error_if_cancelled (task))
++ return TRUE;
++ else
++ return FALSE;
++}
++
+ static void
+ g_socket_client_connected_callback (GObject *source,
+ GAsyncResult *result,
+@@ -1549,8 +1567,7 @@ g_socket_client_connected_callback (GObj
+ GProxy *proxy;
+ const gchar *protocol;
+
+- /* data is NULL once the task is completed */
+- if (data && g_task_return_error_if_cancelled (data->task))
++ if (g_cancellable_is_cancelled (attempt->cancellable) || task_completed_or_cancelled (data->task))
+ {
+ g_object_unref (data->task);
+ connection_attempt_unref (attempt);
+@@ -1570,17 +1587,15 @@ g_socket_client_connected_callback (GObj
+ {
+ clarify_connect_error (error, data->connectable, attempt->address);
+ set_last_error (data, error);
++ connection_attempt_remove (attempt);
++ enumerator_next_async (data, FALSE);
+ }
+ else
+- g_clear_error (&error);
+-
+- if (data)
+ {
+- connection_attempt_remove (attempt);
+- enumerator_next_async (data);
++ g_clear_error (&error);
++ g_object_unref (data->task);
++ connection_attempt_unref (attempt);
+ }
+- else
+- connection_attempt_unref (attempt);
+
+ return;
+ }
+@@ -1592,7 +1607,6 @@ g_socket_client_connected_callback (GObj
+ {
+ ConnectionAttempt *attempt_entry = l->data;
+ g_cancellable_cancel (attempt_entry->cancellable);
+- attempt_entry->data = NULL;
+ connection_attempt_unref (attempt_entry);
+ }
+ g_slist_free (data->connection_attempts);
+@@ -1625,7 +1639,7 @@ g_socket_client_connected_callback (GObj
+ G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ _("Proxying over a non-TCP connection is not supported."));
+
+- enumerator_next_async (data);
++ enumerator_next_async (data, FALSE);
+ }
+ else if (g_hash_table_contains (data->client->priv->app_proxies, protocol))
+ {
+@@ -1652,7 +1666,7 @@ g_socket_client_connected_callback (GObj
+ _("Proxy protocol “%s” is not supported."),
+ protocol);
+
+- enumerator_next_async (data);
++ enumerator_next_async (data, FALSE);
+ }
+ }
+
+@@ -1661,7 +1675,7 @@ on_connection_attempt_timeout (gpointer
+ {
+ ConnectionAttempt *attempt = data;
+
+- enumerator_next_async (attempt->data);
++ enumerator_next_async (attempt->data, TRUE);
+
+ g_clear_pointer (&attempt->timeout_source, g_source_unref);
+ return G_SOURCE_REMOVE;
+@@ -1687,7 +1701,7 @@ g_socket_client_enumerator_callback (GOb
+ ConnectionAttempt *attempt;
+ GError *error = NULL;
+
+- if (g_task_return_error_if_cancelled (data->task))
++ if (task_completed_or_cancelled (data->task))
+ {
+ g_object_unref (data->task);
+ return;
+@@ -1698,7 +1712,10 @@ g_socket_client_enumerator_callback (GOb
+ if (address == NULL)
+ {
+ if (data->connection_attempts)
+- return;
++ {
++ g_object_unref (data->task);
++ return;
++ }
+
+ g_socket_client_emit_event (data->client, G_SOCKET_CLIENT_COMPLETE, data->connectable, NULL);
+ if (!error)
+@@ -1732,7 +1749,7 @@ g_socket_client_enumerator_callback (GOb
+ if (socket == NULL)
+ {
+ g_object_unref (address);
+- enumerator_next_async (data);
++ enumerator_next_async (data, FALSE);
+ return;
+ }
+
+@@ -1804,11 +1821,24 @@ g_socket_client_connect_async (GSocketCl
+ else
+ data->enumerator = g_socket_connectable_enumerate (connectable);
+
++ /* The flow and ownership here isn't quite obvious:
++ - The task starts an async attempt to connect.
++ - Each attempt holds a single ref on task.
++ - Each attempt may create new attempts by timing out (not a failure) so
++ there are multiple attempts happening in parallel.
++ - Upon failure an attempt will start a new attempt that steals its ref
++ until there are no more attempts left and it drops its ref.
++ - Upon success it will cancel all other attempts and continue on
++ to the rest of the connection (tls, proxies, etc) which do not
++ happen in parallel and at the very end drop its ref.
++ - Upon cancellation an attempt drops its ref.
++ */
++
+ data->task = g_task_new (client, cancellable, callback, user_data);
+ g_task_set_source_tag (data->task, g_socket_client_connect_async);
+ g_task_set_task_data (data->task, data, (GDestroyNotify)g_socket_client_async_connect_data_free);
+
+- enumerator_next_async (data);
++ enumerator_next_async (data, FALSE);
+ }
+
+ /**
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch
new file mode 100644
index 00000000..50781e78
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/Enable-more-tests-while-cross-compiling.patch
@@ -0,0 +1,80 @@
+From 4b1a6d247c78125096a6ea5ab3cab8a1f000dc23 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 9 Nov 2015 11:07:27 +0200
+Subject: [PATCH] Enable more tests while cross-compiling
+
+Upstream disables a few tests while cross-compiling because their build requires
+running other built binaries. This usually makes sense but in the cross-compile
+case we can depend on glib-2.0-native.
+
+Upstream-Status: Inappropriate [OE specific]
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ gio/tests/Makefile.am | 10 ++++++----
+ tests/gobject/Makefile.am | 8 +++++---
+ 2 files changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
+index 1f0bed7..8295deb 100644
+--- a/gio/tests/Makefile.am
++++ b/gio/tests/Makefile.am
+@@ -550,10 +550,9 @@ test_programs += \
+ endif
+
+ # -----------------------------------------------------------------------------
+-# The resources test is a bit more complicated, and we cannot build it when
+-# cross-compiling GIO because it requires running a binary...
++# The resources test is a bit more complicated, and requires glib-native
++# for running a binary
+
+-if !CROSS_COMPILING
+ test_programs += resources
+ resources_SOURCES = resources.c
+ nodist_resources_SOURCES = test_resources.c test_resources2.c test_resources2.h
+@@ -578,7 +577,11 @@ if !ENABLE_INSTALLED_TESTS
+ libresourceplugin_la_LDFLAGS += -rpath /
+ endif
+
++if !CROSS_COMPILING
+ glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
++else
++glib_compile_resources=glib-compile-resources
++endif
+
+ test-generated.txt: test1.txt
+ $(AM_V_GEN) echo "Generated" > $@ && \
+@@ -599,7 +602,6 @@ test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --
+
+ EXTRA_DIST += test.gresource.xml test1.txt test2.gresource.xml test2.txt test3.gresource.xml test3.txt test4.gresource.xml
+ CLEANFILES += test-generated.txt test_resources.c test_resources2.[ch] plugin_resources.c test.gresource
+-endif # !CROSS_COMPILING
+
+ BUILT_SOURCES += giotypefuncs.inc
+
+diff --git a/tests/gobject/Makefile.am b/tests/gobject/Makefile.am
+index 0e60987..927d13a 100644
+--- a/tests/gobject/Makefile.am
++++ b/tests/gobject/Makefile.am
+@@ -51,10 +51,13 @@ if ENABLE_TIMELOOP
+ installed_test_programs += timeloop-closure
+ endif
+
+-# The marshal test requires running a binary, which means we cannot
+-# build it when cross-compiling
++# The marshal test requires running a binary, which means we require
++# glib-native when cross-compiling
+ if !CROSS_COMPILING
+ glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal
++else
++glib_genmarshal=$(shell which glib-genmarshal)
++endif
+
+ testmarshal.h: stamp-testmarshal.h
+ @true
+@@ -71,4 +74,3 @@ testmarshal.c: testmarshal.h testmarshal.list $(glib_genmarshal)
+ BUILT_SOURCES += testmarshal.h testmarshal.c
+ CLEANFILES += stamp-testmarshal.h testmarshal.h testmarshal.c
+ EXTRA_DIST += testcommon.h testmarshal.list
+-endif # !CROSS_COMPILING
+\ No newline at end of file
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
new file mode 100644
index 00000000..59b89134
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
@@ -0,0 +1,44 @@
+From 1dd1e6ddca5deada049bac2e1ee1fe4ecc5342c5 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sat, 28 Apr 2012 18:24:50 +0200
+Subject: [PATCH 01/10] configure: use $host_alias-libtool instead of libtool
+ directly
+
+Poky renames libtool to $host_alias-libtool.
+./$host_alias-libtool isn't created until after configure runs with
+libtool >= 2.2.2
+so we can't call # it at this point. We can safely assume a version is
+available
+from PATH though
+
+Rebased to glib-2.27.3 by Dongxiao Xu <dongxiao.xu@intel.com>
+Rebased to glib-2.32.1 by Martin Jansa <Martin.Jansa@gmail.com>
+Rebased to glib-2.31.20+ by Andre McCurdy <armccurdy@gmail.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6fa6eb0..b6f78a6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1428,9 +1428,9 @@ AS_IF([ test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL" ], [
+ LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
+ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
+ echo "void glib_plugin_test(void) { }" > plugin.c
+- ${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
++ ${SHELL} ./$host_alias-libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
+ ${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1
+- ${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
++ ${SHELL} ./$host_alias-libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
+ ${LDFLAGS} -module -o plugin.la -export-dynamic \
+ -shrext ".o" -avoid-version plugin.lo \
+ -rpath /dont/care >/dev/null 2>&1
+--
+2.14.1
+
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/date-lt.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/date-lt.patch
new file mode 100644
index 00000000..dd0aff72
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/date-lt.patch
@@ -0,0 +1,20 @@
+Update Lithuanian month names in the test suite as glibc changed the translations.
+
+Upstream-Status: Submitted [https://gitlab.gnome.org/GNOME/glib/merge_requests/373]
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/glib/tests/date.c b/glib/tests/date.c
+index b801ca704..6646c227c 100644
+--- a/glib/tests/date.c
++++ b/glib/tests/date.c
+@@ -365,8 +365,8 @@ test_month_names (void)
+ TEST_DATE ( 1, 4, 2018, "%Y m. %OB", "2018 m. balandis");
+ TEST_DATE ( 1, 5, 2018, "%Y m. %OB", "2018 m. gegužė");
+ TEST_DATE ( 1, 6, 2018, "%Y m. %OB", "2018 m. birželis");
+- TEST_DATE (17, 7, 2018, "%Y m. %b %e d.", "2018 m. Lie 17 d.");
+- TEST_DATE ( 1, 8, 2018, "%Y m. %Ob", "2018 m. Rgp");
++ TEST_DATE (17, 7, 2018, "%Y m. %b %e d.", "2018 m. Liep. 17 d.");
++ TEST_DATE ( 1, 8, 2018, "%Y m. %Ob", "2018 m. rugp.");
+ }
+ else
+ g_test_skip ("locale lt_LT not available, skipping Lithuanian month names test");
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
new file mode 100644
index 00000000..f9794d3d
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch
@@ -0,0 +1,50 @@
+From 8326961841f4d16c7239e747de11e3817c35cfd2 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Fri, 11 Mar 2016 15:35:55 +0000
+Subject: [PATCH] glib-2.0: relocate the GIO module directory for native builds
+
+Instead of hard-coding GIO_MODULE_PATH when glib is built, use dladdr() to
+determine where libglib.so is and use that path to calculate GIO_MODULES_DIR.
+
+This solves relocation problems with GIOModule for native builds of glib.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Port patch to 2.48
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ gio/giomodule.c | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/gio/giomodule.c b/gio/giomodule.c
+index 36c0cef..912e490 100644
+--- a/gio/giomodule.c
++++ b/gio/giomodule.c
+@@ -40,6 +40,8 @@
+ #include "gnetworkmonitor.h"
+ #ifdef G_OS_WIN32
+ #include "gregistrysettingsbackend.h"
++#else
++#include <dlfcn.h>
+ #endif
+ #include <glib/gstdio.h>
+
+@@ -1099,7 +1101,15 @@ get_gio_module_dir (void)
+ #endif
+ g_free (install_dir);
+ #else
+- module_dir = g_strdup (GIO_MODULE_DIR);
++ Dl_info info;
++
++ if (dladdr (g_io_module_new, &info)) {
++ char *libdir = g_path_get_dirname (info.dli_fname);
++ module_dir = g_build_filename (libdir, "gio", "modules", NULL);
++ g_free (libdir);
++ } else {
++ module_dir = g_strdup (GIO_MODULE_DIR);
++ }
+ #endif
+ }
+
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
new file mode 100644
index 00000000..8f082d34
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+set -eux
+useradd glib2-test
+su glib2-test -c gnome-desktop-testing-runner glib
+userdel glib2-test
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch
new file mode 100644
index 00000000..7aa6217d
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0/uclibc_musl_translation.patch
@@ -0,0 +1,22 @@
+Fix DATADIRNAME on uclibc/Linux
+
+translation files are always installed under PREFIX/share/locale in uclibc
+based systems therefore lets set DATADIRNAME to "share".
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: glib-2.46.1/m4macros/glib-gettext.m4
+===================================================================
+--- glib-2.46.1.orig/m4macros/glib-gettext.m4
++++ glib-2.46.1/m4macros/glib-gettext.m4
+@@ -243,6 +243,10 @@ msgstr ""
+ CATOBJEXT=.mo
+ DATADIRNAME=share
+ ;;
++ *-*-musl* | *-*-linux-uclibc*)
++ CATOBJEXT=.gmo
++ DATADIRNAME=share
++ ;;
+ *)
+ CATOBJEXT=.mo
+ DATADIRNAME=lib
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib-2.0_2.58.0.bb b/external/poky/meta/recipes-core/glib-2.0/glib-2.0_2.58.0.bb
new file mode 100644
index 00000000..f0075969
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib-2.0_2.58.0.bb
@@ -0,0 +1,25 @@
+require glib.inc
+
+PE = "1"
+
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
+ file://configure-libtool.patch \
+ file://run-ptest \
+ file://uclibc_musl_translation.patch \
+ file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \
+ file://Enable-more-tests-while-cross-compiling.patch \
+ file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \
+ file://0001-Do-not-ignore-return-value-of-write.patch \
+ file://0010-Do-not-hardcode-python-path-into-various-tools.patch \
+ file://date-lt.patch \
+ file://CVE-2019-12450.patch \
+ file://CVE-2019-9633_p1.patch \
+ file://CVE-2019-9633_p2.patch \
+ "
+
+SRC_URI_append_class-native = " file://relocate-modules.patch"
+
+SRC_URI[md5sum] = "9b5d21c802f55bf37171c4fbfe7d32d1"
+SRC_URI[sha256sum] = "c0f4ce0730b4f95c47b711613b5406a887c2ee13ea6d25930d72a4fa7fdb77f6"
diff --git a/external/poky/meta/recipes-core/glib-2.0/glib.inc b/external/poky/meta/recipes-core/glib-2.0/glib.inc
new file mode 100644
index 00000000..e8215da5
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-2.0/glib.inc
@@ -0,0 +1,170 @@
+SUMMARY = "A general-purpose utility library"
+DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on."
+HOMEPAGE = "https://developer.gnome.org/glib/"
+
+# pcre is under BSD;
+# docs/reference/COPYING is with a 'public domain'-like license!
+LICENSE = "LGPLv2.1+ & BSD & PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://glib/glib.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \
+ file://gmodule/COPYING;md5=4fbd65380cdd255951079008b364516c \
+ file://gmodule/gmodule.h;beginline=4;endline=17;md5=b88abb7f3ad09607e71cb9d530155906 \
+ file://glib/pcre/pcre.h;beginline=8;endline=36;md5=3e2977dae4ad05217f58c446237298fc \
+ file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc"
+BUGTRACKER = "http://bugzilla.gnome.org"
+SECTION = "libs"
+
+CVE_PRODUCT = "glib"
+
+BBCLASSEXTEND = "native nativesdk"
+
+DEPENDS = "glib-2.0-native \
+ virtual/libintl \
+ virtual/libiconv \
+ libffi \
+ zlib \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', 'dbus', '', d)}"
+
+PACKAGES += "${PN}-codegen ${PN}-utils"
+
+LEAD_SONAME = "libglib-2.0.*"
+
+inherit autotools gettext gtk-doc pkgconfig ptest-gnome upstream-version-is-even bash-completion gio-module-cache manpages
+
+S = "${WORKDIR}/glib-${PV}"
+
+PACKAGECONFIG ??= "system-pcre libmount"
+# To use the system pcre it must be configured with --enable-unicode-properties
+PACKAGECONFIG[system-pcre] = "--with-pcre=system,--with-pcre=internal,libpcre"
+PACKAGECONFIG[libmount] = "--enable-libmount,--disable-libmount,util-linux"
+PACKAGECONFIG[manpages] = "--enable-man --with-xml-catalog=${STAGING_ETCDIR_NATIVE}/xml/catalog.xml, --disable-man, libxslt-native xmlto-native"
+PACKAGECONFIG[libelf] = "--enable-libelf,--disable-libelf,elfutils"
+
+CORECONF = "--disable-dtrace --disable-fam --disable-systemtap"
+
+PRINTF = "--enable-included-printf=no"
+PRINTF_darwin = "--enable-included-printf=yes"
+PRINTF_mingw32 = "--enable-included-printf=yes"
+EXTRA_OECONF = "${PRINTF} ${CORECONF}"
+EXTRA_OECONF_class-native = "${CORECONF} --disable-selinux"
+
+# Tell configure that we'll have dbus-daemon on the target for the tests
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains('PTEST_ENABLED', '1', ' ac_cv_prog_DBUS_DAEMON=dbus-daemon', '', d)}"
+
+do_configure_prepend() {
+ sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
+}
+
+FILES_${PN} = "${libdir}/lib*${SOLIBS} \
+ ${libdir}/gio \
+ ${libexecdir}/*gio-querymodules \
+ ${datadir}/glib-2.0/schemas"
+FILES_${PN}-dev += "${libdir}/glib-2.0/include \
+ ${libdir}/gio/modules/lib*${SOLIBSDEV} \
+ ${libdir}/gio/modules/*.la \
+ ${bindir}/glib-genmarshal \
+ ${bindir}/glib-gettextize \
+ ${bindir}/glib-mkenums \
+ ${bindir}/glib-compile-resources \
+ ${datadir}/glib-2.0/gettext/po/Makefile.in.in \
+ ${datadir}/glib-2.0/schemas/gschema.dtd \
+ ${datadir}/glib-2.0/valgrind/glib.supp \
+ ${datadir}/gettext/its"
+FILES_${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb"
+FILES_${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py \
+ ${bindir}/gdbus-codegen"
+FILES_${PN}-utils = "${bindir}/*"
+
+RRECOMMENDS_${PN} += "shared-mime-info"
+# When cross compiling for Windows we don't want to include this
+RRECOMMENDS_${PN}_remove_mingw32 = "shared-mime-info"
+
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+# Valgrind runtime detection works using hand-written assembly, which
+# doesn't support mips16e
+CPPFLAGS_append_class-target_mips16e = " -DNVALGRIND=1"
+
+# GLib generally requires gettext to be present so for USE_NLS to yes. For
+# native builds as i18n is disabled globally we have to add a gettext-native dependency.
+USE_NLS_class-target = "yes"
+USE_NLS_class-nativesdk = "yes"
+DEPENDS_append_class-native = " gettext-native"
+
+EXEEXT = ""
+EXEEXT_mingw32 = ".exe"
+
+do_install_append () {
+ if [ -f ${D}${bindir}/gtester-report ]; then
+ sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python3|'
+ fi
+
+ # Remove some unpackaged files
+ rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__
+ rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc
+ rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo
+
+ if [ -e ${D}${libdir}/charset.alias ]; then
+ rm -f ${D}${libdir}/charset.alias
+ fi
+
+ # Make sure gio-querymodules is unique among multilibs
+ if test "x${MLPREFIX}" != "x"; then
+ mv ${D}${libexecdir}/gio-querymodules${EXEEXT} ${D}${libexecdir}/${MLPREFIX}gio-querymodules${EXEEXT}
+ fi
+}
+
+do_install_append_class-target () {
+ # Tests are only installed on targets, not native builds. Separating this out
+ # keeps glib-2.0-native from depending on DISTRO_FEATURES
+ if [ -f ${D}${datadir}/installed-tests/glib/gdbus-serialization.test ]; then
+ if ${@bb.utils.contains("DISTRO_FEATURES", "x11", "false", "true", d)}; then
+ rm ${D}${datadir}/installed-tests/glib/gdbus-serialization.test
+ fi
+ fi
+}
+
+CODEGEN_PYTHON_RDEPENDS = "python3 python3-distutils python3-xml"
+CODEGEN_PYTHON_RDEPENDS_mingw32 = ""
+
+RDEPENDS_${PN}-codegen += "${CODEGEN_PYTHON_RDEPENDS}"
+
+RDEPENDS_${PN}-ptest += "\
+ dbus \
+ gnome-desktop-testing \
+ tzdata \
+ tzdata-americas \
+ tzdata-asia \
+ tzdata-europe \
+ tzdata-posix \
+ shared-mime-info \
+ "
+
+# When https://gitlab.gnome.org/GNOME/glib/issues/1343 is
+# fixed add locale-base-pl-pl
+RDEPENDS_${PN}-ptest_append_libc-glibc = "\
+ glibc-gconv-utf-16 \
+ glibc-charmap-utf-8 \
+ glibc-gconv-cp1255 \
+ glibc-charmap-cp1255 \
+ glibc-gconv-utf-32 \
+ glibc-gconv-utf-7 \
+ glibc-gconv-euc-jp \
+ glibc-gconv-iso8859-1 \
+ glibc-gconv-iso8859-15 \
+ glibc-charmap-invariant \
+ glibc-localedata-translit-cjk-variants \
+ locale-base-tr-tr \
+ locale-base-lt-lt \
+ locale-base-ja-jp.euc-jp \
+ locale-base-fa-ir \
+ locale-base-ru-ru \
+ locale-base-de-de \
+ locale-base-hr-hr \
+ locale-base-el-gr \
+ locale-base-fr-fr \
+ locale-base-es-es \
+ locale-base-en-gb \
+ "
+
+INSANE_SKIP_${PN}-ptest += "libdir"
diff --git a/external/poky/meta/recipes-core/glib-networking/glib-networking_2.54.1.bb b/external/poky/meta/recipes-core/glib-networking/glib-networking_2.54.1.bb
new file mode 100644
index 00000000..5d17a824
--- /dev/null
+++ b/external/poky/meta/recipes-core/glib-networking/glib-networking_2.54.1.bb
@@ -0,0 +1,29 @@
+SUMMARY = "GLib networking extensions"
+DESCRIPTION = "glib-networking contains the implementations of certain GLib networking features that cannot be implemented directly in GLib itself because of their dependencies."
+HOMEPAGE = "https://gitlab.gnome.org/GNOME/glib-networking/"
+BUGTRACKER = "http://bugzilla.gnome.org"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+SECTION = "libs"
+DEPENDS = "glib-2.0"
+
+SRC_URI[archive.md5sum] = "99867463f182c2767bce0c74bc9cc981"
+SRC_URI[archive.sha256sum] = "eaa787b653015a0de31c928e9a17eb57b4ce23c8cf6f277afaec0d685335012f"
+
+PACKAGECONFIG ??= "ca-certificates gnutls"
+
+# No explicit dependency as it works without ca-certificates installed
+PACKAGECONFIG[ca-certificates] = "--with-ca-certificates=${sysconfdir}/ssl/certs/ca-certificates.crt,--without-ca-certificates"
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
+PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy"
+PACKAGECONFIG[pkcs11] = "--with-pkcs11,--without-pkcs11,p11-kit"
+
+EXTRA_OECONF = "--without-gnome-proxy"
+
+inherit gnomebase gettext upstream-version-is-even gio-module-cache
+
+FILES_${PN} += "${libdir}/gio/modules/libgio*.so ${datadir}/dbus-1/services/"
+FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la"
+FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a"
diff --git a/external/poky/meta/recipes-core/glibc/cross-localedef-native_2.28.bb b/external/poky/meta/recipes-core/glibc/cross-localedef-native_2.28.bb
new file mode 100644
index 00000000..a05b94e3
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/cross-localedef-native_2.28.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Cross locale generation tool for glibc"
+HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
+SECTION = "libs"
+LICENSE = "LGPL-2.1"
+
+LIC_FILES_CHKSUM = "file://LICENSES;md5=cfc0ed77a9f62fa62eded042ebe31d72 \
+ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+# Tell autotools that we're working in the localedef directory
+#
+AUTOTOOLS_SCRIPT_PATH = "${S}/localedef"
+
+inherit native
+inherit autotools
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:"
+
+SRCBRANCH ?= "release/${PV}/master"
+GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.(?!90)\d+)*)"
+
+SRCREV_glibc ?= "3c03baca37fdcb52c3881e653ca392bba7a99c2b"
+SRCREV_localedef ?= "c328777219ccc480be3112cf807217ca6b570b64"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
+ git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
+ file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
+ file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
+ file://0018-eglibc-Cross-building-and-testing-instructions.patch \
+ file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
+ file://0020-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+ file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+ file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \
+ file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \
+ file://0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
+"
+# Makes for a rather long rev (22 characters), but...
+#
+SRCREV_FORMAT = "glibc_localedef"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "--with-glibc=${S}"
+CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef
+}
diff --git a/external/poky/meta/recipes-core/glibc/glibc-collateral.inc b/external/poky/meta/recipes-core/glibc/glibc-collateral.inc
new file mode 100644
index 00000000..536edfb0
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-collateral.inc
@@ -0,0 +1,23 @@
+INHIBIT_DEFAULT_DEPS = "1"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM ?= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
+ file://${COMMON_LICENSE_DIR}/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
+HOMEPAGE = "http://www.gnu.org/software/libc/index.html"
+
+# This needs to match with glibc.inc, otherwise glibc-scripts and glibc-locale
+# will fail to find main glibc, for details see
+# http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100679.html
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+ARM_INSTRUCTION_SET_armv6 = "arm"
+
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install[depends] += "virtual/${MLPREFIX}libc:do_stash_locale"
+
+COMPATIBLE_HOST_libc-musl_class-target = "null"
+
diff --git a/external/poky/meta/recipes-core/glibc/glibc-common.inc b/external/poky/meta/recipes-core/glibc/glibc-common.inc
new file mode 100644
index 00000000..b05e162f
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-common.inc
@@ -0,0 +1,10 @@
+SUMMARY = "GLIBC (GNU C Library)"
+DESCRIPTION = "The GNU C Library is used as the system C library in most systems with the Linux kernel."
+HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
+SECTION = "libs"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
+ file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
+ file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+ file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
+CVE_PRODUCT = "glibc"
diff --git a/external/poky/meta/recipes-core/glibc/glibc-initial.inc b/external/poky/meta/recipes-core/glibc/glibc-initial.inc
new file mode 100644
index 00000000..acd0d6b1
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-initial.inc
@@ -0,0 +1,57 @@
+DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial libgcc-initial make-native bison-native"
+PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
+
+PACKAGES = ""
+PACKAGES_DYNAMIC = ""
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+
+do_configure () {
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+ find ${S} -name "configure" | xargs touch
+ cfgscript=`python3 -c "import os; print(os.path.relpath('${S}', '.'))"`/configure
+ $cfgscript --host=${TARGET_SYS} --build=${BUILD_SYS} \
+ --prefix=/usr \
+ --disable-sanity-checks \
+ --with-headers=${STAGING_DIR_TARGET}${includedir} \
+ --enable-hacker-mode
+}
+
+do_compile () {
+ :
+}
+
+do_install () {
+ oe_runmake cross-compiling=yes install_root=${D} \
+ includedir='${includedir}' prefix='${prefix}' \
+ install-bootstrap-headers=yes install-headers
+
+ oe_runmake csu/subdir_lib
+ mkdir -p ${D}${libdir}/
+ install -m 644 csu/crt[1in].o ${D}${libdir}
+
+ # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
+ # so do them by hand. We can tolerate an empty stubs.h for the moment.
+ # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
+ mkdir -p ${D}${includedir}/gnu/
+ touch ${D}${includedir}/gnu/stubs.h
+ cp ${S}/include/features.h ${D}${includedir}/features.h
+
+ if [ -e ${B}/bits/stdio_lim.h ]; then
+ cp ${B}/bits/stdio_lim.h ${D}${includedir}/bits/
+ fi
+}
+
+do_stash_locale() {
+ :
+}
+
+do_siteconfig () {
+ :
+}
+
+inherit nopackages
+
+# We really only want this built by things that need it, not any recrdeptask
+deltask do_build
diff --git a/external/poky/meta/recipes-core/glibc/glibc-initial_2.28.bb b/external/poky/meta/recipes-core/glibc/glibc-initial_2.28.bb
new file mode 100644
index 00000000..e86770e1
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-initial_2.28.bb
@@ -0,0 +1,9 @@
+require glibc_${PV}.bb
+require glibc-initial.inc
+
+# main glibc recipes muck with TARGET_CPPFLAGS to point into
+# final target sysroot but we
+# are not there when building glibc-initial
+# so reset it here
+
+TARGET_CPPFLAGS = ""
diff --git a/external/poky/meta/recipes-core/glibc/glibc-ld.inc b/external/poky/meta/recipes-core/glibc/glibc-ld.inc
new file mode 100644
index 00000000..bb167b32
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-ld.inc
@@ -0,0 +1,20 @@
+inherit linuxloader
+
+GLIBC_GETLOADER = "${@get_linuxloader(d)}"
+
+def glibc_dl_info(d):
+ infos = {'ldconfig':set(), 'lddrewrite':set()}
+
+ loaders = all_multilib_tune_values(d, "GLIBC_GETLOADER").split()
+ for loader in loaders:
+ infos['ldconfig'].add('{"' + loader + '",' + "FLAG_ELF_LIBC6" + ' }')
+ infos['lddrewrite'].add(loader)
+
+ infos['ldconfig'] = ','.join(infos['ldconfig'])
+ infos['lddrewrite'] = ' '.join(infos['lddrewrite'])
+ return infos
+
+EGLIBC_KNOWN_INTERPRETER_NAMES = "${@glibc_dl_info(d)['ldconfig']}"
+RTLDLIST = "${@glibc_dl_info(d)['lddrewrite']}"
+RTLDLIST_class-nativesdk = "${base_libdir}/${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', 'ld-linux.so.2', d)}"
+glibc_dl_info[vardepsexclude] = "OVERRIDES"
diff --git a/external/poky/meta/recipes-core/glibc/glibc-locale.inc b/external/poky/meta/recipes-core/glibc/glibc-locale.inc
new file mode 100644
index 00000000..1b676dc2
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-locale.inc
@@ -0,0 +1,97 @@
+require glibc-collateral.inc
+
+SUMMARY = "Locale data from glibc"
+
+BPN = "glibc"
+LOCALEBASEPN = "${MLPREFIX}glibc"
+
+# glibc-collateral.inc inhibits all default deps, but do_package needs objcopy
+# ERROR: objcopy failed with exit code 127 (cmd was 'i586-webos-linux-objcopy' --only-keep-debug 'glibc-locale/2.17-r0/package/usr/lib/gconv/IBM1166.so' 'glibc-locale/2.17-r0/package/usr/lib/gconv/.debug/IBM1166.so')
+# ERROR: Function failed: split_and_strip_files
+BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot"
+BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
+do_package[depends] += "${BINUTILSDEP}"
+
+# localedef links with libc.so and glibc-collateral.inc inhibits all default deps
+# cannot add virtual/libc to DEPENDS, because it would conflict with libc-initial in RSS
+RDEPENDS_localedef += "glibc"
+
+# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
+# is set. The idea is to avoid running localedef on the target (at first boot)
+# to decrease initial boot time and avoid localedef being killed by the OOM
+# killer which used to effectively break i18n on machines with < 128MB RAM.
+
+# default to disabled
+ENABLE_BINARY_LOCALE_GENERATION ?= "0"
+ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-glibc-locale = "1"
+
+#enable locale generation on these arches
+# BINARY_LOCALE_ARCHES is a space separated list of regular expressions
+BINARY_LOCALE_ARCHES ?= "arm.* aarch64 i[3-6]86 x86_64 powerpc mips mips64 riscv32 riscv64"
+
+# set "1" to use cross-localedef for locale generation
+# set "0" for qemu emulation of native localedef for locale generation
+LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1"
+
+PROVIDES = "virtual/libc-locale"
+
+PACKAGES = "localedef ${PN}-dbg"
+
+PACKAGES_DYNAMIC = "^locale-base-.* \
+ ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \
+ ^${MLPREFIX}glibc-gconv$"
+
+# Create a glibc-binaries package
+ALLOW_EMPTY_${BPN}-binaries = "1"
+PACKAGES += "${BPN}-binaries"
+RRECOMMENDS_${BPN}-binaries = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-binary") != -1])}"
+
+# Create a glibc-charmaps package
+ALLOW_EMPTY_${BPN}-charmaps = "1"
+PACKAGES += "${BPN}-charmaps"
+RRECOMMENDS_${BPN}-charmaps = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-charmap") != -1])}"
+
+# Create a glibc-gconvs package
+ALLOW_EMPTY_${BPN}-gconvs = "1"
+PACKAGES += "${BPN}-gconvs"
+RRECOMMENDS_${BPN}-gconvs = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-gconv") != -1])}"
+
+# Create a glibc-localedatas package
+ALLOW_EMPTY_${BPN}-localedatas = "1"
+PACKAGES += "${BPN}-localedatas"
+RRECOMMENDS_${BPN}-localedatas = "${@" ".join([p for p in d.getVar('PACKAGES').split() if p.find("glibc-localedata") != -1])}"
+
+DESCRIPTION_localedef = "glibc: compile locale definition files"
+
+# glibc-gconv is dynamically added into PACKAGES, thus
+# FILES_glibc-gconv will not be automatically extended in multilib.
+# Explicitly add ${MLPREFIX} for FILES_glibc-gconv.
+FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*"
+FILES_localedef = "${bindir}/localedef"
+
+LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
+
+do_install () {
+ mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir}
+ if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then
+ cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${bindir}/* ${D}${bindir}
+ fi
+ if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then
+ mkdir -p ${D}${localedir}
+ cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${localedir}/* ${D}${localedir}
+ fi
+ if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then
+ cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir}
+ fi
+ if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then
+ cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir}
+ fi
+ if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
+ cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
+ fi
+ cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/SUPPORTED ${WORKDIR}
+}
+
+inherit libc-package
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/external/poky/meta/recipes-core/glibc/glibc-locale_2.28.bb b/external/poky/meta/recipes-core/glibc/glibc-locale_2.28.bb
new file mode 100644
index 00000000..f7702e03
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-locale_2.28.bb
@@ -0,0 +1 @@
+require glibc-locale.inc
diff --git a/external/poky/meta/recipes-core/glibc/glibc-mtrace.inc b/external/poky/meta/recipes-core/glibc/glibc-mtrace.inc
new file mode 100644
index 00000000..d703c14b
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-mtrace.inc
@@ -0,0 +1,13 @@
+require glibc-collateral.inc
+
+SUMMARY = "mtrace utility provided by glibc"
+DESCRIPTION = "mtrace utility provided by glibc"
+RDEPENDS_${PN} = "perl"
+RPROVIDES_${PN} = "libc-mtrace"
+
+SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
+
+do_install() {
+ install -d -m 0755 ${D}${bindir}
+ install -m 0755 ${SRC}/mtrace ${D}${bindir}/
+}
diff --git a/external/poky/meta/recipes-core/glibc/glibc-mtrace_2.28.bb b/external/poky/meta/recipes-core/glibc/glibc-mtrace_2.28.bb
new file mode 100644
index 00000000..0b69bad4
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-mtrace_2.28.bb
@@ -0,0 +1 @@
+require glibc-mtrace.inc
diff --git a/external/poky/meta/recipes-core/glibc/glibc-package.inc b/external/poky/meta/recipes-core/glibc/glibc-package.inc
new file mode 100644
index 00000000..a98ae1a2
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-package.inc
@@ -0,0 +1,232 @@
+INHIBIT_SYSROOT_STRIP = "1"
+
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libnss-db libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+
+# The ld.so in this glibc supports the GNU_HASH
+RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)"
+RPROVIDES_${PN}-utils = "eglibc-utils"
+RPROVIDES_${PN}-mtrace = "eglibc-mtrace libc-mtrace"
+RPROVIDES_${PN}-pic = "eglibc-pic"
+RPROVIDES_${PN}-dev = "eglibc-dev libc6-dev virtual-libc-dev"
+RPROVIDES_${PN}-staticdev = "eglibc-staticdev"
+RPROVIDES_${PN}-doc = "eglibc-doc"
+RPROVIDES_glibc-extra-nss = "eglibc-extra-nss"
+RPROVIDES_glibc-thread-db = "eglibc-thread-db"
+RPROVIDES_${PN}-pcprofile = "eglibc-pcprofile"
+RPROVIDES_${PN}-dbg = "eglibc-dbg"
+libc_baselibs = "${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/libmvec-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so"
+libc_baselibs_append_aarch64 = " /lib/ld-linux-aarch64*.so.1"
+INSANE_SKIP_${PN}_append_aarch64 = " libdir"
+
+FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf"
+FILES_ldd = "${bindir}/ldd"
+FILES_libsegfault = "${base_libdir}/libSegFault*"
+FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*"
+FILES_libmemusage = "${base_libdir}/libmemusage.so"
+FILES_libnss-db = "${base_libdir}/libnss_db.so.* ${base_libdir}/libnss_db-*.so ${localstatedir}/db/Makefile ${localstatedir}/db/makedbs.sh"
+RDEPENDS_libnss-db = "${PN}-utils"
+FILES_glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*"
+FILES_sln = "${base_sbindir}/sln"
+FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o"
+FILES_libsotruss = "${libdir}/audit/sotruss-lib.so"
+FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-dev += "${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal"
+FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a"
+FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/init.d/nscd ${systemd_unitdir}/system/nscd* ${sysconfdir}/tmpfiles.d/nscd.conf \
+ ${sysconfdir}/nscd.conf ${sysconfdir}/default/volatiles/98_nscd ${localstatedir}/db/nscd"
+FILES_${PN}-mtrace = "${bindir}/mtrace"
+FILES_tzcode = "${bindir}/tzselect ${sbindir}/zic ${sbindir}/zdump"
+FILES_${PN}-utils = "${bindir}/* ${sbindir}/*"
+FILES_catchsegv = "${bindir}/catchsegv"
+RDEPENDS_catchsegv = "libsegfault"
+FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so"
+FILES_glibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so"
+RPROVIDES_${PN}-dev += "libc-dev"
+RPROVIDES_${PN}-staticdev += "libc-staticdev"
+
+SUMMARY_sln = "The static ln"
+DESCRIPTION_sln = "Similar to the 'ln' utility, but statically linked. sln is useful to make symbolic links to dynamic libraries if the dynamic linking system, for some reason, is not functional."
+SUMMARY_nscd = "Name service cache daemon"
+DESCRIPTION_nscd = "nscd, name service cache daemon, caches name service lookups for the passwd, group and hosts information. It can damatically improvide performance with remote, such as NIS or NIS+, name services."
+SUMMARY_glibc-extra-nss = "hesiod, NIS and NIS+ nss libraries"
+DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services."
+SUMMARY_ldd = "print shared library dependencies"
+DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line."
+SUMMARY_${PN}-utils = "Miscellaneous utilities provided by glibc"
+DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconv, locale, gencat, ..."
+DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs"
+DESCRIPTION_tzcode = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+
+inherit libc-common multilib_header
+
+do_install_append () {
+ rm -f ${D}${sysconfdir}/localtime
+
+ # remove empty glibc dir
+ if [ -d ${D}${libexecdir} ]; then
+ rmdir --ignore-fail-on-non-empty ${D}${libexecdir}
+ fi
+
+ oe_multilib_header bits/syscall.h bits/long-double.h bits/floatn.h
+
+ if [ -f ${D}${bindir}/mtrace ]; then
+ sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace
+ fi
+ # 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
+
+ if ! ${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', 'true', 'false', d)}; then
+ # The distro doesn't want these files so let's not install them
+ rm -f ${D}${sysconfdir}/ld.so.conf
+ rm -f ${D}${base_sbindir}/ldconfig
+ # This directory will be empty now so remove it too.
+ # But check whether it exists first, since it won't for glibc-initial.
+ if [ -d ${D}${sysconfdir} ]; then
+ rmdir ${D}${sysconfdir}
+ fi
+ fi
+
+ if echo ${PN}|grep -q "glibc-initial"; then
+ return
+ fi
+
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${localstatedir}/db/nscd
+ install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd
+ install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf
+ install -m 0755 ${WORKDIR}/makedbs.sh ${D}${localstatedir}/db
+ sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd
+ sed -i "s|\(enable-cache\t\+netgroup\t\+\)yes|\1no|" ${D}${sysconfdir}/nscd.conf
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_unitdir}/system/
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /run/nscd 755 root root -" \
+ > ${D}${sysconfdir}/tmpfiles.d/nscd.conf
+ else
+ install -d ${D}${sysconfdir}/default/volatiles
+ echo "d root root 0755 /var/run/nscd none" \
+ > ${D}${sysconfdir}/default/volatiles/98_nscd
+ fi
+}
+
+do_install_append_aarch64 () {
+ if [ "${base_libdir}" != "${nonarch_base_libdir}" ]; then
+ # The aarch64 ABI says the dynamic linker -must- be /lib/ld-linux-aarch64[_be].so.1
+ install -d ${D}${nonarch_base_libdir}
+ if [ -e ${D}${base_libdir}/ld-linux-aarch64.so.1 ]; then
+ ln -s ${@oe.path.relative('${nonarch_base_libdir}', '${base_libdir}')}/ld-linux-aarch64.so.1 \
+ ${D}${nonarch_base_libdir}/ld-linux-aarch64.so.1
+ elif [ -e ${D}${base_libdir}/ld-linux-aarch64_be.so.1 ]; then
+ ln -s ${@oe.path.relative('${nonarch_base_libdir}', '${base_libdir}')}/ld-linux-aarch64_be.so.1 \
+ ${D}${nonarch_base_libdir}/ld-linux-aarch64_be.so.1
+ fi
+ fi
+ do_install_armmultilib
+}
+
+do_install_append_arm () {
+ do_install_armmultilib
+}
+
+do_install_append_armeb () {
+ do_install_armmultilib
+}
+
+do_install_armmultilib () {
+ oe_multilib_header bits/endian.h bits/fcntl.h bits/fenv.h bits/fp-fast.h bits/hwcap.h bits/ipc.h bits/link.h bits/wordsize.h
+ oe_multilib_header bits/local_lim.h bits/mman.h bits/msq.h bits/pthreadtypes.h bits/pthreadtypes-arch.h bits/sem.h bits/semaphore.h bits/setjmp.h
+ oe_multilib_header bits/shm.h bits/sigstack.h bits/stat.h bits/statfs.h bits/typesizes.h
+
+ oe_multilib_header fpu_control.h gnu/lib-names.h gnu/stubs.h ieee754.h
+
+ oe_multilib_header sys/elf.h sys/procfs.h sys/ptrace.h sys/ucontext.h sys/user.h
+}
+
+
+LOCALESTASH = "${WORKDIR}/stashed-locale"
+bashscripts = "mtrace sotruss xtrace"
+
+do_stash_locale () {
+ dest=${LOCALESTASH}
+ install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir}
+ if [ "${base_libdir}" != "${libdir}" ]; then
+ cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir}
+ fi
+ if [ -e ${D}${bindir}/localedef ]; then
+ mv -f ${D}${bindir}/localedef ${dest}${bindir}
+ fi
+ if [ -e ${D}${libdir}/gconv ]; then
+ mv -f ${D}${libdir}/gconv ${dest}${libdir}
+ fi
+ if [ -e ${D}${exec_prefix}/lib ]; then
+ cp -fpPR ${D}${exec_prefix}/lib ${dest}${exec_prefix}
+ fi
+ if [ -e ${D}${datadir}/i18n ]; then
+ mv ${D}${datadir}/i18n ${dest}${datadir}
+ fi
+ cp -fpPR ${D}${datadir}/* ${dest}${datadir}
+ rm -rf ${D}${datadir}/locale/
+ cp -fpPR ${WORKDIR}/SUPPORTED ${dest}
+
+ target=${dest}/scripts
+ mkdir -p $target
+ for i in ${bashscripts}; do
+ if [ -f ${D}${bindir}/$i ]; then
+ cp ${D}${bindir}/$i $target/
+ fi
+ done
+}
+
+addtask do_stash_locale after do_install before do_populate_sysroot do_package
+do_stash_locale[dirs] = "${B}"
+do_stash_locale[cleandirs] = "${LOCALESTASH}"
+SSTATETASKS += "do_stash_locale"
+do_stash_locale[sstate-inputdirs] = "${LOCALESTASH}"
+do_stash_locale[sstate-outputdirs] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
+do_stash_locale[sstate-fixmedir] = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale"
+
+python do_stash_locale_setscene () {
+ sstate_setscene(d)
+}
+addtask do_stash_locale_setscene
+
+do_poststash_install_cleanup () {
+ # Remove all files which do_stash_locale would remove (mv)
+ # since that task could have come from sstate and not get run.
+ for i in ${bashscripts}; do
+ rm -f ${D}${bindir}/$i
+ done
+ rm -f ${D}${bindir}/localedef
+ rm -rf ${D}${datadir}/i18n
+ rm -rf ${D}${libdir}/gconv
+ rm -rf ${D}/${localedir}
+ rm -rf ${D}${datadir}/locale
+ if [ "${libdir}" != "${exec_prefix}/lib" ]; then
+ if [ -d ${D}${exec_prefix}/lib ]; then
+ # error out if directory isn't empty
+ # this dir should only contain locale dir
+ # which has been deleted in the previous step
+ rmdir ${D}${exec_prefix}/lib
+ fi
+ fi
+}
+addtask do_poststash_install_cleanup after do_stash_locale do_install before do_populate_sysroot do_package
+
+pkg_postinst_nscd () {
+ if [ -z "$D" ]; then
+ if command -v systemd-tmpfiles >/dev/null; then
+ systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nscd.conf
+ elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+ fi
+}
+CONFFILES_nscd="${sysconfdir}/nscd.conf"
+
+SYSTEMD_PACKAGES = "nscd"
+SYSTEMD_SERVICE_nscd = "nscd.service"
diff --git a/external/poky/meta/recipes-core/glibc/glibc-scripts.inc b/external/poky/meta/recipes-core/glibc/glibc-scripts.inc
new file mode 100644
index 00000000..2a2b4150
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-scripts.inc
@@ -0,0 +1,20 @@
+require glibc-collateral.inc
+
+SUMMARY = "utility scripts provided by glibc"
+DESCRIPTION = "utility scripts provided by glibc"
+RDEPENDS_${PN} = "bash glibc-mtrace"
+
+SRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale/scripts"
+
+bashscripts = "sotruss xtrace"
+
+do_install() {
+ install -d -m 0755 ${D}${bindir}
+ for i in ${bashscripts}; do
+ install -m 0755 ${SRC}/$i ${D}${bindir}/
+ done
+}
+
+# sotruss script requires sotruss-lib.so (given by libsotruss package),
+# to produce trace of the library calls.
+RDEPENDS_${PN} += "libsotruss"
diff --git a/external/poky/meta/recipes-core/glibc/glibc-scripts_2.28.bb b/external/poky/meta/recipes-core/glibc/glibc-scripts_2.28.bb
new file mode 100644
index 00000000..5a89bd80
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-scripts_2.28.bb
@@ -0,0 +1 @@
+require glibc-scripts.inc
diff --git a/external/poky/meta/recipes-core/glibc/glibc-testing.inc b/external/poky/meta/recipes-core/glibc/glibc-testing.inc
new file mode 100644
index 00000000..0a42ae7f
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc-testing.inc
@@ -0,0 +1,95 @@
+do_compile_append () {
+ # now generate script to drive testing
+ echo "#!/usr/bin/env sh" >${B}/${HOST_PREFIX}testglibc
+ set >> ${B}/${HOST_PREFIX}testglibc
+ # prune out the unneeded vars
+ sed -i -e "/^BASH/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^USER/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^OPT/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^DIRSTACK/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^EUID/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^FUNCNAME/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^GROUPS/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^HOST/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^HOME/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^IFS/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^LC_ALL/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^LOGNAME/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^MACHTYPE/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^OSTYPE/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PIPE/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^SHELL/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^'/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^UID/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^TERM/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PKG_/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^POSIXLY_/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PPID/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PS4/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^Q/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^SHLVL/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^STAGING/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${HOST_PREFIX}testglibc
+ sed -i -e "/^PSEUDO/d" ${B}/${HOST_PREFIX}testglibc
+
+ # point to real sysroot not the toolchain bootstrap sysroot
+ sed -i -e "s/\-tcbootstrap//g" ${B}/${HOST_PREFIX}testglibc
+
+ # use the final cross-gcc to test since some tests need libstdc++
+ sed -i -e "s/^PATH=.*\.gcc-cross-initial\:/PATH=/g" ${B}/${HOST_PREFIX}testglibc
+
+ # append execution part script
+cat >> ${B}/${HOST_PREFIX}testglibc << STOP
+target="\$1"
+if [ "x\$target" = "x" ]
+then
+ echo "Please specify the target machine and remote user in form of user@target"
+ exit 1;
+fi
+ssh \$target ls \$PWD\ 2>&1 > /dev/null
+if [ "x\$?" != "x0" ]
+then
+ echo "Failed connecting to \$target it could be because of:"
+ echo "1. You dont have passwordless ssh setup to access \$target"
+ echo "2. NFS share on \$target is not mounted or if mounted then not matching the build tree layout."
+ echo " The tree should be accessible at same location on build host and target"
+ echo " You can add nfs-client to IMAGE_FEATURES to get the nfs client on target"
+ echo "3. nfs server on build host is not running."
+ echo " Please make sure that you have 'no_root_squash' added in /etc/exports if you want"
+ echo " to test as root user on target (usually its recommended to create a non"
+ echo " root user."
+ echo " As a sanity check make sure that target can read/write to the glibc build tree"
+ echo " Please refer to ${S}/EGLIBC.cross-testing for further instructions on setup"
+ exit 1
+fi
+ echo "# we test using cross compiler from real sysroot therefore override the" > ${B}/configparms
+ echo "# definitions that come from ${B}/config.make" >> ${B}/configparms
+ fgrep tcbootstrap ${B}/config.make > ${B}/configparms
+ sed -i -e "s/\-tcbootstrap//g" ${B}/configparms
+
+# g++ uses flag -nostdinc, so the locations of system include headers must be explicitly specified
+# If the locations are not already specified in config.make, then we provide the following locations:
+# <sysroot>/usr/include/c++/<g++ version>
+# <sysroot>/usr/include/c++/<g++ version>/<machine>
+
+cxxincludes=\`cat ${B}/config.make | gawk '\$1 == "c++-sysincludes"' | gawk -F"=" '{print \$2}' | sed "s/[ \t]\?//g"\`
+
+if [ -z "\$cxxincludes" ]; then
+ sysroot=\`cat ${B}/configparms | sed -n "/CXX/p" | sed -e "s/^.*--sysroot=//"\`
+ cxx=\`cat ${B}/configparms | gawk '\$1 ~ /^CXX/' | gawk -F"=" '{print \$2}' | gawk '{print \$1}'\`
+ cxxmachine=\`\$cxx -dumpmachine\`
+ cxxversion=\`\$cxx -dumpversion\`
+ # pass the new value of c++-sysincludes via configparms
+ echo "# c++-sysincludes added:" >> ${B}/configparms
+ echo "c++-sysincludes = -isystem \$sysroot/usr/include/c++/\$cxxversion -isystem \$sysroot/usr/include/c++/\$cxxversion/\$cxxmachine" >> ${B}/configparms
+fi
+
+wrapper="${S}/scripts/cross-test-ssh.sh \$target"
+localedef="${STAGING_BINDIR_NATIVE}/cross-localedef --little-endian --uint32-align=4"
+make tests-clean
+make cross-localedef="\$localedef" cross-test-wrapper="\$wrapper" -k check
+rm -rf ${B}/configparms
+STOP
+
+ chmod +x ${B}/${HOST_PREFIX}testglibc
+}
diff --git a/external/poky/meta/recipes-core/glibc/glibc.inc b/external/poky/meta/recipes-core/glibc/glibc.inc
new file mode 100644
index 00000000..99c92ce4
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc.inc
@@ -0,0 +1,81 @@
+require glibc-common.inc
+require glibc-ld.inc
+require glibc-testing.inc
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+python () {
+ opt_effective = "-O"
+ for opt in d.getVar('SELECTED_OPTIMIZATION').split():
+ if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
+ opt_effective = opt
+ if opt_effective == "-O0":
+ bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
+}
+
+# siteconfig.bbclass runs configure which needs a working compiler
+# For the compiler to work we need a working libc yet libc isn't
+# in the sysroots directory at this point. This means the libc.so
+# linker script won't work as the --sysroot setting isn't correct.
+# Here we create a hacked up libc linker script and pass in the right
+# flags to let configure work. Ugly.
+EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
+siteconfig_do_siteconfig_gencache_prepend = " \
+ mkdir -p ${WORKDIR}/site_config_libc; \
+ cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
+ sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
+"
+
+# nptl needs unwind support in gcc, which can't be built without glibc.
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
+
+PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
+PROVIDES += "virtual/libintl virtual/libiconv"
+inherit autotools texinfo distro_features_check systemd
+
+LEAD_SONAME = "libc.so"
+
+CACHED_CONFIGUREVARS += " \
+ ac_cv_path_BASH_SHELL=${base_bindir}/bash \
+ libc_cv_slibdir=${base_libdir} \
+ libc_cv_rootsbindir=${base_sbindir} \
+ libc_cv_localedir=${localedir} \
+ libc_cv_ssp_strong=no \
+ libc_cv_ssp_all=no \
+ libc_cv_ssp=no \
+"
+
+GLIBC_EXTRA_OECONF ?= ""
+GLIBC_EXTRA_OECONF_class-nativesdk = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+# This needs to match with glibc-collateral.inc, otherwise glibc-scripts and glibc-locale
+# will fail to find main glibc, for details see
+# http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100679.html
+ARM_INSTRUCTION_SET_armv4 = "arm"
+ARM_INSTRUCTION_SET_armv5 = "arm"
+ARM_INSTRUCTION_SET_armv6 = "arm"
+
+# glibc uses PARALLELMFLAGS variable to pass parallel build info so transfer
+# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE
+EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}""
+EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM"
+EXTRA_OEMAKE += "${EGLIBCPARALLELISM}"
+PARALLEL_MAKE = ""
+
+# glibc make-syscalls.sh has a number of issues with /bin/dash and
+# it's output which make calls via the SHELL also has issues, so
+# ensure make uses /bin/bash
+EXTRA_OEMAKE += "SHELL=/bin/bash"
+
+do_configure_prepend() {
+ sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
+}
+
+# Enable backtrace from abort()
+do_configure_append_arm () {
+ echo "CFLAGS-abort.c = -fasynchronous-unwind-tables" >> ${B}/configparms
+ echo "CFLAGS-raise.c = -fasynchronous-unwind-tables" >> ${B}/configparms
+}
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch b/external/poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
new file mode 100644
index 00000000..5df26a85
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
@@ -0,0 +1,65 @@
+From bd51b3add89a5cb2d8f44029a1027c780b2afff5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:48:24 +0000
+Subject: [PATCH] nativesdk-glibc: Look for host system ld.so.cache as well
+
+Upstream-Status: Inappropriate [embedded specific]
+
+The default lib search path order is:
+
+ 1) LD_LIBRARY_PATH
+ 2) RPATH from the binary
+ 3) ld.so.cache
+ 4) default search paths embedded in the linker
+
+For nativesdk binaries which are being used alongside binaries on a host system, we
+need the search paths to firstly search the shipped nativesdk libs but then also
+cover the host system. For example we want the host system's libGL and this may be
+in a non-standard location like /usr/lib/mesa. The only place the location is know
+about is in the ld.so.cache of the host system.
+
+Since nativesdk has a simple structure and doesn't need to use a cache itself, we
+repurpose the cache for use as a last resort in finding host system binaries. This
+means we need to switch the order of 3 and 4 above to make this work effectively.
+
+RP 14/10/2010
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/dl-load.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index c51e4b3718..44bbb69dc4 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -2085,6 +2085,14 @@ _dl_map_object (struct link_map *loader, const char *name,
+ }
+ }
+
++ /* try the default path. */
++ if (fd == -1
++ && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
++ || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
++ && rtld_search_dirs.dirs != (void *) -1)
++ fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
++ &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
++ /* Finally try ld.so.cache */
+ #ifdef USE_LDCONFIG
+ if (fd == -1
+ && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
+@@ -2143,14 +2151,6 @@ _dl_map_object (struct link_map *loader, const char *name,
+ }
+ #endif
+
+- /* Finally, try the default path. */
+- if (fd == -1
+- && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
+- || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB)))
+- && rtld_search_dirs.dirs != (void *) -1)
+- fd = open_path (name, namelen, mode, &rtld_search_dirs,
+- &realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
+-
+ /* Add another newline when we are tracing the library loading. */
+ if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
+ _dl_debug_printf ("\n");
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch b/external/poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
new file mode 100644
index 00000000..daadec76
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
@@ -0,0 +1,46 @@
+From fdc8a33ac2c81a0237b8a6d8b1aac7f1cdbb46af Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:50:00 +0000
+Subject: [PATCH] nativesdk-glibc: Fix buffer overrun with a relocated SDK
+
+When ld-linux-*.so.2 is relocated to a path that is longer than the
+original fixed location, the dynamic loader will crash in open_path
+because it implicitly assumes that max_dirnamelen is a fixed size that
+never changes.
+
+The allocated buffer will not be large enough to contain the directory
+path string which is larger than the fixed location provided at build
+time.
+
+Upstream-Status: Inappropriate [OE SDK specific]
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/dl-load.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index 44bbb69dc4..74e2e5e962 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -1785,7 +1785,19 @@ open_path (const char *name, size_t namelen, int mode,
+ given on the command line when rtld is run directly. */
+ return -1;
+
++ do
++ {
++ struct r_search_path_elem *this_dir = *dirs;
++ if (this_dir->dirnamelen > max_dirnamelen)
++ {
++ max_dirnamelen = this_dir->dirnamelen;
++ }
++ }
++ while (*++dirs != NULL);
++
+ buf = alloca (max_dirnamelen + max_capstrlen + namelen);
++
++ dirs = sps->dirs;
+ do
+ {
+ struct r_search_path_elem *this_dir = *dirs;
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch b/external/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
new file mode 100644
index 00000000..e0825403
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
@@ -0,0 +1,136 @@
+From 055dd46b793168fb08e44913153010b088011ba2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:51:38 +0000
+Subject: [PATCH] nativesdk-glibc: Raise the size of arrays containing dl paths
+
+This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings
+and lengths as well as ld.so.cache path in the dynamic loader to specific
+sections in memory. The sections that contain paths have been allocated a 4096
+byte section, which is the maximum path length in linux. This will allow the
+relocating script to parse the ELF binary, detect the section and easily replace
+the strings in a certain path.
+
+Upstream-Status: Inappropriate [SDK specific]
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/dl-cache.c | 4 ++++
+ elf/dl-load.c | 4 ++--
+ elf/interp.c | 2 +-
+ elf/ldconfig.c | 3 +++
+ elf/rtld.c | 5 +++--
+ iconv/gconv_conf.c | 2 +-
+ sysdeps/generic/dl-cache.h | 4 ----
+ 7 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 6ee5153ff9..37a5f701fa 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -133,6 +133,10 @@ do \
+ while (0)
+
+
++const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))) =
++ SYSCONFDIR "/ld.so.cache";
++
++
+ int
+ _dl_cache_libcmp (const char *p1, const char *p2)
+ {
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index 74e2e5e962..8f19186e1c 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -110,8 +110,8 @@ static size_t max_capstrlen attribute_relro;
+ gen-trusted-dirs.awk. */
+ #include "trusted-dirs.h"
+
+-static const char system_dirs[] = SYSTEM_DIRS;
+-static const size_t system_dirs_len[] =
++static const char system_dirs[4096] __attribute__ ((section (".sysdirs"))) = SYSTEM_DIRS;
++volatile static const size_t system_dirs_len[] __attribute__ ((section (".sysdirslen"))) =
+ {
+ SYSTEM_DIRS_LEN
+ };
+diff --git a/elf/interp.c b/elf/interp.c
+index 9cd50c7291..fc2f39d73c 100644
+--- a/elf/interp.c
++++ b/elf/interp.c
+@@ -18,5 +18,5 @@
+
+ #include <runtime-linker.h>
+
+-const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
++const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp")))
+ = RUNTIME_LINKER;
+diff --git a/elf/ldconfig.c b/elf/ldconfig.c
+index fbdd814edf..9f4d8d69b1 100644
+--- a/elf/ldconfig.c
++++ b/elf/ldconfig.c
+@@ -168,6 +168,9 @@ static struct argp argp =
+ options, parse_opt, NULL, doc, NULL, more_help, NULL
+ };
+
++
++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
++
+ /* Check if string corresponds to an important hardware capability or
+ a platform. */
+ static int
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 1b0c74739f..a70a62d31e 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -130,6 +130,7 @@ dso_name_valid_for_suid (const char *p)
+ }
+ return *p != '\0';
+ }
++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
+
+ /* LD_AUDIT variable contents. Must be processed before the
+ audit_list below. */
+@@ -1001,12 +1002,12 @@ of this helper program; chances are you did not intend to run this program.\n\
+ --list list all dependencies and how they are resolved\n\
+ --verify verify that given object really is a dynamically linked\n\
+ object we can handle\n\
+- --inhibit-cache Do not use " LD_SO_CACHE "\n\
++ --inhibit-cache Do not use %s\n\
+ --library-path PATH use given PATH instead of content of the environment\n\
+ variable LD_LIBRARY_PATH\n\
+ --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\
+ in LIST\n\
+- --audit LIST use objects named in LIST as auditors\n");
++ --audit LIST use objects named in LIST as auditors\n", LD_SO_CACHE);
+
+ ++_dl_skip_args;
+ --_dl_argc;
+diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c
+index f173cde71b..5c3205026f 100644
+--- a/iconv/gconv_conf.c
++++ b/iconv/gconv_conf.c
+@@ -36,7 +36,7 @@
+
+
+ /* This is the default path where we look for module lists. */
+-static const char default_gconv_path[] = GCONV_PATH;
++static char default_gconv_path[4096] __attribute__ ((section (".gccrelocprefix"))) = GCONV_PATH;
+
+ /* The path elements, as determined by the __gconv_get_path function.
+ All path elements end in a slash. */
+diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
+index cf43f1cf3b..7f07adde53 100644
+--- a/sysdeps/generic/dl-cache.h
++++ b/sysdeps/generic/dl-cache.h
+@@ -27,10 +27,6 @@
+ ((flags) == 1 || (flags) == _DL_CACHE_DEFAULT_ID)
+ #endif
+
+-#ifndef LD_SO_CACHE
+-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
+-#endif
+-
+ #ifndef add_system_dir
+ # define add_system_dir(dir) add_dir (dir)
+ #endif
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch b/external/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
new file mode 100644
index 00000000..1ae2e33b
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch
@@ -0,0 +1,31 @@
+From a237553ccd15276462be2023057a017fa8ee5d7c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 14:35:35 -0800
+Subject: [PATCH] nativesdk-glibc: Allow 64 bit atomics for x86
+
+The fix consist of allowing 64bit atomic ops for x86.
+This should be safe for i586 and newer CPUs.
+It also makes the synchronization more efficient.
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/i386/atomic-machine.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/i386/atomic-machine.h b/sysdeps/i386/atomic-machine.h
+index 272da5dd8f..409c759f14 100644
+--- a/sysdeps/i386/atomic-machine.h
++++ b/sysdeps/i386/atomic-machine.h
+@@ -54,7 +54,7 @@ typedef uintmax_t uatomic_max_t;
+ # endif
+ #endif
+
+-#define __HAVE_64B_ATOMICS 0
++#define __HAVE_64B_ATOMICS 1
+ #define USE_ATOMIC_COMPILER_BUILTINS 0
+ #define ATOMIC_EXCHANGE_USES_CAS 0
+
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch b/external/poky/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch
new file mode 100644
index 00000000..b53f2ef2
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch
@@ -0,0 +1,67 @@
+From e1dc85af1800afa4fbf4eb5a59cc41025495af57 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 3 Aug 2018 09:55:12 -0700
+Subject: [PATCH] nativesdk-glibc: Make relocatable install for locales
+
+The glibc locale path is hard-coded to the install prefix, but in SDKs we need
+to be able to relocate the binaries. Expand the strings to 4K and put them in a
+magic segment that we can relocate at install time.
+
+Upstream-Status: Inappropriate (OE-specific)
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ locale/findlocale.c | 4 ++--
+ locale/loadarchive.c | 2 +-
+ locale/localeinfo.h | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/locale/findlocale.c b/locale/findlocale.c
+index 872cadb5b9..dd651e07f5 100644
+--- a/locale/findlocale.c
++++ b/locale/findlocale.c
+@@ -56,7 +56,7 @@ struct __locale_data *const _nl_C[] attribute_hidden =
+ which are somehow addressed. */
+ struct loaded_l10nfile *_nl_locale_file_list[__LC_LAST];
+
+-const char _nl_default_locale_path[] attribute_hidden = COMPLOCALEDIR;
++char _nl_default_locale_path[4096] attribute_hidden __attribute__ ((section (".gccrelocprefix"))) = COMPLOCALEDIR;
+
+ /* Checks if the name is actually present, that is, not NULL and not
+ empty. */
+@@ -167,7 +167,7 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
+
+ /* Nothing in the archive. Set the default path to search below. */
+ locale_path = _nl_default_locale_path;
+- locale_path_len = sizeof _nl_default_locale_path;
++ locale_path_len = strlen(locale_path) + 1;
+ }
+ else
+ /* We really have to load some data. First see whether the name is
+diff --git a/locale/loadarchive.c b/locale/loadarchive.c
+index 516d30d8d1..9bfbe1a5dd 100644
+--- a/locale/loadarchive.c
++++ b/locale/loadarchive.c
+@@ -42,7 +42,7 @@
+
+
+ /* Name of the locale archive file. */
+-static const char archfname[] = COMPLOCALEDIR "/locale-archive";
++static const char archfname[4096] __attribute__ ((section (".gccrelocprefix"))) = COMPLOCALEDIR "/locale-archive";
+
+ /* Size of initial mapping window, optimal if large enough to
+ cover the header plus the initial locale. */
+diff --git a/locale/localeinfo.h b/locale/localeinfo.h
+index 68822a6319..537bc35149 100644
+--- a/locale/localeinfo.h
++++ b/locale/localeinfo.h
+@@ -325,7 +325,7 @@ _nl_lookup_word (locale_t l, int category, int item)
+ }
+
+ /* Default search path if no LOCPATH environment variable. */
+-extern const char _nl_default_locale_path[] attribute_hidden;
++extern char _nl_default_locale_path[4096] attribute_hidden;
+
+ /* Load the locale data for CATEGORY from the file specified by *NAME.
+ If *NAME is "", use environment variables as specified by POSIX, and
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0006-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch b/external/poky/meta/recipes-core/glibc/glibc/0006-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
new file mode 100644
index 00000000..971700a6
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0006-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
@@ -0,0 +1,1581 @@
+From d23c577b0b70b34335971abaf3f50e617dda615e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:01:50 +0000
+Subject: [PATCH] fsl e500/e5500/e6500/603e fsqrt implementation
+
+Upstream-Status: Pending
+Signed-off-by: Edmar Wienskoski <edmar@freescale.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 134 ++++++++++++++++++
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 101 +++++++++++++
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 134 ++++++++++++++++++
+ .../powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 101 +++++++++++++
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 134 ++++++++++++++++++
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 101 +++++++++++++
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 134 ++++++++++++++++++
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 101 +++++++++++++
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 134 ++++++++++++++++++
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 101 +++++++++++++
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 134 ++++++++++++++++++
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 101 +++++++++++++
+ .../linux/powerpc/powerpc32/603e/fpu/Implies | 1 +
+ .../powerpc/powerpc32/e300c3/fpu/Implies | 2 +
+ .../powerpc/powerpc32/e500mc/fpu/Implies | 1 +
+ .../linux/powerpc/powerpc32/e5500/fpu/Implies | 1 +
+ .../linux/powerpc/powerpc32/e6500/fpu/Implies | 1 +
+ .../linux/powerpc/powerpc64/e5500/fpu/Implies | 1 +
+ .../linux/powerpc/powerpc64/e6500/fpu/Implies | 1 +
+ 19 files changed, 1418 insertions(+)
+ create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000000..71e516d1c8
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the actual square root and half of its reciprocal
++ simultaneously. */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++ double b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++ double y, g, h, d, r;
++ ieee_double_shape_type u;
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ u.value = b;
++
++ relax_fenv_state ();
++
++ __asm__ ("frsqrte %[estimate], %[x]\n"
++ : [estimate] "=f" (y) : [x] "f" (b));
++
++ /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp. */
++
++ /* Indicate that these can be performed prior to the branch. GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before the branch so that we can cover any latency
++ from storing the argument and loading its high word. Oh well. */
++
++ g = b * y;
++ h = 0.5 * y;
++
++ /* Handle small numbers by scaling. */
++ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++ return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmadd %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ r = FNMSUB (g, h, half);
++ g = FMADD (g, r, g);
++ h = FMADD (h, r, h);
++
++ /* g is now +/- 1ulp, or exactly equal to, the square root of b. */
++
++ /* Final refinement. */
++ d = FNMSUB (g, g, b);
++
++ fesetenv_register (fe);
++ return FMADD (d, h, g);
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000000..26fa067abf
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++ Copyright (C) 2010 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++ _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++ _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++ We find the reciprocal square root and use that to compute the actual
++ square root. */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++ float b;
++#endif
++{
++ if (__builtin_expect (b > 0, 1))
++ {
++#define FMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++#define FNMSUB(a_, c_, b_) \
++ ({ double __r; \
++ __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n" \
++ : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++ __r;})
++
++ if (__builtin_expect (b != a_inf.value, 1))
++ {
++ double y, x;
++ fenv_t fe;
++
++ fe = fegetenv_register ();
++
++ relax_fenv_state ();
++
++ /* Compute y = 1.5 * b - b. Uses fewer constants than y = 0.5 * b. */
++ y = FMSUB (threehalf, b, b);
++
++ /* Initial estimate. */
++ __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++ /* Iterate. x_{n+1} = x_n * (1.5 - y * (x_n * x_n)). */
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++ x = x * FNMSUB (y, x * x, threehalf);
++
++ /* All done. */
++ fesetenv_register (fe);
++ return x * b;
++ }
++ }
++ else if (b < 0)
++ {
++ /* For some reason, some PowerPC32 processors don't implement
++ FE_INVALID_SQRT. */
++#ifdef FE_INVALID_SQRT
++ feraiseexcept (FE_INVALID_SQRT);
++
++ fenv_union_t u = { .fenv = fegetenv_register () };
++ if ((u.l & FE_INVALID) == 0)
++#endif
++ feraiseexcept (FE_INVALID);
++ b = a_nan.value;
++ }
++ return f_washf (b);
++}
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
+new file mode 100644
+index 0000000000..b103b4dea5
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/603e/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
+new file mode 100644
+index 0000000000..64db17fada
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
+@@ -0,0 +1,2 @@
++# e300c3 is a variant of 603e so use the same optimizations for sqrt
++powerpc/powerpc32/603e/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
+new file mode 100644
+index 0000000000..7eac5fcf02
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/e500mc/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
+new file mode 100644
+index 0000000000..264b2a7700
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/e5500/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
+new file mode 100644
+index 0000000000..a25934467b
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/e6500/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
+new file mode 100644
+index 0000000000..a7bc854be8
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc64/e5500/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+new file mode 100644
+index 0000000000..04ff8cc181
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc64/e6500/fpu
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0007-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch b/external/poky/meta/recipes-core/glibc/glibc/0007-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
new file mode 100644
index 00000000..48713468
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0007-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
@@ -0,0 +1,29 @@
+From d65f6ee214d7d91445fceabc6a5d6bf55b0e8d4b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:11:22 +0000
+Subject: [PATCH] readlib: Add OECORE_KNOWN_INTERPRETER_NAMES to known names
+
+This bolts in a hook for OE to pass its own version of interpreter
+names into glibc especially for multilib case, where it differs from any
+other distros
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/readlib.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/elf/readlib.c b/elf/readlib.c
+index 573c01476c..d8c7412287 100644
+--- a/elf/readlib.c
++++ b/elf/readlib.c
+@@ -51,6 +51,7 @@ static struct known_names interpreters[] =
+ #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
+ SYSDEP_KNOWN_INTERPRETER_NAMES
+ #endif
++ OECORE_KNOWN_INTERPRETER_NAMES
+ };
+
+ static struct known_names known_libs[] =
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0008-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch b/external/poky/meta/recipes-core/glibc/glibc/0008-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
new file mode 100644
index 00000000..c0d96eb1
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0008-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
@@ -0,0 +1,205 @@
+From ee3aa1464f40c916c62cf326bf4c18f8b71a229b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:15:07 +0000
+Subject: [PATCH] ppc/sqrt: Fix undefined reference to `__sqrt_finite'
+
+on ppc fixes the errors like below
+| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite'
+| collect2: ld returned 1 exit status
+
+Upstream-Status: Pending
+
+ChangeLog
+
+2012-01-06 Khem Raj <raj.khem@gmail.com>
+
+ * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias.
+ Remove cruft.
+ * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto.
+ * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto.
+ * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 7 +------
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 7 +------
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 1 +
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 1 +
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 1 +
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 1 +
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 1 +
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 1 +
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 7 +------
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 7 +------
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 1 +
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 1 +
+ 12 files changed, 12 insertions(+), 24 deletions(-)
+
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+index 71e516d1c8..1795fd6c3e 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+@@ -39,14 +39,8 @@ static const float half = 0.5;
+ We find the actual square root and half of its reciprocal
+ simultaneously. */
+
+-#ifdef __STDC__
+ double
+ __ieee754_sqrt (double b)
+-#else
+-double
+-__ieee754_sqrt (b)
+- double b;
+-#endif
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+index 26fa067abf..a917f313ab 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
+ We find the reciprocal square root and use that to compute the actual
+ square root. */
+
+-#ifdef __STDC__
+ float
+ __ieee754_sqrtf (float b)
+-#else
+-float
+-__ieee754_sqrtf (b)
+- float b;
+-#endif
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+index 71e516d1c8..fc4a74990e 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+index 26fa067abf..9d175122a8 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+index 71e516d1c8..fc4a74990e 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+index 26fa067abf..9d175122a8 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+index 71e516d1c8..fc4a74990e 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+index 26fa067abf..9d175122a8 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+index 71e516d1c8..1795fd6c3e 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+@@ -39,14 +39,8 @@ static const float half = 0.5;
+ We find the actual square root and half of its reciprocal
+ simultaneously. */
+
+-#ifdef __STDC__
+ double
+ __ieee754_sqrt (double b)
+-#else
+-double
+-__ieee754_sqrt (b)
+- double b;
+-#endif
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+index 26fa067abf..a917f313ab 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
+ We find the reciprocal square root and use that to compute the actual
+ square root. */
+
+-#ifdef __STDC__
+ float
+ __ieee754_sqrtf (float b)
+-#else
+-float
+-__ieee754_sqrtf (b)
+- float b;
+-#endif
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+index 71e516d1c8..fc4a74990e 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+index 26fa067abf..9d175122a8 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0009-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/external/poky/meta/recipes-core/glibc/glibc/0009-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
new file mode 100644
index 00000000..d0b47cd6
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0009-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -0,0 +1,384 @@
+From 17e82d594b2d8d3a6998face953382f9d14fb046 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:16:38 +0000
+Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out
+ __slow versions
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c | 12 ++++++++++--
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c | 8 +++++++-
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c | 14 +++++++++++---
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 12 ++++++++++--
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c | 14 +++++++++++---
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c | 12 ++++++++++--
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 8 ++++++++
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 8 ++++++++
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c | 12 ++++++++++--
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c | 9 ++++++++-
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c | 14 +++++++++++---
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c | 12 ++++++++++--
+ 12 files changed, 114 insertions(+), 21 deletions(-)
+
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+index 1795fd6c3e..daa83f3fe8 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+@@ -40,7 +40,7 @@ static const float half = 0.5;
+ simultaneously. */
+
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+index a917f313ab..b812cf1705 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
+ square root. */
+
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -93,4 +93,10 @@ __ieee754_sqrtf (float b)
+ }
+ return f_washf (b);
+ }
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+index fc4a74990e..7038a70b47 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+ double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+index 9d175122a8..10de1f0cc3 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+ float b;
+ #endif
+ {
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+index fc4a74990e..7038a70b47 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+ double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+index 9d175122a8..10de1f0cc3 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+ float b;
+ #endif
+ {
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+index fc4a74990e..1c34244bd8 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+index 9d175122a8..812653558f 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+index 1795fd6c3e..13a81973e3 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+@@ -40,7 +40,7 @@ static const float half = 0.5;
+ simultaneously. */
+
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+index a917f313ab..fae2d81210 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
+ square root. */
+
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ {
+ if (__builtin_expect (b > 0, 1))
+ {
+@@ -93,4 +93,11 @@ __ieee754_sqrtf (float b)
+ }
+ return f_washf (b);
+ }
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+index fc4a74990e..7038a70b47 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+ double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+ }
+ return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++ return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+index 9d175122a8..10de1f0cc3 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+ float b;
+ #endif
+ {
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+ }
+ return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++ return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0010-Quote-from-bug-1443-which-explains-what-the-patch-do.patch b/external/poky/meta/recipes-core/glibc/glibc/0010-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
new file mode 100644
index 00000000..86ef3a10
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0010-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
@@ -0,0 +1,58 @@
+From fe8d9b76e7c881cc0a0b728ea2bd637fafca0978 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:20:09 +0000
+Subject: [PATCH] Quote from bug 1443 which explains what the patch does :
+
+ We build some random program and link it with -lust. When we run it,
+ it dies with a SIGSEGV before reaching main().
+
+ Libust.so depends on liburcu-bp.so from the usermode-rcu package.
+ Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this
+ is critical.
+
+ Libust.so uses a TLS / __thread variable that is defined in liburcu-
+ bp.so. There are special ARM-specific relocation types that allow two
+ shared libraries to share thread-specific data. This is critical too.
+
+ One more critical issue: although liburcu-bp.so is prelinked, we can't
+ load it at its prelinked address, because we also link against
+ librt.so, and librt.so uses that address.
+
+ The dynamic linker is forced to relink liburcu-bp.so at a different
+ address. In the course of relinking, it processes the special ARM
+ relocation record mentioned above. The prelinker has already filled
+ in the information, which is a short offset into a table of thread-
+ specific data that is allocated per-thread for each library that uses
+ TLS. Because the normal behavior of a relocation is to add the symbol
+ value to an addend stored at the address being relocated, we end up
+ adding the short offset to itself, doubling it.
+
+ Now we have an awkward situation. The libust.so library doesn't know
+ about the addend, so its TLS data for this element is correct. The
+ liburcu-bp.so library has a different offset for the element. When we
+ go to initialize the element for the first time in liburcu-bp.so, we
+ write the address of the result at the doubled (broken) offset.
+ Later, when we refer to the address from libust.so, we check the value
+ at the correct offset, but it's NULL, so we eat hot SIGSEGV.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/arm/dl-machine.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
+index 1a4fd3f17b..a02c47571a 100644
+--- a/sysdeps/arm/dl-machine.h
++++ b/sysdeps/arm/dl-machine.h
+@@ -510,7 +510,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+
+ case R_ARM_TLS_DTPOFF32:
+ if (sym != NULL)
+- *reloc_addr += sym->st_value;
++ *reloc_addr = sym->st_value;
+ break;
+
+ case R_ARM_TLS_TPOFF32:
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0011-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/external/poky/meta/recipes-core/glibc/glibc/0011-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
new file mode 100644
index 00000000..32aae5cd
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0011-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
@@ -0,0 +1,33 @@
+From 3012cb839a64e7d5c621efa79b643d169290e6e9 Mon Sep 17 00:00:00 2001
+From: Ting Liu <b28495@freescale.com>
+Date: Wed, 19 Dec 2012 04:39:57 -0600
+Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S}
+
+libm-err-tab.pl will parse all the files named "libm-test-ulps"
+in the given dir recursively. To avoid parsing the one in
+${S}/.pc/ (it does exist after eglibc adds aarch64 support,
+${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/
+aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs
+in ${S}.
+
+Upstream-Status: inappropriate [OE specific]
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+---
+ manual/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/manual/Makefile b/manual/Makefile
+index c2756640a7..1b5bb16a96 100644
+--- a/manual/Makefile
++++ b/manual/Makefile
+@@ -102,7 +102,8 @@ $(objpfx)libm-err.texi: $(objpfx)stamp-libm-err
+ $(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
+ $(dir)/libm-test-ulps))
+ pwd=`pwd`; \
+- $(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp
++ $(PERL) $< $$pwd/../ports > $(objpfx)libm-err-tmp
++ $(PERL) $< $$pwd/../sysdeps >> $(objpfx)libm-err-tmp
+ $(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
+ touch $@
+
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0012-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/external/poky/meta/recipes-core/glibc/glibc/0012-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
new file mode 100644
index 00000000..93395c38
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0012-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -0,0 +1,58 @@
+From 93ab69ae4c98303929ba9492130a021fa4a215be Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:24:46 +0000
+Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out
+ __slow versions
+
+Upstream-Status: Pending
+
+Signed-off-by: chunrong guo <B40290@freescale.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c | 6 +++---
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+index 1c34244bd8..7038a70b47 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+ double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+
+ /* Handle small numbers by scaling. */
+ if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+- return __ieee754_sqrt (b * two108) * twom54;
++ return __slow_ieee754_sqrt (b * two108) * twom54;
+
+ #define FMADD(a_, c_, b_) \
+ ({ double __r; \
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+index 812653558f..10de1f0cc3 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+ float b;
+ #endif
+ {
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/external/poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
new file mode 100644
index 00000000..9998691f
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
@@ -0,0 +1,39 @@
+From a7bd8aa65f3f2755d6dbd0d5adbfd269c1fb0094 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:27:10 +0000
+Subject: [PATCH] sysdeps/gnu/configure.ac: handle correctly
+ $libc_cv_rootsbindir
+
+Upstream-Status:Pending
+
+Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/gnu/configure | 2 +-
+ sysdeps/gnu/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure
+index c15d1087e8..37cc983f2a 100644
+--- a/sysdeps/gnu/configure
++++ b/sysdeps/gnu/configure
+@@ -32,6 +32,6 @@ case "$prefix" in
+ else
+ libc_cv_localstatedir=$localstatedir
+ fi
+- libc_cv_rootsbindir=/sbin
++ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin
+ ;;
+ esac
+diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac
+index 634fe4de2a..3db1697f4f 100644
+--- a/sysdeps/gnu/configure.ac
++++ b/sysdeps/gnu/configure.ac
+@@ -21,6 +21,6 @@ case "$prefix" in
+ else
+ libc_cv_localstatedir=$localstatedir
+ fi
+- libc_cv_rootsbindir=/sbin
++ test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin
+ ;;
+ esac
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch b/external/poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch
new file mode 100644
index 00000000..9d6ab30e
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch
@@ -0,0 +1,31 @@
+From 2ce5bc6da23dcb402afdeb967fa44c39eecf6d37 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:28:41 +0000
+Subject: [PATCH] Add unused attribute
+
+Helps in avoiding gcc warning when header is is included in
+a source file which does not use both functions
+
+ * iconv/gconv_charset.h (strip):
+ Add unused attribute.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ iconv/gconv_charset.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/iconv/gconv_charset.h b/iconv/gconv_charset.h
+index 123e2a62ce..63cc83ec84 100644
+--- a/iconv/gconv_charset.h
++++ b/iconv/gconv_charset.h
+@@ -21,7 +21,7 @@
+ #include <locale.h>
+
+
+-static void
++static void __attribute__ ((unused))
+ strip (char *wp, const char *s)
+ {
+ int slash_count = 0;
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch b/external/poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch
new file mode 100644
index 00000000..0267e7a4
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch
@@ -0,0 +1,260 @@
+From b382138c41ccf6079b44592f1e74f183ca8281bb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:31:06 +0000
+Subject: [PATCH] 'yes' within the path sets wrong config variables
+
+It seems that the 'AC_EGREP_CPP(yes...' example is quite popular
+but being such a short word to grep it is likely to produce
+false-positive matches with the path it is configured into.
+
+The change is to use a more elaborated string to grep for.
+
+Upstream-Status: Submitted [libc-alpha@sourceware.org]
+
+Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/aarch64/configure | 4 ++--
+ sysdeps/aarch64/configure.ac | 4 ++--
+ sysdeps/arm/configure | 4 ++--
+ sysdeps/arm/configure.ac | 4 ++--
+ sysdeps/mips/configure | 4 ++--
+ sysdeps/mips/configure.ac | 4 ++--
+ sysdeps/nios2/configure | 4 ++--
+ sysdeps/nios2/configure.ac | 4 ++--
+ sysdeps/unix/sysv/linux/mips/configure | 4 ++--
+ sysdeps/unix/sysv/linux/mips/configure.ac | 4 ++--
+ sysdeps/unix/sysv/linux/powerpc/powerpc64/configure | 8 ++++----
+ sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac | 8 ++++----
+ 12 files changed, 28 insertions(+), 28 deletions(-)
+
+diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
+index 5bd355a691..3bc5537bc0 100644
+--- a/sysdeps/aarch64/configure
++++ b/sysdeps/aarch64/configure
+@@ -148,12 +148,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #ifdef __AARCH64EB__
+- yes
++ is_aarch64_be
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "is_aarch64_be" >/dev/null 2>&1; then :
+ libc_cv_aarch64_be=yes
+ else
+ libc_cv_aarch64_be=no
+diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
+index 7851dd4dac..6e9238171f 100644
+--- a/sysdeps/aarch64/configure.ac
++++ b/sysdeps/aarch64/configure.ac
+@@ -10,8 +10,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+ # the dynamic linker via %ifdef.
+ AC_CACHE_CHECK([for big endian],
+ [libc_cv_aarch64_be],
+- [AC_EGREP_CPP(yes,[#ifdef __AARCH64EB__
+- yes
++ [AC_EGREP_CPP(is_aarch64_be,[#ifdef __AARCH64EB__
++ is_aarch64_be
+ #endif
+ ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
+ if test $libc_cv_aarch64_be = yes; then
+diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure
+index 431e843b2b..e152461138 100644
+--- a/sysdeps/arm/configure
++++ b/sysdeps/arm/configure
+@@ -151,12 +151,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #ifdef __ARM_PCS_VFP
+- yes
++ use_arm_pcs_vfp
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "use_arm_pcs_vfp" >/dev/null 2>&1; then :
+ libc_cv_arm_pcs_vfp=yes
+ else
+ libc_cv_arm_pcs_vfp=no
+diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac
+index 90cdd69c75..05a262ba00 100644
+--- a/sysdeps/arm/configure.ac
++++ b/sysdeps/arm/configure.ac
+@@ -15,8 +15,8 @@ AC_DEFINE(PI_STATIC_AND_HIDDEN)
+ # the dynamic linker via %ifdef.
+ AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
+ [libc_cv_arm_pcs_vfp],
+- [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP
+- yes
++ [AC_EGREP_CPP(use_arm_pcs_vfp,[#ifdef __ARM_PCS_VFP
++ use_arm_pcs_vfp
+ #endif
+ ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
+ if test $libc_cv_arm_pcs_vfp = yes; then
+diff --git a/sysdeps/mips/configure b/sysdeps/mips/configure
+index 4e13248c03..f14af952d0 100644
+--- a/sysdeps/mips/configure
++++ b/sysdeps/mips/configure
+@@ -143,11 +143,11 @@ else
+ /* end confdefs.h. */
+ dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then :
+ libc_cv_mips_nan2008=yes
+ else
+ libc_cv_mips_nan2008=no
+diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac
+index bcbdaffd9f..ad3057f4cc 100644
+--- a/sysdeps/mips/configure.ac
++++ b/sysdeps/mips/configure.ac
+@@ -6,9 +6,9 @@ dnl position independent way.
+ dnl AC_DEFINE(PI_STATIC_AND_HIDDEN)
+
+ AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
+- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
++ libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])
+ if test x$libc_cv_mips_nan2008 = xyes; then
+ AC_DEFINE(HAVE_MIPS_NAN2008)
+diff --git a/sysdeps/nios2/configure b/sysdeps/nios2/configure
+index 14c8a3a014..dde3814ef2 100644
+--- a/sysdeps/nios2/configure
++++ b/sysdeps/nios2/configure
+@@ -142,12 +142,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #ifdef __nios2_big_endian__
+- yes
++ is_nios2_be
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "is_nios2_be" >/dev/null 2>&1; then :
+ libc_cv_nios2_be=yes
+ else
+ libc_cv_nios2_be=no
+diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac
+index f05f43802b..dc8639902d 100644
+--- a/sysdeps/nios2/configure.ac
++++ b/sysdeps/nios2/configure.ac
+@@ -4,8 +4,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+ # Nios II big endian is not yet supported.
+ AC_CACHE_CHECK([for big endian],
+ [libc_cv_nios2_be],
+- [AC_EGREP_CPP(yes,[#ifdef __nios2_big_endian__
+- yes
++ [AC_EGREP_CPP(is_nios2_be,[#ifdef __nios2_big_endian__
++ is_nios2_be
+ #endif
+ ], libc_cv_nios2_be=yes, libc_cv_nios2_be=no)])
+ if test $libc_cv_nios2_be = yes; then
+diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure
+index 1ee7f41a36..77e38bebde 100644
+--- a/sysdeps/unix/sysv/linux/mips/configure
++++ b/sysdeps/unix/sysv/linux/mips/configure
+@@ -414,11 +414,11 @@ else
+ /* end confdefs.h. */
+ dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "use_mips_nan2008" >/dev/null 2>&1; then :
+ libc_cv_mips_nan2008=yes
+ else
+ libc_cv_mips_nan2008=no
+diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac
+index 9147aa4582..7898e24738 100644
+--- a/sysdeps/unix/sysv/linux/mips/configure.ac
++++ b/sysdeps/unix/sysv/linux/mips/configure.ac
+@@ -105,9 +105,9 @@ AC_COMPILE_IFELSE(
+ LIBC_CONFIG_VAR([mips-mode-switch],[${libc_mips_mode_switch}])
+
+ AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
+- libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
++ libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])
+
+ libc_mips_nan=
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
+index ae7f254da4..874519000b 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
+@@ -155,12 +155,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #if _CALL_ELF == 2
+- yes
++ use_ppc_elfv2_abi
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "use_ppc_elfv2_abi" >/dev/null 2>&1; then :
+ libc_cv_ppc64_elfv2_abi=yes
+ else
+ libc_cv_ppc64_elfv2_abi=no
+@@ -188,12 +188,12 @@ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #ifdef _CALL_ELF
+- yes
++ is_def_call_elf
+ #endif
+
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+- $EGREP "yes" >/dev/null 2>&1; then :
++ $EGREP "is_def_call_elf" >/dev/null 2>&1; then :
+ libc_cv_ppc64_def_call_elf=yes
+ else
+ libc_cv_ppc64_def_call_elf=no
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
+index f9cba6e15d..b21f72f1e4 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
+@@ -6,8 +6,8 @@ LIBC_SLIBDIR_RTLDDIR([lib64], [lib64])
+ # Define default-abi according to compiler flags.
+ AC_CACHE_CHECK([whether the compiler is using the PowerPC64 ELFv2 ABI],
+ [libc_cv_ppc64_elfv2_abi],
+- [AC_EGREP_CPP(yes,[#if _CALL_ELF == 2
+- yes
++ [AC_EGREP_CPP(use_ppc_elfv2_abi,[#if _CALL_ELF == 2
++ use_ppc_elfv2_abi
+ #endif
+ ], libc_cv_ppc64_elfv2_abi=yes, libc_cv_ppc64_elfv2_abi=no)])
+ if test $libc_cv_ppc64_elfv2_abi = yes; then
+@@ -19,8 +19,8 @@ else
+ # Compiler that do not support ELFv2 ABI does not define _CALL_ELF
+ AC_CACHE_CHECK([whether the compiler defines _CALL_ELF],
+ [libc_cv_ppc64_def_call_elf],
+- [AC_EGREP_CPP(yes,[#ifdef _CALL_ELF
+- yes
++ [AC_EGREP_CPP(is_def_call_elf,[#ifdef _CALL_ELF
++ is_def_call_elf
+ #endif
+ ], libc_cv_ppc64_def_call_elf=yes, libc_cv_ppc64_def_call_elf=no)])
+ if test $libc_cv_ppc64_def_call_elf = no; then
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch b/external/poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
new file mode 100644
index 00000000..15453ec6
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch
@@ -0,0 +1,42 @@
+From 04fb7b93dc40c1f96ebc05d29a2f02f9e4f0d572 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:33:03 +0000
+Subject: [PATCH] timezone: re-written tzselect as posix sh
+
+To avoid the bash dependency.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ timezone/Makefile | 2 +-
+ timezone/tzselect.ksh | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/timezone/Makefile b/timezone/Makefile
+index 0194aba4a1..58e5405a05 100644
+--- a/timezone/Makefile
++++ b/timezone/Makefile
+@@ -122,7 +122,7 @@ $(testdata)/XT%: testdata/XT%
+ cp $< $@
+
+ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
+- sed -e 's|/bin/bash|$(BASH)|' \
++ sed -e 's|/bin/bash|/bin/sh|' \
+ -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
+ -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
+ -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
+diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
+index d2c3a6d1dd..089679f306 100755
+--- a/timezone/tzselect.ksh
++++ b/timezone/tzselect.ksh
+@@ -35,7 +35,7 @@ REPORT_BUGS_TO=tz@iana.org
+
+ # Specify default values for environment variables if they are unset.
+ : ${AWK=awk}
+-: ${TZDIR=`pwd`}
++: ${TZDIR=$(pwd)}
+
+ # Output one argument as-is to standard output.
+ # Safer than 'echo', which can mishandle '\' or leading '-'.
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch b/external/poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch
new file mode 100644
index 00000000..06d2cd1d
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch
@@ -0,0 +1,72 @@
+From 7a2f244c0980a54ed74f9544ab44a7269ef12bce Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 14:33:02 -0800
+Subject: [PATCH] Remove bash dependency for nscd init script
+
+The nscd init script uses #! /bin/bash but only really uses one bashism
+(translated strings), so remove them and switch the shell to #!/bin/sh.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ nscd/nscd.init | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/nscd/nscd.init b/nscd/nscd.init
+index a882da7d8b..b02986ec15 100644
+--- a/nscd/nscd.init
++++ b/nscd/nscd.init
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # nscd: Starts the Name Switch Cache Daemon
+ #
+@@ -49,7 +49,7 @@ prog=nscd
+ start () {
+ [ -d /var/run/nscd ] || mkdir /var/run/nscd
+ [ -d /var/db/nscd ] || mkdir /var/db/nscd
+- echo -n $"Starting $prog: "
++ echo -n "Starting $prog: "
+ daemon /usr/sbin/nscd
+ RETVAL=$?
+ echo
+@@ -58,7 +58,7 @@ start () {
+ }
+
+ stop () {
+- echo -n $"Stopping $prog: "
++ echo -n "Stopping $prog: "
+ /usr/sbin/nscd -K
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+@@ -67,9 +67,9 @@ stop () {
+ # a non-privileged user
+ rm -f /var/run/nscd/nscd.pid
+ rm -f /var/run/nscd/socket
+- success $"$prog shutdown"
++ success "$prog shutdown"
+ else
+- failure $"$prog shutdown"
++ failure "$prog shutdown"
+ fi
+ echo
+ return $RETVAL
+@@ -103,13 +103,13 @@ case "$1" in
+ RETVAL=$?
+ ;;
+ force-reload | reload)
+- echo -n $"Reloading $prog: "
++ echo -n "Reloading $prog: "
+ killproc /usr/sbin/nscd -HUP
+ RETVAL=$?
+ echo
+ ;;
+ *)
+- echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
++ echo "Usage: $0 {start|stop|status|restart|reload|condrestart}"
+ RETVAL=1
+ ;;
+ esac
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch b/external/poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
new file mode 100644
index 00000000..29109a26
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
@@ -0,0 +1,616 @@
+From 44a5c79efea09f5b990e524ec42abdeef444056a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:42:58 +0000
+Subject: [PATCH] eglibc: Cross building and testing instructions
+
+Ported from eglibc
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ GLIBC.cross-building | 383 +++++++++++++++++++++++++++++++++++++++++++
+ GLIBC.cross-testing | 205 +++++++++++++++++++++++
+ 2 files changed, 588 insertions(+)
+ create mode 100644 GLIBC.cross-building
+ create mode 100644 GLIBC.cross-testing
+
+diff --git a/GLIBC.cross-building b/GLIBC.cross-building
+new file mode 100644
+index 0000000000..e6e0da1aaf
+--- /dev/null
++++ b/GLIBC.cross-building
+@@ -0,0 +1,383 @@
++ -*- mode: text -*-
++
++ Cross-Compiling GLIBC
++ Jim Blandy <jimb@codesourcery.com>
++
++
++Introduction
++
++Most GNU tools have a simple build procedure: you run their
++'configure' script, and then you run 'make'. Unfortunately, the
++process of cross-compiling the GNU C library is quite a bit more
++involved:
++
++1) Build a cross-compiler, with certain facilities disabled.
++
++2) Configure the C library using the compiler you built in step 1).
++ Build a few of the C run-time object files, but not the rest of the
++ library. Install the library's header files and the run-time
++ object files, and create a dummy libc.so.
++
++3) Build a second cross-compiler, using the header files and object
++ files you installed in step 2.
++
++4) Configure, build, and install a fresh C library, using the compiler
++ built in step 3.
++
++5) Build a third cross-compiler, based on the C library built in step 4.
++
++The reason for this complexity is that, although GCC and the GNU C
++library are distributed separately, they are not actually independent
++of each other: GCC requires the C library's headers and some object
++files to compile its own libraries, while the C library depends on
++GCC's libraries. GLIBC includes features and bug fixes to the stock
++GNU C library that simplify this process, but the fundamental
++interdependency stands.
++
++In this document, we explain how to cross-compile an GLIBC/GCC pair
++from source. Our intended audience is developers who are already
++familiar with the GNU toolchain and comfortable working with
++cross-development tools. While we do present a worked example to
++accompany the explanation, for clarity's sake we do not cover many of
++the options available to cross-toolchain users.
++
++
++Preparation
++
++GLIBC requires recent versions of the GNU binutils, GCC, and the
++Linux kernel. The web page <http://www.eglibc.org/prerequisites>
++documents the current requirements, and lists patches needed for
++certain target architectures. As of this writing, these build
++instructions have been tested with binutils 2.22.51, GCC 4.6.2,
++and Linux 3.1.
++
++First, let's set some variables, to simplify later commands. We'll
++build GLIBC and GCC for an ARM target, known to the Linux kernel
++as 'arm', and we'll do the build on an Intel x86_64 Linux box:
++
++ $ build=x86_64-pc-linux-gnu
++ $ host=$build
++ $ target=arm-none-linux-gnueabi
++ $ linux_arch=arm
++
++We're using the aforementioned versions of Binutils, GCC, and Linux:
++
++ $ binutilsv=binutils-2.22.51
++ $ gccv=gcc-4.6.2
++ $ linuxv=linux-3.1
++
++We're carrying out the entire process under '~/cross-build', which
++contains unpacked source trees for binutils, gcc, and linux kernel,
++along with GLIBC svn trunk (which can be checked-out with
++'svn co http://www.eglibc.org/svn/trunk eglibc'):
++
++ $ top=$HOME/cross-build/$target
++ $ src=$HOME/cross-build/src
++ $ ls $src
++ binutils-2.22.51 glibc gcc-4.6.2 linux-3.1
++
++We're going to place our build directories in a subdirectory 'obj',
++we'll install the cross-development toolchain in 'tools', and we'll
++place our sysroot (containing files to be installed on the target
++system) in 'sysroot':
++
++ $ obj=$top/obj
++ $ tools=$top/tools
++ $ sysroot=$top/sysroot
++
++
++Binutils
++
++Configuring and building binutils for the target is straightforward:
++
++ $ mkdir -p $obj/binutils
++ $ cd $obj/binutils
++ $ $src/$binutilsv/configure \
++ > --target=$target \
++ > --prefix=$tools \
++ > --with-sysroot=$sysroot
++ $ make
++ $ make install
++
++
++The First GCC
++
++For our work, we need a cross-compiler targeting an ARM Linux
++system. However, that configuration includes the shared library
++'libgcc_s.so', which is compiled against the GLIBC headers (which we
++haven't installed yet) and linked against 'libc.so' (which we haven't
++built yet).
++
++Fortunately, there are configuration options for GCC which tell it not
++to build 'libgcc_s.so'. The '--without-headers' option is supposed to
++take care of this, but its implementation is incomplete, so you must
++also configure with the '--with-newlib' option. While '--with-newlib'
++appears to mean "Use the Newlib C library", its effect is to tell the
++GCC build machinery, "Don't assume there is a C library available."
++
++We also need to disable some of the libraries that would normally be
++built along with GCC, and specify that only the compiler for the C
++language is needed.
++
++So, we create a build directory, configure, make, and install.
++
++ $ mkdir -p $obj/gcc1
++ $ cd $obj/gcc1
++ $ $src/$gccv/configure \
++ > --target=$target \
++ > --prefix=$tools \
++ > --without-headers --with-newlib \
++ > --disable-shared --disable-threads --disable-libssp \
++ > --disable-libgomp --disable-libmudflap --disable-libquadmath \
++ > --disable-decimal-float --disable-libffi \
++ > --enable-languages=c
++ $ PATH=$tools/bin:$PATH make
++ $ PATH=$tools/bin:$PATH make install
++
++
++Linux Kernel Headers
++
++To configure GLIBC, we also need Linux kernel headers in place.
++Fortunately, the Linux makefiles have a target that installs them for
++us. Since the process does modify the source tree a bit, we make a
++copy first:
++
++ $ cp -r $src/$linuxv $obj/linux
++ $ cd $obj/linux
++
++Now we're ready to install the headers into the sysroot:
++
++ $ PATH=$tools/bin:$PATH \
++ > make headers_install \
++ > ARCH=$linux_arch CROSS_COMPILE=$target- \
++ > INSTALL_HDR_PATH=$sysroot/usr
++
++
++GLIBC Headers and Preliminary Objects
++
++Using the cross-compiler we've just built, we can now configure GLIBC
++well enough to install the headers and build the object files that the
++full cross-compiler will need:
++
++ $ mkdir -p $obj/glibc-headers
++ $ cd $obj/glibc-headers
++ $ BUILD_CC=gcc \
++ > CC=$tools/bin/$target-gcc \
++ > CXX=$tools/bin/$target-g++ \
++ > AR=$tools/bin/$target-ar \
++ > RANLIB=$tools/bin/$target-ranlib \
++ > $src/glibc/libc/configure \
++ > --prefix=/usr \
++ > --with-headers=$sysroot/usr/include \
++ > --build=$build \
++ > --host=$target \
++ > --disable-profile --without-gd --without-cvs \
++ > --enable-add-ons=nptl,libidn,../ports
++
++The option '--prefix=/usr' may look strange, but you should never
++configure GLIBC with a prefix other than '/usr': in various places,
++GLIBC's build system checks whether the prefix is '/usr', and does
++special handling only if that is the case. Unless you use this
++prefix, you will get a sysroot that does not use the standard Linux
++directory layouts and cannot be used as a basis for the root
++filesystem on your target system compatibly with normal GLIBC
++installations.
++
++The '--with-headers' option tells GLIBC where the Linux headers have
++been installed.
++
++The '--enable-add-ons=nptl,libidn,../ports' option tells GLIBC to look
++for the listed glibc add-ons. Most notably the ports add-on (located
++just above the libc sources in the GLIBC svn tree) is required to
++support ARM targets.
++
++We can now use the 'install-headers' makefile target to install the
++headers:
++
++ $ make install-headers install_root=$sysroot \
++ > install-bootstrap-headers=yes
++
++The 'install_root' variable indicates where the files should actually
++be installed; its value is treated as the parent of the '--prefix'
++directory we passed to the configure script, so the headers will go in
++'$sysroot/usr/include'. The 'install-bootstrap-headers' variable
++requests special handling for certain tricky header files.
++
++Next, there are a few object files needed to link shared libraries,
++which we build and install by hand:
++
++ $ mkdir -p $sysroot/usr/lib
++ $ make csu/subdir_lib
++ $ cp csu/crt1.o csu/crti.o csu/crtn.o $sysroot/usr/lib
++
++Finally, 'libgcc_s.so' requires a 'libc.so' to link against. However,
++since we will never actually execute its code, it doesn't matter what
++it contains. So, treating '/dev/null' as a C source file, we produce
++a dummy 'libc.so' in one step:
++
++ $ $tools/bin/$target-gcc -nostdlib -nostartfiles -shared -x c /dev/null \
++ > -o $sysroot/usr/lib/libc.so
++
++
++The Second GCC
++
++With the GLIBC headers and selected object files installed, we can
++now build a GCC that is capable of compiling GLIBC. We configure,
++build, and install the second GCC, again building only the C compiler,
++and avoiding libraries we won't use:
++
++ $ mkdir -p $obj/gcc2
++ $ cd $obj/gcc2
++ $ $src/$gccv/configure \
++ > --target=$target \
++ > --prefix=$tools \
++ > --with-sysroot=$sysroot \
++ > --disable-libssp --disable-libgomp --disable-libmudflap \
++ > --disable-libffi --disable-libquadmath \
++ > --enable-languages=c
++ $ PATH=$tools/bin:$PATH make
++ $ PATH=$tools/bin:$PATH make install
++
++
++GLIBC, Complete
++
++With the second compiler built and installed, we're now ready for the
++full GLIBC build:
++
++ $ mkdir -p $obj/glibc
++ $ cd $obj/glibc
++ $ BUILD_CC=gcc \
++ > CC=$tools/bin/$target-gcc \
++ > CXX=$tools/bin/$target-g++ \
++ > AR=$tools/bin/$target-ar \
++ > RANLIB=$tools/bin/$target-ranlib \
++ > $src/glibc/libc/configure \
++ > --prefix=/usr \
++ > --with-headers=$sysroot/usr/include \
++ > --with-kconfig=$obj/linux/scripts/kconfig \
++ > --build=$build \
++ > --host=$target \
++ > --disable-profile --without-gd --without-cvs \
++ > --enable-add-ons=nptl,libidn,../ports
++
++Note the additional '--with-kconfig' option. This tells GLIBC where to
++find the host config tools used by the kernel 'make config' and 'make
++menuconfig'. These tools can be re-used by GLIBC for its own 'make
++*config' support, which will create 'option-groups.config' for you.
++But first make sure those tools have been built by running some
++dummy 'make *config' calls in the kernel directory:
++
++ $ cd $obj/linux
++ $ PATH=$tools/bin:$PATH make config \
++ > ARCH=$linux_arch CROSS_COMPILE=$target- \
++ $ PATH=$tools/bin:$PATH make menuconfig \
++ > ARCH=$linux_arch CROSS_COMPILE=$target- \
++
++Now we can configure and build the full GLIBC:
++
++ $ cd $obj/glibc
++ $ PATH=$tools/bin:$PATH make defconfig
++ $ PATH=$tools/bin:$PATH make menuconfig
++ $ PATH=$tools/bin:$PATH make
++ $ PATH=$tools/bin:$PATH make install install_root=$sysroot
++
++At this point, we have a complete GLIBC installation in '$sysroot',
++with header files, library files, and most of the C runtime startup
++files in place.
++
++
++The Third GCC
++
++Finally, we recompile GCC against this full installation, enabling
++whatever languages and libraries we would like to use:
++
++ $ mkdir -p $obj/gcc3
++ $ cd $obj/gcc3
++ $ $src/$gccv/configure \
++ > --target=$target \
++ > --prefix=$tools \
++ > --with-sysroot=$sysroot \
++ > --enable-__cxa_atexit \
++ > --disable-libssp --disable-libgomp --disable-libmudflap \
++ > --enable-languages=c,c++
++ $ PATH=$tools/bin:$PATH make
++ $ PATH=$tools/bin:$PATH make install
++
++The '--enable-__cxa_atexit' option tells GCC what sort of C++
++destructor support to expect from the C library; it's required with
++GLIBC.
++
++And since GCC's installation process isn't designed to help construct
++sysroot trees, we must manually copy certain libraries into place in
++the sysroot.
++
++ $ cp -d $tools/$target/lib/libgcc_s.so* $sysroot/lib
++ $ cp -d $tools/$target/lib/libstdc++.so* $sysroot/usr/lib
++
++
++Trying Things Out
++
++At this point, '$tools' contains a cross toolchain ready to use
++the GLIBC installation in '$sysroot':
++
++ $ cat > hello.c <<EOF
++ > #include <stdio.h>
++ > int
++ > main (int argc, char **argv)
++ > {
++ > puts ("Hello, world!");
++ > return 0;
++ > }
++ > EOF
++ $ $tools/bin/$target-gcc -Wall hello.c -o hello
++ $ cat > c++-hello.cc <<EOF
++ > #include <iostream>
++ > int
++ > main (int argc, char **argv)
++ > {
++ > std::cout << "Hello, C++ world!" << std::endl;
++ > return 0;
++ > }
++ > EOF
++ $ $tools/bin/$target-g++ -Wall c++-hello.cc -o c++-hello
++
++
++We can use 'readelf' to verify that these are indeed executables for
++our target, using our dynamic linker:
++
++ $ $tools/bin/$target-readelf -hl hello
++ ELF Header:
++ ...
++ Type: EXEC (Executable file)
++ Machine: ARM
++
++ ...
++ Program Headers:
++ Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
++ PHDR 0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4
++ INTERP 0x000134 0x00008134 0x00008134 0x00013 0x00013 R 0x1
++ [Requesting program interpreter: /lib/ld-linux.so.3]
++ LOAD 0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000
++ ...
++
++Looking at the dynamic section of the installed 'libgcc_s.so', we see
++that the 'NEEDED' entry for the C library does include the '.6'
++suffix, indicating that was linked against our fully build GLIBC, and
++not our dummy 'libc.so':
++
++ $ $tools/bin/$target-readelf -d $sysroot/lib/libgcc_s.so.1
++ Dynamic section at offset 0x1083c contains 24 entries:
++ Tag Type Name/Value
++ 0x00000001 (NEEDED) Shared library: [libc.so.6]
++ 0x0000000e (SONAME) Library soname: [libgcc_s.so.1]
++ ...
++
++
++And on the target machine, we can run our programs:
++
++ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \
++ > ./hello
++ Hello, world!
++ $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \
++ > ./c++-hello
++ Hello, C++ world!
+diff --git a/GLIBC.cross-testing b/GLIBC.cross-testing
+new file mode 100644
+index 0000000000..b67b468466
+--- /dev/null
++++ b/GLIBC.cross-testing
+@@ -0,0 +1,205 @@
++ -*- mode: text -*-
++
++ Cross-Testing With GLIBC
++ Jim Blandy <jimb@codesourcery.com>
++
++
++Introduction
++
++Developers writing software for embedded systems often use a desktop
++or other similarly capable computer for development, but need to run
++tests on the embedded system, or perhaps on a simulator. When
++configured for cross-compilation, the stock GNU C library simply
++disables running tests altogether: the command 'make tests' builds
++test programs, but does not run them. GLIBC, however, provides
++facilities for compiling tests and generating data files on the build
++system, but running the test programs themselves on a remote system or
++simulator.
++
++
++Test environment requirements
++
++The test environment must meet certain conditions for GLIBC's
++cross-testing facilities to work:
++
++- Shared filesystems. The 'build' system, on which you configure and
++ compile GLIBC, and the 'host' system, on which you intend to run
++ GLIBC, must share a filesystem containing the GLIBC build and
++ source trees. Files must appear at the same paths on both systems.
++
++- Remote-shell like invocation. There must be a way to run a program
++ on the host system from the build system, passing it properly quoted
++ command-line arguments, setting environment variables, and
++ inheriting the caller's standard input and output.
++
++
++Usage
++
++To use GLIBC's cross-testing support, provide values for the
++following Make variables when you invoke 'make':
++
++- cross-test-wrapper
++
++ This should be the name of the cross-testing wrapper command, along
++ with any arguments.
++
++- cross-localedef
++
++ This should be the name of a cross-capable localedef program, like
++ that included in the GLIBC 'localedef' module, along with any
++ arguments needed.
++
++These are each explained in detail below.
++
++
++The Cross-Testing Wrapper
++
++To run test programs reliably, the stock GNU C library takes care to
++ensure that test programs use the newly compiled dynamic linker and
++shared libraries, and never the host system's installed libraries. To
++accomplish this, it runs the tests by explicitly invoking the dynamic
++linker from the build tree, passing it a list of build tree
++directories to search for shared libraries, followed by the name of
++the executable to run and its arguments.
++
++For example, where one might normally run a test program like this:
++
++ $ ./tst-foo arg1 arg2
++
++the GNU C library might run that program like this:
++
++ $ $objdir/elf/ld-linux.so.3 --library-path $objdir \
++ ./tst-foo arg1 arg2
++
++(where $objdir is the path to the top of the build tree, and the
++trailing backslash indicates a continuation of the command). In other
++words, each test program invocation is 'wrapped up' inside an explicit
++invocation of the dynamic linker, which must itself execute the test
++program, having loaded shared libraries from the appropriate
++directories.
++
++To support cross-testing, GLIBC allows the developer to optionally
++set the 'cross-test-wrapper' Make variable to another wrapper command,
++to which it passes the entire dynamic linker invocation shown above as
++arguments. For example, if the developer supplies a wrapper of
++'my-wrapper hostname', then GLIBC would run the test above as
++follows:
++
++ $ my-wrapper hostname \
++ $objdir/elf/ld-linux.so.3 --library-path $objdir \
++ ./tst-foo arg1 arg2
++
++The 'my-wrapper' command is responsible for executing the command
++given on the host system.
++
++Since tests are run in varying directories, the wrapper should either
++be in your command search path, or 'cross-test-wrapper' should give an
++absolute path for the wrapper.
++
++The wrapper must meet several requirements:
++
++- It must preserve the current directory. As explained above, the
++ build directory tree must be visible on both the build and host
++ systems, at the same path. The test wrapper must ensure that the
++ current directory it inherits is also inherited by the dynamic
++ linker (and thus the test program itself).
++
++- It must preserve environment variables' values. Many GLIBC tests
++ set environment variables for test runs; in native testing, it
++ invokes programs like this:
++
++ $ GCONV_PATH=$objdir/iconvdata \
++ $objdir/elf/ld-linux.so.3 --library-path $objdir \
++ ./tst-foo arg1 arg2
++
++ With the cross-testing wrapper, that invocation becomes:
++
++ $ GCONV_PATH=$objdir/iconvdata \
++ my-wrapper hostname \
++ $objdir/elf/ld-linux.so.3 --library-path $objdir \
++ ./tst-foo arg1 arg2
++
++ Here, 'my-wrapper' must ensure that the value it sees for
++ 'GCONV_PATH' will be seen by the dynamic linker, and thus 'tst-foo'
++ itself. (The wrapper supplied with GLIBC simply preserves the
++ values of *all* enviroment variables, with a fixed set of
++ exceptions.)
++
++ If your wrapper is a shell script, take care to correctly propagate
++ environment variables whose values contain spaces and shell
++ metacharacters.
++
++- It must pass the command's arguments, unmodified. The arguments
++ seen by the test program should be exactly those seen by the wrapper
++ (after whatever arguments are given to the wrapper itself). The
++ GLIBC test framework performs all needed shell word splitting and
++ expansion (wildcard expansion, parameter substitution, and so on)
++ before invoking the wrapper; further expansion may break the tests.
++
++
++The 'cross-test-ssh.sh' script
++
++If you want to use 'ssh' (or something sufficiently similar) to run
++test programs on your host system, GLIBC includes a shell script,
++'scripts/cross-test-ssh.sh', which you can use as your wrapper
++command. This script takes care of setting the test command's current
++directory, propagating environment variable values, and carrying
++command-line arguments, all across an 'ssh' connection. You may even
++supply an alternative to 'ssh' on the command line, if needed.
++
++For more details, pass 'cross-test-ssh.sh' the '--help' option.
++
++
++The Cross-Compiling Locale Definition Command
++
++Some GLIBC tests rely on locales generated especially for the test
++process. In a native configuration, these tests simply run the
++'localedef' command built by the normal GLIBC build process,
++'locale/localedef', to process and install their locales. However, in
++a cross-compiling configuration, this 'localedef' is built for the
++host system, not the build system, and since it requires quite a bit
++of memory to run (we have seen it fail on systems with 64MiB of
++memory), it may not be practical to run it on the host system.
++
++If set, GLIBC uses the 'cross-localedef' Make variable as the command
++to run on the build system to process and install locales. The
++localedef program built from the GLIBC 'localedef' module is
++suitable.
++
++The value of 'cross-localedef' may also include command-line arguments
++to be passed to the program; if you are using GLIBC's 'localedef',
++you may include endianness and 'uint32_t' alignment arguments here.
++
++
++Example
++
++In developing GLIBC's cross-testing facility, we invoked 'make' with
++the following script:
++
++ #!/bin/sh
++
++ srcdir=...
++ test_hostname=...
++ localedefdir=...
++ cross_gxx=...-g++
++
++ wrapper="$srcdir/scripts/cross-test-ssh.sh $test_hostname"
++ localedef="$localedefdir/localedef --little-endian --uint32-align=4"
++
++ make cross-test-wrapper="$wrapper" \
++ cross-localedef="$localedef" \
++ CXX="$cross_gxx" \
++ "$@"
++
++
++Other Cross-Testing Concerns
++
++Here are notes on some other issues which you may encounter in running
++the GLIBC tests in a cross-compiling environment:
++
++- Some tests require a C++ cross-compiler; you should set the 'CXX'
++ Make variable to the name of an appropriate cross-compiler.
++
++- Some tests require access to libstdc++.so.6 and libgcc_s.so.1; we
++ simply place copies of these libraries in the top GLIBC build
++ directory.
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch b/external/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch
new file mode 100644
index 00000000..71c2ab91
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch
@@ -0,0 +1,97 @@
+From f4ec5527d562d38523abb8587a6c7532e9d21f8a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:49:28 +0000
+Subject: [PATCH] eglibc: Help bootstrap cross toolchain
+
+Taken from EGLIBC, r1484 + r1525
+
+ 2007-02-20 Jim Blandy <jimb@codesourcery.com>
+
+ * Makefile (install-headers): Preserve old behavior: depend on
+ $(inst_includedir)/gnu/stubs.h only if install-bootstrap-headers
+ is set; otherwise, place gnu/stubs.h on the 'install-others' list.
+
+ 2007-02-16 Jim Blandy <jimb@codesourcery.com>
+
+ * Makefile: Amend make install-headers to install everything
+ necessary for building a cross-compiler. Install gnu/stubs.h as
+ part of 'install-headers', not 'install-others'.
+ If install-bootstrap-headers is 'yes', install a dummy copy of
+ gnu/stubs.h, instead of computing the real thing.
+ * include/stubs-bootstrap.h: New file.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 22 +++++++++++++++++++++-
+ include/stubs-bootstrap.h | 12 ++++++++++++
+ 2 files changed, 33 insertions(+), 1 deletion(-)
+ create mode 100644 include/stubs-bootstrap.h
+
+diff --git a/Makefile b/Makefile
+index d3f25a525a..ab383867e2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -70,9 +70,18 @@ subdir-dirs = include
+ vpath %.h $(subdir-dirs)
+
+ # What to install.
+-install-others = $(inst_includedir)/gnu/stubs.h
+ install-bin-script =
+
++# If we're bootstrapping, install a dummy gnu/stubs.h along with the
++# other headers, so 'make install-headers' produces a useable include
++# tree. Otherwise, install gnu/stubs.h later, after the rest of the
++# build is done.
++ifeq ($(install-bootstrap-headers),yes)
++install-headers: $(inst_includedir)/gnu/stubs.h
++else
++install-others = $(inst_includedir)/gnu/stubs.h
++endif
++
+ ifeq (yes,$(build-shared))
+ headers += gnu/lib-names.h
+ endif
+@@ -195,6 +204,16 @@ others: $(common-objpfx)testrun.sh
+
+ subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
+
++# gnu/stubs.h depends (via the subdir 'stubs' targets) on all the .o
++# files in EGLIBC. For bootstrapping a GCC/EGLIBC pair, an empty
++# gnu/stubs.h is good enough.
++ifeq ($(install-bootstrap-headers),yes)
++$(inst_includedir)/gnu/stubs.h: include/stubs-bootstrap.h $(+force)
++ $(make-target-directory)
++ $(INSTALL_DATA) $< $@
++
++installed-stubs =
++else
+ ifndef abi-variants
+ installed-stubs = $(inst_includedir)/gnu/stubs.h
+ else
+@@ -221,6 +240,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force)
+
+ install-others-nosubdir: $(installed-stubs)
+ endif
++endif
+
+
+ # Since stubs.h is never needed when building the library, we simplify the
+diff --git a/include/stubs-bootstrap.h b/include/stubs-bootstrap.h
+new file mode 100644
+index 0000000000..1d2b669aff
+--- /dev/null
++++ b/include/stubs-bootstrap.h
+@@ -0,0 +1,12 @@
++/* Placeholder stubs.h file for bootstrapping.
++
++ When bootstrapping a GCC/EGLIBC pair, GCC requires that the EGLIBC
++ headers be installed, but we can't fully build EGLIBC without that
++ GCC. So we run the command:
++
++ make install-headers install-bootstrap-headers=yes
++
++ to install the headers GCC needs, but avoid building certain
++ difficult headers. The <gnu/stubs.h> header depends, via the
++ EGLIBC subdir 'stubs' make targets, on every .o file in EGLIBC, but
++ an empty stubs.h like this will do fine for GCC. */
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Clear-cache-lines-on-ppc8xx.patch b/external/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Clear-cache-lines-on-ppc8xx.patch
new file mode 100644
index 00000000..6e475a71
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Clear-cache-lines-on-ppc8xx.patch
@@ -0,0 +1,80 @@
+From 6c23660d035e71de0e20b40460ad3050bd057665 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Dec 2015 15:15:09 -0800
+Subject: [PATCH] eglibc: Clear cache lines on ppc8xx
+
+2007-06-13 Nathan Sidwell <nathan@codesourcery.com>
+ Mark Shinwell <shinwell@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/powerpc/libc-start.c
+ (__libc_start_main): Detect 8xx parts and clear
+ __cache_line_size if detected.
+ * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+ (DL_PLATFORM_AUXV): Likewise.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c | 14 +++++++++++++-
+ sysdeps/unix/sysv/linux/powerpc/libc-start.c | 16 +++++++++++++++-
+ 2 files changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+index 78051bc7bc..e24f442320 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
++++ b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+@@ -24,9 +24,21 @@ int __cache_line_size attribute_hidden;
+ /* Scan the Aux Vector for the "Data Cache Block Size" entry. If found
+ verify that the static extern __cache_line_size is defined by checking
+ for not NULL. If it is defined then assign the cache block size
+- value to __cache_line_size. */
++ value to __cache_line_size. This is used by memset to
++ optimize setting to zero. We have to detect 8xx processors, which
++ have buggy dcbz implementations that cannot report page faults
++ correctly. That requires reading SPR, which is a privileged
++ operation. Fortunately 2.2.18 and later emulates PowerPC mfspr
++ reads from the PVR register. */
+ #define DL_PLATFORM_AUXV \
+ case AT_DCACHEBSIZE: \
++ if (__LINUX_KERNEL_VERSION >= 0x020218) \
++ { \
++ unsigned pvr = 0; \
++ asm ("mfspr %0, 287" : "=r" (pvr)); \
++ if ((pvr & 0xffff0000) == 0x00500000) \
++ break; \
++ } \
+ __cache_line_size = av->a_un.a_val; \
+ break;
+
+diff --git a/sysdeps/unix/sysv/linux/powerpc/libc-start.c b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+index f2ad0c355d..3e6773795e 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/libc-start.c
++++ b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+@@ -73,11 +73,25 @@ __libc_start_main (int argc, char **argv,
+
+ /* Initialize the __cache_line_size variable from the aux vector. For the
+ static case, we also need _dl_hwcap, _dl_hwcap2 and _dl_platform, so we
+- can call __tcb_parse_hwcap_and_convert_at_platform (). */
++ can call __tcb_parse_hwcap_and_convert_at_platform ().
++
++ This is used by memset to optimize setting to zero. We have to
++ detect 8xx processors, which have buggy dcbz implementations that
++ cannot report page faults correctly. That requires reading SPR,
++ which is a privileged operation. Fortunately 2.2.18 and later
++ emulates PowerPC mfspr reads from the PVR register. */
+ for (ElfW (auxv_t) * av = auxvec; av->a_type != AT_NULL; ++av)
+ switch (av->a_type)
+ {
+ case AT_DCACHEBSIZE:
++ if (__LINUX_KERNEL_VERSION >= 0x020218)
++ {
++ unsigned pvr = 0;
++
++ asm ("mfspr %0, 287" : "=r" (pvr) :);
++ if ((pvr & 0xffff0000) == 0x00500000)
++ break;
++ }
+ __cache_line_size = av->a_un.a_val;
+ break;
+ #ifndef SHARED
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Resolve-__fpscr_values-on-SH4.patch b/external/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Resolve-__fpscr_values-on-SH4.patch
new file mode 100644
index 00000000..8aecf262
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Resolve-__fpscr_values-on-SH4.patch
@@ -0,0 +1,53 @@
+From 55531ef57d04006c5a1e3b32a8e0410372f86007 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:55:53 +0000
+Subject: [PATCH] eglibc: Resolve __fpscr_values on SH4
+
+2010-09-29 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
+ Andrew Stubbs <ams@codesourcery.com>
+
+ Resolve SH's __fpscr_values to symbol in libc.so.
+
+ * sysdeps/sh/sh4/fpu/fpu_control.h: Add C++ __set_fpscr prototype.
+ * sysdeps/unix/sysv/linux/sh/Versions (GLIBC_2.2): Add __fpscr_values.
+ * sysdeps/unix/sysv/linux/sh/sysdep.S (___fpscr_values): New constant.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/unix/sysv/linux/sh/Versions | 1 +
+ sysdeps/unix/sysv/linux/sh/sysdep.S | 11 +++++++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions
+index e0938c4165..ca1d7da339 100644
+--- a/sysdeps/unix/sysv/linux/sh/Versions
++++ b/sysdeps/unix/sysv/linux/sh/Versions
+@@ -2,6 +2,7 @@ libc {
+ GLIBC_2.2 {
+ # functions used in other libraries
+ __xstat64; __fxstat64; __lxstat64;
++ __fpscr_values;
+
+ # a*
+ alphasort64;
+diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S
+index c4e28ffb98..648bae03d5 100644
+--- a/sysdeps/unix/sysv/linux/sh/sysdep.S
++++ b/sysdeps/unix/sysv/linux/sh/sysdep.S
+@@ -30,3 +30,14 @@ ENTRY (__syscall_error)
+
+ #define __syscall_error __syscall_error_1
+ #include <sysdeps/unix/sh/sysdep.S>
++
++ .data
++ .align 3
++ .globl ___fpscr_values
++ .type ___fpscr_values, @object
++ .size ___fpscr_values, 8
++___fpscr_values:
++ .long 0
++ .long 0x80000
++weak_alias (___fpscr_values, __fpscr_values)
++
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch b/external/poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch
new file mode 100644
index 00000000..aa62c635
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch
@@ -0,0 +1,563 @@
+From 4bb23fbb07984b93fd14f353fd9325d927b0cd98 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:33:49 +0000
+Subject: [PATCH] eglibc: Forward port cross locale generation support
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ locale/Makefile | 3 +-
+ locale/catnames.c | 48 ++++++++++++++++++++++++++++
+ locale/localeinfo.h | 2 +-
+ locale/programs/charmap-dir.c | 6 ++++
+ locale/programs/ld-collate.c | 17 +++++-----
+ locale/programs/ld-ctype.c | 27 ++++++++--------
+ locale/programs/ld-time.c | 31 ++++++++++++------
+ locale/programs/linereader.c | 2 +-
+ locale/programs/localedef.c | 8 +++++
+ locale/programs/locfile.c | 5 ++-
+ locale/programs/locfile.h | 59 +++++++++++++++++++++++++++++++++--
+ locale/setlocale.c | 30 ------------------
+ 12 files changed, 169 insertions(+), 69 deletions(-)
+ create mode 100644 locale/catnames.c
+
+diff --git a/locale/Makefile b/locale/Makefile
+index fd9972279b..176b3946de 100644
+--- a/locale/Makefile
++++ b/locale/Makefile
+@@ -26,7 +26,8 @@ headers = langinfo.h locale.h bits/locale.h \
+ bits/types/locale_t.h bits/types/__locale_t.h
+ routines = setlocale findlocale loadlocale loadarchive \
+ localeconv nl_langinfo nl_langinfo_l mb_cur_max \
+- newlocale duplocale freelocale uselocale
++ newlocale duplocale freelocale uselocale \
++ catnames
+ tests = tst-C-locale tst-locname tst-duplocale
+ categories = ctype messages monetary numeric time paper name \
+ address telephone measurement identification collate
+diff --git a/locale/catnames.c b/locale/catnames.c
+new file mode 100644
+index 0000000000..9fad357db1
+--- /dev/null
++++ b/locale/catnames.c
+@@ -0,0 +1,48 @@
++/* Copyright (C) 2006 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include "localeinfo.h"
++
++/* Define an array of category names (also the environment variable names). */
++const union catnamestr_t _nl_category_names attribute_hidden =
++ {
++ {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++ category_name,
++#include "categories.def"
++#undef DEFINE_CATEGORY
++ }
++ };
++
++const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden =
++ {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++ [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)),
++#include "categories.def"
++#undef DEFINE_CATEGORY
++ };
++
++/* An array of their lengths, for convenience. */
++const uint8_t _nl_category_name_sizes[] attribute_hidden =
++ {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++ [category] = sizeof (category_name) - 1,
++#include "categories.def"
++#undef DEFINE_CATEGORY
++ [LC_ALL] = sizeof ("LC_ALL") - 1
++ };
+diff --git a/locale/localeinfo.h b/locale/localeinfo.h
+index 537bc35149..73ba20d695 100644
+--- a/locale/localeinfo.h
++++ b/locale/localeinfo.h
+@@ -224,7 +224,7 @@ __libc_tsd_define (extern, locale_t, LOCALE)
+ unused. We can manage this playing some tricks with weak references.
+ But with thread-local locale settings, it becomes quite ungainly unless
+ we can use __thread variables. So only in that case do we attempt this. */
+-#ifndef SHARED
++#if !defined SHARED && !defined IN_GLIBC_LOCALEDEF
+ # include <tls.h>
+ # define NL_CURRENT_INDIRECT 1
+ #endif
+diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c
+index 34a8d32c92..cbb9436cd1 100644
+--- a/locale/programs/charmap-dir.c
++++ b/locale/programs/charmap-dir.c
+@@ -18,7 +18,9 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <libintl.h>
++#ifndef NO_UNCOMPRESS
+ #include <spawn.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -154,6 +156,7 @@ charmap_closedir (CHARMAP_DIR *cdir)
+ return closedir (dir);
+ }
+
++#ifndef NO_UNCOMPRESS
+ /* Creates a subprocess decompressing the given pathname, and returns
+ a stream reading its output (the decompressed data). */
+ static
+@@ -202,6 +205,7 @@ fopen_uncompressed (const char *pathname, const char *compressor)
+ }
+ return NULL;
+ }
++#endif
+
+ /* Opens a charmap for reading, given its name (not an alias name). */
+ FILE *
+@@ -224,6 +228,7 @@ charmap_open (const char *directory, const char *name)
+ if (stream != NULL)
+ return stream;
+
++#ifndef NO_UNCOMPRESS
+ memcpy (p, ".gz", 4);
+ stream = fopen_uncompressed (pathname, "gzip");
+ if (stream != NULL)
+@@ -233,6 +238,7 @@ charmap_open (const char *directory, const char *name)
+ stream = fopen_uncompressed (pathname, "bzip2");
+ if (stream != NULL)
+ return stream;
++#endif
+
+ return NULL;
+ }
+diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
+index d2eebcfdbb..c3718d6589 100644
+--- a/locale/programs/ld-collate.c
++++ b/locale/programs/ld-collate.c
+@@ -349,7 +349,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen,
+ }
+ if (wcs != NULL)
+ {
+- size_t nwcs = wcslen ((wchar_t *) wcs);
++ size_t nwcs = wcslen_uint32 (wcs);
+ uint32_t zero = 0;
+ /* Handle <U0000> as a single character. */
+ if (nwcs == 0)
+@@ -1772,8 +1772,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name);
+
+ if ((*eptr)->nwcs == runp->nwcs)
+ {
+- int c = wmemcmp ((wchar_t *) (*eptr)->wcs,
+- (wchar_t *) runp->wcs, runp->nwcs);
++ int c = wmemcmp_uint32 ((*eptr)->wcs, runp->wcs, runp->nwcs);
+
+ if (c == 0)
+ {
+@@ -2000,9 +1999,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
+ one consecutive entry. */
+ if (runp->wcnext != NULL
+ && runp->nwcs == runp->wcnext->nwcs
+- && wmemcmp ((wchar_t *) runp->wcs,
+- (wchar_t *)runp->wcnext->wcs,
+- runp->nwcs - 1) == 0
++ && wmemcmp_uint32 (runp->wcs,
++ runp->wcnext->wcs,
++ runp->nwcs - 1) == 0
+ && (runp->wcs[runp->nwcs - 1]
+ == runp->wcnext->wcs[runp->nwcs - 1] + 1))
+ {
+@@ -2026,9 +2025,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
+ runp = runp->wcnext;
+ while (runp->wcnext != NULL
+ && runp->nwcs == runp->wcnext->nwcs
+- && wmemcmp ((wchar_t *) runp->wcs,
+- (wchar_t *)runp->wcnext->wcs,
+- runp->nwcs - 1) == 0
++ && wmemcmp_uint32 (runp->wcs,
++ runp->wcnext->wcs,
++ runp->nwcs - 1) == 0
+ && (runp->wcs[runp->nwcs - 1]
+ == runp->wcnext->wcs[runp->nwcs - 1] + 1));
+
+diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
+index f791e6b7e9..d809d6db7f 100644
+--- a/locale/programs/ld-ctype.c
++++ b/locale/programs/ld-ctype.c
+@@ -915,7 +915,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap,
+ allocate_arrays (ctype, charmap, ctype->repertoire);
+
+ default_missing_len = (ctype->default_missing
+- ? wcslen ((wchar_t *) ctype->default_missing)
++ ? wcslen_uint32 (ctype->default_missing)
+ : 0);
+
+ init_locale_data (&file, nelems);
+@@ -1926,7 +1926,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype,
+ ignore = 1;
+ else
+ /* This value is usable. */
+- obstack_grow (ob, to_wstr, wcslen ((wchar_t *) to_wstr) * 4);
++ obstack_grow (ob, to_wstr, wcslen_uint32 (to_wstr) * 4);
+
+ first = 0;
+ }
+@@ -2460,8 +2460,8 @@ with character code range values one must use the absolute ellipsis `...'"));
+ }
+
+ handle_tok_digit:
+- class_bit = _ISwdigit;
+- class256_bit = _ISdigit;
++ class_bit = BITw (tok_digit);
++ class256_bit = BIT (tok_digit);
+ handle_digits = 1;
+ goto read_charclass;
+
+@@ -3901,8 +3901,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
+
+ while (idx < number)
+ {
+- int res = wcscmp ((const wchar_t *) sorted[idx]->from,
+- (const wchar_t *) runp->from);
++ int res = wcscmp_uint32 (sorted[idx]->from, runp->from);
+ if (res == 0)
+ {
+ replace = 1;
+@@ -3939,11 +3938,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
+ for (size_t cnt = 0; cnt < number; ++cnt)
+ {
+ struct translit_to_t *srunp;
+- from_len += wcslen ((const wchar_t *) sorted[cnt]->from) + 1;
++ from_len += wcslen_uint32 (sorted[cnt]->from) + 1;
+ srunp = sorted[cnt]->to;
+ while (srunp != NULL)
+ {
+- to_len += wcslen ((const wchar_t *) srunp->str) + 1;
++ to_len += wcslen_uint32 (srunp->str) + 1;
+ srunp = srunp->next;
+ }
+ /* Plus one for the extra NUL character marking the end of
+@@ -3967,18 +3966,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
+ ctype->translit_from_idx[cnt] = from_len;
+ ctype->translit_to_idx[cnt] = to_len;
+
+- len = wcslen ((const wchar_t *) sorted[cnt]->from) + 1;
+- wmemcpy ((wchar_t *) &ctype->translit_from_tbl[from_len],
+- (const wchar_t *) sorted[cnt]->from, len);
++ len = wcslen_uint32 (sorted[cnt]->from) + 1;
++ wmemcpy_uint32 (&ctype->translit_from_tbl[from_len],
++ sorted[cnt]->from, len);
+ from_len += len;
+
+ ctype->translit_to_idx[cnt] = to_len;
+ srunp = sorted[cnt]->to;
+ while (srunp != NULL)
+ {
+- len = wcslen ((const wchar_t *) srunp->str) + 1;
+- wmemcpy ((wchar_t *) &ctype->translit_to_tbl[to_len],
+- (const wchar_t *) srunp->str, len);
++ len = wcslen_uint32 (srunp->str) + 1;
++ wmemcpy_uint32 (&ctype->translit_to_tbl[to_len],
++ srunp->str, len);
+ to_len += len;
+ srunp = srunp->next;
+ }
+diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
+index a755792363..e8b2f85522 100644
+--- a/locale/programs/ld-time.c
++++ b/locale/programs/ld-time.c
+@@ -220,8 +220,10 @@ No definition for %s category found"), "LC_TIME");
+ }
+ else
+ {
++ static const uint32_t wt_fmt_ampm[]
++ = { '%','I',':','%','M',':','%','S',' ','%','p',0 };
+ time->t_fmt_ampm = "%I:%M:%S %p";
+- time->wt_fmt_ampm = (const uint32_t *) L"%I:%M:%S %p";
++ time->wt_fmt_ampm = wt_fmt_ampm;
+ }
+ }
+
+@@ -231,7 +233,7 @@ No definition for %s category found"), "LC_TIME");
+ const int days_per_month[12] = { 31, 29, 31, 30, 31, 30,
+ 31, 31, 30, 31 ,30, 31 };
+ size_t idx;
+- wchar_t *wstr;
++ uint32_t *wstr;
+
+ time->era_entries =
+ (struct era_data *) xmalloc (time->num_era
+@@ -457,18 +459,18 @@ No definition for %s category found"), "LC_TIME");
+ }
+
+ /* Now generate the wide character name and format. */
+- wstr = wcschr ((wchar_t *) time->wera[idx], L':');/* end direction */
+- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end offset */
+- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end start */
+- wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end end */
++ wstr = wcschr_uint32 (time->wera[idx], L':'); /* end direction */
++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end offset */
++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end start */
++ wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end end */
+ if (wstr != NULL)
+ {
+- time->era_entries[idx].wname = (uint32_t *) wstr + 1;
+- wstr = wcschr (wstr + 1, L':'); /* end name */
++ time->era_entries[idx].wname = wstr + 1;
++ wstr = wcschr_uint32 (wstr + 1, L':'); /* end name */
+ if (wstr != NULL)
+ {
+ *wstr = L'\0';
+- time->era_entries[idx].wformat = (uint32_t *) wstr + 1;
++ time->era_entries[idx].wformat = wstr + 1;
+ }
+ else
+ time->era_entries[idx].wname =
+@@ -527,7 +529,16 @@ No definition for %s category found"), "LC_TIME");
+ if (time->date_fmt == NULL)
+ time->date_fmt = "%a %b %e %H:%M:%S %Z %Y";
+ if (time->wdate_fmt == NULL)
+- time->wdate_fmt = (const uint32_t *) L"%a %b %e %H:%M:%S %Z %Y";
++ {
++ static const uint32_t wdate_fmt[] =
++ { '%','a',' ',
++ '%','b',' ',
++ '%','e',' ',
++ '%','H',':','%','M',':','%','S',' ',
++ '%','Z',' ',
++ '%','Y',0 };
++ time->wdate_fmt = wdate_fmt;
++ }
+ }
+
+
+diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
+index 3525c8a43d..f8a7fd9c24 100644
+--- a/locale/programs/linereader.c
++++ b/locale/programs/linereader.c
+@@ -595,7 +595,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap,
+ {
+ int return_widestr = lr->return_widestr;
+ char *buf;
+- wchar_t *buf2 = NULL;
++ uint32_t *buf2 = NULL;
+ size_t bufact;
+ size_t bufmax = 56;
+
+diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
+index d718d2e9f4..e0a3ad5a83 100644
+--- a/locale/programs/localedef.c
++++ b/locale/programs/localedef.c
+@@ -105,6 +105,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ #define OPT_BIG_ENDIAN 401
+ #define OPT_NO_WARN 402
+ #define OPT_WARN 403
++#define OPT_UINT32_ALIGN 404
+
+ /* Definitions of arguments for argp functions. */
+ static const struct argp_option options[] =
+@@ -147,6 +148,8 @@ static const struct argp_option options[] =
+ N_("Generate little-endian output") },
+ { "big-endian", OPT_BIG_ENDIAN, NULL, 0,
+ N_("Generate big-endian output") },
++ { "uint32-align", OPT_UINT32_ALIGN, "ALIGNMENT", 0,
++ N_("Set the target's uint32_t alignment in bytes (default 4)") },
+ { NULL, 0, NULL, 0, NULL }
+ };
+
+@@ -236,12 +239,14 @@ main (int argc, char *argv[])
+ ctype locale. (P1003.2 4.35.5.2) */
+ setlocale (LC_CTYPE, "POSIX");
+
++#ifndef NO_SYSCONF
+ /* Look whether the system really allows locale definitions. POSIX
+ defines error code 3 for this situation so I think it must be
+ a fatal error (see P1003.2 4.35.8). */
+ if (sysconf (_SC_2_LOCALEDEF) < 0)
+ record_error (3, 0, _("\
+ FATAL: system does not define `_POSIX2_LOCALEDEF'"));
++#endif
+
+ /* Process charmap file. */
+ charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1);
+@@ -389,6 +394,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
+ /* Enable the warnings. */
+ set_warnings (arg, true);
+ break;
++ case OPT_UINT32_ALIGN:
++ uint32_align_mask = strtol (arg, NULL, 0) - 1;
++ break;
+ case 'c':
+ force_output = 1;
+ break;
+diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
+index 32e5f761f2..b41e77bd8d 100644
+--- a/locale/programs/locfile.c
++++ b/locale/programs/locfile.c
+@@ -544,6 +544,9 @@ compare_files (const char *filename1, const char *filename2, size_t size,
+ machine running localedef. */
+ bool swap_endianness_p;
+
++/* The target's value of __align__(uint32_t) - 1. */
++unsigned int uint32_align_mask = 3;
++
+ /* When called outside a start_locale_structure/end_locale_structure
+ or start_locale_prelude/end_locale_prelude block, record that the
+ next byte in FILE's obstack will be the first byte of a new element.
+@@ -621,7 +624,7 @@ add_locale_string (struct locale_file *file, const char *string)
+ void
+ add_locale_wstring (struct locale_file *file, const uint32_t *string)
+ {
+- add_locale_uint32_array (file, string, wcslen ((const wchar_t *) string) + 1);
++ add_locale_uint32_array (file, string, wcslen_uint32 (string) + 1);
+ }
+
+ /* Record that FILE's next element is the 32-bit integer VALUE. */
+diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
+index 89b347c72d..a636fc2960 100644
+--- a/locale/programs/locfile.h
++++ b/locale/programs/locfile.h
+@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions,
+
+ extern bool swap_endianness_p;
+
++extern unsigned int uint32_align_mask;
++
+ /* Change the output to be big-endian if BIG_ENDIAN is true and
+ little-endian otherwise. */
+ static inline void
+@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value)
+ }
+
+ /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */
+-static inline void
++static void
++__attribute__ ((unused))
+ maybe_swap_uint32_array (uint32_t *array, size_t n)
+ {
+ if (swap_endianness_p)
+@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n)
+
+ /* Like maybe_swap_uint32_array, but the array of N elements is at
+ the end of OBSTACK's current object. */
+-static inline void
++static void
++__attribute__ ((unused))
+ maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
+ {
+ maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
+@@ -276,4 +280,55 @@ extern void identification_output (struct localedef_t *locale,
+ const struct charmap_t *charmap,
+ const char *output_path);
+
++static size_t wcslen_uint32 (const uint32_t *str) __attribute__ ((unused));
++static uint32_t * wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
++static uint32_t * wcschr_uint32 (const uint32_t *s, uint32_t ch) __attribute__ ((unused));
++static int wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) __attribute__ ((unused));
++static int wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
++
++static size_t
++wcslen_uint32 (const uint32_t *str)
++{
++ size_t len = 0;
++ while (str[len] != 0)
++ len++;
++ return len;
++}
++
++static int
++wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n)
++{
++ while (n-- != 0)
++ {
++ int diff = *s1++ - *s2++;
++ if (diff != 0)
++ return diff;
++ }
++ return 0;
++}
++
++static int
++wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2)
++{
++ while (*s1 != 0 && *s1 == *s2)
++ s1++, s2++;
++ return *s1 - *s2;
++}
++
++static uint32_t *
++wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n)
++{
++ return memcpy (s1, s2, n * sizeof (uint32_t));
++}
++
++static uint32_t *
++wcschr_uint32 (const uint32_t *s, uint32_t ch)
++{
++ do
++ if (*s == ch)
++ return (uint32_t *) s;
++ while (*s++ != 0);
++ return 0;
++}
++
+ #endif /* locfile.h */
+diff --git a/locale/setlocale.c b/locale/setlocale.c
+index e4de907e1f..b5d8f5c17d 100644
+--- a/locale/setlocale.c
++++ b/locale/setlocale.c
+@@ -64,36 +64,6 @@ static char *const _nl_current_used[] =
+ #endif
+
+
+-/* Define an array of category names (also the environment variable names). */
+-const union catnamestr_t _nl_category_names attribute_hidden =
+- {
+- {
+-#define DEFINE_CATEGORY(category, category_name, items, a) \
+- category_name,
+-#include "categories.def"
+-#undef DEFINE_CATEGORY
+- }
+- };
+-
+-const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden =
+- {
+-#define DEFINE_CATEGORY(category, category_name, items, a) \
+- [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)),
+-#include "categories.def"
+-#undef DEFINE_CATEGORY
+- };
+-
+-/* An array of their lengths, for convenience. */
+-const uint8_t _nl_category_name_sizes[] attribute_hidden =
+- {
+-#define DEFINE_CATEGORY(category, category_name, items, a) \
+- [category] = sizeof (category_name) - 1,
+-#include "categories.def"
+-#undef DEFINE_CATEGORY
+- [LC_ALL] = sizeof ("LC_ALL") - 1
+- };
+-
+-
+ #ifdef NL_CURRENT_INDIRECT
+ # define WEAK_POSTLOAD(postload) weak_extern (postload)
+ #else
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0023-Define-DUMMY_LOCALE_T-if-not-defined.patch b/external/poky/meta/recipes-core/glibc/glibc/0023-Define-DUMMY_LOCALE_T-if-not-defined.patch
new file mode 100644
index 00000000..68fad964
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0023-Define-DUMMY_LOCALE_T-if-not-defined.patch
@@ -0,0 +1,29 @@
+From 1b2ceb6c2414e3c98c7bcd029583287ced9f3159 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 20 Apr 2016 21:11:00 -0700
+Subject: [PATCH] Define DUMMY_LOCALE_T if not defined
+
+This is a hack to fix building the locale bits on an older
+CentOs 5.X machine
+
+Upstream-Status: Inappropriate [other]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ locale/programs/config.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/locale/programs/config.h b/locale/programs/config.h
+index 9956cd8446..04342f3644 100644
+--- a/locale/programs/config.h
++++ b/locale/programs/config.h
+@@ -19,6 +19,9 @@
+ #ifndef _LD_CONFIG_H
+ #define _LD_CONFIG_H 1
+
++#ifndef DUMMY_LOCALE_T
++#define DUMMY_LOCALE_T
++#endif
+ /* Use the internal textdomain used for libc messages. */
+ #define PACKAGE _libc_intl_domainname
+ #ifndef VERSION
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch b/external/poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
new file mode 100644
index 00000000..28cff2b9
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch
@@ -0,0 +1,53 @@
+From a6159c9486745664a5f116ee9cc45837021b7624 Mon Sep 17 00:00:00 2001
+From: Mark Hatle <mark.hatle@windriver.com>
+Date: Thu, 18 Aug 2016 14:07:58 -0500
+Subject: [PATCH] elf/dl-deps.c: Make _dl_build_local_scope breadth first
+
+According to the ELF specification:
+
+When resolving symbolic references, the dynamic linker examines the symbol
+tables with a breadth-first search.
+
+This function was using a depth first search. By doing so the conflict
+resolution reported to the prelinker (when LD_TRACE_PRELINKING=1 is set)
+was incorrect. This caused problems when their were various circular
+dependencies between libraries. The problem usually manifested itself by
+the wrong IFUNC being executed.
+
+[BZ# 20488]
+
+Upstream-Status: Submitted [libc-alpha]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ elf/dl-deps.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/elf/dl-deps.c b/elf/dl-deps.c
+index 9d9b1ba7f2..8414028c58 100644
+--- a/elf/dl-deps.c
++++ b/elf/dl-deps.c
+@@ -73,13 +73,19 @@ _dl_build_local_scope (struct link_map **list, struct link_map *map)
+ {
+ struct link_map **p = list;
+ struct link_map **q;
++ struct link_map **r;
+
+ *p++ = map;
+ map->l_reserved = 1;
+- if (map->l_initfini)
+- for (q = map->l_initfini + 1; *q; ++q)
+- if (! (*q)->l_reserved)
+- p += _dl_build_local_scope (p, *q);
++
++ for (r = list; r < p; ++r)
++ if ((*r)->l_initfini)
++ for (q = (*r)->l_initfini + 1; *q; ++q)
++ if (! (*q)->l_reserved)
++ {
++ *p++ = *q;
++ (*q)->l_reserved = 1;
++ }
+ return p - list;
+ }
+
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0025-locale-fix-hard-coded-reference-to-gcc-E.patch b/external/poky/meta/recipes-core/glibc/glibc/0025-locale-fix-hard-coded-reference-to-gcc-E.patch
new file mode 100644
index 00000000..4a7919ff
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0025-locale-fix-hard-coded-reference-to-gcc-E.patch
@@ -0,0 +1,35 @@
+From 6c6aecba19b3e7947100623532a41b6f16734ace Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= <jeremy.rosen@smile.fr>
+Date: Mon, 22 Aug 2016 16:09:25 +0200
+Subject: [PATCH] locale: fix hard-coded reference to gcc -E
+
+When new version of compilers are published, they may not be compatible with
+older versions of software. This is particularly common when software is built
+with -Werror.
+
+Autotools provides a way for a user to specify the name of his compiler using a
+set of variables ($CC $CXX $CPP etc.). Those variables are used correctly when
+compiling glibc but the script used to generate transliterations in the locale/
+subdirectory directly calls the gcc binary to get the output of the
+preprocessor instead of using the $CPP variable provided by the build
+environment.
+
+This patch replaces the hard-coded reference to the gcc binary with the proper
+environment variable, thus allowing a user to override it.
+
+Upstream-Status: Submitted [https://sourceware.org/ml/libc-alpha/2016-08/msg00746.html]
+---
+ locale/gen-translit.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/locale/gen-translit.pl b/locale/gen-translit.pl
+index 30d3f2f195..e97653017c 100644
+--- a/locale/gen-translit.pl
++++ b/locale/gen-translit.pl
+@@ -1,5 +1,5 @@
+ #!/usr/bin/perl -w
+-open F, "cat C-translit.h.in | gcc -E - |" || die "Cannot preprocess input file";
++open F, 'cat C-translit.h.in | ${CPP:-gcc -E} - |' || die "Cannot preprocess input file";
+
+
+ sub cstrlen {
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch b/external/poky/meta/recipes-core/glibc/glibc/0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch
new file mode 100644
index 00000000..fae8d004
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch
@@ -0,0 +1,66 @@
+From 38fad3e5ab3b45c56810abd35fa11a72fa10b8f1 Mon Sep 17 00:00:00 2001
+From: Pratyush Anand <panand@redhat.com>
+Date: Wed, 22 Mar 2017 17:02:38 +0530
+Subject: [PATCH] bits/siginfo-consts.h: enum definition for TRAP_HWBKPT is
+ missing
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Compile following linux kernel test code with latest glibc:
+
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
+
+and we get following error:
+breakpoint_test_arm64.c: In function ‘run_test’:
+breakpoint_test_arm64.c:171:25: error: ‘TRAP_HWBKPT’ undeclared (first use in this function)
+ if (siginfo.si_code != TRAP_HWBKPT) {
+ ^
+I can compile test code by modifying my local
+/usr/include/bits/siginfo.h and test works great. Therefore, this patch
+will be needed in upstream glibc so that issue is fixed there as well.
+
+Signed-off-by: Pratyush Anand <panand@redhat.com>
+
+Upstream-Status: Submitted [https://sourceware.org/bugzilla/show_bug.cgi?id=21286]
+---
+ bits/siginfo-consts.h | 6 +++++-
+ sysdeps/unix/sysv/linux/bits/siginfo-consts.h | 6 +++++-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/bits/siginfo-consts.h b/bits/siginfo-consts.h
+index 7464c1882b..298314527a 100644
+--- a/bits/siginfo-consts.h
++++ b/bits/siginfo-consts.h
+@@ -106,8 +106,12 @@ enum
+ {
+ TRAP_BRKPT = 1, /* Process breakpoint. */
+ # define TRAP_BRKPT TRAP_BRKPT
+- TRAP_TRACE /* Process trace trap. */
++ TRAP_TRACE, /* Process trace trap. */
+ # define TRAP_TRACE TRAP_TRACE
++ TRAP_BRANCH, /* Process branch trap. */
++# define TRAP_BRANCH TRAP_BRANCH
++ TRAP_HWBKPT /* hardware breakpoint/watchpoint */
++# define TRAP_HWBKPT TRAP_HWBKPT
+ };
+ # endif
+
+diff --git a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
+index 193bd9c471..3fe852bc5f 100644
+--- a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
++++ b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
+@@ -141,8 +141,12 @@ enum
+ {
+ TRAP_BRKPT = 1, /* Process breakpoint. */
+ # define TRAP_BRKPT TRAP_BRKPT
+- TRAP_TRACE /* Process trace trap. */
++ TRAP_TRACE, /* Process trace trap. */
+ # define TRAP_TRACE TRAP_TRACE
++ TRAP_BRANCH, /* Process branch trap. */
++# define TRAP_BRANCH TRAP_BRANCH
++ TRAP_HWBKPT /* hardware breakpoint/watchpoint */
++# define TRAP_HWBKPT TRAP_HWBKPT
+ };
+ # endif
+
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch b/external/poky/meta/recipes-core/glibc/glibc/0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
new file mode 100644
index 00000000..e17f6aa3
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
@@ -0,0 +1,89 @@
+From 865651d2496a90f7ae8e7cc19a2e54b6f17a8ad5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 3 Aug 2018 09:42:06 -0700
+Subject: [PATCH] localedef --add-to-archive uses a hard-coded locale path
+
+it doesn't exist in normal use, and there's no way to pass an
+alternative filename.
+
+Add a fallback of $LOCALEARCHIVE from the environment, and allow
+creation of new locale archives that are not the system archive.
+
+Upstream-Status: Inappropriate (OE-specific)
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ locale/programs/locarchive.c | 37 ++++++++++++++++++++++++++----------
+ 1 file changed, 27 insertions(+), 10 deletions(-)
+
+diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
+index ca332a345f..91f62da662 100644
+--- a/locale/programs/locarchive.c
++++ b/locale/programs/locarchive.c
+@@ -340,12 +340,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
+ struct namehashent *oldnamehashtab;
+ struct locarhandle new_ah;
+ size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
+- char archivefname[prefix_len + sizeof (ARCHIVE_NAME)];
+- char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1];
++ char *archivefname;
++ char *fname;
++ char *envarchive = getenv("LOCALEARCHIVE");
+
+- if (output_prefix)
+- memcpy (archivefname, output_prefix, prefix_len);
+- strcpy (archivefname + prefix_len, ARCHIVE_NAME);
++ if (envarchive != NULL)
++ {
++ archivefname = xmalloc(strlen(envarchive) + 1);
++ fname = xmalloc(strlen(envarchive) + sizeof (".XXXXXX"));
++ strcpy (archivefname, envarchive);
++ }
++ else
++ {
++ archivefname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME));
++ fname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1);
++ if (output_prefix)
++ memcpy (archivefname, output_prefix, prefix_len);
++ strcpy (archivefname + prefix_len, ARCHIVE_NAME);
++ }
+ strcpy (stpcpy (fname, archivefname), ".XXXXXX");
+
+ /* Not all of the old file has to be mapped. Change this now this
+@@ -551,6 +563,8 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
+
+ /* Add the information for the new one. */
+ *ah = new_ah;
++ free(archivefname);
++ free(fname);
+ }
+
+
+@@ -569,10 +583,13 @@ open_archive (struct locarhandle *ah, bool readonly)
+ /* If ah has a non-NULL fname open that otherwise open the default. */
+ if (archivefname == NULL)
+ {
+- archivefname = default_fname;
+- if (output_prefix)
+- memcpy (default_fname, output_prefix, prefix_len);
+- strcpy (default_fname + prefix_len, ARCHIVE_NAME);
++ archivefname = getenv("LOCALEARCHIVE");
++ if (archivefname == NULL) {
++ archivefname = default_fname;
++ if (output_prefix)
++ memcpy (default_fname, output_prefix, prefix_len);
++ strcpy (default_fname + prefix_len, ARCHIVE_NAME);
++ }
+ }
+
+ while (1)
+@@ -585,7 +602,7 @@ open_archive (struct locarhandle *ah, bool readonly)
+ the default locale archive we ignore the failure and
+ list an empty archive, otherwise we print an error
+ and exit. */
+- if (errno == ENOENT && archivefname == default_fname)
++ if (errno == ENOENT)
+ {
+ if (readonly)
+ {
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0030-intl-Emit-no-lines-in-bison-generated-files.patch b/external/poky/meta/recipes-core/glibc/glibc/0030-intl-Emit-no-lines-in-bison-generated-files.patch
new file mode 100644
index 00000000..db97d91c
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0030-intl-Emit-no-lines-in-bison-generated-files.patch
@@ -0,0 +1,31 @@
+From a54c15d0567d547137066f41b1b22eba4875c27b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 3 Aug 2018 09:44:00 -0700
+Subject: [PATCH] intl: Emit no lines in bison generated files
+
+Improve reproducibility:
+Do not put any #line preprocessor commands in bison generated files.
+These lines contain absolute paths containing file locations on
+the host build machine.
+
+Upstream-Status: Pending
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ intl/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/intl/Makefile b/intl/Makefile
+index 672edf1b38..d31888d013 100644
+--- a/intl/Makefile
++++ b/intl/Makefile
+@@ -155,7 +155,7 @@ $(objpfx)tst-gettext6.out: $(objpfx)tst-gettext.out
+
+ CPPFLAGS += -D'LOCALEDIR="$(localedir)"' \
+ -D'LOCALE_ALIAS_PATH="$(localedir)"'
+-BISONFLAGS = --yacc --name-prefix=__gettext --output
++BISONFLAGS = --yacc --no-lines --name-prefix=__gettext --output
+
+ $(inst_localedir)/locale.alias: locale.alias $(+force)
+ $(do-install)
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch b/external/poky/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch
new file mode 100644
index 00000000..61f55d4f
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch
@@ -0,0 +1,258 @@
+From 546b46c309a52ed74dc906114b1e984bb9703d74 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 14 Sep 2018 23:23:03 +0000
+Subject: [PATCH] sysdeps/ieee754: prevent maybe-uninitialized errors with -O
+ [BZ #19444]
+
+With -O included in CFLAGS it fails to build with:
+
+../sysdeps/ieee754/ldbl-96/e_jnl.c: In function '__ieee754_jnl':
+../sysdeps/ieee754/ldbl-96/e_jnl.c:146:20: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ b = invsqrtpi * temp / sqrtl (x);
+ ~~~~~~~~~~^~~~~~
+../sysdeps/ieee754/ldbl-96/e_jnl.c: In function '__ieee754_ynl':
+../sysdeps/ieee754/ldbl-96/e_jnl.c:375:16: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ b = invsqrtpi * temp / sqrtl (x);
+ ~~~~~~~~~~^~~~~~
+../sysdeps/ieee754/dbl-64/e_jn.c: In function '__ieee754_jn':
+../sysdeps/ieee754/dbl-64/e_jn.c:113:20: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ b = invsqrtpi * temp / sqrt (x);
+ ~~~~~~~~~~^~~~~~
+../sysdeps/ieee754/dbl-64/e_jn.c: In function '__ieee754_yn':
+../sysdeps/ieee754/dbl-64/e_jn.c:320:16: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ b = invsqrtpi * temp / sqrt (x);
+ ~~~~~~~~~~^~~~~~
+
+Build tested with Yocto for ARM, AARCH64, X86, X86_64, PPC, MIPS, MIPS64
+with -O, -O1, -Os.
+For soft-fp ARM it needs one more fix for -O1:
+https://sourceware.org/ml/libc-alpha/2018-09/msg00300.html
+For AARCH64 it needs one more fix in locale for -Os.
+
+ [BZ #23716]
+ * sysdeps/ieee754/dbl-96/e_jnl.c: Fix build with -O
+ * sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
+ * sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Likewise.
+
+Work around the issue instead of removing -O like we do with
+SELECTED_OPTIMIZATION
+
+Upstream-Status: Submitted [https://www.sourceware.org/ml/libc-alpha/2018-09/msg00299.html]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ ChangeLog | 7 +++++++
+ sysdeps/ieee754/dbl-64/e_jn.c | 21 +++++++++++++++++++++
+ sysdeps/ieee754/ldbl-128/e_jnl.c | 21 +++++++++++++++++++++
+ sysdeps/ieee754/ldbl-128ibm/e_jnl.c | 21 +++++++++++++++++++++
+ sysdeps/ieee754/ldbl-96/e_jnl.c | 21 +++++++++++++++++++++
+ 5 files changed, 91 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index 11a9b8d98e..922e916f2c 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2018-09-29 Martin Jansa <Martin.Jansa@gmail.com>
++ Partial fix for [BZ #23716]
++ * sysdeps/ieee754/dbl-96/e_jnl.c: Fix build with -O
++ * sysdeps/ieee754/ldbl-96/e_jnl.c: Likewise.
++ * sysdeps/ieee754/ldbl-128/e_jnl.c: Likewise.
++ * sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Likewise.
++
+ 2018-09-28 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #23579]
+diff --git a/sysdeps/ieee754/dbl-64/e_jn.c b/sysdeps/ieee754/dbl-64/e_jn.c
+index 9181b22bb8..9ff52c737f 100644
+--- a/sysdeps/ieee754/dbl-64/e_jn.c
++++ b/sysdeps/ieee754/dbl-64/e_jn.c
+@@ -42,6 +42,7 @@
+ #include <math-narrow-eval.h>
+ #include <math_private.h>
+ #include <math-underflow.h>
++#include <libc-diag.h>
+
+ static const double
+ invsqrtpi = 5.64189583547756279280e-01, /* 0x3FE20DD7, 0x50429B6D */
+@@ -109,7 +110,17 @@ __ieee754_jn (int n, double x)
+ case 2: temp = -c - s; break;
+ case 3: temp = c - s; break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrt (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+@@ -316,7 +327,17 @@ __ieee754_yn (int n, double x)
+ case 2: temp = -s + c; break;
+ case 3: temp = s + c; break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrt (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+diff --git a/sysdeps/ieee754/ldbl-128/e_jnl.c b/sysdeps/ieee754/ldbl-128/e_jnl.c
+index 7739eec291..8706a11575 100644
+--- a/sysdeps/ieee754/ldbl-128/e_jnl.c
++++ b/sysdeps/ieee754/ldbl-128/e_jnl.c
+@@ -61,6 +61,7 @@
+ #include <math.h>
+ #include <math_private.h>
+ #include <math-underflow.h>
++#include <libc-diag.h>
+
+ static const _Float128
+ invsqrtpi = L(5.6418958354775628694807945156077258584405E-1),
+@@ -150,7 +151,17 @@ __ieee754_jnl (int n, _Float128 x)
+ temp = c - s;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+@@ -386,7 +397,17 @@ __ieee754_ynl (int n, _Float128 x)
+ temp = s + c;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+diff --git a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+index 71b3addfba..3226d02309 100644
+--- a/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
++++ b/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
+@@ -61,6 +61,7 @@
+ #include <math.h>
+ #include <math_private.h>
+ #include <math-underflow.h>
++#include <libc-diag.h>
+
+ static const long double
+ invsqrtpi = 5.6418958354775628694807945156077258584405E-1L,
+@@ -150,7 +151,17 @@ __ieee754_jnl (int n, long double x)
+ temp = c - s;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+@@ -386,7 +397,17 @@ __ieee754_ynl (int n, long double x)
+ temp = s + c;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+diff --git a/sysdeps/ieee754/ldbl-96/e_jnl.c b/sysdeps/ieee754/ldbl-96/e_jnl.c
+index 394921f564..da5c2cc93e 100644
+--- a/sysdeps/ieee754/ldbl-96/e_jnl.c
++++ b/sysdeps/ieee754/ldbl-96/e_jnl.c
+@@ -61,6 +61,7 @@
+ #include <math.h>
+ #include <math_private.h>
+ #include <math-underflow.h>
++#include <libc-diag.h>
+
+ static const long double
+ invsqrtpi = 5.64189583547756286948079e-1L, two = 2.0e0L, one = 1.0e0L;
+@@ -143,7 +144,17 @@ __ieee754_jnl (int n, long double x)
+ temp = c - s;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
+@@ -372,7 +383,17 @@ __ieee754_ynl (int n, long double x)
+ temp = s + c;
+ break;
+ }
++ /* With GCC 8 (and older) when compiling with -O the compiler
++ warns that the variable 'temp', may be used uninitialized.
++ The switch above covers all possible values of n & 3
++ but GCC without VRP enabled isn't able to figure out the
++ range of possible values is [0,3] as explained in:
++ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69230
++ so it's false possitive with -O1 and lower. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ b = invsqrtpi * temp / sqrtl (x);
++ DIAG_POP_NEEDS_COMMENT;
+ }
+ else
+ {
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch b/external/poky/meta/recipes-core/glibc/glibc/0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch
new file mode 100644
index 00000000..99cd2509
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch
@@ -0,0 +1,100 @@
+From 618668540e263c09b0eb28131dde7b4500158fd4 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sun, 16 Sep 2018 12:39:22 +0000
+Subject: [PATCH] sysdeps/ieee754/soft-fp: ignore maybe-uninitialized with -O
+ [BZ #19444]
+
+* with -O, -O1, -Os it fails with:
+
+In file included from ../soft-fp/soft-fp.h:318,
+ from ../sysdeps/ieee754/soft-fp/s_fdiv.c:28:
+../sysdeps/ieee754/soft-fp/s_fdiv.c: In function '__fdiv':
+../soft-fp/op-2.h:98:25: error: 'R_f1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) \
+ ^~
+../sysdeps/ieee754/soft-fp/s_fdiv.c:38:14: note: 'R_f1' was declared here
+ FP_DECL_D (R);
+ ^
+../soft-fp/op-2.h:37:36: note: in definition of macro '_FP_FRAC_DECL_2'
+ _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT
+ ^
+../soft-fp/double.h:95:24: note: in expansion of macro '_FP_DECL'
+ # define FP_DECL_D(X) _FP_DECL (2, X)
+ ^~~~~~~~
+../sysdeps/ieee754/soft-fp/s_fdiv.c:38:3: note: in expansion of macro 'FP_DECL_D'
+ FP_DECL_D (R);
+ ^~~~~~~~~
+../soft-fp/op-2.h:101:17: error: 'R_f0' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+ : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \
+ ^~
+../sysdeps/ieee754/soft-fp/s_fdiv.c:38:14: note: 'R_f0' was declared here
+ FP_DECL_D (R);
+ ^
+../soft-fp/op-2.h:37:14: note: in definition of macro '_FP_FRAC_DECL_2'
+ _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT
+ ^
+../soft-fp/double.h:95:24: note: in expansion of macro '_FP_DECL'
+ # define FP_DECL_D(X) _FP_DECL (2, X)
+ ^~~~~~~~
+../sysdeps/ieee754/soft-fp/s_fdiv.c:38:3: note: in expansion of macro 'FP_DECL_D'
+ FP_DECL_D (R);
+ ^~~~~~~~~
+
+Build tested with Yocto for ARM, AARCH64, X86, X86_64, PPC, MIPS, MIPS64
+with -O, -O1, -Os.
+For AARCH64 it needs one more fix in locale for -Os.
+
+ Partial fix for [BZ #23716]
+ * sysdeps/ieee754/soft-fp/s_fdiv.c: Fix build with -O
+
+Work around the issue instead of removing -O like we do with
+SELECTED_OPTIMIZATION
+
+Upstream-Status: Submitted [https://www.sourceware.org/ml/libc-alpha/2018-09/msg00300.html]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ ChangeLog | 4 ++++
+ sysdeps/ieee754/soft-fp/s_fdiv.c | 12 ++++++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index 922e916f2c..216336edc9 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++2018-09-30 Martin Jansa <Martin.Jansa@gmail.com>
++ Partial fix for [BZ #23716]
++ * sysdeps/ieee754/soft-fp/s_fdiv.c: Fix build with -O.
++
+ 2018-09-29 Martin Jansa <Martin.Jansa@gmail.com>
+ Partial fix for [BZ #23716]
+ * sysdeps/ieee754/dbl-96/e_jnl.c: Fix build with -O
+diff --git a/sysdeps/ieee754/soft-fp/s_fdiv.c b/sysdeps/ieee754/soft-fp/s_fdiv.c
+index 341339f5ed..14655b77da 100644
+--- a/sysdeps/ieee754/soft-fp/s_fdiv.c
++++ b/sysdeps/ieee754/soft-fp/s_fdiv.c
+@@ -25,6 +25,16 @@
+ #undef fdivl
+
+ #include <math-narrow.h>
++
++#include <libc-diag.h>
++/* R_f[01] are not set in cases where it is not used in packing, but the
++ compiler does not see that it is set in all cases where it is
++ used, resulting in warnings that it may be used uninitialized.
++ The location of the warning differs in different versions of GCC,
++ it may be where R is defined using a macro or it may be where the
++ macro is defined. */
++DIAG_PUSH_NEEDS_COMMENT;
++DIAG_IGNORE_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ #include <soft-fp.h>
+ #include <single.h>
+ #include <double.h>
+@@ -53,4 +63,6 @@ __fdiv (double x, double y)
+ CHECK_NARROW_DIV (ret, x, y);
+ return ret;
+ }
++DIAG_POP_NEEDS_COMMENT;
++
+ libm_alias_float_double (div)
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch b/external/poky/meta/recipes-core/glibc/glibc/0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch
new file mode 100644
index 00000000..31058ca9
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch
@@ -0,0 +1,68 @@
+From cbada1a1b218c1ef61d0eb4363fad7598e6509d6 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sun, 30 Sep 2018 09:16:48 +0000
+Subject: [PATCH] locale: prevent maybe-uninitialized errors with -Os [BZ
+ #19444]
+
+Fixes following error when building for aarch64 with -Os:
+| In file included from strcoll_l.c:43:
+| strcoll_l.c: In function '__strcoll_l':
+| ../locale/weight.h:31:26: error: 'seq2.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+| int_fast32_t i = table[*(*cpp)++];
+| ^~~~~~~~~
+| strcoll_l.c:304:18: note: 'seq2.back_us' was declared here
+| coll_seq seq1, seq2;
+| ^~~~
+| In file included from strcoll_l.c:43:
+| ../locale/weight.h:31:26: error: 'seq1.back_us' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+| int_fast32_t i = table[*(*cpp)++];
+| ^~~~~~~~~
+| strcoll_l.c:304:12: note: 'seq1.back_us' was declared here
+| coll_seq seq1, seq2;
+| ^~~~
+
+ Partial fix for [BZ #23716]
+ * locale/weight.h: Fix build with -Os.
+
+Work around the issue instead of removing -O like we do with
+SELECTED_OPTIMIZATION
+
+Upstream-Status: Submitted [https://www.sourceware.org/ml/libc-alpha/2018-09/msg00539.html]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ ChangeLog | 4 ++++
+ locale/weight.h | 7 +++++++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index 216336edc9..84fbbf47ed 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++2018-09-30 Martin Jansa <Martin.Jansa@gmail.com>
++ Partial fix for [BZ #23716]
++ * locale/weight.h: Fix build with -Os.
++
+ 2018-09-30 Martin Jansa <Martin.Jansa@gmail.com>
+ Partial fix for [BZ #23716]
+ * sysdeps/ieee754/soft-fp/s_fdiv.c: Fix build with -O.
+diff --git a/locale/weight.h b/locale/weight.h
+index 6028d3595e..10bcea25e5 100644
+--- a/locale/weight.h
++++ b/locale/weight.h
+@@ -28,7 +28,14 @@ findidx (const int32_t *table,
+ const unsigned char *extra,
+ const unsigned char **cpp, size_t len)
+ {
++ /* With GCC 8 when compiling with -Os the compiler warns that
++ seq1.back_us and seq2.back_us might be used uninitialized.
++ This uninitialized use is impossible for the same reason
++ as described in comments in locale/weightwc.h. */
++ DIAG_PUSH_NEEDS_COMMENT;
++ DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wmaybe-uninitialized");
+ int_fast32_t i = table[*(*cpp)++];
++ DIAG_POP_NEEDS_COMMENT;
+ const unsigned char *cp;
+ const unsigned char *usrc;
+
diff --git a/external/poky/meta/recipes-core/glibc/glibc/0034-inject-file-assembly-directives.patch b/external/poky/meta/recipes-core/glibc/glibc/0034-inject-file-assembly-directives.patch
new file mode 100644
index 00000000..55eba2d4
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/0034-inject-file-assembly-directives.patch
@@ -0,0 +1,272 @@
+Currently, non-IA builds are not reproducibile since build paths are
+being injected into the debug symbols. These are coming from the use of
+.S assembler files during the glibc build. No STT_FILE section is added
+during the assembly but when linking, ld decides to add one to aid
+debugging and ensure references between the different object files its
+linking remain clear.
+
+We can avoid this by injecting a file header into the assembler files
+ahead of time, choosing a filename which does not contain build system
+paths.
+
+This is a bit of a workaround/hack but does significantly reduce the
+build system references in target binaries for the non-IA architectures
+which use .S files.
+
+RP
+2018/10/3
+
+Upstream-Status: Pending
+
+diff --git a/csu/abi-note.S b/csu/abi-note.S
+index 5d0ca7803d..8ce41581b1 100644
+--- a/csu/abi-note.S
++++ b/csu/abi-note.S
+@@ -56,6 +56,8 @@ offset length contents
+ #include <config.h>
+ #include <abi-tag.h> /* OS-specific ABI tag value */
+
++ .file "abi-note.S"
++
+ /* The linker (GNU ld 2.8 and later) recognizes an allocated section whose
+ name begins with `.note' and creates a PT_NOTE program header entry
+ pointing at it. */
+diff --git a/sysdeps/aarch64/crti.S b/sysdeps/aarch64/crti.S
+index 2b213758b2..736f33e314 100644
+--- a/sysdeps/aarch64/crti.S
++++ b/sysdeps/aarch64/crti.S
+@@ -50,6 +50,8 @@
+ # define PREINIT_FUNCTION_WEAK 1
+ #endif
+
++ .file "crti.S"
++
+ #if PREINIT_FUNCTION_WEAK
+ weak_extern (PREINIT_FUNCTION)
+ #else
+diff --git a/sysdeps/aarch64/crtn.S b/sysdeps/aarch64/crtn.S
+index d72300af80..cb249bf3ca 100644
+--- a/sysdeps/aarch64/crtn.S
++++ b/sysdeps/aarch64/crtn.S
+@@ -37,6 +37,8 @@
+ /* crtn.S puts function epilogues in the .init and .fini sections
+ corresponding to the prologues in crti.S. */
+
++ .file "crtn.S"
++
+ .section .init,"ax",%progbits
+ ldp x29, x30, [sp], 16
+ RET
+diff --git a/sysdeps/aarch64/start.S b/sysdeps/aarch64/start.S
+index bad000f555..5957c028cd 100644
+--- a/sysdeps/aarch64/start.S
++++ b/sysdeps/aarch64/start.S
+@@ -18,6 +18,8 @@
+
+ #include <sysdep.h>
+
++ .file "start.S"
++
+ /* This is the canonical entry point, usually the first thing in the text
+ segment.
+
+diff --git a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
+index 92fc0191a5..715bfcb9e4 100644
+--- a/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
++++ b/sysdeps/unix/sysv/linux/aarch64/__read_tp.S
+@@ -18,6 +18,8 @@
+
+ #include <sysdep.h>
+
++ .file "__read_tp.S"
++
+ .hidden __read_tp
+ ENTRY (__read_tp)
+ mrs x0, tpidr_el0
+diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
+index 43a62ef307..42f85cdde9 100644
+--- a/sysdeps/aarch64/dl-tlsdesc.S
++++ b/sysdeps/aarch64/dl-tlsdesc.S
+@@ -22,6 +22,8 @@
+ #include <tls.h>
+ #include "tlsdesc.h"
+
++ .file "dl-tlsdesc.S"
++
+ #define NSAVEDQREGPAIRS 16
+ #define SAVE_Q_REGISTERS \
+ stp q0, q1, [sp, #-32*NSAVEDQREGPAIRS]!; \
+diff --git a/sysdeps/aarch64/dl-trampoline.S b/sysdeps/aarch64/dl-trampoline.S
+index a86d0722d4..92edab1d01 100644
+--- a/sysdeps/aarch64/dl-trampoline.S
++++ b/sysdeps/aarch64/dl-trampoline.S
+@@ -21,6 +21,8 @@
+
+ #include "dl-link.h"
+
++ .file "dl-trampoline.S"
++
+ #define ip0 x16
+ #define ip0l PTR_REG (16)
+ #define ip1 x17
+diff --git a/sysdeps/arm/abi-note.S b/sysdeps/arm/abi-note.S
+index 07bd4c4619..7213b16f27 100644
+--- a/sysdeps/arm/abi-note.S
++++ b/sysdeps/arm/abi-note.S
+@@ -1,3 +1,5 @@
++ .file "abi-note.S"
++
+ /* Tag_ABI_align8_preserved: This code preserves 8-byte
+ alignment in any callee. */
+ .eabi_attribute 25, 1
+diff --git a/sysdeps/arm/crti.S b/sysdeps/arm/crti.S
+index a1424d0333..bca1dab256 100644
+--- a/sysdeps/arm/crti.S
++++ b/sysdeps/arm/crti.S
+@@ -57,6 +57,8 @@
+ .hidden PREINIT_FUNCTION
+ #endif
+
++ .file "crti.S"
++
+ #if PREINIT_FUNCTION_WEAK
+ .p2align 2
+ .type call_weak_fn, %function
+diff --git a/sysdeps/arm/crtn.S b/sysdeps/arm/crtn.S
+index 26027693ce..65a0502826 100644
+--- a/sysdeps/arm/crtn.S
++++ b/sysdeps/arm/crtn.S
+@@ -37,6 +37,8 @@
+ #define NO_THUMB
+ #include <sysdep.h>
+
++ .file "crtn.S"
++
+ /* crtn.S puts function epilogues in the .init and .fini sections
+ corresponding to the prologues in crti.S. */
+
+diff --git a/sysdeps/arm/dl-tlsdesc.S b/sysdeps/arm/dl-tlsdesc.S
+index 056e17d52d..a98c68dfb9 100644
+--- a/sysdeps/arm/dl-tlsdesc.S
++++ b/sysdeps/arm/dl-tlsdesc.S
+@@ -21,6 +21,8 @@
+ #include <tls.h>
+ #include "tlsdesc.h"
+
++ .file "dl-tlsdesc.S"
++
+ .text
+ @ emit debug information with cfi
+ @ use arm-specific pseudos for unwinding itself
+diff --git a/sysdeps/arm/dl-trampoline.S b/sysdeps/arm/dl-trampoline.S
+index c731b01286..4b37b25344 100644
+--- a/sysdeps/arm/dl-trampoline.S
++++ b/sysdeps/arm/dl-trampoline.S
+@@ -21,6 +21,8 @@
+ #include <sysdep.h>
+ #include <libc-symbols.h>
+
++ .file "dl-trampoline.S"
++
+ .text
+ .globl _dl_runtime_resolve
+ .type _dl_runtime_resolve, #function
+diff --git a/sysdeps/arm/start.S b/sysdeps/arm/start.S
+index adef090717..d22e4128e0 100644
+--- a/sysdeps/arm/start.S
++++ b/sysdeps/arm/start.S
+@@ -57,6 +57,8 @@
+ NULL
+ */
+
++ .file "start.S"
++
+ /* Tag_ABI_align8_preserved: This code preserves 8-byte
+ alignment in any callee. */
+ .eabi_attribute 25, 1
+diff --git a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
+index 871702317a..20a942dbac 100644
+--- a/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
++++ b/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
+@@ -39,6 +39,8 @@
+ a normal function call) in a high page of memory; tail call to the
+ helper. */
+
++ .file "aeabi_read_tp.S"
++
+ .hidden __aeabi_read_tp
+ ENTRY (__aeabi_read_tp)
+ #ifdef ARCH_HAS_HARD_TP
+diff --git a/sysdeps/mips/start.S b/sysdeps/mips/start.S
+index a4c4ef0fae..d00fff31a8 100644
+--- a/sysdeps/mips/start.S
++++ b/sysdeps/mips/start.S
+@@ -38,6 +38,8 @@
+ #include <sgidefs.h>
+ #include <sys/asm.h>
+
++ .file "start.S"
++
+ #ifndef ENTRY_POINT
+ #error ENTRY_POINT needs to be defined for start.S on MIPS/ELF.
+ #endif
+diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S
+index eeb96544e3..da182b28f8 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S
++++ b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S
+@@ -1 +1,3 @@
++ .file "dl-brk.S"
++
+ #include <brk.S>
+diff --git a/sysdeps/powerpc/powerpc32/start.S b/sysdeps/powerpc/powerpc32/start.S
+index 5c10a22f8a..2b52627f27 100644
+--- a/sysdeps/powerpc/powerpc32/start.S
++++ b/sysdeps/powerpc/powerpc32/start.S
+@@ -35,6 +35,8 @@
+
+ #include <sysdep.h>
+
++ .file "start.S"
++
+ /* We do not want .eh_frame info for crt1.o since crt1.o is linked
+ before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */
+ #undef cfi_startproc
+diff --git a/sysdeps/powerpc/powerpc64/start.S b/sysdeps/powerpc/powerpc64/start.S
+index bd7189310c..2e22b8472d 100644
+--- a/sysdeps/powerpc/powerpc64/start.S
++++ b/sysdeps/powerpc/powerpc64/start.S
+@@ -35,6 +35,8 @@
+
+ #include <sysdep.h>
+
++ .file "start.S"
++
+ /* We do not want .eh_frame info for crt1.o since crt1.o is linked
+ before crtbegin.o, the file defining __EH_FRAME_BEGIN__. */
+ #undef cfi_startproc
+diff --git a/sysdeps/powerpc/powerpc32/dl-start.S b/sysdeps/powerpc/powerpc32/dl-start.S
+index 244d87fb6d..14d3e2ce14 100644
+--- a/sysdeps/powerpc/powerpc32/dl-start.S
++++ b/sysdeps/powerpc/powerpc32/dl-start.S
+@@ -18,6 +18,8 @@
+
+ #include <sysdep.h>
+
++ .file "dl-start.S"
++
+ /* Initial entry point code for the dynamic linker.
+ The C function `_dl_start' is the real entry point;
+ its return value is the user program's entry point. */
+diff --git a/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S b/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S
+index d26ad1f8d3..a0de10bf81 100644
+--- a/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S
++++ b/sysdeps/unix/sysv/linux/arm/libc-do-syscall.S
+@@ -27,6 +27,8 @@
+ ARM unwind tables for register to register moves, the actual opcodes
+ are not defined. */
+
++ .file "libc-do-syscall.S"
++
+ #if defined(__thumb__)
+ .thumb
+ .syntax unified
diff --git a/external/poky/meta/recipes-core/glibc/glibc/CVE-2016-10739.patch b/external/poky/meta/recipes-core/glibc/glibc/CVE-2016-10739.patch
new file mode 100644
index 00000000..7eb55d66
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/CVE-2016-10739.patch
@@ -0,0 +1,232 @@
+CVE: CVE-2016-10739
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 8e92ca5dd7a7e38a4dddf1ebc4e1e8f0cb27e4aa Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 21 Jan 2019 08:59:42 +0100
+Subject: [PATCH] resolv: Reformat inet_addr, inet_aton to GNU style
+
+(cherry picked from commit 5e30b8ef0758763effa115634e0ed7d8938e4bc0)
+---
+ ChangeLog | 5 ++
+ resolv/inet_addr.c | 192 ++++++++++++++++++++++++++++-------------------------
+ 2 files changed, 106 insertions(+), 91 deletions(-)
+
+diff --git a/resolv/inet_addr.c b/resolv/inet_addr.c
+index 022f7ea084..32f58b0e13 100644
+--- a/resolv/inet_addr.c
++++ b/resolv/inet_addr.c
+@@ -1,3 +1,21 @@
++/* Legacy IPv4 text-to-address functions.
++ Copyright (C) 2019 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
+ /*
+ * Copyright (c) 1983, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+@@ -78,105 +96,97 @@
+ #include <limits.h>
+ #include <errno.h>
+
+-/*
+- * Ascii internet address interpretation routine.
+- * The value returned is in network order.
+- */
++/* ASCII IPv4 Internet address interpretation routine. The value
++ returned is in network order. */
+ in_addr_t
+-__inet_addr(const char *cp) {
+- struct in_addr val;
++__inet_addr (const char *cp)
++{
++ struct in_addr val;
+
+- if (__inet_aton(cp, &val))
+- return (val.s_addr);
+- return (INADDR_NONE);
++ if (__inet_aton (cp, &val))
++ return val.s_addr;
++ return INADDR_NONE;
+ }
+ weak_alias (__inet_addr, inet_addr)
+
+-/*
+- * Check whether "cp" is a valid ascii representation
+- * of an Internet address and convert to a binary address.
+- * Returns 1 if the address is valid, 0 if not.
+- * This replaces inet_addr, the return value from which
+- * cannot distinguish between failure and a local broadcast address.
+- */
++/* Check whether "cp" is a valid ASCII representation of an IPv4
++ Internet address and convert it to a binary address. Returns 1 if
++ the address is valid, 0 if not. This replaces inet_addr, the
++ return value from which cannot distinguish between failure and a
++ local broadcast address. */
+ int
+-__inet_aton(const char *cp, struct in_addr *addr)
++__inet_aton (const char *cp, struct in_addr *addr)
+ {
+- static const in_addr_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
+- in_addr_t val;
+- char c;
+- union iaddr {
+- uint8_t bytes[4];
+- uint32_t word;
+- } res;
+- uint8_t *pp = res.bytes;
+- int digit;
+-
+- int saved_errno = errno;
+- __set_errno (0);
+-
+- res.word = 0;
+-
+- c = *cp;
+- for (;;) {
+- /*
+- * Collect number up to ``.''.
+- * Values are specified as for C:
+- * 0x=hex, 0=octal, isdigit=decimal.
+- */
+- if (!isdigit(c))
+- goto ret_0;
+- {
+- char *endp;
+- unsigned long ul = strtoul (cp, (char **) &endp, 0);
+- if (ul == ULONG_MAX && errno == ERANGE)
+- goto ret_0;
+- if (ul > 0xfffffffful)
+- goto ret_0;
+- val = ul;
+- digit = cp != endp;
+- cp = endp;
+- }
+- c = *cp;
+- if (c == '.') {
+- /*
+- * Internet format:
+- * a.b.c.d
+- * a.b.c (with c treated as 16 bits)
+- * a.b (with b treated as 24 bits)
+- */
+- if (pp > res.bytes + 2 || val > 0xff)
+- goto ret_0;
+- *pp++ = val;
+- c = *++cp;
+- } else
+- break;
+- }
+- /*
+- * Check for trailing characters.
+- */
+- if (c != '\0' && (!isascii(c) || !isspace(c)))
+- goto ret_0;
+- /*
+- * Did we get a valid digit?
+- */
+- if (!digit)
+- goto ret_0;
+-
+- /* Check whether the last part is in its limits depending on
+- the number of parts in total. */
+- if (val > max[pp - res.bytes])
++ static const in_addr_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
++ in_addr_t val;
++ char c;
++ union iaddr
++ {
++ uint8_t bytes[4];
++ uint32_t word;
++ } res;
++ uint8_t *pp = res.bytes;
++ int digit;
++
++ int saved_errno = errno;
++ __set_errno (0);
++
++ res.word = 0;
++
++ c = *cp;
++ for (;;)
++ {
++ /* Collect number up to ``.''. Values are specified as for C:
++ 0x=hex, 0=octal, isdigit=decimal. */
++ if (!isdigit (c))
++ goto ret_0;
++ {
++ char *endp;
++ unsigned long ul = strtoul (cp, &endp, 0);
++ if (ul == ULONG_MAX && errno == ERANGE)
+ goto ret_0;
+-
+- if (addr != NULL)
+- addr->s_addr = res.word | htonl (val);
+-
+- __set_errno (saved_errno);
+- return (1);
+-
+-ret_0:
+- __set_errno (saved_errno);
+- return (0);
++ if (ul > 0xfffffffful)
++ goto ret_0;
++ val = ul;
++ digit = cp != endp;
++ cp = endp;
++ }
++ c = *cp;
++ if (c == '.')
++ {
++ /* Internet format:
++ a.b.c.d
++ a.b.c (with c treated as 16 bits)
++ a.b (with b treated as 24 bits). */
++ if (pp > res.bytes + 2 || val > 0xff)
++ goto ret_0;
++ *pp++ = val;
++ c = *++cp;
++ }
++ else
++ break;
++ }
++ /* Check for trailing characters. */
++ if (c != '\0' && (!isascii (c) || !isspace (c)))
++ goto ret_0;
++ /* Did we get a valid digit? */
++ if (!digit)
++ goto ret_0;
++
++ /* Check whether the last part is in its limits depending on the
++ number of parts in total. */
++ if (val > max[pp - res.bytes])
++ goto ret_0;
++
++ if (addr != NULL)
++ addr->s_addr = res.word | htonl (val);
++
++ __set_errno (saved_errno);
++ return 1;
++
++ ret_0:
++ __set_errno (saved_errno);
++ return 0;
+ }
+ weak_alias (__inet_aton, inet_aton)
+ libc_hidden_def (__inet_aton)
+--
+2.11.0
diff --git a/external/poky/meta/recipes-core/glibc/glibc/CVE-2018-19591.patch b/external/poky/meta/recipes-core/glibc/glibc/CVE-2018-19591.patch
new file mode 100644
index 00000000..9c78a3df
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/CVE-2018-19591.patch
@@ -0,0 +1,48 @@
+CVE: CVE-2018-19591
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From ce6ba630dbc96f49eb1f30366aa62261df4792f9 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Tue, 27 Nov 2018 16:12:43 +0100
+Subject: [PATCH] CVE-2018-19591: if_nametoindex: Fix descriptor for overlong
+ name [BZ #23927]
+
+(cherry picked from commit d527c860f5a3f0ed687bd03f0cb464612dc23408)
+---
+ ChangeLog | 7 +++++++
+ NEWS | 6 ++++++
+ sysdeps/unix/sysv/linux/if_index.c | 11 ++++++-----
+ 3 files changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/if_index.c b/sysdeps/unix/sysv/linux/if_index.c
+index e3d08982d9..782fc5e175 100644
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -38,11 +38,6 @@ __if_nametoindex (const char *ifname)
+ return 0;
+ #else
+ struct ifreq ifr;
+- int fd = __opensock ();
+-
+- if (fd < 0)
+- return 0;
+-
+ if (strlen (ifname) >= IFNAMSIZ)
+ {
+ __set_errno (ENODEV);
+@@ -50,6 +45,12 @@ __if_nametoindex (const char *ifname)
+ }
+
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
++
++ int fd = __opensock ();
++
++ if (fd < 0)
++ return 0;
++
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
+ int saved_errno = errno;
+--
+2.11.0
diff --git a/external/poky/meta/recipes-core/glibc/glibc/CVE-2019-9169.patch b/external/poky/meta/recipes-core/glibc/glibc/CVE-2019-9169.patch
new file mode 100644
index 00000000..14cfaa35
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/CVE-2019-9169.patch
@@ -0,0 +1,63 @@
+From 583dd860d5b833037175247230a328f0050dbfe9 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Mon, 21 Jan 2019 11:08:13 -0800
+Subject: [PATCH] regex: fix read overrun [BZ #24114]
+
+Problem found by AddressSanitizer, reported by Hongxu Chen in:
+https://debbugs.gnu.org/34140
+* posix/regexec.c (proceed_next_node):
+Do not read past end of input buffer.
+
+Upstream-Status: Backport
+https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=583dd860d5b833037175247230a328f0050dbfe9
+
+CVE: CVE-2019-9169
+Signed-off-by: Armin Kuster <akuster@mvista.com>
+
+---
+ ChangeLog | 10 +++++++++-
+ posix/regexec.c | 6 ++++--
+ 2 files changed, 13 insertions(+), 3 deletions(-)
+
+Index: git/ChangeLog
+===================================================================
+--- git.orig/ChangeLog
++++ git/ChangeLog
+@@ -1,3 +1,11 @@
++2019-01-31 Paul Eggert <eggert@cs.ucla.edu>
++
++ regex: fix read overrun [BZ #24114]
++ Problem found by AddressSanitizer, reported by Hongxu Chen in:
++ https://debbugs.gnu.org/34140
++ * posix/regexec.c (proceed_next_node):
++ Do not read past end of input buffer.
++
+ 2018-09-30 Martin Jansa <Martin.Jansa@gmail.com>
+ Partial fix for [BZ #23716]
+ * locale/weight.h: Fix build with -Os.
+@@ -10917,7 +10925,7 @@
+ (CFLAGS-wcstof_l.c): Likewise.
+ (CPPFLAGS-tst-wchar-h.c): Likewise.
+ (CPPFLAGS-wcstold_l.c): Likewise.
+----
++
+ 2017-12-11 Paul A. Clarke <pc@us.ibm.com>
+
+ * sysdeps/ieee754/flt-32/s_cosf.c: New implementation.
+Index: git/posix/regexec.c
+===================================================================
+--- git.orig/posix/regexec.c
++++ git/posix/regexec.c
+@@ -1289,8 +1289,10 @@ proceed_next_node (const re_match_contex
+ else if (naccepted)
+ {
+ char *buf = (char *) re_string_get_buffer (&mctx->input);
+- if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
+- naccepted) != 0)
++ if (mctx->input.valid_len - *pidx < naccepted
++ || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
++ naccepted)
++ != 0))
+ return -1;
+ }
+ }
diff --git a/external/poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf b/external/poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf
new file mode 100644
index 00000000..83327c01
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/etc/ld.so.conf
@@ -0,0 +1 @@
+include /etc/ld.so.conf.d/*.conf
diff --git a/external/poky/meta/recipes-core/glibc/glibc/generate-supported.mk b/external/poky/meta/recipes-core/glibc/glibc/generate-supported.mk
new file mode 100644
index 00000000..d2a28c2d
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/generate-supported.mk
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+
+include $(IN)
+
+all:
+ rm -f $(OUT)
+ touch $(OUT)
+ for locale in $(SUPPORTED-LOCALES); do \
+ [ $$locale = true ] && continue; \
+ echo $$locale | sed 's,/, ,' >> $(OUT); \
+ done
diff --git a/external/poky/meta/recipes-core/glibc/glibc/makedbs.sh b/external/poky/meta/recipes-core/glibc/glibc/makedbs.sh
new file mode 100755
index 00000000..7d51a673
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc/makedbs.sh
@@ -0,0 +1,177 @@
+#!/bin/sh
+
+#
+# Make passwd.db, group.db, etc.
+#
+
+VAR_DB=/var/db
+
+# Use make if available
+if [ -x /usr/bin/make -o -x /bin/make ]; then
+ make -C $VAR_DB
+ exit 0
+fi
+
+# No make available, do it in hard way
+
+# passwd.db
+if [ -e /etc/passwd ]; then
+target=$VAR_DB/passwd.db
+echo -n "passwd... "
+awk 'BEGIN { FS=":"; OFS=":" } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$3; print }' /etc/passwd | \
+makedb --quiet -o $target -
+echo "done."
+fi
+
+# group.db
+if [ -e /etc/group ]; then
+target=$VAR_DB/group.db
+echo -n "group... "
+awk 'BEGIN { FS=":"; OFS=":" } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$3; print; \
+ if ($$4 != "") { \
+ split($$4, grmems, ","); \
+ for (memidx in grmems) { \
+ mem=grmems[memidx]; \
+ if (members[mem] == "") \
+ members[mem]=$$3; \
+ else \
+ members[mem]=members[mem] "," $$3; \
+ } \
+ delete grmems; } } \
+ END { for (mem in members) \
+ printf ":%s %s %s\n", mem, mem, members[mem]; }' /etc/group | \
+makedb --quiet -o $target -
+echo "done."
+fi
+
+# ethers.db
+if [ -e /etc/ethers ]; then
+target=$VAR_DB/ethers.db
+echo -n "ethers... "
+awk '/^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$2; print }' /etc/ethers | \
+makedb --quiet -o $target -
+echo "done."
+fi
+
+# protocols.db
+if [ -e /etc/protocols ]; then
+target=$VAR_DB/protocols.db
+echo -n "protocols... "
+awk '/^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$2; print; \
+ for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
+ { printf ".%s ", $$i; print } }' /etc/protocols | \
+makedb --quiet -o $target -
+echo "done."
+fi
+
+# rpc.db
+if [ -e /etc/rpc ]; then
+target=$VAR_DB/rpc.db
+echo -n "rpc... "
+awk '/^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$2; print; \
+ for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
+ { printf ".%s ", $$i; print } }' /etc/rpc | \
+makedb --quiet -o $target -
+echo "done."
+fi
+
+# services.db
+if [ -e /etc/services ]; then
+target=$VAR_DB/services.db
+echo -n "services... "
+awk 'BEGIN { FS="[ \t/]+" } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ /^[^#]/ { sub(/[ \t]*#.*$$/, "");\
+ printf ":%s/%s ", $$1, $$3; print; \
+ printf ":%s/ ", $$1; print; \
+ printf "=%s/%s ", $$2, $$3; print; \
+ printf "=%s/ ", $$2; print; \
+ for (i = 4; i <= NF && !($$i ~ /^#/); ++i) \
+ { printf ":%s/%s ", $$i, $$3; print; \
+ printf ":%s/ ", $$i; print } }' /etc/services | \
+makedb --quiet -o $target -
+echo "done."
+fi
+
+# shadow.db
+if [ -e /etc/shadow ]; then
+target=$VAR_DB/shadow.db
+echo -n "shadow... "
+awk 'BEGIN { FS=":"; OFS=":" } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ /^[^#]/ { printf ".%s ", $$1; print }' /etc/shadow | \
+(umask 077 && makedb --quiet -o $target -)
+echo "done."
+if chgrp shadow $target 2>/dev/null; then
+ chmod g+r $target
+else
+ chown 0 $target; chgrp 0 $target; chmod 600 $target;
+ echo
+ echo "Warning: The shadow password database $target"
+ echo "has been set to be readable only by root. You may want"
+ echo "to make it readable by the \`shadow' group depending"
+ echo "on your configuration."
+ echo
+fi
+fi
+
+# gshadow.db
+if [ -e /etc/gshadow ]; then
+target=$VAR_DB/gshadow.db
+echo -n "gshadow... "
+awk 'BEGIN { FS=":"; OFS=":" } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ /^[^#]/ { printf ".%s ", $$1; print }' /etc/gshadow | \
+(umask 077 && makedb --quiet -o $target -)
+echo "done."
+if chgrp shadow $target 2>/dev/null; then
+ chmod g+r $target
+else
+ chown 0 $target; chgrp 0 $target; chmod 600 $target
+ echo
+ echo "Warning: The shadow group database $target"
+ echo "has been set to be readable only by root. You may want"
+ echo "to make it readable by the \`shadow' group depending"
+ echo "on your configuration."
+ echo
+fi
+fi
+
+# netgroup.db
+if [ -e /etc/netgroup ]; then
+target=$VAR_DB/netgroup.db
+echo -n "netgroup... "
+awk 'BEGIN { ini=1 } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ /^[^#]/ { if (sub(/[ \t]*\\$$/, " ") == 0) end="\n"; \
+ else end=""; \
+ gsub(/[ \t]+/, " "); \
+ sub(/^[ \t]*/, ""); \
+ if (ini == 0) printf "%s%s", $$0, end; \
+ else printf ".%s %s%s", $$1, $$0, end; \
+ ini=end == "" ? 0 : 1; } \
+ END { if (ini==0) printf "\n" }' /etc/netgroup | \
+makedb --quiet -o $target
+echo "done."
+fi
diff --git a/external/poky/meta/recipes-core/glibc/glibc_2.28.bb b/external/poky/meta/recipes-core/glibc/glibc_2.28.bb
new file mode 100644
index 00000000..0839fa12
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/glibc_2.28.bb
@@ -0,0 +1,136 @@
+require glibc.inc
+
+LIC_FILES_CHKSUM = "file://LICENSES;md5=cfc0ed77a9f62fa62eded042ebe31d72 \
+ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS += "gperf-native bison-native make-native"
+
+SRCREV ?= "044c96f0d5595aeb0bb4e79355081c5a7f4faca5"
+
+SRCBRANCH ?= "release/${PV}/master"
+
+GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.(?!90)\d+)*)"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
+ file://etc/ld.so.conf \
+ file://generate-supported.mk \
+ file://makedbs.sh \
+ \
+ ${NATIVESDKFIXES} \
+ file://0006-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \
+ file://0007-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
+ file://0008-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \
+ file://0009-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
+ file://0010-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \
+ file://0011-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
+ file://0012-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
+ file://0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
+ file://0014-Add-unused-attribute.patch \
+ file://0015-yes-within-the-path-sets-wrong-config-variables.patch \
+ file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
+ file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
+ file://0018-eglibc-Cross-building-and-testing-instructions.patch \
+ file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
+ file://0020-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+ file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+ file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \
+ file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \
+ file://0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \
+ file://0025-locale-fix-hard-coded-reference-to-gcc-E.patch \
+ file://0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch \
+ file://0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
+ file://0030-intl-Emit-no-lines-in-bison-generated-files.patch \
+ file://0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch \
+ file://0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch \
+ file://0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
+ file://0034-inject-file-assembly-directives.patch \
+ file://CVE-2019-9169.patch \
+ file://CVE-2016-10739.patch \
+ file://CVE-2018-19591.patch \
+"
+
+NATIVESDKFIXES ?= ""
+NATIVESDKFIXES_class-nativesdk = "\
+ file://0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
+ file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
+ file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
+ file://0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
+ file://0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch \
+"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+PACKAGES_DYNAMIC = ""
+
+# the -isystem in bitbake.conf screws up glibc do_stage
+BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
+
+GLIBC_BROKEN_LOCALES = ""
+#
+# We will skip parsing glibc when target system C library selection is not glibc
+# this helps in easing out parsing for non-glibc system libraries
+#
+COMPATIBLE_HOST_libc-musl_class-target = "null"
+
+GLIBCPIE ??= ""
+
+EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
+ --disable-profile \
+ --disable-debug --without-gd \
+ --enable-clocale=gnu \
+ --with-headers=${STAGING_INCDIR} \
+ --without-selinux \
+ --enable-tunables \
+ --enable-bind-now \
+ --enable-stack-protector=strong \
+ --enable-stackguard-randomization \
+ --disable-crypt \
+ ${GLIBCPIE} \
+ ${GLIBC_EXTRA_OECONF}"
+
+EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-inet-anl', '--enable-nscd', '--disable-nscd', d)}"
+
+
+do_patch_append() {
+ bb.build.exec_func('do_fix_readlib_c', d)
+}
+
+do_fix_readlib_c () {
+ sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
+}
+
+do_configure () {
+# override this function to avoid the autoconf/automake/aclocal/autoheader
+# calls for now
+# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
+# version check and doesn't really help with anything
+ (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+ find ${S} -name "configure" | xargs touch
+ CPPFLAGS="" oe_runconf
+}
+
+do_compile () {
+ # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
+ unset LDFLAGS
+ base_do_compile
+ echo "Adjust ldd script"
+ if [ -n "${RTLDLIST}" ]
+ then
+ prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
+ if [ "${prevrtld}" != "${RTLDLIST}" ]
+ then
+ sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
+ fi
+ fi
+
+}
+
+require glibc-package.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch
new file mode 100644
index 00000000..cdfeaead
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch
@@ -0,0 +1,331 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+We run the ldconfig in the cross fashion. make the code bitsize aware so that
+we can cross build ldconfig cache for various architectures.
+
+Richard Purdie <richard.purdie@linuxfoundation.org> 2009/05/19
+Nitin A Kamble <nitin.a.kamble@intel.com> 2009/03/29
+
+Index: ldconfig-native-2.12.1/readelflib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readelflib.c
++++ ldconfig-native-2.12.1/readelflib.c
+@@ -40,39 +40,212 @@ do \
+
+ /* Returns 0 if everything is ok, != 0 in case of error. */
+ int
+-process_elf_file (const char *file_name, const char *lib, int *flag,
++process_elf_file32 (const char *file_name, const char *lib, int *flag,
+ unsigned int *osversion, char **soname, void *file_contents,
+ size_t file_length)
+ {
+ int i;
+ unsigned int j;
+- ElfW(Addr) loadaddr;
++ Elf32_Addr loadaddr;
+ unsigned int dynamic_addr;
+ size_t dynamic_size;
+ char *program_interpreter;
+
+- ElfW(Ehdr) *elf_header;
+- ElfW(Phdr) *elf_pheader, *segment;
+- ElfW(Dyn) *dynamic_segment, *dyn_entry;
++ Elf32_Ehdr *elf_header;
++ Elf32_Phdr *elf_pheader, *segment;
++ Elf32_Dyn *dynamic_segment, *dyn_entry;
+ char *dynamic_strings;
+
+- elf_header = (ElfW(Ehdr) *) file_contents;
++ elf_header = (Elf32_Ehdr *) file_contents;
+ *osversion = 0;
+
+- if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS))
++ if (elf_header->e_type != ET_DYN)
+ {
+- if (opt_verbose)
++ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
++ elf_header->e_type);
++ return 1;
++ }
++
++ /* Get information from elf program header. */
++ elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
++ check_ptr (elf_pheader);
++
++ /* The library is an elf library, now search for soname and
++ libc5/libc6. */
++ *flag = FLAG_ELF;
++
++ loadaddr = -1;
++ dynamic_addr = 0;
++ dynamic_size = 0;
++ program_interpreter = NULL;
++ for (i = 0, segment = elf_pheader;
++ i < elf_header->e_phnum; i++, segment++)
++ {
++ check_ptr (segment);
++
++ switch (segment->p_type)
+ {
+- if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
+- error (0, 0, _("%s is a 32 bit ELF file.\n"), file_name);
+- else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
+- error (0, 0, _("%s is a 64 bit ELF file.\n"), file_name);
+- else
+- error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
++ case PT_LOAD:
++ if (loadaddr == (Elf32_Addr) -1)
++ loadaddr = segment->p_vaddr - segment->p_offset;
++ break;
++
++ case PT_DYNAMIC:
++ if (dynamic_addr)
++ error (0, 0, _("more than one dynamic segment\n"));
++
++ dynamic_addr = segment->p_offset;
++ dynamic_size = segment->p_filesz;
++ break;
++
++ case PT_INTERP:
++ program_interpreter = (char *) (file_contents + segment->p_offset);
++ check_ptr (program_interpreter);
++
++ /* Check if this is enough to classify the binary. */
++ for (j = 0; j < sizeof (interpreters) / sizeof (interpreters [0]);
++ ++j)
++ if (strcmp (program_interpreter, interpreters[j].soname) == 0)
++ {
++ *flag = interpreters[j].flag;
++ break;
++ }
++ break;
++
++ case PT_NOTE:
++ if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
++ {
++ Elf32_Word *abi_note = (Elf32_Word *) (file_contents
++ + segment->p_offset);
++ Elf32_Addr size = segment->p_filesz;
++
++ while (abi_note [0] != 4 || abi_note [1] != 16
++ || abi_note [2] != 1
++ || memcmp (abi_note + 3, "GNU", 4) != 0)
++ {
++#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
++ Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
++ + ROUND (abi_note[0])
++ + ROUND (abi_note[1]);
++
++ if (size - 32 < note_size || note_size == 0)
++ {
++ size = 0;
++ break;
++ }
++ size -= note_size;
++ abi_note = (void *) abi_note + note_size;
++ }
++
++ if (size == 0)
++ break;
++
++ *osversion = (abi_note [4] << 24) |
++ ((abi_note [5] & 0xff) << 16) |
++ ((abi_note [6] & 0xff) << 8) |
++ (abi_note [7] & 0xff);
++ }
++ break;
++
++ default:
++ break;
++ }
++
++ }
++ if (loadaddr == (Elf32_Addr) -1)
++ {
++ /* Very strange. */
++ loadaddr = 0;
++ }
++
++ /* Now we can read the dynamic sections. */
++ if (dynamic_size == 0)
++ return 1;
++
++ dynamic_segment = (Elf32_Dyn *) (file_contents + dynamic_addr);
++ check_ptr (dynamic_segment);
++
++ /* Find the string table. */
++ dynamic_strings = NULL;
++ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ ++dyn_entry)
++ {
++ check_ptr (dyn_entry);
++ if (dyn_entry->d_tag == DT_STRTAB)
++ {
++ dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++ check_ptr (dynamic_strings);
++ break;
+ }
+- return 1;
+ }
+
++ if (dynamic_strings == NULL)
++ return 1;
++
++ /* Now read the DT_NEEDED and DT_SONAME entries. */
++ for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ ++dyn_entry)
++ {
++ if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
++ {
++ char *name = dynamic_strings + dyn_entry->d_un.d_val;
++ check_ptr (name);
++
++ if (dyn_entry->d_tag == DT_NEEDED)
++ {
++
++ if (*flag == FLAG_ELF)
++ {
++ /* Check if this is enough to classify the binary. */
++ for (j = 0;
++ j < sizeof (known_libs) / sizeof (known_libs [0]);
++ ++j)
++ if (strcmp (name, known_libs [j].soname) == 0)
++ {
++ *flag = known_libs [j].flag;
++ break;
++ }
++ }
++ }
++
++ else if (dyn_entry->d_tag == DT_SONAME)
++ *soname = xstrdup (name);
++
++ /* Do we have everything we need? */
++ if (*soname && *flag != FLAG_ELF)
++ return 0;
++ }
++ }
++
++ /* We reach this point only if the file doesn't contain a DT_SONAME
++ or if we can't classify the library. If it doesn't have a
++ soname, return the name of the library. */
++ if (*soname == NULL)
++ *soname = xstrdup (lib);
++
++ return 0;
++}
++
++int
++process_elf_file64 (const char *file_name, const char *lib, int *flag,
++ unsigned int *osversion, char **soname, void *file_contents,
++ size_t file_length)
++{
++ int i;
++ unsigned int j;
++ Elf64_Addr loadaddr;
++ unsigned int dynamic_addr;
++ size_t dynamic_size;
++ char *program_interpreter;
++
++ Elf64_Ehdr *elf_header;
++ Elf64_Phdr *elf_pheader, *segment;
++ Elf64_Dyn *dynamic_segment, *dyn_entry;
++ char *dynamic_strings;
++
++ elf_header = (Elf64_Ehdr *) file_contents;
++ *osversion = 0;
++
+ if (elf_header->e_type != ET_DYN)
+ {
+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
+@@ -81,7 +254,7 @@ process_elf_file (const char *file_name,
+ }
+
+ /* Get information from elf program header. */
+- elf_pheader = (ElfW(Phdr) *) (elf_header->e_phoff + file_contents);
++ elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
+ check_ptr (elf_pheader);
+
+ /* The library is an elf library, now search for soname and
+@@ -100,7 +273,7 @@ process_elf_file (const char *file_name,
+ switch (segment->p_type)
+ {
+ case PT_LOAD:
+- if (loadaddr == (ElfW(Addr)) -1)
++ if (loadaddr == (Elf64_Addr) -1)
+ loadaddr = segment->p_vaddr - segment->p_offset;
+ break;
+
+@@ -129,16 +302,16 @@ process_elf_file (const char *file_name,
+ case PT_NOTE:
+ if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
+ {
+- ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents
++ Elf64_Word *abi_note = (Elf64_Word *) (file_contents
+ + segment->p_offset);
+- ElfW(Addr) size = segment->p_filesz;
++ Elf64_Addr size = segment->p_filesz;
+
+ while (abi_note [0] != 4 || abi_note [1] != 16
+ || abi_note [2] != 1
+ || memcmp (abi_note + 3, "GNU", 4) != 0)
+ {
+-#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
+- ElfW(Addr) note_size = 3 * sizeof (ElfW(Word))
++#define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
++ Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
+ + ROUND (abi_note[0])
+ + ROUND (abi_note[1]);
+
+@@ -166,7 +339,7 @@ process_elf_file (const char *file_name,
+ }
+
+ }
+- if (loadaddr == (ElfW(Addr)) -1)
++ if (loadaddr == (Elf64_Addr) -1)
+ {
+ /* Very strange. */
+ loadaddr = 0;
+@@ -176,7 +349,7 @@ process_elf_file (const char *file_name,
+ if (dynamic_size == 0)
+ return 1;
+
+- dynamic_segment = (ElfW(Dyn) *) (file_contents + dynamic_addr);
++ dynamic_segment = (Elf64_Dyn *) (file_contents + dynamic_addr);
+ check_ptr (dynamic_segment);
+
+ /* Find the string table. */
+@@ -233,3 +406,33 @@ process_elf_file (const char *file_name,
+
+ return 0;
+ }
++/* Returns 0 if everything is ok, != 0 in case of error. */
++int
++process_elf_file (const char *file_name, const char *lib, int *flag,
++ unsigned int *osversion, char **soname, void *file_contents,
++ size_t file_length)
++{
++ int i;
++ unsigned int j;
++ ElfW(Addr) loadaddr;
++ unsigned int dynamic_addr;
++ size_t dynamic_size;
++ char *program_interpreter;
++
++ ElfW(Ehdr) *elf_header;
++ ElfW(Phdr) *elf_pheader, *segment;
++ ElfW(Dyn) *dynamic_segment, *dyn_entry;
++ char *dynamic_strings;
++
++ elf_header = (ElfW(Ehdr) *) file_contents;
++ *osversion = 0;
++
++ if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
++ return process_elf_file32(file_name, lib,flag, osversion, soname, file_contents, file_length);
++ else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
++ return process_elf_file64(file_name, lib,flag, osversion, soname, file_contents, file_length);
++ error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
++ return 1;
++}
++
++
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README
new file mode 100644
index 00000000..43fb9837
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/README
@@ -0,0 +1,8 @@
+The files are pulled verbatim from glibc 2.5 and then patched to allow
+standalone compilation of ldconfig.
+
+Richard Purdie
+OpenedHand Ltd.
+
+Upgraded the ldconfig recipe to eglibc 2.12.1
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/03/29
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch
new file mode 100644
index 00000000..f4e38d42
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch
@@ -0,0 +1,116 @@
+From 9d62544090b08849218cd1fc52a36cdd5d90363e Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Fri, 24 Apr 2015 03:29:31 +0000
+Subject: [PATCH] Add 64-bit flag for ELF64 entries.
+
+ldconfig-native was grepped from an old version of glibc, and its output
+lacks neccessary 64bit flag in entries.
+Due to this defect, ctypes.util.find_library() python function fails to
+detect any library due to the old file format that ldconfig-native
+creates. This fix sets architecture-dependent 64bit flags for 64-bit ELF.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ cache.c | 4 ++++
+ ldconfig.h | 4 ++++
+ readelflib.c | 34 ++++++++++++++++++++++++++++++++++
+ 3 files changed, 42 insertions(+)
+
+diff --git a/cache.c b/cache.c
+index a904d44..c4f5411 100644
+--- a/cache.c
++++ b/cache.c
+@@ -121,6 +121,10 @@ print_entry (const char *lib, int flag, unsigned int osversion,
+ break;
+ case FLAG_MIPS64_LIBN64:
+ fputs (",64bit", stdout);
++ break;
++ case FLAG_AARCH64_LIB64:
++ fputs (",AArch64", stdout);
++ break;
+ case 0:
+ break;
+ default:
+diff --git a/ldconfig.h b/ldconfig.h
+index fadd5ec..6a8a750 100644
+--- a/ldconfig.h
++++ b/ldconfig.h
+@@ -34,6 +34,10 @@
+ #define FLAG_POWERPC_LIB64 0x0500
+ #define FLAG_MIPS64_LIBN32 0x0600
+ #define FLAG_MIPS64_LIBN64 0x0700
++#define FLAG_X8664_LIBX32 0x0800
++#define FLAG_ARM_LIBHF 0x0900
++#define FLAG_AARCH64_LIB64 0x0a00
++#define FLAG_ARM_LIBSF 0x0b00
+
+ /* Name of auxiliary cache. */
+ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
+diff --git a/readelflib.c b/readelflib.c
+index 0bf0de3..6e87afc 100644
+--- a/readelflib.c
++++ b/readelflib.c
+@@ -28,6 +28,11 @@
+
+ #include "endian_extra.h"
+
++/* Work-around for old host that does not have AArch64 defined in elf.h. */
++#ifndef EM_AARCH64
++#define EM_AARCH64 183 /* ARM AARCH64 */
++#endif
++
+ #undef check_ptr
+ #define check_ptr(ptr) \
+ do \
+@@ -290,6 +295,48 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ libc5/libc6. */
+ *flag = FLAG_ELF;
+
++ /* Set flags according to information in ELF header to align with target
++ ldconfig */
++ switch (elf_header->e_machine)
++ {
++ case EM_IA_64:
++ /* Intel 64bit libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/ia64/readelflib.c */
++ *flag |= FLAG_IA64_LIB64|FLAG_ELF_LIBC6;
++ break;
++ case EM_X86_64:
++ /* X86-64 64bit libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/i386/readelflib.c */
++ *flag |= FLAG_X8664_LIB64|FLAG_ELF_LIBC6;
++ break;
++ case EM_S390:
++ /* S/390 64bit libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/s390/readelflib.c */
++ *flag |= FLAG_S390_LIB64|FLAG_ELF_LIBC6;
++ break;
++ case EM_PPC64:
++ /* PowerPC 64bit libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/powerpc/readelflib.c */
++ *flag |= FLAG_POWERPC_LIB64|FLAG_ELF_LIBC6;
++ break;
++ case EM_MIPS:
++ case EM_MIPS_RS3_LE:
++ /* n64 libraries are always libc.so.6+. */
++ /* NOTE: This does not correctly distinguish NAN2008 binaries and is possibly broken */
++ /* see sysdeps/unix/sysv/linux/mips/readelflib.c */
++ *flag |= FLAG_MIPS64_LIBN64|FLAG_ELF_LIBC6;
++ break;
++ case EM_AARCH64:
++ /* AArch64 libraries are always libc.so.6+. */
++ /* see sysdeps/unix/sysv/linux/arm/readelflib.c */
++ *flag |= FLAG_AARCH64_LIB64|FLAG_ELF_LIBC6;
++ break;
++ default:
++ error(0, 0, "%s is a 64-bit ELF for unknown machine %lx\n",
++ file_name, (long)elf_header->e_machine);
++ break;
++ }
++
+ loadaddr = -1;
+ dynamic_addr = 0;
+ dynamic_size = 0;
+--
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch
new file mode 100644
index 00000000..7f8e4db7
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch
@@ -0,0 +1,454 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Do data input/output handling according to endien-ness of the library file. That
+enables use of ldconfig in the cross fashion for any architecture.
+
+2011/04/04
+Richard Purdie <richard.purdie@linuxfoundation.org>
+Nitin Kamble <nitin.a.kamble@intel.com>
+
+Index: ldconfig-native-2.12.1/readelflib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readelflib.c
++++ ldconfig-native-2.12.1/readelflib.c
+@@ -38,6 +38,28 @@ do \
+ } \
+ while (0);
+
++int be;
++static uint16_t read16(uint16_t x, int be)
++{
++ if (be)
++ return be16toh(x);
++ return le16toh(x);
++}
++
++static uint32_t read32(uint32_t x, int be)
++{
++ if (be)
++ return be32toh(x);
++ return le32toh(x);
++}
++
++static uint64_t read64(uint64_t x, int be)
++{
++ if (be)
++ return be64toh(x);
++ return le64toh(x);
++}
++
+ /* Returns 0 if everything is ok, != 0 in case of error. */
+ int
+ process_elf_file32 (const char *file_name, const char *lib, int *flag,
+@@ -59,15 +81,17 @@ process_elf_file32 (const char *file_nam
+ elf_header = (Elf32_Ehdr *) file_contents;
+ *osversion = 0;
+
+- if (elf_header->e_type != ET_DYN)
++ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
++
++ if (read16(elf_header->e_type, be) != ET_DYN)
+ {
+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
+- elf_header->e_type);
++ read16(elf_header->e_type, be));
+ return 1;
+ }
+
+ /* Get information from elf program header. */
+- elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
++ elf_pheader = (Elf32_Phdr *) (read32(elf_header->e_phoff, be) + file_contents);
+ check_ptr (elf_pheader);
+
+ /* The library is an elf library, now search for soname and
+@@ -79,27 +103,27 @@ process_elf_file32 (const char *file_nam
+ dynamic_size = 0;
+ program_interpreter = NULL;
+ for (i = 0, segment = elf_pheader;
+- i < elf_header->e_phnum; i++, segment++)
++ i < read16(elf_header->e_phnum, be); i++, segment++)
+ {
+ check_ptr (segment);
+
+- switch (segment->p_type)
++ switch (read32(segment->p_type, be))
+ {
+ case PT_LOAD:
+ if (loadaddr == (Elf32_Addr) -1)
+- loadaddr = segment->p_vaddr - segment->p_offset;
++ loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be);
+ break;
+
+ case PT_DYNAMIC:
+ if (dynamic_addr)
+ error (0, 0, _("more than one dynamic segment\n"));
+
+- dynamic_addr = segment->p_offset;
+- dynamic_size = segment->p_filesz;
++ dynamic_addr = read32(segment->p_offset, be);
++ dynamic_size = read32(segment->p_filesz, be);
+ break;
+
+ case PT_INTERP:
+- program_interpreter = (char *) (file_contents + segment->p_offset);
++ program_interpreter = (char *) (file_contents + read32(segment->p_offset, be));
+ check_ptr (program_interpreter);
+
+ /* Check if this is enough to classify the binary. */
+@@ -113,20 +137,20 @@ process_elf_file32 (const char *file_nam
+ break;
+
+ case PT_NOTE:
+- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
++ if (!*osversion && read32(segment->p_filesz, be) >= 32 && segment->p_align >= 4)
+ {
+ Elf32_Word *abi_note = (Elf32_Word *) (file_contents
+- + segment->p_offset);
+- Elf32_Addr size = segment->p_filesz;
++ + read32(segment->p_offset, be));
++ Elf32_Addr size = read32(segment->p_filesz, be);
+
+- while (abi_note [0] != 4 || abi_note [1] != 16
+- || abi_note [2] != 1
++ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
++ || read32(abi_note [2], be) != 1
+ || memcmp (abi_note + 3, "GNU", 4) != 0)
+ {
+-#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
+- Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
+- + ROUND (abi_note[0])
+- + ROUND (abi_note[1]);
++#define ROUND(len) (((len) + sizeof (Elf32_Word) - 1) & -sizeof (Elf32_Word))
++ Elf32_Addr note_size = 3 * sizeof (Elf32_Word)
++ + ROUND (read32(abi_note[0], be))
++ + ROUND (read32(abi_note[1], be));
+
+ if (size - 32 < note_size || note_size == 0)
+ {
+@@ -140,10 +164,10 @@ process_elf_file32 (const char *file_nam
+ if (size == 0)
+ break;
+
+- *osversion = (abi_note [4] << 24) |
+- ((abi_note [5] & 0xff) << 16) |
+- ((abi_note [6] & 0xff) << 8) |
+- (abi_note [7] & 0xff);
++ *osversion = (read32(abi_note [4], be) << 24) |
++ ((read32(abi_note [5], be) & 0xff) << 16) |
++ ((read32(abi_note [6], be) & 0xff) << 8) |
++ (read32(abi_note [7], be) & 0xff);
+ }
+ break;
+
+@@ -167,13 +191,13 @@ process_elf_file32 (const char *file_nam
+
+ /* Find the string table. */
+ dynamic_strings = NULL;
+- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
+ ++dyn_entry)
+ {
+ check_ptr (dyn_entry);
+- if (dyn_entry->d_tag == DT_STRTAB)
++ if (read32(dyn_entry->d_tag, be) == DT_STRTAB)
+ {
+- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++ dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr);
+ check_ptr (dynamic_strings);
+ break;
+ }
+@@ -183,15 +207,15 @@ process_elf_file32 (const char *file_nam
+ return 1;
+
+ /* Now read the DT_NEEDED and DT_SONAME entries. */
+- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
+ ++dyn_entry)
+ {
+- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
++ if (read32(dyn_entry->d_tag, be) == DT_NEEDED || read32(dyn_entry->d_tag, be) == DT_SONAME)
+ {
+- char *name = dynamic_strings + dyn_entry->d_un.d_val;
++ char *name = dynamic_strings + read32(dyn_entry->d_un.d_val, be);
+ check_ptr (name);
+
+- if (dyn_entry->d_tag == DT_NEEDED)
++ if (read32(dyn_entry->d_tag, be) == DT_NEEDED)
+ {
+
+ if (*flag == FLAG_ELF)
+@@ -208,7 +232,7 @@ process_elf_file32 (const char *file_nam
+ }
+ }
+
+- else if (dyn_entry->d_tag == DT_SONAME)
++ else if (read32(dyn_entry->d_tag, be) == DT_SONAME)
+ *soname = xstrdup (name);
+
+ /* Do we have everything we need? */
+@@ -246,15 +270,17 @@ process_elf_file64 (const char *file_nam
+ elf_header = (Elf64_Ehdr *) file_contents;
+ *osversion = 0;
+
+- if (elf_header->e_type != ET_DYN)
++ be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
++
++ if (read16(elf_header->e_type, be) != ET_DYN)
+ {
+ error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
+- elf_header->e_type);
++ read16(elf_header->e_type, be));
+ return 1;
+ }
+
+ /* Get information from elf program header. */
+- elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
++ elf_pheader = (Elf64_Phdr *) (read64(elf_header->e_phoff, be) + file_contents);
+ check_ptr (elf_pheader);
+
+ /* The library is an elf library, now search for soname and
+@@ -266,27 +292,27 @@ process_elf_file64 (const char *file_nam
+ dynamic_size = 0;
+ program_interpreter = NULL;
+ for (i = 0, segment = elf_pheader;
+- i < elf_header->e_phnum; i++, segment++)
++ i < read16(elf_header->e_phnum, be); i++, segment++)
+ {
+ check_ptr (segment);
+
+- switch (segment->p_type)
++ switch (read32(segment->p_type, be))
+ {
+ case PT_LOAD:
+ if (loadaddr == (Elf64_Addr) -1)
+- loadaddr = segment->p_vaddr - segment->p_offset;
++ loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be);
+ break;
+
+ case PT_DYNAMIC:
+ if (dynamic_addr)
+ error (0, 0, _("more than one dynamic segment\n"));
+
+- dynamic_addr = segment->p_offset;
+- dynamic_size = segment->p_filesz;
++ dynamic_addr = read64(segment->p_offset, be);
++ dynamic_size = read32(segment->p_filesz, be);
+ break;
+
+ case PT_INTERP:
+- program_interpreter = (char *) (file_contents + segment->p_offset);
++ program_interpreter = (char *) (file_contents + read64(segment->p_offset, be));
+ check_ptr (program_interpreter);
+
+ /* Check if this is enough to classify the binary. */
+@@ -300,20 +326,21 @@ process_elf_file64 (const char *file_nam
+ break;
+
+ case PT_NOTE:
+- if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
++ if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
+ {
+ Elf64_Word *abi_note = (Elf64_Word *) (file_contents
+- + segment->p_offset);
+- Elf64_Addr size = segment->p_filesz;
++ + read64(segment->p_offset, be));
++ Elf64_Addr size = read32(segment->p_filesz, be);
+
+- while (abi_note [0] != 4 || abi_note [1] != 16
+- || abi_note [2] != 1
++ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
++ || read32(abi_note [2], be) != 1
+ || memcmp (abi_note + 3, "GNU", 4) != 0)
+ {
++#undef ROUND
+ #define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
+ Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
+- + ROUND (abi_note[0])
+- + ROUND (abi_note[1]);
++ + ROUND (read32(abi_note[0], be))
++ + ROUND (read32(abi_note[1], be));
+
+ if (size - 32 < note_size || note_size == 0)
+ {
+@@ -327,10 +354,10 @@ process_elf_file64 (const char *file_nam
+ if (size == 0)
+ break;
+
+- *osversion = (abi_note [4] << 24) |
+- ((abi_note [5] & 0xff) << 16) |
+- ((abi_note [6] & 0xff) << 8) |
+- (abi_note [7] & 0xff);
++ *osversion = (read32(abi_note [4], be) << 24) |
++ ((read32(abi_note [5], be) & 0xff) << 16) |
++ ((read32(abi_note [6], be) & 0xff) << 8) |
++ (read32(abi_note [7], be) & 0xff);
+ }
+ break;
+
+@@ -354,13 +381,13 @@ process_elf_file64 (const char *file_nam
+
+ /* Find the string table. */
+ dynamic_strings = NULL;
+- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
+ ++dyn_entry)
+ {
+ check_ptr (dyn_entry);
+- if (dyn_entry->d_tag == DT_STRTAB)
++ if (read64(dyn_entry->d_tag, be) == DT_STRTAB)
+ {
+- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++ dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr);
+ check_ptr (dynamic_strings);
+ break;
+ }
+@@ -370,15 +397,15 @@ process_elf_file64 (const char *file_nam
+ return 1;
+
+ /* Now read the DT_NEEDED and DT_SONAME entries. */
+- for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++ for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
+ ++dyn_entry)
+ {
+- if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
++ if (read64(dyn_entry->d_tag, be) == DT_NEEDED || read64(dyn_entry->d_tag, be) == DT_SONAME)
+ {
+- char *name = dynamic_strings + dyn_entry->d_un.d_val;
++ char *name = dynamic_strings + read64(dyn_entry->d_un.d_val, be);
+ check_ptr (name);
+
+- if (dyn_entry->d_tag == DT_NEEDED)
++ if (read64(dyn_entry->d_tag, be) == DT_NEEDED)
+ {
+
+ if (*flag == FLAG_ELF)
+@@ -395,7 +422,7 @@ process_elf_file64 (const char *file_nam
+ }
+ }
+
+- else if (dyn_entry->d_tag == DT_SONAME)
++ else if (read64(dyn_entry->d_tag, be) == DT_SONAME)
+ *soname = xstrdup (name);
+
+ /* Do we have everything we need? */
+Index: ldconfig-native-2.12.1/readlib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readlib.c
++++ ldconfig-native-2.12.1/readlib.c
+@@ -169,7 +169,8 @@ process_file (const char *real_file_name
+ ret = 1;
+ }
+ /* Libraries have to be shared object files. */
+- else if (elf_header->e_type != ET_DYN)
++ else if ((elf_header->e_ident[EI_DATA] == ELFDATA2MSB && be16toh(elf_header->e_type) != ET_DYN) ||
++ (elf_header->e_ident[EI_DATA] == ELFDATA2LSB && le16toh(elf_header->e_type) != ET_DYN))
+ ret = 1;
+ else if (process_elf_file (file_name, lib, flag, osversion, soname,
+ file_contents, statbuf.st_size))
+Index: ldconfig-native-2.12.1/cache.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/cache.c
++++ ldconfig-native-2.12.1/cache.c
+@@ -39,6 +39,29 @@
+ # define N_(msgid) msgid
+ #define _(msg) msg
+
++extern int be;
++
++static uint16_t write16(uint16_t x, int be)
++{
++ if (be)
++ return htobe16(x);
++ return htole16(x);
++}
++
++static uint32_t write32(uint32_t x, int be)
++{
++ if (be)
++ return htobe32(x);
++ return htole32(x);
++}
++
++static uint64_t write64(uint64_t x, int be)
++{
++ if (be)
++ return htobe64(x);
++ return htole64(x);
++}
++
+ struct cache_entry
+ {
+ char *lib; /* Library name. */
+@@ -279,7 +302,12 @@ save_cache (const char *cache_name)
+ /* Number of normal cache entries. */
+ int cache_entry_old_count = 0;
+
+- for (entry = entries; entry != NULL; entry = entry->next)
++ if (be)
++ printf("saving cache in big endian encoding\n");
++ else
++ printf("saving cache in little endian encoding\n");
++
++ for (entry = entries; entry != NULL; entry = entry->next)
+ {
+ /* Account the final NULs. */
+ total_strlen += strlen (entry->lib) + strlen (entry->path) + 2;
+@@ -310,7 +338,7 @@ save_cache (const char *cache_name)
+ memset (file_entries, '\0', sizeof (struct cache_file));
+ memcpy (file_entries->magic, CACHEMAGIC, sizeof CACHEMAGIC - 1);
+
+- file_entries->nlibs = cache_entry_old_count;
++ file_entries->nlibs = write32(cache_entry_old_count, be);
+ }
+
+ struct cache_file_new *file_entries_new = NULL;
+@@ -330,8 +358,8 @@ save_cache (const char *cache_name)
+ memcpy (file_entries_new->version, CACHE_VERSION,
+ sizeof CACHE_VERSION - 1);
+
+- file_entries_new->nlibs = cache_entry_count;
+- file_entries_new->len_strings = total_strlen;
++ file_entries_new->nlibs = write32(cache_entry_count, be);
++ file_entries_new->len_strings = write32(total_strlen, be);
+ }
+
+ /* Pad for alignment of cache_file_new. */
+@@ -358,9 +386,9 @@ save_cache (const char *cache_name)
+ /* First the library. */
+ if (opt_format != 2 && entry->hwcap == 0)
+ {
+- file_entries->libs[idx_old].flags = entry->flags;
++ file_entries->libs[idx_old].flags = write32(entry->flags, be);
+ /* XXX: Actually we can optimize here and remove duplicates. */
+- file_entries->libs[idx_old].key = str_offset + pad;
++ file_entries->libs[idx_old].key = write32(str_offset + pad, be);
+ }
+ if (opt_format != 0)
+ {
+@@ -368,10 +396,10 @@ save_cache (const char *cache_name)
+ not doing so makes the code easier, the string table
+ always begins at the beginning of the the new cache
+ struct. */
+- file_entries_new->libs[idx_new].flags = entry->flags;
+- file_entries_new->libs[idx_new].osversion = entry->osversion;
+- file_entries_new->libs[idx_new].hwcap = entry->hwcap;
+- file_entries_new->libs[idx_new].key = str_offset;
++ file_entries_new->libs[idx_new].flags = write32(entry->flags, be);
++ file_entries_new->libs[idx_new].osversion = write32(entry->osversion, be);
++ file_entries_new->libs[idx_new].hwcap = write64(entry->hwcap, be);
++ file_entries_new->libs[idx_new].key = write32(str_offset, be);
+ }
+
+ size_t len = strlen (entry->lib) + 1;
+@@ -379,9 +407,9 @@ save_cache (const char *cache_name)
+ str_offset += len;
+ /* Then the path. */
+ if (opt_format != 2 && entry->hwcap == 0)
+- file_entries->libs[idx_old].value = str_offset + pad;
++ file_entries->libs[idx_old].value = write32(str_offset + pad, be);
+ if (opt_format != 0)
+- file_entries_new->libs[idx_new].value = str_offset;
++ file_entries_new->libs[idx_new].value = write32(str_offset, be);
+ len = strlen (entry->path) + 1;
+ str = mempcpy (str, entry->path, len);
+ str_offset += len;
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch
new file mode 100644
index 00000000..6aecfe52
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Fix problem during parsing of ELF headers for 64bit on big-endian.
+Some header fields were read with wrong size.
+
+2014/10/24
+Par Olsson <Par.Olsson@windriver.com>
+Shan Hai <shan.hai@windriver.com>
+
+diff --git a/readelflib.c b/readelflib.c
+index 3f5b25b..0bf0de3 100644
+--- a/readelflib.c
++++ b/readelflib.c
+@@ -261,8 +261,8 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ int i;
+ unsigned int j;
+ Elf64_Addr loadaddr;
+- unsigned int dynamic_addr;
+- size_t dynamic_size;
++ Elf64_Addr dynamic_addr;
++ Elf64_Xword dynamic_size;
+ char *program_interpreter;
+
+ Elf64_Ehdr *elf_header;
+@@ -311,7 +311,7 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ error (0, 0, _("more than one dynamic segment\n"));
+
+ dynamic_addr = read64(segment->p_offset, be);
+- dynamic_size = read32(segment->p_filesz, be);
++ dynamic_size = read64(segment->p_filesz, be);
+ break;
+
+ case PT_INTERP:
+@@ -329,11 +329,11 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ break;
+
+ case PT_NOTE:
+- if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
++ if (!*osversion && read64(segment->p_filesz, be) >= 32 && read64(segment->p_align, be) >= 4)
+ {
+ Elf64_Word *abi_note = (Elf64_Word *) (file_contents
+ + read64(segment->p_offset, be));
+- Elf64_Addr size = read32(segment->p_filesz, be);
++ Elf64_Xword size = read64(segment->p_filesz, be);
+
+ while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
+ || read32(abi_note [2], be) != 1
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch
new file mode 100644
index 00000000..a18b2c20
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch
@@ -0,0 +1,113 @@
+Upstream-Status: Inappropriate [fix poky patch]
+
+This patch fixes build issues with a previous endian-ness_handling.patch on
+distros that don't have macros referenced
+
+7/20/2011
+Matthew McClintock <msm@freescale.com>
+
+diff -purN ldconfig-native-2.12.1.orig/endian_extra.h ldconfig-native-2.12.1/endian_extra.h
+--- ldconfig-native-2.12.1.orig/endian_extra.h 1969-12-31 18:00:00.000000000 -0600
++++ ldconfig-native-2.12.1/endian_extra.h 2011-07-19 18:09:14.323048417 -0500
+@@ -0,0 +1,64 @@
++/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <endian.h>
++
++#ifndef _ENDIAN_EXTRA_H
++#define _ENDIAN_EXTRA_H 1
++
++/* Don't redefine these macros if they already exist */
++#ifndef htobe16
++#ifdef __USE_BSD
++/* Conversion interfaces. */
++# include <byteswap.h>
++
++# if __BYTE_ORDER == __LITTLE_ENDIAN
++# define htobe16(x) __bswap_16 (x)
++# define htole16(x) (x)
++# define be16toh(x) __bswap_16 (x)
++# define le16toh(x) (x)
++
++# define htobe32(x) __bswap_32 (x)
++# define htole32(x) (x)
++# define be32toh(x) __bswap_32 (x)
++# define le32toh(x) (x)
++
++# define htobe64(x) __bswap_64 (x)
++# define htole64(x) (x)
++# define be64toh(x) __bswap_64 (x)
++# define le64toh(x) (x)
++# else
++# define htobe16(x) (x)
++# define htole16(x) __bswap_16 (x)
++# define be16toh(x) (x)
++# define le16toh(x) __bswap_16 (x)
++
++# define htobe32(x) (x)
++# define htole32(x) __bswap_32 (x)
++# define be32toh(x) (x)
++# define le32toh(x) __bswap_32 (x)
++
++# define htobe64(x) (x)
++# define htole64(x) __bswap_64 (x)
++# define be64toh(x) (x)
++# define le64toh(x) __bswap_64 (x)
++# endif
++#endif
++#endif
++
++#endif /* endian_extra.h */
+diff -purN ldconfig-native-2.12.1.orig/cache.c ldconfig-native-2.12.1/cache.c
+--- ldconfig-native-2.12.1.orig/cache.c 2011-07-19 18:21:28.347041301 -0500
++++ ldconfig-native-2.12.1/cache.c 2011-07-19 18:22:54.118048064 -0500
+@@ -39,6 +39,8 @@
+ # define N_(msgid) msgid
+ #define _(msg) msg
+
++#include "endian_extra.h"
++
+ extern int be;
+
+ static uint16_t write16(uint16_t x, int be)
+diff -purN ldconfig-native-2.12.1.orig/readelflib.c ldconfig-native-2.12.1/readelflib.c
+--- ldconfig-native-2.12.1.orig/readelflib.c 2011-07-19 18:21:28.346041593 -0500
++++ ldconfig-native-2.12.1/readelflib.c 2011-07-19 18:23:05.324059875 -0500
+@@ -25,6 +25,9 @@
+
+ /* check_ptr checks that a pointer is in the mmaped file and doesn't
+ point outside it. */
++
++#include "endian_extra.h"
++
+ #undef check_ptr
+ #define check_ptr(ptr) \
+ do \
+diff -purN ldconfig-native-2.12.1.orig/readlib.c ldconfig-native-2.12.1/readlib.c
+--- ldconfig-native-2.12.1.orig/readlib.c 2011-07-19 18:21:28.346041593 -0500
++++ ldconfig-native-2.12.1/readlib.c 2011-07-19 18:23:23.877046210 -0500
+@@ -40,6 +40,8 @@
+
+ #include "ldconfig.h"
+
++#include "endian_extra.h"
++
+ #define _(msg) msg
+
+ #define Elf32_CLASS ELFCLASS32
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch
new file mode 100644
index 00000000..4e9aab94
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+The native version of ldconfig was using native definition of LD_SO (i.e.
+ld-linux-x86-64.so.2 ) which is not correct for doing the cross ldconfig.
+This was causing libc.so on the target marked as ELF lib rather than
+FLAG_ELF_LIBC6 in the ld.so.cache.
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/4
+
+Index: ldconfig-native-2.12.1/readlib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readlib.c
++++ ldconfig-native-2.12.1/readlib.c
+@@ -51,6 +51,10 @@ struct known_names
+ int flag;
+ };
+
++/* don't use host's definition of LD_SO */
++#undef LD_SO
++#define LD_SO "ld.so.1"
++
+ static struct known_names interpreters[] =
+ {
+ { "/lib/" LD_SO, FLAG_ELF_LIBC6 },
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch
new file mode 100644
index 00000000..5ed4f6ff
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+make ldconfig default to both /lib+/usr/lib, /lib32+/usr/lib32 and
+/lib64+/usr/lib64 on bi-ABI architectures.
+
+---
+ ldconfig.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff -urpN a/ldconfig.c b/ldconfig.c
+--- a/ldconfig.c
++++ b/ldconfig.c
+@@ -52,7 +52,11 @@
+
+ #define SYSCONFDIR "/etc"
+ #define LIBDIR "/usr/lib"
++#define LIBDIR32 "/usr/lib32"
++#define LIBDIR64 "/usr/lib64"
+ #define SLIBDIR "/lib"
++#define SLIBDIR32 "/lib32"
++#define SLIBDIR64 "/lib64"
+ # define N_(msgid) msgid
+ #define _(msg) msg
+
+@@ -1373,6 +1377,12 @@ main (int argc, char **argv)
+ add_system_dir (SLIBDIR);
+ if (strcmp (SLIBDIR, LIBDIR))
+ add_system_dir (LIBDIR);
++ add_system_dir (SLIBDIR32);
++ if (strcmp (SLIBDIR32, LIBDIR32))
++ add_system_dir (LIBDIR32);
++ add_system_dir (SLIBDIR64);
++ if (strcmp (SLIBDIR64, LIBDIR64))
++ add_system_dir (LIBDIR64);
+ }
+
+ const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
new file mode 100644
index 00000000..dc1e7988
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
Binary files differ
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
new file mode 100644
index 00000000..52986e61
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
@@ -0,0 +1,471 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+enable standalone building of ldconfig
+
+---
+ cache.c | 11 +-
+ chroot_canon.c | 7 +
+ dl-cache.c | 235 ---------------------------------------------------------
+ dl-cache.h | 3
+ ldconfig.c | 27 ++++--
+ readlib.c | 7 +
+ xstrdup.c | 11 --
+ 7 files changed, 45 insertions(+), 256 deletions(-)
+
+Index: ldconfig-native-2.12.1/cache.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/cache.c
++++ ldconfig-native-2.12.1/cache.c
+@@ -16,6 +16,9 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #include <errno.h>
+ #include <error.h>
+ #include <dirent.h>
+@@ -31,8 +34,10 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+
+-#include <ldconfig.h>
+-#include <dl-cache.h>
++#include "ldconfig.h"
++#include "dl-cache.h"
++# define N_(msgid) msgid
++#define _(msg) msg
+
+ struct cache_entry
+ {
+Index: ldconfig-native-2.12.1/chroot_canon.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/chroot_canon.c
++++ ldconfig-native-2.12.1/chroot_canon.c
+@@ -17,6 +17,9 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+@@ -27,7 +30,9 @@
+ #include <stddef.h>
+ #include <stdint.h>
+
+-#include <ldconfig.h>
++#include "ldconfig.h"
++
++#define __set_errno(Val) errno = (Val)
+
+ #ifndef PATH_MAX
+ #define PATH_MAX 1024
+Index: ldconfig-native-2.12.1/dl-cache.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/dl-cache.c
++++ ldconfig-native-2.12.1/dl-cache.c
+@@ -20,12 +20,12 @@
+
+ #include <assert.h>
+ #include <unistd.h>
+-#include <ldsodefs.h>
++//#include "ldsodefs.h"
+ #include <sys/mman.h>
+ #include <dl-cache.h>
+ #include <dl-procinfo.h>
+
+-#include <stdio-common/_itoa.h>
++//#include "_itoa.h"
+
+ #ifndef _DL_PLATFORMS_COUNT
+ # define _DL_PLATFORMS_COUNT 0
+@@ -39,103 +39,7 @@ static size_t cachesize;
+ /* 1 if cache_data + PTR points into the cache. */
+ #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size)
+
+-#define SEARCH_CACHE(cache) \
+-/* We use binary search since the table is sorted in the cache file. \
+- The first matching entry in the table is returned. \
+- It is important to use the same algorithm as used while generating \
+- the cache file. */ \
+-do \
+- { \
+- left = 0; \
+- right = cache->nlibs - 1; \
+- \
+- while (left <= right) \
+- { \
+- __typeof__ (cache->libs[0].key) key; \
+- \
+- middle = (left + right) / 2; \
+- \
+- key = cache->libs[middle].key; \
+- \
+- /* Make sure string table indices are not bogus before using \
+- them. */ \
+- if (! _dl_cache_verify_ptr (key)) \
+- { \
+- cmpres = 1; \
+- break; \
+- } \
+- \
+- /* Actually compare the entry with the key. */ \
+- cmpres = _dl_cache_libcmp (name, cache_data + key); \
+- if (__builtin_expect (cmpres == 0, 0)) \
+- { \
+- /* Found it. LEFT now marks the last entry for which we \
+- know the name is correct. */ \
+- left = middle; \
+- \
+- /* There might be entries with this name before the one we \
+- found. So we have to find the beginning. */ \
+- while (middle > 0) \
+- { \
+- __typeof__ (cache->libs[0].key) key; \
+- \
+- key = cache->libs[middle - 1].key; \
+- /* Make sure string table indices are not bogus before \
+- using them. */ \
+- if (! _dl_cache_verify_ptr (key) \
+- /* Actually compare the entry. */ \
+- || _dl_cache_libcmp (name, cache_data + key) != 0) \
+- break; \
+- --middle; \
+- } \
+- \
+- do \
+- { \
+- int flags; \
+- __typeof__ (cache->libs[0]) *lib = &cache->libs[middle]; \
+- \
+- /* Only perform the name test if necessary. */ \
+- if (middle > left \
+- /* We haven't seen this string so far. Test whether the \
+- index is ok and whether the name matches. Otherwise \
+- we are done. */ \
+- && (! _dl_cache_verify_ptr (lib->key) \
+- || (_dl_cache_libcmp (name, cache_data + lib->key) \
+- != 0))) \
+- break; \
+- \
+- flags = lib->flags; \
+- if (_dl_cache_check_flags (flags) \
+- && _dl_cache_verify_ptr (lib->value)) \
+- { \
+- if (best == NULL || flags == GLRO(dl_correct_cache_id)) \
+- { \
+- HWCAP_CHECK; \
+- best = cache_data + lib->value; \
+- \
+- if (flags == GLRO(dl_correct_cache_id)) \
+- /* We've found an exact match for the shared \
+- object and no general `ELF' release. Stop \
+- searching. */ \
+- break; \
+- } \
+- } \
+- } \
+- while (++middle <= right); \
+- break; \
+- } \
+- \
+- if (cmpres < 0) \
+- left = middle + 1; \
+- else \
+- right = middle - 1; \
+- } \
+- } \
+-while (0)
+-
+-
+ int
+-internal_function
+ _dl_cache_libcmp (const char *p1, const char *p2)
+ {
+ while (*p1 != '\0')
+@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const
+ }
+ return *p1 - *p2;
+ }
+-
+-
+-/* Look up NAME in ld.so.cache and return the file name stored there,
+- or null if none is found. */
+-
+-const char *
+-internal_function
+-_dl_load_cache_lookup (const char *name)
+-{
+- int left, right, middle;
+- int cmpres;
+- const char *cache_data;
+- uint32_t cache_data_size;
+- const char *best;
+-
+- /* Print a message if the loading of libs is traced. */
+- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
+- _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
+-
+- if (cache == NULL)
+- {
+- /* Read the contents of the file. */
+- void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
+- PROT_READ);
+-
+- /* We can handle three different cache file formats here:
+- - the old libc5/glibc2.0/2.1 format
+- - the old format with the new format in it
+- - only the new format
+- The following checks if the cache contains any of these formats. */
+- if (file != MAP_FAILED && cachesize > sizeof *cache
+- && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0)
+- {
+- size_t offset;
+- /* Looks ok. */
+- cache = file;
+-
+- /* Check for new version. */
+- offset = ALIGN_CACHE (sizeof (struct cache_file)
+- + cache->nlibs * sizeof (struct file_entry));
+-
+- cache_new = (struct cache_file_new *) ((void *) cache + offset);
+- if (cachesize < (offset + sizeof (struct cache_file_new))
+- || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW,
+- sizeof CACHEMAGIC_VERSION_NEW - 1) != 0)
+- cache_new = (void *) -1;
+- }
+- else if (file != MAP_FAILED && cachesize > sizeof *cache_new
+- && memcmp (file, CACHEMAGIC_VERSION_NEW,
+- sizeof CACHEMAGIC_VERSION_NEW - 1) == 0)
+- {
+- cache_new = file;
+- cache = file;
+- }
+- else
+- {
+- if (file != MAP_FAILED)
+- __munmap (file, cachesize);
+- cache = (void *) -1;
+- }
+-
+- assert (cache != NULL);
+- }
+-
+- if (cache == (void *) -1)
+- /* Previously looked for the cache file and didn't find it. */
+- return NULL;
+-
+- best = NULL;
+-
+- if (cache_new != (void *) -1)
+- {
+- uint64_t platform;
+-
+- /* This is where the strings start. */
+- cache_data = (const char *) cache_new;
+-
+- /* Now we can compute how large the string table is. */
+- cache_data_size = (const char *) cache + cachesize - cache_data;
+-
+- platform = _dl_string_platform (GLRO(dl_platform));
+- if (platform != (uint64_t) -1)
+- platform = 1ULL << platform;
+-
+-#define _DL_HWCAP_TLS_MASK (1LL << 63)
+- uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask))
+- | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
+-
+- /* Only accept hwcap if it's for the right platform. */
+-#define HWCAP_CHECK \
+- if (lib->hwcap & hwcap_exclude) \
+- continue; \
+- if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion)) \
+- continue; \
+- if (_DL_PLATFORMS_COUNT \
+- && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0 \
+- && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform) \
+- continue
+- SEARCH_CACHE (cache_new);
+- }
+- else
+- {
+- /* This is where the strings start. */
+- cache_data = (const char *) &cache->libs[cache->nlibs];
+-
+- /* Now we can compute how large the string table is. */
+- cache_data_size = (const char *) cache + cachesize - cache_data;
+-
+-#undef HWCAP_CHECK
+-#define HWCAP_CHECK do {} while (0)
+- SEARCH_CACHE (cache);
+- }
+-
+- /* Print our result if wanted. */
+- if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)
+- && best != NULL)
+- _dl_debug_printf (" trying file=%s\n", best);
+-
+- return best;
+-}
+-
+-#ifndef MAP_COPY
+-/* If the system does not support MAP_COPY we cannot leave the file open
+- all the time since this would create problems when the file is replaced.
+- Therefore we provide this function to close the file and open it again
+- once needed. */
+-void
+-_dl_unload_cache (void)
+-{
+- if (cache != NULL && cache != (struct cache_file *) -1)
+- {
+- __munmap (cache, cachesize);
+- cache = NULL;
+- }
+-}
+-#endif
+Index: ldconfig-native-2.12.1/dl-cache.h
+===================================================================
+--- ldconfig-native-2.12.1.orig/dl-cache.h
++++ ldconfig-native-2.12.1/dl-cache.h
+@@ -101,5 +101,4 @@ struct cache_file_new
+ (((addr) + __alignof__ (struct cache_file_new) -1) \
+ & (~(__alignof__ (struct cache_file_new) - 1)))
+
+-extern int _dl_cache_libcmp (const char *p1, const char *p2)
+- internal_function;
++extern int _dl_cache_libcmp (const char *p1, const char *p2);
+Index: ldconfig-native-2.12.1/ldconfig.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/ldconfig.c
++++ ldconfig-native-2.12.1/ldconfig.c
+@@ -16,6 +16,9 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #define PROCINFO_CLASS static
+ #include <alloca.h>
+ #include <argp.h>
+@@ -39,10 +42,20 @@
+ #include <glob.h>
+ #include <libgen.h>
+
+-#include <ldconfig.h>
+-#include <dl-cache.h>
++#include "ldconfig.h"
++#include "dl-cache.h"
++
++#include "dl-procinfo.h"
++
++#include "argp.h"
++
++
++#define SYSCONFDIR "/etc"
++#define LIBDIR "/usr/lib"
++#define SLIBDIR "/lib"
++# define N_(msgid) msgid
++#define _(msg) msg
+
+-#include <dl-procinfo.h>
+
+ #ifdef _DL_FIRST_PLATFORM
+ # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
+@@ -55,7 +68,7 @@
+ #endif
+
+ /* Get libc version number. */
+-#include <version.h>
++#include "version.h"
+
+ #define PACKAGE _libc_intl_domainname
+
+@@ -152,8 +165,8 @@ static const struct argp_option options[
+ { NULL, 0, NULL, 0, NULL, 0 }
+ };
+
+-#define PROCINFO_CLASS static
+-#include <dl-procinfo.c>
++//#define PROCINFO_CLASS static
++//#include <dl-procinfo.c>
+
+ /* Short description of program. */
+ static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.");
+@@ -291,6 +304,7 @@ parse_opt (int key, char *arg, struct ar
+ return 0;
+ }
+
++#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org"
+ /* Print bug-reporting information in the help message. */
+ static char *
+ more_help (int key, const char *text, void *input)
+@@ -315,7 +329,7 @@ For bug reporting instructions, please s
+ static void
+ print_version (FILE *stream, struct argp_state *state)
+ {
+- fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION);
++ fprintf (stream, "ldconfig (Hacked Poky Version)\n");
+ fprintf (stream, gettext ("\
+ Copyright (C) %s Free Software Foundation, Inc.\n\
+ This is free software; see the source for copying conditions. There is NO\n\
+@@ -1233,6 +1247,7 @@ set_hwcap (void)
+ hwcap_mask = strtoul (mask, NULL, 0);
+ }
+
++const char _libc_intl_domainname[] = "libc";
+
+ int
+ main (int argc, char **argv)
+Index: ldconfig-native-2.12.1/readlib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readlib.c
++++ ldconfig-native-2.12.1/readlib.c
+@@ -22,6 +22,9 @@
+ development version. Besides the simplification, it has also been
+ modified to read some other file formats. */
+
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #include <a.out.h>
+ #include <elf.h>
+ #include <error.h>
+@@ -35,7 +38,9 @@
+ #include <sys/stat.h>
+ #include <gnu/lib-names.h>
+
+-#include <ldconfig.h>
++#include "ldconfig.h"
++
++#define _(msg) msg
+
+ #define Elf32_CLASS ELFCLASS32
+ #define Elf64_CLASS ELFCLASS64
+Index: ldconfig-native-2.12.1/xstrdup.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/xstrdup.c
++++ ldconfig-native-2.12.1/xstrdup.c
+@@ -16,15 +16,10 @@
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+-#ifdef HAVE_CONFIG_H
+-# include <config.h>
+-#endif
++#define _GNU_SOURCE
++
++#include <string.h>
+
+-#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC
+-# include <string.h>
+-#else
+-# include <strings.h>
+-#endif
+ void *xmalloc (size_t n) __THROW;
+ char *xstrdup (char *string) __THROW;
+
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
new file mode 100644
index 00000000..27bc4110
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Pending
+
+Coming from this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11149
+
+Nitin A Kamble <nitin.a.kamble@intel.com>2011/03/29
+
+--- ldconfig-native-2.12.1.orig/ldconfig.c
++++ ldconfig-native-2.12.1/ldconfig.c
+@@ -1359,14 +1359,9 @@ main (int argc, char **argv)
+
+ const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
+ if (opt_chroot)
+- {
+- aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
+- if (aux_cache_file == NULL)
+- error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
+- _PATH_LDCONFIG_AUX_CACHE);
+- }
++ aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
+
+- if (! opt_ignore_aux_cache)
++ if (! opt_ignore_aux_cache && aux_cache_file)
+ load_aux_cache (aux_cache_file);
+ else
+ init_aux_cache ();
+@@ -1376,7 +1371,8 @@ main (int argc, char **argv)
+ if (opt_build_cache)
+ {
+ save_cache (cache_file);
+- save_aux_cache (aux_cache_file);
++ if (aux_cache_file)
++ save_aux_cache (aux_cache_file);
+ }
+
+ return 0;
+
diff --git a/external/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb b/external/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
new file mode 100644
index 00000000..93c0b186
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "A standalone native ldconfig build"
+
+LICENSE = "GPLv2+"
+
+LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399"
+
+SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \
+ file://ldconfig.patch \
+ file://ldconfig_aux-cache_path_fix.patch \
+ file://32and64bit.patch \
+ file://endian-ness_handling.patch \
+ file://flag_fix.patch \
+ file://endianess-header.patch \
+ file://ldconfig-default-to-all-multilib-dirs.patch \
+ file://endian-ness_handling_fix.patch \
+ file://add-64-bit-flag-for-ELF64-entries.patch \
+"
+
+PR = "r2"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${P}:"
+
+inherit native
+
+S = "${WORKDIR}/${PN}-${PV}"
+
+do_compile () {
+ $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c -I. dl-cache.c -o ldconfig
+}
+
+do_install () {
+ install -d ${D}/${bindir}/
+ install ldconfig ${D}/${bindir}/
+}
diff --git a/external/poky/meta/recipes-core/glibc/site_config/funcs b/external/poky/meta/recipes-core/glibc/site_config/funcs
new file mode 100644
index 00000000..ccc85392
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/site_config/funcs
@@ -0,0 +1,474 @@
+a64l
+abs
+access
+__adjtimex
+alarm
+alphasort
+argz_append
+__argz_count
+argz_create_sep
+argz_insert
+__argz_next
+argz_next
+__argz_stringify
+argz_stringify
+asprintf
+atexit
+atof
+atoi
+bcmp
+bcopy
+bindresvport
+bind_textdomain_codeset
+btowc
+bzero
+calloc
+canonicalize_file_name
+catgets
+cfgetospeed
+cfsetispeed
+cfsetspeed
+chmod
+chown
+chroot
+clock
+close
+closedir
+closelog
+confstr
+connect
+daemon
+dcgettext
+difftime
+dirfd
+dirname
+dngettext
+dup2
+ecvt
+endgrent
+endmntent
+endpwent
+endutent
+endutxent
+epoll_ctl
+err
+ether_hostton
+ether_ntohost
+euidaccess
+execv
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fcntl
+fcvt
+fdatasync
+fdopendir
+feof_unlocked
+fgets_unlocked
+fgetxattr
+finite
+flistxattr
+flock
+flockfile
+fnmatch
+fork
+fpathconf
+__fpending
+fprintf
+free
+freeaddrinfo
+freeifaddrs
+fseeko
+__fsetlocking
+fsetxattr
+fstat64
+fstat
+fstatfs
+fsync
+ftello
+ftime
+ftruncate
+funlockfile
+futimes
+futimesat
+gai_strerror
+gcvt
+getaddrinfo
+getc_unlocked
+getcwd
+getdelim
+getdomainname
+getdtablesize
+getegid
+getenv
+geteuid
+getgid
+getgrent
+getgrent_r
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getgroups
+gethostbyaddr_r
+gethostbyname2
+gethostbyname
+gethostbyname_r
+gethostent
+gethostid
+gethostname
+getifaddrs
+getline
+getloadavg
+getmntent
+getmsg
+getnameinfo
+getnetbyaddr_r
+getnetgrent_r
+getopt
+getopt_long
+getopt_long_only
+getpagesize
+getpass
+getpeername
+getpgrp
+getpid
+getppid
+getprotoent_r
+getpwent
+getpwent_r
+getpwnam
+getpwnam_r
+getpwuid
+getpwuid_r
+getresuid
+getrlimit
+getrusage
+getservbyname
+getservbyname_r
+getservbyport_r
+getservent
+getservent_r
+getspnam
+getspnam_r
+gettimeofday
+getttyent
+getttynam
+getuid
+getusershell
+getutent
+getutid
+getutline
+getutmp
+getutmpx
+getutxent
+getutxid
+getutxline
+getwd
+getxattr
+glob
+gmtime
+gmtime_r
+grantpt
+group_member
+herror
+hstrerror
+iconv
+iconv_open
+if_freenameindex
+if_indextoname
+if_nameindex
+if_nametoindex
+index
+inet_addr
+inet_aton
+inet_ntoa
+inet_ntop
+inet_pton
+initgroups
+innetgr
+iruserok
+isascii
+isatty
+isblank
+isgraph
+isinf
+isnan
+isprint
+isspace
+iswalnum
+iswcntrl
+iswctype
+iswprint
+iswspace
+iswupper
+isxdigit
+kill
+killpg
+lchown
+lckpwdf
+lgetxattr
+link
+listxattr
+llistxattr
+localtime
+localtime_r
+lockf
+lrand48
+lsearch
+lseek64
+lsetxattr
+lstat
+mallinfo
+malloc
+mblen
+mbrlen
+mbrtowc
+mbsinit
+mbsrtowcs
+mbtowc
+memalign
+memchr
+memcmp
+memcpy
+memmove
+mempcpy
+memrchr
+memset
+mkdir
+mkdirat
+mkdtemp
+mkfifo
+mknod
+mkstemp64
+mkstemp
+mktime
+mlock
+mmap
+mtrace
+munlock
+munmap
+nanosleep
+nice
+nl_langinfo
+ntp_adjtime
+ntp_gettime
+_obstack_free
+on_exit
+open64
+open
+openat
+opendir
+openlog
+pathconf
+pipe
+poll
+popen
+posix_memalign
+prctl
+pread
+printf
+__progname
+pselect
+pthread_mutex_lock
+ptsname
+putenv
+putgrent
+putpwent
+putspent
+pututline
+pututxline
+putwc
+pwrite
+qsort
+raise
+rand
+random
+rand_r
+read
+readdir
+readdir_r
+readlink
+realloc
+realpath
+re_comp
+recvmsg
+re_exec
+regcomp
+regexec
+remove
+rename
+re_search
+rmdir
+rpmatch
+rresvport_af
+ruserok
+ruserok_af
+sbrk
+scandir
+sched_setscheduler
+sched_yield
+__secure_getenv
+select
+semctl
+semget
+sendmsg
+setbuf
+setbuffer
+setegid
+setenv
+seteuid
+setgid
+setgroups
+sethostname
+setitimer
+_setjmp
+setjmp
+setlinebuf
+setlocale
+setmntent
+setpgid
+setpgrp
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setsid
+setsockopt
+settimeofday
+setuid
+setutent
+setutxent
+setvbuf
+setxattr
+sgetspent
+shmat
+shmctl
+shmdt
+shmget
+shutdown
+sigaction
+sigaddset
+sigaltstack
+sigblock
+sigemptyset
+sighold
+siginterrupt
+signal
+sigprocmask
+sigset
+sigsetmask
+sigstack
+sigsuspend
+sigvec
+snprintf
+socket
+socketpair
+sprintf
+srand48
+srand
+srandom
+sscanf
+stat
+statfs
+statvfs
+stime
+stpcpy
+strcasecmp
+strcasestr
+strchr
+strchrnul
+strcmp
+strcspn
+strdup
+strerror
+strerror_r
+strftime
+strlen
+strncasecmp
+strncmp
+strndup
+strnlen
+strpbrk
+strptime
+strrchr
+strsep
+strsignal
+strspn
+strstr
+strtod
+strtoimax
+strtok_r
+strtol
+strtoll
+strtoul
+strtoull
+strtoumax
+strverscmp
+strxfrm
+symlink
+sync
+sysconf
+sysctl
+sysinfo
+syslog
+_sys_siglist
+sys_siglist
+system
+tcgetattr
+tcgetpgrp
+tcsetattr
+tcsetpgrp
+time
+timegm
+times
+timezone
+tmpnam
+towlower
+towupper
+truncate
+tsearch
+ttyname
+tzset
+ulimit
+umask
+uname
+unlink
+unsetenv
+unshare
+updwtmp
+updwtmpx
+usleep
+ustat
+utime
+utimes
+utmpname
+utmpxname
+valloc
+vasprintf
+verrx
+vfork
+vfprintf
+vfscanf
+vhangup
+vprintf
+vsnprintf
+vsprintf
+wait3
+wait4
+waitpid
+wcrtomb
+wcscoll
+wcsdup
+wcslen
+wctob
+wctomb
+wctype
+wcwidth
+wmemchr
+wmemcpy
+wmempcpy
diff --git a/external/poky/meta/recipes-core/glibc/site_config/headers b/external/poky/meta/recipes-core/glibc/site_config/headers
new file mode 100644
index 00000000..69fedea4
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/site_config/headers
@@ -0,0 +1,155 @@
+aio.h
+alloca.h
+argz.h
+arpa/inet.h
+arpa/nameser.h
+asm/byteorder.h
+asm/ioctls.h
+asm/page.h
+asm/types.h
+assert.h
+byteswap.h
+ctype.h
+dirent.h
+dlfcn.h
+elf.h
+endian.h
+err.h
+errno.h
+execinfo.h
+fcntl.h
+features.h
+float.h
+fstab.h
+ftw.h
+getopt.h
+glob.h
+grp.h
+iconv.h
+ifaddrs.h
+inttypes.h
+langinfo.h
+lastlog.h
+libgen.h
+libintl.h
+limits.h
+linux/capability.h
+linux/fd.h
+linux/fs.h
+linux/hayesesp.h
+linux/hdreg.h
+linux/icmp.h
+linux/in6.h
+linux/joystick.h
+linux/ptrace.h
+linux/serial.h
+linux/sonypi.h
+linux/unistd.h
+linux/utsname.h
+linux/version.h
+locale.h
+malloc.h
+math.h
+mcheck.h
+memory.h
+mntent.h
+mqueue.h
+netdb.h
+net/if.h
+netinet/ether.h
+netinet/in.h
+netinet/ip6.h
+netinet/ip.h
+netinet/tcp.h
+netinet/udp.h
+netipx/ipx.h
+net/route.h
+paths.h
+poll.h
+pthread.h
+pty.h
+pwd.h
+regex.h
+resolv.h
+rpc/rpc.h
+rpc/types.h
+sched.h
+scsi/scsi.h
+search.h
+semaphore.h
+setjmp.h
+sgtty.h
+shadow.h
+signal.h
+stdarg.h
+stdbool.h
+stdc
+stddef.h
+stdint.h
+stdio.h
+stdlib.h
+string.h
+strings.h
+stropts.h
+sys/bitypes.h
+sys/cdefs.h
+sys/dir.h
+sys/epoll.h
+sysexits.h
+sys/fcntl.h
+sys/file.h
+sys/fsuid.h
+sys/ioctl.h
+sys/ipc.h
+syslog.h
+sys/mman.h
+sys/mount.h
+sys/mtio.h
+sys/param.h
+sys/poll.h
+sys/prctl.h
+sys/ptrace.h
+sys/queue.h
+sys/reg.h
+sys/resource.h
+sys/select.h
+sys/sem.h
+sys/shm.h
+sys/signal.h
+sys/socket.h
+sys/socketvar.h
+sys/soundcard.h
+sys/statfs.h
+sys/stat.h
+sys/statvfs.h
+sys/stropts.h
+sys/swap.h
+sys/sysctl.h
+sys/sysinfo.h
+sys/sysmacros.h
+sys/termios.h
+sys/timeb.h
+sys/time.h
+sys/times.h
+sys/timex.h
+sys/types.h
+sys/uio.h
+sys/un.h
+sys/unistd.h
+sys/user.h
+sys/utsname.h
+sys/vfs.h
+sys/wait.h
+termio.h
+termios.h
+time.h
+ttyent.h
+ulimit.h
+unistd.h
+ustat.h
+utime.h
+utmp.h
+utmpx.h
+values.h
+wchar.h
+wctype.h
diff --git a/external/poky/meta/recipes-core/glibc/site_config/types b/external/poky/meta/recipes-core/glibc/site_config/types
new file mode 100644
index 00000000..178bd85a
--- /dev/null
+++ b/external/poky/meta/recipes-core/glibc/site_config/types
@@ -0,0 +1,21 @@
+char
+char *
+double
+float
+int
+long
+long double
+long int
+long long
+long long int
+short
+short int
+signed char
+unsigned char
+unsigned int
+unsigned long
+unsigned long int
+unsigned long long int
+unsigned short
+unsigned short int
+void *
diff --git a/external/poky/meta/recipes-core/ifupdown/files/99_network b/external/poky/meta/recipes-core/ifupdown/files/99_network
new file mode 100644
index 00000000..42d5895d
--- /dev/null
+++ b/external/poky/meta/recipes-core/ifupdown/files/99_network
@@ -0,0 +1 @@
+d root root 0755 /run/network none
diff --git a/external/poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch b/external/poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch
new file mode 100644
index 00000000..a24b8cda
--- /dev/null
+++ b/external/poky/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch
@@ -0,0 +1,57 @@
+From 7af9db748974cb3a2c6ef8f9e03d7db1f9f8ee16 Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Wed, 6 Aug 2014 14:54:12 -0400
+Subject: [PATCH 1/2] defn2[c|man]: don't rely on dpkg-architecture to set arch
+
+In yocto we'll always be cross compiling, and we'll always
+be building on linux for linux (vs. *BSD, hurd, etc.)
+
+Without this the arch is not detected, but it doesn't error
+out, and hence you get useless binaries that don't know any
+arch specific methods, and the end result will be strangeness
+like the loopback device not being configured/enabled.
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+Upstream-Status: Pending
+---
+ defn2c.pl | 6 +++---
+ defn2man.pl | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/defn2c.pl b/defn2c.pl
+index c449de2f3d1c..38845e374c76 100755
+--- a/defn2c.pl
++++ b/defn2c.pl
+@@ -2,9 +2,9 @@
+
+ use strict;
+
+-my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
+-
+-$DEB_HOST_ARCH_OS =~ s/\n//;
++#my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
++#$DEB_HOST_ARCH_OS =~ s/\n//;
++my $DEB_HOST_ARCH_OS ="linux";
+
+ # declarations
+ my $address_family = "";
+diff --git a/defn2man.pl b/defn2man.pl
+index 6ddcfdd4fe68..c9c4dd046597 100755
+--- a/defn2man.pl
++++ b/defn2man.pl
+@@ -2,9 +2,9 @@
+
+ use strict;
+
+-my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
+-
+-$DEB_HOST_ARCH_OS =~ s/\n//;
++#my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
++#$DEB_HOST_ARCH_OS =~ s/\n//;
++my $DEB_HOST_ARCH_OS = "linux";
+
+ # declarations
+ my $line;
+--
+1.9.1
+
diff --git a/external/poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch b/external/poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
new file mode 100644
index 00000000..37a61c9b
--- /dev/null
+++ b/external/poky/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
@@ -0,0 +1,406 @@
+From 7efe4676747e4e4a056b9bfb4e9424c8354e9996 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Wed, 21 Dec 2016 15:32:07 +0200
+Subject: [PATCH] inet[6].defn: fix inverted checks for loopback
+
+Compared to the hurd link.defn for loopback, we see these
+are inverted, meaning that you would only be able to configure
+a loopback device that was _not_ named "lo" (unlikely to exist).
+
+The result was that we'd update /run/network/ifstate for "lo"
+but never actually do anything for up/down, as shown below:
+
+root@localhost:~# ifconfig -s
+Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0 1500 0 7736329 0 2016 0 5289422 0 0 0 BMRU
+lo 65536 0 18 0 0 0 18 0 0 0 LRU
+root@localhost:~# ifdown lo
+root@localhost:~# echo $?
+0
+root@localhost:~# ifconfig -s
+Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0 1500 0 7736406 0 2016 0 5289455 0 0 0 BMRU
+lo 65536 0 18 0 0 0 18 0 0 0 LRU
+root@localhost:~# ifconfig lo down
+root@localhost:~# ifconfig -s
+Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0 1500 0 7736474 0 2016 0 5289481 0 0 0 BMRU
+root@localhost:~#
+
+Also reverted the commit:
+commit 80b878497663dae08f70b4d3cffe127b57a3cfc
+which uses absolute paths to binaries called by ifup/ifdown.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ inet.defn | 140 +++++++++++++++++++++++++++++++-------------------------------
+ 1 file changed, 70 insertions(+), 70 deletions(-)
+
+diff --git a/inet.defn b/inet.defn
+index 75e6744..23c7756 100644
+--- a/inet.defn
++++ b/inet.defn
+@@ -6,10 +6,10 @@ method loopback
+ This method may be used to define the IPv4 loopback interface.
+
+ up
+- /bin/ip link set dev %iface% up if (!iface_is_lo())
++ ip link set dev %iface% up if (!iface_is_lo())
+
+ down
+- /bin/ip link set dev %iface% down if (!iface_is_lo())
++ ip link set dev %iface% down if (!iface_is_lo())
+
+ method static
+ description
+@@ -36,17 +36,17 @@ method static
+ broadcast compute_v4_broadcast
+
+ up
+- /bin/ip addr add %address%[[/%netmask%]] [[broadcast %broadcast%]] \
++ ip addr add %address%[[/%netmask%]] [[broadcast %broadcast%]] \
+ [[peer %pointopoint%]] [[scope %scope%]] dev %iface% label %iface%
+- /bin/ip link set dev %iface% [[mtu %mtu%]] [[address %hwaddress%]] up
++ ip link set dev %iface% [[mtu %mtu%]] [[address %hwaddress%]] up
+
+- [[ /bin/ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
++ [[ ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
+
+ down
+- [[ /bin/ip route del default via %gateway% [[metric %metric%]] dev %iface% 2>&1 1>/dev/null || true ]]
+- /bin/ip addr del %address%[[/%netmask%]] [[broadcast %broadcast%]] \
++ [[ ip route del default via %gateway% [[metric %metric%]] dev %iface% 2>&1 1>/dev/null || true ]]
++ ip addr del %address%[[/%netmask%]] [[broadcast %broadcast%]] \
+ [[peer %pointopoint%]] [[scope %scope%]] dev %iface% label %iface%
+- /bin/ip link set dev %iface% down \
++ ip link set dev %iface% down \
+ if (iface_is_link())
+
+ method manual
+@@ -63,12 +63,12 @@ method manual
+ hwaddress cleanup_hwaddress
+
+ up
+- [[/bin/ip link set dev %iface% mtu %mtu%]]
+- [[/bin/ip link set dev %iface% address %hwaddress%]]
+- /bin/ip link set dev %iface% up 2>/dev/null || true
++ [[ip link set dev %iface% mtu %mtu%]]
++ [[ip link set dev %iface% address %hwaddress%]]
++ ip link set dev %iface% up 2>/dev/null || true
+
+ down
+- /bin/ip link set dev %iface% down 2>/dev/null || true \
++ ip link set dev %iface% down 2>/dev/null || true \
+ if (iface_is_link() && !do_all)
+
+ method dhcp
+@@ -93,33 +93,33 @@ method dhcp
+ hwaddress cleanup_hwaddress
+
+ up
+- [[/bin/ip link set dev %iface% address %hwaddress%]]
+- /sbin/dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++ [[ip link set dev %iface% address %hwaddress%]]
++ dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ [[-e IF_METRIC=%metric%]] \
+ if (execable("/sbin/dhclient"))
+- /sbin/pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \
++ pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \
+ elsif (execable("/sbin/pump"))
+- /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \
++ udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-x hostname:%hostname%]] \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
++ dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
+ [[-l %leasetime%]] [[-m %metric%]] %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+ down
+- /sbin/dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++ dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ if (execable("/sbin/dhclient"))
+- /sbin/pump -i %iface% -r \
++ pump -i %iface% -r \
+ elsif (execable("/sbin/pump"))
+- if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \
++ if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd -k %iface% \
++ dhcpcd -k %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+- /bin/ip link set dev %iface% down \
++ ip link set dev %iface% down \
+ if (iface_is_link())
+
+ method bootp
+@@ -134,11 +134,11 @@ method bootp
+ whatever it really is.
+
+ up
+- /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
++ bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
+ [[--hwaddr %hwaddr%]] --returniffail --serverbcast
+
+ down
+- /bin/ip link set dev %iface% down \
++ ip link set dev %iface% down \
+ if (iface_is_link())
+
+ method tunnel
+@@ -158,13 +158,13 @@ method tunnel
+ ttl time -- TTL setting
+ mtu size -- MTU size
+ up
+- /bin/ip tunnel add %iface% mode %mode% remote %endpoint% [[local %local%]] \
++ ip tunnel add %iface% mode %mode% remote %endpoint% [[local %local%]] \
+ [[ttl %ttl%]]
+- /bin/ip link set %iface% up [[mtu %mtu%]]
+- /bin/ip addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]]
+- [[ /bin/ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
++ ip link set %iface% up [[mtu %mtu%]]
++ ip addr add %address%/%netmask% dev %iface% [[peer %dstaddr%]]
++ [[ ip route add default via %gateway% [[metric %metric%]] dev %iface% onlink ]]
+ down
+- /bin/ip tunnel del %iface%
++ ip tunnel del %iface%
+
+ method ppp
+ description
+@@ -175,9 +175,9 @@ method ppp
+ unit number -- Use /number/ as the ppp unit number.
+ options string -- Pass /string/ as additional options to pon.
+ up
+- /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]]
++ pon [[%provider%]] [[unit %unit%]] [[%options%]]
+ down
+- /usr/bin/poff [[%provider%]]
++ poff [[%provider%]]
+
+ method wvdial
+ description
+@@ -186,10 +186,10 @@ method wvdial
+ options
+ provider name -- Use /name/ as the provider (from /etc/wvdial.conf).
+ up
+- /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
++ start-stop-daemon --start -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]]
+ down
+- /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
++ start-stop-daemon --stop -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface%.pid -s 2
+
+
+@@ -200,9 +200,9 @@ method ipv4ll
+ known as APIPA or IPAC, and often colloquially referred to
+ as "Zeroconf address".
+ up
+- /usr/sbin/avahi-autoipd -D %iface%
++ avahi-autoipd -D %iface%
+ down
+- /usr/sbin/avahi-autoipd --kill %iface%
++ avahi-autoipd --kill %iface%
+
+ architecture kfreebsd
+
+@@ -211,11 +211,11 @@ method loopback
+ This method may be used to define the IPv4 loopback interface.
+
+ up
+- /sbin/ifconfig %iface% 127.0.0.1 up \
++ ifconfig %iface% 127.0.0.1 up \
+ if (!iface_is_lo())
+
+ down
+- /sbin/ifconfig %iface% down \
++ ifconfig %iface% down \
+ if (!iface_is_lo())
+
+ method static
+@@ -238,15 +238,15 @@ method static
+ hwaddress cleanup_hwaddress
+
+ up
+- [[ /sbin/ifconfig %iface% link %hwaddress%]]
+- /sbin/ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \
++ [[ ifconfig %iface% link %hwaddress%]]
++ ifconfig %iface% %address% [[netmask %netmask%]] [[broadcast %broadcast%]] \
+ [[pointopoint %pointopoint%]] [[media %media%]] [[mtu %mtu%]] \
+ up
+- [[ /sbin/route add default %gateway% ]]
++ [[ route add default %gateway% ]]
+
+ down
+- [[ /sbin/route del default %gateway% 2>&1 1>/dev/null || true ]]
+- /sbin/ifconfig %iface% down
++ [[ route del default %gateway% 2>&1 1>/dev/null || true ]]
++ ifconfig %iface% down
+
+ method manual
+ description
+@@ -279,30 +279,30 @@ method dhcp
+ hwaddress cleanup_hwaddress
+
+ up
+- [[/sbin/ifconfig %iface% link %hwaddress%]]
+- /sbin/dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++ [[ifconfig %iface% link %hwaddress%]]
++ dhclient -v -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ [[-e IF_METRIC=%metric%]] \
+ if (execable("/sbin/dhclient"))
+- /sbin/udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \
++ udhcpc -n -p /run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \
+ [[-c %client%]] \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
++ dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
+ [[-l %leasetime%]] %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+ down
+- /sbin/dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
++ dhclient -v -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
+ if (execable("/sbin/dhclient"))
+- if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface%.pid); fi \
++ if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd -k %iface% \
++ dhcpcd -k %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+- /sbin/ifconfig %iface% down
++ ifconfig %iface% down
+
+ method bootp
+ description
+@@ -316,11 +316,11 @@ method bootp
+ whatever it really is.
+
+ up
+- /sbin/bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
++ bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
+ [[--hwaddr %hwaddr%]] --returniffail --serverbcast
+
+ down
+- /sbin/ifconfig %iface% down
++ ifconfig %iface% down
+
+ method ppp
+ description
+@@ -331,9 +331,9 @@ method ppp
+ unit number -- Use /number/ as the ppp unit number.
+ options string -- Pass /string/ as additional options to pon.
+ up
+- /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]]
++ pon [[%provider%]] [[unit %unit%]] [[%options%]]
+ down
+- /usr/bin/poff [[%provider%]]
++ poff [[%provider%]]
+
+ method wvdial
+ description
+@@ -342,10 +342,10 @@ method wvdial
+ options
+ provider name -- Use /name/ as the provider (from /etc/wvdial.conf).
+ up
+- /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
++ start-stop-daemon --start -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface%.pid -b -m -- [[ %provider% ]]
+ down
+- /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
++ start-stop-daemon --stop -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface%.pid -s 2
+
+
+@@ -356,9 +356,9 @@ method ipv4ll
+ known as APIPA or IPAC, and often colloquially referred to
+ as "Zeroconf address".
+ up
+- /usr/sbin/avahi-autoipd -D %iface%
++ avahi-autoipd -D %iface%
+ down
+- /usr/sbin/avahi-autoipd --kill %iface%
++ avahi-autoipd --kill %iface%
+ architecture hurd
+
+ method loopback
+@@ -432,23 +432,23 @@ method dhcp
+
+ up
+ [[Warning: Option hwaddress: %hwaddress% not yet supported]]
+- /sbin/dhclient -v -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
++ dhclient -v -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
+ if (execable("/sbin/dhclient"))
+- /sbin/udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \
++ udhcpc -n -p /run/udhcpc.%iface///.%.pid -i %iface% [[-H %hostname%]] \
+ [[-c %client%]] \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
++ dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %client%]] \
+ [[-l %leasetime%]] %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+
+ down
+- /sbin/dhclient -v -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
++ dhclient -v -r -pf /run/dhclient.%iface///.%.pid -lf /var/lib/dhcp/dhclient.%iface///.%.leases -I -df /var/lib/dhcp/dhclient6.%iface///.%.leases %iface% \
+ if (execable("/sbin/dhclient"))
+- if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(/bin/cat /run/udhcpc.%iface///.%.pid); kill -TERM $(/bin/cat /run/udhcpc.%iface///.%.pid); fi \
++ if test -f /run/udhcpc.%iface///.%.pid; then kill -USR2 $(cat /run/udhcpc.%iface///.%.pid); kill -TERM $(cat /run/udhcpc.%iface///.%.pid); fi \
+ elsif (execable("/sbin/udhcpc"))
+- /sbin/dhcpcd -k %iface% \
++ dhcpcd -k %iface% \
+ elsif (execable("/sbin/dhcpcd"))
+ echo 'No DHCP client software found!' >/dev/stderr; false \
+ elsif (1)
+@@ -482,9 +482,9 @@ method ppp
+ unit number -- Use /number/ as the ppp unit number.
+ options string -- Pass /string/ as additional options to pon.
+ up
+- /usr/bin/pon [[%provider%]] [[unit %unit%]] [[%options%]]
++ pon [[%provider%]] [[unit %unit%]] [[%options%]]
+ down
+- /usr/bin/poff [[%provider%]]
++ poff [[%provider%]]
+
+ method wvdial
+ description
+@@ -493,10 +493,10 @@ method wvdial
+ options
+ provider name -- Use /name/ as the provider (from /etc/wvdial.conf).
+ up
+- /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
++ start-stop-daemon --start -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface///.%.pid -b -m -- [[ %provider% ]]
+ down
+- /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
++ start-stop-daemon --stop -x /usr/bin/wvdial \
+ -p /run/wvdial.%iface///.%.pid -s 2
+
+
+@@ -507,6 +507,6 @@ method ipv4ll
+ known as APIPA or IPAC, and often colloquially referred to
+ as "Zeroconf address".
+ up
+- /usr/sbin/avahi-autoipd -D %iface%
++ avahi-autoipd -D %iface%
+ down
+- /usr/sbin/avahi-autoipd --kill %iface%
++ avahi-autoipd --kill %iface%
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb b/external/poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb
new file mode 100644
index 00000000..e9f3a2ae
--- /dev/null
+++ b/external/poky/meta/recipes-core/ifupdown/ifupdown_0.8.16.bb
@@ -0,0 +1,46 @@
+SUMMARY = "ifupdown: basic ifup and ifdown used by initscripts"
+DESCRIPTION = "High level tools to configure network interfaces \
+This package provides the tools ifup and ifdown which may be used to \
+configure (or, respectively, deconfigure) network interfaces, based on \
+the file /etc/network/interfaces."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "git://salsa.debian.org/debian/ifupdown.git;protocol=https \
+ file://defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch \
+ file://inet-6-.defn-fix-inverted-checks-for-loopback.patch \
+ file://99_network \
+ "
+SRCREV = "11b9f99f7ecc7052497e6786156cfed531f11823"
+
+S = "${WORKDIR}/git"
+
+
+inherit update-alternatives
+
+do_compile () {
+ chmod a+rx *.pl *.sh
+ oe_runmake 'CC=${CC}' "CFLAGS=${CFLAGS} -Wall -W -D'IFUPDOWN_VERSION=\"${PV}\"'"
+}
+
+do_install () {
+ install -d ${D}${mandir}/man8 \
+ ${D}${mandir}/man5 \
+ ${D}${base_sbindir}
+
+ # If volatiles are used, then we'll also need /run/network there too.
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/99_network ${D}/etc/default/volatiles
+
+ install -m 0755 ifup ${D}${base_sbindir}/
+ ln ${D}${base_sbindir}/ifup ${D}${base_sbindir}/ifdown
+ install -m 0644 ifup.8 ${D}${mandir}/man8
+ install -m 0644 interfaces.5 ${D}${mandir}/man5
+ cd ${D}${mandir}/man8 && ln -s ifup.8 ifdown.8
+}
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "ifup ifdown"
+
+ALTERNATIVE_LINK_NAME[ifup] = "${base_sbindir}/ifup"
+ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown"
diff --git a/external/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt b/external/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt
new file mode 100644
index 00000000..e7298f2c
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Guest_Additions.txt
@@ -0,0 +1,75 @@
+
+Installing VirtualBox Guest Additions
+=====================================
+
+In order to use VirtualBox guest additions, they have to be build
+first. They may have to be rebuilt each time the time you upgrade to
+a new version of VirtualBox.
+
+Make sure VM is configured with an Optical Drive.
+
+Please follow these steps to install the VirtualBox Guest Additions on the
+Build Appliance VM:
+
+1. Boot VM, select root "Terminal" instead of the default "Terminal <2>"
+
+2. Insert Guest additions CD into VM optical drive:
+ VM menu "Devices"->"Optical Drives"-> Select "VBoxGuestAdditions<version>.iso"
+
+3. Find your CDROM device. Typically it is /dev/hda for IDE. You can determine
+ the actual name <cdromedev> by viewing the cdrom info:
+
+ # cat /proc/sys/dev/cdrom/info
+
+ Mount the cdrom drive:
+ # mount -t iso9660 <cdromdev> /media/cdrom
+ i.e.:
+ # mount -t iso9660 /dev/hda /media/cdrom
+
+4. Build the additions:
+
+ First, we need to build of some prerequisite utilities.
+ (This is only needed to be done once)
+
+ # cd /lib/modules/<kernel-version>-yocto-standard/build
+ # make scripts
+
+ Now build the guest additions:
+
+ # /media/cdrom/VBoxLinuxAdditions.run --nox11
+
+ At this point, providing there were no build errors, the guest additions are
+ built and installed.
+
+5. Check if vbox additions running:
+
+ # /etc/init.d/vboxadd status
+
+ If not running, try manually starting:
+
+ # /etc/init.d/vboxadd start
+
+6. Check if additons actually work, in particular folder sharing.
+
+ Host: Devices->Shared Folders->Shared Folder Settings...
+ Add any host folder and name it (i.e. "images")
+
+ Guest VM: create mount point for the shared folder, i.e.:
+
+ # mkdir ~/my-host
+
+ Mount the shared folder: (Watch out for spelling: it's vboxsf NOT vboxfs)
+
+ # mount -t vboxsf images ~/my-host
+
+ Verify mount, should see the contents of the shared folder:
+
+ # ls ~/my-host
+
+
+
+
+
+
+
+
diff --git a/external/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt b/external/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt
new file mode 100644
index 00000000..a0aede2f
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/build-appliance-image/README_VirtualBox_Toaster.txt
@@ -0,0 +1,78 @@
+
+Running Toaster in VirtualBox
+=============================
+
+Toaster is launched via the command in VM:
+
+ $ source toaster start webport=<IPADDR:PORT>
+
+The interaction with Toaster web server is done via a host internet
+browser.
+The particular steps depend on the actual networking being used
+by the VirtualBox.
+
+
+Bridged Network
+===============
+
+Find out your VM network IP address:
+
+ $ ifconfig
+
+IP address is listed under eth0 inet addr.
+It should be something like:
+ inet addr:192.168.1.18
+
+Launch the Toaster web server in VM:
+
+ $ source toaster start webport=192.168.1.18:8000
+
+Interact with the Toaster web server with your host browser using URL:
+
+ http://192.168.1.18:8000
+
+
+NAT Network
+===========
+Find out your VM network IP address:
+
+ $ ifconfig
+
+IP address is listed under eth0 inet addr.
+For NAT network it should be something like:
+ inet addr:10.0.2.15
+
+When using NAT network, the VM web server can be accessed using
+Port Forwarding.
+
+Using the VirtualBox GUI, navigate to:
+ Settings->Network->Adapter1
+
+You should set:
+ Attached to: NAT
+
+Select "Advanced", click on "Port Forwarding"
+
+This will open a new dialog box "Port Forwarding Rules".
+Create a new rule that looks like this:
+
+| Name | Protocol | Host IP | Host Port | Guest IP | Guest Port |
++-------+----------+---------+-----------+----------+------------+
+| Rule1 | TCP | | 8000 | | 8000 |
+------------------------------------------------------------------
+
+Now we can launch the Toaster web server in VM:
+
+ $ source toaster start webport=10.0.2.15:8000
+
+Interact with the Toaster web server with your host browser using URL:
+
+ http://127.0.0.1:8000
+
+
+
+
+
+
+
+
diff --git a/external/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx b/external/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx
new file mode 100644
index 00000000..6472e875
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx
@@ -0,0 +1,46 @@
+.encoding = "UTF-8"
+config.version = "8"
+virtualHW.version = "10"
+numvcpus = "2"
+vcpu.hotadd = "TRUE"
+memsize = "4096"
+mem.hotadd = "TRUE"
+sata0.present = "TRUE"
+sata0:0.present = "TRUE"
+sata0:0.fileName = "Yocto_Build_Appliance.vmdk"
+ethernet0.present = "TRUE"
+ethernet0.virtualDev = "e1000"
+ethernet0.wakeOnPcktRcv = "FALSE"
+ethernet0.addressType = "generated"
+usb.present = "TRUE"
+ehci.pciSlotNumber = "0"
+sound.present = "TRUE"
+sound.fileName = "-1"
+sound.autodetect = "TRUE"
+pciBridge0.present = "TRUE"
+pciBridge4.present = "TRUE"
+pciBridge4.virtualDev = "pcieRootPort"
+pciBridge4.functions = "8"
+pciBridge5.present = "TRUE"
+pciBridge5.virtualDev = "pcieRootPort"
+pciBridge5.functions = "8"
+pciBridge6.present = "TRUE"
+pciBridge6.virtualDev = "pcieRootPort"
+pciBridge6.functions = "8"
+pciBridge7.present = "TRUE"
+pciBridge7.virtualDev = "pcieRootPort"
+pciBridge7.functions = "8"
+vmci0.present = "TRUE"
+hpet0.present = "TRUE"
+usb.vbluetooth.startConnected = "TRUE"
+displayName = "Yocto Build Appliance"
+guestOS = "other3xlinux-64"
+virtualHW.productCompatibility = "hosted"
+gui.exitOnCLIHLT = "FALSE"
+powerType.powerOff = "soft"
+powerType.powerOn = "soft"
+powerType.suspend = "soft"
+powerType.reset = "soft"
+extendedConfigFile = "Yocto_Build_Appliance.vmxf"
+scsi0:0.present = "FALSE"
+floppy0.present = "FALSE"
diff --git a/external/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf b/external/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf
new file mode 100644
index 00000000..9e941ff2
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<Foundry>
+<VM>
+<VMId type="string">52 a5 d8 cb ed 6c 85 48-cd 99 68 af cc 30 a0 98</VMId>
+<ClientMetaData>
+<clientMetaDataAttributes/>
+<HistoryEventList/></ClientMetaData>
+<vmxPathName type="string">Yocto_Build_Appliance.vmx</vmxPathName></VM></Foundry>
diff --git a/external/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb b/external/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb
new file mode 100644
index 00000000..d9d6c1e4
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb
@@ -0,0 +1,138 @@
+SUMMARY = "An image containing the build system itself"
+DESCRIPTION = "An image containing the build system that you can boot and run using either VirtualBox, VMware Player or VMware Workstation."
+HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted \
+ kernel-dev kernel-devsrc connman connman-plugin-ethernet dhcp-client \
+ tzdata python3-pip perl-misc"
+
+IMAGE_FEATURES += "x11-base package-management splash"
+
+# Ensure there's enough space to do a core-image-sato build, with rm_work enabled
+IMAGE_ROOTFS_EXTRA_SPACE = "41943040"
+
+# Do a quiet boot with limited console messages
+APPEND += "rootfstype=ext4 quiet"
+
+DEPENDS = "zip-native python3-pip-native"
+IMAGE_FSTYPES = "wic.vmdk"
+
+inherit core-image module-base setuptools3
+
+SRCREV ?= "9dfebdaf7af11b69006996f3253e435bce0dfbfb"
+SRC_URI = "git://git.yoctoproject.org/poky;branch=thud \
+ file://Yocto_Build_Appliance.vmx \
+ file://Yocto_Build_Appliance.vmxf \
+ file://README_VirtualBox_Guest_Additions.txt \
+ file://README_VirtualBox_Toaster.txt \
+ "
+BA_INCLUDE_SOURCES ??= "0"
+
+IMAGE_CMD_ext4_append () {
+ # We don't need to reserve much space for root, 0.5% is more than enough
+ tune2fs -m 0.5 ${IMGDEPLOYDIR}/${IMAGE_NAME}.rootfs.ext4
+}
+
+fakeroot do_populate_poky_src () {
+ # Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo
+ # will become invalid in the target.
+ rm -rf ${WORKDIR}/git/.git
+ rm -f ${WORKDIR}/git/.gitignore
+
+ cp -R ${WORKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky
+
+ mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf
+ mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads
+ if [ ${BA_INCLUDE_SOURCES} != 0 ]; then
+ cp -RpL ${DL_DIR}/* ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/
+ # Remove the git2_* tarballs -- this is ok since we still have the git2/.
+ rm -rf ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/git2_*
+ fi
+
+ # Place the README_VirtualBox_Guest_Additions file in builders home folder.
+ cp ${WORKDIR}/README_VirtualBox_Guest_Additions.txt ${IMAGE_ROOTFS}/home/builder/
+
+ # Place the README_VirtualBox_Toaster file in builders home folder.
+ cp ${WORKDIR}/README_VirtualBox_Toaster.txt ${IMAGE_ROOTFS}/home/builder/
+
+ # Create a symlink, needed for out-of-tree kernel modules build
+ if [ ! -e ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build ]; then
+ rm -f ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
+ lnr ${IMAGE_ROOTFS}${KERNEL_SRC_PATH} ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/build
+ fi
+
+ echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
+ echo "export LC_ALL=en_US.utf8" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+
+ # Also save (for reference only) the actual SRCREV used to create this image
+ echo "export BA_SRCREV=${SRCREV}" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo 'export PATH=$PATH:/sbin' >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+
+ echo "# If working behind a proxy and using the provided oe-git-proxy script" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "# you need to set ALL_PROXY based on your proxy settings." >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "# Example ALL_PROXY values:" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "# export ALL_PROXY=https://proxy.example.com:8080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+ echo "# export ALL_PROXY=socks://socks.example.com:1080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+
+ chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/poky
+ chmod -R ug+rw ${IMAGE_ROOTFS}/home/builder/poky
+
+ # Assume we will need CDROM to install guest additions
+ mkdir -p ${IMAGE_ROOTFS}/media/cdrom
+
+ # Allow builder to use sudo
+ echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers
+
+ # Load tap/tun at startup
+ rm -f ${IMAGE_ROOTFS}/sbin/iptables
+ lnr ${IMAGE_ROOTFS}/usr/sbin/iptables ${IMAGE_ROOTFS}/sbin/iptables
+ echo "tun" >> ${IMAGE_ROOTFS}/etc/modules
+
+ # Use Clearlooks GTK+ theme
+ mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0
+ echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc
+
+ # Install modules needed for toaster
+ export STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE}
+ export STAGING_INCDIR=${STAGING_INCDIR_NATIVE}
+ export HOME=${IMAGE_ROOTFS}/home/builder
+ mkdir -p ${IMAGE_ROOTFS}/home/builder/.cache/pip
+ pip3_install_params="--user -I -U -v -r ${IMAGE_ROOTFS}/home/builder/poky/bitbake/toaster-requirements.txt"
+ if [ -n "${http_proxy}" ]; then
+ pip3_install_params="${pip3_install_params} --proxy ${http_proxy}"
+ fi
+ pip3 install ${pip3_install_params}
+ chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/.local
+ chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/.cache
+}
+
+IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; "
+
+addtask rootfs after do_unpack
+
+python () {
+ # Ensure we run these usually noexec tasks
+ d.delVarFlag("do_fetch", "noexec")
+ d.delVarFlag("do_unpack", "noexec")
+}
+
+create_bundle_files () {
+ cd ${WORKDIR}
+ mkdir -p Yocto_Build_Appliance
+ cp *.vmx* Yocto_Build_Appliance
+ ln -sf ${IMGDEPLOYDIR}/${IMAGE_NAME}${IMAGE_NAME_SUFFIX}.wic.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk
+ zip -r ${IMGDEPLOYDIR}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance
+ ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${IMGDEPLOYDIR}/Yocto_Build_Appliance.zip
+}
+create_bundle_files[vardepsexclude] = "DATETIME"
+
+python do_bundle_files() {
+ bb.build.exec_func('create_bundle_files', d)
+}
+
+addtask bundle_files after do_image_wic before do_image_complete
diff --git a/external/poky/meta/recipes-core/images/core-image-base.bb b/external/poky/meta/recipes-core/images/core-image-base.bb
new file mode 100644
index 00000000..75a08cfc
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/core-image-base.bb
@@ -0,0 +1,8 @@
+SUMMARY = "A console-only image that fully supports the target device \
+hardware."
+
+IMAGE_FEATURES += "splash"
+
+LICENSE = "MIT"
+
+inherit core-image
diff --git a/external/poky/meta/recipes-core/images/core-image-minimal-dev.bb b/external/poky/meta/recipes-core/images/core-image-minimal-dev.bb
new file mode 100644
index 00000000..93ead205
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/core-image-minimal-dev.bb
@@ -0,0 +1,7 @@
+require core-image-minimal.bb
+
+DESCRIPTION = "A small image just capable of allowing a device to boot and \
+is suitable for development work."
+
+IMAGE_FEATURES += "dev-pkgs"
+
diff --git a/external/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb b/external/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb
new file mode 100644
index 00000000..7df8ab1e
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/core-image-minimal-initramfs.bb
@@ -0,0 +1,31 @@
+# Simple initramfs image. Mostly used for live images.
+DESCRIPTION = "Small image capable of booting a device. The kernel includes \
+the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
+first 'init' program more efficiently."
+
+INITRAMFS_SCRIPTS ?= "\
+ initramfs-framework-base \
+ initramfs-module-setup-live \
+ initramfs-module-udev \
+ initramfs-module-install \
+ initramfs-module-install-efi \
+ "
+
+PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "${MLPREFIX}core-image-minimal-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "0"
+
+# Use the same restriction as initramfs-live-install
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/external/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb b/external/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb
new file mode 100644
index 00000000..c92234c0
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/core-image-minimal-mtdutils.bb
@@ -0,0 +1,7 @@
+require core-image-minimal.bb
+
+DESCRIPTION = "Small image capable of booting a device with support for the \
+Minimal MTD Utilities, which let the user interact with the MTD subsystem in \
+the kernel to perform operations on flash devices."
+
+IMAGE_INSTALL += "mtd-utils"
diff --git a/external/poky/meta/recipes-core/images/core-image-minimal.bb b/external/poky/meta/recipes-core/images/core-image-minimal.bb
new file mode 100644
index 00000000..4630026a
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/core-image-minimal.bb
@@ -0,0 +1,12 @@
+SUMMARY = "A small image just capable of allowing a device to boot."
+
+IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE ?= "8192"
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}"
diff --git a/external/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb b/external/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb
new file mode 100644
index 00000000..0eca6d99
--- /dev/null
+++ b/external/poky/meta/recipes-core/images/core-image-tiny-initramfs.bb
@@ -0,0 +1,43 @@
+# Simple initramfs image artifact generation for tiny images.
+DESCRIPTION = "Tiny image capable of booting a device. The kernel includes \
+the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
+first 'init' program more efficiently. core-image-tiny-initramfs doesn't \
+actually generate an image but rather generates boot and rootfs artifacts \
+that can subsequently be picked up by external image generation tools such as wic."
+
+VIRTUAL-RUNTIME_dev_manager ?= "busybox-mdev"
+
+PACKAGE_INSTALL = "initramfs-live-boot-tiny packagegroup-core-boot dropbear ${VIRTUAL-RUNTIME_base-utils} ${VIRTUAL-RUNTIME_dev_manager} base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "core-image-tiny-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+# don't actually generate an image, just the artifacts needed for one
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+IMAGE_ROOTFS_EXTRA_SPACE = "0"
+
+# Use the same restriction as initramfs-live-install
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+
+python tinyinitrd () {
+ # Modify our init file so the user knows we drop to shell prompt on purpose
+ newinit = None
+ with open(d.expand('${IMAGE_ROOTFS}/init'), 'r') as init:
+ newinit = init.read()
+ newinit = newinit.replace('Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell ', 'Poky Tiny Reference Distribution:')
+ with open(d.expand('${IMAGE_ROOTFS}/init'), 'w') as init:
+ init.write(newinit)
+}
+
+IMAGE_PREPROCESS_COMMAND += "tinyinitrd;"
+
+QB_KERNEL_CMDLINE_APPEND += "debugshell=3 init=/bin/busybox sh init"
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
new file mode 100644
index 00000000..2a8e0d12
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
@@ -0,0 +1,11 @@
+This package was created by Peter Tobias tobias@et-inf.fho-emden.de on
+Wed, 24 Aug 1994 21:33:28 +0200 and maintained by Anthony Towns
+<ajt@debian.org> until 2001.
+It is currently maintained by Marco d'Itri <md@linux.it>.
+
+Copyright 1994-2010 Peter Tobias, Anthony Towns and Marco d'Itri
+
+The programs in this package are distributed under the terms of the GNU
+General Public License, version 2 as distributed by the Free Software
+Foundation. On Debian systems, a copy of this license may be found in
+/usr/share/common-licenses/GPL-2.
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
new file mode 100644
index 00000000..fb31c635
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
@@ -0,0 +1,90 @@
+#!/bin/sh -e
+### BEGIN INIT INFO
+# Provides: networking
+# Required-Start: mountvirtfs $local_fs
+# Required-Stop: $local_fs
+# Should-Start: ifupdown
+# Should-Stop: ifupdown
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Raise network interfaces.
+### END INIT INFO
+
+PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+
+[ -x /sbin/ifup ] || exit 0
+
+check_network_file_systems() {
+ [ -e /proc/mounts ] || return 0
+
+ if [ -e /etc/iscsi/iscsi.initramfs ]; then
+ echo "not deconfiguring network interfaces: iSCSI root is mounted."
+ exit 0
+ fi
+
+ exec 9<&0 < /proc/mounts
+ while read DEV MTPT FSTYPE REST; do
+ case $DEV in
+ /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
+ echo "not deconfiguring network interfaces: network devices still mounted."
+ exit 0
+ ;;
+ esac
+ case $FSTYPE in
+ nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
+ echo "not deconfiguring network interfaces: network file systems still mounted."
+ exit 0
+ ;;
+ esac
+ done
+ exec 0<&9 9<&-
+}
+
+check_network_swap() {
+ [ -e /proc/swaps ] || return 0
+
+ exec 9<&0 < /proc/swaps
+ while read DEV MTPT FSTYPE REST; do
+ case $DEV in
+ /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
+ echo "not deconfiguring network interfaces: network swap still mounted."
+ exit 0
+ ;;
+ esac
+ done
+ exec 0<&9 9<&-
+}
+
+case "$1" in
+start)
+ echo -n "Configuring network interfaces... "
+ sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
+ ifup -a
+ echo "done."
+ ;;
+
+stop)
+ check_network_file_systems
+ check_network_swap
+
+ echo -n "Deconfiguring network interfaces... "
+ ifdown -a
+ echo "done."
+ ;;
+
+force-reload|restart)
+ echo "Running $0 $1 is deprecated because it may not enable again some interfaces"
+ echo "Reconfiguring network interfaces... "
+ ifdown -a || true
+ ifup -a
+ echo "done."
+ ;;
+
+*)
+ echo "Usage: /etc/init.d/networking {start|stop}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
new file mode 100644
index 00000000..0acf4cf4
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
@@ -0,0 +1,31 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+# Wireless interfaces
+iface wlan0 inet dhcp
+ wireless_mode managed
+ wireless_essid any
+ wpa-driver wext
+ wpa-conf /etc/wpa_supplicant.conf
+
+iface atml0 inet dhcp
+
+# Wired or wireless interfaces
+auto eth0
+iface eth0 inet dhcp
+iface eth1 inet dhcp
+
+# Ethernet/RNDIS gadget (g_ether)
+# ... or on host side, usbnet and random hwaddr
+iface usb0 inet static
+ address 192.168.7.2
+ netmask 255.255.255.0
+ network 192.168.7.0
+ gateway 192.168.7.1
+
+# Bluetooth networking
+iface bnep0 inet dhcp
+
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
new file mode 100644
index 00000000..750c0a98
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+# In case the interface is used as nfsroot, avoid ifup, otherwise
+# nfsroot may lose response
+
+nfsroot=0
+
+if test "x$IFACE" = xlo ; then
+ exit 0
+fi
+
+exec 9<&0 < /proc/mounts
+while read dev mtpt fstype rest; do
+ if test $mtpt = "/" ; then
+ case $fstype in
+ nfs | nfs4)
+ nfsroot=1
+ nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
+ break
+ ;;
+ *)
+ ;;
+ esac
+ fi
+done
+exec 0<&9 9<&-
+
+test $nfsroot -eq 0 && exit 0
+
+if [ -x /bin/ip -o -x /sbin/ip ] ; then
+ nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
+fi
+
+if test "x$IFACE" = "x$nfs_iface" ; then
+ echo "ifup skipped for nfsroot interface $nfs_iface"
+ exit 1
+fi
+
+exit 0
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
new file mode 100644
index 00000000..16967763
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces
new file mode 100644
index 00000000..16967763
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
new file mode 100644
index 00000000..16967763
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
new file mode 100644
index 00000000..16967763
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
new file mode 100644
index 00000000..f62b9a89
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
new file mode 100644
index 00000000..f62b9a89
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
new file mode 100644
index 00000000..f62b9a89
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
new file mode 100644
index 00000000..f62b9a89
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
new file mode 100644
index 00000000..f62b9a89
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
new file mode 100644
index 00000000..f62b9a89
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
new file mode 100644
index 00000000..733ae41f
--- /dev/null
+++ b/external/poky/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Basic TCP/IP networking init scripts and configuration files"
+DESCRIPTION = "This package provides high level tools to configure network interfaces"
+HOMEPAGE = "http://packages.debian.org/ifupdown"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
+PR = "r7"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "networking"
+INITSCRIPT_PARAMS = "start 01 2 3 4 5 . stop 80 0 6 1 ."
+
+SRC_URI = "file://copyright \
+ file://init \
+ file://interfaces \
+ file://nfsroot"
+
+S = "${WORKDIR}"
+
+do_install () {
+ install -d ${D}${sysconfdir}/init.d \
+ ${D}${sysconfdir}/network/if-pre-up.d \
+ ${D}${sysconfdir}/network/if-up.d \
+ ${D}${sysconfdir}/network/if-down.d \
+ ${D}${sysconfdir}/network/if-post-down.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/networking
+ install -m 0644 ${WORKDIR}/interfaces ${D}${sysconfdir}/network/interfaces
+ install -m 0755 ${WORKDIR}/nfsroot ${D}${sysconfdir}/network/if-pre-up.d
+}
+
+do_install_append_qemuall () {
+ # Disable network manager on machines that commonly do NFS booting
+ touch ${D}${sysconfdir}/network/nm-disabled-eth0
+}
+
+PACKAGE_ARCH_qemuall = "${MACHINE_ARCH}"
+RDEPENDS_${PN} = "netbase"
+RCONFLICTS_${PN} = "netbase (< 1:5.0)"
+
+CONFFILES_${PN} = "${sysconfdir}/network/interfaces"
diff --git a/external/poky/meta/recipes-core/initrdscripts/files/init-boot.sh b/external/poky/meta/recipes-core/initrdscripts/files/init-boot.sh
new file mode 100644
index 00000000..e82eba02
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/files/init-boot.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+mkdir /proc
+mkdir /sys
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+
+exec sh
diff --git a/external/poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/external/poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
new file mode 100644
index 00000000..9c4b263d
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
@@ -0,0 +1,199 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2012, Intel Corporation.
+# All rights reserved.
+#
+# install.sh [device_name] [rootfs_name]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We need 200 Mb for the boot partition
+boot_size=200
+
+# 50% for the second rootfs
+testfs_ratio=50
+
+found="no"
+
+echo "Searching for a hard drive..."
+for device in 'hda' 'hdb' 'sda' 'sdb' 'mmcblk0' 'mmcblk1'
+do
+ if [ -e /sys/block/${device}/removable ]; then
+ if [ "$(cat /sys/block/${device}/removable)" = "0" ]; then
+ found="yes"
+
+ while true; do
+ # Try sleeping here to avoid getting kernel messages
+ # obscuring/confusing user
+ sleep 5
+ echo "Found drive at /dev/${device}. Do you want to install this image there ? [y/n]"
+ read answer
+ if [ "$answer" = "y" ] ; then
+ break
+ fi
+
+ if [ "$answer" = "n" ] ; then
+ found=no
+ break
+ fi
+
+ echo "Please answer y or n"
+ done
+ fi
+ fi
+
+ if [ "$found" = "yes" ]; then
+ break;
+ fi
+
+done
+
+if [ "$found" = "no" ]; then
+ exit 1
+fi
+
+echo "Installing image on /dev/${device}"
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount /dev/${device}* 2> /dev/null || /bin/true
+
+mkdir -p /tmp
+cat /proc/mounts > /etc/mtab
+
+disk_size=$(parted /dev/${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
+
+testfs_size=$((disk_size*testfs_ratio/100))
+rootfs_size=$((disk_size-boot_size-testfs_size))
+
+rootfs_start=$((boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+testfs_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#mmcblk}" = "${device}" ]; then
+ part_prefix="p"
+ rootwait="rootwait"
+fi
+bootfs=/dev/${device}${part_prefix}1
+rootfs=/dev/${device}${part_prefix}2
+testfs=/dev/${device}${part_prefix}3
+
+echo "*****************"
+echo "Boot partition size: $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Testfs partition size: $testfs_size MB ($testfs)"
+echo "*****************"
+echo "Deleting partition table on /dev/${device} ..."
+dd if=/dev/zero of=/dev/${device} bs=512 count=2
+
+echo "Creating new partition table on /dev/${device} ..."
+parted /dev/${device} mklabel gpt
+
+echo "Creating boot partition on $bootfs"
+parted /dev/${device} mkpart primary 0% $boot_size
+parted /dev/${device} set 1 boot on
+
+echo "Creating rootfs partition on $rootfs"
+parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
+
+echo "Creating testfs partition on $testfs"
+parted /dev/${device} mkpart primary $testfs_start 100%
+
+parted /dev/${device} print
+
+echo "Formatting $bootfs to vfat..."
+mkfs.vfat -n "boot" $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 -L "platform" $rootfs
+
+echo "Formatting $testfs to ext3..."
+mkfs.ext3 -L "testrootfs" $testfs
+
+mkdir /ssd
+mkdir /rootmnt
+mkdir /bootmnt
+
+mount $rootfs /ssd
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt
+
+echo "Copying rootfs files..."
+cp -a /rootmnt/* /ssd
+
+touch /ssd/etc/masterimage
+
+if [ -d /ssd/etc/ ] ; then
+ # We dont want udev to mount our root device while we're booting...
+ if [ -d /ssd/etc/udev/ ] ; then
+ echo "/dev/${device}" >> /ssd/etc/udev/mount.blacklist
+ fi
+fi
+
+umount /ssd
+umount /rootmnt
+
+echo "Preparing boot partition..."
+mount $bootfs /ssd
+
+EFIDIR="/ssd/EFI/BOOT"
+mkdir -p $EFIDIR
+cp /run/media/$1/vmlinuz /ssd
+# Copy the efi loader
+cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
+
+if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
+ GRUBCFG="$EFIDIR/grub.cfg"
+ cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG
+ # Update grub config for the installed image
+ # Delete the install entry
+ sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
+ # Delete the initrd lines
+ sed -i "/initrd /d" $GRUBCFG
+ # Delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
+ # Delete any root= strings
+ sed -i "s/ root=[^ ]*/ /" $GRUBCFG
+ # Add the root= and other standard boot options
+ sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG
+fi
+
+if [ -d /run/media/$1/loader ]; then
+ SYSTEMDBOOT_CFGS="/ssd/loader/entries/*.conf"
+ # copy config files for systemd-boot
+ cp -dr /run/media/$1/loader /ssd
+ # delete the install entry
+ rm -f /ssd/loader/entries/install.conf
+ # delete the initrd lines
+ sed -i "/initrd /d" $SYSTEMDBOOT_CFGS
+ # delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $SYSTEMDBOOT_CFGS
+ # delete any root= strings
+ sed -i "s/ root=[^ ]*/ /" $SYSTEMDBOOT_CFGS
+ # add the root= and other standard boot options
+ sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $SYSTEMDBOOT_CFGS
+ # Add the test label
+ echo -ne "title test\nlinux /test-kernel\noptions root=$testfs rw $rootwait quiet\n" > /ssd/loader/entries/test.conf
+fi
+
+umount /ssd
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/external/poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/external/poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh
new file mode 100644
index 00000000..b6855b5a
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -0,0 +1,299 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2012, Intel Corporation.
+# All rights reserved.
+#
+# install.sh [device_name] [rootfs_name]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# figure out how big of a boot partition we need
+boot_size=$(du -ms /run/media/$1/ | awk '{print $1}')
+# remove rootfs.img ($2) from the size if it exists, as its not installed to /boot
+if [ -e /run/media/$1/$2 ]; then
+ boot_size=$(( boot_size - $( du -ms /run/media/$1/$2 | awk '{print $1}') ))
+fi
+# remove initrd from size since its not currently installed
+if [ -e /run/media/$1/initrd ]; then
+ boot_size=$(( boot_size - $( du -ms /run/media/$1/initrd | awk '{print $1}') ))
+fi
+# add 10M to provide some extra space for users and account
+# for rounding in the above subtractions
+boot_size=$(( boot_size + 10 ))
+
+# 5% for swap
+swap_ratio=5
+
+# Get a list of hard drives
+hdnamelist=""
+live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
+live_dev_name=${live_dev_name#\/dev/}
+# Only strip the digit identifier if the device is not an mmc
+case $live_dev_name in
+ mmcblk*)
+ ;;
+ nvme*)
+ ;;
+ *)
+ live_dev_name=${live_dev_name%%[0-9]*}
+ ;;
+esac
+
+echo "Searching for hard drives ..."
+
+# Some eMMC devices have special sub devices such as mmcblk0boot0 etc
+# we're currently only interested in the root device so pick them wisely
+devices=`ls /sys/block/ | grep -v mmcblk` || true
+mmc_devices=`ls /sys/block/ | grep "mmcblk[0-9]\{1,\}$"` || true
+devices="$devices $mmc_devices"
+
+for device in $devices; do
+ case $device in
+ loop*)
+ # skip loop device
+ ;;
+ sr*)
+ # skip CDROM device
+ ;;
+ ram*)
+ # skip ram device
+ ;;
+ *)
+ # skip the device LiveOS is on
+ # Add valid hard drive name to the list
+ case $device in
+ $live_dev_name*)
+ # skip the device we are running from
+ ;;
+ *)
+ hdnamelist="$hdnamelist $device"
+ ;;
+ esac
+ ;;
+ esac
+done
+
+if [ -z "${hdnamelist}" ]; then
+ echo "You need another device (besides the live device /dev/${live_dev_name}) to install the image. Installation aborted."
+ exit 1
+fi
+
+TARGET_DEVICE_NAME=""
+for hdname in $hdnamelist; do
+ # Display found hard drives and their basic info
+ echo "-------------------------------"
+ echo /dev/$hdname
+ if [ -r /sys/block/$hdname/device/vendor ]; then
+ echo -n "VENDOR="
+ cat /sys/block/$hdname/device/vendor
+ fi
+ if [ -r /sys/block/$hdname/device/model ]; then
+ echo -n "MODEL="
+ cat /sys/block/$hdname/device/model
+ fi
+ if [ -r /sys/block/$hdname/device/uevent ]; then
+ echo -n "UEVENT="
+ cat /sys/block/$hdname/device/uevent
+ fi
+ echo
+done
+
+# Get user choice
+while true; do
+ echo "Please select an install target or press n to exit ($hdnamelist ): "
+ read answer
+ if [ "$answer" = "n" ]; then
+ echo "Installation manually aborted."
+ exit 1
+ fi
+ for hdname in $hdnamelist; do
+ if [ "$answer" = "$hdname" ]; then
+ TARGET_DEVICE_NAME=$answer
+ break
+ fi
+ done
+ if [ -n "$TARGET_DEVICE_NAME" ]; then
+ break
+ fi
+done
+
+if [ -n "$TARGET_DEVICE_NAME" ]; then
+ echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+else
+ echo "No hard drive selected. Installation aborted."
+ exit 1
+fi
+
+device=/dev/$TARGET_DEVICE_NAME
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount ${device}* 2> /dev/null || /bin/true
+
+mkdir -p /tmp
+
+# Create /etc/mtab if not present
+if [ ! -e /etc/mtab ] && [ -e /proc/mounts ]; then
+ ln -sf /proc/mounts /etc/mtab
+fi
+
+disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
+
+swap_size=$((disk_size*swap_ratio/100))
+rootfs_size=$((disk_size-boot_size-swap_size))
+
+rootfs_start=$((boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+swap_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
+ [ ! "${device#/dev/nvme}" = "${device}" ]; then
+ part_prefix="p"
+ rootwait="rootwait"
+fi
+
+# USB devices also require rootwait
+if [ -n `readlink /dev/disk/by-id/usb* | grep $TARGET_DEVICE_NAME` ]; then
+ rootwait="rootwait"
+fi
+
+bootfs=${device}${part_prefix}1
+rootfs=${device}${part_prefix}2
+swap=${device}${part_prefix}3
+
+echo "*****************"
+echo "Boot partition size: $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Swap partition size: $swap_size MB ($swap)"
+echo "*****************"
+echo "Deleting partition table on ${device} ..."
+dd if=/dev/zero of=${device} bs=512 count=35
+
+echo "Creating new partition table on ${device} ..."
+parted ${device} mklabel gpt
+
+echo "Creating boot partition on $bootfs"
+parted ${device} mkpart boot fat32 0% $boot_size
+parted ${device} set 1 boot on
+
+echo "Creating rootfs partition on $rootfs"
+parted ${device} mkpart root ext4 $rootfs_start $rootfs_end
+
+echo "Creating swap partition on $swap"
+parted ${device} mkpart swap linux-swap $swap_start 100%
+
+parted ${device} print
+
+echo "Waiting for device nodes..."
+C=0
+while [ $C -ne 3 ] && [ ! -e $bootfs -o ! -e $rootfs -o ! -e $swap ]; do
+ C=$(( C + 1 ))
+ sleep 1
+done
+
+echo "Formatting $bootfs to vfat..."
+mkfs.vfat $bootfs
+
+echo "Formatting $rootfs to ext4..."
+mkfs.ext4 $rootfs
+
+echo "Formatting swap partition...($swap)"
+mkswap $swap
+
+mkdir /tgt_root
+mkdir /src_root
+mkdir -p /boot
+
+# Handling of the target root partition
+mount $rootfs /tgt_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
+echo "Copying rootfs files..."
+cp -a /src_root/* /tgt_root
+if [ -d /tgt_root/etc/ ] ; then
+ boot_uuid=$(blkid -o value -s UUID ${bootfs})
+ swap_part_uuid=$(blkid -o value -s PARTUUID ${swap})
+ echo "/dev/disk/by-partuuid/$swap_part_uuid swap swap defaults 0 0" >> /tgt_root/etc/fstab
+ echo "UUID=$boot_uuid /boot vfat defaults 1 2" >> /tgt_root/etc/fstab
+ # We dont want udev to mount our root device while we're booting...
+ if [ -d /tgt_root/etc/udev/ ] ; then
+ echo "${device}" >> /tgt_root/etc/udev/mount.blacklist
+ fi
+fi
+
+umount /src_root
+
+# Handling of the target boot partition
+mount $bootfs /boot
+echo "Preparing boot partition..."
+
+EFIDIR="/boot/EFI/BOOT"
+mkdir -p $EFIDIR
+# Copy the efi loader
+cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
+
+if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
+ root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs})
+ GRUBCFG="$EFIDIR/grub.cfg"
+ cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG
+ # Update grub config for the installed image
+ # Delete the install entry
+ sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
+ # Delete the initrd lines
+ sed -i "/initrd /d" $GRUBCFG
+ # Delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
+ # Replace root= and add additional standard boot options
+ # We use root as a sentinel value, as vmlinuz is no longer guaranteed
+ sed -i "s/ root=[^ ]*/ root=PARTUUID=$root_part_uuid rw $rootwait quiet /g" $GRUBCFG
+fi
+
+if [ -d /run/media/$1/loader ]; then
+ rootuuid=$(blkid -o value -s PARTUUID ${rootfs})
+ SYSTEMDBOOT_CFGS="/boot/loader/entries/*.conf"
+ # copy config files for systemd-boot
+ cp -dr /run/media/$1/loader /boot
+ # delete the install entry
+ rm -f /boot/loader/entries/install.conf
+ # delete the initrd lines
+ sed -i "/initrd /d" $SYSTEMDBOOT_CFGS
+ # delete any LABEL= strings
+ sed -i "s/ LABEL=[^ ]*/ /" $SYSTEMDBOOT_CFGS
+ # delete any root= strings
+ sed -i "s/ root=[^ ]*/ /" $SYSTEMDBOOT_CFGS
+ # add the root= and other standard boot options
+ sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait quiet @" $SYSTEMDBOOT_CFGS
+fi
+
+umount /tgt_root
+
+# Copy kernel artifacts. To add more artifacts just add to types
+# For now just support kernel types already being used by something in OE-core
+for types in bzImage zImage vmlinux vmlinuz fitImage; do
+ for kernel in `find /run/media/$1/ -name $types*`; do
+ cp $kernel /boot
+ done
+done
+
+umount /boot
+
+sync
+
+echo "Installation successful. Remove your installation media and press ENTER to reboot."
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/external/poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh b/external/poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
new file mode 100644
index 00000000..ac621605
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
@@ -0,0 +1,220 @@
+#!/bin/sh -e
+#
+# Copyright (C) 2008-2011 Intel
+#
+# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We need 20 Mb for the boot partition
+boot_size=200
+
+# 50% for the the test partition
+testfs_ratio=50
+
+# Get a list of hard drives
+hdnamelist=""
+live_dev_name=${1%%/*}
+
+echo "Searching for hard drives ..."
+
+for device in `ls /sys/block/`; do
+ case $device in
+ loop*)
+ # skip loop device
+ ;;
+ ram*)
+ # skip ram device
+ ;;
+ *)
+ # skip the device LiveOS is on
+ # Add valid hard drive name to the list
+ if [ $device != $live_dev_name -a -e /dev/$device ]; then
+ hdnamelist="$hdnamelist $device"
+ fi
+ ;;
+ esac
+done
+
+TARGET_DEVICE_NAME=""
+for hdname in $hdnamelist; do
+ # Display found hard drives and their basic info
+ echo "-------------------------------"
+ echo /dev/$hdname
+ if [ -r /sys/block/$hdname/device/vendor ]; then
+ echo -n "VENDOR="
+ cat /sys/block/$hdname/device/vendor
+ fi
+ echo -n "MODEL="
+ cat /sys/block/$hdname/device/model
+ cat /sys/block/$hdname/device/uevent
+ echo
+ # Get user choice
+ while true; do
+ echo -n "Do you want to install this image there? [y/n] "
+ read answer
+ if [ "$answer" = "y" -o "$answer" = "n" ]; then
+ break
+ fi
+ echo "Please answer y or n"
+ done
+ if [ "$answer" = "y" ]; then
+ TARGET_DEVICE_NAME=$hdname
+ break
+ fi
+done
+
+if [ -n "$TARGET_DEVICE_NAME" ]; then
+ echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+else
+ echo "No hard drive selected. Installation aborted."
+ exit 1
+fi
+
+device=$TARGET_DEVICE_NAME
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount /dev/${device}* 2> /dev/null || /bin/true
+
+if [ ! -b /dev/loop0 ] ; then
+ mknod /dev/loop0 b 7 0
+fi
+
+mkdir -p /tmp
+if [ ! -L /etc/mtab ]; then
+ cat /proc/mounts > /etc/mtab
+fi
+
+disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+
+testfs_size=$((disk_size*testfs_ratio/100))
+rootfs_size=$((disk_size-boot_size-testfs_size))
+
+rootfs_start=$((boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+testfs_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#mmcblk}" = "${device}" ]; then
+ part_prefix="p"
+ rootwait="rootwait"
+fi
+bootfs=/dev/${device}${part_prefix}1
+rootfs=/dev/${device}${part_prefix}2
+testfs=/dev/${device}${part_prefix}3
+
+echo "*****************"
+echo "Boot partition size: $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Testfs partition size: $testfs_size MB ($testfs)"
+echo "*****************"
+echo "Deleting partition table on /dev/${device} ..."
+dd if=/dev/zero of=/dev/${device} bs=512 count=2
+
+echo "Creating new partition table on /dev/${device} ..."
+parted /dev/${device} mklabel msdos
+
+echo "Creating boot partition on $bootfs"
+parted /dev/${device} mkpart primary 0% $boot_size
+
+echo "Creating rootfs partition on $rootfs"
+parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
+
+echo "Creating testfs partition on $testfs"
+parted /dev/${device} mkpart primary $testfs_start 100%
+
+parted /dev/${device} print
+
+echo "Formatting $bootfs to ext3..."
+mkfs.ext3 -L "boot" $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 -L "rootfs" $rootfs
+
+echo "Formatting $testfs to ext3..."
+mkfs.ext3 -L "testrootfs" $testfs
+
+mkdir /tgt_root
+mkdir /src_root
+mkdir -p /boot
+
+# Handling of the target root partition
+mount $rootfs /tgt_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
+
+echo "Copying rootfs files..."
+cp -a /src_root/* /tgt_root
+
+touch /tgt_root/etc/masterimage
+
+if [ -d /tgt_root/etc/ ] ; then
+ echo "$bootfs /boot ext3 defaults 1 2" >> /tgt_root/etc/fstab
+ # We dont want udev to mount our root device while we're booting...
+ if [ -d /tgt_root/etc/udev/ ] ; then
+ echo "/dev/${device}" >> /tgt_root/etc/udev/mount.blacklist
+ fi
+fi
+umount /tgt_root
+umount /src_root
+
+# Handling of the target boot partition
+mount $bootfs /boot
+echo "Preparing boot partition..."
+if [ -f /etc/grub.d/00_header ] ; then
+ echo "Preparing custom grub2 menu..."
+ GRUBCFG="/boot/grub/grub.cfg"
+ mkdir -p $(dirname $GRUBCFG)
+ cat >$GRUBCFG <<_EOF
+serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
+terminal_input --append serial
+terminal_output --append serial
+set timeout_style=hidden
+set timeout=5
+menuentry "Linux" {
+ set root=(hd0,1)
+ linux /vmlinuz root=$rootfs $rootwait rw $5 $3 $4 quiet
+}
+_EOF
+ # Add the test label
+ echo -ne "\nmenuentry 'test' --hotkey x {\nlinux /test-kernel root=$testfs rw $rootwait quiet\n}\n" >> $GRUBCFG
+
+ chmod 0444 $GRUBCFG
+fi
+grub-install /dev/${device}
+echo "(hd0) /dev/${device}" > /boot/grub/device.map
+
+# If grub.cfg doesn't exist, assume GRUB 0.97 and create a menu.lst
+if [ ! -f /boot/grub/grub.cfg ] ; then
+ echo "Preparing custom grub menu..."
+ echo "default 0" > /boot/grub/menu.lst
+ echo "timeout 30" >> /boot/grub/menu.lst
+ echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
+ echo "root (hd0,0)" >> /boot/grub/menu.lst
+ echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
+fi
+
+cp /run/media/$1/vmlinuz /boot/
+
+umount /boot
+
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/external/poky/meta/recipes-core/initrdscripts/files/init-install.sh b/external/poky/meta/recipes-core/initrdscripts/files/init-install.sh
new file mode 100644
index 00000000..e7157963
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -0,0 +1,343 @@
+#!/bin/sh -e
+#
+# Copyright (C) 2008-2011 Intel
+#
+# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# figure out how big of a boot partition we need
+boot_size=$(du -ms /run/media/$1/ | awk '{print $1}')
+# remove rootfs.img ($2) from the size if it exists, as its not installed to /boot
+if [ -e /run/media/$1/$2 ]; then
+ boot_size=$(( boot_size - $( du -ms /run/media/$1/$2 | awk '{print $1}') ))
+fi
+# remove initrd from size since its not currently installed
+if [ -e /run/media/$1/initrd ]; then
+ boot_size=$(( boot_size - $( du -ms /run/media/$1/initrd | awk '{print $1}') ))
+fi
+# add 10M to provide some extra space for users and account
+# for rounding in the above subtractions
+boot_size=$(( boot_size + 10 ))
+
+# 5% for the swap
+swap_ratio=5
+
+# Get a list of hard drives
+hdnamelist=""
+live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
+live_dev_name=${live_dev_name#\/dev/}
+# Only strip the digit identifier if the device is not an mmc
+case $live_dev_name in
+ mmcblk*)
+ ;;
+ nvme*)
+ ;;
+ *)
+ live_dev_name=${live_dev_name%%[0-9]*}
+ ;;
+esac
+
+echo "Searching for hard drives ..."
+
+# Some eMMC devices have special sub devices such as mmcblk0boot0 etc
+# we're currently only interested in the root device so pick them wisely
+devices=`ls /sys/block/ | grep -v mmcblk` || true
+mmc_devices=`ls /sys/block/ | grep "mmcblk[0-9]\{1,\}$"` || true
+devices="$devices $mmc_devices"
+
+for device in $devices; do
+ case $device in
+ loop*)
+ # skip loop device
+ ;;
+ sr*)
+ # skip CDROM device
+ ;;
+ ram*)
+ # skip ram device
+ ;;
+ *)
+ # skip the device LiveOS is on
+ # Add valid hard drive name to the list
+ case $device in
+ $live_dev_name*)
+ # skip the device we are running from
+ ;;
+ *)
+ hdnamelist="$hdnamelist $device"
+ ;;
+ esac
+ ;;
+ esac
+done
+
+TARGET_DEVICE_NAME=""
+for hdname in $hdnamelist; do
+ # Display found hard drives and their basic info
+ echo "-------------------------------"
+ echo /dev/$hdname
+ if [ -r /sys/block/$hdname/device/vendor ]; then
+ echo -n "VENDOR="
+ cat /sys/block/$hdname/device/vendor
+ fi
+ if [ -r /sys/block/$hdname/device/model ]; then
+ echo -n "MODEL="
+ cat /sys/block/$hdname/device/model
+ fi
+ if [ -r /sys/block/$hdname/device/uevent ]; then
+ echo -n "UEVENT="
+ cat /sys/block/$hdname/device/uevent
+ fi
+ echo
+done
+
+# Get user choice
+while true; do
+ echo "Please select an install target or press n to exit ($hdnamelist ): "
+ read answer
+ if [ "$answer" = "n" ]; then
+ echo "Installation manually aborted."
+ exit 1
+ fi
+ for hdname in $hdnamelist; do
+ if [ "$answer" = "$hdname" ]; then
+ TARGET_DEVICE_NAME=$answer
+ break
+ fi
+ done
+ if [ -n "$TARGET_DEVICE_NAME" ]; then
+ break
+ fi
+done
+
+if [ -n "$TARGET_DEVICE_NAME" ]; then
+ echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+else
+ echo "No hard drive selected. Installation aborted."
+ exit 1
+fi
+
+device=/dev/$TARGET_DEVICE_NAME
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount ${device}* 2> /dev/null || /bin/true
+
+if [ ! -b /dev/loop0 ] ; then
+ mknod /dev/loop0 b 7 0
+fi
+
+mkdir -p /tmp
+if [ ! -L /etc/mtab ] && [ -e /proc/mounts ]; then
+ ln -sf /proc/mounts /etc/mtab
+fi
+
+disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
+
+grub_version=$(grub-install -V|sed 's/.* \([0-9]\).*/\1/')
+
+if [ $grub_version -eq 0 ] ; then
+ bios_boot_size=0
+else
+ # For GRUB 2 we need separate parition to store stage2 grub image
+ # 2Mb value is chosen to align partition for best performance.
+ bios_boot_size=2
+fi
+
+swap_size=$((disk_size*swap_ratio/100))
+rootfs_size=$((disk_size-bios_boot_size-boot_size-swap_size))
+
+boot_start=$((bios_boot_size))
+rootfs_start=$((bios_boot_size+boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+swap_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#/dev/mmcblk}" = "${device}" ] || \
+ [ ! "${device#/dev/nvme}" = "${device}" ]; then
+ part_prefix="p"
+ rootwait="rootwait"
+fi
+
+# USB devices also require rootwait
+if [ -n `readlink /dev/disk/by-id/usb* | grep $TARGET_DEVICE_NAME` ]; then
+ rootwait="rootwait"
+fi
+
+if [ $grub_version -eq 0 ] ; then
+ bios_boot=''
+ bootfs=${device}${part_prefix}1
+ rootfs=${device}${part_prefix}2
+ swap=${device}${part_prefix}3
+else
+ bios_boot=${device}${part_prefix}1
+ bootfs=${device}${part_prefix}2
+ rootfs=${device}${part_prefix}3
+ swap=${device}${part_prefix}4
+fi
+
+echo "*****************"
+[ $grub_version -ne 0 ] && echo "BIOS boot partition size: $bios_boot_size MB ($bios_boot)"
+echo "Boot partition size: $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Swap partition size: $swap_size MB ($swap)"
+echo "*****************"
+echo "Deleting partition table on ${device} ..."
+dd if=/dev/zero of=${device} bs=512 count=35
+
+echo "Creating new partition table on ${device} ..."
+if [ $grub_version -eq 0 ] ; then
+ parted ${device} mktable msdos
+ echo "Creating boot partition on $bootfs"
+ parted ${device} mkpart primary ext3 0% $boot_size
+else
+ parted ${device} mktable gpt
+ echo "Creating BIOS boot partition on $bios_boot"
+ parted ${device} mkpart bios_boot 0% $bios_boot_size
+ parted ${device} set 1 bios_grub on
+ echo "Creating boot partition on $bootfs"
+ parted ${device} mkpart boot ext3 $boot_start $boot_size
+fi
+
+echo "Creating rootfs partition on $rootfs"
+[ $grub_version -eq 0 ] && pname='primary' || pname='root'
+parted ${device} mkpart $pname ext4 $rootfs_start $rootfs_end
+
+echo "Creating swap partition on $swap"
+[ $grub_version -eq 0 ] && pname='primary' || pname='swap'
+parted ${device} mkpart $pname linux-swap $swap_start 100%
+
+parted ${device} print
+
+echo "Waiting for device nodes..."
+C=0
+while [ $C -ne 3 ] && [ ! -e $bootfs -o ! -e $rootfs -o ! -e $swap ]; do
+ C=$(( C + 1 ))
+ sleep 1
+done
+
+echo "Formatting $bootfs to ext3..."
+mkfs.ext3 $bootfs
+
+echo "Formatting $rootfs to ext4..."
+mkfs.ext4 $rootfs
+
+echo "Formatting swap partition...($swap)"
+mkswap $swap
+
+mkdir /tgt_root
+mkdir /src_root
+mkdir -p /boot
+
+# Handling of the target root partition
+mount $rootfs /tgt_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
+echo "Copying rootfs files..."
+cp -a /src_root/* /tgt_root
+if [ -d /tgt_root/etc/ ] ; then
+ if [ $grub_version -ne 0 ] ; then
+ boot_uuid=$(blkid -o value -s UUID ${bootfs})
+ swap_part_uuid=$(blkid -o value -s PARTUUID ${swap})
+ bootdev="UUID=$boot_uuid"
+ swapdev=/dev/disk/by-partuuid/$swap_part_uuid
+ else
+ bootdev=${bootfs}
+ swapdev=${swap}
+ fi
+ echo "$swapdev swap swap defaults 0 0" >> /tgt_root/etc/fstab
+ echo "$bootdev /boot ext3 defaults 1 2" >> /tgt_root/etc/fstab
+ # We dont want udev to mount our root device while we're booting...
+ if [ -d /tgt_root/etc/udev/ ] ; then
+ echo "${device}" >> /tgt_root/etc/udev/mount.blacklist
+ fi
+fi
+umount /tgt_root
+umount /src_root
+
+echo "Looking for kernels to use as boot target.."
+# Find kernel to boot to
+# Give user options if multiple are found
+kernels="$(find /run/media/$1/ -type f \
+ -name bzImage* -o -name zImage* \
+ -o -name vmlinux* -o -name vmlinuz* \
+ -o -name fitImage* \
+ | sed s:.*/::)"
+if [ -n "$(echo $kernels)" ]; then
+ # only one kernel entry if no space
+ if [ -z "$(echo $kernels | grep " ")" ]; then
+ kernel=$kernels
+ echo "$kernel will be used as the boot target"
+ else
+ echo "Which kernel do we want to boot by default? The following kernels were found:"
+ echo $kernels
+ read answer
+ kernel=$answer
+ fi
+else
+ echo "No kernels found, exiting..."
+ exit 1
+fi
+
+# Handling of the target boot partition
+mount $bootfs /boot
+echo "Preparing boot partition..."
+
+if [ -f /etc/grub.d/00_header -a $grub_version -ne 0 ] ; then
+ echo "Preparing custom grub2 menu..."
+ root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs})
+ boot_uuid=$(blkid -o value -s UUID ${bootfs})
+ GRUBCFG="/boot/grub/grub.cfg"
+ mkdir -p $(dirname $GRUBCFG)
+ cat >$GRUBCFG <<_EOF
+timeout=5
+default=0
+menuentry "Linux" {
+ search --no-floppy --fs-uuid $boot_uuid --set root
+ linux /$kernel root=PARTUUID=$root_part_uuid $rootwait rw $5 $3 $4 quiet
+}
+_EOF
+ chmod 0444 $GRUBCFG
+fi
+grub-install ${device}
+
+if [ $grub_version -eq 0 ] ; then
+ echo "(hd0) ${device}" > /boot/grub/device.map
+ echo "Preparing custom grub menu..."
+ echo "default 0" > /boot/grub/menu.lst
+ echo "timeout 30" >> /boot/grub/menu.lst
+ echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
+ echo "root (hd0,0)" >> /boot/grub/menu.lst
+ echo "kernel /$kernel root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
+fi
+
+# Copy kernel artifacts. To add more artifacts just add to types
+# For now just support kernel types already being used by something in OE-core
+for types in bzImage zImage vmlinux vmlinuz fitImage; do
+ for kernel in `find /run/media/$1/ -name $types*`; do
+ cp $kernel /boot
+ done
+done
+
+umount /boot
+
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/external/poky/meta/recipes-core/initrdscripts/files/init-live.sh b/external/poky/meta/recipes-core/initrdscripts/files/init-live.sh
new file mode 100644
index 00000000..65183d7e
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -0,0 +1,239 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+ROOT_MOUNT="/rootfs"
+ROOT_IMAGE="rootfs.img"
+MOUNT="/bin/mount"
+UMOUNT="/bin/umount"
+ISOLINUX=""
+
+ROOT_DISK=""
+
+# Copied from initramfs-framework. The core of this script probably should be
+# turned into initramfs-framework modules to reduce duplication.
+udev_daemon() {
+ OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
+
+ for o in $OPTIONS; do
+ if [ -x "$o" ]; then
+ echo $o
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+_UDEV_DAEMON=`udev_daemon`
+
+early_setup() {
+ mkdir -p /proc
+ mkdir -p /sys
+ mount -t proc proc /proc
+ mount -t sysfs sysfs /sys
+ mount -t devtmpfs none /dev
+
+ # support modular kernel
+ modprobe isofs 2> /dev/null
+
+ mkdir -p /run
+ mkdir -p /var/run
+
+ $_UDEV_DAEMON --daemon
+ udevadm trigger --action=add
+}
+
+read_args() {
+ [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
+ for arg in $CMDLINE; do
+ optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
+ case $arg in
+ root=*)
+ ROOT_DEVICE=$optarg ;;
+ rootimage=*)
+ ROOT_IMAGE=$optarg ;;
+ rootfstype=*)
+ modprobe $optarg 2> /dev/null ;;
+ LABEL=*)
+ label=$optarg ;;
+ video=*)
+ video_mode=$arg ;;
+ vga=*)
+ vga_mode=$arg ;;
+ console=*)
+ if [ -z "${console_params}" ]; then
+ console_params=$arg
+ else
+ console_params="$console_params $arg"
+ fi ;;
+ debugshell*)
+ if [ -z "$optarg" ]; then
+ shelltimeout=30
+ else
+ shelltimeout=$optarg
+ fi
+ esac
+ done
+}
+
+boot_live_root() {
+ # Watches the udev event queue, and exits if all current events are handled
+ udevadm settle --timeout=3 --quiet
+ # Kills the current udev running processes, which survived after
+ # device node creation events were handled, to avoid unexpected behavior
+ killall -9 "${_UDEV_DAEMON##*/}" 2>/dev/null
+
+ # Don't run systemd-update-done on systemd-based live systems
+ # because it triggers a slow rebuild of ldconfig caches.
+ touch ${ROOT_MOUNT}/etc/.updated ${ROOT_MOUNT}/var/.updated
+
+ # Allow for identification of the real root even after boot
+ mkdir -p ${ROOT_MOUNT}/media/realroot
+ mount -n --move "/run/media/${ROOT_DISK}" ${ROOT_MOUNT}/media/realroot
+
+ # Move the mount points of some filesystems over to
+ # the corresponding directories under the real root filesystem.
+ for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do
+ # Parse any OCT or HEX encoded chars such as spaces
+ # in the mount points to actual ASCII chars
+ dir=`printf $dir`
+ mkdir -p "${ROOT_MOUNT}/media/${dir##*/}"
+ mount -n --move "$dir" "${ROOT_MOUNT}/media/${dir##*/}"
+ done
+ mount -n --move /proc ${ROOT_MOUNT}/proc
+ mount -n --move /sys ${ROOT_MOUNT}/sys
+ mount -n --move /dev ${ROOT_MOUNT}/dev
+
+ cd $ROOT_MOUNT
+
+ # busybox switch_root supports -c option
+ exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init $CMDLINE ||
+ fatal "Couldn't switch_root, dropping to shell"
+}
+
+fatal() {
+ echo $1 >$CONSOLE
+ echo >$CONSOLE
+ exec sh
+}
+
+early_setup
+
+[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
+
+read_args
+
+echo "Waiting for removable media..."
+C=0
+while true
+do
+ for i in `ls /run/media 2>/dev/null`; do
+ if [ -f /run/media/$i/$ROOT_IMAGE ] ; then
+ found="yes"
+ ROOT_DISK="$i"
+ break
+ elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then
+ found="yes"
+ ISOLINUX="isolinux"
+ ROOT_DISK="$i"
+ break
+ fi
+ done
+ if [ "$found" = "yes" ]; then
+ break;
+ fi
+ # don't wait for more than $shelltimeout seconds, if it's set
+ if [ -n "$shelltimeout" ]; then
+ echo -n " " $(( $shelltimeout - $C ))
+ if [ $C -ge $shelltimeout ]; then
+ echo "..."
+ echo "Mounted filesystems"
+ mount | grep media
+ echo "Available block devices"
+ cat /proc/partitions
+ fatal "Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell "
+ fi
+ C=$(( C + 1 ))
+ fi
+ sleep 1
+done
+
+# Try to mount the root image read-write and then boot it up.
+# This function distinguishes between a read-only image and a read-write image.
+# In the former case (typically an iso), it tries to make a union mount if possible.
+# In the latter case, the root image could be mounted and then directly booted up.
+mount_and_boot() {
+ mkdir $ROOT_MOUNT
+ mknod /dev/loop0 b 7 0 2>/dev/null
+
+ if ! mount -o rw,loop,noatime,nodiratime /run/media/$ROOT_DISK/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
+ fatal "Could not mount rootfs image"
+ fi
+
+ if touch $ROOT_MOUNT/bin 2>/dev/null; then
+ # The root image is read-write, directly boot it up.
+ boot_live_root
+ fi
+
+ # determine which unification filesystem to use
+ union_fs_type=""
+ if grep -q -w "overlay" /proc/filesystems; then
+ union_fs_type="overlay"
+ elif grep -q -w "aufs" /proc/filesystems; then
+ union_fs_type="aufs"
+ else
+ union_fs_type=""
+ fi
+
+ # make a union mount if possible
+ case $union_fs_type in
+ "overlay")
+ mkdir -p /rootfs.ro /rootfs.rw
+ if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
+ rm -rf /rootfs.ro /rootfs.rw
+ fatal "Could not move rootfs mount point"
+ else
+ mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
+ mkdir -p /rootfs.rw/upperdir /rootfs.rw/work
+ mount -t overlay overlay -o "lowerdir=/rootfs.ro,upperdir=/rootfs.rw/upperdir,workdir=/rootfs.rw/work" $ROOT_MOUNT
+ mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
+ mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
+ mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
+ fi
+ ;;
+ "aufs")
+ mkdir -p /rootfs.ro /rootfs.rw
+ if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
+ rm -rf /rootfs.ro /rootfs.rw
+ fatal "Could not move rootfs mount point"
+ else
+ mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
+ mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro" aufs $ROOT_MOUNT
+ mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
+ mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
+ mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
+ fi
+ ;;
+ "")
+ mount -t tmpfs -o rw,noatime,mode=755 tmpfs $ROOT_MOUNT/media
+ ;;
+ esac
+
+ # boot the image
+ boot_live_root
+}
+
+if [ "$label" != "boot" -a -f $label.sh ] ; then
+ if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
+ ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
+ else
+ fatal "Could not find $label script"
+ fi
+
+ # If we're getting here, we failed...
+ fatal "Target $label failed"
+fi
+
+mount_and_boot
+
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb
new file mode 100644
index 00000000..7ae7969f
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Extremely basic live image init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-boot.sh"
+
+PR = "r2"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-boot.sh ${D}/init
+}
+
+inherit allarch
+
+FILES_${PN} += " /init "
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/debug b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/debug
new file mode 100644
index 00000000..00bfd7d3
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/debug
@@ -0,0 +1,82 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+# Adds support to dynamic debugging of initramfs using bootparam in
+# following format:
+# shell : starts a shell before and after each module
+# shell=before:<module> : starts a shell before <module> is loaded and run
+# shell=after:<module> : starts a shell after <module> is loaded and run
+#
+# shell-debug : run set -x as soon as possible
+# shell-debug=before:<module> : run set -x before <module> is loaded and run
+# shell-debug=after:<module> : run set -x after <module> is loaded and run
+
+DEBUG_SHELL="false"
+
+debug_hook_handler() {
+ status=$1
+ module=$2
+
+ if [ -n "$bootparam_shell" ] && [ "$bootparam_shell" != "true" ]; then
+ shell_wanted_status=`expr $bootparam_shell : '\(.*\):.*'`
+ shell_wanted_module=`expr $bootparam_shell : '.*:\(.*\)'`
+
+ if [ "$shell_wanted_status" = "before" ]; then
+ shell_wanted_status=pre
+ else
+ shell_wanted_status=post
+ fi
+ fi
+
+ if [ "$bootparam_shell" = "true" ] ||
+ ( [ "$status" = "$shell_wanted_status" ] &&
+ [ "$module" = "$shell_wanted_module" ] ); then
+ if [ "$status" = "pre" ]; then
+ status_msg="before"
+ else
+ status_msg="after"
+ fi
+
+ msg "Starting shell $status_msg $module..."
+ sh
+ fi
+
+ if [ -n "$bootparam_shell_debug" ] && [ "$bootparam_shell_debug" != "true" ]; then
+ shell_debug_wanted_status=`expr $bootparam_shell_debug : '\(.*\):.*'`
+ shell_debug_wanted_module=`expr $bootparam_shell_debug : '.*:\(.*\)'`
+
+ if [ "$shell_debug_wanted_status" = "before" ]; then
+ shell_debug_wanted_status=pre
+ else
+ shell_debug_wanted_status=post
+ fi
+ fi
+
+ if [ "$bootparam_shell_debug" = "true" ] ||
+ ( [ "$status" = "$shell_debug_wanted_status" ] &&
+ [ "$module" = "$shell_debug_wanted_module" ] ); then
+ if [ "$DEBUG_SHELL" = "true" ]; then
+ return 0
+ fi
+
+ if [ "$status" = "pre" ]; then
+ status_msg="before"
+ else
+ status_msg="after"
+ fi
+
+ msg "Starting shell debugging $status_msg $module..."
+ DEBUG_SHELL="true"
+ set -x
+ fi
+}
+
+debug_enabled() {
+ return 0
+}
+
+debug_run() {
+ add_module_pre_hook "debug_hook_handler"
+ add_module_post_hook "debug_hook_handler"
+}
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs
new file mode 100755
index 00000000..29f801a7
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/e2fs
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+e2fs_enabled() {
+ return 0
+}
+
+e2fs_run() {
+ filesystems="ext4 ext3 ext2"
+
+ # load modules
+ for fs in $filesystems; do
+ load_kernel_module $fs
+ done
+
+ for fs in $filesystems; do
+ eval "fs_options=\$bootparam_${fs}"
+ if [ -n "$fs_options" ]; then
+ dev=`expr "$fs_options" : '\([^:]*\).*'`
+ path=`expr "$fs_options" : '[^:]*:\([^:]*\).*'`
+
+ info "Mounting $dev as $fs on $path as $fs..."
+ mkdir -p $path
+ mount -t $fs $dev $path
+ fi
+ done
+}
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/exec b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/exec
new file mode 100644
index 00000000..a8e2432b
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/exec
@@ -0,0 +1,29 @@
+#!/bin/sh
+# Copyright (C) 2017 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+EXEC_DIR=/exec.d # place to look for modules
+
+exec_enabled() {
+ return 0
+}
+
+exec_run() {
+ if [ ! -d $EXEC_DIR ]; then
+ msg "No contents to exec in $EXEC_DIR. Starting shell ..."
+ sh
+ fi
+
+ # Load and run modules
+ for m in $EXEC_DIR/*; do
+ # Skip backup files
+ if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
+ continue
+ fi
+
+ debug "Starting $m"
+
+ # process module
+ ./$m
+ done
+}
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/finish b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/finish
new file mode 100755
index 00000000..717383eb
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/finish
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+finish_enabled() {
+ return 0
+}
+
+finish_run() {
+ if [ -n "$ROOTFS_DIR" ]; then
+ if [ ! -d $ROOTFS_DIR/dev ]; then
+ fatal "ERROR: There's no '/dev' on rootfs."
+ fi
+
+ info "Switching root to '$ROOTFS_DIR'..."
+
+ debug "Moving /dev, /proc and /sys onto rootfs..."
+ mount --move /dev $ROOTFS_DIR/dev
+ mount --move /proc $ROOTFS_DIR/proc
+ mount --move /sys $ROOTFS_DIR/sys
+
+ cd $ROOTFS_DIR
+ exec switch_root -c /dev/console $ROOTFS_DIR ${bootparam_init:-/sbin/init}
+ else
+ debug "No rootfs has been set"
+ fi
+}
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/init b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/init
new file mode 100755
index 00000000..3c7e0942
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/init
@@ -0,0 +1,145 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+#
+# Provides the API to be used by the initramfs modules
+#
+# Modules need to provide the following functions:
+#
+# <module>_enabled : check if the module ought to run (return 1 to skip)
+# <module>_run : do what is need
+#
+# Boot parameters are available on environment in the as:
+#
+# 'foo=value' as 'bootparam_foo=value'
+# 'foo' as 'bootparam_foo=true'
+# 'foo.bar[=value] as 'foo_bar=[value|true]'
+
+# Register a function to be called before running a module
+# The hook is called as:
+# <function> pre <module>
+add_module_pre_hook() {
+ MODULE_PRE_HOOKS="$MODULE_PRE_HOOKS $1"
+}
+
+# Register a function to be called after running a module
+# The hook is called as:
+# <function> post <module>
+add_module_post_hook() {
+ MODULE_POST_HOOKS="$MODULE_POST_HOOKS $1"
+}
+
+# Load kernel module
+load_kernel_module() {
+ if modprobe $1 >/dev/null 2>&1; then
+ info "Loaded module $1"
+ else
+ debug "Failed to load module $1"
+ fi
+}
+
+# Prints information
+msg() {
+ echo "$@" >/dev/console
+}
+
+# Prints information if verbose bootparam is used
+info() {
+ [ -n "$bootparam_verbose" ] && echo "$@" >/dev/console
+}
+
+# Prints information if debug bootparam is used
+debug() {
+ [ -n "$bootparam_debug" ] && echo "DEBUG: $@" >/dev/console
+}
+
+# Prints a message and start a endless loop
+fatal() {
+ echo $1 >/dev/console
+ echo >/dev/console
+
+ if [ -n "$bootparam_init_fatal_sh" ]; then
+ sh
+ else
+ while [ "true" ]; do
+ sleep 3600
+ done
+ fi
+}
+
+# Variables shared amoung modules
+ROOTFS_DIR="/rootfs" # where to do the switch root
+MODULE_PRE_HOOKS="" # functions to call before running each module
+MODULE_POST_HOOKS="" # functions to call after running each module
+MODULES_DIR=/init.d # place to look for modules
+
+# make mount stop complaining about missing /etc/fstab
+touch /etc/fstab
+
+# initialize /proc, /sys, /run/lock and /var/lock
+mkdir -p /proc /sys /run/lock /var/lock
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+
+# populate bootparam environment
+for p in `cat /proc/cmdline`; do
+ opt=`echo $p | cut -d'=' -f1`
+ opt=`echo $opt | sed -e 'y/.-/__/'`
+ if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then
+ eval "bootparam_${opt}=true"
+ else
+ value="`echo $p | cut -d'=' -f2-`"
+ eval "bootparam_${opt}=\"${value}\""
+ fi
+done
+
+# use /dev with devtmpfs
+if grep -q devtmpfs /proc/filesystems; then
+ mkdir -p /dev
+ mount -t devtmpfs devtmpfs /dev
+else
+ if [ ! -d /dev ]; then
+ fatal "ERROR: /dev doesn't exist and kernel doesn't has devtmpfs enabled."
+ fi
+fi
+
+mkdir $ROOTFS_DIR
+
+# Load and run modules
+for m in $MODULES_DIR/*; do
+ # Skip backup files
+ if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
+ continue
+ fi
+
+ module=`basename $m | cut -d'-' -f 2`
+ debug "Loading module $module"
+
+ # pre hooks
+ for h in $MODULE_PRE_HOOKS; do
+ debug "Calling module hook (pre): $h"
+ eval "$h pre $module"
+ debug "Finished module hook (pre): $h"
+ done
+
+ # process module
+ . $m
+
+ if ! eval "${module}_enabled"; then
+ debug "Skipping module $module"
+ continue
+ fi
+
+ debug "Running ${module}_run"
+ eval "${module}_run"
+
+ # post hooks
+ for h in $MODULE_POST_HOOKS; do
+ debug "Calling module hook (post): $h"
+ eval "$h post $module"
+ debug "Finished module hook (post): $h"
+ done
+done
+
+# Catch all
+fatal "ERROR: Initramfs failed to initialize the system."
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev
new file mode 100644
index 00000000..9814d976
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/mdev
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright (C) 2011, 2017 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+mdev_enabled() {
+ if [ ! -e /sbin/mdev ]; then
+ debug "/sbin/mdev doesn't exist"
+ return 1
+ fi
+
+ return 0
+}
+
+mdev_run() {
+ # setup the environment
+ mount -t tmpfs tmpfs /dev
+
+ mkdir -m 1777 /dev/shm
+
+ mkdir -m 0755 /dev/pts
+ mount -t devpts devpts /dev/pts
+
+ echo /sbin/mdev > /proc/sys/kernel/hotplug
+ mdev -s
+
+ # load modules for devices
+ find /sys -name modalias | while read m; do
+ load_kernel_module $(cat "$m")
+ done
+}
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
new file mode 100644
index 00000000..e67ee4c2
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/nfsrootfs
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+nfsrootfs_enabled() {
+ if [ ${bootparam_root} != "/dev/nfs" ] || [ -z ${bootparam_nfsroot} ]; then
+ return 1
+ fi
+ return 0
+}
+
+nfsrootfs_run() {
+ local nfs_opts
+ local location
+ local flags
+ local server_ip
+
+ nfs_opts=""
+ if [ "${bootparam_nfsroot#*,}" != "${bootparam_nfsroot}" ]; then
+ nfs_opts="-o ${bootparam_nfsroot#*,}"
+ fi
+
+ location="${bootparam_nfsroot%%,*}"
+ if [ "${location#*:}" = "${location}" ]; then
+ # server-ip not given. Get server ip from ip option
+ server_ip=""
+ if [ "${bootparam_ip#*:}" != "${bootparam_ip}" ]; then
+ server_ip=$(echo "$bootparam_ip" | cut -d: -f2)
+ fi
+
+ if [ -z "$server_ip" ]; then
+ fatal "Server IP is not set. Update ip or nfsroot options."
+ fi
+ location=${server_ip}:${location}
+ fi
+
+ flags="-o nolock"
+ if [ -n "$bootparam_ro" ] && ! echo "$bootparam_rootflags" | grep -w -q "ro"; then
+ if [ -n "$bootparam_rootflags" ]; then
+ bootparam_rootflags="$bootparam_rootflags,"
+ fi
+ bootparam_rootflags="${bootparam_rootflags}ro"
+ fi
+ if [ -n "$bootparam_rootflags" ]; then
+ flags="$flags -o $bootparam_rootflags"
+ fi
+
+ mount -t nfs ${flags} ${nfs_opts} ${location} ${ROOTFS_DIR}
+}
+
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/rootfs b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
new file mode 100644
index 00000000..76fa84d3
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
@@ -0,0 +1,67 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+rootfs_enabled() {
+ return 0
+}
+
+rootfs_run() {
+ if [ -z "$ROOTFS_DIR" ]; then
+ return
+ fi
+ C=0
+ delay=${bootparam_rootdelay:-1}
+ timeout=${bootparam_roottimeout:-5}
+ while [ ! -d $ROOTFS_DIR/dev ]; do
+ if [ $(( $C * $delay )) -gt $timeout ]; then
+ fatal "root '$bootparam_root' doesn't exist or does not contain a /dev."
+ fi
+
+ if [ -n "$bootparam_root" ]; then
+ debug "No e2fs compatible filesystem has been mounted, mounting $bootparam_root..."
+
+ if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then
+ root_uuid=`echo $bootparam_root | cut -c6-`
+ bootparam_root="/dev/disk/by-uuid/$root_uuid"
+ fi
+
+ if [ "`echo ${bootparam_root} | cut -c1-9`" = "PARTUUID=" ]; then
+ root_uuid=`echo $bootparam_root | cut -c10-`
+ bootparam_root="/dev/disk/by-partuuid/$root_uuid"
+ fi
+
+ if [ "`echo ${bootparam_root} | cut -c1-6`" = "LABEL=" ]; then
+ root_label=`echo $bootparam_root | cut -c7-`
+ bootparam_root="/dev/disk/by-label/$root_label"
+ fi
+
+ if [ -e "$bootparam_root" ]; then
+ flags=""
+ if [ -n "$bootparam_ro" ] && ! echo "$bootparam_rootflags" | grep -w -q "ro"; then
+ if [ -n "$bootparam_rootflags" ]; then
+ bootparam_rootflags="$bootparam_rootflags,"
+ fi
+ bootparam_rootflags="${bootparam_rootflags}ro"
+ fi
+ if [ -n "$bootparam_rootflags" ]; then
+ flags="$flags -o$bootparam_rootflags"
+ fi
+ if [ -n "$bootparam_rootfstype" ]; then
+ flags="$flags -t$bootparam_rootfstype"
+ fi
+ mount $flags $bootparam_root $ROOTFS_DIR
+ if [ -d $ROOTFS_DIR/dev ]; then
+ break
+ else
+ # It is unlikely to change, but keep trying anyway.
+ # Perhaps we pick a different device next time.
+ umount $ROOTFS_DIR
+ fi
+ fi
+ fi
+ debug "Sleeping for $delay second(s) to wait root to settle..."
+ sleep $delay
+ C=$(( $C + 1 ))
+ done
+}
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/setup-live b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/setup-live
new file mode 100644
index 00000000..4c79f412
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/setup-live
@@ -0,0 +1,64 @@
+#/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+setup_enabled() {
+ return 0
+}
+
+setup_run() {
+ROOT_IMAGE="rootfs.img"
+ISOLINUX=""
+ROOT_DISK=""
+shelltimeout=30
+
+ if [ -z "$bootparam_root" -o "$bootparam_root" = "/dev/ram0" ]; then
+ echo "Waiting for removable media..."
+ C=0
+ while true
+ do
+ for i in `ls /run/media 2>/dev/null`; do
+ if [ -f /run/media/$i/$ROOT_IMAGE ] ; then
+ found="yes"
+ ROOT_DISK="$i"
+ break
+ elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then
+ found="yes"
+ ISOLINUX="isolinux"
+ ROOT_DISK="$i"
+ break
+ fi
+ done
+ if [ "$found" = "yes" ]; then
+ break;
+ fi
+ # don't wait for more than $shelltimeout seconds, if it's set
+ if [ -n "$shelltimeout" ]; then
+ echo -n " " $(( $shelltimeout - $C ))
+ if [ $C -ge $shelltimeout ]; then
+ echo "..."
+ echo "Mounted filesystems"
+ mount | grep media
+ echo "Available block devices"
+ cat /proc/partitions
+ fatal "Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell "
+ fi
+ C=$(( C + 1 ))
+ fi
+ sleep 1
+ done
+ # The existing rootfs module has no support for rootfs images. Assign the rootfs image.
+ bootparam_root="/run/media/$ROOT_DISK/$ISOLINUX/$ROOT_IMAGE"
+ fi
+
+ if [ "$bootparam_LABEL" != "boot" -a -f /init.d/$bootparam_LABEL.sh ] ; then
+ if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
+ ./init.d/$bootparam_LABEL.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
+ else
+ fatal "Could not find $bootparam_LABEL script"
+ fi
+
+ # If we're getting here, we failed...
+ fatal "Target $bootparam_LABEL failed"
+ fi
+}
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/udev b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/udev
new file mode 100644
index 00000000..87551ff4
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework/udev
@@ -0,0 +1,47 @@
+#!/bin/sh
+# Copyright (C) 2011, 2012 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+udev_shutdown_hook_handler() {
+ status=$1
+ module=$2
+ if [ "$status" = "pre" ] && [ "$module" = "finish" ]; then
+ udevadm settle
+ killall `basename $_UDEV_DAEMON` 2>/dev/null
+ fi
+}
+
+udev_daemon() {
+ OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
+
+ for o in $OPTIONS; do
+ if [ -x "$o" ]; then
+ echo $o
+ return 0
+ fi
+ done
+
+ return 1
+}
+
+_UDEV_DAEMON=`udev_daemon`
+
+udev_enabled() {
+ if [ -z "$_UDEV_DAEMON" ]; then
+ msg "WARNING: Cannot find the udev daemon; daemon will not be started in initramfs."
+ return 1
+ fi
+
+ return 0
+}
+
+udev_run() {
+ add_module_pre_hook "udev_shutdown_hook_handler"
+
+ mkdir -p /run
+ mkdir -p /var/run
+
+ $_UDEV_DAEMON --daemon
+ udevadm trigger --action=add
+ udevadm settle
+}
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
new file mode 100644
index 00000000..660343ea
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
@@ -0,0 +1,100 @@
+SUMMARY = "Modular initramfs system"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_base-utils}"
+RRECOMMENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog}"
+
+PR = "r4"
+
+inherit allarch
+
+SRC_URI = "file://init \
+ file://exec \
+ file://nfsrootfs \
+ file://rootfs \
+ file://finish \
+ file://mdev \
+ file://udev \
+ file://e2fs \
+ file://debug \
+ "
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/init.d
+
+ # base
+ install -m 0755 ${WORKDIR}/init ${D}/init
+ install -m 0755 ${WORKDIR}/nfsrootfs ${D}/init.d/85-nfsrootfs
+ install -m 0755 ${WORKDIR}/rootfs ${D}/init.d/90-rootfs
+ install -m 0755 ${WORKDIR}/finish ${D}/init.d/99-finish
+
+ # exec
+ install -m 0755 ${WORKDIR}/exec ${D}/init.d/89-exec
+
+ # mdev
+ install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev
+
+ # udev
+ install -m 0755 ${WORKDIR}/udev ${D}/init.d/01-udev
+
+ # e2fs
+ install -m 0755 ${WORKDIR}/e2fs ${D}/init.d/10-e2fs
+
+ # debug
+ install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug
+
+ # Create device nodes expected by some kernels in initramfs
+ # before even executing /init.
+ install -d ${D}/dev
+ mknod -m 622 ${D}/dev/console c 5 1
+}
+
+PACKAGES = "${PN}-base \
+ initramfs-module-exec \
+ initramfs-module-mdev \
+ initramfs-module-udev \
+ initramfs-module-e2fs \
+ initramfs-module-nfsrootfs \
+ initramfs-module-rootfs \
+ initramfs-module-debug \
+ "
+
+FILES_${PN}-base = "/init /init.d/99-finish /dev"
+
+# 99-finish in base depends on some other module which mounts
+# the rootfs, like 90-rootfs. To replace that default, use
+# BAD_RECOMMENDATIONS += "initramfs-module-rootfs" in your
+# initramfs recipe and install something else, or install
+# something that runs earlier (for example, a 89-my-rootfs)
+# and mounts the rootfs. Then 90-rootfs will proceed immediately.
+RRECOMMENDS_${PN}-base += "initramfs-module-rootfs"
+
+SUMMARY_initramfs-module-exec = "initramfs support for easy execution of applications"
+RDEPENDS_initramfs-module-exec = "${PN}-base"
+FILES_initramfs-module-exec = "/init.d/89-exec"
+
+SUMMARY_initramfs-module-mdev = "initramfs support for mdev"
+RDEPENDS_initramfs-module-mdev = "${PN}-base busybox-mdev"
+FILES_initramfs-module-mdev = "/init.d/01-mdev"
+
+SUMMARY_initramfs-module-udev = "initramfs support for udev"
+RDEPENDS_initramfs-module-udev = "${PN}-base udev"
+FILES_initramfs-module-udev = "/init.d/01-udev"
+
+SUMMARY_initramfs-module-e2fs = "initramfs support for ext4/ext3/ext2 filesystems"
+RDEPENDS_initramfs-module-e2fs = "${PN}-base"
+FILES_initramfs-module-e2fs = "/init.d/10-e2fs"
+
+SUMMARY_initramfs-module-nfsrootfs = "initramfs support for locating and mounting the root partition via nfs"
+RDEPENDS_initramfs-module-nfsrootfs = "${PN}-base"
+FILES_initramfs-module-nfsrootfs = "/init.d/85-nfsrootfs"
+
+SUMMARY_initramfs-module-rootfs = "initramfs support for locating and mounting the root partition"
+RDEPENDS_initramfs-module-rootfs = "${PN}-base"
+FILES_initramfs-module-rootfs = "/init.d/90-rootfs"
+
+SUMMARY_initramfs-module-debug = "initramfs dynamic debug support"
+RDEPENDS_initramfs-module-debug = "${PN}-base"
+FILES_initramfs-module-debug = "/init.d/00-debug"
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-live-boot-tiny_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-boot-tiny_1.0.bb
new file mode 100644
index 00000000..7a9a8eca
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-boot-tiny_1.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Live image init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+DEPENDS = "virtual/kernel"
+RDEPENDS_${PN} = "busybox-mdev"
+SRC_URI = "file://init-live.sh"
+
+PR = "r12"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
+ install -d ${D}/dev
+ mknod -m 622 ${D}/dev/console c 5 1
+}
+
+FILES_${PN} += " /init /dev "
+
+# Due to kernel dependency
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
new file mode 100644
index 00000000..57b30254
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Live image init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+DEPENDS = "virtual/kernel"
+RDEPENDS_${PN} = "udev udev-extraconf"
+SRC_URI = "file://init-live.sh"
+
+PR = "r12"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
+ install -d ${D}/dev
+ mknod -m 622 ${D}/dev/console c 5 1
+}
+
+FILES_${PN} += " /init /dev "
+
+# Due to kernel dependency
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb
new file mode 100644
index 00000000..c03bd2d7
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Live image install script for with a second rootfs/kernel option"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install-efi-testfs.sh"
+
+RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-install-efi-testfs.sh ${D}/install-efi.sh
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+FILES_${PN} = " /install-efi.sh "
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb
new file mode 100644
index 00000000..cc842ae8
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Live image install script for grub-efi"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install-efi.sh"
+
+PR = "r1"
+
+RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
+RRECOMMENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog}"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-install-efi.sh ${D}/install-efi.sh
+}
+
+# While this package maybe an allarch due to it being a
+# simple script, reality is that it is Host specific based
+# on the COMPATIBLE_HOST below, which needs to take precedence
+#inherit allarch
+INHIBIT_DEFAULT_DEPS = "1"
+
+FILES_${PN} = " /install-efi.sh "
+
+COMPATIBLE_HOST = "(i.86.*|x86_64.*|aarch64.*)-linux"
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb
new file mode 100644
index 00000000..937bfd4d
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Live image install script with a second rootfs/kernel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install-testfs.sh"
+
+RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-install-testfs.sh ${D}/install.sh
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+FILES_${PN} = " /install.sh "
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
new file mode 100644
index 00000000..48fc0c4a
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Live image install script for grub"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install.sh"
+
+PR = "r9"
+
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
+RRECOMMENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-install.sh ${D}/install.sh
+}
+
+# While this package maybe an allarch due to it being a
+# simple script, reality is that it is Host specific based
+# on the COMPATIBLE_HOST below, which needs to take precedence
+#inherit allarch
+INHIBIT_DEFAULT_DEPS = "1"
+
+FILES_${PN} = " /install.sh "
+
+COMPATIBLE_HOST = "(i.86.*|x86_64.*|aarch64.*)-linux"
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bb
new file mode 100644
index 00000000..523138cf
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bb
@@ -0,0 +1,18 @@
+SUMMARY = "initramfs-framework module for EFI installation option"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} = "initramfs-framework-base parted e2fsprogs-mke2fs dosfstools util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
+RRECOMMENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog}"
+
+PR = "r4"
+
+SRC_URI = "file://init-install-efi.sh"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/init.d
+ install -m 0755 ${WORKDIR}/init-install-efi.sh ${D}/init.d/install-efi.sh
+}
+
+FILES_${PN} = "/init.d/install-efi.sh"
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-module-install_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-module-install_1.0.bb
new file mode 100644
index 00000000..56898e82
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-module-install_1.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "initramfs-framework module for installation option"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} = "initramfs-framework-base grub parted e2fsprogs-mke2fs util-linux-blkid ${VIRTUAL-RUNTIME_base-utils}"
+RRECOMMENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils-syslog}"
+
+# The same restriction as grub
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
+COMPATIBLE_HOST_armv7a = 'null'
+COMPATIBLE_HOST_armv7ve = 'null'
+
+PR = "r1"
+
+SRC_URI = "file://init-install.sh"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/init.d
+ install -m 0755 ${WORKDIR}/init-install.sh ${D}/init.d/install.sh
+}
+
+FILES_${PN} = "/init.d/install.sh"
diff --git a/external/poky/meta/recipes-core/initrdscripts/initramfs-module-setup-live_1.0.bb b/external/poky/meta/recipes-core/initrdscripts/initramfs-module-setup-live_1.0.bb
new file mode 100644
index 00000000..4d2fe9dd
--- /dev/null
+++ b/external/poky/meta/recipes-core/initrdscripts/initramfs-module-setup-live_1.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "initramfs-framework module for live booting"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} = "initramfs-framework-base udev-extraconf"
+
+PR = "r4"
+
+inherit allarch
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/initramfs-framework:"
+SRC_URI = "file://setup-live"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}/init.d
+ install -m 0755 ${WORKDIR}/setup-live ${D}/init.d/80-setup-live
+}
+
+FILES_${PN} = "/init.d/80-setup-live"
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch
new file mode 100644
index 00000000..1ee8181f
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch
@@ -0,0 +1,347 @@
+Upstream-Status: Inappropriate [licensing]
+
+diff --git a/COPYING b/COPYING
+new file mode 100644
+index 0000000..d511905
+--- /dev/null
++++ b/COPYING
+@@ -0,0 +1,339 @@
++ GNU GENERAL PUBLIC LICENSE
++ Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++ Preamble
++
++ The licenses for most software are designed to take away your
++freedom to share and change it. By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users. This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it. (Some other Free Software Foundation software is covered by
++the GNU Lesser General Public License instead.) You can apply it to
++your programs, too.
++
++ When we speak of free software, we are referring to freedom, not
++price. Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++ To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++ For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have. You must make sure that they, too, receive or can get the
++source code. And you must show them these terms so they know their
++rights.
++
++ We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++ Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software. If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++ Finally, any free program is threatened constantly by software
++patents. We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary. To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++ The precise terms and conditions for copying, distribution and
++modification follow.
++
++ GNU GENERAL PUBLIC LICENSE
++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++ 0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License. The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language. (Hereinafter, translation is included without limitation in
++the term "modification".) Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope. The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++ 1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++ 2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++ a) You must cause the modified files to carry prominent notices
++ stating that you changed the files and the date of any change.
++
++ b) You must cause any work that you distribute or publish, that in
++ whole or in part contains or is derived from the Program or any
++ part thereof, to be licensed as a whole at no charge to all third
++ parties under the terms of this License.
++
++ c) If the modified program normally reads commands interactively
++ when run, you must cause it, when started running for such
++ interactive use in the most ordinary way, to print or display an
++ announcement including an appropriate copyright notice and a
++ notice that there is no warranty (or else, saying that you provide
++ a warranty) and that users may redistribute the program under
++ these conditions, and telling the user how to view a copy of this
++ License. (Exception: if the Program itself is interactive but
++ does not normally print such an announcement, your work based on
++ the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole. If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works. But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++ 3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++ a) Accompany it with the complete corresponding machine-readable
++ source code, which must be distributed under the terms of Sections
++ 1 and 2 above on a medium customarily used for software interchange; or,
++
++ b) Accompany it with a written offer, valid for at least three
++ years, to give any third party, for a charge no more than your
++ cost of physically performing source distribution, a complete
++ machine-readable copy of the corresponding source code, to be
++ distributed under the terms of Sections 1 and 2 above on a medium
++ customarily used for software interchange; or,
++
++ c) Accompany it with the information you received as to the offer
++ to distribute corresponding source code. (This alternative is
++ allowed only for noncommercial distribution and only if you
++ received the program in object code or executable form with such
++ an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it. For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable. However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++ 4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License. Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++ 5. You are not required to accept this License, since you have not
++signed it. However, nothing else grants you permission to modify or
++distribute the Program or its derivative works. These actions are
++prohibited by law if you do not accept this License. Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++ 6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions. You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++ 7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License. If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all. For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices. Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++ 8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded. In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++ 9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time. Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number. If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation. If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++ 10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission. For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this. Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++ NO WARRANTY
++
++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++ END OF TERMS AND CONDITIONS
++
++ How to Apply These Terms to Your New Programs
++
++ If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++ To do so, attach the following notices to the program. It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++ <one line to give the program's name and a brief idea of what it does.>
++ Copyright (C) <year> <name of author>
++
++ 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 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this program; if not, write to the Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++ Gnomovision version 69, Copyright (C) year name of author
++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++ This is free software, and you are welcome to redistribute it
++ under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License. Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary. Here is a sample; alter the names:
++
++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++ `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++ <signature of Ty Coon>, 1 April 1989
++ Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs. If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library. If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh
new file mode 100644
index 00000000..b577b9a0
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: alignment
+# Required-Start: mountkernfs
+# Required-Stop: mountkernfs
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+if [ -e /proc/cpu/alignment ]; then
+ echo "3" > /proc/cpu/alignment
+fi
+
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh
new file mode 100644
index 00000000..9e2b0912
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/banner.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: banner
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+if [ ! -e /dev/tty ]; then
+ /bin/mknod -m 0666 /dev/tty c 5 0
+fi
+
+if ( > /dev/tty0 ) 2>/dev/null; then
+ vtmaster=/dev/tty0
+elif ( > /dev/vc/0 ) 2>/dev/null; then
+ vtmaster=/dev/vc/0
+elif ( > /dev/console ) 2>/dev/null; then
+ vtmaster=/dev/console
+else
+ vtmaster=/dev/null
+fi
+echo > $vtmaster
+echo "Please wait: booting..." > $vtmaster
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
new file mode 100755
index 00000000..df553bc0
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: bootmisc
+# Required-Start: $local_fs mountvirtfs
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Misc and other.
+### END INIT INFO
+
+. /etc/default/rcS
+#
+# Put a nologin file in /etc to prevent people from logging in before
+# system startup is complete.
+#
+if test "$DELAYLOGIN" = yes
+then
+ echo "System bootup in progress - please wait" > /etc/nologin
+ cp /etc/nologin /etc/nologin.boot
+fi
+
+#
+# Set pseudo-terminal access permissions.
+#
+if test -c /dev/ttyp0
+then
+ chmod 666 /dev/tty[p-za-e][0-9a-f]
+ chown root:tty /dev/tty[p-za-e][0-9a-f]
+fi
+
+#
+# Apply /proc settings if defined
+#
+SYSCTL_CONF="/etc/sysctl.conf"
+if [ -f "${SYSCTL_CONF}" ]
+then
+ if [ -x "/sbin/sysctl" ]
+ then
+ # busybox sysctl does not support -q
+ VERBOSE_REDIR="1>/dev/null"
+ if [ "${VERBOSE}" != "no" ]; then
+ VERBOSE_REDIR="1>&1"
+ fi
+ eval /sbin/sysctl -p "${SYSCTL_CONF}" $VERBOSE_REDIR
+ else
+ echo "To have ${SYSCTL_CONF} applied during boot, install package <procps>."
+ fi
+fi
+
+#
+# Update /etc/motd.
+#
+if test "$EDITMOTD" != no
+then
+ uname -a > /etc/motd.tmp
+ sed 1d /etc/motd >> /etc/motd.tmp
+ mv /etc/motd.tmp /etc/motd
+fi
+
+#
+# This is as good a place as any for a sanity check
+#
+# Set the system clock from hardware clock
+# If the timestamp is more recent than the current time,
+# use the timestamp instead.
+test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start
+if test -e /etc/timestamp
+then
+ SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M%2S`
+ read TIMESTAMP < /etc/timestamp
+ if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
+ # format the timestamp as date expects it (2m2d2H2M4Y.2S)
+ TS_YR=${TIMESTAMP%??????????}
+ TS_SEC=${TIMESTAMP#????????????}
+ TS_FIRST12=${TIMESTAMP%??}
+ TS_MIDDLE8=${TS_FIRST12#????}
+ date -u ${TS_MIDDLE8}${TS_YR}.${TS_SEC}
+ test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop
+ fi
+fi
+: exit 0
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
new file mode 100755
index 00000000..62869451
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: checkfs
+# Required-Start: checkroot
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Check all other file systems
+### END INIT INFO
+
+. /etc/default/rcS
+
+#
+# Check the rest of the filesystems.
+#
+if test ! -f /fastboot
+then
+ if test -f /forcefsck
+ then
+ force="-f"
+ else
+ force=""
+ fi
+ if test "$FSCKFIX" = yes
+ then
+ fix="-y"
+ else
+ fix="-a"
+ fi
+ spinner="-C"
+ case "$TERM" in
+ dumb|network|unknown|"") spinner="" ;;
+ esac
+ test "`uname -m`" = "s390" && spinner="" # This should go away
+ test "$VERBOSE" != no && echo "Checking all filesystems..."
+ fsck $spinner -R -A $fix $force
+ if test "$?" -gt 1
+ then
+ echo
+ echo "fsck failed. Please repair manually."
+ echo
+ echo "CONTROL-D will exit from this shell and continue system startup."
+ echo
+ # Start a single user shell on the console
+ /sbin/sulogin $CONSOLE
+ fi
+fi
+rm -f /fastboot /forcefsck
+
+: exit 0
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
new file mode 100755
index 00000000..02f0351f
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
@@ -0,0 +1,148 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: checkroot
+# Required-Start: udev
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Check to root file system.
+### END INIT INFO
+
+. /etc/default/rcS
+
+#
+# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
+# from this script *before anything else* with a timeout, like SCO does.
+#
+test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
+
+#
+# Read /etc/fstab.
+#
+exec 9< /etc/fstab
+rootmode=rw
+rootopts=rw
+rootcheck=$ENABLE_ROOTFS_FSCK
+swap_on_md=no
+devfs=
+while read fs mnt type opts dump pass junk <&9
+do
+ case "$fs" in
+ ""|\#*)
+ continue;
+ ;;
+ /dev/md*)
+ # Swap on md device.
+ test "$type" = swap && swap_on_md=yes
+ ;;
+ /dev/*)
+ ;;
+ *)
+ # Might be a swapfile.
+ test "$type" = swap && swap_on_md=yes
+ ;;
+ esac
+ test "$type" = devfs && devfs="$fs"
+ test "$mnt" != / && continue
+ rootopts="$opts"
+ test "$pass" = 0 -o "$pass" = "" && rootcheck=no
+ case "$opts" in
+ ro|ro,*|*,ro|*,ro,*)
+ rootmode=ro
+ ;;
+ esac
+done
+exec 0>&9 9>&-
+
+# Check for conflicting configurations
+if [ "$rootmode" = "ro" -a "$ROOTFS_READ_ONLY" = "no" ] || \
+ [ "$rootmode" = "rw" -a "$ROOTFS_READ_ONLY" = "yes" ]; then
+ echo ""
+ echo "WARN: conflicting configurations in /etc/fstab and /etc/default/rcS"
+ echo " regarding the writability of rootfs. Please fix one of them."
+ echo ""
+fi
+
+
+#
+# Activate the swap device(s) in /etc/fstab. This needs to be done
+# before fsck, since fsck can be quite memory-hungry.
+#
+test "$VERBOSE" != no && echo "Activating swap"
+[ -x /sbin/swapon ] && swapon -a
+
+#
+# Check the root filesystem.
+#
+if test -f /fastboot || test $rootcheck = no
+then
+ test $rootcheck = yes && echo "Fast boot, no filesystem check"
+else
+ #
+ # Ensure that root is quiescent and read-only before fsck'ing.
+ #
+ mount -n -o remount,ro /
+ if test $? = 0
+ then
+ if test -f /forcefsck
+ then
+ force="-f"
+ else
+ force=""
+ fi
+ if test "$FSCKFIX" = yes
+ then
+ fix="-y"
+ else
+ fix="-a"
+ fi
+ spinner="-C"
+ case "$TERM" in
+ dumb|network|unknown|"") spinner="" ;;
+ esac
+ test `uname -m` = s390 && spinner="" # This should go away
+ test "$VERBOSE" != no && echo "Checking root filesystem..."
+ fsck $spinner $force $fix /
+ #
+ # If there was a failure, drop into single-user mode.
+ #
+ # NOTE: "failure" is defined as exiting with a return code of
+ # 2 or larger. A return code of 1 indicates that filesystem
+ # errors were corrected but that the boot may proceed.
+ #
+ if test "$?" -gt 1
+ then
+ # Surprise! Re-directing from a HERE document (as in
+ # "cat << EOF") won't work, because the root is read-only.
+ echo
+ echo "fsck failed. Please repair manually and reboot. Please note"
+ echo "that the root filesystem is currently mounted read-only. To"
+ echo "remount it read-write:"
+ echo
+ echo " # mount -n -o remount,rw /"
+ echo
+ echo "CONTROL-D will exit from this shell and REBOOT the system."
+ echo
+ # Start a single user shell on the console
+ /sbin/sulogin $CONSOLE
+ reboot -f
+ fi
+ else
+ echo "*** ERROR! Cannot fsck root fs because it is not mounted read-only!"
+ echo
+ fi
+fi
+
+#
+# If the root filesystem was not marked as read-only in /etc/fstab,
+# remount the rootfs rw but do not try to change mtab because it
+# is on a ro fs until the remount succeeded. Then clean up old mtabs
+# and finally write the new mtab.
+#
+mount -n -o remount,$rootmode /
+if test "$rootmode" = rw
+then
+ ln -sf /proc/mounts /dev/mtab
+fi
+
+: exit 0
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts
new file mode 100644
index 00000000..4a0978b4
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts
@@ -0,0 +1,5 @@
+# GID of the `tty' group
+TTYGRP=5
+
+# Set to 600 to have `mesg n' be the default
+TTYMODE=620
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh
new file mode 100755
index 00000000..c6043fb1
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: devpts
+# Required-Start: udev
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Mount /dev/pts file systems.
+### END INIT INFO
+
+. /etc/default/devpts
+
+if grep -q devpts /proc/filesystems
+then
+ #
+ # Create multiplexor device.
+ #
+ test -c /dev/ptmx || mknod -m 666 /dev/ptmx c 5 2
+
+ #
+ # Mount /dev/pts if needed.
+ #
+ if ! grep -q devpts /proc/mounts
+ then
+ mkdir -p /dev/pts
+ mount -t devpts devpts /dev/pts -ogid=${TTYGRP},mode=${TTYMODE}
+ fi
+fi
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
new file mode 100755
index 00000000..2b9eba64
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: dmesg
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+if [ -f /var/log/dmesg ]; then
+ if LOGPATH=$(which logrotate); then
+ $LOGPATH -f /etc/logrotate-dmesg.conf
+ else
+ mv -f /var/log/dmesg /var/log/dmesg.old
+ fi
+fi
+dmesg -s 131072 > /var/log/dmesg
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/functions b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/functions
new file mode 100755
index 00000000..01ad1edd
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/functions
@@ -0,0 +1,91 @@
+# -*-Shell-script-*-
+#
+# functions This file contains functions to be used by most or all
+# shell scripts in the /etc/init.d directory.
+#
+
+NORMAL="\\033[0;39m" # Standard console grey
+SUCCESS="\\033[1;32m" # Success is green
+WARNING="\\033[1;33m" # Warnings are yellow
+FAILURE="\\033[1;31m" # Failures are red
+INFO="\\033[1;36m" # Information is light cyan
+BRACKET="\\033[1;34m" # Brackets are blue
+
+# NOTE: The pidofproc () doesn't support the process which is a script unless
+# the pidof supports "-x" option. If you want to use it for such a
+# process:
+# 1) If there is no "pidof -x", replace the "pidof $1" with another
+# command like(for core-image-minimal):
+# ps | awk '/'"$1"'/ {print $1}'
+# Or
+# 2) If there is "pidof -x", replace "pidof" with "pidof -x".
+#
+# pidofproc - print the pid of a process
+# $1: the name of the process
+pidofproc () {
+
+ # pidof output null when no program is running, so no "2>/dev/null".
+ pid=`pidof $1`
+ status=$?
+ case $status in
+ 0)
+ echo $pid
+ return 0
+ ;;
+ 127)
+ echo "ERROR: command pidof not found" >&2
+ exit 127
+ ;;
+ *)
+ return $status
+ ;;
+ esac
+}
+
+machine_id() { # return the machine ID
+ awk 'BEGIN { FS=": " } /Hardware/ \
+ { gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo
+}
+
+killproc() { # kill the named process(es)
+ pid=`pidofproc $1` && kill $pid
+}
+
+status() {
+ local pid
+ if [ "$#" = 0 ]; then
+ echo "Usage: status {program}"
+ return 1
+ fi
+ pid=`pidofproc $1`
+ if [ -n "$pid" ]; then
+ echo "$1 (pid $pid) is running..."
+ return 0
+ else
+ echo "$1 is stopped"
+ fi
+ return 3
+}
+
+success() {
+ echo -n -e "${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
+ return 0
+}
+
+failure() {
+ local rc=$*
+ echo -n -e "${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
+ return $rc
+}
+
+warning() {
+ local rc=$*
+ echo -n -e "${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
+ return $rc
+}
+
+passed() {
+ local rc=$*
+ echo -n -e "${BRACKET}[${SUCCESS} PASS ${BRACKET}]${NORMAL}"
+ return $rc
+}
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/halt b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/halt
new file mode 100755
index 00000000..a56f7342
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/halt
@@ -0,0 +1,29 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: halt
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop: 0
+# Short-Description: Execute the halt command.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# See if we need to cut the power.
+if test -x /etc/init.d/ups-monitor
+then
+ /etc/init.d/ups-monitor poweroff
+fi
+
+# Don't shut down drives if we're using RAID.
+hddown="-h"
+if grep -qs '^md.*active' /proc/mdstat
+then
+ hddown=""
+fi
+
+halt SED_HALTARGS -p $hddown
+
+: exit 0
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
new file mode 100755
index 00000000..95287cc1
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: hostname
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Set hostname based on /etc/hostname
+### END INIT INFO
+HOSTNAME=$(/bin/hostname)
+
+hostname -b -F /etc/hostname 2> /dev/null
+if [ $? -eq 0 ]; then
+ exit
+fi
+
+# Busybox hostname doesn't support -b so we need implement it on our own
+if [ -f /etc/hostname ];then
+ hostname `cat /etc/hostname`
+elif [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" -o ! -z "`echo $HOSTNAME | sed -n '/^[0-9]*\.[0-9].*/p'`" ] ; then
+ hostname localhost
+fi
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf
new file mode 100644
index 00000000..6f46e421
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf
@@ -0,0 +1,9 @@
+# see "man logrotate" for details
+# rotate dmesg, and keep 5 versions.
+
+/var/log/dmesg {
+ create
+ rotate 5
+ nodateext
+}
+
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
new file mode 100755
index 00000000..c719be5d
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: mountall
+# Required-Start: mountvirtfs
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Mount all filesystems.
+# Description:
+### END INIT INFO
+
+. /etc/default/rcS
+
+#
+# Mount local filesystems in /etc/fstab. For some reason, people
+# might want to mount "proc" several times, and mount -v complains
+# about this. So we mount "proc" filesystems without -v.
+#
+test "$VERBOSE" != no && echo "Mounting local filesystems..."
+mount -at nonfs,nosmbfs,noncpfs 2>/dev/null
+
+#
+# We might have mounted something over /dev, see if /dev/initctl is there.
+#
+if test ! -p /dev/initctl
+then
+ rm -f /dev/initctl
+ mknod -m 600 /dev/initctl p
+fi
+kill -USR1 1
+
+#
+# Execute swapon command again, in case we want to swap to
+# a file on a now mounted filesystem.
+#
+[ -x /sbin/swapon ] && swapon -a
+
+: exit 0
+
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
new file mode 100755
index 00000000..be9f5970
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
@@ -0,0 +1,91 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: mountnfs
+# Required-Start: $local_fs $network $rpcbind
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+#
+# Run in a subshell because of I/O redirection.
+#
+test -f /etc/fstab && (
+
+#
+# Read through fstab line by line. If it is NFS, set the flag
+# for mounting NFS filesystems. If any NFS partition is found and it
+# not mounted with the nolock option, we start the rpcbind.
+#
+rpcbind=no
+mount_nfs=no
+mount_smb=no
+mount_ncp=no
+mount_cifs=no
+while read device mountpt fstype options
+do
+ case "$device" in
+ ""|\#*)
+ continue
+ ;;
+ esac
+
+ case "$options" in
+ *noauto*)
+ continue
+ ;;
+ esac
+
+ if test "$fstype" = nfs
+ then
+ mount_nfs=yes
+ case "$options" in
+ *nolock*)
+ ;;
+ *)
+ rpcbind=yes
+ ;;
+ esac
+ fi
+ if test "$fstype" = smbfs
+ then
+ mount_smb=yes
+ fi
+ if test "$fstype" = ncpfs
+ then
+ mount_ncp=yes
+ fi
+ if test "$fstype" = cifs
+ then
+ mount_cifs=yes
+ fi
+done
+
+exec 0>&1
+
+if test "$rpcbind" = yes
+then
+ if test -x /usr/sbin/rpcbind
+ then
+ service rpcbind status > /dev/null
+ if [ $? != 0 ]; then
+ echo -n "Starting rpcbind..."
+ start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
+ sleep 2
+ fi
+ fi
+fi
+
+if test "$mount_nfs" = yes || test "$mount_smb" = yes || test "$mount_ncp" = yes || test "$mount_cifs" = yes
+then
+ echo "Mounting remote filesystems..."
+ test "$mount_nfs" = yes && mount -a -t nfs
+ test "$mount_smb" = yes && mount -a -t smbfs
+ test "$mount_ncp" = yes && mount -a -t ncpfs
+ test "$mount_cifs" = yes && mount -a -t cifs
+fi
+
+) < /etc/fstab
+
+: exit 0
+
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
new file mode 100755
index 00000000..6f965a68
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -0,0 +1,273 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: volatile
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Populate the volatile filesystem
+### END INIT INFO
+
+# Get ROOT_DIR
+DIRNAME=`dirname $0`
+ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'`
+
+[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS
+# When running populate-volatile.sh at rootfs time, disable cache.
+[ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no
+# If rootfs is read-only, disable cache.
+[ "$ROOTFS_READ_ONLY" = "yes" ] && VOLATILE_ENABLE_CACHE=no
+
+CFGDIR="${ROOT_DIR}/etc/default/volatiles"
+TMPROOT="${ROOT_DIR}/var/volatile/tmp"
+COREDEF="00_core"
+
+[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems."
+
+create_file() {
+ EXEC=""
+ [ -z "$2" ] && {
+ EXEC="
+ touch \"$1\";
+ "
+ } || {
+ EXEC="
+ cp \"$2\" \"$1\";
+ "
+ }
+ EXEC="
+ ${EXEC}
+ chown ${TUSER}:${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
+ chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
+
+ test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
+
+ [ -e "$1" ] && {
+ [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+ } || {
+ if [ -z "$ROOT_DIR" ]; then
+ eval $EXEC
+ else
+ # Creating some files at rootfs time may fail and should fail,
+ # but these failures should not be logged to make sure the do_rootfs
+ # process doesn't fail. This does no harm, as this script will
+ # run on target to set up the correct files and directories.
+ eval $EXEC > /dev/null 2>&1
+ fi
+ }
+}
+
+mk_dir() {
+ EXEC="
+ mkdir -p \"$1\";
+ chown ${TUSER}:${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
+ chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
+
+ test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
+ [ -e "$1" ] && {
+ [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+ } || {
+ if [ -z "$ROOT_DIR" ]; then
+ eval $EXEC
+ else
+ # For the same reason with create_file(), failures should
+ # not be logged.
+ eval $EXEC > /dev/null 2>&1
+ fi
+ }
+}
+
+link_file() {
+ EXEC="
+ if [ -L \"$2\" ]; then
+ [ \"\$(readlink -f \"$2\")\" != \"$1\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
+ elif [ -d \"$2\" ]; then
+ if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then
+ cp -a $2/* $1 2>/dev/null;
+ cp -a $2/.[!.]* $1 2>/dev/null;
+ rm -rf \"$2\";
+ ln -sf \"$1\" \"$2\";
+ fi
+ else
+ ln -sf \"$1\" \"$2\";
+ fi
+ "
+
+ test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/volatile.cache.build
+
+ if [ -z "$ROOT_DIR" ]; then
+ eval $EXEC
+ else
+ # For the same reason with create_file(), failures should
+ # not be logged.
+ eval $EXEC > /dev/null 2>&1
+ fi
+}
+
+check_requirements() {
+ cleanup() {
+ rm "${TMP_INTERMED}"
+ rm "${TMP_DEFINED}"
+ rm "${TMP_COMBINED}"
+ }
+
+ CFGFILE="$1"
+
+ TMP_INTERMED="${TMPROOT}/tmp.$$"
+ TMP_DEFINED="${TMPROOT}/tmpdefined.$$"
+ TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
+
+ sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/passwd | sort | uniq > "${TMP_DEFINED}"
+ cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 > "${TMP_INTERMED}"
+ cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
+ NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
+ NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`"
+
+ [ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && {
+ echo "Undefined users:"
+ diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
+ cleanup
+ return 1
+ }
+
+
+ sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/group | sort | uniq > "${TMP_DEFINED}"
+ cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 > "${TMP_INTERMED}"
+ cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
+
+ NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`"
+ NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`"
+
+ [ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && {
+ echo "Undefined groups:"
+ diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
+ cleanup
+ return 1
+ }
+
+ # Add checks for required directories here
+
+ cleanup
+ return 0
+}
+
+apply_cfgfile() {
+ CFGFILE="$1"
+ SKIP_REQUIREMENTS="$2"
+
+ [ "${VERBOSE}" != "no" ] && echo "Applying ${CFGFILE}"
+
+ [ "${SKIP_REQUIREMENTS}" == "yes" ] || check_requirements "${CFGFILE}" || {
+ echo "Skipping ${CFGFILE}"
+ return 1
+ }
+
+ cat ${CFGFILE} | sed 's/#.*//' | \
+ while read TTYPE TUSER TGROUP TMODE TNAME TLTARGET; do
+ test -z "${TLTARGET}" && continue
+ TNAME=${ROOT_DIR}${TNAME}
+ [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
+
+ [ "${TTYPE}" = "l" ] && {
+ TSOURCE="$TLTARGET"
+ [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
+ link_file "${TSOURCE}" "${TNAME}"
+ continue
+ }
+
+ [ "${TTYPE}" = "b" ] && {
+ TSOURCE="$TLTARGET"
+ [ "${VERBOSE}" != "no" ] && echo "Creating mount-bind -${TNAME}- from -${TSOURCE}-."
+ mount --bind "${TSOURCE}" "${TNAME}"
+ EXEC="
+ mount --bind \"${TSOURCE}\" \"${TNAME}\""
+ test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
+ continue
+ }
+
+ [ -L "${TNAME}" ] && {
+ [ "${VERBOSE}" != "no" ] && echo "Found link."
+ NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'`
+ echo ${NEWNAME} | grep -v "^/" >/dev/null && {
+ TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}"
+ [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-."
+ } || {
+ TNAME="${NEWNAME}"
+ [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-."
+ }
+ }
+
+ case "${TTYPE}" in
+ "f") [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
+ TSOURCE="$TLTARGET"
+ [ "${TSOURCE}" = "none" ] && TSOURCE=""
+ create_file "${TNAME}" "${TSOURCE}" &
+ ;;
+ "d") [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-."
+ mk_dir "${TNAME}"
+ # Add check to see if there's an entry in fstab to mount.
+ ;;
+ *) [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-."
+ continue
+ ;;
+ esac
+ done
+ return 0
+}
+
+clearcache=0
+exec 9</proc/cmdline
+while read line <&9
+do
+ case "$line" in
+ *clearcache*) clearcache=1
+ ;;
+ *) continue
+ ;;
+ esac
+done
+exec 9>&-
+
+if test -e ${ROOT_DIR}/etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0"
+then
+ sh ${ROOT_DIR}/etc/volatile.cache
+else
+ rm -f ${ROOT_DIR}/etc/volatile.cache ${ROOT_DIR}/etc/volatile.cache.build
+
+ # Apply the core file with out checking requirements. ${TMPROOT} is
+ # needed by check_requirements but is setup by this file, so it must be
+ # processed first and without being checked.
+ [ -e "${CFGDIR}/${COREDEF}" ] && apply_cfgfile "${CFGDIR}/${COREDEF}" "yes"
+
+ # Fast path: check_requirements is slow and most of the time doesn't
+ # find any problems. If there are a lot of config files, it is much
+ # faster to to concatenate them all together and process them once to
+ # avoid the overhead of calling check_requirements repeatedly
+ TMP_FILE="${TMPROOT}/tmp_volatile.$$"
+ rm -f "$TMP_FILE"
+
+ CFGFILES="`ls -1 "${CFGDIR}" | grep -v "^${COREDEF}\$" | sort`"
+ for file in ${CFGFILES}; do
+ cat "${CFGDIR}/${file}" >> "$TMP_FILE"
+ done
+
+ if check_requirements "$TMP_FILE"
+ then
+ apply_cfgfile "$TMP_FILE" "yes"
+ else
+ # Slow path: One or more config files failed requirements.
+ # Process each one individually so the offending one can be
+ # skipped
+ for file in ${CFGFILES}; do
+ apply_cfgfile "${CFGDIR}/${file}"
+ done
+ fi
+ rm "$TMP_FILE"
+
+ [ -e ${ROOT_DIR}/etc/volatile.cache.build ] && sync && mv ${ROOT_DIR}/etc/volatile.cache.build ${ROOT_DIR}/etc/volatile.cache
+fi
+
+if [ -z "${ROOT_DIR}" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ]
+then
+ ln -s /etc/ld.so.cache /var/run/ld.so.cache
+fi
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
new file mode 100644
index 00000000..bd445ddb
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+. /etc/default/rcS
+
+[ "$ROOTFS_READ_ONLY" = "no" ] && exit 0
+
+is_on_read_only_partition () {
+ DIRECTORY=$1
+ dir=`readlink -f $DIRECTORY`
+ while true; do
+ if [ ! -d "$dir" ]; then
+ echo "ERROR: $dir is not a directory"
+ exit 1
+ else
+ for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \
+ END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do
+ [ "$flag" = "FOUND" ] && partition="read-write"
+ [ "$flag" = "ro" ] && { partition="read-only"; break; }
+ done
+ if [ "$dir" = "/" -o -n "$partition" ]; then
+ break
+ else
+ dir=`dirname $dir`
+ fi
+ fi
+ done
+ [ "$partition" = "read-only" ] && echo "yes" || echo "no"
+}
+
+if [ "$1" = "start" ] ; then
+ if [ `is_on_read_only_partition /var/lib` = "yes" ]; then
+ grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile
+ mkdir -p /var/volatile/lib
+ mkdir -p /var/volatile/.lib-work
+ # Try to mount using overlay, which is much faster than copying
+ # files. If that fails, fallback to the slower copy
+ if ! mount -t overlay overlay -olowerdir=/var/lib,upperdir=/var/volatile/lib,workdir=/var/volatile/.lib-work /var/lib > /dev/null 2>&1; then
+ cp -a /var/lib/* /var/volatile/lib
+ mount --bind /var/volatile/lib /var/lib
+ fi
+ fi
+fi
+
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/reboot b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/reboot
new file mode 100755
index 00000000..087d8d5d
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/reboot
@@ -0,0 +1,15 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: reboot
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop: 6
+# Short-Description: Execute the reboot command.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+echo -n "Rebooting... "
+reboot SED_HALTARGS
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh
new file mode 100755
index 00000000..76de3418
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: rmnologin
+# Required-Start: $remote_fs $all
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop:
+# Short-Description: Remove /etc/nologin at boot
+# Description: This script removes the /etc/nologin file as the
+# last step in the boot process, if DELAYLOGIN=yes.
+# If DELAYLOGIN=no, /etc/nologin was not created by
+# bootmisc earlier in the boot process.
+### END INIT INFO
+
+if test -f /etc/nologin.boot
+then
+ rm -f /etc/nologin /etc/nologin.boot
+fi
+
+: exit 0
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
new file mode 100644
index 00000000..1632a5f6
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: save-rtc
+# Required-Start:
+# Required-Stop: $local_fs hwclock
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Store system clock into file
+# Description:
+### END INIT INFO
+
+# Update the timestamp
+date -u +%4Y%2m%2d%2H%2M%2S 2>/dev/null > /etc/timestamp
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs
new file mode 100755
index 00000000..34e1b771
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sendsigs
@@ -0,0 +1,21 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: sendsigs
+# Required-Start:
+# Required-Stop: umountnfs
+# Default-Start:
+# Default-Stop: 0 6
+# Short-Description: Kill all remaining processes.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Kill all processes.
+echo "Sending all processes the TERM signal..."
+killall5 -15
+sleep 5
+echo "Sending all processes the KILL signal..."
+killall5 -9
+
+: exit 0
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/single b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/single
new file mode 100755
index 00000000..da82d178
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/single
@@ -0,0 +1,24 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: single
+# Required-Start: $local_fs $all killprocs
+# Required-Stop:
+# Default-Start: 1
+# Default-Stop:
+# Short-Description: executed by init(8) upon entering runlevel 1 (single).
+### END INIT INFO
+
+PATH="/sbin:/bin:/usr/sbin:/usr/bin"
+
+# Kill all processes.
+echo "Sending all processes the TERM signal..."
+killall5 -15
+sleep 5
+echo "Sending all processes the KILL signal..."
+killall5 -9
+
+# We start update here, since we just killed it.
+test -x /sbin/update && update
+
+echo "Entering single-user mode..."
+exec init -t1 S
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sushell b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sushell
new file mode 100644
index 00000000..c319d95b
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sushell
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ -z "$SUSHELL" ] && SUSHELL=/bin/sh
+
+exec $SUSHELL
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
new file mode 100644
index 00000000..f5b5b990
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: mountvirtfs
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Mount kernel virtual file systems.
+# Description: Mount initial set of virtual filesystems the kernel
+# provides and that are required by everything.
+### END INIT INFO
+
+if [ -e /proc ] && ! [ -e /proc/mounts ]; then
+ mount -t proc proc /proc
+fi
+
+if [ -e /sys ] && grep -q sysfs /proc/filesystems && ! [ -e /sys/class ]; then
+ mount -t sysfs sysfs /sys
+fi
+
+if [ -e /sys/kernel/debug ] && grep -q debugfs /proc/filesystems; then
+ mount -t debugfs debugfs /sys/kernel/debug
+fi
+
+if [ -e /sys/kernel/config ] && grep -q configfs /proc/filesystems; then
+ mount -t configfs configfs /sys/kernel/config
+fi
+
+if ! [ -e /dev/zero ] && [ -e /dev ] && grep -q devtmpfs /proc/filesystems; then
+ mount -n -t devtmpfs devtmpfs /dev
+fi
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs
new file mode 100755
index 00000000..7fb5c58b
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/umountfs
@@ -0,0 +1,24 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: umountfs
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop: 0 6
+# Short-Description: Turn off swap and unmount all local file systems.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+echo "Deactivating swap..."
+[ -x /sbin/swapoff ] && swapoff -a
+
+# We leave /proc mounted.
+echo "Unmounting local filesystems..."
+grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram
+mount -o remount,ro /
+
+umount -f -a -r > /dev/null 2>&1
+
+: exit 0
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh
new file mode 100755
index 00000000..af075407
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: umountnfs
+# Required-Start:
+# Required-Stop: umountfs
+# Should-Stop: $network $portmap
+# Default-Start:
+# Default-Stop: 0 6
+# Short-Description: Unmount all network filesystems
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Write a reboot record to /var/log/wtmp before unmounting
+halt -w
+
+echo "Unmounting remote filesystems..."
+
+test -f /etc/fstab && (
+
+#
+# Read through fstab line by line and unount network file systems
+#
+while read device mountpt fstype options
+do
+ if test "$fstype" = nfs || test "$fstype" = smbfs || test "$fstype" = ncpfs || test "$fstype" = cifs
+ then
+ umount -f $mountpt
+ fi
+done
+) < /etc/fstab
+
+: exit 0
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/urandom b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/urandom
new file mode 100755
index 00000000..af1625b5
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/urandom
@@ -0,0 +1,49 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: urandom
+# Required-Start: $local_fs mountvirtfs
+# Required-Stop: $local_fs
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Save and restore the random seed
+# Description: Save the random seed on shutdown and restore it on boot,
+# to ensure that the seed isn't predicable on startup
+# (because the boot process is predictable)
+### END INIT INFO
+
+test -c /dev/urandom || exit 0
+
+RANDOM_SEED_FILE=/var/lib/urandom/random-seed
+
+. /etc/default/rcS
+[ -f /etc/default/urandom ] && . /etc/default/urandom
+
+case "$1" in
+ start|"")
+ test "$VERBOSE" != no && echo "Initializing random number generator..."
+ # Load and then save 512 bytes, which is the size of the entropy
+ # pool. Also load the current date, in case the seed file is
+ # empty.
+ ( date +%s.%N; [ -f "$RANDOM_SEED_FILE" ] && cat "$RANDOM_SEED_FILE" ) \
+ >/dev/urandom
+ rm -f "$RANDOM_SEED_FILE"
+ umask 077
+ dd if=/dev/urandom of=$RANDOM_SEED_FILE count=1 \
+ >/dev/null 2>&1 || echo "urandom start: failed."
+ umask 022
+ ;;
+ stop)
+ # Carry a random seed from shut-down to start-up;
+ # see documentation in linux/drivers/char/random.c
+ test "$VERBOSE" != no && echo "Saving random seed..."
+ umask 077
+ dd if=/dev/urandom of=$RANDOM_SEED_FILE count=1 \
+ >/dev/null 2>&1 || echo "urandom stop: failed."
+ ;;
+ *)
+ echo "Usage: urandom {start|stop}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles
new file mode 100644
index 00000000..20110664
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -0,0 +1,37 @@
+# This configuration file lists filesystem objects that should get verified
+# during startup and be created if missing.
+#
+# Entries have the following format:
+# <type> <owner> <group> <mode> <path> <linksource>
+# where the items are separated by whitespace !
+#
+# The # character introduces a comment lasting until end of line.
+# Blank lines are ignored.
+#
+# <type> : d|f|l : (d)irectory|(f)ile|(l)ink
+#
+# A linking example:
+# l root root 0777 /var/test /tmp/testfile
+# f root root 0644 /var/test none
+#
+# Understanding links:
+# When populate-volatile is to verify/create a directory or file, it will first
+# check it's existence. If a link is found to exist in the place of the target,
+# the path of the target is replaced with the target the link points to.
+# Thus, if a link is in the place to be verified, the object will be created
+# in the place the link points to instead.
+# This explains the order of "link before object" as in the example above, where
+# a link will be created at /var/test pointing to /tmp/testfile and due to this
+# link the file defined as /var/test will actually be created as /tmp/testfile.
+d root root 1777 /run/lock none
+d root root 0755 /var/volatile/log none
+d root root 1777 /var/volatile/tmp none
+l root root 1777 /var/lock /run/lock
+l root root 0755 /var/run /run
+l root root 1777 /var/tmp /var/volatile/tmp
+l root root 1777 /tmp /var/tmp
+d root root 0755 /var/lock/subsys none
+f root root 0664 /var/log/wtmp none
+f root root 0664 /var/run/utmp none
+l root root 0644 /etc/resolv.conf /var/run/resolv.conf
+f root root 0644 /var/run/resolv.conf none
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts_1.0.bb b/external/poky/meta/recipes-core/initscripts/initscripts_1.0.bb
new file mode 100644
index 00000000..91eea4b8
--- /dev/null
+++ b/external/poky/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -0,0 +1,186 @@
+SUMMARY = "SysV init scripts"
+HOMEPAGE = "https://github.com/fedora-sysv/initscripts"
+DESCRIPTION = "Initscripts provide the basic system startup initialization scripts for the system. These scripts include actions such as filesystem mounting, fsck, RTC manipulation and other actions routinely performed at system startup. In addition, the scripts are also used during system shutdown to reverse the actions performed at startup."
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+PR = "r155"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://functions \
+ file://halt \
+ file://umountfs \
+ file://devpts.sh \
+ file://devpts \
+ file://hostname.sh \
+ file://mountall.sh \
+ file://banner.sh \
+ file://bootmisc.sh \
+ file://mountnfs.sh \
+ file://reboot \
+ file://checkfs.sh \
+ file://single \
+ file://sendsigs \
+ file://urandom \
+ file://rmnologin.sh \
+ file://checkroot.sh \
+ file://umountnfs.sh \
+ file://sysfs.sh \
+ file://populate-volatile.sh \
+ file://read-only-rootfs-hook.sh \
+ file://volatiles \
+ file://save-rtc.sh \
+ file://GPLv2.patch \
+ file://dmesg.sh \
+ file://logrotate-dmesg.conf \
+ ${@bb.utils.contains('DISTRO_FEATURES','selinux','file://sushell','',d)} \
+"
+
+S = "${WORKDIR}"
+
+SRC_URI_append_arm = " file://alignment.sh"
+
+KERNEL_VERSION = ""
+
+DEPENDS_append = " update-rc.d-native"
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+
+PACKAGES =+ "${PN}-functions ${PN}-sushell"
+RDEPENDS_${PN} = "initd-functions \
+ ${@bb.utils.contains('DISTRO_FEATURES','selinux','${PN}-sushell','',d)} \
+ "
+# Recommend pn-functions so that it will be a preferred default provider for initd-functions
+RRECOMMENDS_${PN} = "${PN}-functions"
+RPROVIDES_${PN}-functions = "initd-functions"
+RCONFLICTS_${PN}-functions = "lsbinitscripts"
+FILES_${PN}-functions = "${sysconfdir}/init.d/functions*"
+FILES_${PN}-sushell = "${base_sbindir}/sushell"
+
+HALTARGS ?= "-d -f"
+
+do_configure() {
+ sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/halt
+ sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/reboot
+}
+
+do_install () {
+#
+# Create directories and install device independent scripts
+#
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/rcS.d
+ install -d ${D}${sysconfdir}/rc0.d
+ install -d ${D}${sysconfdir}/rc1.d
+ install -d ${D}${sysconfdir}/rc2.d
+ install -d ${D}${sysconfdir}/rc3.d
+ install -d ${D}${sysconfdir}/rc4.d
+ install -d ${D}${sysconfdir}/rc5.d
+ install -d ${D}${sysconfdir}/rc6.d
+ install -d ${D}${sysconfdir}/default
+ install -d ${D}${sysconfdir}/default/volatiles
+ # Holds state information pertaining to urandom
+ install -d ${D}${localstatedir}/lib/urandom
+
+ install -m 0644 ${WORKDIR}/functions ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/checkroot.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/halt ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/hostname.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/mountall.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/mountnfs.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/reboot ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/rmnologin.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/sendsigs ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/single ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/umountnfs.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/urandom ${D}${sysconfdir}/init.d
+ sed -i ${D}${sysconfdir}/init.d/urandom -e 's,/var/,${localstatedir}/,g;s,/etc/,${sysconfdir}/,g'
+ install -m 0755 ${WORKDIR}/devpts.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core
+ if [ ${@ oe.types.boolean('${VOLATILE_LOG_DIR}') } = True ]; then
+ echo "l root root 0755 /var/log /var/volatile/log" >> ${D}${sysconfdir}/default/volatiles/00_core
+ fi
+ install -m 0755 ${WORKDIR}/dmesg.sh ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
+
+ if [ "${TARGET_ARCH}" = "arm" ]; then
+ install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','selinux','true','false',d)}; then
+ install -d ${D}/${base_sbindir}
+ install -m 0755 ${WORKDIR}/sushell ${D}/${base_sbindir}
+ fi
+#
+# Install device dependent scripts
+#
+ install -m 0755 ${WORKDIR}/banner.sh ${D}${sysconfdir}/init.d/banner.sh
+ install -m 0755 ${WORKDIR}/umountfs ${D}${sysconfdir}/init.d/umountfs
+#
+# Create runlevel links
+#
+ update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 .
+ update-rc.d -r ${D} sendsigs start 20 0 6 .
+ update-rc.d -r ${D} urandom start 38 S 0 6 .
+ update-rc.d -r ${D} umountnfs.sh start 31 0 1 6 .
+ update-rc.d -r ${D} umountfs start 40 0 6 .
+ update-rc.d -r ${D} reboot start 90 6 .
+ update-rc.d -r ${D} halt start 90 0 .
+ update-rc.d -r ${D} save-rtc.sh start 25 0 6 .
+ update-rc.d -r ${D} banner.sh start 02 S .
+ update-rc.d -r ${D} checkroot.sh start 06 S .
+ update-rc.d -r ${D} mountall.sh start 03 S .
+ update-rc.d -r ${D} hostname.sh start 39 S .
+ update-rc.d -r ${D} mountnfs.sh start 15 2 3 4 5 .
+ update-rc.d -r ${D} bootmisc.sh start 36 S .
+ update-rc.d -r ${D} sysfs.sh start 02 S .
+ update-rc.d -r ${D} populate-volatile.sh start 37 S .
+ update-rc.d -r ${D} read-only-rootfs-hook.sh start 29 S .
+ update-rc.d -r ${D} devpts.sh start 06 S .
+ if [ "${TARGET_ARCH}" = "arm" ]; then
+ update-rc.d -r ${D} alignment.sh start 06 S .
+ fi
+ # We wish to have /var/log ready at this stage so execute this after
+ # populate-volatile.sh
+ update-rc.d -r ${D} dmesg.sh start 38 S .
+}
+
+MASKED_SCRIPTS = " \
+ banner \
+ bootmisc \
+ checkfs \
+ checkroot \
+ devpts \
+ dmesg \
+ hostname \
+ mountall \
+ mountnfs \
+ populate-volatile \
+ read-only-rootfs-hook \
+ rmnologin \
+ sysfs \
+ urandom"
+
+pkg_postinst_${PN} () {
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+ for SERVICE in ${MASKED_SCRIPTS}; do
+ systemctl $OPTS mask $SERVICE.service
+ done
+ fi
+
+ # Delete any old volatile cache script, as directories may have moved
+ if [ -z "$D" ]; then
+ rm -f "/etc/volatile.cache"
+ fi
+}
+
+CONFFILES_${PN} += "${sysconfdir}/init.d/checkroot.sh"
diff --git a/external/poky/meta/recipes-core/kbd/kbd/run-ptest b/external/poky/meta/recipes-core/kbd/kbd/run-ptest
new file mode 100644
index 00000000..7a2d205f
--- /dev/null
+++ b/external/poky/meta/recipes-core/kbd/kbd/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+CURDIR=$(dirname `readlink -f $0`)
+make -k -C ${CURDIR}/tests check-TESTS
diff --git a/external/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch b/external/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch
new file mode 100644
index 00000000..a9a3ab8a
--- /dev/null
+++ b/external/poky/meta/recipes-core/kbd/kbd/set-proper-path-of-resources.patch
@@ -0,0 +1,56 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+kbd is out of source built, then the value of $(srcdir) is relative path of
+${S}/tests to ${B}/tests. Macro DATADIR is defined with $(srcdir) and replaced
+in .c files by compiler, and string @DATADIR@ is replaced with $(srdir) by rule
+"%: %.in" in Makefile.
+
+But kbd-ptest puts test cases and resource files in same directory, then some
+ptest cases fail to find resources.
+
+Replace DATADIR and @DATADIR@ with current directory(dot) to make test cases
+run as expected.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+Index: kbd-2.0.4/tests/Makefile.am
+===================================================================
+--- kbd-2.0.4.orig/tests/Makefile.am
++++ kbd-2.0.4/tests/Makefile.am
+@@ -1,7 +1,7 @@
+ AM_CPPFLAGS = \
+ -I$(srcdir)/../src/libkeymap \
+ -I$(builddir)/../src/libkeymap \
+- -DDATADIR=\"$(srcdir)\" -DBUILDDIR=\"$(builddir)\"
++ -DDATADIR=\".\" -DBUILDDIR=\"$(builddir)\"
+
+ AM_CFLAGS = $(CHECK_CFLAGS)
+ LDADD = $(top_builddir)/src/libkeymap/libkeymap.la $(CHECK_LIBS) @INTLLIBS@
+Index: kbd-2.0.4/tests/alt-is-meta.in
+===================================================================
+--- kbd-2.0.4.orig/tests/alt-is-meta.in
++++ kbd-2.0.4/tests/alt-is-meta.in
+@@ -7,8 +7,8 @@ cd "$cwd"
+ rc=0
+ temp="$(mktemp "@BUILDDIR@/temp.XXXXXXXXX")"
+
+-./libkeymap-showmaps "@DATADIR@"/alt-is-meta.map > "$temp" || rc=$?
+-cmp -s "@DATADIR@//alt-is-meta.output" "$temp" || rc=$?
++./libkeymap-showmaps ./alt-is-meta.map > "$temp" || rc=$?
++cmp -s "./alt-is-meta.output" "$temp" || rc=$?
+
+ if [ "$rc" != 0 ]; then
+ printf 'failed\n'
+Index: kbd-2.0.4/tests/dumpkeys-fulltable.in
+===================================================================
+--- kbd-2.0.4.orig/tests/dumpkeys-fulltable.in
++++ kbd-2.0.4/tests/dumpkeys-fulltable.in
+@@ -5,7 +5,7 @@ cwd="$(readlink -ev "${0%/*}")"
+ cd "$cwd"
+
+ BUILDDIR="@BUILDDIR@"
+-DATADIR="@DATADIR@"
++DATADIR="."
+
+ check_keymap() {
+ local kmap temp rc
diff --git a/external/poky/meta/recipes-core/kbd/kbd_2.0.4.bb b/external/poky/meta/recipes-core/kbd/kbd_2.0.4.bb
new file mode 100644
index 00000000..4af3256f
--- /dev/null
+++ b/external/poky/meta/recipes-core/kbd/kbd_2.0.4.bb
@@ -0,0 +1,64 @@
+SUMMARY = "Keytable files and keyboard utilities"
+HOMEPAGE = "http://www.kbd-project.org/"
+# everything minus console-fonts is GPLv2+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5fcc36121d93e1f69d96a313078c8b5"
+
+inherit autotools gettext ptest pkgconfig
+
+RREPLACES_${PN} = "console-tools"
+RPROVIDES_${PN} = "console-tools"
+RCONFLICTS_${PN} = "console-tools"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
+ file://run-ptest \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://set-proper-path-of-resources.patch', '', d)} \
+ "
+
+SRC_URI[md5sum] = "c1635a5a83b63aca7f97a3eab39ebaa6"
+SRC_URI[sha256sum] = "5fd90af6beb225a9bb9b9fb414c090fba53c9a55793e172f508cd43652e59a88"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests','', d)} \
+ "
+
+PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam,"
+PACKAGECONFIG[tests] = "--enable-tests, --disable-tests, libcheck"
+
+do_compile_ptest() {
+ oe_runmake -C ${B}/tests dumpkeys-fulltable alt-is-meta
+}
+
+do_install_ptest() {
+ install -D ${B}/tests/Makefile ${D}${PTEST_PATH}/tests/Makefile
+ sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
+ -e 's:--sysroot=${STAGING_DIR_TARGET}::g' \
+ -e 's:${DEBUG_PREFIX_MAP}::g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${S}/config/missing::g' \
+ -e 's:${WORKDIR}::g' \
+ -e '/libkeymap_.*_SOURCES =/d' -e '/$(EXEEXT):/,/^$/d' ${D}${PTEST_PATH}/tests/Makefile
+
+ find ${B}/tests -executable -exec install {} ${D}${PTEST_PATH}/tests \;
+ find ${S}/tests \( -name \*.map -o -name \*.bin -o -name \*.output \) -exec install {} ${D}${PTEST_PATH}/tests \;
+
+ install -D -m 755 ${S}/config/test-driver ${D}${PTEST_PATH}/config/test-driver
+}
+
+PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans"
+
+FILES_${PN}-consolefonts = "${datadir}/consolefonts"
+FILES_${PN}-consoletrans = "${datadir}/consoletrans"
+FILES_${PN}-keymaps = "${datadir}/keymaps"
+FILES_${PN}-unimaps = "${datadir}/unimaps"
+
+RDEPENDS_${PN}-ptest = "make"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt showkey"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
diff --git a/external/poky/meta/recipes-core/libcgroup/libcgroup/CVE-2018-14348.patch b/external/poky/meta/recipes-core/libcgroup/libcgroup/CVE-2018-14348.patch
new file mode 100644
index 00000000..d133703d
--- /dev/null
+++ b/external/poky/meta/recipes-core/libcgroup/libcgroup/CVE-2018-14348.patch
@@ -0,0 +1,37 @@
+From 0d88b73d189ea3440ccaab00418d6469f76fa590 Mon Sep 17 00:00:00 2001
+From: Michal Hocko <mhocko@suse.com>
+Date: Wed, 18 Jul 2018 11:24:29 +0200
+Subject: [PATCH] cgrulesengd: remove umask(0)
+
+One of our partners has noticed that cgred daemon is creating a log file
+(/var/log/cgred) with too wide permissions (0666) and that is seen as
+a security bug because an untrusted user can write to otherwise
+restricted area. CVE-2018-14348 has been assigned to this issue.
+
+CVE: CVE-2018-14348
+Upstream-Status: Backport [https://sourceforge.net/p/libcg/libcg/ci/0d88b73d189ea3440ccaab00418d6469f76fa590]
+
+Signed-off-by: Michal Hocko <mhocko@suse.com>
+Acked-by: Balbir Singh <bsingharora@gmail.com>
+Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
+---
+ src/daemon/cgrulesengd.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/daemon/cgrulesengd.c b/src/daemon/cgrulesengd.c
+index ea51f11..0d288f3 100644
+--- a/src/daemon/cgrulesengd.c
++++ b/src/daemon/cgrulesengd.c
+@@ -889,9 +889,6 @@ int cgre_start_daemon(const char *logp, const int logf,
+ } else if (pid > 0) {
+ exit(EXIT_SUCCESS);
+ }
+-
+- /* Change the file mode mask. */
+- umask(0);
+ } else {
+ flog(LOG_DEBUG, "Not using daemon mode\n");
+ pid = getpid();
+--
+2.13.3
+
diff --git a/external/poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch b/external/poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
new file mode 100644
index 00000000..65f4ef9a
--- /dev/null
+++ b/external/poky/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
@@ -0,0 +1,235 @@
+commit ca780b4f7f71abeeb04a585f2a4d889caaa985fa
+Author: Isaac Dunham <ibid.ag@gmail.com>
+Date: Fri Sep 5 22:35:32 2014 -0700
+
+ Remove __.*DECLS nonsense
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libcgroup-0.41/include/libcgroup/config.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/config.h
++++ libcgroup-0.41/include/libcgroup/config.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_config 5. Configuration
+@@ -107,6 +109,8 @@ int cgroup_config_create_template_group(
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /*_LIBCGROUP_CONFIG_H*/
+Index: libcgroup-0.41/include/libcgroup/error.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/error.h
++++ libcgroup-0.41/include/libcgroup/error.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_errors 6. Error handling
+@@ -99,6 +101,8 @@ int cgroup_get_last_errno(void);
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_INIT_H */
+Index: libcgroup-0.41/include/libcgroup/groups.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/groups.h
++++ libcgroup-0.41/include/libcgroup/groups.h
+@@ -11,7 +11,9 @@
+ #include <stdbool.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * Flags for cgroup_delete_cgroup_ext().
+@@ -577,6 +579,8 @@ char *cgroup_get_cgroup_name(struct cgro
+ */
+
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_GROUPS_H */
+Index: libcgroup-0.41/include/libcgroup/init.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/init.h
++++ libcgroup-0.41/include/libcgroup/init.h
+@@ -9,7 +9,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_init 1. Initialization
+@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_INIT_H */
+Index: libcgroup-0.41/include/libcgroup/iterators.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/iterators.h
++++ libcgroup-0.41/include/libcgroup/iterators.h
+@@ -11,7 +11,9 @@
+ #include <features.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_iterators 3. Iterators
+@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(vo
+ * @}
+ */
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_ITERATORS_H */
+Index: libcgroup-0.41/include/libcgroup/tasks.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/tasks.h
++++ libcgroup-0.41/include/libcgroup/tasks.h
+@@ -12,7 +12,9 @@
+ #include <stdbool.h>
+ #endif
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /** Flags for cgroup_change_cgroup_uid_gid(). */
+ enum cgflags {
+@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pi
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_TASKS_H */
+Index: libcgroup-0.41/src/daemon/cgrulesengd.h
+===================================================================
+--- libcgroup-0.41.orig/src/daemon/cgrulesengd.h
++++ libcgroup-0.41/src/daemon/cgrulesengd.h
+@@ -17,7 +17,9 @@
+
+ #include <features.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ #include "config.h"
+ #include "libcgroup.h"
+@@ -119,7 +121,9 @@ void cgre_flash_templates(int signum);
+ */
+ void cgre_catch_term(int signum);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _CGRULESENGD_H */
+
+Index: libcgroup-0.41/src/libcgroup-internal.h
+===================================================================
+--- libcgroup-0.41.orig/src/libcgroup-internal.h
++++ libcgroup-0.41/src/libcgroup-internal.h
+@@ -16,7 +16,9 @@
+
+ #define __LIBCG_INTERNAL
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ #include "config.h"
+ #include <fts.h>
+@@ -279,6 +281,8 @@ extern void cgroup_dictionary_iterator_e
+ */
+ int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask);
+
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif
+Index: libcgroup-0.41/include/libcgroup/log.h
+===================================================================
+--- libcgroup-0.41.orig/include/libcgroup/log.h
++++ libcgroup-0.41/include/libcgroup/log.h
+@@ -11,7 +11,9 @@
+
+ #include <stdarg.h>
+
+-__BEGIN_DECLS
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ /**
+ * @defgroup group_log 7. Logging
+@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(co
+ * @}
+ * @}
+ */
+-__END_DECLS
++#ifdef __cplusplus
++}
++#endif
+
+ #endif /* _LIBCGROUP_LOG_H */
diff --git a/external/poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb b/external/poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb
new file mode 100644
index 00000000..92d7261b
--- /dev/null
+++ b/external/poky/meta/recipes-core/libcgroup/libcgroup_0.41.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Linux control group abstraction library"
+HOMEPAGE = "http://libcg.sourceforge.net/"
+DESCRIPTION = "libcgroup is a library that abstracts the control group file system \
+in Linux. Control groups allow you to limit, account and isolate resource usage \
+(CPU, memory, disk I/O, etc.) of groups of processes."
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+inherit autotools pkgconfig
+
+DEPENDS = "bison-native flex-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/libcg/${BPN}/v0.41/${BPN}-${PV}.tar.bz2 \
+ file://CVE-2018-14348.patch"
+SRC_URI_append_libc-musl = " file://musl-decls-compat.patch"
+
+SRC_URI[md5sum] = "3dea9d50b8a5b73ff0bf1cdcb210f63f"
+SRC_URI[sha256sum] = "e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libcg/files/libcgroup/"
+
+DEPENDS_append_libc-musl = " fts "
+EXTRA_OEMAKE_append_libc-musl = " LIBS=-lfts"
+
+PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG[pam] = "--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes,--enable-pam=no,libpam"
+
+PACKAGES =+ "cgroups-pam-plugin"
+FILES_cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*"
+FILES_${PN}-dev += "${base_libdir}/security/*.la"
+
+do_install_append() {
+ # Moving libcgroup to base_libdir
+ if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+ mkdir -p ${D}/${base_libdir}/
+ mv -f ${D}${libdir}/libcgroup.so.* ${D}${base_libdir}/
+ rm -f ${D}${libdir}/libcgroup.so
+ lnr ${D}${base_libdir}/libcgroup.so.1 ${D}${libdir}/libcgroup.so
+ fi
+ # pam modules in ${base_libdir}/security/ should be binary .so files, not symlinks.
+ if [ -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ]; then
+ mv -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ${D}${base_libdir}/security/pam_cgroup.so
+ rm -f ${D}${base_libdir}/security/pam_cgroup.so.*
+ fi
+}
diff --git a/external/poky/meta/recipes-core/libxcrypt/libxcrypt_4.1.1.bb b/external/poky/meta/recipes-core/libxcrypt/libxcrypt_4.1.1.bb
new file mode 100644
index 00000000..465aa965
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxcrypt/libxcrypt_4.1.1.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Extended cryptographic library (from glibc)"
+DESCRIPTION = "Forked code from glibc libary to extract only crypto part."
+HOMEPAGE = "https://github.com/besser82/libxcrypt"
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM ?= "file://LICENSING;md5=cb3ca4cabd2447a37bf186fad6f79852 \
+ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
+"
+
+inherit autotools pkgconfig
+
+SRCREV ?= "21b455b68baad279e6a3936faced16c5e5634376"
+SRCBRANCH ?= "develop"
+
+SRC_URI = "git://github.com/besser82/libxcrypt.git;branch=${SRCBRANCH} \
+ "
+
+PROVIDES = "virtual/crypt"
+
+FILES_${PN} = "${libdir}/libcrypt*.so.* ${libdir}/libcrypt-*.so ${libdir}/libowcrypt*.so.* ${libdir}/libowcrypt-*.so"
+
+S = "${WORKDIR}/git"
+
+BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE} -std=gnu99"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/0001-Fix-infinite-loop-in-LZMA-decompression.patch b/external/poky/meta/recipes-core/libxml/libxml2/0001-Fix-infinite-loop-in-LZMA-decompression.patch
new file mode 100644
index 00000000..16c22957
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/0001-Fix-infinite-loop-in-LZMA-decompression.patch
@@ -0,0 +1,55 @@
+From 28a9dc642ffd759df1e48be247a114f440a6c16e Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Mon, 30 Jul 2018 13:14:11 +0200
+Subject: [PATCH] Fix infinite loop in LZMA decompression
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Check the liblzma error code more thoroughly to avoid infinite loops.
+
+Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/13
+Closes: https://bugzilla.gnome.org/show_bug.cgi?id=794914
+
+This is CVE-2018-9251 and CVE-2018-14567.
+
+Thanks to Dongliang Mu and Simon Wörner for the reports.
+
+CVE: CVE-2018-9251
+CVE: CVE-2018-14567
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/commit/2240fbf5912054af025fb6e01e26375100275e74]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ xzlib.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/xzlib.c b/xzlib.c
+index a839169..0ba88cf 100644
+--- a/xzlib.c
++++ b/xzlib.c
+@@ -562,6 +562,10 @@ xz_decomp(xz_statep state)
+ "internal error: inflate stream corrupt");
+ return -1;
+ }
++ /*
++ * FIXME: Remapping a couple of error codes and falling through
++ * to the LZMA error handling looks fragile.
++ */
+ if (ret == Z_MEM_ERROR)
+ ret = LZMA_MEM_ERROR;
+ if (ret == Z_DATA_ERROR)
+@@ -587,6 +591,11 @@ xz_decomp(xz_statep state)
+ xz_error(state, LZMA_PROG_ERROR, "compression error");
+ return -1;
+ }
++ if ((state->how != GZIP) &&
++ (ret != LZMA_OK) && (ret != LZMA_STREAM_END)) {
++ xz_error(state, ret, "lzma error");
++ return -1;
++ }
+ } while (strm->avail_out && ret != LZMA_STREAM_END);
+
+ /* update available output and crc check value */
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch b/external/poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
new file mode 100644
index 00000000..2b92dbc8
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch
@@ -0,0 +1,96 @@
+From 78dbd4c09d617a9cb730d796f94ee4d93840d3cc Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Fri, 9 Jun 2017 17:50:46 +0200
+Subject: [PATCH] Make ptest run the python tests if python is enabled
+
+One of the tests (tstLastError.py) needed a minor correction. It might
+be due to the fact that the tests are forced to run with Python 3.
+
+Upstream-Status: Inappropriate [OE specific]
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ Makefile.am | 2 +-
+ python/Makefile.am | 9 +++++++++
+ python/tests/Makefile.am | 12 ++++++++++--
+ python/tests/tstLastError.py | 2 +-
+ 4 files changed, 21 insertions(+), 4 deletions(-)
+
+Index: libxml2-2.9.7/Makefile.am
+===================================================================
+--- libxml2-2.9.7.orig/Makefile.am
++++ libxml2-2.9.7/Makefile.am
+@@ -207,9 +207,9 @@ install-ptest:
+ install $(check_PROGRAMS) $(DESTDIR))
+ cp -r $(srcdir)/test $(DESTDIR)
+ cp -r $(srcdir)/result $(DESTDIR)
+- cp -r $(srcdir)/python $(DESTDIR)
+ cp Makefile $(DESTDIR)
+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
++ $(MAKE) -C python install-ptest
+
+ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
+ testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
+Index: libxml2-2.9.7/python/Makefile.am
+===================================================================
+--- libxml2-2.9.7.orig/python/Makefile.am
++++ libxml2-2.9.7/python/Makefile.am
+@@ -48,7 +48,16 @@ GENERATED = libxml2class.py libxml2class
+
+ $(GENERATED): $(srcdir)/generator.py $(API_DESC)
+ $(PYTHON) $(srcdir)/generator.py $(srcdir)
++
++install-ptest:
++ cp -r $(srcdir) $(DESTDIR)
++ sed -e 's|^Makefile:|_Makefile:|' \
++ -e 's|^\(tests test:\) all|\1|' Makefile >$(DESTDIR)/python/Makefile
++ $(MAKE) -C tests install-ptest
++else
++install-ptest:
+ endif
+
++.PHONY: tests test
+ tests test: all
+ cd tests && $(MAKE) tests
+Index: libxml2-2.9.7/python/tests/Makefile.am
+===================================================================
+--- libxml2-2.9.7.orig/python/tests/Makefile.am
++++ libxml2-2.9.7/python/tests/Makefile.am
+@@ -59,6 +59,11 @@ XMLS= \
+ CLEANFILES = core tmp.xml *.pyc
+
+ if WITH_PYTHON
++install-ptest:
++ cp -r $(srcdir) $(DESTDIR)/python
++ sed -e 's|^Makefile:|_Makefile:|' \
++ -e 's|^\(srcdir = \).*|\1.|' Makefile >$(DESTDIR)/python/tests/Makefile
++
+ tests: $(PYTESTS)
+ @for f in $(XMLS) ; do test -f $$f || $(LN_S) $(srcdir)/$$f . ; done
+ @echo "## running Python regression tests"
+@@ -68,8 +73,11 @@ tests: $(PYTESTS)
+ export LD_LIBRARY_PATH; \
+ for test in $(PYTESTS) ; \
+ do log=`$(PYTHON) $(srcdir)/$$test` ; \
+- if [ "`echo $$log | grep OK`" = "" ] ; then \
+- echo "-- $$test" ; echo "$$log" ; fi ; done)
++ if [ "`echo $$log | grep OK`" ]; then \
++ echo "PASS: $$test"; else \
++ echo "$$log"; echo "FAIL: $$test"; fi; done)
+ else
++install-ptest:
++
+ tests:
+ endif
+Index: libxml2-2.9.7/python/tests/tstLastError.py
+===================================================================
+--- libxml2-2.9.7.orig/python/tests/tstLastError.py
++++ libxml2-2.9.7/python/tests/tstLastError.py
+@@ -25,7 +25,7 @@ class TestCase(unittest.TestCase):
+ when the exception is raised, check the libxml2.lastError for
+ expected values."""
+ # disable the default error handler
+- libxml2.registerErrorHandler(None,None)
++ libxml2.registerErrorHandler(lambda ctx,str: None,None)
+ try:
+ f(*args)
+ except exc:
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch b/external/poky/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch
new file mode 100644
index 00000000..42a4b0ed
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/fix-CVE-2017-8872.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Backport
+CVE: CVE-2017-8872
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 123234f2cfcd9e9b9f83047eee1dc17b4c3f4407 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Tue, 11 Sep 2018 14:52:07 +0200
+Subject: [PATCH] Free input buffer in xmlHaltParser
+
+This avoids miscalculation of available bytes.
+
+Thanks to Yunho Kim for the report.
+
+Closes: #26
+---
+ parser.c | 5 +++++
+ result/errors/759573.xml.err | 17 +++++++----------
+ 2 files changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/parser.c b/parser.c
+index ca9fde2c..5813a664 100644
+--- a/parser.c
++++ b/parser.c
+@@ -12462,7 +12462,12 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
+ ctxt->input->free((xmlChar *) ctxt->input->base);
+ ctxt->input->free = NULL;
+ }
++ if (ctxt->input->buf != NULL) {
++ xmlFreeParserInputBuffer(ctxt->input->buf);
++ ctxt->input->buf = NULL;
++ }
+ ctxt->input->cur = BAD_CAST"";
++ ctxt->input->length = 0;
+ ctxt->input->base = ctxt->input->cur;
+ ctxt->input->end = ctxt->input->cur;
+ }
+diff --git a/result/errors/759573.xml.err b/result/errors/759573.xml.err
+index 554039f6..38ef5c40 100644
+--- a/result/errors/759573.xml.err
++++ b/result/errors/759573.xml.err
+@@ -21,14 +21,11 @@ Entity: line 1:
+ ^
+ ./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
+- ^
++
++^
+ ./test/errors/759573.xml:1: parser error : DOCTYPE improperly terminated
+-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
+- ^
+-./test/errors/759573.xml:1: parser error : StartTag: invalid element name
+-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
+- ^
+-./test/errors/759573.xml:1: parser error : Extra content at the end of the document
+-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
+- ^
++
++^
++./test/errors/759573.xml:1: parser error : Start tag expected, '<' not found
++
++^
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/fix-CVE-2018-14404.patch b/external/poky/meta/recipes-core/libxml/libxml2/fix-CVE-2018-14404.patch
new file mode 100644
index 00000000..21668e25
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/fix-CVE-2018-14404.patch
@@ -0,0 +1,45 @@
+libxml2-2.9.8: Fix CVE-2018-14404
+
+[No upstream tracking] -- https://gitlab.gnome.org/GNOME/libxml2/issues/5
+ -- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901817
+ -- https://bugzilla.redhat.com/show_bug.cgi?id=1595985
+
+xpath: Fix nullptr deref with XPath logic ops
+
+If the XPath stack is corrupted, for example by a misbehaving extension
+function, the "and" and "or" XPath operators could dereference NULL
+pointers. Check that the XPath stack isn't empty and optimize the
+logic operators slightly.
+
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/commit/a436374994c47b12d5de1b8b1d191a098fa23594]
+CVE: CVE-2018-14404
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+
+diff --git a/xpath.c b/xpath.c
+index f440696..75cac5c 100644
+--- a/xpath.c
++++ b/xpath.c
+@@ -13297,9 +13297,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
+ return(0);
+ }
+ xmlXPathBooleanFunction(ctxt, 1);
+- arg1 = valuePop(ctxt);
+- arg1->boolval &= arg2->boolval;
+- valuePush(ctxt, arg1);
++ if (ctxt->value != NULL)
++ ctxt->value->boolval &= arg2->boolval;
+ xmlXPathReleaseObject(ctxt->context, arg2);
+ return (total);
+ case XPATH_OP_OR:
+@@ -13323,9 +13322,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
+ return(0);
+ }
+ xmlXPathBooleanFunction(ctxt, 1);
+- arg1 = valuePop(ctxt);
+- arg1->boolval |= arg2->boolval;
+- valuePush(ctxt, arg1);
++ if (ctxt->value != NULL)
++ ctxt->value->boolval |= arg2->boolval;
+ xmlXPathReleaseObject(ctxt->context, arg2);
+ return (total);
+ case XPATH_OP_EQUAL:
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch b/external/poky/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch
new file mode 100644
index 00000000..51a9e193
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/fix-execution-of-ptests.patch
@@ -0,0 +1,21 @@
+Make sure that Makefile doesn't try to compile these tests again
+on the target where the source dependencies won't be available.
+
+Upstream-Status: Inappropriate [cross-compile specific]
+
+Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
+
+Index: libxml2-2.9.7/Makefile.am
+===================================================================
+--- libxml2-2.9.7.orig/Makefile.am
++++ libxml2-2.9.7/Makefile.am
+@@ -211,8 +211,7 @@ install-ptest:
+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
+ $(MAKE) -C python install-ptest
+
+-runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
+- testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
++runtests:
+ [ -d test ] || $(LN_S) $(srcdir)/test .
+ [ -d result ] || $(LN_S) $(srcdir)/result .
+ $(CHECKER) ./runtest$(EXEEXT) && \
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch b/external/poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch
new file mode 100644
index 00000000..1147017b
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/libxml-64bit.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Backport [from debian: bugs.debian.org/439843]
+
+---
+ libxml.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- libxml2-2.6.29.orig/libxml.h
++++ libxml2-2.6.29/libxml.h
+@@ -11,10 +11,13 @@
+
+ #ifndef NO_LARGEFILE_SOURCE
+ #ifndef _LARGEFILE_SOURCE
+ #define _LARGEFILE_SOURCE
+ #endif
++#ifndef _LARGEFILE64_SOURCE
++#define _LARGEFILE64_SOURCE
++#endif
+ #ifndef _FILE_OFFSET_BITS
+ #define _FILE_OFFSET_BITS 64
+ #endif
+ #endif
+
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch b/external/poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch
new file mode 100644
index 00000000..d9ed1516
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch
@@ -0,0 +1,204 @@
+AM_PATH_XML2 uses xml-config which we disable through
+binconfig-disabled.bbclass, so port it to use pkg-config instead.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/libxml.m4 b/libxml.m4
+index 68cd824..5fa0a9b 100644
+--- a/libxml.m4
++++ b/libxml.m4
+@@ -1,188 +1,12 @@
+-# Configure paths for LIBXML2
+-# Mike Hommey 2004-06-19
+-# use CPPFLAGS instead of CFLAGS
+-# Toshio Kuratomi 2001-04-21
+-# Adapted from:
+-# Configure paths for GLIB
+-# Owen Taylor 97-11-3
+-
+ dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+ dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
+ dnl
+-AC_DEFUN([AM_PATH_XML2],[
+-AC_ARG_WITH(xml-prefix,
+- [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
+- xml_config_prefix="$withval", xml_config_prefix="")
+-AC_ARG_WITH(xml-exec-prefix,
+- [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
+- xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
+-AC_ARG_ENABLE(xmltest,
+- [ --disable-xmltest Do not try to compile and run a test LIBXML program],,
+- enable_xmltest=yes)
+-
+- if test x$xml_config_exec_prefix != x ; then
+- xml_config_args="$xml_config_args"
+- if test x${XML2_CONFIG+set} != xset ; then
+- XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
+- fi
+- fi
+- if test x$xml_config_prefix != x ; then
+- xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
+- if test x${XML2_CONFIG+set} != xset ; then
+- XML2_CONFIG=$xml_config_prefix/bin/xml2-config
+- fi
+- fi
+-
+- AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
+- min_xml_version=ifelse([$1], ,2.0.0,[$1])
+- AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
+- no_xml=""
+- if test "$XML2_CONFIG" = "no" ; then
+- no_xml=yes
+- else
+- XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
+- XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
+- xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+- xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+- xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
+- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+- if test "x$enable_xmltest" = "xyes" ; then
+- ac_save_CPPFLAGS="$CPPFLAGS"
+- ac_save_LIBS="$LIBS"
+- CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+- LIBS="$XML_LIBS $LIBS"
+-dnl
+-dnl Now check if the installed libxml is sufficiently new.
+-dnl (Also sanity checks the results of xml2-config to some extent)
+-dnl
+- rm -f conf.xmltest
+- AC_TRY_RUN([
+-#include <stdlib.h>
+-#include <stdio.h>
+-#include <string.h>
+-#include <libxml/xmlversion.h>
+-
+-int
+-main()
+-{
+- int xml_major_version, xml_minor_version, xml_micro_version;
+- int major, minor, micro;
+- char *tmp_version;
+-
+- system("touch conf.xmltest");
+-
+- /* Capture xml2-config output via autoconf/configure variables */
+- /* HP/UX 9 (%@#!) writes to sscanf strings */
+- tmp_version = (char *)strdup("$min_xml_version");
+- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+- printf("%s, bad version string from xml2-config\n", "$min_xml_version");
+- exit(1);
+- }
+- free(tmp_version);
+-
+- /* Capture the version information from the header files */
+- tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
+- if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
+- printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
+- exit(1);
+- }
+- free(tmp_version);
+-
+- /* Compare xml2-config output to the libxml headers */
+- if ((xml_major_version != $xml_config_major_version) ||
+- (xml_minor_version != $xml_config_minor_version) ||
+- (xml_micro_version != $xml_config_micro_version))
+- {
+- printf("*** libxml header files (version %d.%d.%d) do not match\n",
+- xml_major_version, xml_minor_version, xml_micro_version);
+- printf("*** xml2-config (version %d.%d.%d)\n",
+- $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
+- return 1;
+- }
+-/* Compare the headers to the library to make sure we match */
+- /* Less than ideal -- doesn't provide us with return value feedback,
+- * only exits if there's a serious mismatch between header and library.
+- */
+- LIBXML_TEST_VERSION;
+-
+- /* Test that the library is greater than our minimum version */
+- if ((xml_major_version > major) ||
+- ((xml_major_version == major) && (xml_minor_version > minor)) ||
+- ((xml_major_version == major) && (xml_minor_version == minor) &&
+- (xml_micro_version >= micro)))
+- {
+- return 0;
+- }
+- else
+- {
+- printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
+- xml_major_version, xml_minor_version, xml_micro_version);
+- printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
+- major, minor, micro);
+- printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
+- printf("***\n");
+- printf("*** If you have already installed a sufficiently new version, this error\n");
+- printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
+- printf("*** being found. The easiest way to fix this is to remove the old version\n");
+- printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
+- printf("*** correct copy of xml2-config. (In this case, you will have to\n");
+- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+- printf("*** so that the correct libraries are found at run-time))\n");
+- }
+- return 1;
+-}
+-],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+- CPPFLAGS="$ac_save_CPPFLAGS"
+- LIBS="$ac_save_LIBS"
+- fi
+- fi
++AC_DEFUN([AM_PATH_XML2],[
++ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+
+- if test "x$no_xml" = x ; then
+- AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
+- ifelse([$2], , :, [$2])
+- else
+- AC_MSG_RESULT(no)
+- if test "$XML2_CONFIG" = "no" ; then
+- echo "*** The xml2-config script installed by LIBXML could not be found"
+- echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
+- echo "*** your path, or set the XML2_CONFIG environment variable to the"
+- echo "*** full path to xml2-config."
+- else
+- if test -f conf.xmltest ; then
+- :
+- else
+- echo "*** Could not run libxml test program, checking why..."
+- CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+- LIBS="$LIBS $XML_LIBS"
+- AC_TRY_LINK([
+-#include <libxml/xmlversion.h>
+-#include <stdio.h>
+-], [ LIBXML_TEST_VERSION; return 0;],
+- [ echo "*** The test program compiled, but did not run. This usually means"
+- echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
+- echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
+- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+- echo "*** to the installed location Also, make sure you have run ldconfig if that"
+- echo "*** is required on your system"
+- echo "***"
+- echo "*** If you have an old version installed, it is best to remove it, although"
+- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+- [ echo "*** The test program failed to compile or link. See the file config.log for the"
+- echo "*** exact error that occurred. This usually means LIBXML was incorrectly installed"
+- echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
+- echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
+- CPPFLAGS="$ac_save_CPPFLAGS"
+- LIBS="$ac_save_LIBS"
+- fi
+- fi
++ verdep=ifelse([$1], [], [], [">= $1"])
++ PKG_CHECK_MODULES(XML, [libxml-2.0 $verdep], [$2], [$3])
+
+- XML_CPPFLAGS=""
+- XML_LIBS=""
+- ifelse([$3], , :, [$3])
+- fi
++ XML_CPPFLAGS=$XML_CFLAGS
+ AC_SUBST(XML_CPPFLAGS)
+- AC_SUBST(XML_LIBS)
+- rm -f conf.xmltest
+ ])
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch b/external/poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch
new file mode 100644
index 00000000..e83c8325
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch
@@ -0,0 +1,30 @@
+Allow us to pass in PYTHON_SITE_PACKAGES
+
+The python binary used when building for nativesdk doesn't give us the
+correct path here so we need to be able to specify it ourselves.
+
+Upstream-Status: Inappropriate [config]
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebase to 2.9.2
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -813,7 +813,8 @@ dnl
+
+ PYTHON_VERSION=
+ PYTHON_INCLUDES=
+-PYTHON_SITE_PACKAGES=
++# Allow this to be set externally
++#PYTHON_SITE_PACKAGES=
+ PYTHON_TESTS=
+ pythondir=
+ if test "$with_python" != "no" ; then
+--
+1.9.1
+
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/run-ptest b/external/poky/meta/recipes-core/libxml/libxml2/run-ptest
new file mode 100644
index 00000000..c313d832
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+export LC_ALL=en_US.UTF-8
+make -k runtests
diff --git a/external/poky/meta/recipes-core/libxml/libxml2/runtest.patch b/external/poky/meta/recipes-core/libxml/libxml2/runtest.patch
new file mode 100644
index 00000000..544dc058
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2/runtest.patch
@@ -0,0 +1,818 @@
+Add 'install-ptest' rule.
+Print a standard result line for each test.
+
+Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
+Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
+Upstream-Status: Backport
+
+diff -uNr a/Makefile.am b/Makefile.am
+--- a/Makefile.am 2017-12-02 09:58:10.000000000 +0100
++++ b/Makefile.am 2018-03-20 08:27:34.360505864 +0100
+@@ -202,6 +202,15 @@
+ #testOOM_DEPENDENCIES = $(DEPS)
+ #testOOM_LDADD= $(LDADDS)
+
++install-ptest:
++ @(if [ -d .libs ] ; then cd .libs; fi; \
++ install $(check_PROGRAMS) $(DESTDIR))
++ cp -r $(srcdir)/test $(DESTDIR)
++ cp -r $(srcdir)/result $(DESTDIR)
++ cp -r $(srcdir)/python $(DESTDIR)
++ cp Makefile $(DESTDIR)
++ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
++
+ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
+ testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
+ [ -d test ] || $(LN_S) $(srcdir)/test .
+diff -uNr a/runsuite.c b/runsuite.c
+--- a/runsuite.c 2016-06-07 12:04:14.000000000 +0200
++++ b/runsuite.c 2018-03-20 08:27:57.478817247 +0100
+@@ -1162,6 +1162,7 @@
+
+ if (logfile != NULL)
+ fclose(logfile);
++ printf("%s: runsuite\n\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+ #else /* !SCHEMAS */
+diff -uNr a/runtest.c b/runtest.c
+--- a/runtest.c 2017-11-13 22:00:17.000000000 +0100
++++ b/runtest.c 2018-03-20 08:28:50.859047551 +0100
+@@ -4496,7 +4496,8 @@
+ }
+
+ xmlCharEncCloseFunc(ebcdicHandler);
+-
++
++ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
+ return(err);
+ }
+
+@@ -4573,6 +4574,7 @@
+ xmlCleanupParser();
+ xmlMemoryDump();
+
++ printf("%s: runtest\n\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+
+diff -uNr a/runxmlconf.c b/runxmlconf.c
+--- a/runxmlconf.c 2016-06-07 12:04:14.000000000 +0200
++++ b/runxmlconf.c 2018-03-20 08:29:17.944862893 +0100
+@@ -595,6 +595,7 @@
+
+ if (logfile != NULL)
+ fclose(logfile);
++ printf("%s: runxmlconf\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+
+diff -uNr a/testapi.c b/testapi.c
+--- a/testapi.c 2018-01-25 07:39:15.000000000 +0100
++++ b/testapi.c 2018-03-20 09:08:35.323980145 +0100
+@@ -1246,49 +1246,91 @@
+ testlibxml2(void)
+ {
+ int test_ret = 0;
++ int ret = 0;
+
+- test_ret += test_HTMLparser();
+- test_ret += test_HTMLtree();
+- test_ret += test_SAX2();
+- test_ret += test_c14n();
+- test_ret += test_catalog();
+- test_ret += test_chvalid();
+- test_ret += test_debugXML();
+- test_ret += test_dict();
+- test_ret += test_encoding();
+- test_ret += test_entities();
+- test_ret += test_hash();
+- test_ret += test_list();
+- test_ret += test_nanoftp();
+- test_ret += test_nanohttp();
+- test_ret += test_parser();
+- test_ret += test_parserInternals();
+- test_ret += test_pattern();
+- test_ret += test_relaxng();
+- test_ret += test_schemasInternals();
+- test_ret += test_schematron();
+- test_ret += test_tree();
+- test_ret += test_uri();
+- test_ret += test_valid();
+- test_ret += test_xinclude();
+- test_ret += test_xmlIO();
+- test_ret += test_xmlautomata();
+- test_ret += test_xmlerror();
+- test_ret += test_xmlmodule();
+- test_ret += test_xmlreader();
+- test_ret += test_xmlregexp();
+- test_ret += test_xmlsave();
+- test_ret += test_xmlschemas();
+- test_ret += test_xmlschemastypes();
+- test_ret += test_xmlstring();
+- test_ret += test_xmlunicode();
+- test_ret += test_xmlwriter();
+- test_ret += test_xpath();
+- test_ret += test_xpathInternals();
+- test_ret += test_xpointer();
++ test_ret += (ret = test_HTMLparser());
++ printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_HTMLtree());
++ printf("%s: HTMLtree\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_SAX2());
++ printf("%s: SAX2\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_c14n());
++ printf("%s: c14n\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_catalog());
++ printf("%s: catalog\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_chvalid());
++ printf("%s: chvalid\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_debugXML());
++ printf("%s: debugXML\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_dict());
++ printf("%s: dict\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_encoding());
++ printf("%s: encoding\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_entities());
++ printf("%s: entities\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_hash());
++ printf("%s: hash\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_list());
++ printf("%s: list\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_nanoftp());
++ printf("%s: nanoftp\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_nanohttp());
++ printf("%s: nanohttp\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_parser());
++ printf("%s: parser\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_parserInternals());
++ printf("%s: parserInternals\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_pattern());
++ printf("%s: pattern\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_relaxng());
++ printf("%s: relaxng\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_schemasInternals());
++ printf("%s: schemasInternals\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_schematron());
++ printf("%s: schematron\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_tree());
++ printf("%s: tree\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_uri());
++ printf("%s: uri\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_valid());
++ printf("%s: valid\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xinclude());
++ printf("%s: xinclude\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlIO());
++ printf("%s: xmlIO\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlautomata());
++ printf("%s: xmlautomata\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlerror());
++ printf("%s: xmlerror\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlmodule());
++ printf("%s: xmlmodule\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlreader());
++ printf("%s: xmlreader\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlregexp());
++ printf("%s: xmlregexp\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlsave());
++ printf("%s: xmlsave\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlschemas());
++ printf("%s: xmlschemas\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlschemastypes());
++ printf("%s: xmlschemastypes\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlstring());
++ printf("%s: xmlstring\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlunicode());
++ printf("%s: xmlunicode\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xmlwriter());
++ printf("%s: xmlwriter\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xpath());
++ printf("%s: xpath\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xpathInternals());
++ printf("%s: xpathInternals\n", (ret == 0) ? "PASS" : "FAIL");
++ test_ret += (ret = test_xpointer());
++ printf("%s: xpointer\n", (ret == 0) ? "PASS" : "FAIL");
+
+ printf("Total: %d functions, %d tests, %d errors\n",
+ function_tests, call_tests, test_ret);
++
++ printf("%s: testapi\n\n", (test_ret == 0) ? "PASS" : "FAIL");
+ return(test_ret);
+ }
+
+diff -uNr a/testdict.c b/testdict.c
+--- a/testdict.c 2016-06-07 12:04:14.000000000 +0200
++++ b/testdict.c 2018-03-20 08:59:16.864275812 +0100
+@@ -440,5 +440,6 @@
+ clean_strings();
+ xmlCleanupParser();
+ xmlMemoryDump();
++ printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+diff -uNr a/testchar.c b/testchar.c
+--- a/testchar.c 2016-06-07 12:04:14.000000000 +0200
++++ b/testchar.c 2018-03-20 09:11:20.383573912 +0100
+@@ -23,7 +23,7 @@
+ char document1[100] = "<doc>XXXX</doc>";
+ char document2[100] = "<doc foo='XXXX'/>";
+
+-static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
++static int testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
+ int len, char *data, int forbid1, int forbid2) {
+ int i;
+ xmlDocPtr res;
+@@ -37,33 +37,41 @@
+ res = xmlReadMemory(document, len, "test", NULL, 0);
+
+ if ((i == forbid1) || (i == forbid2)) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Byte 0x%02X: %c\n",
+ i, i);
++ return(1);
++ }
+ }
+
+ else if ((i == '<') || (i == '&')) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect illegal char %c for Byte 0x%02X\n", i, i);
++ return(1);
++ }
+ }
+ else if (((i < 0x20) || (i >= 0x80)) &&
+ (i != 0x9) && (i != 0xA) && (i != 0xD)) {
+- if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL))
++ if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Byte 0x%02X\n", i);
++ return(1);
++ }
+ }
+ else if (res == NULL) {
+ fprintf(stderr,
+ "Failed to parse valid char for Byte 0x%02X : %c\n", i, i);
++ return(1);
+ }
+ if (res != NULL)
+ xmlFreeDoc(res);
+ }
++ return(0);
+ }
+
+-static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
++static int testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
+ int len, char *data) {
+ int i, j;
+ xmlDocPtr res;
+@@ -80,10 +88,12 @@
+
+ /* if first bit of first char is set, then second bit must too */
+ if ((i & 0x80) && ((i & 0x40) == 0)) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -91,10 +101,12 @@
+ * bits must be 10
+ */
+ else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -102,10 +114,12 @@
+ * than 0x80, i.e. one of bits 5 to 1 of i must be set
+ */
+ else if ((i & 0x80) && ((i & 0x1E) == 0)) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -113,10 +127,12 @@
+ * at least 3 bytes, but we give only 2 !
+ */
+ else if ((i & 0xE0) == 0xE0) {
+- if ((lastError == 0) || (res != NULL))
++ if ((lastError == 0) || (res != NULL)) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -125,11 +141,13 @@
+ else if ((lastError != 0) || (res == NULL)) {
+ fprintf(stderr,
+ "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j);
++ return(1);
+ }
+ if (res != NULL)
+ xmlFreeDoc(res);
+ }
+ }
++ return(0);
+ }
+
+ /**
+@@ -141,9 +159,10 @@
+ * CDATA in text or in attribute values.
+ */
+
+-static void testDocumentRanges(void) {
++static int testDocumentRanges(void) {
+ xmlParserCtxtPtr ctxt;
+ char *data;
++ int test_ret = 0;
+
+ /*
+ * Set up a parsing context using the first document as
+@@ -152,7 +171,7 @@
+ ctxt = xmlNewParserCtxt();
+ if (ctxt == NULL) {
+ fprintf(stderr, "Failed to allocate parser context\n");
+- return;
++ return(1);
+ }
+
+ printf("testing 1 byte char in document: 1");
+@@ -163,7 +182,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at beginning of area */
+- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
++ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+ data, -1, -1);
+ printf(" 2");
+ fflush(stdout);
+@@ -172,7 +191,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at end of area */
+- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
++ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+ data + 3, -1, -1);
+
+ printf(" 3");
+@@ -183,7 +202,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at beginning of area */
+- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
++ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+ data, '\'', -1);
+ printf(" 4");
+ fflush(stdout);
+@@ -192,7 +211,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at end of area */
+- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
++ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+ data + 3, '\'', -1);
+ printf(" done\n");
+
+@@ -204,7 +223,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at beginning of area */
+- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
++ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+ data);
+ printf(" 2");
+ fflush(stdout);
+@@ -213,7 +232,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at end of area */
+- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
++ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+ data + 2);
+
+ printf(" 3");
+@@ -224,7 +243,7 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at beginning of area */
+- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
++ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+ data);
+ printf(" 4");
+ fflush(stdout);
+@@ -233,14 +252,15 @@
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at end of area */
+- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
++ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+ data + 2);
+ printf(" done\n");
+
+ xmlFreeParserCtxt(ctxt);
++ return(test_ret);
+ }
+
+-static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
+ int i = 0;
+ int len, c;
+
+@@ -255,19 +275,25 @@
+ c = xmlCurrentChar(ctxt, &len);
+ if ((i == 0) || (i >= 0x80)) {
+ /* we must see an error there */
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Byte 0x%02X\n", i);
++ return(1);
++ }
+ } else if (i == 0xD) {
+- if ((c != 0xA) || (len != 1))
++ if ((c != 0xA) || (len != 1)) {
+ fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i);
++ return(1);
++ }
+ } else if ((c != i) || (len != 1)) {
+ fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i);
++ return(1);
+ }
+ }
++ return(0);
+ }
+
+-static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
+ int i, j;
+ int len, c;
+
+@@ -284,10 +310,12 @@
+
+ /* if first bit of first char is set, then second bit must too */
+ if ((i & 0x80) && ((i & 0x40) == 0)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -295,10 +323,12 @@
+ * bits must be 10
+ */
+ else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
+ i, j, c);
++ return(1);
++ }
+ }
+
+ /*
+@@ -306,10 +336,12 @@
+ * than 0x80, i.e. one of bits 5 to 1 of i must be set
+ */
+ else if ((i & 0x80) && ((i & 0x1E) == 0)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
+ i, j, c);
++ return(1);
++ }
+ }
+
+ /*
+@@ -317,10 +349,12 @@
+ * at least 3 bytes, but we give only 2 !
+ */
+ else if ((i & 0xE0) == 0xE0) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
+ i, j);
++ return(1);
++ }
+ }
+
+ /*
+@@ -329,6 +363,7 @@
+ else if ((lastError != 0) || (len != 2)) {
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j);
++ return(1);
+ }
+
+ /*
+@@ -338,12 +373,14 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n",
+ i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c);
++ return(1);
+ }
+ }
+ }
++ return(0);
+ }
+
+-static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
+ int i, j, k, K;
+ int len, c;
+ unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
+@@ -368,20 +405,24 @@
+ * at least 4 bytes, but we give only 3 !
+ */
+ if ((i & 0xF0) == 0xF0) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, data[3]);
++ return(1);
++ }
+ }
+
+ /*
+ * The second and the third bytes must start with 10
+ */
+ else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
++ return(1);
++ }
+ }
+
+ /*
+@@ -390,10 +431,12 @@
+ * the 6th byte of data[1] must be set
+ */
+ else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
++ return(1);
++ }
+ }
+
+ /*
+@@ -401,10 +444,12 @@
+ */
+ else if (((value > 0xD7FF) && (value <0xE000)) ||
+ ((value > 0xFFFD) && (value <0x10000))) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n",
+ value, i, j, K);
++ return(1);
++ }
+ }
+
+ /*
+@@ -414,6 +459,7 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
++ return(1);
+ }
+
+ /*
+@@ -423,13 +469,15 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
+ i, j, data[2], value, c);
++ return(1);
+ }
+ }
+ }
+ }
++ return(0);
+ }
+
+-static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
+ int i, j, k, K, l, L;
+ int len, c;
+ unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
+@@ -458,10 +506,12 @@
+ * at least 5 bytes, but we give only 4 !
+ */
+ if ((i & 0xF8) == 0xF8) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, data[3]);
++ return(1);
++ }
+ }
+
+ /*
+@@ -469,10 +519,12 @@
+ */
+ else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) ||
+ ((L & 0xC0) != 0x80)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, L);
++ return(1);
++ }
+ }
+
+ /*
+@@ -481,10 +533,12 @@
+ * the 6 or 5th byte of j must be set
+ */
+ else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, L);
++ return(1);
++ }
+ }
+
+ /*
+@@ -493,10 +547,12 @@
+ else if (((value > 0xD7FF) && (value <0xE000)) ||
+ ((value > 0xFFFD) && (value <0x10000)) ||
+ (value > 0x10FFFF)) {
+- if (lastError != XML_ERR_INVALID_CHAR)
++ if (lastError != XML_ERR_INVALID_CHAR) {
+ fprintf(stderr,
+ "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ value, i, j, K, L);
++ return(1);
++ }
+ }
+
+ /*
+@@ -506,6 +562,7 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
++ return(1);
+ }
+
+ /*
+@@ -515,11 +572,13 @@
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
+ i, j, data[2], value, c);
++ return(1);
+ }
+ }
+ }
+ }
+ }
++ return(0);
+ }
+
+ /**
+@@ -530,11 +589,12 @@
+ * cover the full range of UTF-8 chars accepted by XML-1.0
+ */
+
+-static void testCharRanges(void) {
++static int testCharRanges(void) {
+ char data[5];
+ xmlParserCtxtPtr ctxt;
+ xmlParserInputBufferPtr buf;
+ xmlParserInputPtr input;
++ int test_ret = 0;
+
+ memset(data, 0, 5);
+
+@@ -545,17 +605,19 @@
+ ctxt = xmlNewParserCtxt();
+ if (ctxt == NULL) {
+ fprintf(stderr, "Failed to allocate parser context\n");
+- return;
++ return(1);
+ }
+ buf = xmlParserInputBufferCreateStatic(data, sizeof(data),
+ XML_CHAR_ENCODING_NONE);
+ if (buf == NULL) {
+ fprintf(stderr, "Failed to allocate input buffer\n");
++ test_ret = 1;
+ goto error;
+ }
+ input = xmlNewInputStream(ctxt);
+ if (input == NULL) {
+ xmlFreeParserInputBuffer(buf);
++ test_ret = 1;
+ goto error;
+ }
+ input->filename = NULL;
+@@ -567,25 +629,28 @@
+
+ printf("testing char range: 1");
+ fflush(stdout);
+- testCharRangeByte1(ctxt, data);
++ test_ret += testCharRangeByte1(ctxt, data);
+ printf(" 2");
+ fflush(stdout);
+- testCharRangeByte2(ctxt, data);
++ test_ret += testCharRangeByte2(ctxt, data);
+ printf(" 3");
+ fflush(stdout);
+- testCharRangeByte3(ctxt, data);
++ test_ret += testCharRangeByte3(ctxt, data);
+ printf(" 4");
+ fflush(stdout);
+- testCharRangeByte4(ctxt, data);
++ test_ret += testCharRangeByte4(ctxt, data);
+ printf(" done\n");
+ fflush(stdout);
+
+ error:
+ xmlFreeParserCtxt(ctxt);
++ return(test_ret);
+ }
+
+ int main(void) {
+
++ int ret = 0;
++
+ /*
+ * this initialize the library and check potential ABI mismatches
+ * between the version it was compiled for and the actual shared
+@@ -602,8 +667,9 @@
+ /*
+ * Run the tests
+ */
+- testCharRanges();
+- testDocumentRanges();
++ ret += testCharRanges();
++ ret += testDocumentRanges();
++ printf("%s: testchar\n\n", (ret == 0) ? "PASS" : "FAIL");
+
+ /*
+ * Cleanup function for the XML library.
+diff -uNr a/testlimits.c b/testlimits.c
+--- a/testlimits.c 2016-11-07 09:41:40.000000000 +0100
++++ b/testlimits.c 2018-03-20 08:59:38.965581280 +0100
+@@ -1634,5 +1634,6 @@
+ xmlCleanupParser();
+ xmlMemoryDump();
+
++ printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
+diff -uNr a/testrecurse.c b/testrecurse.c
+--- a/testrecurse.c 2017-10-26 09:54:40.000000000 +0200
++++ b/testrecurse.c 2018-03-20 09:00:46.781628749 +0100
+@@ -892,6 +892,7 @@
+ err++;
+ }
+ }
++ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
+ return(err);
+ }
+
+@@ -961,5 +962,6 @@
+ xmlCleanupParser();
+ xmlMemoryDump();
+
++ printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL");
+ return(ret);
+ }
diff --git a/external/poky/meta/recipes-core/libxml/libxml2_2.9.8.bb b/external/poky/meta/recipes-core/libxml/libxml2_2.9.8.bb
new file mode 100644
index 00000000..740bf56a
--- /dev/null
+++ b/external/poky/meta/recipes-core/libxml/libxml2_2.9.8.bb
@@ -0,0 +1,113 @@
+SUMMARY = "XML C Parser Library and Toolkit"
+DESCRIPTION = "The XML Parser Library allows for manipulation of XML files. Libxml2 exports Push and Pull type parser interfaces for both XML and HTML. It can do DTD validation at parse time, on a parsed document instance or with an arbitrary DTD. Libxml2 includes complete XPath, XPointer and Xinclude implementations. It also has a SAX like interface, which is designed to be compatible with Expat."
+HOMEPAGE = "http://www.xmlsoft.org/"
+BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://Copyright;md5=2044417e2e5006b65a8b9067b683fcf1 \
+ file://hash.c;beginline=6;endline=15;md5=96f7296605eae807670fb08947829969 \
+ file://list.c;beginline=4;endline=13;md5=cdbfa3dee51c099edb04e39f762ee907 \
+ file://trio.c;beginline=5;endline=14;md5=6c025753c86d958722ec76e94cae932e"
+
+DEPENDS = "zlib virtual/libiconv"
+
+SRC_URI = "http://www.xmlsoft.org/sources/libxml2-${PV}.tar.gz;name=libtar \
+ http://www.w3.org/XML/Test/xmlts20080827.tar.gz;subdir=${BP};name=testtar \
+ file://libxml-64bit.patch \
+ file://runtest.patch \
+ file://run-ptest \
+ file://python-sitepackages-dir.patch \
+ file://libxml-m4-use-pkgconfig.patch \
+ file://0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch \
+ file://fix-execution-of-ptests.patch \
+ file://fix-CVE-2017-8872.patch \
+ file://fix-CVE-2018-14404.patch \
+ file://0001-Fix-infinite-loop-in-LZMA-decompression.patch \
+ "
+
+SRC_URI[libtar.md5sum] = "b786e353e2aa1b872d70d5d1ca0c740d"
+SRC_URI[libtar.sha256sum] = "0b74e51595654f958148759cfef0993114ddccccbb6f31aee018f3558e8e2732"
+SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a"
+SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7"
+
+BINCONFIG = "${bindir}/xml2-config"
+
+PACKAGECONFIG ??= "python \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+inherit autotools pkgconfig binconfig-disabled ptest
+
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)}
+
+RDEPENDS_${PN}-ptest += "make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-logging python3-shell python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}"
+
+RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
+
+RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-ebcdic-us \
+ glibc-gconv-ibm1141 \
+ glibc-gconv-iso8859-5 \
+ glibc-gconv-euc-jp \
+ locale-base-en-us \
+ "
+
+export PYTHON_SITE_PACKAGES="${PYTHON_SITEPACKAGES_DIR}"
+
+# WARNING: zlib is required for RPM use
+EXTRA_OECONF = "--without-debug --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions"
+EXTRA_OECONF_class-native = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib"
+EXTRA_OECONF_class-nativesdk = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib"
+EXTRA_OECONF_linuxstdbase = "--with-debug --with-legacy --with-docbook --with-c14n --without-lzma --with-zlib"
+
+python populate_packages_prepend () {
+ # autonamer would call this libxml2-2, but we don't want that
+ if d.getVar('DEBIAN_NAMES'):
+ d.setVar('PKG_libxml2', '${MLPREFIX}libxml2')
+}
+
+PACKAGE_BEFORE_PN += "${PN}-utils"
+PACKAGES += "${PN}-python"
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
+FILES_${PN}-dev += "${libdir}/xml2Conf.sh ${libdir}/cmake/*"
+FILES_${PN}-utils = "${bindir}/*"
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
+do_configure_prepend () {
+ # executables take longer to package: these should not be executable
+ find ${S}/xmlconf/ -type f -exec chmod -x {} \+
+}
+
+do_compile_ptest() {
+ oe_runmake check-am
+}
+
+do_install_ptest () {
+ cp -r ${S}/xmlconf ${D}${PTEST_PATH}
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then
+ sed -i -e 's|^\(PYTHON = \).*|\1${USRBINPATH}/${PYTHON_PN}|' \
+ ${D}${PTEST_PATH}/python/tests/Makefile
+ grep -lrZ '#!/usr/bin/python' ${D}${PTEST_PATH}/python |
+ xargs -0 sed -i -e 's|/usr/bin/python|${USRBINPATH}/${PYTHON_PN}|'
+ fi
+ #Remove build host references from various Makefiles
+ find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
+ sed -i \
+ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+ -e 's|${DEBUG_PREFIX_MAP}||g' \
+ -e 's:${HOSTTOOLS_DIR}/::g' \
+ -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ -e 's:${RECIPE_SYSROOT}::g' \
+ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
+ -e '/^RELDATE/d' \
+ {} +
+}
+
+do_install_append_class-native () {
+ # Docs are not needed in the native case
+ rm ${D}${datadir}/gtk-doc -rf
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-core/meta/build-sysroots.bb b/external/poky/meta/recipes-core/meta/build-sysroots.bb
new file mode 100644
index 00000000..7a712e2f
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/build-sysroots.bb
@@ -0,0 +1,38 @@
+INHIBIT_DEFAULT_DEPS = "1"
+LICENSE = "MIT"
+
+STANDALONE_SYSROOT = "${STAGING_DIR}/${MACHINE}"
+STANDALONE_SYSROOT_NATIVE = "${STAGING_DIR}/${BUILD_ARCH}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+EXCLUDE_FROM_WORLD = "1"
+
+inherit nopackages
+deltask fetch
+deltask unpack
+deltask patch
+deltask prepare_recipe_sysroot
+deltask populate_lic
+deltask configure
+deltask compile
+deltask install
+deltask populate_sysroot
+
+python do_build_native_sysroot () {
+ targetsysroot = d.getVar("STANDALONE_SYSROOT")
+ nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE")
+ staging_populate_sysroot_dir(targetsysroot, nativesysroot, True, d)
+}
+do_build_native_sysroot[cleandirs] = "${STANDALONE_SYSROOT_NATIVE}"
+do_build_native_sysroot[nostamp] = "1"
+addtask do_build_native_sysroot before do_build
+
+python do_build_target_sysroot () {
+ targetsysroot = d.getVar("STANDALONE_SYSROOT")
+ nativesysroot = d.getVar("STANDALONE_SYSROOT_NATIVE")
+ staging_populate_sysroot_dir(targetsysroot, nativesysroot, False, d)
+}
+do_build_target_sysroot[cleandirs] = "${STANDALONE_SYSROOT}"
+do_build_target_sysroot[nostamp] = "1"
+addtask do_build_target_sysroot before do_build
+
+do_clean[cleandirs] += "${STANDALONE_SYSROOT} ${STANDALONE_SYSROOT_NATIVE}"
diff --git a/external/poky/meta/recipes-core/meta/buildtools-tarball.bb b/external/poky/meta/recipes-core/meta/buildtools-tarball.bb
new file mode 100644
index 00000000..91df6f1a
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/buildtools-tarball.bb
@@ -0,0 +1,87 @@
+DESCRIPTION = "SDK type target for building a standalone tarball containing python3, chrpath, make, git and tar. The \
+ tarball can be used to run bitbake builds on systems which don't meet the usual version requirements."
+SUMMARY = "Standalone tarball for running builds on systems with inadequate software"
+LICENSE = "MIT"
+
+TOOLCHAIN_TARGET_TASK ?= ""
+
+TOOLCHAIN_HOST_TASK ?= "\
+ nativesdk-python3-core \
+ nativesdk-python3-modules \
+ nativesdk-python3-misc \
+ nativesdk-python3-git \
+ nativesdk-python3-testtools \
+ nativesdk-python3-subunit \
+ nativesdk-ncurses-terminfo-base \
+ nativesdk-chrpath \
+ nativesdk-tar \
+ nativesdk-buildtools-perl-dummy \
+ nativesdk-git \
+ nativesdk-git-perltools \
+ nativesdk-pigz \
+ nativesdk-make \
+ nativesdk-wget \
+ nativesdk-ca-certificates \
+ nativesdk-texinfo \
+ nativesdk-libnss-nis \
+ nativesdk-rpcsvc-proto \
+ "
+
+MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+PACKAGE_ARCH = "${SDK_ARCH}_${SDK_OS}"
+PACKAGE_ARCHS = ""
+TARGET_ARCH = "none"
+TARGET_OS = "none"
+
+SDK_PACKAGE_ARCHS += "buildtools-dummy-${SDKPKGSUFFIX}"
+
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_ARCH}-buildtools-nativesdk-standalone-${DISTRO_VERSION}"
+
+SDK_TITLE = "Build tools"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit meta
+inherit populate_sdk
+inherit toolchain-scripts-base
+inherit nopackages
+
+deltask install
+deltask populate_sysroot
+
+do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}"
+
+REAL_MULTIMACH_TARGET_SYS = "none"
+
+create_sdk_files_append () {
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-*
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-*
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/version-*
+
+ # Generate new (mini) sdk-environment-setup file
+ script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}}
+ touch $script
+ echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $script
+ # In order for the self-extraction script to correctly extract and set up things,
+ # we need a 'OECORE_NATIVE_SYSROOT=xxx' line in environment setup script.
+ # However, buildtools-tarball is inherently a tool set instead of a fully functional SDK,
+ # so instead of exporting the variable, we use a comment here.
+ echo '#OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
+ toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS}
+
+ echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
+
+ if [ "${SDKMACHINE}" = "i686" ]; then
+ echo 'export NO32LIBS="0"' >>$script
+ echo 'echo "$BB_ENV_EXTRAWHITE" | grep -q "NO32LIBS"' >>$script
+ echo '[ $? != 0 ] && export BB_ENV_EXTRAWHITE="NO32LIBS $BB_ENV_EXTRAWHITE"' >>$script
+ fi
+}
+
+# buildtools-tarball doesn't need config site
+TOOLCHAIN_NEED_CONFIGSITE_CACHE = ""
+
+# The recipe doesn't need any default deps
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/external/poky/meta/recipes-core/meta/dummy-sdk-package.inc b/external/poky/meta/recipes-core/meta/dummy-sdk-package.inc
new file mode 100644
index 00000000..4d653706
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/dummy-sdk-package.inc
@@ -0,0 +1,26 @@
+SUMMARY = "Dummy packages which handle excluding packages from the sdk, e.g. ensuring perl is excluded from buildtools"
+LICENSE = "MIT"
+
+PACKAGE_ARCH = "all"
+
+inherit allarch
+
+python() {
+ # Put the package somewhere separate to ensure it's never used except
+ # when we want it
+ # (note that we have to do this in anonymous python here to avoid
+ # allarch.bbclass disabling itself)
+ d.setVar('PACKAGE_ARCH', '${DUMMYARCH}')
+}
+
+ALLOW_EMPTY_${PN} = "1"
+
+PR[vardeps] += "DUMMYPROVIDES"
+
+python populate_packages_prepend() {
+ p = d.getVar("PN")
+ d.appendVar("RPROVIDES_%s" % p, "${DUMMYPROVIDES}")
+ d.appendVar("RCONFLICTS_%s" % p, "${DUMMYPROVIDES}")
+ d.appendVar("RREPLACES_%s" % p, "${DUMMYPROVIDES}")
+}
+
diff --git a/external/poky/meta/recipes-core/meta/meta-environment-extsdk.bb b/external/poky/meta/recipes-core/meta/meta-environment-extsdk.bb
new file mode 100644
index 00000000..2076b56f
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/meta-environment-extsdk.bb
@@ -0,0 +1,12 @@
+# meta-environment for extensible SDK
+
+require meta-environment.bb
+
+PN = "meta-environment-extsdk-${MACHINE}"
+
+create_sdk_files_append() {
+ local sysroot=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR'), d.getVar('TMPDIR'))}/${MACHINE}
+ local sdkpathnative=${SDKPATH}/tmp/${@os.path.relpath(d.getVar('STAGING_DIR'), d.getVar('TMPDIR'))}/${BUILD_ARCH}
+
+ toolchain_create_sdk_env_script '' '' $sysroot '' ${bindir_native} ${prefix_native} $sdkpathnative
+}
diff --git a/external/poky/meta/recipes-core/meta/meta-environment.bb b/external/poky/meta/recipes-core/meta/meta-environment.bb
new file mode 100644
index 00000000..da1230be
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/meta-environment.bb
@@ -0,0 +1,78 @@
+SUMMARY = "Package of environment files for SDK"
+LICENSE = "MIT"
+PR = "r8"
+
+EXCLUDE_FROM_WORLD = "1"
+
+MODIFYTOS = "0"
+
+REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+inherit toolchain-scripts
+TOOLCHAIN_NEED_CONFIGSITE_CACHE_append = " zlib"
+# Need to expand here before cross-candian changes HOST_ARCH -> SDK_ARCH
+TOOLCHAIN_CONFIGSITE_NOCACHE := "${TOOLCHAIN_CONFIGSITE_NOCACHE}"
+
+SDK_DIR = "${WORKDIR}/sdk"
+SDK_OUTPUT = "${SDK_DIR}/image"
+SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
+
+inherit cross-canadian
+
+do_generate_content[cleandirs] = "${SDK_OUTPUT}"
+do_generate_content[dirs] = "${SDK_OUTPUT}/${SDKPATH}"
+# Need to ensure we have the virtual mappings and site files for all multtilib variants
+do_generate_content[depends] = "${@oe.utils.build_depends_string(all_multilib_tune_values(d, 'TOOLCHAIN_NEED_CONFIGSITE_CACHE'), 'do_populate_sysroot')}"
+python do_generate_content() {
+ # Handle multilibs in the SDK environment, siteconfig, etc files...
+ localdata = bb.data.createCopy(d)
+
+ # make sure we only use the WORKDIR value from 'd', or it can change
+ localdata.setVar('WORKDIR', d.getVar('WORKDIR'))
+
+ # make sure we only use the SDKTARGETSYSROOT value from 'd'
+ localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT'))
+ localdata.setVar('libdir', d.getVar('target_libdir', False))
+
+ # Process DEFAULTTUNE
+ bb.build.exec_func("create_sdk_files", localdata)
+
+ variants = d.getVar("MULTILIB_VARIANTS") or ""
+ for item in variants.split():
+ # Load overrides from 'd' to avoid having to reset the value...
+ overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+ localdata.setVar("OVERRIDES", overrides)
+ localdata.setVar("MLPREFIX", item + "-")
+ bb.build.exec_func("create_sdk_files", localdata)
+}
+addtask generate_content before do_install after do_compile
+
+create_sdk_files() {
+ # Setup site file for external use
+ toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS}
+
+ toolchain_create_sdk_env_script ${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
+
+ # Add version information
+ toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS}
+
+ toolchain_create_post_relocate_script ${SDK_OUTPUT}/${SDKPATH}/post-relocate-setup.sh ${SDKPATH}
+}
+
+do_install() {
+ install -d ${D}/${SDKPATH}
+ install -m 0644 -t ${D}/${SDKPATH} ${SDK_OUTPUT}/${SDKPATH}/*
+}
+
+PN = "meta-environment-${MACHINE}"
+PACKAGES = "${PN}"
+FILES_${PN}= " \
+ ${SDKPATH}/* \
+ "
+
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_populate_sysroot
diff --git a/external/poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb b/external/poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb
new file mode 100644
index 00000000..235d6ecc
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/meta-extsdk-toolchain.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Extensible SDK toolchain meta-recipe"
+DESCRIPTION = "Meta-recipe for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
+LICENSE = "MIT"
+
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
+
+do_populate_sysroot[deptask] = "do_populate_sysroot"
+
+# NOTE: There is logic specific to this recipe in setscene_depvalid()
+# within sstate.bbclass, so if you copy or rename this and expect the same
+# functionality you'll need to modify that as well.
+
+LOCKED_SIGS_INDIR = "${WORKDIR}/locked-sigs"
+
+addtask do_locked_sigs after do_populate_sysroot
+SSTATETASKS += "do_locked_sigs"
+do_locked_sigs[sstate-inputdirs] = "${LOCKED_SIGS_INDIR}"
+do_locked_sigs[sstate-outputdirs] = "${STAGING_DIR}/${PACKAGE_ARCH}/${PN}/locked-sigs"
+
+python do_locked_sigs() {
+ import oe.copy_buildsystem
+ outdir = os.path.join(d.getVar('LOCKED_SIGS_INDIR'))
+ bb.utils.mkdirhier(outdir)
+ sigfile = os.path.join(outdir, 'locked-sigs-extsdk-toolchain.inc')
+ oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
+}
diff --git a/external/poky/meta/recipes-core/meta/meta-go-toolchain.bb b/external/poky/meta/recipes-core/meta/meta-go-toolchain.bb
new file mode 100644
index 00000000..dde385c1
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/meta-go-toolchain.bb
@@ -0,0 +1,12 @@
+SUMMARY = "Meta package for building a installable Go toolchain"
+LICENSE = "MIT"
+
+inherit populate_sdk
+
+TOOLCHAIN_HOST_TASK_append = " \
+ packagegroup-go-cross-canadian-${MACHINE} \
+"
+
+TOOLCHAIN_TARGET_TASK_append = " \
+ ${@multilib_pkg_extend(d, 'packagegroup-go-sdk-target')} \
+"
diff --git a/external/poky/meta/recipes-core/meta/meta-ide-support.bb b/external/poky/meta/recipes-core/meta/meta-ide-support.bb
new file mode 100644
index 00000000..768f6f4b
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/meta-ide-support.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Integrated Development Environment support"
+DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
+LICENSE = "MIT"
+
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native cmake-native"
+PR = "r3"
+RM_WORK_EXCLUDE += "${PN}"
+
+inherit meta toolchain-scripts nopackages
+
+do_populate_ide_support () {
+ toolchain_create_tree_env_script
+}
+
+addtask populate_ide_support before do_build after do_install
diff --git a/external/poky/meta/recipes-core/meta/meta-toolchain.bb b/external/poky/meta/recipes-core/meta/meta-toolchain.bb
new file mode 100644
index 00000000..b02b0665
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/meta-toolchain.bb
@@ -0,0 +1,6 @@
+SUMMARY = "Meta package for building a installable toolchain"
+LICENSE = "MIT"
+
+PR = "r7"
+
+inherit populate_sdk
diff --git a/external/poky/meta/recipes-core/meta/meta-world-pkgdata.bb b/external/poky/meta/recipes-core/meta/meta-world-pkgdata.bb
new file mode 100644
index 00000000..b2998613
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/meta-world-pkgdata.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Pulls in pkgdata for world"
+LICENSE = "MIT"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+addtask do_allpackagedata before do_build
+do_allpackagedata() {
+ :
+}
+do_allpackagedata[recrdeptask] = "do_packagedata do_allpackagedata"
+do_allpackagedata[noexec] = "1"
+
+WORLD_PKGDATADIR = "${D}/world-pkgdata"
+
+addtask do_collect_packagedata after do_allpackagedata
+SSTATETASKS += "do_collect_packagedata"
+do_collect_packagedata[sstate-inputdirs] = "${WORLD_PKGDATADIR}"
+do_collect_packagedata[sstate-outputdirs] = "${STAGING_DIR_HOST}/world-pkgdata"
+
+python do_collect_packagedata() {
+ import oe.copy_buildsystem
+ outdir = os.path.join(d.getVar('WORLD_PKGDATADIR'))
+ bb.utils.mkdirhier(outdir)
+ sigfile = os.path.join(outdir, 'locked-sigs-pkgdata.inc')
+ oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
+}
+
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_install
+
+do_prepare_recipe_sysroot[deptask] = ""
+
+WORLD_PKGDATA_EXCLUDE ?= ""
+
+python calculate_extra_depends() {
+ exclude = '${WORLD_PKGDATA_EXCLUDE}'.split()
+ for p in world_target:
+ if p == self_pn:
+ continue
+
+ if p in exclude:
+ continue
+
+ deps.append(p)
+}
+
+PACKAGES = ""
diff --git a/external/poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb b/external/poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
new file mode 100644
index 00000000..6a8748ac
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
@@ -0,0 +1,31 @@
+DUMMYARCH = "buildtools-dummy-${SDKPKGSUFFIX}"
+
+DUMMYPROVIDES = "\
+ nativesdk-perl \
+ nativesdk-libxml-parser-perl \
+ nativesdk-perl-module-bytes \
+ nativesdk-perl-module-carp \
+ nativesdk-perl-module-constant \
+ nativesdk-perl-module-data-dumper \
+ nativesdk-perl-module-errno \
+ nativesdk-perl-module-exporter \
+ nativesdk-perl-module-file-basename \
+ nativesdk-perl-module-file-compare \
+ nativesdk-perl-module-file-copy \
+ nativesdk-perl-module-file-find \
+ nativesdk-perl-module-file-glob \
+ nativesdk-perl-module-file-path \
+ nativesdk-perl-module-file-stat \
+ nativesdk-perl-module-getopt-long \
+ nativesdk-perl-module-io-file \
+ nativesdk-perl-module-posix \
+ nativesdk-perl-module-thread-queue \
+ nativesdk-perl-module-threads \
+ /usr/bin/perl \
+ "
+
+PR = "r2"
+
+require dummy-sdk-package.inc
+
+inherit nativesdk
diff --git a/external/poky/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb b/external/poky/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb
new file mode 100644
index 00000000..b891efa5
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb
@@ -0,0 +1,14 @@
+DUMMYARCH = "sdk-provides-dummy-${SDKPKGSUFFIX}"
+
+# Add /bin/sh?
+DUMMYPROVIDES = "\
+ /bin/bash \
+ /usr/bin/env \
+ pkgconfig \
+ libGL.so()(64bit) \
+ libGL.so \
+"
+
+require dummy-sdk-package.inc
+
+inherit nativesdk
diff --git a/external/poky/meta/recipes-core/meta/package-index.bb b/external/poky/meta/recipes-core/meta/package-index.bb
new file mode 100644
index 00000000..a4123b76
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/package-index.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Rebuilds the package index"
+LICENSE = "MIT"
+
+INHIBIT_DEFAULT_DEPS = "1"
+PACKAGES = ""
+
+inherit nopackages
+
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
+deltask do_install
+deltask do_populate_sysroot
+
+do_package_index[nostamp] = "1"
+do_package_index[depends] += "${PACKAGEINDEXDEPS}"
+
+python do_package_index() {
+ from oe.rootfs import generate_index_files
+ generate_index_files(d)
+}
+addtask do_package_index before do_build
+EXCLUDE_FROM_WORLD = "1"
diff --git a/external/poky/meta/recipes-core/meta/signing-keys.bb b/external/poky/meta/recipes-core/meta/signing-keys.bb
new file mode 100644
index 00000000..1e1c7e34
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/signing-keys.bb
@@ -0,0 +1,83 @@
+# Copyright (C) 2015 Intel Corporation
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Makes public keys of the signing keys available"
+LICENSE = "MIT"
+
+
+inherit allarch deploy
+
+EXCLUDE_FROM_WORLD = "1"
+INHIBIT_DEFAULT_DEPS = "1"
+
+SYSROOT_DIRS += "${sysconfdir}/pki"
+
+PACKAGES =+ "${PN}-ipk ${PN}-rpm ${PN}-packagefeed"
+
+FILES_${PN}-rpm = "${sysconfdir}/pki/rpm-gpg"
+FILES_${PN}-ipk = "${sysconfdir}/pki/ipk-gpg"
+FILES_${PN}-packagefeed = "${sysconfdir}/pki/packagefeed-gpg"
+
+python do_get_public_keys () {
+ from oe.gpg_sign import get_signer
+
+ if d.getVar("RPM_SIGN_PACKAGES"):
+ # Export public key of the rpm signing key
+ signer = get_signer(d, d.getVar('RPM_GPG_BACKEND'))
+ signer.export_pubkey(os.path.join(d.expand('${B}'), 'rpm-key'),
+ d.getVar('RPM_GPG_NAME'))
+
+ if d.getVar("IPK_SIGN_PACKAGES"):
+ # Export public key of the ipk signing key
+ signer = get_signer(d, d.getVar('IPK_GPG_BACKEND'))
+ signer.export_pubkey(os.path.join(d.expand('${B}'), 'ipk-key'),
+ d.getVar('IPK_GPG_NAME'))
+
+ if d.getVar('PACKAGE_FEED_SIGN') == '1':
+ # Export public key of the feed signing key
+ signer = get_signer(d, d.getVar('PACKAGE_FEED_GPG_BACKEND'))
+ signer.export_pubkey(os.path.join(d.expand('${B}'), 'pf-key'),
+ d.getVar('PACKAGE_FEED_GPG_NAME'))
+}
+do_get_public_keys[cleandirs] = "${B}"
+addtask get_public_keys before do_install
+do_get_public_keys[depends] += "gnupg-native:do_populate_sysroot"
+
+do_install () {
+ if [ -f "${B}/rpm-key" ]; then
+ install -D -m 0644 "${B}/rpm-key" "${D}${sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+ if [ -f "${B}/ipk-key" ]; then
+ install -D -m 0644 "${B}/ipk-key" "${D}${sysconfdir}/pki/ipk-gpg/IPK-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+ if [ -f "${B}/pf-key" ]; then
+ install -D -m 0644 "${B}/pf-key" "${D}${sysconfdir}/pki/packagefeed-gpg/PACKAGEFEED-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+}
+
+do_deploy () {
+ if [ -f "${B}/rpm-key" ]; then
+ install -D -m 0644 "${B}/rpm-key" "${DEPLOYDIR}/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+ if [ -f "${B}/ipk-key" ]; then
+ install -D -m 0644 "${B}/ipk-key" "${DEPLOYDIR}/IPK-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+ if [ -f "${B}/pf-key" ]; then
+ install -D -m 0644 "${B}/pf-key" "${DEPLOYDIR}/PACKAGEFEED-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
+ fi
+}
+do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_RPM}"
+# cleandirs should possibly be in deploy.bbclass but we need it
+do_deploy[cleandirs] = "${DEPLOYDIR}"
+# clear stamp-extra-info since MACHINE_ARCH is normally put there by
+# deploy.bbclass
+do_deploy[stamp-extra-info] = ""
+addtask deploy after do_get_public_keys
+
+# Delete unnecessary tasks. In particular, "do_unpack" _must_ be deleted because
+# it cleans ${B} and will wipe any keys exported by do_get_public_keys.
+deltask do_fetch
+deltask do_unpack
+deltask do_patch
+deltask do_configure
+deltask do_compile
diff --git a/external/poky/meta/recipes-core/meta/target-sdk-provides-dummy.bb b/external/poky/meta/recipes-core/meta/target-sdk-provides-dummy.bb
new file mode 100644
index 00000000..0160cb8e
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/target-sdk-provides-dummy.bb
@@ -0,0 +1,52 @@
+DUMMYARCH = "sdk-provides-dummy-target"
+
+DUMMYPROVIDES = "\
+ busybox \
+ busybox-dev \
+ busybox-src \
+ coreutils \
+ coreutils-dev \
+ coreutils-src \
+ bash \
+ bash-dev \
+ bash-src \
+ perl \
+ perl-dev \
+ perl-src \
+ perl-module-re \
+ perl-module-strict \
+ perl-module-vars \
+ perl-module-text-wrap \
+ libxml-parser-perl \
+ perl-module-bytes \
+ perl-module-carp \
+ perl-module-constant \
+ perl-module-data-dumper \
+ perl-module-errno \
+ perl-module-exporter \
+ perl-module-file-basename \
+ perl-module-file-compare \
+ perl-module-file-copy \
+ perl-module-file-find \
+ perl-module-file-glob \
+ perl-module-file-path \
+ perl-module-file-stat \
+ perl-module-file-temp \
+ perl-module-getopt-long \
+ perl-module-io-file \
+ perl-module-overload \
+ perl-module-posix \
+ perl-module-overload \
+ perl-module-thread-queue \
+ perl-module-threads \
+ perl-module-warnings \
+ /bin/sh \
+ /bin/bash \
+ /usr/bin/env \
+ /usr/bin/perl \
+ pkgconfig \
+ pkgconfig-dev \
+ pkgconfig-src \
+"
+
+require dummy-sdk-package.inc
diff --git a/external/poky/meta/recipes-core/meta/testexport-tarball.bb b/external/poky/meta/recipes-core/meta/testexport-tarball.bb
new file mode 100644
index 00000000..c38ac902
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/testexport-tarball.bb
@@ -0,0 +1,70 @@
+DESCRIPTION = "SDK type target for standalone tarball containing packages defined by TEST_EXPORT_TOOLS. The \
+ tarball can be used to run missing programs on testing systems which don't have such tools.\
+ This recipe is almost the same as buildtools-tarball"
+SUMMARY = "Standalone tarball for test systems with missing software"
+LICENSE = "MIT"
+
+TEST_EXPORT_SDK_PACKAGES ??= ""
+
+TOOLCHAIN_TARGET_TASK ?= ""
+
+TOOLCHAIN_HOST_TASK ?= "${TEST_EXPORT_SDK_PACKAGES}"
+
+MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+PACKAGE_ARCH = "${SDK_ARCH}_${SDK_OS}"
+PACKAGE_ARCHS = ""
+TARGET_ARCH = "none"
+TARGET_OS = "none"
+
+SDK_PACKAGE_ARCHS += "testexport-tools-${SDKPKGSUFFIX}"
+
+TOOLCHAIN_OUTPUTNAME ?= "${TEST_EXPORT_SDK_NAME}"
+
+SDK_TITLE = "Testexport tools"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit meta
+inherit populate_sdk
+inherit toolchain-scripts-base
+inherit nopackages
+
+deltask install
+deltask populate_sysroot
+
+do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}"
+
+REAL_MULTIMACH_TARGET_SYS = "none"
+
+create_sdk_files_append () {
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-*
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-*
+ rm -f ${SDK_OUTPUT}/${SDKPATH}/version-*
+
+ # Generate new (mini) sdk-environment-setup file
+ script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}}
+ touch $script
+ echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $script
+ # In order for the self-extraction script to correctly extract and set up things,
+ # we need a 'OECORE_NATIVE_SYSROOT=xxx' line in environment setup script.
+ # However, testexport-tarball is inherently a tool set instead of a fully functional SDK,
+ # so instead of exporting the variable, we use a comment here.
+ echo '#OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
+ toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS}
+
+ echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
+
+ if [ "${SDKMACHINE}" = "i686" ]; then
+ echo 'export NO32LIBS="0"' >>$script
+ echo 'echo "$BB_ENV_EXTRAWHITE" | grep -q "NO32LIBS"' >>$script
+ echo '[ $? != 0 ] && export BB_ENV_EXTRAWHITE="NO32LIBS $BB_ENV_EXTRAWHITE"' >>$script
+ fi
+}
+
+# testexport-tarball doesn't need config site
+TOOLCHAIN_NEED_CONFIGSITE_CACHE = ""
+
+# The recipe doesn't need any default deps
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/external/poky/meta/recipes-core/meta/uninative-tarball.bb b/external/poky/meta/recipes-core/meta/uninative-tarball.bb
new file mode 100644
index 00000000..e0cb9ffe
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/uninative-tarball.bb
@@ -0,0 +1,69 @@
+SUMMARY = "libc and patchelf tarball for use with uninative.bbclass"
+LICENSE = "MIT"
+
+TOOLCHAIN_TARGET_TASK = ""
+
+# ibm850 - mcopy from mtools
+# iso8859-1 - guile
+# utf-16, cp1252 - binutils-windres
+TOOLCHAIN_HOST_TASK = "\
+ nativesdk-glibc \
+ nativesdk-glibc-gconv-ibm850 \
+ nativesdk-glibc-gconv-iso8859-1 \
+ nativesdk-glibc-gconv-utf-16 \
+ nativesdk-glibc-gconv-cp1252 \
+ nativesdk-glibc-gconv-euc-jp \
+ nativesdk-glibc-gconv-libjis \
+ nativesdk-patchelf \
+ nativesdk-libxcrypt \
+ nativesdk-libnss-nis \
+ "
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+MULTIMACH_TARGET_SYS = "${SDK_ARCH}-nativesdk${SDK_VENDOR}-${SDK_OS}"
+PACKAGE_ARCH = "${SDK_ARCH}_${SDK_OS}"
+PACKAGE_ARCHS = ""
+TARGET_ARCH = "none"
+TARGET_OS = "none"
+
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_ARCH}-nativesdk-libc"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit meta
+inherit populate_sdk
+inherit nopackages
+
+deltask install
+deltask populate_sysroot
+
+do_populate_sdk[stamp-extra-info] = "${PACKAGE_ARCH}"
+
+SDK_DEPENDS += "patchelf-native"
+
+SDK_PACKAGING_FUNC = ""
+REAL_MULTIMACH_TARGET_SYS = "none"
+
+fakeroot create_sdk_files() {
+ cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
+
+ # Replace the ##DEFAULT_INSTALL_DIR## with the correct pattern.
+ # Escape special characters like '+' and '.' in the SDKPATH
+ escaped_sdkpath=$(echo ${SDKPATH}/sysroots/${SDK_SYS} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
+ sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
+}
+
+
+fakeroot tar_sdk() {
+ cd ${SDK_OUTPUT}/${SDKPATH}
+
+ DEST="./${SDK_ARCH}-${SDK_OS}"
+ mv sysroots/${SDK_SYS} $DEST
+ rm sysroots -rf
+ patchelf --set-interpreter ${@''.join('a' for n in range(1024))} $DEST/usr/bin/patchelf
+ mv $DEST/usr/bin/patchelf $DEST/usr/bin/patchelf-uninative
+ tar ${SDKTAROPTS} -c -j --file=${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
+}
diff --git a/external/poky/meta/recipes-core/meta/wic-tools.bb b/external/poky/meta/recipes-core/meta/wic-tools.bb
new file mode 100644
index 00000000..09eb409e
--- /dev/null
+++ b/external/poky/meta/recipes-core/meta/wic-tools.bb
@@ -0,0 +1,26 @@
+SUMMARY = "A meta recipe to build native tools used by wic."
+
+LICENSE = "MIT"
+
+DEPENDS = "\
+ parted-native syslinux-native gptfdisk-native dosfstools-native \
+ mtools-native bmap-tools-native grub-efi-native cdrtools-native \
+ btrfs-tools-native squashfs-tools-native pseudo-native \
+ e2fsprogs-native util-linux-native \
+ "
+DEPENDS_append_x86 = " syslinux grub-efi systemd-boot"
+DEPENDS_append_x86-64 = " syslinux grub-efi systemd-boot"
+DEPENDS_append_x86-x32 = " syslinux grub-efi"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+inherit nopackages
+
+# The sysroot of wic-tools is needed for wic, but if rm_work is enabled, it will
+# be removed before wic has a chance to use it, hence the exclusion below.
+RM_WORK_EXCLUDE += "${PN}"
+
+python do_build_sysroot () {
+ bb.build.exec_func("extend_recipe_sysroot", d)
+}
+addtask do_build_sysroot after do_prepare_recipe_sysroot before do_build
diff --git a/external/poky/meta/recipes-core/musl/bsd-headers.bb b/external/poky/meta/recipes-core/musl/bsd-headers.bb
new file mode 100644
index 00000000..c9945d45
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/bsd-headers.bb
@@ -0,0 +1,31 @@
+# Copyright (C) 2016 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "BSD compatible headers"
+LICENSE = "BSD-3-Clause & BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://sys-queue.h;beginline=1;endline=32;md5=c6352b0f03bb448600456547d334b56f"
+SECTION = "devel"
+
+SRC_URI = "file://sys-queue.h \
+ file://sys-tree.h \
+ file://sys-cdefs.h \
+ "
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -Dm 0644 ${S}/sys-queue.h ${D}${includedir}/sys/queue.h
+ install -Dm 0644 ${S}/sys-tree.h ${D}${includedir}/sys/tree.h
+ install -Dm 0644 ${S}/sys-cdefs.h ${D}${includedir}/sys/cdefs.h
+}
+#
+# We will skip parsing for non-musl systems
+#
+
+COMPATIBLE_HOST = ".*-musl.*"
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
diff --git a/external/poky/meta/recipes-core/musl/bsd-headers/sys-cdefs.h b/external/poky/meta/recipes-core/musl/bsd-headers/sys-cdefs.h
new file mode 100644
index 00000000..209a623c
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/bsd-headers/sys-cdefs.h
@@ -0,0 +1,26 @@
+#warning usage of non-standard #include <sys/cdefs.h> is deprecated
+
+#undef __P
+#undef __PMT
+
+#define __P(args) args
+#define __PMT(args) args
+
+#define __CONCAT(x,y) x ## y
+#define __STRING(x) #x
+
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+#if defined(__GNUC__) && !defined(__cplusplus)
+# define __THROW __attribute__ ((__nothrow__))
+# define __NTH(fct) __attribute__ ((__nothrow__)) fct
+#else
+# define __THROW
+# define __NTH(fct) fct
+#endif
diff --git a/external/poky/meta/recipes-core/musl/bsd-headers/sys-queue.h b/external/poky/meta/recipes-core/musl/bsd-headers/sys-queue.h
new file mode 100644
index 00000000..99d01a55
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/bsd-headers/sys-queue.h
@@ -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/external/poky/meta/recipes-core/musl/bsd-headers/sys-tree.h b/external/poky/meta/recipes-core/musl/bsd-headers/sys-tree.h
new file mode 100644
index 00000000..eaea56aa
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/bsd-headers/sys-tree.h
@@ -0,0 +1,761 @@
+/* $NetBSD: tree.h,v 1.20 2013/09/14 13:20:45 joerg Exp $ */
+/* $OpenBSD: tree.h,v 1.13 2011/07/09 00:19:45 pirofti Exp $ */
+/*
+ * Copyright 2002 Niels Provos <provos@citi.umich.edu>
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+
+#ifndef _SYS_TREE_H_
+#define _SYS_TREE_H_
+
+/*
+ * This file defines data structures for different types of trees:
+ * splay trees and red-black trees.
+ *
+ * A splay tree is a self-organizing data structure. Every operation
+ * on the tree causes a splay to happen. The splay moves the requested
+ * node to the root of the tree and partly rebalances it.
+ *
+ * This has the benefit that request locality causes faster lookups as
+ * the requested nodes move to the top of the tree. On the other hand,
+ * every lookup causes memory writes.
+ *
+ * The Balance Theorem bounds the total access time for m operations
+ * and n inserts on an initially empty tree as O((m + n)lg n). The
+ * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
+ *
+ * A red-black tree is a binary search tree with the node color as an
+ * extra attribute. It fulfills a set of conditions:
+ * - every search path from the root to a leaf consists of the
+ * same number of black nodes,
+ * - each red node (except for the root) has a black parent,
+ * - each leaf node is black.
+ *
+ * Every operation on a red-black tree is bounded as O(lg n).
+ * The maximum height of a red-black tree is 2lg (n+1).
+ */
+
+#define SPLAY_HEAD(name, type) \
+struct name { \
+ struct type *sph_root; /* root of the tree */ \
+}
+
+#define SPLAY_INITIALIZER(root) \
+ { NULL }
+
+#define SPLAY_INIT(root) do { \
+ (root)->sph_root = NULL; \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ENTRY(type) \
+struct { \
+ struct type *spe_left; /* left element */ \
+ struct type *spe_right; /* right element */ \
+}
+
+#define SPLAY_LEFT(elm, field) (elm)->field.spe_left
+#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right
+#define SPLAY_ROOT(head) (head)->sph_root
+#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL)
+
+/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
+#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ (head)->sph_root = tmp; \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_LINKLEFT(head, tmp, field) do { \
+ SPLAY_LEFT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_LINKRIGHT(head, tmp, field) do { \
+ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \
+ tmp = (head)->sph_root; \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \
+} while (/*CONSTCOND*/ 0)
+
+#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \
+ SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \
+ SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \
+ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \
+} while (/*CONSTCOND*/ 0)
+
+/* Generates prototypes and inline functions */
+
+#define SPLAY_PROTOTYPE(name, type, field, cmp) \
+void name##_SPLAY(struct name *, struct type *); \
+void name##_SPLAY_MINMAX(struct name *, int); \
+struct type *name##_SPLAY_INSERT(struct name *, struct type *); \
+struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \
+ \
+/* Finds the node with the same key as elm */ \
+static __inline struct type * \
+name##_SPLAY_FIND(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) \
+ return(NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) \
+ return (head->sph_root); \
+ return (NULL); \
+} \
+ \
+static __inline __unused struct type * \
+name##_SPLAY_NEXT(struct name *head, struct type *elm) \
+{ \
+ name##_SPLAY(head, elm); \
+ if (SPLAY_RIGHT(elm, field) != NULL) { \
+ elm = SPLAY_RIGHT(elm, field); \
+ while (SPLAY_LEFT(elm, field) != NULL) { \
+ elm = SPLAY_LEFT(elm, field); \
+ } \
+ } else \
+ elm = NULL; \
+ return (elm); \
+} \
+ \
+static __unused __inline struct type * \
+name##_SPLAY_MIN_MAX(struct name *head, int val) \
+{ \
+ name##_SPLAY_MINMAX(head, val); \
+ return (SPLAY_ROOT(head)); \
+}
+
+/* Main splay operation.
+ * Moves node close to the key of elm to top
+ */
+#define SPLAY_GENERATE(name, type, field, cmp) \
+struct type * \
+name##_SPLAY_INSERT(struct name *head, struct type *elm) \
+{ \
+ if (SPLAY_EMPTY(head)) { \
+ SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \
+ } else { \
+ int __comp; \
+ name##_SPLAY(head, elm); \
+ __comp = (cmp)(elm, (head)->sph_root); \
+ if(__comp < 0) { \
+ SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\
+ SPLAY_RIGHT(elm, field) = (head)->sph_root; \
+ SPLAY_LEFT((head)->sph_root, field) = NULL; \
+ } else if (__comp > 0) { \
+ SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\
+ SPLAY_LEFT(elm, field) = (head)->sph_root; \
+ SPLAY_RIGHT((head)->sph_root, field) = NULL; \
+ } else \
+ return ((head)->sph_root); \
+ } \
+ (head)->sph_root = (elm); \
+ return (NULL); \
+} \
+ \
+struct type * \
+name##_SPLAY_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *__tmp; \
+ if (SPLAY_EMPTY(head)) \
+ return (NULL); \
+ name##_SPLAY(head, elm); \
+ if ((cmp)(elm, (head)->sph_root) == 0) { \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \
+ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\
+ } else { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\
+ name##_SPLAY(head, elm); \
+ SPLAY_RIGHT((head)->sph_root, field) = __tmp; \
+ } \
+ return (elm); \
+ } \
+ return (NULL); \
+} \
+ \
+void \
+name##_SPLAY(struct name *head, struct type *elm) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+ int __comp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if ((cmp)(elm, __tmp) > 0){ \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+} \
+ \
+/* Splay with either the minimum or the maximum element \
+ * Used to find minimum or maximum element in tree. \
+ */ \
+void name##_SPLAY_MINMAX(struct name *head, int __comp) \
+{ \
+ struct type __node, *__left, *__right, *__tmp; \
+\
+ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+ __left = __right = &__node; \
+\
+ while (1) { \
+ if (__comp < 0) { \
+ __tmp = SPLAY_LEFT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp < 0){ \
+ SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKLEFT(head, __right, field); \
+ } else if (__comp > 0) { \
+ __tmp = SPLAY_RIGHT((head)->sph_root, field); \
+ if (__tmp == NULL) \
+ break; \
+ if (__comp > 0) { \
+ SPLAY_ROTATE_LEFT(head, __tmp, field); \
+ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+ break; \
+ } \
+ SPLAY_LINKRIGHT(head, __left, field); \
+ } \
+ } \
+ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \
+}
+
+#define SPLAY_NEGINF -1
+#define SPLAY_INF 1
+
+#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y)
+#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y)
+#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y)
+#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y)
+#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
+#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \
+ : name##_SPLAY_MIN_MAX(x, SPLAY_INF))
+
+#define SPLAY_FOREACH(x, name, head) \
+ for ((x) = SPLAY_MIN(name, head); \
+ (x) != NULL; \
+ (x) = SPLAY_NEXT(name, head, x))
+
+/* Macros that define a red-black tree */
+#define RB_HEAD(name, type) \
+struct name { \
+ struct type *rbh_root; /* root of the tree */ \
+}
+
+#define RB_INITIALIZER(root) \
+ { NULL }
+
+#define RB_INIT(root) do { \
+ (root)->rbh_root = NULL; \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_BLACK 0
+#define RB_RED 1
+#define RB_ENTRY(type) \
+struct { \
+ struct type *rbe_left; /* left element */ \
+ struct type *rbe_right; /* right element */ \
+ struct type *rbe_parent; /* parent element */ \
+ int rbe_color; /* node color */ \
+}
+
+#define RB_LEFT(elm, field) (elm)->field.rbe_left
+#define RB_RIGHT(elm, field) (elm)->field.rbe_right
+#define RB_PARENT(elm, field) (elm)->field.rbe_parent
+#define RB_COLOR(elm, field) (elm)->field.rbe_color
+#define RB_ROOT(head) (head)->rbh_root
+#define RB_EMPTY(head) (RB_ROOT(head) == NULL)
+
+#define RB_SET(elm, parent, field) do { \
+ RB_PARENT(elm, field) = parent; \
+ RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \
+ RB_COLOR(elm, field) = RB_RED; \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_SET_BLACKRED(black, red, field) do { \
+ RB_COLOR(black, field) = RB_BLACK; \
+ RB_COLOR(red, field) = RB_RED; \
+} while (/*CONSTCOND*/ 0)
+
+#ifndef RB_AUGMENT
+#define RB_AUGMENT(x) do {} while (/*CONSTCOND*/ 0)
+#endif
+
+#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \
+ (tmp) = RB_RIGHT(elm, field); \
+ if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \
+ RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_LEFT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (/*CONSTCOND*/ 0)
+
+#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \
+ (tmp) = RB_LEFT(elm, field); \
+ if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \
+ RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
+ } \
+ RB_AUGMENT(elm); \
+ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
+ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
+ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
+ else \
+ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+ } else \
+ (head)->rbh_root = (tmp); \
+ RB_RIGHT(tmp, field) = (elm); \
+ RB_PARENT(elm, field) = (tmp); \
+ RB_AUGMENT(tmp); \
+ if ((RB_PARENT(tmp, field))) \
+ RB_AUGMENT(RB_PARENT(tmp, field)); \
+} while (/*CONSTCOND*/ 0)
+
+/* Generates prototypes and inline functions */
+#define RB_PROTOTYPE(name, type, field, cmp) \
+ RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
+#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \
+ RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static)
+#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \
+attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \
+attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
+attr struct type *name##_RB_REMOVE(struct name *, struct type *); \
+attr struct type *name##_RB_INSERT(struct name *, struct type *); \
+attr struct type *name##_RB_FIND(struct name *, struct type *); \
+attr struct type *name##_RB_NFIND(struct name *, struct type *); \
+attr struct type *name##_RB_NEXT(struct type *); \
+attr struct type *name##_RB_PREV(struct type *); \
+attr struct type *name##_RB_MINMAX(struct name *, int); \
+ \
+
+/* Main rb operation.
+ * Moves node close to the key of elm to top
+ */
+#define RB_GENERATE(name, type, field, cmp) \
+ RB_GENERATE_INTERNAL(name, type, field, cmp,)
+#define RB_GENERATE_STATIC(name, type, field, cmp) \
+ RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static)
+#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \
+attr void \
+name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \
+{ \
+ struct type *parent, *gparent, *tmp; \
+ while ((parent = RB_PARENT(elm, field)) != NULL && \
+ RB_COLOR(parent, field) == RB_RED) { \
+ gparent = RB_PARENT(parent, field); \
+ if (parent == RB_LEFT(gparent, field)) { \
+ tmp = RB_RIGHT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_RIGHT(parent, field) == elm) { \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_RIGHT(head, gparent, tmp, field); \
+ } else { \
+ tmp = RB_LEFT(gparent, field); \
+ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
+ RB_COLOR(tmp, field) = RB_BLACK; \
+ RB_SET_BLACKRED(parent, gparent, field);\
+ elm = gparent; \
+ continue; \
+ } \
+ if (RB_LEFT(parent, field) == elm) { \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = parent; \
+ parent = elm; \
+ elm = tmp; \
+ } \
+ RB_SET_BLACKRED(parent, gparent, field); \
+ RB_ROTATE_LEFT(head, gparent, tmp, field); \
+ } \
+ } \
+ RB_COLOR(head->rbh_root, field) = RB_BLACK; \
+} \
+ \
+attr void \
+name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
+{ \
+ struct type *tmp; \
+ while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \
+ elm != RB_ROOT(head)) { \
+ if (RB_LEFT(parent, field) == elm) { \
+ tmp = RB_RIGHT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\
+ struct type *oleft; \
+ if ((oleft = RB_LEFT(tmp, field)) \
+ != NULL) \
+ RB_COLOR(oleft, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_RIGHT(head, tmp, oleft, field);\
+ tmp = RB_RIGHT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_RIGHT(tmp, field)) \
+ RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_LEFT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } else { \
+ tmp = RB_LEFT(parent, field); \
+ if (RB_COLOR(tmp, field) == RB_RED) { \
+ RB_SET_BLACKRED(tmp, parent, field); \
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ if ((RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+ (RB_RIGHT(tmp, field) == NULL || \
+ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+ RB_COLOR(tmp, field) = RB_RED; \
+ elm = parent; \
+ parent = RB_PARENT(elm, field); \
+ } else { \
+ if (RB_LEFT(tmp, field) == NULL || \
+ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\
+ struct type *oright; \
+ if ((oright = RB_RIGHT(tmp, field)) \
+ != NULL) \
+ RB_COLOR(oright, field) = RB_BLACK;\
+ RB_COLOR(tmp, field) = RB_RED; \
+ RB_ROTATE_LEFT(head, tmp, oright, field);\
+ tmp = RB_LEFT(parent, field); \
+ } \
+ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+ RB_COLOR(parent, field) = RB_BLACK; \
+ if (RB_LEFT(tmp, field)) \
+ RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\
+ RB_ROTATE_RIGHT(head, parent, tmp, field);\
+ elm = RB_ROOT(head); \
+ break; \
+ } \
+ } \
+ } \
+ if (elm) \
+ RB_COLOR(elm, field) = RB_BLACK; \
+} \
+ \
+attr struct type * \
+name##_RB_REMOVE(struct name *head, struct type *elm) \
+{ \
+ struct type *child, *parent, *old = elm; \
+ int color; \
+ if (RB_LEFT(elm, field) == NULL) \
+ child = RB_RIGHT(elm, field); \
+ else if (RB_RIGHT(elm, field) == NULL) \
+ child = RB_LEFT(elm, field); \
+ else { \
+ struct type *left; \
+ elm = RB_RIGHT(elm, field); \
+ while ((left = RB_LEFT(elm, field)) != NULL) \
+ elm = left; \
+ child = RB_RIGHT(elm, field); \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+ if (RB_PARENT(elm, field) == old) \
+ parent = elm; \
+ (elm)->field = (old)->field; \
+ if (RB_PARENT(old, field)) { \
+ if (RB_LEFT(RB_PARENT(old, field), field) == old)\
+ RB_LEFT(RB_PARENT(old, field), field) = elm;\
+ else \
+ RB_RIGHT(RB_PARENT(old, field), field) = elm;\
+ RB_AUGMENT(RB_PARENT(old, field)); \
+ } else \
+ RB_ROOT(head) = elm; \
+ RB_PARENT(RB_LEFT(old, field), field) = elm; \
+ if (RB_RIGHT(old, field)) \
+ RB_PARENT(RB_RIGHT(old, field), field) = elm; \
+ if (parent) { \
+ left = parent; \
+ do { \
+ RB_AUGMENT(left); \
+ } while ((left = RB_PARENT(left, field)) != NULL); \
+ } \
+ goto color; \
+ } \
+ parent = RB_PARENT(elm, field); \
+ color = RB_COLOR(elm, field); \
+ if (child) \
+ RB_PARENT(child, field) = parent; \
+ if (parent) { \
+ if (RB_LEFT(parent, field) == elm) \
+ RB_LEFT(parent, field) = child; \
+ else \
+ RB_RIGHT(parent, field) = child; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = child; \
+color: \
+ if (color == RB_BLACK) \
+ name##_RB_REMOVE_COLOR(head, parent, child); \
+ return (old); \
+} \
+ \
+/* Inserts a node into the RB tree */ \
+attr struct type * \
+name##_RB_INSERT(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp; \
+ struct type *parent = NULL; \
+ int comp = 0; \
+ tmp = RB_ROOT(head); \
+ while (tmp) { \
+ parent = tmp; \
+ comp = (cmp)(elm, parent); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ RB_SET(elm, parent, field); \
+ if (parent != NULL) { \
+ if (comp < 0) \
+ RB_LEFT(parent, field) = elm; \
+ else \
+ RB_RIGHT(parent, field) = elm; \
+ RB_AUGMENT(parent); \
+ } else \
+ RB_ROOT(head) = elm; \
+ name##_RB_INSERT_COLOR(head, elm); \
+ return (NULL); \
+} \
+ \
+/* Finds the node with the same key as elm */ \
+attr struct type * \
+name##_RB_FIND(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ int comp; \
+ while (tmp) { \
+ comp = cmp(elm, tmp); \
+ if (comp < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ return (NULL); \
+} \
+ \
+/* Finds the first node greater than or equal to the search key */ \
+attr struct type * \
+name##_RB_NFIND(struct name *head, struct type *elm) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ struct type *res = NULL; \
+ int comp; \
+ while (tmp) { \
+ comp = cmp(elm, tmp); \
+ if (comp < 0) { \
+ res = tmp; \
+ tmp = RB_LEFT(tmp, field); \
+ } \
+ else if (comp > 0) \
+ tmp = RB_RIGHT(tmp, field); \
+ else \
+ return (tmp); \
+ } \
+ return (res); \
+} \
+ \
+/* ARGSUSED */ \
+attr struct type * \
+name##_RB_NEXT(struct type *elm) \
+{ \
+ if (RB_RIGHT(elm, field)) { \
+ elm = RB_RIGHT(elm, field); \
+ while (RB_LEFT(elm, field)) \
+ elm = RB_LEFT(elm, field); \
+ } else { \
+ if (RB_PARENT(elm, field) && \
+ (elm == RB_LEFT(RB_PARENT(elm, field), field))) \
+ elm = RB_PARENT(elm, field); \
+ else { \
+ while (RB_PARENT(elm, field) && \
+ (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\
+ elm = RB_PARENT(elm, field); \
+ elm = RB_PARENT(elm, field); \
+ } \
+ } \
+ return (elm); \
+} \
+ \
+/* ARGSUSED */ \
+attr struct type * \
+name##_RB_PREV(struct type *elm) \
+{ \
+ if (RB_LEFT(elm, field)) { \
+ elm = RB_LEFT(elm, field); \
+ while (RB_RIGHT(elm, field)) \
+ elm = RB_RIGHT(elm, field); \
+ } else { \
+ if (RB_PARENT(elm, field) && \
+ (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \
+ elm = RB_PARENT(elm, field); \
+ else { \
+ while (RB_PARENT(elm, field) && \
+ (elm == RB_LEFT(RB_PARENT(elm, field), field)))\
+ elm = RB_PARENT(elm, field); \
+ elm = RB_PARENT(elm, field); \
+ } \
+ } \
+ return (elm); \
+} \
+ \
+attr struct type * \
+name##_RB_MINMAX(struct name *head, int val) \
+{ \
+ struct type *tmp = RB_ROOT(head); \
+ struct type *parent = NULL; \
+ while (tmp) { \
+ parent = tmp; \
+ if (val < 0) \
+ tmp = RB_LEFT(tmp, field); \
+ else \
+ tmp = RB_RIGHT(tmp, field); \
+ } \
+ return (parent); \
+}
+
+#define RB_NEGINF -1
+#define RB_INF 1
+
+#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y)
+#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y)
+#define RB_FIND(name, x, y) name##_RB_FIND(x, y)
+#define RB_NFIND(name, x, y) name##_RB_NFIND(x, y)
+#define RB_NEXT(name, x, y) name##_RB_NEXT(y)
+#define RB_PREV(name, x, y) name##_RB_PREV(y)
+#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF)
+#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF)
+
+#define RB_FOREACH(x, name, head) \
+ for ((x) = RB_MIN(name, head); \
+ (x) != NULL; \
+ (x) = name##_RB_NEXT(x))
+
+#define RB_FOREACH_FROM(x, name, y) \
+ for ((x) = (y); \
+ ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \
+ (x) = (y))
+
+#define RB_FOREACH_SAFE(x, name, head, y) \
+ for ((x) = RB_MIN(name, head); \
+ ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \
+ (x) = (y))
+
+#define RB_FOREACH_REVERSE(x, name, head) \
+ for ((x) = RB_MAX(name, head); \
+ (x) != NULL; \
+ (x) = name##_RB_PREV(x))
+
+#define RB_FOREACH_REVERSE_FROM(x, name, y) \
+ for ((x) = (y); \
+ ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
+ (x) = (y))
+
+#define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \
+ for ((x) = RB_MAX(name, head); \
+ ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
+ (x) = (y))
+
+#endif /* _SYS_TREE_H_ */
diff --git a/external/poky/meta/recipes-core/musl/libssp-nonshared.bb b/external/poky/meta/recipes-core/musl/libssp-nonshared.bb
new file mode 100644
index 00000000..458eafef
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/libssp-nonshared.bb
@@ -0,0 +1,39 @@
+# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Minimal libssp_nonshared.a must needed for ssp to work with gcc on musl"
+LICENSE = "GPL-3.0-with-GCC-exception"
+LIC_FILES_CHKSUM = "file://ssp-local.c;beginline=1;endline=32;md5=c06d391208c0cfcbc541a6728ed65cc4"
+SECTION = "libs"
+
+SRC_URI = "file://ssp-local.c"
+
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils \
+ virtual/${TARGET_PREFIX}gcc-initial \
+"
+
+do_configure[noexec] = "1"
+
+S = "${WORKDIR}"
+
+do_compile() {
+ ${CC} ${CPPFLAGS} ${CFLAGS} -fPIE -c ssp-local.c -o ssp-local.o
+ ${AR} r libssp_nonshared.a ssp-local.o
+}
+do_install() {
+ install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
+RDEPENDS_${PN}-staticdev = ""
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})"
diff --git a/external/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/external/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
new file mode 100644
index 00000000..8f51afa2
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
@@ -0,0 +1,45 @@
+/* Stack protector support.
+ Copyright (C) 2005-2018 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC 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.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC 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.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+extern void __stack_chk_fail (void);
+
+/* Some targets can avoid loading a GP for calls to hidden functions.
+ Using this entry point may avoid the load of a GP entirely for the
+ function, making the overall code smaller. */
+
+void
+__attribute__((visibility ("hidden")))
+__stack_chk_fail_local (void)
+{
+ __stack_chk_fail ();
+}
diff --git a/external/poky/meta/recipes-core/musl/musl-utils.bb b/external/poky/meta/recipes-core/musl/musl-utils.bb
new file mode 100644
index 00000000..dd0ce330
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/musl-utils.bb
@@ -0,0 +1,27 @@
+# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+DESCRIPTION = "getconf, getent and iconv implementations for musl"
+HOMEPAGE = "https://git.alpinelinux.org/cgit/aports/tree/main/musl"
+LICENSE = "BSD-2-Clause & GPL-2.0+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=9d08215e611db87b357e8674b4b42564"
+SECTION = "utils"
+
+# Date of the commit in SRCREV
+PV = "20170421"
+
+SRCREV = "fb5630138ccabbbc14a19d372096a04e42573c7d"
+SRC_URI = "git://github.com/boltlinux/musl-utils"
+
+UPSTREAM_CHECK_COMMITS = "1"
+
+inherit autotools
+
+S = "${WORKDIR}/git"
+
+PACKAGES =+ "${PN}-iconv"
+
+FILES_${PN}-iconv = "${bindir}/iconv"
+
+COMPATIBLE_HOST = ".*-musl.*"
+
diff --git a/external/poky/meta/recipes-core/musl/musl.inc b/external/poky/meta/recipes-core/musl/musl.inc
new file mode 100644
index 00000000..319709b3
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/musl.inc
@@ -0,0 +1,33 @@
+# Copyright (C) 2014 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "An implementation of the standard library for Linux-based systems"
+DESCRIPTION = "A new standard library to power a new generation of Linux-based devices. \
+musl is lightweight, fast, simple, free, and strives to be correct in the sense of \
+standards-conformance and safety."
+
+HOMEPAGE = "http://www.musl-libc.org/"
+LICENSE = "MIT"
+SECTION = "libs"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8a4bb28f771c817fe57d3a7c4240e3aa"
+
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+
+
+FILES_SOLIBSDEV = ""
+FILES_${PN} += "${libdir}/lib*${SOLIBSDEV}"
+INSANE_SKIP_${PN} = "dev-so"
+
+# Doesn't compile in MIPS16e mode due to use of hand-written
+# assembly
+MIPS_INSTRUCTION_SET = "mips"
+
+# thumb1 is unsupported
+ARM_INSTRUCTION_SET_armv5 = "arm"
+ARM_INSTRUCTION_SET_armv4 = "arm"
+
diff --git a/external/poky/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch b/external/poky/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
new file mode 100644
index 00000000..462d338b
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/musl/0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch
@@ -0,0 +1,76 @@
+From 0ec74744a4cba7c5fdfaa2685995119a4fca0260 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 18 Jan 2017 16:14:37 +0200
+Subject: [PATCH] Make dynamic linker a relative symlink to libc
+
+absolute symlink into $(libdir) fails to load in a cross build
+environment, especially when executing qemu in usermode to run target
+applications, which cross build systems often do, since not everything
+can be computed during cross builds, qemu in usermode often comes to aid
+in such situations to feed into cross builds.
+
+V2:
+ Make use of 'ln -r' to create relative symlinks, as most fo the distros
+ shipping coreutils 8.16+
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+Upstream-Status: Pending
+---
+ Makefile | 2 +-
+ tools/install.sh | 8 +++++---
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 8246b78..d1dbe39 100644
+--- a/Makefile
++++ b/Makefile
+@@ -215,7 +215,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/include/%
+ $(INSTALL) -D -m 644 $< $@
+
+ $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
+- $(INSTALL) -D -l $(libdir)/libc.so $@ || true
++ $(INSTALL) -D -r $(DESTDIR)$(libdir)/libc.so $@ || true
+
+ install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
+
+diff --git a/tools/install.sh b/tools/install.sh
+index d913b60..b6a7f79 100755
+--- a/tools/install.sh
++++ b/tools/install.sh
+@@ -6,18 +6,20 @@
+ #
+
+ usage() {
+-printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
++printf "usage: %s [-D] [-l] [-r] [-m mode] src dest\n" "$0" 1>&2
+ exit 1
+ }
+
+ mkdirp=
+ symlink=
++symlinkflags="-s"
+ mode=755
+
+-while getopts Dlm: name ; do
++while getopts Dlrm: name ; do
+ case "$name" in
+ D) mkdirp=yes ;;
+ l) symlink=yes ;;
++r) symlink=yes; symlinkflags="$symlinkflags -r" ;;
+ m) mode=$OPTARG ;;
+ ?) usage ;;
+ esac
+@@ -48,7 +50,7 @@ trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
+ umask 077
+
+ if test "$symlink" ; then
+-ln -s "$1" "$tmp"
++ln $symlinkflags "$1" "$tmp"
+ else
+ cat < "$1" > "$tmp"
+ chmod "$mode" "$tmp"
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/musl/musl_git.bb b/external/poky/meta/recipes-core/musl/musl_git.bb
new file mode 100644
index 00000000..0d8f8eb2
--- /dev/null
+++ b/external/poky/meta/recipes-core/musl/musl_git.bb
@@ -0,0 +1,89 @@
+# Copyright (C) 2014 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require musl.inc
+inherit linuxloader
+
+SRCREV = "c50985d5c8e316c5c464f352e79eeebfed1121a9"
+
+PV = "1.1.20+git${SRCPV}"
+
+# mirror is at git://github.com/kraj/musl.git
+
+SRC_URI = "git://git.musl-libc.org/musl \
+ file://0001-Make-dynamic-linker-a-relative-symlink-to-libc.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc virtual/libiconv virtual/libintl virtual/crypt"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils \
+ virtual/${TARGET_PREFIX}gcc-initial \
+ libgcc-initial \
+ linux-libc-headers \
+ bsd-headers \
+ libssp-nonshared \
+ "
+GLIBC_LDSO = "${@get_glibc_loader(d)}"
+
+export CROSS_COMPILE="${TARGET_PREFIX}"
+
+LDFLAGS += "-Wl,-soname,libc.so"
+
+# When compiling for Thumb or Thumb2, frame pointers _must_ be disabled since the
+# Thumb frame pointer in r7 clashes with musl's use of inline asm to make syscalls
+# (where r7 is used for the syscall NR). In most cases, frame pointers will be
+# disabled automatically due to the optimisation level, but append an explicit
+# -fomit-frame-pointer to handle cases where optimisation is set to -O0 or frame
+# pointers have been enabled by -fno-omit-frame-pointer earlier in CFLAGS, etc.
+CFLAGS_append_arm = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
+
+CONFIGUREOPTS = " \
+ --prefix=${prefix} \
+ --exec-prefix=${exec_prefix} \
+ --bindir=${bindir} \
+ --libdir=${libdir} \
+ --includedir=${includedir} \
+ --syslibdir=${base_libdir} \
+"
+
+do_configure() {
+ ${S}/configure ${CONFIGUREOPTS}
+}
+
+do_compile() {
+ oe_runmake
+}
+
+do_install() {
+ oe_runmake install DESTDIR='${D}'
+
+ install -d ${D}${bindir}
+ rm -f ${D}${bindir}/ldd
+ lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd
+ lnr ${D}${libdir}/libc.so ${D}${GLIBC_LDSO}
+ for l in crypt dl m pthread resolv rt util xnet
+ do
+ ln -sf libc.so ${D}${libdir}/lib$l.so
+ done
+ for i in libc.so.6 libcrypt.so.1 libdl.so.2 libm.so.6 libpthread.so.0 libresolv.so.2 librt.so.1 libutil.so.1; do
+ ln -sf libc.so ${D}${libdir}/$i
+ done
+}
+
+PACKAGES =+ "${PN}-glibc-compat"
+
+FILES_${PN}-glibc-compat += "\
+ ${libdir}/libc.so.6 ${libdir}/libcrypt.so.1 \
+ ${libdir}/libdl.so.2 ${libdir}/libm.so.6 \
+ ${libdir}/libpthread.so.0 ${libdir}/libresolv.so.2 \
+ ${libdir}/librt.so.1 ${libdir}/libutil.so.1 \
+ ${GLIBC_LDSO} \
+ "
+
+RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev libssp-nonshared-staticdev"
+RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
+RPROVIDES_${PN} += "ldd libsegfault rtld(GNU_HASH)"
+
+LEAD_SONAME = "libc.so"
diff --git a/external/poky/meta/recipes-core/ncurses/files/0001-tic-hang.patch b/external/poky/meta/recipes-core/ncurses/files/0001-tic-hang.patch
new file mode 100644
index 00000000..f98a943e
--- /dev/null
+++ b/external/poky/meta/recipes-core/ncurses/files/0001-tic-hang.patch
@@ -0,0 +1,43 @@
+From 168ba7a681be73ac024438e33e14fde1d5aea97d Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 30 Mar 2018 10:02:24 +0800
+Subject: [PATCH 1/2] tic hang
+
+Upstream-Status: Inappropriate [configuration]
+
+'tic' of some linux distributions (e.g. fedora 11) hang in an infinite
+loop when processing the original file.
+
+Signed-off-by: anonymous
+
+Rebase to 6.1
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ misc/terminfo.src | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/misc/terminfo.src b/misc/terminfo.src
+index 84f4810..6b385ec 100644
+--- a/misc/terminfo.src
++++ b/misc/terminfo.src
+@@ -5562,12 +5562,11 @@ konsole-xf3x|KDE console window with keyboard for XFree86 3.x xterm,
+ # The value for kbs (see konsole-vt100) reflects local customization rather
+ # than the settings used for XFree86 xterm.
+ konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm,
+- kend=\EOF, khome=\EOH, use=konsole+pcfkeys,
+- use=konsole-vt100,
+-
+-konsole+pcfkeys|konsole subset of xterm+pcfkeys,
+- kcbt=\E[Z, use=xterm+pcc2, use=xterm+pcf0,
+- use=xterm+pce2,
++ kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R,
++ kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~,
++ kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
++ kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS,
++ khome=\EOH, use=konsole-vt100,
+
+ # Obsolete: vt100.keymap
+ # KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but
+--
+1.8.3.1
+
diff --git a/external/poky/meta/recipes-core/ncurses/files/0002-configure-reproducible.patch b/external/poky/meta/recipes-core/ncurses/files/0002-configure-reproducible.patch
new file mode 100644
index 00000000..57219561
--- /dev/null
+++ b/external/poky/meta/recipes-core/ncurses/files/0002-configure-reproducible.patch
@@ -0,0 +1,35 @@
+From 2a53c03ffa90f0050a949fc5920f0df3e668ff42 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 16 Aug 2017 14:45:27 +0800
+Subject: [PATCH 2/2] configure: reproducible
+
+"configure" enforces -U for ar flags, breaking deterministic builds.
+The flag was added to fix some vaguely specified "recent POSIX binutil
+build problems" in 2015.
+
+Upstream-Status: Pending
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+
+Rebase to 6.1
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index adead92..fa4fdb7 100755
+--- a/configure
++++ b/configure
+@@ -4503,7 +4503,7 @@ if test "${cf_cv_ar_flags+set}" = set; then
+ else
+
+ cf_cv_ar_flags=unknown
+- for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
++ for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
+ do
+
+ # check if $ARFLAGS already contains this choice
+--
+1.8.3.1
+
diff --git a/external/poky/meta/recipes-core/ncurses/files/config.cache b/external/poky/meta/recipes-core/ncurses/files/config.cache
new file mode 100644
index 00000000..6a9217d5
--- /dev/null
+++ b/external/poky/meta/recipes-core/ncurses/files/config.cache
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+cf_cv_func_nanosleep=yes
+cf_cv_func_mkstemp=yes
diff --git a/external/poky/meta/recipes-core/ncurses/ncurses.inc b/external/poky/meta/recipes-core/ncurses/ncurses.inc
new file mode 100644
index 00000000..99fc4786
--- /dev/null
+++ b/external/poky/meta/recipes-core/ncurses/ncurses.inc
@@ -0,0 +1,319 @@
+SUMMARY = "The New Curses library"
+DESCRIPTION = "SVr4 and XSI-Curses compatible curses library and terminfo tools including tic, infocmp, captoinfo. Supports color, multiple highlights, forms-drawing characters, and automatic recognition of keypad and function-key sequences. Extensions include resizable windows and mouse support on both xterm and Linux console using the gpm library."
+HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66"
+SECTION = "libs"
+DEPENDS = "ncurses-native"
+DEPENDS_class-native = ""
+
+BINCONFIG = "${bindir}/ncurses5-config ${bindir}/ncursesw5-config \
+ ${bindir}/ncurses6-config ${bindir}/ncursesw6-config"
+
+inherit autotools binconfig-disabled multilib_header pkgconfig
+
+# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/
+SRC_URI = "git://salsa.debian.org/debian/ncurses.git;protocol=https"
+
+EXTRA_AUTORECONF = "-I m4"
+CONFIG_SITE =+ "${WORKDIR}/config.cache"
+
+EXTRASITECONFIG = "CFLAGS='${CFLAGS} -I${SYSROOT_DESTDIR}${includedir}'"
+
+# Whether to enable separate widec libraries; must be 'true' or 'false'
+#
+# TODO: remove this variable when widec is supported in every setup?
+ENABLE_WIDEC ?= "true"
+
+# _GNU_SOURCE is required for widec stuff and is detected automatically
+# for target objects. But it must be set manually for native and sdk
+# builds.
+BUILD_CPPFLAGS += "-D_GNU_SOURCE"
+
+# natives don't generally look in base_libdir
+base_libdir_class-native = "${libdir}"
+
+# Display corruption occurs on 64 bit hosts without these settings
+# This was derrived from the upstream debian ncurses which uses
+# these settings for 32 and 64 bit hosts.
+EXCONFIG_ARGS = ""
+EXCONFIG_ARGS_class-native = " \
+ --disable-lp64 \
+ --with-chtype='long' \
+ --with-mmask-t='long'"
+EXCONFIG_ARGS_class-nativesdk = " \
+ --disable-lp64 \
+ --with-chtype='long' \
+ --with-mmask-t='long'"
+
+PACKAGES_DYNAMIC = "^${PN}-lib.*"
+
+# Fall back to the host termcap / terminfo for -nativesdk and -native
+# The reality is a work around for strange problems with things like
+# "bitbake -c menuconfig busybox" where it cannot find the terminfo
+# because the sstate had a hard coded search path. Until this is fixed
+# another way this is deemed good enough.
+EX_TERMCAP = ""
+EX_TERMCAP_class-native = ":/etc/termcap:/usr/share/misc/termcap"
+EX_TERMCAP_class-nativesdk = ":/etc/termcap:/usr/share/misc/termcap"
+EX_TERMINFO = ""
+EX_TERMINFO_class-native = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
+EX_TERMINFO_class-nativesdk = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
+EX_TERMLIB ?= "tinfo"
+
+# Helper function for do_configure to allow multiple configurations
+# $1 the directory to run configure in
+# $@ the arguments to pass to configure
+ncurses_configure() {
+ mkdir -p $1
+ cd $1
+ shift
+ oe_runconf \
+ --without-debug \
+ --without-ada \
+ --without-gpm \
+ --enable-hard-tabs \
+ --enable-xmc-glitch \
+ --enable-colorfgbg \
+ --with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap${EX_TERMCAP}' \
+ --with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo${EX_TERMINFO}' \
+ --with-shared \
+ --disable-big-core \
+ --program-prefix= \
+ --with-ticlib \
+ --with-termlib=${EX_TERMLIB} \
+ --enable-sigwinch \
+ --enable-pc-files \
+ --disable-rpath-hack \
+ ${EXCONFIG_ARGS} \
+ --with-manpage-format=normal \
+ --disable-stripping \
+ "$@" || return 1
+ cd ..
+}
+
+# Override the function from the autotools class; ncurses requires a
+# patched autoconf213 to generate the configure script. This autoconf
+# is not available so that the shipped script will be used.
+do_configure() {
+ # check does not work with cross-compiling and is generally
+ # broken because it requires stdin to be pollable (which is
+ # not the case for /dev/null redirections)
+ export cf_cv_working_poll=yes
+ #Remove ${includedir} from CPPFLAGS, need for cross compile
+ sed -i 's#-I${cf_includedir}##g' ${S}/configure || die "sed CPPFLAGS"
+
+ # The --enable-pc-files requires PKG_CONFIG_LIBDIR existed
+ mkdir -p ${PKG_CONFIG_LIBDIR}
+ ( cd ${S}; gnu-configize --force )
+ ncurses_configure "narrowc" || \
+ return 1
+ ! ${ENABLE_WIDEC} || \
+ ncurses_configure "widec" "--enable-widec" "--without-progs"
+
+}
+
+do_compile() {
+ oe_runmake -C narrowc libs
+ oe_runmake -C narrowc/progs
+
+ ! ${ENABLE_WIDEC} || \
+ oe_runmake -C widec libs
+}
+
+# set of expected differences between narrowc and widec header
+#
+# TODO: the NCURSES_CH_T difference can cause real problems :(
+_unifdef_cleanup = " \
+ -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \
+ -e '/^#define NCURSES_CH_T /d' \
+ -e '/^#include <wchar.h>/d' \
+ -e '\!^/\* .* \*/!d' \
+"
+
+do_test[depends] = "unifdef-native:do_populate_sysroot"
+do_test[dirs] = "${S}"
+do_test() {
+ ${ENABLE_WIDEC} || return 0
+
+ # make sure that the narrow and widec header are compatible
+ # and differ only in minor details.
+ unifdef -k narrowc/include/curses.h | \
+ sed ${_unifdef_cleanup} > curses-narrowc.h
+ unifdef -k widec/include/curses.h | \
+ sed ${_unifdef_cleanup} > curses-widec.h
+
+ diff curses-narrowc.h curses-widec.h
+}
+
+# Split original _install_opts to two parts.
+# One is the options to install contents, the other is the parameters \
+# when running command "make install"
+# Note that install.libs will also implicitly install header files,
+# so we do not need to explicitly specify install.includes.
+# Doing so could in fact result in a race condition, as both targets
+# (install.libs and install.includes) would install the same headers
+# at the same time
+
+_install_opts = " install.libs install.man "
+
+_install_cfgs = "\
+ DESTDIR='${D}' \
+ PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
+"
+
+do_install() {
+ # Order of installation is important; widec installs a 'curses.h'
+ # header with more definitions and must be installed last hence.
+ # Compatibility of these headers will be checked in 'do_test()'.
+ oe_runmake -C narrowc ${_install_cfgs} ${_install_opts} \
+ install.progs
+
+ # The install.data should run after install.libs, otherwise
+ # there would be a race issue in a very critical conditon, since
+ # tic will be run by install.data, and tic needs libtinfo.so
+ # which would be regenerated by install.libs.
+ oe_runmake -C narrowc ${_install_cfgs} \
+ install.data
+
+
+ ! ${ENABLE_WIDEC} || \
+ oe_runmake -C widec ${_install_cfgs} ${_install_opts}
+
+ cd narrowc
+
+ # include some basic terminfo files
+ # stolen ;) from gentoo and modified a bit
+ for x in ansi console dumb linux rxvt screen screen-256color sun vt52 vt100 vt102 vt200 vt220 xterm-color xterm-xfree86 xterm-256color
+ do
+ local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
+ local basedir="$(basename $(dirname "${termfile}"))"
+
+ if [ -n "${termfile}" ]
+ then
+ install -d ${D}${sysconfdir}/terminfo/${basedir}
+ mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
+ ln -s /etc/terminfo/${basedir}/${x} \
+ ${D}${datadir}/terminfo/${basedir}/${x}
+ fi
+ done
+ # i think we can use xterm-color as default xterm
+ if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
+ then
+ ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
+ fi
+
+ # When changing ${libdir} to e.g. /usr/lib/myawesomelib/ ncurses
+ # still installs '/usr/lib/terminfo', so try to rm both
+ # the proper path and a slightly hardcoded one
+ rm -f ${D}${libdir}/terminfo ${D}${prefix}/lib/terminfo
+
+ # create linker scripts for libcurses.so and libncurses to
+ # link against -ltinfo when needed. Some builds might break
+ # else when '-Wl,--no-copy-dt-needed-entries' has been set in
+ # linker flags.
+ for i in libncurses libncursesw; do
+ f=${D}${libdir}/$i.so
+ test -h $f || continue
+ rm -f $f
+ echo '/* GNU ld script */' >$f
+ echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f
+ done
+
+ # Make sure that libcurses is linked so that it gets -ltinfo
+ # also, this should be addressed upstream really.
+ ln -sf libncurses.so ${D}${libdir}/libcurses.so
+
+ # create libtermcap.so linker script for backward compatibility
+ f=${D}${libdir}/libtermcap.so
+ echo '/* GNU ld script */' >$f
+ echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f
+
+ if [ ! -d "${D}${base_libdir}" ]; then
+ # Setting base_libdir to libdir as is done in the -native
+ # case will skip this code
+ mkdir -p ${D}${base_libdir}
+ mv ${D}${libdir}/libncurses.so.* ${D}${base_libdir}
+ ! ${ENABLE_WIDEC} || \
+ mv ${D}${libdir}/libncursesw.so.* ${D}${base_libdir}
+
+ mv ${D}${libdir}/libtinfo.so.* ${D}${base_libdir}
+ rm ${D}${libdir}/libtinfo.so
+
+ # Use lnr to ensure this is a relative link despite absolute paths
+ # (as we can't know the relationship between base_libdir and libdir).
+ # At some point we can rely on coreutils 8.16 which has ln -r.
+ lnr ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so
+ fi
+ if [ -d "${D}${includedir}/ncurses" ]; then
+ for f in `find ${D}${includedir}/ncurses -name "*.h"`
+ do
+ f=`basename $f`
+ test -e ${D}${includedir}/$f && continue
+ ln -sf ncurses/$f ${D}${includedir}/$f
+ done
+ fi
+ oe_multilib_header curses.h
+}
+
+python populate_packages_prepend () {
+ libdir = d.expand("${libdir}")
+ base_libdir = d.expand("${base_libdir}")
+ pnbase = d.expand("${PN}-lib%s")
+ do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
+ if libdir is not base_libdir:
+ do_split_packages(d, base_libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
+}
+
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_ncurses-tools_class-target = "clear reset"
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGES += " \
+ ${PN}-tools \
+ ${PN}-terminfo-base \
+ ${PN}-terminfo \
+"
+
+FILES_${PN} = "\
+ ${bindir}/tput \
+ ${bindir}/tset \
+ ${bindir}/ncurses5-config \
+ ${bindir}/ncursesw5-config \
+ ${bindir}/ncurses6-config \
+ ${bindir}/ncursesw6-config \
+ ${datadir}/tabset \
+"
+
+# This keeps only tput/tset in ncurses
+# clear/reset are in already busybox
+FILES_${PN}-tools = "\
+ ${bindir}/tic \
+ ${bindir}/toe \
+ ${bindir}/infotocap \
+ ${bindir}/captoinfo \
+ ${bindir}/infocmp \
+ ${bindir}/clear${@['', '.${BPN}']['${CLASSOVERRIDE}' == 'class-target']} \
+ ${bindir}/reset${@['', '.${BPN}']['${CLASSOVERRIDE}' == 'class-target']} \
+ ${bindir}/tack \
+ ${bindir}/tabs \
+"
+
+# 'reset' is a symlink to 'tset' which is in the 'ncurses' package
+RDEPENDS_${PN}-tools = "${PN}"
+
+FILES_${PN}-terminfo = "\
+ ${datadir}/terminfo \
+"
+
+FILES_${PN}-terminfo-base = "\
+ ${sysconfdir}/terminfo \
+"
+
+RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo"
+RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base"
diff --git a/external/poky/meta/recipes-core/ncurses/ncurses_6.1+20180630.bb b/external/poky/meta/recipes-core/ncurses/ncurses_6.1+20180630.bb
new file mode 100644
index 00000000..38faf7af
--- /dev/null
+++ b/external/poky/meta/recipes-core/ncurses/ncurses_6.1+20180630.bb
@@ -0,0 +1,11 @@
+require ncurses.inc
+
+SRC_URI += "file://0001-tic-hang.patch \
+ file://0002-configure-reproducible.patch \
+ file://config.cache \
+"
+# commit id corresponds to the revision in package version
+SRCREV = "d3b29180ae4360d7ab7a41a15e963299fdb72e33"
+S = "${WORKDIR}/git"
+EXTRA_OECONF += "--with-abi-version=5"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+(\+\d+)*)"
diff --git a/external/poky/meta/recipes-core/ncurses/site_config/headers b/external/poky/meta/recipes-core/ncurses/site_config/headers
new file mode 100644
index 00000000..087b7bfd
--- /dev/null
+++ b/external/poky/meta/recipes-core/ncurses/site_config/headers
@@ -0,0 +1,5 @@
+curses.h
+ncurses/curses.h
+ncurses.h
+ncurses/termcap.h
+
diff --git a/external/poky/meta/recipes-core/netbase/netbase/hosts b/external/poky/meta/recipes-core/netbase/netbase/hosts
new file mode 100644
index 00000000..b94f414d
--- /dev/null
+++ b/external/poky/meta/recipes-core/netbase/netbase/hosts
@@ -0,0 +1,8 @@
+127.0.0.1 localhost.localdomain localhost
+
+# The following lines are desirable for IPv6 capable hosts
+::1 localhost ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
diff --git a/external/poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch b/external/poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
new file mode 100644
index 00000000..56c8d5b5
--- /dev/null
+++ b/external/poky/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
@@ -0,0 +1,48 @@
+From 76989205a1411f16d7ab09ff9d279539a73dc259 Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+Date: Thu, 12 Jan 2017 16:50:58 +0200
+Subject: [PATCH] netbase: add rpcbind as an alias to sunrpc
+
+the patch comes from:
+https://bugs.archlinux.org/task/20273
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Wang <li.wang@windriver.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+---
+ etc-rpc | 2 +-
+ etc-services | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/etc-rpc b/etc-rpc
+index 1b30625..9a9a81a 100644
+--- a/etc-rpc
++++ b/etc-rpc
+@@ -1,7 +1,7 @@
+ # This file contains user readable names that can be used in place of rpc
+ # program numbers.
+
+-portmapper 100000 portmap sunrpc
++portmapper 100000 portmap sunrpc rpcbind
+ rstatd 100001 rstat rstat_svc rup perfmeter
+ rusersd 100002 rusers
+ nfs 100003 nfsprog
+diff --git a/etc-services b/etc-services
+index e3202ec..a039d7e 100644
+--- a/etc-services
++++ b/etc-services
+@@ -64,8 +64,8 @@ csnet-ns 105/udp cso-ns
+ rtelnet 107/tcp # Remote Telnet
+ rtelnet 107/udp
+ pop3 110/tcp pop-3 # POP version 3
+-sunrpc 111/tcp portmapper # RPC 4.0 portmapper
+-sunrpc 111/udp portmapper
++sunrpc 111/tcp portmapper rpcbind # RPC 4.0 portmapper
++sunrpc 111/udp portmapper rpcbind
+ auth 113/tcp authentication tap ident
+ sftp 115/tcp
+ nntp 119/tcp readnews untp # USENET News Transfer Protocol
+--
+2.4.0
+
diff --git a/external/poky/meta/recipes-core/netbase/netbase_5.4.bb b/external/poky/meta/recipes-core/netbase/netbase_5.4.bb
new file mode 100644
index 00000000..5ab0c58f
--- /dev/null
+++ b/external/poky/meta/recipes-core/netbase/netbase_5.4.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Basic TCP/IP networking support"
+DESCRIPTION = "This package provides the necessary infrastructure for basic TCP/IP based networking"
+HOMEPAGE = "http://packages.debian.org/netbase"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
+PE = "1"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20170112T093812Z/pool/main/n/${BPN}/${BPN}_${PV}.tar.xz \
+ file://netbase-add-rpcbind-as-an-alias-to-sunrpc.patch \
+ file://hosts"
+
+SRC_URI[md5sum] = "117cb70c55ef3c1c002f127812b114c1"
+SRC_URI[sha256sum] = "66ff73d2d162e2d49db43988d8b8cd328cf7fffca042db73397f14c71825e80d"
+
+UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netbase/"
+do_install () {
+ install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
+ install -m 0644 etc-rpc ${D}${sysconfdir}/rpc
+ install -m 0644 etc-protocols ${D}${sysconfdir}/protocols
+ install -m 0644 etc-services ${D}${sysconfdir}/services
+}
+
+CONFFILES_${PN} = "${sysconfdir}/hosts"
diff --git a/external/poky/meta/recipes-core/newlib/libgloss/fix-rs6000-crt0.patch b/external/poky/meta/recipes-core/newlib/libgloss/fix-rs6000-crt0.patch
new file mode 100644
index 00000000..c220fb84
--- /dev/null
+++ b/external/poky/meta/recipes-core/newlib/libgloss/fix-rs6000-crt0.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Inappropriate [OE-Specific]
+
+Make install tries to perform install for all variants, but some of them use the same
+name for crt0 in specific, so performing all of them results in an error during
+do_install, we simply modify the name of the objects so the installation can proceed
+and leave it to the user to select which object files to use.
+
+Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
+
+Index: newlib-3.0.0/libgloss/rs6000/Makefile.in
+===================================================================
+--- newlib-3.0.0.orig/libgloss/rs6000/Makefile.in
++++ newlib-3.0.0/libgloss/rs6000/Makefile.in
+@@ -358,7 +358,7 @@ install-sim:
+ set -e; for x in ${SIM_CRT0} ${SIM_BSP} ${SIM_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
+
+ install-mvme:
+- set -e; for x in ${MVME_CRT0} ${MVME_BSP} ${MVME_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
++ set -e; for x in ${MVME_CRT0} ${MVME_BSP} ${MVME_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/mvme-$$x; done
+
+ install-solaris:
+ set -e; for x in ${SOLARIS_CRT0} ${SOLARIS_BSP} ${SOLARIS_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
+@@ -367,15 +367,15 @@ install-linux:
+ set -e; for x in ${LINUX_CRT0} ${LINUX_BSP} ${LINUX_SCRIPTS}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
+
+ install-yellowknife:
+- set -e; for x in ${YELLOWKNIFE_CRT0} ${YELLOWKNIFE_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
++ set -e; for x in ${YELLOWKNIFE_CRT0} ${YELLOWKNIFE_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/yellowknife-$$x; done
+ set -e; for x in ${YELLOWKNIFE_SCRIPTS}; do ${INSTALL_DATA} $(srcdir)/$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
+
+ install-ads:
+- set -e; for x in ${ADS_CRT0} ${ADS_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
++ set -e; for x in ${ADS_CRT0} ${ADS_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/ads-$$x; done
+ set -e; for x in ${ADS_SCRIPTS}; do ${INSTALL_DATA} $(srcdir)/$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
+
+ install-mbx:
+- set -e; for x in ${MBX_CRT0} ${MBX_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
++ set -e; for x in ${MBX_CRT0} ${MBX_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/mbx-$$x; done
+ set -e; for x in ${MBX_SCRIPTS} ${MBX_SPECS}; do ${INSTALL_DATA} $(srcdir)/$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
+
+ install-xil:
diff --git a/external/poky/meta/recipes-core/newlib/libgloss/fix_makefile_include_arm_h.patch b/external/poky/meta/recipes-core/newlib/libgloss/fix_makefile_include_arm_h.patch
new file mode 100644
index 00000000..7645be73
--- /dev/null
+++ b/external/poky/meta/recipes-core/newlib/libgloss/fix_makefile_include_arm_h.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [OE-Specific]
+
+When trying to build libgloss for an arm target, the build system
+complains about missing some include files:
+
+| fatal error: acle-compiat.h: No such file or directory
+| #include "acle-compat.h"
+| ^~~~~~~~~~~~~~~
+| compilation terminated.
+
+These include files come from the newlib source, but since we
+are building libgloss separately from newlib, libgloss is unaware
+of where they are, this patch fixes the INCLUDES so the build system
+can find such files.
+
+Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>
+
+Index: newlib-3.0.0/libgloss/config/default.mh
+===================================================================
+--- newlib-3.0.0.orig/libgloss/config/default.mh
++++ newlib-3.0.0/libgloss/config/default.mh
+@@ -1,7 +1,7 @@
+ NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi`
+ NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi`
+
+-INCLUDES = -I. -I$(srcdir)/..
++INCLUDES = -I. -I$(srcdir)/.. -I$(srcdir)/../newlib/libc/machine/arm
+ # Note that when building the library, ${MULTILIB} is not the way multilib
+ # options are passed; they're passed in $(CFLAGS).
+ CFLAGS_FOR_TARGET = -O2 -g ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS}
diff --git a/external/poky/meta/recipes-core/newlib/libgloss_3.0.0.bb b/external/poky/meta/recipes-core/newlib/libgloss_3.0.0.bb
new file mode 100644
index 00000000..c9ed30d9
--- /dev/null
+++ b/external/poky/meta/recipes-core/newlib/libgloss_3.0.0.bb
@@ -0,0 +1,33 @@
+require newlib.inc
+
+DEPENDS += "newlib"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/libgloss:"
+
+SRC_URI_append_powerpc = " file://fix-rs6000-crt0.patch"
+SRC_URI_append_arm = " file://fix_makefile_include_arm_h.patch"
+
+do_configure() {
+ ${S}/libgloss/configure ${EXTRA_OECONF}
+}
+
+do_install_prepend() {
+ # install doesn't create this itself, avoid install error
+ install -d ${D}${prefix}/${TARGET_SYS}/lib
+}
+
+do_install_append() {
+ # Move libs to default directories so they can be picked up later
+ install -d ${D}${libdir}
+ mv -v ${D}${prefix}/${TARGET_SYS}/lib/* ${D}${libdir}
+
+ # Remove original directory
+ rmdir -p --ignore-fail-on-non-empty ${D}${prefix}/${TARGET_SYS}/lib
+}
+
+# Split packages correctly
+FILES_${PN} += "${libdir}/*.ld ${libdir}/*.specs"
+FILES_${PN}-dev += "${libdir}/cpu-init/*"
+
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
diff --git a/external/poky/meta/recipes-core/newlib/newlib.inc b/external/poky/meta/recipes-core/newlib/newlib.inc
new file mode 100644
index 00000000..c97c7c27
--- /dev/null
+++ b/external/poky/meta/recipes-core/newlib/newlib.inc
@@ -0,0 +1,58 @@
+SUMMARY = "Newlib is a C library intended for use on embedded systems"
+HOMEPAGE = "https://sourceware.org/newlib/"
+DESCRIPTION = "C library intended for use on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products."
+SECTION = "libs"
+
+LICENSE = "GPLv2 & LGPLv3 & GPLv3 & LGPLv2"
+LIC_FILES_CHKSUM = " \
+ file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING.LIBGLOSS;md5=73f5c98779aea7dba4a6c94a74ab0ae2 \
+ file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://COPYING.NEWLIB;md5=956a4b1487f7677cdcceeee8f05a21f0 \
+ file://newlib/libc/posix/COPYRIGHT;md5=103468ff1982be840fdf4ee9f8b51bbf \
+ file://newlib/libc/sys/linux/linuxthreads/LICENSE;md5=73640207fbc79b198c7ffd4ad4d97aa0 \
+ "
+
+SRC_URI = "ftp://sourceware.org/pub/newlib/newlib-${PV}.tar.gz"
+SRC_URI[md5sum] = "81ec873108b8593c586f91ca65963952"
+SRC_URI[sha256sum] = "c8566335ee74e5fcaeb8595b4ebd0400c4b043d6acb3263ecb1314f8f5501332"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial"
+
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+
+S = "${WORKDIR}/newlib-${PV}"
+B = "${WORKDIR}/build"
+
+## disable stdlib
+TARGET_CC_ARCH_append = " -nostdlib"
+
+EXTRA_OECONF = " \
+ --build=${BUILD_SYS} \
+ --target=${TARGET_SYS} \
+ --host=${HOST_SYS} \
+ --prefix=${prefix} \
+ --exec-prefix=${exec_prefix} \
+ --bindir=${bindir} \
+ --libdir=${libdir} \
+ --includedir=${includedir} \
+ --enable-languages=c \
+ --with-newlib \
+ --with-gnu-as \
+ --with-gnu-ld \
+ --disable-multilib \
+ "
+
+do_configure[cleandirs] = "${B}"
+
+do_install() {
+ oe_runmake install DESTDIR='${D}'
+}
+
+COMPATIBLE_HOST_libc-musl_class-target = "null"
+COMPATIBLE_HOST_libc-glibc_class-target = "null"
diff --git a/external/poky/meta/recipes-core/newlib/newlib_3.0.0.bb b/external/poky/meta/recipes-core/newlib/newlib_3.0.0.bb
new file mode 100644
index 00000000..09238fe0
--- /dev/null
+++ b/external/poky/meta/recipes-core/newlib/newlib_3.0.0.bb
@@ -0,0 +1,19 @@
+require newlib.inc
+
+PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc virtual/libiconv virtual/libintl"
+
+do_configure() {
+ ${S}/configure ${EXTRA_OECONF}
+}
+
+do_install_append() {
+ # Move include files and libs to default directories so they can be picked up later
+ mv -v ${D}${prefix}/${TARGET_SYS}/lib ${D}${libdir}
+ mv -v ${D}${prefix}/${TARGET_SYS}/include ${D}${includedir}
+
+ # Remove original directory
+ rmdir ${D}${prefix}/${TARGET_SYS}
+}
+
+# No rpm package is actually created but -dev depends on it, avoid dnf error
+RDEPENDS_${PN}-dev_libc-newlib = ""
diff --git a/external/poky/meta/recipes-core/os-release/os-release.bb b/external/poky/meta/recipes-core/os-release/os-release.bb
new file mode 100644
index 00000000..7f3d9cba
--- /dev/null
+++ b/external/poky/meta/recipes-core/os-release/os-release.bb
@@ -0,0 +1,50 @@
+inherit allarch
+
+SUMMARY = "Operating system identification"
+DESCRIPTION = "The /usr/lib/os-release file contains operating system identification data."
+LICENSE = "MIT"
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+
+# Other valid fields: BUILD_ID ID_LIKE ANSI_COLOR CPE_NAME
+# HOME_URL SUPPORT_URL BUG_REPORT_URL
+OS_RELEASE_FIELDS = "ID ID_LIKE NAME VERSION VERSION_ID PRETTY_NAME"
+
+ID = "${DISTRO}"
+NAME = "${DISTRO_NAME}"
+VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}"
+VERSION_ID = "${DISTRO_VERSION}"
+PRETTY_NAME = "${DISTRO_NAME} ${VERSION}"
+BUILD_ID ?= "${DATETIME}"
+BUILD_ID[vardepsexclude] = "DATETIME"
+
+def sanitise_version(ver):
+ # VERSION_ID should be (from os-release(5)):
+ # lower-case string (mostly numeric, no spaces or other characters
+ # outside of 0-9, a-z, ".", "_" and "-")
+ ret = ver.replace('+', '-').replace(' ','_')
+ return ret.lower()
+
+python do_compile () {
+ import shutil
+ with open(d.expand('${B}/os-release'), 'w') as f:
+ for field in d.getVar('OS_RELEASE_FIELDS').split():
+ value = d.getVar(field)
+ if value and field == 'VERSION_ID':
+ value = sanitise_version(value)
+ if value:
+ f.write('{0}="{1}"\n'.format(field, value))
+}
+do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
+
+do_install () {
+ install -d ${D}${nonarch_libdir} ${D}${sysconfdir}
+ install -m 0644 os-release ${D}${nonarch_libdir}/
+ lnr ${D}${nonarch_libdir}/os-release ${D}${sysconfdir}/os-release
+}
+
+FILES_${PN} += "${nonarch_libdir}/os-release"
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf-shell-image.bb b/external/poky/meta/recipes-core/ovmf/ovmf-shell-image.bb
new file mode 100644
index 00000000..0d2b8bf5
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf-shell-image.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "boot image with UEFI shell and tools"
+
+# For this image recipe, only the wic format with a
+# single vfat partition makes sense. Because we have no
+# boot loader and no rootfs partition, not additional
+# tools are needed for this .wks file.
+IMAGE_FSTYPES_forcevariable = 'wic'
+WKS_FILE = "ovmf/ovmf-shell-image.wks"
+WKS_FILE_DEPENDS = ""
+
+inherit image
+
+# We want a minimal image with just ovmf-shell-efi unpacked in it. We
+# avoid installing unnecessary stuff as much as possible, but some
+# things still get through and need to be removed.
+PACKAGE_INSTALL = "ovmf-shell-efi"
+LINGUAS_INSTALL = ""
+do_image () {
+ rm -rf `ls -d ${IMAGE_ROOTFS}/* | grep -v efi`
+}
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch b/external/poky/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
new file mode 100644
index 00000000..342fcc62
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
@@ -0,0 +1,71 @@
+From 9fce4bab014b9aa618060eba13d6dd04b0fa1b70 Mon Sep 17 00:00:00 2001
+From: Laszlo Ersek <lersek@redhat.com>
+Date: Fri, 2 Mar 2018 17:11:52 +0100
+Subject: [PATCH 1/4] BaseTools/header.makefile: add "-Wno-stringop-truncation"
+
+gcc-8 (which is part of Fedora 28) enables the new warning
+"-Wstringop-truncation" in "-Wall". This warning is documented in detail
+at <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>; the
+introduction says
+
+> Warn for calls to bounded string manipulation functions such as strncat,
+> strncpy, and stpncpy that may either truncate the copied string or leave
+> the destination unchanged.
+
+It breaks the BaseTools build with:
+
+> EfiUtilityMsgs.c: In function 'PrintMessage':
+> EfiUtilityMsgs.c:484:9: error: 'strncat' output may be truncated copying
+> between 0 and 511 bytes from a string of length 511
+> [-Werror=stringop-truncation]
+> strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
+> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+> EfiUtilityMsgs.c:469:9: error: 'strncat' output may be truncated copying
+> between 0 and 511 bytes from a string of length 511
+> [-Werror=stringop-truncation]
+> strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
+> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+> EfiUtilityMsgs.c:511:5: error: 'strncat' output may be truncated copying
+> between 0 and 511 bytes from a string of length 511
+> [-Werror=stringop-truncation]
+> strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
+> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The right way to fix the warning would be to implement string concat with
+snprintf(). However, Microsoft does not appear to support snprintf()
+before VS2015
+<https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010>,
+so we just have to shut up the warning. The strncat() calls flagged above
+are valid BTW.
+
+Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Cc: Cole Robinson <crobinso@redhat.com>
+Cc: Liming Gao <liming.gao@intel.com>
+Cc: Paolo Bonzini <pbonzini@redhat.com>
+Cc: Yonghong Zhu <yonghong.zhu@intel.com>
+Contributed-under: TianoCore Contribution Agreement 1.1
+Signed-off-by: Laszlo Ersek <lersek@redhat.com>
+Reviewed-by: Liming Gao <liming.gao@intel.com>
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+
+ BaseTools/Source/C/Makefiles/header.makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: git/BaseTools/Source/C/Makefiles/header.makefile
+===================================================================
+--- git.orig/BaseTools/Source/C/Makefiles/header.makefile
++++ git/BaseTools/Source/C/Makefiles/header.makefile
+@@ -47,9 +47,9 @@ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT)
+ BUILD_CPPFLAGS += $(INCLUDE) -O2
+ ifeq ($(DARWIN),Darwin)
+ # assume clang or clang compatible flags on OS X
+-BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g
++BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-self-assign -Wno-unused-result -nostdlib -c -g
+ else
+-BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g
++BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-unused-result -nostdlib -c -g
+ endif
+ BUILD_LFLAGS = $(LDFLAGS)
+ BUILD_CXXFLAGS += -Wno-unused-result
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch b/external/poky/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch
new file mode 100644
index 00000000..5bb418b9
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch
@@ -0,0 +1,46 @@
+From f65e9cc025278387b494c2383c5d9ff3bed98687 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 11 Jun 2017 00:47:24 -0700
+Subject: [PATCH] ia32: Dont use -pie
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ BaseTools/Conf/tools_def.template | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: git/BaseTools/Conf/tools_def.template
+===================================================================
+--- git.orig/BaseTools/Conf/tools_def.template
++++ git/BaseTools/Conf/tools_def.template
+@@ -4336,7 +4336,7 @@ RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG =
+ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug
+
+ DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common
+-DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
++DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe -fno-PIE -no-pie
+ DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
+ DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
+ DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pic -fno-pie
+@@ -4369,9 +4369,9 @@ DEFINE GCC_ARM_RC_FLAGS = -I
+ DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
+
+ DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+-DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables
++DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -fno-PIE -no-pie
+ DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables
+-DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20
++DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 -no-pie
+ DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
+ DEFINE GCC44_IA32_X64_DLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
+ DEFINE GCC44_IA32_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON)
+@@ -4451,7 +4451,7 @@ DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = D
+
+ DEFINE GCC49_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS)
+ DEFINE GCC49_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS)
+-DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40
++DEFINE GCC49_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x40 -no-pie
+ DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
+ DEFINE GCC49_IA32_X64_DLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map
+ DEFINE GCC49_IA32_DLINK2_FLAGS = DEF(GCC48_IA32_DLINK2_FLAGS)
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/0002-BaseTools-header.makefile-add-Wno-restrict.patch b/external/poky/meta/recipes-core/ovmf/ovmf/0002-BaseTools-header.makefile-add-Wno-restrict.patch
new file mode 100644
index 00000000..a076665c
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/0002-BaseTools-header.makefile-add-Wno-restrict.patch
@@ -0,0 +1,102 @@
+From 86dbdac5a25bd23deb4a0e0a97b527407e02184d Mon Sep 17 00:00:00 2001
+From: Laszlo Ersek <lersek@redhat.com>
+Date: Fri, 2 Mar 2018 17:11:52 +0100
+Subject: [PATCH 2/4] BaseTools/header.makefile: add "-Wno-restrict"
+
+gcc-8 (which is part of Fedora 28) enables the new warning
+"-Wrestrict" in "-Wall". This warning is documented in detail
+at <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>; the
+introduction says
+
+> Warn when an object referenced by a restrict-qualified parameter (or, in
+> C++, a __restrict-qualified parameter) is aliased by another argument,
+> or when copies between such objects overlap.
+
+It breaks the BaseTools build (in the Brotli compression library) with:
+
+> In function 'ProcessCommandsInternal',
+> inlined from 'ProcessCommands' at dec/decode.c:1828:10:
+> dec/decode.c:1781:9: error: 'memcpy' accessing between 17 and 2147483631
+> bytes at offsets 16 and 16 overlaps between 17 and 2147483631 bytes at
+> offset 16 [-Werror=restrict]
+> memcpy(copy_dst + 16, copy_src + 16, (size_t)(i - 16));
+> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+> In function 'ProcessCommandsInternal',
+> inlined from 'SafeProcessCommands' at dec/decode.c:1833:10:
+> dec/decode.c:1781:9: error: 'memcpy' accessing between 17 and 2147483631
+> bytes at offsets 16 and 16 overlaps between 17 and 2147483631 bytes at
+> offset 16 [-Werror=restrict]
+> memcpy(copy_dst + 16, copy_src + 16, (size_t)(i - 16));
+> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Paolo Bonzini <pbonzini@redhat.com> analyzed the Brotli source in detail,
+and concluded that the warning is a false positive:
+
+> This seems safe to me, because it's preceded by:
+>
+> uint8_t* copy_dst = &s->ringbuffer[pos];
+> uint8_t* copy_src = &s->ringbuffer[src_start];
+> int dst_end = pos + i;
+> int src_end = src_start + i;
+> if (src_end > pos && dst_end > src_start) {
+> /* Regions intersect. */
+> goto CommandPostWrapCopy;
+> }
+>
+> If [src_start, src_start + i) and [pos, pos + i) don't intersect, then
+> neither do [src_start + 16, src_start + i) and [pos + 16, pos + i).
+>
+> The if seems okay:
+>
+> (src_start + i > pos && pos + i > src_start)
+>
+> which can be rewritten to:
+>
+> (pos < src_start + i && src_start < pos + i)
+>
+> Then the numbers are in one of these two orders:
+>
+> pos <= src_start < pos + i <= src_start + i
+> src_start <= pos < src_start + i <= pos + i
+>
+> These two would be allowed by the "if", but they can only happen if pos
+> == src_start so they degenerate to the same two orders above:
+>
+> pos <= src_start < src_start + i <= pos + i
+> src_start <= pos < pos + i <= src_start + i
+>
+> So it is a false positive in GCC.
+
+Disable the warning for now.
+
+Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Cc: Cole Robinson <crobinso@redhat.com>
+Cc: Liming Gao <liming.gao@intel.com>
+Cc: Paolo Bonzini <pbonzini@redhat.com>
+Cc: Yonghong Zhu <yonghong.zhu@intel.com>
+Reported-by: Cole Robinson <crobinso@redhat.com>
+Contributed-under: TianoCore Contribution Agreement 1.1
+Signed-off-by: Laszlo Ersek <lersek@redhat.com>
+Reviewed-by: Liming Gao <liming.gao@intel.com>
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+ BaseTools/Source/C/Makefiles/header.makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: git/BaseTools/Source/C/Makefiles/header.makefile
+===================================================================
+--- git.orig/BaseTools/Source/C/Makefiles/header.makefile
++++ git/BaseTools/Source/C/Makefiles/header.makefile
+@@ -47,9 +47,9 @@ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT)
+ BUILD_CPPFLAGS += $(INCLUDE) -O2
+ ifeq ($(DARWIN),Darwin)
+ # assume clang or clang compatible flags on OS X
+-BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-self-assign -Wno-unused-result -nostdlib -c -g
++BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-self-assign -Wno-unused-result -nostdlib -c -g
+ else
+-BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-unused-result -nostdlib -c -g
++BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -c -g
+ endif
+ BUILD_LFLAGS = $(LDFLAGS)
+ BUILD_CXXFLAGS += -Wno-unused-result
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch b/external/poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch
new file mode 100644
index 00000000..94ae5d44
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/0002-ovmf-update-path-to-native-BaseTools.patch
@@ -0,0 +1,33 @@
+From 9e632e3f9edd09632cc877dff6ea57608f979aab Mon Sep 17 00:00:00 2001
+From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
+Date: Thu, 9 Jun 2016 02:23:01 -0700
+Subject: [PATCH] ovmf: update path to native BaseTools
+
+BaseTools is a set of utilities to build EDK-based firmware. These utilities
+are used during the build process. Thus, they need to be built natively.
+When cross-compiling, we need to provide a path to the location of these
+tools. The BBAKE_EDK_TOOLS_PATH string is used as a pattern to be replaced
+with the appropriate location before building.
+
+Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
+Upstream-Status: Pending
+---
+ OvmfPkg/build.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
+index eb5eb73..9058fca 100755
+--- a/OvmfPkg/build.sh
++++ b/OvmfPkg/build.sh
+@@ -30,7 +30,7 @@ then
+ # this assumes svn pulls have the same root dir
+ # export EDK_TOOLS_PATH=`pwd`/../BaseTools
+ # This version is for the tools source in edk2
+- export EDK_TOOLS_PATH=`pwd`/BaseTools
++ export EDK_TOOLS_PATH=BBAKE_EDK_TOOLS_PATH/BaseTools
+ echo $EDK_TOOLS_PATH
+ source edksetup.sh BaseTools
+ else
+--
+2.8.1
+
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-header.makefile-revert-gcc-8-Wno-xxx-optio.patch b/external/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-header.makefile-revert-gcc-8-Wno-xxx-optio.patch
new file mode 100644
index 00000000..920723e3
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-header.makefile-revert-gcc-8-Wno-xxx-optio.patch
@@ -0,0 +1,53 @@
+From 6866325dd9c17412e555974dde41f9631224db52 Mon Sep 17 00:00:00 2001
+From: Laszlo Ersek <lersek@redhat.com>
+Date: Wed, 7 Mar 2018 10:17:28 +0100
+Subject: [PATCH 3/4] BaseTools/header.makefile: revert gcc-8 "-Wno-xxx"
+ options on OSX
+
+I recently added the gcc-8 specific "-Wno-stringop-truncation" and
+"-Wno-restrict" options to BUILD_CFLAGS, both for "Darwin" (XCODE5 /
+clang, OSX) and otherwise (gcc, Linux / Cygwin).
+
+I also regression-tested the change with gcc-4.8 on Linux -- gcc-4.8 does
+not know either of the (gcc-8 specific) "-Wno-stringop-truncation" and
+"-Wno-restrict" options, yet the build completed fine (by GCC design).
+
+Regarding OSX, my expectation was that
+
+- XCODE5 / clang would either recognize these warnings options (because
+ clang does recognize most -W options of gcc),
+
+- or, similarly to gcc, clang would simply ignore the "-Wno-xxx" flags
+ that it didn't recognize.
+
+Neither is the case; the new flags have broken the BaseTools build on OSX.
+Revert them (for OSX only).
+
+Cc: Liming Gao <liming.gao@intel.com>
+Cc: Yonghong Zhu <yonghong.zhu@intel.com>
+Reported-by: Liming Gao <liming.gao@intel.com>
+Fixes: 1d212a83df0eaf32a6f5d4159beb2d77832e0231
+Fixes: 9222154ae7b3eef75ae88cdb56158256227cb929
+Contributed-under: TianoCore Contribution Agreement 1.1
+Signed-off-by: Laszlo Ersek <lersek@redhat.com>
+Reviewed-by: Liming Gao <liming.gao@intel.com>
+Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+ BaseTools/Source/C/Makefiles/header.makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: git/BaseTools/Source/C/Makefiles/header.makefile
+===================================================================
+--- git.orig/BaseTools/Source/C/Makefiles/header.makefile
++++ git/BaseTools/Source/C/Makefiles/header.makefile
+@@ -47,7 +47,7 @@ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT)
+ BUILD_CPPFLAGS += $(INCLUDE) -O2
+ ifeq ($(DARWIN),Darwin)
+ # assume clang or clang compatible flags on OS X
+-BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-self-assign -Wno-unused-result -nostdlib -c -g
++BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g
+ else
+ BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -c -g
+ endif
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch b/external/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
new file mode 100644
index 00000000..65b5c16d
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
@@ -0,0 +1,39 @@
+From 2320650c6d381b914fe91b2dedaa5870279a8bcf Mon Sep 17 00:00:00 2001
+From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
+Date: Sun, 27 Nov 2016 18:42:55 -0800
+Subject: [PATCH] BaseTools: makefile: adjust to build in under bitbake
+
+Prepend the build flags with those of bitbake. This is to build
+using the bitbake native sysroot include and library directories.
+
+Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com>
+Upstream-Status: Pending
+---
+ BaseTools/Source/C/Makefiles/header.makefile | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+Index: git/BaseTools/Source/C/Makefiles/header.makefile
+===================================================================
+--- git.orig/BaseTools/Source/C/Makefiles/header.makefile
++++ git/BaseTools/Source/C/Makefiles/header.makefile
+@@ -44,15 +44,15 @@ ARCH_INCLUDE = -I $(MAKEROOT)/Include/AA
+ endif
+
+ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
+-BUILD_CPPFLAGS = $(INCLUDE) -O2
++BUILD_CPPFLAGS += $(INCLUDE) -O2
+ ifeq ($(DARWIN),Darwin)
+ # assume clang or clang compatible flags on OS X
+-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g
++BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g
+ else
+-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g
++BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g
+ endif
+-BUILD_LFLAGS =
+-BUILD_CXXFLAGS = -Wno-unused-result
++BUILD_LFLAGS = $(LDFLAGS)
++BUILD_CXXFLAGS += -Wno-unused-result
+
+ ifeq ($(ARCH), IA32)
+ #
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/0004-BaseTools-GenVtf-silence-false-stringop-overflow-war.patch b/external/poky/meta/recipes-core/ovmf/ovmf/0004-BaseTools-GenVtf-silence-false-stringop-overflow-war.patch
new file mode 100644
index 00000000..7ad7cdf0
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/0004-BaseTools-GenVtf-silence-false-stringop-overflow-war.patch
@@ -0,0 +1,66 @@
+From dfb42a5bff78d9239a80731e337855234badef3e Mon Sep 17 00:00:00 2001
+From: Laszlo Ersek <lersek@redhat.com>
+Date: Fri, 2 Mar 2018 17:11:52 +0100
+Subject: [PATCH 4/4] BaseTools/GenVtf: silence false "stringop-overflow"
+ warning with memcpy()
+
+gcc-8 (which is part of Fedora 28) enables the new warning
+"-Wstringop-overflow" in "-Wall". This warning is documented in detail at
+<https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>; the
+introduction says
+
+> Warn for calls to string manipulation functions such as memcpy and
+> strcpy that are determined to overflow the destination buffer.
+
+It breaks the BaseTools build with:
+
+> GenVtf.c: In function 'ConvertVersionInfo':
+> GenVtf.c:132:7: error: 'strncpy' specified bound depends on the length
+> of the source argument [-Werror=stringop-overflow=]
+> strncpy (TemStr + 4 - Length, Str, Length);
+> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+> GenVtf.c:130:14: note: length computed here
+> Length = strlen(Str);
+> ^~~~~~~~~~~
+
+It is a false positive because, while the bound equals the length of the
+source argument, the destination pointer is moved back towards the
+beginning of the destination buffer by the same amount (and this amount is
+range-checked first, so we can't precede the start of the dest buffer).
+
+Replace both strncpy() calls with memcpy().
+
+Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+Cc: Cole Robinson <crobinso@redhat.com>
+Cc: Liming Gao <liming.gao@intel.com>
+Cc: Paolo Bonzini <pbonzini@redhat.com>
+Cc: Yonghong Zhu <yonghong.zhu@intel.com>
+Reported-by: Cole Robinson <crobinso@redhat.com>
+Contributed-under: TianoCore Contribution Agreement 1.1
+Signed-off-by: Laszlo Ersek <lersek@redhat.com>
+Reviewed-by: Liming Gao <liming.gao@intel.com>
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport
+ BaseTools/Source/C/GenVtf/GenVtf.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/BaseTools/Source/C/GenVtf/GenVtf.c b/BaseTools/Source/C/GenVtf/GenVtf.c
+index 2ae9a7be2c..0cd33e71e9 100644
+--- a/BaseTools/Source/C/GenVtf/GenVtf.c
++++ b/BaseTools/Source/C/GenVtf/GenVtf.c
+@@ -129,9 +129,9 @@ Returns:
+ } else {
+ Length = strlen(Str);
+ if (Length < 4) {
+- strncpy (TemStr + 4 - Length, Str, Length);
++ memcpy (TemStr + 4 - Length, Str, Length);
+ } else {
+- strncpy (TemStr, Str + Length - 4, 4);
++ memcpy (TemStr, Str + Length - 4, 4);
+ }
+
+ sscanf (
+--
+2.17.0
+
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-enable-long-path-file.patch b/external/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-enable-long-path-file.patch
new file mode 100644
index 00000000..d954fbe3
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-enable-long-path-file.patch
@@ -0,0 +1,18 @@
+From 032fc6b1f7691bd537fd2a6bd13821fcf3c45e64 Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Mon, 11 Sep 2017 02:21:55 -0400
+Subject: [PATCH] ovmf: enable long path file
+
+Upstream-Status: Pending
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ BaseTools/Source/C/Common/CommonLib.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/BaseTools/Source/C/Common/CommonLib.h b/BaseTools/Source/C/Common/CommonLib.h
+index 2041b89e2d..8116aa2e35 100644
+--- a/BaseTools/Source/C/Common/CommonLib.h
++++ b/BaseTools/Source/C/Common/CommonLib.h
+@@ -22 +22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-#define MAX_LONG_FILE_PATH 500
++#define MAX_LONG_FILE_PATH 1023
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch b/external/poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch
new file mode 100644
index 00000000..3aa6cc4a
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch
@@ -0,0 +1,1124 @@
+From: Laszlo Ersek <lersek@redhat.com>
+Date: Mon, 6 Jul 2015 20:22:02 +0200
+Subject: [PATCH] OvmfPkg: EnrollDefaultKeys: application for enrolling default
+ keys
+
+(A port of the <https://bugzilla.redhat.com/show_bug.cgi?id=1148296> patch
+to Gerd's public RPMs.)
+
+This application is meant to be invoked by the management layer, after
+booting the UEFI shell and getting a shell prompt on the serial console.
+The app enrolls a number of certificates (see below), and then reports
+status to the serial console as well. The expected output is "info:
+success":
+
+> Shell> EnrollDefaultKeys.efi
+> info: SetupMode=1 SecureBoot=0 SecureBootEnable=0 CustomMode=0 VendorKeys=1
+> info: SetupMode=0 SecureBoot=1 SecureBootEnable=1 CustomMode=0 VendorKeys=0
+> info: success
+> Shell>
+
+In case of success, the management layer can force off or reboot the VM
+(for example with the "reset -s" or "reset -c" UEFI shell commands,
+respectively), and start the guest installation with SecureBoot enabled.
+
+PK:
+- A unique, static, ad-hoc certificate whose private half has been
+ destroyed (more precisely, never saved) and is therefore unusable for
+ signing. (The command for creating this certificate is saved in the
+ source code.)
+
+KEK:
+- same ad-hoc certificate as used for the PK,
+- "Microsoft Corporation KEK CA 2011" -- the dbx data in Fedora's dbxtool
+ package is signed (indirectly, through a chain) with this; enrolling
+ such a KEK should allow guests to install those updates.
+
+DB:
+- "Microsoft Windows Production PCA 2011" -- to load Windows 8 and Windows
+ Server 2012 R2,
+- "Microsoft Corporation UEFI CA 2011" -- to load Linux and signed PCI
+ oproms.
+
+Contributed-under: TianoCore Contribution Agreement 1.0
+Signed-off-by: Laszlo Ersek <lersek@redhat.com>
+Upstream-Status: Inappropriate [not author]
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c | 960 ++++++++++++++++++++++++
+ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf | 51 ++
+ OvmfPkg/OvmfPkgIa32.dsc | 4 +
+ OvmfPkg/OvmfPkgIa32X64.dsc | 4 +
+ OvmfPkg/OvmfPkgX64.dsc | 4 +
+ 5 files changed, 1023 insertions(+)
+ create mode 100644 OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+ create mode 100644 OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
+
+diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+new file mode 100644
+index 0000000..081212b
+--- /dev/null
++++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.c
+@@ -0,0 +1,960 @@
++/** @file
++ Enroll default PK, KEK, DB.
++
++ Copyright (C) 2014, Red Hat, Inc.
++
++ This program and the accompanying materials are licensed and made available
++ under the terms and conditions of the BSD License which accompanies this
++ distribution. The full text of the license may be found at
++ http://opensource.org/licenses/bsd-license.
++
++ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
++ WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
++**/
++#include <Guid/AuthenticatedVariableFormat.h> // gEfiCustomModeEnableGuid
++#include <Guid/GlobalVariable.h> // EFI_SETUP_MODE_NAME
++#include <Guid/ImageAuthentication.h> // EFI_IMAGE_SECURITY_DATABASE
++#include <Library/BaseMemoryLib.h> // CopyGuid()
++#include <Library/DebugLib.h> // ASSERT()
++#include <Library/MemoryAllocationLib.h> // FreePool()
++#include <Library/ShellCEntryLib.h> // ShellAppMain()
++#include <Library/UefiLib.h> // AsciiPrint()
++#include <Library/UefiRuntimeServicesTableLib.h> // gRT
++
++//
++// The example self-signed certificate below, which we'll use for both Platform
++// Key, and first Key Exchange Key, has been generated with the following
++// non-interactive openssl command. The passphrase is read from /dev/urandom,
++// and not saved, and the private key is written to /dev/null. In other words,
++// we can't sign anything else against this certificate, which is our purpose.
++//
++/*
++ openssl req \
++ -passout file:<(head -c 16 /dev/urandom) \
++ -x509 \
++ -newkey rsa:2048 \
++ -keyout /dev/null \
++ -outform DER \
++ -subj $(
++ printf /C=US
++ printf /ST=TestStateOrProvince
++ printf /L=TestLocality
++ printf /O=TestOrganization
++ printf /OU=TestOrganizationalUnit
++ printf /CN=TestCommonName
++ printf /emailAddress=test@example.com
++ ) \
++ 2>/dev/null \
++ | xxd -i
++*/
++STATIC CONST UINT8 ExampleCert[] = {
++ 0x30, 0x82, 0x04, 0x45, 0x30, 0x82, 0x03, 0x2d, 0xa0, 0x03, 0x02, 0x01, 0x02,
++ 0x02, 0x09, 0x00, 0xcf, 0x9f, 0x51, 0xa3, 0x07, 0xdb, 0x54, 0xa1, 0x30, 0x0d,
++ 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00,
++ 0x30, 0x81, 0xb8, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
++ 0x02, 0x55, 0x53, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c,
++ 0x13, 0x54, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x50,
++ 0x72, 0x6f, 0x76, 0x69, 0x6e, 0x63, 0x65, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03,
++ 0x55, 0x04, 0x07, 0x0c, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x63, 0x61,
++ 0x6c, 0x69, 0x74, 0x79, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0a,
++ 0x0c, 0x10, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a,
++ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04,
++ 0x0b, 0x0c, 0x16, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69,
++ 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x31,
++ 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0e, 0x54, 0x65, 0x73,
++ 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x31, 0x1f,
++ 0x30, 0x1d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01,
++ 0x16, 0x10, 0x74, 0x65, 0x73, 0x74, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c,
++ 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x34, 0x31, 0x30,
++ 0x30, 0x39, 0x31, 0x33, 0x32, 0x38, 0x32, 0x32, 0x5a, 0x17, 0x0d, 0x31, 0x34,
++ 0x31, 0x31, 0x30, 0x38, 0x31, 0x33, 0x32, 0x38, 0x32, 0x32, 0x5a, 0x30, 0x81,
++ 0xb8, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55,
++ 0x53, 0x31, 0x1c, 0x30, 0x1a, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0c, 0x13, 0x54,
++ 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x50, 0x72, 0x6f,
++ 0x76, 0x69, 0x6e, 0x63, 0x65, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
++ 0x07, 0x0c, 0x0c, 0x54, 0x65, 0x73, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x69,
++ 0x74, 0x79, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x10,
++ 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74,
++ 0x69, 0x6f, 0x6e, 0x31, 0x1f, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c,
++ 0x16, 0x54, 0x65, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61,
++ 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x31, 0x17, 0x30,
++ 0x15, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0e, 0x54, 0x65, 0x73, 0x74, 0x43,
++ 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x31, 0x1f, 0x30, 0x1d,
++ 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x10,
++ 0x74, 0x65, 0x73, 0x74, 0x40, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
++ 0x63, 0x6f, 0x6d, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
++ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f,
++ 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xbf, 0xf1, 0xce,
++ 0x17, 0x32, 0xac, 0xc4, 0x4b, 0xb2, 0xed, 0x84, 0x76, 0xe5, 0xd0, 0xf8, 0x21,
++ 0xac, 0x10, 0xf8, 0x18, 0x09, 0x0e, 0x07, 0x13, 0x76, 0x21, 0x5c, 0xc4, 0xcc,
++ 0xd5, 0xe6, 0x25, 0xa7, 0x26, 0x53, 0x79, 0x2f, 0x16, 0x4b, 0x85, 0xbd, 0xae,
++ 0x42, 0x64, 0x58, 0xcb, 0x5e, 0xe8, 0x6e, 0x5a, 0xd0, 0xc4, 0x0f, 0x38, 0x16,
++ 0xbe, 0xd3, 0x22, 0xa7, 0x3c, 0x9b, 0x8b, 0x5e, 0xcb, 0x62, 0x35, 0xc5, 0x9b,
++ 0xe2, 0x8e, 0x4c, 0x65, 0x57, 0x4f, 0xcb, 0x27, 0xad, 0xe7, 0x63, 0xa7, 0x77,
++ 0x2b, 0xd5, 0x02, 0x42, 0x70, 0x46, 0xac, 0xba, 0xb6, 0x60, 0x57, 0xd9, 0xce,
++ 0x31, 0xc5, 0x12, 0x03, 0x4a, 0xf7, 0x2a, 0x2b, 0x40, 0x06, 0xb4, 0xdb, 0x31,
++ 0xb7, 0x83, 0x6c, 0x67, 0x87, 0x98, 0x8b, 0xce, 0x1b, 0x30, 0x7a, 0xfa, 0x35,
++ 0x6c, 0x86, 0x20, 0x74, 0xc5, 0x7d, 0x32, 0x31, 0x18, 0xeb, 0x69, 0xf7, 0x2d,
++ 0x20, 0xc4, 0xf0, 0xd2, 0xfa, 0x67, 0x81, 0xc1, 0xbb, 0x23, 0xbb, 0x75, 0x1a,
++ 0xe4, 0xb4, 0x49, 0x99, 0xdf, 0x12, 0x4c, 0xe3, 0x6d, 0x76, 0x24, 0x85, 0x24,
++ 0xae, 0x5a, 0x9e, 0xbd, 0x54, 0x1c, 0xf9, 0x0e, 0xed, 0x96, 0xb5, 0xd8, 0xa2,
++ 0x0d, 0x2a, 0x38, 0x5d, 0x12, 0x97, 0xb0, 0x4d, 0x75, 0x85, 0x1e, 0x47, 0x6d,
++ 0xe1, 0x25, 0x59, 0xcb, 0xe9, 0x33, 0x86, 0x6a, 0xef, 0x98, 0x24, 0xa0, 0x2b,
++ 0x02, 0x7b, 0xc0, 0x9f, 0x88, 0x03, 0xb0, 0xbe, 0x22, 0x65, 0x83, 0x77, 0xb3,
++ 0x30, 0xba, 0xe0, 0x3b, 0x54, 0x31, 0x3a, 0x45, 0x81, 0x9c, 0x48, 0xaf, 0xc1,
++ 0x11, 0x5b, 0xf2, 0x3a, 0x1e, 0x33, 0x1b, 0x8f, 0x0e, 0x04, 0xa4, 0x16, 0xd4,
++ 0x6b, 0x57, 0xee, 0xe7, 0xba, 0xf5, 0xee, 0xaf, 0xe2, 0x4c, 0x50, 0xf8, 0x68,
++ 0x57, 0x88, 0xfb, 0x7f, 0xa3, 0xcf, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x50,
++ 0x30, 0x4e, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14,
++ 0x1e, 0x44, 0xe5, 0xef, 0xcd, 0x6e, 0x1f, 0xdb, 0xcb, 0x4f, 0x94, 0x8f, 0xe3,
++ 0x3b, 0x1a, 0x8c, 0xe6, 0x95, 0x29, 0x61, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d,
++ 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x1e, 0x44, 0xe5, 0xef, 0xcd, 0x6e,
++ 0x1f, 0xdb, 0xcb, 0x4f, 0x94, 0x8f, 0xe3, 0x3b, 0x1a, 0x8c, 0xe6, 0x95, 0x29,
++ 0x61, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01,
++ 0x01, 0xff, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
++ 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x12, 0x9c, 0x3e, 0x38,
++ 0xfc, 0x26, 0xea, 0x6d, 0xb7, 0x5c, 0x29, 0x3c, 0x76, 0x20, 0x0c, 0xb2, 0xa9,
++ 0x0f, 0xdf, 0xc0, 0x85, 0xfe, 0xeb, 0xec, 0x1d, 0x5d, 0x73, 0x84, 0xac, 0x8a,
++ 0xb4, 0x2a, 0x86, 0x38, 0x30, 0xaf, 0xd2, 0x2d, 0x2a, 0xde, 0x54, 0xc8, 0x5c,
++ 0x29, 0x90, 0x24, 0xf2, 0x39, 0xc1, 0xa5, 0x00, 0xb4, 0xb7, 0xd8, 0xdc, 0x59,
++ 0x64, 0x50, 0x62, 0x5f, 0x54, 0xf1, 0x73, 0x02, 0x4d, 0x43, 0xc5, 0xc3, 0xc4,
++ 0x0e, 0x62, 0x60, 0x8c, 0x53, 0x66, 0x57, 0x77, 0xb5, 0x81, 0xda, 0x1f, 0x81,
++ 0xda, 0xe9, 0xd6, 0x5e, 0x82, 0xce, 0xa7, 0x5c, 0xc0, 0xa6, 0xbe, 0x9c, 0x5c,
++ 0x7b, 0xa5, 0x15, 0xc8, 0xd7, 0x14, 0x53, 0xd3, 0x5c, 0x1c, 0x9f, 0x8a, 0x9f,
++ 0x66, 0x15, 0xd5, 0xd3, 0x2a, 0x27, 0x0c, 0xee, 0x9f, 0x80, 0x39, 0x88, 0x7b,
++ 0x24, 0xde, 0x0c, 0x61, 0xa3, 0x44, 0xd8, 0x8d, 0x2e, 0x79, 0xf8, 0x1e, 0x04,
++ 0x5a, 0xcb, 0xd6, 0x9c, 0xa3, 0x22, 0x8f, 0x09, 0x32, 0x1e, 0xe1, 0x65, 0x8f,
++ 0x10, 0x5f, 0xd8, 0x52, 0x56, 0xd5, 0x77, 0xac, 0x58, 0x46, 0x60, 0xba, 0x2e,
++ 0xe2, 0x3f, 0x58, 0x7d, 0x60, 0xfc, 0x31, 0x4a, 0x3a, 0xaf, 0x61, 0x55, 0x5f,
++ 0xfb, 0x68, 0x14, 0x74, 0xda, 0xdc, 0x42, 0x78, 0xcc, 0xee, 0xff, 0x5c, 0x03,
++ 0x24, 0x26, 0x2c, 0xb8, 0x3a, 0x81, 0xad, 0xdb, 0xe7, 0xed, 0xe1, 0x62, 0x84,
++ 0x07, 0x1a, 0xc8, 0xa4, 0x4e, 0xb0, 0x87, 0xf7, 0x96, 0xd8, 0x33, 0x9b, 0x0d,
++ 0xa7, 0x77, 0xae, 0x5b, 0xaf, 0xad, 0xe6, 0x5a, 0xc9, 0xfa, 0xa4, 0xe4, 0xe5,
++ 0x57, 0xbb, 0x97, 0xdd, 0x92, 0x85, 0xd8, 0x03, 0x45, 0xfe, 0xd8, 0x6b, 0xb1,
++ 0xdb, 0x85, 0x36, 0xb9, 0xd9, 0x28, 0xbf, 0x17, 0xae, 0x11, 0xde, 0x10, 0x19,
++ 0x26, 0x5b, 0xc0, 0x3d, 0xc7
++};
++
++//
++// Second KEK: "Microsoft Corporation KEK CA 2011".
++// SHA1: 31:59:0b:fd:89:c9:d7:4e:d0:87:df:ac:66:33:4b:39:31:25:4b:30
++//
++// "dbx" updates in "dbxtool" are signed with a key derived from this KEK.
++//
++STATIC CONST UINT8 MicrosoftKEK[] = {
++ 0x30, 0x82, 0x05, 0xe8, 0x30, 0x82, 0x03, 0xd0, 0xa0, 0x03, 0x02, 0x01, 0x02,
++ 0x02, 0x0a, 0x61, 0x0a, 0xd1, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30,
++ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
++ 0x00, 0x30, 0x81, 0x91, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
++ 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
++ 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31,
++ 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64,
++ 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a,
++ 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43,
++ 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x3b, 0x30,
++ 0x39, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x32, 0x4d, 0x69, 0x63, 0x72, 0x6f,
++ 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74,
++ 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x68, 0x69, 0x72, 0x64, 0x20, 0x50, 0x61, 0x72,
++ 0x74, 0x79, 0x20, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63,
++ 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30,
++ 0x36, 0x32, 0x34, 0x32, 0x30, 0x34, 0x31, 0x32, 0x39, 0x5a, 0x17, 0x0d, 0x32,
++ 0x36, 0x30, 0x36, 0x32, 0x34, 0x32, 0x30, 0x35, 0x31, 0x32, 0x39, 0x5a, 0x30,
++ 0x81, 0x80, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
++ 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a,
++ 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31, 0x10, 0x30,
++ 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64, 0x6d, 0x6f,
++ 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x15,
++ 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72,
++ 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x2a, 0x30, 0x28, 0x06,
++ 0x03, 0x55, 0x04, 0x03, 0x13, 0x21, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f,
++ 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f,
++ 0x6e, 0x20, 0x4b, 0x45, 0x4b, 0x20, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31, 0x31,
++ 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
++ 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82,
++ 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xc4, 0xe8, 0xb5, 0x8a, 0xbf, 0xad,
++ 0x57, 0x26, 0xb0, 0x26, 0xc3, 0xea, 0xe7, 0xfb, 0x57, 0x7a, 0x44, 0x02, 0x5d,
++ 0x07, 0x0d, 0xda, 0x4a, 0xe5, 0x74, 0x2a, 0xe6, 0xb0, 0x0f, 0xec, 0x6d, 0xeb,
++ 0xec, 0x7f, 0xb9, 0xe3, 0x5a, 0x63, 0x32, 0x7c, 0x11, 0x17, 0x4f, 0x0e, 0xe3,
++ 0x0b, 0xa7, 0x38, 0x15, 0x93, 0x8e, 0xc6, 0xf5, 0xe0, 0x84, 0xb1, 0x9a, 0x9b,
++ 0x2c, 0xe7, 0xf5, 0xb7, 0x91, 0xd6, 0x09, 0xe1, 0xe2, 0xc0, 0x04, 0xa8, 0xac,
++ 0x30, 0x1c, 0xdf, 0x48, 0xf3, 0x06, 0x50, 0x9a, 0x64, 0xa7, 0x51, 0x7f, 0xc8,
++ 0x85, 0x4f, 0x8f, 0x20, 0x86, 0xce, 0xfe, 0x2f, 0xe1, 0x9f, 0xff, 0x82, 0xc0,
++ 0xed, 0xe9, 0xcd, 0xce, 0xf4, 0x53, 0x6a, 0x62, 0x3a, 0x0b, 0x43, 0xb9, 0xe2,
++ 0x25, 0xfd, 0xfe, 0x05, 0xf9, 0xd4, 0xc4, 0x14, 0xab, 0x11, 0xe2, 0x23, 0x89,
++ 0x8d, 0x70, 0xb7, 0xa4, 0x1d, 0x4d, 0xec, 0xae, 0xe5, 0x9c, 0xfa, 0x16, 0xc2,
++ 0xd7, 0xc1, 0xcb, 0xd4, 0xe8, 0xc4, 0x2f, 0xe5, 0x99, 0xee, 0x24, 0x8b, 0x03,
++ 0xec, 0x8d, 0xf2, 0x8b, 0xea, 0xc3, 0x4a, 0xfb, 0x43, 0x11, 0x12, 0x0b, 0x7e,
++ 0xb5, 0x47, 0x92, 0x6c, 0xdc, 0xe6, 0x04, 0x89, 0xeb, 0xf5, 0x33, 0x04, 0xeb,
++ 0x10, 0x01, 0x2a, 0x71, 0xe5, 0xf9, 0x83, 0x13, 0x3c, 0xff, 0x25, 0x09, 0x2f,
++ 0x68, 0x76, 0x46, 0xff, 0xba, 0x4f, 0xbe, 0xdc, 0xad, 0x71, 0x2a, 0x58, 0xaa,
++ 0xfb, 0x0e, 0xd2, 0x79, 0x3d, 0xe4, 0x9b, 0x65, 0x3b, 0xcc, 0x29, 0x2a, 0x9f,
++ 0xfc, 0x72, 0x59, 0xa2, 0xeb, 0xae, 0x92, 0xef, 0xf6, 0x35, 0x13, 0x80, 0xc6,
++ 0x02, 0xec, 0xe4, 0x5f, 0xcc, 0x9d, 0x76, 0xcd, 0xef, 0x63, 0x92, 0xc1, 0xaf,
++ 0x79, 0x40, 0x84, 0x79, 0x87, 0x7f, 0xe3, 0x52, 0xa8, 0xe8, 0x9d, 0x7b, 0x07,
++ 0x69, 0x8f, 0x15, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x4f, 0x30,
++ 0x82, 0x01, 0x4b, 0x30, 0x10, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82,
++ 0x37, 0x15, 0x01, 0x04, 0x03, 0x02, 0x01, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55,
++ 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x62, 0xfc, 0x43, 0xcd, 0xa0, 0x3e, 0xa4,
++ 0xcb, 0x67, 0x12, 0xd2, 0x5b, 0xd9, 0x55, 0xac, 0x7b, 0xcc, 0xb6, 0x8a, 0x5f,
++ 0x30, 0x19, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02,
++ 0x04, 0x0c, 0x1e, 0x0a, 0x00, 0x53, 0x00, 0x75, 0x00, 0x62, 0x00, 0x43, 0x00,
++ 0x41, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01,
++ 0x86, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05,
++ 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04,
++ 0x18, 0x30, 0x16, 0x80, 0x14, 0x45, 0x66, 0x52, 0x43, 0xe1, 0x7e, 0x58, 0x11,
++ 0xbf, 0xd6, 0x4e, 0x9e, 0x23, 0x55, 0x08, 0x3b, 0x3a, 0x22, 0x6a, 0xa8, 0x30,
++ 0x5c, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x55, 0x30, 0x53, 0x30, 0x51, 0xa0,
++ 0x4f, 0xa0, 0x4d, 0x86, 0x4b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63,
++ 0x72, 0x6c, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e,
++ 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x72, 0x6c, 0x2f, 0x70,
++ 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43, 0x6f,
++ 0x72, 0x54, 0x68, 0x69, 0x50, 0x61, 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f, 0x6f,
++ 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e, 0x63,
++ 0x72, 0x6c, 0x30, 0x60, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01,
++ 0x01, 0x04, 0x54, 0x30, 0x52, 0x30, 0x50, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05,
++ 0x05, 0x07, 0x30, 0x02, 0x86, 0x44, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
++ 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
++ 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x74,
++ 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43, 0x6f, 0x72, 0x54, 0x68, 0x69, 0x50, 0x61,
++ 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f, 0x6f, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d,
++ 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06, 0x09,
++ 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82,
++ 0x02, 0x01, 0x00, 0xd4, 0x84, 0x88, 0xf5, 0x14, 0x94, 0x18, 0x02, 0xca, 0x2a,
++ 0x3c, 0xfb, 0x2a, 0x92, 0x1c, 0x0c, 0xd7, 0xa0, 0xd1, 0xf1, 0xe8, 0x52, 0x66,
++ 0xa8, 0xee, 0xa2, 0xb5, 0x75, 0x7a, 0x90, 0x00, 0xaa, 0x2d, 0xa4, 0x76, 0x5a,
++ 0xea, 0x79, 0xb7, 0xb9, 0x37, 0x6a, 0x51, 0x7b, 0x10, 0x64, 0xf6, 0xe1, 0x64,
++ 0xf2, 0x02, 0x67, 0xbe, 0xf7, 0xa8, 0x1b, 0x78, 0xbd, 0xba, 0xce, 0x88, 0x58,
++ 0x64, 0x0c, 0xd6, 0x57, 0xc8, 0x19, 0xa3, 0x5f, 0x05, 0xd6, 0xdb, 0xc6, 0xd0,
++ 0x69, 0xce, 0x48, 0x4b, 0x32, 0xb7, 0xeb, 0x5d, 0xd2, 0x30, 0xf5, 0xc0, 0xf5,
++ 0xb8, 0xba, 0x78, 0x07, 0xa3, 0x2b, 0xfe, 0x9b, 0xdb, 0x34, 0x56, 0x84, 0xec,
++ 0x82, 0xca, 0xae, 0x41, 0x25, 0x70, 0x9c, 0x6b, 0xe9, 0xfe, 0x90, 0x0f, 0xd7,
++ 0x96, 0x1f, 0xe5, 0xe7, 0x94, 0x1f, 0xb2, 0x2a, 0x0c, 0x8d, 0x4b, 0xff, 0x28,
++ 0x29, 0x10, 0x7b, 0xf7, 0xd7, 0x7c, 0xa5, 0xd1, 0x76, 0xb9, 0x05, 0xc8, 0x79,
++ 0xed, 0x0f, 0x90, 0x92, 0x9c, 0xc2, 0xfe, 0xdf, 0x6f, 0x7e, 0x6c, 0x0f, 0x7b,
++ 0xd4, 0xc1, 0x45, 0xdd, 0x34, 0x51, 0x96, 0x39, 0x0f, 0xe5, 0x5e, 0x56, 0xd8,
++ 0x18, 0x05, 0x96, 0xf4, 0x07, 0xa6, 0x42, 0xb3, 0xa0, 0x77, 0xfd, 0x08, 0x19,
++ 0xf2, 0x71, 0x56, 0xcc, 0x9f, 0x86, 0x23, 0xa4, 0x87, 0xcb, 0xa6, 0xfd, 0x58,
++ 0x7e, 0xd4, 0x69, 0x67, 0x15, 0x91, 0x7e, 0x81, 0xf2, 0x7f, 0x13, 0xe5, 0x0d,
++ 0x8b, 0x8a, 0x3c, 0x87, 0x84, 0xeb, 0xe3, 0xce, 0xbd, 0x43, 0xe5, 0xad, 0x2d,
++ 0x84, 0x93, 0x8e, 0x6a, 0x2b, 0x5a, 0x7c, 0x44, 0xfa, 0x52, 0xaa, 0x81, 0xc8,
++ 0x2d, 0x1c, 0xbb, 0xe0, 0x52, 0xdf, 0x00, 0x11, 0xf8, 0x9a, 0x3d, 0xc1, 0x60,
++ 0xb0, 0xe1, 0x33, 0xb5, 0xa3, 0x88, 0xd1, 0x65, 0x19, 0x0a, 0x1a, 0xe7, 0xac,
++ 0x7c, 0xa4, 0xc1, 0x82, 0x87, 0x4e, 0x38, 0xb1, 0x2f, 0x0d, 0xc5, 0x14, 0x87,
++ 0x6f, 0xfd, 0x8d, 0x2e, 0xbc, 0x39, 0xb6, 0xe7, 0xe6, 0xc3, 0xe0, 0xe4, 0xcd,
++ 0x27, 0x84, 0xef, 0x94, 0x42, 0xef, 0x29, 0x8b, 0x90, 0x46, 0x41, 0x3b, 0x81,
++ 0x1b, 0x67, 0xd8, 0xf9, 0x43, 0x59, 0x65, 0xcb, 0x0d, 0xbc, 0xfd, 0x00, 0x92,
++ 0x4f, 0xf4, 0x75, 0x3b, 0xa7, 0xa9, 0x24, 0xfc, 0x50, 0x41, 0x40, 0x79, 0xe0,
++ 0x2d, 0x4f, 0x0a, 0x6a, 0x27, 0x76, 0x6e, 0x52, 0xed, 0x96, 0x69, 0x7b, 0xaf,
++ 0x0f, 0xf7, 0x87, 0x05, 0xd0, 0x45, 0xc2, 0xad, 0x53, 0x14, 0x81, 0x1f, 0xfb,
++ 0x30, 0x04, 0xaa, 0x37, 0x36, 0x61, 0xda, 0x4a, 0x69, 0x1b, 0x34, 0xd8, 0x68,
++ 0xed, 0xd6, 0x02, 0xcf, 0x6c, 0x94, 0x0c, 0xd3, 0xcf, 0x6c, 0x22, 0x79, 0xad,
++ 0xb1, 0xf0, 0xbc, 0x03, 0xa2, 0x46, 0x60, 0xa9, 0xc4, 0x07, 0xc2, 0x21, 0x82,
++ 0xf1, 0xfd, 0xf2, 0xe8, 0x79, 0x32, 0x60, 0xbf, 0xd8, 0xac, 0xa5, 0x22, 0x14,
++ 0x4b, 0xca, 0xc1, 0xd8, 0x4b, 0xeb, 0x7d, 0x3f, 0x57, 0x35, 0xb2, 0xe6, 0x4f,
++ 0x75, 0xb4, 0xb0, 0x60, 0x03, 0x22, 0x53, 0xae, 0x91, 0x79, 0x1d, 0xd6, 0x9b,
++ 0x41, 0x1f, 0x15, 0x86, 0x54, 0x70, 0xb2, 0xde, 0x0d, 0x35, 0x0f, 0x7c, 0xb0,
++ 0x34, 0x72, 0xba, 0x97, 0x60, 0x3b, 0xf0, 0x79, 0xeb, 0xa2, 0xb2, 0x1c, 0x5d,
++ 0xa2, 0x16, 0xb8, 0x87, 0xc5, 0xe9, 0x1b, 0xf6, 0xb5, 0x97, 0x25, 0x6f, 0x38,
++ 0x9f, 0xe3, 0x91, 0xfa, 0x8a, 0x79, 0x98, 0xc3, 0x69, 0x0e, 0xb7, 0xa3, 0x1c,
++ 0x20, 0x05, 0x97, 0xf8, 0xca, 0x14, 0xae, 0x00, 0xd7, 0xc4, 0xf3, 0xc0, 0x14,
++ 0x10, 0x75, 0x6b, 0x34, 0xa0, 0x1b, 0xb5, 0x99, 0x60, 0xf3, 0x5c, 0xb0, 0xc5,
++ 0x57, 0x4e, 0x36, 0xd2, 0x32, 0x84, 0xbf, 0x9e
++};
++
++//
++// First DB entry: "Microsoft Windows Production PCA 2011"
++// SHA1: 58:0a:6f:4c:c4:e4:b6:69:b9:eb:dc:1b:2b:3e:08:7b:80:d0:67:8d
++//
++// Windows 8 and Windows Server 2012 R2 boot loaders are signed with a chain
++// rooted in this certificate.
++//
++STATIC CONST UINT8 MicrosoftPCA[] = {
++ 0x30, 0x82, 0x05, 0xd7, 0x30, 0x82, 0x03, 0xbf, 0xa0, 0x03, 0x02, 0x01, 0x02,
++ 0x02, 0x0a, 0x61, 0x07, 0x76, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x30,
++ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
++ 0x00, 0x30, 0x81, 0x88, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
++ 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
++ 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31,
++ 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64,
++ 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a,
++ 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43,
++ 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x32, 0x30,
++ 0x30, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x29, 0x4d, 0x69, 0x63, 0x72, 0x6f,
++ 0x73, 0x6f, 0x66, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72,
++ 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68,
++ 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x32, 0x30, 0x31, 0x30, 0x30, 0x1e, 0x17,
++ 0x0d, 0x31, 0x31, 0x31, 0x30, 0x31, 0x39, 0x31, 0x38, 0x34, 0x31, 0x34, 0x32,
++ 0x5a, 0x17, 0x0d, 0x32, 0x36, 0x31, 0x30, 0x31, 0x39, 0x31, 0x38, 0x35, 0x31,
++ 0x34, 0x32, 0x5a, 0x30, 0x81, 0x84, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55,
++ 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
++ 0x04, 0x08, 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f,
++ 0x6e, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52,
++ 0x65, 0x64, 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55,
++ 0x04, 0x0a, 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
++ 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31,
++ 0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x25, 0x4d, 0x69, 0x63,
++ 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
++ 0x73, 0x20, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
++ 0x50, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31, 0x31, 0x30, 0x82, 0x01, 0x22, 0x30,
++ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05,
++ 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01,
++ 0x01, 0x00, 0xdd, 0x0c, 0xbb, 0xa2, 0xe4, 0x2e, 0x09, 0xe3, 0xe7, 0xc5, 0xf7,
++ 0x96, 0x69, 0xbc, 0x00, 0x21, 0xbd, 0x69, 0x33, 0x33, 0xef, 0xad, 0x04, 0xcb,
++ 0x54, 0x80, 0xee, 0x06, 0x83, 0xbb, 0xc5, 0x20, 0x84, 0xd9, 0xf7, 0xd2, 0x8b,
++ 0xf3, 0x38, 0xb0, 0xab, 0xa4, 0xad, 0x2d, 0x7c, 0x62, 0x79, 0x05, 0xff, 0xe3,
++ 0x4a, 0x3f, 0x04, 0x35, 0x20, 0x70, 0xe3, 0xc4, 0xe7, 0x6b, 0xe0, 0x9c, 0xc0,
++ 0x36, 0x75, 0xe9, 0x8a, 0x31, 0xdd, 0x8d, 0x70, 0xe5, 0xdc, 0x37, 0xb5, 0x74,
++ 0x46, 0x96, 0x28, 0x5b, 0x87, 0x60, 0x23, 0x2c, 0xbf, 0xdc, 0x47, 0xa5, 0x67,
++ 0xf7, 0x51, 0x27, 0x9e, 0x72, 0xeb, 0x07, 0xa6, 0xc9, 0xb9, 0x1e, 0x3b, 0x53,
++ 0x35, 0x7c, 0xe5, 0xd3, 0xec, 0x27, 0xb9, 0x87, 0x1c, 0xfe, 0xb9, 0xc9, 0x23,
++ 0x09, 0x6f, 0xa8, 0x46, 0x91, 0xc1, 0x6e, 0x96, 0x3c, 0x41, 0xd3, 0xcb, 0xa3,
++ 0x3f, 0x5d, 0x02, 0x6a, 0x4d, 0xec, 0x69, 0x1f, 0x25, 0x28, 0x5c, 0x36, 0xff,
++ 0xfd, 0x43, 0x15, 0x0a, 0x94, 0xe0, 0x19, 0xb4, 0xcf, 0xdf, 0xc2, 0x12, 0xe2,
++ 0xc2, 0x5b, 0x27, 0xee, 0x27, 0x78, 0x30, 0x8b, 0x5b, 0x2a, 0x09, 0x6b, 0x22,
++ 0x89, 0x53, 0x60, 0x16, 0x2c, 0xc0, 0x68, 0x1d, 0x53, 0xba, 0xec, 0x49, 0xf3,
++ 0x9d, 0x61, 0x8c, 0x85, 0x68, 0x09, 0x73, 0x44, 0x5d, 0x7d, 0xa2, 0x54, 0x2b,
++ 0xdd, 0x79, 0xf7, 0x15, 0xcf, 0x35, 0x5d, 0x6c, 0x1c, 0x2b, 0x5c, 0xce, 0xbc,
++ 0x9c, 0x23, 0x8b, 0x6f, 0x6e, 0xb5, 0x26, 0xd9, 0x36, 0x13, 0xc3, 0x4f, 0xd6,
++ 0x27, 0xae, 0xb9, 0x32, 0x3b, 0x41, 0x92, 0x2c, 0xe1, 0xc7, 0xcd, 0x77, 0xe8,
++ 0xaa, 0x54, 0x4e, 0xf7, 0x5c, 0x0b, 0x04, 0x87, 0x65, 0xb4, 0x43, 0x18, 0xa8,
++ 0xb2, 0xe0, 0x6d, 0x19, 0x77, 0xec, 0x5a, 0x24, 0xfa, 0x48, 0x03, 0x02, 0x03,
++ 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x43, 0x30, 0x82, 0x01, 0x3f, 0x30, 0x10,
++ 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x15, 0x01, 0x04, 0x03,
++ 0x02, 0x01, 0x00, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04,
++ 0x14, 0xa9, 0x29, 0x02, 0x39, 0x8e, 0x16, 0xc4, 0x97, 0x78, 0xcd, 0x90, 0xf9,
++ 0x9e, 0x4f, 0x9a, 0xe1, 0x7c, 0x55, 0xaf, 0x53, 0x30, 0x19, 0x06, 0x09, 0x2b,
++ 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02, 0x04, 0x0c, 0x1e, 0x0a, 0x00,
++ 0x53, 0x00, 0x75, 0x00, 0x62, 0x00, 0x43, 0x00, 0x41, 0x30, 0x0b, 0x06, 0x03,
++ 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x0f, 0x06, 0x03,
++ 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff,
++ 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14,
++ 0xd5, 0xf6, 0x56, 0xcb, 0x8f, 0xe8, 0xa2, 0x5c, 0x62, 0x68, 0xd1, 0x3d, 0x94,
++ 0x90, 0x5b, 0xd7, 0xce, 0x9a, 0x18, 0xc4, 0x30, 0x56, 0x06, 0x03, 0x55, 0x1d,
++ 0x1f, 0x04, 0x4f, 0x30, 0x4d, 0x30, 0x4b, 0xa0, 0x49, 0xa0, 0x47, 0x86, 0x45,
++ 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x63, 0x72, 0x6c, 0x2e, 0x6d, 0x69,
++ 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70,
++ 0x6b, 0x69, 0x2f, 0x63, 0x72, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
++ 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x52, 0x6f, 0x6f, 0x43, 0x65, 0x72, 0x41,
++ 0x75, 0x74, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x30, 0x36, 0x2d, 0x32, 0x33,
++ 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x5a, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05,
++ 0x07, 0x01, 0x01, 0x04, 0x4e, 0x30, 0x4c, 0x30, 0x4a, 0x06, 0x08, 0x2b, 0x06,
++ 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x3e, 0x68, 0x74, 0x74, 0x70, 0x3a,
++ 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f,
++ 0x66, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x65,
++ 0x72, 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x52, 0x6f, 0x6f, 0x43, 0x65, 0x72,
++ 0x41, 0x75, 0x74, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x30, 0x36, 0x2d, 0x32,
++ 0x33, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
++ 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x02, 0x01, 0x00, 0x14,
++ 0xfc, 0x7c, 0x71, 0x51, 0xa5, 0x79, 0xc2, 0x6e, 0xb2, 0xef, 0x39, 0x3e, 0xbc,
++ 0x3c, 0x52, 0x0f, 0x6e, 0x2b, 0x3f, 0x10, 0x13, 0x73, 0xfe, 0xa8, 0x68, 0xd0,
++ 0x48, 0xa6, 0x34, 0x4d, 0x8a, 0x96, 0x05, 0x26, 0xee, 0x31, 0x46, 0x90, 0x61,
++ 0x79, 0xd6, 0xff, 0x38, 0x2e, 0x45, 0x6b, 0xf4, 0xc0, 0xe5, 0x28, 0xb8, 0xda,
++ 0x1d, 0x8f, 0x8a, 0xdb, 0x09, 0xd7, 0x1a, 0xc7, 0x4c, 0x0a, 0x36, 0x66, 0x6a,
++ 0x8c, 0xec, 0x1b, 0xd7, 0x04, 0x90, 0xa8, 0x18, 0x17, 0xa4, 0x9b, 0xb9, 0xe2,
++ 0x40, 0x32, 0x36, 0x76, 0xc4, 0xc1, 0x5a, 0xc6, 0xbf, 0xe4, 0x04, 0xc0, 0xea,
++ 0x16, 0xd3, 0xac, 0xc3, 0x68, 0xef, 0x62, 0xac, 0xdd, 0x54, 0x6c, 0x50, 0x30,
++ 0x58, 0xa6, 0xeb, 0x7c, 0xfe, 0x94, 0xa7, 0x4e, 0x8e, 0xf4, 0xec, 0x7c, 0x86,
++ 0x73, 0x57, 0xc2, 0x52, 0x21, 0x73, 0x34, 0x5a, 0xf3, 0xa3, 0x8a, 0x56, 0xc8,
++ 0x04, 0xda, 0x07, 0x09, 0xed, 0xf8, 0x8b, 0xe3, 0xce, 0xf4, 0x7e, 0x8e, 0xae,
++ 0xf0, 0xf6, 0x0b, 0x8a, 0x08, 0xfb, 0x3f, 0xc9, 0x1d, 0x72, 0x7f, 0x53, 0xb8,
++ 0xeb, 0xbe, 0x63, 0xe0, 0xe3, 0x3d, 0x31, 0x65, 0xb0, 0x81, 0xe5, 0xf2, 0xac,
++ 0xcd, 0x16, 0xa4, 0x9f, 0x3d, 0xa8, 0xb1, 0x9b, 0xc2, 0x42, 0xd0, 0x90, 0x84,
++ 0x5f, 0x54, 0x1d, 0xff, 0x89, 0xea, 0xba, 0x1d, 0x47, 0x90, 0x6f, 0xb0, 0x73,
++ 0x4e, 0x41, 0x9f, 0x40, 0x9f, 0x5f, 0xe5, 0xa1, 0x2a, 0xb2, 0x11, 0x91, 0x73,
++ 0x8a, 0x21, 0x28, 0xf0, 0xce, 0xde, 0x73, 0x39, 0x5f, 0x3e, 0xab, 0x5c, 0x60,
++ 0xec, 0xdf, 0x03, 0x10, 0xa8, 0xd3, 0x09, 0xe9, 0xf4, 0xf6, 0x96, 0x85, 0xb6,
++ 0x7f, 0x51, 0x88, 0x66, 0x47, 0x19, 0x8d, 0xa2, 0xb0, 0x12, 0x3d, 0x81, 0x2a,
++ 0x68, 0x05, 0x77, 0xbb, 0x91, 0x4c, 0x62, 0x7b, 0xb6, 0xc1, 0x07, 0xc7, 0xba,
++ 0x7a, 0x87, 0x34, 0x03, 0x0e, 0x4b, 0x62, 0x7a, 0x99, 0xe9, 0xca, 0xfc, 0xce,
++ 0x4a, 0x37, 0xc9, 0x2d, 0xa4, 0x57, 0x7c, 0x1c, 0xfe, 0x3d, 0xdc, 0xb8, 0x0f,
++ 0x5a, 0xfa, 0xd6, 0xc4, 0xb3, 0x02, 0x85, 0x02, 0x3a, 0xea, 0xb3, 0xd9, 0x6e,
++ 0xe4, 0x69, 0x21, 0x37, 0xde, 0x81, 0xd1, 0xf6, 0x75, 0x19, 0x05, 0x67, 0xd3,
++ 0x93, 0x57, 0x5e, 0x29, 0x1b, 0x39, 0xc8, 0xee, 0x2d, 0xe1, 0xcd, 0xe4, 0x45,
++ 0x73, 0x5b, 0xd0, 0xd2, 0xce, 0x7a, 0xab, 0x16, 0x19, 0x82, 0x46, 0x58, 0xd0,
++ 0x5e, 0x9d, 0x81, 0xb3, 0x67, 0xaf, 0x6c, 0x35, 0xf2, 0xbc, 0xe5, 0x3f, 0x24,
++ 0xe2, 0x35, 0xa2, 0x0a, 0x75, 0x06, 0xf6, 0x18, 0x56, 0x99, 0xd4, 0x78, 0x2c,
++ 0xd1, 0x05, 0x1b, 0xeb, 0xd0, 0x88, 0x01, 0x9d, 0xaa, 0x10, 0xf1, 0x05, 0xdf,
++ 0xba, 0x7e, 0x2c, 0x63, 0xb7, 0x06, 0x9b, 0x23, 0x21, 0xc4, 0xf9, 0x78, 0x6c,
++ 0xe2, 0x58, 0x17, 0x06, 0x36, 0x2b, 0x91, 0x12, 0x03, 0xcc, 0xa4, 0xd9, 0xf2,
++ 0x2d, 0xba, 0xf9, 0x94, 0x9d, 0x40, 0xed, 0x18, 0x45, 0xf1, 0xce, 0x8a, 0x5c,
++ 0x6b, 0x3e, 0xab, 0x03, 0xd3, 0x70, 0x18, 0x2a, 0x0a, 0x6a, 0xe0, 0x5f, 0x47,
++ 0xd1, 0xd5, 0x63, 0x0a, 0x32, 0xf2, 0xaf, 0xd7, 0x36, 0x1f, 0x2a, 0x70, 0x5a,
++ 0xe5, 0x42, 0x59, 0x08, 0x71, 0x4b, 0x57, 0xba, 0x7e, 0x83, 0x81, 0xf0, 0x21,
++ 0x3c, 0xf4, 0x1c, 0xc1, 0xc5, 0xb9, 0x90, 0x93, 0x0e, 0x88, 0x45, 0x93, 0x86,
++ 0xe9, 0xb1, 0x20, 0x99, 0xbe, 0x98, 0xcb, 0xc5, 0x95, 0xa4, 0x5d, 0x62, 0xd6,
++ 0xa0, 0x63, 0x08, 0x20, 0xbd, 0x75, 0x10, 0x77, 0x7d, 0x3d, 0xf3, 0x45, 0xb9,
++ 0x9f, 0x97, 0x9f, 0xcb, 0x57, 0x80, 0x6f, 0x33, 0xa9, 0x04, 0xcf, 0x77, 0xa4,
++ 0x62, 0x1c, 0x59, 0x7e
++};
++
++//
++// Second DB entry: "Microsoft Corporation UEFI CA 2011"
++// SHA1: 46:de:f6:3b:5c:e6:1c:f8:ba:0d:e2:e6:63:9c:10:19:d0:ed:14:f3
++//
++// To verify the "shim" binary and PCI expansion ROMs with.
++//
++STATIC CONST UINT8 MicrosoftUefiCA[] = {
++ 0x30, 0x82, 0x06, 0x10, 0x30, 0x82, 0x03, 0xf8, 0xa0, 0x03, 0x02, 0x01, 0x02,
++ 0x02, 0x0a, 0x61, 0x08, 0xd3, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x30,
++ 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05,
++ 0x00, 0x30, 0x81, 0x91, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
++ 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08,
++ 0x13, 0x0a, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31,
++ 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64,
++ 0x6d, 0x6f, 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a,
++ 0x13, 0x15, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43,
++ 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x3b, 0x30,
++ 0x39, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x32, 0x4d, 0x69, 0x63, 0x72, 0x6f,
++ 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74,
++ 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x68, 0x69, 0x72, 0x64, 0x20, 0x50, 0x61, 0x72,
++ 0x74, 0x79, 0x20, 0x4d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x70, 0x6c, 0x61, 0x63,
++ 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x31, 0x30,
++ 0x36, 0x32, 0x37, 0x32, 0x31, 0x32, 0x32, 0x34, 0x35, 0x5a, 0x17, 0x0d, 0x32,
++ 0x36, 0x30, 0x36, 0x32, 0x37, 0x32, 0x31, 0x33, 0x32, 0x34, 0x35, 0x5a, 0x30,
++ 0x81, 0x81, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
++ 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a,
++ 0x57, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x74, 0x6f, 0x6e, 0x31, 0x10, 0x30,
++ 0x0e, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x07, 0x52, 0x65, 0x64, 0x6d, 0x6f,
++ 0x6e, 0x64, 0x31, 0x1e, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x15,
++ 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72,
++ 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x31, 0x2b, 0x30, 0x29, 0x06,
++ 0x03, 0x55, 0x04, 0x03, 0x13, 0x22, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f,
++ 0x66, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f,
++ 0x6e, 0x20, 0x55, 0x45, 0x46, 0x49, 0x20, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31,
++ 0x31, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
++ 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30,
++ 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xa5, 0x08, 0x6c, 0x4c, 0xc7,
++ 0x45, 0x09, 0x6a, 0x4b, 0x0c, 0xa4, 0xc0, 0x87, 0x7f, 0x06, 0x75, 0x0c, 0x43,
++ 0x01, 0x54, 0x64, 0xe0, 0x16, 0x7f, 0x07, 0xed, 0x92, 0x7d, 0x0b, 0xb2, 0x73,
++ 0xbf, 0x0c, 0x0a, 0xc6, 0x4a, 0x45, 0x61, 0xa0, 0xc5, 0x16, 0x2d, 0x96, 0xd3,
++ 0xf5, 0x2b, 0xa0, 0xfb, 0x4d, 0x49, 0x9b, 0x41, 0x80, 0x90, 0x3c, 0xb9, 0x54,
++ 0xfd, 0xe6, 0xbc, 0xd1, 0x9d, 0xc4, 0xa4, 0x18, 0x8a, 0x7f, 0x41, 0x8a, 0x5c,
++ 0x59, 0x83, 0x68, 0x32, 0xbb, 0x8c, 0x47, 0xc9, 0xee, 0x71, 0xbc, 0x21, 0x4f,
++ 0x9a, 0x8a, 0x7c, 0xff, 0x44, 0x3f, 0x8d, 0x8f, 0x32, 0xb2, 0x26, 0x48, 0xae,
++ 0x75, 0xb5, 0xee, 0xc9, 0x4c, 0x1e, 0x4a, 0x19, 0x7e, 0xe4, 0x82, 0x9a, 0x1d,
++ 0x78, 0x77, 0x4d, 0x0c, 0xb0, 0xbd, 0xf6, 0x0f, 0xd3, 0x16, 0xd3, 0xbc, 0xfa,
++ 0x2b, 0xa5, 0x51, 0x38, 0x5d, 0xf5, 0xfb, 0xba, 0xdb, 0x78, 0x02, 0xdb, 0xff,
++ 0xec, 0x0a, 0x1b, 0x96, 0xd5, 0x83, 0xb8, 0x19, 0x13, 0xe9, 0xb6, 0xc0, 0x7b,
++ 0x40, 0x7b, 0xe1, 0x1f, 0x28, 0x27, 0xc9, 0xfa, 0xef, 0x56, 0x5e, 0x1c, 0xe6,
++ 0x7e, 0x94, 0x7e, 0xc0, 0xf0, 0x44, 0xb2, 0x79, 0x39, 0xe5, 0xda, 0xb2, 0x62,
++ 0x8b, 0x4d, 0xbf, 0x38, 0x70, 0xe2, 0x68, 0x24, 0x14, 0xc9, 0x33, 0xa4, 0x08,
++ 0x37, 0xd5, 0x58, 0x69, 0x5e, 0xd3, 0x7c, 0xed, 0xc1, 0x04, 0x53, 0x08, 0xe7,
++ 0x4e, 0xb0, 0x2a, 0x87, 0x63, 0x08, 0x61, 0x6f, 0x63, 0x15, 0x59, 0xea, 0xb2,
++ 0x2b, 0x79, 0xd7, 0x0c, 0x61, 0x67, 0x8a, 0x5b, 0xfd, 0x5e, 0xad, 0x87, 0x7f,
++ 0xba, 0x86, 0x67, 0x4f, 0x71, 0x58, 0x12, 0x22, 0x04, 0x22, 0x22, 0xce, 0x8b,
++ 0xef, 0x54, 0x71, 0x00, 0xce, 0x50, 0x35, 0x58, 0x76, 0x95, 0x08, 0xee, 0x6a,
++ 0xb1, 0xa2, 0x01, 0xd5, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, 0x76,
++ 0x30, 0x82, 0x01, 0x72, 0x30, 0x12, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01,
++ 0x82, 0x37, 0x15, 0x01, 0x04, 0x05, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x23,
++ 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x15, 0x02, 0x04, 0x16,
++ 0x04, 0x14, 0xf8, 0xc1, 0x6b, 0xb7, 0x7f, 0x77, 0x53, 0x4a, 0xf3, 0x25, 0x37,
++ 0x1d, 0x4e, 0xa1, 0x26, 0x7b, 0x0f, 0x20, 0x70, 0x80, 0x30, 0x1d, 0x06, 0x03,
++ 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x13, 0xad, 0xbf, 0x43, 0x09, 0xbd,
++ 0x82, 0x70, 0x9c, 0x8c, 0xd5, 0x4f, 0x31, 0x6e, 0xd5, 0x22, 0x98, 0x8a, 0x1b,
++ 0xd4, 0x30, 0x19, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14,
++ 0x02, 0x04, 0x0c, 0x1e, 0x0a, 0x00, 0x53, 0x00, 0x75, 0x00, 0x62, 0x00, 0x43,
++ 0x00, 0x41, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02,
++ 0x01, 0x86, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04,
++ 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23,
++ 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x45, 0x66, 0x52, 0x43, 0xe1, 0x7e, 0x58,
++ 0x11, 0xbf, 0xd6, 0x4e, 0x9e, 0x23, 0x55, 0x08, 0x3b, 0x3a, 0x22, 0x6a, 0xa8,
++ 0x30, 0x5c, 0x06, 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x55, 0x30, 0x53, 0x30, 0x51,
++ 0xa0, 0x4f, 0xa0, 0x4d, 0x86, 0x4b, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,
++ 0x63, 0x72, 0x6c, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
++ 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x72, 0x6c, 0x2f,
++ 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43,
++ 0x6f, 0x72, 0x54, 0x68, 0x69, 0x50, 0x61, 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f,
++ 0x6f, 0x5f, 0x32, 0x30, 0x31, 0x30, 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e,
++ 0x63, 0x72, 0x6c, 0x30, 0x60, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07,
++ 0x01, 0x01, 0x04, 0x54, 0x30, 0x52, 0x30, 0x50, 0x06, 0x08, 0x2b, 0x06, 0x01,
++ 0x05, 0x05, 0x07, 0x30, 0x02, 0x86, 0x44, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,
++ 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66,
++ 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x6b, 0x69, 0x2f, 0x63, 0x65, 0x72,
++ 0x74, 0x73, 0x2f, 0x4d, 0x69, 0x63, 0x43, 0x6f, 0x72, 0x54, 0x68, 0x69, 0x50,
++ 0x61, 0x72, 0x4d, 0x61, 0x72, 0x52, 0x6f, 0x6f, 0x5f, 0x32, 0x30, 0x31, 0x30,
++ 0x2d, 0x31, 0x30, 0x2d, 0x30, 0x35, 0x2e, 0x63, 0x72, 0x74, 0x30, 0x0d, 0x06,
++ 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03,
++ 0x82, 0x02, 0x01, 0x00, 0x35, 0x08, 0x42, 0xff, 0x30, 0xcc, 0xce, 0xf7, 0x76,
++ 0x0c, 0xad, 0x10, 0x68, 0x58, 0x35, 0x29, 0x46, 0x32, 0x76, 0x27, 0x7c, 0xef,
++ 0x12, 0x41, 0x27, 0x42, 0x1b, 0x4a, 0xaa, 0x6d, 0x81, 0x38, 0x48, 0x59, 0x13,
++ 0x55, 0xf3, 0xe9, 0x58, 0x34, 0xa6, 0x16, 0x0b, 0x82, 0xaa, 0x5d, 0xad, 0x82,
++ 0xda, 0x80, 0x83, 0x41, 0x06, 0x8f, 0xb4, 0x1d, 0xf2, 0x03, 0xb9, 0xf3, 0x1a,
++ 0x5d, 0x1b, 0xf1, 0x50, 0x90, 0xf9, 0xb3, 0x55, 0x84, 0x42, 0x28, 0x1c, 0x20,
++ 0xbd, 0xb2, 0xae, 0x51, 0x14, 0xc5, 0xc0, 0xac, 0x97, 0x95, 0x21, 0x1c, 0x90,
++ 0xdb, 0x0f, 0xfc, 0x77, 0x9e, 0x95, 0x73, 0x91, 0x88, 0xca, 0xbd, 0xbd, 0x52,
++ 0xb9, 0x05, 0x50, 0x0d, 0xdf, 0x57, 0x9e, 0xa0, 0x61, 0xed, 0x0d, 0xe5, 0x6d,
++ 0x25, 0xd9, 0x40, 0x0f, 0x17, 0x40, 0xc8, 0xce, 0xa3, 0x4a, 0xc2, 0x4d, 0xaf,
++ 0x9a, 0x12, 0x1d, 0x08, 0x54, 0x8f, 0xbd, 0xc7, 0xbc, 0xb9, 0x2b, 0x3d, 0x49,
++ 0x2b, 0x1f, 0x32, 0xfc, 0x6a, 0x21, 0x69, 0x4f, 0x9b, 0xc8, 0x7e, 0x42, 0x34,
++ 0xfc, 0x36, 0x06, 0x17, 0x8b, 0x8f, 0x20, 0x40, 0xc0, 0xb3, 0x9a, 0x25, 0x75,
++ 0x27, 0xcd, 0xc9, 0x03, 0xa3, 0xf6, 0x5d, 0xd1, 0xe7, 0x36, 0x54, 0x7a, 0xb9,
++ 0x50, 0xb5, 0xd3, 0x12, 0xd1, 0x07, 0xbf, 0xbb, 0x74, 0xdf, 0xdc, 0x1e, 0x8f,
++ 0x80, 0xd5, 0xed, 0x18, 0xf4, 0x2f, 0x14, 0x16, 0x6b, 0x2f, 0xde, 0x66, 0x8c,
++ 0xb0, 0x23, 0xe5, 0xc7, 0x84, 0xd8, 0xed, 0xea, 0xc1, 0x33, 0x82, 0xad, 0x56,
++ 0x4b, 0x18, 0x2d, 0xf1, 0x68, 0x95, 0x07, 0xcd, 0xcf, 0xf0, 0x72, 0xf0, 0xae,
++ 0xbb, 0xdd, 0x86, 0x85, 0x98, 0x2c, 0x21, 0x4c, 0x33, 0x2b, 0xf0, 0x0f, 0x4a,
++ 0xf0, 0x68, 0x87, 0xb5, 0x92, 0x55, 0x32, 0x75, 0xa1, 0x6a, 0x82, 0x6a, 0x3c,
++ 0xa3, 0x25, 0x11, 0xa4, 0xed, 0xad, 0xd7, 0x04, 0xae, 0xcb, 0xd8, 0x40, 0x59,
++ 0xa0, 0x84, 0xd1, 0x95, 0x4c, 0x62, 0x91, 0x22, 0x1a, 0x74, 0x1d, 0x8c, 0x3d,
++ 0x47, 0x0e, 0x44, 0xa6, 0xe4, 0xb0, 0x9b, 0x34, 0x35, 0xb1, 0xfa, 0xb6, 0x53,
++ 0xa8, 0x2c, 0x81, 0xec, 0xa4, 0x05, 0x71, 0xc8, 0x9d, 0xb8, 0xba, 0xe8, 0x1b,
++ 0x44, 0x66, 0xe4, 0x47, 0x54, 0x0e, 0x8e, 0x56, 0x7f, 0xb3, 0x9f, 0x16, 0x98,
++ 0xb2, 0x86, 0xd0, 0x68, 0x3e, 0x90, 0x23, 0xb5, 0x2f, 0x5e, 0x8f, 0x50, 0x85,
++ 0x8d, 0xc6, 0x8d, 0x82, 0x5f, 0x41, 0xa1, 0xf4, 0x2e, 0x0d, 0xe0, 0x99, 0xd2,
++ 0x6c, 0x75, 0xe4, 0xb6, 0x69, 0xb5, 0x21, 0x86, 0xfa, 0x07, 0xd1, 0xf6, 0xe2,
++ 0x4d, 0xd1, 0xda, 0xad, 0x2c, 0x77, 0x53, 0x1e, 0x25, 0x32, 0x37, 0xc7, 0x6c,
++ 0x52, 0x72, 0x95, 0x86, 0xb0, 0xf1, 0x35, 0x61, 0x6a, 0x19, 0xf5, 0xb2, 0x3b,
++ 0x81, 0x50, 0x56, 0xa6, 0x32, 0x2d, 0xfe, 0xa2, 0x89, 0xf9, 0x42, 0x86, 0x27,
++ 0x18, 0x55, 0xa1, 0x82, 0xca, 0x5a, 0x9b, 0xf8, 0x30, 0x98, 0x54, 0x14, 0xa6,
++ 0x47, 0x96, 0x25, 0x2f, 0xc8, 0x26, 0xe4, 0x41, 0x94, 0x1a, 0x5c, 0x02, 0x3f,
++ 0xe5, 0x96, 0xe3, 0x85, 0x5b, 0x3c, 0x3e, 0x3f, 0xbb, 0x47, 0x16, 0x72, 0x55,
++ 0xe2, 0x25, 0x22, 0xb1, 0xd9, 0x7b, 0xe7, 0x03, 0x06, 0x2a, 0xa3, 0xf7, 0x1e,
++ 0x90, 0x46, 0xc3, 0x00, 0x0d, 0xd6, 0x19, 0x89, 0xe3, 0x0e, 0x35, 0x27, 0x62,
++ 0x03, 0x71, 0x15, 0xa6, 0xef, 0xd0, 0x27, 0xa0, 0xa0, 0x59, 0x37, 0x60, 0xf8,
++ 0x38, 0x94, 0xb8, 0xe0, 0x78, 0x70, 0xf8, 0xba, 0x4c, 0x86, 0x87, 0x94, 0xf6,
++ 0xe0, 0xae, 0x02, 0x45, 0xee, 0x65, 0xc2, 0xb6, 0xa3, 0x7e, 0x69, 0x16, 0x75,
++ 0x07, 0x92, 0x9b, 0xf5, 0xa6, 0xbc, 0x59, 0x83, 0x58
++};
++
++//
++// The most important thing about the variable payload is that it is a list of
++// lists, where the element size of any given *inner* list is constant.
++//
++// Since X509 certificates vary in size, each of our *inner* lists will contain
++// one element only (one X.509 certificate). This is explicitly mentioned in
++// the UEFI specification, in "28.4.1 Signature Database", in a Note.
++//
++// The list structure looks as follows:
++//
++// struct EFI_VARIABLE_AUTHENTICATION_2 { |
++// struct EFI_TIME { |
++// UINT16 Year; |
++// UINT8 Month; |
++// UINT8 Day; |
++// UINT8 Hour; |
++// UINT8 Minute; |
++// UINT8 Second; |
++// UINT8 Pad1; |
++// UINT32 Nanosecond; |
++// INT16 TimeZone; |
++// UINT8 Daylight; |
++// UINT8 Pad2; |
++// } TimeStamp; |
++// |
++// struct WIN_CERTIFICATE_UEFI_GUID { | |
++// struct WIN_CERTIFICATE { | |
++// UINT32 dwLength; ----------------------------------------+ |
++// UINT16 wRevision; | |
++// UINT16 wCertificateType; | |
++// } Hdr; | +- DataSize
++// | |
++// EFI_GUID CertType; | |
++// UINT8 CertData[1] = { <--- "struct hack" | |
++// struct EFI_SIGNATURE_LIST { | | |
++// EFI_GUID SignatureType; | | |
++// UINT32 SignatureListSize; -------------------------+ | |
++// UINT32 SignatureHeaderSize; | | |
++// UINT32 SignatureSize; ---------------------------+ | | |
++// UINT8 SignatureHeader[SignatureHeaderSize]; | | | |
++// v | | |
++// struct EFI_SIGNATURE_DATA { | | | |
++// EFI_GUID SignatureOwner; | | | |
++// UINT8 SignatureData[1] = { <--- "struct hack" | | | |
++// X.509 payload | | | |
++// } | | | |
++// } Signatures[]; | | |
++// } SigLists[]; | |
++// }; | |
++// } AuthInfo; | |
++// }; |
++//
++// Given that the "struct hack" invokes undefined behavior (which is why C99
++// introduced the flexible array member), and because subtracting those pesky
++// sizes of 1 is annoying, and because the format is fully specified in the
++// UEFI specification, we'll introduce two matching convenience structures that
++// are customized for our X.509 purposes.
++//
++#pragma pack(1)
++typedef struct {
++ EFI_TIME TimeStamp;
++
++ //
++ // dwLength covers data below
++ //
++ UINT32 dwLength;
++ UINT16 wRevision;
++ UINT16 wCertificateType;
++ EFI_GUID CertType;
++} SINGLE_HEADER;
++
++typedef struct {
++ //
++ // SignatureListSize covers data below
++ //
++ EFI_GUID SignatureType;
++ UINT32 SignatureListSize;
++ UINT32 SignatureHeaderSize; // constant 0
++ UINT32 SignatureSize;
++
++ //
++ // SignatureSize covers data below
++ //
++ EFI_GUID SignatureOwner;
++
++ //
++ // X.509 certificate follows
++ //
++} REPEATING_HEADER;
++#pragma pack()
++
++/**
++ Enroll a set of DER-formatted X.509 certificates in a global variable,
++ overwriting it.
++
++ The variable will be rewritten with NV+BS+RT+AT attributes.
++
++ @param[in] VariableName The name of the variable to overwrite.
++
++ @param[in] VendorGuid The namespace (ie. vendor GUID) of the variable to
++ overwrite.
++
++ @param[in] ... A list of
++
++ IN CONST UINT8 *Cert,
++ IN UINTN CertSize,
++ IN CONST EFI_GUID *OwnerGuid
++
++ triplets. If the first component of a triplet is
++ NULL, then the other two components are not
++ accessed, and processing is terminated. The list of
++ X.509 certificates is enrolled in the variable
++ specified, overwriting it. The OwnerGuid component
++ identifies the agent installing the certificate.
++
++ @retval EFI_INVALID_PARAMETER The triplet list is empty (ie. the first Cert
++ value is NULL), or one of the CertSize values
++ is 0, or one of the CertSize values would
++ overflow the accumulated UINT32 data size.
++
++ @retval EFI_OUT_OF_RESOURCES Out of memory while formatting variable
++ payload.
++
++ @retval EFI_SUCCESS Enrollment successful; the variable has been
++ overwritten (or created).
++
++ @return Error codes from gRT->GetTime() and
++ gRT->SetVariable().
++**/
++STATIC
++EFI_STATUS
++EFIAPI
++EnrollListOfX509Certs (
++ IN CHAR16 *VariableName,
++ IN EFI_GUID *VendorGuid,
++ ...
++ )
++{
++ UINTN DataSize;
++ SINGLE_HEADER *SingleHeader;
++ REPEATING_HEADER *RepeatingHeader;
++ VA_LIST Marker;
++ CONST UINT8 *Cert;
++ EFI_STATUS Status = EFI_SUCCESS;
++ UINT8 *Data;
++ UINT8 *Position;
++
++ //
++ // compute total size first, for UINT32 range check, and allocation
++ //
++ DataSize = sizeof *SingleHeader;
++ VA_START (Marker, VendorGuid);
++ for (Cert = VA_ARG (Marker, CONST UINT8 *);
++ Cert != NULL;
++ Cert = VA_ARG (Marker, CONST UINT8 *)) {
++ UINTN CertSize;
++
++ CertSize = VA_ARG (Marker, UINTN);
++ (VOID)VA_ARG (Marker, CONST EFI_GUID *);
++
++ if (CertSize == 0 ||
++ CertSize > MAX_UINT32 - sizeof *RepeatingHeader ||
++ DataSize > MAX_UINT32 - sizeof *RepeatingHeader - CertSize) {
++ Status = EFI_INVALID_PARAMETER;
++ break;
++ }
++ DataSize += sizeof *RepeatingHeader + CertSize;
++ }
++ VA_END (Marker);
++
++ if (DataSize == sizeof *SingleHeader) {
++ Status = EFI_INVALID_PARAMETER;
++ }
++ if (EFI_ERROR (Status)) {
++ goto Out;
++ }
++
++ Data = AllocatePool (DataSize);
++ if (Data == NULL) {
++ Status = EFI_OUT_OF_RESOURCES;
++ goto Out;
++ }
++
++ Position = Data;
++
++ SingleHeader = (SINGLE_HEADER *)Position;
++ Status = gRT->GetTime (&SingleHeader->TimeStamp, NULL);
++ if (EFI_ERROR (Status)) {
++ goto FreeData;
++ }
++ SingleHeader->TimeStamp.Pad1 = 0;
++ SingleHeader->TimeStamp.Nanosecond = 0;
++ SingleHeader->TimeStamp.TimeZone = 0;
++ SingleHeader->TimeStamp.Daylight = 0;
++ SingleHeader->TimeStamp.Pad2 = 0;
++#if 0
++ SingleHeader->dwLength = DataSize - sizeof SingleHeader->TimeStamp;
++#else
++ //
++ // This looks like a bug in edk2. According to the UEFI specification,
++ // dwLength is "The length of the entire certificate, including the length of
++ // the header, in bytes". That shouldn't stop right after CertType -- it
++ // should include everything below it.
++ //
++ SingleHeader->dwLength = sizeof *SingleHeader
++ - sizeof SingleHeader->TimeStamp;
++#endif
++ SingleHeader->wRevision = 0x0200;
++ SingleHeader->wCertificateType = WIN_CERT_TYPE_EFI_GUID;
++ CopyGuid (&SingleHeader->CertType, &gEfiCertPkcs7Guid);
++ Position += sizeof *SingleHeader;
++
++ VA_START (Marker, VendorGuid);
++ for (Cert = VA_ARG (Marker, CONST UINT8 *);
++ Cert != NULL;
++ Cert = VA_ARG (Marker, CONST UINT8 *)) {
++ UINTN CertSize;
++ CONST EFI_GUID *OwnerGuid;
++
++ CertSize = VA_ARG (Marker, UINTN);
++ OwnerGuid = VA_ARG (Marker, CONST EFI_GUID *);
++
++ RepeatingHeader = (REPEATING_HEADER *)Position;
++ CopyGuid (&RepeatingHeader->SignatureType, &gEfiCertX509Guid);
++ RepeatingHeader->SignatureListSize = sizeof *RepeatingHeader + CertSize;
++ RepeatingHeader->SignatureHeaderSize = 0;
++ RepeatingHeader->SignatureSize =
++ sizeof RepeatingHeader->SignatureOwner + CertSize;
++ CopyGuid (&RepeatingHeader->SignatureOwner, OwnerGuid);
++ Position += sizeof *RepeatingHeader;
++
++ CopyMem (Position, Cert, CertSize);
++ Position += CertSize;
++ }
++ VA_END (Marker);
++
++ ASSERT (Data + DataSize == Position);
++
++ Status = gRT->SetVariable (VariableName, VendorGuid,
++ (EFI_VARIABLE_NON_VOLATILE |
++ EFI_VARIABLE_BOOTSERVICE_ACCESS |
++ EFI_VARIABLE_RUNTIME_ACCESS |
++ EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS),
++ DataSize, Data);
++
++FreeData:
++ FreePool (Data);
++
++Out:
++ if (EFI_ERROR (Status)) {
++ AsciiPrint ("error: %a(\"%s\", %g): %r\n", __FUNCTION__, VariableName,
++ VendorGuid, Status);
++ }
++ return Status;
++}
++
++
++STATIC
++EFI_STATUS
++EFIAPI
++GetExact (
++ IN CHAR16 *VariableName,
++ IN EFI_GUID *VendorGuid,
++ OUT VOID *Data,
++ IN UINTN DataSize,
++ IN BOOLEAN AllowMissing
++ )
++{
++ UINTN Size;
++ EFI_STATUS Status;
++
++ Size = DataSize;
++ Status = gRT->GetVariable (VariableName, VendorGuid, NULL, &Size, Data);
++ if (EFI_ERROR (Status)) {
++ if (Status == EFI_NOT_FOUND && AllowMissing) {
++ ZeroMem (Data, DataSize);
++ return EFI_SUCCESS;
++ }
++
++ AsciiPrint ("error: GetVariable(\"%s\", %g): %r\n", VariableName,
++ VendorGuid, Status);
++ return Status;
++ }
++
++ if (Size != DataSize) {
++ AsciiPrint ("error: GetVariable(\"%s\", %g): expected size 0x%Lx, "
++ "got 0x%Lx\n", VariableName, VendorGuid, (UINT64)DataSize, (UINT64)Size);
++ return EFI_PROTOCOL_ERROR;
++ }
++
++ return EFI_SUCCESS;
++}
++
++typedef struct {
++ UINT8 SetupMode;
++ UINT8 SecureBoot;
++ UINT8 SecureBootEnable;
++ UINT8 CustomMode;
++ UINT8 VendorKeys;
++} SETTINGS;
++
++STATIC
++EFI_STATUS
++EFIAPI
++GetSettings (
++ OUT SETTINGS *Settings
++ )
++{
++ EFI_STATUS Status;
++
++ Status = GetExact (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid,
++ &Settings->SetupMode, sizeof Settings->SetupMode, FALSE);
++ if (EFI_ERROR (Status)) {
++ return Status;
++ }
++
++ Status = GetExact (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid,
++ &Settings->SecureBoot, sizeof Settings->SecureBoot, FALSE);
++ if (EFI_ERROR (Status)) {
++ return Status;
++ }
++
++ Status = GetExact (EFI_SECURE_BOOT_ENABLE_NAME,
++ &gEfiSecureBootEnableDisableGuid, &Settings->SecureBootEnable,
++ sizeof Settings->SecureBootEnable, TRUE);
++ if (EFI_ERROR (Status)) {
++ return Status;
++ }
++
++ Status = GetExact (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid,
++ &Settings->CustomMode, sizeof Settings->CustomMode, FALSE);
++ if (EFI_ERROR (Status)) {
++ return Status;
++ }
++
++ Status = GetExact (EFI_VENDOR_KEYS_VARIABLE_NAME, &gEfiGlobalVariableGuid,
++ &Settings->VendorKeys, sizeof Settings->VendorKeys, FALSE);
++ return Status;
++}
++
++STATIC
++VOID
++EFIAPI
++PrintSettings (
++ IN CONST SETTINGS *Settings
++ )
++{
++ AsciiPrint ("info: SetupMode=%d SecureBoot=%d SecureBootEnable=%d "
++ "CustomMode=%d VendorKeys=%d\n", Settings->SetupMode, Settings->SecureBoot,
++ Settings->SecureBootEnable, Settings->CustomMode, Settings->VendorKeys);
++}
++
++
++INTN
++EFIAPI
++ShellAppMain (
++ IN UINTN Argc,
++ IN CHAR16 **Argv
++ )
++{
++ EFI_STATUS Status;
++ SETTINGS Settings;
++
++ Status = GetSettings (&Settings);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++ PrintSettings (&Settings);
++
++ if (Settings.SetupMode != 1) {
++ AsciiPrint ("error: already in User Mode\n");
++ return 1;
++ }
++
++ if (Settings.CustomMode != CUSTOM_SECURE_BOOT_MODE) {
++ Settings.CustomMode = CUSTOM_SECURE_BOOT_MODE;
++ Status = gRT->SetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid,
++ (EFI_VARIABLE_NON_VOLATILE |
++ EFI_VARIABLE_BOOTSERVICE_ACCESS),
++ sizeof Settings.CustomMode, &Settings.CustomMode);
++ if (EFI_ERROR (Status)) {
++ AsciiPrint ("error: SetVariable(\"%s\", %g): %r\n", EFI_CUSTOM_MODE_NAME,
++ &gEfiCustomModeEnableGuid, Status);
++ return 1;
++ }
++ }
++
++ Status = EnrollListOfX509Certs (
++ EFI_IMAGE_SECURITY_DATABASE,
++ &gEfiImageSecurityDatabaseGuid,
++ MicrosoftPCA, sizeof MicrosoftPCA, &gEfiCallerIdGuid,
++ MicrosoftUefiCA, sizeof MicrosoftUefiCA, &gEfiCallerIdGuid,
++ NULL);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++
++ Status = EnrollListOfX509Certs (
++ EFI_KEY_EXCHANGE_KEY_NAME,
++ &gEfiGlobalVariableGuid,
++ ExampleCert, sizeof ExampleCert, &gEfiCallerIdGuid,
++ MicrosoftKEK, sizeof MicrosoftKEK, &gEfiCallerIdGuid,
++ NULL);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++
++ Status = EnrollListOfX509Certs (
++ EFI_PLATFORM_KEY_NAME,
++ &gEfiGlobalVariableGuid,
++ ExampleCert, sizeof ExampleCert, &gEfiGlobalVariableGuid,
++ NULL);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++
++ Settings.CustomMode = STANDARD_SECURE_BOOT_MODE;
++ Status = gRT->SetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid,
++ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
++ sizeof Settings.CustomMode, &Settings.CustomMode);
++ if (EFI_ERROR (Status)) {
++ AsciiPrint ("error: SetVariable(\"%s\", %g): %r\n", EFI_CUSTOM_MODE_NAME,
++ &gEfiCustomModeEnableGuid, Status);
++ return 1;
++ }
++
++ Status = GetSettings (&Settings);
++ if (EFI_ERROR (Status)) {
++ return 1;
++ }
++ PrintSettings (&Settings);
++
++ if (Settings.SetupMode != 0 || Settings.SecureBoot != 1 ||
++ Settings.SecureBootEnable != 1 || Settings.CustomMode != 0 ||
++ Settings.VendorKeys != 0) {
++ AsciiPrint ("error: unexpected\n");
++ return 1;
++ }
++
++ AsciiPrint ("info: success\n");
++ return 0;
++}
+diff --git a/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
+new file mode 100644
+index 0000000..ac919bb
+--- /dev/null
++++ b/OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf
+@@ -0,0 +1,51 @@
++## @file
++# Enroll default PK, KEK, DB.
++#
++# Copyright (C) 2014, Red Hat, Inc.
++#
++# This program and the accompanying materials are licensed and made available
++# under the terms and conditions of the BSD License which accompanies this
++# distribution. The full text of the license may be found at
++# http://opensource.org/licenses/bsd-license.
++#
++# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
++# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
++# IMPLIED.
++##
++
++[Defines]
++ INF_VERSION = 0x00010006
++ BASE_NAME = EnrollDefaultKeys
++ FILE_GUID = D5C1DF0B-1BAC-4EDF-BA48-08834009CA5A
++ MODULE_TYPE = UEFI_APPLICATION
++ VERSION_STRING = 0.1
++ ENTRY_POINT = ShellCEntryLib
++
++#
++# VALID_ARCHITECTURES = IA32 X64
++#
++
++[Sources]
++ EnrollDefaultKeys.c
++
++[Packages]
++ MdePkg/MdePkg.dec
++ MdeModulePkg/MdeModulePkg.dec
++ SecurityPkg/SecurityPkg.dec
++ ShellPkg/ShellPkg.dec
++
++[Guids]
++ gEfiCertPkcs7Guid
++ gEfiCertX509Guid
++ gEfiCustomModeEnableGuid
++ gEfiGlobalVariableGuid
++ gEfiImageSecurityDatabaseGuid
++ gEfiSecureBootEnableDisableGuid
++
++[LibraryClasses]
++ BaseMemoryLib
++ DebugLib
++ MemoryAllocationLib
++ ShellCEntryLib
++ UefiLib
++ UefiRuntimeServicesTableLib
+diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
+index fa9661c..e2e6ba3 100644
+--- a/OvmfPkg/OvmfPkgIa32.dsc
++++ b/OvmfPkg/OvmfPkgIa32.dsc
+@@ -764,6 +764,10 @@
+
+ !if $(SECURE_BOOT_ENABLE) == TRUE
+ SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
++ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf {
++ <LibraryClasses>
++ ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
++ }
+ !endif
+
+ OvmfPkg/PlatformDxe/Platform.inf
+diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
+index 667584a..a0ae1aa 100644
+--- a/OvmfPkg/OvmfPkgIa32X64.dsc
++++ b/OvmfPkg/OvmfPkgIa32X64.dsc
+@@ -773,6 +773,10 @@
+
+ !if $(SECURE_BOOT_ENABLE) == TRUE
+ SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
++ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf {
++ <LibraryClasses>
++ ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
++ }
+ !endif
+
+ OvmfPkg/PlatformDxe/Platform.inf
+diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
+index 5ae8469..87cee52 100644
+--- a/OvmfPkg/OvmfPkgX64.dsc
++++ b/OvmfPkg/OvmfPkgX64.dsc
+@@ -771,6 +771,10 @@
+
+ !if $(SECURE_BOOT_ENABLE) == TRUE
+ SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
++ OvmfPkg/EnrollDefaultKeys/EnrollDefaultKeys.inf {
++ <LibraryClasses>
++ ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
++ }
+ !endif
+
+ OvmfPkg/PlatformDxe/Platform.inf
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch b/external/poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch
new file mode 100644
index 00000000..bb12d8be
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/VfrCompile-increase-path-length-limit.patch
@@ -0,0 +1,33 @@
+From c7722d10c7bcf6be0adcf54abb1d406599dd7914 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Fri, 24 Feb 2017 01:40:02 +0100
+Subject: [PATCH] VfrCompile: increase path length limit
+
+The VfrCompile tool has a hard-coded maximum length for path names
+which turned out to be too small by around 20 characters in the Yocto
+autobuilder setup. Increasing the maximum by a factor of 4 is
+relatively easy and makes the problem less likely.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ BaseTools/Source/C/VfrCompile/EfiVfr.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/BaseTools/Source/C/VfrCompile/EfiVfr.h b/BaseTools/Source/C/VfrCompile/EfiVfr.h
+index d187902..9ad4a7b 100644
+--- a/BaseTools/Source/C/VfrCompile/EfiVfr.h
++++ b/BaseTools/Source/C/VfrCompile/EfiVfr.h
+@@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ #include "Common/UefiInternalFormRepresentation.h"
+ #include "Common/MdeModuleHii.h"
+
+-#define MAX_PATH 255
++#define MAX_PATH 1023
+ #define MAX_VFR_LINE_LEN 4096
+
+ #define EFI_IFR_MAX_LENGTH 0xFF
+--
+2.1.4
+
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch b/external/poky/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch
new file mode 100644
index 00000000..25e5b58e
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch
@@ -0,0 +1,20 @@
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Description: pass -fno-stack-protector to all GCC toolchains
+ The upstream build rules inexplicably pass -fno-stack-protector only
+ when building for i386 and amd64. Add this essential argument to the
+ generic rules for gcc 4.4 and later.
+Last-Updated: 2016-04-12
+Upstream-Status: Pending
+Index: git/BaseTools/Conf/tools_def.template
+===================================================================
+--- git.orig/BaseTools/Conf/tools_def.template
++++ git/BaseTools/Conf/tools_def.template
+@@ -4368,7 +4368,7 @@ DEFINE GCC_IPF_RC_FLAGS = -I
+ DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii
+ DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
+
+-DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
++DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-stack-protector -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -fno-PIE -no-pie
+ DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables
+ DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 -no-pie
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks b/external/poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks
new file mode 100644
index 00000000..1d2f16bd
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf/ovmf-shell-image.wks
@@ -0,0 +1,4 @@
+# short-description: Create an EFI disk image with just the EFI system partition
+
+part / --source rootfs --ondisk sda --fstype=vfat --align 1024
+bootloader --ptable gpt --timeout=5
diff --git a/external/poky/meta/recipes-core/ovmf/ovmf_git.bb b/external/poky/meta/recipes-core/ovmf/ovmf_git.bb
new file mode 100644
index 00000000..d2ecb619
--- /dev/null
+++ b/external/poky/meta/recipes-core/ovmf/ovmf_git.bb
@@ -0,0 +1,252 @@
+SUMMARY = "OVMF - UEFI firmware for Qemu and KVM"
+DESCRIPTION = "OVMF is an EDK II based project to enable UEFI support for \
+Virtual Machines. OVMF contains sample UEFI firmware for QEMU and KVM"
+HOMEPAGE = "https://github.com/tianocore/tianocore.github.io/wiki/OVMF"
+LICENSE = "BSD"
+LICENSE_class-target = "${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'BSD & OpenSSL', 'BSD', d)}"
+LIC_FILES_CHKSUM = "file://OvmfPkg/License.txt;md5=343dc88e82ff33d042074f62050c3496"
+
+# Enabling Secure Boot adds a dependency on OpenSSL and implies
+# compiling OVMF twice, so it is disabled by default. Distros
+# may change that default.
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[secureboot] = ",,,"
+
+SRC_URI = "git://github.com/tianocore/edk2.git;branch=master \
+ file://0001-ia32-Dont-use-pie.patch \
+ file://0002-ovmf-update-path-to-native-BaseTools.patch \
+ file://0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \
+ file://0004-ovmf-enable-long-path-file.patch \
+ file://VfrCompile-increase-path-length-limit.patch \
+ file://no-stack-protector-all-archs.patch \
+ file://0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch \
+ file://0002-BaseTools-header.makefile-add-Wno-restrict.patch \
+ file://0003-BaseTools-header.makefile-revert-gcc-8-Wno-xxx-optio.patch \
+ file://0004-BaseTools-GenVtf-silence-false-stringop-overflow-war.patch \
+ "
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+OPENSSL_RELEASE = "openssl-1.1.0e"
+
+SRC_URI_append_class-target = " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'http://www.openssl.org/source/${OPENSSL_RELEASE}.tar.gz;name=openssl;subdir=${S}/CryptoPkg/Library/OpensslLib', '', d)} \
+ file://0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch \
+"
+
+SRCREV="ec4910cd3336565fdb61dafdd9ec4ae7a6160ba3"
+SRC_URI[openssl.md5sum] = "51c42d152122e474754aea96f66928c6"
+SRC_URI[openssl.sha256sum] = "57be8618979d80c910728cfc99369bf97b2a1abd8f366ab6ebdee8975ad3874c"
+
+inherit deploy
+
+PARALLEL_MAKE = ""
+
+S = "${WORKDIR}/git"
+
+DEPENDS_class-native="util-linux-native iasl-native qemu-native"
+
+DEPENDS_class-target="ovmf-native"
+
+DEPENDS_append = " nasm-native"
+
+EDK_TOOLS_DIR="edk2_basetools"
+
+# OVMF has trouble building with the default optimization of -O2.
+BUILD_OPTIMIZATION="-pipe"
+
+# OVMF supports IA only, although it could conceivably support ARM someday.
+COMPATIBLE_HOST='(i.86|x86_64).*'
+
+# Additional build flags for OVMF with Secure Boot.
+# Fedora also uses "-D SMM_REQUIRE -D EXCLUDE_SHELL_FROM_FD".
+OVMF_SECURE_BOOT_EXTRA_FLAGS ??= ""
+OVMF_SECURE_BOOT_FLAGS = "-DSECURE_BOOT_ENABLE=TRUE ${OVMF_SECURE_BOOT_EXTRA_FLAGS}"
+
+do_patch[postfuncs] += "fix_basetools_location"
+fix_basetools_location () {
+}
+fix_basetools_location_class-target() {
+ # Replaces the fake path inserted by 0002-ovmf-update-path-to-native-BaseTools.patch.
+ # Necessary for finding the actual BaseTools from ovmf-native.
+ sed -i -e 's#BBAKE_EDK_TOOLS_PATH#${STAGING_BINDIR_NATIVE}/${EDK_TOOLS_DIR}#' ${S}/OvmfPkg/build.sh
+}
+
+do_patch[postfuncs] += "fix_iasl"
+fix_iasl() {
+}
+fix_iasl_class-native() {
+ # iasl is not installed under /usr/bin when building with OE.
+ sed -i -e 's#/usr/bin/iasl#${STAGING_BINDIR_NATIVE}/iasl#' ${S}/BaseTools/Conf/tools_def.template
+}
+
+# Inject CC and friends into the build. LINKER already is in GNUmakefile.
+# Must be idempotent and thus remove old assignments that were inserted
+# earlier.
+do_patch[postfuncs] += "fix_toolchain"
+fix_toolchain() {
+ sed -i \
+ -e '/^\(CC\|CXX\|AS\|AR\|LD\|LINKER\) =/d' \
+ -e '/^APPLICATION/a CC = ${CC}\nCXX = ${CXX}\nAS = ${AS}\nAR = ${AR}\nLD = ${LD}\nLINKER = $(CC)' \
+ ${S}/BaseTools/Source/C/Makefiles/app.makefile
+ sed -i \
+ -e '/^\(CC\|CXX\|AS\|AR\|LD\)/d' \
+ -e '/^VFR_CPPFLAGS/a CC = ${CC}\nCXX = ${CXX}\nAS = ${AS}\nAR = ${AR}\nLD = ${LD}' \
+ ${S}/BaseTools/Source/C/VfrCompile/GNUmakefile
+}
+fix_toolchain_append_class-native() {
+ # This tools_def.template is going to be used by the target ovmf and
+ # defines which compilers to use. For the GCC toolchain definitions,
+ # that will be ${HOST_PREFIX}gcc. However, "make" doesn't need that
+ # prefix.
+ #
+ # Injecting ENV(HOST_PREFIX) matches exporting that value as env
+ # variable in do_compile_class-target.
+ sed -i \
+ -e 's#\(ENV\|DEF\)(GCC.*_PREFIX)#ENV(HOST_PREFIX)#' \
+ -e 's#ENV(HOST_PREFIX)make#make#' \
+ ${S}/BaseTools/Conf/tools_def.template
+ sed -i \
+ -e '/^\(LFLAGS\|CFLAGS\) +=/d' \
+ -e '/^LINKER/a LFLAGS += ${BUILD_LDFLAGS}\nCFLAGS += ${BUILD_CFLAGS}' \
+ ${S}/BaseTools/Source/C/Makefiles/app.makefile \
+ ${S}/BaseTools/Source/C/VfrCompile/GNUmakefile
+ # Linking with gold fails:
+ # internal error in do_layout, at ../../gold/object.cc:1821
+ # make: *** [.../OUTPUT/Facs.acpi] Error 1
+ # We intentionally hard-code the use of ld.bfd regardless of DISTRO_FEATURES
+ # to make ovmf-native reusable across distros.
+ sed -i \
+ -e 's#^\(DEFINE GCC.*DLINK.*FLAGS *=\)#\1 -fuse-ld=bfd#' \
+ ${S}/BaseTools/Conf/tools_def.template
+}
+
+GCC_VER="$(${CC} -v 2>&1 | tail -n1 | awk '{print $3}')"
+
+fixup_target_tools() {
+ case ${1} in
+ 4.4.*)
+ FIXED_GCCVER=GCC44
+ ;;
+ 4.5.*)
+ FIXED_GCCVER=GCC45
+ ;;
+ 4.6.*)
+ FIXED_GCCVER=GCC46
+ ;;
+ 4.7.*)
+ FIXED_GCCVER=GCC47
+ ;;
+ 4.8.*)
+ FIXED_GCCVER=GCC48
+ ;;
+ 4.9.*)
+ FIXED_GCCVER=GCC49
+ ;;
+ *)
+ FIXED_GCCVER=GCC5
+ ;;
+ esac
+ echo ${FIXED_GCCVER}
+}
+
+do_compile_class-native() {
+ oe_runmake -C ${S}/BaseTools
+}
+
+do_compile_class-target() {
+ export LFLAGS="${LDFLAGS}"
+ PARALLEL_JOBS="${@oe.utils.parallel_make_argument(d, '-n %d')}"
+ OVMF_ARCH="X64"
+ if [ "${TARGET_ARCH}" != "x86_64" ] ; then
+ OVMF_ARCH="IA32"
+ fi
+
+ # The build for the target uses BaseTools/Conf/tools_def.template
+ # from ovmf-native to find the compiler, which depends on
+ # exporting HOST_PREFIX.
+ export HOST_PREFIX="${HOST_PREFIX}"
+
+ # BaseTools/Conf gets copied to Conf, but only if that does not
+ # exist yet. To ensure that an updated template gets used during
+ # incremental builds, we need to remove the copy before we start.
+ rm -f `ls ${S}/Conf/*.txt | grep -v ReadMe.txt`
+
+ # ${WORKDIR}/ovmf is a well-known location where do_install and
+ # do_deploy will be able to find the files.
+ rm -rf ${WORKDIR}/ovmf
+ mkdir ${WORKDIR}/ovmf
+ OVMF_DIR_SUFFIX="X64"
+ if [ "${TARGET_ARCH}" != "x86_64" ] ; then
+ OVMF_DIR_SUFFIX="Ia32" # Note the different capitalization
+ fi
+ FIXED_GCCVER=$(fixup_target_tools ${GCC_VER})
+ bbnote FIXED_GCCVER is ${FIXED_GCCVER}
+ build_dir="${S}/Build/Ovmf$OVMF_DIR_SUFFIX/RELEASE_${FIXED_GCCVER}"
+
+ bbnote "Building without Secure Boot."
+ rm -rf ${S}/Build/Ovmf$OVMF_DIR_SUFFIX
+ ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b RELEASE -t ${FIXED_GCCVER}
+ ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.fd
+ ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.code.fd
+ ln ${build_dir}/FV/OVMF_VARS.fd ${WORKDIR}/ovmf/ovmf.vars.fd
+ ln ${build_dir}/${OVMF_ARCH}/Shell.efi ${WORKDIR}/ovmf/
+
+ if ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'true', 'false', d)}; then
+ # See CryptoPkg/Library/OpensslLib/Patch-HOWTO.txt and
+ # https://src.fedoraproject.org/cgit/rpms/edk2.git/tree/ for
+ # building with Secure Boot enabled.
+ bbnote "Building with Secure Boot."
+ rm -rf ${S}/Build/Ovmf$OVMF_DIR_SUFFIX
+ ln -sf ${OPENSSL_RELEASE} ${S}/CryptoPkg/Library/OpensslLib/openssl
+ ${S}/OvmfPkg/build.sh $PARALLEL_JOBS -a $OVMF_ARCH -b RELEASE -t ${FIXED_GCCVER} ${OVMF_SECURE_BOOT_FLAGS}
+ ln ${build_dir}/FV/OVMF.fd ${WORKDIR}/ovmf/ovmf.secboot.fd
+ ln ${build_dir}/FV/OVMF_CODE.fd ${WORKDIR}/ovmf/ovmf.secboot.code.fd
+ ln ${build_dir}/${OVMF_ARCH}/EnrollDefaultKeys.efi ${WORKDIR}/ovmf/
+ fi
+}
+
+do_install_class-native() {
+ install -d ${D}/${bindir}/edk2_basetools
+ cp -r ${S}/BaseTools ${D}/${bindir}/${EDK_TOOLS_DIR}
+}
+
+do_install_class-target() {
+ # Content for UEFI shell iso. We install the EFI shell as
+ # bootx64/ia32.efi because then it can be started even when the
+ # firmware itself does not contain it.
+ install -d ${D}/efi/boot
+ install ${WORKDIR}/ovmf/Shell.efi ${D}/efi/boot/boot${@ "ia32" if "${TARGET_ARCH}" != "x86_64" else "x64"}.efi
+ if ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'true', 'false', d)}; then
+ install ${WORKDIR}/ovmf/EnrollDefaultKeys.efi ${D}
+ fi
+}
+
+# This always gets packaged because ovmf-shell-image depends on it.
+# This allows testing that recipe in all configurations because it
+# can always be part of a world build.
+#
+# However, EnrollDefaultKeys.efi is only included when Secure Boot is enabled.
+PACKAGES =+ "ovmf-shell-efi"
+FILES_ovmf-shell-efi = " \
+ EnrollDefaultKeys.efi \
+ efi/ \
+"
+
+do_deploy() {
+}
+do_deploy[cleandirs] = "${DEPLOYDIR}"
+do_deploy_class-target() {
+ # For use with "runqemu ovmf".
+ for i in \
+ ovmf \
+ ovmf.code \
+ ovmf.vars \
+ ${@bb.utils.contains('PACKAGECONFIG', 'secureboot', 'ovmf.secboot ovmf.secboot.code', '', d)} \
+ ; do
+ qemu-img convert -f raw -O qcow2 ${WORKDIR}/ovmf/$i.fd ${DEPLOYDIR}/$i.qcow2
+ done
+}
+addtask do_deploy after do_compile before do_build
+
+BBCLASSEXTEND = "native"
+TOOLCHAIN = "gcc"
diff --git a/external/poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/external/poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
new file mode 100644
index 00000000..4bf0ac04
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -0,0 +1,35 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd
+#
+
+SUMMARY = "Host packages for the standalone SDK or external toolchain"
+PR = "r12"
+
+inherit packagegroup nativesdk
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+RDEPENDS_${PN} = "\
+ nativesdk-pkgconfig \
+ nativesdk-qemu \
+ nativesdk-qemu-helper \
+ nativesdk-pseudo \
+ nativesdk-unfs3 \
+ nativesdk-opkg \
+ nativesdk-libtool \
+ nativesdk-autoconf \
+ nativesdk-automake \
+ nativesdk-shadow \
+ nativesdk-makedevs \
+ nativesdk-cmake \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'nativesdk-wayland', '', d)} \
+ nativesdk-sdk-provides-dummy \
+ nativesdk-bison \
+ nativesdk-flex \
+ "
+
+RDEPENDS_${PN}_darwin = "\
+ nativesdk-pkgconfig \
+ nativesdk-opkg \
+ nativesdk-libtool \
+ "
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-base.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-base.bb
new file mode 100644
index 00000000..442201c9
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-base.bb
@@ -0,0 +1,364 @@
+SUMMARY = "Merge machine and distro options to create a basic machine task/package"
+PR = "r83"
+
+#
+# packages which content depend on MACHINE_FEATURES need to be MACHINE_ARCH
+#
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+inherit bluetooth
+
+PROVIDES = "${PACKAGES}"
+PACKAGES = ' \
+ packagegroup-base \
+ packagegroup-base-extended \
+ packagegroup-distro-base \
+ packagegroup-machine-base \
+ \
+ ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "packagegroup-base-acpi", "",d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "alsa", "packagegroup-base-alsa", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "apm", "packagegroup-base-apm", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "ext2", "packagegroup-base-ext2", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "vfat", "packagegroup-base-vfat", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "irda", "packagegroup-base-irda", "",d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "packagegroup-base-keyboard", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "pci", "packagegroup-base-pci", "",d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "pcmcia", "packagegroup-base-pcmcia", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "phone", "packagegroup-base-phone", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "serial", "packagegroup-base-serial", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "usbgadget", "packagegroup-base-usbgadget", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "usbhost", "packagegroup-base-usbhost", "", d)} \
+ \
+ ${@bb.utils.contains("DISTRO_FEATURES", "bluetooth", "packagegroup-base-bluetooth", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "wifi", "packagegroup-base-wifi", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "nfc", "packagegroup-base-nfc", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "cramfs", "packagegroup-base-cramfs", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "ipsec", "packagegroup-base-ipsec", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "packagegroup-base-ipv6", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "nfs", "packagegroup-base-nfs", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "ppp", "packagegroup-base-ppp", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "smbfs", "packagegroup-base-smbfs", "", d)} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "zeroconf", "packagegroup-base-zeroconf", "", d)} \
+ \
+ '
+
+# Override by distro if needed
+VIRTUAL-RUNTIME_keymaps ?= "keymaps"
+
+#
+# packagegroup-base contain stuff needed for base system (machine related)
+#
+RDEPENDS_packagegroup-base = "\
+ packagegroup-distro-base \
+ packagegroup-machine-base \
+ \
+ module-init-tools \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'apm', 'packagegroup-base-apm', '',d)} \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'packagegroup-base-acpi', '',d)} \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'keyboard', 'packagegroup-base-keyboard', '',d)} \
+ ${@bb.utils.contains('MACHINE_FEATURES', 'phone', 'packagegroup-base-phone', '',d)} \
+ \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', 'packagegroup-base-alsa', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'ext2', 'packagegroup-base-ext2', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'vfat', 'packagegroup-base-vfat', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'irda', 'packagegroup-base-irda', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pci', 'packagegroup-base-pci', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'packagegroup-base-pcmcia', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', 'packagegroup-base-usbgadget', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'packagegroup-base-usbhost', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'bluetooth', 'packagegroup-base-bluetooth', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'wifi', 'packagegroup-base-wifi', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'nfc', 'packagegroup-base-nfc', '',d)} \
+ \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'nfs', 'packagegroup-base-nfs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'cramfs', 'packagegroup-base-cramfs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'smbfs', 'packagegroup-base-smbfs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'packagegroup-base-ipv6', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ipsec', 'packagegroup-base-ipsec', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ppp', 'packagegroup-base-ppp', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'packagegroup-base-zeroconf', '',d)} \
+ "
+
+
+RRECOMMENDS_packagegroup-base = "\
+ kernel-module-nls-utf8 \
+ kernel-module-input \
+ kernel-module-uinput \
+ kernel-module-rtc-dev \
+ kernel-module-rtc-proc \
+ kernel-module-rtc-sysfs \
+ kernel-module-unix"
+
+RDEPENDS_packagegroup-base-extended = "\
+ packagegroup-base \
+ ${ADD_WIFI} \
+ ${ADD_BT} \
+ ${ADD_3G} \
+ ${ADD_NFC} \
+ "
+
+ADD_WIFI = ""
+ADD_BT = ""
+ADD_3G = ""
+ADD_NFC = ""
+
+python __anonymous () {
+ # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them)
+ # then include packagegroup-base-wifi in packagegroup-base
+
+ distro_features = set(d.getVar("DISTRO_FEATURES").split())
+ machine_features= set(d.getVar("MACHINE_FEATURES").split())
+
+ if "bluetooth" in distro_features and not "bluetooth" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
+ d.setVar("ADD_BT", "packagegroup-base-bluetooth")
+
+ if "wifi" in distro_features and not "wifi" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
+ d.setVar("ADD_WIFI", "packagegroup-base-wifi")
+
+ if "3g" in distro_features and not "3g" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
+ d.setVar("ADD_3G", "packagegroup-base-3g")
+
+ if "nfc" in distro_features and not "nfc" in machine_features and ("usbhost" in machine_features):
+ d.setVar("ADD_NFC", "packagegroup-base-nfc")
+}
+
+#
+# packages added by distribution
+#
+SUMMARY_packagegroup-distro-base = "${DISTRO} extras"
+DEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_DEPENDS}"
+RDEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RDEPENDS}"
+RRECOMMENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RRECOMMENDS}"
+
+#
+# packages added by machine config
+#
+SUMMARY_packagegroup-machine-base = "${MACHINE} extras"
+SUMMARY_packagegroup-machine-base = "Extra packages required to fully support ${MACHINE} hardware"
+RDEPENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RDEPENDS}"
+RRECOMMENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RRECOMMENDS}"
+
+SUMMARY_packagegroup-base-keyboard = "Keyboard support"
+RDEPENDS_packagegroup-base-keyboard = "\
+ ${VIRTUAL-RUNTIME_keymaps}"
+
+SUMMARY_packagegroup-base-pci = "PCI bus support"
+RDEPENDS_packagegroup-base-pci = "\
+ pciutils"
+
+SUMMARY_packagegroup-base-acpi = "ACPI support"
+RDEPENDS_packagegroup-base-acpi = "\
+ acpid"
+
+SUMMARY_packagegroup-base-apm = "APM support"
+RDEPENDS_packagegroup-base-apm = "\
+ ${VIRTUAL-RUNTIME_apm} \
+ apmd"
+
+SUMMARY_packagegroup-base-ext2 = "ext2 filesystem support"
+RDEPENDS_packagegroup-base-ext2 = "\
+ hdparm \
+ e2fsprogs \
+ e2fsprogs-e2fsck \
+ e2fsprogs-mke2fs"
+
+SUMMARY_packagegroup-base-vfat = "FAT filesystem support"
+RRECOMMENDS_packagegroup-base-vfat = "\
+ kernel-module-msdos \
+ kernel-module-vfat \
+ kernel-module-nls-iso8859-1 \
+ kernel-module-nls-cp437 \
+ dosfstools"
+
+SUMMARY_packagegroup-base-alsa = "ALSA sound support"
+RDEPENDS_packagegroup-base-alsa = "\
+ alsa-utils-alsactl \
+ alsa-utils-alsamixer \
+ ${VIRTUAL-RUNTIME_alsa-state}"
+
+RRECOMMENDS_packagegroup-base-alsa = "\
+ kernel-module-snd-mixer-oss \
+ kernel-module-snd-pcm-oss"
+
+SUMMARY_packagegroup-base-pcmcia = "PC card slot support"
+RDEPENDS_packagegroup-base-pcmcia = "\
+ pcmciautils \
+ "
+
+RRECOMMENDS_packagegroup-base-pcmcia = "\
+ kernel-module-pcmcia \
+ kernel-module-airo-cs \
+ kernel-module-pcnet-cs \
+ kernel-module-serial-cs \
+ kernel-module-ide-cs \
+ kernel-module-ide-disk \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'kernel-module-hostap-cs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'kernel-module-orinoco-cs', '',d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'kernel-module-spectrum-cs', '',d)}"
+
+SUMMARY_packagegroup-base-bluetooth = "Bluetooth support"
+RDEPENDS_packagegroup-base-bluetooth = "\
+ ${BLUEZ} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', bb.utils.contains('BLUEZ', 'bluez4', 'libasound-module-bluez', '', d), '',d)} \
+ "
+
+RRECOMMENDS_packagegroup-base-bluetooth = "\
+ kernel-module-bluetooth \
+ kernel-module-l2cap \
+ kernel-module-rfcomm \
+ kernel-module-hci-vhci \
+ kernel-module-bnep \
+ kernel-module-hidp \
+ kernel-module-hci-uart \
+ kernel-module-sco \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-hci-usb', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetooth3c-cs', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluecard-cs', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetoothuart-cs', '',d)} \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-dtl1-cs', '',d)} \
+ "
+
+SUMMARY_packagegroup-base-irda = "IrDA support"
+RDEPENDS_packagegroup-base-irda = "\
+ irda-utils"
+
+RRECOMMENDS_packagegroup-base-irda = "\
+ kernel-module-pxaficp-ir \
+ kernel-module-irda \
+ kernel-module-ircomm \
+ kernel-module-ircomm-tty \
+ kernel-module-irlan \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ppp', 'kernel-module-irnet', '',d)} \
+ kernel-module-irport \
+ kernel-module-irtty \
+ kernel-module-irtty-sir \
+ kernel-module-sir-dev \
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-ir-usb', '',d)} "
+
+SUMMARY_packagegroup-base-usbgadget = "USB gadget support"
+RRECOMMENDS_packagegroup-base-usbgadget = "\
+ kernel-module-pxa27x_udc \
+ kernel-module-gadgetfs \
+ kernel-module-g-file-storage \
+ kernel-module-g-serial \
+ kernel-module-g-ether"
+
+SUMMARY_packagegroup-base-usbhost = "USB host support"
+RDEPENDS_packagegroup-base-usbhost = "\
+ usbutils "
+
+RRECOMMENDS_packagegroup-base-usbhost = "\
+ kernel-module-uhci-hcd \
+ kernel-module-ohci-hcd \
+ kernel-module-ehci-hcd \
+ kernel-module-usbcore \
+ kernel-module-usbhid \
+ kernel-module-usbnet \
+ kernel-module-sd-mod \
+ kernel-module-scsi-mod \
+ kernel-module-usbmouse \
+ kernel-module-mousedev \
+ kernel-module-usbserial \
+ kernel-module-usb-storage "
+
+SUMMARY_packagegroup-base-ppp = "PPP dial-up protocol support"
+RDEPENDS_packagegroup-base-ppp = "\
+ ppp \
+ ppp-dialin"
+
+RRECOMMENDS_packagegroup-base-ppp = "\
+ kernel-module-ppp-async \
+ kernel-module-ppp-deflate \
+ kernel-module-ppp-generic \
+ kernel-module-ppp-mppe \
+ kernel-module-slhc"
+
+SUMMARY_packagegroup-base-ipsec = "IPSEC support"
+RDEPENDS_packagegroup-base-ipsec = "\
+ "
+
+RRECOMMENDS_packagegroup-base-ipsec = "\
+ kernel-module-ipsec"
+
+#
+# packagegroup-base-wifi contain everything needed to get WiFi working
+# WEP/WPA connection needs to be supported out-of-box
+#
+SUMMARY_packagegroup-base-wifi = "WiFi support"
+RDEPENDS_packagegroup-base-wifi = "\
+ iw \
+ wpa-supplicant"
+
+RRECOMMENDS_packagegroup-base-wifi = "\
+ ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-zd1211rw', '',d)} \
+ kernel-module-ieee80211-crypt \
+ kernel-module-ieee80211-crypt-ccmp \
+ kernel-module-ieee80211-crypt-tkip \
+ kernel-module-ieee80211-crypt-wep \
+ kernel-module-ecb \
+ kernel-module-arc4 \
+ kernel-module-crypto_algapi \
+ kernel-module-cryptomgr \
+ kernel-module-michael-mic \
+ kernel-module-aes-generic \
+ kernel-module-aes"
+
+SUMMARY_packagegroup-base-nfc = "Near Field Communication support"
+RDEPENDS_packagegroup-base-nfc = "\
+ neard"
+
+RRECOMMENDS_packagegroup-base-nfc = "\
+ kernel-module-nfc"
+
+SUMMARY_packagegroup-base-3g = "Cellular data support"
+RDEPENDS_packagegroup-base-3g = "\
+ ofono"
+
+RRECOMMENDS_packagegroup-base-3g = "\
+ kernel-module-cdc-acm \
+ kernel-module-cdc-wdm"
+
+SUMMARY_packagegroup-base-smbfs = "SMB network filesystem support"
+RRECOMMENDS_packagegroup-base-smbfs = "\
+ kernel-module-cifs \
+ kernel-module-smbfs"
+
+SUMMARY_packagegroup-base-cramfs = "cramfs filesystem support"
+RRECOMMENDS_packagegroup-base-cramfs = "\
+ kernel-module-cramfs"
+
+#
+# packagegroup-base-nfs provides ONLY client support - server is in nfs-utils package
+#
+SUMMARY_packagegroup-base-nfs = "NFS network filesystem support"
+RDEPENDS_packagegroup-base-nfs = "\
+ rpcbind"
+
+RRECOMMENDS_packagegroup-base-nfs = "\
+ kernel-module-nfs "
+
+SUMMARY_packagegroup-base-zeroconf = "Zeroconf support"
+RDEPENDS_packagegroup-base-zeroconf = "\
+ avahi-daemon"
+RDEPENDS_packagegroup-base-zeroconf_append_libc-glibc = "\
+ libnss-mdns \
+ "
+
+SUMMARY_packagegroup-base-ipv6 = "IPv6 support"
+RDEPENDS_packagegroup-base-ipv6 = "\
+ "
+
+RRECOMMENDS_packagegroup-base-ipv6 = "\
+ kernel-module-ipv6 "
+
+SUMMARY_packagegroup-base-serial = "Serial port support"
+RDEPENDS_packagegroup-base-serial = "\
+ setserial \
+ lrzsz "
+
+SUMMARY_packagegroup-base-phone = "Cellular telephony (voice) support"
+RDEPENDS_packagegroup-base-phone = "\
+ ofono"
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
new file mode 100644
index 00000000..8dc445dc
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
@@ -0,0 +1,50 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Minimal boot requirements"
+DESCRIPTION = "The minimal set of packages required to boot the system"
+PR = "r17"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+#
+# Set by the machine configuration with packages essential for device bootup
+#
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
+
+# Distro can override the following VIRTUAL-RUNTIME providers:
+VIRTUAL-RUNTIME_dev_manager ?= "udev"
+VIRTUAL-RUNTIME_login_manager ?= "busybox"
+VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
+VIRTUAL-RUNTIME_initscripts ?= "initscripts"
+VIRTUAL-RUNTIME_keymaps ?= "keymaps"
+
+EFI_PROVIDER ??= "grub-efi"
+
+SYSVINIT_SCRIPTS = "${@bb.utils.contains('MACHINE_FEATURES', 'rtc', '${VIRTUAL-RUNTIME_base-utils-hwclock}', '', d)} \
+ modutils-initscripts \
+ init-ifupdown \
+ ${VIRTUAL-RUNTIME_initscripts} \
+ "
+
+RDEPENDS_${PN} = "\
+ base-files \
+ base-passwd \
+ ${VIRTUAL-RUNTIME_base-utils} \
+ ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
+ ${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER} kernel", "", d)} \
+ netbase \
+ ${VIRTUAL-RUNTIME_login_manager} \
+ ${VIRTUAL-RUNTIME_init_manager} \
+ ${VIRTUAL-RUNTIME_dev_manager} \
+ ${VIRTUAL-RUNTIME_update-alternatives} \
+ ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"
+
+RRECOMMENDS_${PN} = "\
+ ${VIRTUAL-RUNTIME_base-utils-syslog} \
+ ${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}"
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
new file mode 100644
index 00000000..78cc65db
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+# Copyright (C) 2012 Red Hat, Inc.
+#
+
+SUMMARY = "Essential build dependencies"
+
+inherit packagegroup
+
+RDEPENDS_packagegroup-core-buildessential = "\
+ autoconf \
+ automake \
+ binutils \
+ binutils-symlinks \
+ cpp \
+ cpp-symlinks \
+ gcc \
+ gcc-symlinks \
+ g++ \
+ g++-symlinks \
+ gettext \
+ make \
+ libstdc++ \
+ libstdc++-dev \
+ libtool \
+ pkgconfig \
+ "
+
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
new file mode 100644
index 00000000..c45463fc
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Remote debugging tools for Eclipse integration"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "\
+ gdbserver \
+ tcf-agent \
+ openssh-sftp-server \
+ "
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
new file mode 100644
index 00000000..b345e314
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "NFS package groups"
+PR = "r2"
+
+inherit packagegroup
+
+PROVIDES = "${PACKAGES}"
+PACKAGES = "${PN}-server ${PN}-client"
+
+SUMMARY_${PN}-client = "NFS client"
+RDEPENDS_${PN}-client = "nfs-utils-client"
+
+SUMMARY_${PN}-server = "NFS server"
+RDEPENDS_${PN}-server = "\
+ nfs-utils \
+ nfs-utils-client \
+ "
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
new file mode 100644
index 00000000..45e8c135
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
@@ -0,0 +1,80 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Software development tools"
+PR = "r9"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+#PACKAGEFUNCS =+ 'generate_sdk_pkgs'
+
+RDEPENDS_packagegroup-core-sdk = "\
+ packagegroup-core-buildessential \
+ coreutils \
+ ccache \
+ diffutils \
+ intltool \
+ perl-module-re \
+ perl-module-text-wrap \
+ findutils \
+ quilt \
+ less \
+ ldd \
+ file \
+ tcl"
+
+SANITIZERS = "libasan-dev libubsan-dev"
+SANITIZERS_microblaze = ""
+SANITIZERS_mipsarch = ""
+SANITIZERS_nios2 = ""
+SANITIZERS_riscv64 = ""
+SANITIZERS_libc-musl = ""
+
+RRECOMMENDS_packagegroup-core-sdk = "\
+ libgomp \
+ libgomp-dev \
+ ${SANITIZERS}"
+
+#python generate_sdk_pkgs () {
+# poky_pkgs = read_pkgdata('packagegroup-core', d)['PACKAGES']
+# pkgs = d.getVar('PACKAGES').split()
+# for pkg in poky_pkgs.split():
+# newpkg = pkg.replace('packagegroup-core', 'packagegroup-core-sdk')
+#
+# # for each of the task packages, add a corresponding sdk task
+# pkgs.append(newpkg)
+#
+# # for each sdk task, take the rdepends of the non-sdk task, and turn
+# # that into rrecommends upon the -dev versions of those, not unlike
+# # the package depchain code
+# spkgdata = read_subpkgdata(pkg, d)
+#
+# rdepends = explode_deps(spkgdata.get('RDEPENDS_%s' % pkg) or '')
+# rreclist = []
+#
+# for depend in rdepends:
+# split_depend = depend.split(' (')
+# name = split_depend[0].strip()
+# if packaged('%s-dev' % name, d):
+# rreclist.append('%s-dev' % name)
+# else:
+# deppkgdata = read_subpkgdata(name, d)
+# rdepends2 = explode_deps(deppkgdata.get('RDEPENDS_%s' % name) or '')
+# for depend in rdepends2:
+# split_depend = depend.split(' (')
+# name = split_depend[0].strip()
+# if packaged('%s-dev' % name, d):
+# rreclist.append('%s-dev' % name)
+#
+# oldrrec = d.getVar('RRECOMMENDS_%s' % newpkg, False) or ''
+# d.setVar('RRECOMMENDS_%s' % newpkg, oldrrec + ' ' + ' '.join(rreclist))
+# # bb.note('RRECOMMENDS_%s = "%s"' % (newpkg, d.getVar('RRECOMMENDS_%s' % newpkg, False)))
+#
+# # bb.note('pkgs is %s' % pkgs)
+# d.setVar('PACKAGES', ' '.join(pkgs))
+#}
+#
+#PACKAGES_DYNAMIC += "^packagegroup-core-sdk-.*"
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
new file mode 100644
index 00000000..5ec3f6c9
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
@@ -0,0 +1,6 @@
+SUMMARY = "Dropbear SSH client/server"
+PR = "r1"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "dropbear"
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
new file mode 100644
index 00000000..703f956a
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
@@ -0,0 +1,6 @@
+SUMMARY = "OpenSSH SSH client/server"
+PR = "r1"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "openssh"
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
new file mode 100644
index 00000000..f5b2d69c
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Target packages for the standalone SDK"
+PR = "r8"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "\
+ libgcc \
+ libgcc-dev \
+ libatomic \
+ libatomic-dev \
+ libstdc++ \
+ libstdc++-dev \
+ ${LIBC_DEPENDENCIES} \
+ "
+
+RRECOMMENDS_${PN}_mingw32 = "\
+ libssp \
+ libssp-dev \
+ "
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
new file mode 100644
index 00000000..9fc2b0ef
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Debugging tools"
+
+inherit packagegroup
+
+PR = "r3"
+
+MTRACE = ""
+MTRACE_libc-glibc = "libc-mtrace"
+
+RDEPENDS_${PN} = "\
+ gdb \
+ gdbserver \
+ strace \
+ ${MTRACE} \
+ "
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
new file mode 100644
index 00000000..33d9c09a
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
@@ -0,0 +1,76 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Profiling tools"
+
+PR = "r3"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+PROFILE_TOOLS_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'sysprof', '', d)}"
+# sysprof doesn't support aarch64 and nios2
+PROFILE_TOOLS_X_aarch64 = ""
+PROFILE_TOOLS_X_nios2 = ""
+PROFILE_TOOLS_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-analyze', '', d)}"
+
+RRECOMMENDS_${PN} = "\
+ ${PERF} \
+ blktrace \
+ ${PROFILE_TOOLS_X} \
+ ${PROFILE_TOOLS_SYSTEMD} \
+ "
+
+PROFILETOOLS = "\
+ powertop \
+ "
+PERF = "perf"
+PERF_libc-musl = ""
+
+# systemtap needs elfutils which is not fully buildable on some arches/libcs
+SYSTEMTAP = "systemtap"
+SYSTEMTAP_libc-musl = ""
+SYSTEMTAP_nios2 = ""
+SYSTEMTAP_riscv64 = ""
+
+# lttng-ust uses sched_getcpu() which is not there on for some platforms.
+LTTNGUST = "lttng-ust"
+LTTNGUST_libc-musl = ""
+LTTNGUST_riscv64 = ""
+
+LTTNGTOOLS = "lttng-tools"
+LTTNGTOOLS_libc-musl = ""
+LTTNGTOOLS_riscv64 = ""
+
+LTTNGMODULES = "lttng-modules"
+LTTNGMODULES_riscv64 = ""
+
+BABELTRACE = "babeltrace"
+
+# valgrind does not work on the following configurations/architectures
+
+VALGRIND = "valgrind"
+VALGRIND_libc-musl = ""
+VALGRIND_mipsarch = ""
+VALGRIND_nios2 = ""
+VALGRIND_arc = ""
+VALGRIND_armv4 = ""
+VALGRIND_armv5 = ""
+VALGRIND_armv6 = ""
+VALGRIND_armeb = ""
+VALGRIND_aarch64 = ""
+VALGRIND_riscv64 = ""
+VALGRIND_linux-gnux32 = ""
+VALGRIND_linux-gnun32 = ""
+
+RDEPENDS_${PN} = "\
+ ${PROFILETOOLS} \
+ ${LTTNGUST} \
+ ${LTTNGTOOLS} \
+ ${LTTNGMODULES} \
+ ${BABELTRACE} \
+ ${SYSTEMTAP} \
+ ${VALGRIND} \
+ "
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
new file mode 100644
index 00000000..64321985
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Testing tools/applications"
+
+PR = "r2"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+# kexec-tools doesn't work on e5500-64b, microblaze and nios2 yet
+KEXECTOOLS ?= "kexec"
+KEXECTOOLS_e5500-64b ?= ""
+KEXECTOOLS_microblaze ?= ""
+KEXECTOOLS_nios2 ?= ""
+KEXECTOOLS_riscv64 ?= ""
+
+GSTEXAMPLES ?= "gst-examples"
+GSTEXAMPLES_riscv64 = ""
+
+X11GLTOOLS = "\
+ mesa-demos \
+ "
+
+3GTOOLS = "\
+ ofono-tests \
+ "
+
+X11TOOLS = "\
+ ${GSTEXAMPLES} \
+ x11perf \
+ xrestop \
+ xwininfo \
+ xprop \
+ xvideo-tests \
+ "
+
+RDEPENDS_${PN} = "\
+ blktool \
+ lrzsz \
+ ${KEXECTOOLS} \
+ alsa-utils-amixer \
+ alsa-utils-aplay \
+ ltp \
+ connman-tools \
+ connman-tests \
+ connman-client \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', "${X11TOOLS}", "", d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', "${X11GLTOOLS}", "", d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', '3g', "${3GTOOLS}", "", d)} \
+ "
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
new file mode 100644
index 00000000..d551147b
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Host SDK package for cross canadian toolchain"
+PN = "packagegroup-cross-canadian-${MACHINE}"
+
+inherit cross-canadian packagegroup
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+# Use indirection to stop these being expanded prematurely
+BINUTILS = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+GCC = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+GDB = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+RDEPENDS_${PN} = "\
+ ${@all_multilib_tune_values(d, 'BINUTILS')} \
+ ${@all_multilib_tune_values(d, 'GCC')} \
+ ${@all_multilib_tune_values(d, 'GDB')} \
+ meta-environment-${MACHINE} \
+ "
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb
new file mode 100644
index 00000000..3daace1a
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-go-cross-canadian.bb
@@ -0,0 +1,12 @@
+SUMMARY = "Host SDK package for Go cross canadian toolchain"
+PN = "packagegroup-go-cross-canadian-${MACHINE}"
+
+inherit cross-canadian packagegroup
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+GO = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+RDEPENDS_${PN} = " \
+ ${@all_multilib_tune_values(d, 'GO')} \
+"
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
new file mode 100644
index 00000000..5afb490a
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
@@ -0,0 +1,11 @@
+SUMMARY = "Target packages for the Go SDK"
+
+inherit packagegroup goarch
+
+RDEPENDS_${PN} = " \
+ go-runtime \
+ go-runtime-dev \
+ go-runtime-staticdev \
+"
+
+COMPATIBLE_HOST = "^(?!riscv64).*"
diff --git a/external/poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/external/poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
new file mode 100644
index 00000000..9a6721ce
--- /dev/null
+++ b/external/poky/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
@@ -0,0 +1,197 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Self-hosting"
+DESCRIPTION = "Packages required to run the build system"
+PR = "r13"
+
+inherit packagegroup distro_features_check
+# rdepends on libx11-dev
+REQUIRED_DISTRO_FEATURES = "x11"
+
+# rdepends on libgl
+REQUIRED_DISTRO_FEATURES += "opengl"
+
+PACKAGES = "\
+ packagegroup-self-hosted \
+ packagegroup-self-hosted-debug \
+ packagegroup-self-hosted-sdk \
+ packagegroup-self-hosted-extended \
+ packagegroup-self-hosted-graphics \
+ packagegroup-self-hosted-host-tools \
+ "
+
+RDEPENDS_packagegroup-self-hosted = "\
+ packagegroup-self-hosted-debug \
+ packagegroup-self-hosted-sdk \
+ packagegroup-self-hosted-extended \
+ packagegroup-self-hosted-graphics \
+ packagegroup-self-hosted-host-tools \
+ "
+
+RDEPENDS_packagegroup-self-hosted-host-tools = "\
+ e2fsprogs \
+ e2fsprogs-e2fsck \
+ e2fsprogs-mke2fs \
+ e2fsprogs-tune2fs \
+ hdparm \
+ iptables \
+ lsb \
+ mc \
+ mc-fish \
+ mc-helpers \
+ mc-helpers-perl \
+ parted \
+ ${PSEUDO} \
+ screen \
+ "
+PSEUDO = "pseudo"
+PSEUDO_libc-musl = ""
+
+RRECOMMENDS_packagegroup-self-hosted-host-tools = "\
+ kernel-module-tun \
+ kernel-module-iptable-raw \
+ kernel-module-iptable-nat \
+ kernel-module-iptable-mangle \
+ kernel-module-iptable-filter \
+ "
+
+RDEPENDS_packagegroup-self-hosted-sdk = "\
+ autoconf \
+ automake \
+ binutils \
+ binutils-symlinks \
+ ccache \
+ coreutils \
+ cpp \
+ cpp-symlinks \
+ distcc \
+ file \
+ findutils \
+ g++ \
+ g++-symlinks \
+ gcc \
+ gcc-symlinks \
+ intltool \
+ ldd \
+ less \
+ libstdc++ \
+ libstdc++-dev \
+ libtool \
+ make \
+ perl-module-re \
+ perl-module-text-wrap \
+ pkgconfig \
+ quilt \
+ sed \
+ "
+RDEPENDS_packagegroup-self-hosted-sdk_append_mingw32 = "\
+ libssp \
+ libssp-dev \
+ libssp-staticdev \
+ "
+# rpcsvc-proto: for rpcgen
+RDEPENDS_packagegroup-self-hosted-sdk_append_libc-glibc = "\
+ glibc-gconv-ibm850 \
+ glibc-utils \
+ rpcsvc-proto \
+ "
+RDEPENDS_packagegroup-self-hosted-debug = " \
+ gdb \
+ gdbserver \
+ rsync \
+ strace \
+ tcf-agent"
+
+
+RDEPENDS_packagegroup-self-hosted-extended = "\
+ bzip2 \
+ chkconfig \
+ chrpath \
+ cpio \
+ curl \
+ diffstat \
+ diffutils \
+ elfutils \
+ expat \
+ gawk \
+ gdbm \
+ gettext \
+ gettext-runtime \
+ git \
+ git-perltools \
+ grep \
+ groff \
+ gzip \
+ settings-daemon \
+ libaio \
+ libusb1 \
+ libxml2 \
+ lrzsz \
+ lsof \
+ lzo \
+ man \
+ man-pages \
+ mdadm \
+ minicom \
+ mtools \
+ ncurses \
+ ncurses-terminfo-base \
+ nfs-utils \
+ nfs-utils-client \
+ openssl \
+ openssh-scp \
+ openssh-sftp-server \
+ openssh-ssh \
+ opkg \
+ opkg-utils \
+ patch \
+ perl \
+ perl-dev \
+ perl-misc \
+ perl-modules \
+ perl-pod \
+ python \
+ python-modules \
+ python3 \
+ python3-modules \
+ python3-git \
+ quota \
+ readline \
+ rpm \
+ setserial \
+ socat \
+ subversion \
+ sudo \
+ sysstat \
+ tar \
+ tcl \
+ texi2html \
+ texinfo \
+ unzip \
+ usbutils \
+ watchdog \
+ wget \
+ which \
+ xinetd \
+ zip \
+ zlib \
+ xz \
+ "
+
+
+RDEPENDS_packagegroup-self-hosted-graphics = "\
+ builder \
+ libgl \
+ libgl-dev \
+ libglu \
+ libglu-dev \
+ libx11-dev \
+ adwaita-icon-theme \
+ xdg-utils \
+ epiphany \
+ l3afpad \
+ pcmanfm \
+ vte \
+ "
diff --git a/external/poky/meta/recipes-core/psplash/files/psplash-init b/external/poky/meta/recipes-core/psplash/files/psplash-init
new file mode 100755
index 00000000..0bce1de5
--- /dev/null
+++ b/external/poky/meta/recipes-core/psplash/files/psplash-init
@@ -0,0 +1,35 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: psplash
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+### END INIT INFO
+
+if [ ! -e /dev/fb0 ]; then
+ echo "Framebuffer /dev/fb0 not detected"
+ echo "Boot splashscreen disabled"
+ exit 0;
+fi
+
+read CMDLINE < /proc/cmdline
+for x in $CMDLINE; do
+ case $x in
+ psplash=false)
+ echo "Boot splashscreen disabled"
+ exit 0;
+ ;;
+ esac
+done
+
+export TMPDIR=/mnt/.psplash
+mount tmpfs -t tmpfs $TMPDIR -o,size=40k
+
+rotation=0
+if [ -e /etc/rotation ]; then
+ read rotation < /etc/rotation
+fi
+
+/usr/bin/psplash --angle $rotation &
+
diff --git a/external/poky/meta/recipes-core/psplash/files/psplash-poky-img.h b/external/poky/meta/recipes-core/psplash/files/psplash-poky-img.h
new file mode 100644
index 00000000..8d56aa02
--- /dev/null
+++ b/external/poky/meta/recipes-core/psplash/files/psplash-poky-img.h
@@ -0,0 +1,1259 @@
+/* GdkPixbuf RGB C-Source image dump 1-byte-run-length-encoded */
+
+#define POKY_IMG_ROWSTRIDE (1920)
+#define POKY_IMG_WIDTH (640)
+#define POKY_IMG_HEIGHT (480)
+#define POKY_IMG_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */
+#define POKY_IMG_RLE_PIXEL_DATA ((uint8*) \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\237\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
+ "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \
+ "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \
+ "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \
+ "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\363\376\377\374\3\373\375" \
+ "\372\360\366\370\353\360\363\202\347\355\357\5\346\354\356\347\355\357" \
+ "\351\356\360\360\366\370\371\373\370\363\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\353\376\377\374\10\356" \
+ "\363\366\324\331\333\277\304\306\252\262\272\227\237\247}\220\233p\203" \
+ "\216ew\202\212]oz\10dv\201n\201\214~\215\223\216\236\244\247\257\267" \
+ "\274\301\303\320\326\330\352\357\362\353\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\346\376\377\374\5\366" \
+ "\370\364\320\326\330\255\265\275\210\227\235j}\210\232]oz\5gy\204\204" \
+ "\223\231\250\260\270\314\321\324\355\362\365\346\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\342\376\377" \
+ "\374\5\373\375\372\327\334\337\253\263\273x\213\227^p{\243]oz\4q\204" \
+ "\217\242\252\262\320\326\330\365\372\375\342\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\337\376\377\374" \
+ "\4\371\373\370\317\324\327\225\245\253ew\202\252]oz\4bt\177\211\230\236" \
+ "\306\314\316\367\371\366\337\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\335\376\377\374\3\333\340\343\236" \
+ "\246\256fx\203\260]oz\3bt\177\225\235\245\320\326\330\335\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\332" \
+ "\376\377\374\3\367\371\366\276\303\305u\210\224\266]oz\3m\200\213\257" \
+ "\267\277\355\362\365\332\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\330\376\377\374\3\353\360\363\252\262" \
+ "\272fx\203\272]oz\3as~\230\250\256\342\347\352\330\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\326\376\377" \
+ "\374\3\352\357\362\236\246\256as~\276]oz\3^p{\216\236\244\341\346\351" \
+ "\326\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\324\376\377\374\3\354\361\364\246\256\266as~\302]oz\3^p" \
+ "{\227\237\247\346\354\356\324\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\322\376\377\374\3\372\374\371\265" \
+ "\276\306fx\203\306]oz\3as~\250\260\270\362\367\371\322\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\321\376" \
+ "\377\374\2\320\326\330p\203\216\312]oz\2hz\205\302\307\312\321\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\317\376\377\374\2\356\363\366\231\241\251\316]oz\2\204\223\231\345\352" \
+ "\355\317\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\316\376\377\374\2\311\316\321i{\206\320]oz\2bt\177\264" \
+ "\274\305\316\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\314\376\377\374\2\362\367\371\226\246\254\324]o" \
+ "z\2\206\225\233\353\360\363\314\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\313\376\377\374\2\334\342\344o\202" \
+ "\215\326]oz\2gy\204\315\322\325\313\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\312\376\377\374\2\302\307\312" \
+ "as~\330]oz\3^p{\254\264\274\373\375\372\311\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\310\376\377\374\2\372" \
+ "\374\371\236\246\256\334]oz\2\210\227\235\360\366\370\310\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\307" \
+ "\376\377\374\2\360\366\370\205\224\232\336]oz\2s\206\221\347\355\357" \
+ "\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\306\376\377\374\2\347\355\357t\207\222\340]oz\2i{\206\333" \
+ "\340\343\306\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\305\376\377\374\2\343\350\353j}\210\251]oz\7bt\177" \
+ "w\212\226\215\234\243\236\246\256\246\256\266\254\264\274\264\274\305" \
+ "\202\300\305\310\7\264\274\305\255\265\275\250\260\270\233\252\261\222" \
+ "\241\247~\215\223ew\202\251]oz\2cu\200\322\330\332\305\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\304\376" \
+ "\377\374\2\337\344\346i{\206\245]oz\5j}\210\230\240\250\270\300\311\322" \
+ "\330\332\351\356\360\220\376\377\374\5\354\361\364\326\333\335\300\305" \
+ "\310\236\246\256p\203\216\245]oz\2as~\316\323\326\304\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\303\376" \
+ "\377\374\2\335\343\345gy\204\242]oz\4ew\202\222\241\247\276\303\305\342" \
+ "\347\352\232\376\377\374\4\352\357\362\304\311\314\233\243\253j}\210" \
+ "\242]oz\2as~\313\320\322\303\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\302\376\377\374\2\341\346\351hz" \
+ "\205\240]oz\4_q|\211\230\236\307\315\317\370\372\367\240\376\377\374" \
+ "\4\373\375\372\320\326\330\231\241\251bt\177\240]oz\2as~\317\324\327" \
+ "\302\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\301\376\377\374\2\343\350\353i{\206\237]oz\3q\204\217\266" \
+ "\277\307\354\361\364\246\376\377\374\3\366\370\364\303\310\313\177\216" \
+ "\224\237]oz\2bt\177\325\332\334\301\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\300\376\377\374\2\355\362\365" \
+ "l\177\212\236]oz\3u\210\224\307\315\317\373\375\372\253\376\377\374\2" \
+ "\324\331\333\204\223\231\236]oz\2ew\202\341\346\351\300\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\277\376" \
+ "\377\374\2\365\372\375\177\216\224\235]oz\2~\215\223\315\322\325\260" \
+ "\376\377\374\2\331\336\341\211\230\236\235]oz\2l\177\212\353\360\363" \
+ "\277\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\277\376\377\374\1\214\233\242\234]oz\2i{\206\305\312\315" \
+ "\264\376\377\374\2\324\331\333q\204\217\234]oz\2u\210\224\367\371\366" \
+ "\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\276\376\377\374\1\257\267\277\233]oz\3^p{\242\252\262\362" \
+ "\367\371\266\376\377\374\3\372\374\371\261\271\302bt\177\233]oz\1\225" \
+ "\235\245\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\275\376\377\374\2\317\324\327^p{\232]oz\2w\212\226" \
+ "\335\343\345\272\376\377\374\2\351\356\360\211\230\236\233]oz\1\264\274" \
+ "\305\275\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\274\376\377\374\2\347\355\357ew\202\232]oz\2\242\252" \
+ "\262\371\373\370\225\376\377\374\10\336\367\374\262\355\370\220\343\361" \
+ "m\332\361G\317\353,\311\352(\307\350#\304\346\202\0\301\350\10\0\304" \
+ "\352(\307\350,\311\352B\314\347i\326\356\207\341\364\260\353\366\333" \
+ "\364\371\226\376\377\374\2\266\277\307as~\231]oz\2_q|\327\334\337\274" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\273\376\377\374\2\373\375\372}\220\233\231]oz\2ew\202\313\320" \
+ "\322\223\376\377\374\4\334\365\372\233\345\364M\323\357\0\304\352\222" \
+ "\25\274\344\4\0\301\350J\321\355\211\342\365\314\361\372\223\376\377" \
+ "\374\2\332\337\342m\200\213\231]oz\2l\177\212\360\366\370\273\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\273\376\377\374\1\257\267\277\231]oz\2x\213\227\347\355\357\221\376" \
+ "\377\374\3\336\367\374\206\340\363*\310\351\232\25\274\344\3#\304\346" \
+ "w\333\356\316\363\374\221\376\377\374\2\360\366\370\214\233\242\231]" \
+ "oz\1\227\237\247\273\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\272\376\377\374\2\335\343\345_q|\230]oz" \
+ "\2\210\227\235\364\371\374\217\376\377\374\3\370\376\377\256\350\364" \
+ "B\314\347\240\25\274\344\3*\310\351\233\345\364\367\375\377\217\376\377" \
+ "\374\2\373\375\372\242\252\262\231]oz\1\305\312\315\272\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\271\376" \
+ "\377\374\2\372\374\371w\212\226\230]oz\2\231\241\251\372\374\371\216" \
+ "\376\377\374\3\367\375\377\233\345\364(\307\350\244\25\274\344\3\0\302" \
+ "\351\206\340\363\356\373\374\217\376\377\374\1\257\267\277\230]oz\2h" \
+ "z\205\356\363\366\271\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\271\376\377\374\1\257\267\277\230]oz\1\246" \
+ "\256\266\217\376\377\374\2\237\350\367\0\304\352\250\25\274\344\3\0\276" \
+ "\345\207\341\364\370\376\377\216\376\377\374\2\277\304\306_q|\227]oz" \
+ "\1\231\241\251\271\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\270\376\377\374\2\346\354\356bt\177\227]oz\1" \
+ "\251\261\271\216\376\377\374\2\315\362\3731\313\354\254\25\274\344\2" \
+ "(\307\350\262\355\370\216\376\377\374\2\305\312\315^p{\227]oz\1\322\330" \
+ "\332\270\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\270\376\377\374\1\215\234\243\227]oz\1\233\252\261\215" \
+ "\376\377\374\3\367\375\377m\332\361\0\276\345\257\25\274\344\2L\322\356" \
+ "\356\373\374\215\376\377\374\1\274\301\303\227]oz\2t\207\222\373\375" \
+ "\372\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\267\376\377\374\1\325\332\334\227]oz\2\214\233\242\373" \
+ "\375\372\214\376\377\374\2\333\364\371,\311\352\262\25\274\344\2\0\304" \
+ "\352\301\356\366\215\376\377\374\1\252\262\272\227]oz\1\274\301\303\267" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\267\376\377\374\1v\211\225\226]oz\2\205\224\232\365\372\375" \
+ "\214\376\377\374\2\236\347\366\0\276\345\264\25\274\344\3\0\276\345\203" \
+ "\334\360\370\376\377\214\376\377\374\1\236\246\256\226]oz\2hz\205\362" \
+ "\367\371\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\266\376\377\374\1\307\315\317\226]oz\2n\201\214" \
+ "\360\366\370\214\376\377\374\1m\332\361\270\25\274\344\2I\320\354\366" \
+ "\373\376\213\376\377\374\2\373\375\372\203\222\230\226]oz\1\254\264\274" \
+ "\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\265\376\377\374\2\373\375\372s\206\221\225]oz\2as~\333\340" \
+ "\343\213\376\377\374\2\370\376\377M\323\357\272\25\274\344\2""1\313\354" \
+ "\356\373\374\213\376\377\374\2\353\360\363i{\206\225]oz\2ew\202\357\365" \
+ "\367\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\265\376\377\374\1\305\312\315\226]oz\1\265\276\306\213" \
+ "\376\377\374\2\366\373\376B\314\347\274\25\274\344\2(\307\350\336\367" \
+ "\374\213\376\377\374\2\322\330\332^p{\225]oz\1\252\262\272\265\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\265\376\377\374\1u\210\224\225]oz\1\214\233\242\213\376\377\374\2\366" \
+ "\373\376B\314\347\276\25\274\344\2#\304\346\337\370\375\213\376\377\374" \
+ "\1\253\263\273\225]oz\2fx\203\367\371\366\264\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374" \
+ "\1\322\330\332\225]oz\2i{\206\360\366\370\212\376\377\374\2\370\376\377" \
+ "I\320\354\300\25\274\344\2*\310\351\357\374\375\212\376\377\374\2\373" \
+ "\375\372~\215\223\225]oz\1\264\274\305\264\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1\210" \
+ "\227\235\225]oz\1\303\310\313\213\376\377\374\1i\326\356\302\25\274\344" \
+ "\2B\314\347\370\376\377\212\376\377\374\2\335\343\345^p{\224]oz\2m\200" \
+ "\213\373\375\372\263\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\263\376\377\374\2\345\352\355^p{\224]oz" \
+ "\1~\221\235\213\376\377\374\1y\336\360\304\25\274\344\1M\323\357\213" \
+ "\376\377\374\1\242\252\262\225]oz\1\315\322\325\263\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\263\376\377" \
+ "\374\1\252\262\272\224]oz\2_q|\341\346\351\212\376\377\374\2\274\355" \
+ "\373\0\276\345\305\25\274\344\1\220\343\361\212\376\377\374\2\360\366" \
+ "\370i{\206\224]oz\1\211\230\236\263\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\262\376\377\374\2\372\374\371" \
+ "i{\206\224]oz\1\250\260\270\212\376\377\374\2\350\371\377\0\304\352\306" \
+ "\25\274\344\2\0\276\345\316\363\374\212\376\377\374\1\303\310\313\224" \
+ "]oz\2^p{\352\357\362\262\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\262\376\377\374\1\315\322\325\224]o" \
+ "z\2dv\201\357\365\367\212\376\377\374\1G\317\353\240\25\274\344\3\0\302" \
+ "\351,\311\352J\321\355\203L\322\356\2B\314\347#\304\346\240\25\274\344" \
+ "\2*\310\351\367\375\377\212\376\377\374\1q\204\217\224]oz\1\257\267\277" \
+ "\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\262\376\377\374\1\230\240\250\224]oz\1\247\257\267\212\376" \
+ "\377\374\1\233\345\364\235\25\274\344\4*\310\351n\333\362\273\354\371" \
+ "\360\375\376\210\376\377\374\4\357\374\375\303\361\370\206\340\363/\312" \
+ "\353\235\25\274\344\1w\333\356\212\376\377\374\1\303\310\313\224]oz\1" \
+ "v\211\225\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\261\376\377\374\2\365\372\375dv\201\223]oz\2as~" \
+ "\353\360\363\211\376\377\374\2\356\373\374\0\302\351\232\25\274\344\3" \
+ "\0\276\345m\332\361\335\366\373\220\376\377\374\2\336\367\374(\307\350" \
+ "\232\25\274\344\2%\305\347\336\367\374\212\376\377\374\2\372\374\371" \
+ "n\201\214\224]oz\1\343\350\353\261\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\261\376\377\374\1\313\320\322" \
+ "\224]oz\1\233\252\261\212\376\377\374\1k\327\357\231\25\274\344\3\0\276" \
+ "\345\206\340\363\357\374\375\222\376\377\374\1k\327\357\232\25\274\344" \
+ "\2%\305\347\336\367\374\214\376\377\374\1\276\303\305\224]oz\1\257\267" \
+ "\277\261\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\261\376\377\374\1\226\246\254\223]oz\2^p{\347\355\357" \
+ "\211\376\377\374\2\316\363\374\0\276\345\230\25\274\344\2J\321\355\337" \
+ "\370\375\223\376\377\374\1k\327\357\232\25\274\344\2%\305\347\336\367" \
+ "\374\215\376\377\374\2\370\372\367i{\206\223]oz\1\177\216\224\261\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\261\376\377\374\1k~\211\223]oz\1\205\224\232\212\376\377\374\1J" \
+ "\321\355\227\25\274\344\2\0\276\345\257\351\365\224\376\377\374\1m\332" \
+ "\361\232\25\274\344\2%\305\347\336\367\374\217\376\377\374\1\246\256" \
+ "\266\223]oz\2^p{\356\363\366\260\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\260\376\377\374\1\335\343\345" \
+ "\224]oz\1\303\310\313\211\376\377\374\2\333\364\371\0\276\345\226\25" \
+ "\274\344\2#\304\346\316\363\374\224\376\377\374\1m\332\361\232\25\274" \
+ "\344\2%\305\347\336\367\374\220\376\377\374\1\335\343\345\224]oz\1\306" \
+ "\314\316\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\260\376\377\374\1\264\274\305\223]oz\2cu\200\367" \
+ "\371\366\211\376\377\374\1i\326\356\226\25\274\344\2,\311\352\347\370" \
+ "\376\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367\374" \
+ "\222\376\377\374\1t\207\222\223]oz\1\236\246\256\260\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\260\376" \
+ "\377\374\1\215\234\243\223]oz\1\231\241\251\211\376\377\374\2\347\370" \
+ "\376\0\276\345\225\25\274\344\2*\310\351\357\374\375\224\376\377\374" \
+ "\1m\332\361\232\25\274\344\2%\305\347\336\367\374\223\376\377\374\1\261" \
+ "\271\302\223]oz\1q\204\217\260\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\260\376\377\374\1i{\206\223]oz\1" \
+ "\317\324\327\211\376\377\374\1\207\341\364\225\25\274\344\2#\304\346" \
+ "\337\370\375\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336" \
+ "\367\374\224\376\377\374\1\351\356\360\224]oz\1\356\363\366\257\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\257\376\377\374\1\345\352\355\223]oz\2as~\370\372\367\211\376\377\374" \
+ "\1,\311\352\224\25\274\344\2\0\276\345\313\360\371\224\376\377\374\1" \
+ "m\332\361\232\25\274\344\2%\305\347\336\367\374\226\376\377\374\1q\204" \
+ "\217\223]oz\1\314\321\324\257\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\257\376\377\374\1\311\316\321\223" \
+ "]oz\1\202\221\227\211\376\377\374\1\320\365\376\225\25\274\344\1\207" \
+ "\341\364\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367" \
+ "\374\214\376\377\374\2\236\347\366\237\350\367\211\376\377\374\1\236" \
+ "\246\256\223]oz\1\255\265\275\257\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\254\264\274" \
+ "\223]oz\1\255\265\275\211\376\377\374\1y\336\360\224\25\274\344\2/\312" \
+ "\353\370\376\377\223\376\377\374\1m\332\361\232\25\274\344\2%\305\347" \
+ "\336\367\374\214\376\377\374\3\236\347\366\0\276\345J\321\355\211\376" \
+ "\377\374\1\311\316\321\223]oz\1\215\234\243\257\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374" \
+ "\1\214\233\242\223]oz\1\326\333\335\211\376\377\374\1,\311\352\224\25" \
+ "\274\344\1\312\357\370\223\376\377\374\1n\333\362\232\25\274\344\2%\305" \
+ "\347\336\367\374\214\376\377\374\5\236\347\366\0\276\345\25\274\344\0" \
+ "\276\345\367\375\377\210\376\377\374\2\356\363\366^p{\222]oz\1o\202\215" \
+ "\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\257\376\377\374\1o\202\215\222]oz\2as~\366\373\376\210\376" \
+ "\377\374\2\357\374\375\0\276\345\223\25\274\344\1J\321\355\223\376\377" \
+ "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \
+ "\2\236\347\366\0\276\345\203\25\274\344\1\274\355\373\211\376\377\374" \
+ "\1u\210\224\222]oz\2^p{\370\372\367\256\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\2\373\375" \
+ "\372_q|\222]oz\1u\210\224\211\376\377\374\1\261\354\367\224\25\274\344" \
+ "\1\312\357\370\222\376\377\374\1n\333\362\232\25\274\344\2%\305\347\336" \
+ "\367\374\214\376\377\374\2\236\347\366\0\276\345\204\25\274\344\1\204" \
+ "\335\361\211\376\377\374\1\230\240\250\223]oz\1\342\347\352\256\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\256\376\377\374\1\351\356\360\223]oz\1\225\235\245\211\376\377\374\1" \
+ "n\333\362\223\25\274\344\1,\311\352\222\376\377\374\1n\333\362\232\25" \
+ "\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345" \
+ "\205\25\274\344\1B\314\347\211\376\377\374\1\257\267\277\223]oz\1\317" \
+ "\324\327\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\256\376\377\374\1\326\333\335\223]oz\1\253\263\273" \
+ "\211\376\377\374\1B\314\347\223\25\274\344\1\211\342\365\221\376\377" \
+ "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \
+ "\2\236\347\366\0\276\345\206\25\274\344\1\0\302\351\211\376\377\374\1" \
+ "\307\315\317\223]oz\1\276\303\305\256\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\306\314" \
+ "\316\223]oz\1\305\312\315\211\376\377\374\1#\304\346\223\25\274\344\1" \
+ "\337\370\375\220\376\377\374\1w\333\356\232\25\274\344\2%\305\347\336" \
+ "\367\374\214\376\377\374\2\236\347\366\0\276\345\210\25\274\344\1\356" \
+ "\373\374\210\376\377\374\1\337\344\346\223]oz\1\253\263\273\256\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\256\376\377\374\1\274\301\303\223]oz\1\333\340\343\210\376\377\374\2" \
+ "\367\375\377\0\276\345\222\25\274\344\1(\307\350\220\376\377\374\1\231" \
+ "\342\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236" \
+ "\347\366\0\276\345\211\25\274\344\1\302\357\367\210\376\377\374\2\364" \
+ "\371\374^p{\222]oz\1\236\246\256\256\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\257\267" \
+ "\277\223]oz\1\353\360\363\210\376\377\374\1\316\363\374\223\25\274\344" \
+ "\1\\\326\355\217\376\377\374\2\320\365\376\31\275\345\231\25\274\344" \
+ "\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\212\25" \
+ "\274\344\1\237\350\367\211\376\377\374\1gy\204\222]oz\1\216\236\244\256" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\256\376\377\374\1\242\252\262\223]oz\1\366\370\364\210\376\377" \
+ "\374\1\262\355\370\223\25\274\344\1\220\343\361\217\376\377\374\1J\321" \
+ "\355\231\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347" \
+ "\366\0\276\345\213\25\274\344\1\211\342\365\211\376\377\374\1m\200\213" \
+ "\222]oz\1\204\223\231\256\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\256\376\377\374\1\226\246\254\223]o" \
+ "z\211\376\377\374\1\237\350\367\223\25\274\344\1\262\355\370\216\376" \
+ "\377\374\2\350\371\377\0\276\345\230\25\274\344\2%\305\347\336\367\374" \
+ "\214\376\377\374\2\236\347\366\0\276\345\214\25\274\344\1n\333\362\211" \
+ "\376\377\374\1u\210\224\222]oz\1y\214\230\256\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \
+ "\1\231\241\251\222]oz\1cu\200\211\376\377\374\1\233\345\364\223\25\274" \
+ "\344\1\316\363\374\216\376\377\374\1\235\346\365\230\25\274\344\2%\305" \
+ "\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\215\25\274\344" \
+ "\1k\327\357\211\376\377\374\1\200\217\225\222]oz\1u\210\224\256\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\256\376\377\374\1\222\241\247\222]oz\1j}\210\211\376\377\374\1\220\343" \
+ "\361\223\25\274\344\1\336\367\374\216\376\377\374\1w\333\356\227\25\274" \
+ "\344\2#\304\346\336\367\374\214\376\377\374\2\236\347\366\0\276\345\216" \
+ "\25\274\344\1M\323\357\211\376\377\374\1\210\227\235\222]oz\1s\206\221" \
+ "\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\256\376\377\374\1\211\230\236\222]oz\1n\201\214\211\376" \
+ "\377\374\1\206\340\363\223\25\274\344\1\350\371\377\216\376\377\374\1" \
+ "i\326\356\226\25\274\344\2#\304\346\336\367\374\214\376\377\374\2\236" \
+ "\347\366\0\276\345\217\25\274\344\1M\323\357\211\376\377\374\1\215\234" \
+ "\243\222]oz\1m\200\213\256\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\256\376\377\374\1\222\241\247\222]o" \
+ "z\1l\177\212\211\376\377\374\1\207\341\364\223\25\274\344\1\336\367\374" \
+ "\216\376\377\374\1n\333\362\225\25\274\344\2#\304\346\336\367\374\214" \
+ "\376\377\374\2\235\346\365\0\276\345\220\25\274\344\1M\323\357\211\376" \
+ "\377\374\1\211\230\236\222]oz\1s\206\221\256\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \
+ "\1\231\241\251\222]oz\1ew\202\211\376\377\374\1\231\342\362\223\25\274" \
+ "\344\1\320\365\376\216\376\377\374\1\221\344\362\224\25\274\344\2#\304" \
+ "\346\336\367\374\214\376\377\374\2\235\346\365\0\276\345\221\25\274\344" \
+ "\1i\326\356\211\376\377\374\1\202\221\227\222]oz\1u\210\224\256\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\256\376\377\374\1\242\252\262\222]oz\1^p{\211\376\377\374\1\237\350" \
+ "\367\223\25\274\344\1\301\356\366\216\376\377\374\1\333\364\371\223\25" \
+ "\274\344\2#\304\346\336\367\374\214\376\377\374\2\356\373\374\0\276\345" \
+ "\222\25\274\344\1n\333\362\211\376\377\374\1w\212\226\222]oz\1\202\221" \
+ "\227\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\256\376\377\374\1\246\256\266\223]oz\1\370\372\367\210" \
+ "\376\377\374\1\260\353\366\223\25\274\344\1\233\345\364\217\376\377\374" \
+ "\1,\311\352\221\25\274\344\2#\304\346\336\367\374\215\376\377\374\1\312" \
+ "\357\370\223\25\274\344\1\204\335\361\211\376\377\374\1o\202\215\222" \
+ "]oz\1\205\224\232\256\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\256\376\377\374\1\252\262\272\223]oz\1\355" \
+ "\362\365\210\376\377\374\1\314\361\372\223\25\274\344\1m\332\361\217" \
+ "\376\377\374\1\273\354\371\220\25\274\344\2#\304\346\336\367\374\216" \
+ "\376\377\374\1\233\345\364\223\25\274\344\1\236\347\366\211\376\377\374" \
+ "\1i{\206\222]oz\1\211\230\236\256\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\266\277\307" \
+ "\223]oz\1\340\345\350\210\376\377\374\1\356\373\374\223\25\274\344\1" \
+ ",\311\352\220\376\377\374\1i\326\356\216\25\274\344\2#\304\346\336\367" \
+ "\374\217\376\377\374\1\\\326\355\223\25\274\344\1\274\355\373\210\376" \
+ "\377\374\2\372\374\371_q|\222]oz\1\226\246\254\256\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377" \
+ "\374\1\307\315\317\223]oz\1\313\320\322\211\376\377\374\1\0\302\351\222" \
+ "\25\274\344\2\0\276\345\357\374\375\217\376\377\374\2\370\376\377G\317" \
+ "\353\214\25\274\344\2(\307\350\336\367\374\220\376\377\374\1%\305\347" \
+ "\223\25\274\344\1\336\367\374\210\376\377\374\1\343\350\353\223]oz\1" \
+ "\254\264\274\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\256\376\377\374\1\327\334\337\223]oz\1\257\267" \
+ "\277\211\376\377\374\1B\314\347\223\25\274\344\1\237\350\367\220\376" \
+ "\377\374\3\370\376\377n\333\362\31\275\345\211\25\274\344\2J\321\355" \
+ "\356\373\374\220\376\377\374\1\315\362\373\223\25\274\344\1\0\301\350" \
+ "\211\376\377\374\1\316\323\326\223]oz\1\276\303\305\256\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376" \
+ "\377\374\1\346\354\356\223]oz\1\225\245\253\211\376\377\374\1k\327\357" \
+ "\223\25\274\344\1G\317\353\222\376\377\374\3\320\365\376Z\325\354\0\301" \
+ "\350\204\25\274\344\3\0\276\345G\317\353\274\355\373\222\376\377\374" \
+ "\1w\333\356\223\25\274\344\1""3\314\355\211\376\377\374\1\264\274\305" \
+ "\223]oz\1\315\322\325\256\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\256\376\377\374\1\366\373\376\223]o" \
+ "z\1z\215\231\211\376\377\374\1\237\350\367\223\25\274\344\2\31\275\345" \
+ "\335\366\373\223\376\377\374\2\370\376\377\316\363\374\202\261\354\367" \
+ "\2\313\360\371\366\373\376\223\376\377\374\2\370\376\377\0\302\351\223" \
+ "\25\274\344\1n\333\362\211\376\377\374\1\230\250\256\223]oz\1\334\342" \
+ "\344\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\257\376\377\374\1m\200\213\222]oz\1ew\202\211\376\377" \
+ "\374\1\347\370\376\224\25\274\344\1m\332\361\254\376\377\374\1\233\345" \
+ "\364\224\25\274\344\1\261\354\367\211\376\377\374\1}\220\233\223]oz\1" \
+ "\366\370\364\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\257\376\377\374\1\211\230\236\223]oz\1\335\343" \
+ "\345\211\376\377\374\1%\305\347\223\25\274\344\2\0\276\345\336\367\374" \
+ "\252\376\377\374\2\367\375\377#\304\346\223\25\274\344\2\31\275\345\357" \
+ "\374\375\210\376\377\374\2\370\372\367as~\222]oz\1m\200\213\257\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\257\376\377\374\1\251\261\271\223]oz\1\264\274\305\211\376\377\374\1" \
+ "k\327\357\224\25\274\344\1L\322\356\252\376\377\374\1\206\340\363\224" \
+ "\25\274\344\1""3\314\355\211\376\377\374\1\322\330\332\223]oz\1\211\230" \
+ "\236\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\257\376\377\374\1\305\312\315\223]oz\1\211\230\236\211" \
+ "\376\377\374\1\301\356\366\225\25\274\344\1\262\355\370\250\376\377\374" \
+ "\2\334\365\372\0\276\345\224\25\274\344\1\220\343\361\211\376\377\374" \
+ "\1\252\262\272\223]oz\1\251\261\271\257\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\337\344" \
+ "\346\223]oz\2ew\202\373\375\372\210\376\377\374\2\370\376\377#\304\346" \
+ "\224\25\274\344\2\0\302\351\347\370\376\246\376\377\374\2\367\375\377" \
+ ",\311\352\224\25\274\344\2\0\276\345\337\370\375\211\376\377\374\1\177" \
+ "\216\224\223]oz\1\305\312\315\257\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\2\373\375\372" \
+ "dv\201\223]oz\1\331\336\341\211\376\377\374\1n\333\362\225\25\274\344" \
+ "\2B\314\347\370\376\377\245\376\377\374\1i\326\356\225\25\274\344\1B" \
+ "\314\347\211\376\377\374\2\362\367\371_q|\223]oz\1\346\354\356\257\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\260\376\377\374\1\210\227\235\223]oz\1\246\256\266\211\376\377\374" \
+ "\1\316\363\374\226\25\274\344\2M\323\357\370\376\377\243\376\377\374" \
+ "\1\206\340\363\226\25\274\344\1\256\350\364\211\376\377\374\1\301\306" \
+ "\311\223]oz\1k~\211\260\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\260\376\377\374\1\257\267\277\223]oz\2i" \
+ "{\206\373\375\372\211\376\377\374\1G\317\353\226\25\274\344\2\\\326\355" \
+ "\370\376\377\241\376\377\374\1\220\343\361\226\25\274\344\2\0\304\352" \
+ "\370\376\377\211\376\377\374\1\204\223\231\223]oz\1\230\240\250\260\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\260\376\377\374\1\331\336\341\224]oz\1\317\324\327\211\376\377\374" \
+ "\1\301\356\366\227\25\274\344\2J\321\355\367\375\377\237\376\377\374" \
+ "\1w\333\356\227\25\274\344\1\206\340\363\211\376\377\374\2\351\356\360" \
+ "^p{\223]oz\1\277\304\306\260\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\260\376\377\374\2\372\374\371cu" \
+ "\200\223]oz\1\222\241\247\212\376\377\374\1/\312\353\227\25\274\344\2" \
+ ",\311\352\334\365\372\234\376\377\374\2\356\373\374I\320\354\227\25\274" \
+ "\344\2\0\301\350\366\373\376\211\376\377\374\1\261\271\302\224]oz\1\343" \
+ "\350\353\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\261\376\377\374\1\216\236\244\223]oz\2cu\200\362" \
+ "\367\371\211\376\377\374\1\261\354\367\230\25\274\344\3\0\276\345\233" \
+ "\345\364\370\376\377\231\376\377\374\2\262\355\370\0\304\352\230\25\274" \
+ "\344\1\206\340\363\212\376\377\374\1s\206\221\223]oz\1q\204\217\261\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\261\376\377\374\1\305\312\315\224]oz\1\257\267\277\212\376\377\374" \
+ "\1B\314\347\231\25\274\344\2""1\313\354\303\361\370\226\376\377\374\2" \
+ "\334\365\372J\321\355\231\25\274\344\2#\304\346\366\373\376\211\376\377" \
+ "\374\1\315\322\325\224]oz\1\251\261\271\261\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\261\376\377\374\2\362" \
+ "\367\371as~\223]oz\2hz\205\370\372\367\211\376\377\374\2\334\365\372" \
+ "\0\276\345\232\25\274\344\3B\314\347\262\355\370\370\376\377\221\376" \
+ "\377\374\3\313\360\371L\322\356\0\276\345\232\25\274\344\1\256\350\364" \
+ "\212\376\377\374\1z\215\231\224]oz\1\333\340\343\261\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376" \
+ "\377\374\1\207\226\234\224]oz\1\270\300\311\212\376\377\374\1w\333\356" \
+ "\234\25\274\344\4\0\304\352m\332\361\273\354\371\366\373\376\212\376" \
+ "\377\374\4\370\376\377\302\357\367y\336\360(\307\350\234\25\274\344\1" \
+ "B\314\347\212\376\377\374\1\324\331\333\224]oz\1k~\211\262\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262" \
+ "\376\377\374\1\301\306\311\224]oz\2k~\211\372\374\371\211\376\377\374" \
+ "\2\366\373\376(\307\350\236\25\274\344\5\31\275\345,\311\352M\323\357" \
+ "y\336\360\211\342\365\202\233\345\364\5\220\343\361\204\335\361Z\325" \
+ "\3541\313\354\0\276\345\236\25\274\344\2\0\301\350\336\367\374\212\376" \
+ "\377\374\1\205\224\232\224]oz\1\246\256\266\262\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376\377\374" \
+ "\2\367\371\366dv\201\224]oz\1\274\301\303\212\376\377\374\2\315\362\373" \
+ "\0\276\345\307\25\274\344\1\236\347\366\212\376\377\374\1\325\332\334" \
+ "\225]oz\1\341\346\351\262\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\263\376\377\374\1\236\246\256\224]o" \
+ "z\2fx\203\356\363\366\212\376\377\374\1\221\344\362\306\25\274\344\1" \
+ "M\323\357\212\376\377\374\2\372\374\371t\207\222\224]oz\1\177\216\224" \
+ "\263\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\263\376\377\374\1\333\340\343\225]oz\1\226\246\254\213\376" \
+ "\377\374\1L\322\356\304\25\274\344\2,\311\352\366\373\376\212\376\377" \
+ "\374\1\265\276\306\225]oz\1\302\307\312\263\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1u\210" \
+ "\224\224]oz\2^p{\331\336\341\212\376\377\374\2\366\373\376/\312\353\302" \
+ "\25\274\344\2\0\302\351\336\367\374\212\376\377\374\2\353\360\363dv\201" \
+ "\224]oz\2dv\201\364\371\374\263\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\264\376\377\374\1\302\307\312\225" \
+ "]oz\2w\212\226\372\374\371\212\376\377\374\2\350\371\377%\305\347\300" \
+ "\25\274\344\2\0\301\350\314\361\372\213\376\377\374\1\227\237\247\225" \
+ "]oz\1\246\256\266\264\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\264\376\377\374\2\372\374\371l\177\212\225" \
+ "]oz\1\252\262\272\213\376\377\374\2\337\370\375\0\304\352\276\25\274" \
+ "\344\2\0\276\345\274\355\373\213\376\377\374\1\305\312\315\225]oz\2a" \
+ "s~\353\360\363\264\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\265\376\377\374\1\270\300\311\225]oz\2^p{\322" \
+ "\330\332\213\376\377\374\2\332\363\370#\304\346\274\25\274\344\2\0\276" \
+ "\345\273\354\371\213\376\377\374\2\343\350\353dv\201\225]oz\1\236\246" \
+ "\256\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\265\376\377\374\2\365\372\375hz\205\225]oz\2i{\206\354" \
+ "\361\364\213\376\377\374\2\337\370\375*\310\351\272\25\274\344\2\0\302" \
+ "\351\314\361\372\213\376\377\374\2\371\373\370x\213\227\225]oz\2_q|\346" \
+ "\354\356\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\266\376\377\374\1\261\271\302\226]oz\2\205\224\232" \
+ "\373\375\372\213\376\377\374\2\356\373\374B\314\347\270\25\274\344\2" \
+ "%\305\347\335\366\373\214\376\377\374\1\242\252\262\226]oz\1\231\241" \
+ "\251\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\266\376\377\374\2\370\372\367m\200\213\226]oz\1\242" \
+ "\252\262\214\376\377\374\2\367\375\377i\326\356\266\25\274\344\2B\314" \
+ "\347\350\371\377\214\376\377\374\1\277\304\306\226]oz\2bt\177\351\356" \
+ "\360\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\267\376\377\374\1\305\312\315\227]oz\1\261\271\302\215" \
+ "\376\377\374\2\250\347\371\0\301\350\262\25\274\344\3\31\275\345\206" \
+ "\340\363\370\376\377\214\376\377\374\2\316\323\326_q|\226]oz\1\251\261" \
+ "\271\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\270\376\377\374\1y\214\230\226]oz\2^p{\301\306\311\215" \
+ "\376\377\374\2\335\366\373/\312\353\260\25\274\344\2#\304\346\312\357" \
+ "\370\215\376\377\374\2\330\335\340cu\200\226]oz\2hz\205\366\370\364\267" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\270\376\377\374\1\332\337\342\230\222\241\247\1\353\360\363" \
+ "\215\376\377\374\3\370\376\377\231\342\362\0\301\350\254\25\274\344\3" \
+ "\0\276\345w\333\356\366\373\376\215\376\377\374\2\365\372\375\236\246" \
+ "\256\227\222\241\247\1\307\315\317\270\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\341\376\377\374\3\356\373" \
+ "\374i\326\356\0\276\345\251\25\274\344\2J\321\355\335\366\373\341\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\343\376\377\374\3\316\363\374Z\325\354\31\275\345\245\25\274\344" \
+ "\2G\317\353\302\357\367\343\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\345\376\377\374\3\336\367\374m\332\361" \
+ "\0\276\345\240\25\274\344\3\31\275\345M\323\357\316\363\374\345\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\347\376\377\374\4\366\373\376\237\350\367I\320\354\31\275\345\232\25" \
+ "\274\344\4\0\276\345B\314\347\231\342\362\356\373\374\347\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\352" \
+ "\376\377\374\4\356\373\374\235\346\365Z\325\354#\304\346\224\25\274\344" \
+ "\4\0\302\351L\322\356\221\344\362\336\367\374\352\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\356\376\377" \
+ "\374\6\336\367\374\237\350\367w\333\356M\323\357,\311\352\0\276\345\210" \
+ "\25\274\344\6\0\276\345*\310\351J\321\355n\333\362\233\345\364\320\365" \
+ "\376\356\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\364\376\377\374\10\367\375\377\356\373\374\335\366\373" \
+ "\316\363\374\315\362\373\335\366\373\350\371\377\366\373\376\364\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
+ "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\375\376\377\374\202" \
+ "\370\376\377\250\376\377\374\1\367\375\377\217\376\377\374\1\367\375" \
+ "\377\237\376\377\374\1\367\375\377\230\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374\4\237\350" \
+ "\367\0\276\345\31\275\345\203\334\360\245\376\377\374\5\316\363\374#" \
+ "\304\346\25\274\344G\317\353\367\375\377\213\376\377\374\5\335\366\373" \
+ "(\307\350\25\274\344B\314\347\366\373\376\233\376\377\374\5\356\373\374" \
+ "/\312\353\25\274\344*\310\351\337\370\375\226\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374" \
+ "\1#\304\346\203\25\274\344\1\357\374\375\244\376\377\374\1i\326\356\203" \
+ "\25\274\344\1\260\353\366\213\376\377\374\1n\333\362\203\25\274\344\1" \
+ "\235\346\365\233\376\377\374\1\231\342\362\203\25\274\344\1y\336\360" \
+ "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \
+ "\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377" \
+ "\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340" \
+ "\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\374\376\377\374\1\0\301\350" \
+ "\203\25\274\344\1\336\367\374\244\376\377\374\1I\320\354\203\25\274\344" \
+ "\1\231\342\362\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363" \
+ "\233\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377" \
+ "\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357" \
+ "\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274" \
+ "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1" \
+ "\336\367\374\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362" \
+ "\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377" \
+ "\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377" \
+ "\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377\374\1I\320" \
+ "\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357\203\25\274" \
+ "\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274\344\1k\327" \
+ "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\232\376\377\374\7\311\316\321\211\230\236j}\210cu\200" \
+ "n\201\214\233\243\253\333\340\343\206\376\377\374\2\236\246\256dv\201" \
+ "\205]oz\4_q|k~\211\222\241\247\337\344\346\210\376\377\374\7\322\330" \
+ "\332\222\241\247l\177\212cu\200k~\211\222\241\247\322\330\332\206\376" \
+ "\377\374\2\257\267\277gy\204\205]oz\4^p{i{\206\211\230\236\325\332\334" \
+ "\210\376\377\374\10\313\360\371\\\326\355%\305\347\0\276\345\0\302\351" \
+ "G\317\353\237\350\367\370\376\377\205\376\377\374\2\235\346\365\0\304" \
+ "\352\212\25\274\344\4\0\276\345\0\304\352M\323\357\315\362\373\205\376" \
+ "\377\374\1\0\301\350\207\25\274\344\4\0\301\350B\314\347\233\345\364" \
+ "\370\376\377\207\376\377\374\7\302\357\367M\323\357#\304\346\0\276\345" \
+ "\0\304\352J\321\355\260\353\366\210\376\377\374\4\315\362\373M\323\357" \
+ "#\304\346\31\275\345\207\25\274\344\1\231\342\362\204\376\377\374\4\323" \
+ "\364\367\\\326\355%\305\347\0\276\345\207\25\274\344\1\206\340\363\205" \
+ "\376\377\374\10\334\365\372m\332\361(\307\350\0\276\345\0\302\351B\314" \
+ "\347\233\345\364\370\376\377\207\376\377\374\4\336\367\374m\332\361(" \
+ "\307\350\0\276\345\207\25\274\344\1k\327\357\226\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\230\376\377" \
+ "\374\2\356\363\366\202\221\227\206]oz\3^p{\247\257\267\373\375\372\203" \
+ "\376\377\374\1\327\334\337\212]oz\2_q|\303\310\313\205\376\377\374\2" \
+ "\364\371\374\222\241\247\207]oz\2\222\241\247\370\372\367\203\376\377" \
+ "\374\2\353\360\363^p{\212]oz\1\254\264\274\205\376\377\374\2\370\376" \
+ "\377m\332\361\207\25\274\344\2B\314\347\350\371\377\203\376\377\374\2" \
+ "\370\376\377\0\276\345\216\25\274\344\2\31\275\345\235\346\365\204\376" \
+ "\377\374\1\0\301\350\212\25\274\344\2B\314\347\357\374\375\204\376\377" \
+ "\374\2\367\375\377Z\325\354\207\25\274\344\2G\317\353\357\374\375\205" \
+ "\376\377\374\2\235\346\365\31\275\345\212\25\274\344\1\231\342\362\203" \
+ "\376\377\374\2\256\350\364\0\276\345\212\25\274\344\1\206\340\363\204" \
+ "\376\377\374\2\206\340\363\31\275\345\206\25\274\344\2*\310\351\335\366" \
+ "\373\205\376\377\374\2\302\357\367\0\301\350\212\25\274\344\1k\327\357" \
+ "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\227\376\377\374\2\364\371\374u\210\224\211]oz\1\242\252" \
+ "\262\203\376\377\374\1\306\314\316\213]oz\2_q|\325\332\334\203\376\377" \
+ "\374\2\373\375\372\210\227\235\211]oz\2\211\230\236\373\375\372\202\376" \
+ "\377\374\1\330\335\340\214]oz\1\304\311\314\204\376\377\374\1i\326\356" \
+ "\211\25\274\344\2*\310\351\366\373\376\202\376\377\374\1\357\374\375" \
+ "\220\25\274\344\2\0\276\345\274\355\373\203\376\377\374\1\0\301\350\213" \
+ "\25\274\344\1M\323\357\204\376\377\374\1L\322\356\211\25\274\344\2""3" \
+ "\314\355\370\376\377\203\376\377\374\2\313\360\371\0\276\345\213\25\274" \
+ "\344\1\231\342\362\202\376\377\374\2\333\364\371\0\276\345\213\25\274" \
+ "\344\1\206\340\363\203\376\377\374\1\206\340\363\211\25\274\344\2\0\304" \
+ "\352\347\370\376\203\376\377\374\2\356\373\374\0\304\352\213\25\274\344" \
+ "\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\227\376\377\374\1\251\261\271\213]oz\1\322\330\332" \
+ "\202\376\377\374\1\306\314\316\214]oz\1\200\217\225\203\376\377\374\1" \
+ "\277\304\306\213]oz\1\277\304\306\202\376\377\374\1\330\335\340\214]" \
+ "oz\2j}\210\373\375\372\202\376\377\374\1\273\354\371\213\25\274\344\1" \
+ "n\333\362\202\376\377\374\1\357\374\375\221\25\274\344\1""1\313\354\203" \
+ "\376\377\374\1\0\301\350\214\25\274\344\1\332\363\370\202\376\377\374" \
+ "\1\237\350\367\213\25\274\344\1\206\340\363\203\376\377\374\1I\320\354" \
+ "\214\25\274\344\1\231\342\362\202\376\377\374\1M\323\357\214\25\274\344" \
+ "\1\206\340\363\202\376\377\374\2\320\365\376\31\275\345\212\25\274\344" \
+ "\1L\322\356\203\376\377\374\1\203\334\360\214\25\274\344\1k\327\357\226" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\226\376\377\374\2\370\372\367cu\200\203]oz\5s\206\221\317\324" \
+ "\327\343\350\353\276\303\305ew\202\203]oz\1\210\227\235\202\376\377\374" \
+ "\1\306\314\316\203]oz\1y\214\230\203\347\355\357\2\346\354\356\264\274" \
+ "\305\203]oz\2^p{\357\365\367\202\376\377\374\1p\203\216\203]oz\5k~\211" \
+ "\307\315\317\343\350\353\306\314\316k~\211\203]oz\1p\203\216\202\376" \
+ "\377\374\1\330\335\340\203]oz\1k~\211\204\347\355\357\2\304\311\314_" \
+ "q|\203]oz\1\334\342\344\202\376\377\374\1B\314\347\203\25\274\344\5\0" \
+ "\301\350\233\345\364\333\364\371\260\353\366(\307\350\203\25\274\344" \
+ "\4\0\276\345\367\375\377\376\377\374\357\374\375\204\25\274\344\203\335" \
+ "\366\373\204\25\274\344\3\302\357\367\335\366\373\206\340\363\204\25" \
+ "\274\344\1\356\373\374\202\376\377\374\1\0\301\350\203\25\274\344\1\302" \
+ "\357\367\203\335\366\373\2\302\357\367\0\304\352\203\25\274\344\1\207" \
+ "\341\364\202\376\377\374\1,\311\352\203\25\274\344\5\0\302\351\236\347" \
+ "\366\332\363\370\256\350\364#\304\346\203\25\274\344\5\0\302\351\370" \
+ "\376\377\376\377\374\370\376\377\0\276\345\203\25\274\344\1w\333\356" \
+ "\204\335\366\373\1B\314\347\203\25\274\344\1\231\342\362\202\376\377" \
+ "\374\1\0\276\345\203\25\274\344\2m\332\361\334\365\372\203\335\366\373" \
+ "\1I\320\354\203\25\274\344\1\206\340\363\202\376\377\374\1i\326\356\203" \
+ "\25\274\344\5\0\276\345\206\340\363\323\364\367\273\354\3711\313\354" \
+ "\204\25\274\344\1\335\366\373\202\376\377\374\1,\311\352\203\25\274\344" \
+ "\2L\322\356\332\363\370\203\335\366\373\1n\333\362\203\25\274\344\1k" \
+ "\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\226\376\377\374\1\324\331\333\203]oz\2cu\200\353" \
+ "\360\363\203\376\377\374\1\307\315\317\203]oz\4as~\372\374\371\376\377" \
+ "\374\306\314\316\203]oz\1\202\221\227\205\376\377\374\1hz\205\203]oz" \
+ "\3\341\346\351\376\377\374\347\355\357\203]oz\2^p{\335\343\345\203\376" \
+ "\377\374\1\333\340\343\204]oz\3\347\355\357\376\377\374\330\335\340\203" \
+ "]oz\1m\200\213\205\376\377\374\1~\215\223\203]oz\4\313\320\322\376\377" \
+ "\374\370\376\377\31\275\345\203\25\274\344\1\256\350\364\203\376\377" \
+ "\374\2\336\367\374\0\276\345\203\25\274\344\3\274\355\373\376\377\374" \
+ "\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367" \
+ "\374\202\376\377\374\1\0\301\350\203\25\274\344\1\323\364\367\202\376" \
+ "\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374\1n" \
+ "\333\362\203\25\274\344\3m\332\361\376\377\374\356\373\374\204\25\274" \
+ "\344\1\274\355\373\203\376\377\374\2\323\364\367\0\276\345\203\25\274" \
+ "\344\3\315\362\373\376\377\374\335\366\373\203\25\274\344\2\0\276\345" \
+ "\370\376\377\204\376\377\374\1I\320\354\203\25\274\344\3\231\342\362" \
+ "\376\377\374\366\373\376\204\25\274\344\1\366\373\376\204\376\377\374" \
+ "\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\1%\305\347\203" \
+ "\25\274\344\1\207\341\364\203\376\377\374\2\360\375\376\0\304\352\203" \
+ "\25\274\344\1\233\345\364\202\376\377\374\1\0\301\350\203\25\274\344" \
+ "\1\323\364\367\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357" \
+ "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\226\376\377\374\1\303\310\313\203]oz\1\204\223\231\204\376" \
+ "\377\374\2\370\372\367_q|\203]oz\3\354\361\364\376\377\374\306\314\316" \
+ "\203]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351" \
+ "\376\377\374\326\333\335\203]oz\1n\201\214\205\376\377\374\1l\177\212" \
+ "\203]oz\3\327\334\337\376\377\374\330\335\340\203]oz\1m\200\213\205\376" \
+ "\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\337\370\375\203" \
+ "\25\274\344\2\31\275\345\370\376\377\204\376\377\374\1""3\314\355\203" \
+ "\25\274\344\3\236\347\366\376\377\374\357\374\375\204\25\274\344\203" \
+ "\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346" \
+ "\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274" \
+ "\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357" \
+ "\376\377\374\315\362\373\203\25\274\344\1\0\301\350\205\376\377\374\1" \
+ "*\310\351\203\25\274\344\3\261\354\367\376\377\374\316\363\374\203\25" \
+ "\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \
+ "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \
+ "\357\203\25\274\344\1\206\340\363\202\376\377\374\1\31\275\345\203\25" \
+ "\274\344\1\335\366\373\204\376\377\374\1M\323\357\203\25\274\344\1\203" \
+ "\334\360\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204" \
+ "\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226" \
+ "\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202" \
+ "\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205" \
+ "\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327" \
+ "\203]oz\1as~\205o\202\215\1as~\203]oz\3\317\324\327\376\377\374\330\335" \
+ "\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306\314" \
+ "\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\205%\305\347" \
+ "\1\0\276\345\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204" \
+ "\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377" \
+ "\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301" \
+ "\350\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274" \
+ "\344\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\31\275\345\205" \
+ "%\305\347\1\0\276\345\203\25\274\344\3\237\350\367\376\377\374\316\363" \
+ "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \
+ "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \
+ "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274" \
+ "\344\1#\304\346\204%\305\347\1\0\301\350\203\25\274\344\1w\333\356\202" \
+ "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \
+ "\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376\377\374" \
+ "\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203]oz\3" \
+ "\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376\377" \
+ "\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215]oz\3" \
+ "\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374" \
+ "\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25\274" \
+ "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376\377" \
+ "\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274" \
+ "\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \
+ "\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376\377\374" \
+ "\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363\374\203" \
+ "\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \
+ "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \
+ "\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274\344\1w\333" \
+ "\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376" \
+ "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376" \
+ "\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203" \
+ "]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376" \
+ "\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215" \
+ "]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377" \
+ "\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25" \
+ "\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376" \
+ "\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203" \
+ "\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344" \
+ "\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376" \
+ "\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363" \
+ "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \
+ "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \
+ "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274" \
+ "\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \
+ "\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\226\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374" \
+ "\1ew\202\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221" \
+ "\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317" \
+ "\324\327\215]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213" \
+ "\205\376\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367" \
+ "\374\215\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274" \
+ "\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#" \
+ "\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203" \
+ "\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3" \
+ "k\327\357\376\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377" \
+ "\374\316\363\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354" \
+ "\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344" \
+ "\205\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377" \
+ "\374\215\25\274\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274" \
+ "\344\1\336\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327" \
+ "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\226\376\377\374\1\300\305\310\203]oz\1\211\230\236\205" \
+ "\376\377\374\1bt\177\203]oz\3\352\357\362\376\377\374\306\314\316\203" \
+ "]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376" \
+ "\377\374\317\324\327\203]oz\1p\203\216\211\335\343\345\3\366\370\364" \
+ "\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \
+ "\227\203]oz\3\306\314\316\376\377\374\336\367\374\203\25\274\344\1\0" \
+ "\276\345\211\314\361\372\3\350\371\377\376\377\374\357\374\375\204\25" \
+ "\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374" \
+ "\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350" \
+ "\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344" \
+ "\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\0\302\351\211\314" \
+ "\361\372\3\356\373\374\376\377\374\316\363\374\203\25\274\344\1\0\301" \
+ "\350\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376\377" \
+ "\374\357\374\375\204\25\274\344\205\376\377\374\1M\323\357\203\25\274" \
+ "\344\1\206\340\363\202\376\377\374\204\25\274\344\1\301\356\366\210\314" \
+ "\361\372\1\337\370\375\202\376\377\374\1\0\301\350\203\25\274\344\1\336" \
+ "\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\226\376\377\374\1\314\321\324\203]oz\2l\177\212\372\374\371" \
+ "\203\376\377\374\1\333\340\343\203]oz\4^p{\366\373\376\376\377\374\306" \
+ "\314\316\203]oz\1\202\221\227\205\376\377\374\1k~\211\203]oz\3\341\346" \
+ "\351\376\377\374\320\326\330\203]oz\1t\207\222\213\376\377\374\1\330" \
+ "\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306" \
+ "\314\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\213\376\377" \
+ "\374\1\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336" \
+ "\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202" \
+ "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \
+ "\1n\333\362\203\25\274\344\3k\327\357\376\377\374\303\361\370\203\25" \
+ "\274\344\1\0\304\352\213\376\377\374\1\332\363\370\203\25\274\344\1\0" \
+ "\276\345\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376" \
+ "\377\374\357\374\375\204\25\274\344\1\370\376\377\204\376\377\374\1M" \
+ "\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274\344" \
+ "\1\356\373\374\213\376\377\374\1\0\301\350\203\25\274\344\1\335\366\373" \
+ "\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\226\376\377\374\2\353\360\363^p{\203]oz\5\236\246\256\366\373\376\376" \
+ "\377\374\347\355\357w\212\226\203]oz\1~\215\223\202\376\377\374\1\306" \
+ "\314\316\203]oz\1\202\221\227\204\376\377\374\2\335\343\345^p{\203]o" \
+ "z\3\351\356\360\376\377\374\335\343\345\203]oz\2bt\177\343\350\353\212" \
+ "\376\377\374\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \
+ "\227\203]oz\3\306\314\316\376\377\374\356\373\374\204\25\274\344\1\274" \
+ "\355\373\212\376\377\374\1\357\374\375\204\25\274\344\203\376\377\374" \
+ "\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344" \
+ "\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \
+ "\203\376\377\374\2\367\375\377/\312\353\203\25\274\344\3\204\335\361" \
+ "\376\377\374\334\365\372\203\25\274\344\2\0\276\345\314\361\372\212\376" \
+ "\377\374\1\356\373\374\204\25\274\344\1\274\355\373\204\376\377\374\1" \
+ "I\320\354\203\25\274\344\4\231\342\362\376\377\374\370\376\377\0\276" \
+ "\345\203\25\274\344\1\257\351\365\204\376\377\374\1M\323\357\203\25\274" \
+ "\344\1\206\340\363\202\376\377\374\1\0\301\350\203\25\274\344\1\233\345" \
+ "\364\213\376\377\374\1#\304\346\203\25\274\344\1\207\341\364\204\376" \
+ "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\227\376" \
+ "\377\374\1\211\230\236\204]oz\3cu\200p\203\216^p{\204]oz\1\277\304\306" \
+ "\202\376\377\374\1\306\314\316\203]oz\1dv\201\203~\215\223\2v\211\225" \
+ "as~\203]oz\1n\201\214\202\376\377\374\2\371\373\370dv\201\203]oz\2bt" \
+ "\177w\212\226\205~\215\223\2\203\222\230\304\311\314\202\376\377\374" \
+ "\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]o" \
+ "z\1\306\314\316\202\376\377\374\1(\307\350\203\25\274\344\2\0\276\345" \
+ "*\310\351\205,\311\352\2""1\313\354\207\341\364\202\376\377\374\1\357" \
+ "\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374" \
+ "\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377" \
+ "\374\1\0\301\350\203\25\274\344\1*\310\351\203,\311\352\1\0\302\351\204" \
+ "\25\274\344\4\274\355\373\376\377\374\370\376\377\0\302\351\203\25\274" \
+ "\344\2\31\275\345*\310\351\205,\311\352\2B\314\347\231\342\362\203\376" \
+ "\377\374\1%\305\347\203\25\274\344\2\0\276\345*\310\351\203,\311\352" \
+ "\1\0\301\350\203\25\274\344\1\231\342\362\202\376\377\374\1/\312\353" \
+ "\203\25\274\344\2\0\276\345*\310\351\203,\311\352\1\0\301\350\203\25" \
+ "\274\344\1\206\340\363\202\376\377\374\1G\317\353\204\25\274\344\1(\307" \
+ "\350\205,\311\352\3""1\313\354w\333\356\370\376\377\202\376\377\374\1" \
+ "M\323\357\204\25\274\344\1(\307\350\203,\311\352\1\0\304\352\203\25\274" \
+ "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\227\376\377\374\2\343\350\353ew\202\211]oz\2" \
+ "\177\216\224\373\375\372\202\376\377\374\1\306\314\316\214]oz\1\270\300" \
+ "\311\203\376\377\374\1\253\263\273\213]oz\4_q|\352\357\362\376\377\374" \
+ "\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\1" \
+ "\306\314\316\202\376\377\374\1\233\345\364\214\25\274\344\3\301\356\366" \
+ "\376\377\374\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344" \
+ "\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374" \
+ "\202\376\377\374\1\0\301\350\213\25\274\344\2,\311\352\370\376\377\202" \
+ "\376\377\374\1\206\340\363\214\25\274\344\1\316\363\374\202\376\377\374" \
+ "\1\233\345\364\214\25\274\344\1\231\342\362\202\376\377\374\1\250\347" \
+ "\371\214\25\274\344\1\206\340\363\202\376\377\374\1\273\354\371\214\25" \
+ "\274\344\1\236\347\366\202\376\377\374\2\313\360\371\0\276\345\213\25" \
+ "\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\230\376\377\374\2\325\332\334gy\204\207" \
+ "]oz\2x\213\227\354\361\364\203\376\377\374\1\306\314\316\213]oz\1\225" \
+ "\235\245\204\376\377\374\2\372\374\371~\221\235\213]oz\3\333\340\343" \
+ "\376\377\374\342\347\352\203]oz\1t\207\222\205\376\377\374\1\211\230" \
+ "\236\203]oz\1\317\324\327\203\376\377\374\1M\323\357\213\25\274\344\4" \
+ "\237\350\367\376\377\374\367\375\377\0\276\345\202\25\274\344\1\0\276" \
+ "\345\203\376\377\374\1\0\301\350\203\25\274\344\1\357\374\375\202\376" \
+ "\377\374\1(\307\350\203\25\274\344\1\335\366\373\202\376\377\374\1\0" \
+ "\302\351\212\25\274\344\2\0\301\350\333\364\371\203\376\377\374\2\370" \
+ "\376\377G\317\353\213\25\274\344\1\273\354\371\203\376\377\374\1M\323" \
+ "\357\213\25\274\344\1\237\350\367\203\376\377\374\1k\327\357\213\25\274" \
+ "\344\1\231\342\362\203\376\377\374\1w\333\356\213\25\274\344\1\206\340" \
+ "\363\203\376\377\374\1\207\341\364\213\25\274\344\1n\333\362\226\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\231\376\377\374\3\351\356\360\231\241\251bt\177\203]oz\3k~\211\257" \
+ "\267\277\370\372\367\204\376\377\374\1\306\314\316\211]oz\3gy\204\261" \
+ "\271\302\373\375\372\205\376\377\374\3\371\373\370\252\262\272dv\201" \
+ "\210]oz\2x\213\227\372\374\371\202\376\377\374\4}\220\233]oz^p{\266\277" \
+ "\307\205\376\377\374\5\311\316\321_q|]ozq\204\217\370\372\367\203\376" \
+ "\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344\2\0\304\352" \
+ "\356\373\374\202\376\377\374\1M\323\357\202\25\274\344\1m\332\361\203" \
+ "\376\377\374\1n\333\362\202\25\274\344\1L\322\356\203\376\377\374\1\206" \
+ "\340\363\202\25\274\344\2B\314\347\370\376\377\202\376\377\374\1w\333" \
+ "\356\210\25\274\344\3\0\276\345L\322\356\336\367\374\205\376\377\374" \
+ "\3\370\376\377\204\335\361\0\301\350\210\25\274\344\2(\307\350\366\373" \
+ "\376\203\376\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344" \
+ "\2#\304\346\356\373\374\204\376\377\374\2\233\345\364\0\302\351\210\25" \
+ "\274\344\2\0\302\351\337\370\375\204\376\377\374\2\237\350\367#\304\346" \
+ "\210\25\274\344\2\0\301\350\333\364\371\204\376\377\374\2\257\351\365" \
+ "%\305\347\210\25\274\344\2\0\276\345\314\361\372\226\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\233\376" \
+ "\377\374\4\365\372\375\335\343\345\325\332\334\343\350\353\207\376\377" \
+ "\374\1\306\314\316\203]oz\1u\210\224\204\324\331\333\2\335\343\345\373" \
+ "\375\372\211\376\377\374\2\372\374\371\334\342\344\206\324\331\333\2" \
+ "\331\336\341\372\374\371\203\376\377\374\3\373\375\372\332\337\342\343" \
+ "\350\353\207\376\377\374\3\351\356\360\330\335\340\366\373\376\206\376" \
+ "\377\374\2\370\376\377\316\363\374\206\273\354\371\2\302\357\367\366" \
+ "\373\376\204\376\377\374\2\314\361\372\315\362\373\205\376\377\374\2" \
+ "\316\363\374\313\360\371\205\376\377\374\3\332\363\370\312\357\370\370" \
+ "\376\377\204\376\377\374\1\316\363\374\206\273\354\371\2\302\357\367" \
+ "\356\373\374\211\376\377\374\2\370\376\377\314\361\372\206\273\354\371" \
+ "\2\302\357\367\367\375\377\206\376\377\374\2\370\376\377\316\363\374" \
+ "\206\273\354\371\2\302\357\367\366\373\376\206\376\377\374\2\370\376" \
+ "\377\316\363\374\206\273\354\371\2\301\356\366\357\374\375\207\376\377" \
+ "\374\1\332\363\370\206\273\354\371\2\301\356\366\356\373\374\207\376" \
+ "\377\374\2\333\364\371\274\355\373\205\273\354\371\2\274\355\373\350" \
+ "\371\377\227\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202\221\227" \
+ "\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202" \
+ "\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203" \
+ "]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314" \
+ "\316\203]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374" \
+ "\1\315\322\325\203]oz\1\211\230\236\377\376\377\374\306\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376" \
+ "\377\374\2\360\366\370i{\206\202]oz\1\302\307\312\377\376\377\374\306" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\247\376\377\374\3\357\365\367\313\320\322\335\343\345\377\376" \
+ "\377\374\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \
+ "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+ "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \
+ "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \
+ "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+ "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \
+ "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+ "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \
+ "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \
+ "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+ "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
+ "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+ "\377\377\377\377\232\377\377\377")
+
+
diff --git a/external/poky/meta/recipes-core/psplash/psplash_git.bb b/external/poky/meta/recipes-core/psplash/psplash_git.bb
new file mode 100644
index 00000000..3ad1ef48
--- /dev/null
+++ b/external/poky/meta/recipes-core/psplash/psplash_git.bb
@@ -0,0 +1,123 @@
+SUMMARY = "Userspace framebuffer boot logo based on usplash"
+DESCRIPTION = "PSplash is a userspace graphical boot splash screen for mainly embedded Linux devices supporting a 16bpp or 32bpp framebuffer. It has few dependencies (just libc), supports basic images and text and handles rotation. Its visual look is configurable by basic source changes. Also included is a 'client' command utility for sending information to psplash such as boot progress information."
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=16;md5=840fb2356b10a85bed78dd09dc7745c6"
+
+SRCREV = "2015f7073e98dd9562db0936a254af5ef56356cf"
+PV = "0.1+git${SRCPV}"
+PR = "r15"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+ file://psplash-init \
+ ${SPLASH_IMAGES}"
+UPSTREAM_CHECK_COMMITS = "1"
+
+SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"
+
+python __anonymous() {
+ oldpkgs = d.getVar("PACKAGES").split()
+ splashfiles = d.getVar('SPLASH_IMAGES').split()
+ pkgs = []
+ localpaths = []
+ haspng = False
+ for uri in splashfiles:
+ fetcher = bb.fetch2.Fetch([uri], d)
+ flocal = os.path.basename(fetcher.localpath(uri))
+ fbase = os.path.splitext(flocal)[0]
+ outsuffix = fetcher.ud[uri].parm.get("outsuffix")
+ if not outsuffix:
+ if fbase.startswith("psplash-"):
+ outsuffix = fbase[8:]
+ else:
+ outsuffix = fbase
+ if outsuffix.endswith('-img'):
+ outsuffix = outsuffix[:-4]
+ outname = "psplash-%s" % outsuffix
+ if outname == '' or outname in oldpkgs:
+ bb.fatal("The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter" % (outname, uri))
+ else:
+ pkgs.append(outname)
+ if flocal.endswith(".png"):
+ haspng = True
+ localpaths.append(flocal)
+
+ # Set these so that we have less work to do in do_compile and do_install_append
+ d.setVar("SPLASH_INSTALL", " ".join(pkgs))
+ d.setVar("SPLASH_LOCALPATHS", " ".join(localpaths))
+
+ if haspng:
+ d.appendVar("DEPENDS", " gdk-pixbuf-native")
+
+ d.prependVar("PACKAGES", "%s " % (" ".join(pkgs)))
+ mlprefix = d.getVar('MLPREFIX') or ''
+ pn = d.getVar('PN') or ''
+ for p in pkgs:
+ ep = '%s%s' % (mlprefix, p)
+ epsplash = '%s%s' % (mlprefix, 'psplash')
+ d.setVar("FILES_%s" % ep, "${bindir}/%s" % p)
+ d.setVar("ALTERNATIVE_%s" % ep, 'psplash')
+ d.setVarFlag("ALTERNATIVE_TARGET_%s" % ep, 'psplash', '${bindir}/%s' % p)
+ d.appendVar("RDEPENDS_%s" % ep, " %s" % pn)
+ if p == "psplash-default":
+ d.appendVar("RRECOMMENDS_%s" % pn, " %s" % ep)
+}
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig update-rc.d update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash"
+
+python do_compile () {
+ import shutil
+ import subprocess
+ import shlex
+
+ # Build a separate executable for each splash image
+ workdir = d.getVar('WORKDIR')
+ convertscript = "%s/make-image-header.sh" % d.getVar('S')
+ destfile = "%s/psplash-poky-img.h" % d.getVar('S')
+ localfiles = d.getVar('SPLASH_LOCALPATHS').split()
+ outputfiles = d.getVar('SPLASH_INSTALL').split()
+ for localfile, outputfile in zip(localfiles, outputfiles):
+ if localfile.endswith(".png"):
+ subprocess.call(shlex.split('%s %s POKY' % (convertscript, os.path.join(workdir, localfile))))
+ fbase = os.path.splitext(localfile)[0]
+ shutil.copyfile("%s-img.h" % fbase, destfile)
+ else:
+ shutil.copyfile(os.path.join(workdir, localfile), destfile)
+ # For some reason just updating the header is not enough, we have to touch the .c
+ # file in order to get it to rebuild
+ os.utime("%s/psplash.c" % d.getVar('S'), None)
+ bb.build.exec_func("oe_runmake", d)
+ shutil.copyfile("psplash", outputfile)
+}
+
+do_install_append() {
+ install -d ${D}/mnt/.psplash/
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh
+ install -d ${D}${bindir}
+ for i in ${SPLASH_INSTALL} ; do
+ install -m 0755 $i ${D}${bindir}/$i
+ done
+ rm -f ${D}${bindir}/psplash
+}
+
+FILES_${PN} += "/mnt/.psplash"
+
+INITSCRIPT_NAME = "psplash.sh"
+INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."
+
+PACKAGE_WRITE_DEPS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+ systemctl $OPTS mask psplash.service
+ fi
+}
diff --git a/external/poky/meta/recipes-core/readline/files/inputrc b/external/poky/meta/recipes-core/readline/files/inputrc
new file mode 100644
index 00000000..b5c4c8af
--- /dev/null
+++ b/external/poky/meta/recipes-core/readline/files/inputrc
@@ -0,0 +1,61 @@
+# /etc/inputrc - global inputrc for libreadline
+# See readline(3readline) and `info rluserman' for more information.
+
+# Be 8 bit clean.
+set input-meta on
+set output-meta on
+
+# To allow the use of 8bit-characters like the german umlauts, comment out
+# the line below. However this makes the meta key not work as a meta key,
+# which is annoying to those which don't need to type in 8-bit characters.
+
+# set convert-meta off
+
+# try to enable the application keypad when it is called. Some systems
+# need this to enable the arrow keys.
+# set enable-keypad on
+
+# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
+
+# do not bell on tab-completion
+# set bell-style none
+
+# some defaults / modifications for the emacs mode
+$if mode=emacs
+
+# allow the use of the Home/End keys
+# "\e[1~": beginning-of-line
+# "\e[4~": end-of-line
+
+# allow the use of the Delete/Insert keys
+# "\e[3~": delete-char
+# "\e[2~": quoted-insert
+
+# mappings for "page up" and "page down" to step to the beginning/end
+# of the history
+# "\e[5~": beginning-of-history
+# "\e[6~": end-of-history
+
+# alternate mappings for "page up" and "page down" to search the history
+# "\e[5~": history-search-backward
+# "\e[6~": history-search-forward
+
+# # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
+# "\e[5C": forward-word
+# "\e[5D": backward-word
+# "\e\e[C": forward-word
+# "\e\e[D": backward-word
+
+# $if term=rxvt
+# "\e[8~": end-of-line
+# $endif
+
+# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
+# "\eOH": beginning-of-line
+# "\eOF": end-of-line
+
+# for freebsd console
+# "\e[H": beginning-of-line
+# "\e[F": end-of-line
+
+$endif
diff --git a/external/poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch b/external/poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch
new file mode 100644
index 00000000..ef3104f8
--- /dev/null
+++ b/external/poky/meta/recipes-core/readline/readline-7.0/configure-fix.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+Without this it fails to link against libtermcap causing various missing
+symbols issues.
+
+RP - 8/10/08
+
+Support 6.3 which uses configure.ac rather than configure.in.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index cea8f91..9075b8f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -218,10 +218,10 @@ if test -f ${srcdir}/support/shobj-conf; then
+ AC_MSG_CHECKING(configuration for building shared libraries)
+ eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+
+-# case "$SHLIB_LIBS" in
+-# *curses*|*termcap*|*termlib*) ;;
+-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
+-# esac
++ case "$SHLIB_LIBS" in
++ *curses*|*termcap*|*termlib*) ;;
++ *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
++ esac
+
+ AC_SUBST(SHOBJ_CC)
+ AC_SUBST(SHOBJ_CFLAGS)
+--
+1.8.1.2
+
diff --git a/external/poky/meta/recipes-core/readline/readline-7.0/norpath.patch b/external/poky/meta/recipes-core/readline/readline-7.0/norpath.patch
new file mode 100644
index 00000000..5d71582b
--- /dev/null
+++ b/external/poky/meta/recipes-core/readline/readline-7.0/norpath.patch
@@ -0,0 +1,21 @@
+This support script ends up hardcoding unnecessary rpaths into the libraries. We
+will search $libdir automatically so this is just wastes space. There may be some
+cases this is necessary but our use cases aren't one of them.
+
+Upstream-Status: Inappropriate
+
+RP 2012/2/23
+
+Index: readline-6.2/support/shobj-conf
+===================================================================
+--- readline-6.2.orig/support/shobj-conf 2012-02-23 11:06:37.193179379 +0000
++++ readline-6.2/support/shobj-conf 2012-02-23 11:06:50.049178918 +0000
+@@ -114,7 +114,7 @@
+ SHOBJ_LD='${CC}'
+ SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+
+- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
++ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+ ;;
+
diff --git a/external/poky/meta/recipes-core/readline/readline.inc b/external/poky/meta/recipes-core/readline/readline.inc
new file mode 100644
index 00000000..e9665228
--- /dev/null
+++ b/external/poky/meta/recipes-core/readline/readline.inc
@@ -0,0 +1,45 @@
+SUMMARY = "Library for editing typed command lines"
+DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
+command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes \
+additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those \
+lines, and perform csh-like history expansion on previous commands."
+SECTION = "libs"
+HOMEPAGE = "https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html"
+
+# GPLv2+ (< 6.0), GPLv3+ (>= 6.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS += "ncurses"
+
+SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive"
+SRC_URI += "file://inputrc"
+
+inherit autotools texinfo
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+LEAD_SONAME = "libreadline.so"
+
+do_configure_prepend () {
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+ fi
+}
+
+do_install_append () {
+ # Make install doesn't properly install these
+ oe_libinstall -so -C shlib libhistory ${D}${libdir}
+ oe_libinstall -so -C shlib libreadline ${D}${libdir}
+
+ rmdir ${D}${bindir}
+ rm -rf ${D}${datadir}/${BPN}/*.c
+ rmdir ${D}${datadir}/${BPN} || true
+
+ install -m 0755 -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+CONFFILES_${PN} += "${sysconfdir}/inputrc"
diff --git a/external/poky/meta/recipes-core/readline/readline_7.0.bb b/external/poky/meta/recipes-core/readline/readline_7.0.bb
new file mode 100644
index 00000000..85dfaa62
--- /dev/null
+++ b/external/poky/meta/recipes-core/readline/readline_7.0.bb
@@ -0,0 +1,7 @@
+require readline.inc
+
+SRC_URI += "file://configure-fix.patch \
+ file://norpath.patch"
+
+SRC_URI[archive.md5sum] = "205b03a87fc83dab653b628c59b9fc91"
+SRC_URI[archive.sha256sum] = "750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334"
diff --git a/external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch b/external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch
new file mode 100644
index 00000000..9d828d70
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [http://sourceforge.net/tracker/?func=detail&aid=3600345&group_id=44427&atid=439544]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd sysfsutils-2.1.0/configure.ac sysfsutils-2.1.0/configure.ac
+--- sysfsutils-2.1.0/configure.ac 2006-08-07 08:08:00.000000000 +0300
++++ sysfsutils-2.1.0/configure.ac 2013-01-11 08:13:08.651550634 +0200
+@@ -2,7 +2,7 @@
+ AC_INIT(sysfsutils, 2.1.0, linux-diag-devel@lists.sourceforge.net)
+ AM_INIT_AUTOMAKE
+ AC_CONFIG_SRCDIR([config.h.in])
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ # Checks for KLIBC support (should be before AC_PROG_LIBTOOL and AC_PROG_CC)
+ AC_CHECK_KLIBC
diff --git a/external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch b/external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch
new file mode 100644
index 00000000..82e725e2
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Pending
+
+Fix out of tree build issues so ${B} != ${S} works.
+
+RP 2013/03/18
+
+Index: sysfsutils-2.1.0/cmd/Makefile.am
+===================================================================
+--- sysfsutils-2.1.0.orig/cmd/Makefile.am 2013-03-08 08:57:27.224556508 +0000
++++ sysfsutils-2.1.0/cmd/Makefile.am 2013-03-08 08:57:27.480556502 +0000
+@@ -1,6 +1,6 @@
+ bin_PROGRAMS = systool
+ systool_SOURCES = systool.c names.c names.h
+-INCLUDES = -I../include
++INCLUDES = -I$(srcdir)/../include
+ LDADD = ../lib/libsysfs.la
+ EXTRA_CFLAGS = @EXTRA_CFLAGS@
+ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS)
+Index: sysfsutils-2.1.0/lib/Makefile.am
+===================================================================
+--- sysfsutils-2.1.0.orig/lib/Makefile.am 2013-03-08 08:57:27.224556508 +0000
++++ sysfsutils-2.1.0/lib/Makefile.am 2013-03-08 08:57:27.480556502 +0000
+@@ -1,7 +1,7 @@
+ lib_LTLIBRARIES = libsysfs.la
+ libsysfs_la_SOURCES = sysfs_utils.c sysfs_attr.c sysfs_class.c dlist.c \
+ sysfs_device.c sysfs_driver.c sysfs_bus.c sysfs_module.c sysfs.h
+-INCLUDES = -I../include
++INCLUDES = -I$(srcdir)/../include
+ libsysfs_la_LDFLAGS = -version-info 2:1:0
+ EXTRA_CFLAGS = @EXTRA_CLFAGS@
+ libsysfs_la_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS)
+Index: sysfsutils-2.1.0/test/Makefile.am
+===================================================================
+--- sysfsutils-2.1.0.orig/test/Makefile.am 2013-03-08 08:57:27.224556508 +0000
++++ sysfsutils-2.1.0/test/Makefile.am 2013-03-08 09:06:48.196543326 +0000
+@@ -2,14 +2,14 @@
+ BUILT_SOURCES = test.h
+ CLEANFILES = test.h
+ test.h:
+- ./create-test
++ $(srcdir)/create-test $(srcdir)/libsysfs.conf
+ get_device_SOURCES = get_device.c
+ get_driver_SOURCES = get_driver.c
+ get_module_SOURCES = get_module.c
+ testlibsysfs_SOURCES = test.c test_attr.c test_bus.c test_class.c \
+ test_device.c test_driver.c test_module.c test_utils.c \
+ testout.c test-defs.h libsysfs.conf create-test
+-INCLUDES = -I../include
++INCLUDES = -I$(srcdir)/../include
+ LDADD = ../lib/libsysfs.la
+ EXTRA_CFLAGS = @EXTRA_CLFAGS@
+ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS)
+Index: sysfsutils-2.1.0/test/create-test
+===================================================================
+--- sysfsutils-2.1.0.orig/test/create-test 2005-11-28 10:22:10.000000000 +0000
++++ sysfsutils-2.1.0/test/create-test 2013-03-08 09:07:03.372542838 +0000
+@@ -2,7 +2,7 @@
+
+ rm -f test.h
+
+-conf_file=./libsysfs.conf
++conf_file=$1
+
+ . $conf_file
+
diff --git a/external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch b/external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch
new file mode 100644
index 00000000..1a35b789
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport [from fedora core 9]
+
+This patch is from the Fedora Core 9 sysfsutils-2.1.0-3.fc9 package.
+
+It fixes a problem in the upstream package where not all devices
+will be returned by the function.
+
+The package License indicates this is GPLv2 licensed.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -puN lib/sysfs_class.c~sysfsutils_class_dup lib/sysfs_class.c
+--- sysfsutils-2.1.0/lib/sysfs_class.c~sysfsutils_class_dup 2006-09-07 17:01:26.000000000 -0500
++++ sysfsutils-2.1.0-bjking1/lib/sysfs_class.c 2006-09-07 17:01:26.000000000 -0500
+@@ -66,7 +66,7 @@ static int cdev_name_equal(void *a, void
+ return 0;
+
+ if (strncmp((char *)a, ((struct sysfs_class_device *)b)->name,
+- strlen((char *)a)) == 0)
++ SYSFS_NAME_LEN) == 0)
+ return 1;
+
+ return 0;
diff --git a/external/poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb b/external/poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
new file mode 100644
index 00000000..f9f067dc
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Tools for working with sysfs"
+DESCRIPTION = "Tools for working with the sysfs virtual filesystem. The tool 'systool' can query devices by bus, class and topology."
+HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html"
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LICENSE_${PN} = "GPLv2"
+LICENSE_libsysfs = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3d06403ea54c7574a9e581c6478cc393 \
+ file://cmd/GPL;md5=d41d4e2e1e108554e0388ea4aecd8d27 \
+ file://lib/LGPL;md5=b75d069791103ffe1c0d6435deeff72e"
+PR = "r5"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz \
+ file://sysfsutils-2.0.0-class-dup.patch \
+ file://obsolete_automake_macros.patch \
+ file://separatebuild.patch"
+
+SRC_URI[md5sum] = "14e7dcd0436d2f49aa403f67e1ef7ddc"
+SRC_URI[sha256sum] = "e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a"
+
+UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/linux-diag/files/sysfsutils/"
+UPSTREAM_CHECK_REGEX = "/sysfsutils/(?P<pver>(\d+[\.\-_]*)+)/"
+
+S = "${WORKDIR}/sysfsutils-${PV}"
+
+inherit autotools
+
+PACKAGES =+ "libsysfs"
+FILES_libsysfs = "${libdir}/lib*${SOLIBS}"
+FILES_libsysfs-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
+FILES_libsysfs-staticdev = "${libdir}/lib*.a"
+
+export libdir = "${base_libdir}"
diff --git a/external/poky/meta/recipes-core/systemd/systemd-boot_239.bb b/external/poky/meta/recipes-core/systemd/systemd-boot_239.bb
new file mode 100644
index 00000000..2450d52c
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd-boot_239.bb
@@ -0,0 +1,70 @@
+require systemd.inc
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:"
+
+DEPENDS = "intltool-native libcap util-linux gnu-efi gperf-native"
+
+SRC_URI += "file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
+ file://0006-remove-nobody-user-group-checking.patch \
+ file://0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch \
+ file://0001-meson-rename-Ddebug-to-Ddebug-extra.patch \
+ "
+
+inherit meson pkgconfig gettext
+inherit deploy
+
+EFI_CC ?= "${CC}"
+EXTRA_OEMESON += "-Defi=true \
+ -Dgnu-efi=true \
+ -Defi-includedir=${STAGING_INCDIR}/efi \
+ -Defi-ldsdir=${STAGING_LIBDIR} \
+ -Defi-libdir=${STAGING_LIBDIR} \
+ -Dman=false \
+ -Defi-cc='${EFI_CC}' \
+ -Defi-ld='${LD}' \
+ "
+
+# install to the image as boot*.efi if its the EFI_PROVIDER,
+# otherwise install as the full name.
+# This allows multiple bootloaders to coexist in a single image.
+python __anonymous () {
+ import re
+ target = d.getVar('TARGET_ARCH')
+ prefix = "" if d.getVar('EFI_PROVIDER') == "systemd-boot" else "systemd-"
+ if target == "x86_64":
+ systemdimage = prefix + "bootx64.efi"
+ else:
+ systemdimage = prefix + "bootia32.efi"
+ d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage)
+ prefix = "systemd-" if prefix == "" else ""
+ d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix)
+}
+
+FILES_${PN} = "/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}"
+
+RDEPENDS_${PN} += "virtual/systemd-bootconf"
+
+# Imported from the old gummiboot recipe
+TUNE_CCARGS_remove = "-mfpmath=sse"
+COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
+COMPATIBLE_HOST_x86-x32 = "null"
+
+do_compile() {
+ SYSTEMD_BOOT_EFI_ARCH="ia32"
+ if [ "${TARGET_ARCH}" = "x86_64" ]; then
+ SYSTEMD_BOOT_EFI_ARCH="x64"
+ fi
+
+ ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE_PREFIX}${SYSTEMD_BOOT_IMAGE}
+}
+
+do_install() {
+ install -d ${D}/boot
+ install -d ${D}/boot/EFI
+ install -d ${D}/boot/EFI/BOOT
+ install ${B}/src/boot/efi/systemd-boot*.efi ${D}/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}
+}
+
+do_deploy () {
+ install ${B}/src/boot/efi/systemd-boot*.efi ${DEPLOYDIR}
+}
+addtask deploy before do_build after do_compile
diff --git a/external/poky/meta/recipes-core/systemd/systemd-bootconf_1.00.bb b/external/poky/meta/recipes-core/systemd/systemd-bootconf_1.00.bb
new file mode 100644
index 00000000..e9c24664
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd-bootconf_1.00.bb
@@ -0,0 +1,31 @@
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SUMMARY = "Basic systemd-boot configuration files"
+
+RPROVIDES_${PN} += "virtual/systemd-bootconf"
+
+inherit systemd-boot-cfg
+
+S = "${WORKDIR}"
+
+LABELS = "boot"
+
+ROOT ?= "root=/dev/sda2"
+APPEND_append = " ${ROOT}"
+
+python do_configure() {
+ bb.build.exec_func('build_efi_cfg', d)
+}
+
+do_configure[vardeps] += "APPEND"
+
+do_install() {
+ install -d ${D}/boot
+ install -d ${D}/boot/loader
+ install -d ${D}/boot/loader/entries
+ install loader.conf ${D}/boot/loader/
+ rm loader.conf
+ install *.conf ${D}/boot/loader/entries/
+}
+
+FILES_${PN} = "/boot/loader/* /boot/loader/entries/*"
diff --git a/external/poky/meta/recipes-core/systemd/systemd-compat-units.bb b/external/poky/meta/recipes-core/systemd/systemd-compat-units.bb
new file mode 100644
index 00000000..d228a51c
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
+LICENSE = "MIT"
+
+PR = "r29"
+
+PACKAGE_WRITE_DEPS += "systemd-systemctl-native"
+
+S = "${WORKDIR}"
+
+inherit distro_features_check
+
+ALLOW_EMPTY_${PN} = "1"
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+SYSTEMD_DISABLED_SYSV_SERVICES = " \
+ busybox-udhcpc \
+ hwclock \
+ networking \
+ nfsserver \
+ nfscommon \
+ syslog.busybox \
+"
+
+pkg_postinst_${PN} () {
+
+ cd $D${sysconfdir}/init.d || exit 0
+
+ echo "Disabling the following sysv scripts: "
+
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ else
+ OPTS=""
+ fi
+
+ for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
+ if [ -e $i -o -e $i.sh ] && ! [ -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service ] ; then
+ echo -n "$i: "
+ systemctl $OPTS mask $i.service
+ fi
+ done
+ echo
+}
+
+RDEPENDS_${PN} = "systemd"
diff --git a/external/poky/meta/recipes-core/systemd/systemd-conf.bb b/external/poky/meta/recipes-core/systemd/systemd-conf.bb
new file mode 100644
index 00000000..9bb27fd9
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd-conf.bb
@@ -0,0 +1,53 @@
+require systemd.inc
+
+SUMMARY = "Systemd system configuration"
+DESCRIPTION = "Systemd may require slightly different configuration for \
+different machines. For example, qemu machines require a longer \
+DefaultTimeoutStartSec setting."
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+CONFFILES_${PN} = "${sysconfdir}/machine-id \
+${sysconfdir}/systemd/coredump.conf \
+${sysconfdir}/systemd/journald.conf \
+${sysconfdir}/systemd/logind.conf \
+${sysconfdir}/systemd/system.conf \
+${sysconfdir}/systemd/user.conf"
+
+FILES_${PN} = "${sysconfdir}/machine-id ${sysconfdir}/systemd"
+
+do_configure[noexec] = '1'
+do_compile[noexec] = '1'
+
+do_install() {
+ rm -rf ${D}/${sysconfdir}/systemd
+ install -d ${D}/${sysconfdir}/systemd
+
+ # Create machine-id
+ # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable
+ touch ${D}${sysconfdir}/machine-id
+
+ install -m 0644 ${S}/src/coredump/coredump.conf ${D}${sysconfdir}/systemd/coredump.conf
+
+ install -m 0644 ${S}/src/journal/journald.conf ${D}${sysconfdir}/systemd/journald.conf
+ # Enable journal to forward message to syslog daemon
+ sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
+ # Set the maximium size of runtime journal to 64M as default
+ sed -i -e 's/.*RuntimeMaxUse.*/RuntimeMaxUse=64M/' ${D}${sysconfdir}/systemd/journald.conf
+
+ install -m 0644 ${S}/src/login/logind.conf.in ${D}${sysconfdir}/systemd/logind.conf
+ # Set KILL_USER_PROCESSES to yes
+ sed -i -e 's/@KILL_USER_PROCESSES@/yes/' ${D}${sysconfdir}/systemd/logind.conf
+
+ install -m 0644 ${S}/src/core/system.conf.in ${D}${sysconfdir}/systemd/system.conf
+ # Set MEMORY_ACCOUNTING_DEFAULT to yes
+ sed -i -e 's/@MEMORY_ACCOUNTING_DEFAULT@/yes/' ${D}${sysconfdir}/systemd/system.conf
+
+ install -m 0644 ${S}/src/core/user.conf ${D}${sysconfdir}/systemd/user.conf
+}
+
+# Based on change from YP bug 8141, OE commit 5196d7bacaef1076c361adaa2867be31759c1b52
+do_install_append_qemuall() {
+ # Change DefaultTimeoutStartSec from 90s to 240s
+ echo "DefaultTimeoutStartSec = 240s" >> ${D}${sysconfdir}/systemd/system.conf
+}
diff --git a/external/poky/meta/recipes-core/systemd/systemd-machine-units_1.0.bb b/external/poky/meta/recipes-core/systemd/systemd-machine-units_1.0.bb
new file mode 100644
index 00000000..02756f43
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd-machine-units_1.0.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Machine specific systemd units"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+PR = "r19"
+
+inherit systemd
+SYSTEMD_SERVICE_${PN} = ""
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/external/poky/meta/recipes-core/systemd/systemd-serialgetty.bb b/external/poky/meta/recipes-core/systemd/systemd-serialgetty.bb
new file mode 100644
index 00000000..65a931f4
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Serial terminal support for systemd"
+HOMEPAGE = "https://www.freedesktop.org/wiki/Software/systemd/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PR = "r5"
+
+SERIAL_CONSOLES ?= "115200;ttyS0"
+
+SRC_URI = "file://serial-getty@.service"
+
+S = "${WORKDIR}"
+
+# As this package is tied to systemd, only build it when we're also building systemd.
+inherit distro_features_check
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+do_install() {
+ if [ ! -z "${SERIAL_CONSOLES}" ] ; then
+ default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'`
+ install -d ${D}${systemd_unitdir}/system/
+ install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
+ install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
+ sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service
+
+ tmp="${SERIAL_CONSOLES}"
+ for entry in $tmp ; do
+ baudrate=`echo $entry | sed 's/\;.*//'`
+ ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
+ if [ "$baudrate" = "$default_baudrate" ] ; then
+ # enable the service
+ ln -sf ${systemd_unitdir}/system/serial-getty@.service \
+ ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service
+ else
+ # install custom service file for the non-default baudrate
+ install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
+ sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
+ # enable the service
+ ln -sf ${systemd_unitdir}/system/serial-getty$baudrate@.service \
+ ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service
+ fi
+ done
+ fi
+}
+
+# This is a machine specific file
+FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/external/poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/external/poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
new file mode 100644
index 00000000..e8b027e9
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
@@ -0,0 +1,37 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Serial Getty on %I
+Documentation=man:agetty(8) man:systemd-getty-generator(8)
+Documentation=http://0pointer.de/blog/projects/serial-console.html
+BindsTo=dev-%i.device
+After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
+After=rc-local.service
+
+# If additional gettys are spawned during boot then we should make
+# sure that this is synchronized before getty.target, even though
+# getty.target didn't actually pull it in.
+Before=getty.target
+IgnoreOnIsolate=yes
+
+[Service]
+Environment="TERM=xterm"
+ExecStart=-/sbin/agetty -8 -L %I @BAUDRATE@ $TERM
+Type=idle
+Restart=always
+RestartSec=0
+UtmpIdentifier=%I
+TTYPath=/dev/%I
+TTYReset=yes
+TTYVHangup=yes
+KillMode=process
+IgnoreSIGPIPE=no
+SendSIGHUP=yes
+
+[Install]
+WantedBy=getty.target
diff --git a/external/poky/meta/recipes-core/systemd/systemd-systemctl-native.bb b/external/poky/meta/recipes-core/systemd/systemd-systemctl-native.bb
new file mode 100644
index 00000000..fadc8433
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd-systemctl-native.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Wrapper for enabling systemd services"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r6"
+
+inherit native
+
+SRC_URI = "file://systemctl"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
+}
diff --git a/external/poky/meta/recipes-core/systemd/systemd-systemctl/systemctl b/external/poky/meta/recipes-core/systemd/systemd-systemctl/systemctl
new file mode 100755
index 00000000..2bc64896
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,196 @@
+#!/bin/sh
+echo "Started $0 $*"
+
+ROOT=
+
+# parse command line params
+action=
+while [ $# != 0 ]; do
+ opt="$1"
+
+ case "$opt" in
+ enable)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ disable)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ mask)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ preset)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ --root=*)
+ ROOT=${opt##--root=}
+ cmd_args="0"
+ shift
+ ;;
+ *)
+ if [ "$cmd_args" = "1" ]; then
+ services="$services $opt"
+ shift
+ else
+ echo "'$opt' is an unkown option; exiting with error"
+ exit 1
+ fi
+ ;;
+ esac
+done
+if [ "$action" = "preset" -a "$service_file" = "" ]; then
+ services=$(for f in `find $ROOT/etc/systemd/system $ROOT/lib/systemd/system $ROOT/usr/lib/systemd/system -type f 2>1`; do basename $f; done)
+ services="$services $opt"
+ presetall=1
+fi
+
+for service in $services; do
+ if [ "$presetall" = "1" ]; then
+ action="preset"
+ fi
+ if [ "$action" = "mask" ]; then
+ if [ ! -d $ROOT/etc/systemd/system/ ]; then
+ mkdir -p $ROOT/etc/systemd/system/
+ fi
+ cmd="ln -s /dev/null $ROOT/etc/systemd/system/$service"
+ echo "$cmd"
+ $cmd
+ exit 0
+ fi
+
+ service_base_file=`echo $service | sed 's/\(@\).*\(\.[^.]\+\)/\1\2/'`
+ if [ -z `echo $service | sed '/@/p;d'` ]; then
+ echo "Try to find location of $service..."
+ service_template=false
+ else
+ echo "Try to find location of template $service_base_file of instance $service..."
+ service_template=true
+ instance_specified=`echo $service | sed 's/^.\+@\(.*\)\.[^.]\+/\1/'`
+ fi
+
+ # find service file
+ for p in $ROOT/etc/systemd/system \
+ $ROOT/lib/systemd/system \
+ $ROOT/usr/lib/systemd/system; do
+ if [ -e $p/$service_base_file ]; then
+ service_file=$p/$service_base_file
+ service_file=${service_file##$ROOT}
+ fi
+ done
+ if [ -z "$service_file" ]; then
+ echo "'$service_base_file' couldn't be found; exiting with error"
+ exit 1
+ fi
+ echo "Found $service in $service_file"
+
+ # If any new unit types are added to systemd they should be added
+ # to this regular expression.
+ unit_types_re='\.\(service\|socket\|device\|mount\|automount\|swap\|target\|target\.wants\|path\|timer\|snapshot\)\s*$'
+ if [ "$action" = "preset" ]; then
+ action=`egrep -sh $service $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '`
+ if [ -z "$action" ]; then
+ globalpreset=`egrep -sh '\*' $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '`
+ if [ -n "$globalpreset" ]; then
+ action="$globalpreset"
+ else
+ action="enable"
+ fi
+ fi
+ fi
+ # create the required symbolic links
+ wanted_by=$(sed '/^WantedBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+ | tr ',' '\n' \
+ | grep "$unit_types_re")
+
+ required_by=$(sed '/^RequiredBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+ | tr ',' '\n' \
+ | grep "$unit_types_re")
+
+ for dependency in WantedBy RequiredBy; do
+ if [ "$dependency" = "WantedBy" ]; then
+ suffix="wants"
+ dependency_list="$wanted_by"
+ elif [ "$dependency" = "RequiredBy" ]; then
+ suffix="requires"
+ dependency_list="$required_by"
+ fi
+ for r in $dependency_list; do
+ echo "$dependency=$r found in $service"
+ if [ -n "$instance_specified" ]; then
+ # substitute wildcards in the dependency
+ r=`echo $r | sed "s/%i/$instance_specified/g"`
+ fi
+
+ if [ "$action" = "enable" ]; then
+ enable_service=$service
+ if [ "$service_template" = true -a -z "$instance_specified" ]; then
+ default_instance=$(sed '/^DefaultInstance[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file")
+ if [ -z $default_instance ]; then
+ echo "Template unit without instance or DefaultInstance directive, nothing to enable"
+ continue
+ else
+ echo "Found DefaultInstance $default_instance, enabling it"
+ enable_service=$(echo $service | sed "s/@/@$(echo $default_instance | sed 's/\\/\\\\/g')/")
+ fi
+ fi
+ mkdir -p $ROOT/etc/systemd/system/$r.$suffix
+ ln -s $service_file $ROOT/etc/systemd/system/$r.$suffix/$enable_service
+ echo "Enabled $enable_service for $r."
+ else
+ if [ "$service_template" = true -a -z "$instance_specified" ]; then
+ disable_service="$ROOT/etc/systemd/system/$r.$suffix/`echo $service | sed 's/@/@*/'`"
+ else
+ disable_service="$ROOT/etc/systemd/system/$r.$suffix/$service"
+ fi
+ rm -f $disable_service
+ [ -d $ROOT/etc/systemd/system/$r.$suffix ] && rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.$suffix
+ echo "Disabled ${disable_service##$ROOT/etc/systemd/system/$r.$suffix/} for $r."
+ fi
+ done
+ done
+
+ # create the required symbolic 'Alias' links
+ alias=$(sed '/^Alias[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+ | tr ',' '\n' \
+ | grep "$unit_types_re")
+
+ for r in $alias; do
+ if [ "$action" = "enable" ]; then
+ mkdir -p $ROOT/etc/systemd/system
+ ln -s $service_file $ROOT/etc/systemd/system/$r
+ echo "Enabled $service for $alias."
+ else
+ rm -f $ROOT/etc/systemd/system/$r
+ echo "Disabled $service for $alias."
+ fi
+ done
+
+ # call us for the other required scripts
+ also=$(sed '/^Also[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+ | tr ',' '\n')
+ for a in $also; do
+ echo "Also=$a found in $service"
+ if [ "$action" = "enable" ]; then
+ $0 --root=$ROOT enable $a
+ fi
+ done
+done
diff --git a/external/poky/meta/recipes-core/systemd/systemd.inc b/external/poky/meta/recipes-core/systemd/systemd.inc
new file mode 100644
index 00000000..736e0a0e
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd.inc
@@ -0,0 +1,21 @@
+SUMMARY = "A System and service manager"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
+
+DESCRIPTION = "systemd is a system and service manager for Linux, compatible with \
+SysV and LSB init scripts. systemd provides aggressive parallelization \
+capabilities, uses socket and D-Bus activation for starting services, \
+offers on-demand starting of daemons, keeps track of processes using \
+Linux cgroups, supports snapshotting and restoring of the system \
+state, maintains mount and automount points and implements an \
+elaborate transactional dependency-based service control logic. It can \
+work as a drop-in replacement for sysvinit."
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
+ file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
+
+SRCREV = "de7436b02badc82200dc127ff190b8155769b8e7"
+
+SRC_URI = "git://github.com/systemd/systemd.git;protocol=git"
+
+S = "${WORKDIR}/git"
diff --git a/external/poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/external/poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf
new file mode 100644
index 00000000..87cbe1e7
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/00-create-volatile.conf
@@ -0,0 +1,7 @@
+#This goes hand-in-hand with the base-files of OE-Core. The file must
+# be sorted before 'systemd.conf' becuase this attempts to create a file
+# inside /var/log.
+
+
+d /var/volatile/log - - - -
+d /var/volatile/tmp 1777 - -
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch
new file mode 100644
index 00000000..e2e19ba0
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch
@@ -0,0 +1,62 @@
+From 527413ec243564a89ffaad6368d446de44415970 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 27 Feb 2018 21:42:23 -0800
+Subject: [PATCH] Fix to run efi_cc and efi_ld correctly when cross-compiling
+
+When cross-compiling, efi_cc and efi_ld may take the form of
+'xxx-gcc --sysroot=xxx', and this would cause run_command and
+the alike fail.
+
+Fix to split them to make commands run correctly.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/boot/efi/meson.build | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
+index 992a3ba4c..9f9ec4911 100644
+--- a/src/boot/efi/meson.build
++++ b/src/boot/efi/meson.build
+@@ -157,7 +157,7 @@ if have_gnu_efi
+ o_file = custom_target(file + '.o',
+ input : file,
+ output : file + '.o',
+- command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@']
++ command : efi_cc.split() + ['-c', '@INPUT@', '-o', '@OUTPUT@']
+ + compile_args,
+ depend_files : efi_headers)
+ if (common_sources + systemd_boot_sources).contains(file)
+@@ -168,7 +168,17 @@ if have_gnu_efi
+ endif
+ endforeach
+
+- libgcc_file_name = run_command(efi_cc, '-print-libgcc-file-name').stdout().strip()
++ find_libgcc_cmd_all = efi_cc + ' -print-libgcc-file-name'
++ find_libgcc_cmd = find_libgcc_cmd_all.split()[0]
++ find_libgcc_args = []
++ cmd_args_all = find_libgcc_cmd_all.split()
++ foreach arg : cmd_args_all
++ if arg != find_libgcc_cmd
++ find_libgcc_args += arg
++ endif
++ endforeach
++
++ libgcc_file_name = run_command(find_libgcc_cmd, find_libgcc_args).stdout().strip()
+ systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME)
+ stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME)
+ no_undefined_symbols = find_program('no-undefined-symbols.sh')
+@@ -179,7 +189,7 @@ if have_gnu_efi
+ tuple[0],
+ input : tuple[2],
+ output : tuple[0],
+- command : [efi_ld, '-o', '@OUTPUT@'] +
++ command : efi_ld.split() + ['-o', '@OUTPUT@'] +
+ efi_ldflags + tuple[2] +
+ ['-lefi', '-lgnuefi', libgcc_file_name])
+
+--
+2.13.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch
new file mode 100644
index 00000000..d745800c
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch
@@ -0,0 +1,33 @@
+From 9e3816bcaa36e1a11647ca0cf4f8044449c77fe0 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 2 Jul 2018 15:28:22 +0800
+Subject: [PATCH] Remove fstack-protector flags to workaround musl build
+
+Remove fstack-protector and fstack-protector-strong flags to fix
+the following build failure for qemux86 and qemuppc with musl.
+
+ undefined reference to `__stack_chk_fail_local'
+
+Upstream-Status: Inappropriate [musl Specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index f432ea072..a734a295c 100644
+--- a/meson.build
++++ b/meson.build
+@@ -333,8 +333,6 @@ possible_cc_flags = [
+ '-fdiagnostics-show-option',
+ '-fno-strict-aliasing',
+ '-fvisibility=hidden',
+- '-fstack-protector',
+- '-fstack-protector-strong',
+ '--param=ssp-buffer-size=4',
+ ]
+
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch
new file mode 100644
index 00000000..7fd6d018
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch
@@ -0,0 +1,36 @@
+From 1e190dfd5bb95036f937ef1dc46f43eb0a146612 Mon Sep 17 00:00:00 2001
+From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
+Date: Fri, 17 Aug 2018 21:31:05 +0200
+Subject: [PATCH] Revert "sysctl.d: request ECN on both in and outgoing
+ connections"
+
+Turning on ECN still causes slow or broken network on linux. Our tcp
+is not yet ready for wide spread use of ECN.
+
+This reverts commit 919472741dba6ad0a3f6c2b76d390a02d0e2fdc3.
+
+https://github.com/systemd/systemd/issues/9748
+
+Upstream-Status: Backport
+Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
+---
+ sysctl.d/50-default.conf | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/sysctl.d/50-default.conf b/sysctl.d/50-default.conf
+index b67ae87ca6b7..e263cf06284a 100644
+--- a/sysctl.d/50-default.conf
++++ b/sysctl.d/50-default.conf
+@@ -33,9 +33,6 @@ net.ipv4.conf.all.promote_secondaries = 1
+ # Fair Queue CoDel packet scheduler to fight bufferbloat
+ net.core.default_qdisc = fq_codel
+
+-# Request Explicit Congestion Notification (ECN) on both in and outgoing connections
+-net.ipv4.tcp_ecn = 1
+-
+ # Enable hard and soft link protection
+ fs.protected_hardlinks = 1
+ fs.protected_symlinks = 1
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
new file mode 100644
index 00000000..03f6ead1
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
@@ -0,0 +1,33 @@
+From 6dd136512896979feb6883a16226d640a7e5ca74 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 23 Feb 2018 10:04:48 +0800
+Subject: [PATCH 01/19] Use getenv when secure versions are not available
+
+musl doesnt implement secure version, so we default
+to it if configure does not detect a secure implementation
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Denied
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/missing.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 71a07d057..0e33abb9f 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -592,7 +592,7 @@ struct btrfs_ioctl_quota_ctl_args {
+ # if HAVE___SECURE_GETENV
+ # define secure_getenv __secure_getenv
+ # else
+-# error "neither secure_getenv nor __secure_getenv are available"
++# define secure_getenv getenv
+ # endif
+ #endif
+
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch
new file mode 100644
index 00000000..e24e7f83
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch
@@ -0,0 +1,81 @@
+From 87dd61be2e28e78ce4f9f173794812e6c2d904d1 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 27 Jun 2018 16:01:22 +0800
+Subject: [PATCH 1/9] binfmt: Don't install dependency links at install time
+ for the binfmt services
+
+use [Install] blocks so that they get created when the service is enabled
+like a traditional service.
+
+The [Install] blocks were rejected upstream as they don't have a way to
+"enable" it on install without static symlinks which can't be disabled,
+only masked. We however can do that in a postinst.
+
+Upstream-Status: Denied
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ units/meson.build | 6 ++----
+ units/proc-sys-fs-binfmt_misc.automount | 3 +++
+ units/systemd-binfmt.service.in | 4 ++++
+ 3 files changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/units/meson.build b/units/meson.build
+index e4ac6ced6..698734e44 100644
+--- a/units/meson.build
++++ b/units/meson.build
+@@ -46,8 +46,7 @@ units = [
+ ['poweroff.target', '',
+ 'runlevel0.target'],
+ ['printer.target', ''],
+- ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT',
+- 'sysinit.target.wants/'],
++ ['proc-sys-fs-binfmt_misc.automount', 'ENABLE_BINFMT'],
+ ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'],
+ ['reboot.target', '',
+ 'runlevel6.target ctrl-alt-del.target'],
+@@ -130,8 +129,7 @@ in_units = [
+ ['systemd-ask-password-console.service', ''],
+ ['systemd-ask-password-wall.service', ''],
+ ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
+- ['systemd-binfmt.service', 'ENABLE_BINFMT',
+- 'sysinit.target.wants/'],
++ ['systemd-binfmt.service', 'ENABLE_BINFMT'],
+ ['systemd-coredump@.service', 'ENABLE_COREDUMP'],
+ ['systemd-exit.service', ''],
+ ['systemd-firstboot.service', 'ENABLE_FIRSTBOOT',
+diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
+index 30a6bc991..4231f3b70 100644
+--- a/units/proc-sys-fs-binfmt_misc.automount
++++ b/units/proc-sys-fs-binfmt_misc.automount
+@@ -18,3 +18,6 @@ ConditionPathIsReadWrite=/proc/sys/
+
+ [Automount]
+ Where=/proc/sys/fs/binfmt_misc
++
++[Install]
++WantedBy=sysinit.target
+diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
+index e940c7c9a..6be7f5cc9 100644
+--- a/units/systemd-binfmt.service.in
++++ b/units/systemd-binfmt.service.in
+@@ -14,6 +14,7 @@ Documentation=https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.htm
+ Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
+ DefaultDependencies=no
+ Conflicts=shutdown.target
++Wants=proc-sys-fs-binfmt_misc.automount
+ After=proc-sys-fs-binfmt_misc.automount
+ Before=sysinit.target shutdown.target
+ ConditionPathIsReadWrite=/proc/sys/
+@@ -28,3 +29,6 @@ Type=oneshot
+ RemainAfterExit=yes
+ ExecStart=@rootlibexecdir@/systemd-binfmt
+ TimeoutSec=90s
++
++[Install]
++WantedBy=sysinit.target
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch
new file mode 100644
index 00000000..9d350eba
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch
@@ -0,0 +1,219 @@
+From 2da8ba3f507345d0401ea9d7191fa16ffa560ebc Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart@poettering.net>
+Date: Fri, 19 Oct 2018 11:26:59 +0200
+Subject: [PATCH] chown-recursive: let's rework the recursive logic to use
+ O_PATH
+
+That way we can pin a specific inode and analyze it and manipulate it
+without it being swapped out beneath our hands.
+
+Fixes a vulnerability originally found by Jann Horn from Google.
+
+CVE-2018-15687
+LP: #1796692
+https://bugzilla.redhat.com/show_bug.cgi?id=1639076
+
+(cherry picked from commit 5de6cce58b3e8b79239b6e83653459d91af6e57c)
+
+CVE: CVE-2018-15687
+Upstream-Status: Backport
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/core/chown-recursive.c | 146 ++++++++++++++++++++++-----------------------
+ 1 file changed, 70 insertions(+), 76 deletions(-)
+
+diff --git a/src/core/chown-recursive.c b/src/core/chown-recursive.c
+index c479450..27c6448 100644
+--- a/src/core/chown-recursive.c
++++ b/src/core/chown-recursive.c
+@@ -1,17 +1,19 @@
+ /* SPDX-License-Identifier: LGPL-2.1+ */
+
+-#include <sys/types.h>
+-#include <sys/stat.h>
+ #include <fcntl.h>
++#include <sys/stat.h>
++#include <sys/types.h>
+
+-#include "user-util.h"
+-#include "macro.h"
+-#include "fd-util.h"
+-#include "dirent-util.h"
+ #include "chown-recursive.h"
++#include "dirent-util.h"
++#include "fd-util.h"
++#include "macro.h"
++#include "stdio-util.h"
++#include "strv.h"
++#include "user-util.h"
+
+-static int chown_one(int fd, const char *name, const struct stat *st, uid_t uid, gid_t gid) {
+- int r;
++static int chown_one(int fd, const struct stat *st, uid_t uid, gid_t gid) {
++ char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
+
+ assert(fd >= 0);
+ assert(st);
+@@ -20,90 +22,82 @@ static int chown_one(int fd, const char *name, const struct stat *st, uid_t uid,
+ (!gid_is_valid(gid) || st->st_gid == gid))
+ return 0;
+
+- if (name)
+- r = fchownat(fd, name, uid, gid, AT_SYMLINK_NOFOLLOW);
+- else
+- r = fchown(fd, uid, gid);
+- if (r < 0)
+- return -errno;
++ /* We change ownership through the /proc/self/fd/%i path, so that we have a stable reference that works with
++ * O_PATH. (Note: fchown() and fchmod() do not work with O_PATH, the kernel refuses that. */
++ xsprintf(procfs_path, "/proc/self/fd/%i", fd);
+
+- /* The linux kernel alters the mode in some cases of chown(). Let's undo this. */
+- if (name) {
+- if (!S_ISLNK(st->st_mode))
+- r = fchmodat(fd, name, st->st_mode, 0);
+- else /* There's currently no AT_SYMLINK_NOFOLLOW for fchmodat() */
+- r = 0;
+- } else
+- r = fchmod(fd, st->st_mode);
+- if (r < 0)
++ if (chown(procfs_path, uid, gid) < 0)
+ return -errno;
+
++ /* The linux kernel alters the mode in some cases of chown(). Let's undo this. We do this only for non-symlinks
++ * however. That's because for symlinks the access mode is ignored anyway and because on some kernels/file
++ * systems trying to change the access mode will succeed but has no effect while on others it actively
++ * fails. */
++ if (!S_ISLNK(st->st_mode))
++ if (chmod(procfs_path, st->st_mode & 07777) < 0)
++ return -errno;
++
+ return 1;
+ }
+
+ static int chown_recursive_internal(int fd, const struct stat *st, uid_t uid, gid_t gid) {
++ _cleanup_closedir_ DIR *d = NULL;
+ bool changed = false;
++ struct dirent *de;
+ int r;
+
+ assert(fd >= 0);
+ assert(st);
+
+- if (S_ISDIR(st->st_mode)) {
+- _cleanup_closedir_ DIR *d = NULL;
+- struct dirent *de;
+-
+- d = fdopendir(fd);
+- if (!d) {
+- r = -errno;
+- goto finish;
+- }
+- fd = -1;
+-
+- FOREACH_DIRENT_ALL(de, d, r = -errno; goto finish) {
+- struct stat fst;
+-
+- if (dot_or_dot_dot(de->d_name))
+- continue;
+-
+- if (fstatat(dirfd(d), de->d_name, &fst, AT_SYMLINK_NOFOLLOW) < 0) {
+- r = -errno;
+- goto finish;
+- }
+-
+- if (S_ISDIR(fst.st_mode)) {
+- int subdir_fd;
+-
+- subdir_fd = openat(dirfd(d), de->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
+- if (subdir_fd < 0) {
+- r = -errno;
+- goto finish;
+- }
+-
+- r = chown_recursive_internal(subdir_fd, &fst, uid, gid);
+- if (r < 0)
+- goto finish;
+- if (r > 0)
+- changed = true;
+- } else {
+- r = chown_one(dirfd(d), de->d_name, &fst, uid, gid);
+- if (r < 0)
+- goto finish;
+- if (r > 0)
+- changed = true;
+- }
++ d = fdopendir(fd);
++ if (!d) {
++ safe_close(fd);
++ return -errno;
++ }
++
++ FOREACH_DIRENT_ALL(de, d, return -errno) {
++ _cleanup_close_ int path_fd = -1;
++ struct stat fst;
++
++ if (dot_or_dot_dot(de->d_name))
++ continue;
++
++ /* Let's pin the child inode we want to fix now with an O_PATH fd, so that it cannot be swapped out
++ * while we manipulate it. */
++ path_fd = openat(dirfd(d), de->d_name, O_PATH|O_CLOEXEC|O_NOFOLLOW);
++ if (path_fd < 0)
++ return -errno;
++
++ if (fstat(path_fd, &fst) < 0)
++ return -errno;
++
++ if (S_ISDIR(fst.st_mode)) {
++ int subdir_fd;
++
++ /* Convert it to a "real" (i.e. non-O_PATH) fd now */
++ subdir_fd = fd_reopen(path_fd, O_RDONLY|O_CLOEXEC|O_NOATIME);
++ if (subdir_fd < 0)
++ return subdir_fd;
++
++ r = chown_recursive_internal(subdir_fd, &fst, uid, gid); /* takes possession of subdir_fd even on failure */
++ if (r < 0)
++ return r;
++ if (r > 0)
++ changed = true;
++ } else {
++ r = chown_one(path_fd, &fst, uid, gid);
++ if (r < 0)
++ return r;
++ if (r > 0)
++ changed = true;
+ }
++ }
+
+- r = chown_one(dirfd(d), NULL, st, uid, gid);
+- } else
+- r = chown_one(fd, NULL, st, uid, gid);
++ r = chown_one(dirfd(d), st, uid, gid);
+ if (r < 0)
+- goto finish;
++ return r;
+
+- r = r > 0 || changed;
+-
+-finish:
+- safe_close(fd);
+- return r;
++ return r > 0 || changed;
+ }
+
+ int path_chown_recursive(const char *path, uid_t uid, gid_t gid) {
+@@ -111,7 +105,7 @@ int path_chown_recursive(const char *path, uid_t uid, gid_t gid) {
+ struct stat st;
+ int r;
+
+- fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
++ fd = open(path, O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
+ if (fd < 0)
+ return -errno;
+
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-core-when-deserializing-state-always-use-read_line-L.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-core-when-deserializing-state-always-use-read_line-L.patch
new file mode 100644
index 00000000..215d6807
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-core-when-deserializing-state-always-use-read_line-L.patch
@@ -0,0 +1,250 @@
+From 1a05ff4948d778280ec155a9abe69d3360bfddd9 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart@poettering.net>
+Date: Wed, 17 Oct 2018 18:36:24 +0200
+Subject: [PATCH] =?UTF-8?q?core:=20when=20deserializing=20state=20always?=
+ =?UTF-8?q?=20use=20read=5Fline(=E2=80=A6,=20LONG=5FLINE=5FMAX,=20?=
+ =?UTF-8?q?=E2=80=A6)?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This should be much better than fgets(), as we can read substantially
+longer lines and overly long lines result in proper errors.
+
+Fixes a vulnerability discovered by Jann Horn at Google.
+
+CVE-2018-15686
+LP: #1796402
+https://bugzilla.redhat.com/show_bug.cgi?id=1639071
+
+(cherry picked from commit 8948b3415d762245ebf5e19d80b97d4d8cc208c1)
+
+CVE: CVE-2018-15686
+Upstream-Status: Backport
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/core/job.c | 19 +++++++++++--------
+ src/core/manager.c | 44 ++++++++++++++++++++------------------------
+ src/core/unit.c | 34 ++++++++++++++++++----------------
+ src/core/unit.h | 2 +-
+ 4 files changed, 50 insertions(+), 49 deletions(-)
+
+diff --git a/src/core/job.c b/src/core/job.c
+index 734756b..8552ffb 100644
+--- a/src/core/job.c
++++ b/src/core/job.c
+@@ -10,6 +10,7 @@
+ #include "dbus-job.h"
+ #include "dbus.h"
+ #include "escape.h"
++#include "fileio.h"
+ #include "job.h"
+ #include "log.h"
+ #include "macro.h"
+@@ -1091,24 +1092,26 @@ int job_serialize(Job *j, FILE *f) {
+ }
+
+ int job_deserialize(Job *j, FILE *f) {
++ int r;
++
+ assert(j);
+ assert(f);
+
+ for (;;) {
+- char line[LINE_MAX], *l, *v;
++ _cleanup_free_ char *line = NULL;
++ char *l, *v;
+ size_t k;
+
+- if (!fgets(line, sizeof(line), f)) {
+- if (feof(f))
+- return 0;
+- return -errno;
+- }
++ r = read_line(f, LONG_LINE_MAX, &line);
++ if (r < 0)
++ return log_error_errno(r, "Failed to read serialization line: %m");
++ if (r == 0)
++ return 0;
+
+- char_array_0(line);
+ l = strstrip(line);
+
+ /* End marker */
+- if (l[0] == 0)
++ if (isempty(l))
+ return 0;
+
+ k = strcspn(l, "=");
+diff --git a/src/core/manager.c b/src/core/manager.c
+index 3a7f0c4..a5780c9 100644
+--- a/src/core/manager.c
++++ b/src/core/manager.c
+@@ -3171,22 +3171,19 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
+ m->n_reloading++;
+
+ for (;;) {
+- char line[LINE_MAX];
++ _cleanup_free_ char *line = NULL;
+ const char *val, *l;
+
+- if (!fgets(line, sizeof(line), f)) {
+- if (feof(f))
+- r = 0;
+- else
+- r = -errno;
+-
++ r = read_line(f, LONG_LINE_MAX, &line);
++ if (r < 0) {
++ log_error_errno(r, "Failed to read serialization line: %m");
+ goto finish;
+ }
++ if (r == 0)
++ break;
+
+- char_array_0(line);
+ l = strstrip(line);
+-
+- if (l[0] == 0)
++ if (isempty(l)) /* end marker */
+ break;
+
+ if ((val = startswith(l, "current-job-id="))) {
+@@ -3353,29 +3350,31 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
+ }
+
+ for (;;) {
+- Unit *u;
+- char name[UNIT_NAME_MAX+2];
++ _cleanup_free_ char *line = NULL;
+ const char* unit_name;
++ Unit *u;
+
+ /* Start marker */
+- if (!fgets(name, sizeof(name), f)) {
+- if (feof(f))
+- r = 0;
+- else
+- r = -errno;
+-
++ r = read_line(f, LONG_LINE_MAX, &line);
++ if (r < 0) {
++ log_error_errno(r, "Failed to read serialization line: %m");
+ goto finish;
+ }
++ if (r == 0)
++ break;
+
+- char_array_0(name);
+- unit_name = strstrip(name);
++ unit_name = strstrip(line);
+
+ r = manager_load_unit(m, unit_name, NULL, NULL, &u);
+ if (r < 0) {
+ log_notice_errno(r, "Failed to load unit \"%s\", skipping deserialization: %m", unit_name);
+ if (r == -ENOMEM)
+ goto finish;
+- unit_deserialize_skip(f);
++
++ r = unit_deserialize_skip(f);
++ if (r < 0)
++ goto finish;
++
+ continue;
+ }
+
+@@ -3388,9 +3387,6 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
+ }
+
+ finish:
+- if (ferror(f))
+- r = -EIO;
+-
+ assert(m->n_reloading > 0);
+ m->n_reloading--;
+
+diff --git a/src/core/unit.c b/src/core/unit.c
+index 7da963a..e98c9c4 100644
+--- a/src/core/unit.c
++++ b/src/core/unit.c
+@@ -3380,21 +3380,19 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
+ assert(fds);
+
+ for (;;) {
+- char line[LINE_MAX], *l, *v;
++ _cleanup_free_ char *line = NULL;
+ CGroupIPAccountingMetric m;
++ char *l, *v;
+ size_t k;
+
+- if (!fgets(line, sizeof(line), f)) {
+- if (feof(f))
+- return 0;
+- return -errno;
+- }
++ r = read_line(f, LONG_LINE_MAX, &line);
++ if (r < 0)
++ return log_error_errno(r, "Failed to read serialization line: %m");
++ if (r == 0) /* eof */
++ break;
+
+- char_array_0(line);
+ l = strstrip(line);
+-
+- /* End marker */
+- if (isempty(l))
++ if (isempty(l)) /* End marker */
+ break;
+
+ k = strcspn(l, "=");
+@@ -3671,23 +3669,27 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
+ return 0;
+ }
+
+-void unit_deserialize_skip(FILE *f) {
++int unit_deserialize_skip(FILE *f) {
++ int r;
+ assert(f);
+
+ /* Skip serialized data for this unit. We don't know what it is. */
+
+ for (;;) {
+- char line[LINE_MAX], *l;
++ _cleanup_free_ char *line = NULL;
++ char *l;
+
+- if (!fgets(line, sizeof line, f))
+- return;
++ r = read_line(f, LONG_LINE_MAX, &line);
++ if (r < 0)
++ return log_error_errno(r, "Failed to read serialization line: %m");
++ if (r == 0)
++ return 0;
+
+- char_array_0(line);
+ l = strstrip(line);
+
+ /* End marker */
+ if (isempty(l))
+- return;
++ return 1;
+ }
+ }
+
+diff --git a/src/core/unit.h b/src/core/unit.h
+index 06321bb..51c7aaa 100644
+--- a/src/core/unit.h
++++ b/src/core/unit.h
+@@ -684,7 +684,7 @@ bool unit_can_serialize(Unit *u) _pure_;
+
+ int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs);
+ int unit_deserialize(Unit *u, FILE *f, FDSet *fds);
+-void unit_deserialize_skip(FILE *f);
++int unit_deserialize_skip(FILE *f);
+
+ int unit_serialize_item(Unit *u, FILE *f, const char *key, const char *value);
+ int unit_serialize_item_escaped(Unit *u, FILE *f, const char *key, const char *value);
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
new file mode 100644
index 00000000..0c912f25
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
@@ -0,0 +1,39 @@
+From a2622b8398ba026faf481f5eddeb53231d9de4a7 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart@poettering.net>
+Date: Fri, 19 Oct 2018 12:12:33 +0200
+Subject: [PATCH] dhcp6: make sure we have enough space for the DHCP6 option
+ header
+
+Fixes a vulnerability originally discovered by Felix Wilhelm from
+Google.
+
+CVE-2018-15688
+LP: #1795921
+https://bugzilla.redhat.com/show_bug.cgi?id=1639067
+
+(cherry picked from commit 4dac5eaba4e419b29c97da38a8b1f82336c2c892)
+
+CVE: CVE-2018-15688
+Upstream-Status: Backport
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/libsystemd-network/dhcp6-option.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c
+index c4b402b..dcbaad0 100644
+--- a/src/libsystemd-network/dhcp6-option.c
++++ b/src/libsystemd-network/dhcp6-option.c
+@@ -103,7 +103,7 @@ int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, DHCP6IA *ia) {
+ return -EINVAL;
+ }
+
+- if (*buflen < len)
++ if (*buflen < offsetof(DHCP6Option, data) + len)
+ return -ENOBUFS;
+
+ ia_hdr = *buf;
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch
new file mode 100644
index 00000000..ba08e345
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch
@@ -0,0 +1,110 @@
+From 86d18f3b09ec984ef3732567af992adb2dc77a8a Mon Sep 17 00:00:00 2001
+From: Yu Watanabe <watanabe.yu+github@gmail.com>
+Date: Mon, 9 Jul 2018 14:05:20 +0900
+Subject: [PATCH] login: use parse_uid() when unmounting user runtime directory
+
+When unmounting user runtime directory, only UID is necessary,
+and the corresponding user may not exist anymore.
+This makes first try to parse the input by parse_uid(), and only if it
+fails, prase the input by get_user_creds().
+
+Fixes #9541.
+
+Upstream-Status: Backport
+---
+ src/login/user-runtime-dir.c | 57 ++++++++++++++++++++++++++++----------------
+ 1 file changed, 36 insertions(+), 21 deletions(-)
+
+diff --git a/src/login/user-runtime-dir.c b/src/login/user-runtime-dir.c
+index 1bb26c99e..de4061c75 100644
+--- a/src/login/user-runtime-dir.c
++++ b/src/login/user-runtime-dir.c
+@@ -111,8 +111,22 @@ static int user_remove_runtime_path(const char *runtime_path) {
+ return r;
+ }
+
+-static int do_mount(const char *runtime_path, uid_t uid, gid_t gid) {
++static int do_mount(const char *user) {
++ char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)];
+ size_t runtime_dir_size;
++ uid_t uid;
++ gid_t gid;
++ int r;
++
++ r = get_user_creds(&user, &uid, &gid, NULL, NULL);
++ if (r < 0)
++ return log_error_errno(r,
++ r == -ESRCH ? "No such user \"%s\"" :
++ r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group"
++ : "Failed to look up user \"%s\": %m",
++ user);
++
++ xsprintf(runtime_path, "/run/user/" UID_FMT, uid);
+
+ assert_se(gather_configuration(&runtime_dir_size) == 0);
+
+@@ -120,16 +134,30 @@ static int do_mount(const char *runtime_path, uid_t uid, gid_t gid) {
+ return user_mkdir_runtime_path(runtime_path, uid, gid, runtime_dir_size);
+ }
+
+-static int do_umount(const char *runtime_path) {
++static int do_umount(const char *user) {
++ char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)];
++ uid_t uid;
++ int r;
++
++ /* The user may be already removed. So, first try to parse the string by parse_uid(),
++ * and if it fails, fallback to get_user_creds().*/
++ if (parse_uid(user, &uid) < 0) {
++ r = get_user_creds(&user, &uid, NULL, NULL, NULL);
++ if (r < 0)
++ return log_error_errno(r,
++ r == -ESRCH ? "No such user \"%s\"" :
++ r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group"
++ : "Failed to look up user \"%s\": %m",
++ user);
++ }
++
++ xsprintf(runtime_path, "/run/user/" UID_FMT, uid);
++
+ log_debug("Will remove %s", runtime_path);
+ return user_remove_runtime_path(runtime_path);
+ }
+
+ int main(int argc, char *argv[]) {
+- const char *user;
+- uid_t uid;
+- gid_t gid;
+- char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)];
+ int r;
+
+ log_parse_environment();
+@@ -146,23 +174,10 @@ int main(int argc, char *argv[]) {
+
+ umask(0022);
+
+- user = argv[2];
+- r = get_user_creds(&user, &uid, &gid, NULL, NULL);
+- if (r < 0) {
+- log_error_errno(r,
+- r == -ESRCH ? "No such user \"%s\"" :
+- r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group"
+- : "Failed to look up user \"%s\": %m",
+- user);
+- return EXIT_FAILURE;
+- }
+-
+- xsprintf(runtime_path, "/run/user/" UID_FMT, uid);
+-
+ if (streq(argv[1], "start"))
+- r = do_mount(runtime_path, uid, gid);
++ r = do_mount(argv[2]);
+ else if (streq(argv[1], "stop"))
+- r = do_umount(runtime_path);
++ r = do_umount(argv[2]);
+ else
+ assert_not_reached("Unknown verb!");
+
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-meson-rename-Ddebug-to-Ddebug-extra.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-meson-rename-Ddebug-to-Ddebug-extra.patch
new file mode 100644
index 00000000..d6d305cb
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-meson-rename-Ddebug-to-Ddebug-extra.patch
@@ -0,0 +1,45 @@
+From 8f6b442a78d0b485f044742ad90b2e8271b4e68e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Sun, 19 Aug 2018 19:11:30 +0200
+Subject: [PATCH] meson: rename -Ddebug to -Ddebug-extra
+
+Meson added -Doptimization and -Ddebug options, which obviously causes
+a conflict with our -Ddebug options. Let's rename it.
+
+Fixes #9883.
+Upstream-Status: Backport
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ meson.build | 2 +-
+ meson_options.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index f79ac4b12..2209c935a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -763,7 +763,7 @@ substs.set('DEBUGTTY', get_option('debug-tty'))
+
+ enable_debug_hashmap = false
+ enable_debug_mmap_cache = false
+-foreach name : get_option('debug')
++foreach name : get_option('debug-extra')
+ if name == 'hashmap'
+ enable_debug_hashmap = true
+ elif name == 'mmap-cache'
+diff --git a/meson_options.txt b/meson_options.txt
+index e3140c8c1..7b1f61bf4 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -45,7 +45,7 @@ option('debug-shell', type : 'string', value : '/bin/sh',
+ description : 'path to debug shell binary')
+ option('debug-tty', type : 'string', value : '/dev/tty9',
+ description : 'specify the tty device for debug shell')
+-option('debug', type : 'array', choices : ['hashmap', 'mmap-cache'], value : [],
++option('debug-extra', type : 'array', choices : ['hashmap', 'mmap-cache'], value : [],
+ description : 'enable extra debugging')
+ option('memory-accounting-default', type : 'boolean',
+ description : 'enable MemoryAccounting= by default')
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch
new file mode 100644
index 00000000..45c9b5b1
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch
@@ -0,0 +1,175 @@
+From 5b75a72ee968c9666b5f2ea313720b6c383cb4c2 Mon Sep 17 00:00:00 2001
+From: Yu Watanabe <watanabe.yu+github@gmail.com>
+Date: Fri, 13 Jul 2018 17:38:47 +0900
+Subject: [PATCH] sd-bus: make BUS_DEFAULT_TIMEOUT configurable
+
+This adds sd_bus_{get,set}_method_call_timeout().
+If the timeout is not set or set to 0, then the timeout value is
+parsed from $SYSTEMD_BUS_TIMEOUT= environment variable. If the
+environment variable is not set, then built-in timeout is used.
+---
+ doc/ENVIRONMENT.md | 5 +++++
+ src/libsystemd/libsystemd.sym | 5 +++++
+ src/libsystemd/sd-bus/bus-internal.h | 9 ++++----
+ src/libsystemd/sd-bus/bus-message.c | 7 +++++--
+ src/libsystemd/sd-bus/sd-bus.c | 40 ++++++++++++++++++++++++++++++++++--
+ src/systemd/sd-bus.h | 3 +++
+ 6 files changed, 61 insertions(+), 8 deletions(-)
+
+Upstream-Status: Backport
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+diff --git a/doc/ENVIRONMENT.md b/doc/ENVIRONMENT.md
+index 85d26fe28c..641a03d5d7 100644
+--- a/doc/ENVIRONMENT.md
++++ b/doc/ENVIRONMENT.md
+@@ -37,6 +37,11 @@ All tools:
+ useful for debugging, in order to test generators and other code against
+ specific kernel command lines.
+
++* `$SYSTEMD_BUS_TIMEOUT=SECS` — specifies the maximum time to wait for method call
++ completion. If no time unit is specified, assumes seconds. The usual other units
++ are understood, too (us, ms, s, min, h, d, w, month, y). If it is not set or set
++ to 0, then the built-in default is used.
++
+ systemctl:
+
+ * `$SYSTEMCTL_FORCE_BUS=1` — if set, do not connect to PID1's private D-Bus
+diff --git a/src/libsystemd/libsystemd.sym b/src/libsystemd/libsystemd.sym
+index 1eec17db50..006dbc9c3f 100644
+--- a/src/libsystemd/libsystemd.sym
++++ b/src/libsystemd/libsystemd.sym
+@@ -570,3 +570,8 @@ global:
+ sd_event_source_set_destroy_callback;
+ sd_event_source_get_destroy_callback;
+ } LIBSYSTEMD_238;
++
++LIBSYSTEMD_240 {
++ sd_bus_set_method_call_timeout;
++ sd_bus_get_method_call_timeout;
++} LIBSYSTEMD_239;
+diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h
+index 2087ef8eeb..4864b1e911 100644
+--- a/src/libsystemd/sd-bus/bus-internal.h
++++ b/src/libsystemd/sd-bus/bus-internal.h
+@@ -319,6 +319,9 @@ struct sd_bus {
+
+ int *inotify_watches;
+ size_t n_inotify_watches;
++
++ /* zero means use value specified by $SYSTEMD_BUS_TIMEOUT= environment variable or built-in default */
++ usec_t method_call_timeout;
+ };
+
+ /* For method calls we time-out at 25s, like in the D-Bus reference implementation */
+@@ -336,8 +339,7 @@ struct sd_bus {
+
+ #define BUS_CONTAINER_DEPTH 128
+
+-/* Defined by the specification as maximum size of an array in
+- * bytes */
++/* Defined by the specification as maximum size of an array in bytes */
+ #define BUS_ARRAY_MAX_SIZE 67108864
+
+ #define BUS_FDS_MAX 1024
+@@ -388,8 +390,7 @@ void bus_close_io_fds(sd_bus *b);
+ _slash = streq((prefix), "/") ? NULL : strrchr((prefix), '/'))
+
+ /* If we are invoking callbacks of a bus object, ensure unreffing the
+- * bus from the callback doesn't destroy the object we are working
+- * on */
++ * bus from the callback doesn't destroy the object we are working on */
+ #define BUS_DONT_DESTROY(bus) \
+ _cleanup_(sd_bus_unrefp) _unused_ sd_bus *_dont_destroy_##bus = sd_bus_ref(bus)
+
+diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
+index 8d92bc2002..dffe70a665 100644
+--- a/src/libsystemd/sd-bus/bus-message.c
++++ b/src/libsystemd/sd-bus/bus-message.c
+@@ -5809,8 +5809,11 @@ int bus_message_remarshal(sd_bus *bus, sd_bus_message **m) {
+ return r;
+
+ timeout = (*m)->timeout;
+- if (timeout == 0 && !((*m)->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED))
+- timeout = BUS_DEFAULT_TIMEOUT;
++ if (timeout == 0 && !((*m)->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)) {
++ r = sd_bus_get_method_call_timeout(bus, &timeout);
++ if (r < 0)
++ return r;
++ }
+
+ r = sd_bus_message_seal(n, BUS_MESSAGE_COOKIE(*m), timeout);
+ if (r < 0)
+diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
+index 089b51a6d9..945490ebf7 100644
+--- a/src/libsystemd/sd-bus/sd-bus.c
++++ b/src/libsystemd/sd-bus/sd-bus.c
+@@ -1611,8 +1611,11 @@ static int bus_seal_message(sd_bus *b, sd_bus_message *m, usec_t timeout) {
+ return 0;
+ }
+
+- if (timeout == 0)
+- timeout = BUS_DEFAULT_TIMEOUT;
++ if (timeout == 0) {
++ r = sd_bus_get_method_call_timeout(b, &timeout);
++ if (r < 0)
++ return r;
++ }
+
+ if (!m->sender && b->patch_sender) {
+ r = sd_bus_message_set_sender(m, b->patch_sender);
+@@ -4075,3 +4078,36 @@ _public_ int sd_bus_get_n_queued_write(sd_bus *bus, uint64_t *ret) {
+ *ret = bus->wqueue_size;
+ return 0;
+ }
++
++_public_ int sd_bus_set_method_call_timeout(sd_bus *bus, uint64_t usec) {
++ assert_return(bus, -EINVAL);
++ assert_return(bus = bus_resolve(bus), -ENOPKG);
++
++ bus->method_call_timeout = usec;
++ return 0;
++}
++
++_public_ int sd_bus_get_method_call_timeout(sd_bus *bus, uint64_t *ret) {
++ const char *e;
++ usec_t usec;
++
++ assert_return(bus, -EINVAL);
++ assert_return(bus = bus_resolve(bus), -ENOPKG);
++ assert_return(ret, -EINVAL);
++
++ if (bus->method_call_timeout != 0) {
++ *ret = bus->method_call_timeout;
++ return 0;
++ }
++
++ e = secure_getenv("SYSTEMD_BUS_TIMEOUT");
++ if (e && parse_sec(e, &usec) >= 0 && usec != 0) {
++ /* Save the parsed value to avoid multiple parsing. To change the timeout value,
++ * use sd_bus_set_method_call_timeout() instead of setenv(). */
++ *ret = bus->method_call_timeout = usec;
++ return 0;
++ }
++
++ *ret = bus->method_call_timeout = BUS_DEFAULT_TIMEOUT;
++ return 0;
++}
+diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
+index 54c4b1ca83..c9fd254834 100644
+--- a/src/systemd/sd-bus.h
++++ b/src/systemd/sd-bus.h
+@@ -206,6 +206,9 @@ sd_event *sd_bus_get_event(sd_bus *bus);
+ int sd_bus_get_n_queued_read(sd_bus *bus, uint64_t *ret);
+ int sd_bus_get_n_queued_write(sd_bus *bus, uint64_t *ret);
+
++int sd_bus_set_method_call_timeout(sd_bus *bus, uint64_t usec);
++int sd_bus_get_method_call_timeout(sd_bus *bus, uint64_t *ret);
++
+ int sd_bus_add_filter(sd_bus *bus, sd_bus_slot **slot, sd_bus_message_handler_t callback, void *userdata);
+ int sd_bus_add_match(sd_bus *bus, sd_bus_slot **slot, const char *match, sd_bus_message_handler_t callback, void *userdata);
+ int sd_bus_add_match_async(sd_bus *bus, sd_bus_slot **slot, const char *match, sd_bus_message_handler_t callback, sd_bus_message_handler_t install_callback, void *userdata);
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch
new file mode 100644
index 00000000..0538c7bb
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch
@@ -0,0 +1,31 @@
+From bfc4183ea995f1c211385d066cdb1fe9ce89f621 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Dec 2018 20:53:38 -0800
+Subject: [PATCH 1/2] sysctl: Don't pass null directive argument to '%s'
+
+value pointer here is always NULL but subsequent use of that pointer
+with a %s format will always be NULL, printing p instead would be a
+valid string
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/11179]
+ src/sysctl/sysctl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
+index 1cfe51018..c67d79032 100644
+--- a/src/sysctl/sysctl.c
++++ b/src/sysctl/sysctl.c
+@@ -115,7 +115,7 @@ static int parse_file(OrderedHashmap *sysctl_options, const char *path, bool ign
+
+ value = strchr(p, '=');
+ if (!value) {
+- log_error("Line is not an assignment at '%s:%u': %s", path, c, value);
++ log_error("Line is not an assignment at '%s:%u': %s", path, c, p);
+
+ if (r == 0)
+ r = -EINVAL;
+--
+2.20.1
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0001-timesync-changes-type-of-drift_freq-to-int64_t.patch b/external/poky/meta/recipes-core/systemd/systemd/0001-timesync-changes-type-of-drift_freq-to-int64_t.patch
new file mode 100644
index 00000000..8d395c2f
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0001-timesync-changes-type-of-drift_freq-to-int64_t.patch
@@ -0,0 +1,49 @@
+Backport patch to fix systemd build failure on x32.
+
+Upstream-Status: Backport [https://github.com/systemd/systemd/commit/75ca162]
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+From 75ca1621db4647a4d62d7873cd6715e28fe0f9fa Mon Sep 17 00:00:00 2001
+From: Yu Watanabe <watanabe.yu+github@gmail.com>
+Date: Sat, 23 Jun 2018 09:41:55 +0900
+Subject: [PATCH] timesync: changes type of drift_freq to int64_t
+
+drift_freq is used for storing timex.freq, and is a 64bit integer.
+To support x32 ABI, this changes the type of drift_freq to int64_t.
+
+Fixes #9387.
+---
+ src/timesync/timesyncd-manager.c | 2 +-
+ src/timesync/timesyncd-manager.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
+index 2b731af9e..404a2b189 100644
+--- a/src/timesync/timesyncd-manager.c
++++ b/src/timesync/timesyncd-manager.c
+@@ -604,7 +604,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
+ m->dest_time = *recv_time;
+ m->spike = spike;
+
+- log_debug("interval/delta/delay/jitter/drift " USEC_FMT "s/%+.3fs/%.3fs/%.3fs/%+"PRI_TIMEX"ppm%s",
++ log_debug("interval/delta/delay/jitter/drift " USEC_FMT "s/%+.3fs/%.3fs/%.3fs/%+"PRIi64"ppm%s",
+ m->poll_interval_usec / USEC_PER_SEC, offset, delay, m->samples_jitter, m->drift_freq / 65536,
+ spike ? " (ignored)" : "");
+
+diff --git a/src/timesync/timesyncd-manager.h b/src/timesync/timesyncd-manager.h
+index d8d97cc1e..18347416d 100644
+--- a/src/timesync/timesyncd-manager.h
++++ b/src/timesync/timesyncd-manager.h
+@@ -79,7 +79,7 @@ struct Manager {
+ /* last change */
+ bool jumped;
+ bool sync;
+- long drift_freq;
++ int64_t drift_freq;
+
+ /* watch for time changes */
+ sd_event_source *event_clock_watch;
+--
+2.17.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0002-core-Fix-use-after-free-case-in-load_from_path.patch b/external/poky/meta/recipes-core/systemd/systemd/0002-core-Fix-use-after-free-case-in-load_from_path.patch
new file mode 100644
index 00000000..4da96e29
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0002-core-Fix-use-after-free-case-in-load_from_path.patch
@@ -0,0 +1,43 @@
+From cb67aebd63d9f0077cbf3e769f0b223c5bba20ac Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Dec 2018 20:58:35 -0800
+Subject: [PATCH 2/2] core: Fix use after free case in load_from_path()
+
+ensure that mfree() on filename is called after the logging function
+which uses the string pointed by filename
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/11179]
+ src/core/load-fragment.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
+index fc5644f48..da585786e 100644
+--- a/src/core/load-fragment.c
++++ b/src/core/load-fragment.c
+@@ -4531,7 +4531,6 @@ static int load_from_path(Unit *u, const char *path) {
+ r = open_follow(&filename, &f, symlink_names, &id);
+ if (r >= 0)
+ break;
+- filename = mfree(filename);
+
+ /* ENOENT means that the file is missing or is a dangling symlink.
+ * ENOTDIR means that one of paths we expect to be is a directory
+@@ -4540,9 +4539,12 @@ static int load_from_path(Unit *u, const char *path) {
+ */
+ if (r == -EACCES)
+ log_debug_errno(r, "Cannot access \"%s\": %m", filename);
+- else if (!IN_SET(r, -ENOENT, -ENOTDIR))
++ else if (!IN_SET(r, -ENOENT, -ENOTDIR)) {
++ filename = mfree(filename);
+ return r;
++ }
+
++ filename = mfree(filename);
+ /* Empty the symlink names for the next run */
+ set_clear_free(symlink_names);
+ }
+--
+2.20.1
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch b/external/poky/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
new file mode 100644
index 00000000..8e0d669e
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
@@ -0,0 +1,183 @@
+From d74a4de6daea5a511c2b5636bbb552c15b3a4ad9 Mon Sep 17 00:00:00 2001
+From: Emil Renner Berthing <systemd@esmil.dk>
+Date: Thu, 18 Sep 2014 15:24:56 +0200
+Subject: [PATCH] don't use glibc-specific qsort_r
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/format-table.c | 27 ++++++++++++++++-----------
+ src/basic/util.h | 7 -------
+ src/hwdb/hwdb.c | 18 +++++++++++-------
+ src/udev/udevadm-hwdb.c | 16 ++++++++++------
+ 4 files changed, 37 insertions(+), 31 deletions(-)
+
+diff --git a/src/basic/format-table.c b/src/basic/format-table.c
+index 94e796d1ca..9b3f35c29a 100644
+--- a/src/basic/format-table.c
++++ b/src/basic/format-table.c
+@@ -745,29 +745,29 @@ static int cell_data_compare(TableData *a, size_t index_a, TableData *b, size_t
+ return 0;
+ }
+
+-static int table_data_compare(const void *x, const void *y, void *userdata) {
++static Table *user_table;
++static int table_data_compare(const void *x, const void *y) {
+ const size_t *a = x, *b = y;
+- Table *t = userdata;
+ size_t i;
+ int r;
+
+- assert(t);
+- assert(t->sort_map);
++ assert(user_table);
++ assert(user_table->sort_map);
+
+ /* Make sure the header stays at the beginning */
+- if (*a < t->n_columns && *b < t->n_columns)
++ if (*a < user_table->n_columns && *b < user_table->n_columns)
+ return 0;
+- if (*a < t->n_columns)
++ if (*a < user_table->n_columns)
+ return -1;
+- if (*b < t->n_columns)
++ if (*b < user_table->n_columns)
+ return 1;
+
+ /* Order other lines by the sorting map */
+- for (i = 0; i < t->n_sort_map; i++) {
++ for (i = 0; i < user_table->n_sort_map; i++) {
+ TableData *d, *dd;
+
+- d = t->data[*a + t->sort_map[i]];
+- dd = t->data[*b + t->sort_map[i]];
++ d = user_table->data[*a + user_table->sort_map[i]];
++ dd = user_table->data[*b + user_table->sort_map[i]];
+
+ r = cell_data_compare(d, *a, dd, *b);
+ if (r != 0)
+@@ -960,7 +960,12 @@ int table_print(Table *t, FILE *f) {
+ for (i = 0; i < n_rows; i++)
+ sorted[i] = i * t->n_columns;
+
+- qsort_r_safe(sorted, n_rows, sizeof(size_t), table_data_compare, t);
++ if (n_rows <= 1)
++ return 0;
++ assert(sorted);
++ user_table = t;
++ qsort(sorted, n_rows, sizeof(size_t), table_data_compare);
++ user_table = NULL;
+ }
+
+ if (t->display_map)
+diff --git a/src/basic/util.h b/src/basic/util.h
+index 9699d228f9..40eaf518cb 100644
+--- a/src/basic/util.h
++++ b/src/basic/util.h
+@@ -105,13 +105,6 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_
+ qsort_safe((p), (n), sizeof((p)[0]), (__compar_fn_t) _func_); \
+ })
+
+-static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void*, const void*, void*), void *userdata) {
+- if (nmemb <= 1)
+- return;
+-
+- assert(base);
+- qsort_r(base, nmemb, size, compar, userdata);
+-}
+
+ /**
+ * Normal memcpy requires src to be nonnull. We do nothing if n is 0.
+diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
+index 317cad8a67..701d59a1eb 100644
+--- a/src/hwdb/hwdb.c
++++ b/src/hwdb/hwdb.c
+@@ -135,13 +135,12 @@ static void trie_free(struct trie *trie) {
+
+ DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);
+
+-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
++static struct trie *trie_node_add_value_trie;
++static int trie_values_cmp(const void *v1, const void *v2) {
+ const struct trie_value_entry *val1 = v1;
+ const struct trie_value_entry *val2 = v2;
+- struct trie *trie = arg;
+-
+- return strcmp(trie->strings->buf + val1->key_off,
+- trie->strings->buf + val2->key_off);
++ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
++ trie_node_add_value_trie->strings->buf + val2->key_off);
+ }
+
+ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+@@ -166,7 +165,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+ .value_off = v,
+ };
+
+- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
++ trie_node_add_value_trie = trie;
++ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
++ trie_node_add_value_trie = NULL;
++
+ if (val) {
+ /* At this point we have 2 identical properties on the same match-string.
+ * Since we process files in order, we just replace the previous value.
+@@ -191,7 +193,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+ node->values[node->values_count].file_priority = file_priority;
+ node->values[node->values_count].line_number = line_number;
+ node->values_count++;
+- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
++ trie_node_add_value_trie = trie;
++ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
++ trie_node_add_value_trie = NULL;
+ return 0;
+ }
+
+diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
+index 02408a4285..491d367d12 100644
+--- a/src/udev/udevadm-hwdb.c
++++ b/src/udev/udevadm-hwdb.c
+@@ -114,13 +114,13 @@ static void trie_node_cleanup(struct trie_node *node) {
+ free(node);
+ }
+
+-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
++static struct trie *trie_node_add_value_trie;
++static int trie_values_cmp(const void *v1, const void *v2) {
+ const struct trie_value_entry *val1 = v1;
+ const struct trie_value_entry *val2 = v2;
+- struct trie *trie = arg;
+
+- return strcmp(trie->strings->buf + val1->key_off,
+- trie->strings->buf + val2->key_off);
++ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
++ trie_node_add_value_trie->strings->buf + val2->key_off);
+ }
+
+ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+@@ -141,7 +141,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+ .value_off = v,
+ };
+
+- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
++ trie_node_add_value_trie = trie;
++ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
++ trie_node_add_value_trie = NULL;
+ if (val) {
+ /* replace existing earlier key with new value */
+ val->value_off = v;
+@@ -158,7 +160,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
+ node->values[node->values_count].key_off = k;
+ node->values[node->values_count].value_off = v;
+ node->values_count++;
+- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
++ trie_node_add_value_trie = trie;
++ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
++ trie_node_add_value_trie = NULL;
+ return 0;
+ }
+
+--
+2.18.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch b/external/poky/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
new file mode 100644
index 00000000..1d7f5230
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
@@ -0,0 +1,64 @@
+From 6e62be87a2722fbe531310a1b052c1301bdf06fb Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 27 Jun 2018 16:09:24 +0800
+Subject: [PATCH 2/9] use lnr wrapper instead of looking for --relative option
+ for ln
+
+Remove file manually to avoid the 'File Exists' error when creating
+symlink. This is because the original 'ln' command uses '-f' option.
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 4 ----
+ tools/meson-make-symlink.sh | 3 ++-
+ units/meson-add-wants.sh | 7 ++++++-
+ 3 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 04331dd41..6d5edcb4e 100644
+--- a/meson.build
++++ b/meson.build
+@@ -558,10 +558,6 @@ endforeach
+
+ conf.set_quoted('TELINIT', get_option('telinit-path'))
+
+-if run_command('ln', '--relative', '--help').returncode() != 0
+- error('ln does not support --relative (added in coreutils 8.16)')
+-endif
+-
+ ############################################################
+
+ gperf = find_program('gperf')
+diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh
+index 501cd43d4..f4e4ac9ac 100755
+--- a/tools/meson-make-symlink.sh
++++ b/tools/meson-make-symlink.sh
+@@ -8,5 +8,6 @@ mkdir -vp "$(dirname "${DESTDIR:-}$2")"
+ if [ "$(dirname $1)" = . ]; then
+ ln -vfs -T "$1" "${DESTDIR:-}$2"
+ else
+- ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
++ rm -f "${DESTDIR:-}$2"
++ lnr "${DESTDIR:-}$1" "${DESTDIR:-}$2"
+ fi
+diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh
+index 70f7172ae..a42666aac 100755
+--- a/units/meson-add-wants.sh
++++ b/units/meson-add-wants.sh
+@@ -25,4 +25,9 @@ case "$target" in
+ ;;
+ esac
+
+-ln -vfs --relative "$unitpath" "$dir"
++if [ -d "$dir" ]; then
++ rm -f "$dir/$unit"
++ lnr "$unitpath" "$dir/$unit"
++else
++ lnr "$unitpath" "$dir"
++fi
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch b/external/poky/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
new file mode 100644
index 00000000..115fb33c
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
@@ -0,0 +1,40 @@
+From e965e748c7030df0709e63128db2f023540a06ba Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 12 Sep 2015 18:53:31 +0000
+Subject: [PATCH 03/19] comparison_fn_t is glibc specific, use raw signature in
+ function pointer
+
+make it work with musl where comparison_fn_t is not provided
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/util.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/util.h b/src/basic/util.h
+index 40eaf518c..c58392397 100644
+--- a/src/basic/util.h
++++ b/src/basic/util.h
+@@ -77,7 +77,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
+ * that only if nmemb > 0.
+ */
+ static inline void* bsearch_safe(const void *key, const void *base,
+- size_t nmemb, size_t size, comparison_fn_t compar) {
++ size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
+ if (nmemb <= 0)
+ return NULL;
+
+@@ -89,7 +89,7 @@ static inline void* bsearch_safe(const void *key, const void *base,
+ * Normal qsort requires base to be nonnull. Here were require
+ * that only if nmemb > 0.
+ */
+-static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
++static inline void qsort_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
+ if (nmemb <= 1)
+ return;
+
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch b/external/poky/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch
new file mode 100644
index 00000000..6c595ae7
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch
@@ -0,0 +1,43 @@
+From 0fcb6e646401205e17cc6c129441a49023c62cef Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Sep 2015 06:31:47 +0000
+Subject: [PATCH 3/9] implment systemd-sysv-install for OE
+
+Use update-rc.d for enabling/disabling and status command
+to check the status of the sysv service
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemctl/systemd-sysv-install.SKELETON | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON
+index 8c16cf999..9f078a121 100755
+--- a/src/systemctl/systemd-sysv-install.SKELETON
++++ b/src/systemctl/systemd-sysv-install.SKELETON
+@@ -32,17 +32,17 @@ case "$1" in
+ enable)
+ # call the command to enable SysV init script $NAME here
+ # (consider optional $ROOT)
+- echo "IMPLEMENT ME: enabling SysV init.d script $NAME"
++ update-rc.d -f $NAME defaults
+ ;;
+ disable)
+ # call the command to disable SysV init script $NAME here
+ # (consider optional $ROOT)
+- echo "IMPLEMENT ME: disabling SysV init.d script $NAME"
++ update-rc.d -f $NAME remove
+ ;;
+ is-enabled)
+ # exit with 0 if $NAME is enabled, non-zero if it is disabled
+ # (consider optional $ROOT)
+- echo "IMPLEMENT ME: checking SysV init.d script $NAME"
++ /etc/init.d/$NAME status
+ ;;
+ *)
+ usage ;;
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch b/external/poky/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch
new file mode 100644
index 00000000..7652a2d8
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch
@@ -0,0 +1,432 @@
+From 582af7ec13131dfcc620ed81de7b211914c4cb03 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 29 Jun 2018 13:43:49 +0800
+Subject: [PATCH 04/19] add fallback parse_printf_format implementation
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 1 +
+ src/basic/meson.build | 5 +
+ src/basic/parse-printf-format.c | 273 ++++++++++++++++++++++++++++++++++++++++
+ src/basic/parse-printf-format.h | 57 +++++++++
+ src/basic/stdio-util.h | 2 +-
+ src/journal/journal-send.c | 2 +-
+ 6 files changed, 338 insertions(+), 2 deletions(-)
+ create mode 100644 src/basic/parse-printf-format.c
+ create mode 100644 src/basic/parse-printf-format.h
+
+diff --git a/meson.build b/meson.build
+index e045b9224..8c16bc979 100644
+--- a/meson.build
++++ b/meson.build
+@@ -598,6 +598,7 @@ foreach header : ['crypt.h',
+ 'linux/btrfs.h',
+ 'linux/memfd.h',
+ 'linux/vm_sockets.h',
++ 'printf.h',
+ 'sys/auxv.h',
+ 'valgrind/memcheck.h',
+ 'valgrind/valgrind.h',
+diff --git a/src/basic/meson.build b/src/basic/meson.build
+index 31625b178..0c27528e7 100644
+--- a/src/basic/meson.build
++++ b/src/basic/meson.build
+@@ -302,6 +302,11 @@ foreach item : [['af', af_list_txt, 'af', ''],
+ endforeach
+
+ basic_sources += [missing_h] + generated_gperf_headers
++
++if conf.get('HAVE_PRINTF_H') != 1
++ basic_sources += [files('parse-printf-format.c')]
++endif
++
+ basic_gcrypt_sources = files(
+ 'gcrypt-util.c',
+ 'gcrypt-util.h')
+diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c
+new file mode 100644
+index 000000000..49437e544
+--- /dev/null
++++ b/src/basic/parse-printf-format.c
+@@ -0,0 +1,273 @@
++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
++
++/***
++ This file is part of systemd.
++
++ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
++
++ With parts from the musl C library
++ Copyright 2005-2014 Rich Felker, et al.
++
++ systemd is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Lesser General Public License as published by
++ the Free Software Foundation; either version 2.1 of the License, or
++ (at your option) any later version.
++
++ systemd 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public License
++ along with systemd; If not, see <http://www.gnu.org/licenses/>.
++***/
++
++#include <stddef.h>
++#include <string.h>
++
++#include "parse-printf-format.h"
++
++static const char *consume_nonarg(const char *fmt)
++{
++ do {
++ if (*fmt == '\0')
++ return fmt;
++ } while (*fmt++ != '%');
++ return fmt;
++}
++
++static const char *consume_num(const char *fmt)
++{
++ for (;*fmt >= '0' && *fmt <= '9'; fmt++)
++ /* do nothing */;
++ return fmt;
++}
++
++static const char *consume_argn(const char *fmt, size_t *arg)
++{
++ const char *p = fmt;
++ size_t val = 0;
++
++ if (*p < '1' || *p > '9')
++ return fmt;
++ do {
++ val = 10*val + (*p++ - '0');
++ } while (*p >= '0' && *p <= '9');
++
++ if (*p != '$')
++ return fmt;
++ *arg = val;
++ return p+1;
++}
++
++static const char *consume_flags(const char *fmt)
++{
++ while (1) {
++ switch (*fmt) {
++ case '#':
++ case '0':
++ case '-':
++ case ' ':
++ case '+':
++ case '\'':
++ case 'I':
++ fmt++;
++ continue;
++ }
++ return fmt;
++ }
++}
++
++enum state {
++ BARE,
++ LPRE,
++ LLPRE,
++ HPRE,
++ HHPRE,
++ BIGLPRE,
++ ZTPRE,
++ JPRE,
++ STOP
++};
++
++enum type {
++ NONE,
++ PTR,
++ INT,
++ UINT,
++ ULLONG,
++ LONG,
++ ULONG,
++ SHORT,
++ USHORT,
++ CHAR,
++ UCHAR,
++ LLONG,
++ SIZET,
++ IMAX,
++ UMAX,
++ PDIFF,
++ UIPTR,
++ DBL,
++ LDBL,
++ MAXTYPE
++};
++
++static const short pa_types[MAXTYPE] = {
++ [NONE] = PA_INT,
++ [PTR] = PA_POINTER,
++ [INT] = PA_INT,
++ [UINT] = PA_INT,
++ [ULLONG] = PA_INT | PA_FLAG_LONG_LONG,
++ [LONG] = PA_INT | PA_FLAG_LONG,
++ [ULONG] = PA_INT | PA_FLAG_LONG,
++ [SHORT] = PA_INT | PA_FLAG_SHORT,
++ [USHORT] = PA_INT | PA_FLAG_SHORT,
++ [CHAR] = PA_CHAR,
++ [UCHAR] = PA_CHAR,
++ [LLONG] = PA_INT | PA_FLAG_LONG_LONG,
++ [SIZET] = PA_INT | PA_FLAG_LONG,
++ [IMAX] = PA_INT | PA_FLAG_LONG_LONG,
++ [UMAX] = PA_INT | PA_FLAG_LONG_LONG,
++ [PDIFF] = PA_INT | PA_FLAG_LONG_LONG,
++ [UIPTR] = PA_INT | PA_FLAG_LONG,
++ [DBL] = PA_DOUBLE,
++ [LDBL] = PA_DOUBLE | PA_FLAG_LONG_DOUBLE
++};
++
++#define S(x) [(x)-'A']
++#define E(x) (STOP + (x))
++
++static const unsigned char states[]['z'-'A'+1] = {
++ { /* 0: bare types */
++ S('d') = E(INT), S('i') = E(INT),
++ S('o') = E(UINT),S('u') = E(UINT),S('x') = E(UINT), S('X') = E(UINT),
++ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
++ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
++ S('c') = E(CHAR),S('C') = E(INT),
++ S('s') = E(PTR), S('S') = E(PTR), S('p') = E(UIPTR),S('n') = E(PTR),
++ S('m') = E(NONE),
++ S('l') = LPRE, S('h') = HPRE, S('L') = BIGLPRE,
++ S('z') = ZTPRE, S('j') = JPRE, S('t') = ZTPRE
++ }, { /* 1: l-prefixed */
++ S('d') = E(LONG), S('i') = E(LONG),
++ S('o') = E(ULONG),S('u') = E(ULONG),S('x') = E(ULONG),S('X') = E(ULONG),
++ S('e') = E(DBL), S('f') = E(DBL), S('g') = E(DBL), S('a') = E(DBL),
++ S('E') = E(DBL), S('F') = E(DBL), S('G') = E(DBL), S('A') = E(DBL),
++ S('c') = E(INT), S('s') = E(PTR), S('n') = E(PTR),
++ S('l') = LLPRE
++ }, { /* 2: ll-prefixed */
++ S('d') = E(LLONG), S('i') = E(LLONG),
++ S('o') = E(ULLONG),S('u') = E(ULLONG),
++ S('x') = E(ULLONG),S('X') = E(ULLONG),
++ S('n') = E(PTR)
++ }, { /* 3: h-prefixed */
++ S('d') = E(SHORT), S('i') = E(SHORT),
++ S('o') = E(USHORT),S('u') = E(USHORT),
++ S('x') = E(USHORT),S('X') = E(USHORT),
++ S('n') = E(PTR),
++ S('h') = HHPRE
++ }, { /* 4: hh-prefixed */
++ S('d') = E(CHAR), S('i') = E(CHAR),
++ S('o') = E(UCHAR),S('u') = E(UCHAR),
++ S('x') = E(UCHAR),S('X') = E(UCHAR),
++ S('n') = E(PTR)
++ }, { /* 5: L-prefixed */
++ S('e') = E(LDBL),S('f') = E(LDBL),S('g') = E(LDBL), S('a') = E(LDBL),
++ S('E') = E(LDBL),S('F') = E(LDBL),S('G') = E(LDBL), S('A') = E(LDBL),
++ S('n') = E(PTR)
++ }, { /* 6: z- or t-prefixed (assumed to be same size) */
++ S('d') = E(PDIFF),S('i') = E(PDIFF),
++ S('o') = E(SIZET),S('u') = E(SIZET),
++ S('x') = E(SIZET),S('X') = E(SIZET),
++ S('n') = E(PTR)
++ }, { /* 7: j-prefixed */
++ S('d') = E(IMAX), S('i') = E(IMAX),
++ S('o') = E(UMAX), S('u') = E(UMAX),
++ S('x') = E(UMAX), S('X') = E(UMAX),
++ S('n') = E(PTR)
++ }
++};
++
++size_t parse_printf_format(const char *fmt, size_t n, int *types)
++{
++ size_t i = 0;
++ size_t last = 0;
++
++ memset(types, 0, n);
++
++ while (1) {
++ size_t arg;
++ unsigned int state;
++
++ fmt = consume_nonarg(fmt);
++ if (*fmt == '\0')
++ break;
++ if (*fmt == '%') {
++ fmt++;
++ continue;
++ }
++ arg = 0;
++ fmt = consume_argn(fmt, &arg);
++ /* flags */
++ fmt = consume_flags(fmt);
++ /* width */
++ if (*fmt == '*') {
++ size_t warg = 0;
++ fmt = consume_argn(fmt+1, &warg);
++ if (warg == 0)
++ warg = ++i;
++ if (warg > last)
++ last = warg;
++ if (warg <= n && types[warg-1] == NONE)
++ types[warg-1] = INT;
++ } else
++ fmt = consume_num(fmt);
++ /* precision */
++ if (*fmt == '.') {
++ fmt++;
++ if (*fmt == '*') {
++ size_t parg = 0;
++ fmt = consume_argn(fmt+1, &parg);
++ if (parg == 0)
++ parg = ++i;
++ if (parg > last)
++ last = parg;
++ if (parg <= n && types[parg-1] == NONE)
++ types[parg-1] = INT;
++ } else {
++ if (*fmt == '-')
++ fmt++;
++ fmt = consume_num(fmt);
++ }
++ }
++ /* length modifier and conversion specifier */
++ state = BARE;
++ do {
++ unsigned char c = *fmt++;
++
++ if (c < 'A' || c > 'z')
++ continue;
++ state = states[state]S(c);
++ if (state == 0)
++ continue;
++ } while (state < STOP);
++
++ if (state == E(NONE))
++ continue;
++
++ if (arg == 0)
++ arg = ++i;
++ if (arg > last)
++ last = arg;
++ if (arg <= n)
++ types[arg-1] = state - STOP;
++ }
++
++ if (last > n)
++ last = n;
++ for (i = 0; i < last; i++)
++ types[i] = pa_types[types[i]];
++
++ return last;
++}
+diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h
+new file mode 100644
+index 000000000..47be7522d
+--- /dev/null
++++ b/src/basic/parse-printf-format.h
+@@ -0,0 +1,57 @@
++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
++
++/***
++ This file is part of systemd.
++
++ Copyright 2014 Emil Renner Berthing <systemd@esmil.dk>
++
++ With parts from the GNU C Library
++ Copyright 1991-2014 Free Software Foundation, Inc.
++
++ systemd is free software; you can redistribute it and/or modify it
++ under the terms of the GNU Lesser General Public License as published by
++ the Free Software Foundation; either version 2.1 of the License, or
++ (at your option) any later version.
++
++ systemd 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
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public License
++ along with systemd; If not, see <http://www.gnu.org/licenses/>.
++***/
++
++#pragma once
++
++#include "config.h"
++
++#if HAVE_PRINTF_H
++#include <printf.h>
++#else
++
++#include <stddef.h>
++
++enum { /* C type: */
++ PA_INT, /* int */
++ PA_CHAR, /* int, cast to char */
++ PA_WCHAR, /* wide char */
++ PA_STRING, /* const char *, a '\0'-terminated string */
++ PA_WSTRING, /* const wchar_t *, wide character string */
++ PA_POINTER, /* void * */
++ PA_FLOAT, /* float */
++ PA_DOUBLE, /* double */
++ PA_LAST
++};
++
++/* Flag bits that can be set in a type returned by `parse_printf_format'. */
++#define PA_FLAG_MASK 0xff00
++#define PA_FLAG_LONG_LONG (1 << 8)
++#define PA_FLAG_LONG_DOUBLE PA_FLAG_LONG_LONG
++#define PA_FLAG_LONG (1 << 9)
++#define PA_FLAG_SHORT (1 << 10)
++#define PA_FLAG_PTR (1 << 11)
++
++size_t parse_printf_format(const char *fmt, size_t n, int *types);
++
++#endif /* HAVE_PRINTF_H */
+diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h
+index 73c03274c..30192cd71 100644
+--- a/src/basic/stdio-util.h
++++ b/src/basic/stdio-util.h
+@@ -1,12 +1,12 @@
+ /* SPDX-License-Identifier: LGPL-2.1+ */
+ #pragma once
+
+-#include <printf.h>
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+
+ #include "macro.h"
++#include "parse-printf-format.h"
+
+ #define snprintf_ok(buf, len, fmt, ...) \
+ ((size_t) snprintf(buf, len, fmt, __VA_ARGS__) < (len))
+diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
+index a0621524a..65bcbcd2e 100644
+--- a/src/journal/journal-send.c
++++ b/src/journal/journal-send.c
+@@ -2,7 +2,6 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <printf.h>
+ #include <stddef.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+@@ -21,6 +20,7 @@
+ #include "stdio-util.h"
+ #include "string-util.h"
+ #include "util.h"
++#include "parse-printf-format.h"
+
+ #define SNDBUF_SIZE (8*1024*1024)
+
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch b/external/poky/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch
new file mode 100644
index 00000000..7e37cbc2
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch
@@ -0,0 +1,33 @@
+From 5d8128f3832fd11fd046d1d1ad86c4ee7bc1dff0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 9 Nov 2016 19:41:13 -0800
+Subject: [PATCH 4/9] rules: whitelist hd* devices
+
+qemu by default emulates IDE and the linux-yocto kernel(s) use
+CONFIG_IDE instead of the more modern libsata, so disks appear as
+/dev/hd*. Patch rejected upstream because CONFIG_IDE is deprecated.
+
+Upstream-Status: Denied [https://github.com/systemd/systemd/pull/1276]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ rules/60-persistent-storage.rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
+index 8ddb7577c..811e948ad 100644
+--- a/rules/60-persistent-storage.rules
++++ b/rules/60-persistent-storage.rules
+@@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end"
+ ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end"
+
+ SUBSYSTEM!="block", GOTO="persistent_storage_end"
+-KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*", GOTO="persistent_storage_end"
++KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*|hd*", GOTO="persistent_storage_end"
+
+ # ignore partitions that span the entire disk
+ TEST=="whole_disk", GOTO="persistent_storage_end"
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch b/external/poky/meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch
new file mode 100644
index 00000000..c1370872
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch
@@ -0,0 +1,70 @@
+From 8b82663aeeedf9ca58e3b97116b4c4da5229e0f5 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 27 Jun 2018 16:46:45 +0800
+Subject: [PATCH 5/9] Make root's home directory configurable
+
+OpenEmbedded has a configurable home directory for root. Allow
+systemd to be built using its idea of what root's home directory
+should be.
+
+Upstream-Status: Denied
+Upstream wants to have a unified hierarchy where everyone is
+using the same root folder.
+https://github.com/systemd/systemd/issues/541
+
+Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 7 +++++++
+ meson_options.txt | 2 ++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 6d5edcb4e..323146fe1 100644
+--- a/meson.build
++++ b/meson.build
+@@ -89,6 +89,11 @@ if rootlibdir == ''
+ rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
+ endif
+
++roothomedir = get_option('roothomedir')
++if roothomedir == ''
++ roothomedir = '/root'
++endif
++
+ # Dirs of external packages
+ pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
+ pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
+@@ -210,6 +215,7 @@ conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
+ conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
+ conf.set_quoted('LIBDIR', libdir)
+ conf.set_quoted('ROOTLIBDIR', rootlibdir)
++conf.set_quoted('ROOTHOMEDIR', roothomedir)
+ conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
+ conf.set_quoted('BOOTLIBDIR', bootlibdir)
+ conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
+@@ -228,6 +234,7 @@ substs.set('prefix', prefixdir)
+ substs.set('exec_prefix', prefixdir)
+ substs.set('libdir', libdir)
+ substs.set('rootlibdir', rootlibdir)
++substs.set('roothomedir', roothomedir)
+ substs.set('includedir', includedir)
+ substs.set('pkgsysconfdir', pkgsysconfdir)
+ substs.set('bindir', bindir)
+diff --git a/meson_options.txt b/meson_options.txt
+index 16c1f2b2f..aa9a33368 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -9,6 +9,8 @@ option('rootlibdir', type : 'string',
+ description : '''[/usr]/lib/x86_64-linux-gnu or such''')
+ option('rootprefix', type : 'string',
+ description : '''override the root prefix''')
++option('roothomedir', type : 'string',
++ description : '''override the root home directory''')
+ option('link-udev-shared', type : 'boolean',
+ description : 'link systemd-udev and its helpers to libsystemd-shared.so')
+ option('link-systemctl-shared', type: 'boolean',
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch b/external/poky/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch
new file mode 100644
index 00000000..6d5faf5f
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch
@@ -0,0 +1,29 @@
+From a2c4d46944892174930135672508389a04e191f0 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 29 Jun 2018 13:53:29 +0800
+Subject: [PATCH 05/19] include gshadow only if ENABLE_GSHADOW is 1
+
+Upstream-Status: Inappropriate [musl]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/user-util.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/basic/user-util.h b/src/basic/user-util.h
+index b74f16885..f9c1e29c4 100644
+--- a/src/basic/user-util.h
++++ b/src/basic/user-util.h
+@@ -2,7 +2,9 @@
+ #pragma once
+
+ #include <grp.h>
++#if ENABLE_GSHADOW
+ #include <gshadow.h>
++#endif
+ #include <pwd.h>
+ #include <shadow.h>
+ #include <stdbool.h>
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch b/external/poky/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch
new file mode 100644
index 00000000..eb6eb8bf
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch
@@ -0,0 +1,63 @@
+From 5199ae5dec9b8a9c9e20477d5090f1732735fbe2 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Thu, 28 Jun 2018 09:38:12 +0800
+Subject: [PATCH 6/9] remove nobody user/group checking
+
+Upstream-Status: Inappropriate [OE Specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 37 -------------------------------------
+ 1 file changed, 37 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 323146fe1..3bb087fef 100644
+--- a/meson.build
++++ b/meson.build
+@@ -681,43 +681,6 @@ substs.set('containeruidbasemax', container_uid_base_max)
+ nobody_user = get_option('nobody-user')
+ nobody_group = get_option('nobody-group')
+
+-getent_result = run_command('getent', 'passwd', '65534')
+-if getent_result.returncode() == 0
+- name = getent_result.stdout().split(':')[0]
+- if name != nobody_user
+- warning('\n' +
+- 'The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) +
+- 'Your build will result in an user table setup that is incompatible with the local system.')
+- endif
+-endif
+-id_result = run_command('id', '-u', nobody_user)
+-if id_result.returncode() == 0
+- id = id_result.stdout().to_int()
+- if id != 65534
+- warning('\n' +
+- 'The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) +
+- 'Your build will result in an user table setup that is incompatible with the local system.')
+- endif
+-endif
+-
+-getent_result = run_command('getent', 'group', '65534')
+-if getent_result.returncode() == 0
+- name = getent_result.stdout().split(':')[0]
+- if name != nobody_group
+- warning('\n' +
+- 'The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) +
+- 'Your build will result in an group table setup that is incompatible with the local system.')
+- endif
+-endif
+-id_result = run_command('id', '-g', nobody_group)
+-if id_result.returncode() == 0
+- id = id_result.stdout().to_int()
+- if id != 65534
+- warning('\n' +
+- 'The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) +
+- 'Your build will result in an group table setup that is incompatible with the local system.')
+- endif
+-endif
+ if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
+ warning('\n' +
+ 'The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch b/external/poky/meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch
new file mode 100644
index 00000000..107a7943
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch
@@ -0,0 +1,118 @@
+From 03fd19fc87573276e0d359260c8fe591f5f0216a Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 29 Jun 2018 16:34:50 +0800
+Subject: [PATCH 06/19] src/basic/missing.h: check for missing strndupa
+
+include missing.h for definition of strndupa
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 1 +
+ src/basic/missing.h | 11 +++++++++++
+ src/basic/mkdir.c | 1 +
+ src/basic/pager.c | 1 +
+ src/basic/parse-util.c | 1 +
+ src/basic/procfs-util.c | 1 +
+ src/shared/uid-range.c | 1 +
+ 7 files changed, 17 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 8c16bc979..a734a295c 100644
+--- a/meson.build
++++ b/meson.build
+@@ -503,6 +503,7 @@ foreach ident : [
+ #include <unistd.h>'''],
+ ['explicit_bzero' , '''#include <string.h>'''],
+ ['reallocarray', '''#include <malloc.h>'''],
++ ['strndupa' , '''#include <string.h>'''],
+ ]
+
+ have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 0e33abb9f..02397f1b6 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -1184,6 +1184,17 @@ struct input_mask {
+ typedef int32_t key_serial_t;
+ #endif
+
++#if ! HAVE_STRNDUPA
++#define strndupa(s, n) \
++ ({ \
++ const char *__old = (s); \
++ size_t __len = strnlen(__old, (n)); \
++ char *__new = (char *)alloca(__len + 1); \
++ __new[__len] = '\0'; \
++ (char *)memcpy(__new, __old, __len); \
++ })
++#endif
++
+ #ifndef KEYCTL_JOIN_SESSION_KEYRING
+ #define KEYCTL_JOIN_SESSION_KEYRING 1
+ #endif
+diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
+index 6ab1b4422..77c3e0863 100644
+--- a/src/basic/mkdir.c
++++ b/src/basic/mkdir.c
+@@ -13,6 +13,7 @@
+ #include "stat-util.h"
+ #include "stdio-util.h"
+ #include "user-util.h"
++#include "missing.h"
+
+ int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdir_func_t _mkdir) {
+ struct stat st;
+diff --git a/src/basic/pager.c b/src/basic/pager.c
+index f24126111..8223bff02 100644
+--- a/src/basic/pager.c
++++ b/src/basic/pager.c
+@@ -21,6 +21,7 @@
+ #include "string-util.h"
+ #include "strv.h"
+ #include "terminal-util.h"
++#include "missing.h"
+
+ static pid_t pager_pid = 0;
+
+diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
+index 6becf8587..52576f536 100644
+--- a/src/basic/parse-util.c
++++ b/src/basic/parse-util.c
+@@ -17,6 +17,7 @@
+ #include "parse-util.h"
+ #include "process-util.h"
+ #include "string-util.h"
++#include "missing.h"
+
+ int parse_boolean(const char *v) {
+ assert(v);
+diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
+index a159e344b..ebc427d6b 100644
+--- a/src/basic/procfs-util.c
++++ b/src/basic/procfs-util.c
+@@ -11,6 +11,7 @@
+ #include "procfs-util.h"
+ #include "stdio-util.h"
+ #include "string-util.h"
++#include "missing.h"
+
+ int procfs_tasks_get_limit(uint64_t *ret) {
+ _cleanup_free_ char *value = NULL;
+diff --git a/src/shared/uid-range.c b/src/shared/uid-range.c
+index 434ce6ff4..37093ab7b 100644
+--- a/src/shared/uid-range.c
++++ b/src/shared/uid-range.c
+@@ -8,6 +8,7 @@
+ #include "macro.h"
+ #include "uid-range.h"
+ #include "user-util.h"
++#include "missing.h"
+
+ static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) {
+ assert(range);
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch b/external/poky/meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch
new file mode 100644
index 00000000..2df8cf95
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch
@@ -0,0 +1,96 @@
+From aab90d0dfa934d33879eaec1a878e93b201d33f1 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 29 Jun 2018 16:44:43 +0800
+Subject: [PATCH 07/19] Include netinet/if_ether.h
+
+Fixes
+/path/to/systemd/recipe-sysroot/usr/include/netinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr'
+ struct ethhdr {
+ ^~~~~~
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/libsystemd/sd-netlink/netlink-types.c | 1 +
+ src/network/netdev/tuntap.c | 1 +
+ src/network/networkd-brvlan.c | 1 +
+ src/udev/net/ethtool-util.c | 1 +
+ src/udev/net/ethtool-util.h | 1 +
+ src/udev/udev-builtin-net_setup_link.c | 1 +
+ 6 files changed, 6 insertions(+)
+
+diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
+index c93fe9cb4..2013d06e1 100644
+--- a/src/libsystemd/sd-netlink/netlink-types.c
++++ b/src/libsystemd/sd-netlink/netlink-types.c
+@@ -3,6 +3,7 @@
+ #include <netinet/in.h>
+ #include <stdint.h>
+ #include <sys/socket.h>
++#include <netinet/if_ether.h>
+ #include <linux/netlink.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/genetlink.h>
+diff --git a/src/network/netdev/tuntap.c b/src/network/netdev/tuntap.c
+index 21fb7ab06..0afe5170c 100644
+--- a/src/network/netdev/tuntap.c
++++ b/src/network/netdev/tuntap.c
+@@ -2,6 +2,7 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
++#include <netinet/if_ether.h>
+ #include <linux/if_tun.h>
+ #include <net/if.h>
+ #include <netinet/if_ether.h>
+diff --git a/src/network/networkd-brvlan.c b/src/network/networkd-brvlan.c
+index 8e8a618e2..52d523a67 100644
+--- a/src/network/networkd-brvlan.c
++++ b/src/network/networkd-brvlan.c
+@@ -4,6 +4,7 @@
+ ***/
+
+ #include <netinet/in.h>
++#include <netinet/if_ether.h>
+ #include <linux/if_bridge.h>
+ #include <stdbool.h>
+
+diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c
+index 4bb4216ac..5f7383483 100644
+--- a/src/udev/net/ethtool-util.c
++++ b/src/udev/net/ethtool-util.c
+@@ -1,5 +1,6 @@
+ /* SPDX-License-Identifier: LGPL-2.1+ */
+
++#include <netinet/if_ether.h>
+ #include <net/if.h>
+ #include <sys/ioctl.h>
+ #include <linux/ethtool.h>
+diff --git a/src/udev/net/ethtool-util.h b/src/udev/net/ethtool-util.h
+index 064bf4d2b..ee0d4fb2a 100644
+--- a/src/udev/net/ethtool-util.h
++++ b/src/udev/net/ethtool-util.h
+@@ -3,6 +3,7 @@
+
+
+ #include <macro.h>
++#include <netinet/if_ether.h>
+ #include <linux/ethtool.h>
+
+ #include "missing.h"
+diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
+index 8bed6399a..a3a96959b 100644
+--- a/src/udev/udev-builtin-net_setup_link.c
++++ b/src/udev/udev-builtin-net_setup_link.c
+@@ -1,5 +1,6 @@
+ /* SPDX-License-Identifier: LGPL-2.1+ */
+
++#include <netinet/if_ether.h>
+ #include "alloc-util.h"
+ #include "link-config.h"
+ #include "log.h"
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch b/external/poky/meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch
new file mode 100644
index 00000000..a5f65e66
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch
@@ -0,0 +1,43 @@
+From 9302b72e5e69512aaa7106197b00c55baeb35b3c Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 17 Nov 2017 09:46:00 +0800
+Subject: [PATCH 7/9] rules: watch metadata changes in ide devices
+
+Formatting IDE storage does not trigger "change" uevents. As a result
+clients using udev API don't get any updates afterwards and get outdated
+information about the device.
+...
+root@qemux86-64:~# mkfs.ext4 -F /dev/hda1
+Creating filesystem with 262144 4k blocks and 65536 inodes
+Filesystem UUID: 98791eb2-2bf3-47ad-b4d8-4cf7e914eee2
+
+root@qemux86-64:~# ls /dev/disk/by-uuid/98791eb2-2bf3-47ad-b4d8-4cf7e914eee2
+ls: cannot access '/dev/disk/by-uuid/98791eb2-2bf3-47ad-b4d8-4cf7e914eee2': No such file or directory
+...
+Include hd* in a match for watch option assignment.
+
+Upstream-Status: Denied
+
+qemu by default emulates IDE and the linux-yocto kernel(s) use
+CONFIG_IDE instead of the more modern libsata, so disks appear as
+/dev/hd*. A similar patch rejected by upstream because CONFIG_IDE
+is deprecated.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ rules/60-block.rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rules/60-block.rules b/rules/60-block.rules
+index 343fc06f8..b5237dac4 100644
+--- a/rules/60-block.rules
++++ b/rules/60-block.rules
+@@ -8,4 +8,4 @@ ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_
+ ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
+
+ # watch metadata changes, caused by tools closing the device node which was opened for writing
+-ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*", OPTIONS+="watch"
++ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*|hd*", OPTIONS+="watch"
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch b/external/poky/meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch
new file mode 100644
index 00000000..abecdc76
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch
@@ -0,0 +1,29 @@
+From b6ba596fd1313a162cdc2eb88161dcf24d19ede7 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Thu, 28 Jun 2018 10:10:02 +0800
+Subject: [PATCH 8/9] Do not enable nss tests if nss-systemd is not enabled
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/test/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/test/meson.build b/src/test/meson.build
+index 7da7e3a22..7b7c257ff 100644
+--- a/src/test/meson.build
++++ b/src/test/meson.build
+@@ -645,7 +645,7 @@ tests += [
+ [['src/test/test-nss.c'],
+ [],
+ [libdl],
+- '', 'manual'],
++ 'ENABLE_NSS_SYSTEMD', 'manual'],
+
+ [['src/test/test-umount.c',
+ 'src/core/mount-setup.c',
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch b/external/poky/meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
new file mode 100644
index 00000000..bee5fb65
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
@@ -0,0 +1,153 @@
+From 848e711d719a6d987bc7d14183e1c7b1f1c91c56 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Fri, 29 Jun 2018 17:10:29 +0800
+Subject: [PATCH 08/19] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not
+ defined
+
+If the standard library doesn't provide brace
+expansion users just won't get it.
+
+Dont use GNU GLOB extentions on non-glibc systems
+
+Conditionalize use of GLOB_ALTDIRFUNC
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/glob-util.c | 13 +++++++++++--
+ src/test/test-glob-util.c | 15 +++++++++++++++
+ src/tmpfiles/tmpfiles.c | 10 ++++++++++
+ 3 files changed, 36 insertions(+), 2 deletions(-)
+
+diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c
+index 9fac676f2..8adb9559e 100644
+--- a/src/basic/glob-util.c
++++ b/src/basic/glob-util.c
+@@ -10,6 +10,11 @@
+ #include "macro.h"
+ #include "path-util.h"
+ #include "strv.h"
++/* Don't fail if the standard library
++ * doesn't provide brace expansion */
++#ifndef GLOB_BRACE
++#define GLOB_BRACE 0
++#endif
+
+ static void closedir_wrapper(void* v) {
+ (void) closedir(v);
+@@ -18,6 +23,7 @@ static void closedir_wrapper(void* v) {
+ int safe_glob(const char *path, int flags, glob_t *pglob) {
+ int k;
+
++#ifdef GLOB_ALTDIRFUNC
+ /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
+ assert(!(flags & GLOB_ALTDIRFUNC));
+
+@@ -31,10 +37,13 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
+ pglob->gl_lstat = lstat;
+ if (!pglob->gl_stat)
+ pglob->gl_stat = stat;
+-
++#endif
+ errno = 0;
++#ifdef GLOB_ALTDIRFUNC
+ k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob);
+-
++#else
++ k = glob(path, flags, NULL, pglob);
++#endif
+ if (k == GLOB_NOMATCH)
+ return -ENOENT;
+ if (k == GLOB_NOSPACE)
+diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c
+index d78d6223c..f5943b26d 100644
+--- a/src/test/test-glob-util.c
++++ b/src/test/test-glob-util.c
+@@ -12,6 +12,11 @@
+ #include "glob-util.h"
+ #include "macro.h"
+ #include "rm-rf.h"
++/* Don't fail if the standard library
++ * doesn't provide brace expansion */
++#ifndef GLOB_BRACE
++#define GLOB_BRACE 0
++#endif
+
+ static void test_glob_exists(void) {
+ char name[] = "/tmp/test-glob_exists.XXXXXX";
+@@ -40,11 +45,13 @@ static void test_glob_no_dot(void) {
+ const char *fn;
+
+ _cleanup_globfree_ glob_t g = {
++#ifdef GLOB_ALTDIRFUNC
+ .gl_closedir = closedir_wrapper,
+ .gl_readdir = (struct dirent *(*)(void *)) readdir_no_dot,
+ .gl_opendir = (void *(*)(const char *)) opendir,
+ .gl_lstat = lstat,
+ .gl_stat = stat,
++#endif
+ };
+
+ int r;
+@@ -52,11 +59,19 @@ static void test_glob_no_dot(void) {
+ assert_se(mkdtemp(template));
+
+ fn = strjoina(template, "/*");
++#ifdef GLOB_ALTDIRFUNC
+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
++#else
++ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
++#endif
+ assert_se(r == GLOB_NOMATCH);
+
+ fn = strjoina(template, "/.*");
++#ifdef GLOB_ALTDIRFUNC
+ r = glob(fn, GLOB_NOSORT|GLOB_BRACE|GLOB_ALTDIRFUNC, NULL, &g);
++#else
++ r = glob(fn, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
++#endif
+ assert_se(r == GLOB_NOMATCH);
+
+ (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
+diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
+index 927de35f3..5f0283da5 100644
+--- a/src/tmpfiles/tmpfiles.c
++++ b/src/tmpfiles/tmpfiles.c
+@@ -60,6 +60,12 @@
+ #include "user-util.h"
+ #include "util.h"
+
++/* Don't fail if the standard library
++ * doesn't provide brace expansion */
++#ifndef GLOB_BRACE
++#define GLOB_BRACE 0
++#endif
++
+ /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
+ * them in the file system. This is intended to be used to create
+ * properly owned directories beneath /tmp, /var/tmp, /run, which are
+@@ -1345,7 +1351,9 @@ finish:
+
+ static int glob_item(Item *i, action_t action) {
+ _cleanup_globfree_ glob_t g = {
++#ifdef GLOB_ALTDIRFUNC
+ .gl_opendir = (void *(*)(const char *)) opendir_nomod,
++#endif
+ };
+ int r = 0, k;
+ char **fn;
+@@ -1365,7 +1373,9 @@ static int glob_item(Item *i, action_t action) {
+
+ static int glob_item_recursively(Item *i, fdaction_t action) {
+ _cleanup_globfree_ glob_t g = {
++#ifdef GLOB_ALTDIRFUNC
+ .gl_opendir = (void *(*)(const char *)) opendir_nomod,
++#endif
+ };
+ int r = 0, k;
+ char **fn;
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch b/external/poky/meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch
new file mode 100644
index 00000000..95287cce
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch
@@ -0,0 +1,50 @@
+From acc2c08082795802011e3c5f8626d63210021489 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:36:32 -0800
+Subject: [PATCH 09/19] add missing FTW_ macros for musl
+
+This is to avoid build failures like below for musl.
+
+ locale-util.c:296:24: error: 'FTW_STOP' undeclared
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/missing.h | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 02397f1b6..6dc750eba 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -189,6 +189,26 @@ struct sockaddr_vm {
+ #define BTRFS_QGROUP_LEVEL_SHIFT 48
+ #endif
+
++#ifndef FTW_ACTIONRETVAL
++#define FTW_ACTIONRETVAL 16
++#endif
++
++#ifndef FTW_CONTINUE
++#define FTW_CONTINUE 0
++#endif
++
++#ifndef FTW_STOP
++#define FTW_STOP 1
++#endif
++
++#ifndef FTW_SKIP_SUBTREE
++#define FTW_SKIP_SUBTREE 2
++#endif
++
++#ifndef FTW_SKIP_SIBLINGS
++#define FTW_SKIP_SIBLINGS 3
++#endif
++
+ #if ! HAVE_LINUX_BTRFS_H
+ #define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \
+ struct btrfs_ioctl_qgroup_assign_args)
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch b/external/poky/meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch
new file mode 100644
index 00000000..a635fa91
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch
@@ -0,0 +1,43 @@
+From f9625b5f3fd5dac3f3591dbeeb24dc9d6fda790d Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 27 Feb 2018 12:56:21 +0800
+Subject: [PATCH 9/9] nss-mymachines: Build conditionally when
+ ENABLE_MYHOSTNAME is set
+
+Fixes build failures when building with --disable-myhostname
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ meson.build | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 3bb087fef..73bd70b0b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1371,12 +1371,15 @@ test_dlopen = executable(
+ link_with : [libbasic],
+ dependencies : [libdl])
+
+-foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
+- ['systemd', 'ENABLE_NSS_SYSTEMD'],
+- ['mymachines', 'ENABLE_MACHINED'],
+- ['resolve', 'ENABLE_RESOLVE']]
++foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME', ''],
++ ['systemd', 'ENABLE_NSS_SYSTEMD', ''],
++ ['mymachines', 'ENABLE_MACHINED', 'ENABLE_MYHOSTNAME'],
++ ['resolve', 'ENABLE_RESOLVE', '']]
+
+ condition = tuple[1] == '' or conf.get(tuple[1]) == 1
++ if tuple[2] != '' and condition
++ condition = conf.get(tuple[2]) == 1
++ endif
+ if condition
+ module = tuple[0]
+
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch b/external/poky/meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
new file mode 100644
index 00000000..16547981
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
@@ -0,0 +1,38 @@
+From a0bd587300744dbb8e9cfbb043233670ce781c98 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 2 Jul 2018 13:22:41 +0800
+Subject: [PATCH 10/19] socket-util: don't fail if libc doesn't support IDN
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Emil Renner Berthing <systemd@esmil.dk>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/socket-util.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
+index a913102e1..0d0154805 100644
+--- a/src/basic/socket-util.c
++++ b/src/basic/socket-util.c
+@@ -32,6 +32,16 @@
+ #include "utf8.h"
+ #include "util.h"
+
++/* Don't fail if the standard library
++ * doesn't support IDN */
++#ifndef NI_IDN
++#define NI_IDN 0
++#endif
++
++#ifndef NI_IDN_USE_STD3_ASCII_RULES
++#define NI_IDN_USE_STD3_ASCII_RULES 0
++#endif
++
+ #if ENABLE_IDN
+ # define IDN_FLAGS NI_IDN
+ #else
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch b/external/poky/meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch
new file mode 100644
index 00000000..1a22ffd9
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch
@@ -0,0 +1,48 @@
+From 045f205fd21e5e380edf813de04fcfbf5a487219 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 2 Jul 2018 13:28:25 +0800
+Subject: [PATCH 11/19] src/basic/missing.h: check for missing __compar_fn_t
+ typedef
+
+include missing.h for missing __compar_fn_t
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/missing.h | 5 +++++
+ src/basic/strbuf.c | 1 +
+ 2 files changed, 6 insertions(+)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index 6dc750eba..cd1cc109f 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -1179,6 +1179,11 @@ struct input_mask {
+ #define RENAME_NOREPLACE (1 << 0)
+ #endif
+
++#ifndef __COMPAR_FN_T
++#define __COMPAR_FN_T
++typedef int (*__compar_fn_t)(const void *, const void *);
++#endif
++
+ #ifndef KCMP_FILE
+ #define KCMP_FILE 0
+ #endif
+diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c
+index e2ed776a0..4d3ebec4c 100644
+--- a/src/basic/strbuf.c
++++ b/src/basic/strbuf.c
+@@ -7,6 +7,7 @@
+ #include "alloc-util.h"
+ #include "strbuf.h"
+ #include "util.h"
++#include "missing.h"
+
+ /*
+ * Strbuf stores given strings in a single continuous allocated memory
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch b/external/poky/meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch
new file mode 100644
index 00000000..d41bc4a0
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch
@@ -0,0 +1,45 @@
+From 1fadf805cb391e3bcbd9a0286a9e4b7adb9e7427 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 2 Jul 2018 13:34:09 +0800
+Subject: [PATCH 12/19] fix missing of __register_atfork for non-glibc builds
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/process-util.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/basic/process-util.c b/src/basic/process-util.c
+index 0a4f917cb..3543bc045 100644
+--- a/src/basic/process-util.c
++++ b/src/basic/process-util.c
+@@ -22,6 +22,9 @@
+ #if HAVE_VALGRIND_VALGRIND_H
+ #include <valgrind/valgrind.h>
+ #endif
++#ifndef __GLIBC__
++#include <pthread.h>
++#endif
+
+ #include "alloc-util.h"
+ #include "architecture.h"
+@@ -1150,11 +1153,15 @@ void reset_cached_pid(void) {
+ cached_pid = CACHED_PID_UNSET;
+ }
+
++#ifdef __GLIBC__
+ /* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc
+ * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
+ * libpthread, as it is part of glibc anyway. */
+ extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle);
+ extern void* __dso_handle __attribute__ ((__weak__));
++#else
++#define __register_atfork(prepare,parent,child,dso) pthread_atfork(prepare,parent,child)
++#endif
+
+ pid_t getpid_cached(void) {
+ static bool installed = false;
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch b/external/poky/meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch
new file mode 100644
index 00000000..69b3c151
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch
@@ -0,0 +1,90 @@
+From a0ac0cfd90af6431c64d1b276f422a2092d569b3 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Mon, 2 Jul 2018 13:44:21 +0800
+Subject: [PATCH 13/19] Use uintmax_t for handling rlim_t
+
+PRIu{32,64} is not right format to represent rlim_t type
+therefore use %ju and typecast the rlim_t variables to
+uintmax_t.
+
+Fixes portablility errors like
+
+execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
+| fprintf(f, "%s%s: " RLIM_FMT "\n",
+| ^~~~~~~~
+| prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
+| ~~~~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Denied [https://github.com/systemd/systemd/pull/7199]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/format-util.h | 8 --------
+ src/basic/rlimit-util.c | 8 ++++----
+ src/core/execute.c | 8 ++++----
+ 3 files changed, 8 insertions(+), 16 deletions(-)
+
+diff --git a/src/basic/format-util.h b/src/basic/format-util.h
+index 160550cd6..61245d1e3 100644
+--- a/src/basic/format-util.h
++++ b/src/basic/format-util.h
+@@ -43,14 +43,6 @@
+ # define PRI_TIMEX "li"
+ #endif
+
+-#if SIZEOF_RLIM_T == 8
+-# define RLIM_FMT "%" PRIu64
+-#elif SIZEOF_RLIM_T == 4
+-# define RLIM_FMT "%" PRIu32
+-#else
+-# error Unknown rlim_t size
+-#endif
+-
+ #if SIZEOF_DEV_T == 8
+ # define DEV_FMT "%" PRIu64
+ #elif SIZEOF_DEV_T == 4
+diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
+index be1ba615e..e328ce499 100644
+--- a/src/basic/rlimit-util.c
++++ b/src/basic/rlimit-util.c
+@@ -299,13 +299,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) {
+ if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
+ s = strdup("infinity");
+ else if (rl->rlim_cur >= RLIM_INFINITY)
+- (void) asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max);
++ (void) asprintf(&s, "infinity:%ju", (uintmax_t)rl->rlim_max);
+ else if (rl->rlim_max >= RLIM_INFINITY)
+- (void) asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur);
++ (void) asprintf(&s, "%ju:infinity", (uintmax_t)rl->rlim_cur);
+ else if (rl->rlim_cur == rl->rlim_max)
+- (void) asprintf(&s, RLIM_FMT, rl->rlim_cur);
++ (void) asprintf(&s, "%ju", (uintmax_t)rl->rlim_cur);
+ else
+- (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max);
++ (void) asprintf(&s, "%ju:%ju", (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max);
+
+ if (!s)
+ return -ENOMEM;
+diff --git a/src/core/execute.c b/src/core/execute.c
+index 8ac69d1a0..efedf3842 100644
+--- a/src/core/execute.c
++++ b/src/core/execute.c
+@@ -3976,10 +3976,10 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
+
+ for (i = 0; i < RLIM_NLIMITS; i++)
+ if (c->rlimit[i]) {
+- fprintf(f, "Limit%s%s: " RLIM_FMT "\n",
+- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
+- fprintf(f, "Limit%s%sSoft: " RLIM_FMT "\n",
+- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur);
++ fprintf(f, "Limit%s%s: %ju\n",
++ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max);
++ fprintf(f, "Limit%s%sSoft: %ju\n",
++ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur);
+ }
+
+ if (c->ioprio_set) {
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch b/external/poky/meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
new file mode 100644
index 00000000..258a631c
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
@@ -0,0 +1,30 @@
+From cb59b3af54fb3bbd4d8264fef919810af8d08d16 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 27 Feb 2018 14:01:30 +0800
+Subject: [PATCH 14/19] fix missing ULONG_LONG_MAX definition in case of musl
+
+Upstream-Status: Inappropriate [musl]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/missing.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/basic/missing.h b/src/basic/missing.h
+index cd1cc109f..144058a1a 100644
+--- a/src/basic/missing.h
++++ b/src/basic/missing.h
+@@ -54,6 +54,10 @@ struct sockaddr_vm {
+ };
+ #endif /* !HAVE_LINUX_VM_SOCKETS_H */
+
++#ifndef ULONG_LONG_MAX
++#define ULONG_LONG_MAX ULLONG_MAX
++#endif
++
+ #ifndef RLIMIT_RTTIME
+ #define RLIMIT_RTTIME 15
+ #endif
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch b/external/poky/meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
new file mode 100644
index 00000000..c7ca9cd4
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
@@ -0,0 +1,28 @@
+From b11109ecc41110c518a98b6ac39611ff86477021 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 23 Oct 2017 12:33:22 -0700
+Subject: [PATCH 15/19] test-hexdecoct.c: Include missing.h for strndupa
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/test/test-hexdecoct.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
+index da9f3008b..7ff2dfe0c 100644
+--- a/src/test/test-hexdecoct.c
++++ b/src/test/test-hexdecoct.c
+@@ -6,6 +6,7 @@
+ #include "hexdecoct.h"
+ #include "macro.h"
+ #include "string-util.h"
++#include "missing.h"
+
+ static void test_hexchar(void) {
+ assert_se(hexchar(0xa) == 'a');
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch b/external/poky/meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
new file mode 100644
index 00000000..c06a3706
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
@@ -0,0 +1,42 @@
+From c4bbf3efefffe0a4efadbf4e3f0adb54d76fe0e7 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 28 Feb 2018 21:25:22 -0800
+Subject: [PATCH 16/19] test-sizeof.c: Disable tests for missing typedefs in
+ musl
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/test/test-sizeof.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
+index 7a1e496ed..386b314d5 100644
+--- a/src/test/test-sizeof.c
++++ b/src/test/test-sizeof.c
+@@ -40,8 +40,10 @@ int main(void) {
+ info(unsigned);
+ info(long unsigned);
+ info(long long unsigned);
++#ifdef __GLIBC__
+ info(__syscall_ulong_t);
+ info(__syscall_slong_t);
++#endif
+
+ info(float);
+ info(double);
+@@ -59,7 +61,9 @@ int main(void) {
+ info(ssize_t);
+ info(time_t);
+ info(usec_t);
++#ifdef __GLIBC__
+ info(__time_t);
++#endif
+ info(pid_t);
+ info(uid_t);
+ info(gid_t);
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch b/external/poky/meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
new file mode 100644
index 00000000..8e47c6f5
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
@@ -0,0 +1,99 @@
+From 91bb4f5c9c11464468e8d3fa4746d98d59997264 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 10 Oct 2017 14:33:30 -0700
+Subject: [PATCH 17/19] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat()
+
+Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right
+thing to do and it's not portable (not supported by musl). See:
+
+ http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
+ http://www.openwall.com/lists/musl/2015/02/05/2
+
+Note that laccess() is never passing AT_EACCESS so a lot of the
+discussion in the links above doesn't apply. Note also that
+(currently) all systemd callers of laccess() pass mode as F_OK, so
+only check for existence of a file, not access permissions.
+Therefore, in this case, the only distiction between faccessat()
+with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the behaviour
+for broken symlinks; laccess() on a broken symlink will succeed with
+(flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
+
+The laccess() macros was added to systemd some time ago and it's not
+clear if or why it needs to return success for broken symlinks. Maybe
+just historical and not actually necessary or desired behaviour?
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ src/basic/fs-util.h | 22 +++++++++++++++++++++-
+ src/shared/base-filesystem.c | 6 +++---
+ 2 files changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
+index 28566773c..14b864cc5 100644
+--- a/src/basic/fs-util.h
++++ b/src/basic/fs-util.h
+@@ -32,7 +32,27 @@ int fchmod_opath(int fd, mode_t m);
+
+ int fd_warn_permissions(const char *path, int fd);
+
+-#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), AT_SYMLINK_NOFOLLOW)
++/*
++ Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right thing to
++ do and it's not portable (not supported by musl). See:
++
++ http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003610.html
++ http://www.openwall.com/lists/musl/2015/02/05/2
++
++ Note that laccess() is never passing AT_EACCESS so a lot of the discussion in
++ the links above doesn't apply. Note also that (currently) all systemd callers
++ of laccess() pass mode as F_OK, so only check for existence of a file, not
++ access permissions. Therefore, in this case, the only distiction between
++ faccessat() with (flag == 0) and (flag == AT_SYMLINK_NOFOLLOW) is the
++ behaviour for broken symlinks; laccess() on a broken symlink will succeed
++ with (flag == AT_SYMLINK_NOFOLLOW) and fail (flag == 0).
++
++ The laccess() macros was added to systemd some time ago and it's not clear if
++ or why it needs to return success for broken symlinks. Maybe just historical
++ and not actually necessary or desired behaviour?
++*/
++
++#define laccess(path, mode) faccessat(AT_FDCWD, (path), (mode), 0)
+
+ int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
+ int touch(const char *path);
+diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
+index 89d7a7d59..34b4ad53a 100644
+--- a/src/shared/base-filesystem.c
++++ b/src/shared/base-filesystem.c
+@@ -53,7 +53,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
+ return log_error_errno(errno, "Failed to open root file system: %m");
+
+ for (i = 0; i < ELEMENTSOF(table); i ++) {
+- if (faccessat(fd, table[i].dir, F_OK, AT_SYMLINK_NOFOLLOW) >= 0)
++ if (faccessat(fd, table[i].dir, F_OK, 0) >= 0)
+ continue;
+
+ if (table[i].target) {
+@@ -61,7 +61,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
+
+ /* check if one of the targets exists */
+ NULSTR_FOREACH(s, table[i].target) {
+- if (faccessat(fd, s, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
++ if (faccessat(fd, s, F_OK, 0) < 0)
+ continue;
+
+ /* check if a specific file exists at the target path */
+@@ -72,7 +72,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
+ if (!p)
+ return log_oom();
+
+- if (faccessat(fd, p, F_OK, AT_SYMLINK_NOFOLLOW) < 0)
++ if (faccessat(fd, p, F_OK, 0) < 0)
+ continue;
+ }
+
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch b/external/poky/meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch
new file mode 100644
index 00000000..1bd0d602
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch
@@ -0,0 +1,34 @@
+From 97fed07132533a1b2bce9c60e305a5d09aee2e9b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 27 May 2018 08:36:44 -0700
+Subject: [PATCH 18/19] Define glibc compatible basename() for non-glibc
+ systems
+
+Fixes builds with musl, even though systemd is adamant about
+using non-posix basename implementation, we have a way out
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/machine/machine-dbus.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
+index 7f41465cc..cee8a5d43 100644
+--- a/src/machine/machine-dbus.c
++++ b/src/machine/machine-dbus.c
+@@ -11,6 +11,10 @@
+ #include <libgen.h>
+ #undef basename
+
++#if !defined(__GLIBC__)
++#define basename(src) (strrchr(src,'/') ? strrchr(src,'/')+1 : src)
++#endif
++
+ #include "alloc-util.h"
+ #include "bus-common-errors.h"
+ #include "bus-internal.h"
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch b/external/poky/meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
new file mode 100644
index 00000000..942f4c09
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
@@ -0,0 +1,39 @@
+From 8440348bcac34249cdf6ac2dcae9ac66d3c727db Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 4 Jul 2018 15:00:44 +0800
+Subject: [PATCH 19/19] Do not disable buffering when writing to oom_score_adj
+
+On musl, disabling buffering when writing to oom_score_adj will
+cause the following error.
+
+ Failed to adjust OOM setting: Invalid argument
+
+This error appears for systemd-udevd.service and dbus.service.
+This is because kernel receives '-' instead of the whole '-900'
+if buffering is disabled.
+
+This is libc implementation specific, as glibc does not have this issue.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/basic/process-util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/basic/process-util.c b/src/basic/process-util.c
+index 3543bc045..d0572e034 100644
+--- a/src/basic/process-util.c
++++ b/src/basic/process-util.c
+@@ -1473,7 +1473,7 @@ int set_oom_score_adjust(int value) {
+ sprintf(t, "%i", value);
+
+ return write_string_file("/proc/self/oom_score_adj", t,
+- WRITE_STRING_FILE_VERIFY_ON_FAILURE|WRITE_STRING_FILE_DISABLE_BUFFER);
++ WRITE_STRING_FILE_VERIFY_ON_FAILURE);
+ }
+
+ static const char *const ioprio_class_table[] = {
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch b/external/poky/meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
new file mode 100644
index 00000000..5c78cabb
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
@@ -0,0 +1,62 @@
+From dd53dc9b9542cbd2c39a39096941dfed70d06506 Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Tue, 10 Jul 2018 15:40:17 +0800
+Subject: [PATCH 20/20] distinguish XSI-compliant strerror_r from GNU-specifi
+ strerror_r
+
+XSI-compliant strerror_r and GNU-specifi strerror_r are different.
+
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ /* XSI-compliant */
+
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ /* GNU-specific */
+
+We need to distinguish between them. Otherwise, we'll get an int value
+assigned to (char *) variable, resulting in segment fault.
+
+Upstream-Status: Inappropriate [musl specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/journal/journal-send.c | 5 +++++
+ src/libsystemd/sd-bus/bus-error.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
+index 65bcbcd2e..aef80dd8f 100644
+--- a/src/journal/journal-send.c
++++ b/src/journal/journal-send.c
+@@ -337,7 +337,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
+ char* j;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++ j = buffer + 8 + k;
++#else
+ j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
++#endif
+ if (errno == 0) {
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
+
+diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
+index ec359ac13..d2aa86cea 100644
+--- a/src/libsystemd/sd-bus/bus-error.c
++++ b/src/libsystemd/sd-bus/bus-error.c
+@@ -362,7 +362,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
+ return;
+
+ errno = 0;
++#ifndef __GLIBC__
++ strerror_r(error, m, k);
++ x = m;
++#else
+ x = strerror_r(error, m, k);
++#endif
+ if (errno == ERANGE || strlen(x) >= k - 1) {
+ free(m);
+ k *= 2;
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch b/external/poky/meta/recipes-core/systemd/systemd/0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
new file mode 100644
index 00000000..668f2732
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
@@ -0,0 +1,34 @@
+From 687a5af8dc5d38f918a6ce08fed5297234bf8346 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Mar 2018 18:00:17 -0800
+Subject: [PATCH] Hide __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP
+
+for currently unknown reasons they get exported to the shared libries
+even without being listed in the sym file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+
+Upstream-Status: Pending [ Conditional on master needing this, 239 does need it ]
+
+ src/libsystemd/sd-bus/bus-error.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
+index 378f7a377..49d797abd 100644
+--- a/src/libsystemd/sd-bus/bus-error.c
++++ b/src/libsystemd/sd-bus/bus-error.c
+@@ -71,8 +71,8 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
+ };
+
+ /* GCC maps this magically to the beginning and end of the BUS_ERROR_MAP section */
+-extern const sd_bus_error_map __start_BUS_ERROR_MAP[];
+-extern const sd_bus_error_map __stop_BUS_ERROR_MAP[];
++extern const sd_bus_error_map __start_BUS_ERROR_MAP[] _hidden_;
++extern const sd_bus_error_map __stop_BUS_ERROR_MAP[] _hidden_;
+
+ /* Additional maps registered with sd_bus_error_add_map() are in this
+ * NULL terminated array */
+--
+2.16.2
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch b/external/poky/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
new file mode 100644
index 00000000..962463f0
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
@@ -0,0 +1,109 @@
+From 75720bff62a84896e9a0654afc7cf9408cf89a38 Mon Sep 17 00:00:00 2001
+From: Filipe Brandenburger <filbranden@google.com>
+Date: Sun, 15 Jul 2018 22:43:35 -0700
+Subject: [PATCH] build-sys: Detect whether struct statx is defined in
+ sys/stat.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Starting with glibc 2.27.9000-36.fc29, include file sys/stat.h will have a
+definition for struct statx, in which case include file linux/stat.h should be
+avoided, in order to prevent a duplicate definition.
+
+ In file included from ../src/basic/missing.h:18,
+ from ../src/basic/util.h:28,
+ from ../src/basic/hashmap.h:10,
+ from ../src/shared/bus-util.h:12,
+ from ../src/libsystemd/sd-bus/bus-creds.c:11:
+ /usr/include/linux/stat.h:99:8: error: redefinition of ‘struct statx’
+ struct statx {
+ ^~~~~
+ In file included from /usr/include/sys/stat.h:446,
+ from ../src/basic/util.h:19,
+ from ../src/basic/hashmap.h:10,
+ from ../src/shared/bus-util.h:12,
+ from ../src/libsystemd/sd-bus/bus-creds.c:11:
+ /usr/include/bits/statx.h:36:8: note: originally defined here
+ struct statx
+ ^~~~~
+
+Extend our meson.build to look for struct statx when only sys/stat.h is
+included and, in that case, do not include linux/stat.h anymore.
+
+Tested that systemd builds correctly when using a glibc version that includes a
+definition for struct statx.
+
+glibc Fedora RPM update:
+https://src.fedoraproject.org/rpms/glibc/c/28cb5d31fc1e5887912283c889689c47076278ae
+
+glibc upstream commit:
+https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fd70af45528d59a00eb3190ef6706cb299488fcd
+---
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ meson.build | 5 +++++
+ src/basic/missing.h | 5 ++++-
+ src/basic/xattr-util.c | 1 -
+ 3 files changed, 9 insertions(+), 2 deletions(-)
+
+Index: git/meson.build
+===================================================================
+--- git.orig/meson.build
++++ git/meson.build
+@@ -432,6 +432,7 @@ decl_headers = '''
+ #include <sys/stat.h>
+ '''
+ # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
++# FIXME: these should use -D_GNU_SOURCE, since that is defined at build time
+
+ foreach decl : ['char16_t',
+ 'char32_t',
+@@ -446,6 +447,10 @@ foreach decl : ['char16_t',
+ conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
+ endforeach
+
++conf.set10('HAVE_STRUCT_STATX_IN_SYS_STAT_H', cc.sizeof('struct statx', prefix : '''
++#include <sys/stat.h>
++''', args : '-D_GNU_SOURCE') > 0)
++
+ foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
+ ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
+ ['IFLA_VRF_TABLE', 'linux/if_link.h'],
+Index: git/src/basic/missing.h
+===================================================================
+--- git.orig/src/basic/missing.h
++++ git/src/basic/missing.h
+@@ -15,7 +15,6 @@
+ #include <linux/neighbour.h>
+ #include <linux/oom.h>
+ #include <linux/rtnetlink.h>
+-#include <linux/stat.h>
+ #include <net/ethernet.h>
+ #include <stdlib.h>
+ #include <sys/resource.h>
+@@ -25,6 +24,10 @@
+ #include <uchar.h>
+ #include <unistd.h>
+
++#if !HAVE_STRUCT_STATX_IN_SYS_STAT_H
++#include <linux/stat.h>
++#endif
++
+ #if HAVE_AUDIT
+ #include <libaudit.h>
+ #endif
+Index: git/src/basic/xattr-util.c
+===================================================================
+--- git.orig/src/basic/xattr-util.c
++++ git/src/basic/xattr-util.c
+@@ -2,7 +2,6 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <linux/stat.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch b/external/poky/meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch
new file mode 100644
index 00000000..2f3e776a
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch
@@ -0,0 +1,58 @@
+systemd-239: fixes for the compatibility interface
+
+[No upstream tracking] -- https://github.com/systemd/systemd/issues/9423
+
+resolvconf-compat: use compat_main() when called as `resolvconf`,
+since the interface is closer to that of `systemd-resolve`.
+
+Use a heap allocated string to set arg_ifname, since a stack allocated
+one would be lost after the function returns. (This last one broke the
+case where an interface name was suffixed with a dot, such as in
+`resolvconf -a tap0.dhcp`.)
+
+Tested:
+ $ build/resolvconf -a nonexistent.abc </etc/resolv.conf
+ Unknown interface 'nonexistent': No such device
+
+Upstream-Status: Backport [https://github.com/systemd/systemd/commit/5a01b3f35d7b6182c78b6973db8d99bdabd4f9c3]
+bug: 9423
+Signed-off-by: Simon Ausserlechner <simon.ausserlechner@siemens.com>
+
+diff --git a/src/resolve/resolvconf-compat.c b/src/resolve/resolvconf-compat.c
+index d7e68003e..072345894 100644
+--- a/src/resolve/resolvconf-compat.c
++++ b/src/resolve/resolvconf-compat.c
+@@ -53,6 +53,8 @@ static int parse_nameserver(const char *string) {
+
+ if (strv_push(&arg_set_dns, word) < 0)
+ return log_oom();
++
++ word = NULL;
+ }
+
+ return 0;
+@@ -202,7 +204,7 @@ int resolvconf_parse_argv(int argc, char *argv[]) {
+
+ dot = strchr(argv[optind], '.');
+ if (dot) {
+- iface = strndupa(argv[optind], dot - argv[optind]);
++ iface = strndup(argv[optind], dot - argv[optind]);
+ log_debug("Ignoring protocol specifier '%s'.", dot + 1);
+ } else
+ iface = argv[optind];
+diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c
+index e96c13fea..e9e395e3e 100644
+--- a/src/resolve/resolvectl.c
++++ b/src/resolve/resolvectl.c
+@@ -3092,7 +3092,7 @@ int main(int argc, char **argv) {
+ goto finish;
+ }
+
+- if (streq(program_invocation_short_name, "systemd-resolve"))
++ if (STR_IN_SET(program_invocation_short_name, "systemd-resolve", "resolvconf"))
+ r = compat_main(argc, argv, bus);
+ else
+ r = native_main(argc, argv, bus);
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0024-journald-do-not-store-the-iovec-entry-for-process-co.patch b/external/poky/meta/recipes-core/systemd/systemd/0024-journald-do-not-store-the-iovec-entry-for-process-co.patch
new file mode 100644
index 00000000..c2f78be3
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0024-journald-do-not-store-the-iovec-entry-for-process-co.patch
@@ -0,0 +1,208 @@
+From 9cb07e7d82c7c4f28bbaa1478e1387e8ea3d03dd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Wed, 5 Dec 2018 18:38:39 +0100
+Subject: [PATCH] journald: do not store the iovec entry for process
+ commandline on stack
+
+This fixes a crash where we would read the commandline, whose length is under
+control of the sending program, and then crash when trying to create a stack
+allocation for it.
+
+CVE-2018-16864
+https://bugzilla.redhat.com/show_bug.cgi?id=1653855
+
+The message actually doesn't get written to disk, because
+journal_file_append_entry() returns -E2BIG.
+
+Patch backported from systemd master at
+084eeb865ca63887098e0945fb4e93c852b91b0f.
+
+CVE: CVE-2018-16864
+Upstream-Status: Backport
+Signed-off-by: Marcus Cooper <marcusc@axis.com>
+---
+ src/basic/io-util.c | 10 ++++++++++
+ src/basic/io-util.h | 2 ++
+ src/coredump/coredump.c | 31 +++++++++++--------------------
+ src/journal/journald-server.c | 25 +++++++++++++++----------
+ 4 files changed, 38 insertions(+), 30 deletions(-)
+
+diff --git a/src/basic/io-util.c b/src/basic/io-util.c
+index 1f64cc933b..575398fbe6 100644
+--- a/src/basic/io-util.c
++++ b/src/basic/io-util.c
+@@ -8,6 +8,7 @@
+ #include <unistd.h>
+
+ #include "io-util.h"
++#include "string-util.h"
+ #include "time-util.h"
+
+ int flush_fd(int fd) {
+@@ -252,3 +253,12 @@ ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) {
+
+ return q - (const uint8_t*) p;
+ }
++
++char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value) {
++ char *x;
++
++ x = strappend(field, value);
++ if (x)
++ iovec[(*n_iovec)++] = IOVEC_MAKE_STRING(x);
++ return x;
++}
+diff --git a/src/basic/io-util.h b/src/basic/io-util.h
+index ed189b5820..792a64ad5e 100644
+--- a/src/basic/io-util.h
++++ b/src/basic/io-util.h
+@@ -71,3 +71,5 @@ static inline bool FILE_SIZE_VALID_OR_INFINITY(uint64_t l) {
+ #define IOVEC_MAKE(base, len) (struct iovec) IOVEC_INIT(base, len)
+ #define IOVEC_INIT_STRING(string) IOVEC_INIT((char*) string, strlen(string))
+ #define IOVEC_MAKE_STRING(string) (struct iovec) IOVEC_INIT_STRING(string)
++
++char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value);
+diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
+index 20a1cbdd45..18e4f61d72 100644
+--- a/src/coredump/coredump.c
++++ b/src/coredump/coredump.c
+@@ -1053,19 +1053,10 @@ static int send_iovec(const struct iovec iovec[], size_t n_iovec, int input_fd)
+ return 0;
+ }
+
+-static char* set_iovec_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value) {
+- char *x;
+-
+- x = strappend(field, value);
+- if (x)
+- iovec[(*n_iovec)++] = IOVEC_MAKE_STRING(x);
+- return x;
+-}
+-
+ static char* set_iovec_field_free(struct iovec *iovec, size_t *n_iovec, const char *field, char *value) {
+ char *x;
+
+- x = set_iovec_field(iovec, n_iovec, field, value);
++ x = set_iovec_string_field(iovec, n_iovec, field, value);
+ free(value);
+ return x;
+ }
+@@ -1115,36 +1106,36 @@ static int gather_pid_metadata(
+ disable_coredumps();
+ }
+
+- set_iovec_field(iovec, n_iovec, "COREDUMP_UNIT=", context[CONTEXT_UNIT]);
++ set_iovec_string_field(iovec, n_iovec, "COREDUMP_UNIT=", context[CONTEXT_UNIT]);
+ }
+
+ if (cg_pid_get_user_unit(pid, &t) >= 0)
+ set_iovec_field_free(iovec, n_iovec, "COREDUMP_USER_UNIT=", t);
+
+ /* The next few are mandatory */
+- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_PID=", context[CONTEXT_PID]))
++ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_PID=", context[CONTEXT_PID]))
+ return log_oom();
+
+- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_UID=", context[CONTEXT_UID]))
++ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_UID=", context[CONTEXT_UID]))
+ return log_oom();
+
+- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_GID=", context[CONTEXT_GID]))
++ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_GID=", context[CONTEXT_GID]))
+ return log_oom();
+
+- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_SIGNAL=", context[CONTEXT_SIGNAL]))
++ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_SIGNAL=", context[CONTEXT_SIGNAL]))
+ return log_oom();
+
+- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_RLIMIT=", context[CONTEXT_RLIMIT]))
++ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_RLIMIT=", context[CONTEXT_RLIMIT]))
+ return log_oom();
+
+- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_HOSTNAME=", context[CONTEXT_HOSTNAME]))
++ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_HOSTNAME=", context[CONTEXT_HOSTNAME]))
+ return log_oom();
+
+- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_COMM=", context[CONTEXT_COMM]))
++ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_COMM=", context[CONTEXT_COMM]))
+ return log_oom();
+
+ if (context[CONTEXT_EXE] &&
+- !set_iovec_field(iovec, n_iovec, "COREDUMP_EXE=", context[CONTEXT_EXE]))
++ !set_iovec_string_field(iovec, n_iovec, "COREDUMP_EXE=", context[CONTEXT_EXE]))
+ return log_oom();
+
+ if (sd_pid_get_session(pid, &t) >= 0)
+@@ -1212,7 +1203,7 @@ static int gather_pid_metadata(
+ iovec[(*n_iovec)++] = IOVEC_MAKE_STRING(t);
+
+ if (safe_atoi(context[CONTEXT_SIGNAL], &signo) >= 0 && SIGNAL_VALID(signo))
+- set_iovec_field(iovec, n_iovec, "COREDUMP_SIGNAL_NAME=SIG", signal_to_string(signo));
++ set_iovec_string_field(iovec, n_iovec, "COREDUMP_SIGNAL_NAME=SIG", signal_to_string(signo));
+
+ return 0; /* we successfully acquired all metadata */
+ }
+diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
+index 4f1550ec5b..31be085c6b 100644
+--- a/src/journal/journald-server.c
++++ b/src/journal/journald-server.c
+@@ -753,6 +753,7 @@ static void dispatch_message_real(
+ pid_t object_pid) {
+
+ char source_time[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)];
++ _cleanup_free_ char *cmdline1 = NULL, *cmdline2 = NULL;
+ uid_t journal_uid;
+ ClientContext *o;
+
+@@ -769,20 +770,23 @@ static void dispatch_message_real(
+ IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->uid, uid_t, uid_is_valid, UID_FMT, "_UID");
+ IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->gid, gid_t, gid_is_valid, GID_FMT, "_GID");
+
+- IOVEC_ADD_STRING_FIELD(iovec, n, c->comm, "_COMM");
+- IOVEC_ADD_STRING_FIELD(iovec, n, c->exe, "_EXE");
+- IOVEC_ADD_STRING_FIELD(iovec, n, c->cmdline, "_CMDLINE");
+- IOVEC_ADD_STRING_FIELD(iovec, n, c->capeff, "_CAP_EFFECTIVE");
++ IOVEC_ADD_STRING_FIELD(iovec, n, c->comm, "_COMM"); /* At most TASK_COMM_LENGTH (16 bytes) */
++ IOVEC_ADD_STRING_FIELD(iovec, n, c->exe, "_EXE"); /* A path, so at most PATH_MAX (4096 bytes) */
+
+- IOVEC_ADD_SIZED_FIELD(iovec, n, c->label, c->label_size, "_SELINUX_CONTEXT");
++ if (c->cmdline)
++ /* At most _SC_ARG_MAX (2MB usually), which is too much to put on stack.
++ * Let's use a heap allocation for this one. */
++ cmdline1 = set_iovec_string_field(iovec, &n, "_CMDLINE=", c->cmdline);
+
++ IOVEC_ADD_STRING_FIELD(iovec, n, c->capeff, "_CAP_EFFECTIVE"); /* Read from /proc/.../status */
++ IOVEC_ADD_SIZED_FIELD(iovec, n, c->label, c->label_size, "_SELINUX_CONTEXT");
+ IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->auditid, uint32_t, audit_session_is_valid, "%" PRIu32, "_AUDIT_SESSION");
+ IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->loginuid, uid_t, uid_is_valid, UID_FMT, "_AUDIT_LOGINUID");
+
+- IOVEC_ADD_STRING_FIELD(iovec, n, c->cgroup, "_SYSTEMD_CGROUP");
++ IOVEC_ADD_STRING_FIELD(iovec, n, c->cgroup, "_SYSTEMD_CGROUP"); /* A path */
+ IOVEC_ADD_STRING_FIELD(iovec, n, c->session, "_SYSTEMD_SESSION");
+ IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->owner_uid, uid_t, uid_is_valid, UID_FMT, "_SYSTEMD_OWNER_UID");
+- IOVEC_ADD_STRING_FIELD(iovec, n, c->unit, "_SYSTEMD_UNIT");
++ IOVEC_ADD_STRING_FIELD(iovec, n, c->unit, "_SYSTEMD_UNIT"); /* Unit names are bounded by UNIT_NAME_MAX */
+ IOVEC_ADD_STRING_FIELD(iovec, n, c->user_unit, "_SYSTEMD_USER_UNIT");
+ IOVEC_ADD_STRING_FIELD(iovec, n, c->slice, "_SYSTEMD_SLICE");
+ IOVEC_ADD_STRING_FIELD(iovec, n, c->user_slice, "_SYSTEMD_USER_SLICE");
+@@ -803,13 +807,14 @@ static void dispatch_message_real(
+ IOVEC_ADD_NUMERIC_FIELD(iovec, n, o->uid, uid_t, uid_is_valid, UID_FMT, "OBJECT_UID");
+ IOVEC_ADD_NUMERIC_FIELD(iovec, n, o->gid, gid_t, gid_is_valid, GID_FMT, "OBJECT_GID");
+
++ /* See above for size limits, only ->cmdline may be large, so use a heap allocation for it. */
+ IOVEC_ADD_STRING_FIELD(iovec, n, o->comm, "OBJECT_COMM");
+ IOVEC_ADD_STRING_FIELD(iovec, n, o->exe, "OBJECT_EXE");
+- IOVEC_ADD_STRING_FIELD(iovec, n, o->cmdline, "OBJECT_CMDLINE");
+- IOVEC_ADD_STRING_FIELD(iovec, n, o->capeff, "OBJECT_CAP_EFFECTIVE");
++ if (o->cmdline)
++ cmdline2 = set_iovec_string_field(iovec, &n, "OBJECT_CMDLINE=", o->cmdline);
+
++ IOVEC_ADD_STRING_FIELD(iovec, n, o->capeff, "OBJECT_CAP_EFFECTIVE");
+ IOVEC_ADD_SIZED_FIELD(iovec, n, o->label, o->label_size, "OBJECT_SELINUX_CONTEXT");
+-
+ IOVEC_ADD_NUMERIC_FIELD(iovec, n, o->auditid, uint32_t, audit_session_is_valid, "%" PRIu32, "OBJECT_AUDIT_SESSION");
+ IOVEC_ADD_NUMERIC_FIELD(iovec, n, o->loginuid, uid_t, uid_is_valid, UID_FMT, "OBJECT_AUDIT_LOGINUID");
+
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0025-journald-set-a-limit-on-the-number-of-fields.patch b/external/poky/meta/recipes-core/systemd/systemd/0025-journald-set-a-limit-on-the-number-of-fields.patch
new file mode 100644
index 00000000..ae9ef5de
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0025-journald-set-a-limit-on-the-number-of-fields.patch
@@ -0,0 +1,139 @@
+From 7cad044b72406cbadf048da432c29afea74c3c10 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Wed, 5 Dec 2018 22:45:02 +0100
+Subject: [PATCH] journald: set a limit on the number of fields
+
+The fix for CVE-2018-16865 is plucked from two commits that have
+been pushed to systemd master.
+
+journald: set a limit on the number of fields (1k)
+
+We allocate a iovec entry for each field, so with many short entries,
+our memory usage and processing time can be large, even with a relatively
+small message size. Let's refuse overly long entries.
+
+CVE-2018-16865
+https://bugzilla.redhat.com/show_bug.cgi?id=1653861
+
+What from I can see, the problem is not from an alloca, despite what the CVE
+description says, but from the attack multiplication that comes from creating
+many very small iovecs: (void* + size_t) for each three bytes of input message.
+
+Patch backported from systemd master at
+052c57f132f04a3cf4148f87561618da1a6908b4.
+
+journal-remote: set a limit on the number of fields in a message
+
+Existing use of E2BIG is replaced with ENOBUFS (entry too long), and E2BIG is
+reused for the new error condition (too many fields).
+
+This matches the change done for systemd-journald, hence forming the second
+part of the fix for CVE-2018-16865
+(https://bugzilla.redhat.com/show_bug.cgi?id=1653861).
+
+Patch backported from systemd master at
+ef4d6abe7c7fab6cbff975b32e76b09feee56074.
+with the changes applied by 7fdb237f5473cb8fc2129e57e8a0039526dcb4fd
+removed.
+
+CVE: CVE-2018-16865
+Upstream-Status: Backport
+Signed-off-by: Marcus Cooper <marcusc@axis.com>
+---
+ src/basic/journal-importer.c | 5 ++++-
+ src/basic/journal-importer.h | 3 +++
+ src/journal-remote/journal-remote-main.c | 7 ++++++-
+ src/journal-remote/journal-remote.c | 5 ++++-
+ src/journal/journald-native.c | 5 +++++
+ 5 files changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/src/basic/journal-importer.c b/src/basic/journal-importer.c
+index ca203bbbfc..3ac55a66d9 100644
+--- a/src/basic/journal-importer.c
++++ b/src/basic/journal-importer.c
+@@ -23,6 +23,9 @@ enum {
+ };
+
+ static int iovw_put(struct iovec_wrapper *iovw, void* data, size_t len) {
++ if (iovw->count >= ENTRY_FIELD_COUNT_MAX)
++ return -E2BIG;
++
+ if (!GREEDY_REALLOC(iovw->iovec, iovw->size_bytes, iovw->count + 1))
+ return log_oom();
+
+@@ -98,7 +101,7 @@ static int get_line(JournalImporter *imp, char **line, size_t *size) {
+ imp->scanned = imp->filled;
+ if (imp->scanned >= DATA_SIZE_MAX) {
+ log_error("Entry is bigger than %u bytes.", DATA_SIZE_MAX);
+- return -E2BIG;
++ return -ENOBUFS;
+ }
+
+ if (imp->passive_fd)
+diff --git a/src/basic/journal-importer.h b/src/basic/journal-importer.h
+index f49ce734a1..c4ae45d32d 100644
+--- a/src/basic/journal-importer.h
++++ b/src/basic/journal-importer.h
+@@ -16,6 +16,9 @@
+ #define DATA_SIZE_MAX (1024*1024*768u)
+ #define LINE_CHUNK 8*1024u
+
++/* The maximum number of fields in an entry */
++#define ENTRY_FIELD_COUNT_MAX 1024
++
+ struct iovec_wrapper {
+ struct iovec *iovec;
+ size_t size_bytes;
+diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c
+index 8fda9d1499..3a01fef646 100644
+--- a/src/journal-remote/journal-remote-main.c
++++ b/src/journal-remote/journal-remote-main.c
+@@ -212,7 +212,12 @@ static int process_http_upload(
+ break;
+ else if (r < 0) {
+ log_warning("Failed to process data for connection %p", connection);
+- if (r == -E2BIG)
++ if (r == -ENOBUFS)
++ return mhd_respondf(connection,
++ r, MHD_HTTP_PAYLOAD_TOO_LARGE,
++ "Entry is above the maximum of %u, aborting connection %p.",
++ DATA_SIZE_MAX, connection);
++ else if (r == -E2BIG)
+ return mhd_respondf(connection,
+ r, MHD_HTTP_PAYLOAD_TOO_LARGE,
+ "Entry is too large, maximum is " STRINGIFY(DATA_SIZE_MAX) " bytes.");
+diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
+index beb75a1cb4..67e3a70c06 100644
+--- a/src/journal-remote/journal-remote.c
++++ b/src/journal-remote/journal-remote.c
+@@ -408,7 +408,10 @@ int journal_remote_handle_raw_source(
+ log_debug("%zu active sources remaining", s->active);
+ return 0;
+ } else if (r == -E2BIG) {
+- log_notice_errno(E2BIG, "Entry too big, skipped");
++ log_notice("Entry with too many fields, skipped");
++ return 1;
++ } else if (r == -ENOBUFS) {
++ log_notice("Entry too big, skipped");
+ return 1;
+ } else if (r == -EAGAIN) {
+ return 0;
+diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
+index 5ff22a10af..951d092053 100644
+--- a/src/journal/journald-native.c
++++ b/src/journal/journald-native.c
+@@ -140,6 +140,11 @@ static int server_process_entry(
+ }
+
+ /* A property follows */
++ if (n > ENTRY_FIELD_COUNT_MAX) {
++ log_debug("Received an entry that has more than " STRINGIFY(ENTRY_FIELD_COUNT_MAX) " fields, ignoring entry.");
++ r = 1;
++ goto finish;
++ }
+
+ /* n existing properties, 1 new, +1 for _TRANSPORT */
+ if (!GREEDY_REALLOC(iovec, m,
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch b/external/poky/meta/recipes-core/systemd/systemd/0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch
new file mode 100644
index 00000000..3925a4ab
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch
@@ -0,0 +1,49 @@
+From ebd06c37d4311db9851f4d3fdd023de3dd590de0 Mon Sep 17 00:00:00 2001
+From: Filipe Brandenburger <filbranden@google.com>
+Date: Thu, 10 Jan 2019 14:53:33 -0800
+Subject: [PATCH] journal: fix out-of-bounds read CVE-2018-16866
+
+The original code didn't account for the fact that strchr() would match on the
+'\0' character, making it read past the end of the buffer if no non-whitespace
+character was present.
+
+This bug was introduced in commit ec5ff4445cca6a which was first released in
+systemd v221 and later fixed in commit 8595102d3ddde6 which was released in
+v240, so versions in the range [v221, v240) are affected.
+
+Patch backported from systemd-stable at f005e73d3723d62a39be661931fcb6347119b52b
+also includes a change from systemd master which removes a heap buffer overflow
+a6aadf4ae0bae185dc4c414d492a4a781c80ffe5.
+
+CVE: CVE-2018-16866
+Upstream-Status: Backport
+Signed-off-by: Marcus Cooper <marcusc@axis.com>
+---
+ src/journal/journald-syslog.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
+index 9dea116722..809b318c06 100644
+--- a/src/journal/journald-syslog.c
++++ b/src/journal/journald-syslog.c
+@@ -194,7 +194,7 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid)
+ e = l;
+ l--;
+
+- if (p[l-1] == ']') {
++ if (l > 0 && p[l-1] == ']') {
+ size_t k = l-1;
+
+ for (;;) {
+@@ -219,7 +219,7 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid)
+ if (t)
+ *identifier = t;
+
+- if (strchr(WHITESPACE, p[e]))
++ if (p[e] != '\0' && strchr(WHITESPACE, p[e]))
+ e++;
+ *buf = p + e;
+ return e;
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/CVE-2019-6454.patch b/external/poky/meta/recipes-core/systemd/systemd/CVE-2019-6454.patch
new file mode 100644
index 00000000..80170dac
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/CVE-2019-6454.patch
@@ -0,0 +1,210 @@
+Description: sd-bus: enforce a size limit for dbus paths, and don't allocate
+ them on the stacka
+Forwarded: no
+
+Patch from: systemd_239-7ubuntu10.8
+
+For information see:
+https://usn.ubuntu.com/3891-1/
+https://git.launchpad.net/ubuntu/+source/systemd/commit/?id=f8e75d5634904c8e672658856508c3a02f349adb
+
+CVE: CVE-2019-6454
+Upstream-Status: Backport
+
+Signed-off-by: George McCollister <george.mccollister@gmail.com>
+
+--- a/src/libsystemd/sd-bus/bus-internal.c
++++ b/src/libsystemd/sd-bus/bus-internal.c
+@@ -45,7 +45,7 @@
+ if (slash)
+ return false;
+
+- return true;
++ return (q - p) <= BUS_PATH_SIZE_MAX;
+ }
+
+ char* object_path_startswith(const char *a, const char *b) {
+--- a/src/libsystemd/sd-bus/bus-internal.h
++++ b/src/libsystemd/sd-bus/bus-internal.h
+@@ -333,6 +333,10 @@
+
+ #define BUS_MESSAGE_SIZE_MAX (128*1024*1024)
+ #define BUS_AUTH_SIZE_MAX (64*1024)
++/* Note that the D-Bus specification states that bus paths shall have no size limit. We enforce here one
++ * anyway, since truly unbounded strings are a security problem. The limit we pick is relatively large however,
++ * to not clash unnecessarily with real-life applications. */
++#define BUS_PATH_SIZE_MAX (64*1024)
+
+ #define BUS_CONTAINER_DEPTH 128
+
+--- a/src/libsystemd/sd-bus/bus-objects.c
++++ b/src/libsystemd/sd-bus/bus-objects.c
+@@ -1134,7 +1134,8 @@
+ const char *path,
+ sd_bus_error *error) {
+
+- char *prefix;
++ _cleanup_free_ char *prefix = NULL;
++ size_t pl;
+ int r;
+
+ assert(bus);
+@@ -1150,7 +1151,12 @@
+ return 0;
+
+ /* Second, add fallback vtables registered for any of the prefixes */
+- prefix = alloca(strlen(path) + 1);
++ pl = strlen(path);
++ assert(pl <= BUS_PATH_SIZE_MAX);
++ prefix = new(char, pl + 1);
++ if (!prefix)
++ return -ENOMEM;
++
+ OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
+ r = object_manager_serialize_path(bus, reply, prefix, path, true, error);
+ if (r < 0)
+@@ -1346,6 +1352,7 @@
+ }
+
+ int bus_process_object(sd_bus *bus, sd_bus_message *m) {
++ _cleanup_free_ char *prefix = NULL;
+ int r;
+ size_t pl;
+ bool found_object = false;
+@@ -1370,9 +1377,12 @@
+ assert(m->member);
+
+ pl = strlen(m->path);
+- do {
+- char prefix[pl+1];
++ assert(pl <= BUS_PATH_SIZE_MAX);
++ prefix = new(char, pl + 1);
++ if (!prefix)
++ return -ENOMEM;
+
++ do {
+ bus->nodes_modified = false;
+
+ r = object_find_and_run(bus, m, m->path, false, &found_object);
+@@ -1499,9 +1509,15 @@
+
+ n = hashmap_get(bus->nodes, path);
+ if (!n) {
+- char *prefix;
++ _cleanup_free_ char *prefix = NULL;
++ size_t pl;
++
++ pl = strlen(path);
++ assert(pl <= BUS_PATH_SIZE_MAX);
++ prefix = new(char, pl + 1);
++ if (!prefix)
++ return -ENOMEM;
+
+- prefix = alloca(strlen(path) + 1);
+ OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
+ n = hashmap_get(bus->nodes, prefix);
+ if (n)
+@@ -2091,8 +2107,9 @@
+ char **names) {
+
+ BUS_DONT_DESTROY(bus);
++ _cleanup_free_ char *prefix = NULL;
+ bool found_interface = false;
+- char *prefix;
++ size_t pl;
+ int r;
+
+ assert_return(bus, -EINVAL);
+@@ -2111,6 +2128,12 @@
+ if (names && names[0] == NULL)
+ return 0;
+
++ pl = strlen(path);
++ assert(pl <= BUS_PATH_SIZE_MAX);
++ prefix = new(char, pl + 1);
++ if (!prefix)
++ return -ENOMEM;
++
+ do {
+ bus->nodes_modified = false;
+
+@@ -2120,7 +2143,6 @@
+ if (bus->nodes_modified)
+ continue;
+
+- prefix = alloca(strlen(path) + 1);
+ OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
+ r = emit_properties_changed_on_interface(bus, prefix, path, interface, true, &found_interface, names);
+ if (r != 0)
+@@ -2252,7 +2274,8 @@
+
+ static int object_added_append_all(sd_bus *bus, sd_bus_message *m, const char *path) {
+ _cleanup_set_free_ Set *s = NULL;
+- char *prefix;
++ _cleanup_free_ char *prefix = NULL;
++ size_t pl;
+ int r;
+
+ assert(bus);
+@@ -2297,7 +2320,12 @@
+ if (bus->nodes_modified)
+ return 0;
+
+- prefix = alloca(strlen(path) + 1);
++ pl = strlen(path);
++ assert(pl <= BUS_PATH_SIZE_MAX);
++ prefix = new(char, pl + 1);
++ if (!prefix)
++ return -ENOMEM;
++
+ OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
+ r = object_added_append_all_prefix(bus, m, s, prefix, path, true);
+ if (r < 0)
+@@ -2436,7 +2464,8 @@
+
+ static int object_removed_append_all(sd_bus *bus, sd_bus_message *m, const char *path) {
+ _cleanup_set_free_ Set *s = NULL;
+- char *prefix;
++ _cleanup_free_ char *prefix = NULL;
++ size_t pl;
+ int r;
+
+ assert(bus);
+@@ -2468,7 +2497,12 @@
+ if (bus->nodes_modified)
+ return 0;
+
+- prefix = alloca(strlen(path) + 1);
++ pl = strlen(path);
++ assert(pl <= BUS_PATH_SIZE_MAX);
++ prefix = new(char, pl + 1);
++ if (!prefix)
++ return -ENOMEM;
++
+ OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
+ r = object_removed_append_all_prefix(bus, m, s, prefix, path, true);
+ if (r < 0)
+@@ -2618,7 +2652,8 @@
+ const char *path,
+ const char *interface) {
+
+- char *prefix;
++ _cleanup_free_ char *prefix = NULL;
++ size_t pl;
+ int r;
+
+ assert(bus);
+@@ -2632,7 +2667,12 @@
+ if (bus->nodes_modified)
+ return 0;
+
+- prefix = alloca(strlen(path) + 1);
++ pl = strlen(path);
++ assert(pl <= BUS_PATH_SIZE_MAX);
++ prefix = new(char, pl + 1);
++ if (!prefix)
++ return -ENOMEM;
++
+ OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
+ r = interfaces_added_append_one_prefix(bus, m, prefix, path, interface, true);
+ if (r != 0)
diff --git a/external/poky/meta/recipes-core/systemd/systemd/init b/external/poky/meta/recipes-core/systemd/systemd/init
new file mode 100644
index 00000000..ea52be48
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/init
@@ -0,0 +1,104 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: udev
+# Required-Start: mountvirtfs
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Start udevd, populate /dev and load drivers.
+### END INIT INFO
+
+. /etc/init.d/functions
+
+export TZ=/etc/localtime
+
+[ -d /sys/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -x @UDEVD@ ] || exit 1
+[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
+[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+readfile () {
+ filename=$1
+ READDATA=""
+ if [ -r $filename ]; then
+ while read line; do
+ READDATA="$READDATA$line"
+ done < $filename
+ fi
+}
+
+case "$1" in
+ start)
+ export ACTION=add
+ # propagate /dev from /sys
+ echo "Starting udev"
+
+ # mount the devtmpfs on /dev, if not already done
+ LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
+ mount -n -o mode=0755 -t devtmpfs none "/dev"
+ }
+ [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
+ [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
+ mount -a -t tmpfs 2>/dev/null
+
+ # cache handling
+ if [ "$DEVCACHE" != "" ]; then
+ readfile /proc/version
+ VERSION="$READDATA"
+ readfile /proc/cmdline
+ CMDLINE="$READDATA"
+ readfile /proc/devices
+ DEVICES="$READDATA"
+ readfile /proc/atags
+ ATAGS="$READDATA"
+
+ if [ -e $DEVCACHE ]; then
+ readfile /etc/udev/cache.data
+ if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then
+ (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
+ not_first_boot=1
+ [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
+ [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
+ else
+ echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
+ fi
+ else
+ echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
+ fi
+ fi
+
+ # make_extra_nodes
+ killproc systemd-udevd > "/dev/null" 2>&1
+
+ # trigger the sorted events
+ echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
+ @UDEVD@ -d
+
+ udevadm control --env=STARTUP=1
+ if [ "$not_first_boot" != "" ];then
+ udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform
+ (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
+ else
+ udevadm trigger --action=add
+ udevadm settle
+ fi
+ ;;
+ stop)
+ echo "Stopping udevd"
+ start-stop-daemon --stop --name systemd-udevd --quiet
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ status systemd-udevd
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart}"
+ exit 1
+esac
+exit 0
diff --git a/external/poky/meta/recipes-core/systemd/systemd/sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch b/external/poky/meta/recipes-core/systemd/systemd/sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch
new file mode 100644
index 00000000..57311faa
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch
@@ -0,0 +1,61 @@
+Description: sd-bus: if we receive an invalid dbus message, ignore and
+ proceeed
+ .
+ dbus-daemon might have a slightly different idea of what a valid msg is
+ than us (for example regarding valid msg and field sizes). Let's hence
+ try to proceed if we can and thus drop messages rather than fail the
+ connection if we fail to validate a message.
+ .
+ Hopefully the differences in what is considered valid are not visible
+ for real-life usecases, but are specific to exploit attempts only.
+Author: Lennart Poettering <lennart@poettering.net>
+Forwarded: other,https://github.com/systemd/systemd/pull/11708/
+
+Patch from: systemd_239-7ubuntu10.8
+
+For information see:
+https://usn.ubuntu.com/3891-1/
+https://git.launchpad.net/ubuntu/+source/systemd/commit/?id=f8e75d5634904c8e672658856508c3a02f349adb
+
+CVE: CVE-2019-6454
+Upstream-Status: Backport
+
+Signed-off-by: George McCollister <george.mccollister@gmail.com>
+
+diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
+index 30d6455b6f..441b4a816f 100644
+--- a/src/libsystemd/sd-bus/bus-socket.c
++++ b/src/libsystemd/sd-bus/bus-socket.c
+@@ -1072,7 +1072,7 @@ static int bus_socket_read_message_need(sd_bus *bus, size_t *need) {
+ }
+
+ static int bus_socket_make_message(sd_bus *bus, size_t size) {
+- sd_bus_message *t;
++ sd_bus_message *t = NULL;
+ void *b;
+ int r;
+
+@@ -1097,7 +1097,9 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) {
+ bus->fds, bus->n_fds,
+ NULL,
+ &t);
+- if (r < 0) {
++ if (r == -EBADMSG)
++ log_debug_errno(r, "Received invalid message from connection %s, dropping.", strna(bus->description));
++ else if (r < 0) {
+ free(b);
+ return r;
+ }
+@@ -1108,7 +1110,8 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) {
+ bus->fds = NULL;
+ bus->n_fds = 0;
+
+- bus->rqueue[bus->rqueue_size++] = t;
++ if (t)
++ bus->rqueue[bus->rqueue_size++] = t;
+
+ return 1;
+ }
+--
+2.17.1
+
diff --git a/external/poky/meta/recipes-core/systemd/systemd/touchscreen.rules b/external/poky/meta/recipes-core/systemd/systemd/touchscreen.rules
new file mode 100644
index 00000000..d83fd167
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd/touchscreen.rules
@@ -0,0 +1,18 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Create a symlink to any touchscreen input device
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"
diff --git a/external/poky/meta/recipes-core/systemd/systemd_239.bb b/external/poky/meta/recipes-core/systemd/systemd_239.bb
new file mode 100644
index 00000000..7fbd64ce
--- /dev/null
+++ b/external/poky/meta/recipes-core/systemd/systemd_239.bb
@@ -0,0 +1,666 @@
+require systemd.inc
+
+PROVIDES = "udev"
+
+PE = "1"
+
+DEPENDS = "intltool-native gperf-native libcap util-linux"
+
+SECTION = "base/shell"
+
+inherit useradd pkgconfig meson perlnative update-rc.d update-alternatives qemu systemd gettext bash-completion manpages distro_features_check
+
+# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
+# that we don't build both udev and systemd in world builds.
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+SRC_URI += "file://touchscreen.rules \
+ file://00-create-volatile.conf \
+ file://init \
+ file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
+ file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
+ file://0003-implment-systemd-sysv-install-for-OE.patch \
+ file://0004-rules-whitelist-hd-devices.patch \
+ file://0005-Make-root-s-home-directory-configurable.patch \
+ file://0006-remove-nobody-user-group-checking.patch \
+ file://0007-rules-watch-metadata-changes-in-ide-devices.patch \
+ file://0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch \
+ file://0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch \
+ file://0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch \
+ file://0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch \
+ file://0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch \
+ file://0023-resolvconf-fixes-for-the-compatibility-interface.patch \
+ file://0001-core-when-deserializing-state-always-use-read_line-L.patch \
+ file://0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch \
+ file://0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch \
+ file://0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch \
+ file://0001-timesync-changes-type-of-drift_freq-to-int64_t.patch \
+ file://0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch \
+ file://0002-core-Fix-use-after-free-case-in-load_from_path.patch \
+ file://0001-meson-rename-Ddebug-to-Ddebug-extra.patch \
+ file://0024-journald-do-not-store-the-iovec-entry-for-process-co.patch \
+ file://0025-journald-set-a-limit-on-the-number-of-fields.patch \
+ file://0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch \
+ file://CVE-2019-6454.patch \
+ file://sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch \
+ "
+
+# patches made for musl are only applied on TCLIBC is musl
+SRC_URI += "${SRC_URI_MUSL}"
+SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.patch \
+ file://0002-don-t-use-glibc-specific-qsort_r.patch \
+ file://0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \
+ file://0004-add-fallback-parse_printf_format-implementation.patch \
+ file://0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch \
+ file://0006-src-basic-missing.h-check-for-missing-strndupa.patch \
+ file://0007-Include-netinet-if_ether.h.patch \
+ file://0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
+ file://0009-add-missing-FTW_-macros-for-musl.patch \
+ file://0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
+ file://0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch \
+ file://0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
+ file://0013-Use-uintmax_t-for-handling-rlim_t.patch \
+ file://0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch \
+ file://0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch \
+ file://0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
+ file://0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
+ file://0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
+ file://0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
+ file://0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
+ file://0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
+ "
+
+# Workaround undefined reference to `__stack_chk_fail_local' on qemux86 and qemuppc for musl
+SRC_URI_append_libc-musl_qemux86 = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
+SRC_URI_append_libc-musl_qemuppc = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
+
+PAM_PLUGINS = " \
+ pam-plugin-unix \
+ pam-plugin-loginuid \
+ pam-plugin-keyinit \
+"
+
+PACKAGECONFIG ??= " \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
+ acl \
+ backlight \
+ binfmt \
+ firstboot \
+ gshadow \
+ hibernate \
+ hostnamed \
+ ima \
+ kmod \
+ localed \
+ logind \
+ machined \
+ myhostname \
+ networkd \
+ nss \
+ polkit \
+ quotacheck \
+ randomseed \
+ resolved \
+ smack \
+ sysusers \
+ timedated \
+ timesyncd \
+ utmp \
+ vconsole \
+ xz \
+"
+
+PACKAGECONFIG_remove_libc-musl = " \
+ gshadow \
+ localed \
+ myhostname \
+ nss \
+ resolved \
+ selinux \
+ smack \
+ sysusers \
+ utmp \
+"
+
+# Use the upstream systemd serial-getty@.service and rely on
+# systemd-getty-generator instead of using the OE-core specific
+# systemd-serialgetty.bb - not enabled by default.
+PACKAGECONFIG[serial-getty-generator] = ""
+
+PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
+PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
+PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
+PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
+PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
+PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
+PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup"
+PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
+PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
+PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
+PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
+# Sign the journal for anti-tampering
+PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
+PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
+PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
+PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
+PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
+PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
+# importd requires curl/xz/zlib/bzip2/gcrypt
+PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
+# Update NAT firewall rules
+PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
+PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
+PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
+PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
+PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
+PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
+PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
+PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
+PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
+PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
+PACKAGECONFIG[myhostname] = "-Dmyhostname=true,-Dmyhostname=false"
+PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
+PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
+PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
+PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
+PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
+PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode"
+PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
+PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
+PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
+PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
+# libseccomp is found in meta-security
+PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
+PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
+PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
+PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
+PACKAGECONFIG[time-epoch] = "-Dtime-epoch=0,,"
+PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
+PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
+PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
+PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
+PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
+PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
+PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
+# Verify keymaps on locale change
+PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
+PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
+PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
+
+# Helper variables to clarify locations. This mirrors the logic in systemd's
+# build system.
+rootprefix ?= "${root_prefix}"
+rootlibdir ?= "${base_libdir}"
+rootlibexecdir = "${rootprefix}/lib"
+
+# This links udev statically with systemd helper library.
+# Otherwise udev package would depend on systemd package (which has the needed shared library),
+# and always pull it into images.
+EXTRA_OEMESON += "-Dlink-udev-shared=false"
+
+EXTRA_OEMESON += "-Dnobody-user=nobody \
+ -Dnobody-group=nobody \
+ -Droothomedir=${ROOT_HOME} \
+ -Drootlibdir=${rootlibdir} \
+ -Drootprefix=${rootprefix} \
+ -Dsysvrcnd-path=${sysconfdir} \
+ "
+
+# Hardcode target binary paths to avoid using paths from sysroot
+EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
+ -Dkill-path=${base_bindir}/kill \
+ -Dkmod-path=${base_bindir}/kmod \
+ -Dmount-path=${base_bindir}/mount \
+ -Dquotacheck-path=${sbindir}/quotacheck \
+ -Dquotaon-path=${sbindir}/quotaon \
+ -Dsulogin-path=${base_sbindir}/sulogin \
+ -Dumount-path=${base_bindir}/umount"
+
+do_install() {
+ meson_do_install
+ install -d ${D}/${base_sbindir}
+ if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
+ # Provided by a separate recipe
+ rm ${D}${systemd_unitdir}/system/serial-getty* -f
+ fi
+
+ # Provide support for initramfs
+ [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
+ [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
+
+ install -d ${D}${sysconfdir}/udev/rules.d/
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
+ install -d ${D}${libdir}/pkgconfig
+ install -m 0644 ${B}/src/udev/udev.pc ${D}${libdir}/pkgconfig/
+
+ install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
+ sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
+ fi
+
+ chown root:systemd-journal ${D}/${localstatedir}/log/journal
+
+ # Delete journal README, as log can be symlinked inside volatile.
+ rm -f ${D}/${localstatedir}/log/README
+
+ # journal-remote creates this at start
+ rm -rf ${D}/${localstatedir}/log/journal/remote
+
+ install -d ${D}${systemd_unitdir}/system/graphical.target.wants
+ install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
+ install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
+ install -d ${D}${systemd_unitdir}/system/reboot.target.wants
+ install -d ${D}${systemd_unitdir}/system/rescue.target.wants
+
+ # Create symlinks for systemd-update-utmp-runlevel.service
+ if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
+ ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
+ fi
+
+ # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
+ # for existence else it fails
+ if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
+ ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf', d)}
+ fi
+ if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
+ echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
+ echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
+ echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
+ ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
+ else
+ sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf%g" ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
+ ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
+ fi
+ install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
+
+ # If polkit is setup fixup permissions and ownership
+ if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
+ if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
+ chmod 700 ${D}${datadir}/polkit-1/rules.d
+ chown polkitd:root ${D}${datadir}/polkit-1/rules.d
+ fi
+ fi
+
+ # conf files are handled by systemd-conf
+ rm -f ${D}${sysconfdir}/machine-id
+ rm -f ${D}${sysconfdir}/systemd/coredump.conf
+ rm -f ${D}${sysconfdir}/systemd/journald.conf
+ rm -f ${D}${sysconfdir}/systemd/logind.conf
+ rm -f ${D}${sysconfdir}/systemd/system.conf
+ rm -f ${D}${sysconfdir}/systemd/user.conf
+
+ # duplicate udevadm for postinst script
+ install -d ${D}${libexecdir}
+ ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
+}
+
+
+python populate_packages_prepend (){
+ systemdlibdir = d.getVar("rootlibdir")
+ do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
+}
+PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
+
+PACKAGES =+ "\
+ ${PN}-gui \
+ ${PN}-vconsole-setup \
+ ${PN}-initramfs \
+ ${PN}-analyze \
+ ${PN}-kernel-install \
+ ${PN}-rpm-macros \
+ ${PN}-binfmt \
+ ${PN}-zsh-completion \
+ ${PN}-xorg-xinitrc \
+ ${PN}-container \
+ ${PN}-journal-gatewayd \
+ ${PN}-journal-upload \
+ ${PN}-journal-remote \
+ ${PN}-extra-utils \
+"
+
+SUMMARY_${PN}-container = "Tools for containers and VMs"
+DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
+
+SUMMARY_${PN}-journal-gatewayd = "HTTP server for journal events"
+DESCRIPTION_${PN}-journal-gatewayd = "systemd-journal-gatewayd serves journal events over the network. Clients must connect using HTTP. The server listens on port 19531 by default."
+
+SUMMARY_${PN}-journal-upload = "Send journal messages over the network"
+DESCRIPTION_${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
+
+SUMMARY_${PN}-journal-remote = "Receive journal messages over the network"
+DESCRIPTION_${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
+
+SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
+"
+SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
+
+USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
+ ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gateway', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
+"
+GROUPADD_PARAM_${PN} = "-r systemd-journal"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
+USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
+USERADD_PARAM_${PN}-extra-utils = "--system -d / -M --shell /bin/nologin systemd-bus-proxy"
+USERADD_PARAM_${PN}-journal-gateway = "--system -d / -M --shell /bin/nologin systemd-journal-gateway"
+USERADD_PARAM_${PN}-journal-remote = "--system -d / -M --shell /bin/nologin systemd-journal-remote"
+USERADD_PARAM_${PN}-journal-upload = "--system -d / -M --shell /bin/nologin systemd-journal-upload"
+
+FILES_${PN}-analyze = "${bindir}/systemd-analyze"
+
+FILES_${PN}-initramfs = "/init"
+RDEPENDS_${PN}-initramfs = "${PN}"
+
+FILES_${PN}-gui = "${bindir}/systemadm"
+
+FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
+ ${systemd_unitdir}/system/systemd-vconsole-setup.service \
+ ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
+
+RDEPENDS_${PN}-kernel-install += "bash"
+FILES_${PN}-kernel-install = "${bindir}/kernel-install \
+ ${sysconfdir}/kernel/ \
+ ${exec_prefix}/lib/kernel \
+ "
+FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
+ "
+
+FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*"
+
+FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
+
+FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
+ ${exec_prefix}/lib/binfmt.d \
+ ${rootlibexecdir}/systemd/systemd-binfmt \
+ ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
+ ${systemd_unitdir}/system/systemd-binfmt.service"
+RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
+
+RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
+
+
+FILES_${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
+ ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
+ ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
+ ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
+ ${datadir}/systemd/gatewayd/browse.html \
+ "
+SYSTEMD_SERVICE_${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
+
+FILES_${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
+ ${systemd_system_unitdir}/systemd-journal-upload.service \
+ ${sysconfdir}/systemd/journal-upload.conf \
+ "
+SYSTEMD_SERVICE_${PN}-journal-upload = "systemd-journal-upload.service"
+
+FILES_${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
+ ${sysconfdir}/systemd/journal-remote.conf \
+ ${systemd_system_unitdir}/systemd-journal-remote.service \
+ ${systemd_system_unitdir}/systemd-journal-remote.socket \
+ "
+SYSTEMD_SERVICE_${PN}-remote = "systemd-journal-remote.socket"
+
+
+FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
+ ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
+ ${base_bindir}/machinectl \
+ ${bindir}/systemd-nspawn \
+ ${nonarch_libdir}/systemd/import-pubring.gpg \
+ ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
+ ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
+ ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
+ ${systemd_system_unitdir}/machine.slice \
+ ${systemd_system_unitdir}/machines.target \
+ ${systemd_system_unitdir}/org.freedesktop.import1.busname \
+ ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
+ ${systemd_system_unitdir}/systemd-importd.service \
+ ${systemd_system_unitdir}/systemd-machined.service \
+ ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
+ ${systemd_system_unitdir}/var-lib-machines.mount \
+ ${rootlibexecdir}/systemd/systemd-import \
+ ${rootlibexecdir}/systemd/systemd-importd \
+ ${rootlibexecdir}/systemd/systemd-machined \
+ ${rootlibexecdir}/systemd/systemd-pull \
+ ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
+ ${systemd_system_unitdir}/systemd-nspawn@.service \
+ ${libdir}/libnss_mymachines.so.2 \
+ ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
+ ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
+ ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
+ ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
+ ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
+ "
+
+RRECOMMENDS_${PN}-container += "\
+ ${PN}-journal-upload \
+ ${PN}-journal-remote \
+ ${PN}-journal-gatewayd \
+ "
+
+FILES_${PN}-extra-utils = "\
+ ${base_bindir}/systemd-escape \
+ ${base_bindir}/systemd-inhibit \
+ ${bindir}/systemd-detect-virt \
+ ${bindir}/systemd-path \
+ ${bindir}/systemd-run \
+ ${bindir}/systemd-cat \
+ ${bindir}/systemd-delta \
+ ${bindir}/systemd-cgls \
+ ${bindir}/systemd-cgtop \
+ ${bindir}/systemd-stdio-bridge \
+ ${base_bindir}/systemd-ask-password \
+ ${base_bindir}/systemd-tty-ask-password-agent \
+ ${systemd_unitdir}/system/systemd-ask-password-console.path \
+ ${systemd_unitdir}/system/systemd-ask-password-console.service \
+ ${systemd_unitdir}/system/systemd-ask-password-wall.path \
+ ${systemd_unitdir}/system/systemd-ask-password-wall.service \
+ ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
+ ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
+ ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
+ ${rootlibexecdir}/systemd/systemd-resolve-host \
+ ${rootlibexecdir}/systemd/systemd-ac-power \
+ ${rootlibexecdir}/systemd/systemd-activate \
+ ${rootlibexecdir}/systemd/systemd-bus-proxyd \
+ ${systemd_unitdir}/system/systemd-bus-proxyd.service \
+ ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
+ ${rootlibexecdir}/systemd/systemd-socket-proxyd \
+ ${rootlibexecdir}/systemd/systemd-reply-password \
+ ${rootlibexecdir}/systemd/systemd-sleep \
+ ${rootlibexecdir}/systemd/system-sleep \
+ ${systemd_unitdir}/system/systemd-hibernate.service \
+ ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
+ ${systemd_unitdir}/system/systemd-suspend.service \
+ ${systemd_unitdir}/system/sleep.target \
+ ${rootlibexecdir}/systemd/systemd-initctl \
+ ${systemd_unitdir}/system/systemd-initctl.service \
+ ${systemd_unitdir}/system/systemd-initctl.socket \
+ ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
+ ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
+ ${rootlibexecdir}/systemd/systemd-cgroups-agent \
+"
+
+FILES_${PN} = " ${base_bindir}/* \
+ ${base_sbindir}/shutdown \
+ ${base_sbindir}/halt \
+ ${base_sbindir}/poweroff \
+ ${base_sbindir}/runlevel \
+ ${base_sbindir}/telinit \
+ ${base_sbindir}/resolvconf \
+ ${base_sbindir}/reboot \
+ ${base_sbindir}/init \
+ ${datadir}/dbus-1/services \
+ ${datadir}/dbus-1/system-services \
+ ${datadir}/polkit-1 \
+ ${datadir}/${BPN} \
+ ${datadir}/factory \
+ ${sysconfdir}/dbus-1/ \
+ ${sysconfdir}/modules-load.d/ \
+ ${sysconfdir}/pam.d/ \
+ ${sysconfdir}/sysctl.d/ \
+ ${sysconfdir}/systemd/ \
+ ${sysconfdir}/tmpfiles.d/ \
+ ${sysconfdir}/xdg/ \
+ ${sysconfdir}/init.d/README \
+ ${sysconfdir}/resolv-conf.systemd \
+ ${rootlibexecdir}/systemd/* \
+ ${systemd_unitdir}/* \
+ ${base_libdir}/security/*.so \
+ /cgroup \
+ ${bindir}/systemd* \
+ ${bindir}/busctl \
+ ${bindir}/coredumpctl \
+ ${bindir}/localectl \
+ ${bindir}/hostnamectl \
+ ${bindir}/resolvectl \
+ ${bindir}/timedatectl \
+ ${bindir}/bootctl \
+ ${bindir}/kernel-install \
+ ${exec_prefix}/lib/tmpfiles.d/*.conf \
+ ${exec_prefix}/lib/systemd \
+ ${exec_prefix}/lib/modules-load.d \
+ ${exec_prefix}/lib/sysctl.d \
+ ${exec_prefix}/lib/sysusers.d \
+ ${exec_prefix}/lib/environment.d \
+ ${localstatedir} \
+ ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \
+ ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \
+ ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \
+ ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \
+ ${nonarch_base_libdir}/modprobe.d/systemd.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
+ ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
+ "
+
+FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
+
+RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck"
+RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
+RDEPENDS_${PN} += "volatile-binds update-rc.d systemd-conf"
+
+RRECOMMENDS_${PN} += "systemd-extra-utils \
+ systemd-compat-units udev-hwdb \
+ e2fsprogs-e2fsck \
+ kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
+ os-release \
+"
+
+INSANE_SKIP_${PN} += "dev-so libdir"
+INSANE_SKIP_${PN}-dbg += "libdir"
+INSANE_SKIP_${PN}-doc += " libdir"
+
+PACKAGES =+ "udev udev-hwdb"
+
+RPROVIDES_udev = "hotplug"
+
+RDEPENDS_udev-hwdb += "udev"
+
+FILES_udev += "${base_sbindir}/udevd \
+ ${rootlibexecdir}/systemd/systemd-udevd \
+ ${rootlibexecdir}/udev/accelerometer \
+ ${rootlibexecdir}/udev/ata_id \
+ ${rootlibexecdir}/udev/cdrom_id \
+ ${rootlibexecdir}/udev/collect \
+ ${rootlibexecdir}/udev/findkeyboards \
+ ${rootlibexecdir}/udev/keyboard-force-release.sh \
+ ${rootlibexecdir}/udev/keymap \
+ ${rootlibexecdir}/udev/mtd_probe \
+ ${rootlibexecdir}/udev/scsi_id \
+ ${rootlibexecdir}/udev/v4l_id \
+ ${rootlibexecdir}/udev/keymaps \
+ ${rootlibexecdir}/udev/rules.d/*.rules \
+ ${sysconfdir}/udev \
+ ${sysconfdir}/init.d/systemd-udevd \
+ ${systemd_unitdir}/system/*udev* \
+ ${systemd_unitdir}/system/*.wants/*udev* \
+ ${base_bindir}/udevadm \
+ ${libexecdir}/${MLPREFIX}udevadm \
+ ${datadir}/bash-completion/completions/udevadm \
+ "
+
+FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
+
+INITSCRIPT_PACKAGES = "udev"
+INITSCRIPT_NAME_udev = "systemd-udevd"
+INITSCRIPT_PARAMS_udev = "start 03 S ."
+
+python __anonymous() {
+ if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+ d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf"
+
+ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
+ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
+ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
+
+ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
+ALTERNATIVE_PRIORITY[halt] ?= "300"
+
+ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
+ALTERNATIVE_PRIORITY[reboot] ?= "300"
+
+ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
+ALTERNATIVE_PRIORITY[shutdown] ?= "300"
+
+ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
+ALTERNATIVE_PRIORITY[poweroff] ?= "300"
+
+ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
+ALTERNATIVE_PRIORITY[runlevel] ?= "300"
+
+pkg_postinst_${PN} () {
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
+
+pkg_prerm_${PN} () {
+ sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+ -e '/^hosts:/s/\s*myhostname//' \
+ -i $D${sysconfdir}/nsswitch.conf
+}
+
+PACKAGE_WRITE_DEPS += "qemu-native"
+pkg_postinst_udev-hwdb () {
+ if test -n "$D"; then
+ $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
+ else
+ udevadm hwdb --update
+ fi
+}
+
+pkg_prerm_udev-hwdb () {
+ rm -f $D${sysconfdir}/udev/hwdb.bin
+}
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch b/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch
new file mode 100644
index 00000000..2575b59b
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch
@@ -0,0 +1,71 @@
+From 29c7a529d3bb0c1e20239f885e74c5036f1a908c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Aug 2018 15:38:58 -0700
+Subject: [PATCH] include sys/sysmacros.h for major/minor defines in glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+---
+ src/bootlogd.c | 3 +++
+ src/bootlogd.o | Bin 58448 -> 60376 bytes
+ src/dowall.c | 3 +++
+ src/shutdown.c | 4 +++-
+ 4 files changed, 9 insertions(+), 1 deletion(-)
+
+Index: sysvinit-2.88dsf/src/bootlogd.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/bootlogd.c
++++ sysvinit-2.88dsf/src/bootlogd.c
+@@ -53,6 +53,9 @@
+ #ifdef __linux__
+ #include <sys/mount.h>
+ #endif
++#ifdef __GLIBC__
++#include <sys/sysmacros.h>
++#endif
+
+ char *Version = "@(#) bootlogd 2.86 03-Jun-2004 miquels@cistron.nl";
+
+Index: sysvinit-2.88dsf/src/dowall.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/dowall.c
++++ sysvinit-2.88dsf/src/dowall.c
+@@ -37,6 +37,9 @@
+ #include <signal.h>
+ #include <setjmp.h>
+ #include <paths.h>
++#ifdef __GLIBC__
++#include <sys/sysmacros.h>
++#endif
+
+ #ifndef _PATH_DEV
+ # define _PATH_DEV "/dev/"
+Index: sysvinit-2.88dsf/src/shutdown.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/shutdown.c
++++ sysvinit-2.88dsf/src/shutdown.c
+@@ -57,7 +57,9 @@
+ #include "reboot.h"
+ #include "initreq.h"
+ #include "init.h"
+-
++#ifdef __GLIBC__
++#include <sys/sysmacros.h>
++#endif
+
+ char *Version = "@(#) shutdown 2.86-1 31-Jul-2004 miquels@cistron.nl";
+
+Index: sysvinit-2.88dsf/src/mountpoint.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/mountpoint.c
++++ sysvinit-2.88dsf/src/mountpoint.c
+@@ -32,6 +32,9 @@
+ #include <stdarg.h>
+ #include <getopt.h>
+ #include <stdio.h>
++#ifdef __GLIBC__
++#include <sys/sysmacros.h>
++#endif
+
+ int dostat(char *path, struct stat *st, int do_lstat, int quiet)
+ {
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch b/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch
new file mode 100644
index 00000000..7b342901
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Inappropriate [configuration]
+
+# The src Makefile was checking for libcrypt.a on the host, not in the
+# build environment. This patch checks for $LCRYPT in the environment
+# and uses it if it's there.
+# - jdike@linux.intel.com
+
+Index: sysvinit-2.88dsf/src/Makefile
+===================================================================
+--- sysvinit-2.88dsf.orig/src/Makefile
++++ sysvinit-2.88dsf/src/Makefile
+@@ -85,9 +85,13 @@ else
+ endif
+
+ # Additional libs for GNU libc.
++ifneq ($(LCRYPT),)
++ SULOGINLIBS += $(LCRYPT)
++else
+ ifneq ($(wildcard /usr/lib*/libcrypt.a),)
+ SULOGINLIBS += -lcrypt
+ endif
++endif
+
+ all: $(BIN) $(SBIN) $(USRBIN)
+
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch b/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
new file mode 100644
index 00000000..6c4225a6
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
@@ -0,0 +1,83 @@
+Upstream-Status: Pending
+
+diff --git a/src/Makefile b/src/Makefile
+index e2b8028..3e11e92 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -65,7 +65,14 @@ else
+ INSTALL_DATA = install -m 644
+ endif
+ INSTALL_DIR = install -m 755 -d
+-MANDIR = /usr/share/man
++
++ROOT ?=
++base_bindir ?= /bin
++base_sbindir ?= /sbin
++bindir ?= /usr/bin
++sysconfdir ?= /etc
++includedir ?= /usr/include
++mandir ?= /usr/share/man
+
+ ifeq ($(WITH_SELINUX),yes)
+ SELINUX_DEF = -DWITH_SELINUX
+@@ -138,39 +145,39 @@ clobber: cleanobjs
+ distclean: clobber
+
+ install:
+- $(INSTALL_DIR) $(ROOT)/bin/ $(ROOT)/sbin/
+- $(INSTALL_DIR) $(ROOT)/usr/bin/
++ $(INSTALL_DIR) $(ROOT)$(base_bindir)/ $(ROOT)$(base_sbindir)/
++ $(INSTALL_DIR) $(ROOT)$(bindir)/
+ for i in $(BIN); do \
+- $(INSTALL_EXEC) $$i $(ROOT)/bin/ ; \
++ $(INSTALL_EXEC) $$i $(ROOT)$(base_bindir)/ ; \
+ done
+ for i in $(SBIN); do \
+- $(INSTALL_EXEC) $$i $(ROOT)/sbin/ ; \
++ $(INSTALL_EXEC) $$i $(ROOT)$(base_sbindir)/ ; \
+ done
+ for i in $(USRBIN); do \
+- $(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \
++ $(INSTALL_EXEC) $$i $(ROOT)$(bindir)/ ; \
+ done
+- # $(INSTALL_DIR) $(ROOT)/etc/
+- # $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/
+- ln -sf halt $(ROOT)/sbin/reboot
+- ln -sf halt $(ROOT)/sbin/poweroff
+- ln -sf init $(ROOT)/sbin/telinit
+- ln -sf /sbin/killall5 $(ROOT)/bin/pidof
+- if [ ! -f $(ROOT)/usr/bin/lastb ]; then \
+- ln -sf last $(ROOT)/usr/bin/lastb; \
++ # $(INSTALL_DIR) $(ROOT)$(sysconfdir)/
++ # $(INSTALL_EXEC) initscript.sample $(ROOT)$(sysconfdir)/
++ ln -sf halt $(ROOT)$(base_sbindir)/reboot
++ ln -sf halt $(ROOT)$(base_sbindir)/poweroff
++ ln -sf init $(ROOT)$(base_sbindir)/telinit
++ ln -sf $(base_sbindir)/killall5 $(ROOT)$(base_bindir)/pidof
++ if [ ! -f $(ROOT)$(bindir)/lastb ]; then \
++ ln -sf last $(ROOT)$(bindir)/lastb; \
+ fi
+- $(INSTALL_DIR) $(ROOT)/usr/include/
+- $(INSTALL_DATA) initreq.h $(ROOT)/usr/include/
+- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man1/
+- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man5/
+- $(INSTALL_DIR) $(ROOT)$(MANDIR)/man8/
++ $(INSTALL_DIR) $(ROOT)$(includedir)/
++ $(INSTALL_DATA) initreq.h $(ROOT)$(includedir)/
++ $(INSTALL_DIR) $(ROOT)$(mandir)/man1/
++ $(INSTALL_DIR) $(ROOT)$(mandir)/man5/
++ $(INSTALL_DIR) $(ROOT)$(mandir)/man8/
+ for i in $(MAN1); do \
+- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man1/; \
++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man1/; \
+ done
+ for i in $(MAN5); do \
+- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man5/; \
++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man5/; \
+ done
+ for i in $(MAN8); do \
+- $(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man8/; \
++ $(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man8/; \
+ done
+ ifeq ($(ROOT),)
+ #
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch b/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch
new file mode 100644
index 00000000..5b5dfdc0
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch
@@ -0,0 +1,189 @@
+pidof: add -m option
+
+When used with -o, will also omit any processes that have the same
+argv[0] and argv[1] as any explicitly omitted process ids. This can be
+used to avoid multiple shell scripts concurrently calling pidof returning
+each other's pids.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=883856
+
+Upstream-Status: backport
+Imported patch from: https://bugzilla.redhat.com/attachment.cgi?id=658166
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ man/pidof.8 | 6 ++++++
+ src/killall5.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
+ 2 files changed, 65 insertions(+), 3 deletions(-)
+
+diff --git a/man/pidof.8 b/man/pidof.8
+--- a/man/pidof.8
++++ b/man/pidof.8
+@@ -24,6 +24,7 @@ pidof -- find the process ID of a running program.
+ .RB [ \-c ]
+ .RB [ \-n ]
+ .RB [ \-x ]
++.RB [ \-m ]
+ .RB [ \-o
+ .IR omitpid[,omitpid..] ]
+ .RB [ \-o
+@@ -63,6 +64,11 @@ shells running the named scripts.
+ Tells \fIpidof\fP to omit processes with that process id. The special
+ pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
+ program, in other words the calling shell or shell script.
++.IP -m
++When used with -o, will also omit any processes that have the same
++argv[0] and argv[1] as any explicitly omitted process ids. This can be
++used to avoid multiple shell scripts concurrently calling pidof returning
++each other's pids.
+ .SH "EXIT STATUS"
+ .TP
+ .B 0
+diff --git a/src/killall5.c b/src/killall5.c
+index 5937d98..e73885e 100644
+--- a/src/killall5.c
++++ b/src/killall5.c
+@@ -118,6 +118,7 @@ typedef struct _s_nfs
+
+ /* List of processes. */
+ PROC *plist;
++PROC *olist;
+
+ /* List of processes to omit. */
+ OMIT *omit;
+@@ -345,6 +346,20 @@ static void clear_mnt(void)
+ }
+ }
+
++static void clear_omit(void)
++{
++ OMIT *o;
++ PROC *p;
++ for (o = omit; o; o = omit) {
++ omit = omit->next;
++ free(o);
++ }
++ for (p = olist; p; p = olist) {
++ olist = olist->next;
++ free(p);
++ }
++}
++
+ /*
+ * Check if path is ia shadow off a NFS partition.
+ */
+@@ -452,6 +467,7 @@ int readproc(int do_stat)
+ DIR *dir;
+ FILE *fp;
+ PROC *p, *n;
++ OMIT *o, *m;
+ struct dirent *d;
+ struct stat st;
+ char path[PATH_MAX+1];
+@@ -624,6 +640,17 @@ int readproc(int do_stat)
+ p->next = plist;
+ plist = p;
+ p->pid = pid;
++ /* Could be smarter, but it's a small list. */
++ m = omit;
++ for (o = omit; m; o = m) {
++ m = o->next;
++ if (o->pid == p->pid) {
++ n = (PROC*)xmalloc(sizeof(PROC));
++ *n = *p;
++ n->next = olist;
++ olist = n;
++ }
++ }
+ }
+ closedir(dir);
+
+@@ -813,6 +840,26 @@ PIDQ_HEAD *pidof(char *prog)
+ return q;
+ }
+
++int matches(PROC *o, PROC *p)
++{
++ int ret = 0;
++ char *oargv1, *pargv1;
++ if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) {
++ if (o->argv1 && p->argv1) {
++ if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL)
++ oargv1 = strdup(o->argv1);
++ if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL)
++ pargv1 = strdup(p->argv1);
++ if (! strcmp(oargv1, pargv1)) {
++ ret = 1;
++ }
++ free(oargv1);
++ free(pargv1);
++ }
++ }
++ return ret;
++}
++
+ /* Give usage message and exit. */
+ void usage(void)
+ {
+@@ -845,6 +892,7 @@ void nsyslog(int pri, char *fmt, ...)
+ #define PIDOF_SINGLE 0x01
+ #define PIDOF_OMIT 0x02
+ #define PIDOF_NETFS 0x04
++#define PIDOF_OMIT_OMIT_MATCHES 0x08
+
+ /*
+ * Pidof functionality.
+@@ -861,6 +909,7 @@ int main_pidof(int argc, char **argv)
+ struct stat st;
+ char tmp[512];
+
++ olist = (PROC*)0;
+ omit = (OMIT*)0;
+ nlist = (NFS*)0;
+ opterr = 0;
+@@ -868,7 +917,7 @@ int main_pidof(int argc, char **argv)
+ if ((token = getenv("PIDOF_NETFS")) && (strcmp(token,"no") != 0))
+ flags |= PIDOF_NETFS;
+
+- while ((opt = getopt(argc,argv,"hco:sxn")) != EOF) switch (opt) {
++ while ((opt = getopt(argc,argv,"hcmo:sxn")) != EOF) switch (opt) {
+ case '?':
+ nsyslog(LOG_ERR,"invalid options on command line!\n");
+ closelog();
+@@ -907,6 +956,9 @@ int main_pidof(int argc, char **argv)
+ case 'x':
+ scripts_too++;
+ break;
++ case 'm':
++ flags |= PIDOF_OMIT_OMIT_MATCHES;
++ break;
+ case 'n':
+ flags |= PIDOF_NETFS;
+ break;
+@@ -938,10 +990,13 @@ int main_pidof(int argc, char **argv)
+ pid_t spid = 0;
+ while ((p = get_next_from_pid_q(q))) {
+ if ((flags & PIDOF_OMIT) && omit) {
+- OMIT * optr;
+- for (optr = omit; optr; optr = optr->next) {
++ PROC * optr;
++ for (optr = olist; optr; optr = optr->next) {
+ if (optr->pid == p->pid)
+ break;
++ if (flags & PIDOF_OMIT_OMIT_MATCHES)
++ if (matches(optr, p))
++ break;
+ }
+
+ /*
+@@ -977,6 +1032,7 @@ int main_pidof(int argc, char **argv)
+ if (!first)
+ printf("\n");
+
++ clear_omit();
+ clear_mnt();
+
+ closelog();
+--
+1.8.1.2
+
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab b/external/poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab
new file mode 100644
index 00000000..6abbdf45
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab
@@ -0,0 +1,30 @@
+# /etc/inittab: init(8) configuration.
+# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
+
+# The default runlevel.
+id:5:initdefault:
+
+# Boot-time system configuration/initialization script.
+# This is run first except when booting in emergency (-b) mode.
+si::sysinit:/etc/init.d/rcS
+
+# What to do in single-user mode.
+~~:S:wait:/sbin/sulogin
+
+# /etc/init.d executes the S and K scripts upon change
+# of runlevel.
+#
+# Runlevel 0 is halt.
+# Runlevel 1 is single-user.
+# Runlevels 2-5 are multi-user.
+# Runlevel 6 is reboot.
+
+l0:0:wait:/etc/init.d/rc 0
+l1:1:wait:/etc/init.d/rc 1
+l2:2:wait:/etc/init.d/rc 2
+l3:3:wait:/etc/init.d/rc 3
+l4:4:wait:/etc/init.d/rc 4
+l5:5:wait:/etc/init.d/rc 5
+l6:6:wait:/etc/init.d/rc 6
+# Normally not reached, but fallthrough in case of emergency.
+z6:6:respawn:/sbin/sulogin
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/external/poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
new file mode 100644
index 00000000..e15ae35f
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
@@ -0,0 +1,43 @@
+#!/bin/sh
+###############################################################################
+# This script is used to automatically set up the serial console(s) on startup.
+# The variable SERIAL_CONSOLES can be set in meta/conf/machine/*.conf.
+# Script enhancement has been done based on Bug YOCTO #10844.
+# Most of the information is retrieved from /proc virtual filesystem containing
+# all the runtime system information (eg. system memory, device mount, etc).
+###############################################################################
+
+# Get active serial filename.
+active_serial=$(grep "serial" /proc/tty/drivers | cut -d/ -f1 | sed "s/ *$//")
+
+# Rephrase input parameter from ttyS target index (ttyS1, ttyS2, ttyAMA0, etc).
+runtime_tty=$(echo $2 | grep -oh '[0-9]')
+
+# Backup $IFS.
+DEFAULT_IFS=$IFS
+# Customize Internal Field Separator.
+IFS="$(printf '\n\t')"
+
+for line in $active_serial; do
+ # Check we have the file containing current active serial target index.
+ if [ -e "/proc/tty/driver/$line" ]
+ then
+ # Remove all unknown entries and discard the first line (desc).
+ activetty=$(grep -v "unknown" "/proc/tty/driver/$line" \
+ | tail -n +2 | grep -oh "^\s*\S*[0-9]")
+ for active in $activetty; do
+ # If indexes do match then enable the serial console.
+ if [ $active -eq $runtime_tty ]
+ then
+ if [ -c /dev/$2 ]
+ then
+ /sbin/getty -L $1 $2 $3
+ fi
+ break
+ fi
+ done
+ fi
+done
+
+# Restore $IFS.
+IFS=$DEFAULT_IFS
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/external/poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
new file mode 100644
index 00000000..8585a418
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -0,0 +1,93 @@
+SUMMARY = "Inittab configuration for SysVinit"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PR = "r10"
+
+SRC_URI = "file://inittab \
+ file://start_getty"
+
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -d ${D}${sysconfdir}
+ install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+ install -d ${D}${base_bindir}
+ install -m 0755 ${WORKDIR}/start_getty ${D}${base_bindir}/start_getty
+
+ set -x
+ tmp="${SERIAL_CONSOLES}"
+ for i in $tmp
+ do
+ j=`echo ${i} | sed s/\;/\ /g`
+ l=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
+ label=`echo $l | sed 's/.*\(....\)/\1/'`
+ echo "$label:12345:respawn:${base_bindir}/start_getty ${j} vt102" >> ${D}${sysconfdir}/inittab
+ done
+
+ if [ "${USE_VT}" = "1" ]; then
+ cat <<EOF >>${D}${sysconfdir}/inittab
+# ${base_sbindir}/getty invocations for the runlevels.
+#
+# The "id" field MUST be the same as the last
+# characters of the device (after "tty").
+#
+# Format:
+# <id>:<runlevels>:<action>:<process>
+#
+
+EOF
+
+ for n in ${SYSVINIT_ENABLED_GETTYS}
+ do
+ echo "$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
+ done
+ echo "" >> ${D}${sysconfdir}/inittab
+ fi
+}
+
+pkg_postinst_${PN} () {
+# run this on host and on target
+if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
+ exit 0
+fi
+}
+
+pkg_postinst_ontarget_${PN} () {
+# run this on the target
+if [ -e /proc/consoles ]; then
+ tmp="${SERIAL_CONSOLES_CHECK}"
+ for i in $tmp
+ do
+ j=`echo ${i} | sed -e s/^.*\;//g -e s/\:.*//g`
+ k=`echo ${i} | sed s/^.*\://g`
+ if [ -z "`grep ${j} /proc/consoles`" ]; then
+ if [ -z "${k}" ] || [ -z "`grep ${k} /proc/consoles`" ] || [ ! -e /dev/${j} ]; then
+ sed -i -e /^.*${j}\ /d -e /^.*${j}$/d /etc/inittab
+ fi
+ fi
+ done
+ kill -HUP 1
+else
+ exit 1
+fi
+}
+
+# USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf.
+# Set PACKAGE_ARCH appropriately.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} = "${sysconfdir}/inittab ${base_bindir}/start_getty"
+CONFFILES_${PN} = "${sysconfdir}/inittab"
+
+USE_VT ?= "1"
+SYSVINIT_ENABLED_GETTYS ?= "1"
+
+
+
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch b/external/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch
new file mode 100644
index 00000000..f35c15cb
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch
@@ -0,0 +1,52 @@
+From 36ac97bfe51797458442a6035219a504a42e703a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Aug 2015 10:56:40 -0700
+Subject: [PATCH] This fixes an issue that clang reports about mutliple output
+ files
+
+Issue is that we are passing .h file to link step as seen below.
+
+| arm-oe-linux-gnueabi-clang -march=armv7-a -mthumb -mfloat-abi=hard
+-mfpu=neon-vfpv4 -mtune=cortex-a7 -D__extern_always_inline=inline
+-no-integrated-as
+--sysroot=/mnt/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-glibc/sysroots/raspberrypi2
+-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed halt.o ifdown.o hddown.o
+utmp.o reboot.h -o halt
+| clang-3.7: error: cannot specify -o when generating multiple output
+files
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index e77ed5f..a6f9f40 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -103,9 +103,9 @@ all: $(BIN) $(SBIN) $(USRBIN)
+ init: LDLIBS += $(INITLIBS) $(STATIC)
+ init: init.o init_utmp.o
+
+-halt: halt.o ifdown.o hddown.o utmp.o reboot.h
++halt: halt.o ifdown.o hddown.o utmp.o
+
+-last: last.o oldutmp.h
++last: last.o
+
+ mesg: mesg.o
+
+@@ -120,7 +120,7 @@ sulogin: sulogin.o
+
+ wall: dowall.o wall.o
+
+-shutdown: dowall.o shutdown.o utmp.o reboot.h
++shutdown: dowall.o shutdown.o utmp.o
+
+ bootlogd: LDLIBS += -lutil
+ bootlogd: bootlogd.o
+--
+2.1.4
+
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd b/external/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
new file mode 100644
index 00000000..a689d92d
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
@@ -0,0 +1 @@
+f root root 0644 /var/log/boot none
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/external/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
new file mode 100755
index 00000000..df5aa430
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
@@ -0,0 +1,98 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: bootlogd
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop: 2 3 4 5
+# Short-Description: One of the first scripts to be executed. Starts or stops
+# the bootlogd log program. If this script is called as
+# "stop-bootlogd", it will stop the daemon instead of
+# starting it even when called with the "start" argument.
+#
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/sbin/bootlogd
+NAME=bootlogd
+DESC="Bootlog daemon"
+
+# source function library
+. /etc/init.d/functions
+
+test -f $DAEMON || exit 0
+
+[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
+
+## set -e # not needed
+
+case "$BOOTLOGD_ENABLE" in
+ [Nn]*)
+ exit 0
+ ;;
+esac
+
+STOPPER=
+ACTION="$1"
+case "$0" in
+ *stop-bootlog*)
+ STOPPER=Y
+ if [ "$ACTION" = start ]
+ then
+ ACTION=stop
+ fi
+ ;;
+esac
+
+case "$ACTION" in
+ start)
+ [ "${VERBOSE}" != "no" ] && echo -n "Starting $DESC: "
+ if [ -d /proc/1/. ]
+ then
+ umask 027
+ start-stop-daemon --start --quiet \
+ --exec $DAEMON -- -r -c
+ else
+ $DAEMON -r -c
+ fi
+ [ "${VERBOSE}" != "no" ] && echo "$NAME."
+ ;;
+ stop)
+ # stop may get called during bootup, so let it honor
+ # rcS VERBOSE setting
+ [ "${VERBOSE}" != "no" ] && echo -n "Stopping $DESC: "
+ start-stop-daemon --stop --quiet --exec $DAEMON
+
+ if [ "$STOPPER" ] && [ "$(which savelog 2>/dev/null)" ] && \
+ [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
+ then
+ cd /var/log
+ chgrp adm boot
+ savelog -p -c 5 boot > /dev/null 2>&1
+ mv boot.0 boot
+ mv boot~ boot.0
+ fi
+
+ [ "${VERBOSE}" != "no" ] && echo "$NAME."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting $DESC: "
+ start-stop-daemon --stop --quiet --exec $DAEMON
+ sleep 1
+ start-stop-daemon --start --quiet --exec $DAEMON
+ echo "$NAME."
+ ;;
+ status)
+ status $DAEMON
+ exit $?
+ ;;
+ *)
+ N=${0##*/}
+ N=${N#[SK]??}
+ echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit/rc b/external/poky/meta/recipes-core/sysvinit/sysvinit/rc
new file mode 100755
index 00000000..7ca41ae1
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit/rc
@@ -0,0 +1,182 @@
+#!/bin/sh
+#
+# rc This file is responsible for starting/stopping
+# services when the runlevel changes.
+#
+# Optimization feature:
+# A startup script is _not_ run when the service was
+# running in the previous runlevel and it wasn't stopped
+# in the runlevel transition (most Debian services don't
+# have K?? links in rc{1,2,3,4,5} )
+#
+# Author: Miquel van Smoorenburg <miquels@cistron.nl>
+# Bruce Perens <Bruce@Pixar.com>
+#
+# Version: @(#)rc 2.78 07-Nov-1999 miquels@cistron.nl
+#
+
+. /etc/default/rcS
+export VERBOSE
+
+startup_progress() {
+ step=$(($step + $step_change))
+ if [ "$num_steps" != "0" ]; then
+ progress=$((($step * $progress_size / $num_steps) + $first_step))
+ else
+ progress=$progress_size
+ fi
+ #echo "PROGRESS is $progress $runlevel $first_step + ($step of $num_steps) $step_change $progress_size"
+ #if type psplash-write >/dev/null 2>&1; then
+ # TMPDIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true
+ #fi
+ if [ -e /mnt/.psplash/psplash_fifo ]; then
+ echo "PROGRESS $progress" > /mnt/.psplash/psplash_fifo
+ fi
+}
+
+
+#
+# Start script or program.
+#
+startup() {
+ # Handle verbosity
+ [ "$VERBOSE" = very ] && echo "INIT: Running $@..."
+
+ case "$1" in
+ *.sh)
+ # Source shell script for speed.
+ (
+ trap - INT QUIT TSTP
+ scriptname=$1
+ shift
+ . $scriptname
+ )
+ ;;
+ *)
+ "$@"
+ ;;
+ esac
+ startup_progress
+}
+
+ # Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
+ trap ":" INT QUIT TSTP
+
+ # Set onlcr to avoid staircase effect.
+ stty onlcr 0>&1
+
+ # Limit stack size for startup scripts
+ [ "$STACK_SIZE" == "" ] || ulimit -S -s $STACK_SIZE
+
+ # Now find out what the current and what the previous runlevel are.
+
+ runlevel=$RUNLEVEL
+ # Get first argument. Set new runlevel to this argument.
+ [ "$1" != "" ] && runlevel=$1
+ if [ "$runlevel" = "" ]
+ then
+ echo "Usage: $0 <runlevel>" >&2
+ exit 1
+ fi
+ previous=$PREVLEVEL
+ [ "$previous" = "" ] && previous=N
+
+ export runlevel previous
+
+ # Is there an rc directory for this new runlevel?
+ if [ -d /etc/rc$runlevel.d ]
+ then
+ # Find out where in the progress bar the initramfs got to.
+ PROGRESS_STATE=0
+ #if [ -f /dev/.initramfs/progress_state ]; then
+ # . /dev/.initramfs/progress_state
+ #fi
+
+ # Split the remaining portion of the progress bar into thirds
+ progress_size=$(((100 - $PROGRESS_STATE) / 3))
+
+ case "$runlevel" in
+ 0|6)
+ # Count down from -100 to 0 and use the entire bar
+ first_step=-100
+ progress_size=100
+ step_change=1
+ ;;
+ S)
+ # Begin where the initramfs left off and use 2/3
+ # of the remaining space
+ first_step=$PROGRESS_STATE
+ progress_size=$(($progress_size * 2))
+ step_change=1
+ ;;
+ *)
+ # Begin where rcS left off and use the final 1/3 of
+ # the space (by leaving progress_size unchanged)
+ first_step=$(($progress_size * 2 + $PROGRESS_STATE))
+ step_change=1
+ ;;
+ esac
+
+ num_steps=0
+ for s in /etc/rc$runlevel.d/[SK]*; do
+ case "${s##/etc/rc$runlevel.d/S??}" in
+ gdm|xdm|kdm|reboot|halt)
+ break
+ ;;
+ esac
+ num_steps=$(($num_steps + 1))
+ done
+ step=0
+
+ # First, run the KILL scripts.
+ if [ $previous != N ]
+ then
+ for i in /etc/rc$runlevel.d/K[0-9][0-9]*
+ do
+ # Check if the script is there.
+ [ ! -f $i ] && continue
+
+ # Stop the service.
+ startup $i stop
+ done
+ fi
+
+ # Now run the START scripts for this runlevel.
+ for i in /etc/rc$runlevel.d/S*
+ do
+ [ ! -f $i ] && continue
+
+ if [ $previous != N ] && [ $previous != S ]
+ then
+ #
+ # Find start script in previous runlevel and
+ # stop script in this runlevel.
+ #
+ suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
+ stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
+ previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
+ #
+ # If there is a start script in the previous level
+ # and _no_ stop script in this level, we don't
+ # have to re-start the service.
+ #
+ [ -f $previous_start ] && [ ! -f $stop ] && continue
+ fi
+ case "$runlevel" in
+ 0|6)
+ startup $i stop
+ ;;
+ *)
+ startup $i start
+ ;;
+ esac
+ done
+ fi
+
+#Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch
+if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; then
+ if type psplash-write >/dev/null 2>&1; then
+ TMPDIR=/mnt/.psplash psplash-write "QUIT" || true
+ umount -l /mnt/.psplash
+ fi
+fi
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit/rcS b/external/poky/meta/recipes-core/sysvinit/sysvinit/rcS
new file mode 100755
index 00000000..080b04f3
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit/rcS
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# rcS Call all S??* scripts in /etc/rcS.d in
+# numerical/alphabetical order.
+#
+# Version: @(#)/etc/init.d/rcS 2.76 19-Apr-1999 miquels@cistron.nl
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+runlevel=S
+prevlevel=N
+umask 022
+export PATH runlevel prevlevel
+
+# Make sure proc is mounted
+#
+[ -d "/proc/1" ] || mount /proc
+
+#
+# Source defaults.
+#
+. /etc/default/rcS
+
+#
+# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
+#
+trap ":" INT QUIT TSTP
+
+#
+# Call all parts in order.
+#
+exec /etc/init.d/rc S
+
+
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default b/external/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default
new file mode 100644
index 00000000..709cdf6e
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -0,0 +1,29 @@
+#
+# Defaults for the boot scripts in /etc/rcS.d
+#
+
+# Time files in /tmp are kept in days.
+TMPTIME=0
+# Set to yes if you want sulogin to be spawned on bootup
+SULOGIN=no
+# Set to no if you want to be able to login over telnet/rlogin
+# before system startup is complete (as soon as inetd is started)
+DELAYLOGIN=no
+# Assume that the BIOS clock is set to UTC time (recommended)
+UTC=yes
+# Set VERBOSE to "no" if you would like a more quiet bootup.
+VERBOSE=no
+# Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically
+EDITMOTD=no
+# Whether to fsck root on boot
+ENABLE_ROOTFS_FSCK=no
+# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
+FSCKFIX=yes
+# Set TICKADJ to the correct tick value for this specific machine
+#TICKADJ=10000
+# Enable caching in populate-volatile.sh
+VOLATILE_ENABLE_CACHE=yes
+# Indicate whether the rootfs is intended to be read-only or not.
+# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs.
+# Normally you should not change this value.
+ROOTFS_READ_ONLY=no
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch b/external/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch
new file mode 100644
index 00000000..5e0dca3b
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit/realpath.patch
@@ -0,0 +1,78 @@
+Fix build on musl use realpath() API its available on all libcs
+
+realpath() API doesnt work on systems with PATH_MAX set to be unlimited e.g. GNU/Hurd
+However for Linux it should always work
+
+Upstream-Status: Inappropriate[Linux specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: sysvinit-2.88dsf/src/ifdown.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/ifdown.c 2010-03-23 07:37:01.000000000 -0700
++++ sysvinit-2.88dsf/src/ifdown.c 2014-04-02 00:43:43.675437029 -0700
+@@ -26,11 +26,11 @@
+ #include <unistd.h>
+ #include <time.h>
+ #include <string.h>
++#include <errno.h>
+
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+ #include <sys/time.h>
+-#include <sys/errno.h>
+
+ #include <net/if.h>
+ #include <netinet/in.h>
+Index: sysvinit-2.88dsf/src/init.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/init.c 2014-04-02 00:42:10.488770162 -0700
++++ sysvinit-2.88dsf/src/init.c 2014-04-02 00:42:59.432103823 -0700
+@@ -49,6 +49,7 @@
+ #include <utmp.h>
+ #include <ctype.h>
+ #include <stdarg.h>
++#include <sys/ttydefaults.h>
+ #include <sys/syslog.h>
+ #include <sys/time.h>
+
+Index: sysvinit-2.88dsf/src/mountpoint.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/mountpoint.c 2009-09-10 01:28:49.000000000 -0700
++++ sysvinit-2.88dsf/src/mountpoint.c 2014-04-02 00:44:18.248770942 -0700
+@@ -23,6 +23,7 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
++#include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+Index: sysvinit-2.88dsf/src/killall5.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/killall5.c 2014-03-26 00:49:52.982668074 -0700
++++ sysvinit-2.88dsf/src/killall5.c 2014-04-02 00:46:45.838771653 -0700
+@@ -846,9 +846,9 @@
+ char *oargv1, *pargv1;
+ if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) {
+ if (o->argv1 && p->argv1) {
+- if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL)
++ if ((oargv1 = realpath(o->argv1, NULL)) == NULL)
+ oargv1 = strdup(o->argv1);
+- if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL)
++ if ((pargv1 = realpath(p->argv1, NULL)) == NULL)
+ pargv1 = strdup(p->argv1);
+ if (! strcmp(oargv1, pargv1)) {
+ ret = 1;
+Index: sysvinit-2.88dsf/src/wall.c
+===================================================================
+--- sysvinit-2.88dsf.orig/src/wall.c 2009-11-22 14:05:53.000000000 -0800
++++ sysvinit-2.88dsf/src/wall.c 2014-04-02 00:49:15.258772217 -0700
+@@ -29,6 +29,7 @@
+ #include <unistd.h>
+ #include <pwd.h>
+ #include <syslog.h>
++#include <time.h>
+ #include "init.h"
+
+
diff --git a/external/poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/external/poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
new file mode 100644
index 00000000..bfc1283f
--- /dev/null
+++ b/external/poky/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
@@ -0,0 +1,110 @@
+SUMMARY = "System-V like init"
+DESCRIPTION = "This package is required to boot in most configurations. It provides the /sbin/init program. This is the first process started on boot, and the last process terminated before the system halts."
+HOMEPAGE = "http://savannah.nongnu.org/projects/sysvinit/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+ file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
+PR = "r14"
+
+RDEPENDS_${PN} = "${PN}-inittab"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/sysvinit/sysvinit-${PV}.tar.bz2 \
+ file://install.patch \
+ file://crypt-lib.patch \
+ file://pidof-add-m-option.patch \
+ file://0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch \
+ file://realpath.patch \
+ file://0001-include-sys-sysmacros.h-for-major-minor-defines-in-g.patch \
+ file://rcS-default \
+ file://rc \
+ file://rcS \
+ file://bootlogd.init \
+ file://01_bootlogd \
+"
+
+SRC_URI[md5sum] = "6eda8a97b86e0a6f59dabbf25202aa6f"
+SRC_URI[sha256sum] = "60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5df1519"
+
+S = "${WORKDIR}/sysvinit-${PV}"
+B = "${S}/src"
+
+inherit update-alternatives distro_features_check
+DEPENDS_append = " update-rc.d-native base-passwd virtual/crypt"
+
+REQUIRED_DISTRO_FEATURES = "sysvinit"
+
+ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last lastb mesg utmpdump wall"
+
+ALTERNATIVE_PRIORITY = "200"
+
+ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
+ALTERNATIVE_PRIORITY[init] = "50"
+
+ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
+ALTERNATIVE_PRIORITY[mountpoint] = "20"
+
+ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
+ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
+ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
+ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
+ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
+
+ALTERNATIVE_${PN}-pidof = "pidof"
+ALTERNATIVE_LINK_NAME[pidof] = "${base_bindir}/pidof"
+
+ALTERNATIVE_${PN}-sulogin = "sulogin"
+ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
+
+ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 sulogin.8 utmpdump.1"
+
+ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
+ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1"
+ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
+ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
+ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
+ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
+ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
+
+PACKAGES =+ "sysvinit-pidof sysvinit-sulogin"
+FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*"
+FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5"
+FILES_sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit"
+
+RDEPENDS_${PN} += "sysvinit-pidof initd-functions"
+
+CFLAGS_prepend = "-D_GNU_SOURCE "
+export LCRYPT = "-lcrypt"
+EXTRA_OEMAKE += "'base_bindir=${base_bindir}' \
+ 'base_sbindir=${base_sbindir}' \
+ 'bindir=${bindir}' \
+ 'sbindir=${sbindir}' \
+ 'sysconfdir=${sysconfdir}' \
+ 'includedir=${includedir}' \
+ 'mandir=${mandir}'"
+
+do_install () {
+ oe_runmake 'ROOT=${D}' install
+
+ install -d ${D}${sysconfdir} \
+ ${D}${sysconfdir}/default \
+ ${D}${sysconfdir}/init.d
+ for level in S 0 1 2 3 4 5 6; do
+ install -d ${D}${sysconfdir}/rc$level.d
+ done
+
+ install -m 0644 ${WORKDIR}/rcS-default ${D}${sysconfdir}/default/rcS
+ install -m 0755 ${WORKDIR}/rc ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/bootlogd.init ${D}${sysconfdir}/init.d/bootlogd
+ ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd
+
+ update-rc.d -r ${D} bootlogd start 07 S .
+ update-rc.d -r ${D} stop-bootlogd start 99 2 3 4 5 .
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/01_bootlogd ${D}${sysconfdir}/default/volatiles
+
+ chown root:shutdown ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
+ chmod o-x,u+s ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
+}
diff --git a/external/poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch b/external/poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch
new file mode 100644
index 00000000..fe2ba532
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch
@@ -0,0 +1,28 @@
+From 4f0a722489154da99e7f6b3051afde984eed2f74 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Thu, 19 Mar 2015 15:01:29 +1100
+Subject: [PATCH] Revert "rules: remove firmware loading rules"
+
+This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19.
+Userspace firmware loading support is needed for Linux < 3.7.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ rules/50-firmware.rules | 3 +++
+ 1 file changed, 3 insertions(+)
+ create mode 100644 rules/50-firmware.rules
+
+diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules
+new file mode 100644
+index 0000000..f0ae684
+--- /dev/null
++++ b/rules/50-firmware.rules
+@@ -0,0 +1,3 @@
++# do not edit this file, it will be overwritten on update
++
++SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
+--
+2.3.3
+
diff --git a/external/poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch b/external/poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch
new file mode 100644
index 00000000..db333e93
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch
@@ -0,0 +1,364 @@
+From e415372cc7a2f52e70e1cfa8c6c1f633b411355d Mon Sep 17 00:00:00 2001
+From: Lauren Post <lauren.post@nxp.com>
+Date: Wed, 8 Jun 2016 06:51:56 -0500
+Subject: [PATCH] Revert "udev: remove userspace firmware loading support"
+
+This reverts commit 3b717594600fa717cdf9bcfd0c7c1b703b245482.
+
+Conflicts:
+ configure.ac
+ src/udev/udevd.c
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Lauren Post <lauren.post@nxp.com>
+---
+ configure.ac | 39 +++++++++-
+ rules/Makefile.am | 5 ++
+ src/udev/Makefile.am | 10 +++
+ src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
+ src/udev/udev-builtin.c | 3 +
+ src/udev/udev.h | 6 ++
+ src/udev/udevd.c | 13 ++++
+ 7 files changed, 227 insertions(+), 3 deletions(-)
+ create mode 100644 src/udev/udev-builtin-firmware.c
+
+diff --git a/configure.ac b/configure.ac
+index 8691891..65028c2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -238,9 +238,42 @@ AC_CHECK_DECL([unshare],
+ [#include <sched.h>])
+
+ # ------------------------------------------------------------------------------
+-AC_PATH_TOOL(GPERF, gperf)
+-if test -z "$GPERF" ; then
+- AC_MSG_ERROR([*** gperf not found])
++AC_ARG_WITH(firmware-path,
++ AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
++ [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]),
++ [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
++OLD_IFS=$IFS
++IFS=:
++for i in $with_firmware_path; do
++ if test "x${FIRMWARE_PATH}" = "x"; then
++ FIRMWARE_PATH="\\\"${i}/\\\""
++ else
++ FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
++ fi
++done
++IFS=$OLD_IFS
++AC_SUBST(FIRMWARE_PATH)
++AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
++AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
++
++# ------------------------------------------------------------------------------
++AC_ARG_ENABLE([gudev],
++ AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]),
++ [], [enable_gudev=yes])
++AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ])
++AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
++
++# ------------------------------------------------------------------------------
++AC_ARG_ENABLE([keymap],
++ AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]),
++ [], [enable_keymap=yes])
++
++if test "x$enable_keymap" = "xyes"; then
++ AC_PATH_TOOL(GPERF, gperf)
++ if test -z "$GPERF" ; then
++ AC_MSG_ERROR([*** gperf not found])
++ fi
++ AC_DEFINE([ENABLE_KEYMAP], [1], [Define if we are enabling rule generator])
+ fi
+
+ # ------------------------------------------------------------------------------
+diff --git a/rules/Makefile.am b/rules/Makefile.am
+index 24c099c..d714ae3 100644
+--- a/rules/Makefile.am
++++ b/rules/Makefile.am
+@@ -22,6 +22,11 @@ dist_udevrules_DATA += \
+ 80-net-name-slot.rules
+ endif
+
++if ENABLE_FIRMWARE
++dist_udevrules_DATA += \
++ 50-firmware.rules
++endif
++
+ if HAVE_BLKID
+ dist_udevrules_DATA += \
+ 60-persistent-storage.rules
+diff --git a/src/udev/Makefile.am b/src/udev/Makefile.am
+index 401af01..742fbc8 100644
+--- a/src/udev/Makefile.am
++++ b/src/udev/Makefile.am
+@@ -53,12 +53,18 @@ libudev_core_la_SOURCES = \
+ udev-ctrl.c \
+ udev-builtin.c \
+ udev-builtin-btrfs.c \
++ udev-builtin-firmware.c \
+ udev-builtin-hwdb.c \
+ udev-builtin-input_id.c \
+ udev-builtin-net_id.c \
+ udev-builtin-path_id.c \
+ udev-builtin-usb_id.c
+
++if ENABLE_FIRMWARE
++libudev_core_la_SOURCES += \
++ udev-builtin-firmware.c
++endif
++
+ include_HEADERS = \
+ udev.h
+
+@@ -86,6 +92,10 @@ libudev_core_la_LIBADD += \
+ $(KMOD_LIBS)
+ endif
+
++libudev_core_la_CPPFLAGS = \
++ $(AM_CPPFLAGS) \
++ -DFIRMWARE_PATH="$(FIRMWARE_PATH)"
++
+ #
+ # Extras
+ #
+diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c
+new file mode 100644
+index 0000000..bd8c2fb
+--- /dev/null
++++ b/src/udev/udev-builtin-firmware.c
+@@ -0,0 +1,154 @@
++/*
++ * firmware - Kernel firmware loader
++ *
++ * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
++ * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
++ *
++ * 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 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details:*
++ */
++
++#include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++#include <getopt.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <sys/utsname.h>
++#include <sys/stat.h>
++
++#include "udev.h"
++
++static bool set_loading(struct udev *udev, char *loadpath, const char *state) {
++ FILE *ldfile;
++
++ ldfile = fopen(loadpath, "we");
++ if (ldfile == NULL) {
++ log_error("error: can not open '%s'", loadpath);
++ return false;
++ };
++ fprintf(ldfile, "%s\n", state);
++ fclose(ldfile);
++ return true;
++}
++
++static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) {
++ char *buf;
++ FILE *fsource = NULL, *ftarget = NULL;
++ bool ret = false;
++
++ buf = malloc(size);
++ if (buf == NULL) {
++ log_error("No memory available to load firmware file");
++ return false;
++ }
++
++ log_debug("writing '%s' (%zi) to '%s'", source, size, target);
++
++ fsource = fopen(source, "re");
++ if (fsource == NULL)
++ goto exit;
++ ftarget = fopen(target, "we");
++ if (ftarget == NULL)
++ goto exit;
++ if (fread(buf, size, 1, fsource) != 1)
++ goto exit;
++ if (fwrite(buf, size, 1, ftarget) == 1)
++ ret = true;
++exit:
++ if (ftarget != NULL)
++ fclose(ftarget);
++ if (fsource != NULL)
++ fclose(fsource);
++ free(buf);
++ return ret;
++}
++
++static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) {
++ struct udev *udev = udev_device_get_udev(dev);
++ static const char *searchpath[] = { FIRMWARE_PATH };
++ char loadpath[UTIL_PATH_SIZE];
++ char datapath[UTIL_PATH_SIZE];
++ char fwpath[UTIL_PATH_SIZE];
++ const char *firmware;
++ FILE *fwfile = NULL;
++ struct utsname kernel;
++ struct stat statbuf;
++ unsigned int i;
++ int rc = EXIT_SUCCESS;
++
++ firmware = udev_device_get_property_value(dev, "FIRMWARE");
++ if (firmware == NULL) {
++ log_error("firmware parameter missing");
++ rc = EXIT_FAILURE;
++ goto exit;
++ }
++
++ /* lookup firmware file */
++ uname(&kernel);
++ for (i = 0; i < ELEMENTSOF(searchpath); i++) {
++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
++ fwfile = fopen(fwpath, "re");
++ if (fwfile != NULL)
++ break;
++
++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL);
++ fwfile = fopen(fwpath, "re");
++ if (fwfile != NULL)
++ break;
++ }
++
++ strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
++
++ if (fwfile == NULL) {
++ log_debug("did not find firmware file '%s'", firmware);
++ rc = EXIT_FAILURE;
++ /*
++ * Do not cancel the request in the initrd, the real root might have
++ * the firmware file and the 'coldplug' run in the real root will find
++ * this pending request and fulfill or cancel it.
++ * */
++ if (!in_initrd())
++ set_loading(udev, loadpath, "-1");
++ goto exit;
++ }
++
++ if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) {
++ if (!in_initrd())
++ set_loading(udev, loadpath, "-1");
++ rc = EXIT_FAILURE;
++ goto exit;
++ }
++
++ if (!set_loading(udev, loadpath, "1"))
++ goto exit;
++
++ strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
++ if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
++ log_error("error sending firmware '%s' to device", firmware);
++ set_loading(udev, loadpath, "-1");
++ rc = EXIT_FAILURE;
++ goto exit;
++ };
++
++ set_loading(udev, loadpath, "0");
++exit:
++ if (fwfile)
++ fclose(fwfile);
++ return rc;
++}
++
++const struct udev_builtin udev_builtin_firmware = {
++ .name = "firmware",
++ .cmd = builtin_firmware,
++ .help = "kernel firmware loader",
++ .run_once = true,
++};
+diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
+index 74b3bdc..3657106 100644
+--- a/src/udev/udev-builtin.c
++++ b/src/udev/udev-builtin.c
+@@ -34,6 +34,9 @@ static const struct udev_builtin *builtins[] = {
+ [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
+ #endif
+ [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
++#ifdef HAVE_FIRMWARE
++ [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
++#endif
+ [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
+ [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
+ [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
+diff --git a/src/udev/udev.h b/src/udev/udev.h
+index 198cb2c..01a1e9c 100644
+--- a/src/udev/udev.h
++++ b/src/udev/udev.h
+@@ -149,6 +149,9 @@ enum udev_builtin_cmd {
+ UDEV_BUILTIN_BLKID,
+ #endif
+ UDEV_BUILTIN_BTRFS,
++#ifdef HAVE_FIRMWARE
++ UDEV_BUILTIN_FIRMWARE,
++#endif
+ UDEV_BUILTIN_HWDB,
+ UDEV_BUILTIN_INPUT_ID,
+ UDEV_BUILTIN_KEYBOARD,
+@@ -173,6 +176,9 @@ struct udev_builtin {
+ extern const struct udev_builtin udev_builtin_blkid;
+ #endif
+ extern const struct udev_builtin udev_builtin_btrfs;
++#ifdef HAVE_FIRMWARE
++extern const struct udev_builtin udev_builtin_firmware;
++#endif
+ extern const struct udev_builtin udev_builtin_hwdb;
+ extern const struct udev_builtin udev_builtin_input_id;
+ extern const struct udev_builtin udev_builtin_keyboard;
+diff --git a/src/udev/udevd.c b/src/udev/udevd.c
+index b1de97a..35655d8 100644
+--- a/src/udev/udevd.c
++++ b/src/udev/udevd.c
+@@ -101,6 +101,9 @@ struct event {
+ bool is_block;
+ usec_t start_usec;
+ bool warned;
++#ifdef HAVE_FIRMWARE
++ bool nodelay;
++#endif
+ };
+
+ static inline struct event *node_to_event(struct udev_list_node *node) {
+@@ -491,6 +494,10 @@ static int event_queue_insert(struct udev_device *dev) {
+ event->devnum = udev_device_get_devnum(dev);
+ event->is_block = streq("block", udev_device_get_subsystem(dev));
+ event->ifindex = udev_device_get_ifindex(dev);
++#ifdef HAVE_FIRMWARE
++ if (streq(udev_device_get_subsystem(dev), "firmware"))
++ event->nodelay = true;
++#endif
+
+ log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
+ udev_device_get_action(dev), udev_device_get_subsystem(dev));
+@@ -566,6 +573,12 @@ static bool is_devpath_busy(struct event *event) {
+ return true;
+ }
+
++#ifdef HAVE_FIRMWARE
++ /* allow to bypass the dependency tracking */
++ if (event->nodelay)
++ continue;
++#endif
++
+ /* parent device event found */
+ if (event->devpath[common] == '/') {
+ event->delaying_seqnum = loop_event->seqnum;
+--
+1.9.1
+
diff --git a/external/poky/meta/recipes-core/udev/eudev/devfs-udev.rules b/external/poky/meta/recipes-core/udev/eudev/devfs-udev.rules
new file mode 100644
index 00000000..0ba1ad4e
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev/devfs-udev.rules
@@ -0,0 +1,108 @@
+# The use of these rules is not recommended or supported.
+# In a world where devices can come and go at any time, the devfs scheme
+# of simple device enumeration does not help _anything_. Just forget about
+# it. Use custom rules to name your device or look at the persistent device
+# naming scheme, which is implemented for disks and add your subsystem.
+
+# ide block devices
+BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}"
+
+# md block devices
+KERNEL="md[0-9]*", NAME="md/%n"
+
+# floppy devices
+KERNEL="fd[0-9]*", NAME="floppy/%n"
+
+# tty devices
+KERNEL="tty[0-9]*", NAME="vc/%n", SYMLINK="%k"
+KERNEL="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k"
+KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n"
+
+# vc devices
+KERNEL="vcs", NAME="vcc/0"
+KERNEL="vcs[0-9]*", NAME="vcc/%n"
+KERNEL="vcsa", NAME="vcc/a0"
+KERNEL="vcsa[0-9]*", NAME="vcc/a%n"
+
+# v4l devices
+KERNEL="video[0-9]*", NAME="v4l/video%n"
+KERNEL="radio[0-9]*", NAME="v4l/radio%n"
+KERNEL="vbi[0-9]*", NAME="v4l/vbi%n"
+KERNEL="vtx[0-9]*", NAME="v4l/vtx%n"
+
+# dm devices (ignore them)
+KERNEL="dm-[0-9]*", NAME=""
+
+# i2c devices
+KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"
+
+# loop devices
+KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
+
+# ramdisks
+KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k"
+
+# framebuffer devices
+KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"
+
+# misc
+KERNEL="rtc", NAME="misc/%k", SYMLINK="%k"
+KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
+KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k"
+KERNEL="rtc", NAME="misc/%k", SYMLINK="%k"
+KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
+KERNEL="uinput", NAME="misc/%k", SYMLINK="%k"
+
+# alsa devices
+KERNEL="controlC[0-9]*", NAME="snd/%k"
+KERNEL="hw[CD0-9]*", NAME="snd/%k"
+KERNEL="pcm[CD0-9cp]*", NAME="snd/%k"
+KERNEL="midi[CD0-9]*", NAME="snd/%k"
+KERNEL="timer", NAME="snd/%k"
+KERNEL="seq", NAME="snd/%k"
+
+# oss devices
+KERNEL="audio*", NAME="sound/%k", SYMLINK="%k"
+KERNEL="dmmidi", NAME="sound/%k", SYMLINK="%k"
+KERNEL="dsp*", NAME="sound/%k", SYMLINK="%k"
+KERNEL="midi*", NAME="sound/%k", SYMLINK="%k"
+KERNEL="mixer*", NAME="sound/%k", SYMLINK="%k"
+KERNEL="sequencer*", NAME="sound/%k", SYMLINK="%k"
+
+# input devices
+KERNEL="mice", NAME="input/%k"
+KERNEL="mouse*", NAME="input/%k"
+KERNEL="event*", NAME="input/%k"
+KERNEL="js*", NAME="input/%k"
+KERNEL="ts*", NAME="input/%k"
+
+# USB devices
+KERNEL="hiddev*", NAME="usb/%k"
+KERNEL="auer*", NAME="usb/%k"
+KERNEL="legousbtower*", NAME="usb/%k"
+KERNEL="dabusb*", NAME="usb/%k"
+BUS="usb", KERNEL="lp[0-9]*", NAME="usb/%k"
+
+# netlink devices
+KERNEL="route", NAME="netlink/%k"
+KERNEL="skip", NAME="netlink/%k"
+KERNEL="usersock", NAME="netlink/%k"
+KERNEL="fwmonitor", NAME="netlink/%k"
+KERNEL="tcpdiag", NAME="netlink/%k"
+KERNEL="nflog", NAME="netlink/%k"
+KERNEL="xfrm", NAME="netlink/%k"
+KERNEL="arpd", NAME="netlink/%k"
+KERNEL="route6", NAME="netlink/%k"
+KERNEL="ip6_fw", NAME="netlink/%k"
+KERNEL="dnrtmsg", NAME="netlink/%k"
+KERNEL="tap*", NAME="netlink/%k"
+
+# CAPI devices
+KERNEL="capi", NAME="capi20", SYMLINK="isdn/capi20"
+KERNEL="capi*", NAME="capi/%n"
+
+# Network devices
+KERNEL="tun", NAME="net/%k"
+
+# raw devices
+KERNEL="raw[0-9]*", NAME="raw/%k"
diff --git a/external/poky/meta/recipes-core/udev/eudev/init b/external/poky/meta/recipes-core/udev/eudev/init
new file mode 100644
index 00000000..0455ade2
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev/init
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: udev
+# Required-Start: mountvirtfs
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Start udevd, populate /dev and load drivers.
+### END INIT INFO
+
+export TZ=/etc/localtime
+
+[ -d /sys/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -x @UDEVD@ ] || exit 1
+
+[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+kill_udevd () {
+ pid=`pidof -x udevd`
+ [ -n "$pid" ] && kill $pid
+}
+
+case "$1" in
+ start)
+ export ACTION=add
+ # propagate /dev from /sys
+ echo "Starting udev"
+
+ # Check for requireed devtmpfs before trying to start udev and
+ # mount a no-existant fs.
+ if ! grep -q devtmpfs /proc/filesystems
+ then
+ echo "Missing devtmpfs, which is required for udev to run";
+ echo "Halting..."
+ halt
+ fi
+ # mount the devtmpfs on /dev, if not already done
+ LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
+ mount -n -o mode=0755 -t devtmpfs none "/dev"
+ }
+ [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
+ [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
+ # the automount rule for udev needs /tmp directory available, as /tmp is a symlink
+ # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure
+ # /var/volatile/tmp directory to be available.
+ mkdir -m 1777 -p /var/volatile/tmp
+
+ # make_extra_nodes
+ kill_udevd > "/dev/null" 2>&1
+
+ # trigger the sorted events
+ [ -e /proc/sys/kernel/hotplug ] && echo -e '\000' >/proc/sys/kernel/hotplug
+ @UDEVD@ -d
+
+ udevadm control --env=STARTUP=1
+ if [ "$not_first_boot" != "" ];then
+ if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then
+ PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform"
+ else
+ PLATFORM_BUS_NOMATCH=""
+ fi
+ udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH
+ (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
+ else
+ udevadm trigger --action=add
+ udevadm settle
+ fi
+ ;;
+ stop)
+ echo "Stopping udevd"
+ start-stop-daemon --stop --name udevd --quiet
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ pid=`pidof -x udevd`
+ if [ -n "$pid" ]; then
+ echo "udevd (pid $pid) is running ..."
+ else
+ echo "udevd is stopped"
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart}"
+ exit 1
+esac
+exit 0
diff --git a/external/poky/meta/recipes-core/udev/eudev/links.conf b/external/poky/meta/recipes-core/udev/eudev/links.conf
new file mode 100644
index 00000000..8fff922d
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev/links.conf
@@ -0,0 +1,21 @@
+# This file does not exist. Please do not ask the debian maintainer about it.
+# You may use it to do strange and wonderful things, at your risk.
+
+L fd /proc/self/fd
+L stdin /proc/self/fd/0
+L stdout /proc/self/fd/1
+L stderr /proc/self/fd/2
+L core /proc/kcore
+L sndstat /proc/asound/oss/sndstat
+L MAKEDEV /sbin/MAKEDEV
+
+D pts
+D shm
+
+# Hic sunt leones.
+M ppp c 108 0
+D loop
+M loop/0 b 7 0
+D net
+M net/tun c 10 200
+
diff --git a/external/poky/meta/recipes-core/udev/eudev/local.rules b/external/poky/meta/recipes-core/udev/eudev/local.rules
new file mode 100644
index 00000000..d502cdd6
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev/local.rules
@@ -0,0 +1,19 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Create a symlink to any touchscreen input device
+# Trigger based on input type, that the evbit (-e) has EV_SYN and EV_ABS,
+# has an EV_ABS value (-a) which is used for touchscreen type devices.
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0"
diff --git a/external/poky/meta/recipes-core/udev/eudev/permissions.rules b/external/poky/meta/recipes-core/udev/eudev/permissions.rules
new file mode 100644
index 00000000..205b7332
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev/permissions.rules
@@ -0,0 +1,131 @@
+ACTION!="add", GOTO="permissions_end"
+
+# workarounds needed to synchronize with sysfs
+# only needed for kernels < v2.6.18-rc1
+ENV{PHYSDEVPATH}!="?*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
+SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt"
+# only needed for kernels < 2.6.16
+SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
+# only needed for kernels < 2.6.17
+SUBSYSTEM=="net", ENV{DRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
+
+# devices needed to load the drivers providing them
+KERNEL=="tun", OPTIONS+="ignore_remove"
+KERNEL=="ppp", OPTIONS+="ignore_remove"
+KERNEL=="loop[0-9]*", OPTIONS+="ignore_remove"
+
+# default permissions for block devices
+SUBSYSTEM=="block", GROUP="disk"
+# the aacraid driver is broken and reports that disks removable (see #404927)
+SUBSYSTEM=="block", ATTRS{removable}=="1", \
+ DRIVERS!="aacraid", GROUP="floppy"
+# all block devices on these buses are "removable"
+SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy"
+
+# IDE devices
+KERNEL=="hd[a-z]|pcd[0-9]*", DRIVERS=="ide-cdrom|pcd", \
+ IMPORT{program}="cdrom_id --export $tempnode"
+ENV{ID_CDROM}=="?*", GROUP="cdrom"
+KERNEL=="ht[0-9]*", GROUP="tape"
+KERNEL=="nht[0-9]*", GROUP="tape"
+
+# SCSI devices
+KERNEL=="sr[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
+SUBSYSTEMS=="scsi", ATTRS{type}=="1", GROUP="tape"
+SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="HP", GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="Epson", GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="EPSON", GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="4", GROUP="cdrom"
+SUBSYSTEMS=="scsi", ATTRS{type}=="5", GROUP="cdrom"
+SUBSYSTEMS=="scsi", ATTRS{type}=="6", GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="8", GROUP="tape"
+
+# USB devices
+KERNEL=="legousbtower*", MODE="0666"
+KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp"
+
+# usbfs-like devices
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
+ MODE="0664"
+
+# iRiver music players
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \
+ ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]"
+
+# serial devices
+SUBSYSTEM=="tty", GROUP="dialout"
+SUBSYSTEM=="capi", GROUP="dialout"
+SUBSYSTEM=="slamr", GROUP="dialout"
+SUBSYSTEM=="zaptel", GROUP="dialout"
+
+# vc devices (all members of the tty subsystem)
+KERNEL=="ptmx", MODE="0666", GROUP="root"
+KERNEL=="console", MODE="0600", GROUP="root"
+KERNEL=="tty", MODE="0666", GROUP="root"
+KERNEL=="tty[0-9]*", GROUP="root"
+KERNEL=="pty*", MODE="0666", GROUP="tty"
+
+# video devices
+SUBSYSTEM=="video4linux", GROUP="video"
+SUBSYSTEM=="drm", GROUP="video"
+SUBSYSTEM=="dvb", GROUP="video"
+SUBSYSTEM=="em8300", GROUP="video"
+SUBSYSTEM=="graphics", GROUP="video"
+SUBSYSTEM=="nvidia", GROUP="video"
+
+# misc devices
+KERNEL=="random", MODE="0666"
+KERNEL=="urandom", MODE="0666"
+KERNEL=="mem", MODE="0640", GROUP="kmem"
+KERNEL=="kmem", MODE="0640", GROUP="kmem"
+KERNEL=="port", MODE="0640", GROUP="kmem"
+KERNEL=="full", MODE="0666"
+KERNEL=="null", MODE="0666"
+KERNEL=="zero", MODE="0666"
+KERNEL=="inotify", MODE="0666"
+KERNEL=="sgi_fetchop", MODE="0666"
+KERNEL=="sonypi", MODE="0666"
+KERNEL=="agpgart", GROUP="video"
+KERNEL=="nvram", GROUP="nvram"
+KERNEL=="rtc|rtc[0-9]*", GROUP="audio"
+KERNEL=="tpm*", MODE="0600", OWNER="tss", GROUP="tss"
+KERNEL=="fuse", GROUP="fuse"
+KERNEL=="kqemu", MODE="0666"
+KERNEL=="kvm", GROUP="kvm"
+KERNEL=="tun", MODE="0666",
+
+KERNEL=="cdemu[0-9]*", GROUP="cdrom"
+KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
+KERNEL=="pktcdvd", MODE="0644"
+
+KERNEL=="uverbs*", GROUP="rdma"
+KERNEL=="ucm*", GROUP="rdma"
+KERNEL=="rdma_ucm", GROUP="rdma"
+
+# printers and parallel devices
+SUBSYSTEM=="printer", GROUP="lp"
+SUBSYSTEM=="ppdev", GROUP="lp"
+KERNEL=="irlpt*", GROUP="lp"
+KERNEL=="pt[0-9]*", GROUP="tape"
+KERNEL=="pht[0-9]*", GROUP="tape"
+
+# sound devices
+SUBSYSTEM=="sound", GROUP="audio"
+
+# ieee1394 devices
+KERNEL=="raw1394", GROUP="disk"
+KERNEL=="dv1394*", GROUP="video"
+KERNEL=="video1394*", GROUP="video"
+
+# input devices
+KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \
+ MODE="0664", GROUP="video"
+KERNEL=="js[0-9]*", MODE="0664"
+KERNEL=="lirc[0-9]*", GROUP="video"
+
+# AOE character devices
+SUBSYSTEM=="aoe", MODE="0220", GROUP="disk"
+SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
+
+LABEL="permissions_end"
+
diff --git a/external/poky/meta/recipes-core/udev/eudev/run.rules b/external/poky/meta/recipes-core/udev/eudev/run.rules
new file mode 100644
index 00000000..75d71375
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev/run.rules
@@ -0,0 +1,14 @@
+# debugging monitor
+RUN+="socket:/org/kernel/udev/monitor"
+
+# run a command on remove events
+ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}"
+
+# ignore the events generated by virtual consoles
+KERNEL=="ptmx", OPTIONS+="last_rule"
+KERNEL=="console", OPTIONS+="last_rule"
+KERNEL=="tty" , OPTIONS+="last_rule"
+KERNEL=="tty[0-9]*", OPTIONS+="last_rule"
+KERNEL=="pty*", OPTIONS+="last_rule"
+SUBSYSTEM=="vc", OPTIONS+="last_rule"
+
diff --git a/external/poky/meta/recipes-core/udev/eudev/udev.rules b/external/poky/meta/recipes-core/udev/eudev/udev.rules
new file mode 100644
index 00000000..a19d4a0b
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev/udev.rules
@@ -0,0 +1,116 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# workaround for devices which do not report media changes
+SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \
+ ENV{ID_MODEL}=="IOMEGA_ZIP*", NAME="%k", OPTIONS+="all_partitions"
+SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{media}=="floppy", \
+ OPTIONS+="all_partitions"
+
+# SCSI devices
+SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n"
+
+# USB devices
+SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="dabusb*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="hiddev*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="legousbtower*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \
+ ATTRS{product}=="Palm Handheld*|Handspring Visor|palmOne Handheld", \
+ SYMLINK+="pilot"
+
+# usbfs-like devices
+SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \
+ NAME="%c"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"
+
+# serial devices
+KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
+KERNEL=="capi[0-9]*", NAME="capi/%n"
+
+# video devices
+KERNEL=="dvb*", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION=="add", \
+ NAME="%c"
+KERNEL=="card[0-9]*", NAME="dri/%k"
+
+# misc devices
+KERNEL=="hw_random", NAME="hwrng"
+KERNEL=="tun", NAME="net/%k"
+KERNEL=="evtchn", NAME="xen/%k"
+
+KERNEL=="cdemu[0-9]*", NAME="cdemu/%n"
+KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n"
+KERNEL=="pktcdvd", NAME="pktcdvd/control"
+
+KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
+KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
+KERNEL=="microcode", NAME="cpu/microcode"
+
+KERNEL=="umad*", NAME="infiniband/%k"
+KERNEL=="issm*", NAME="infiniband/%k"
+KERNEL=="uverbs*", NAME="infiniband/%k"
+KERNEL=="ucm*", NAME="infiniband/%k"
+KERNEL=="rdma_ucm", NAME="infiniband/%k"
+
+# ALSA devices
+KERNEL=="controlC[0-9]*", NAME="snd/%k"
+KERNEL=="hwC[D0-9]*", NAME="snd/%k"
+KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
+KERNEL=="midiC[D0-9]*", NAME="snd/%k"
+KERNEL=="timer", NAME="snd/%k"
+KERNEL=="seq", NAME="snd/%k"
+
+# ieee1394 devices
+KERNEL=="dv1394*", NAME="dv1394/%n"
+KERNEL=="video1394*", NAME="video1394/%n"
+
+# input devices
+KERNEL=="mice", NAME="input/%k"
+KERNEL=="mouse[0-9]*", NAME="input/%k"
+KERNEL=="event[0-9]*", NAME="input/%k"
+KERNEL=="js[0-9]*", NAME="input/%k"
+KERNEL=="ts[0-9]*", NAME="input/%k"
+KERNEL=="uinput", NAME="input/%k"
+
+# Zaptel
+KERNEL=="zapctl", NAME="zap/ctl"
+KERNEL=="zaptimer", NAME="zap/timer"
+KERNEL=="zapchannel", NAME="zap/channel"
+KERNEL=="zappseudo", NAME="zap/pseudo"
+KERNEL=="zap[0-9]*", NAME="zap/%n"
+
+# AOE character devices
+SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k"
+
+# device mapper creates its own device nodes, so ignore these
+KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device"
+KERNEL=="device-mapper", NAME="mapper/control"
+
+KERNEL=="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660"
+
+# Firmware Helper
+ACTION=="add", SUBSYSTEM=="firmware", RUN+="/lib/udev/firmware.sh"
+
+# Samsung UARTS
+KERNEL=="s3c2410_serial[0-9]", NAME="ttySAC%n"
+
+# MXC UARTs
+KERNEL=="ttymxc[0-4]", NAME="ttymxc%n"
+
diff --git a/external/poky/meta/recipes-core/udev/eudev_3.2.7.bb b/external/poky/meta/recipes-core/udev/eudev_3.2.7.bb
new file mode 100644
index 00000000..1bea4ebd
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/eudev_3.2.7.bb
@@ -0,0 +1,96 @@
+SUMMARY = "eudev is a fork of systemd's udev"
+HOMEPAGE = "https://wiki.gentoo.org/wiki/Eudev"
+LICENSE = "GPLv2.0+ & LGPL-2.1+"
+LICENSE_libudev = "LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "glib-2.0 glib-2.0-native gperf-native kmod libxslt-native util-linux"
+
+PROVIDES = "udev"
+
+SRC_URI = "http://dev.gentoo.org/~blueness/${BPN}/${BP}.tar.gz \
+ file://0014-Revert-rules-remove-firmware-loading-rules.patch \
+ file://Revert-udev-remove-userspace-firmware-loading-suppor.patch \
+ file://devfs-udev.rules \
+ file://init \
+ file://links.conf \
+ file://local.rules \
+ file://permissions.rules \
+ file://run.rules \
+ file://udev.rules \
+"
+
+SRC_URI[md5sum] = "c75d99910c1791dd9430d26ab76059c0"
+SRC_URI[sha256sum] = "3004614bd253c1f98558460215027aaf60d7592c70be27fd384ec01db87bf062"
+
+inherit autotools update-rc.d qemu pkgconfig distro_features_check
+
+CONFLICT_DISTRO_FEATURES = "systemd"
+
+EXTRA_OECONF = " \
+ --sbindir=${base_sbindir} \
+ --with-rootlibdir=${base_libdir} \
+ --with-rootlibexecdir=${nonarch_base_libdir}/udev \
+ --with-rootprefix= \
+"
+
+PACKAGECONFIG ??= "hwdb"
+PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
+ sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
+
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
+
+ # Use classic network interface naming scheme
+ touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
+
+ # hid2hci has moved to bluez4. removed in udev as of version 169
+ rm -f ${D}${base_libdir}/udev/hid2hci
+
+ # duplicate udevadm for postinst script
+ install -d ${D}${libexecdir}
+ ln ${D}${bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
+}
+
+do_install_prepend_class-target () {
+ # Remove references to buildmachine
+ sed -i -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
+ ${B}/src/udev/keyboard-keys-from-name.h
+}
+
+INITSCRIPT_NAME = "udev"
+INITSCRIPT_PARAMS = "start 04 S ."
+
+PACKAGES =+ "libudev"
+PACKAGES =+ "eudev-hwdb"
+
+
+FILES_${PN} += "${libexecdir} ${nonarch_base_libdir}/udev ${bindir}/udevadm"
+FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
+ ${includedir}/libudev.h ${libdir}/libudev.so \
+ ${includedir}/udev.h ${libdir}/libudev.la \
+ ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc"
+FILES_libudev = "${base_libdir}/libudev.so.*"
+FILES_eudev-hwdb = "${sysconfdir}/udev/hwdb.d"
+
+RDEPENDS_eudev-hwdb += "eudev"
+
+RPROVIDES_${PN} = "hotplug udev"
+RPROVIDES_eudev-hwdb += "udev-hwdb"
+
+PACKAGE_WRITE_DEPS += "qemu-native"
+pkg_postinst_eudev-hwdb () {
+ if test -n "$D"; then
+ $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
+ else
+ udevadm hwdb --update
+ fi
+}
+
+pkg_prerm_eudev-hwdb () {
+ rm -f $D${sysconfdir}/udev/hwdb.bin
+}
diff --git a/external/poky/meta/recipes-core/udev/udev-extraconf/automount.rules b/external/poky/meta/recipes-core/udev/udev-extraconf/automount.rules
new file mode 100644
index 00000000..62578ea6
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/udev-extraconf/automount.rules
@@ -0,0 +1,19 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Media automounting
+SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
+SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
+SUBSYSTEM=="block", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1" RUN+="/etc/udev/scripts/mount.sh"
diff --git a/external/poky/meta/recipes-core/udev/udev-extraconf/autonet.rules b/external/poky/meta/recipes-core/udev/udev-extraconf/autonet.rules
new file mode 100644
index 00000000..19676aa1
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/udev-extraconf/autonet.rules
@@ -0,0 +1,19 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Handle network interface setup
+SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
+SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
+
diff --git a/external/poky/meta/recipes-core/udev/udev-extraconf/localextra.rules b/external/poky/meta/recipes-core/udev/udev-extraconf/localextra.rules
new file mode 100644
index 00000000..3d51d3e3
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/udev-extraconf/localextra.rules
@@ -0,0 +1,23 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# The first rtc device is symlinked to /dev/rtc
+KERNEL=="rtc0", SYMLINK+="rtc"
+
+#The first framebuffer is symlinked to /dev/fb
+KERNEL=="fb0", SYMLINK+="fb"
+
+# Make all input devices read-write to the input group
+SUBSYSTEM=="input", GROUP="input", MODE="660"
diff --git a/external/poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist b/external/poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist
new file mode 100644
index 00000000..e4934942
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/udev-extraconf/mount.blacklist
@@ -0,0 +1,5 @@
+/dev/loop
+/dev/ram
+/dev/mtdblock
+/dev/md
+/dev/dm-*
diff --git a/external/poky/meta/recipes-core/udev/udev-extraconf/mount.sh b/external/poky/meta/recipes-core/udev/udev-extraconf/mount.sh
new file mode 100644
index 00000000..3ee67b13
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -0,0 +1,151 @@
+#!/bin/sh
+#
+# Called from udev
+#
+# Attempt to mount any added block devices and umount any removed devices
+
+BASE_INIT="`readlink -f "@base_sbindir@/init"`"
+INIT_SYSTEMD="@systemd_unitdir@/systemd"
+
+if [ "x$BASE_INIT" = "x$INIT_SYSTEMD" ];then
+ # systemd as init uses systemd-mount to mount block devices
+ MOUNT="/usr/bin/systemd-mount"
+ UMOUNT="/usr/bin/systemd-umount"
+
+ if [ -x $MOUNT ] && [ -x $UMOUNT ];
+ then
+ logger "Using systemd-mount to finish mount"
+ else
+ logger "Linux init is using systemd, so please install systemd-mount to finish mount"
+ exit 1
+ fi
+else
+ MOUNT="/bin/mount"
+ UMOUNT="/bin/umount"
+fi
+
+PMOUNT="/usr/bin/pmount"
+
+for line in `grep -h -v ^# /etc/udev/mount.blacklist /etc/udev/mount.blacklist.d/*`
+do
+ if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ];
+ then
+ logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
+ exit 0
+ fi
+done
+
+automount_systemd() {
+ name="`basename "$DEVNAME"`"
+
+ # Skip the partition which are already in /etc/fstab
+ grep "^[[:space:]]*$DEVNAME" /etc/fstab && return
+ for n in LABEL PARTLABEL UUID PARTUUID; do
+ tmp="$(lsblk -o $n $DEVNAME | sed -e '1d')"
+ test -z "$tmp" && continue
+ tmp="$n=$tmp"
+ grep "^[[:space:]]*$tmp" /etc/fstab && return
+ done
+
+ [ -d "/run/media/$name" ] || mkdir -p "/run/media/$name"
+
+ MOUNT="$MOUNT -o silent"
+
+ # If filesystemtype is vfat, change the ownership group to 'disk', and
+ # grant it with w/r/x permissions.
+ case $ID_FS_TYPE in
+ vfat|fat)
+ MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`"
+ ;;
+ # TODO
+ *)
+ ;;
+ esac
+
+ if ! $MOUNT --no-block -t auto $DEVNAME "/run/media/$name"
+ then
+ #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/run/media/$name\" failed!"
+ rm_dir "/run/media/$name"
+ else
+ logger "mount.sh/automount" "Auto-mount of [/run/media/$name] successful"
+ touch "/tmp/.automount-$name"
+ fi
+}
+
+automount() {
+ name="`basename "$DEVNAME"`"
+
+ if [ -x "$PMOUNT" ]; then
+ $PMOUNT $DEVNAME 2> /dev/null
+ elif [ -x $MOUNT ]; then
+ $MOUNT $DEVNAME 2> /dev/null
+ fi
+
+ # If the device isn't mounted at this point, it isn't
+ # configured in fstab
+ grep -q "^$DEVNAME " /proc/mounts && return
+
+ ! test -d "/run/media/$name" && mkdir -p "/run/media/$name"
+ # Silent util-linux's version of mounting auto
+ if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ;
+ then
+ MOUNT="$MOUNT -o silent"
+ fi
+
+ # If filesystem type is vfat, change the ownership group to 'disk', and
+ # grant it with w/r/x permissions.
+ case $ID_FS_TYPE in
+ vfat|fat)
+ MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`"
+ ;;
+ # TODO
+ *)
+ ;;
+ esac
+
+ if ! $MOUNT -t auto $DEVNAME "/run/media/$name"
+ then
+ #logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/run/media/$name\" failed!"
+ rm_dir "/run/media/$name"
+ else
+ logger "mount.sh/automount" "Auto-mount of [/run/media/$name] successful"
+ touch "/tmp/.automount-$name"
+ fi
+}
+
+rm_dir() {
+ # We do not want to rm -r populated directories
+ if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1"
+ then
+ ! test -z "$1" && rm -r "$1"
+ else
+ logger "mount.sh/automount" "Not removing non-empty directory [$1]"
+ fi
+}
+
+# No ID_FS_TYPE for cdrom device, yet it should be mounted
+name="`basename "$DEVNAME"`"
+[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
+
+if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
+ # Note the root filesystem can show up as /dev/root in /proc/mounts,
+ # so check the device number too
+ if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then
+ if [ "`basename $MOUNT`" = "systemd-mount" ];then
+ automount_systemd
+ else
+ automount
+ fi
+ fi
+fi
+
+if [ "$ACTION" = "remove" ] || [ "$ACTION" = "change" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
+ for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
+ do
+ $UMOUNT $mnt
+ done
+
+ # Remove empty directories from auto-mounter
+ name="`basename "$DEVNAME"`"
+ test -e "/tmp/.automount-$name" && rm_dir "/run/media/$name"
+fi
diff --git a/external/poky/meta/recipes-core/udev/udev-extraconf/network.sh b/external/poky/meta/recipes-core/udev/udev-extraconf/network.sh
new file mode 100644
index 00000000..3ee92714
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/udev-extraconf/network.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# We get two "add" events for hostap cards due to wifi0
+echo "$INTERFACE" | grep -q wifi && exit 0
+
+# udevd does clearenv(). Export shell PATH to children.
+export PATH
+
+# Check if /etc/init.d/network has been run yet to see if we are
+# called by starting /etc/rcS.d/S03udev and not by hotplugging a device
+#
+# At this stage, network interfaces should not be brought up
+# automatically because:
+# a) /etc/init.d/network has not been run yet (security issue)
+# b) /var has not been populated yet so /etc/resolv,conf points to
+# oblivion, making the network unusable
+#
+
+spoofp="`grep ^spoofprotect /etc/network/options`"
+if test -z "$spoofp"
+then
+ # This is the default from /etc/init.d/network
+ spoofp_val=yes
+else
+ spoofp_val=${spoofp#spoofprotect=}
+fi
+
+test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0
+
+# I think it is safe to assume that "lo" will always be there ;)
+if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val"
+then
+ echo "$INTERFACE" >> /dev/udev_network_queue
+ exit 0
+fi
+
+#
+# Code taken from pcmcia-cs:/etc/pcmcia/network
+#
+
+# if this interface has an entry in /etc/network/interfaces, let ifupdown
+# handle it
+if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then
+ case $ACTION in
+ add)
+ ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE
+ ;;
+ remove)
+ ifdown $INTERFACE
+ ;;
+ esac
+
+ exit 0
+fi
diff --git a/external/poky/meta/recipes-core/udev/udev-extraconf_1.1.bb b/external/poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
new file mode 100644
index 00000000..90f933d9
--- /dev/null
+++ b/external/poky/meta/recipes-core/udev/udev-extraconf_1.1.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Extra machine specific configuration files"
+HOMEPAGE = "https://wiki.gentoo.org/wiki/Eudev"
+DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = " \
+ file://automount.rules \
+ file://mount.sh \
+ file://mount.blacklist \
+ file://autonet.rules \
+ file://network.sh \
+ file://localextra.rules \
+"
+
+S = "${WORKDIR}"
+
+
+do_install() {
+ install -d ${D}${sysconfdir}/udev/rules.d
+
+ install -m 0644 ${WORKDIR}/automount.rules ${D}${sysconfdir}/udev/rules.d/automount.rules
+ install -m 0644 ${WORKDIR}/autonet.rules ${D}${sysconfdir}/udev/rules.d/autonet.rules
+ install -m 0644 ${WORKDIR}/localextra.rules ${D}${sysconfdir}/udev/rules.d/localextra.rules
+
+ install -d ${D}${sysconfdir}/udev/mount.blacklist.d
+ install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/
+
+ install -d ${D}${sysconfdir}/udev/scripts/
+
+ install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
+ sed -i 's|@systemd_unitdir@|${systemd_unitdir}|g' ${D}${sysconfdir}/udev/scripts/mount.sh
+ sed -i 's|@base_sbindir@|${base_sbindir}|g' ${D}${sysconfdir}/udev/scripts/mount.sh
+
+ install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
+}
+
+FILES_${PN} = "${sysconfdir}/udev"
+RDEPENDS_${PN} = "udev"
+CONFFILES_${PN} = "${sysconfdir}/udev/mount.blacklist"
+
+# to replace udev-extra-rules from meta-oe
+RPROVIDES_${PN} = "udev-extra-rules"
+RREPLACES_${PN} = "udev-extra-rules"
+RCONFLICTS_${PN} = "udev-extra-rules"
diff --git a/external/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb b/external/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb
new file mode 100644
index 00000000..baa21aea
--- /dev/null
+++ b/external/poky/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb
@@ -0,0 +1,26 @@
+SUMMARY = "manage symlinks in /etc/rcN.d"
+HOMEPAGE = "http://github.com/philb/update-rc.d/"
+DESCRIPTION = "update-rc.d is a utility that allows the management of symlinks to the initscripts in the /etc/rcN.d directory structure."
+SECTION = "base"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://update-rc.d;beginline=5;endline=15;md5=148a48321b10eb37c1fa3ee02b940a75"
+
+SRC_URI = "git://git.yoctoproject.org/update-rc.d"
+SRCREV = "22e0692898c3e7ceedc8eb5ff4ec8e0b9c340b2d"
+
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${WORKDIR}/git"
+
+inherit allarch
+
+do_compile() {
+}
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 0755 ${S}/update-rc.d ${D}${sbindir}/update-rc.d
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux.inc b/external/poky/meta/recipes-core/util-linux/util-linux.inc
new file mode 100644
index 00000000..a05c1cab
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux.inc
@@ -0,0 +1,357 @@
+SUMMARY = "A suite of basic system administration utilities"
+HOMEPAGE = "http://userweb.kernel.org/~kzak/util-linux/"
+DESCRIPTION = "Util-linux includes a suite of basic system administration utilities \
+commonly found on most Linux systems. Some of the more important utilities include \
+disk partitioning, kernel message management, filesystem creation, and system login."
+
+SECTION = "base"
+
+LICENSE = "GPLv2+ & LGPLv2.1+ & BSD"
+
+LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c \
+ file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://Documentation/licenses/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://Documentation/licenses/COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \
+ file://Documentation/licenses/COPYING.BSD-3;md5=58dcd8452651fc8b07d1f65ce07ca8af \
+ file://Documentation/licenses/COPYING.UCB;md5=263860f8968d8bafa5392cab74285262 \
+ file://libuuid/COPYING;md5=b442ffb762cf8d3e9df1b99e0bb4af70 \
+ file://libmount/COPYING;md5=fb93f01d4361069c5616327705373b16 \
+ file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16"
+
+#gtk-doc is not enabled as it requires xmlto which requires util-linux
+inherit autotools gettext pkgconfig systemd update-alternatives python3-dir bash-completion ptest
+DEPENDS = "zlib ncurses virtual/crypt"
+DEPENDS_append_class-native = " lzo-native"
+DEPENDS_append_class-nativesdk = " lzo-native"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz \
+ "
+
+PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \
+ util-linux-swaponoff util-linux-losetup util-linux-umount \
+ util-linux-mount util-linux-readprofile util-linux-uuidd \
+ util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs util-linux-fsck \
+ util-linux-blkid util-linux-mkfs util-linux-mcookie util-linux-rfkill \
+ util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \
+ util-linux-partx util-linux-hwclock util-linux-mountpoint \
+ util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit \
+ util-linux-ionice util-linux-switch-root util-linux-unshare"
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
+PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}"
+
+PACKAGES_DYNAMIC = "^util-linux-lib.*"
+
+SHARED_EXTRA_OECONF = "--disable-use-tty-group \
+ --disable-makeinstall-chown \
+ --enable-kill --enable-last --enable-mesg --enable-partx \
+ --enable-raw --enable-rfkill --disable-login \
+ --disable-vipw --disable-newgrp --disable-chfn-chsh \
+ --enable-write --enable-mount --enable-unshare \
+ --enable-libuuid --enable-libblkid --enable-fsck \
+ --disable-minix --disable-bfs --without-udev \
+ usrsbin_execdir='${sbindir}' \
+"
+
+EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}"
+
+PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
+
+# Respect the systemd feature for uuidd
+PACKAGECONFIG[systemd] = "--with-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/, --without-systemd --without-systemdsystemunitdir,systemd"
+
+# Build setpriv requires libcap-ng
+PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng,"
+
+# Build python bindings for libmount
+PACKAGECONFIG[pylibmount] = "--with-python=3 --enable-pylibmount,--without-python --disable-pylibmount,python3"
+
+# Readline support
+PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
+
+FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
+
+FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
+
+FILES_util-linux-agetty = "${base_sbindir}/agetty"
+FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}"
+FILES_util-linux-fstrim = "${base_sbindir}/fstrim.${BPN}"
+FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk"
+FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
+FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${base_sbindir}/swapoff.${BPN}"
+FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}"
+FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
+FILES_util-linux-mcookie = "${bindir}/mcookie"
+FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
+FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
+FILES_util-linux-uuidgen = "${bindir}/uuidgen"
+FILES_util-linux-uuidd = "${sbindir}/uuidd"
+FILES_util-linux-rfkill = "${sbindir}/rfkill*"
+FILES_util-linux-partx = "${sbindir}/partx"
+FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
+FILES_util-linux-findfs = "${sbindir}/findfs"
+FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}"
+FILES_util-linux-runuser = "${sbindir}/runuser"
+FILES_util-linux-prlimit = "${bindir}/prlimit"
+FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
+FILES_util-linux-su = "${bindir}/su.util-linux ${sysconfdir}/pam.d/su-l"
+CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
+
+FILES_util-linux-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
+ ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \
+ ${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*"
+FILES_util-linux-lsblk = "${bindir}/lsblk"
+FILES_util-linux-lscpu = "${bindir}/lscpu"
+
+FILES_util-linux-fsck = "${base_sbindir}/fsck*"
+FILES_util-linux-mkfs = "${sbindir}/mkfs"
+
+FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
+FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
+
+FILES_util-linux-sulogin = "${base_sbindir}/sulogin*"
+FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}"
+
+FILES_util-linux-switch-root = "${base_sbindir}/switch_root.${BPN}"
+FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
+
+# Util-linux' blkid replaces the e2fsprogs one
+FILES_util-linux-blkid = "${base_sbindir}/blkid*"
+RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
+RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
+
+RDEPENDS_util-linux-runuser += "libpam"
+RDEPENDS_util-linux-su += "libpam"
+
+RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk"
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}"
+
+RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint util-linux-prlimit util-linux-ionice util-linux-switch-root"
+
+RRECOMMENDS_${PN}_class-native = ""
+RRECOMMENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+
+RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev"
+
+#SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim"
+SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service"
+SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable"
+SYSTEMD_SERVICE_${PN}-fstrim = "fstrim.timer fstrim.service"
+SYSTEMD_AUTO_ENABLE_${PN}-fstrim = "disable"
+
+do_compile () {
+ set -e
+ oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'
+}
+
+do_install () {
+ # with ccache the timestamps on compiled files may
+ # end up earlier than on their inputs, this allows
+ # for the resultant compilation in the install step.
+ oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
+ 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
+ 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install
+
+ mkdir -p ${D}${base_bindir}
+
+ sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
+ sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin"
+ binprogs_a="dmesg getopt kill more umount mount login su mountpoint"
+
+ if [ "${base_sbindir}" != "${sbindir}" ]; then
+ mkdir -p ${D}${base_sbindir}
+ for p in $sbinprogs $sbinprogs_a; do
+ if [ -f "${D}${sbindir}/$p" ]; then
+ mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p"
+ fi
+ done
+ fi
+
+ if [ "${base_bindir}" != "${bindir}" ]; then
+ mkdir -p ${D}${base_bindir}
+ for p in $binprogs_a; do
+ if [ -f "${D}${bindir}/$p" ]; then
+ mv "${D}${bindir}/$p" "${D}${base_bindir}/$p"
+ fi
+ done
+ fi
+
+ install -d ${D}${sysconfdir}/default/
+ echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
+
+ rm -f ${D}${bindir}/chkdupexe
+
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -d ${D}${sysconfdir}/pam.d
+ install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser
+ install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l
+ fi
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
+ # Required for "su -" aka "su --login" because
+ # otherwise it uses "other", which has "auth pam_deny.so"
+ # and thus prevents the operation.
+ ln -s su ${D}${sysconfdir}/pam.d/su-l
+ fi
+}
+
+# nologin causes a conflict with shadow-native
+# kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir})
+do_install_append_class-native () {
+ rm -f ${D}${base_sbindir}/nologin
+ rm -f ${D}${base_bindir}/kill
+}
+
+ALTERNATIVE_PRIORITY = "80"
+
+ALTERNATIVE_${PN} = " \
+ dmesg kill more mkswap blockdev pivot_root \
+ hexdump last lastb logger mesg renice wall \
+ setsid chrt flock utmpdump eject nologin taskset fallocate \
+ fsfreeze nsenter cal rev \
+"
+
+ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
+ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
+ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more"
+ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap"
+ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
+ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
+ALTERNATIVE_LINK_NAME[cal] = "${bindir}/cal"
+ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
+ALTERNATIVE_LINK_NAME[fallocate] = "${bindir}/fallocate"
+ALTERNATIVE_LINK_NAME[rev] = "${bindir}/rev"
+ALTERNATIVE_LINK_NAME[fsfreeze] = "${sbindir}/fsfreeze"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
+
+ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 rfkill.8 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3 eject.1 logger.1"
+
+ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
+ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1"
+ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
+ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
+ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8"
+ALTERNATIVE_LINK_NAME[rfkill.8] = "${mandir}/man8/rfkill.8"
+ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
+ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
+ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3"
+ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8"
+ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8"
+ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
+ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3"
+ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1"
+ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1"
+
+ALTERNATIVE_util-linux-hwclock = "hwclock"
+ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock"
+
+ALTERNATIVE_util-linux-fdisk = "fdisk"
+ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk"
+
+ALTERNATIVE_util-linux-fstrim = "fstrim"
+ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim"
+
+ALTERNATIVE_util-linux-agetty = "getty"
+ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty"
+ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty"
+
+ALTERNATIVE_util-linux-mount = "mount"
+ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount"
+
+ALTERNATIVE_util-linux-umount = "umount"
+ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount"
+
+ALTERNATIVE_util-linux-readprofile = "readprofile"
+ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile"
+
+ALTERNATIVE_util-linux-losetup = "losetup"
+ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup"
+
+ALTERNATIVE_util-linux-swaponoff = "swapoff swapon"
+ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff"
+ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon"
+
+ALTERNATIVE_util-linux-fsck = "fsck"
+ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck"
+
+ALTERNATIVE_util-linux-blkid = "blkid"
+ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid"
+
+ALTERNATIVE_util-linux-rfkill = "rfkill"
+ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill"
+
+ALTERNATIVE_util-linux-getopt = "getopt"
+ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt"
+
+ALTERNATIVE_util-linux-sulogin = "sulogin"
+ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
+
+ALTERNATIVE_util-linux-mountpoint = "mountpoint"
+ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
+
+ALTERNATIVE_util-linux-unshare = "unshare"
+ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
+
+ALTERNATIVE_util-linux-ionice = "ionice"
+ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice"
+
+ALTERNATIVE_util-linux-switch-root = "switch_root"
+ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
+
+BBCLASSEXTEND = "native nativesdk"
+
+python do_package_prepend () {
+ if '--enable-su' in d.getVar('EXTRA_OECONF').split():
+ d.appendVar(d.expand('ALTERNATIVE_${PN}'), ' su')
+ d.appendVar(d.expand('ALTERNATIVE_${PN}-doc'), ' su.1')
+
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', "su", d.expand('${base_bindir}/su'))
+ d.setVarFlag('ALTERNATIVE_LINK_NAME', "su.1", d.expand('${mandir}/man1/su.1'))
+}
+
+python populate_packages_prepend() {
+ do_split_packages(d, '${base_libdir}', '^lib(.*)\.so\..*$',
+ output_pattern='util-linux-lib%s',
+ description='util-linux lib%s',
+ extra_depends='', prepend=True, allow_links=True)
+}
+
+RDEPENDS_${PN}-bash-completion += "util-linux-lsblk"
+RDEPENDS_${PN}-ptest = "bash grep coreutils which util-linux-blkid util-linux-fsck btrfs-tools"
+
+do_compile_ptest() {
+ oe_runmake buildtest-TESTS
+}
+
+do_install_ptest() {
+ mkdir -p ${D}${PTEST_PATH}/tests/ts
+ find . -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
+ find ./.libs -name 'sample*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
+ find ./.libs -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \;
+
+ cp ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/
+ cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected
+ cp -pR ${S}/tests/ts ${D}${PTEST_PATH}/tests/
+ cp ${WORKDIR}/build/config.h ${D}${PTEST_PATH}
+
+ # The original paths of executables to be tested point to a local folder containing
+ # the executables. We want to test the installed executables, not the local copies.
+ # So strip the paths, the executables will be located via "which"
+ sed -i \
+ -e '/^TS_CMD/ s|$top_builddir/||g' \
+ -e '/^TS_HELPER/ s|$top_builddir|${PTEST_PATH}|g' \
+ ${D}${PTEST_PATH}/tests/commands.sh
+
+ # Change 'if [ ! -x "$1" ]' to 'if [ ! -x "`which $1 2>/dev/null`"]'
+ sed -i -e \
+ '/^\tif[[:space:]]\[[[:space:]]![[:space:]]-x[[:space:]]"$1"/s|$1|`which $1 2>/dev/null`|g' \
+ ${D}${PTEST_PATH}/tests/functions.sh
+
+ # "kill -L" behaves differently than "/bin/kill -L" so we need an additional fix
+ sed -i -e \
+ '/^TS_CMD_KILL/ s|kill|/bin/kill|g' \
+ ${D}${PTEST_PATH}/tests/commands.sh
+}
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/external/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
new file mode 100644
index 00000000..748b6ef0
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch
@@ -0,0 +1,20 @@
+Ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+Revert run.sh script accordingly to serialize running tests
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Inappropriate
+
+Index: util-linux-2.32/configure.ac
+===================================================================
+--- util-linux-2.32.orig/configure.ac
++++ util-linux-2.32/configure.ac
+@@ -11,7 +11,7 @@ AC_CONFIG_MACRO_DIR([m4])
+ dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run
+ dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors.
+ AC_USE_SYSTEM_EXTENSIONS
+-AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects])
++AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects serial-tests])
+
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+ [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch b/external/poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch
new file mode 100644
index 00000000..e475289f
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch
@@ -0,0 +1,23 @@
+util-linux: take ${sbindir} from the environment if it is set there
+fix the test, the [ ] syntax was getting eaten by autoconf
+
+Signed-off-by: Phil Blundell <pb@pbcl.net>
+Signed-off-by: Saul Wold <sgw@linux.intel.com
+Upstream-Status: Inappropriate [configuration]
+
+Index: util-linux-2.31/configure.ac
+===================================================================
+--- util-linux-2.31.orig/configure.ac
++++ util-linux-2.31/configure.ac
+@@ -89,7 +89,10 @@ AC_SUBST([runstatedir])
+ usrbin_execdir='${exec_prefix}/bin'
+ AC_SUBST([usrbin_execdir])
+
+-usrsbin_execdir='${exec_prefix}/sbin'
++if test -z "$usrsbin_execdir" ;
++then
++ usrsbin_execdir='${exec_prefix}/sbin'
++fi
+ AC_SUBST([usrsbin_execdir])
+
+ AS_CASE([$libdir],
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch b/external/poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
new file mode 100644
index 00000000..417ca1d9
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/display_testname_for_subtest.patch
@@ -0,0 +1,25 @@
+Display testname for subtest
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+---
+ tests/functions.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/functions.sh b/tests/functions.sh
+index 5246605..b24dc15 100644
+--- a/tests/functions.sh
++++ b/tests/functions.sh
+@@ -320,7 +320,7 @@ function ts_init_subtest {
+
+ if [ "$TS_PARSABLE" != "yes" ]; then
+ [ $TS_NSUBTESTS -eq 1 ] && echo
+- printf "%16s: %-27s ..." "" "$TS_SUBNAME"
++ printf "%13s: %-30s ..." "$TS_COMPONENT" "$TS_SUBNAME"
+ fi
+ }
+
+--
+2.8.3
+
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/ptest.patch b/external/poky/meta/recipes-core/util-linux/util-linux/ptest.patch
new file mode 100644
index 00000000..0537f7d8
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/ptest.patch
@@ -0,0 +1,23 @@
+Define TESTS variable
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+---
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index bbaccb1..7d5a6bb 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -48,6 +48,7 @@ systemdsystemunit_DATA =
+ dist_bashcompletion_DATA =
+ check_PROGRAMS =
+ dist_check_SCRIPTS =
++TESTS = $(check_PROGRAMS)
+
+ PATHFILES =
+
+--
+2.8.3
+
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/run-ptest b/external/poky/meta/recipes-core/util-linux/util-linux/run-ptest
new file mode 100644
index 00000000..fbc2f9b5
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/run-ptest
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+cd tests || exit 1
+
+comps=$(find ts/ -type f -perm -111 -regex ".*/[^\.~]*" | sort)
+
+
+echo
+echo "-------------------- util-linux regression tests --------------------"
+echo
+echo " For development purpose only. "
+echo " Don't execute on production system! "
+echo
+
+res=0
+count=0
+for ts in $comps;
+do
+ $ts | sed '{
+ s/^\(.*\):\(.*\) \.\.\. OK$/PASS: \1:\2/
+ s/^\(.*\):\(.*\) \.\.\. FAILED \(.*\)$/FAIL: \1:\2 \3/
+ s/^\(.*\):\(.*\) \.\.\. SKIPPED \(.*\)$/SKIP: \1:\2 \3/
+ }'
+done
+
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd b/external/poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd
new file mode 100644
index 00000000..4b368ccf
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/runuser-l.pamd
@@ -0,0 +1,3 @@
+auth include runuser
+session optional pam_keyinit.so force revoke
+session include runuser
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/runuser.pamd b/external/poky/meta/recipes-core/util-linux/util-linux/runuser.pamd
new file mode 100644
index 00000000..48d133b9
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/runuser.pamd
@@ -0,0 +1,4 @@
+auth sufficient pam_rootok.so
+session optional pam_keyinit.so revoke
+session required pam_limits.so
+session required pam_unix.so
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch b/external/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
new file mode 100644
index 00000000..68bf22de
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
@@ -0,0 +1,33 @@
+From f220d809be1baa654503bf6ff52f3630b0d7015c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 26 Mar 2014 01:30:29 +0000
+Subject: [PATCH] sun.c: use qsort() to instead of qsort_r()
+
+qsort_r() was added to glibc in version 2.8, so there is no qsort_r() on
+the host like CentOS 5.x.
+
+Upstream-Status: Inappropriate [Other]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libfdisk/src/sun.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+Index: util-linux-2.24.2/libfdisk/src/sun.c
+===================================================================
+--- util-linux-2.24.2.orig/libfdisk/src/sun.c
++++ util-linux-2.24.2/libfdisk/src/sun.c
+@@ -431,10 +431,9 @@ static int sun_verify_disklabel(struct f
+ }
+ verify_sun_starts = starts;
+
+- qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
+- (int (*)(const void *,const void *,void *)) verify_sun_cmp,
+- verify_sun_starts);
+-
++ qsort(array,ARRAY_SIZE(array),sizeof(array[0]),
++ (int (*)(const void *,const void *)) verify_sun_cmp);
++
+ if (array[0] == -1) {
+ fdisk_info(cxt, _("No partitions defined."));
+ return 0;
diff --git a/external/poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb b/external/poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb
new file mode 100644
index 00000000..a616d85b
--- /dev/null
+++ b/external/poky/meta/recipes-core/util-linux/util-linux_2.32.1.bb
@@ -0,0 +1,28 @@
+MAJOR_VERSION = "2.32"
+require util-linux.inc
+
+# To support older hosts, we need to patch and/or revert
+# some upstream changes. Only do this for native packages.
+OLDHOST = ""
+OLDHOST_class-native = "file://util-linux-native-qsort.patch"
+
+SRC_URI += "file://configure-sbindir.patch \
+ file://runuser.pamd \
+ file://runuser-l.pamd \
+ ${OLDHOST} \
+ file://ptest.patch \
+ file://run-ptest \
+ file://display_testname_for_subtest.patch \
+ file://avoid_parallel_tests.patch \
+"
+SRC_URI[md5sum] = "9e5b1b8c1dc99455bdb6b462cf9436d9"
+SRC_URI[sha256sum] = "86e6707a379c7ff5489c218cfaf1e3464b0b95acf7817db0bc5f179e356a67b2"
+
+CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
+
+EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \
+ --disable-use-tty-group \
+"
+EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \
+ --disable-use-tty-group \
+"
diff --git a/external/poky/meta/recipes-core/volatile-binds/files/COPYING.MIT b/external/poky/meta/recipes-core/volatile-binds/files/COPYING.MIT
new file mode 100644
index 00000000..7e7d5741
--- /dev/null
+++ b/external/poky/meta/recipes-core/volatile-binds/files/COPYING.MIT
@@ -0,0 +1,17 @@
+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/external/poky/meta/recipes-core/volatile-binds/files/mount-copybind b/external/poky/meta/recipes-core/volatile-binds/files/mount-copybind
new file mode 100755
index 00000000..fddf5200
--- /dev/null
+++ b/external/poky/meta/recipes-core/volatile-binds/files/mount-copybind
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# Perform a bind mount, copying existing files as we do so to ensure the
+# overlaid path has the necessary content.
+
+if [ $# -lt 2 ]; then
+ echo >&2 "Usage: $0 spec mountpoint [OPTIONS]"
+ exit 1
+fi
+
+# e.g. /var/volatile/lib
+spec=$1
+
+# e.g. /var/lib
+mountpoint=$2
+
+if [ $# -gt 2 ]; then
+ options=$3
+else
+ options=
+fi
+
+[ -n "$options" ] && options=",$options"
+
+mkdir -p "${spec%/*}"
+
+if [ -d "$mountpoint" ]; then
+
+ if [ -d "$spec" ]; then
+ specdir_existed=yes
+ else
+ specdir_existed=no
+ mkdir "$spec"
+ fi
+
+ # Fast version of calculating `dirname ${spec}`/.`basename ${spec}`-work
+ overlay_workdir="${spec%/*}/.${spec##*/}-work"
+ mkdir "${overlay_workdir}"
+
+ # Try to mount using overlay, which is must faster than copying files.
+ # If that fails, fall back to slower copy.
+ if ! mount -t overlay overlay -olowerdir="$mountpoint",upperdir="$spec",workdir="$overlay_workdir" "$mountpoint" > /dev/null 2>&1; then
+
+ if [ "$specdir_existed" != "yes" ]; then
+ cp -pPR "$mountpoint"/. "$spec/"
+ fi
+
+ mount -o "bind$options" "$spec" "$mountpoint"
+ fi
+elif [ -f "$mountpoint" ]; then
+ if [ ! -f "$spec" ]; then
+ cp -pP "$mountpoint" "$spec"
+ fi
+
+ mount -o "bind$options" "$spec" "$mountpoint"
+fi
diff --git a/external/poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in b/external/poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in
new file mode 100644
index 00000000..b23355a7
--- /dev/null
+++ b/external/poky/meta/recipes-core/volatile-binds/files/volatile-binds.service.in
@@ -0,0 +1,19 @@
+[Unit]
+Description=Bind mount volatile @where@
+DefaultDependencies=false
+Before=local-fs.target
+RequiresMountsFor=@whatparent@ @whereparent@
+ConditionPathIsReadWrite=@whatparent@
+ConditionPathExists=@where@
+ConditionPathIsReadWrite=!@where@
+
+[Service]
+Type=oneshot
+RemainAfterExit=Yes
+StandardOutput=syslog
+TimeoutSec=0
+ExecStart=/sbin/mount-copybind @what@ @where@
+ExecStop=/bin/umount @where@
+
+[Install]
+WantedBy=local-fs.target
diff --git a/external/poky/meta/recipes-core/volatile-binds/volatile-binds.bb b/external/poky/meta/recipes-core/volatile-binds/volatile-binds.bb
new file mode 100644
index 00000000..d861a71a
--- /dev/null
+++ b/external/poky/meta/recipes-core/volatile-binds/volatile-binds.bb
@@ -0,0 +1,80 @@
+SUMMARY = "Volatile bind mount setup and configuration for read-only-rootfs"
+DESCRIPTION = "${SUMMARY}"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=5750f3aa4ea2b00c2bf21b2b2a7b714d"
+
+SRC_URI = "\
+ file://mount-copybind \
+ file://COPYING.MIT \
+ file://volatile-binds.service.in \
+"
+
+S = "${WORKDIR}"
+
+inherit allarch systemd distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+VOLATILE_BINDS ?= "\
+ /var/volatile/lib /var/lib\n\
+ /var/volatile/cache /var/cache\n\
+ /var/volatile/spool /var/spool\n\
+ /var/volatile/srv /srv\n\
+"
+VOLATILE_BINDS[type] = "list"
+VOLATILE_BINDS[separator] = "\n"
+
+def volatile_systemd_services(d):
+ services = []
+ for line in oe.data.typed_value("VOLATILE_BINDS", d):
+ if not line:
+ continue
+ what, where = line.split(None, 1)
+ services.append("%s.service" % what[1:].replace("/", "-"))
+ return " ".join(services)
+
+SYSTEMD_SERVICE_${PN} = "${@volatile_systemd_services(d)}"
+
+FILES_${PN} += "${systemd_unitdir}/system/*.service"
+
+do_compile () {
+ while read spec mountpoint; do
+ if [ -z "$spec" ]; then
+ continue
+ fi
+
+ servicefile="${spec#/}"
+ servicefile="$(echo "$servicefile" | tr / -).service"
+ sed -e "s#@what@#$spec#g; s#@where@#$mountpoint#g" \
+ -e "s#@whatparent@#${spec%/*}#g; s#@whereparent@#${mountpoint%/*}#g" \
+ volatile-binds.service.in >$servicefile
+ done <<END
+${@d.getVar('VOLATILE_BINDS').replace("\\n", "\n")}
+END
+
+ if [ -e var-volatile-lib.service ]; then
+ # As the seed is stored under /var/lib, ensure that this service runs
+ # after the volatile /var/lib is mounted.
+ sed -i -e "/^Before=/s/\$/ systemd-random-seed.service/" \
+ -e "/^WantedBy=/s/\$/ systemd-random-seed.service/" \
+ var-volatile-lib.service
+ fi
+}
+do_compile[dirs] = "${WORKDIR}"
+
+do_install () {
+ install -d ${D}${base_sbindir}
+ install -m 0755 mount-copybind ${D}${base_sbindir}/
+
+ install -d ${D}${systemd_unitdir}/system
+ for service in ${SYSTEMD_SERVICE_${PN}}; do
+ install -m 0644 $service ${D}${systemd_unitdir}/system/
+ done
+
+ # Suppress attempts to process some tmpfiles that are not temporary.
+ #
+ install -d ${D}${sysconfdir}/tmpfiles.d ${D}/var/cache
+ ln -s /dev/null ${D}${sysconfdir}/tmpfiles.d/etc.conf
+ ln -s /dev/null ${D}${sysconfdir}/tmpfiles.d/home.conf
+}
+do_install[dirs] = "${WORKDIR}"
diff --git a/external/poky/meta/recipes-core/zlib/site_config/headers b/external/poky/meta/recipes-core/zlib/site_config/headers
new file mode 100644
index 00000000..50268918
--- /dev/null
+++ b/external/poky/meta/recipes-core/zlib/site_config/headers
@@ -0,0 +1 @@
+zlib.h
diff --git a/external/poky/meta/recipes-core/zlib/zlib/ldflags-tests.patch b/external/poky/meta/recipes-core/zlib/zlib/ldflags-tests.patch
new file mode 100644
index 00000000..28639066
--- /dev/null
+++ b/external/poky/meta/recipes-core/zlib/zlib/ldflags-tests.patch
@@ -0,0 +1,45 @@
+Obey LDFLAGS for tests
+
+Upstream-Status: Submitted [https://github.com/madler/zlib/pull/409]
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- zlib-1.2.8.orig/Makefile.in
++++ zlib-1.2.8/Makefile.in
+@@ -26,7 +26,7 @@ CFLAGS=-O
+
+ SFLAGS=-O
+ LDFLAGS=
+-TEST_LDFLAGS=-L. libz.a
++TEST_LDFLAGS=-L. $(LDFLAGS)
+ LDSHARED=$(CC)
+ CPP=$(CC) -E
+
+@@ -176,22 +176,22 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz.
+ -@rmdir objs
+
+ example$(EXE): example.o $(STATICLIB)
+- $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
++ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ minigzip$(EXE): minigzip.o $(STATICLIB)
+- $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
++ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ examplesh$(EXE): example.o $(SHAREDLIBV)
+- $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
++ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(SHAREDLIBV)
+
+ minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
+- $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
++ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(SHAREDLIBV)
+
+ example64$(EXE): example64.o $(STATICLIB)
+- $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
++ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ minigzip64$(EXE): minigzip64.o $(STATICLIB)
+- $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
++ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ install-libs: $(LIBS)
+ -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
diff --git a/external/poky/meta/recipes-core/zlib/zlib/run-ptest b/external/poky/meta/recipes-core/zlib/zlib/run-ptest
new file mode 100644
index 00000000..065863ef
--- /dev/null
+++ b/external/poky/meta/recipes-core/zlib/zlib/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if ./examplesh ; then
+ echo "PASS: zlib"
+else
+ echo "FAIL: zlib"
+fi
diff --git a/external/poky/meta/recipes-core/zlib/zlib_1.2.11.bb b/external/poky/meta/recipes-core/zlib/zlib_1.2.11.bb
new file mode 100644
index 00000000..ef9431ae
--- /dev/null
+++ b/external/poky/meta/recipes-core/zlib/zlib_1.2.11.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Zlib Compression Library"
+DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \
+library which is used by many different programs."
+HOMEPAGE = "http://zlib.net/"
+SECTION = "libs"
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://zlib.h;beginline=6;endline=23;md5=5377232268e952e9ef63bc555f7aa6c0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libpng/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
+ file://ldflags-tests.patch \
+ file://run-ptest \
+ "
+UPSTREAM_CHECK_URI = "http://zlib.net/"
+
+SRC_URI[md5sum] = "85adef240c5f370b308da8c938951a68"
+SRC_URI[sha256sum] = "4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066"
+
+CFLAGS += "-D_REENTRANT"
+
+RDEPENDS_${PN}-ptest += "make"
+
+inherit ptest
+
+do_configure() {
+ LDCONFIG=true ./configure --prefix=${prefix} --shared --libdir=${libdir} --uname=GNU
+}
+
+do_compile() {
+ oe_runmake shared
+}
+
+do_install() {
+ oe_runmake DESTDIR=${D} install
+}
+
+do_install_ptest() {
+ install ${B}/examplesh ${D}${PTEST_PATH}
+}
+
+# Move zlib shared libraries for target builds to $base_libdir so the library
+# can be used in early boot before $prefix is mounted.
+do_install_append_class-target() {
+ if [ ${base_libdir} != ${libdir} ]
+ then
+ mkdir -p ${D}/${base_libdir}
+ mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
+ libname=`readlink ${D}/${libdir}/libz.so`
+ ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname ${D}${libdir}/libz.so
+ fi
+}
+
+BBCLASSEXTEND = "native nativesdk"