1################################################################################ 2# 3# systemd 4# 5################################################################################ 6 7# When updating systemd, take care of the following: 8# - Check if the requirements have changed (see README), in particular 9# arch and headers 10# - If yes, propagate the dependencies to BR2_INIT_SYSTEMD 11# - If the required kernel options have changed, update the Config.in 12# help text and the list of KCONFIG_ENABLE_OPT. 13# - Check if there are new meson_options. Make sure all options are set 14# explicitly (usually to default value). 15# - If there are new services: 16# - create new options for them (if they really are optional); 17# - create a new _USER if necessary; 18# - create new directory (with _PERMISSIONS) if necessary. 19# - Diff sysusers.d with the previous version 20# - Diff factory/etc/nsswitch.conf with the previous version 21# (details are often sprinkled around in README and manpages) 22SYSTEMD_VERSION = 250.4 23SYSTEMD_SITE = $(call github,systemd,systemd-stable,v$(SYSTEMD_VERSION)) 24SYSTEMD_LICENSE = \ 25 LGPL-2.1+, \ 26 GPL-2.0+ (udev), \ 27 Public Domain (few source files, see LICENSES/README.md), \ 28 BSD-2-Clause (eBPF instruction mini library), \ 29 BSD-3-Clause (tools/chromiumos), \ 30 CC0-1.0 (few source files, see LICENSES/README.md), \ 31 GPL-2.0 with Linux-syscall-note (linux kernel headers), \ 32 MIT (few source files, see LICENSES/README.md), \ 33 OFL-1.1 (Heebo fonts) 34SYSTEMD_LICENSE_FILES = \ 35 LICENSE.GPL2 \ 36 LICENSE.LGPL2.1 \ 37 LICENSES/BSD-2-Clause.txt \ 38 LICENSES/BSD-3-Clause.txt \ 39 LICENSES/CC0-1.0.txt \ 40 LICENSES/LGPL-2.0-or-later.txt \ 41 LICENSES/Linux-syscall-note.txt \ 42 LICENSES/lookup3-public-domain.txt \ 43 LICENSES/MIT.txt \ 44 LICENSES/murmurhash2-public-domain.txt \ 45 LICENSES/OFL-1.1.txt \ 46 LICENSES/README.md 47SYSTEMD_CPE_ID_VENDOR = systemd_project 48SYSTEMD_INSTALL_STAGING = YES 49SYSTEMD_DEPENDENCIES = \ 50 $(BR2_COREUTILS_HOST_DEPENDENCY) \ 51 $(if $(BR2_PACKAGE_BASH_COMPLETION),bash-completion) \ 52 host-gperf \ 53 host-python-jinja2 \ 54 kmod \ 55 libcap \ 56 util-linux-libs \ 57 $(TARGET_NLS_DEPENDENCIES) 58 59SYSTEMD_SELINUX_MODULES = systemd udev xdg 60 61SYSTEMD_PROVIDES = udev 62 63SYSTEMD_CONF_OPTS += \ 64 -Ddefault-hierarchy=unified \ 65 -Didn=true \ 66 -Dima=false \ 67 -Dkexec-path=/usr/sbin/kexec \ 68 -Dkmod-path=/usr/bin/kmod \ 69 -Dldconfig=false \ 70 -Dlink-boot-shared=true \ 71 -Dloadkeys-path=/usr/bin/loadkeys \ 72 -Dman=false \ 73 -Dmount-path=/usr/bin/mount \ 74 -Dmode=release \ 75 -Dnss-systemd=true \ 76 -Dquotacheck-path=/usr/sbin/quotacheck \ 77 -Dquotaon-path=/usr/sbin/quotaon \ 78 -Drootlibdir='/usr/lib' \ 79 -Dsetfont-path=/usr/bin/setfont \ 80 -Dsplit-bin=true \ 81 -Dsplit-usr=false \ 82 -Dsulogin-path=/usr/sbin/sulogin \ 83 -Dsystem-gid-max=999 \ 84 -Dsystem-uid-max=999 \ 85 -Dsysvinit-path= \ 86 -Dsysvrcnd-path= \ 87 -Dtelinit-path= \ 88 -Dtests=false \ 89 -Dtmpfiles=true \ 90 -Dumount-path=/usr/bin/umount \ 91 -Dutmp=false 92 93ifeq ($(BR2_nios2),y) 94# Nios2 ld emits warnings, make warnings not to be treated as errors 95SYSTEMD_LDFLAGS = $(TARGET_LDFLAGS) -Wl,--no-fatal-warnings 96endif 97 98ifeq ($(BR2_PACKAGE_ACL),y) 99SYSTEMD_DEPENDENCIES += acl 100SYSTEMD_CONF_OPTS += -Dacl=true 101else 102SYSTEMD_CONF_OPTS += -Dacl=false 103endif 104 105ifeq ($(BR2_PACKAGE_LESS),y) 106SYSTEMD_CONF_OPTS += -Durlify=true 107else 108SYSTEMD_CONF_OPTS += -Durlify=false 109endif 110 111ifeq ($(BR2_PACKAGE_LIBAPPARMOR),y) 112SYSTEMD_DEPENDENCIES += libapparmor 113SYSTEMD_CONF_OPTS += -Dapparmor=true 114else 115SYSTEMD_CONF_OPTS += -Dapparmor=false 116endif 117 118ifeq ($(BR2_PACKAGE_AUDIT),y) 119SYSTEMD_DEPENDENCIES += audit 120SYSTEMD_CONF_OPTS += -Daudit=true 121else 122SYSTEMD_CONF_OPTS += -Daudit=false 123endif 124 125ifeq ($(BR2_PACKAGE_CRYPTSETUP),y) 126SYSTEMD_DEPENDENCIES += cryptsetup 127SYSTEMD_CONF_OPTS += -Dlibcryptsetup=true -Dlibcryptsetup-plugins=true 128else 129SYSTEMD_CONF_OPTS += -Dlibcryptsetup=false -Dlibcryptsetup-plugins=false 130endif 131 132ifeq ($(BR2_PACKAGE_ELFUTILS),y) 133SYSTEMD_DEPENDENCIES += elfutils 134SYSTEMD_CONF_OPTS += -Delfutils=true 135else 136SYSTEMD_CONF_OPTS += -Delfutils=false 137endif 138 139ifeq ($(BR2_PACKAGE_IPTABLES),y) 140SYSTEMD_DEPENDENCIES += iptables 141SYSTEMD_CONF_OPTS += -Dlibiptc=true 142else 143SYSTEMD_CONF_OPTS += -Dlibiptc=false 144endif 145 146# Both options can't be selected at the same time so prefer libidn2 147ifeq ($(BR2_PACKAGE_LIBIDN2),y) 148SYSTEMD_DEPENDENCIES += libidn2 149SYSTEMD_CONF_OPTS += -Dlibidn2=true -Dlibidn=false 150else ifeq ($(BR2_PACKAGE_LIBIDN),y) 151SYSTEMD_DEPENDENCIES += libidn 152SYSTEMD_CONF_OPTS += -Dlibidn=true -Dlibidn2=false 153else 154SYSTEMD_CONF_OPTS += -Dlibidn=false -Dlibidn2=false 155endif 156 157ifeq ($(BR2_PACKAGE_LIBSECCOMP),y) 158SYSTEMD_DEPENDENCIES += libseccomp 159SYSTEMD_CONF_OPTS += -Dseccomp=true 160else 161SYSTEMD_CONF_OPTS += -Dseccomp=false 162endif 163 164ifeq ($(BR2_PACKAGE_LIBXKBCOMMON),y) 165SYSTEMD_DEPENDENCIES += libxkbcommon 166SYSTEMD_CONF_OPTS += -Dxkbcommon=true 167else 168SYSTEMD_CONF_OPTS += -Dxkbcommon=false 169endif 170 171ifeq ($(BR2_PACKAGE_BZIP2),y) 172SYSTEMD_DEPENDENCIES += bzip2 173SYSTEMD_CONF_OPTS += -Dbzip2=true 174else 175SYSTEMD_CONF_OPTS += -Dbzip2=false 176endif 177 178ifeq ($(BR2_PACKAGE_ZSTD),y) 179SYSTEMD_DEPENDENCIES += zstd 180SYSTEMD_CONF_OPTS += -Dzstd=true 181else 182SYSTEMD_CONF_OPTS += -Dzstd=false 183endif 184 185ifeq ($(BR2_PACKAGE_LZ4),y) 186SYSTEMD_DEPENDENCIES += lz4 187SYSTEMD_CONF_OPTS += -Dlz4=true 188else 189SYSTEMD_CONF_OPTS += -Dlz4=false 190endif 191 192ifeq ($(BR2_PACKAGE_LINUX_PAM),y) 193SYSTEMD_DEPENDENCIES += linux-pam 194SYSTEMD_CONF_OPTS += -Dpam=true 195else 196SYSTEMD_CONF_OPTS += -Dpam=false 197endif 198 199ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBFDISK),y) 200SYSTEMD_CONF_OPTS += -Dfdisk=true 201else 202SYSTEMD_CONF_OPTS += -Dfdisk=false 203endif 204 205ifeq ($(BR2_PACKAGE_VALGRIND),y) 206SYSTEMD_DEPENDENCIES += valgrind 207SYSTEMD_CONF_OPTS += -Dvalgrind=true 208else 209SYSTEMD_CONF_OPTS += -Dvalgrind=false 210endif 211 212ifeq ($(BR2_PACKAGE_XZ),y) 213SYSTEMD_DEPENDENCIES += xz 214SYSTEMD_CONF_OPTS += -Dxz=true 215else 216SYSTEMD_CONF_OPTS += -Dxz=false 217endif 218 219ifeq ($(BR2_PACKAGE_ZLIB),y) 220SYSTEMD_DEPENDENCIES += zlib 221SYSTEMD_CONF_OPTS += -Dzlib=true 222else 223SYSTEMD_CONF_OPTS += -Dzlib=false 224endif 225 226ifeq ($(BR2_PACKAGE_LIBCURL),y) 227SYSTEMD_DEPENDENCIES += libcurl 228SYSTEMD_CONF_OPTS += -Dlibcurl=true 229else 230SYSTEMD_CONF_OPTS += -Dlibcurl=false 231endif 232 233ifeq ($(BR2_PACKAGE_LIBGCRYPT),y) 234SYSTEMD_DEPENDENCIES += libgcrypt 235SYSTEMD_CONF_OPTS += -Ddefault-dnssec=allow-downgrade -Dgcrypt=true 236else 237SYSTEMD_CONF_OPTS += -Ddefault-dnssec=no -Dgcrypt=false 238endif 239 240ifeq ($(BR2_PACKAGE_P11_KIT),y) 241SYSTEMD_DEPENDENCIES += p11-kit 242SYSTEMD_CONF_OPTS += -Dp11kit=true 243else 244SYSTEMD_CONF_OPTS += -Dp11kit=false 245endif 246 247ifeq ($(BR2_PACKAGE_PCRE2),y) 248SYSTEMD_DEPENDENCIES += pcre2 249SYSTEMD_CONF_OPTS += -Dpcre2=true 250else 251SYSTEMD_CONF_OPTS += -Dpcre2=false 252endif 253 254ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),y) 255SYSTEMD_CONF_OPTS += -Dblkid=true 256else 257SYSTEMD_CONF_OPTS += -Dblkid=false 258endif 259 260ifeq ($(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),y) 261SYSTEMD_CONF_OPTS += -Dnologin-path=/sbin/nologin 262else 263SYSTEMD_CONF_OPTS += -Dnologin-path=/bin/false 264endif 265 266ifeq ($(BR2_PACKAGE_SYSTEMD_INITRD),y) 267SYSTEMD_CONF_OPTS += -Dinitrd=true 268else 269SYSTEMD_CONF_OPTS += -Dinitrd=false 270endif 271 272ifeq ($(BR2_PACKAGE_SYSTEMD_KERNELINSTALL),y) 273SYSTEMD_CONF_OPTS += -Dkernel-install=true 274else 275SYSTEMD_CONF_OPTS += -Dkernel-install=false 276endif 277 278ifeq ($(BR2_PACKAGE_SYSTEMD_ANALYZE),y) 279SYSTEMD_CONF_OPTS += -Danalyze=true 280else 281SYSTEMD_CONF_OPTS += -Danalyze=false 282endif 283 284ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_REMOTE),y) 285# remote also depends on libcurl, this is already added above. 286SYSTEMD_DEPENDENCIES += libmicrohttpd 287SYSTEMD_CONF_OPTS += -Dremote=true -Dmicrohttpd=true 288SYSTEMD_REMOTE_USER = systemd-journal-remote -1 systemd-journal-remote -1 * - - - systemd Journal Remote 289else 290SYSTEMD_CONF_OPTS += -Dremote=false -Dmicrohttpd=false 291endif 292 293ifeq ($(BR2_PACKAGE_LIBQRENCODE),y) 294SYSTEMD_DEPENDENCIES += libqrencode 295SYSTEMD_CONF_OPTS += -Dqrencode=true 296else 297SYSTEMD_CONF_OPTS += -Dqrencode=false 298endif 299 300ifeq ($(BR2_PACKAGE_LIBSELINUX),y) 301SYSTEMD_DEPENDENCIES += libselinux 302SYSTEMD_CONF_OPTS += -Dselinux=true 303else 304SYSTEMD_CONF_OPTS += -Dselinux=false 305endif 306 307ifeq ($(BR2_PACKAGE_SYSTEMD_HWDB),y) 308SYSTEMD_CONF_OPTS += -Dhwdb=true 309define SYSTEMD_BUILD_HWDB 310 $(HOST_DIR)/bin/udevadm hwdb --update --root $(TARGET_DIR) 311endef 312SYSTEMD_TARGET_FINALIZE_HOOKS += SYSTEMD_BUILD_HWDB 313define SYSTEMD_RM_HWDB_SRV 314 rm -rf $(TARGET_DIR)/$(HOST_EUDEV_SYSCONFDIR)/udev/hwdb.d/ 315endef 316SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_RM_HWDB_SRV 317else 318SYSTEMD_CONF_OPTS += -Dhwdb=false 319endif 320 321ifeq ($(BR2_PACKAGE_SYSTEMD_BINFMT),y) 322SYSTEMD_CONF_OPTS += -Dbinfmt=true 323else 324SYSTEMD_CONF_OPTS += -Dbinfmt=false 325endif 326 327ifeq ($(BR2_PACKAGE_SYSTEMD_VCONSOLE),y) 328SYSTEMD_CONF_OPTS += -Dvconsole=true 329else 330SYSTEMD_CONF_OPTS += -Dvconsole=false 331endif 332 333ifeq ($(BR2_PACKAGE_SYSTEMD_QUOTACHECK),y) 334SYSTEMD_CONF_OPTS += -Dquotacheck=true 335else 336SYSTEMD_CONF_OPTS += -Dquotacheck=false 337endif 338 339ifeq ($(BR2_PACKAGE_SYSTEMD_SYSUSERS),y) 340SYSTEMD_CONF_OPTS += -Dsysusers=true 341else 342SYSTEMD_CONF_OPTS += -Dsysusers=false 343endif 344 345ifeq ($(BR2_PACKAGE_SYSTEMD_FIRSTBOOT),y) 346SYSTEMD_CONF_OPTS += -Dfirstboot=true 347else 348SYSTEMD_CONF_OPTS += -Dfirstboot=false 349endif 350 351ifeq ($(BR2_PACKAGE_SYSTEMD_RANDOMSEED),y) 352SYSTEMD_CONF_OPTS += -Drandomseed=true 353else 354SYSTEMD_CONF_OPTS += -Drandomseed=false 355endif 356 357ifeq ($(BR2_PACKAGE_SYSTEMD_BACKLIGHT),y) 358SYSTEMD_CONF_OPTS += -Dbacklight=true 359else 360SYSTEMD_CONF_OPTS += -Dbacklight=false 361endif 362 363ifeq ($(BR2_PACKAGE_SYSTEMD_RFKILL),y) 364SYSTEMD_CONF_OPTS += -Drfkill=true 365else 366SYSTEMD_CONF_OPTS += -Drfkill=false 367endif 368 369ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y) 370SYSTEMD_CONF_OPTS += -Dlogind=true 371SYSTEMD_LOGIND_PERMISSIONS = /var/lib/systemd/linger d 755 0 0 - - - - - 372else 373SYSTEMD_CONF_OPTS += -Dlogind=false 374endif 375 376ifeq ($(BR2_PACKAGE_SYSTEMD_MACHINED),y) 377SYSTEMD_CONF_OPTS += -Dmachined=true -Dnss-mymachines=true 378SYSTEMD_MACHINED_PERMISSIONS = /var/lib/machines d 700 0 0 - - - - - 379else 380SYSTEMD_CONF_OPTS += -Dmachined=false -Dnss-mymachines=false 381endif 382 383ifeq ($(BR2_PACKAGE_SYSTEMD_IMPORTD),y) 384SYSTEMD_CONF_OPTS += -Dimportd=true 385else 386SYSTEMD_CONF_OPTS += -Dimportd=false 387endif 388 389ifeq ($(BR2_PACKAGE_SYSTEMD_HOMED),y) 390SYSTEMD_CONF_OPTS += -Dhomed=true 391SYSTEMD_DEPENDENCIES += cryptsetup openssl 392SYSTEMD_HOMED_PERMISSIONS = /var/lib/systemd/home d 755 0 0 - - - - - 393else 394SYSTEMD_CONF_OPTS += -Dhomed=false 395endif 396 397ifeq ($(BR2_PACKAGE_SYSTEMD_HOSTNAMED),y) 398SYSTEMD_CONF_OPTS += -Dhostnamed=true 399else 400SYSTEMD_CONF_OPTS += -Dhostnamed=false 401endif 402 403ifeq ($(BR2_PACKAGE_SYSTEMD_MYHOSTNAME),y) 404SYSTEMD_CONF_OPTS += -Dnss-myhostname=true 405else 406SYSTEMD_CONF_OPTS += -Dnss-myhostname=false 407endif 408 409ifeq ($(BR2_PACKAGE_SYSTEMD_TIMEDATED),y) 410SYSTEMD_CONF_OPTS += -Dtimedated=true 411else 412SYSTEMD_CONF_OPTS += -Dtimedated=false 413endif 414 415ifeq ($(BR2_PACKAGE_SYSTEMD_LOCALED),y) 416SYSTEMD_CONF_OPTS += -Dlocaled=true 417else 418SYSTEMD_CONF_OPTS += -Dlocaled=false 419endif 420 421ifeq ($(BR2_PACKAGE_SYSTEMD_REPART),y) 422SYSTEMD_CONF_OPTS += -Drepart=true 423SYSTEMD_DEPENDENCIES += openssl 424else 425SYSTEMD_CONF_OPTS += -Drepart=false 426endif 427 428ifeq ($(BR2_PACKAGE_SYSTEMD_USERDB),y) 429SYSTEMD_CONF_OPTS += -Duserdb=true 430else 431SYSTEMD_CONF_OPTS += -Duserdb=false 432endif 433 434ifeq ($(BR2_PACKAGE_SYSTEMD_COREDUMP),y) 435SYSTEMD_CONF_OPTS += -Dcoredump=true 436SYSTEMD_COREDUMP_USER = systemd-coredump -1 systemd-coredump -1 * - - - systemd core dump processing 437SYSTEMD_COREDUMP_PERMISSIONS = /var/lib/systemd/coredump d 755 0 0 - - - - - 438else 439SYSTEMD_CONF_OPTS += -Dcoredump=false 440endif 441 442ifeq ($(BR2_PACKAGE_SYSTEMD_PSTORE),y) 443SYSTEMD_CONF_OPTS += -Dpstore=true 444SYSTEMD_PSTORE_PERMISSIONS = /var/lib/systemd/pstore d 755 0 0 - - - - - 445else 446SYSTEMD_CONF_OPTS += -Dpstore=false 447endif 448 449ifeq ($(BR2_PACKAGE_SYSTEMD_OOMD),y) 450SYSTEMD_CONF_OPTS += -Doomd=true 451SYSTEMD_OOMD_USER = systemd-oom -1 systemd-oom -1 * - - - systemd Userspace OOM Killer 452else 453SYSTEMD_CONF_OPTS += -Doomd=false 454endif 455 456ifeq ($(BR2_PACKAGE_SYSTEMD_POLKIT),y) 457SYSTEMD_CONF_OPTS += -Dpolkit=true 458SYSTEMD_DEPENDENCIES += polkit 459else 460SYSTEMD_CONF_OPTS += -Dpolkit=false 461endif 462 463ifeq ($(BR2_PACKAGE_SYSTEMD_PORTABLED),y) 464SYSTEMD_CONF_OPTS += -Dportabled=true 465else 466SYSTEMD_CONF_OPTS += -Dportabled=false 467endif 468 469ifeq ($(BR2_PACKAGE_SYSTEMD_SYSEXT),y) 470SYSTEMD_CONF_OPTS += -Dsysext=true 471else 472SYSTEMD_CONF_OPTS += -Dsysext=false 473endif 474 475ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y) 476SYSTEMD_CONF_OPTS += -Dnetworkd=true 477SYSTEMD_NETWORKD_USER = systemd-network -1 systemd-network -1 * - - - systemd Network Management 478SYSTEMD_NETWORKD_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP)) 479ifneq ($(SYSTEMD_NETWORKD_DHCP_IFACE),) 480define SYSTEMD_INSTALL_NETWORK_CONFS 481 sed s/SYSTEMD_NETWORKD_DHCP_IFACE/$(SYSTEMD_NETWORKD_DHCP_IFACE)/ \ 482 $(SYSTEMD_PKGDIR)/dhcp.network > \ 483 $(TARGET_DIR)/etc/systemd/network/$(SYSTEMD_NETWORKD_DHCP_IFACE).network 484endef 485endif 486else 487SYSTEMD_CONF_OPTS += -Dnetworkd=false 488endif 489 490ifeq ($(BR2_PACKAGE_SYSTEMD_RESOLVED),y) 491define SYSTEMD_INSTALL_RESOLVCONF_HOOK 492 ln -sf ../run/systemd/resolve/resolv.conf \ 493 $(TARGET_DIR)/etc/resolv.conf 494endef 495SYSTEMD_CONF_OPTS += -Dnss-resolve=true -Dresolve=true 496SYSTEMD_RESOLVED_USER = systemd-resolve -1 systemd-resolve -1 * - - - systemd Resolver 497else 498SYSTEMD_CONF_OPTS += -Dnss-resolve=false -Dresolve=false 499endif 500 501ifeq ($(BR2_PACKAGE_LIBOPENSSL),y) 502SYSTEMD_CONF_OPTS += \ 503 -Dgnutls=false \ 504 -Dopenssl=true \ 505 -Ddns-over-tls=openssl \ 506 -Ddefault-dns-over-tls=opportunistic 507SYSTEMD_DEPENDENCIES += openssl 508else ifeq ($(BR2_PACKAGE_GNUTLS),y) 509SYSTEMD_CONF_OPTS += \ 510 -Dgnutls=true \ 511 -Dopenssl=false \ 512 -Ddns-over-tls=gnutls \ 513 -Ddefault-dns-over-tls=opportunistic 514SYSTEMD_DEPENDENCIES += gnutls 515else 516SYSTEMD_CONF_OPTS += \ 517 -Dgnutls=false \ 518 -Dopenssl=false \ 519 -Ddns-over-tls=false \ 520 -Ddefault-dns-over-tls=no 521endif 522 523ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y) 524SYSTEMD_CONF_OPTS += -Dtimesyncd=true 525SYSTEMD_TIMESYNCD_USER = systemd-timesync -1 systemd-timesync -1 * - - - systemd Time Synchronization 526SYSTEMD_TIMESYNCD_PERMISSIONS = /var/lib/systemd/timesync d 755 systemd-timesync systemd-timesync - - - - - 527else 528SYSTEMD_CONF_OPTS += -Dtimesyncd=false 529endif 530 531ifeq ($(BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT),y) 532SYSTEMD_CONF_OPTS += -Dsmack=true 533else 534SYSTEMD_CONF_OPTS += -Dsmack=false 535endif 536 537ifeq ($(BR2_PACKAGE_SYSTEMD_HIBERNATE),y) 538SYSTEMD_CONF_OPTS += -Dhibernate=true 539else 540SYSTEMD_CONF_OPTS += -Dhibernate=false 541endif 542 543ifeq ($(BR2_PACKAGE_SYSTEMD_BOOT),y) 544SYSTEMD_INSTALL_IMAGES = YES 545SYSTEMD_DEPENDENCIES += gnu-efi 546SYSTEMD_CONF_OPTS += \ 547 -Defi=true \ 548 -Dgnu-efi=true \ 549 -Defi-cc=$(TARGET_CC) \ 550 -Defi-ld=bfd \ 551 -Defi-libdir=$(STAGING_DIR)/usr/lib \ 552 -Defi-includedir=$(STAGING_DIR)/usr/include/efi 553 554SYSTEMD_BOOT_EFI_ARCH = $(call qstrip,$(BR2_PACKAGE_SYSTEMD_BOOT_EFI_ARCH)) 555define SYSTEMD_INSTALL_BOOT_FILES 556 $(INSTALL) -D -m 0644 $(@D)/build/src/boot/efi/systemd-boot$(SYSTEMD_BOOT_EFI_ARCH).efi \ 557 $(BINARIES_DIR)/efi-part/EFI/BOOT/boot$(SYSTEMD_BOOT_EFI_ARCH).efi 558 $(INSTALL) -D -m 0644 $(SYSTEMD_PKGDIR)/boot-files/loader.conf \ 559 $(BINARIES_DIR)/efi-part/loader/loader.conf 560 $(INSTALL) -D -m 0644 $(SYSTEMD_PKGDIR)/boot-files/buildroot.conf \ 561 $(BINARIES_DIR)/efi-part/loader/entries/buildroot.conf 562endef 563 564else 565SYSTEMD_CONF_OPTS += -Defi=false -Dgnu-efi=false 566endif # BR2_PACKAGE_SYSTEMD_BOOT == y 567 568SYSTEMD_FALLBACK_HOSTNAME = $(call qstrip,$(BR2_TARGET_GENERIC_HOSTNAME)) 569ifneq ($(SYSTEMD_FALLBACK_HOSTNAME),) 570SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME) 571endif 572 573define SYSTEMD_INSTALL_INIT_HOOK 574 ln -fs "$(call qstrip,$(BR2_PACKAGE_SYSTEMD_DEFAULT_TARGET))" \ 575 $(TARGET_DIR)/usr/lib/systemd/system/default.target 576endef 577 578define SYSTEMD_INSTALL_MACHINEID_HOOK 579 touch $(TARGET_DIR)/etc/machine-id 580endef 581 582SYSTEMD_POST_INSTALL_TARGET_HOOKS += \ 583 SYSTEMD_INSTALL_INIT_HOOK \ 584 SYSTEMD_INSTALL_MACHINEID_HOOK 585 586define SYSTEMD_INSTALL_IMAGES_CMDS 587 $(SYSTEMD_INSTALL_BOOT_FILES) 588endef 589 590define SYSTEMD_PERMISSIONS 591 /var/spool d 755 0 0 - - - - - 592 /var/lib d 755 0 0 - - - - - 593 /var/lib/private d 700 0 0 - - - - - 594 /var/log/private d 700 0 0 - - - - - 595 /var/cache/private d 700 0 0 - - - - - 596 $(SYSTEMD_LOGIND_PERMISSIONS) 597 $(SYSTEMD_MACHINED_PERMISSIONS) 598 $(SYSTEMD_HOMED_PERMISSIONS) 599 $(SYSTEMD_COREDUMP_PERMISSIONS) 600 $(SYSTEMD_PSTORE_PERMISSIONS) 601 $(SYSTEMD_TIMESYNCD_PERMISSIONS) 602endef 603 604define SYSTEMD_USERS 605 # udev user groups 606 - - render -1 * - - - DRI rendering nodes 607 - - sgx -1 * - - - SGX device nodes 608 # systemd user groups 609 - - systemd-journal -1 * - - - Journal 610 $(SYSTEMD_REMOTE_USER) 611 $(SYSTEMD_COREDUMP_USER) 612 $(SYSTEMD_OOMD_USER) 613 $(SYSTEMD_NETWORKD_USER) 614 $(SYSTEMD_RESOLVED_USER) 615 $(SYSTEMD_TIMESYNCD_USER) 616endef 617 618define SYSTEMD_INSTALL_NSSCONFIG_HOOK 619 $(SED) '/^passwd:/ {/systemd/! s/$$/ systemd/}' \ 620 -e '/^group:/ {/systemd/! s/$$/ [SUCCESS=merge] systemd/}' \ 621 -e '/^shadow:/ {/systemd/! s/$$/ systemd/}' \ 622 -e '/^gshadow:/ {/systemd/! s/$$/ systemd/}' \ 623 $(if $(BR2_PACKAGE_SYSTEMD_RESOLVED), \ 624 -e '/^hosts:/ s/[[:space:]]*mymachines//' \ 625 -e '/^hosts:/ {/resolve/! s/files/resolve [!UNAVAIL=return] files/}' ) \ 626 $(if $(BR2_PACKAGE_SYSTEMD_MYHOSTNAME), \ 627 -e '/^hosts:/ {/myhostname/! s/files/files myhostname/}' ) \ 628 $(if $(BR2_PACKAGE_SYSTEMD_MACHINED), \ 629 -e '/^hosts:/ {/mymachines/! s/^\(hosts:[[:space:]]*\)/\1mymachines /}' ) \ 630 $(TARGET_DIR)/etc/nsswitch.conf 631endef 632 633SYSTEMD_TARGET_FINALIZE_HOOKS += \ 634 SYSTEMD_INSTALL_NSSCONFIG_HOOK \ 635 SYSTEMD_INSTALL_RESOLVCONF_HOOK 636 637ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),) 638# systemd provides multiple units to autospawn getty as neede 639# * getty@.service to start a getty on normal TTY 640# * sertial-getty@.service to start a getty on serial lines 641# * console-getty.service for generic /dev/console 642# * container-getty@.service for a getty on /dev/pts/* 643# 644# the generator systemd-getty-generator will 645# * read the console= kernel command line parameter 646# * enable one of the above units depending on what it finds 647# 648# Systemd defaults to enablinb getty@tty1.service 649# 650# What we want to do 651# * Enable a getty on $BR2_TARGET_GENERIC_TTY_PATH 652# * Set the baudrate for all units according to BR2_TARGET_GENERIC_GETTY_BAUDRATE 653# * Always enable a getty on the console using systemd-getty-generator 654# (backward compatibility with previous releases of buildroot) 655# 656# What we do 657# * disable getty@tty1 (enabled by upstream systemd) 658# * enable getty@xxx if $BR2_TARGET_GENERIC_TTY_PATH is a tty 659# * enable serial-getty@xxx for other $BR2_TARGET_GENERIC_TTY_PATH 660# * rewrite baudrates if a baudrate is provided 661define SYSTEMD_INSTALL_SERVICE_TTY 662 mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/getty@.service.d; \ 663 printf '[Install]\nDefaultInstance=\n' \ 664 >$(TARGET_DIR)/usr/lib/systemd/system/getty@.service.d/buildroot-console.conf; \ 665 if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \ 666 then \ 667 : ; \ 668 elif echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \ 669 then \ 670 printf '[Install]\nDefaultInstance=%s\n' \ 671 $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) \ 672 >$(TARGET_DIR)/usr/lib/systemd/system/getty@.service.d/buildroot-console.conf; \ 673 else \ 674 mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/serial-getty@.service.d;\ 675 printf '[Install]\nDefaultInstance=%s\n' \ 676 $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) \ 677 >$(TARGET_DIR)/usr/lib/systemd/system/serial-getty@.service.d/buildroot-console.conf;\ 678 fi; \ 679 if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \ 680 then \ 681 $(SED) 's/115200/$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),115200/' $(TARGET_DIR)/lib/systemd/system/getty@.service; \ 682 $(SED) 's/115200/$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),115200/' $(TARGET_DIR)/lib/systemd/system/serial-getty@.service; \ 683 $(SED) 's/115200/$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),115200/' $(TARGET_DIR)/lib/systemd/system/console-getty@.service; \ 684 $(SED) 's/115200/$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),115200/' $(TARGET_DIR)/lib/systemd/system/container-getty@.service; \ 685 fi 686endef 687endif 688 689define SYSTEMD_INSTALL_PRESET 690 $(INSTALL) -D -m 644 $(SYSTEMD_PKGDIR)/80-buildroot.preset $(TARGET_DIR)/usr/lib/systemd/system-preset/80-buildroot.preset 691endef 692 693define SYSTEMD_INSTALL_INIT_SYSTEMD 694 $(SYSTEMD_INSTALL_PRESET) 695 $(SYSTEMD_INSTALL_SERVICE_TTY) 696 $(SYSTEMD_INSTALL_NETWORK_CONFS) 697endef 698 699ifeq ($(BR2_ENABLE_LOCALE_PURGE),y) 700# Go through all files with scheme <basename>.<langext>.catalog 701# and remove those where <langext> is not in LOCALE_NOPURGE 702define SYSTEMD_LOCALE_PURGE_CATALOGS 703 for cfile in `find $(TARGET_DIR)/usr/lib/systemd/catalog -name '*.*.catalog'`; \ 704 do \ 705 basename=$${cfile##*/}; \ 706 basename=$${basename%.catalog}; \ 707 langext=$${basename#*.}; \ 708 [ "$$langext" = "$${basename}" ] && continue; \ 709 expr '$(LOCALE_NOPURGE)' : ".*\b$${langext}\b" >/dev/null && continue; \ 710 rm -f "$$cfile"; \ 711 done 712endef 713SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_LOCALE_PURGE_CATALOGS 714endif 715 716ifeq ($(BR2_PACKAGE_SYSTEMD_CATALOGDB),y) 717define SYSTEMD_UPDATE_CATALOGS 718 $(HOST_DIR)/bin/journalctl --root=$(TARGET_DIR) --update-catalog 719 install -D $(TARGET_DIR)/var/lib/systemd/catalog/database \ 720 $(TARGET_DIR)/usr/share/factory/var/lib/systemd/catalog/database 721 rm $(TARGET_DIR)/var/lib/systemd/catalog/database 722 ln -sf /usr/share/factory/var/lib/systemd/catalog/database \ 723 $(TARGET_DIR)/var/lib/systemd/catalog/database 724 grep -q '^L /var/lib/systemd/catalog/database' $(TARGET_DIR)/usr/lib/tmpfiles.d/var.conf || \ 725 printf "\nL /var/lib/systemd/catalog/database\n" >> $(TARGET_DIR)/usr/lib/tmpfiles.d/var.conf 726endef 727SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_UPDATE_CATALOGS 728endif 729 730define SYSTEMD_RM_CATALOG_UPDATE_SERVICE 731 rm -rf $(TARGET_DIR)/usr/lib/systemd/catalog \ 732 $(TARGET_DIR)/usr/lib/systemd/system/systemd-journal-catalog-update.service \ 733 $(TARGET_DIR)/usr/lib/systemd/system/*/systemd-journal-catalog-update.service 734endef 735SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_RM_CATALOG_UPDATE_SERVICE 736 737define SYSTEMD_CREATE_TMPFILES_HOOK 738 HOST_SYSTEMD_TMPFILES=$(HOST_DIR)/bin/systemd-tmpfiles \ 739 $(SYSTEMD_PKGDIR)/fakeroot_tmpfiles.sh $(TARGET_DIR) 740endef 741SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_CREATE_TMPFILES_HOOK 742 743define SYSTEMD_PRESET_ALL 744 $(HOST_DIR)/bin/systemctl --root=$(TARGET_DIR) preset-all 745endef 746SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_PRESET_ALL 747 748SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV) 749SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV) 750 751define SYSTEMD_LINUX_CONFIG_FIXUPS 752 $(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS) 753 $(call KCONFIG_ENABLE_OPT,CONFIG_CGROUPS) 754 $(call KCONFIG_ENABLE_OPT,CONFIG_INOTIFY_USER) 755 $(call KCONFIG_ENABLE_OPT,CONFIG_SIGNALFD) 756 $(call KCONFIG_ENABLE_OPT,CONFIG_TIMERFD) 757 $(call KCONFIG_ENABLE_OPT,CONFIG_EPOLL) 758 $(call KCONFIG_ENABLE_OPT,CONFIG_UNIX) 759 $(call KCONFIG_ENABLE_OPT,CONFIG_SYSFS) 760 $(call KCONFIG_ENABLE_OPT,CONFIG_PROC_FS) 761 $(call KCONFIG_ENABLE_OPT,CONFIG_FHANDLE) 762 763 $(call KCONFIG_ENABLE_OPT,CONFIG_NET_NS) 764 765 $(call KCONFIG_DISABLE_OPT,CONFIG_SYSFS_DEPRECATED) 766 767 $(call KCONFIG_ENABLE_OPT,CONFIG_AUTOFS_FS) 768 $(call KCONFIG_ENABLE_OPT,CONFIG_AUTOFS4_FS) 769 $(call KCONFIG_ENABLE_OPT,CONFIG_TMPFS_POSIX_ACL) 770 $(call KCONFIG_ENABLE_OPT,CONFIG_TMPFS_XATTR) 771endef 772 773# We need a very minimal host variant, so we disable as much as possible. 774HOST_SYSTEMD_CONF_OPTS = \ 775 -Dsplit-bin=true \ 776 -Dsplit-usr=false \ 777 --prefix=/usr \ 778 --libdir=lib \ 779 --sysconfdir=/etc \ 780 --localstatedir=/var \ 781 -Dmode=release \ 782 -Dutmp=false \ 783 -Dhibernate=false \ 784 -Dldconfig=false \ 785 -Dresolve=false \ 786 -Defi=false \ 787 -Dtpm=false \ 788 -Denvironment-d=false \ 789 -Dbinfmt=false \ 790 -Drepart=false \ 791 -Dcoredump=false \ 792 -Dpstore=false \ 793 -Doomd=false \ 794 -Dlogind=false \ 795 -Dhostnamed=false \ 796 -Dlocaled=false \ 797 -Dmachined=false \ 798 -Dportabled=false \ 799 -Dsysext=false \ 800 -Duserdb=false \ 801 -Dhomed=false \ 802 -Dnetworkd=false \ 803 -Dtimedated=false \ 804 -Dtimesyncd=false \ 805 -Dremote=false \ 806 -Dcreate-log-dirs=false \ 807 -Dnss-myhostname=false \ 808 -Dnss-mymachines=false \ 809 -Dnss-resolve=false \ 810 -Dnss-systemd=false \ 811 -Dfirstboot=false \ 812 -Drandomseed=false \ 813 -Dbacklight=false \ 814 -Dvconsole=false \ 815 -Dquotacheck=false \ 816 -Dsysusers=false \ 817 -Dtmpfiles=true \ 818 -Dimportd=false \ 819 -Dhwdb=false \ 820 -Drfkill=false \ 821 -Dman=false \ 822 -Dhtml=false \ 823 -Dsmack=false \ 824 -Dpolkit=false \ 825 -Dblkid=false \ 826 -Didn=false \ 827 -Dadm-group=false \ 828 -Dwheel-group=false \ 829 -Dzlib=false \ 830 -Dgshadow=false \ 831 -Dima=false \ 832 -Dtests=false \ 833 -Dglib=false \ 834 -Dacl=false \ 835 -Dsysvinit-path='' \ 836 -Dinitrd=false \ 837 -Dxdg-autostart=false \ 838 -Dkernel-install=false \ 839 -Danalyze=false \ 840 -Dlibcryptsetup=false \ 841 -Daudit=false \ 842 -Dzstd=false 843 844HOST_SYSTEMD_DEPENDENCIES = \ 845 $(BR2_COREUTILS_HOST_DEPENDENCY) \ 846 host-util-linux \ 847 host-patchelf \ 848 host-libcap \ 849 host-gperf \ 850 host-python-jinja2 851 852HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR) 853 854# Fix RPATH After installation 855# * systemd provides a install_rpath instruction to meson because the binaries 856# need to link with libsystemd which is not in a standard path 857# * meson can only replace the RPATH, not append to it 858# * the original rpath is thus lost. 859# * the original path had been tweaked by buildroot via LDFLAGS to add 860# $(HOST_DIR)/lib 861# * thus re-tweak rpath after the installation for all binaries that need it 862HOST_SYSTEMD_HOST_TOOLS = busctl journalctl systemctl systemd-* udevadm 863 864define HOST_SYSTEMD_FIX_RPATH 865 for f in $(addprefix $(HOST_DIR)/bin/,$(HOST_SYSTEMD_HOST_TOOLS)); do \ 866 [ -e $$f ] || continue; \ 867 $(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $${f} \ 868 || exit 1; \ 869 done 870endef 871HOST_SYSTEMD_POST_INSTALL_HOOKS += HOST_SYSTEMD_FIX_RPATH 872 873$(eval $(meson-package)) 874$(eval $(host-meson-package)) 875