diff options
Diffstat (limited to 'poky/meta/recipes-devtools/opkg-utils')
-rw-r--r-- | poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch | 113 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch | 44 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/opkg-utils/opkg-utils/fix-reproducibility.patch | 32 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/opkg-utils/opkg-utils/pipefail.patch | 31 | ||||
-rw-r--r-- | poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb (renamed from poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb) | 23 |
5 files changed, 43 insertions, 200 deletions
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 deleted file mode 100644 index 691ed50c2..000000000 --- a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-Switch-all-scripts-to-use-Python-3.x.patch +++ /dev/null @@ -1,113 +0,0 @@ -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 - """ - Utility to create opkg compatible indexes - """ - -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/0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch deleted file mode 100644 index a181169d4..000000000 --- a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch +++ /dev/null @@ -1,44 +0,0 @@ -Upstream-Status: Backport -Signed-off-by: Ross Burton <ross.burton@intel.com> - -From 59da5577bf8df441c6ca958e50fcb83228702764 Mon Sep 17 00:00:00 2001 -From: Alejandro del Castillo <alejandro.delcastillo@ni.com> -Date: Thu, 12 Sep 2019 10:24:58 -0500 -Subject: [PATCH] opkg-build: clamp mtimes to SOURCE_DATE_EPOCH - -For reproducible builds, clamp mtimes bigger than SOURCE_DATE_EPOCH to -SOURCE_DATE_EPOCH (build generated files, usually). - -Fixes bugzilla 13450 - -Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> -Signed-off-by: Ross Burton <ross.burton@intel.com> ---- - opkg-build | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/opkg-build b/opkg-build -index dcd2d68..2517a2b 100755 ---- a/opkg-build -+++ b/opkg-build -@@ -297,9 +297,16 @@ mkdir $tmp_dir - - build_date="${SOURCE_DATE_EPOCH:-$(date +%s)}" - -+mtime_args="" -+# --clamp-mtime requires tar > 1.28. Only use it if SOURCE_DATE_EPOCH is set, to avoid having a generic case dependency on tar > 1.28. -+# this setting will make sure files generated at build time have consistent mtimes, for reproducible builds. -+if [ ! -z "$SOURCE_DATE_EPOCH" ]; then -+ mtime_args="--mtime=@$build_date --clamp-mtime" -+fi -+ - ( cd $pkg_dir/$CONTROL && find . -type f > $tmp_dir/control_list ) - ( cd $pkg_dir && find . -path ./$CONTROL -prune -o -print > $tmp_dir/file_list ) --( cd $pkg_dir && tar $ogargs $tsortargs --no-recursion -c $tarformat -T $tmp_dir/file_list | $compressor $compressorargs > $tmp_dir/data.tar.$cext ) -+( cd $pkg_dir && tar $ogargs $tsortargs --no-recursion $mtime_args -c $tarformat -T $tmp_dir/file_list | $compressor $compressorargs > $tmp_dir/data.tar.$cext ) - ( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --no-recursion --mtime=@$build_date -c $tarformat -T $tmp_dir/control_list | gzip $zipargs > $tmp_dir/control.tar.gz ) - rm $tmp_dir/file_list - rm $tmp_dir/control_list --- -2.20.1 - diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/fix-reproducibility.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/fix-reproducibility.patch new file mode 100644 index 000000000..945979bc8 --- /dev/null +++ b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/fix-reproducibility.patch @@ -0,0 +1,32 @@ +Fix reproducibility issues in opkg-build + +There is a sorting problem with opkg-build where the ipk generated is depending +upon the order of files on disk. The reason is the --sort option to tar only +influences the orders of files tar reads, not those passed by the -T option. + +Add in a sort call to resolve this issue. To ensure consistent sorting we +also need to force to a specific locale (C) else the results are still not +deterministic. + +RP 2020/2/5 + +Upstream-Status: Submitted [https://groups.google.com/forum/#!topic/opkg-devel/YttZ73NLrYQ] +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> + +Index: opkg-utils-0.4.2/opkg-build +=================================================================== +--- opkg-utils-0.4.2.orig/opkg-build ++++ opkg-utils-0.4.2/opkg-build +@@ -305,8 +305,10 @@ if [ ! -z "$SOURCE_DATE_EPOCH" ]; then + mtime_args="--mtime=@$build_date --clamp-mtime" + fi + +-( cd $pkg_dir/$CONTROL && find . -type f > $tmp_dir/control_list ) +-( cd $pkg_dir && find . -path ./$CONTROL -prune -o -path . -o -print > $tmp_dir/file_list ) ++export LANG=C ++export LC_ALL=C ++( cd $pkg_dir/$CONTROL && find . -type f | sort > $tmp_dir/control_list ) ++( cd $pkg_dir && find . -path ./$CONTROL -prune -o -path . -o -print | sort > $tmp_dir/file_list ) + ( cd $pkg_dir && tar $ogargs $tsortargs --no-recursion $mtime_args -c $tarformat -T $tmp_dir/file_list | $compressor $compressorargs > $tmp_dir/data.tar.$cext ) + ( cd $pkg_dir/$CONTROL && tar $ogargs $tsortargs --no-recursion --mtime=@$build_date -c $tarformat -T $tmp_dir/control_list | gzip $zipargs > $tmp_dir/control.tar.gz ) + rm $tmp_dir/file_list diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/pipefail.patch b/poky/meta/recipes-devtools/opkg-utils/opkg-utils/pipefail.patch deleted file mode 100644 index 55ddcc1fd..000000000 --- a/poky/meta/recipes-devtools/opkg-utils/opkg-utils/pipefail.patch +++ /dev/null @@ -1,31 +0,0 @@ -We need opkg-build to fail if for example the tar command is passed invalid -options. Without this, we see silently created empty packaged where data.tar -is zero bytes in size. This creates hard to debug problems. - -An example is when reproducible builds are enabled and run on old hosts like -centos7 which has tar < 1.28: - -Subprocess output:tar: unrecognized option '--clamp-mtime' -Try `tar --help' or `tar --usage' for more information. - -Upstream-Status: Pending -Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> - -Index: opkg-utils-0.4.1/opkg-build -=================================================================== ---- opkg-utils-0.4.1.orig/opkg-build -+++ opkg-utils-0.4.1/opkg-build -@@ -1,4 +1,4 @@ --#!/bin/sh -+#!/bin/bash - - : <<=cut - =head1 NAME -@@ -12,6 +12,7 @@ opkg-build - construct an .opk from a di - # Updated to work on Familiar Pre0.7rc1, with busybox tar. - # Note it Requires: binutils-ar (since the busybox ar can't create) - set -e -+set -o pipefail - - version=1.0 - diff --git a/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb b/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb index eb6c7a3a6..931524019 100644 --- a/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb +++ b/poky/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb @@ -4,24 +4,23 @@ 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" + file://opkg.py;beginline=2;endline=18;md5=ffa11ff3c15eb31c6a7ceaa00cc9f986" 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-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch \ - file://pipefail.patch \ +SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ + file://fix-reproducibility.patch \ " UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/" - -SRC_URI[md5sum] = "8c140f835b694a0c27cfb23d2426a02b" -SRC_URI[sha256sum] = "9ea9efdd9fe13661ad251e3a2860c1c93045adcfaa6659c3e86d9748ecda3b6e" +SRC_URI[md5sum] = "cc210650644fcb9bba06ad5ec95a63ec" +SRC_URI[sha256sum] = "5929ad87d541789e0b82d626db01a1201ac48df6f49f2262fcfb86cf815e5d6c" TARGET_CC_ARCH += "${LDFLAGS}" RDEPENDS_${PN} += "bash" +inherit perlnative + # 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 = "" @@ -35,13 +34,13 @@ do_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 ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + grep -lZ "/usr/bin/env.*python" ${D}${bindir}/* | xargs -0 rm + fi + 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 |