Merge change 4307

* changes:
  don't require some OTA features
This commit is contained in:
Android (Google) Code Review 2009-06-15 22:39:16 -07:00
commit c0288c2cdb
2 changed files with 19 additions and 13 deletions

View file

@ -90,11 +90,15 @@ def BuildBootableImage(sourcedir):
assert p1.returncode == 0, "mkbootfs of %s ramdisk failed" % (targetname,)
assert p2.returncode == 0, "minigzip of %s ramdisk failed" % (targetname,)
cmdline = open(os.path.join(sourcedir, "cmdline")).read().rstrip("\n")
fn = os.path.join(sourcedir, "cmdline")
if os.access(fn, os.F_OK):
cmdline = ["--cmdline", open(fn).read().rstrip("\n")]
else:
cmdline = []
p = Run(["mkbootimg",
"--kernel", os.path.join(sourcedir, "kernel"),
"--cmdline", cmdline,
"--ramdisk", ramdisk_img.name,
"--kernel", os.path.join(sourcedir, "kernel")] +
cmdline +
["--ramdisk", ramdisk_img.name,
"--output", img.name],
stdout=subprocess.PIPE)
p.communicate()

View file

@ -310,13 +310,11 @@ def AppendAssertions(script, input_zip):
info = input_zip.read("OTA/android-info.txt")
m = re.search(r"require\s+version-bootloader\s*=\s*(\S+)", info)
if not m:
raise ExternalError("failed to find required bootloaders in "
"android-info.txt")
bootloaders = m.group(1).split("|")
script.append("assert " +
" || ".join(['getprop("ro.bootloader") == "%s"' % (b,)
for b in bootloaders]))
if m:
bootloaders = m.group(1).split("|")
script.append("assert " +
" || ".join(['getprop("ro.bootloader") == "%s"' % (b,)
for b in bootloaders]))
def IncludeBinary(name, input_zip, output_zip, input_path=None):
@ -343,8 +341,12 @@ def WriteFullOTAPackage(input_zip, output_zip):
script.append("format BOOT:")
script.append("show_progress 0.1 0")
common.ZipWriteStr(output_zip, "radio.img", input_zip.read("RADIO/image"))
script.append("write_radio_image PACKAGE:radio.img")
try:
common.ZipWriteStr(output_zip, "radio.img", input_zip.read("RADIO/image"))
script.append("write_radio_image PACKAGE:radio.img")
except KeyError:
pass
script.append("show_progress 0.5 0")
if OPTIONS.wipe_user_data: