0004-default-kernel.patch 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. From ddb9b1b93df3bf75843ab952534a39a7e8dd7711 Mon Sep 17 00:00:00 2001
  2. From: Dorian Stoll <dorian.stoll@tmsp.io>
  3. Date: Sat, 22 Jul 2023 10:41:11 +0200
  4. Subject: [PATCH 4/5] 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 | 33 +++++++++++++++++++++++++++++++++
  9. 1 file changed, 33 insertions(+)
  10. diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
  11. index 890d9225edd8..68b06ba0d4b1 100644
  12. --- a/redhat/kernel.spec.template
  13. +++ b/redhat/kernel.spec.template
  14. @@ -992,6 +992,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.py
  20. +Source4103: 90-linux-surface-default-watchdog.preset
  21. +
  22. ## Patches needed for building this package
  23. %if !%{nopatches}
  24. @@ -1025,6 +1030,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. @@ -1039,6 +1045,13 @@ 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. %package doc
  42. Summary: Various documentation bits found in the kernel source
  43. Group: Documentation
  44. @@ -3170,6 +3183,11 @@ find Documentation -type d | xargs chmod u+w
  45. cd linux-%{KVERREL}
  46. +install -D -m644 "%{SOURCE4100}" -t "%{buildroot}%{_unitdir}"
  47. +install -D -m644 "%{SOURCE4101}" -t "%{buildroot}%{_unitdir}"
  48. +install -D -m755 "%{SOURCE4102}" -t "%{buildroot}%{_bindir}"
  49. +install -D -m755 "%{SOURCE4103}" -t "%{buildroot}%{_presetdir}"
  50. +
  51. # re-define RPM_VMLINUX_H, because it doesn't carry over from %build
  52. RPM_VMLINUX_H="$(cat ../vmlinux_h_path)"
  53. @@ -3441,6 +3459,15 @@ popd
  54. ### scripts
  55. ###
  56. +%post default-watchdog
  57. +%systemd_post linux-surface-default-watchdog.path
  58. +
  59. +%preun default-watchdog
  60. +%systemd_preun linux-surface-default-watchdog.path
  61. +
  62. +%postun default-watchdog
  63. +%systemd_postun_with_restart linux-surface-default-watchdog.path
  64. +
  65. %if %{with_tools}
  66. %post -n %{package_name}-tools-libs
  67. /sbin/ldconfig
  68. @@ -3904,6 +3931,12 @@ fi\
  69. %{_libexecdir}/kselftests
  70. %endif
  71. +%files default-watchdog
  72. +%{_bindir}/linux-surface-default-watchdog.py
  73. +%{_unitdir}/linux-surface-default-watchdog.path
  74. +%{_unitdir}/linux-surface-default-watchdog.service
  75. +%{_presetdir}/90-linux-surface-default-watchdog.preset
  76. +
  77. # empty meta-package
  78. %if %{with_up_base}
  79. %ifnarch %nobuildarches noarch
  80. --
  81. 2.46.0