diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/recipes-devtools/opkg-utils | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-devtools/opkg-utils')
6 files changed, 340 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Only-use-sort-name-on-versions-of-tar-which-support-.patch b/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 0000000000..6b7ca7da3e --- /dev/null +++ b/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/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch new file mode 100644 index 0000000000..c36ae2ffda --- /dev/null +++ b/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/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0002-opkg-build-Use-local-time-for-build_date-since-opkg-.patch b/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 0000000000..e338914b09 --- /dev/null +++ b/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/poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch new file mode 100644 index 0000000000..d8931b281f --- /dev/null +++ b/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/poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/threaded-xz.patch new file mode 100644 index 0000000000..13a49f9170 --- /dev/null +++ b/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/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb b/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb new file mode 100644 index 0000000000..0487c5f305 --- /dev/null +++ b/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb @@ -0,0 +1,67 @@ +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 \ +" +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" |