Squashed 'yocto-poky/' content from commit ea562de

git-subtree-dir: yocto-poky
git-subtree-split: ea562de57590c966cd5a75fda8defecd397e6436
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
new file mode 100644
index 0000000..6eec2cd
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -0,0 +1,79 @@
+SUMMARY = "Package maintenance system from Debian"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz"
+
+SRC_URI_append_class-native = " file://0001-When-running-do_package_write_deb-we-have-trees-of-h.patch"
+
+DEPENDS = "zlib bzip2 perl ncurses"
+DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
+RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
+RDEPENDS_${PN}_class-native = "xz-native"
+
+inherit autotools gettext perlnative pkgconfig systemd
+
+python () {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        pn = d.getVar('PN', True)
+        d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
+}
+
+export PERL = "${bindir}/perl"
+PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
+
+export PERL_LIBDIR = "${libdir}/perl"
+PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
+
+EXTRA_OECONF = "\
+		--disable-dselect \
+		--enable-start-stop-daemon \
+		--with-zlib \
+		--with-bz2 \
+		--without-liblzma \
+		--without-selinux \
+		"
+
+EXTRA_OECONF_append_class-target = " TAR=tar"
+
+do_configure () {
+    echo >> ${S}/m4/compiler.m4
+    sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
+    autotools_do_configure
+}
+
+do_install_append () {
+	if [ "${PN}" = "dpkg-native" ]; then
+		# update-alternatives doesn't have an offline mode
+		rm ${D}${bindir}/update-alternatives
+		sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
+	else
+		sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
+	fi
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
+		install -d ${D}${systemd_unitdir}/system
+		install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/
+		sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+			-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+			-e 's,@BINDIR@,${bindir},g' \
+			-e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
+			${D}${systemd_unitdir}/system/dpkg-configure.service
+	fi
+}
+
+PROV = "virtual/update-alternatives"
+PROV_class-native = ""
+
+PROVIDES += "${PROV}"
+
+PACKAGES =+ "update-alternatives-dpkg"
+FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
+RPROVIDES_update-alternatives-dpkg += "update-alternatives"
+
+PACKAGES += "${PN}-perl"
+FILES_${PN}-perl = "${libdir}/perl"
+
+BBCLASSEXTEND = "native"
+
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch b/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch
new file mode 100644
index 0000000..6967ef4
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch
@@ -0,0 +1,63 @@
+From d14ffd786993da60ca84c4812da8a6594a8c764e Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 15:48:13 +0300
+Subject: [PATCH 1/5] When running do_package_write_deb, we have trees of
+ hardlinked files such as the dbg source files in ${PN}-dbg. If something
+ makes another copy of one of those files (or deletes one), the number of
+ links a file has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package `sed-ptest' in `/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'.
+| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).
+
+Upstream-Status: Inappropriate
+RP 2015/3/27
+---
+ dpkg-deb/build.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
+index ea3d861..1589927 100644
+--- a/dpkg-deb/build.c
++++ b/dpkg-deb/build.c
+@@ -458,7 +458,7 @@ do_build(const char *const *argv)
+   char *debar;
+   char *tfbuf;
+   int arfd;
+-  int p1[2], p2[2], gzfd;
++  int p1[2], p2[2], gzfd, rc;
+   pid_t c1, c2;
+ 
+   /* Decode our arguments. */
+@@ -538,7 +538,9 @@ do_build(const char *const *argv)
+   }
+   close(p1[0]);
+   subproc_reap(c2, _("<compress> from tar -cf"), 0);
+-  subproc_reap(c1, "tar -cf", 0);
++  rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
++  if (rc && rc != 1)
++    ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
+ 
+   if (lseek(gzfd, 0, SEEK_SET))
+     ohshite(_("failed to rewind temporary file (%s)"), _("control member"));
+@@ -626,7 +628,10 @@ do_build(const char *const *argv)
+   /* All done, clean up wait for tar and <compress> to finish their job. */
+   close(p1[1]);
+   subproc_reap(c2, _("<compress> from tar -cf"), 0);
+-  subproc_reap(c1, "tar -cf", 0);
++  rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
++  if (rc && rc != 1)
++    ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
++
+   /* Okay, we have data.tar as well now, add it to the ar wrapper. */
+   if (deb_format.major == 2) {
+     char datamember[16 + 1];
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch b/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch
new file mode 100644
index 0000000..231a6a2
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch
@@ -0,0 +1,38 @@
+From b4ea54158c399874e12394ebc91afe98954695e2 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:16:16 +0300
+Subject: [PATCH 2/5] Adapt to linux-wrs kernel version, which has character
+ '_' inside. Remove the first-char-digit-check (as the 1.15.8.5 version does).
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ lib/dpkg/parsehelp.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c
+index 79b2908..7758aa5 100644
+--- a/lib/dpkg/parsehelp.c
++++ b/lib/dpkg/parsehelp.c
+@@ -235,14 +235,12 @@ parseversion(struct dpkg_version *rversion, const char *string,
+ 
+   /* XXX: Would be faster to use something like cisversion and cisrevision. */
+   ptr = rversion->version;
+-  if (*ptr && !c_isdigit(*ptr++))
+-    return dpkg_put_warn(err, _("version number does not start with digit"));
+   for (; *ptr; ptr++) {
+-    if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:", *ptr) == NULL)
++    if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:_", *ptr) == NULL)
+       return dpkg_put_warn(err, _("invalid character in version number"));
+   }
+   for (ptr = rversion->revision; *ptr; ptr++) {
+-    if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".+~", *ptr) == NULL)
++    if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~_", *ptr) == NULL)
+       return dpkg_put_warn(err, _("invalid character in revision number"));
+   }
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
new file mode 100644
index 0000000..9f77c6c
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
@@ -0,0 +1,60 @@
+From 24229971492515b64c81e8c6392e5dfbdc22b44c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:25:45 +0300
+Subject: [PATCH 3/5] Our pre/postinsts expect $D to be set when running in a
+ sysroot and don't expect a chroot. This matches up our system expectations
+ with what dpkg does.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2011/12/07
+---
+ src/script.c | 31 ++-----------------------------
+ 1 file changed, 2 insertions(+), 29 deletions(-)
+
+diff --git a/src/script.c b/src/script.c
+index a958145..24c49f9 100644
+--- a/src/script.c
++++ b/src/script.c
+@@ -100,36 +100,9 @@ maintscript_pre_exec(struct command *cmd)
+ 	size_t instdirl = strlen(instdir);
+ 
+ 	if (*instdir) {
+-		if (strncmp(admindir, instdir, instdirl) != 0)
+-			ohshit(_("admindir must be inside instdir for dpkg to work properly"));
+-		if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0)
+-			ohshite(_("unable to setenv for subprocesses"));
+-
+-		if (chroot(instdir))
+-			ohshite(_("failed to chroot to '%.250s'"), instdir);
+-	}
+-	/* Switch to a known good directory to give the maintainer script
+-	 * a saner environment, also needed after the chroot(). */
+-	if (chdir("/"))
+-		ohshite(_("failed to chdir to '%.255s'"), "/");
+-	if (debug_has_flag(dbg_scripts)) {
+-		struct varbuf args = VARBUF_INIT;
+-		const char **argv = cmd->argv;
+-
+-		while (*++argv) {
+-			varbuf_add_char(&args, ' ');
+-			varbuf_add_str(&args, *argv);
+-		}
+-		varbuf_end_str(&args);
+-		debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename,
+-		      args.buf);
+-		varbuf_destroy(&args);
++		setenv("D", instdir, 1);
+ 	}
+-	if (!instdirl)
+-		return cmd->filename;
+-
+-	assert(strlen(cmd->filename) >= instdirl);
+-	return cmd->filename + instdirl;
++	return cmd->filename;
+ }
+ 
+ /**
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch b/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch
new file mode 100644
index 0000000..56c85c7
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch
@@ -0,0 +1,31 @@
+From adb6bfd0feeceaf030df0debe3343d7f73e708a0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:27:45 +0300
+Subject: [PATCH 4/5] The lutimes function doesn't work properly for all
+ systems.
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ src/archives.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/archives.c b/src/archives.c
+index bff5f14..b711013 100644
+--- a/src/archives.c
++++ b/src/archives.c
+@@ -449,8 +449,9 @@ tarobject_set_mtime(struct tar_entry *te, const char *path)
+ 
+   if (te->type == TAR_FILETYPE_SYMLINK) {
+ #ifdef HAVE_LUTIMES
+-    if (lutimes(path, tv) && errno != ENOSYS)
++/*    if (lutimes(path, tv) && errno != ENOSYS)
+       ohshite(_("error setting timestamps of '%.255s'"), path);
++*/
+ #endif
+   } else {
+     if (utimes(path, tv))
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch b/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch
new file mode 100644
index 0000000..96e96f2
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch
@@ -0,0 +1,36 @@
+From 0ad7bba80d5b9035089ff2b2f77a774b5b201915 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:28:59 +0300
+Subject: [PATCH 5/5] dpkg-compiler.m4: remove -Wvla
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Remove the -Wvla flag from the set of compiler warning flags, since gcc
+on old host systems such as CentOS 5.8 doesn't support it, and it
+causes a build error for dpkg-native.
+
+Upstream-Status: Pending
+
+Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ m4/dpkg-compiler.m4 | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4
+index 682857c..23ed7d0 100644
+--- a/m4/dpkg-compiler.m4
++++ b/m4/dpkg-compiler.m4
+@@ -52,7 +52,6 @@ AC_DEFUN([DPKG_CHECK_COMPILER_WARNINGS], [
+   DPKG_CHECK_COMPILER_FLAG([-Wlogical-op])
+   DPKG_CHECK_COMPILER_FLAG([-Wlogical-not-parentheses])
+   DPKG_CHECK_COMPILER_FLAG([-Wswitch-bool])
+-  DPKG_CHECK_COMPILER_FLAG([-Wvla])
+   DPKG_CHECK_COMPILER_FLAG([-Winit-self])
+   DPKG_CHECK_COMPILER_FLAG([-Wwrite-strings])
+   DPKG_CHECK_COMPILER_FLAG([-Wcast-align])
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch b/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
new file mode 100644
index 0000000..af275de
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
@@ -0,0 +1,38 @@
+Author: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+Date:   Wed Apr 8 18:08:14 2015 +0530
+
+[PATCH] add armeb triplet entry into triplettable.
+
+Cross-compling dpkg application for armeb fails with below error
+during configure task,
+
+(snip)
+ configure:23141: checking dpkg cpu type
+ configure:23148: result: armeb
+ configure:23150: WARNING: armeb not found in cputable
+ configure:23162: checking dpkg operating system type
+ configure:23169: result: linux-gnueabi
+ configure:23171: WARNING: linux-gnueabi not found in ostable
+ configure:23183: checking dpkg architecture name
+ configure:23189: error: cannot determine host dpkg architecture
+-- CUT --
+
+the required combination of "gnueabi-linux-armeb" was not found in
+the triplettable file thereby returning dpkg_arch as
+empty in configure script.
+
+Upstream-Status: Pending
+
+Signed-off-by: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+
+diff -Naurp dpkg-1.17.21_org/triplettable dpkg-1.17.21/triplettable
+--- dpkg-1.17.21_org/triplettable	2015-04-08 17:08:52.370759171 +0530
++++ dpkg-1.17.21/triplettable	2015-04-08 17:09:12.406752081 +0530
+@@ -9,6 +9,7 @@ musleabihf-linux-arm	musl-linux-armhf
+ musl-linux-<cpu>	musl-linux-<cpu>
+ gnueabihf-linux-arm	armhf
+ gnueabi-linux-arm	armel
++gnueabi-linux-armeb	armeb
+ gnuabin32-linux-mips64el	mipsn32el
+ gnuabin32-linux-mips64	mipsn32
+ gnuabi64-linux-mips64el	mips64el
diff --git a/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch b/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
new file mode 100644
index 0000000..cad4c0f
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
@@ -0,0 +1,22 @@
+configure cannot determine the proper cpu, os, or
+architecture for mips64, and possibly other arch's
+because of faulty code added to Arch.pm in the latest
+release from upstream.  We remove that code.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+
+--- a/scripts/Dpkg/Arch.pm
++++ b/scripts/Dpkg/Arch.pm
+@@ -233,9 +233,6 @@ sub read_triplettable()
+ 		    (my $dt = $debtriplet) =~ s/<cpu>/$_cpu/;
+ 		    (my $da = $debarch) =~ s/<cpu>/$_cpu/;
+ 
+-		    next if exists $debarch_to_debtriplet{$da}
+-		         or exists $debtriplet_to_debarch{$dt};
+-
+ 		    $debarch_to_debtriplet{$da} = $dt;
+ 		    $debtriplet_to_debarch{$dt} = $da;
+ 		}
diff --git a/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service b/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service
new file mode 100644
index 0000000..f0b0789
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=dpkg first boot configure
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-@SYSCONFDIR@/default/postinst
+ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/dpkg --configure -a > $LOGFILE 2>&1; else @BINDIR@/dpkg --configure -a; fi"
+ExecStartPost=@BASE_BINDIR@/systemctl disable dpkg-configure.service
+StandardOutput=syslog
+RemainAfterExit=No
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target
diff --git a/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch b/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
new file mode 100644
index 0000000..e73311c
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
@@ -0,0 +1,40 @@
+Upstream-Status: Pending
+
+dpkg defines:
+#define DPKG_BEGIN_DECLS	extern "C" {
+
+That makes header cstdlib included in a extern "C" block which is not supported
+by gcc 4.8. It fails on Fedora 19:
+
+/usr/include/c++/4.8.1/cstdlib: In function ‘long long int std::abs(long long int)’:
+/usr/include/c++/4.8.1/cstdlib:174:20: error: declaration of C function ‘long long int std::abs(long long int)’ conflicts with
+   abs(long long __x) { return __builtin_llabs (__x); }
+                    ^
+/usr/include/c++/4.8.1/cstdlib:166:3: error: previous declaration ‘long int std::abs(long int)’ here
+   abs(long __i) { return __builtin_labs(__i); }
+   ^
+
+Move include gettext.h out of the extern "C" block to fix this issue.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+--- dpkg-1.17.1/lib/dpkg/i18n.h.orig	2013-08-13 17:31:28.870935573 +0800
++++ dpkg-1.17.1/lib/dpkg/i18n.h	2013-08-13 17:31:37.893065249 +0800
+@@ -23,8 +23,6 @@
+ 
+ #include <dpkg/macros.h>
+ 
+-DPKG_BEGIN_DECLS
+-
+ /**
+  * @defgroup i18n Internationalization support
+  * @ingroup dpkg-internal
+@@ -33,6 +31,8 @@
+ 
+ #include <gettext.h>
+ 
++DPKG_BEGIN_DECLS
++
+ /* We need to include this because pgettext() uses LC_MESSAGES, but libintl.h
+  * which gets pulled by gettext.h only includes it if building optimized. */
+ #include <locale.h>
diff --git a/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch b/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
new file mode 100644
index 0000000..d56b8a6
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
@@ -0,0 +1,86 @@
+CentOS 5.8 kernels and headers support the sync_file_range() system call,
+but glibc 2.5 doesn't provide the syscall stub.  It appears that this
+problem is known but will never be fixed:
+
+  https://bugzilla.redhat.com/show_bug.cgi?id=518581
+
+  Bug 518581 - [RHEL5] glibc misses sync_file_range syscall interface 
+
+  Status:       CLOSED CANTFIX 
+  Last Closed:  2009-11-22 22:19:55
+
+  Kirby Zhou 2009-08-20 23:37:55 EDT
+
+  Description of problem:
+
+  glibc misses sync_file_range syscall interface.  The header file and
+  man page both say 'sync_file_range' should exist.  From man page,
+  sync_file_range should exist sinc kernel-2.6.17
+
+  Andreas Schwab 2009-08-21 03:24:24 EDT
+
+  It has only been added to glibc 2.6, and cannot be backported due to
+  ABI breakage.  You can always fall back to syscall(3).
+
+  Ulrich Drepper 2009-11-22 22:19:55 EST
+
+  As comment #1 says, no chance to backport this.
+
+  See the syscall man page for instructions.
+
+  Jon E 2010-03-19 10:32:37 EDT
+
+  then why document it if it's broken and you're not going to fix it?
+  .. might want to FTFM over at sync_file_range(2) - in the meantime -
+  borrowing from glibc 2.6 .. any thoughts on this implementation for a
+  hacky workaround for those still on your "ancient releases" .. (eg:
+  RHEL5.3)?:
+
+  #ifdef ULI_WONT_FIX_THIS_IN_GLIBC2.5
+  #define NR_sync_file_range 277
+  int sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+  {
+    return syscall (NR_sync_file_range, fd,
+                           __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+                           __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+                           flags);
+  }
+  #endif
+
+  assuming of course that you're on an x86_64 and include/asm-
+  x86_64/unistd.h has the correct entry
+
+  (fwiw - fio is starting to use this now)
+
+Rather than attempting to provide an implementation using syscall(),
+we take the more conservative route and ignore header support for
+sync_file_range() flags when the glibc version is <= 2.5.
+
+Upstream-Status: Inappropriate [everyone else builds on newer hosts :-)]
+
+Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
+Signed-off-by: Lei Liu <lei.liu2@windriver.com>
+---
+ src/archives.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/src/archives.c
++++ b/src/archives.c
+@@ -75,7 +75,7 @@
+   /* Ignore the return code as it should be considered equivalent to an
+    * asynchronous hint for the kernel, we are doing an fsync() later on
+    * anyway. */
+-#if defined(SYNC_FILE_RANGE_WRITE)
++#if defined(SYNC_FILE_RANGE_WRITE) && __GLIBC_PREREQ(2, 6)
+   sync_file_range(fd, 0, 0, SYNC_FILE_RANGE_WRITE);
+ #elif defined(HAVE_POSIX_FADVISE)
+   posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
+@@ -1179,7 +1179,7 @@
+   return 0;
+ }
+ 
+-#if defined(SYNC_FILE_RANGE_WAIT_BEFORE)
++#if defined(SYNC_FILE_RANGE_WAIT_BEFORE) && __GLIBC_PREREQ(2, 6)
+ static void
+ tar_writeback_barrier(struct fileinlist *files, struct pkginfo *pkg)
+ {
diff --git a/meta/recipes-devtools/dpkg/dpkg/noman.patch b/meta/recipes-devtools/dpkg/dpkg/noman.patch
new file mode 100644
index 0000000..d30c150
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/noman.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [disable feature]
+
+diff -ruN dpkg-1.15.8.5-orig/Makefile.am dpkg-1.15.8.5/Makefile.am
+--- dpkg-1.15.8.5-orig/Makefile.am	2010-10-08 12:27:15.042083703 +0800
++++ dpkg-1.15.8.5/Makefile.am	2010-10-08 12:27:27.755148228 +0800
+@@ -12,8 +12,7 @@
+ 	utils \
+ 	$(MAYBE_DSELECT) \
+ 	scripts \
+-	po \
+-	man
++	po
+ 
+ ACLOCAL_AMFLAGS = -I m4
diff --git a/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch b/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
new file mode 100644
index 0000000..4f408ff
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
@@ -0,0 +1,17 @@
+busybox-1.19.4 tar utility doesn't support --warning=no-timestamp
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+Index: dpkg-1.17.1/dpkg-deb/extract.c
+===================================================================
+--- dpkg-1.17.1.orig/dpkg-deb/extract.c
++++ dpkg-1.17.1/dpkg-deb/extract.c
+@@ -318,7 +318,6 @@ extracthalf(const char *debar, const cha
+ 
+       command_add_arg(&cmd, "-f");
+       command_add_arg(&cmd, "-");
+-      command_add_arg(&cmd, "--warning=no-timestamp");
+ 
+       m_dup2(p2[0],0);
+       close(p2[0]);
diff --git a/meta/recipes-devtools/dpkg/dpkg_1.18.2.bb b/meta/recipes-devtools/dpkg/dpkg_1.18.2.bb
new file mode 100644
index 0000000..4c3fa4f
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg_1.18.2.bb
@@ -0,0 +1,19 @@
+require dpkg.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI += "file://noman.patch \
+            file://remove-tar-no-timestamp.patch \
+            file://fix-abs-redefine.patch \
+            file://arch_pm.patch \
+            file://dpkg-configure.service \
+            file://glibc2.5-sync_file_range.patch \
+            file://add_armeb_triplet_entry.patch \
+	    file://0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch \
+	    file://0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch \
+	    file://0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch \
+	    file://0005-dpkg-compiler.m4-remove-Wvla.patch \
+           "
+
+SRC_URI[md5sum] = "63b9d869081ec49adeef6c5ff62d6576"
+SRC_URI[sha256sum] = "11484f2a73d027d696e720a60380db71978bb5c06cd88fe30c291e069ac457a4"
+