From 9165c9f6690ab225eca5283f4467ab05ffbda794 Mon Sep 17 00:00:00 2001 From: Pawit Pornkitprasan Date: Sat, 21 Jul 2012 10:09:55 +0700 Subject: aries-common: built ramdisk into kernel Do not use the hackish append-ramdisk-to-kernel now that we can build the ramdisk right into the kernel with in-line kernel building. Change-Id: Id6cd448c7bede78d60f1c57c10447c9294a1e8d1 --- mkshbootimg.py | 47 ----------------------------------------------- shbootimg.mk | 7 +++++-- 2 files changed, 5 insertions(+), 49 deletions(-) delete mode 100755 mkshbootimg.py diff --git a/mkshbootimg.py b/mkshbootimg.py deleted file mode 100755 index dcc8294..0000000 --- a/mkshbootimg.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/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() diff --git a/shbootimg.mk b/shbootimg.mk index c90f874..9eda9ec 100644 --- a/shbootimg.mk +++ b/shbootimg.mk @@ -1,9 +1,12 @@ LOCAL_PATH := $(call my-dir) +# Add ramdisk dependencies to kernel +TARGET_KERNEL_BINARIES: $(recovery_ramdisk) $(INSTALLED_RAMDISK_TARGET) $(PRODUCT_OUT)/utilities/flash_image $(PRODUCT_OUT)/utilities/busybox $(PRODUCT_OUT)/utilities/make_ext4fs $(PRODUCT_OUT)/utilities/erase_image $(PRODUCT_OUT)/modem.bin + INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img -$(INSTALLED_BOOTIMAGE_TARGET): $(INSTALLED_KERNEL_TARGET) $(recovery_ramdisk) $(INSTALLED_RAMDISK_TARGET) $(PRODUCT_OUT)/utilities/flash_image $(PRODUCT_OUT)/utilities/busybox $(PRODUCT_OUT)/utilities/make_ext4fs $(PRODUCT_OUT)/utilities/erase_image $(PRODUCT_OUT)/modem.bin +$(INSTALLED_BOOTIMAGE_TARGET): $(INSTALLED_KERNEL_TARGET) $(call pretty,"Boot image: $@") - $(hide) ./device/samsung/aries-common/mkshbootimg.py $@ $(INSTALLED_KERNEL_TARGET) $(INSTALLED_RAMDISK_TARGET) $(recovery_ramdisk) + $(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $@ $(INSTALLED_RECOVERYIMAGE_TARGET): $(INSTALLED_BOOTIMAGE_TARGET) $(ACP) $(INSTALLED_BOOTIMAGE_TARGET) $@ -- cgit v1.1