From 50145d617478a975cbc3b30d7fe13a87f35b06d1 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Tue, 16 Nov 2021 08:43:45 +0100 Subject: [PATCH] ca-certificates: fix busybox error in post-upgrade Do not try to use "mktemp --tmpdir" in the update-ca-certificates script. This broke upgrading, as the script gets executed during post-upgrade. Related: https://salsa.debian.org/debian/ca-certificates/-/commit/66951d3b45ffe24d182d36ec02d3ec7aee30ece7 Related: SYS#5283 --- ...-certificates-Replace-deprecated-mkt.patch | 45 +++++++++++++++++++ .../ca-certificates_20211016.bb | 2 + 2 files changed, 47 insertions(+) create mode 100644 recipes-extra/ca-certificates/ca-certificates/0004-Revert-update-ca-certificates-Replace-deprecated-mkt.patch diff --git a/recipes-extra/ca-certificates/ca-certificates/0004-Revert-update-ca-certificates-Replace-deprecated-mkt.patch b/recipes-extra/ca-certificates/ca-certificates/0004-Revert-update-ca-certificates-Replace-deprecated-mkt.patch new file mode 100644 index 0000000..8214554 --- /dev/null +++ b/recipes-extra/ca-certificates/ca-certificates/0004-Revert-update-ca-certificates-Replace-deprecated-mkt.patch @@ -0,0 +1,45 @@ +From c32d2e7154e242402f086b126dc439507813f173 Mon Sep 17 00:00:00 2001 +From: Oliver Smith +Date: Tue, 16 Nov 2021 08:38:47 +0100 +Subject: [PATCH] Revert "update-ca-certificates: Replace deprecated mktemp -t + with mktemp --tmpdir" + +This reverts commit 66951d3b45ffe24d182d36ec02d3ec7aee30ece7. + +The busybox version we use doesn't support --tmpdir. Fix for: + + root@sysmocom-alix:~# opkg upgrade + Not selecting udev 232 as installing it would break existing dependencies. + Configuring ca-certificates. + mktemp: unrecognized option '--tmpdir' + BusyBox v1.24.1 (2019-08-13 07:53:38 UTC) multi-call binary. + + Usage: mktemp [-dt] [-p DIR] [TEMPLATE] + Collected errors: + * pkg_run_script: package "ca-certificates" postinst script returned status 1. + * opkg_configure: ca-certificates.postinst returned 1. + root@sysmocom-alix:~# + +Related: SYS#5283 +--- + sbin/update-ca-certificates | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates +index 9a876d7..40a3932 100755 +--- a/sbin/update-ca-certificates ++++ b/sbin/update-ca-certificates +@@ -81,8 +81,8 @@ trap cleanup 0 + # Helper files. (Some of them are not simple arrays because we spawn + # subshells later on.) + TEMPBUNDLE="${ETCCERTSDIR}/${CERTBUNDLE}.new" +-ADDED="$(mktemp --tmpdir "ca-certificates.tmp.XXXXXX")" +-REMOVED="$(mktemp --tmpdir "ca-certificates.tmp.XXXXXX")" ++ADDED="$(mktemp -t "ca-certificates.tmp.XXXXXX")" ++REMOVED="$(mktemp -t "ca-certificates.tmp.XXXXXX")" + + # Adds a certificate to the list of trusted ones. This includes a symlink + # in /etc/ssl/certs to the certificate file and its inclusion into the +-- +2.30.2 + diff --git a/recipes-extra/ca-certificates/ca-certificates_20211016.bb b/recipes-extra/ca-certificates/ca-certificates_20211016.bb index 3e16308..8a29391 100644 --- a/recipes-extra/ca-certificates/ca-certificates_20211016.bb +++ b/recipes-extra/ca-certificates/ca-certificates_20211016.bb @@ -6,6 +6,7 @@ HOMEPAGE = "http://packages.debian.org/sid/ca-certificates" SECTION = "misc" LICENSE = "GPL-2.0+ & MPL-2.0" LIC_FILES_CHKSUM = "file://debian/copyright;md5=ae5b36b514e3f12ce1aa8e2ee67f3d7e" +PR="r1" # This is needed to ensure we can run the postinst at image creation time DEPENDS = "" @@ -22,6 +23,7 @@ SRC_URI = "git://salsa.debian.org/debian/ca-certificates.git;protocol=https \ file://default-sysroot.patch \ file://0003-update-ca-certificates-use-relative-symlinks-from-ET.patch \ file://0001-Revert-mozilla-certdata2pem.py-print-a-warning-for-e.patch \ + file://0004-Revert-update-ca-certificates-Replace-deprecated-mkt.patch \ " UPSTREAM_CHECK_GITTAGREGEX = "(?P\d+)"