diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd_212.bb')
-rw-r--r-- | meta/recipes-core/systemd/systemd_212.bb | 354 |
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 @@ | |||
1 | SUMMARY = "System and service manager for Linux, replacing SysVinit" | ||
2 | HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd" | ||
3 | |||
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" | ||
8 | |||
9 | PROVIDES = "udev" | ||
10 | |||
11 | PE = "1" | ||
12 | |||
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)}" | ||
15 | |||
16 | SECTION = "base/shell" | ||
17 | |||
18 | inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest | ||
19 | |||
20 | SRCREV = "9b3310b066136b0674a926da094b7fe87a13a58b" | ||
21 | |||
22 | PV = "212+git${SRCPV}" | ||
23 | |||
24 | SRC_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 | |||
41 | S = "${WORKDIR}/git" | ||
42 | |||
43 | SRC_URI_append_libc-uclibc = "\ | ||
44 | file://systemd-pam-fix-getty-unit.patch \ | ||
45 | " | ||
46 | LDFLAGS_append_libc-uclibc = " -lrt" | ||
47 | |||
48 | GTKDOC_DOCDIR = "${S}/docs/" | ||
49 | |||
50 | PACKAGECONFIG ??= "xz tcp-wrappers" | ||
51 | # Sign the journal for anti-tampering | ||
52 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" | ||
53 | # regardless of PACKAGECONFIG, libgcrypt is always required to expand | ||
54 | # the AM_PATH_LIBGCRYPT autoconf macro | ||
55 | DEPENDS += "libgcrypt" | ||
56 | # Compress the journal | ||
57 | PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz" | ||
58 | PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers" | ||
59 | PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" | ||
60 | PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd" | ||
61 | |||
62 | CACHED_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. | ||
66 | rootprefix ?= "${base_prefix}" | ||
67 | rootlibdir ?= "${base_libdir}" | ||
68 | rootlibexecdir = "${rootprefix}/lib" | ||
69 | |||
70 | # The gtk+ tools should get built as a separate recipe e.g. systemd-tools | ||
71 | EXTRA_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 | ||
85 | EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname " | ||
86 | |||
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 | ||
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 | |||
103 | do_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 | |||
131 | do_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 | |||
147 | python 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 | } | ||
151 | PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*" | ||
152 | |||
153 | PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \ | ||
154 | ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh" | ||
155 | |||
156 | SYSTEMD_PACKAGES = "${PN}-binfmt" | ||
157 | SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" | ||
158 | |||
159 | USERADD_PACKAGES = "${PN}" | ||
160 | USERADD_PARAM_${PN} += "--system systemd-journal-gateway" | ||
161 | GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal" | ||
162 | |||
163 | FILES_${PN}-analyze = "${bindir}/systemd-analyze" | ||
164 | |||
165 | FILES_${PN}-initramfs = "/init" | ||
166 | RDEPENDS_${PN}-initramfs = "${PN}" | ||
167 | |||
168 | # The test cases need perl and bash to run correctly. | ||
169 | RDEPENDS_${PN}-ptest += "perl bash" | ||
170 | FILES_${PN}-ptest += "${libdir}/udev/rules.d" | ||
171 | |||
172 | FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug" | ||
173 | |||
174 | FILES_${PN}-gui = "${bindir}/systemadm" | ||
175 | |||
176 | FILES_${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 | |||
180 | FILES_${PN}-kernel-install = "${bindir}/kernel-install \ | ||
181 | ${sysconfdir}/kernel/ \ | ||
182 | ${exec_prefix}/lib/kernel \ | ||
183 | " | ||
184 | FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ | ||
185 | " | ||
186 | |||
187 | FILES_${PN}-zsh = "${datadir}/zsh/site-functions" | ||
188 | |||
189 | FILES_${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" | ||
194 | RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" | ||
195 | |||
196 | RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts" | ||
197 | |||
198 | CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \ | ||
199 | ${sysconfdir}/systemd/logind.conf \ | ||
200 | ${sysconfdir}/systemd/system.conf \ | ||
201 | ${sysconfdir}/systemd/user.conf" | ||
202 | |||
203 | FILES_${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 | |||
242 | FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/" | ||
243 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" | ||
244 | |||
245 | RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})" | ||
246 | |||
247 | RRECOMMENDS_${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 | |||
253 | PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb" | ||
254 | |||
255 | FILES_udev-dbg += "/lib/udev/.debug" | ||
256 | |||
257 | RDEPENDS_udev += "udev-utils" | ||
258 | RPROVIDES_udev = "hotplug" | ||
259 | RRECOMMENDS_udev += "udev-hwdb" | ||
260 | |||
261 | RDEPENDS_udev-hwdb += "udev-utils" | ||
262 | |||
263 | FILES_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 | |||
290 | FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm" | ||
291 | |||
292 | FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" | ||
293 | |||
294 | INITSCRIPT_PACKAGES = "udev" | ||
295 | INITSCRIPT_NAME_udev = "systemd-udevd" | ||
296 | INITSCRIPT_PARAMS_udev = "start 03 S ." | ||
297 | |||
298 | python __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 | |||
306 | ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel" | ||
307 | |||
308 | ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd" | ||
309 | ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" | ||
310 | ALTERNATIVE_PRIORITY[init] ?= "300" | ||
311 | |||
312 | ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" | ||
313 | ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" | ||
314 | ALTERNATIVE_PRIORITY[halt] ?= "300" | ||
315 | |||
316 | ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" | ||
317 | ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" | ||
318 | ALTERNATIVE_PRIORITY[reboot] ?= "300" | ||
319 | |||
320 | ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" | ||
321 | ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" | ||
322 | ALTERNATIVE_PRIORITY[shutdown] ?= "300" | ||
323 | |||
324 | ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" | ||
325 | ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" | ||
326 | ALTERNATIVE_PRIORITY[poweroff] ?= "300" | ||
327 | |||
328 | ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" | ||
329 | ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" | ||
330 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" | ||
331 | |||
332 | pkg_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 | |||
341 | pkg_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. | ||
351 | python () { | ||
352 | if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): | ||
353 | raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") | ||
354 | } | ||