diff mbox

[U-Boot] image-fit: switch ENOLINK to ENOENT

Message ID 20160902223014.86215-1-jsg@jsg.id.au
State Accepted
Commit bac17b78daceeba1af2e1d8cd204ee460c71c93a
Delegated to: Tom Rini
Headers show

Commit Message

Jonathan Gray Sept. 2, 2016, 10:30 p.m. UTC
ENOLINK is not required by POSIX and does not exist on OpenBSD
and likely other systems.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
---
 common/image-fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini Sept. 7, 2016, 6 p.m. UTC | #1
On Sat, Sep 03, 2016 at 08:30:14AM +1000, Jonathan Gray wrote:

> ENOLINK is not required by POSIX and does not exist on OpenBSD
> and likely other systems.
> 
> Signed-off-by: Jonathan Gray <jsg@jsg.id.au>

Applied to u-boot/master, thanks!
Stefan Roese Sept. 15, 2016, 12:49 p.m. UTC | #2
Hi Tom,
Hi Jonathan,

On 03.09.2016 00:30, Jonathan Gray wrote:
> ENOLINK is not required by POSIX and does not exist on OpenBSD
> and likely other systems.
> 
> Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
> ---
>  common/image-fit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/image-fit.c b/common/image-fit.c
> index d8d4e95..79c0375 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -1566,7 +1566,7 @@ int fit_get_node_from_config(bootm_headers_t *images, const char *prop_name,
>  	noffset = fit_conf_get_prop_node(fit_hdr, cfg_noffset, prop_name);
>  	if (noffset < 0) {
>  		debug("*  %s: no '%s' in config\n", prop_name, prop_name);
> -		return -ENOLINK;
> +		return -ENOENT;
>  	}
>  
>  	return noffset;
> 

This patch breaks Linux booting via FIT-image on Marvell Armada
XP for me. Here a short log with this patch applied:

## Loading kernel from FIT Image at 02000000 ...
   Using 'conf@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x020000f4
     Data Size:    5065728 Bytes = 4.8 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    sha1
     Hash value:   11ddefa0b68cbc5db9d84b0fd74ec67da155fada
   Verifying Hash Integrity ... sha1+ OK
Ramdisk image is corrupt or invalid


And this is how is should look like:

## Loading kernel from FIT Image at 02000000 ...
   Using 'conf@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x020000f4
     Data Size:    5065728 Bytes = 4.8 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    sha1
     Hash value:   11ddefa0b68cbc5db9d84b0fd74ec67da155fada
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 02000000 ...
   Using 'conf@1' configuration
   Trying 'fdt@1' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x024d4de8
     Data Size:    16971 Bytes = 16.6 KiB
     Architecture: ARM
     Hash algo:    sha1
     Hash value:   672f2964b334406749265f4508e2231fb54ccbf4
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x24d4de8
   Loading Kernel Image ... OK
   Loading Device Tree to 0fff8000, end 0ffff24a ... OK

Starting kernel ...


Unfortunately v2016.09 is useless with this patch - at least for me.
I really think that we should revert it and release v2016.09.01.

What do you think?

Thanks,
Stefan
diff mbox

Patch

diff --git a/common/image-fit.c b/common/image-fit.c
index d8d4e95..79c0375 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1566,7 +1566,7 @@  int fit_get_node_from_config(bootm_headers_t *images, const char *prop_name,
 	noffset = fit_conf_get_prop_node(fit_hdr, cfg_noffset, prop_name);
 	if (noffset < 0) {
 		debug("*  %s: no '%s' in config\n", prop_name, prop_name);
-		return -ENOLINK;
+		return -ENOENT;
 	}
 
 	return noffset;