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

Bug#783278: patch



Here is how I have fixed the problem (attached patch). There was an if statement with a TODO that was not implemented, so I just took it out.
>From 20cea9a9506575a40a439766fb3e9d4bbb7587cb Mon Sep 17 00:00:00 2001
From: David Lechner <david@lechnology.com>
Date: Fri, 24 Apr 2015 19:13:00 -0500
Subject: [PATCH] remove kernel != kfile check in boot_kernel_path handler.

This only applies to Method: generic.

Old behavior:

If the db entry specifies Boot-Kernel-Path, one of Dtb-Append, Machine-Id
or U-Boot-Kernel-Address must be specified which changes the value of $kernel.
When checking what to do wht Boot-Kernel-Path, the script checks to see if
$kernel was changed from the original value ($kfile). If it did not change,
it does nothing. There is a TODO comment about handling symlinks, but this
does not make sense since this is the generic method, not the symlink method.

New behavior:

The check to see if $kernel changed is removed. As long as Boot-Kernel-Path
is specified, flash-kernel will copy the kernel to the specified path.

Use case:

On Raspberry Pi, the boot loader uses the vmlinux-* file directly, but it
needs to be renamed to kernel.img, which flash-kernel should be doing.
---
 functions | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/functions b/functions
index a7ff6de..34e7536 100644
--- a/functions
+++ b/functions
@@ -684,13 +684,7 @@ case "$method" in
 		if [ -n "$boot_kernel_path" ]; then
 			boot_kernel_path="$boot_mnt_dir/$boot_kernel_path"
 			# don't mv the original kernel
-			if [ "$kernel" != "$kfile" ]; then
-				backup_and_install "$kernel" \
-					"$boot_kernel_path"
-			else
-				# TODO add support for kernel symlink
-				:
-			fi
+			backup_and_install "$kernel" "$boot_kernel_path"
 		elif [ -n "$kmtd" ]; then
 			flash_kernel "$tmpdir/uImage" "$kmtd" ""
 			rm -f "$tmpdir/uImage"
-- 
1.9.1


Reply to: