[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/busybox/Makefile b/ap/app/busybox/Makefile
new file mode 100755
index 0000000..c0a819b
--- /dev/null
+++ b/ap/app/busybox/Makefile
@@ -0,0 +1,35 @@
+
+include $(COMMON_BASE_MK)
+
+NAME=busybox
+SRC_DIR=$(APP_DIR)/$(NAME)/src
+INSTALL_DIR=$(APP_DIR)/$(NAME)/install
+BUILD_DIR=$(APP_DIR)/$(NAME)/build
+GEN_MAKEFILE=$(BUILD_DIR)/Makefile
+INSTALLER=$(SRC_DIR)/install-romfs.sh
+TARGETDIR=$(ROOTFS_DIR)
+
+all: $(GEN_MAKEFILE)
+ make -C $(SRC_DIR) O=$(BUILD_DIR) all
+ cp -v $(BUILD_DIR)/busybox_unstripped $(BUILD_DIR)/busybox_unstripped.elf
+
+$(GEN_MAKEFILE):
+ mkdir -p $(BUILD_DIR)
+ make -C $(SRC_DIR) O=$(BUILD_DIR) zte_defconfig
+
+clean:
+ -rm -fr $(BUILD_DIR) $(INSTALL_DIR)
+
+$(BUILD_DIR)/busybox.links:
+ make -C $(SRC_DIR) O=$(BUILD_DIR) busybox.links
+
+# Before copying, remove all existing busybox links
+romfs: $(INSTALLER) $(BUILD_DIR)/busybox.links
+ mkdir -p $(TARGETDIR)/bin $(TARGETDIR)/etc
+ if [ -f "$(TARGETDIR)/bin/busybox" ]; then \
+ inode=`ls -i $(TARGETDIR)/bin/busybox | awk '{print $$1}'`; \
+ ls -iL "$(TARGETDIR)/bin" | grep "^ *$$inode" | awk '{print $$2}' | \
+ sed "s:^:$(TARGETDIR)/bin/:" | env -i xargs rm -f; \
+ fi
+ $(ROMFSINST) $(BUILD_DIR)/busybox /bin/busybox
+ bash $(INSTALLER) $(TARGETDIR) $(BUILD_DIR)/busybox.links