From 9e1529dfd1a99dde5ccfddb089fa426d71eda2fe Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 06:18:44 +0100 Subject: [PATCH] add sccripts to workaround replace directory with symlink bug [release 20220913-2mamba;Tue Sep 20 2022] --- linux-firmware.spec | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/linux-firmware.spec b/linux-firmware.spec index 2f3561d..031a347 100644 --- a/linux-firmware.spec +++ b/linux-firmware.spec @@ -1,6 +1,6 @@ Name: linux-firmware -Version: 20220815 -Release: 1mamba +Version: 20220913 +Release: 2mamba Summary: Collection of firmware files used by the Linux Kernel Group: System/Kernel and Hardware Vendor: openmamba @@ -37,6 +37,8 @@ Summary: Microcode update image for AMD CPUs %description -n amd-ucode Microcode update image for AMD CPUs. +%define __strip /usr/bin/true + %prep %setup -q #%patch0 -p1 @@ -70,6 +72,23 @@ install -D -m0644 amd-ucode.img %{buildroot}/boot/amd-ucode.img %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%pretrans -p +-- Define the path to directory being replaced below. +-- DO NOT add a trailing slash at the end. +path = "/usr/lib/firmware/qcom/LENOVO/21BX" +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 + %pre if [ ! -L /lib -a ! -L /lib/firmware ]; then # Migrate /lib/firmware to /usr/lib/firmware @@ -87,6 +106,8 @@ if [ ! -L /lib -a ! -e /lib/firmware ]; then # make /lib/firmware symlink to /usr/lib/firmware ln -s ../usr/lib/firmware /lib/firmware fi +[ -e /usr/lib/firmware/qcom/LENOVO/21BX.rpmmoved ] && \ + rm -rf /usr/lib/firmware/qcom/LENOVO/21BX.rpmmoved : %files @@ -102,6 +123,12 @@ fi %endif %changelog +* Tue Sep 20 2022 Silvan Calarco 20220913-2mamba +- add sccripts to workaround replace directory with symlink bug + +* Tue Sep 20 2022 Automatic Build System 20220913-1mamba +- automatic version update by autodist + * Wed Aug 17 2022 Automatic Build System 20220815-1mamba - automatic version update by autodist