linux-firmware/0001-copy-firmware.sh-don-t-add-compext-to-directory-link.patch
Jan Stancek c019edd513 Fix PSR-SU issues with kernel 6.2 or later
Resolves: rhbz#2218668

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2023-07-03 08:39:57 +02:00

55 lines
1.8 KiB
Diff

From d50d13a9d8c3863a847077e6357fdde2bf39a88f Mon Sep 17 00:00:00 2001
Message-Id: <d50d13a9d8c3863a847077e6357fdde2bf39a88f.1688365829.git.jstancek@redhat.com>
From: Jan Stancek <jstancek@redhat.com>
Date: Mon, 3 Jul 2023 08:30:14 +0200
Subject: [PATCH] copy-firmware.sh: don't add compext to directory links
Content-type: text/plain
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
Makefile | 2 +-
copy-firmware.sh | 14 +++++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 50a4c29be5b4..a5480eee0730 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ install:
install-xz:
install -d $(DESTDIR)$(FIRMWAREDIR)
- ./copy-firmware.sh --xz $(DESTDIR)$(FIRMWAREDIR)
+ ./copy-firmware.sh -v --xz $(DESTDIR)$(FIRMWAREDIR)
install-zst:
install -d $(DESTDIR)$(FIRMWAREDIR)
diff --git a/copy-firmware.sh b/copy-firmware.sh
index 58eb7e39ffb7..71f6be02d4cb 100755
--- a/copy-firmware.sh
+++ b/copy-firmware.sh
@@ -94,9 +94,17 @@ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do
$verbose "WARNING: missing target for symlink $f"
fi
else
- install -d "$destdir/$(dirname "$f")"
- $verbose "creating link $f$compext -> $d$compext"
- ln -s "$d$compext" "$destdir/$f$compext"
+ 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$compext -> $d$compext"
+ install -d $destdir/$(dirname "$f$compext")
+ ln -sf "$d$compext" "$destdir/$f$compext"
+ fi
fi
done
--
2.31.1