From: David Karlstrom Date: Sat, 23 Jul 2005 13:36:38 +0000 (+0000) Subject: Updated to use update-alternatives and fix some FHS bugs X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e01906b;p=openembedded.git Updated to use update-alternatives and fix some FHS bugs --- diff --git a/packages/binutils/binutils.inc b/packages/binutils/binutils.inc index 731f58ba2c..e544e9ef53 100644 --- a/packages/binutils/binutils.inc +++ b/packages/binutils/binutils.inc @@ -16,7 +16,6 @@ FILES_${PN}-dev = " \ FILES_${PN}-symlinks = " \ ${bindir}/addr2line \ - ${bindir}/ar \ ${bindir}/as \ ${bindir}/c++filt \ ${bindir}/gprof \ @@ -27,7 +26,6 @@ FILES_${PN}-symlinks = " \ ${bindir}/ranlib \ ${bindir}/readelf \ ${bindir}/size \ - ${bindir}/strings \ ${bindir}/strip" EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \ @@ -101,4 +99,19 @@ do_install () { for p in ${TARGET_SYS}-* ; do ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,` done + + rm ${D}${bindir}/ar ${D}${bindir}/strings +} + + +pkg_postinst_${PN}-symlinks () { + update-alternatives --install ${bindir}/ar ar ${TARGET_SYS}-ar 100 + update-alternatives --install ${bindir}/strings strings ${TARGET_SYS}-strings 100 } + + +pkg_prerm_${PN}-symlinks () { + update-alternatives --remove ar ${TARGET_SYS}-ar + update-alternatives --remove strings ${TARGET_SYS}-strings +} + diff --git a/packages/binutils/binutils_2.16.bb b/packages/binutils/binutils_2.16.bb index 27e2f8983c..bb280f0fb5 100644 --- a/packages/binutils/binutils_2.16.bb +++ b/packages/binutils/binutils_2.16.bb @@ -3,7 +3,7 @@ HOMEPAGE = "http://www.gnu.org/software/binutils/" SECTION = "devel" LICENSE = "GPL" MAINTAINER = "Gerald Britton " -PR = "r0" +PR = "r1" DEFAULT_PREFERENCE_linux-uclibc = "-1" 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