summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd_212.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd_212.bb')
-rw-r--r--meta/recipes-core/systemd/systemd_212.bb354
1 files changed, 354 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_212.bb b/meta/recipes-core/systemd/systemd_212.bb
new file mode 100644
index 0000000000..bbc5d34a19
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_212.bb
@@ -0,0 +1,354 @@
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
19
20SRCREV = "9b3310b066136b0674a926da094b7fe87a13a58b"
21
22PV = "212+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://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \
32 file://uclibc-sysinfo_h.patch \
33 file://uclibc-get-physmem.patch \
34 \
35 file://touchscreen.rules \
36 file://00-create-volatile.conf \
37 file://init \
38 file://run-ptest \
39 "
40
41S = "${WORKDIR}/git"
42
43SRC_URI_append_libc-uclibc = "\
44 file://systemd-pam-fix-getty-unit.patch \
45 "
46LDFLAGS_append_libc-uclibc = " -lrt"
47
48GTKDOC_DOCDIR = "${S}/docs/"
49
50PACKAGECONFIG ??= "xz tcp-wrappers"
51# Sign the journal for anti-tampering
52PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
53# regardless of PACKAGECONFIG, libgcrypt is always required to expand
54# the AM_PATH_LIBGCRYPT autoconf macro
55DEPENDS += "libgcrypt"
56# Compress the journal
57PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
58PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers"
59PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
60PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
61
62CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
63
64# Helper variables to clarify locations. This mirrors the logic in systemd's
65# build system.
66rootprefix ?= "${base_prefix}"
67rootlibdir ?= "${base_libdir}"
68rootlibexecdir = "${rootprefix}/lib"
69
70# The gtk+ tools should get built as a separate recipe e.g. systemd-tools
71EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
72 --with-rootlibdir=${rootlibdir} \
73 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
74 --disable-manpages \
75 --disable-coredump \
76 --disable-introspection \
77 --disable-kdbus \
78 --enable-split-usr \
79 --without-python \
80 --with-sysvrcnd-path=${sysconfdir} \
81 --with-firmware-path=/lib/firmware \
82 ac_cv_path_KILL=${base_bindir}/kill \
83 "
84# uclibc does not have NSS
85EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
86
87do_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
95 else
96 cp -r ${S}/units ${S}/units.pre_sed
97 fi
98 sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
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
101}
102
103do_install() {
104 autotools_do_install
105 install -d ${D}/${base_sbindir}
106 # Provided by a separate recipe
107 rm ${D}${systemd_unitdir}/system/serial-getty* -f
108
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
112
113 # Create machine-id
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
116
117 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
118
119 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
120
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
125 fi
126
127 # Delete journal README, as log can be symlinked inside volatile.
128 rm -f ${D}/${localstatedir}/log/README
129}
130
131do_install_ptest () {
132 install -d ${D}${PTEST_PATH}/test
133 cp -rf ${S}/test/* ${D}${PTEST_PATH}/test
134 install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/
135 install -d ${D}${PTEST_PATH}/build-aux
136 cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
137 cp -rf ${B}/rules ${D}${PTEST_PATH}/
138 # This directory needs to be there for udev-test.pl to work.
139 install -d ${D}${libdir}/udev/rules.d
140 cp ${B}/Makefile ${D}${PTEST_PATH}/
141 cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test
142 sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl
143 sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
144 sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
145}
146
147python populate_packages_prepend (){
148 systemdlibdir = d.getVar("rootlibdir", True)
149 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
150}
151PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*"
152
153PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \
154 ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh"
155
156SYSTEMD_PACKAGES = "${PN}-binfmt"
157SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
158
159USERADD_PACKAGES = "${PN}"
160USERADD_PARAM_${PN} += "--system systemd-journal-gateway"
161GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
162
163FILES_${PN}-analyze = "${bindir}/systemd-analyze"
164
165FILES_${PN}-initramfs = "/init"
166RDEPENDS_${PN}-initramfs = "${PN}"
167
168# The test cases need perl and bash to run correctly.
169RDEPENDS_${PN}-ptest += "perl bash"
170FILES_${PN}-ptest += "${libdir}/udev/rules.d"
171
172FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug"
173
174FILES_${PN}-gui = "${bindir}/systemadm"
175
176FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
177 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
178 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
179
180FILES_${PN}-kernel-install = "${bindir}/kernel-install \
181 ${sysconfdir}/kernel/ \
182 ${exec_prefix}/lib/kernel \
183 "
184FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
185 "
186
187FILES_${PN}-zsh = "${datadir}/zsh/site-functions"
188
189FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
190 ${exec_prefix}/lib/binfmt.d \
191 ${rootlibexecdir}/systemd/systemd-binfmt \
192 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
193 ${systemd_unitdir}/system/systemd-binfmt.service"
194RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
195
196RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts"
197
198CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
199 ${sysconfdir}/systemd/logind.conf \
200 ${sysconfdir}/systemd/system.conf \
201 ${sysconfdir}/systemd/user.conf"
202
203FILES_${PN} = " ${base_bindir}/* \
204 ${datadir}/bash-completion \
205 ${datadir}/dbus-1/services \
206 ${datadir}/dbus-1/system-services \
207 ${datadir}/polkit-1 \
208 ${datadir}/${BPN} \
209 ${sysconfdir}/bash_completion.d/ \
210 ${sysconfdir}/dbus-1/ \
211 ${sysconfdir}/machine-id \
212 ${sysconfdir}/modules-load.d/ \
213 ${sysconfdir}/sysctl.d/ \
214 ${sysconfdir}/systemd/ \
215 ${sysconfdir}/tmpfiles.d/ \
216 ${sysconfdir}/xdg/ \
217 ${sysconfdir}/init.d/README \
218 ${rootlibexecdir}/systemd/* \
219 ${systemd_unitdir}/* \
220 ${base_libdir}/security/*.so \
221 ${libdir}/libnss_myhostname.so.2 \
222 /cgroup \
223 ${bindir}/systemd* \
224 ${bindir}/busctl \
225 ${bindir}/localectl \
226 ${bindir}/hostnamectl \
227 ${bindir}/timedatectl \
228 ${bindir}/bootctl \
229 ${bindir}/kernel-install \
230 ${exec_prefix}/lib/tmpfiles.d/*.conf \
231 ${exec_prefix}/lib/systemd \
232 ${exec_prefix}/lib/modules-load.d \
233 ${exec_prefix}/lib/sysctl.d \
234 ${localstatedir} \
235 /lib/udev/rules.d/70-uaccess.rules \
236 /lib/udev/rules.d/71-seat.rules \
237 /lib/udev/rules.d/73-seat-late.rules \
238 /lib/udev/rules.d/99-systemd.rules \
239 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \
240 "
241
242FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
243FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
244
245RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
246
247RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
248 util-linux-agetty \
249 util-linux-fsck e2fsprogs-e2fsck \
250 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
251"
252
253PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"
254
255FILES_udev-dbg += "/lib/udev/.debug"
256
257RDEPENDS_udev += "udev-utils"
258RPROVIDES_udev = "hotplug"
259RRECOMMENDS_udev += "udev-hwdb"
260
261RDEPENDS_udev-hwdb += "udev-utils"
262
263FILES_udev += "${base_sbindir}/udevd \
264 ${rootlibexecdir}/systemd/systemd-udevd \
265 ${rootlibexecdir}/udev/accelerometer \
266 ${rootlibexecdir}/udev/ata_id \
267 ${rootlibexecdir}/udev/cdrom_id \
268 ${rootlibexecdir}/udev/collect \
269 ${rootlibexecdir}/udev/findkeyboards \
270 ${rootlibexecdir}/udev/keyboard-force-release.sh \
271 ${rootlibexecdir}/udev/keymap \
272 ${rootlibexecdir}/udev/mtd_probe \
273 ${rootlibexecdir}/udev/scsi_id \
274 ${rootlibexecdir}/udev/v4l_id \
275 ${rootlibexecdir}/udev/keymaps \
276 ${rootlibexecdir}/udev/rules.d/4*.rules \
277 ${rootlibexecdir}/udev/rules.d/5*.rules \
278 ${rootlibexecdir}/udev/rules.d/6*.rules \
279 ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \
280 ${rootlibexecdir}/udev/rules.d/75*.rules \
281 ${rootlibexecdir}/udev/rules.d/78*.rules \
282 ${rootlibexecdir}/udev/rules.d/8*.rules \
283 ${rootlibexecdir}/udev/rules.d/95*.rules \
284 ${sysconfdir}/udev \
285 ${sysconfdir}/init.d/systemd-udevd \
286 ${systemd_unitdir}/system/*udev* \
287 ${systemd_unitdir}/system/*.wants/*udev* \
288 "
289
290FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm"
291
292FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
293
294INITSCRIPT_PACKAGES = "udev"
295INITSCRIPT_NAME_udev = "systemd-udevd"
296INITSCRIPT_PARAMS_udev = "start 03 S ."
297
298python __anonymous() {
299 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
300 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
301}
302
303# TODO:
304# u-a for runlevel and telinit
305
306ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel"
307
308ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
309ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
310ALTERNATIVE_PRIORITY[init] ?= "300"
311
312ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
313ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
314ALTERNATIVE_PRIORITY[halt] ?= "300"
315
316ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
317ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
318ALTERNATIVE_PRIORITY[reboot] ?= "300"
319
320ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
321ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
322ALTERNATIVE_PRIORITY[shutdown] ?= "300"
323
324ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
325ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
326ALTERNATIVE_PRIORITY[poweroff] ?= "300"
327
328ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
329ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
330ALTERNATIVE_PRIORITY[runlevel] ?= "300"
331
332pkg_postinst_udev-hwdb () {
333 if test -n "$D"; then
334 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
335 --root $D
336 else
337 udevadm hwdb --update
338 fi
339}
340
341pkg_prerm_udev-hwdb () {
342 if test -n "$D"; then
343 exit 1
344 fi
345
346 rm -f ${sysconfdir}/udev/hwdb.bin
347}
348
349# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
350# that we don't build both udev and systemd in world builds.
351python () {
352 if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
353 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
354}