1 SUMMARY = "System and service manager for Linux, replacing SysVinit"
2 HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
4 LICENSE = "GPLv2 & LGPLv2.1 & MIT"
5 LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
6 file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \
7 file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed"
13 DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native util-linux"
14 DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
16 SECTION = "base/shell"
18 inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext
20 SRCREV = "1c6d7a3b259467df3c02c1fb0bb4c57d70192d15"
22 PV = "216+git${SRCPV}"
24 SRC_URI = "git://review.tizen.org/platform/upstream/systemd;protocol=git;tag=1c6d7a3b259467df3c02c1fb0bb4c57d70192d15;nobranch=1 \
25 file://touchscreen.rules \
26 file://00-create-volatile.conf \
33 SRC_URI_append_libc-uclibc = "\
34 file://systemd-pam-fix-getty-unit.patch \
36 LDFLAGS_append_libc-uclibc = " -lrt"
38 GTKDOC_DOCDIR = "${S}/docs/"
40 PACKAGECONFIG ??= "xz"
41 PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl"
42 # Sign the journal for anti-tampering
43 PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
44 # regardless of PACKAGECONFIG, libgcrypt is always required to expand
45 # the AM_PATH_LIBGCRYPT autoconf macro
46 DEPENDS += "libgcrypt"
47 # Compress the journal
48 PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
49 PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
50 PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
51 PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
52 PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved"
53 PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
55 CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
57 # Helper variables to clarify locations. This mirrors the logic in systemd's
59 rootprefix ?= "${base_prefix}"
60 rootlibdir ?= "${base_libdir}"
61 rootlibexecdir = "${rootprefix}/lib"
63 # The gtk+ tools should get built as a separate recipe e.g. systemd-tools
64 EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
65 --with-rootlibdir=${rootlibdir} \
66 --with-roothomedir=${ROOT_HOME} \
67 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
70 --disable-introspection \
74 --with-sysvrcnd-path= \
75 --with-firmware-path=/lib/firmware \
76 --enable-compat-libs \
77 ac_cv_path_KILL=${base_bindir}/kill \
80 EXTRA_OECONF += " --enable-bootchart --disable-sysusers --disable-firstboot --disable-timesyncd --disable-resolved --disable-networkd --libexecdir=${prefix}/lib --docdir=${prefix}/share/doc/packages/systemd --disable-static --disable-libcurl --with-sysvinit-path= --with-smack-run-label=System cc_cv_CFLAGS__flto=no"
84 # uclibc does not have NSS
85 EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
87 do_configure_prepend() {
88 export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
89 export NM="${HOST_PREFIX}gcc-nm"
90 export AR="${HOST_PREFIX}gcc-ar"
91 export RANLIB="${HOST_PREFIX}gcc-ranlib"
92 export KMOD="${base_bindir}/kmod"
93 if [ -d ${S}/units.pre_sed ] ; then
94 cp -r ${S}/units.pre_sed ${S}/units
96 cp -r ${S}/units ${S}/units.pre_sed
98 sed -i '/ln --relative --help/d' ${S}/configure.ac
99 sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am
100 sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am
105 install -d ${D}/${base_sbindir}
106 # Provided by a separate recipe
107 rm ${D}${systemd_unitdir}/system/serial-getty* -f
109 # Provide support for initramfs
110 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
111 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
114 # 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
115 touch ${D}${sysconfdir}/machine-id
117 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
119 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
121 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
122 install -d ${D}${sysconfdir}/init.d
123 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
124 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
127 # Move libgudev back to ${rootlibdir} to keep backward compatibility
128 [ ${rootlibdir} != ${libdir} ] && mv -t ${D}${rootlibdir} ${D}${libdir}/libgudev*
130 # Delete journal README, as log can be symlinked inside volatile.
131 rm -f ${D}/${localstatedir}/log/README
132 rm -rf ${D}/${localstatedir}/log
135 # Create symlinks for systemd-update-utmp-runlevel.service
136 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
137 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
138 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
139 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
140 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
141 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
142 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
143 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
144 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
145 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
147 # Enable journal to forward message to syslog daemon
148 sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
149 ### TIZEN PART SPECIFIC #####
151 ln -sf loginctl ${D}${prefix}/bin/systemd-loginctl
153 # We create all wants links manually at installation time to make sure
154 # they are not owned and hence overriden by rpm after the used deleted
156 rm -rf ${D}${sysconfdir}/systemd/system/*.target.wants
158 # Make sure the ghost-ing below works
159 touch ${D}${sysconfdir}/systemd/system/runlevel2.target
160 touch ${D}${sysconfdir}/systemd/system/runlevel3.target
161 touch ${D}${sysconfdir}/systemd/system/runlevel4.target
162 touch ${D}${sysconfdir}/systemd/system/runlevel5.target
164 # Make sure these directories are properly owned
165 mkdir -p ${D}${systemd_unitdir}/system/basic.target.wants
166 mkdir -p ${D}${systemd_unitdir}/system/default.target.wants
167 mkdir -p ${D}${systemd_unitdir}/system/dbus.target.wants
168 mkdir -p ${D}${systemd_unitdir}/system/syslog.target.wants
170 # Make sure the user generators dir exists too
171 mkdir -p ${D}/lib/systemd/system-generators
172 mkdir -p ${D}${prefix}/lib/systemd/user-generators
174 # Create new-style configuration files so that we can ghost-own them
175 touch ${D}${sysconfdir}/hostname
176 touch ${D}${sysconfdir}/vconsole.conf
177 touch ${D}${sysconfdir}/locale.conf
178 touch ${D}${sysconfdir}/machine-id
179 touch ${D}${sysconfdir}/machine-info
180 touch ${D}${sysconfdir}/timezone
182 mkdir -p ${D}/lib/systemd/system-preset/
183 mkdir -p ${D}/lib/systemd/user-preset/
185 # Make sure the shutdown/sleep drop-in dirs exist
186 mkdir -p ${D}/lib/systemd/system-shutdown/
187 mkdir -p ${D}/lib/systemd/system-sleep/
189 # Make sure the NTP units dir exists
190 mkdir -p ${D}${prefix}/lib/systemd/ntp-units.d/
192 # Install modprobe fragment
193 mkdir -p ${D}${sysconfdir}/modprobe.d/
195 # Fix the dangling /var/lock -> /run/lock symlink
196 install -Dm644 ${S}/tmpfiles.d/legacy.conf ${D}${prefix}/lib/tmpfiles.d/legacy.conf
198 install -m644 ${S}/packaging/pamconsole-tmp.conf ${D}${prefix}/lib/tmpfiles.d/
200 rm -rf ${D}${systemd_unitdir}/system/default.target
201 install -m 755 -d ${D}${systemd_unitdir}/system
202 install -m 644 ${S}/packaging/default.target ${D}${systemd_unitdir}/system/
204 rm -rf ${D}${prefix}/share/doc/packages/systemd
206 # Disable some useless services in Tizen
207 rm -rf ${D}${prefix}/lib/systemd/user/sysinit.target.wants/dev-hugepages.mount
208 rm -rf ${D}${prefix}/lib/systemd/user/sysinit.target.wants/sys-fs-fuse-connections.mount
209 rm -rf ${D}${prefix}/lib/systemd/user/sysinit.target.wants/systemd-binfmt.service
210 rm -rf ${D}${prefix}/lib/systemd/user/sysinit.target.wants/systemd-modules-load.service
211 rm -rf ${D}${prefix}/lib/systemd/user/sysinit.target.wants/systemd-ask-password-console.path
212 rm -rf ${D}${prefix}/lib/systemd/user/multi-user.target.wants/systemd-ask-password-wall.path
214 # Move macros to the proper location for Tizen
215 mkdir -p ${D}${sysconfdir}/rpm
216 install -m644 ${B}/src/core/macros.systemd ${D}${sysconfdir}/rpm/macros.systemd
218 rm -fr ${D}${prefix}/lib/rpm
219 rm -fr ${D}${sysconfdir}/kernel
220 rm -fr ${D}${sysconfdir}/modprobe.d
221 rm -fr ${D}${localstatedir}
223 # Exclude ELF binaries
224 rm -f ${D}/lib/systemd/system-generators/systemd-debug-generator
225 rm -f ${D}${prefix}/lib/systemd/system-generators/systemd-hibernate-resume-generator
232 do_install_ptest () {
233 install -d ${D}${PTEST_PATH}/test
234 cp -rf ${S}/test/* ${D}${PTEST_PATH}/test
235 install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/
236 install -d ${D}${PTEST_PATH}/build-aux
237 cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
238 cp -rf ${B}/rules ${D}${PTEST_PATH}/
239 # This directory needs to be there for udev-test.pl to work.
240 install -d ${D}${libdir}/udev/rules.d
241 cp ${B}/Makefile ${D}${PTEST_PATH}/
242 cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test
243 sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl
244 sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
245 sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
248 python populate_packages_prepend (){
249 systemdlibdir = d.getVar("rootlibdir", True)
250 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
252 PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*"
254 PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \
255 ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh"
257 SYSTEMD_PACKAGES = "${PN}-binfmt"
258 SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
260 USERADD_PACKAGES = "${PN}"
261 USERADD_PARAM_${PN} += "--system systemd-journal-gateway"
262 GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
264 FILES_${PN}-analyze = "${bindir}/systemd-analyze"
266 FILES_${PN}-initramfs = "/init"
267 RDEPENDS_${PN}-initramfs = "${PN}"
269 # The test cases need perl and bash to run correctly.
270 RDEPENDS_${PN}-ptest += "perl bash"
271 FILES_${PN}-ptest += "${libdir}/udev/rules.d"
273 FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug"
275 FILES_${PN}-gui = "${bindir}/systemadm"
277 FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
278 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
279 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
281 FILES_${PN}-kernel-install = "${bindir}/kernel-install \
282 ${sysconfdir}/kernel/ \
283 ${exec_prefix}/lib/kernel \
285 FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
288 FILES_${PN}-zsh = "${datadir}/zsh/site-functions"
290 FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
291 ${exec_prefix}/lib/binfmt.d \
292 ${rootlibexecdir}/systemd/systemd-binfmt \
293 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
294 ${systemd_unitdir}/system/systemd-binfmt.service"
295 RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
297 RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
299 CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
300 ${sysconfdir}/systemd/logind.conf \
301 ${sysconfdir}/systemd/system.conf \
302 ${sysconfdir}/systemd/user.conf"
304 FILES_${PN} = " ${base_bindir}/* \
305 ${datadir}/bash-completion \
306 ${datadir}/dbus-1/services \
307 ${datadir}/dbus-1/system-services \
308 ${datadir}/polkit-1 \
311 ${sysconfdir}/bash_completion.d/ \
312 ${sysconfdir}/dbus-1/ \
313 ${sysconfdir}/machine-id \
314 ${sysconfdir}/modules-load.d/ \
315 ${sysconfdir}/sysctl.d/ \
316 ${sysconfdir}/systemd/ \
317 ${sysconfdir}/tmpfiles.d/ \
319 ${sysconfdir}/init.d/README \
320 ${rootlibexecdir}/systemd/* \
321 ${systemd_unitdir}/* \
322 ${base_libdir}/security/*.so \
327 ${bindir}/localectl \
328 ${bindir}/hostnamectl \
329 ${bindir}/timedatectl \
331 ${bindir}/kernel-install \
332 ${exec_prefix}/lib/tmpfiles.d/*.conf \
333 ${exec_prefix}/lib/systemd \
334 ${exec_prefix}/lib/modules-load.d \
335 ${exec_prefix}/lib/sysctl.d \
336 ${exec_prefix}/lib/sysusers.d \
338 /lib/udev/rules.d/70-uaccess.rules \
339 /lib/udev/rules.d/71-seat.rules \
340 /lib/udev/rules.d/73-seat-late.rules \
341 /lib/udev/rules.d/99-systemd.rules \
342 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \
345 FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
346 FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
348 RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
349 RDEPENDS_${PN} += "volatile-binds"
351 RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units udev-hwdb\
353 util-linux-fsck e2fsprogs-e2fsck \
354 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 os-release \
357 PACKAGES =+ "udev-dbg udev udev-hwdb"
359 FILES_udev-dbg += "/lib/udev/.debug"
361 RPROVIDES_udev = "hotplug"
363 RDEPENDS_udev-hwdb += "udev"
365 FILES_udev += "${base_sbindir}/udevd \
366 ${rootlibexecdir}/systemd/systemd-udevd \
367 ${rootlibexecdir}/udev/accelerometer \
368 ${rootlibexecdir}/udev/ata_id \
369 ${rootlibexecdir}/udev/cdrom_id \
370 ${rootlibexecdir}/udev/collect \
371 ${rootlibexecdir}/udev/findkeyboards \
372 ${rootlibexecdir}/udev/keyboard-force-release.sh \
373 ${rootlibexecdir}/udev/keymap \
374 ${rootlibexecdir}/udev/mtd_probe \
375 ${rootlibexecdir}/udev/scsi_id \
376 ${rootlibexecdir}/udev/v4l_id \
377 ${rootlibexecdir}/udev/keymaps \
378 ${rootlibexecdir}/udev/rules.d/4*.rules \
379 ${rootlibexecdir}/udev/rules.d/5*.rules \
380 ${rootlibexecdir}/udev/rules.d/6*.rules \
381 ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \
382 ${rootlibexecdir}/udev/rules.d/75*.rules \
383 ${rootlibexecdir}/udev/rules.d/78*.rules \
384 ${rootlibexecdir}/udev/rules.d/8*.rules \
385 ${rootlibexecdir}/udev/rules.d/95*.rules \
387 ${sysconfdir}/init.d/systemd-udevd \
388 ${systemd_unitdir}/system/*udev* \
389 ${systemd_unitdir}/system/*.wants/*udev* \
390 ${base_bindir}/udevadm \
391 ${datadir}/bash-completion/completions/udevadm \
394 FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
396 INITSCRIPT_PACKAGES = "udev"
397 INITSCRIPT_NAME_udev = "systemd-udevd"
398 INITSCRIPT_PARAMS_udev = "start 03 S ."
400 python __anonymous() {
401 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
402 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
406 # u-a for runlevel and telinit
408 ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel"
410 ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
411 ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
412 ALTERNATIVE_PRIORITY[init] ?= "300"
414 ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
415 ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
416 ALTERNATIVE_PRIORITY[halt] ?= "300"
418 ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
419 ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
420 ALTERNATIVE_PRIORITY[reboot] ?= "300"
422 ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
423 ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
424 ALTERNATIVE_PRIORITY[shutdown] ?= "300"
426 ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
427 ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
428 ALTERNATIVE_PRIORITY[poweroff] ?= "300"
430 ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
431 ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
432 ALTERNATIVE_PRIORITY[runlevel] ?= "300"
434 pkg_postinst_udev-hwdb () {
435 if test -n "$D"; then
436 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
439 udevadm hwdb --update
443 pkg_prerm_udev-hwdb () {
444 if test -n "$D"; then
448 rm -f ${sysconfdir}/udev/hwdb.bin
451 # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
452 # that we don't build both udev and systemd in world builds.
454 if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
455 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")