add sccripts to workaround replace directory with symlink bug [release 20220913-2mamba;Tue Sep 20 2022]

This commit is contained in:
Silvan Calarco 2024-01-06 06:18:44 +01:00
parent 6c7a328685
commit 9e1529dfd1

View File

@ -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 <lua>
-- 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 <silvan.calarco@mambasoft.it> 20220913-2mamba
- add sccripts to workaround replace directory with symlink bug
* Tue Sep 20 2022 Automatic Build System <autodist@mambasoft.it> 20220913-1mamba
- automatic version update by autodist
* Wed Aug 17 2022 Automatic Build System <autodist@mambasoft.it> 20220815-1mamba
- automatic version update by autodist