Merge "Use a different kernel boot line for the disk installer."
diff --git a/core/definitions.mk b/core/definitions.mk
index 3221525..27e38d3 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1324,12 +1324,10 @@
-F $@
endef
-#TODO: Allow library directory to be specified based on the target
-# CPU and ABI instead of being hard coded as armeabi.
define add-jni-shared-libs-to-package
$(hide) rm -rf $(dir $@)lib
-$(hide) mkdir -p $(dir $@)lib/armeabi
-$(hide) cp $(PRIVATE_JNI_SHARED_LIBRARIES) $(dir $@)lib/armeabi
+$(hide) mkdir -p $(dir $@)lib/$(TARGET_CPU_ABI)
+$(hide) cp $(PRIVATE_JNI_SHARED_LIBRARIES) $(dir $@)lib/$(TARGET_CPU_ABI)
$(hide) (cd $(dir $@) && zip -r $(notdir $@) lib)
$(hide) rm -rf $(dir $@)lib
endef
diff --git a/core/main.mk b/core/main.mk
index 5cb160b..fdb1163 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -737,7 +737,7 @@
modules:
@echo "Available sub-modules:"
@echo "$(call module-names-for-tag-list,$(ALL_MODULE_TAGS))" | \
- sed -e 's/ */\n/g' | sort -u | $(COLUMN)
+ tr -s ' ' '\n' | sort -u | $(COLUMN)
.PHONY: showcommands
showcommands:
diff --git a/target/board/generic_x86/buildspec-generic_x86.mk b/target/board/generic_x86/buildspec-generic_x86.mk
index 5c4e6a5..fbc3947 100644
--- a/target/board/generic_x86/buildspec-generic_x86.mk
+++ b/target/board/generic_x86/buildspec-generic_x86.mk
@@ -1,3 +1,7 @@
BUILD_ENV_SEQUENCE_NUMBER := 9
DISABLE_DEXPREOPT := true
TARGET_ARCH := x86
+
+# The eth0 device should be started with dhcp on boot.
+# Useful for emulators that don't provide a wifi connection.
+NET_ETH0_STARTONBOOT := true
diff --git a/target/board/generic_x86/init.rc b/target/board/generic_x86/init.rc
index 2a6f665..235083d 100644
--- a/target/board/generic_x86/init.rc
+++ b/target/board/generic_x86/init.rc
@@ -191,6 +191,7 @@
class_start default
+
## Daemon processes to be run by init.
##
service console /system/bin/sh
@@ -241,3 +242,13 @@
service installd /system/bin/installd
socket installd stream 600 system system
+
+#
+# Set by PRODUCT_PROPERTY_OVERRIDES in <product>.mk
+on property:net.eth0.startonboot=1
+ setprop ro.com.android.dataroaming true
+ start start_eth0
+
+service start_eth0 /system/bin/netcfg eth0 dhcp
+ oneshot
+ disabled
diff --git a/target/product/generic_x86.mk b/target/product/generic_x86.mk
index 00f2822..9713900 100644
--- a/target/product/generic_x86.mk
+++ b/target/product/generic_x86.mk
@@ -25,3 +25,10 @@
PRODUCT_DEVICE := generic_x86
PRODUCT_NAME := generic_x86
PRODUCT_POLICY := android.policy_phone
+
+# If running on an emulator or some other device that has a LAN connection
+# that isn't a wifi connection. This will instruct init.rc to enable the
+# network connection so that you can use it with ADB
+ifdef NET_ETH0_STARTONBOOT
+ PRODUCT_PROPERTY_OVERRIDES += net.eth0.startonboot=1
+endif
diff --git a/tools/atree/fs.cpp b/tools/atree/fs.cpp
index 00f44c2..9971879 100644
--- a/tools/atree/fs.cpp
+++ b/tools/atree/fs.cpp
@@ -108,6 +108,10 @@
{
int err;
size_t pos = 0;
+ // For absolute pathnames, that starts with leading '/'
+ // use appropriate initial value.
+ if (path.length() != 0 and path[0] == '/') pos++;
+
while (true) {
pos = path.find('/', pos);
string p = path.substr(0, pos);