fix broken symlink /usr/lib/firmware/qcom/LENOVO/21BX.xz

Also make copy-firmware verbose.

Resolves: rhbz#2214391

Signed-off-by: Jan Stancek <jstancek@redhat.com>
This commit is contained in:
Jan Stancek 2023-06-16 10:56:37 +02:00
parent 01e800b901
commit 9929c3dc7c
3 changed files with 42 additions and 1 deletions

View File

@ -32,7 +32,7 @@ index 83a0ec6..1edf4a6 100644
+
+installcompress:
+ install -d $(DESTDIR)$(FIRMWAREDIR)
+ ./copy-firmware.sh -C $(DESTDIR)$(FIRMWAREDIR)
+ ./copy-firmware.sh -v -C $(DESTDIR)$(FIRMWAREDIR)
diff --git a/copy-firmware.sh b/copy-firmware.sh
index bbacb92..fc419a3 100755
--- a/copy-firmware.sh

View File

@ -0,0 +1,40 @@
From 6208866dbef0b336e2b63695b27d61d95ace5721 Mon Sep 17 00:00:00 2001
Message-Id: <6208866dbef0b336e2b63695b27d61d95ace5721.1686643559.git.jstancek@redhat.com>
From: Jan Stancek <jstancek@redhat.com>
Date: Tue, 13 Jun 2023 09:26:08 +0200
Subject: [PATCH] copy-firmware.sh: don't add cmpxtn to directory links
Content-type: text/plain
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
copy-firmware.sh | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/copy-firmware.sh b/copy-firmware.sh
index fc419a340c48..acd095ac8952 100755
--- a/copy-firmware.sh
+++ b/copy-firmware.sh
@@ -77,9 +77,17 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d
$verbose "WARNING: missing target for symlink $f$cmpxtn"
fi
else
- $verbose "creating link $f$cmpxtn -> $d$cmpxtn"
- install -d $destdir/$(dirname "$f$cmpxtn")
- ln -sf "$d$cmpxtn" "$destdir/$f$cmpxtn"
+ mkdir -p $(dirname "$f")
+ if test -d $(dirname "$f")/"$d"; then
+ # don't add compression extension to directory symlinks
+ $verbose "creating dir link $f -> $d"
+ install -d $destdir/$(dirname "$f")
+ ln -sf "$d" "$destdir/$f"
+ else
+ $verbose "creating link $f$cmpxtn -> $d$cmpxtn"
+ install -d $destdir/$(dirname "$f$cmpxtn")
+ ln -sf "$d$cmpxtn" "$destdir/$f$cmpxtn"
+ fi
fi
done
--
2.31.1

View File

@ -14,6 +14,7 @@ BuildArch: noarch
Source0: https://www.kernel.org/pub/linux/kernel/firmware/%{name}-%{version}.tar.xz
Patch1: 0001-Add-support-for-compressing-firmware-in-copy-firmwar.patch
Patch2: 0001-copy-firmware.sh-don-t-add-cmpxtn-to-directory-links.patch
BuildRequires: git-core
BuildRequires: make