OSDN Git Service

toybox: Fix race condition during install
authorSteve Kondik <steve@cyngn.com>
Mon, 16 Nov 2015 06:27:44 +0000 (22:27 -0800)
committerSteve Kondik <steve@cyngn.com>
Mon, 16 Nov 2015 06:27:44 +0000 (22:27 -0800)
 * It's possible that if we create a link which actually has a real
   package that the build system follows the link and ends up in place
   of the toybox binary. This is happening with blkid now, so remove
   it from the system image (and keep it for recovery)

Change-Id: I5efc471c5339a7718964698d23b955993a1f0563

Android.mk

index 42b43ad..ce3a51e 100644 (file)
@@ -269,6 +269,11 @@ LOCAL_ADDITIONAL_DEPENDENCIES := toybox_links
 # stick around for compatibility reasons, for now.
 TOYS_FOR_XBIN := ps
 
+# skip links for these toys in the system image, they already have
+# a full-blown counterpart. we still want them for the recovery
+# image though.
+TOYS_WITHOUT_LINKS := blkid
+
 include $(BUILD_EXECUTABLE)
 
 toybox_links: $(TOYBOX_INSTLIST) toybox
@@ -278,7 +283,7 @@ toybox_links:
        @echo -e ${CL_CYN}"Generate Toybox links:"${CL_RST} $(TOY_LIST)
        @mkdir -p $(TARGET_OUT)/bin
        @mkdir -p $(TARGET_OUT)/xbin
-       $(hide) $(foreach t,$(filter-out $(TOYS_FOR_XBIN),$(TOY_LIST)),ln -sf toybox $(TARGET_OUT_EXECUTABLES)/$(t);)
+       $(hide) $(foreach t,$(filter-out $(TOYS_FOR_XBIN) $(TOYS_WITHOUT_LINKS),$(TOY_LIST)),ln -sf toybox $(TARGET_OUT_EXECUTABLES)/$(t);)
        $(hide) $(foreach t,$(TOYS_FOR_XBIN),ln -sf /system/bin/toybox $(TARGET_OUT_OPTIONAL_EXECUTABLES)/$(t);)