|
24 | 24 | %if 0%{?suse_version} >= 1550
|
25 | 25 | %global modprobe_dir /usr/lib/modprobe.d
|
26 | 26 | %global depmod_dir /usr/lib/depmod.d
|
| 27 | +%global with_kernel_sysctl 1 |
| 28 | +# boot_sysctl may be dropped on TW when we can assume that nobody keeps |
| 29 | +# kernel packages around that store sysctl files under /boot |
| 30 | +%bcond_without boot_sysctl |
27 | 31 | %else
|
28 | 32 | %global modprobe_dir /lib/modprobe.d
|
29 | 33 | %global depmod_dir /lib/depmod.d
|
| 34 | +%global with_kernel_sysctl 0 |
| 35 | +%global with_boot_sysctl 1 |
30 | 36 | %endif
|
| 37 | +%global sysctl_dropin %{_unitdir}/systemd-sysctl.service.d/50-kernel-uname_r.conf |
31 | 38 |
|
32 | 39 | # List of legacy file systems to be blacklisted by default
|
33 | 40 | %global fs_blacklist adfs affs bfs befs cramfs efs erofs exofs freevxfs hfs hpfs jfs minix nilfs2 ntfs omfs qnx4 qnx6 sysv ufs
|
@@ -132,9 +139,17 @@ install -pm 755 "regenerate-initrd-posttrans" "%{buildroot}/usr/lib/module-init-
|
132 | 139 | install -d -m 755 "%{buildroot}%{_prefix}/bin"
|
133 | 140 | install -pm 755 kmp-install "%{buildroot}%{_bindir}/"
|
134 | 141 |
|
135 |
| -# systemd service to load /boot/sysctl.conf-`uname -r` |
| 142 | +# systemd service(s) to load kernel-specific sysctl settings |
136 | 143 | install -d -m 755 "%{buildroot}%{_unitdir}/systemd-sysctl.service.d"
|
137 |
| -install -pm 644 50-kernel-uname_r.conf "%{buildroot}%{_unitdir}/systemd-sysctl.service.d" |
| 144 | +echo '[Unit]' >"%{buildroot}%{sysctl_dropin}" |
| 145 | +%if 0%{?with_kernel_sysctl} |
| 146 | +install -m 644 kernel-sysctl.service "%{buildroot}%{_unitdir}" |
| 147 | +echo 'Wants=kernel-sysctl.service' >>"%{buildroot}%{sysctl_dropin}" |
| 148 | +%endif |
| 149 | +%if 0%{?with_boot_sysctl} |
| 150 | +install -m 644 boot-sysctl.service "%{buildroot}%{_unitdir}" |
| 151 | +echo 'Wants=boot-sysctl.service' >>"%{buildroot}%{sysctl_dropin}" |
| 152 | +%endif |
138 | 153 |
|
139 | 154 | # Ensure that the sg driver is loaded early (bsc#1036463)
|
140 | 155 | # Not needed in SLE11, where sg is loaded via udev rule.
|
@@ -208,6 +223,7 @@ exit 0
|
208 | 223 | %{_bindir}/kmp-install
|
209 | 224 | /usr/lib/module-init-tools
|
210 | 225 | %exclude /usr/lib/module-init-tools/weak-modules
|
| 226 | +%{_unitdir}/*.service |
211 | 227 | %{_unitdir}/systemd-sysctl.service.d
|
212 | 228 | %{_modulesloaddir}
|
213 | 229 | %ifarch ppc64 ppc64le
|
|
0 commit comments