Message ID | 20180417170900.31045-1-javierm@redhat.com |
---|---|
State | Accepted |
Headers | show |
Series | [v2,1/3] discover/grub: Reverse BLS entries sorting to match Petitboot's boot order | expand |
On Tue, 2018-04-17 at 19:08 +0200, Javier Martinez Canillas wrote: > The BLS entries were sorted so that the latest entry was at the top in the > Petitboot UI, since it matches how menu entries are sorted in GRUB2 config > and the GRUB2 UI. > > But in the Petitboot's UI, the latest entry is expected to be at the bottom > and the older one at the top. Sort the BLS entries to match what's expected. > > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> > --- Thanks, series merged as c41ffcc > > Changes in v2: None > > discover/grub2/blscfg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/discover/grub2/blscfg.c b/discover/grub2/blscfg.c > index 02ac621be061..d20dde20bb9c 100644 > --- a/discover/grub2/blscfg.c > +++ b/discover/grub2/blscfg.c > @@ -162,7 +162,7 @@ static int bls_filter(const struct dirent *ent) > > static int bls_sort(const struct dirent **ent_a, const struct dirent **ent_b) > { > - return strverscmp((*ent_b)->d_name, (*ent_a)->d_name); > + return strverscmp((*ent_a)->d_name, (*ent_b)->d_name); > } > > int builtin_blscfg(struct grub2_script *script,
diff --git a/discover/grub2/blscfg.c b/discover/grub2/blscfg.c index 02ac621be061..d20dde20bb9c 100644 --- a/discover/grub2/blscfg.c +++ b/discover/grub2/blscfg.c @@ -162,7 +162,7 @@ static int bls_filter(const struct dirent *ent) static int bls_sort(const struct dirent **ent_a, const struct dirent **ent_b) { - return strverscmp((*ent_b)->d_name, (*ent_a)->d_name); + return strverscmp((*ent_a)->d_name, (*ent_b)->d_name); } int builtin_blscfg(struct grub2_script *script,
The BLS entries were sorted so that the latest entry was at the top in the Petitboot UI, since it matches how menu entries are sorted in GRUB2 config and the GRUB2 UI. But in the Petitboot's UI, the latest entry is expected to be at the bottom and the older one at the top. Sort the BLS entries to match what's expected. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> --- Changes in v2: None discover/grub2/blscfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)