From 0652fbc46eae23c398cecfa1877b87e6c5963b3fdc1eff652ee0dbaa94932dc5 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 10 Oct 2022 09:25:22 +0000 Subject: [PATCH] Accepting request 1009317 from home:tiwai:branches:Kernel:HEAD - Apply the same workaround to uncompressed flat package, too (bsc#1204103) OBS-URL: https://build.opensuse.org/request/show/1009317 OBS-URL: https://build.opensuse.org/package/show/Kernel:HEAD/kernel-firmware?expand=0&rev=391 --- kernel-firmware.changes | 6 ++++++ kernel-firmware.spec | 21 +++++++++++++++++++++ kernel-firmware.spec.in | 2 ++ makespec.sh | 4 ++++ uncompressed-post | 27 +++++++++++++++++++++++++++ 5 files changed, 60 insertions(+) create mode 100644 uncompressed-post diff --git a/kernel-firmware.changes b/kernel-firmware.changes index 54e868e..3c9fc8b 100644 --- a/kernel-firmware.changes +++ b/kernel-firmware.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Oct 10 09:12:47 UTC 2022 - Takashi Iwai + +- Apply the same workaround to uncompressed flat package, too + (bsc#1204103) + ------------------------------------------------------------------- Sat Oct 8 15:46:30 UTC 2022 - Takashi Iwai diff --git a/kernel-firmware.spec b/kernel-firmware.spec index 9bb5319..a47b8e9 100644 --- a/kernel-firmware.spec +++ b/kernel-firmware.spec @@ -61,7 +61,9 @@ Source1011: fwtopics.py Source1012: check-topic.py Source1013: update-aliases.py Source1014: README.build +# workarounds Source1100: qcom-post +Source1101: uncompressed-post BuildRequires: fdupes BuildRequires: suse-module-tools Requires(post): /usr/bin/mkdir /usr/bin/touch @@ -6272,13 +6274,32 @@ sh %{_sourcedir}/list-license.sh < %{_sourcedir}/licenses.list %fdupes -s %{buildroot} %if "%flavor" != "compressed" +%pre +# ugly workaround for changing qcom/LENOVO/21BX to a symlink (bsc#1204103) +if [ ! -L %{_firmwaredir}/qcom/LENOVO/21BX ]; then + if [ -d %{_firmwaredir}/qcom/LENOVO/21BX ]; then + mv %{_firmwaredir}/qcom/LENOVO/21BX %{_firmwaredir}/qcom/LENOVO/21BX.xxxold + fi +fi + %post +# ugly workaround (bsc#1204103) +if [ -d %{_firmwaredir}/qcom/LENOVO/21BX.xxxold ]; then + mv %{_firmwaredir}/qcom/LENOVO/21BX %{_firmwaredir}/qcom/LENOVO/21BX.xxxnew + mv %{_firmwaredir}/qcom/LENOVO/21BX.xxxold %{_firmwaredir}/qcom/LENOVO/21BX +else %{?regenerate_initrd_post} +fi %postun %{?regenerate_initrd_post} %posttrans +# ugly workaround (bsc#1204103) +if [ -L %{_firmwaredir}/qcom/LENOVO/21BX.xxxnew ]; then + rm -rf %{_firmwaredir}/qcom/LENOVO/21BX + mv %{_firmwaredir}/qcom/LENOVO/21BX.xxxnew %{_firmwaredir}/qcom/LENOVO/21BX +fi %{?regenerate_initrd_posttrans} %post -n ucode-amd diff --git a/kernel-firmware.spec.in b/kernel-firmware.spec.in index 0411ec3..57e32a9 100644 --- a/kernel-firmware.spec.in +++ b/kernel-firmware.spec.in @@ -61,7 +61,9 @@ Source1011: fwtopics.py Source1012: check-topic.py Source1013: update-aliases.py Source1014: README.build +# workarounds Source1100: qcom-post +Source1101: uncompressed-post BuildRequires: fdupes BuildRequires: suse-module-tools Requires(post): /usr/bin/mkdir /usr/bin/touch diff --git a/makespec.sh b/makespec.sh index 2e150d7..643f82c 100644 --- a/makespec.sh +++ b/makespec.sh @@ -33,6 +33,10 @@ define_subpackage () { define_post () { local l="$*" + if [ -z "$l" -a -f uncompressed-post ]; then + cat uncompressed-post + return 0 + fi if [ -n "$l" -a -f "$l"-post ]; then cat "$l"-post return 0 diff --git a/uncompressed-post b/uncompressed-post new file mode 100644 index 0000000..40f338e --- /dev/null +++ b/uncompressed-post @@ -0,0 +1,27 @@ +%pre +# ugly workaround for changing qcom/LENOVO/21BX to a symlink (bsc#1204103) +if [ ! -L %{_firmwaredir}/qcom/LENOVO/21BX ]; then + if [ -d %{_firmwaredir}/qcom/LENOVO/21BX ]; then + mv %{_firmwaredir}/qcom/LENOVO/21BX %{_firmwaredir}/qcom/LENOVO/21BX.xxxold + fi +fi + +%post +# ugly workaround (bsc#1204103) +if [ -d %{_firmwaredir}/qcom/LENOVO/21BX.xxxold ]; then + mv %{_firmwaredir}/qcom/LENOVO/21BX %{_firmwaredir}/qcom/LENOVO/21BX.xxxnew + mv %{_firmwaredir}/qcom/LENOVO/21BX.xxxold %{_firmwaredir}/qcom/LENOVO/21BX +else +%{?regenerate_initrd_post} +fi + +%postun +%{?regenerate_initrd_post} + +%posttrans +# ugly workaround (bsc#1204103) +if [ -L %{_firmwaredir}/qcom/LENOVO/21BX.xxxnew ]; then + rm -rf %{_firmwaredir}/qcom/LENOVO/21BX + mv %{_firmwaredir}/qcom/LENOVO/21BX.xxxnew %{_firmwaredir}/qcom/LENOVO/21BX +fi +%{?regenerate_initrd_posttrans}