summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/recipes-devtools/opkg-utils
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/meta/recipes-devtools/opkg-utils')
-rw-r--r--external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch51
-rw-r--r--external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch112
-rw-r--r--external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-make-index-use-ctime-instead-of-mtime.patch59
-rw-r--r--external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-Fix-link-relocation-support.patch40
-rw-r--r--external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch44
-rw-r--r--external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/pigz.patch51
-rw-r--r--external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch48
-rw-r--r--external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch18
-rw-r--r--external/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb70
9 files changed, 493 insertions, 0 deletions
diff --git a/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch
new file mode 100644
index 00000000..6b7ca7da
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch
@@ -0,0 +1,51 @@
+From ef5db062b7d25e6070acc6922ea48f50491313b5 Mon Sep 17 00:00:00 2001
+From: Michael Hansen <michael.j.hansen@hp.com>
+Date: Mon, 26 Feb 2018 09:42:56 -0800
+Subject: [PATCH 1/2] Only use --sort=name on versions of tar which support it.
+ This fixes compatibility with bsdtar and old versions of GNU tar (e.g.
+ RHEL6).
+
+Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Upstream-Status: Backport
+
+---
+ opkg-build | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+Index: opkg-utils-0.3.6/opkg-build
+===================================================================
+--- opkg-utils-0.3.6.orig/opkg-build
++++ opkg-utils-0.3.6/opkg-build
+@@ -232,6 +232,11 @@ if [ $compressor = "gzip" ] ; then
+ compressorargs=$zipargs
+ fi
+
++tsortargs=
++if tar --help 2>&1 | grep -- "--sort=" > /dev/null; then
++ tsortargs="--sort=name"
++fi
++
+ shift $(($OPTIND - 1))
+
+ # continue on to process additional arguments
+@@ -280,8 +285,8 @@ mkdir $tmp_dir
+ build_date="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
+
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs --sort=name --mtime=$build_date -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
+-( cd $pkg_dir/$CONTROL && tar $ogargs --sort=name --mtime=$build_date -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
++( cd $pkg_dir && tar $ogargs $tsortargs --mtime=$build_date -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
++( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime=$build_date -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
+ rm $tmp_dir/tarX
+
+ echo "2.0" > $tmp_dir/debian-binary
+@@ -296,7 +301,7 @@ rm -f $pkg_file
+ if [ "$outer" = "ar" ] ; then
+ ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
+ else
+- ( cd $tmp_dir && tar -c --sort=name --mtime=$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
++ ( cd $tmp_dir && tar -c $tsortargs --mtime=$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
+ fi
+
+ rm $tmp_dir/debian-binary $tmp_dir/data.tar.$cext $tmp_dir/control.tar.gz
diff --git a/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch
new file mode 100644
index 00000000..c36ae2ff
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch
@@ -0,0 +1,112 @@
+From d42b23f4fb5d6bd58e92e995fe5befc76efbae0c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 27 Apr 2017 15:47:58 +0300
+Subject: [PATCH] Switch all scripts to use Python 3.x
+
+Upstream-Status: Pending
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ makePackage | 2 +-
+ opkg-compare-indexes | 2 +-
+ opkg-graph-deps | 2 +-
+ opkg-list-fields | 2 +-
+ opkg-make-index | 2 +-
+ opkg-show-deps | 2 +-
+ opkg-unbuild | 2 +-
+ opkg-update-index | 2 +-
+ opkg.py | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/makePackage b/makePackage
+index 4bdfc56..02124dd 100755
+--- a/makePackage
++++ b/makePackage
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/env python3
+
+ # The general algorithm this program follows goes like this:
+ # Run tar to extract control from control.tar.gz from the package.
+diff --git a/opkg-compare-indexes b/opkg-compare-indexes
+index b60d20a..80c1263 100755
+--- a/opkg-compare-indexes
++++ b/opkg-compare-indexes
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-graph-deps b/opkg-graph-deps
+index 6653fd5..f1e376a 100755
+--- a/opkg-graph-deps
++++ b/opkg-graph-deps
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-list-fields b/opkg-list-fields
+index c14a90f..24f7955 100755
+--- a/opkg-list-fields
++++ b/opkg-list-fields
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-make-index b/opkg-make-index
+index 3f757f6..2988f9f 100755
+--- a/opkg-make-index
++++ b/opkg-make-index
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-show-deps b/opkg-show-deps
+index 153f21e..4e18b4f 100755
+--- a/opkg-show-deps
++++ b/opkg-show-deps
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-unbuild b/opkg-unbuild
+index 4f36bec..57642c9 100755
+--- a/opkg-unbuild
++++ b/opkg-unbuild
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+ from __future__ import print_function
+
+diff --git a/opkg-update-index b/opkg-update-index
+index 341c1c2..7bff8a1 100755
+--- a/opkg-update-index
++++ b/opkg-update-index
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ from __future__ import absolute_import
+
+ import sys, os
+diff --git a/opkg.py b/opkg.py
+index 2ecac8a..7e64de4 100644
+--- a/opkg.py
++++ b/opkg.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ # Copyright (C) 2001 Alexander S. Guy <a7r@andern.org>
+ # Andern Research Labs
+ #
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-make-index-use-ctime-instead-of-mtime.patch b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-make-index-use-ctime-instead-of-mtime.patch
new file mode 100644
index 00000000..19778acd
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-make-index-use-ctime-instead-of-mtime.patch
@@ -0,0 +1,59 @@
+From 0cd38bb1bdcdbfc091014a1f39d015a1586a33e6 Mon Sep 17 00:00:00 2001
+From: Stefan Agner <stefan.agner@toradex.com>
+Date: Fri, 19 Oct 2018 17:38:21 +0200
+Subject: [PATCH] opkg-make-index: use ctime instead of mtime
+
+Upstream-Status: Backport
+
+When using sstate, two parallel builds can produce two packages
+with the same mtime but different checksums. When later one of
+those two builds fetches the others ipk, the package index does
+not get udpated properly (since mtime matches). This ends up with
+messages such as:
+ Downloading file:/../tmp/work/../image/...ipk.
+ Removing corrupt package file /../sysroot/../var/cache/opkg/volatile/...ipk
+
+However, in that case, ctime is different. Use ctime instead of
+mtime to prevent failures like this.
+
+Suggested-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
+Acked-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Acked-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Signed-off-by: Ming Liu <liu.ming50@gmail.com>
+---
+ opkg-make-index | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/opkg-make-index b/opkg-make-index
+index 3227fc0..db7bf64 100755
+--- a/opkg-make-index
++++ b/opkg-make-index
+@@ -115,12 +115,12 @@ for abspath in files:
+ pkg = None
+ fnameStat = os.stat(abspath)
+ if filename in old_pkg_hash:
+- if filename in pkgsStamps and int(fnameStat.st_mtime) == pkgsStamps[filename]:
++ if filename in pkgsStamps and int(fnameStat.st_ctime) == pkgsStamps[filename]:
+ if (verbose):
+ sys.stderr.write("Found %s in Packages\n" % (filename,))
+ pkg = old_pkg_hash[filename]
+ else:
+- sys.stderr.write("Found %s in Packages, but mtime differs - re-reading\n" % (filename,))
++ sys.stderr.write("Found %s in Packages, but ctime differs - re-reading\n" % (filename,))
+
+ if not pkg:
+ if (verbose):
+@@ -137,7 +137,7 @@ for abspath in files:
+ else:
+ old_filename = ""
+ s = packages.add_package(pkg, opt_a)
+- pkgsStamps[filename] = fnameStat.st_mtime
++ pkgsStamps[filename] = fnameStat.st_ctime
+ if s == 0:
+ if old_filename:
+ # old package was displaced by newer
+--
+2.7.4
+
diff --git a/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-Fix-link-relocation-support.patch b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-Fix-link-relocation-support.patch
new file mode 100644
index 00000000..9dc488b7
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-Fix-link-relocation-support.patch
@@ -0,0 +1,40 @@
+From 18562ccae6996431d37767653b061d4e9e1b9424 Mon Sep 17 00:00:00 2001
+From: Niko Mauno <niko.mauno@iki.fi>
+Date: Sun, 11 Nov 2018 15:50:22 +0200
+Subject: [opkg-utils PATCH] update-alternatives: Fix link relocation support
+
+Commit fcb26339000021eb9bb711aa264247aebcfdd4ae which added Debian-style
+support for link relocation tries to relocate symbolic link on host OS,
+resulting in following-like error when two alternative packages have
+symbolic link source located in different directories (/bin/rev ->
+/bin/busybox.nosuid and /usr/bin/rev -> /usr/bin/rev.util-linux):
+
+ update-alternatives: renaming rev link from /bin/rev to /usr/bin/rev
+ mv: cannot stat '/bin/rev': No such file or directory
+
+Fix the issue by prefixing 'olink' and 'link' variable references with
+path to targeted root filesystem's root directory.
+
+Upstream-Status: Submitted [opkg-utils]
+
+Signed-off-by: Niko Mauno <niko.mauno@iki.fi>
+---
+ update-alternatives | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/update-alternatives b/update-alternatives
+index 89a440b..d4fa7eb 100644
+--- a/update-alternatives
++++ b/update-alternatives
+@@ -58,7 +58,7 @@ register_alt() {
+ local link_str=`echo $link | protect_slashes`
+ sed -e "1s/.*/$link_str/" $ad/$name > $ad/$name.new
+ mv $ad/$name.new $ad/$name
+- mv $olink $link
++ mv $OPKG_OFFLINE_ROOT$olink $OPKG_OFFLINE_ROOT$link
+ fi
+ else
+ echo "$link" > "$ad/$name"
+--
+2.19.1
+
diff --git a/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch
new file mode 100644
index 00000000..e338914b
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch
@@ -0,0 +1,44 @@
+From 5727826b51cf99feaff3483a9df8af2043e7efc1 Mon Sep 17 00:00:00 2001
+From: Michael Hansen <michael.j.hansen@hp.com>
+Date: Mon, 26 Feb 2018 10:17:01 -0800
+Subject: [PATCH 2/2] opkg-build: Use local time for build_date, since opkg
+ extracts files assuming local time rather than UTC. Also increase resolution
+ of build date down to the second, rather than clamping to midnight of the
+ current date.
+
+Signed-off-by: Michael Hansen <michael.j.hansen@hp.com>
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Upstream-Status: Backport
+
+---
+ opkg-build | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+Index: opkg-utils-0.3.6/opkg-build
+===================================================================
+--- opkg-utils-0.3.6.orig/opkg-build
++++ opkg-utils-0.3.6/opkg-build
+@@ -282,11 +282,11 @@ fi
+ tmp_dir=$dest_dir/IPKG_BUILD.$$
+ mkdir $tmp_dir
+
+-build_date="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
++build_date="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" "+%Y-%m-%d %H:%M:%S")"
+
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs $tsortargs --mtime=$build_date -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
+-( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime=$build_date -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
++( cd $pkg_dir && tar $ogargs $tsortargs --mtime="$build_date" -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
++( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime="$build_date" -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
+ rm $tmp_dir/tarX
+
+ echo "2.0" > $tmp_dir/debian-binary
+@@ -301,7 +301,7 @@ rm -f $pkg_file
+ if [ "$outer" = "ar" ] ; then
+ ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./control.tar.gz ./data.tar.$cext )
+ else
+- ( cd $tmp_dir && tar -c $tsortargs --mtime=$build_date $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
++ ( cd $tmp_dir && tar -c $tsortargs --mtime="$build_date" $tarformat ./debian-binary ./control.tar.gz ./data.tar.$cext | gzip $zipargs > $pkg_file )
+ fi
+
+ rm $tmp_dir/debian-binary $tmp_dir/data.tar.$cext $tmp_dir/control.tar.gz
diff --git a/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/pigz.patch b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/pigz.patch
new file mode 100644
index 00000000..dd433e8e
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/pigz.patch
@@ -0,0 +1,51 @@
+From ab1436927b47badcd219a5f075dfc848020e061d Mon Sep 17 00:00:00 2001
+From: Mike Crowe <mac@mcrowe.com>
+Date: Thu, 4 Oct 2018 17:54:19 +0100
+Subject: [opkg-utils PATCH] opkg-build: Add support for explicit use of pigz
+To: opkg-devel@googlegroups.com,
+ yocto@yoctoproject.org
+
+oe-core has stopped[1] installing pigz as gzip. This means that in
+order to persuade opkg-build to use pigz it must be specified
+explicitly. Let's teach opkg-build to deal with being passed pigz as a
+compressor.
+
+We can't combine the check for whether -T is required with the one for
+gzip because opkg-build needs to call $compressor and gzip separately
+to construct the package.
+
+[1] http://lists.openembedded.org/pipermail/openembedded-commits/2018-February/218767.html
+
+Upstream-Status: Submitted [opkg-devel@googlegroups.com https://groups.google.com/forum/#!topic/opkg-devel/E0WVOhjK61w]
+Signed-off-by: Mike Crowe <mac@mcrowe.com>
+---
+ opkg-build | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/opkg-build b/opkg-build
+index 93a7956..f8403ea 100755
+--- a/opkg-build
++++ b/opkg-build
+@@ -170,7 +170,7 @@ fi
+
+ compressor_ext() {
+ case $1 in
+- gzip)
++ gzip|pigz)
+ echo gz
+ ;;
+ bzip2)
+@@ -232,6 +232,10 @@ if [ $compressor = "gzip" ] ; then
+ compressorargs=$zipargs
+ elif [ $compressor = "xz" ] ; then
+ compressorargs="--threads 0"
++elif [ $compressor = "pigz" ] ; then
++ if $compressor --help 2>&1 | grep -- "-T" > /dev/null; then
++ compressorargs="-9nT"
++ fi
+ fi
+
+ tsortargs=
+--
+2.11.0
+
diff --git a/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
new file mode 100644
index 00000000..d8931b28
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
@@ -0,0 +1,48 @@
+If a the number of hard links decreases or increases while creating
+the tar files used for an ipk package, tar fails with error code 1:
+
+| DEBUG: Executing python function do_package_ipk
+| tar: ./usr/src/debug/gperf/3.0.4-r0/gperf-3.0.4/src/main.cc: file changed as we read it
+NOTE: recipe gperf-3.0.4-r0: task do_package_write_ipk: Failed
+ERROR: Task 6539 (recipes-extended/gperf/gperf_3.0.4.bb, do_package_write_ipk) failed with exit code '1'
+
+
+We detect if the error code produced by tar is 1 and in this case ignore it.
+
+This a similar behavior to the one on dpkg:
+http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=40731942515ec8d80c727ad561174986d4f05818
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+
+Index: git/opkg-build
+
+===================================================================
+--- git.orig/opkg-build
++++ git/opkg-build
+@@ -285,8 +285,21 @@ mkdir $tmp_dir
+ build_date="$(date --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" "+%Y-%m-%d %H:%M:%S")"
+
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs $tsortargs --mtime="$build_date" -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
+-( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime="$build_date" -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz )
++
++
++# Ignore error code 1, caused by modifying the number of hard links while creating the tar file
++rc=0
++( cd $pkg_dir && tar $ogargs $tsortargs --mtime="$build_date" -X $tmp_dir/tarX -c $tarformat . | $compressor $compressorargs > $tmp_dir/data.tar.$cext ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++ exit $rc
++fi
++
++rc=0
++( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --mtime="$build_date" -c $tarformat . | gzip $zipargs > $tmp_dir/control.tar.gz ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++ exit $rc
++fi
++
+ rm $tmp_dir/tarX
+
+ echo "2.0" > $tmp_dir/debian-binary
diff --git a/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch
new file mode 100644
index 00000000..13a49f91
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch
@@ -0,0 +1,18 @@
+Pass --threads=0 to xz so that it will use as many threads as there are cores to compress the packages. This makes qemu's do_package_ipk run in 34s instead of 275s on my machine.
+
+Upstream-Status: Inappropriate (ugly but works, discussing with upstream now)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/opkg-build b/opkg-build
+index 0050c2b..93a7956 100755
+--- a/opkg-build
++++ b/opkg-build
+@@ -230,6 +230,8 @@ if gzip --help 2>&1 | grep -- "-T" > /dev/null; then
+ fi
+ if [ $compressor = "gzip" ] ; then
+ compressorargs=$zipargs
++elif [ $compressor = "xz" ] ; then
++ compressorargs="--threads 0"
+ fi
+
+ tsortargs=
diff --git a/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb
new file mode 100644
index 00000000..41cf11c2
--- /dev/null
+++ b/external/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb
@@ -0,0 +1,70 @@
+SUMMARY = "Additional utilities for the opkg package manager"
+SUMMARY_update-alternatives-opkg = "Utility for managing the alternatives system"
+SECTION = "base"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://opkg.py;beginline=2;endline=18;md5=63ce9e6bcc445181cd9e4baf4b4ccc35"
+PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
+
+SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \
+ file://0001-Switch-all-scripts-to-use-Python-3.x.patch \
+ file://0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch \
+ file://0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch \
+ file://threaded-xz.patch \
+ file://pigz.patch \
+ file://0001-update-alternatives-Fix-link-relocation-support.patch \
+ file://0001-opkg-make-index-use-ctime-instead-of-mtime.patch \
+"
+SRC_URI_append_class-native = " file://tar_ignore_error.patch"
+UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"
+
+
+SRC_URI[md5sum] = "391c1c80aca26961375dd22e1d2d0cbf"
+SRC_URI[sha256sum] = "26b3f4dd1c1ef65f519d4cddfb35ebea41ae8af989aea2699a39783598c33769"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+# For native builds we use the host Python
+PYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-pickle python3-compression python3-stringold"
+PYTHONRDEPS_class-native = ""
+
+PACKAGECONFIG = "python update-alternatives"
+PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+PACKAGECONFIG[update-alternatives] = ",,,"
+
+do_install() {
+ oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+ if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
+ rm -f "${D}${bindir}/update-alternatives"
+ fi
+
+ if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
+ grep -lZ "/usr/bin/env.*python" ${D}${bindir}/* | xargs -0 rm
+ fi
+}
+
+do_install_append_class-target() {
+ if [ -e "${D}${bindir}/update-alternatives" ]; then
+ sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g'
+ fi
+}
+
+# These are empty and will pull python3-dev into images where it wouldn't
+# have been otherwise, so don't generate them.
+PACKAGES_remove = "${PN}-dev ${PN}-staticdev"
+
+PACKAGES =+ "update-alternatives-opkg"
+FILES_update-alternatives-opkg = "${bindir}/update-alternatives"
+RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cworth"
+RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
+RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
+
+pkg_postrm_update-alternatives-opkg() {
+ rm -rf $D${nonarch_libdir}/opkg/alternatives
+ rmdir $D${nonarch_libdir}/opkg || true
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+CLEANBROKEN = "1"