From ff1160b28ffc543274b43ca275db8111c73f6808 Mon Sep 17 00:00:00 2001 From: Daniel Rosenberg Date: Wed, 28 Oct 2015 13:13:37 -0700 Subject: [PATCH] rootdir: Allow board specific folders and symlinks in root directory Building without ramdisk requires a way to specify board specific directoryies and symlinks in the root directory at build time. Change-Id: I11301e98228bc4761f3aee177a546146651b9f25 --- rootdir/Android.mk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/rootdir/Android.mk b/rootdir/Android.mk index a850890d7..ab3220eb0 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -25,17 +25,21 @@ LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) # because init.rc is conditionally included. # # create some directories (some are mount points) and symlinks -local_post_install_cmd_base := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \ - sbin dev proc sys system data oem acct cache config storage mnt root); \ +LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \ + sbin dev proc sys system data oem acct cache config storage mnt root $(BOARD_ROOT_EXTRA_FOLDERS)); \ ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \ ln -sf /sys/kernel/debug $(TARGET_ROOT_OUT)/d; \ ln -sf /storage/self/primary $(TARGET_ROOT_OUT)/sdcard ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE - LOCAL_POST_INSTALL_CMD := $(local_post_install_cmd_base); mkdir -p $(TARGET_ROOT_OUT)/vendor -else - LOCAL_POST_INSTALL_CMD := $(local_post_install_cmd_base) + LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/vendor +endif +ifdef BOARD_ROOT_EXTRA_SYMLINKS +# BOARD_ROOT_EXTRA_SYMLINKS is a list of :. + LOCAL_POST_INSTALL_CMD += $(foreach s, $(BOARD_ROOT_EXTRA_SYMLINKS),\ + $(eval p := $(subst :,$(space),$(s)))\ + ; mkdir -p $(dir $(TARGET_ROOT_OUT)/$(word 2,$(p))) \ + ; ln -sf $(word 1,$(p)) $(TARGET_ROOT_OUT)/$(word 2,$(p))) endif -local_post_install_cmd_base := include $(BUILD_SYSTEM)/base_rules.mk