diff options
author | Andreas Müller <schnitzeltony@googlemail.com> | 2012-07-11 13:24:32 +0200 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-07-16 09:39:05 +0200 |
commit | a5b2aea321b2851ed82828e6204c075a2329059c (patch) | |
tree | 06c57ad79e5cdcb0b8b62bb6e910c29c379fac8c /meta-systemd/recipes-core/systemd/systemd_git.bb | |
parent | 5ed19733f5193b752da650841a1383adb532fffd (diff) | |
download | meta-openembedded-a5b2aea321b2851ed82828e6204c075a2329059c.tar.gz |
move systemd recipes to meta-systemd
Diffstat (limited to 'meta-systemd/recipes-core/systemd/systemd_git.bb')
-rw-r--r-- | meta-systemd/recipes-core/systemd/systemd_git.bb | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/meta-systemd/recipes-core/systemd/systemd_git.bb b/meta-systemd/recipes-core/systemd/systemd_git.bb new file mode 100644 index 000000000..f4ca72a12 --- /dev/null +++ b/meta-systemd/recipes-core/systemd/systemd_git.bb | |||
@@ -0,0 +1,156 @@ | |||
1 | DESCRIPTION = "Systemd a init replacement" | ||
2 | HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd" | ||
3 | LICENSE = "GPLv2+" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" | ||
5 | |||
6 | DEPENDS = "xz kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline udev dbus libcap libcgroup tcp-wrappers" | ||
7 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
8 | |||
9 | SERIAL_CONSOLE ?= "115200 /dev/ttyS0" | ||
10 | |||
11 | SECTION = "base/shell" | ||
12 | |||
13 | inherit gitpkgv | ||
14 | PKGV = "v${GITPKGVTAG}" | ||
15 | |||
16 | PV = "git" | ||
17 | PR = "r27" | ||
18 | |||
19 | inherit useradd pkgconfig autotools vala perlnative | ||
20 | |||
21 | SRCREV = "3eff4208ffecedd778fec260f0d4b18e94dab443" | ||
22 | |||
23 | SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;protocol=git \ | ||
24 | ${UCLIBCPATCHES} \ | ||
25 | " | ||
26 | UCLIBCPATCHES = "" | ||
27 | UCLIBCPATCHES_libc-uclibc = "file://paper-over-mkostemp.patch \ | ||
28 | file://format-replace-m-uclibc.patch \ | ||
29 | " | ||
30 | |||
31 | LDFLAGS_libc-uclibc_append = " -lrt" | ||
32 | |||
33 | S = "${WORKDIR}/git" | ||
34 | |||
35 | SYSTEMDDISTRO ?= "debian" | ||
36 | SYSTEMDDISTRO_angstrom = "angstrom" | ||
37 | |||
38 | # The gtk+ tools should get built as a separate recipe e.g. systemd-tools | ||
39 | EXTRA_OECONF = " --with-distro=${SYSTEMDDISTRO} \ | ||
40 | --with-rootprefix=${base_prefix} \ | ||
41 | --with-rootlibdir=${base_libdir} \ | ||
42 | ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \ | ||
43 | --disable-gtk \ | ||
44 | --enable-xz \ | ||
45 | --disable-manpages \ | ||
46 | --disable-coredump \ | ||
47 | " | ||
48 | |||
49 | # There's no docbook-xsl-native, so for the xsltproc check to false | ||
50 | do_configure_prepend() { | ||
51 | sed -i /xsltproc/d configure.ac | ||
52 | |||
53 | # we only have /home/root, not /root | ||
54 | sed -i -e 's:=/root:=/home/root:g' units/*.service* | ||
55 | } | ||
56 | |||
57 | do_install() { | ||
58 | autotools_do_install | ||
59 | # provided by a seperate recipe | ||
60 | rm ${D}${systemd_unitdir}/system/serial-getty* -f | ||
61 | |||
62 | # provide support for initramfs | ||
63 | ln -s ${systemd_unitdir}/systemd ${D}/init | ||
64 | |||
65 | # create dir for journal | ||
66 | install -d ${D}${localstatedir}/log/journal | ||
67 | |||
68 | # create machine-id | ||
69 | # 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 | ||
70 | touch ${D}${sysconfdir}/machine-id | ||
71 | } | ||
72 | |||
73 | python populate_packages_prepend (){ | ||
74 | systemdlibdir = d.getVar("base_libdir", True) | ||
75 | do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) | ||
76 | } | ||
77 | |||
78 | PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze" | ||
79 | |||
80 | USERADD_PACKAGES = "${PN}" | ||
81 | GROUPADD_PARAM_${PN} = "-r lock" | ||
82 | |||
83 | FILES_${PN}-analyze = "${bindir}/systemd-analyze" | ||
84 | RDEPENDS_${PN}-analyze = "python-dbus" | ||
85 | RRECOMMENDS_${PN}-analyze = "python-pycairo" | ||
86 | |||
87 | FILES_${PN}-initramfs = "/init" | ||
88 | RDEPENDS_${PN}-initramfs = "${PN}" | ||
89 | |||
90 | FILES_${PN}-gui = "${bindir}/systemadm" | ||
91 | |||
92 | FILES_${PN}-vconsole-setup = "${systemd_unitdir}/systemd-vconsole-setup \ | ||
93 | ${systemd_unitdir}/system/systemd-vconsole-setup.service \ | ||
94 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" | ||
95 | |||
96 | RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts" | ||
97 | |||
98 | FILES_${PN} = " ${base_bindir}/* \ | ||
99 | ${datadir}/dbus-1/services \ | ||
100 | ${datadir}/dbus-1/system-services \ | ||
101 | ${datadir}/polkit-1 \ | ||
102 | ${datadir}/${PN} \ | ||
103 | ${sysconfdir} \ | ||
104 | ${systemd_unitdir}/* \ | ||
105 | ${systemd_unitdir}/system/* \ | ||
106 | ${base_libdir}/udev/rules.d \ | ||
107 | ${base_libdir}/security/*.so \ | ||
108 | /cgroup \ | ||
109 | ${bindir}/systemd* \ | ||
110 | ${libdir}/tmpfiles.d/*.conf \ | ||
111 | ${libdir}/systemd \ | ||
112 | ${libdir}/binfmt.d \ | ||
113 | ${libdir}/modules-load.d \ | ||
114 | ${libdir}/sysctl.d \ | ||
115 | ${localstatedir} \ | ||
116 | ${libexecdir} \ | ||
117 | " | ||
118 | |||
119 | FILES_${PN}-dbg += "${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/" | ||
120 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/" | ||
121 | |||
122 | RDEPENDS_${PN} += "dbus-systemd udev-systemd" | ||
123 | |||
124 | # kbd -> loadkeys,setfont | ||
125 | # systemd calls 'modprobe -sab --', which busybox doesn't support due to lack | ||
126 | # of blacklist support, so use proper modprobe from module-init-tools | ||
127 | # And pull in the kernel modules mentioned in INSTALL | ||
128 | # swapon -p is also not supported by busybox | ||
129 | # busybox mount is broken | ||
130 | RRECOMMENDS_${PN} += "systemd-serialgetty \ | ||
131 | util-linux-agetty \ | ||
132 | util-linux-swaponoff \ | ||
133 | util-linux-fsck e2fsprogs-e2fsck \ | ||
134 | module-init-tools \ | ||
135 | util-linux-mount util-linux-umount \ | ||
136 | kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ | ||
137 | " | ||
138 | |||
139 | # TODO: | ||
140 | # u-a for runlevel and telinit | ||
141 | |||
142 | pkg_postinst_systemd () { | ||
143 | update-alternatives --install ${base_sbindir}/init init ${systemd_unitdir}/systemd 300 | ||
144 | update-alternatives --install ${base_sbindir}/halt halt ${base_bindir}/systemctl 300 | ||
145 | update-alternatives --install ${base_sbindir}/reboot reboot ${base_bindir}/systemctl 300 | ||
146 | update-alternatives --install ${base_sbindir}/shutdown shutdown ${base_bindir}/systemctl 300 | ||
147 | update-alternatives --install ${base_sbindir}/poweroff poweroff ${base_bindir}/systemctl 300 | ||
148 | } | ||
149 | |||
150 | pkg_prerm_systemd () { | ||
151 | update-alternatives --remove init ${systemd_unitdir}/systemd | ||
152 | update-alternatives --remove halt ${base_bindir}/systemctl | ||
153 | update-alternatives --remove reboot ${base_bindir}/systemctl | ||
154 | update-alternatives --remove shutdown ${base_bindir}/systemctl | ||
155 | update-alternatives --remove poweroff ${base_bindir}/systemctl | ||
156 | } | ||