systemd: bump version to 232
[buildroot-gz.git] / package / systemd / systemd.mk
blobfa07bd05729fa5be90d85cd0c28a2e0f79f3203d
1 ################################################################################
3 # systemd
5 ################################################################################
7 SYSTEMD_VERSION = 232
8 SYSTEMD_SITE = $(call github,systemd,systemd,v$(SYSTEMD_VERSION))
9 SYSTEMD_LICENSE = LGPLv2.1+, GPLv2+ (udev), Public Domain (few source files, see README)
10 SYSTEMD_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1 README
11 SYSTEMD_INSTALL_STAGING = YES
12 SYSTEMD_DEPENDENCIES = \
13 host-intltool \
14 libcap \
15 util-linux \
16 kmod \
17 host-gperf
19 SYSTEMD_PROVIDES = udev
20 SYSTEMD_AUTORECONF = YES
22 # Make sure that systemd will always be built after busybox so that we have
23 # a consistent init setup between two builds
24 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
25 SYSTEMD_DEPENDENCIES += busybox
26 endif
28 SYSTEMD_CONF_OPTS += \
29 --with-rootprefix= \
30 --enable-blkid \
31 --enable-static=no \
32 --disable-manpages \
33 --disable-selinux \
34 --disable-pam \
35 --disable-ima \
36 --disable-libcryptsetup \
37 --disable-efi \
38 --disable-gnuefi \
39 --disable-ldconfig \
40 --disable-tests \
41 --disable-coverage \
42 --with-default-dnssec=no \
43 --without-python
45 SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto
47 # Override path to kmod, used in kmod-static-nodes.service
48 SYSTEMD_CONF_ENV = \
49 CFLAGS="$(SYSTEMD_CFLAGS)" \
50 ac_cv_path_KMOD=/usr/bin/kmod
52 define SYSTEMD_RUN_INTLTOOLIZE
53 cd $(@D) && $(HOST_DIR)/usr/bin/intltoolize --force --automake
54 endef
55 SYSTEMD_PRE_CONFIGURE_HOOKS += SYSTEMD_RUN_INTLTOOLIZE
57 ifeq ($(BR2_PACKAGE_ACL),y)
58 SYSTEMD_CONF_OPTS += --enable-acl
59 SYSTEMD_DEPENDENCIES += acl
60 else
61 SYSTEMD_CONF_OPTS += --disable-acl
62 endif
64 ifeq ($(BR2_PACKAGE_AUDIT),y)
65 SYSTEMD_CONF_OPTS += --enable-audit
66 SYSTEMD_DEPENDENCIES += audit
67 else
68 SYSTEMD_CONF_OPTS += --disable-audit
69 endif
71 ifeq ($(BR2_PACKAGE_LIBIDN),y)
72 SYSTEMD_CONF_OPTS += --enable-libidn
73 SYSTEMD_DEPENDENCIES += libidn
74 else
75 SYSTEMD_CONF_OPTS += --disable-libidn
76 endif
78 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
79 SYSTEMD_CONF_OPTS += --enable-seccomp
80 SYSTEMD_DEPENDENCIES += libseccomp
81 else
82 SYSTEMD_CONF_OPTS += --disable-seccomp
83 endif
85 ifeq ($(BR2_PACKAGE_LIBXKBCOMMON),y)
86 SYSTEMD_CONF_OPTS += --enable-xkbcommon
87 SYSTEMD_DEPENDENCIES += libxkbcommon
88 else
89 SYSTEMD_CONF_OPTS += --disable-xkbcommon
90 endif
92 ifeq ($(BR2_PACKAGE_SYSTEMD_KDBUS),y)
93 SYSTEMD_CONF_OPTS += --enable-kdbus
94 else
95 SYSTEMD_CONF_OPTS += --disable-kdbus
96 endif
98 ifeq ($(BR2_PACKAGE_BZIP2),y)
99 SYSTEMD_DEPENDENCIES += bzip2
100 SYSTEMD_CONF_OPTS += --enable-bzip2
101 else
102 SYSTEMD_CONF_OPTS += --disable-bzip2
103 endif
105 ifeq ($(BR2_PACKAGE_LZ4),y)
106 SYSTEMD_DEPENDENCIES += lz4
107 SYSTEMD_CONF_OPTS += --enable-lz4
108 else
109 SYSTEMD_CONF_OPTS += --disable-lz4
110 endif
112 ifeq ($(BR2_PACKAGE_XZ),y)
113 SYSTEMD_DEPENDENCIES += xz
114 SYSTEMD_CONF_OPTS += --enable-xz
115 else
116 SYSTEMD_CONF_OPTS += --disable-xz
117 endif
119 ifeq ($(BR2_PACKAGE_ZLIB),y)
120 SYSTEMD_DEPENDENCIES += zlib
121 SYSTEMD_CONF_OPTS += --enable-zlib
122 else
123 SYSTEMD_CONF_OPTS += --disable-zlib
124 endif
126 ifeq ($(BR2_PACKAGE_LIBCURL),y)
127 SYSTEMD_DEPENDENCIES += libcurl
128 SYSTEMD_CONF_OPTS += --enable-libcurl
129 else
130 SYSTEMD_CONF_OPTS += --disable-libcurl
131 endif
133 ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
134 SYSTEMD_DEPENDENCIES += libgcrypt
135 SYSTEMD_CONF_OPTS += \
136 --enable-gcrypt \
137 --with-libgcrypt-prefix=$(STAGING_DIR)/usr \
138 --with-libgpg-error-prefix=$(STAGING_DIR)/usr
139 else
140 SYSTEMD_CONF_OPTS += --disable-gcrypt
141 endif
143 ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY),y)
144 SYSTEMD_DEPENDENCIES += libmicrohttpd
145 SYSTEMD_CONF_OPTS += --enable-microhttpd
146 ifeq ($(BR2_PACKAGE_LIBQRENCODE),y)
147 SYSTEMD_CONF_OPTS += --enable-qrencode
148 SYSTEMD_DEPENDENCIES += libqrencode
149 else
150 SYSTEMD_CONF_OPTS += --disable-qrencode
151 endif
152 else
153 SYSTEMD_CONF_OPTS += --disable-microhttpd --disable-qrencode
154 endif
156 ifeq ($(BR2_PACKAGE_SYSTEMD_HWDB),y)
157 SYSTEMD_CONF_OPTS += --enable-hwdb
158 else
159 SYSTEMD_CONF_OPTS += --disable-hwdb
160 endif
162 ifeq ($(BR2_PACKAGE_SYSTEMD_BINFMT),y)
163 SYSTEMD_CONF_OPTS += --enable-binfmt
164 else
165 SYSTEMD_CONF_OPTS += --disable-binfmt
166 endif
168 ifeq ($(BR2_PACKAGE_SYSTEMD_VCONSOLE),y)
169 SYSTEMD_CONF_OPTS += --enable-vconsole
170 else
171 SYSTEMD_CONF_OPTS += --disable-vconsole
172 endif
174 ifeq ($(BR2_PACKAGE_SYSTEMD_QUOTACHECK),y)
175 SYSTEMD_CONF_OPTS += --enable-quotacheck
176 else
177 SYSTEMD_CONF_OPTS += --disable-quotacheck
178 endif
180 ifeq ($(BR2_PACKAGE_SYSTEMD_TMPFILES),y)
181 SYSTEMD_CONF_OPTS += --enable-tmpfiles
182 else
183 SYSTEMD_CONF_OPTS += --disable-tmpfiles
184 endif
186 ifeq ($(BR2_PACKAGE_SYSTEMD_SYSUSERS),y)
187 SYSTEMD_CONF_OPTS += --enable-sysusers
188 else
189 SYSTEMD_CONF_OPTS += --disable-sysusers
190 endif
192 ifeq ($(BR2_PACKAGE_SYSTEMD_FIRSTBOOT),y)
193 SYSTEMD_CONF_OPTS += --enable-firstboot
194 else
195 SYSTEMD_CONF_OPTS += --disable-firstboot
196 endif
198 ifeq ($(BR2_PACKAGE_SYSTEMD_RANDOMSEED),y)
199 SYSTEMD_CONF_OPTS += --enable-randomseed
200 else
201 SYSTEMD_CONF_OPTS += --disable-randomseed
202 endif
204 ifeq ($(BR2_PACKAGE_SYSTEMD_BACKLIGHT),y)
205 SYSTEMD_CONF_OPTS += --enable-backlight
206 else
207 SYSTEMD_CONF_OPTS += --disable-backlight
208 endif
210 ifeq ($(BR2_PACKAGE_SYSTEMD_RFKILL),y)
211 SYSTEMD_CONF_OPTS += --enable-rfkill
212 else
213 SYSTEMD_CONF_OPTS += --disable-rfkill
214 endif
216 ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y)
217 SYSTEMD_CONF_OPTS += --enable-logind
218 else
219 SYSTEMD_CONF_OPTS += --disable-logind
220 endif
222 ifeq ($(BR2_PACKAGE_SYSTEMD_MACHINED),y)
223 SYSTEMD_CONF_OPTS += --enable-machined
224 else
225 SYSTEMD_CONF_OPTS += --disable-machined
226 endif
228 ifeq ($(BR2_PACKAGE_SYSTEMD_IMPORTD),y)
229 SYSTEMD_CONF_OPTS += --enable-importd
230 else
231 SYSTEMD_CONF_OPTS += --disable-importd
232 endif
234 ifeq ($(BR2_PACKAGE_SYSTEMD_HOSTNAMED),y)
235 SYSTEMD_CONF_OPTS += --enable-hostnamed
236 else
237 SYSTEMD_CONF_OPTS += --disable-hostnamed
238 endif
240 ifeq ($(BR2_PACKAGE_SYSTEMD_MYHOSTNAME),y)
241 SYSTEMD_CONF_OPTS += --enable-myhostname
242 else
243 SYSTEMD_CONF_OPTS += --disable-myhostname
244 endif
246 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMEDATED),y)
247 SYSTEMD_CONF_OPTS += --enable-timedated
248 else
249 SYSTEMD_CONF_OPTS += --disable-timedated
250 endif
252 ifeq ($(BR2_PACKAGE_SYSTEMD_LOCALED),y)
253 SYSTEMD_CONF_OPTS += --enable-localed
254 else
255 SYSTEMD_CONF_OPTS += --disable-localed
256 endif
258 ifeq ($(BR2_PACKAGE_SYSTEMD_COREDUMP),y)
259 SYSTEMD_CONF_OPTS += --enable-coredump
260 SYSTEMD_COREDUMP_USER = systemd-coredump -1 systemd-coredump -1 * /var/lib/systemd/coredump - - Core Dumper
261 else
262 SYSTEMD_CONF_OPTS += --disable-coredump
263 endif
265 ifeq ($(BR2_PACKAGE_SYSTEMD_POLKIT),y)
266 SYSTEMD_CONF_OPTS += --enable-polkit
267 else
268 SYSTEMD_CONF_OPTS += --disable-polkit
269 endif
271 ifeq ($(BR2_PACKAGE_SYSTEMD_NETWORKD),y)
272 SYSTEMD_CONF_OPTS += --enable-networkd
273 SYSTEMD_NETWORKD_USER = systemd-network -1 systemd-network -1 * - - - Network Manager
274 define SYSTEMD_INSTALL_RESOLVCONF_HOOK
275 ln -sf ../run/systemd/resolve/resolv.conf \
276 $(TARGET_DIR)/etc/resolv.conf
277 endef
278 else
279 SYSTEMD_CONF_OPTS += --disable-networkd
280 define SYSTEMD_INSTALL_SERVICE_NETWORK
281 $(INSTALL) -D -m 644 package/systemd/network.service \
282 $(TARGET_DIR)/etc/systemd/system/network.service
283 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
284 ln -fs ../network.service \
285 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/network.service
286 endef
287 endif
289 ifeq ($(BR2_PACKAGE_SYSTEMD_RESOLVED),y)
290 SYSTEMD_CONF_OPTS += --enable-resolved
291 SYSTEMD_RESOLVED_USER = systemd-resolve -1 systemd-resolve -1 * - - - Network Name Resolution Manager
292 else
293 SYSTEMD_CONF_OPTS += --disable-resolved
294 endif
296 ifeq ($(BR2_PACKAGE_SYSTEMD_TIMESYNCD),y)
297 SYSTEMD_CONF_OPTS += --enable-timesyncd
298 SYSTEMD_TIMESYNCD_USER = systemd-timesync -1 systemd-timesync -1 * - - - Network Time Synchronization
299 define SYSTEMD_INSTALL_SERVICE_TIMESYNC
300 mkdir -p $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants
301 ln -sf ../../../../lib/systemd/system/systemd-timesyncd.service \
302 $(TARGET_DIR)/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service
303 endef
304 else
305 SYSTEMD_CONF_OPTS += --disable-timesyncd
306 endif
308 ifeq ($(BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT),y)
309 SYSTEMD_CONF_OPTS += --enable-smack
310 else
311 SYSTEMD_CONF_OPTS += --disable-smack
312 endif
314 ifeq ($(BR2_PACKAGE_SYSTEMD_HIBERNATE),y)
315 SYSTEMD_CONF_OPTS += --enable-hibernate
316 else
317 SYSTEMD_CONF_OPTS += --disable-hibernate
318 endif
320 define SYSTEMD_INSTALL_INIT_HOOK
321 ln -fs ../lib/systemd/systemd $(TARGET_DIR)/sbin/init
322 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
323 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
324 ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
326 ln -fs ../../../lib/systemd/system/multi-user.target \
327 $(TARGET_DIR)/etc/systemd/system/default.target
328 endef
330 define SYSTEMD_INSTALL_MACHINEID_HOOK
331 touch $(TARGET_DIR)/etc/machine-id
332 endef
334 SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
335 SYSTEMD_INSTALL_INIT_HOOK \
336 SYSTEMD_INSTALL_MACHINEID_HOOK \
337 SYSTEMD_INSTALL_RESOLVCONF_HOOK
339 define SYSTEMD_USERS
340 - - input -1 * - - - Input device group
341 - - systemd-journal -1 * - - - Journal
342 systemd-bus-proxy -1 systemd-bus-proxy -1 * - - - Proxy D-Bus messages to/from a bus
343 systemd-journal-gateway -1 systemd-journal-gateway -1 * /var/log/journal - - Journal Gateway
344 systemd-journal-remote -1 systemd-journal-remote -1 * /var/log/journal/remote - - Journal Remote
345 systemd-journal-upload -1 systemd-journal-upload -1 * - - - Journal Upload
346 $(SYSTEMD_COREDUMP_USER)
347 $(SYSTEMD_NETWORKD_USER)
348 $(SYSTEMD_RESOLVED_USER)
349 $(SYSTEMD_TIMESYNCD_USER)
350 endef
352 define SYSTEMD_DISABLE_SERVICE_TTY1
353 rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
354 endef
356 ifneq ($(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT)),)
357 # systemd needs getty.service for VTs and serial-getty.service for serial ttys
358 # also patch the file to use the correct baud-rate, the default baudrate is 115200 so look for that
359 define SYSTEMD_INSTALL_SERVICE_TTY
360 if echo $(BR2_TARGET_GENERIC_GETTY_PORT) | egrep -q 'tty[0-9]*$$'; \
361 then \
362 SERVICE="getty"; \
363 else \
364 SERVICE="serial-getty"; \
365 fi; \
366 ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
367 $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service; \
368 if [ $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE)) -gt 0 ] ; \
369 then \
370 $(SED) 's,115200,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE),' $(TARGET_DIR)/lib/systemd/system/$${SERVICE}@.service; \
372 endef
373 endif
375 define SYSTEMD_INSTALL_INIT_SYSTEMD
376 $(SYSTEMD_DISABLE_SERVICE_TTY1)
377 $(SYSTEMD_INSTALL_SERVICE_TTY)
378 $(SYSTEMD_INSTALL_SERVICE_NETWORK)
379 $(SYSTEMD_INSTALL_SERVICE_TIMESYNC)
380 endef
382 $(eval $(autotools-package))