summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd_198.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd_198.bb')
-rw-r--r--meta/recipes-core/systemd/systemd_198.bb275
1 files changed, 275 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_198.bb b/meta/recipes-core/systemd/systemd_198.bb
new file mode 100644
index 0000000000..6a8db512ca
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_198.bb
@@ -0,0 +1,275 @@
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 tcp-wrappers glib-2.0"
14DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
15
16SECTION = "base/shell"
17
18inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d
19
20SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
21 file://touchscreen.rules \
22 file://modprobe.rules \
23 file://var-run.conf \
24 ${UCLIBCPATCHES} \
25 file://00-create-volatile.conf \
26 file://init \
27 "
28SRC_URI[md5sum] = "26a75e2a310f8c1c1ea9ec26ddb171c5"
29SRC_URI[sha256sum] = "444492355e5ff0ad99e0691ecaff1081ee8d45901580f47ba8b74e56107c71bf"
30
31UCLIBCPATCHES = ""
32UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \
33 file://systemd-pam-fix-execvpe.patch \
34 file://systemd-pam-fix-fallocate.patch \
35 file://systemd-pam-fix-getty-unit.patch \
36 file://systemd-pam-fix-mkostemp.patch \
37 file://systemd-pam-fix-msformat.patch \
38 file://optional_secure_getenv.patch \
39 "
40LDFLAGS_libc-uclibc_append = " -lrt"
41
42GTKDOC_DOCDIR = "${S}/docs/"
43
44PACKAGECONFIG ??= "xz"
45# Sign the journal for anti-tampering
46PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
47# Compress the journal
48PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
49
50CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
51
52# The gtk+ tools should get built as a separate recipe e.g. systemd-tools
53EXTRA_OECONF = " --with-rootprefix=${base_prefix} \
54 --with-rootlibdir=${base_libdir} \
55 --sbindir=${base_sbindir} \
56 --libexecdir=${base_libdir} \
57 ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
58 --enable-xz \
59 --disable-manpages \
60 --disable-coredump \
61 --disable-introspection \
62 --disable-tcpwrap \
63 --enable-split-usr \
64 --disable-microhttpd \
65 --without-python \
66 --with-sysvrcnd-path=${sysconfdir} \
67 ac_cv_path_KILL=${base_bindir}/kill \
68 "
69# uclibc does not have NSS
70EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
71
72# There's no docbook-xsl-native, so for the xsltproc check to false
73do_configure_prepend() {
74 export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
75
76 sed -i -e 's:=/root:=${ROOT_HOME}:g' units/*.service*
77}
78
79do_install() {
80 autotools_do_install
81 install -d ${D}/${base_sbindir}
82 # provided by a seperate recipe
83 rm ${D}${systemd_unitdir}/system/serial-getty* -f
84
85 # provide support for initramfs
86 ln -s ${systemd_unitdir}/systemd ${D}/init
87 ln -s ${systemd_unitdir}/systemd-udevd ${D}/${base_sbindir}/udevd
88
89 # create dir for journal
90 install -d ${D}${localstatedir}/log/journal
91
92 # create machine-id
93 # 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
94 touch ${D}${sysconfdir}/machine-id
95
96 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
97
98 install -m 0644 ${WORKDIR}/var-run.conf ${D}${sysconfdir}/tmpfiles.d/
99
100 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
101
102 if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
103 install -d ${D}${sysconfdir}/init.d
104 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
105 fi
106}
107
108python populate_packages_prepend (){
109 systemdlibdir = d.getVar("base_libdir", True)
110 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
111}
112PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*"
113
114PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze"
115
116USERADD_PACKAGES = "${PN}"
117GROUPADD_PARAM_${PN} = "-r lock"
118
119FILES_${PN}-analyze = "${base_bindir}/systemd-analyze"
120
121FILES_${PN}-initramfs = "/init"
122RDEPENDS_${PN}-initramfs = "${PN}"
123
124FILES_${PN}-gui = "${bindir}/systemadm"
125
126FILES_${PN}-vconsole-setup = "${systemd_unitdir}/systemd-vconsole-setup \
127 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
128 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
129
130RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts"
131
132CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
133 ${sysconfdir}/systemd/logind.conf \
134 ${sysconfdir}/systemd/system.conf \
135 ${sysconfdir}/systemd/user.conf"
136
137FILES_${PN} = " ${base_bindir}/* \
138 ${datadir}/bash-completion \
139 ${datadir}/dbus-1/services \
140 ${datadir}/dbus-1/system-services \
141 ${datadir}/polkit-1 \
142 ${datadir}/${PN} \
143 ${sysconfdir}/bash_completion.d/ \
144 ${sysconfdir}/binfmt.d/ \
145 ${sysconfdir}/dbus-1/ \
146 ${sysconfdir}/machine-id \
147 ${sysconfdir}/modules-load.d/ \
148 ${sysconfdir}/sysctl.d/ \
149 ${sysconfdir}/systemd/ \
150 ${sysconfdir}/tmpfiles.d/ \
151 ${sysconfdir}/xdg/ \
152 ${sysconfdir}/init.d/README \
153 ${systemd_unitdir}/* \
154 ${systemd_unitdir}/system/* \
155 /lib/udev/rules.d/99-systemd.rules \
156 ${base_libdir}/security/*.so \
157 ${libdir}/libnss_myhostname.so.2 \
158 /cgroup \
159 ${bindir}/systemd* \
160 ${bindir}/localectl \
161 ${bindir}/hostnamectl \
162 ${bindir}/timedatectl \
163 ${bindir}/bootctl \
164 ${bindir}/kernel-install \
165 ${exec_prefix}/lib/tmpfiles.d/*.conf \
166 ${exec_prefix}/lib/systemd \
167 ${exec_prefix}/lib/binfmt.d \
168 ${exec_prefix}/lib/modules-load.d \
169 ${exec_prefix}/lib/sysctl.d \
170 ${localstatedir} \
171 ${libexecdir} \
172 /lib/udev/rules.d/70-uaccess.rules \
173 /lib/udev/rules.d/71-seat.rules \
174 /lib/udev/rules.d/73-seat-late.rules \
175 /lib/udev/rules.d/99-systemd.rules \
176 "
177
178FILES_${PN}-dbg += "${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
179FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
180
181RDEPENDS_${PN} += "dbus"
182
183RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
184 util-linux-agetty \
185 util-linux-fsck e2fsprogs-e2fsck \
186 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
187"
188
189PACKAGES =+ "udev-dbg udev udev-consolekit udev-utils udev-hwdb"
190
191FILES_udev-dbg += "/lib/udev/.debug"
192
193RDEPENDS_udev += "udev-utils"
194RPROVIDES_udev = "hotplug"
195RRECOMMENDS_udev += "udev-extraconf udev-hwdb"
196
197FILES_udev += "${base_sbindir}/udevd \
198 ${base_libdir}/systemd/systemd-udevd \
199 /lib/udev/accelerometer \
200 /lib/udev/ata_id \
201 /lib/udev/cdrom_id \
202 /lib/udev/collect \
203 /lib/udev/findkeyboards \
204 /lib/udev/keyboard-force-release.sh \
205 /lib/udev/keymap \
206 /lib/udev/mtd_probe \
207 /lib/udev/scsi_id \
208 /lib/udev/v4l_id \
209 /lib/udev/keymaps \
210 /lib/udev/rules.d/4*.rules \
211 /lib/udev/rules.d/5*.rules \
212 /lib/udev/rules.d/6*.rules \
213 /lib/udev/rules.d/70-power-switch.rules \
214 /lib/udev/rules.d/75*.rules \
215 /lib/udev/rules.d/78*.rules \
216 /lib/udev/rules.d/8*.rules \
217 /lib/udev/rules.d/95*.rules \
218 ${sysconfdir}/udev \
219 ${sysconfdir}/init.d/systemd-udevd \
220 ${systemd_unitdir}/system/*udev* \
221 ${systemd_unitdir}/system/*.wants/*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-hwdb = "${base_libdir}/udev/hwdb.d"
230
231INITSCRIPT_PACKAGES = "udev"
232INITSCRIPT_NAME_udev = "systemd-udevd"
233INITSCRIPT_PARAMS_udev = "start 03 S ."
234
235# TODO:
236# u-a for runlevel and telinit
237
238pkg_postinst_systemd () {
239update-alternatives --install ${base_sbindir}/init init ${systemd_unitdir}/systemd 300
240update-alternatives --install ${base_sbindir}/halt halt ${base_bindir}/systemctl 300
241update-alternatives --install ${base_sbindir}/reboot reboot ${base_bindir}/systemctl 300
242update-alternatives --install ${base_sbindir}/shutdown shutdown ${base_bindir}/systemctl 300
243update-alternatives --install ${base_sbindir}/poweroff poweroff ${base_bindir}/systemctl 300
244}
245
246pkg_prerm_systemd () {
247update-alternatives --remove init ${systemd_unitdir}/systemd
248update-alternatives --remove halt ${base_bindir}/systemctl
249update-alternatives --remove reboot ${base_bindir}/systemctl
250update-alternatives --remove shutdown ${base_bindir}/systemctl
251update-alternatives --remove poweroff ${base_bindir}/systemctl
252}
253
254pkg_postinst_udev-hwdb () {
255 if test -n "$D"; then
256 exit 1
257 fi
258
259 udevadm hwdb --update
260}
261
262pkg_prerm_udev-hwdb () {
263 if test -n "$D"; then
264 exit 1
265 fi
266
267 rm -f ${sysconfdir}/udev/hwdb.bin
268}
269
270# As this recipe builds udev, respect the systemd DISTRO_FEATURE so we don't try
271# building udev and systemd in world builds.
272python () {
273 if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
274 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
275}