From 1673cd73f29973a6819c0741217dd3ccd32d405b Mon Sep 17 00:00:00 2001
From: Michal Hrusecky <Michal@Hrusecky.net>
Date: Tue, 27 Feb 2018 17:24:33 +0100
Subject: [PATCH] busybox: Try to install everything into /{s,}bin

Signed-off-by: Michal Hrusecky <Michal@Hrusecky.net>
---
 package/utils/busybox/Makefile | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index a3c87aa661..3844cf82a9 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -147,6 +147,18 @@ define Package/busybox/install
 	$(INSTALL_DIR) $(1)/etc/init.d
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(CP) $(PKG_INSTALL_DIR)/* $(1)/
+	$(INSTALL_DIR) $(1)/bin
+	$(INSTALL_DIR) $(1)/usr/bin
+	$(INSTALL_DIR) $(1)/sbin
+	[ -z "`ls $(1)/usr/bin/ 2> /dev/null`" ] || for i in $(1)/usr/bin/*; do \
+		[ "$$$$(basename $$$$i)" \!= env ] || continue; \
+		echo Moving $$$$i && rm -f $$$$i &&  ln -s busybox $(1)/bin/`basename $$$$i`; \
+	done
+	[ -z "`ls $(1)/usr/sbin/ 2> /dev/null`" ] || for i in $(1)/usr/sbin/*; do \
+		echo Moving $$$$i && rm -f $$$$i &&  ln -s ../bin/busybox $(1)/sbin/`basename $$$$i`; \
+	done
+	[ -e $(1)/usr/bin/env ] || ln -s ../../bin/busybox $(1)/usr/bin/env
+	rm -f $(1)/sbin/ifup $(1)/sbin/ifdown
 ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_CROND),)
 	$(INSTALL_BIN) ./files/cron $(1)/etc/init.d/cron
 endif
-- 
2.21.0