handle BOARD_KERNEL_BASE in releasetools

Some devices define a BOARD_KERNEL_BASE argument which must be given
as an argument to mkbootimg when building a bootable image.  Store the
value of this var (if any) in the target-files zip and use it when
building images.
This commit is contained in:
Doug Zongker 2009-06-17 09:07:09 -07:00
parent c0288c2cdb
commit 38a649f873
2 changed files with 20 additions and 9 deletions

View File

@ -819,6 +819,9 @@ ifdef INSTALLED_2NDBOOTLOADER_TARGET
endif
ifdef BOARD_KERNEL_CMDLINE
$(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/RECOVERY/cmdline
endif
ifdef BOARD_KERNEL_BASE
$(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/RECOVERY/base
endif
@# Components of the boot image
$(hide) mkdir -p $(zip_root)/BOOT
@ -834,6 +837,9 @@ endif
ifdef BOARD_KERNEL_CMDLINE
$(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline
endif
ifdef BOARD_KERNEL_BASE
$(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/BOOT/base
endif
ifdef INSTALLED_RADIOIMAGE_TARGET
@# The radio image
$(hide) mkdir -p $(zip_root)/RADIO

View File

@ -90,17 +90,22 @@ def BuildBootableImage(sourcedir):
assert p1.returncode == 0, "mkbootfs of %s ramdisk failed" % (targetname,)
assert p2.returncode == 0, "minigzip of %s ramdisk failed" % (targetname,)
cmd = ["mkbootimg", "--kernel", os.path.join(sourcedir, "kernel")]
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 +
["--ramdisk", ramdisk_img.name,
"--output", img.name],
stdout=subprocess.PIPE)
cmd.append("--cmdline")
cmd.append(open(fn).read().rstrip("\n"))
fn = os.path.join(sourcedir, "base")
if os.access(fn, os.F_OK):
cmd.append("--base")
cmd.append(open(fn).read().rstrip("\n"))
cmd.extend(["--ramdisk", ramdisk_img.name,
"--output", img.name])
p = Run(cmd, stdout=subprocess.PIPE)
p.communicate()
assert p.returncode == 0, "mkbootimg of %s image failed" % (targetname,)