From d1c08df98751c8255bd5de3a2de1cf2f1f2afb32 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Thu, 17 Jul 2025 16:38:24 +0800 Subject: [PATCH] Fix upgrade from previous version by replacing directory with symlink (cherry picked from commit cc381c900c259f582d90ab07dc018e7c47839891) --- linux-firmware.spec | 59 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/linux-firmware.spec b/linux-firmware.spec index 7e9f429..45ca5f4 100644 --- a/linux-firmware.spec +++ b/linux-firmware.spec @@ -4,7 +4,7 @@ Name: linux-firmware Version: 20250708 -Release: 1 +Release: 2 Summary: Firmware files used by the Linux kernel License: GPL-1.0-or-later AND GPL-2.0-or-later AND MIT and Redistributable, no modification permitted URL: https://www.kernel.org/ @@ -158,6 +158,60 @@ rm -rf check_whence.py copy-firmware.sh rm -rf build_packages.py contrib popd +%pretrans -p +path = "/usr/lib/firmware/nvidia/ad103" +st = posix.stat(path) +if st and st.type == "directory" then + status = os.rename(path, path .. ".rpmmoved") + if not status then + suffix = 0 + while not status do + suffix = suffix + 1 + status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) + end + os.rename(path, path .. ".rpmmoved") + end +end +path = "/usr/lib/firmware/nvidia/ad104" +st = posix.stat(path) +if st and st.type == "directory" then + status = os.rename(path, path .. ".rpmmoved") + if not status then + suffix = 0 + while not status do + suffix = suffix + 1 + status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) + end + os.rename(path, path .. ".rpmmoved") + end +end +path = "/usr/lib/firmware/nvidia/ad106" +st = posix.stat(path) +if st and st.type == "directory" then + status = os.rename(path, path .. ".rpmmoved") + if not status then + suffix = 0 + while not status do + suffix = suffix + 1 + status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) + end + os.rename(path, path .. ".rpmmoved") + end +end +path = "/usr/lib/firmware/nvidia/ad107" +st = posix.stat(path) +if st and st.type == "directory" then + status = os.rename(path, path .. ".rpmmoved") + if not status then + suffix = 0 + while not status do + suffix = suffix + 1 + status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix) + end + os.rename(path, path .. ".rpmmoved") + end +end + %files %dir %{_lib_path} %license WHENCE @@ -216,6 +270,9 @@ popd %{_lib_path}/ti-connectivity %changelog +* Thu Jul 17 2025 Funda Wang - 20250708-2 +- Fix upgrade from previous version by replacing directory with symlink + * Fri Jul 11 2025 Funda Wang - 20250708-1 - update to 20250708 - fix broken symlinks -- Gitee