summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-03 20:39:14 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-06 12:16:34 +0000
commit09c6a41b751d080f0c12fc4172a31d1dbe760b0b (patch)
tree145a78e65dbd4bbf0a02fa1e838dff489e438dc5 /meta
parent73333dd4b8f80f9d6224b319f476a7bf0e27b83c (diff)
downloadpoky-09c6a41b751d080f0c12fc4172a31d1dbe760b0b.tar.gz
opkg-utils: 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. (From OE-Core rev: a9b8287984c63420e10329a69f7ac5125f1687f8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils/fix-reproducibility.patch32
-rw-r--r--meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb1
2 files changed, 33 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/fix-reproducibility.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/fix-reproducibility.patch
new file mode 100644
index 0000000000..945979bc8a
--- /dev/null
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils/fix-reproducibility.patch
@@ -0,0 +1,32 @@
1Fix reproducibility issues in opkg-build
2
3There is a sorting problem with opkg-build where the ipk generated is depending
4upon the order of files on disk. The reason is the --sort option to tar only
5influences the orders of files tar reads, not those passed by the -T option.
6
7Add in a sort call to resolve this issue. To ensure consistent sorting we
8also need to force to a specific locale (C) else the results are still not
9deterministic.
10
11RP 2020/2/5
12
13Upstream-Status: Submitted [https://groups.google.com/forum/#!topic/opkg-devel/YttZ73NLrYQ]
14Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
15
16Index: opkg-utils-0.4.2/opkg-build
17===================================================================
18--- opkg-utils-0.4.2.orig/opkg-build
19+++ opkg-utils-0.4.2/opkg-build
20@@ -305,8 +305,10 @@ if [ ! -z "$SOURCE_DATE_EPOCH" ]; then
21 mtime_args="--mtime=@$build_date --clamp-mtime"
22 fi
23
24-( cd $pkg_dir/$CONTROL && find . -type f > $tmp_dir/control_list )
25-( cd $pkg_dir && find . -path ./$CONTROL -prune -o -path . -o -print > $tmp_dir/file_list )
26+export LANG=C
27+export LC_ALL=C
28+( cd $pkg_dir/$CONTROL && find . -type f | sort > $tmp_dir/control_list )
29+( cd $pkg_dir && find . -path ./$CONTROL -prune -o -path . -o -print | sort > $tmp_dir/file_list )
30 ( cd $pkg_dir && tar $ogargs $tsortargs --no-recursion $mtime_args -c $tarformat -T $tmp_dir/file_list | $compressor $compressorargs > $tmp_dir/data.tar.$cext )
31 ( 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 )
32 rm $tmp_dir/file_list
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb
index 8e7ef00b08..eda73db6a4 100644
--- a/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.2.bb
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
8PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}" 8PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
9 9
10SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \ 10SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \
11 file://fix-reproducibility.patch \
11" 12"
12UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/" 13UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"
13 14