Advertisement
Guest User

Untitled

a guest
Dec 11th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. SUMMARY = "Toybox combines common utilities together into a single executable."
  2. HOMEPAGE = "http://www.landley.net/toybox/"
  3.  
  4. SECTION = "base"
  5.  
  6. LICENSE = "BSD-0-Clause"
  7. LIC_FILES_CHKSUM = "file://LICENSE;md5=8d0ff8805fc1a255ffdbcce36f7d71c0"
  8.  
  9. PV = "0.7.8+git${SRCPV}"
  10. SRCREV = "06af852a0f369a5a0f608ee4cbaef487c8493f3e"
  11.  
  12. SRC_URI = "git://github.com/landley/toybox.git;protocol=https;branch=master \
  13. file://0004-Fix_route.patch \
  14. "
  15.  
  16. S = "${WORKDIR}/git/"
  17.  
  18. DEPENDS = "attr virtual/crypt kern-tools-native"
  19.  
  20. inherit cml1 update-alternatives
  21.  
  22. EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC}" CPUS=${@oe.utils.cpu_count()}'
  23.  
  24. # returns all the elements from the src uri that are .cfg files
  25. def find_cfgs(d):
  26. return [s for s in src_patches(d, True) if s.endswith('.cfg')]
  27.  
  28. do_configure () {
  29. cp ${WORKDIR}/defconfig ${S}/.config
  30. merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
  31. cml1_do_configure
  32. }
  33.  
  34. TOYBOX_BIN = "generated/unstripped/toybox"
  35.  
  36. do_compile() {
  37. oe_runmake ${TOYBOX_BIN}
  38.  
  39. # Create a list of links needed
  40. ${BUILD_CC} -I . scripts/install.c -o generated/instlist
  41. ./generated/instlist long | sed -e 's#^#/#' > toybox.links
  42. }
  43.  
  44. do_install() {
  45. # Install manually instead of using 'make install'
  46. install -d ${D}${base_bindir}
  47. if grep -q "CONFIG_TOYBOX_SUID=y" ${B}/.config; then
  48. install -m 4755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox
  49. else
  50. install -m 0755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox
  51. fi
  52.  
  53. install -d ${D}${sysconfdir}
  54. install -m 0644 ${B}/toybox.links ${D}${sysconfdir}
  55. }
  56.  
  57. # If you've chosen to install toybox you probably want it to take precedence
  58. # over busybox where possible but not over other packages
  59. ALTERNATIVE_PRIORITY = "60"
  60.  
  61. python do_package_prepend () {
  62. # Read links from /etc/toybox.links and create appropriate
  63. # update-alternatives variables
  64.  
  65. dvar = d.getVar('D')
  66. pn = d.getVar('PN')
  67. target = d.expand("${base_bindir}/toybox")
  68.  
  69. f = open('%s/etc/toybox.links' % (dvar), 'r')
  70. for alt_link_name in f:
  71. alt_link_name = alt_link_name.strip()
  72. alt_name = os.path.basename(alt_link_name)
  73. d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
  74. d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
  75. d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
  76. f.close()
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement