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