From ff1ef9f2b10d98131ea8945c642dd8388d9b0250 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 6 Dec 2017 08:59:02 -0800 Subject: [PATCH] Add a /bin symlink for convenience. We already have /etc and /sbin. As the Android world moves towards / being on the system partition, the circumstances under which a /bin symlink won't work are reduced. This should already be usable most of the time. Bug: http://b/63142920 Test: `adb shell /bin/date` Change-Id: I81c2209ae808ced186d05fbe1d5417ce8dd93ea7 --- rootdir/Android.mk | 1 + rootdir/init.rc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rootdir/Android.mk b/rootdir/Android.mk index aa970d6a7..21dd31191 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -142,6 +142,7 @@ endif # create some directories (some are mount points) and symlinks LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \ sbin dev proc sys system data oem acct config storage mnt $(BOARD_ROOT_EXTRA_FOLDERS)); \ + ln -sf /system/bin $(TARGET_ROOT_OUT)/bin; \ ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \ ln -sf /data/user_de/0/com.android.shell/files/bugreports $(TARGET_ROOT_OUT)/bugreports; \ ln -sf /sys/kernel/debug $(TARGET_ROOT_OUT)/d; \ diff --git a/rootdir/init.rc b/rootdir/init.rc index 11b838358..2f91db5d7 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -48,8 +48,10 @@ on init copy /proc/cmdline /dev/urandom copy /default.prop /dev/urandom - # Backward compatibility. + symlink /system/bin /bin symlink /system/etc /etc + + # Backward compatibility. symlink /sys/kernel/debug /d # Link /vendor to /system/vendor for devices without a vendor partition.