Merge change I485df382 into eclair

* changes:
  Tweak gettop() -- used in defining ANDROID_BUILD_TOP -- to expand symlinks.
diff --git a/target/board/Android.mk b/target/board/Android.mk
index fc2f651..7137082 100644
--- a/target/board/Android.mk
+++ b/target/board/Android.mk
@@ -45,7 +45,8 @@
 board_info_txt := $(wildcard $(TARGET_DEVICE_DIR)/board-info.txt)
 $(INSTALLED_ANDROID_INFO_TXT_TARGET): $(board_info_txt)
 	$(call pretty,"Generated: ($@)")
-	$(hide) echo "board=$(TARGET_BOOTLOADER_BOARD_NAME)" > $@
 ifdef board_info_txt
 	$(hide) cat $< >> $@
+else
+	$(hide) echo "board=$(TARGET_BOOTLOADER_BOARD_NAME)" > $@
 endif
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 27264dd..041daf4 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -35,6 +35,7 @@
 OPTIONS.verbose = False
 OPTIONS.tempfiles = []
 OPTIONS.device_specific = None
+OPTIONS.extras = {}
 
 class ExternalError(RuntimeError): pass
 
@@ -259,6 +260,10 @@
       Path to the python module containing device-specific
       releasetools code.
 
+  -x  (--extra)  <key=value>
+      Add a key/value pair to the 'extras' dict, which device-specific
+      extension code may look at.
+
   -v  (--verbose)
       Show command lines being executed.
 
@@ -283,8 +288,8 @@
 
   try:
     opts, args = getopt.getopt(
-        argv, "hvp:s:" + extra_opts,
-        ["help", "verbose", "path=", "device_specific="] +
+        argv, "hvp:s:x:" + extra_opts,
+        ["help", "verbose", "path=", "device_specific=", "extra="] +
           list(extra_long_opts))
   except getopt.GetoptError, err:
     Usage(docstring)
@@ -303,6 +308,9 @@
       OPTIONS.search_path = a
     elif o in ("-s", "--device_specific"):
       OPTIONS.device_specific = a
+    elif o in ("-x" "--extra"):
+      key, value = a.split("=", 1)
+      OPTIONS.extras[key] = value
     else:
       if extra_option_handler is None or not extra_option_handler(o, a):
         assert False, "unknown option \"%s\"" % (o,)
@@ -437,6 +445,7 @@
     module."""
     for k, v in kwargs.iteritems():
       setattr(self, k, v)
+    self.extras = OPTIONS.extras
 
     if self.module is None:
       path = OPTIONS.device_specific