The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / systemd / systemd.mk
1 ################################################################################
2 #
3 # systemd
4 #
5 ################################################################################
6
7 SYSTEMD_VERSION = 219
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 = \
14         host-intltool \
15         libcap \
16         util-linux \
17         kmod \
18         host-gperf
19
20 SYSTEMD_PROVIDES = udev
21 SYSTEMD_AUTORECONF = YES
22
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
27 endif
28
29 SYSTEMD_CONF_OPTS += \
30         --with-rootprefix= \
31         --with-rootlibdir=/lib \
32         --enable-static=no \
33         --disable-manpages \
34         --disable-selinux \
35         --disable-pam \
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 \
40         --enable-split-usr \
41         --disable-efi \
42         --disable-tests \
43         --disable-dbus \
44         --without-python
45
46 SYSTEMD_CFLAGS = $(TARGET_CFLAGS) -fno-lto
47
48 # Override path to kmod, used in kmod-static-nodes.service
49 SYSTEMD_CONF_ENV = \
50         CFLAGS="$(SYSTEMD_CFLAGS)" \
51         ac_cv_path_KMOD=/usr/bin/kmod
52
53 ifeq ($(BR2_PACKAGE_SYSTEMD_COMPAT),y)
54 SYSTEMD_CONF_OPTS += --enable-compat-libs
55 else
56 SYSTEMD_CONF_OPTS += --disable-compat-libs
57 endif
58
59 ifeq ($(BR2_PACKAGE_ACL),y)
60 SYSTEMD_CONF_OPTS += --enable-acl
61 SYSTEMD_DEPENDENCIES += acl
62 else
63 SYSTEMD_CONF_OPTS += --disable-acl
64 endif
65
66 ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
67 SYSTEMD_CONF_OPTS += --enable-gudev
68 SYSTEMD_DEPENDENCIES += libglib2
69 else
70 SYSTEMD_CONF_OPTS += --disable-gudev
71 endif
72
73 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
74 SYSTEMD_CONF_OPTS += --enable-seccomp
75 SYSTEMD_DEPENDENCIES += libseccomp
76 else
77 SYSTEMD_CONF_OPTS += --disable-seccomp
78 endif
79
80 ifeq ($(BR2_PACKAGE_SYSTEMD_ALL_EXTRAS),y)
81 SYSTEMD_DEPENDENCIES += \
82         xz              \
83         libgcrypt
84 SYSTEMD_CONF_OPTS +=    \
85         --enable-xz     \
86         --enable-gcrypt \
87         --with-libgcrypt-prefix=$(STAGING_DIR)/usr
88 else
89 SYSTEMD_CONF_OPTS +=    \
90         --disable-xz    \
91         --disable-gcrypt
92 endif
93
94 ifeq ($(BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY),y)
95 SYSTEMD_DEPENDENCIES += libmicrohttpd
96 else
97 SYSTEMD_CONF_OPTS += --disable-microhttpd
98 endif
99
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
105 endef
106 else
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
114 endef
115 endif
116
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
123 endef
124 else
125 SYSTEMD_CONF_OPTS += --disable-timesyncd
126 endif
127
128 ifeq ($(BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT),y)
129 SYSTEMD_CONF_OPTS += --enable-smack
130 else
131 SYSTEMD_CONF_OPTS += --disable-smack
132 endif
133
134 ifeq ($(BR2_PACKAGE_BASH),)
135 SYSTEMD_CONF_OPTS += --with-bashcompletiondir=
136 endif
137
138 ifeq ($(BR2_PACKAGE_ZSH),)
139 SYSTEMD_CONF_OPTS += --with-zshcompletiondir=
140 endif
141
142 # mq_getattr needs -lrt
143 SYSTEMD_MAKE_OPTS += LIBS=-lrt
144 SYSTEMD_MAKE_OPTS += LDFLAGS+=-ldl
145
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
151
152         ln -fs ../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
153 endef
154
155 define SYSTEMD_INSTALL_MACHINEID_HOOK
156         touch $(TARGET_DIR)/etc/machine-id
157 endef
158
159 define SYSTEMD_SANITIZE_PATH_IN_UNITS
160         find $(TARGET_DIR)/lib/systemd/system -name '*.service' \
161                 -exec $(SED) 's,$(HOST_DIR),,g' {} \;
162 endef
163
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
168 endef
169
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
176
177 define SYSTEMD_USERS
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
187 endef
188
189 define SYSTEMD_DISABLE_SERVICE_TTY1
190         rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
191 endef
192
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]*$$'; \
197         then \
198                 SERVICE="getty"; \
199         else \
200                 SERVICE="serial-getty"; \
201         fi; \
202         ln -fs ../../../../lib/systemd/system/$${SERVICE}@.service \
203                 $(TARGET_DIR)/etc/systemd/system/getty.target.wants/$${SERVICE}@$(BR2_TARGET_GENERIC_GETTY_PORT).service
204 endef
205 endif
206
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)
212 endef
213
214 $(eval $(autotools-package))