summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd_196.bb
diff options
context:
space:
mode:
authorRadu Moisan <radu.moisan@intel.com>2013-01-19 22:47:07 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-20 12:58:55 (GMT)
commitb8744d5376a9df4ec30120fdc8f39579d34d0545 (patch)
tree9503d5816da66544969292ddb5ff999e50c1b9a8 /meta/recipes-core/systemd/systemd_196.bb
parentb18886d9b7c913cd463a98d0ef1b3a8a240f5791 (diff)
downloadpoky-b8744d5376a9df4ec30120fdc8f39579d34d0545.tar.gz
systemd: add systemd recipes
Add systemd recipes and associated support recipes. Mostly based on meta-oe/meta-systemd, so almost all credit should go to: Andreas Müller <schnitzeltony@googlemail.com> Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Holger Hans Peter Freyther <holger@moiji-mobile.com> Khem Raj <raj.khem@gmail.com> Koen Kooi <koen@dominion.thruhere.net> Martin Jansa <Martin.Jansa@gmail.com> (From OE-Core rev: 6a8a48b4d0d0b9b8d8af46cae11245bcb870bbc3) Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd_196.bb')
-rw-r--r--meta/recipes-core/systemd/systemd_196.bb249
1 files changed, 249 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_196.bb b/meta/recipes-core/systemd/systemd_196.bb
new file mode 100644
index 0000000..1861437
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_196.bb
@@ -0,0 +1,249 @@
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=fb919cc88dbe06ec0b0bd50e001ccf1f \
7 file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed"
8
9PROVIDES = "udev"
10
11DEPENDS = "xz kmod gtk-doc-stub-native docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers usbutils glib-2.0 libgcrypt"
12DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
13
14SERIAL_CONSOLE ?= "115200 /dev/ttyS0"
15
16SECTION = "base/shell"
17
18inherit useradd pkgconfig autotools perlnative
19
20SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
21 file://0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch \
22 file://0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch \
23 file://touchscreen.rules \
24 file://modprobe.rules \
25 file://var-run.conf \
26 ${UCLIBCPATCHES} \
27 file://00-create-volatile.conf \
28 "
29SRC_URI[md5sum] = "05ebd7f108e420e2b4e4810ea4b3c810"
30SRC_URI[sha256sum] = "6bd4a658a5dd8198235b17ad1b1f0cc56d9e6f00d646ddcffdfc6f058b55e4bf"
31
32UCLIBCPATCHES = ""
33UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \
34 file://systemd-pam-fix-execvpe.patch \
35 file://systemd-pam-fix-fallocate.patch \
36 file://systemd-pam-fix-getty-unit.patch \
37 file://systemd-pam-fix-mkostemp.patch \
38 file://systemd-pam-fix-msformat.patch \
39 file://optional_secure_getenv.patch \
40 "
41LDFLAGS_libc-uclibc_append = " -lrt"
42
43# This will disappear with systemd 197
44SYSTEMDDISTRO ?= "debian"
45
46CACHED_CONFIGUREVARS = "ac_cv_file__usr_share_pci_ids=no \
47 ac_cv_file__usr_share_hwdata_pci_ids=no \
48 ac_cv_file__usr_share_misc_pci_ids=yes"
49
50# The gtk+ tools should get built as a separate recipe e.g. systemd-tools
51EXTRA_OECONF = " --with-distro=${SYSTEMDDISTRO} \
52 --with-rootprefix=${base_prefix} \
53 --with-rootlibdir=${base_libdir} \
54 --sbindir=${base_sbindir} \
55 --libexecdir=${base_libdir} \
56 ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
57 --enable-xz \
58 --disable-manpages \
59 --disable-coredump \
60 --disable-introspection \
61 --with-pci-ids-path=/usr/share/misc \
62 --disable-gtk-doc-html \
63 --disable-tcpwrap \
64 --enable-split-usr \
65 --disable-microhttpd \
66 --without-python \
67 "
68
69# There's no docbook-xsl-native, so for the xsltproc check to false
70do_configure_prepend() {
71 export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
72 sed -i /xsltproc/d configure.ac
73
74 # we only have /home/root, not /root
75 sed -i -e 's:=/root:=/home/root:g' units/*.service*
76
77 gtkdocize --docdir ${S}/docs/
78}
79
80do_install() {
81 autotools_do_install
82 install -d ${D}/${base_sbindir}
83 # provided by a seperate recipe
84 rm ${D}${systemd_unitdir}/system/serial-getty* -f
85
86 # provide support for initramfs
87 ln -s ${systemd_unitdir}/systemd ${D}/init
88 ln -s ${systemd_unitdir}/systemd-udevd ${D}/${base_sbindir}/udevd
89
90 # create dir for journal
91 install -d ${D}${localstatedir}/log/journal
92
93 # create machine-id
94 # 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
95 touch ${D}${sysconfdir}/machine-id
96
97 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
98
99 install -m 0644 ${WORKDIR}/var-run.conf ${D}${sysconfdir}/tmpfiles.d/
100
101 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
102}
103
104python populate_packages_prepend (){
105 systemdlibdir = d.getVar("base_libdir", True)
106 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
107}
108PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*"
109
110PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze"
111
112USERADD_PACKAGES = "${PN}"
113GROUPADD_PARAM_${PN} = "-r lock"
114
115FILES_${PN}-analyze = "${bindir}/systemd-analyze"
116RDEPENDS_${PN}-analyze = "python-dbus python-argparse python-textutils"
117RRECOMMENDS_${PN}-analyze = "python-pycairo"
118
119FILES_${PN}-initramfs = "/init"
120RDEPENDS_${PN}-initramfs = "${PN}"
121
122FILES_${PN}-gui = "${bindir}/systemadm"
123
124FILES_${PN}-vconsole-setup = "${systemd_unitdir}/systemd-vconsole-setup \
125 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
126 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
127
128RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts"
129
130CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
131 ${sysconfdir}/systemd/logind.conf \
132 ${sysconfdir}/systemd/system.conf \
133 ${sysconfdir}/systemd/user.conf"
134
135FILES_${PN} = " ${base_bindir}/* \
136 ${datadir}/dbus-1/services \
137 ${datadir}/dbus-1/system-services \
138 ${datadir}/polkit-1 \
139 ${datadir}/${PN} \
140 ${sysconfdir}/bash_completion.d/ \
141 ${sysconfdir}/binfmt.d/ \
142 ${sysconfdir}/dbus-1/ \
143 ${sysconfdir}/machine-id \
144 ${sysconfdir}/modules-load.d/ \
145 ${sysconfdir}/sysctl.d/ \
146 ${sysconfdir}/systemd/ \
147 ${sysconfdir}/tmpfiles.d/ \
148 ${sysconfdir}/xdg/ \
149 ${sysconfdir}/init.d/README \
150 ${systemd_unitdir}/* \
151 ${systemd_unitdir}/system/* \
152 /lib/udev/rules.d/99-systemd.rules \
153 ${base_libdir}/security/*.so \
154 /cgroup \
155 ${bindir}/systemd* \
156 ${bindir}/localectl \
157 ${bindir}/hostnamectl \
158 ${bindir}/timedatectl \
159 ${exec_prefix}/lib/tmpfiles.d/*.conf \
160 ${exec_prefix}/lib/systemd \
161 ${exec_prefix}/lib/binfmt.d \
162 ${exec_prefix}/lib/modules-load.d \
163 ${exec_prefix}/lib/sysctl.d \
164 ${localstatedir} \
165 ${libexecdir} \
166 /lib/udev/rules.d/70-uaccess.rules \
167 /lib/udev/rules.d/71-seat.rules \
168 /lib/udev/rules.d/73-seat-late.rules \
169 /lib/udev/rules.d/99-systemd.rules \
170 "
171
172FILES_${PN}-dbg += "${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
173FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
174
175RDEPENDS_${PN} += "dbus udev-systemd"
176
177# kbd -> loadkeys,setfont
178# systemd calls 'modprobe -sab --', which busybox doesn't support due to lack
179# of blacklist support, so use proper modprobe from module-init-tools
180# And pull in the kernel modules mentioned in INSTALL
181# swapon -p is also not supported by busybox
182# busybox mount is broken
183RRECOMMENDS_${PN} += "systemd-serialgetty \
184 util-linux-agetty \
185 util-linux-swaponoff \
186 util-linux-fsck e2fsprogs-e2fsck \
187 module-init-tools \
188 util-linux-mount util-linux-umount \
189 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
190"
191
192PACKAGES =+ "udev-dbg udev udev-consolekit udev-utils udev-systemd"
193
194FILES_udev-dbg += "/lib/udev/.debug"
195
196RDEPENDS_udev += "udev-utils"
197RPROVIDES_udev = "hotplug"
198
199FILES_udev += "${base_sbindir}/udevd \
200 /libstemd-udevd \
201 /lib/udev/accelerometer \
202 /lib/udev/ata_id \
203 /lib/udev/cdrom_id \
204 /lib/udev/collect \
205 /lib/udev/findkeyboards \
206 /lib/udev/keyboard-force-release.sh \
207 /lib/udev/keymap \
208 /lib/udev/mtd_probe \
209 /lib/udev/scsi_id \
210 /lib/udev/v4l_id \
211 /lib/udev/keymaps \
212 /lib/udev/rules.d/4*.rules \
213 /lib/udev/rules.d/5*.rules \
214 /lib/udev/rules.d/6*.rules \
215 /lib/udev/rules.d/70-power-switch.rules \
216 /lib/udev/rules.d/75*.rules \
217 /lib/udev/rules.d/78*.rules \
218 /lib/udev/rules.d/8*.rules \
219 /lib/udev/rules.d/95*.rules \
220 ${base_libdir}/udev/hwdb.d \
221 ${sysconfdir}/udev \
222 "
223
224FILES_udev-consolekit += "/lib/ConsoleKit"
225RDEPENDS_udev-consolekit += "${@base_contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}"
226
227FILES_udev-utils = "${bindir}/udevadm"
228
229FILES_udev-systemd = "${systemd_unitdir}/system/*udev* ${systemd_unitdir}/system/*.wants/*udev*"
230RDEPENDS_udev-systemd = "udev"
231
232# TODO:
233# u-a for runlevel and telinit
234
235pkg_postinst_systemd () {
236update-alternatives --install ${base_sbindir}/init init ${systemd_unitdir}/systemd 300
237update-alternatives --install ${base_sbindir}/halt halt ${base_bindir}/systemctl 300
238update-alternatives --install ${base_sbindir}/reboot reboot ${base_bindir}/systemctl 300
239update-alternatives --install ${base_sbindir}/shutdown shutdown ${base_bindir}/systemctl 300
240update-alternatives --install ${base_sbindir}/poweroff poweroff ${base_bindir}/systemctl 300
241}
242
243pkg_prerm_systemd () {
244update-alternatives --remove init ${systemd_unitdir}/systemd
245update-alternatives --remove halt ${base_bindir}/systemctl
246update-alternatives --remove reboot ${base_bindir}/systemctl
247update-alternatives --remove shutdown ${base_bindir}/systemctl
248update-alternatives --remove poweroff ${base_bindir}/systemctl
249}