* [PATCH] linux-firmware: replace mkdir by install
@ 2022-05-09 10:41 Konrad Weihmann
2022-05-09 10:45 ` [OE-core] " Alexander Kanavin
0 siblings, 1 reply; 3+ messages in thread
From: Konrad Weihmann @ 2022-05-09 10:41 UTC (permalink / raw)
To: openembedded-core; +Cc: Konrad Weihmann
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
Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
---
...01-Makefile-replace-mkdir-by-install.patch | 84 +++++++++++++++++++
.../linux-firmware/linux-firmware_20220209.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..16e0fa8986
--- /dev/null
+++ b/meta/recipes-kernel/linux-firmware/files/0001-Makefile-replace-mkdir-by-install.patch
@@ -0,0 +1,84 @@
+From 81bbf4495ab59979948043fa13f1c18db249fbdd Mon Sep 17 00:00:00 2001
+From: Konrad Weihmann <kweihmann@outlook.com>
+Date: Mon, 9 May 2022 12:23:28 +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 <kweihmann@outlook.com>
+Upstream-Status: Submitted
+---
+ 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)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst; \
+ $(MAKE) -j3; \
+ $(MAKE) install
+
+ gcc: src/gcc-$(GCC_VER) binutils
+- mkdir -p build/gcc
++ install -d build/gcc
+ cd build/gcc; \
+ $(BASEDIR)/$</configure --target=sh-elf --prefix=$(BASEDIR)/inst -enable-languages=c --without-pkgversion --with-newlib; \
+ $(MAKE) -j3; \
+diff --git a/copy-firmware.sh b/copy-firmware.sh
+index 9b46b63..bbacb92 100755
+--- a/copy-firmware.sh
++++ b/copy-firmware.sh
+@@ -34,7 +34,7 @@ done
+ grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do
+ test -f "$f" || continue
+ $verbose "copying file $f"
+- mkdir -p $destdir/$(dirname "$f")
++ install -d $destdir/$(dirname "$f")
+ cp -d "$f" $destdir/"$f"
+ done
+
+@@ -42,7 +42,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //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_20220209.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_20220209.bb
index fe51892eb4..4758466aa9 100644
--- a/meta/recipes-kernel/linux-firmware/linux-firmware_20220209.bb
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_20220209.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] = "e2e46fa618414952bbf2f6920cd3abcddbef45bfb7d1352994b4bfc35394d177"
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH] linux-firmware: replace mkdir by install
2022-05-09 10:41 [PATCH] linux-firmware: replace mkdir by install Konrad Weihmann
@ 2022-05-09 10:45 ` Alexander Kanavin
2022-05-09 10:47 ` richard.purdie
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kanavin @ 2022-05-09 10:45 UTC (permalink / raw)
To: Konrad Weihmann; +Cc: OE-core
On Mon, 9 May 2022 at 12:42, Konrad Weihmann <kweihmann@outlook.com> wrote:
> +Upstream-Status: Submitted
Submitted [where] please. If it's to a mailing list, link to the
message on some web archive.
Alex
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH] linux-firmware: replace mkdir by install
2022-05-09 10:45 ` [OE-core] " Alexander Kanavin
@ 2022-05-09 10:47 ` richard.purdie
0 siblings, 0 replies; 3+ messages in thread
From: richard.purdie @ 2022-05-09 10:47 UTC (permalink / raw)
To: Alexander Kanavin, Konrad Weihmann; +Cc: OE-core
On Mon, 2022-05-09 at 12:45 +0200, Alexander Kanavin wrote:
> On Mon, 9 May 2022 at 12:42, Konrad Weihmann <kweihmann@outlook.com> wrote:
> > +Upstream-Status: Submitted
>
> Submitted [where] please. If it's to a mailing list, link to the
> message on some web archive.
Patch also doesn't apply against master as I think the version may have
been upgraded.
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-09 10:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 10:41 [PATCH] linux-firmware: replace mkdir by install Konrad Weihmann
2022-05-09 10:45 ` [OE-core] " Alexander Kanavin
2022-05-09 10:47 ` richard.purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.