summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd_219.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd_219.bb')
-rw-r--r--meta/recipes-core/systemd/systemd_219.bb389
1 files changed, 389 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_219.bb b/meta/recipes-core/systemd/systemd_219.bb
new file mode 100644
index 0000000000..f45c5e1260
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_219.bb
@@ -0,0 +1,389 @@
1SUMMARY = "A System and service manager"
2HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
3
4DESCRIPTION = "systemd is a system and service manager for Linux, compatible with \
5SysV and LSB init scripts. systemd provides aggressive parallelization \
6capabilities, uses socket and D-Bus activation for starting services, \
7offers on-demand starting of daemons, keeps track of processes using \
8Linux cgroups, supports snapshotting and restoring of the system \
9state, maintains mount and automount points and implements an \
10elaborate transactional dependency-based service control logic. It can \
11work as a drop-in replacement for sysvinit."
12
13LICENSE = "GPLv2 & LGPLv2.1 & MIT"
14LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
15 file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \
16 file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed"
17
18PROVIDES = "udev"
19
20PE = "1"
21
22DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native"
23DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
24
25SECTION = "base/shell"
26
27inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext
28
29SRCREV = "a88abde72169ddc2df77df3fa5bed30725022253"
30
31PV = "219+git${SRCPV}"
32
33SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git \
34 file://0002-shared-missing.h-fall-back-to-insecure-getenv.patch \
35 file://0003-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
36 file://0004-configure-Check-for-additional-features-that-uclibc-.patch \
37 file://0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch \
38 file://0006-journal-Use-posix-fallocate-only-if-available.patch \
39 file://0007-util-Use-mkostemp-only-if-libc-supports-it.patch \
40 file://0008-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch \
41 file://0009-sysv-generator-add-support-for-executing-scripts-und.patch \
42 file://0010-Make-root-s-home-directory-configurable.patch \
43 file://0011-systemd-user-avoid-using-system-auth.patch \
44 file://touchscreen.rules \
45 file://00-create-volatile.conf \
46 file://init \
47 file://run-ptest \
48 "
49
50S = "${WORKDIR}/git"
51
52SRC_URI_append_libc-uclibc = "\
53 file://0001-units-Prefer-getty-to-agetty-in-console-setup-system.patch \
54 "
55LDFLAGS_append_libc-uclibc = " -lrt"
56
57GTKDOC_DOCDIR = "${S}/docs/"
58
59PACKAGECONFIG ??= "xz"
60PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl"
61# Sign the journal for anti-tampering
62PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
63# regardless of PACKAGECONFIG, libgcrypt is always required to expand
64# the AM_PATH_LIBGCRYPT autoconf macro
65DEPENDS += "libgcrypt"
66# Compress the journal
67PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
68PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
69PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
70PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
71PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved"
72PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
73PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn"
74PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit"
75PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
76
77CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
78
79# Helper variables to clarify locations. This mirrors the logic in systemd's
80# build system.
81rootprefix ?= "${base_prefix}"
82rootlibdir ?= "${base_libdir}"
83rootlibexecdir = "${rootprefix}/lib"
84
85# The gtk+ tools should get built as a separate recipe e.g. systemd-tools
86EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
87 --with-rootlibdir=${rootlibdir} \
88 --with-roothomedir=${ROOT_HOME} \
89 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
90 --disable-coredump \
91 --disable-introspection \
92 --disable-kdbus \
93 --enable-split-usr \
94 --without-python \
95 --with-sysvrcnd-path=${sysconfdir} \
96 "
97# uclibc does not have NSS
98EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
99
100do_configure_prepend() {
101 export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
102 export NM="${HOST_PREFIX}gcc-nm"
103 export AR="${HOST_PREFIX}gcc-ar"
104 export RANLIB="${HOST_PREFIX}gcc-ranlib"
105 export KMOD="${base_bindir}/kmod"
106 if [ -d ${S}/units.pre_sed ] ; then
107 cp -r ${S}/units.pre_sed ${S}/units
108 else
109 cp -r ${S}/units ${S}/units.pre_sed
110 fi
111 sed -i '/ln --relative --help/d' ${S}/configure.ac
112 sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am
113 sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am
114}
115
116do_install() {
117 autotools_do_install
118 install -d ${D}/${base_sbindir}
119 # Provided by a separate recipe
120 rm ${D}${systemd_unitdir}/system/serial-getty* -f
121
122 # Provide support for initramfs
123 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
124 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
125
126 # Create machine-id
127 # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable
128 touch ${D}${sysconfdir}/machine-id
129
130
131 install -d ${D}${sysconfdir}/udev/rules.d/
132 install -d ${D}${sysconfdir}/tmpfiles.d
133 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
134
135 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
136
137 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
138 install -d ${D}${sysconfdir}/init.d
139 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
140 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
141 fi
142
143 # Delete journal README, as log can be symlinked inside volatile.
144 rm -f ${D}/${localstatedir}/log/README
145
146 # Create symlinks for systemd-update-utmp-runlevel.service
147 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
148 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
149 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
150 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
151 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
152 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
153 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
154 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
155 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
156 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
157
158 # Enable journal to forward message to syslog daemon
159 sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
160 # its needed in 216 upstream has fixed it with 919699ec301ea507edce4a619141ed22e789ac0d
161 # don't order journal flushing afte remote-fs.target
162 sed -i -e 's/ remote-fs.target$//' ${D}${systemd_unitdir}/system/systemd-journal-flush.service
163 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
164 # for existence else it fails
165 if [ -s ${D}${libdir}/tmpfiles.d/systemd.conf ]; then
166 ${@bb.utils.contains('PACKAGECONFIG', 'networkd', '', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${libdir}/tmpfiles.d/systemd.conf', d)}
167 fi
168}
169
170do_install_ptest () {
171 install -d ${D}${PTEST_PATH}/test
172 cp -rf ${S}/test/* ${D}${PTEST_PATH}/test
173 install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/
174 install -d ${D}${PTEST_PATH}/build-aux
175 cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
176 cp -rf ${B}/rules ${D}${PTEST_PATH}/
177 # This directory needs to be there for udev-test.pl to work.
178 install -d ${D}${libdir}/udev/rules.d
179 cp ${B}/Makefile ${D}${PTEST_PATH}/
180 cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test
181 sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl
182 sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
183 sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
184}
185
186python populate_packages_prepend (){
187 systemdlibdir = d.getVar("rootlibdir", True)
188 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
189}
190PACKAGES_DYNAMIC += "^lib(udev|systemd).*"
191
192PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \
193 ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh libgudev"
194
195SYSTEMD_PACKAGES = "${PN}-binfmt"
196SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
197
198USERADD_PACKAGES = "${PN}"
199USERADD_PARAM_${PN} += "--system systemd-journal-gateway; --system systemd-timesync"
200GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
201
202FILES_${PN}-analyze = "${bindir}/systemd-analyze"
203
204FILES_${PN}-initramfs = "/init"
205RDEPENDS_${PN}-initramfs = "${PN}"
206
207FILES_libgudev = "${libdir}/libgudev*${SOLIBS}"
208
209RDEPENDS_${PN}-ptest += "perl python bash"
210FILES_${PN}-ptest += "${libdir}/udev/rules.d"
211
212FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug"
213
214FILES_${PN}-gui = "${bindir}/systemadm"
215
216FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
217 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
218 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
219
220RDEPENDS_${PN}-kernel-install += "bash"
221FILES_${PN}-kernel-install = "${bindir}/kernel-install \
222 ${sysconfdir}/kernel/ \
223 ${exec_prefix}/lib/kernel \
224 "
225FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
226 "
227
228FILES_${PN}-zsh = "${datadir}/zsh/site-functions"
229
230FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
231 ${exec_prefix}/lib/binfmt.d \
232 ${rootlibexecdir}/systemd/systemd-binfmt \
233 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
234 ${systemd_unitdir}/system/systemd-binfmt.service"
235RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
236
237RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
238
239CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
240 ${sysconfdir}/systemd/logind.conf \
241 ${sysconfdir}/systemd/system.conf \
242 ${sysconfdir}/systemd/user.conf"
243
244FILES_${PN} = " ${base_bindir}/* \
245 ${datadir}/bash-completion \
246 ${datadir}/dbus-1/services \
247 ${datadir}/dbus-1/system-services \
248 ${datadir}/polkit-1 \
249 ${datadir}/${BPN} \
250 ${datadir}/factory \
251 ${sysconfdir}/bash_completion.d/ \
252 ${sysconfdir}/dbus-1/ \
253 ${sysconfdir}/machine-id \
254 ${sysconfdir}/modules-load.d/ \
255 ${sysconfdir}/sysctl.d/ \
256 ${sysconfdir}/systemd/ \
257 ${sysconfdir}/tmpfiles.d/ \
258 ${sysconfdir}/xdg/ \
259 ${sysconfdir}/init.d/README \
260 ${rootlibexecdir}/systemd/* \
261 ${systemd_unitdir}/* \
262 ${base_libdir}/security/*.so \
263 ${libdir}/libnss_* \
264 /cgroup \
265 ${bindir}/systemd* \
266 ${bindir}/busctl \
267 ${bindir}/localectl \
268 ${bindir}/hostnamectl \
269 ${bindir}/timedatectl \
270 ${bindir}/bootctl \
271 ${bindir}/kernel-install \
272 ${exec_prefix}/lib/tmpfiles.d/*.conf \
273 ${exec_prefix}/lib/systemd \
274 ${exec_prefix}/lib/modules-load.d \
275 ${exec_prefix}/lib/sysctl.d \
276 ${exec_prefix}/lib/sysusers.d \
277 ${localstatedir} \
278 /lib/udev/rules.d/70-uaccess.rules \
279 /lib/udev/rules.d/71-seat.rules \
280 /lib/udev/rules.d/73-seat-late.rules \
281 /lib/udev/rules.d/99-systemd.rules \
282 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \
283 "
284
285FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
286FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
287
288RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
289RDEPENDS_${PN} += "volatile-binds"
290
291RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units udev-hwdb\
292 util-linux-agetty \
293 util-linux-fsck e2fsprogs-e2fsck \
294 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 os-release \
295"
296
297PACKAGES =+ "udev-dbg udev udev-hwdb"
298
299FILES_udev-dbg += "/lib/udev/.debug"
300
301RPROVIDES_udev = "hotplug"
302
303RDEPENDS_udev-hwdb += "udev"
304
305FILES_udev += "${base_sbindir}/udevd \
306 ${rootlibexecdir}/systemd/systemd-udevd \
307 ${rootlibexecdir}/udev/accelerometer \
308 ${rootlibexecdir}/udev/ata_id \
309 ${rootlibexecdir}/udev/cdrom_id \
310 ${rootlibexecdir}/udev/collect \
311 ${rootlibexecdir}/udev/findkeyboards \
312 ${rootlibexecdir}/udev/keyboard-force-release.sh \
313 ${rootlibexecdir}/udev/keymap \
314 ${rootlibexecdir}/udev/mtd_probe \
315 ${rootlibexecdir}/udev/scsi_id \
316 ${rootlibexecdir}/udev/v4l_id \
317 ${rootlibexecdir}/udev/keymaps \
318 ${rootlibexecdir}/udev/rules.d/*.rules \
319 ${sysconfdir}/udev \
320 ${sysconfdir}/init.d/systemd-udevd \
321 ${systemd_unitdir}/system/*udev* \
322 ${systemd_unitdir}/system/*.wants/*udev* \
323 ${base_bindir}/udevadm \
324 ${datadir}/bash-completion/completions/udevadm \
325 "
326
327FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
328
329INITSCRIPT_PACKAGES = "udev"
330INITSCRIPT_NAME_udev = "systemd-udevd"
331INITSCRIPT_PARAMS_udev = "start 03 S ."
332
333python __anonymous() {
334 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
335 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
336}
337
338# TODO:
339# u-a for runlevel and telinit
340
341ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel"
342
343ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
344ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
345ALTERNATIVE_PRIORITY[init] ?= "300"
346
347ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
348ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
349ALTERNATIVE_PRIORITY[halt] ?= "300"
350
351ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
352ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
353ALTERNATIVE_PRIORITY[reboot] ?= "300"
354
355ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
356ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
357ALTERNATIVE_PRIORITY[shutdown] ?= "300"
358
359ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
360ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
361ALTERNATIVE_PRIORITY[poweroff] ?= "300"
362
363ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
364ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
365ALTERNATIVE_PRIORITY[runlevel] ?= "300"
366
367pkg_postinst_udev-hwdb () {
368 if test -n "$D"; then
369 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
370 --root $D
371 else
372 udevadm hwdb --update
373 fi
374}
375
376pkg_prerm_udev-hwdb () {
377 if test -n "$D"; then
378 exit 1
379 fi
380
381 rm -f ${sysconfdir}/udev/hwdb.bin
382}
383
384# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
385# that we don't build both udev and systemd in world builds.
386python () {
387 if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
388 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
389}