Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

oops

  • Loading branch information...
commit a9c46fb0506498475c9fb874ab8734eb382ca221 1 parent 5fcca6c
@jt1134 jt1134 authored
Showing with 48 additions and 10 deletions.
  1. +47 −0 mkshbootimg.py
  2. +1 −10 shbootimg.mk
View
47 mkshbootimg.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+import sys, os
+
+def copydata(outfile, infile):
+ while 1:
+ data = infile.read(512)
+ if (data):
+ outfile.write(data)
+ else:
+ break
+
+def alignoffset(outfile):
+ offset = outfile.tell()
+ outfile.seek((offset + 511) & ~511)
+ return outfile.tell()
+
+def appendimage(outfile, infile):
+ offset = alignoffset(outfile)
+ copydata(outfile, infile)
+ length = alignoffset(outfile) - offset
+ assert (offset % 512 == 0)
+ assert (length % 512 == 0)
+ return (offset/512, length/512)
+
+if len(sys.argv) < 4:
+ print "Usage:", sys.argv[0], "output kernel boot [recovery]"
+ sys.exit(1)
+
+outfile = open(sys.argv[1], 'wb')
+kernel = open(sys.argv[2], 'r')
+boot = open(sys.argv[3], 'r')
+recovery = None
+if (len(sys.argv) == 5):
+ recovery = open(sys.argv[4], 'r')
+offset_table = "\n\nBOOT_IMAGE_OFFSETS\n"
+copydata(outfile, kernel)
+table_loc = alignoffset(outfile)
+outfile.write('\x00' * 512)
+offset_table += "boot_offset=%d;boot_len=%d;" % appendimage(outfile, boot)
+if recovery:
+ offset_table += "recovery_offset=%d;recovery_len=%d;" % appendimage(outfile, recovery)
+offset_table += "\n\n"
+outfile.seek(table_loc)
+outfile.write(offset_table)
+outfile.flush()
+os.fsync(outfile.fileno())
+outfile.close()
View
11 shbootimg.mk
@@ -3,17 +3,8 @@ LOCAL_PATH := $(call my-dir)
INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
$(INSTALLED_BOOTIMAGE_TARGET): $(TARGET_PREBUILT_KERNEL) $(recovery_ramdisk) $(INSTALLED_RAMDISK_TARGET)
$(call pretty,"Boot image: $@")
- $(hide) ./device/samsung/aries-common/mkshbootimg.py $@ $(TARGET_PREBUILT_KERNEL) $(INSTALLED_RAMDISK_TARGET) $(recovery_ramdisk)
+ $(hide) ./device/samsung/fascinatemtd/mkshbootimg.py $@ $(TARGET_PREBUILT_KERNEL) $(INSTALLED_RAMDISK_TARGET) $(recovery_ramdisk)
$(INSTALLED_RECOVERYIMAGE_TARGET): $(INSTALLED_BOOTIMAGE_TARGET)
$(ACP) $(INSTALLED_BOOTIMAGE_TARGET) $@
-PRODUCT_COPY_FILES += vendor/samsung/$(TARGET_DEVICE)/proprietary/modem.bin:modem.bin
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := modem.bin
-LOCAL_MODULE_TAGS := eng
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_PATH := $(PRODUCT_OUT)
-LOCAL_SRC_FILES := ../../../vendor/samsung/$(TARGET_DEVICE)/proprietary/modem.bin
-include $(BUILD_PREBUILT)
Please sign in to comment.
Something went wrong with that request. Please try again.