From 5e01906b8433bc6a8c03be2e31758589641124c9 Mon Sep 17 00:00:00 2001 From: David Karlstrom Date: Sat, 23 Jul 2005 13:36:38 +0000 Subject: Updated to use update-alternatives and fix some FHS bugs --- packages/busybox/busybox_1.00.bb | 68 ++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 9 deletions(-) (limited to 'packages/busybox') diff --git a/packages/busybox/busybox_1.00.bb b/packages/busybox/busybox_1.00.bb index 1a5b392b7d..056213c82c 100644 --- a/packages/busybox/busybox_1.00.bb +++ b/packages/busybox/busybox_1.00.bb @@ -10,7 +10,7 @@ HOMEPAGE = "http://www.busybox.net" LICENSE = "GPL" SECTION = "base" PRIORITY = "required" -PR = "r27" +PR = "r28" SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.gz \ file://add-getkey-applet.patch;patch=1 \ @@ -73,39 +73,89 @@ do_compile () { do_install () { install -d ${D}${sysconfdir}/init.d oe_runmake 'PREFIX=${D}' install + + # Move everything to /busybox (not supposed to end up in any package) + install -d ${D}/busybox + mv ${D}${base_bindir} ${D}${base_sbindir} ${D}${prefix} ${D}/busybox/ + # Move the busybox binary back to /bin + install -d ${D}${base_bindir} + mv ${D}/busybox${base_bindir}/busybox ${D}${base_bindir}/ + # Move back the sh symlink + mv ${D}/busybox${base_bindir}/sh ${D}${base_bindir}/ + install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/ install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/ if grep "CONFIG_CROND=y" ${WORKDIR}/defconfig; then + # Move crond back to /usr/sbin/crond + install -d ${D}${sbindir} + mv ${D}/busybox${sbindir}/crond ${D}${sbindir}/ + install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/ fi if grep "CONFIG_HTTPD=y" ${WORKDIR}/defconfig; then + # Move httpd back to /usr/sbin/httpd + install -d ${D}${sbindir} + mv ${D}/busybox${sbindir}/httpd ${D}${sbindir}/ + install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/ install -d ${D}/srv/www fi if grep "CONFIG_UDHCPD=y" ${WORKDIR}/defconfig; then + # Move udhcpd back to /usr/sbin/udhcpd + install -d ${D}${sbindir} + mv ${D}/busybox${sbindir}/udhcpd ${D}${sbindir}/ + install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/ fi if grep "CONFIG_HWCLOCK=y" ${WORKDIR}/defconfig; then + # Move hwclock back to /sbin/hwclock + install -d ${D}${base_sbindir} + mv ${D}/busybox${base_sbindir}/hwclock ${D}${base_sbindir}/ + install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/ fi if grep "CONFIG_UDHCPC=y" ${WORKDIR}/defconfig; then + # Move dhcpc back to /usr/sbin/udhcpc + install -d ${D}${base_sbindir} + mv ${D}/busybox${base_sbindir}/udhcpc ${D}${base_sbindir}/ + install -d ${D}${sysconfdir}/udhcpc.d install -d ${D}${datadir}/udhcpc install -m 0755 ${S}/examples/udhcp/simple.script ${D}${sysconfdir}/udhcpc.d/50default install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script fi - rm ${D}${base_bindir}/mount - install -m 0755 ${WORKDIR}/mount.busybox ${D}${base_bindir}/ - rm ${D}${base_bindir}/umount - install -m 0755 ${WORKDIR}/umount.busybox ${D}${base_bindir}/ + + install -m 0644 ${S}/busybox.links ${D}${sysconfdir} } pkg_postinst_${PN} () { - update-alternatives --install /bin/mount mount /bin/mount.busybox 50 - update-alternatives --install /bin/umount umount /bin/umount.busybox 50 + # If we are not making an image we create links for the utilities that doesn't exist + # so the update-alternatives script will get the utilities it needs + # (update-alternatives have no problem replacing links later anyway) + alias test='busybox test' + if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/busybox";; /bin/*) to="busybox";; /*/*) to="../bin/busybox";; esac; busybox ln -s $to $link; fi; done