From 85bdd234fffca5447c2b706a109de97ca3e82e6b Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Sun, 15 Nov 2015 22:27:44 -0800 Subject: [PATCH 1/1] toybox: Fix race condition during install * 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index 42b43ad9..ce3a51e0 100644 --- a/Android.mk +++ b/Android.mk @@ -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);) -- 2.11.0