diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-21 14:50:18 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-21 23:08:20 +0000 |
commit | 95bf5c0bba6e62283f62d95e5869921df43870ee (patch) | |
tree | f4e8d4bfe2389ead8836917e560bc70b59734a68 /meta/recipes-devtools/opkg-utils | |
parent | 7b299db80f01290e4eda25afaae6895d07540715 (diff) | |
download | poky-95bf5c0bba6e62283f62d95e5869921df43870ee.tar.gz |
opkg-utils: Fix silent empty/broken opkg package creation
opkg-build was failing on hosts where tar < 1.28 and reproducibile builds
were enabled but it was doing this silently and generating corrupted
(empty) ipk files. Add a fix for this (submitted upstream).
The fix requires bash but if you're building ipk files this shoudn't be
a problem.
(From OE-Core rev: ff9ec19b02650a3ae230e4d1bdc99ec686cc4c81)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/opkg-utils')
-rw-r--r-- | meta/recipes-devtools/opkg-utils/opkg-utils/pipefail.patch | 31 | ||||
-rw-r--r-- | meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb | 3 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/pipefail.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/pipefail.patch new file mode 100644 index 0000000000..55ddcc1fd2 --- /dev/null +++ b/meta/recipes-devtools/opkg-utils/opkg-utils/pipefail.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | We need opkg-build to fail if for example the tar command is passed invalid | ||
2 | options. Without this, we see silently created empty packaged where data.tar | ||
3 | is zero bytes in size. This creates hard to debug problems. | ||
4 | |||
5 | An example is when reproducible builds are enabled and run on old hosts like | ||
6 | centos7 which has tar < 1.28: | ||
7 | |||
8 | Subprocess output:tar: unrecognized option '--clamp-mtime' | ||
9 | Try `tar --help' or `tar --usage' for more information. | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
13 | |||
14 | Index: opkg-utils-0.4.1/opkg-build | ||
15 | =================================================================== | ||
16 | --- opkg-utils-0.4.1.orig/opkg-build | ||
17 | +++ opkg-utils-0.4.1/opkg-build | ||
18 | @@ -1,4 +1,4 @@ | ||
19 | -#!/bin/sh | ||
20 | +#!/bin/bash | ||
21 | |||
22 | : <<=cut | ||
23 | =head1 NAME | ||
24 | @@ -12,6 +12,7 @@ opkg-build - construct an .opk from a di | ||
25 | # Updated to work on Familiar Pre0.7rc1, with busybox tar. | ||
26 | # Note it Requires: binutils-ar (since the busybox ar can't create) | ||
27 | set -e | ||
28 | +set -o pipefail | ||
29 | |||
30 | version=1.0 | ||
31 | |||
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb index cf1e4670c6..eb6c7a3a6a 100644 --- a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb +++ b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.1.bb | |||
@@ -10,6 +10,7 @@ PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtu | |||
10 | SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ | 10 | SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ |
11 | file://0001-Switch-all-scripts-to-use-Python-3.x.patch \ | 11 | file://0001-Switch-all-scripts-to-use-Python-3.x.patch \ |
12 | file://0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch \ | 12 | file://0001-opkg-build-clamp-mtimes-to-SOURCE_DATE_EPOCH.patch \ |
13 | file://pipefail.patch \ | ||
13 | " | 14 | " |
14 | UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/" | 15 | UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/" |
15 | 16 | ||
@@ -19,6 +20,8 @@ SRC_URI[sha256sum] = "9ea9efdd9fe13661ad251e3a2860c1c93045adcfaa6659c3e86d9748ec | |||
19 | 20 | ||
20 | TARGET_CC_ARCH += "${LDFLAGS}" | 21 | TARGET_CC_ARCH += "${LDFLAGS}" |
21 | 22 | ||
23 | RDEPENDS_${PN} += "bash" | ||
24 | |||
22 | # For native builds we use the host Python | 25 | # For native builds we use the host Python |
23 | PYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-pickle python3-compression python3-stringold" | 26 | PYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-pickle python3-compression python3-stringold" |
24 | PYTHONRDEPS_class-native = "" | 27 | PYTHONRDEPS_class-native = "" |