From 3ccfcc3fcf35bbf0bf1193c855ed71000b1cbefe Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Mon, 9 May 2022 12:59:57 +0200 Subject: linux-firmware: replace mkdir by install if a setup is using RPM for packaging and there are multiple recipes that install to ${nonarch_base_libdir}/firmware by using install -d ${nonarch_base_libdir}/firmware, it will create installation clashes on image install, as linux-firmware in before this patch used mkdir -p, which creates different file mode bits (depending on the current user's settings). In a particular example linux-fimware created /lib/firmware with 0600 while other-firmware-package created it with 0644 making the combination not installable by rpm backend (From OE-Core rev: 98bf3f427702687bf81ed759e7cde5d6d15e77eb) Signed-off-by: Konrad Weihmann Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- .../0001-Makefile-replace-mkdir-by-install.patch | 84 ++++++++++++++++++++++ .../linux-firmware/linux-firmware_20220411.bb | 5 +- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-kernel/linux-firmware/files/0001-Makefile-replace-mkdir-by-install.patch diff --git a/meta/recipes-kernel/linux-firmware/files/0001-Makefile-replace-mkdir-by-install.patch b/meta/recipes-kernel/linux-firmware/files/0001-Makefile-replace-mkdir-by-install.patch new file mode 100644 index 0000000000..b1ac5a16ab --- /dev/null +++ b/meta/recipes-kernel/linux-firmware/files/0001-Makefile-replace-mkdir-by-install.patch @@ -0,0 +1,84 @@ +From 71514e74f35f2b51ca24062573d6d913525b30db Mon Sep 17 00:00:00 2001 +From: Konrad Weihmann +Date: Mon, 9 May 2022 12:57:57 +0200 +Subject: [PATCH] Makefile: replace mkdir by install + +mkdir -p creates paths that are bound to user's settings and therefore +can lead to different file mode bits of the base paths accross different +machines. +Use install instead, as this tool is not prone to such behavior. + +Signed-off-by: Konrad Weihmann +Upstream-Status: Submitted [https://lore.kernel.org/linux-firmware/PR2PR09MB310088EA719E6D7CA5C268F1A8C69@PR2PR09MB3100.eurprd09.prod.outlook.com/] +--- + Makefile | 2 +- + carl9170fw/toolchain/Makefile | 4 ++-- + copy-firmware.sh | 6 +++--- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/Makefile b/Makefile +index e1c362f..83a0ec6 100644 +--- a/Makefile ++++ b/Makefile +@@ -9,5 +9,5 @@ check: + @./check_whence.py + + install: +- mkdir -p $(DESTDIR)$(FIRMWAREDIR) ++ install -d $(DESTDIR)$(FIRMWAREDIR) + ./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR) +diff --git a/carl9170fw/toolchain/Makefile b/carl9170fw/toolchain/Makefile +index 2b25ffe..aaea8e8 100644 +--- a/carl9170fw/toolchain/Makefile ++++ b/carl9170fw/toolchain/Makefile +@@ -46,14 +46,14 @@ src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER) + ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/libgloss $@ + + binutils: src/binutils-$(BINUTILS_VER) +- mkdir -p build/binutils ++ install -d build/binutils + cd build/binutils; \ + $(BASEDIR)/$ //g' | while read f d; d + if test -L "$f"; then + test -f "$destdir/$f" && continue + $verbose "copying link $f" +- mkdir -p $destdir/$(dirname "$f") ++ install -d $destdir/$(dirname "$f") + cp -d "$f" $destdir/"$f" + + if test "x$d" != "x"; then +@@ -63,7 +63,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d + fi + else + $verbose "creating link $f -> $d" +- mkdir -p $destdir/$(dirname "$f") ++ install -d $destdir/$(dirname "$f") + ln -sf "$d" "$destdir/$f" + fi + done +-- +2.25.1 + diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_20220411.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_20220411.bb index 89e1b8cbaf..19b970c091 100644 --- a/meta/recipes-kernel/linux-firmware/linux-firmware_20220411.bb +++ b/meta/recipes-kernel/linux-firmware/linux-firmware_20220411.bb @@ -203,7 +203,10 @@ NO_GENERIC_LICENSE[WHENCE] = "WHENCE" PE = "1" -SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/firmware/${BPN}-${PV}.tar.xz" +SRC_URI = "\ + ${KERNELORG_MIRROR}/linux/kernel/firmware/${BPN}-${PV}.tar.xz \ + file://0001-Makefile-replace-mkdir-by-install.patch \ +" SRC_URI[sha256sum] = "020b11f6412f4956f5a6f98de7d41867d2b30ea0ce81b1e2d206ec9840363849" -- cgit v1.2.3-54-g00ecf