[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#720285: flash-kernel: Please support kernel entry point setup of mkimage



Package: flash-kernel
Version: 3.8
Severity: normal
Tags: patch

Hi,

Current flash-kernel does not support kernel entry point setup of mkimage.
I created a patch which support this function.

Could you apply this?

Best regards,
  Nobuhiro

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: armhf

Kernel: Linux 3.9-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
>From a6a749029e366beaa400f67d75cd57c6934483d5 Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Date: Tue, 20 Aug 2013 12:38:16 +0900
Subject: [PATCH] Add support Entry point for mkimage

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
---
 README         |  7 ++++---
 functions      | 19 +++++++++++++------
 test_db        |  2 +-
 test_functions |  4 ++--
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/README b/README
index 920acb3..f48bffb 100644
--- a/README
+++ b/README
@@ -94,9 +94,10 @@ The supported fields are:
 * DTB-Append: (optional) when yes the DTB specified by DTB-Id will be appended
   to the kernel image.
 
-* U-Boot-Kernel-Address, U-Boot-Initrd-Address: (optional) address where
-  to load in (physical) RAM the kernel and initrd, respectively; this
-  also indicates that U-Boot images should be generated with mkimage
+* U-Boot-Kernel-Address, U-Boot-Kernel-Entry-Point, U-Boot-Initrd-Address:
+  (optional) address where to load in (physical) RAM the kernel, entry point
+  and initrd, respectively; this also indicates that U-Boot images should be
+  generated with mkimage
 
 * U-Boot-Script-Address: (optional) like U-Boot-Kernel-Address and
   U-Boot-Initrd-Address but for an U-Boot boot script; see also
diff --git a/functions b/functions
index df00a86..48611e2 100644
--- a/functions
+++ b/functions
@@ -224,12 +224,13 @@ flash_initrd() {
 
 mkimage_kernel() {
 	local kaddr="$1"
-	local kdesc="$2"
-	local kdata="$3"
-	local uimage="$4"
+	local epoint="$2"
+	local kdesc="$3"
+	local kdata="$4"
+	local uimage="$5"
 
 	printf "Generating kernel u-boot image... " >&2
-	mkimage -A arm -O linux -T kernel -C none -a "$kaddr" -e "$kaddr" \
+	mkimage -A arm -O linux -T kernel -C none -a "$kaddr" -e "$epoint" \
 		-n "$kdesc" -d "$kdata" "$uimage" >&2 1>/dev/null
 	echo "done." >&2
 }
@@ -396,6 +397,7 @@ mtd_initrd="$(get_machine_field "$machine" "Mtd-Initrd")" || :
 dtb_name="$(get_machine_field "$machine" "DTB-Id")" || :
 dtb_append="$(get_machine_field "$machine" "DTB-Append")" || :
 ukaddr="$(get_machine_field "$machine" "U-Boot-Kernel-Address")" || :
+ukepoint="$(get_machine_field "$machine" "U-Boot-Kernel-Entry-Point")" || :
 uiaddr="$(get_machine_field "$machine" "U-Boot-Initrd-Address")" || :
 umaddr="$(get_machine_field "$machine" "U-Boot-Multi-Address")" || :
 usaddr="$(get_machine_field "$machine" "U-Boot-Script-Address")" || :
@@ -493,8 +495,13 @@ case "$method" in
 			kernel="$tmpdir/kernel"
 		fi
 		if [ -n "$ukaddr" ]; then
-			mkimage_kernel "$ukaddr" "$desc" "$kernel" \
-				"$tmpdir/uImage"
+			if [ -n "$ukepoint" ]; then
+				mkimage_kernel "$ukaddr" "$ukepoint" "$desc" "$kernel" \
+					"$tmpdir/uImage"
+			else
+				mkimage_kernel "$ukaddr" "$ukaddr" "$desc" "$kernel" \
+					"$tmpdir/uImage"
+			fi
 			kernel="$tmpdir/uImage"
 			rm -f "$tmpdir/kernel"
 		fi
diff --git a/test_db b/test_db
index 1f14993..dd066d8 100755
--- a/test_db
+++ b/test_db
@@ -22,7 +22,7 @@
 MACHINE_DB="$(cat "${FK_CHECKOUT:-$FK_DIR}/db/"*.db)"
 
 test_no_unknown_fields() {
-    local expected='Android-Boot-Device Boot-Device Boot-DTB-Path Boot-Initrd-Path Boot-Kernel-Path Boot-Multi-Path Boot-Script-Path Bootloader-Sets-Root DTB-Append DTB-Id Kernel-Flavors Machine Machine-Id Method Mtd-Initrd Mtd-Kernel Optional-Packages Required-Packages U-Boot-Initrd-Address U-Boot-Kernel-Address U-Boot-Multi-Address U-Boot-Script-Address U-Boot-Script-Name'
+    local expected='Android-Boot-Device Boot-Device Boot-DTB-Path Boot-Initrd-Path Boot-Kernel-Path Boot-Multi-Path Boot-Script-Path Bootloader-Sets-Root DTB-Append DTB-Id Kernel-Flavors Machine Machine-Id Method Mtd-Initrd Mtd-Kernel Optional-Packages Required-Packages U-Boot-Initrd-Address U-Boot-Kernel-Address U-Boot-Kernel-Entry-Point U-Boot-Multi-Address U-Boot-Script-Address U-Boot-Script-Name'
     expected="$(echo "$expected" | sed 's/ /\n/g' | sort -u | xargs)"
     local fields="$(echo "$MACHINE_DB" | sed -n '/^[^#]*:/s/:.*//p' | sort -u | xargs)"
     if [ "$fields" != "$expected" ]; then
diff --git a/test_functions b/test_functions
index 6f3fbe8..c66da60 100755
--- a/test_functions
+++ b/test_functions
@@ -287,8 +287,8 @@ test_mkimage_kernel() {
         }
         . "$functions"
         saved_args=""
-        mkimage_kernel "0xdeadbeef" "desc" "input" "output" 2>/dev/null
-        expected="-A arm -O linux -T kernel -C none -a 0xdeadbeef -e 0xdeadbeef -n desc -d input output"
+        mkimage_kernel "0xdeadbeef" "0xbaddcafe" "desc" "input" "output" 2>/dev/null
+        expected="-A arm -O linux -T kernel -C none -a 0xdeadbeef -e 0xbaddcafe -n desc -d input output"
         if [ "$expected" != "$saved_args" ]; then
             echo "Expected mkimage_kernel to be called with \"$expected\" but it was called with \"$saved_args\"" >&2
             exit 1
-- 
1.8.3.2


Reply to: