diff options
Diffstat (limited to 'meta-oe/recipes-core/toybox/toybox_0.4.9.bb')
-rw-r--r-- | meta-oe/recipes-core/toybox/toybox_0.4.9.bb | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/toybox/toybox_0.4.9.bb b/meta-oe/recipes-core/toybox/toybox_0.4.9.bb new file mode 100644 index 000000000..ec76bd61a --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox_0.4.9.bb | |||
@@ -0,0 +1,64 @@ | |||
1 | SUMMARY = "Toybox combines common utilities together into a single executable." | ||
2 | HOMEPAGE = "http://www.landley.net/toybox/" | ||
3 | |||
4 | SRC_URI = "http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.bz2 \ | ||
5 | file://0001-Match-paths-with-busybox.patch" | ||
6 | SRC_URI[md5sum] = "a8f1022175689defec51cf5a71c41326" | ||
7 | SRC_URI[sha256sum] = "e6dc9052826a3bdae1923e3301c9e3542e890af5ed66534052943f8412255bff" | ||
8 | |||
9 | LICENSE = "BSD-0-Clause" | ||
10 | LIC_FILES_CHKSUM = "file://LICENSE;md5=57cc240a6204b2ea8c68450d42f9d33f" | ||
11 | |||
12 | SECTION = "base" | ||
13 | |||
14 | do_configure() { | ||
15 | oe_runmake defconfig | ||
16 | |||
17 | # Disable killall5 as it isn't managed by update-alternatives | ||
18 | sed -e 's/CONFIG_KILLALL5=y/# CONFIG_KILLALL5 is not set/' -i .config | ||
19 | } | ||
20 | |||
21 | do_compile() { | ||
22 | oe_runmake toybox_unstripped | ||
23 | |||
24 | # Create a list of links needed | ||
25 | oe_runmake generated/instlist | ||
26 | ./generated/instlist long | sed -e 's#^#/#' > toybox.links | ||
27 | } | ||
28 | |||
29 | do_install() { | ||
30 | # Install manually instead of using 'make install' | ||
31 | install -d ${D}${base_bindir} | ||
32 | if grep -q "CONFIG_TOYBOX_SUID=y" ${B}/.config; then | ||
33 | install -m 4755 ${B}/toybox_unstripped ${D}${base_bindir}/toybox | ||
34 | else | ||
35 | install -m 0755 ${B}/toybox_unstripped ${D}${base_bindir}/toybox | ||
36 | fi | ||
37 | |||
38 | install -d ${D}${sysconfdir} | ||
39 | install -m 0644 ${B}/toybox.links ${D}${sysconfdir} | ||
40 | } | ||
41 | |||
42 | inherit update-alternatives | ||
43 | |||
44 | # If you've chosen to install toybox you probably want it to take precedence | ||
45 | # over busybox where possible but not over other packages | ||
46 | ALTERNATIVE_PRIORITY = "60" | ||
47 | |||
48 | python do_package_prepend () { | ||
49 | # Read links from /etc/toybox.links and create appropriate | ||
50 | # update-alternatives variables | ||
51 | |||
52 | dvar = d.getVar('D', True) | ||
53 | pn = d.getVar('PN', True) | ||
54 | target = "/bin/toybox" | ||
55 | |||
56 | f = open('%s/etc/toybox.links' % (dvar), 'r') | ||
57 | for alt_link_name in f: | ||
58 | alt_link_name = alt_link_name.strip() | ||
59 | alt_name = os.path.basename(alt_link_name) | ||
60 | d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name) | ||
61 | d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name) | ||
62 | d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target) | ||
63 | f.close() | ||
64 | } | ||