-
Notifications
You must be signed in to change notification settings - Fork 621
Expand file tree
/
Copy pathsystemd.spec
More file actions
4135 lines (3232 loc) · 168 KB
/
systemd.spec
File metadata and controls
4135 lines (3232 loc) · 168 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# We ship a .pc file but don't want to have a dep on pkg-config. We
# strip the automatically generated dep here and instead co-own the
# directory.
%global __requires_exclude pkg-config
%global pkgdir %{_prefix}/lib/systemd
%global system_unit_dir %{pkgdir}/system
%global user_unit_dir %{pkgdir}/user
%if 0%{?__isa_bits} == 64
%global elf_bits (64bit)
%global elf_suffix ()%{elf_bits}
%endif
%bcond bzip2 1
%bcond gnutls 0
%bcond lz4 1
%bcond xz 1
%bcond zlib 1
%bcond zstd 1
# Bootstrap may be needed to break circular dependencies with cryptsetup,
# e.g. when re-building cryptsetup on a json-c SONAME-bump.
%bcond bootstrap 0
%bcond tests 1
%bcond lto 1
# Support for quick builds with rpmbuild --build-in-place.
# See README.build-in-place.
%bcond inplace 0
# Custom settings for Azure Linux
# We don't need to support FIDO hardware for cryptenroll/cryptsetup
%bcond libfido2 0
# This is needed only to include a splash image when building a UKI with ukify
%bcond pillow 0
# We don't need to generate any QR codes
%bcond qrencode 0
# This is only used for udev tracing
%bcond systemtap 0
# We don't need to support Xen
%bcond xen 0
Name: systemd
Url: https://systemd.io
%if %{without inplace}
Version: 255
%else
# determine the build information from local checkout
Version: %(tools/meson-vcs-tag.sh . error | sed -r 's/-([0-9])/.^\1/; s/-g/_g/')
%endif
Release: 27%{?dist}
# FIXME - hardcode to 'stable' for now as that's what we have in our blobstore
%global stable 1
# %%global stable %%(c="%%version"; [ "$c" = "${c#*.*}" ]; echo $?)
# For a breakdown of the licensing, see README
License: LGPL-2.1-or-later AND MIT AND GPL-2.0-or-later
Vendor: Microsoft Corporation
Distribution: Azure Linux
Summary: System and Service Manager
%if %{undefined version_no_tilde}
# This is defined in 'macros.rust-srpm' which we may not have installed.
# However, we don't plan on using any RC releases, so we should be able to just define it directly to the version.
%define version_no_tilde %version
%endif
# download tarballs with "spectool -g systemd.spec"
%if %{defined commit}
Source0: https://github.com/systemd/systemd%{?stable:-stable}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
%else
%if 0%{?stable}
Source0: https://github.com/systemd/systemd-stable/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz
%else
Source0: https://github.com/systemd/systemd/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz
%endif
%endif
# This file must be available before %%prep.
# It is generated during systemd build and can be found in build/src/core/.
Source1: triggers.systemd
Source2: split-files.py
# Prevent accidental removal of the systemd package
Source4: yum-protect-systemd.conf
Source6: sysctl.conf.README
Source7: systemd-journal-remote.xml
Source8: systemd-journal-gatewayd.xml
Source9: 20-yama-ptrace.conf
Source10: systemd-udev-trigger-no-reload.conf
Source14: 10-oomd-defaults.conf
Source15: 10-oomd-per-slice-defaults.conf
Source16: 10-timeout-abort.conf
Source17: 10-map-count.conf
Source18: 10-console-messages.conf
Source21: macros.sysusers
Source22: sysusers.attr
Source23: sysusers.prov
Source24: sysusers.generate-pre.sh
Source25: 98-default-mac-none.link
%if 0
GIT_DIR=../../src/systemd/.git git format-patch-ab --no-signature -M -N v235..v235-stable
i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done|xclip
GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[67]* hwdb/parse_hwdb.py >hwdb.patch
%endif
# Backports of patches from upstream (0000–0499)
#
# Any patches which are "in preparation" upstream should be listed here, rather
# than in the next section. Packit CI will drop any patches in this range before
# applying upstream pull requests.
# Work-around for dracut issue: run generators directly when we are in initrd
# https://bugzilla.redhat.com/show_bug.cgi?id=2164404
# Drop when dracut-060 is available.
Patch0001: https://github.com/systemd/systemd/pull/26494.patch
# Those are downstream-only patches, but we don't want them in packit builds:
# https://bugzilla.redhat.com/show_bug.cgi?id=1738828
%if 0%{?azl}
# On Azure, it is recommended to use an i/o scheduler that passes the scheduling
# decisions to the underlying Hyper-V hypervisor. In our case, we should use
# the "none" scheduler, which is also ideal for fast random I/O devices like
# NVMe. So we update Fedora's bfq patch to change the udev rule to select "none"
# instead of Fedora's default Budget Fair Queuing (bfq) and rename the patch
# from referencing "bfq" to "none".
Patch0490: use-none-scheduler.patch
%endif
# Adjust upstream config to use our shared stack
# NOTE: the patch was based on the fedora patch, but renamed to
# 'azurelinux-...' and modified for our 'system-*' pam files
Patch0491: azurelinux-use-system-auth-in-pam-systemd-user.patch
# Patches for Azure Linux
Patch0900: do-not-test-openssl-sm3.patch
Patch0901: networkd-default-use-domains.patch
Patch0902: CVE-2023-7008.patch
Patch0903: CVE-2025-4598.patch
Patch0904: fix-stackoverflow-when-dropping-tclass-or-qdisc.patch
Patch0905: ipc-call-0001-path-util-add-flavour-of-path_startswith-that-leaves.patch
Patch0906: ipc-call-0003-core-cgroup-avoid-one-unnecessary-strjoina.patch
Patch0907: ipc-call-0002-path-util-invert-PATH_STARTSWITH_ACCEPT_DOT_DOT-flag.patch
Patch0908: ipc-call-0004-core-validate-input-cgroup-path-more-prudently.patch
Patch0909: fix-pcrlock-hyperv-hash-algorithm-ordering.patch
%ifarch %{ix86} x86_64 aarch64
%global want_bootloader 1
%endif
# additional BuildRequires for Azure Linux
BuildRequires: glibc-devel
BuildRequires: pkgconfig(libcrypt)
BuildRequires: p11-kit-devel
BuildRequires: polkit-devel
# This is required for /etc/os-release, as the systemd uses this during src/boot/efi build
BuildRequires: azurelinux-release
# This is required because...toolkit
BuildRequires: systemd-bootstrap-rpm-macros
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: clang
BuildRequires: coreutils
BuildRequires: libcap-devel
BuildRequires: libmount-devel
BuildRequires: pkgconfig(fdisk)
BuildRequires: libpwquality-devel
BuildRequires: pam-devel
BuildRequires: libselinux-devel
BuildRequires: audit-libs-devel
%if %{without bootstrap}
BuildRequires: cryptsetup-devel
%endif
BuildRequires: dbus-devel
BuildRequires: /sbin/sfdisk
# /usr/bin/getfacl is needed by test-acl-util
BuildRequires: /usr/bin/getfacl
BuildRequires: libacl-devel
BuildRequires: gobject-introspection-devel
BuildRequires: libblkid-devel
%if %{with xz}
BuildRequires: xz-devel
BuildRequires: xz
%endif
%if %{with lz4}
BuildRequires: lz4-devel
BuildRequires: lz4
%endif
%if %{with bzip2}
BuildRequires: bzip2-devel
%endif
%if %{with zstd}
BuildRequires: libzstd-devel
%endif
BuildRequires: libidn2-devel
BuildRequires: libcurl-devel
BuildRequires: kmod-devel
BuildRequires: elfutils-devel
BuildRequires: openssl-devel
%if %{with gnutls}
BuildRequires: gnutls-devel
%endif
%if %{with qrencode}
BuildRequires: qrencode-devel
%endif
BuildRequires: libmicrohttpd-devel
BuildRequires: libxkbcommon-devel
BuildRequires: iptables-devel
%if %{with libfido2}
BuildRequires: pkgconfig(libfido2)
%endif
BuildRequires: pkgconfig(tss2-esys)
BuildRequires: pkgconfig(tss2-rc)
BuildRequires: pkgconfig(tss2-mu)
BuildRequires: pkgconfig(libbpf)
%if %{with systemtap}
# This is required for udev tracing
BuildRequires: systemtap-sdt-devel
%endif
BuildRequires: libxslt
BuildRequires: docbook-style-xsl
BuildRequires: pkgconfig
BuildRequires: gperf
BuildRequires: gawk
BuildRequires: tree
BuildRequires: hostname
BuildRequires: python3
BuildRequires: python3-devel
BuildRequires: python3dist(jinja2)
BuildRequires: python3dist(lxml)
BuildRequires: python3dist(pefile)
%if %{with pillow}
BuildRequires: python3dist(pillow)
%endif
BuildRequires: python3dist(pytest-flakes)
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(zstd)
%if 0%{?want_bootloader}
BuildRequires: python3dist(pyelftools)
%endif
%if 0%{?with_check}
BuildRequires: python3dist(pyflakes)
%endif
# gzip and lzma are provided by the stdlib
BuildRequires: firewalld-filesystem
BuildRequires: libseccomp-devel
BuildRequires: meson >= 0.43
BuildRequires: gettext
# We use RUNNING_ON_VALGRIND in tests, so the headers need to be available
BuildRequires: valgrind-devel
BuildRequires: pkgconfig(bash-completion)
BuildRequires: perl
BuildRequires: perl(IPC::SysV)
%ifnarch %ix86
# bpftool is not built for i368
BuildRequires: bpftool
%global have_bpf 1
%endif
%if %{with xen}
%ifarch x86_64 aarch64
%global have_xen 1
# That package is only built for those two architectures
BuildRequires: xen-devel
%endif
%endif
Requires(post): coreutils
Requires(post): grep
# systemd-machine-id-setup requires libssl
Requires(post): openssl-libs
Requires: dbus >= 1.9.18
Requires: %{name}-pam%{_isa} = %{version}-%{release}
# FIXME - our toolkit can't handle logical deps like this
#Requires(meta): (%%{name}-rpm-macros = %%{version}-%%{release} if rpm-build)
Requires(meta): %{name}-rpm-macros = %{version}-%{release}
Requires: %{name}-libs%{_isa} = %{version}-%{release}
Recommends: %{name}-networkd = %{version}-%{release}
Recommends: %{name}-resolved = %{version}-%{release}
Recommends: diffutils
# FIXME - our toolkit can't handle logical deps like this
#Requires: (util-linux-core or util-linux)
Requires: util-linux
Recommends: libxkbcommon%{_isa}
Provides: /bin/systemctl
Provides: /sbin/shutdown
Provides: syslog
Provides: systemd-units = %{version}-%{release}
Obsoletes: systemd-bootstrap <= %{version}-%{release}
Obsoletes: system-setup-keyboard < 0.9
Provides: system-setup-keyboard = 0.9
# systemd-sysv-convert was removed in f20: https://fedorahosted.org/fpc/ticket/308
Obsoletes: systemd-sysv < 206
# self-obsoletes so that dnf will install new subpackages on upgrade (#1260394)
Obsoletes: %{name} < 249~~
Provides: systemd-sysv = 206
Conflicts: initscripts < 9.56.1
%if 0%{?fedora}
Conflicts: fedora-release < 23-0.12
%endif
# Make sure that dracut supports systemd-executor and the renames done for v255
Conflicts: dracut < 059
Obsoletes: timedatex < 0.6-3
Provides: timedatex = 0.6-3
Conflicts: %{name}-standalone-repart < %{version}-%{release}^
Provides: %{name}-repart = %{version}-%{release}
Conflicts: %{name}-standalone-tmpfiles < %{version}-%{release}^
Provides: %{name}-tmpfiles = %{version}-%{release}
Conflicts: %{name}-standalone-sysusers < %{version}-%{release}^
Provides: %{name}-sysusers = %{version}-%{release}
Conflicts: %{name}-standalone-shutdown < %{version}-%{release}^
Provides: %{name}-shutdown = %{version}-%{release}
# Recommends to replace normal Requires deps for stuff that is dlopen()ed
Recommends: libpcre2-8.so.0%{?elf_suffix}
Recommends: libpwquality.so.1%{?elf_suffix}
Recommends: libpwquality.so.1(LIBPWQUALITY_1.0)%{?elf_bits}
%if %{with qrencode}
Recommends: libqrencode.so.4%{?elf_suffix}
%endif
Recommends: libbpf.so.1%{?elf_suffix}
Recommends: libbpf.so.1(LIBBPF_0.4.0)%{?elf_bits}
# used by systemd-coredump and systemd-analyze
Recommends: libdw.so.1%{?elf_suffix}
Recommends: libdw.so.1(ELFUTILS_0.186)%{?elf_bits}
Recommends: libelf.so.1%{?elf_suffix}
Recommends: libelf.so.1(ELFUTILS_1.7)%{?elf_bits}
# used by dissect, integritysetup, veritysetyp, growfs, repart, cryptenroll, home
Recommends: libcryptsetup.so.12%{?elf_suffix}
Recommends: libcryptsetup.so.12(CRYPTSETUP_2.4)%{?elf_bits}
%description
systemd is a system and service manager that runs as PID 1 and starts the rest
of the system. It provides aggressive parallelization capabilities, uses socket
and D-Bus activation for starting services, offers on-demand starting of
daemons, keeps track of processes using Linux control groups, maintains mount
and automount points, and implements an elaborate transactional dependency-based
service control logic. systemd supports SysV and LSB init scripts and works as a
replacement for sysvinit. Other parts of this package are a logging daemon,
utilities to control basic system configuration like the hostname, date, locale,
maintain a list of logged-in users, system accounts, runtime directories and
settings, and a logging daemons.
%if 0%{?stable}
This package was built from the %(c=%version; echo "v${c%.*}-stable") branch of systemd.
%endif
%package libs
Summary: systemd libraries
License: LGPL-2.1-or-later AND MIT
Obsoletes: libudev < 183
Obsoletes: systemd < 185-4
Conflicts: systemd < 185-4
Obsoletes: systemd-compat-libs < 230
Obsoletes: nss-myhostname < 0.4
Provides: nss-myhostname = 0.4
Provides: nss-myhostname%{_isa} = 0.4
Obsoletes: systemd-bootstrap-libs <= %{version}-%{release}
%description libs
Libraries for systemd and udev.
%package pam
Summary: systemd PAM module
Requires: %{name} = %{version}-%{release}
%description pam
Systemd PAM module registers the session with systemd-logind.
%package rpm-macros
Summary: Macros that define paths and scriptlets related to systemd
BuildArch: noarch
Obsoletes: systemd-bootstrap-rpm-macros <= %{version}-%{release}
%description rpm-macros
Just the definitions of rpm macros.
See
https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_systemd
for information how to use those macros.
%package devel
Summary: Development headers for systemd
License: LGPL-2.1-or-later AND MIT
Requires: %{name}-libs%{_isa} = %{version}-%{release}
# FIXME - our toolkit can't handle logical deps like this
#Requires(meta): (%%{name}-rpm-macros = %%{version}-%%{release} if rpm-build)
Requires(meta): %{name}-rpm-macros = %{version}-%{release}
Provides: libudev-devel = %{version}
Provides: libudev-devel%{_isa} = %{version}
Obsoletes: libudev-devel < 183
Obsoletes: systemd-bootstrap-devel <= %{version}-%{release}
%description devel
Development headers and auxiliary files for developing applications linking
to libudev or libsystemd.
%package udev
Summary: Rule-based device node and kernel event manager
License: LGPL-2.1-or-later
Requires: systemd%{_isa} = %{version}-%{release}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Requires(post): grep
Requires: kmod >= 18-4
# https://bodhi.fedoraproject.org/updates/FEDORA-2020-dd43dd05b1
Obsoletes: systemd < 245.6-1
Provides: udev = %{version}
Provides: udev%{_isa} = %{version}
Obsoletes: udev < 183
# FIXME - our toolkit can't handle logical deps like this
#Requires: (grubby > 8.40-72 if grubby)
#Requires: (sdubby > 1.0-3 if sdubby)
# Recommends to replace normal Requires deps for stuff that is dlopen()ed
# used by dissect, integritysetup, veritysetyp, growfs, repart, cryptenroll, home
Recommends: libcryptsetup.so.12%{?elf_suffix}
Recommends: libcryptsetup.so.12(CRYPTSETUP_2.4)%{?elf_bits}
# used by systemd-coredump and systemd-analyze
Recommends: libdw.so.1%{?elf_suffix}
Recommends: libdw.so.1(ELFUTILS_0.186)%{?elf_bits}
Recommends: libelf.so.1%{?elf_suffix}
Recommends: libelf.so.1(ELFUTILS_1.7)%{?elf_bits}
# used by home, cryptsetup, cryptenroll, logind
%if %{with libfido2}
Recommends: libfido2.so.1%{?elf_suffix}
%endif
Recommends: libp11-kit.so.0%{?elf_suffix}
Recommends: libtss2-esys.so.0%{?elf_suffix}
Recommends: libtss2-mu.so.0%{?elf_suffix}
Recommends: libtss2-rc.so.0%{?elf_suffix}
# https://bugzilla.redhat.com/show_bug.cgi?id=1377733#c9
Suggests: systemd-bootchart
# https://bugzilla.redhat.com/show_bug.cgi?id=1408878
Requires: kbd
# https://bugzilla.redhat.com/show_bug.cgi?id=1753381
Provides: u2f-hidraw-policy = 1.0.2-40
Obsoletes: u2f-hidraw-policy < 1.0.2-40
# self-obsoletes to install both packages after split of systemd-boot
Obsoletes: systemd-udev < 252.2^
%description udev
This package contains systemd-udev and the rules and hardware database needed to
manage device nodes. This package is necessary on physical machines and in
virtual machines, but not in containers.
This package also provides systemd-timesyncd, a network time protocol daemon.
It also contains tools to manage encrypted home areas and secrets bound to the
machine, and to create or grow partitions and make file systems automatically.
%if 0%{?want_bootloader}
%package ukify
Summary: Tool to build Unified Kernel Images
Requires: %{name} = %{version}-%{release}
Requires: python3dist(pefile)
Requires: python3dist(zstd)
Requires: python3dist(cryptography)
%if %{with pillow}
Recommends: python3dist(pillow)
%endif
BuildArch: noarch
%description ukify
This package provides ukify, a script that combines a kernel image, an initrd,
with a command line, and possibly PCR measurements and other metadata, into a
Unified Kernel Image (UKI).
%package boot
Summary: UEFI boot manager (unsigned version)
Provides: systemd-boot-%{efi_arch} = %version-%release
Provides: systemd-boot = %version-%release
Provides: systemd-boot%{_isa} = %version-%release
# A provides with just the version, no release or dist, used to build systemd-boot
Provides: version(systemd-boot) = %version
Provides: version(systemd-boot)%{_isa} = %version
# self-obsoletes to install both packages after split of systemd-boot
Obsoletes: systemd-udev < 252.2^
Conflicts: grub2-efi-binary
%description boot
systemd-boot (short: sd-boot) is a simple UEFI boot manager. It provides a
graphical menu to select the entry to boot and an editor for the kernel command
line. systemd-boot supports systems with UEFI firmware only.
This package contains the unsigned version. Install systemd-boot instead to get
the version that works with Secure Boot.
%endif
%package container
# Name is the same as in Debian
Summary: Tools for containers and VMs
Requires: %{name}%{_isa} = %{version}-%{release}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
# obsolete parent package so that dnf will install new subpackage on upgrade (#1260394)
Obsoletes: %{name} < 229-5
# Bias the system towards libcurl-minimal if nothing pulls in full libcurl (#1997040)
Suggests: libcurl-minimal
License: LGPL-2.1-or-later
%description container
Systemd tools to spawn and manage containers and virtual machines.
This package contains systemd-nspawn, systemd-vmspawn, machinectl,
systemd-machined, and systemd-importd.
%package journal-remote
# Name is the same as in Debian
Summary: Tools to send journal events over the network
Requires: %{name}%{_isa} = %{version}-%{release}
License: LGPL-2.1-or-later
Requires: firewalld-filesystem
Provides: %{name}-journal-gateway = %{version}-%{release}
Provides: %{name}-journal-gateway%{_isa} = %{version}-%{release}
Obsoletes: %{name}-journal-gateway < 227-7
# Bias the system towards libcurl-minimal if nothing pulls in full libcurl (#1997040)
Suggests: libcurl-minimal
%description journal-remote
Programs to forward journal entries over the network, using encrypted HTTP, and
to write journal files from serialized journal contents.
This package contains systemd-journal-gatewayd, systemd-journal-remote, and
systemd-journal-upload.
%package networkd
Summary: System daemon that manages network configurations
Requires: %{name}%{_isa} = %{version}-%{release}
License: LGPL-2.1-or-later
# https://src.fedoraproject.org/rpms/systemd/pull-request/34
Obsoletes: systemd < 246.6-2
Recommends: libidn2.so.0%{?elf_suffix}
Recommends: libidn2.so.0(IDN2_0.0.0)%{?elf_bits}
%description networkd
systemd-networkd is a system service that manages networks. It detects and
configures network devices as they appear, as well as creating virtual network
devices.
%package networkd-defaults
Summary: Configure network interfaces with networkd by default
Requires: %{name}-networkd = %{version}-%{release}
License: MIT-0
BuildArch: noarch
%description networkd-defaults
This package contains a set of config files for systemd-networkd that cause it
to configure network interfaces by default. Note that systemd-networkd needs to
enabled for this to have any effect.
%package resolved
Summary: Network Name Resolution manager
Requires: %{name}%{_isa} = %{version}-%{release}
Obsoletes: %{name} < 249~~
Requires: libidn2.so.0%{?elf_suffix}
Requires: libidn2.so.0(IDN2_0.0.0)%{?elf_bits}
Requires(posttrans): grep
%description resolved
systemd-resolved is a system service that provides network name resolution to
local applications. It implements a caching and validating DNS/DNSSEC stub
resolver, as well as an LLMNR and MulticastDNS resolver and responder.
%package oomd-defaults
Summary: Configuration files for systemd-oomd
Requires: %{name}-udev = %{version}-%{release}
License: LGPL-2.1-or-later
BuildArch: noarch
%description oomd-defaults
A set of drop-in files for systemd units to enable action from systemd-oomd,
a userspace out-of-memory (OOM) killer.
%package tests
Summary: Internal unit tests for systemd
Requires: %{name}%{_isa} = %{version}-%{release}
# This dependency is provided transitively. Also add it explicitly to
# appease rpminspect, https://github.com/rpminspect/rpminspect/issues/1231:
Requires: %{name}-libs%{_isa} = %{version}-%{release}
License: LGPL-2.1-or-later
%description tests
"Installed tests" that are usually run as part of the build system. They can be
useful to test systemd internals.
%package standalone-repart
Summary: Standalone systemd-repart binary for use on systems without systemd
Provides: %{name}-repart = %{version}-%{release}
RemovePathPostfixes: .standalone
%description standalone-repart
Standalone systemd-repart binary with no dependencies on the systemd-shared library or
other libraries from systemd-libs. This package conflicts with the main systemd
package and is meant for use on systems without systemd.
%package standalone-tmpfiles
Summary: Standalone systemd-tmpfiles binary for use on systems without systemd
Provides: %{name}-tmpfiles = %{version}-%{release}
RemovePathPostfixes: .standalone
%description standalone-tmpfiles
Standalone systemd-tmpfiles binary with no dependencies on the systemd-shared library or
other libraries from systemd-libs. This package conflicts with the main systemd
package and is meant for use on systems without systemd.
%package standalone-sysusers
Summary: Standalone systemd-sysusers binary for use on systems without systemd
Provides: %{name}-sysusers = %{version}-%{release}
RemovePathPostfixes: .standalone
%description standalone-sysusers
Standalone systemd-sysusers binary with no dependencies on the systemd-shared library or
other libraries from systemd-libs. This package conflicts with the main systemd
package and is meant for use on systems without systemd.
%package standalone-shutdown
Summary: Standalone systemd-shutdown binary for use on systems without systemd
Provides: %{name}-shutdown = %{version}-%{release}
RemovePathPostfixes: .standalone
%description standalone-shutdown
Standalone systemd-shutdown binary with no dependencies on the systemd-shared library or
other libraries from systemd-libs. This package conflicts with the main systemd
package and is meant for use in exitrds.
%prep
%autosetup -n %{?commit:%{name}%[%stable?"-stable":""]-%{commit}}%{!?commit:%{name}%[%stable?"-stable":""]-%{version_no_tilde}} -p1
%build
CONFIGURE_OPTS=(
-Dmode=release
-Dsysvinit-path=/etc/rc.d/init.d
-Drc-local=/etc/rc.d/rc.local
-Dntp-servers=
-Ddns-servers=
-Duser-path=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
-Dservice-watchdog=
-Ddev-kvm-mode=0666
-Dkmod=enabled
-Dxkbcommon=enabled
-Dblkid=enabled
-Dfdisk=enabled
-Dseccomp=enabled
-Dima=true
-Dselinux=enabled
-Dbpf-framework=%[0%{?have_bpf}?"enabled":"disabled"]
-Dapparmor=disabled
-Dpolkit=enabled
-Dxz=%[%{with xz}?"enabled":"disabled"]
-Dzlib=%[%{with zlib}?"enabled":"disabled"]
-Dbzip2=%[%{with bzip2}?"enabled":"disabled"]
-Dlz4=%[%{with lz4}?"enabled":"disabled"]
-Dzstd=%[%{with zstd}?"enabled":"disabled"]
-Dpam=enabled
-Dacl=enabled
-Dsmack=true
-Dopenssl=enabled
-Dcryptolib=openssl
-Dp11kit=enabled
-Dgcrypt=disabled
-Daudit=enabled
-Delfutils=enabled
-Dlibcryptsetup=%[%{with bootstrap}?"disabled":"enabled"]
-Delfutils=enabled
-Dpwquality=enabled
-Dqrencode=%[%{with qrencode}?"enabled":"disabled"]
-Dgnutls=%[%{with gnutls}?"enabled":"disabled"]
-Dmicrohttpd=enabled
-Dvmspawn=enabled
-Dlibidn2=enabled
-Dlibiptc=disabled
-Dlibcurl=enabled
-Dlibfido2=%[%{with libfido2}?"enabled":"disabled"]
-Dxenctrl=%[0%{?have_xen}?"enabled":"disabled"]
-Defi=true
-Dtpm=true
-Dtpm2=enabled
-Dhwdb=true
-Dsysusers=true
-Dstandalone-binaries=true
-Ddefault-kill-user-processes=false
-Dfirst-boot-full-preset=true
-Ddefault-network=true
-Dtests=unsafe
-Dinstall-tests=true
-Dtty-gid=5
-Dusers-gid=100
-Dnobody-user=nobody
-Dnobody-group=nobody
-Dcompat-mutable-uid-boundaries=true
-Dsplit-bin=true
-Db_lto=%[%{with lto}?"true":"false"]
-Db_ndebug=false
-Dman=enabled
-Dversion-tag=%{version}-%{release}
# https://bugzilla.redhat.com/show_bug.cgi?id=1906010
-Dshared-lib-tag=%{version_no_tilde}-%{release}
-Dfallback-hostname="localhost"
-Ddefault-dnssec=no
-Ddefault-dns-over-tls=no
# https://bugzilla.redhat.com/show_bug.cgi?id=1867830
-Ddefault-mdns=no
%if 0%{?azl}
# By default, disable llmnr to prevent llmnr poisoning MitM attacks
-Ddefault-llmnr=no
%else
-Ddefault-llmnr=resolve
%endif
# https://bugzilla.redhat.com/show_bug.cgi?id=2028169
-Dstatus-unit-format-default=combined
# https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer
-Ddefault-timeout-sec=45
-Ddefault-user-timeout-sec=45
-Doomd=true
-Dadm-gid=4
-Daudio-gid=63
-Dcdrom-gid=11
-Ddialout-gid=18
-Ddisk-gid=6
-Dinput-gid=104
-Dkmem-gid=9
-Dkvm-gid=36
-Dlp-gid=7
-Drender-gid=105
-Dsgx-gid=106
-Dtape-gid=33
-Dtty-gid=5
-Dusers-gid=100
-Dutmp-gid=22
-Dvideo-gid=39
-Dwheel-gid=10
-Dsystemd-journal-gid=190
-Dsystemd-network-uid=192
-Dsystemd-resolve-uid=193
# -Dsystemd-timesync-uid=, not set yet
# For now, let's build the bootloader in the same places where we
# built with gnu-efi. Later on, we might want to extend coverage, but
# considering that that support is untested, let's not do this now.
# Note, ukify requires bootloader, let's also explicitly enable/disable it
# here for https://github.com/systemd/systemd/pull/24175.
-Dbootloader=%[%{?want_bootloader}?"enabled":"disabled"]
-Dukify=%[%{?want_bootloader}?"enabled":"disabled"]
)
%if %{without lto}
%global _lto_cflags %nil
%endif
# Do configuration. If doing an inplace build, try to do
# reconfiguration to pick up new options.
%if %{with inplace}
command -v ccache 2>/dev/null && { CC="${CC:-ccache %__cc}"; CXX="${CXX:-ccache %__cxx}"; }
[ -e %{_vpath_builddir}/build.ninja ] &&
%__meson configure %{_vpath_builddir} "${CONFIGURE_OPTS[@]}" ||
%endif
{ %meson "${CONFIGURE_OPTS[@]}"; }
%meson_build
new_triggers=%{_vpath_builddir}/src/rpm/triggers.systemd.sh
if ! diff -u %{SOURCE1} ${new_triggers}; then
echo -e "\n\n\nWARNING: triggers.systemd in Source1 is different!"
echo -e " cp $PWD/${new_triggers} %{SOURCE1}\n\n\n"
sleep 5
fi
sed -r 's|/system/|/user/|g' %{SOURCE16} >10-timeout-abort.conf.user
%install
%meson_install
# udev links
mkdir -p %{buildroot}/%{_sbindir}
ln -sf ../bin/udevadm %{buildroot}%{_sbindir}/udevadm
# Compatiblity and documentation files
touch %{buildroot}/etc/crypttab
chmod 600 %{buildroot}/etc/crypttab
# /etc/sysctl.conf compat
install -Dm0644 %{SOURCE6} %{buildroot}/etc/sysctl.conf
ln -s ../sysctl.conf %{buildroot}/etc/sysctl.d/99-sysctl.conf
# Make sure these directories are properly owned
mkdir -p %{buildroot}%{system_unit_dir}/basic.target.wants
mkdir -p %{buildroot}%{system_unit_dir}/default.target.wants
mkdir -p %{buildroot}%{system_unit_dir}/dbus.target.wants
mkdir -p %{buildroot}%{system_unit_dir}/syslog.target.wants
mkdir -p %{buildroot}/run
mkdir -p %{buildroot}%{_localstatedir}/log
touch %{buildroot}%{_localstatedir}/log/lastlog
chmod 0664 %{buildroot}%{_localstatedir}/log/lastlog
touch %{buildroot}/run/utmp
touch %{buildroot}%{_localstatedir}/log/{w,b}tmp
# Make sure the user generators dir exists too
mkdir -p %{buildroot}%{pkgdir}/system-generators
mkdir -p %{buildroot}%{pkgdir}/user-generators
# Create new-style configuration files so that we can ghost-own them
touch %{buildroot}%{_sysconfdir}/hostname
touch %{buildroot}%{_sysconfdir}/vconsole.conf
touch %{buildroot}%{_sysconfdir}/locale.conf
touch %{buildroot}%{_sysconfdir}/machine-id
touch %{buildroot}%{_sysconfdir}/machine-info
touch %{buildroot}%{_sysconfdir}/localtime
mkdir -p %{buildroot}%{_sysconfdir}/X11/xorg.conf.d
touch %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/00-keyboard.conf
# Make sure the shutdown/sleep drop-in dirs exist
mkdir -p %{buildroot}%{pkgdir}/system-shutdown/
mkdir -p %{buildroot}%{pkgdir}/system-sleep/
# Make sure directories in /var exist
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/coredump
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/catalog
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/backlight
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/rfkill
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/linger
mkdir -p %{buildroot}%{_localstatedir}/lib/private
mkdir -p %{buildroot}%{_localstatedir}/log/private
mkdir -p %{buildroot}%{_localstatedir}/cache/private
mkdir -p %{buildroot}%{_localstatedir}/lib/private/systemd/journal-upload
mkdir -p %{buildroot}%{_localstatedir}/lib/systemd/timesync
ln -s ../private/systemd/journal-upload %{buildroot}%{_localstatedir}/lib/systemd/journal-upload
mkdir -p %{buildroot}%{_localstatedir}/log/journal
touch %{buildroot}%{_localstatedir}/lib/systemd/catalog/database
touch %{buildroot}%{_sysconfdir}/udev/hwdb.bin
touch %{buildroot}%{_localstatedir}/lib/systemd/random-seed
touch %{buildroot}%{_localstatedir}/lib/systemd/timesync/clock
touch %{buildroot}%{_localstatedir}/lib/private/systemd/journal-upload/state
# Install yum protection fragment
install -Dm0644 %{SOURCE4} %{buildroot}/etc/dnf/protected.d/systemd.conf
install -Dm0644 -t %{buildroot}/usr/lib/firewalld/services/ %{SOURCE7} %{SOURCE8}
# Install additional docs
# https://bugzilla.redhat.com/show_bug.cgi?id=1234951
install -Dm0644 -t %{buildroot}%{_pkgdocdir}/ %{SOURCE9}
# https://bugzilla.redhat.com/show_bug.cgi?id=1378974
install -Dm0644 -t %{buildroot}%{system_unit_dir}/systemd-udev-trigger.service.d/ %{SOURCE10}
# systemd-oomd default configuration
install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/oomd.conf.d/ %{SOURCE14}
install -Dm0644 -t %{buildroot}%{system_unit_dir}/system.slice.d/ %{SOURCE15}
install -Dm0644 -t %{buildroot}%{user_unit_dir}/slice.d/ %{SOURCE15}
# https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer
install -Dm0644 -t %{buildroot}%{system_unit_dir}/service.d/ %{SOURCE16}
install -Dm0644 10-timeout-abort.conf.user %{buildroot}%{user_unit_dir}/service.d/10-timeout-abort.conf
# https://fedoraproject.org/wiki/Changes/IncreaseVmMaxMapCount
install -Dm0644 -t %{buildroot}%{_prefix}/lib/sysctl.d/ %{SOURCE17}
%if 0%{?azl}
install -Dm0644 -t %{buildroot}%{_prefix}/lib/sysctl.d/ %{SOURCE18}
%endif
sed -i 's|#!/usr/bin/env python3|#!%{__python3}|' %{buildroot}/usr/lib/systemd/tests/run-unit-tests.py
install -m 0644 -D -t %{buildroot}%{_rpmconfigdir}/macros.d/ %{SOURCE21}
install -m 0644 -D -t %{buildroot}%{_rpmconfigdir}/fileattrs/ %{SOURCE22}
install -m 0755 -D -t %{buildroot}%{_rpmconfigdir}/ %{SOURCE23}
install -m 0755 -D -t %{buildroot}%{_rpmconfigdir}/ %{SOURCE24}
# https://bugzilla.redhat.com/show_bug.cgi?id=2107754
install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/network/ %{SOURCE25}
ln -s --relative %{buildroot}%{_bindir}/kernel-install %{buildroot}%{_sbindir}/installkernel
%find_lang %{name}
# Split files in build root into rpms
python3 %{SOURCE2} %buildroot %{!?want_bootloader:--no-bootloader}
%if 0%{?want_bootloader}
mkdir -p %{buildroot}/boot/efi/EFI/BOOT
%ifarch x86_64
cp %{buildroot}/usr/lib/systemd/boot/efi/systemd-bootx64.efi %{buildroot}/boot/efi/EFI/BOOT/grubx64.efi
%elifarch aarch64
cp %{buildroot}/usr/lib/systemd/boot/efi/systemd-bootaa64.efi %{buildroot}/boot/efi/EFI/BOOT/grubaa64.efi
%endif
%endif
%check
%if %{with tests}
meson test -C %{_vpath_builddir} -t 6 --print-errorlogs
%endif
#############################################################################################
%include %{SOURCE1}
%post
systemd-machine-id-setup &>/dev/null || :
# FIXME: move to %postun. We want to restart systemd *after* removing
# files from the old rpm. Right now we may still have bits the old
# setup if the files are not present in the new version. But before
# implement restarting of *other* services after the transaction, moving
# this would make things worse, increasing the number of warnings we get
# about needed daemon-reload.
systemctl daemon-reexec &>/dev/null || {
# systemd v239 had bug #9553 in D-Bus authentication of the private socket,
# which was later fixed in v240 by #9625.
#
# The end result is that a `systemctl daemon-reexec` call as root will fail
# when upgrading from systemd v239, which means the system will not start
# running the new version of systemd after this post install script runs.
#
# To work around this issue, let's fall back to using a `kill -TERM 1` to
# re-execute the daemon when the `systemctl daemon-reexec` call fails.
#
# In order to prevent issues when the reason why the daemon-reexec failed is
# not the aforementioned bug, let's only use this fallback when:
# - we're upgrading this RPM package; and
# - we confirm that systemd is running as PID1 on this system.
if [ $1 -gt 1 ] && [ -d /run/systemd/system ] ; then
kill -TERM 1 &>/dev/null || :
fi
}
[ $1 -eq 1 ] || exit 0
# create /var/log/journal only on initial installation,
# and only if it's writable (it won't be in rpm-ostree).
[ -w %{_localstatedir} ] && mkdir -p %{_localstatedir}/log/journal
[ -w %{_localstatedir} ] && journalctl --update-catalog || :
systemd-sysusers || :
systemd-tmpfiles --create &>/dev/null || :
# We reset the enablement of all services upon initial installation
# https://bugzilla.redhat.com/show_bug.cgi?id=1118740#c23
# This will fix up enablement of any preset services that got installed
# before systemd due to rpm ordering problems:
# https://bugzilla.redhat.com/show_bug.cgi?id=1647172.
# We also do this for user units, see
# https://fedoraproject.org/wiki/Changes/Systemd_presets_for_user_units.
systemctl preset-all &>/dev/null || :
systemctl --global preset-all &>/dev/null || :
%postun
if [ $1 -eq 1 ]; then
[ -w %{_localstatedir} ] && journalctl --update-catalog || :
systemd-tmpfiles --create &>/dev/null || :
fi
%systemd_postun_with_restart systemd-timedated.service systemd-hostnamed.service systemd-journald.service systemd-localed.service systemd-userdbd.service
# FIXME: systemd-logind.service is excluded (https://github.com/systemd/systemd/pull/17558)
# This is the explanded form of %%systemd_user_daemon_reexec. We
# can't use the macro because we define it ourselves.
if [ $1 -ge 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then
# Package upgrade, not uninstall
/usr/lib/systemd/systemd-update-helper user-reexec || :
fi
%triggerun resolved -- systemd < 246.1-1
# This is for upgrades from previous versions before systemd-resolved became the default.
systemctl --no-reload preset systemd-resolved.service &>/dev/null || :
if systemctl -q is-enabled systemd-resolved.service &>/dev/null; then
systemctl -q is-enabled NetworkManager.service 2>/dev/null && \
! test -L /etc/resolv.conf 2>/dev/null && \
! mountpoint /etc/resolv.conf &>/dev/null && \
grep -q 'Generated by NetworkManager' /etc/resolv.conf 2>/dev/null && \
echo -e '/etc/resolv.conf was generated by NetworkManager.\nRemoving it to let systemd-resolved manage this file.' && \
mv -v /etc/resolv.conf /etc/resolv.conf.orig-with-nm && \