All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] add default-option to bootmenu
@ 2018-10-05  9:58 Frank Wunderlich
  2018-11-27 18:47 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Wunderlich @ 2018-10-05  9:58 UTC (permalink / raw)
  To: u-boot



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

* [U-Boot] add default-option to bootmenu
  2018-10-05  9:58 [U-Boot] [PATCH] add default-option to bootmenu Frank Wunderlich
@ 2018-11-27 18:47 ` Tom Rini
  2018-12-01 12:41   ` Frank Wunderlich
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Rini @ 2018-11-27 18:47 UTC (permalink / raw)
  To: u-boot

On Fri, Oct 05, 2018 at 11:58:39AM +0200, Frank Wunderlich wrote:

> >From 6304b2ee2d2e9be47672d3559fee8d879b7328ff Mon Sep 17 00:00:00 2001
> From: Frank Wunderlich <frank-w@public-files.de>
> Date: Fri, 5 Oct 2018 11:41:59 +0200
> Subject: [PATCH] add default-option to bootmenu
> with this patch the selected Entry in bootmenu can be set by
> environment-var bootmenu_default=<number>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181127/d152ee8c/attachment.sig>

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

* [U-Boot] add default-option to bootmenu
  2018-11-27 18:47 ` [U-Boot] " Tom Rini
@ 2018-12-01 12:41   ` Frank Wunderlich
  2018-12-02 19:16     ` Frank Wunderlich
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Wunderlich @ 2018-12-01 12:41 UTC (permalink / raw)
  To: u-boot

thank you

as a small improvement (i've recently experienced), menu->active should be checked against menu->count (at the end of bootmenu_create), else it can be "outside" of the menu and selection is not visible till menu->active is below menu->count.

http://git.denx.de/?p=u-boot.git;a=blob;f=cmd/bootmenu.c;h=979ac4a638df48b9552feb82dd80ddbe74e69b8e;hb=f7bb20a53e829ce0b4d3c22c704e80b490d24016#l353

but i'm not 100% sure, how to handle it correctly, so i post it for discussion

because menu->active is initialized with 0 my preferred version is this:

if (menu->active >= menu->count)
  menu->active=0; //or any other value below menu->count (maybe a const set by boardconfig, but this can also be outside the menu, so 0 is imho better)

this is a user-configured environment-var so it is not a big problem :) but a simple check avoids this issue

regards Frank

> Gesendet: Dienstag, 27. November 2018 um 19:47 Uhr
> Von: "Tom Rini" <trini@konsulko.com>
> An: "Frank Wunderlich" <FrankWu@gmx.de>
> Cc: u-boot at lists.denx.de
> Betreff: Re: [U-Boot] add default-option to bootmenu
>
> On Fri, Oct 05, 2018 at 11:58:39AM +0200, Frank Wunderlich wrote:
> 
> > >From 6304b2ee2d2e9be47672d3559fee8d879b7328ff Mon Sep 17 00:00:00 2001
> > From: Frank Wunderlich <frank-w@public-files.de>
> > Date: Fri, 5 Oct 2018 11:41:59 +0200
> > Subject: [PATCH] add default-option to bootmenu
> > with this patch the selected Entry in bootmenu can be set by
> > environment-var bootmenu_default=<number>
> > Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> 
> Applied to u-boot/master, thanks!
> 
> -- 
> Tom
> 

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

* [U-Boot] add default-option to bootmenu
  2018-12-01 12:41   ` Frank Wunderlich
@ 2018-12-02 19:16     ` Frank Wunderlich
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Wunderlich @ 2018-12-02 19:16 UTC (permalink / raw)
  To: u-boot

attached Patch to check if active menuitem is inside menu

regards Frank

> Gesendet: Samstag, 01. Dezember 2018 um 13:41 Uhr
> Von: "Frank Wunderlich" <frank-w@public-files.de>
> An: "Tom Rini" <trini@konsulko.com>
> Cc: u-boot at lists.denx.de
> Betreff: Re: [U-Boot] add default-option to bootmenu
>
> thank you
> 
> as a small improvement (i've recently experienced), menu->active should be checked against menu->count (at the end of bootmenu_create), else it can be "outside" of the menu and selection is not visible till menu->active is below menu->count.
> 
> http://git.denx.de/?p=u-boot.git;a=blob;f=cmd/bootmenu.c;h=979ac4a638df48b9552feb82dd80ddbe74e69b8e;hb=f7bb20a53e829ce0b4d3c22c704e80b490d24016#l353
> 
> but i'm not 100% sure, how to handle it correctly, so i post it for discussion
> 
> because menu->active is initialized with 0 my preferred version is this:
> 
> if (menu->active >= menu->count)
>   menu->active=0; //or any other value below menu->count (maybe a const set by boardconfig, but this can also be outside the menu, so 0 is imho better)
> 
> this is a user-configured environment-var so it is not a big problem :) but a simple check avoids this issue
> 
> regards Frank
> 
> > Gesendet: Dienstag, 27. November 2018 um 19:47 Uhr
> > Von: "Tom Rini" <trini@konsulko.com>
> > An: "Frank Wunderlich" <FrankWu@gmx.de>
> > Cc: u-boot at lists.denx.de
> > Betreff: Re: [U-Boot] add default-option to bootmenu
> >
> > On Fri, Oct 05, 2018 at 11:58:39AM +0200, Frank Wunderlich wrote:
> > 
> > > >From 6304b2ee2d2e9be47672d3559fee8d879b7328ff Mon Sep 17 00:00:00 2001
> > > From: Frank Wunderlich <frank-w@public-files.de>
> > > Date: Fri, 5 Oct 2018 11:41:59 +0200
> > > Subject: [PATCH] add default-option to bootmenu
> > > with this patch the selected Entry in bootmenu can be set by
> > > environment-var bootmenu_default=<number>
> > > Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> > 
> > Applied to u-boot/master, thanks!
> > 
> > -- 
> > Tom
> > 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ensure-active-menuitem-is-inside-menu.patch
Type: text/x-patch
Size: 840 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181202/92d81458/attachment.bin>

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

end of thread, other threads:[~2018-12-02 19:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-05  9:58 [U-Boot] [PATCH] add default-option to bootmenu Frank Wunderlich
2018-11-27 18:47 ` [U-Boot] " Tom Rini
2018-12-01 12:41   ` Frank Wunderlich
2018-12-02 19:16     ` Frank Wunderlich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.