summaryrefslogtreecommitdiffstats
path: root/package/systemd/systemd.mk
blob: d606589ffddaf02bc3e49c9540e700bc93fea9ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#############################################################
#
# systemd
#
#############################################################
SYSTEMD_VERSION = 185
SYSTEMD_SITE = http://www.freedesktop.org/software/systemd/
SYSTEMD_SOURCE = systemd-$(SYSTEMD_VERSION).tar.xz
SYSTEMD_INSTALL_STAGING = YES
SYSTEMD_DEPENDENCIES = \
	host-intltool \
        usbutils \
	libcap \
	host-gperf \
	dbus

# Make sure that systemd will always be built after busybox so that we have
# a consistent init setup between two builds
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
	SYSTEMD_DEPENDENCIES += busybox
endif

SYSTEMD_CONF_OPT += \
	--exec-prefix=/openslx \
	--with-distro=other \
	--enable-plymouth \
	--with-dbuspolicydir=/etc/dbus-1/system.d \
	--with-dbussessionservicedir=/usr/share/dbus-1/services \
	--with-dbussystemservicedir=/usr/share/dbus-1/system-services \
	--with-dbusinterfacedir=/usr/share/dbus-1/interfaces \
	--with-sysvinit-path=/etc/init.d/ \
	--without-sysvrcd-path \
	--enable-split-usr

ifeq ($(BR2_PACKAGE_ACL),y)
	SYSTEMD_CONF_OPT += --enable-acl
	SYSTEMD_DEPENDENCIES += acl
else
	SYSTEMD_CONF_OPT += --disable-acl
endif

ifneq ($(BR2_LARGEFILE),y)
	SYSTEMD_CONF_OPT += --disable-largefile
endif

# mq_getattr needs -lrt
SYSTEMD_MAKE_OPT += LIBS=-lrt
SYSTEMD_MAKE_OPT += LDFLAGS+=-ldl

define SYSTEMD_INSTALL_INIT_HOOK
	ln -fs ../usr/lib/systemd/systemd $(TARGET_DIR)/sbin/init
	ln -fs ../usr/bin/systemctl $(TARGET_DIR)/openslx/sbin/halt
	ln -fs ../usr/bin/systemctl $(TARGET_DIR)/openslx/sbin/poweroff
	ln -fs ../usr/bin/systemctl $(TARGET_DIR)/openslx/sbin/reboot

	ln -fs ../../../usr/lib/systemd/system/getty.target $(TARGET_DIR)/etc/systemd/system/default.target
endef

define SYSTEMD_INSTALL_TTY_HOOK
	rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty@tty1.service
	ln -fs ../../../../usr/lib/systemd/system/serial-getty@.service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
endef

SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
	SYSTEMD_INSTALL_INIT_HOOK \
	SYSTEMD_INSTALL_TTY_HOOK \

$(eval $(call AUTOTARGETS))