0004-default-kernel.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. From a45b4c3fcb7d364f236a25e03378a6b03a9cc627 Mon Sep 17 00:00:00 2001
  2. From: Dorian Stoll <dorian.stoll@tmsp.io>
  3. Date: Sat, 3 Jun 2023 11:47:02 +0200
  4. Subject: [PATCH] Install scripts and service files for keeping the surface
  5. kernel the default
  6. Signed-off-by: Dorian Stoll <dorian.stoll@tmsp.io>
  7. ---
  8. redhat/kernel.spec.template | 34 ++++++++++++++++++++++++++++++++++
  9. 1 file changed, 34 insertions(+)
  10. diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
  11. index dc95736a227e..4d6504ca721b 100644
  12. --- a/redhat/kernel.spec.template
  13. +++ b/redhat/kernel.spec.template
  14. @@ -911,6 +911,11 @@ Source4000: README.rst
  15. Source4001: rpminspect.yaml
  16. Source4002: gating.yaml
  17. +Source4100: linux-surface-default-watchdog.path
  18. +Source4101: linux-surface-default-watchdog.service
  19. +Source4102: linux-surface-default-watchdog.sh
  20. +Source4103: 90-linux-surface-default-watchdog.preset
  21. +
  22. ## Patches needed for building this package
  23. %if !%{nopatches}
  24. @@ -944,6 +949,7 @@ Requires(pre): %{initrd_prereq}\
  25. Requires(pre): ((linux-firmware >= 20150904-56.git6ebf5d57) if linux-firmware)\
  26. Recommends: linux-firmware\
  27. Recommends: iptsd\
  28. +Recommends: %{package_name}-default-watchdog\
  29. Requires(preun): systemd >= 200\
  30. Conflicts: xfsprogs < 4.3.0-1\
  31. Conflicts: xorg-x11-drv-vmmouse < 13.0.99\
  32. @@ -958,6 +964,14 @@ AutoProv: yes\
  33. %{nil}
  34. +%package default-watchdog
  35. +Summary: Watchdog service ensuring that the surface kernel stays the default kernel.
  36. +%description default-watchdog
  37. +This package provides a systemd service that will automatically keep
  38. +the surface kernel as the default kernel in GRUB, even if a newer stock
  39. +kernel has been installed.
  40. +
  41. +
  42. %package doc
  43. Summary: Various documentation bits found in the kernel source
  44. Group: Documentation
  45. @@ -2691,6 +2705,11 @@ find Documentation -type d | xargs chmod u+w
  46. cd linux-%{KVERREL}
  47. +install -D -m644 "%{SOURCE4100}" -t "%{buildroot}%{_unitdir}"
  48. +install -D -m644 "%{SOURCE4101}" -t "%{buildroot}%{_unitdir}"
  49. +install -D -m755 "%{SOURCE4102}" -t "%{buildroot}%{_bindir}"
  50. +install -D -m755 "%{SOURCE4103}" -t "%{buildroot}%{_presetdir}"
  51. +
  52. %if %{with_doc}
  53. docdir=$RPM_BUILD_ROOT%{_datadir}/doc/kernel-doc-%{specversion}-%{pkgrelease}
  54. @@ -2938,6 +2957,15 @@ popd
  55. ### scripts
  56. ###
  57. +%post default-watchdog
  58. +%systemd_post linux-surface-default-watchdog.path
  59. +
  60. +%preun default-watchdog
  61. +%systemd_preun linux-surface-default-watchdog.path
  62. +
  63. +%postun default-watchdog
  64. +%systemd_postun_with_restart linux-surface-default-watchdog.path
  65. +
  66. %if %{with_tools}
  67. %post -n %{package_name}-tools-libs
  68. /sbin/ldconfig
  69. @@ -3313,6 +3341,12 @@ fi
  70. %{_libexecdir}/kselftests
  71. %endif
  72. +%files default-watchdog
  73. +%{_bindir}/linux-surface-default-watchdog.sh
  74. +%{_unitdir}/linux-surface-default-watchdog.path
  75. +%{_unitdir}/linux-surface-default-watchdog.service
  76. +%{_presetdir}/90-linux-surface-default-watchdog.preset
  77. +
  78. # empty meta-package
  79. %ifnarch %nobuildarches noarch
  80. %files
  81. --
  82. 2.40.1