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