Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

mkbootimg: Specify custom mkbootimg #9

Merged
merged 1 commit into from

1 participant

Bjorn Andersson
Bjorn Andersson
Collaborator

This change requires https://android-review.googlesource.com/#/c/51120/ to be merged.

Bjorn Andersson andersson mkbootimg: Specify custom mkbootimg
Specify custom mkbootimg to generate the boot image for LT26.

Change-Id: I622a44dd7feb734ba05ac5d198f0011d2e09a5a5
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
70371c9
Bjorn Andersson andersson merged commit 28bf4ac into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 23, 2013
  1. Bjorn Andersson

    mkbootimg: Specify custom mkbootimg

    andersson authored
    Specify custom mkbootimg to generate the boot image for LT26.
    
    Change-Id: I622a44dd7feb734ba05ac5d198f0011d2e09a5a5
    Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
This page is out of date. Refresh to see the latest.
Showing with 79 additions and 16 deletions.
  1. +0 −16 Android.mk
  2. +2 −0  BoardConfig.mk
  3. +77 −0 tools/mkbootimg.py
16 Android.mk
View
@@ -1,16 +0,0 @@
-ifneq ($(filter lt26,$(TARGET_DEVICE)),)
-
-LOCAL_PATH := $(call my-dir)
-
-ELF_BOOTIMAGE := $(PRODUCT_OUT)/boot.img.elf
-
-droid: $(ELF_BOOTIMAGE)
-
-$(ELF_BOOTIMAGE): $(PRODUCT_OUT)/boot.img
- $(call pretty,"ELF Boot image: $(ELF_BOOTIMAGE)")
- $(hide) python device/sony/lt26/tools/mkelf.py -o $(ELF_BOOTIMAGE) $(PRODUCT_OUT)/kernel@0x40208000 $(PRODUCT_OUT)/ramdisk.img@0x41300000,ramdisk vendor/sony/lt26/proprietary/boot/RPM.bin@0x20000,rpm
- $(hide) cp -p $(ELF_BOOTIMAGE) $(PRODUCT_OUT)/boot.img
-
-endif
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
2  BoardConfig.mk
View
@@ -61,3 +61,5 @@ TARGET_NO_RECOVERY := true
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1056964608
BOARD_USERDATAIMAGE_PARTITION_SIZE := 2147483648
BOARD_FLASH_BLOCK_SIZE := 131072
+
+BOARD_CUSTOM_MKBOOTIMG := device/sony/lt26/tools/mkbootimg.py
77 tools/mkbootimg.py
View
@@ -0,0 +1,77 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2012, Sony Mobile Communications AB
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Sony Mobile Communications AB nor the names
+# of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# DESCRIPTION
+#
+# mkbootimg wrapper to create the custom boot.img format used by LT26
+#
+# SYNOPSIS
+#
+# usage: mkbootimg
+# --kernel <filename>
+# --ramdisk <filename>
+# -o|--output <filename>
+#
+# For compatibility the following mkbootimg arguments are gracefully ignored
+# [ --second <2ndbootloader-filename> ]
+# [ --cmdline <kernel-commandline> ]
+# [ --board <boardname> ]
+# [ --base <address> ]
+# [ --pagesize <pagesize> ]
+#
+
+import os
+import sys
+from optparse import OptionParser
+from string import Template
+
+mkelf_template = Template('device/sony/lt26/tools/mkelf.py -o $output $kernel@0x40208000 $ramdisk@0x41300000,ramdisk $rpm@0x20000,rpm')
+
+def main(args):
+ parser = OptionParser("usage: %prog options")
+ parser.add_option("--kernel", dest="kernel", help="path to the kernel image")
+ parser.add_option("--ramdisk", dest="ramdisk", help="path to the ramdisk image")
+ parser.add_option("-o", "--output", dest="output", help="path to the output file")
+ parser.add_option("--second", dest="ignore_second", help="2ndbootloader-filename (mkbootimg compatibility)")
+ parser.add_option("--cmdline", dest="ignore_cmdline", help="kernel-commandline (mkbootimg compatibility)")
+ parser.add_option("--board", dest="ignore_boardname", help="boardname (mkbootimg compatibility)")
+ parser.add_option("--base", dest="ignore_base", help="base (mkbootimg compatibility)")
+ parser.add_option("--pagesize", dest="ignore_pagesize", help="pagesize (mkbootimg compatibility)")
+ parser.add_option("--rpm", dest="rpm", default="vendor/sony/lt26/proprietary/boot/RPM.bin")
+
+ (opts, args) = parser.parse_args()
+
+ os.system(mkelf_template.substitute(vars(opts)))
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
+
Something went wrong with that request. Please try again.