mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v1] startup: allow to abort dryrun just before starting the OS
@ 2020-06-06  5:13 Oleksij Rempel
  2020-06-08  5:06 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksij Rempel @ 2020-06-06  5:13 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

The dryrun in this function is used two times:
- with "Would run %s\n" and return
- to store dryrun for later use

The second one makes no sense since the first one will abort execution.
Since it is needed for debugging any way, it is better to allow to abort
later, just before starting the OS.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 common/boot.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/common/boot.c b/common/boot.c
index f546fce62c..8969ca51ad 100644
--- a/common/boot.c
+++ b/common/boot.c
@@ -87,10 +87,8 @@ static int bootscript_boot(struct bootentry *entry, int verbose, int dryrun)
 
 	struct bootm_data data = {};
 
-	if (dryrun) {
-		printf("Would run %s\n", bs->scriptpath);
-		return 0;
-	}
+	if (verbose)
+		printf("Run %s\n", bs->scriptpath);
 
 	globalvar_add_simple("linux.bootargs.dyn.ip", NULL);
 	globalvar_add_simple("linux.bootargs.dyn.root", NULL);
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] startup: allow to abort dryrun just before starting the OS
  2020-06-06  5:13 [PATCH v1] startup: allow to abort dryrun just before starting the OS Oleksij Rempel
@ 2020-06-08  5:06 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2020-06-08  5:06 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: barebox

On Sat, Jun 06, 2020 at 07:13:04AM +0200, Oleksij Rempel wrote:
> The dryrun in this function is used two times:
> - with "Would run %s\n" and return
> - to store dryrun for later use
> 
> The second one makes no sense since the first one will abort execution.
> Since it is needed for debugging any way, it is better to allow to abort
> later, just before starting the OS.

I think that we must abort before running the command, not afterwards.
Originally it was thought that the bootscripts only configure the setup
for a following bootm. Many bootscripts failed to do so and just
start something right away, for these we indeed have to abort before
running the command.
You are right, this makes the second if(dryrun) pointless of course.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-08  5:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06  5:13 [PATCH v1] startup: allow to abort dryrun just before starting the OS Oleksij Rempel
2020-06-08  5:06 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox