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