summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd_206.bb
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2013-08-22 02:16:30 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-28 00:37:00 +0100
commit937968bf95e38dcdfc3e7791dc9efaf5f7613f24 (patch)
tree281e7ee48cfefa2ba946eb1593ef779243dc1bae /meta/recipes-core/systemd/systemd_206.bb
parent695039598b18a49e9637fdb335a5d7b011e9598c (diff)
downloadpoky-937968bf95e38dcdfc3e7791dc9efaf5f7613f24.tar.gz
systemd: Upgrade to 206
Add new PACKAGE systemd-rpm-macros, this will hold the macros which are interesting when rpm is used as package management backend Forward port uclibc only patches. Add a new patch to stub out use of preadv/pwritev in testcases Delete patches that have been merged upstream in systemd Remove force export of GPERF variable in environment this was causing AC_CHECK_TOOL to not populate GPERF variable as expected systemd needs kmod to be present on rootfs so add it to RDEPENDS some services substitute discovered kmod when the service file is generated during boot, however the discovered kmod is from native sysroot and it gets into the service file with absolute path. So specify the target path of kmod using KMOD variable so the unit files have correct pointer to kmod on target Add a patch to make sure that mknod capability is checked before the service which excercise mknod, this patch is also submitted to upstream systemd (From OE-Core rev: 3f1788f8edf18a292cb5d8e16a2a98a19ec89239) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd_206.bb')
-rw-r--r--meta/recipes-core/systemd/systemd_206.bb299
1 files changed, 299 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_206.bb b/meta/recipes-core/systemd/systemd_206.bb
new file mode 100644
index 0000000000..f05aa1b6d9
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_206.bb
@@ -0,0 +1,299 @@
1DESCRIPTION = "Systemd a init replacement"
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
19
20SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
21 file://0001-use-CAP_MKNOD-ConditionCapability.patch \
22 file://touchscreen.rules \
23 ${UCLIBCPATCHES} \
24 file://00-create-volatile.conf \
25 file://init \
26 "
27SRC_URI[md5sum] = "89e36f2d3ba963020b72738549954cbc"
28SRC_URI[sha256sum] = "4c993de071118ea1df7ffc4be26ef0b0d78354ef15b2743a2783d20edfcde9de"
29
30UCLIBCPATCHES = ""
31UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \
32 file://systemd-pam-fix-execvpe.patch \
33 file://systemd-pam-fix-fallocate.patch \
34 file://systemd-pam-fix-getty-unit.patch \
35 file://systemd-pam-fix-mkostemp.patch \
36 file://systemd-pam-fix-msformat.patch \
37 file://optional_secure_getenv.patch \
38 file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \
39 "
40LDFLAGS_libc-uclibc_append = " -lrt"
41
42GTKDOC_DOCDIR = "${S}/docs/"
43
44PACKAGECONFIG ??= "xz tcp-wrappers"
45# Sign the journal for anti-tampering
46PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
47# regardless of PACKAGECONFIG, libgcrypt is always required to expand
48# the AM_PATH_LIBGCRYPT autoconf macro
49DEPENDS += "libgcrypt"
50# Compress the journal
51PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
52PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers"
53
54CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
55
56# Helper variables to clarify locations. This mirrors the logic in systemd's
57# build system.
58rootprefix ?= "${base_prefix}"
59rootlibdir ?= "${base_libdir}"
60rootlibexecdir = "${rootprefix}/lib"
61
62# The gtk+ tools should get built as a separate recipe e.g. systemd-tools
63EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
64 --with-rootlibdir=${rootlibdir} \
65 ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
66 --enable-xz \
67 --disable-manpages \
68 --disable-coredump \
69 --disable-introspection \
70 --disable-tcpwrap \
71 --enable-split-usr \
72 --disable-microhttpd \
73 --without-python \
74 --with-sysvrcnd-path=${sysconfdir} \
75 --with-firmware-path=/lib/firmware \
76 ac_cv_path_KILL=${base_bindir}/kill \
77 "
78# uclibc does not have NSS
79EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
80
81do_configure_prepend() {
82 export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
83 export KMOD="${base_bindir}/kmod"
84 sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
85}
86
87do_install() {
88 autotools_do_install
89 install -d ${D}/${base_sbindir}
90 # Provided by a separate recipe
91 rm ${D}${systemd_unitdir}/system/serial-getty* -f
92
93 # Provide support for initramfs
94 ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
95 ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
96
97 # Create dir for journal
98 install -d ${D}${localstatedir}/log/journal
99
100 # Create machine-id
101 # 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
102 touch ${D}${sysconfdir}/machine-id
103
104 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
105
106 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
107
108 if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
109 install -d ${D}${sysconfdir}/init.d
110 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
111 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
112 fi
113}
114
115python populate_packages_prepend (){
116 systemdlibdir = d.getVar("rootlibdir", True)
117 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
118}
119PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*"
120
121PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install ${PN}-rpm-macros"
122
123USERADD_PACKAGES = "${PN}"
124GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
125
126FILES_${PN}-analyze = "${bindir}/systemd-analyze"
127
128FILES_${PN}-initramfs = "/init"
129RDEPENDS_${PN}-initramfs = "${PN}"
130
131FILES_${PN}-gui = "${bindir}/systemadm"
132
133FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
134 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
135 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
136
137FILES_${PN}-kernel-install = "${bindir}/kernel-install \
138 ${sysconfdir}/kernel/ \
139 ${exec_prefix}/lib/kernel \
140 "
141FILES_${PN}-rpm-macros = "${libdir}/rpm \
142 "
143
144RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts"
145
146CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
147 ${sysconfdir}/systemd/logind.conf \
148 ${sysconfdir}/systemd/system.conf \
149 ${sysconfdir}/systemd/user.conf"
150
151FILES_${PN} = " ${base_bindir}/* \
152 ${datadir}/bash-completion \
153 ${datadir}/dbus-1/services \
154 ${datadir}/dbus-1/system-services \
155 ${datadir}/polkit-1 \
156 ${datadir}/${BPN} \
157 ${sysconfdir}/bash_completion.d/ \
158 ${sysconfdir}/binfmt.d/ \
159 ${sysconfdir}/dbus-1/ \
160 ${sysconfdir}/machine-id \
161 ${sysconfdir}/modules-load.d/ \
162 ${sysconfdir}/sysctl.d/ \
163 ${sysconfdir}/systemd/ \
164 ${sysconfdir}/tmpfiles.d/ \
165 ${sysconfdir}/xdg/ \
166 ${sysconfdir}/init.d/README \
167 ${rootlibexecdir}/systemd/* \
168 ${systemd_unitdir}/* \
169 ${base_libdir}/security/*.so \
170 ${libdir}/libnss_myhostname.so.2 \
171 /cgroup \
172 ${bindir}/systemd* \
173 ${bindir}/localectl \
174 ${bindir}/hostnamectl \
175 ${bindir}/timedatectl \
176 ${bindir}/bootctl \
177 ${bindir}/kernel-install \
178 ${exec_prefix}/lib/tmpfiles.d/*.conf \
179 ${exec_prefix}/lib/systemd \
180 ${exec_prefix}/lib/binfmt.d \
181 ${exec_prefix}/lib/modules-load.d \
182 ${exec_prefix}/lib/sysctl.d \
183 ${localstatedir} \
184 /lib/udev/rules.d/70-uaccess.rules \
185 /lib/udev/rules.d/71-seat.rules \
186 /lib/udev/rules.d/73-seat-late.rules \
187 /lib/udev/rules.d/99-systemd.rules \
188 "
189
190FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
191FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
192
193RDEPENDS_${PN} += "kmod dbus util-linux-mount"
194
195RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
196 util-linux-agetty \
197 util-linux-fsck e2fsprogs-e2fsck \
198 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
199"
200
201PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"
202
203FILES_udev-dbg += "/lib/udev/.debug"
204
205RDEPENDS_udev += "udev-utils"
206RPROVIDES_udev = "hotplug"
207RRECOMMENDS_udev += "udev-hwdb"
208
209RDEPENDS_udev-hwdb += "udev-utils"
210
211FILES_udev += "${base_sbindir}/udevd \
212 ${rootlibexecdir}/systemd/systemd-udevd \
213 ${rootlibexecdir}/udev/accelerometer \
214 ${rootlibexecdir}/udev/ata_id \
215 ${rootlibexecdir}/udev/cdrom_id \
216 ${rootlibexecdir}/udev/collect \
217 ${rootlibexecdir}/udev/findkeyboards \
218 ${rootlibexecdir}/udev/keyboard-force-release.sh \
219 ${rootlibexecdir}/udev/keymap \
220 ${rootlibexecdir}/udev/mtd_probe \
221 ${rootlibexecdir}/udev/scsi_id \
222 ${rootlibexecdir}/udev/v4l_id \
223 ${rootlibexecdir}/udev/keymaps \
224 ${rootlibexecdir}/udev/rules.d/4*.rules \
225 ${rootlibexecdir}/udev/rules.d/5*.rules \
226 ${rootlibexecdir}/udev/rules.d/6*.rules \
227 ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \
228 ${rootlibexecdir}/udev/rules.d/75*.rules \
229 ${rootlibexecdir}/udev/rules.d/78*.rules \
230 ${rootlibexecdir}/udev/rules.d/8*.rules \
231 ${rootlibexecdir}/udev/rules.d/95*.rules \
232 ${sysconfdir}/udev \
233 ${sysconfdir}/init.d/systemd-udevd \
234 ${systemd_unitdir}/system/*udev* \
235 ${systemd_unitdir}/system/*.wants/*udev* \
236 "
237
238FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm"
239
240FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
241
242INITSCRIPT_PACKAGES = "udev"
243INITSCRIPT_NAME_udev = "systemd-udevd"
244INITSCRIPT_PARAMS_udev = "start 03 S ."
245
246python __anonymous() {
247 features = d.getVar("DISTRO_FEATURES", True).split()
248 if "sysvinit" not in features:
249 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
250}
251
252# TODO:
253# u-a for runlevel and telinit
254
255ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff"
256
257ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
258ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
259ALTERNATIVE_PRIORITY[init] ?= "300"
260
261ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
262ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
263ALTERNATIVE_PRIORITY[halt] ?= "300"
264
265ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
266ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
267ALTERNATIVE_PRIORITY[reboot] ?= "300"
268
269ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
270ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
271ALTERNATIVE_PRIORITY[shutdown] ?= "300"
272
273ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
274ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
275ALTERNATIVE_PRIORITY[poweroff] ?= "300"
276
277pkg_postinst_udev-hwdb () {
278 if test -n "$D"; then
279 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
280 --root $D
281 else
282 udevadm hwdb --update
283 fi
284}
285
286pkg_prerm_udev-hwdb () {
287 if test -n "$D"; then
288 exit 1
289 fi
290
291 rm -f ${sysconfdir}/udev/hwdb.bin
292}
293
294# As this recipe builds udev, respect the systemd DISTRO_FEATURE so we don't try
295# building udev and systemd in world builds.
296python () {
297 if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
298 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
299}