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:
@@ -819,6 +819,9 @@ ifdef INSTALLED_2NDBOOTLOADER_TARGET
|
|||||||
endif
|
endif
|
||||||
ifdef BOARD_KERNEL_CMDLINE
|
ifdef BOARD_KERNEL_CMDLINE
|
||||||
$(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/RECOVERY/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
|
endif
|
||||||
@# Components of the boot image
|
@# Components of the boot image
|
||||||
$(hide) mkdir -p $(zip_root)/BOOT
|
$(hide) mkdir -p $(zip_root)/BOOT
|
||||||
@@ -834,6 +837,9 @@ endif
|
|||||||
ifdef BOARD_KERNEL_CMDLINE
|
ifdef BOARD_KERNEL_CMDLINE
|
||||||
$(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline
|
$(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline
|
||||||
endif
|
endif
|
||||||
|
ifdef BOARD_KERNEL_BASE
|
||||||
|
$(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/BOOT/base
|
||||||
|
endif
|
||||||
ifdef INSTALLED_RADIOIMAGE_TARGET
|
ifdef INSTALLED_RADIOIMAGE_TARGET
|
||||||
@# The radio image
|
@# The radio image
|
||||||
$(hide) mkdir -p $(zip_root)/RADIO
|
$(hide) mkdir -p $(zip_root)/RADIO
|
||||||
|
@@ -90,17 +90,22 @@ def BuildBootableImage(sourcedir):
|
|||||||
assert p1.returncode == 0, "mkbootfs of %s ramdisk failed" % (targetname,)
|
assert p1.returncode == 0, "mkbootfs of %s ramdisk failed" % (targetname,)
|
||||||
assert p2.returncode == 0, "minigzip 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")
|
fn = os.path.join(sourcedir, "cmdline")
|
||||||
if os.access(fn, os.F_OK):
|
if os.access(fn, os.F_OK):
|
||||||
cmdline = ["--cmdline", open(fn).read().rstrip("\n")]
|
cmd.append("--cmdline")
|
||||||
else:
|
cmd.append(open(fn).read().rstrip("\n"))
|
||||||
cmdline = []
|
|
||||||
p = Run(["mkbootimg",
|
fn = os.path.join(sourcedir, "base")
|
||||||
"--kernel", os.path.join(sourcedir, "kernel")] +
|
if os.access(fn, os.F_OK):
|
||||||
cmdline +
|
cmd.append("--base")
|
||||||
["--ramdisk", ramdisk_img.name,
|
cmd.append(open(fn).read().rstrip("\n"))
|
||||||
"--output", img.name],
|
|
||||||
stdout=subprocess.PIPE)
|
cmd.extend(["--ramdisk", ramdisk_img.name,
|
||||||
|
"--output", img.name])
|
||||||
|
|
||||||
|
p = Run(cmd, stdout=subprocess.PIPE)
|
||||||
p.communicate()
|
p.communicate()
|
||||||
assert p.returncode == 0, "mkbootimg of %s image failed" % (targetname,)
|
assert p.returncode == 0, "mkbootimg of %s image failed" % (targetname,)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user