Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SUMMARY = "Toybox combines common utilities together into a single executable."
- HOMEPAGE = "http://www.landley.net/toybox/"
- SECTION = "base"
- LICENSE = "BSD-0-Clause"
- LIC_FILES_CHKSUM = "file://LICENSE;md5=8d0ff8805fc1a255ffdbcce36f7d71c0"
- PV = "0.7.8+git${SRCPV}"
- SRCREV = "06af852a0f369a5a0f608ee4cbaef487c8493f3e"
- SRC_URI = "git://github.com/landley/toybox.git;protocol=https;branch=master \
- file://0004-Fix_route.patch \
- "
- S = "${WORKDIR}/git/"
- DEPENDS = "attr virtual/crypt kern-tools-native"
- inherit cml1 update-alternatives
- EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC}" CPUS=${@oe.utils.cpu_count()}'
- # returns all the elements from the src uri that are .cfg files
- def find_cfgs(d):
- return [s for s in src_patches(d, True) if s.endswith('.cfg')]
- do_configure () {
- cp ${WORKDIR}/defconfig ${S}/.config
- merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
- cml1_do_configure
- }
- TOYBOX_BIN = "generated/unstripped/toybox"
- do_compile() {
- oe_runmake ${TOYBOX_BIN}
- # Create a list of links needed
- ${BUILD_CC} -I . scripts/install.c -o generated/instlist
- ./generated/instlist long | sed -e 's#^#/#' > toybox.links
- }
- do_install() {
- # Install manually instead of using 'make install'
- install -d ${D}${base_bindir}
- if grep -q "CONFIG_TOYBOX_SUID=y" ${B}/.config; then
- install -m 4755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox
- else
- install -m 0755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox
- fi
- install -d ${D}${sysconfdir}
- install -m 0644 ${B}/toybox.links ${D}${sysconfdir}
- }
- # If you've chosen to install toybox you probably want it to take precedence
- # over busybox where possible but not over other packages
- ALTERNATIVE_PRIORITY = "60"
- python do_package_prepend () {
- # Read links from /etc/toybox.links and create appropriate
- # update-alternatives variables
- dvar = d.getVar('D')
- pn = d.getVar('PN')
- target = d.expand("${base_bindir}/toybox")
- f = open('%s/etc/toybox.links' % (dvar), 'r')
- for alt_link_name in f:
- alt_link_name = alt_link_name.strip()
- alt_name = os.path.basename(alt_link_name)
- d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
- d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
- d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
- f.close()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement