diff options
| -rw-r--r-- | meta/recipes-core/busybox/busybox.inc | 103 | ||||
| -rw-r--r-- | meta/recipes-core/busybox/busybox_1.18.4.bb | 2 |
2 files changed, 57 insertions, 48 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc index 341c5c4146..86fbdae2a5 100644 --- a/meta/recipes-core/busybox/busybox.inc +++ b/meta/recipes-core/busybox/busybox.inc | |||
| @@ -46,75 +46,84 @@ do_compile() { | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | do_install () { | 48 | do_install () { |
| 49 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS | 49 | oe_runmake busybox.links |
| 50 | if [ "${prefix}" != "/usr" ]; then | ||
| 51 | sed "s:^/usr/:${prefix}/:" busybox.links > busybox.links.new | ||
| 52 | mv busybox.links.new busybox.links | ||
| 53 | fi | ||
| 54 | if [ "${base_sbindir}" != "/sbin" ]; then | ||
| 55 | sed "s:^/sbin/:${base_sbindir}/:" busybox.links > busybox.links.new | ||
| 56 | mv busybox.links.new busybox.links | ||
| 57 | fi | ||
| 58 | |||
| 50 | install -d ${D}${sysconfdir}/init.d | 59 | install -d ${D}${sysconfdir}/init.d |
| 51 | oe_runmake "PREFIX=${D}" install | ||
| 52 | cp -pPR ${S}/_install/* ${D}/ | ||
| 53 | |||
| 54 | # Move everything to /busybox (not supposed to end up in any package) | ||
| 55 | install -d ${D}/busybox | ||
| 56 | ls ${D} -R | ||
| 57 | |||
| 58 | cp -dPr ${D}${base_bindir} ${D}${base_sbindir} ${D}${prefix} ${D}/busybox/ | ||
| 59 | # Move the busybox binary back to /bin | ||
| 60 | install -d ${D}${base_bindir} | ||
| 61 | mv ${D}/busybox${base_bindir}/busybox ${D}${base_bindir}/ | ||
| 62 | # Move back the sh symlink | ||
| 63 | test -h ${D}/busybox${base_bindir}/sh && mv ${D}/busybox${base_bindir}/sh ${D}${base_bindir}/ | ||
| 64 | |||
| 65 | install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${PN} | ||
| 66 | install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${PN} | ||
| 67 | if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then | ||
| 68 | # Move crond back to /usr/sbin/crond | ||
| 69 | install -d ${D}${sbindir} | ||
| 70 | mv ${D}/busybox${sbindir}/crond ${D}${sbindir}/ | ||
| 71 | 60 | ||
| 61 | if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${WORKDIR}/defconfig; then | ||
| 62 | # Install /bin/busybox, and the /bin/sh link so the postinst script | ||
| 63 | # can run. Let update-alternatives handle the rest. | ||
| 64 | install -d ${D}${base_bindir} | ||
| 65 | if grep -q "CONFIG_FEATURE_SUID=y" ${WORKDIR}/defconfig; then | ||
| 66 | install -m 4755 ${S}/busybox ${D}${base_bindir} | ||
| 67 | else | ||
| 68 | install -m 0755 ${S}/busybox ${D}${base_bindir} | ||
| 69 | fi | ||
| 70 | ln -sf busybox ${D}${base_bindir}/sh | ||
| 71 | else | ||
| 72 | install -d ${D}${base_bindir} ${D}${base_sbindir} | ||
| 73 | install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir} | ||
| 74 | cat busybox.links | while read FILE; do | ||
| 75 | NAME=`basename "$FILE"` | ||
| 76 | install -m 0755 "0_lib/$NAME" "${D}$FILE.${PN}" | ||
| 77 | done | ||
| 78 | # add suid bit where needed | ||
| 79 | for i in `grep -E "APPLET.*_BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do | ||
| 80 | find ${D} -name $i.${PN} -exec chmod a+s {} \; | ||
| 81 | done | ||
| 82 | install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV} | ||
| 83 | ln -sf sh.${PN} ${D}${base_bindir}/sh | ||
| 84 | ln -sf ln.${PN} ${D}${base_bindir}/ln | ||
| 85 | ln -sf test.${PN} ${D}${bindir}/test | ||
| 86 | if [ -f ${D}/linuxrc.${PN} ]; then | ||
| 87 | mv ${D}/linuxrc.${PN} ${D}/linuxrc | ||
| 88 | fi | ||
| 89 | fi | ||
| 90 | |||
| 91 | if grep -q "CONFIG_SYSLOGD=y" ${WORKDIR}/defconfig; then | ||
| 92 | install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${PN} | ||
| 93 | install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${PN} | ||
| 94 | fi | ||
| 95 | if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then | ||
| 72 | install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/ | 96 | install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/ |
| 73 | fi | 97 | fi |
| 74 | if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then | 98 | if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then |
| 75 | # Move httpd back to /usr/sbin/httpd | ||
| 76 | install -d ${D}${sbindir} | ||
| 77 | mv ${D}/busybox${sbindir}/httpd ${D}${sbindir}/ | ||
| 78 | |||
| 79 | install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/ | 99 | install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/ |
| 80 | install -d ${D}/srv/www | 100 | install -d ${D}/srv/www |
| 81 | fi | 101 | fi |
| 82 | if grep "CONFIG_UDHCPD=y" ${WORKDIR}/defconfig; then | 102 | if grep "CONFIG_UDHCPD=y" ${WORKDIR}/defconfig; then |
| 83 | # Move udhcpd back to /usr/sbin/udhcpd | ||
| 84 | install -d ${D}${sbindir} | ||
| 85 | mv ${D}/busybox${sbindir}/udhcpd ${D}${sbindir}/ | ||
| 86 | |||
| 87 | install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ | 103 | install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ |
| 88 | fi | 104 | fi |
| 89 | if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then | 105 | if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then |
| 90 | # Move hwclock back to /sbin/hwclock | 106 | install -d ${D}${sysconfdir}/default |
| 91 | install -d ${D}${base_sbindir} | ||
| 92 | mv ${D}/busybox${base_sbindir}/hwclock ${D}${base_sbindir}/ | ||
| 93 | |||
| 94 | install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ | 107 | install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ |
| 95 | fi | 108 | fi |
| 96 | if grep "CONFIG_UDHCPC=y" ${WORKDIR}/defconfig; then | 109 | if grep "CONFIG_UDHCPC=y" ${WORKDIR}/defconfig; then |
| 97 | # Move dhcpc back to /usr/sbin/udhcpc | ||
| 98 | install -d ${D}${base_sbindir} | ||
| 99 | mv ${D}/busybox${base_sbindir}/udhcpc ${D}${base_sbindir}/ | ||
| 100 | |||
| 101 | install -d ${D}${sysconfdir}/udhcpc.d | 110 | install -d ${D}${sysconfdir}/udhcpc.d |
| 102 | install -d ${D}${datadir}/udhcpc | 111 | install -d ${D}${datadir}/udhcpc |
| 103 | install -m 0755 ${S}/examples/udhcp/simple.script ${D}${sysconfdir}/udhcpc.d/50default | 112 | install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default |
| 104 | install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script | 113 | install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script |
| 105 | install -m 0755 ${WORKDIR}/busybox-udhcpc ${D}${sysconfdir}/init.d/ | 114 | install -m 0755 ${WORKDIR}/busybox-udhcpc ${D}${sysconfdir}/init.d/ |
| 106 | fi | 115 | fi |
| 107 | if grep "CONFIG_MDEV=y" ${WORKDIR}/defconfig; then | 116 | if grep "CONFIG_INETD=y" ${WORKDIR}/defconfig; then |
| 108 | install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev | 117 | install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${PN} |
| 109 | if grep "CONFIG_FEATURE_MDEV_CONF=y" ${WORKDIR}/defconfig; then | 118 | install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/ |
| 110 | install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf | 119 | fi |
| 111 | fi | 120 | if grep "CONFIG_MDEV=y" ${WORKDIR}/defconfig; then |
| 121 | install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev | ||
| 122 | if grep "CONFIG_FEATURE_MDEV_CONF=y" ${WORKDIR}/defconfig; then | ||
| 123 | install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf | ||
| 124 | fi | ||
| 112 | fi | 125 | fi |
| 113 | |||
| 114 | install -m 0644 ${S}/busybox.links ${D}${sysconfdir} | 126 | install -m 0644 ${S}/busybox.links ${D}${sysconfdir} |
| 115 | |||
| 116 | # remove the temp dir to suppress warning, we are done with it | ||
| 117 | rm -rf ${D}/busybox | ||
| 118 | } | 127 | } |
| 119 | 128 | ||
| 120 | pkg_postinst_${PN} () { | 129 | pkg_postinst_${PN} () { |
diff --git a/meta/recipes-core/busybox/busybox_1.18.4.bb b/meta/recipes-core/busybox/busybox_1.18.4.bb index cf3765075c..a5080d5a47 100644 --- a/meta/recipes-core/busybox/busybox_1.18.4.bb +++ b/meta/recipes-core/busybox/busybox_1.18.4.bb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | require busybox.inc | 1 | require busybox.inc |
| 2 | PR = "r1" | 2 | PR = "r2" |
| 3 | 3 | ||
| 4 | SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ | 4 | SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ |
| 5 | file://udhcpscript.patch \ | 5 | file://udhcpscript.patch \ |
