summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2012-07-21 10:09:55 +0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2012-07-21 10:09:55 +0700
commit9165c9f6690ab225eca5283f4467ab05ffbda794 (patch)
tree3203f867be9bdb3dc28856579db2d3196df2611d
parent01693192f1b769a7ee76167be6258d79aec61235 (diff)
downloaddevice_samsung_aries-common-9165c9f6690ab225eca5283f4467ab05ffbda794.zip
device_samsung_aries-common-9165c9f6690ab225eca5283f4467ab05ffbda794.tar.gz
device_samsung_aries-common-9165c9f6690ab225eca5283f4467ab05ffbda794.tar.bz2
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
-rwxr-xr-xmkshbootimg.py47
-rw-r--r--shbootimg.mk7
2 files changed, 5 insertions, 49 deletions
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) $@