1 ################################################################################
5 ################################################################################
8 SYSTEMD_SITE = http://www.freedesktop.org/software/systemd
9 SYSTEMD_SOURCE = systemd-$(SYSTEMD_VERSION).tar.xz
10 SYSTEMD_LICENSE = LGPLv2.1+; GPLv2+ for udev; MIT-like license for few source files listed in README
11 SYSTEMD_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1 LICENSE.MIT
12 SYSTEMD_INSTALL_STAGING = YES
13 SYSTEMD_DEPENDENCIES = \
20 SYSTEMD_PROVIDES = udev
21 SYSTEMD_AUTORECONF = YES
23 # Make sure that systemd will always be built after busybox so that we have
24 # a consistent init setup between two builds
25 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
26 SYSTEMD_DEPENDENCIES += busybox
29 SYSTEMD_CONF_OPTS += \
31 --with-rootlibdir=/lib \
36 --disable-libcryptsetup \
37 --with-dbuspolicydir=/etc/dbus-1/system.d \
38 --with-dbussessionservicedir=/usr/share/dbus-1/services \
39 --with-dbussystemservicedir=/usr/share/dbus-1/system-services \
46 SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto
48 # Override path to kmod, used in kmod-static-nodes.service
50 CFLAGS="$(SYSTEMD_CFLAGS)" \
51 ac_cv_path_KMOD=/usr/bin/kmod
53 ifeq ($(BR2_PACKAGE_SYSTEMD_COMPAT),y)
54 SYSTEMD_CONF_OPTS += --enable-compat-libs
56 SYSTEMD_CONF_OPTS += --disable-compat-libs
59 ifeq ($(BR2_PACKAGE_ACL),y)
60 SYSTEMD_CONF_OPTS += --enable-acl
61 SYSTEMD_DEPENDENCIES += acl
63 SYSTEMD_CONF_OPTS += --disable-acl
66 ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
67 SYSTEMD_CONF_OPTS += --enable-gudev
68 SYSTEMD_DEPENDENCIES += libglib2
70 SYSTEMD_CONF_OPTS += --disable-gudev
73 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
74 SYSTEMD_CONF_OPTS += --enable-seccomp
75 SYSTEMD_DEPENDENCIES += libseccomp
77 SYSTEMD_CONF_OPTS += --disable-seccomp
80 ifeq ($(BR2_PACKAGE_SYSTEMD_ALL_EXTRAS),y)
81 SYSTEMD_DEPENDENCIES += \
84 SYSTEMD_CONF_OPTS += \
87 --with-libgcrypt-prefix=$(STAGING_DIR)/usr
89 SYSTEMD_CONF_OPTS += \
94 ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY),y)
95 SYSTEMD_DEPENDENCIES += libmicrohttpd
97 SYSTEMD_CONF_OPTS += --disable-microhttpd
100 ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
101 SYSTEMD_CONF_OPTS += --enable-networkd
102 define SYSTEMD_INSTALL_RESOLVCONF_HOOK
103 ln -sf ../run/systemd/resolve/resolv.conf \
104 $(TARGET_DIR)/etc/resolv.conf
107 SYSTEMD_CONF_OPTS += --disable-networkd
108 define SYSTEMD_INSTALL_SERVICE_NETWORK
109 $(INSTALL) -D -m 644 package/systemd/network.service \
110 $(TARGET_DIR)/etc/systemd/system/network.service
111 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
112 ln -fs ../network.service \
113 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service
117 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
118 SYSTEMD_CONF_OPTS += --enable-timesyncd
119 define SYSTEMD_INSTALL_SERVICE_TIMESYNC
120 mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
121 ln -sf ../../../../lib/systemd/system/systemd-timesyncd.service \
122 $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
125 SYSTEMD_CONF_OPTS += --disable-timesyncd
128 ifeq ($(BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT),y)
129 SYSTEMD_CONF_OPTS += --enable-smack
131 SYSTEMD_CONF_OPTS += --disable-smack
134 ifeq ($(BR2_PACKAGE_BASH),)
135 SYSTEMD_CONF_OPTS += --with-bashcompletiondir=
138 ifeq ($(BR2_PACKAGE_ZSH),)
139 SYSTEMD_CONF_OPTS += --with-zshcompletiondir=
142 # mq_getattr needs -lrt
143 SYSTEMD_MAKE_OPTS += LIBS=-lrt
144 SYSTEMD_MAKE_OPTS += LDFLAGS+=-ldl
146 define SYSTEMD_INSTALL_INIT_HOOK
147 ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
148 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
149 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
150 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
152 ln -fs ../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
155 define SYSTEMD_INSTALL_MACHINEID_HOOK
156 touch $(TARGET_DIR)/etc/machine-id
159 define SYSTEMD_SANITIZE_PATH_IN_UNITS
160 find $(TARGET_DIR)/lib/systemd/system -name '*.service' \
161 -exec $(SED) 's,$(HOST_DIR),,g' {} \;
164 # Disable ldconfig.service, as /sbin/ldconfig is not available when the
165 # target is built with a glibc-based toolchain.
166 define SYSTEMD_DISABLE_LDCONFIG_SERVICE_HOOK
167 rm -f $(TARGET_DIR)/lib/systemd/system/sysinit.target.wants/ldconfig.service
170 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
171 SYSTEMD_INSTALL_INIT_HOOK \
172 SYSTEMD_INSTALL_MACHINEID_HOOK \
173 SYSTEMD_INSTALL_RESOLVCONF_HOOK \
174 SYSTEMD_DISABLE_LDCONFIG_SERVICE_HOOK \
175 SYSTEMD_SANITIZE_PATH_IN_UNITS
178 systemd-journal -1 systemd-journal -1 * /var/log/journal - - Journal
179 systemd-journal-gateway -1 systemd-journal-gateway -1 * /var/log/journal - - Journal Gateway
180 systemd-journal-remote -1 systemd-journal-remote -1 * /var/log/journal/remote - - Journal Remote
181 systemd-journal-upload -1 systemd-journal-upload -1 * - - - Journal Upload
182 systemd-resolve -1 systemd-resolve -1 * - - - Network Name Resolution Manager
183 systemd-bus-proxy -1 systemd-bus-proxy -1 * - - - Proxy D-Bus messages to/from a bus
184 systemd-timesync -1 systemd-timesync -1 * - - - Network Time Synchronization
185 systemd-network -1 systemd-network -1 * - - - Network Manager
186 - - input -1 * - - - Input device group
189 define SYSTEMD_DISABLE_SERVICE_TTY1
190 rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
193 ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
194 # systemd needs getty.service for VTs and serial-getty.service for serial ttys
195 define SYSTEMD_INSTALL_SERVICE_TTY
196 if echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
200 SERVICE="serial-getty"; \
202 ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
203 $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
207 define SYSTEMD_INSTALL_INIT_SYSTEMD
208 $(SYSTEMD_DISABLE_SERVICE_TTY1)
209 $(SYSTEMD_INSTALL_SERVICE_TTY)
210 $(SYSTEMD_INSTALL_SERVICE_NETWORK)
211 $(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
214 $(eval $(autotools-package))