[U-Boot] [PATCH 1/1] CONFIG_MENUKEY: RFC: Is this how CONFIG_MENUKEY supposed to work?

I noticed that CONFIG_MENUKEY aborts autoboot unconditionally and executes the "menucmd" env.variable if it found a match later on. This seems odd. It is possible that I misunderstood the intent of the logic. The only other user of it now is AmigaOneG3SE.
I made a patch to make the logic only aborts autoboot if there is a match detected.
If the person who wrote the logic is reading this, did I understood the logic correctly? If so please Sign-off the patch to have it applied.
Signed-off-by: Richard Retanubun <RichardRetanubun_at_ruggedcom.com> ----
diff --git a/common/main.c b/common/main.c index 187ef8a..5a4308d 100644 --- a/common/main.c +++ b/common/main.c @@ -238,14 +238,19 @@ static __inline__ int abortboot(int bootdelay) /* delay 100 * 10ms */ for (i=0; !abort && i<100; ++i) { if (tstc()) { /* we got a key press */ - abort = 1; /* don't auto boot */ - bootdelay = 0; /* no more delay */ # ifdef CONFIG_MENUKEY menukey = getc(); + if (menukey == CONFIG_MENUKEY) { /* we got a match */ + abort = 1; /* don't auto boot */ + bootdelay = 0; /* no more delay */ + break; + } # else - (void) getc(); /* consume input */ -# endif + (void) getc(); /* consume input */ + abort = 1; /* don't auto boot */ + bootdelay = 0; /* no more delay */ break; +# endif } udelay(10000); }
participants (1)
-
richardretanubun