summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Weihmann <kweihmann@outlook.com>2022-05-09 12:59:57 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-20 10:08:06 +0100
commit98481ac1de15a7d24cf74aa7b613f64910a442b5 (patch)
treebfcea93344b9266ab950448e88d655cf4f15393a
parent0070210dee83fdb820583d278188ba7d4ab4d55b (diff)
downloadpoky-98481ac1de15a7d24cf74aa7b613f64910a442b5.tar.gz
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: e16b9768a2e3eb931d11558f448149c16afa490b) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 98bf3f427702687bf81ed759e7cde5d6d15e77eb) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-kernel/linux-firmware/files/0001-Makefile-replace-mkdir-by-install.patch84
-rw-r--r--meta/recipes-kernel/linux-firmware/linux-firmware_20220411.bb5
2 files changed, 88 insertions, 1 deletions
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 @@
1From 71514e74f35f2b51ca24062573d6d913525b30db Mon Sep 17 00:00:00 2001
2From: Konrad Weihmann <kweihmann@outlook.com>
3Date: Mon, 9 May 2022 12:57:57 +0200
4Subject: [PATCH] Makefile: replace mkdir by install
5
6mkdir -p creates paths that are bound to user's settings and therefore
7can lead to different file mode bits of the base paths accross different
8machines.
9Use install instead, as this tool is not prone to such behavior.
10
11Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
12Upstream-Status: Submitted [https://lore.kernel.org/linux-firmware/PR2PR09MB310088EA719E6D7CA5C268F1A8C69@PR2PR09MB3100.eurprd09.prod.outlook.com/]
13---
14 Makefile | 2 +-
15 carl9170fw/toolchain/Makefile | 4 ++--
16 copy-firmware.sh | 6 +++---
17 3 files changed, 6 insertions(+), 6 deletions(-)
18
19diff --git a/Makefile b/Makefile
20index e1c362f..83a0ec6 100644
21--- a/Makefile
22+++ b/Makefile
23@@ -9,5 +9,5 @@ check:
24 @./check_whence.py
25
26 install:
27- mkdir -p $(DESTDIR)$(FIRMWAREDIR)
28+ install -d $(DESTDIR)$(FIRMWAREDIR)
29 ./copy-firmware.sh $(DESTDIR)$(FIRMWAREDIR)
30diff --git a/carl9170fw/toolchain/Makefile b/carl9170fw/toolchain/Makefile
31index 2b25ffe..aaea8e8 100644
32--- a/carl9170fw/toolchain/Makefile
33+++ b/carl9170fw/toolchain/Makefile
34@@ -46,14 +46,14 @@ src/gcc-$(GCC_VER): src/$(GCC_TAR) src/newlib-$(NEWLIB_VER)
35 ln -s $(BASEDIR)/src/newlib-$(NEWLIB_VER)/libgloss $@
36
37 binutils: src/binutils-$(BINUTILS_VER)
38- mkdir -p build/binutils
39+ install -d build/binutils
40 cd build/binutils; \
41 $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \
42 $(MAKE) -j3; \
43 $(MAKE) install
44
45 gcc: src/gcc-$(GCC_VER) binutils
46- mkdir -p build/gcc
47+ install -d build/gcc
48 cd build/gcc; \
49 $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \
50 $(MAKE) -j3; \
51diff --git a/copy-firmware.sh b/copy-firmware.sh
52index 9b46b63..bbacb92 100755
53--- a/copy-firmware.sh
54+++ b/copy-firmware.sh
55@@ -34,7 +34,7 @@ done
56 grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do
57 test -f "$f" || continue
58 $verbose "copying file $f"
59- mkdir -p $destdir/$(dirname "$f")
60+ install -d $destdir/$(dirname "$f")
61 cp -d "$f" $destdir/"$f"
62 done
63
64@@ -42,7 +42,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d
65 if test -L "$f"; then
66 test -f "$destdir/$f" && continue
67 $verbose "copying link $f"
68- mkdir -p $destdir/$(dirname "$f")
69+ install -d $destdir/$(dirname "$f")
70 cp -d "$f" $destdir/"$f"
71
72 if test "x$d" != "x"; then
73@@ -63,7 +63,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d
74 fi
75 else
76 $verbose "creating link $f -> $d"
77- mkdir -p $destdir/$(dirname "$f")
78+ install -d $destdir/$(dirname "$f")
79 ln -sf "$d" "$destdir/$f"
80 fi
81 done
82--
832.25.1
84
diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_20220411.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_20220411.bb
index 4a443d14d1..d396702690 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"
203 203
204PE = "1" 204PE = "1"
205 205
206SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/firmware/${BPN}-${PV}.tar.xz" 206SRC_URI = "\
207 ${KERNELORG_MIRROR}/linux/kernel/firmware/${BPN}-${PV}.tar.xz \
208 file://0001-Makefile-replace-mkdir-by-install.patch \
209"
207 210
208SRC_URI[sha256sum] = "020b11f6412f4956f5a6f98de7d41867d2b30ea0ce81b1e2d206ec9840363849" 211SRC_URI[sha256sum] = "020b11f6412f4956f5a6f98de7d41867d2b30ea0ce81b1e2d206ec9840363849"
209 212