diff mbox series

Fix bootloader script handling

Message ID 1519297019-25875-1-git-send-email-sami.hartikainen@teleste.com
State Accepted
Headers show
Series Fix bootloader script handling | expand

Commit Message

Hartikainen, Sami Feb. 22, 2018, 10:56 a.m. UTC
Initialize the 'bootscripts' list of the internal database, and
consider filenames listed in it when scanning the cpio archive.

Signed-off-by: Sami Hartikainen <sami.hartikainen@teleste.com>
---
 core/cpio_utils.c | 2 ++
 core/swupdate.c   | 1 +
 2 files changed, 3 insertions(+)

Comments

Stefano Babic Feb. 22, 2018, 12:40 p.m. UTC | #1
Hi Sami,

On 22/02/2018 11:56, Sami Hartikainen wrote:
> Initialize the 'bootscripts' list of the internal database, and
> consider filenames listed in it when scanning the cpio archive.
> 
> Signed-off-by: Sami Hartikainen <sami.hartikainen@teleste.com>
> ---
>  core/cpio_utils.c | 2 ++
>  core/swupdate.c   | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/core/cpio_utils.c b/core/cpio_utils.c
> index 6030b30..15c1374 100644
> --- a/core/cpio_utils.c
> +++ b/core/cpio_utils.c
> @@ -651,6 +651,8 @@ int cpio_scan(int fd, struct swupdate_cfg *cfg, off_t start)
>  			file_listed, start);
>  		SEARCH_FILE(struct img_type, cfg->scripts,
>  			file_listed, start);
> +		SEARCH_FILE(struct img_type, cfg->bootscripts,
> +			file_listed, start);

Right, it was missing !

>  
>  		TRACE("Found file:\n\tfilename %s\n\tsize %lu\n\t%s\n",
>  			fdh.filename,
> diff --git a/core/swupdate.c b/core/swupdate.c
> index 430bb96..ed0e563 100644
> --- a/core/swupdate.c
> +++ b/core/swupdate.c
> @@ -427,6 +427,7 @@ static void swupdate_init(struct swupdate_cfg *sw)
>  	LIST_INIT(&sw->images);
>  	LIST_INIT(&sw->hardware);
>  	LIST_INIT(&sw->scripts);
> +	LIST_INIT(&sw->bootscripts);
>  	LIST_INIT(&sw->bootloader);
>  	LIST_INIT(&sw->extprocs);
>  

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/core/cpio_utils.c b/core/cpio_utils.c
index 6030b30..15c1374 100644
--- a/core/cpio_utils.c
+++ b/core/cpio_utils.c
@@ -651,6 +651,8 @@  int cpio_scan(int fd, struct swupdate_cfg *cfg, off_t start)
 			file_listed, start);
 		SEARCH_FILE(struct img_type, cfg->scripts,
 			file_listed, start);
+		SEARCH_FILE(struct img_type, cfg->bootscripts,
+			file_listed, start);
 
 		TRACE("Found file:\n\tfilename %s\n\tsize %lu\n\t%s\n",
 			fdh.filename,
diff --git a/core/swupdate.c b/core/swupdate.c
index 430bb96..ed0e563 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -427,6 +427,7 @@  static void swupdate_init(struct swupdate_cfg *sw)
 	LIST_INIT(&sw->images);
 	LIST_INIT(&sw->hardware);
 	LIST_INIT(&sw->scripts);
+	LIST_INIT(&sw->bootscripts);
 	LIST_INIT(&sw->bootloader);
 	LIST_INIT(&sw->extprocs);