mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@26c91a9
This commit is contained in:
@@ -4,29 +4,33 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SYSTEMD_VERSION = 241
|
||||
SYSTEMD_SITE = $(call github,systemd,systemd,v$(SYSTEMD_VERSION))
|
||||
SYSTEMD_LICENSE = LGPL-2.1+, GPL-2.0+ (udev), Public Domain (few source files, see README)
|
||||
SYSTEMD_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1 README
|
||||
SYSTEMD_VERSION = 246.5
|
||||
SYSTEMD_SITE = $(call github,systemd,systemd-stable,v$(SYSTEMD_VERSION))
|
||||
SYSTEMD_LICENSE = LGPL-2.1+, GPL-2.0+ (udev), Public Domain (few source files, see README), BSD-3-Clause (tools/chromiumos)
|
||||
SYSTEMD_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1 README tools/chromiumos/LICENSE
|
||||
SYSTEMD_INSTALL_STAGING = YES
|
||||
SYSTEMD_DEPENDENCIES = \
|
||||
$(BR2_COREUTILS_HOST_DEPENDENCY) \
|
||||
$(if $(BR2_PACKAGE_BASH_COMPLETION),bash-completion) \
|
||||
host-gperf \
|
||||
host-intltool \
|
||||
kmod \
|
||||
libcap \
|
||||
util-linux
|
||||
util-linux-libs \
|
||||
$(TARGET_NLS_DEPENDENCIES)
|
||||
|
||||
SYSTEMD_SELINUX_MODULES = systemd udev
|
||||
|
||||
SYSTEMD_PROVIDES = udev
|
||||
|
||||
SYSTEMD_CONF_OPTS += \
|
||||
-Drootlibdir='/usr/lib' \
|
||||
-Dblkid=true \
|
||||
-Dsysvinit-path= \
|
||||
-Dsysvrcnd-path= \
|
||||
-Dutmp=false \
|
||||
-Dman=false \
|
||||
-Dima=false \
|
||||
-Dlibcryptsetup=false \
|
||||
-Dldconfig=false \
|
||||
-Ddefault-dnssec=no \
|
||||
-Ddefault-hierarchy=hybrid \
|
||||
-Dtests=false \
|
||||
-Dsplit-bin=true \
|
||||
-Dsplit-usr=false \
|
||||
@@ -38,9 +42,9 @@ SYSTEMD_CONF_OPTS += \
|
||||
-Dsulogin-path=/usr/sbin/sulogin \
|
||||
-Dmount-path=/usr/bin/mount \
|
||||
-Dumount-path=/usr/bin/umount \
|
||||
-Dnobody-group=nogroup \
|
||||
-Didn=true \
|
||||
-Dnss-systemd=true
|
||||
-Dnss-systemd=true \
|
||||
-Dportabled=false
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ACL),y)
|
||||
SYSTEMD_DEPENDENCIES += acl
|
||||
@@ -49,6 +53,13 @@ else
|
||||
SYSTEMD_CONF_OPTS += -Dacl=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBAPPARMOR),y)
|
||||
SYSTEMD_DEPENDENCIES += libapparmor
|
||||
SYSTEMD_CONF_OPTS += -Dapparmor=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dapparmor=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_AUDIT),y)
|
||||
SYSTEMD_DEPENDENCIES += audit
|
||||
SYSTEMD_CONF_OPTS += -Daudit=true
|
||||
@@ -70,6 +81,13 @@ else
|
||||
SYSTEMD_CONF_OPTS += -Delfutils=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_GNUTLS),y)
|
||||
SYSTEMD_DEPENDENCIES += gnutls
|
||||
SYSTEMD_CONF_OPTS += -Dgnutls=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dgnutls=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_IPTABLES),y)
|
||||
SYSTEMD_DEPENDENCIES += iptables
|
||||
SYSTEMD_CONF_OPTS += -Dlibiptc=true
|
||||
@@ -109,6 +127,13 @@ else
|
||||
SYSTEMD_CONF_OPTS += -Dbzip2=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ZSTD),y)
|
||||
SYSTEMD_DEPENDENCIES += zstd
|
||||
SYSTEMD_CONF_OPTS += -Dzstd=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dzstd=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LZ4),y)
|
||||
SYSTEMD_DEPENDENCIES += lz4
|
||||
SYSTEMD_CONF_OPTS += -Dlz4=true
|
||||
@@ -123,6 +148,12 @@ else
|
||||
SYSTEMD_CONF_OPTS += -Dpam=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBFDISK),y)
|
||||
SYSTEMD_CONF_OPTS += -Dfdisk=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dfdisk=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_VALGRIND),y)
|
||||
SYSTEMD_DEPENDENCIES += valgrind
|
||||
SYSTEMD_CONF_OPTS += -Dvalgrind=true
|
||||
@@ -153,9 +184,23 @@ endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
|
||||
SYSTEMD_DEPENDENCIES += libgcrypt
|
||||
SYSTEMD_CONF_OPTS += -Dgcrypt=true
|
||||
SYSTEMD_CONF_OPTS += -Ddefault-dnssec=allow-downgrade -Dgcrypt=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dgcrypt=false
|
||||
SYSTEMD_CONF_OPTS += -Ddefault-dnssec=no -Dgcrypt=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_P11_KIT),y)
|
||||
SYSTEMD_DEPENDENCIES += p11-kit
|
||||
SYSTEMD_CONF_OPTS += -Dp11kit=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dp11kit=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
||||
SYSTEMD_DEPENDENCIES += openssl
|
||||
SYSTEMD_CONF_OPTS += -Dopenssl=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dopenssl=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_PCRE2),y)
|
||||
@@ -165,6 +210,36 @@ else
|
||||
SYSTEMD_CONF_OPTS += -Dpcre2=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),y)
|
||||
SYSTEMD_CONF_OPTS += -Dblkid=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dblkid=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),y)
|
||||
SYSTEMD_CONF_OPTS += -Dnologin-path=/sbin/nologin
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dnologin-path=/bin/false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_INITRD),y)
|
||||
SYSTEMD_CONF_OPTS += -Dinitrd=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dinitrd=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_KERNELINSTALL),y)
|
||||
SYSTEMD_CONF_OPTS += -Dkernel-install=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dkernel-install=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_ANALYZE),y)
|
||||
SYSTEMD_CONF_OPTS += -Danalyze=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Danalyze=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY),y)
|
||||
SYSTEMD_DEPENDENCIES += libmicrohttpd
|
||||
SYSTEMD_CONF_OPTS += -Dmicrohttpd=true
|
||||
@@ -180,6 +255,7 @@ endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_REMOTE),y)
|
||||
SYSTEMD_CONF_OPTS += -Dremote=true
|
||||
SYSTEMD_REMOTE_USER = systemd-journal-remote -1 systemd-journal-remote -1 * - - - systemd Journal Remote
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dremote=false
|
||||
endif
|
||||
@@ -193,6 +269,14 @@ endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_HWDB),y)
|
||||
SYSTEMD_CONF_OPTS += -Dhwdb=true
|
||||
define SYSTEMD_BUILD_HWDB
|
||||
$(HOST_DIR)/bin/udevadm hwdb --update --root $(TARGET_DIR)
|
||||
endef
|
||||
SYSTEMD_TARGET_FINALIZE_HOOKS += SYSTEMD_BUILD_HWDB
|
||||
define SYSTEMD_RM_HWDB_SRV
|
||||
rm -rf $(TARGET_DIR)/$(HOST_EUDEV_SYSCONFDIR)/udev/hwdb.d/
|
||||
endef
|
||||
SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_RM_HWDB_SRV
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dhwdb=false
|
||||
endif
|
||||
@@ -258,9 +342,9 @@ SYSTEMD_CONF_OPTS += -Dlogind=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_MACHINED),y)
|
||||
SYSTEMD_CONF_OPTS += -Dmachined=true
|
||||
SYSTEMD_CONF_OPTS += -Dmachined=true -Dnss-mymachines=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dmachined=false
|
||||
SYSTEMD_CONF_OPTS += -Dmachined=false -Dnss-mymachines=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_IMPORTD),y)
|
||||
@@ -269,6 +353,13 @@ else
|
||||
SYSTEMD_CONF_OPTS += -Dimportd=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_HOMED),y)
|
||||
SYSTEMD_CONF_OPTS += -Dhomed=true
|
||||
SYSTEMD_DEPENDENCIES += cryptsetup openssl
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dhomed=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_HOSTNAMED),y)
|
||||
SYSTEMD_CONF_OPTS += -Dhostnamed=true
|
||||
else
|
||||
@@ -293,13 +384,32 @@ else
|
||||
SYSTEMD_CONF_OPTS += -Dlocaled=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_REPART),y)
|
||||
SYSTEMD_CONF_OPTS += -Drepart=true
|
||||
SYSTEMD_DEPENDENCIES += openssl
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Drepart=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_USERDB),y)
|
||||
SYSTEMD_CONF_OPTS += -Duserdb=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Duserdb=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_COREDUMP),y)
|
||||
SYSTEMD_CONF_OPTS += -Dcoredump=true
|
||||
SYSTEMD_COREDUMP_USER = systemd-coredump -1 systemd-coredump -1 * /var/lib/systemd/coredump - - Core Dumper
|
||||
SYSTEMD_COREDUMP_USER = systemd-coredump -1 systemd-coredump -1 * - - - systemd core dump processing
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dcoredump=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_PSTORE),y)
|
||||
SYSTEMD_CONF_OPTS += -Dpstore=true
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dpstore=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_POLKIT),y)
|
||||
SYSTEMD_CONF_OPTS += -Dpolkit=true
|
||||
SYSTEMD_DEPENDENCIES += polkit
|
||||
@@ -309,17 +419,13 @@ endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
|
||||
SYSTEMD_CONF_OPTS += -Dnetworkd=true
|
||||
SYSTEMD_NETWORKD_USER = systemd-network -1 systemd-network -1 * - - - Network Manager
|
||||
define SYSTEMD_INSTALL_RESOLVCONF_HOOK
|
||||
ln -sf ../run/systemd/resolve/resolv.conf \
|
||||
$(TARGET_DIR)/etc/resolv.conf
|
||||
endef
|
||||
SYSTEMD_NETWORKD_USER = systemd-network -1 systemd-network -1 * - - - systemd Network Management
|
||||
SYSTEMD_NETWORKD_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
|
||||
ifneq ($(SYSTEMD_NETWORKD_DHCP_IFACE),)
|
||||
define SYSTEMD_INSTALL_NETWORK_CONFS
|
||||
sed s/SYSTEMD_NETWORKD_DHCP_IFACE/$(SYSTEMD_NETWORKD_DHCP_IFACE)/ \
|
||||
package/systemd/dhcp.network > \
|
||||
$(TARGET_DIR)/etc/systemd/network/dhcp.network
|
||||
$(SYSTEMD_PKGDIR)/dhcp.network > \
|
||||
$(TARGET_DIR)/etc/systemd/network/$(SYSTEMD_NETWORKD_DHCP_IFACE).network
|
||||
endef
|
||||
endif
|
||||
else
|
||||
@@ -327,20 +433,29 @@ SYSTEMD_CONF_OPTS += -Dnetworkd=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_RESOLVED),y)
|
||||
SYSTEMD_CONF_OPTS += -Dresolve=true
|
||||
SYSTEMD_RESOLVED_USER = systemd-resolve -1 systemd-resolve -1 * - - - Network Name Resolution Manager
|
||||
define SYSTEMD_INSTALL_RESOLVCONF_HOOK
|
||||
ln -sf ../run/systemd/resolve/resolv.conf \
|
||||
$(TARGET_DIR)/etc/resolv.conf
|
||||
endef
|
||||
SYSTEMD_CONF_OPTS += -Dnss-resolve=true -Dresolve=true
|
||||
SYSTEMD_RESOLVED_USER = systemd-resolve -1 systemd-resolve -1 * - - - systemd Resolver
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dresolve=false
|
||||
SYSTEMD_CONF_OPTS += -Dnss-resolve=false -Dresolve=false
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_GNUTLS),y)
|
||||
SYSTEMD_CONF_OPTS += -Ddns-over-tls=gnutls -Ddefault-dns-over-tls=opportunistic
|
||||
SYSTEMD_DEPENDENCIES += gnutls
|
||||
else ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
||||
SYSTEMD_CONF_OPTS += -Ddns-over-tls=openssl -Ddefault-dns-over-tls=opportunistic
|
||||
SYSTEMD_DEPENDENCIES += openssl
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Ddns-over-tls=false -Ddefault-dns-over-tls=no
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
|
||||
SYSTEMD_CONF_OPTS += -Dtimesyncd=true
|
||||
SYSTEMD_TIMESYNCD_USER = systemd-timesync -1 systemd-timesync -1 * - - - Network Time Synchronization
|
||||
define SYSTEMD_INSTALL_SERVICE_TIMESYNC
|
||||
mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
|
||||
ln -sf ../../../../lib/systemd/system/systemd-timesyncd.service \
|
||||
$(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
|
||||
endef
|
||||
SYSTEMD_TIMESYNCD_USER = systemd-timesync -1 systemd-timesync -1 * - - - systemd Time Synchronization
|
||||
else
|
||||
SYSTEMD_CONF_OPTS += -Dtimesyncd=false
|
||||
endif
|
||||
@@ -391,13 +506,8 @@ SYSTEMD_CONF_OPTS += -Dfallback-hostname=$(SYSTEMD_FALLBACK_HOSTNAME)
|
||||
endif
|
||||
|
||||
define SYSTEMD_INSTALL_INIT_HOOK
|
||||
ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
|
||||
ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
|
||||
ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
|
||||
ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
|
||||
ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/shutdown
|
||||
ln -fs ../../../lib/systemd/system/multi-user.target \
|
||||
$(TARGET_DIR)/etc/systemd/system/default.target
|
||||
ln -fs multi-user.target \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/default.target
|
||||
endef
|
||||
|
||||
define SYSTEMD_INSTALL_MACHINEID_HOOK
|
||||
@@ -414,58 +524,212 @@ define SYSTEMD_INSTALL_IMAGES_CMDS
|
||||
endef
|
||||
|
||||
define SYSTEMD_USERS
|
||||
- - input -1 * - - - Input device group
|
||||
# udev user groups
|
||||
# systemd user groups
|
||||
- - systemd-journal -1 * - - - Journal
|
||||
- - render -1 * - - - DRI rendering nodes
|
||||
- - kvm -1 * - - - kvm nodes
|
||||
systemd-bus-proxy -1 systemd-bus-proxy -1 * - - - Proxy D-Bus messages to/from a bus
|
||||
systemd-journal-gateway -1 systemd-journal-gateway -1 * /var/log/journal - - Journal Gateway
|
||||
systemd-journal-remote -1 systemd-journal-remote -1 * /var/log/journal/remote - - Journal Remote
|
||||
systemd-journal-upload -1 systemd-journal-upload -1 * - - - Journal Upload
|
||||
$(SYSTEMD_REMOTE_USER)
|
||||
$(SYSTEMD_COREDUMP_USER)
|
||||
$(SYSTEMD_NETWORKD_USER)
|
||||
$(SYSTEMD_RESOLVED_USER)
|
||||
$(SYSTEMD_TIMESYNCD_USER)
|
||||
endef
|
||||
|
||||
define SYSTEMD_DISABLE_SERVICE_TTY1
|
||||
rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
|
||||
define SYSTEMD_INSTALL_NSSCONFIG_HOOK
|
||||
$(SED) '/^passwd:/ {/systemd/! s/$$/ systemd/}' \
|
||||
-e '/^group:/ {/systemd/! s/$$/ [SUCCESS=merge] systemd/}' \
|
||||
$(if $(BR2_PACKAGE_SYSTEMD_RESOLVED), \
|
||||
-e '/^hosts:/ s/[[:space:]]*mymachines//' \
|
||||
-e '/^hosts:/ {/resolve/! s/files/files resolve [!UNAVAIL=return]/}' ) \
|
||||
$(if $(BR2_PACKAGE_SYSTEMD_MYHOSTNAME), \
|
||||
-e '/^hosts:/ {/myhostname/! s/$$/ myhostname/}' ) \
|
||||
$(if $(BR2_PACKAGE_SYSTEMD_MACHINED), \
|
||||
-e '/^passwd:/ {/mymachines/! s/files/files mymachines/}' \
|
||||
-e '/^group:/ {/mymachines/! s/files/files [SUCCESS=merge] mymachines/}' \
|
||||
-e '/^hosts:/ {/mymachines/! s/files/files mymachines/}' ) \
|
||||
$(TARGET_DIR)/etc/nsswitch.conf
|
||||
endef
|
||||
|
||||
SYSTEMD_TARGET_FINALIZE_HOOKS += SYSTEMD_INSTALL_NSSCONFIG_HOOK
|
||||
|
||||
ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
|
||||
# systemd needs getty.service for VTs and serial-getty.service for serial ttys
|
||||
# note that console-getty.service should be used on /dev/console as it should not have dependencies
|
||||
# also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
|
||||
# systemd provides multiple units to autospawn getty as neede
|
||||
# * getty@.service to start a getty on normal TTY
|
||||
# * sertial-getty@.service to start a getty on serial lines
|
||||
# * console-getty.service for generic /dev/console
|
||||
# * container-getty@.service for a getty on /dev/pts/*
|
||||
#
|
||||
# the generator systemd-getty-generator will
|
||||
# * read the console= kernel command line parameter
|
||||
# * enable one of the above units depending on what it finds
|
||||
#
|
||||
# Systemd defaults to enablinb getty@tty1.service
|
||||
#
|
||||
# What we want to do
|
||||
# * Enable a getty on $BR2_TARGET_GENERIC_TTY_PATH
|
||||
# * Set the baudrate for all units according to BR2_TARGET_GENERIC_GETTY_BAUDRATE
|
||||
# * Always enable a getty on the console using systemd-getty-generator
|
||||
# (backward compatibility with previous releases of buildroot)
|
||||
#
|
||||
# What we do
|
||||
# * disable getty@tty1 (enabled by upstream systemd)
|
||||
# * enable getty@xxx if $BR2_TARGET_GENERIC_TTY_PATH is a tty
|
||||
# * enable serial-getty@xxx for other $BR2_TARGET_GENERIC_TTY_PATH
|
||||
# * rewrite baudrates if a baudrate is provided
|
||||
define SYSTEMD_INSTALL_SERVICE_TTY
|
||||
mkdir $(TARGET_DIR)/usr/lib/systemd/system/getty@.service.d; \
|
||||
printf '[Install]\nDefaultInstance=\n' \
|
||||
>$(TARGET_DIR)/usr/lib/systemd/system/getty@.service.d/buildroot-console.conf; \
|
||||
if [ $(BR2_TARGET_GENERIC_GETTY_PORT) = "console" ]; \
|
||||
then \
|
||||
TARGET="console-getty.service"; \
|
||||
LINK_NAME="console-getty.service"; \
|
||||
: ; \
|
||||
elif echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
|
||||
then \
|
||||
TARGET="getty@.service"; \
|
||||
LINK_NAME="getty@$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
|
||||
printf '[Install]\nDefaultInstance=%s\n' \
|
||||
$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) \
|
||||
>$(TARGET_DIR)/usr/lib/systemd/system/getty@.service.d/buildroot-console.conf; \
|
||||
else \
|
||||
TARGET="serial-getty@.service"; \
|
||||
LINK_NAME="serial-getty@$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)).service"; \
|
||||
mkdir $(TARGET_DIR)/usr/lib/systemd/system/serial-getty@.service.d;\
|
||||
printf '[Install]\nDefaultInstance=%s\n' \
|
||||
$(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)) \
|
||||
>$(TARGET_DIR)/usr/lib/systemd/system/serial-getty@.service.d/buildroot-console.conf;\
|
||||
fi; \
|
||||
ln -fs ../../../../lib/systemd/system/$${TARGET} \
|
||||
$(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${LINK_NAME}; \
|
||||
if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
|
||||
then \
|
||||
$(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${TARGET}; \
|
||||
$(SED) 's/115200/$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),115200/' $(TARGET_DIR)/lib/systemd/system/getty@.service; \
|
||||
$(SED) 's/115200/$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),115200/' $(TARGET_DIR)/lib/systemd/system/serial-getty@.service; \
|
||||
$(SED) 's/115200/$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),115200/' $(TARGET_DIR)/lib/systemd/system/console-getty@.service; \
|
||||
$(SED) 's/115200/$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),115200/' $(TARGET_DIR)/lib/systemd/system/container-getty@.service; \
|
||||
fi
|
||||
endef
|
||||
endif
|
||||
|
||||
define SYSTEMD_INSTALL_PRESET
|
||||
$(INSTALL) -D -m 644 $(SYSTEMD_PKGDIR)/80-buildroot.preset $(TARGET_DIR)/usr/lib/systemd/system-preset/80-buildroot.preset
|
||||
endef
|
||||
|
||||
define SYSTEMD_INSTALL_INIT_SYSTEMD
|
||||
$(SYSTEMD_DISABLE_SERVICE_TTY1)
|
||||
$(SYSTEMD_INSTALL_PRESET)
|
||||
$(SYSTEMD_INSTALL_SERVICE_TTY)
|
||||
$(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
|
||||
$(SYSTEMD_INSTALL_NETWORK_CONFS)
|
||||
endef
|
||||
|
||||
define SYSTEMD_PRESET_ALL
|
||||
$(HOST_DIR)/bin/systemctl --root=$(TARGET_DIR) preset-all
|
||||
endef
|
||||
SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SYSTEMD_PRESET_ALL
|
||||
|
||||
SYSTEMD_CONF_ENV = $(HOST_UTF8_LOCALE_ENV)
|
||||
SYSTEMD_NINJA_ENV = $(HOST_UTF8_LOCALE_ENV)
|
||||
|
||||
define SYSTEMD_LINUX_CONFIG_FIXUPS
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_CGROUPS)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_FHANDLE)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_EPOLL)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_SIGNALFD)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_TIMERFD)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_INOTIFY_USER)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_PROC_FS)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_SYSFS)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_AUTOFS4_FS)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_TMPFS_POSIX_ACL)
|
||||
$(call KCONFIG_ENABLE_OPT,CONFIG_TMPFS_XATTR)
|
||||
endef
|
||||
|
||||
# We need a very minimal host variant, so we disable as much as possible.
|
||||
HOST_SYSTEMD_CONF_OPTS = \
|
||||
-Dsplit-bin=true \
|
||||
-Dsplit-usr=false \
|
||||
--prefix=/usr \
|
||||
--libdir=lib \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var \
|
||||
-Dutmp=false \
|
||||
-Dhibernate=false \
|
||||
-Dldconfig=false \
|
||||
-Dresolve=false \
|
||||
-Defi=false \
|
||||
-Dtpm=false \
|
||||
-Denvironment-d=false \
|
||||
-Dbinfmt=false \
|
||||
-Drepart=false \
|
||||
-Dcoredump=false \
|
||||
-Dpstore=false \
|
||||
-Dlogind=false \
|
||||
-Dhostnamed=false \
|
||||
-Dlocaled=false \
|
||||
-Dmachined=false \
|
||||
-Dportabled=false \
|
||||
-Duserdb=false \
|
||||
-Dhomed=false \
|
||||
-Dnetworkd=false \
|
||||
-Dtimedated=false \
|
||||
-Dtimesyncd=false \
|
||||
-Dremote=false \
|
||||
-Dcreate-log-dirs=false \
|
||||
-Dnss-myhostname=false \
|
||||
-Dnss-mymachines=false \
|
||||
-Dnss-resolve=false \
|
||||
-Dnss-systemd=false \
|
||||
-Dfirstboot=false \
|
||||
-Drandomseed=false \
|
||||
-Dbacklight=false \
|
||||
-Dvconsole=false \
|
||||
-Dquotacheck=false \
|
||||
-Dsysusers=false \
|
||||
-Dtmpfiles=false \
|
||||
-Dimportd=false \
|
||||
-Dhwdb=false \
|
||||
-Drfkill=false \
|
||||
-Dman=false \
|
||||
-Dhtml=false \
|
||||
-Dsmack=false \
|
||||
-Dpolkit=false \
|
||||
-Dblkid=false \
|
||||
-Didn=false \
|
||||
-Dadm-group=false \
|
||||
-Dwheel-group=false \
|
||||
-Dzlib=false \
|
||||
-Dgshadow=false \
|
||||
-Dima=false \
|
||||
-Dtests=false \
|
||||
-Dglib=false \
|
||||
-Dacl=false \
|
||||
-Dsysvinit-path='' \
|
||||
-Dinitrd=false \
|
||||
-Dxdg-autostart=false \
|
||||
-Dkernel-install=false \
|
||||
-Dsystemd-analyze=false \
|
||||
-Dlibcryptsetup=false \
|
||||
-Daudit=false \
|
||||
-Dzstd=false
|
||||
|
||||
HOST_SYSTEMD_DEPENDENCIES = \
|
||||
$(BR2_COREUTILS_HOST_DEPENDENCY) \
|
||||
host-util-linux \
|
||||
host-patchelf \
|
||||
host-libcap \
|
||||
host-gperf
|
||||
|
||||
HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR)
|
||||
|
||||
# Fix RPATH After installation
|
||||
# * systemd provides a install_rpath instruction to meson because the binaries
|
||||
# need to link with libsystemd which is not in a standard path
|
||||
# * meson can only replace the RPATH, not append to it
|
||||
# * the original rpath is thus lost.
|
||||
# * the original path had been tweaked by buildroot via LDFLAGS to add
|
||||
# $(HOST_DIR)/lib
|
||||
# * thus re-tweak rpath after the installation for all binaries that need it
|
||||
HOST_SYSTEMD_HOST_TOOLS = busctl journalctl systemctl systemd-* udevadm
|
||||
|
||||
define HOST_SYSTEMD_FIX_RPATH
|
||||
for f in $(addprefix $(HOST_DIR)/bin/,$(HOST_SYSTEMD_HOST_TOOLS)); do \
|
||||
[ -e $$f ] || continue; \
|
||||
$(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $${f} \
|
||||
|| exit 1; \
|
||||
done
|
||||
endef
|
||||
HOST_SYSTEMD_POST_INSTALL_HOOKS += HOST_SYSTEMD_FIX_RPATH
|
||||
|
||||
$(eval $(meson-package))
|
||||
$(eval $(host-meson-package))
|
||||
|
||||
Reference in New Issue
Block a user