Message ID | 1453398885-102144-2-git-send-email-openwrt@daniel.thecshore.com |
---|---|
State | Changes Requested |
Headers | show |
On 2016-01-21 18:54, openwrt@daniel.thecshore.com wrote: > From: Daniel Dickinson <openwrt@daniel.thecshore.com> > > There are a number of packages in base and feeds > that provide full versions of commands that are > provided by busybox either by default or as a > configure option. Here we add a macro that makes > installation/uninstallation of the full version > work smoothly (so that --force-overwrite is > unnecessary and so that so on uninstall the busybox > functionality is restored, if the applicable > applet has been included in busybox). > > It does require making sure that if busybox > applet is installed in /bin that the full > version is in /usr/bin and vice versa (and > similarly with /sbin and /usr/sbin) so that > the path of the file in the package doesn't > conflict with the symlink to busybox that > exists in the stock image, so that on > installation/deinstallation of the package > we simply point symlinks at the right target > and at the same time that even if the command isn't > in the 'standard' location there is a symlink so that > any program or configuration that depends or > defaults to a particular path still works. > > Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com> I don't really like this approach. Here's what I want to have instead: Any busybox utility for which a full replacement exists should just install itself to /bin or /sbin. The replacement should go into /usr/bin or /usr/sbin and is thus preferred via $PATH. No messing with busybox's symlinks at (un)install time needed. - Felix
diff --git a/include/package.mk b/include/package.mk index 1dfbd68..012b504 100644 --- a/include/package.mk +++ b/include/package.mk @@ -233,6 +233,21 @@ define Build/IncludeOverlay endef endef +define Package/BusyBoxReplacement/Default + define Package/$(1)/postinst + #!/bin/sh + ln -sf $(3)/$(5) $${IPKG_INSTROOT}/$(2)/$(5) + $(6) + exit 0 + endef + define Package/$(1)/postrm + #!/bin/sh + /bin/busybox $(5) -h 2>&1 | grep -q BusyBox && ln -sf $(if $(4),$(4)/)busybox $(2)/$(5) || rm -f $(2)/$(5) + $(7) + exit 0 + endef +endef + define BuildPackage $(Build/IncludeOverlay) $(eval $(Package/Default))