All of lore.kernel.org
 help / color / mirror / Atom feed
* Random selections and changing splash screen
@ 2009-01-28 13:01 Antóin Óg Ó Cuinneagáin
  2009-01-28 15:09 ` Colin D Bennett
  0 siblings, 1 reply; 4+ messages in thread
From: Antóin Óg Ó Cuinneagáin @ 2009-01-28 13:01 UTC (permalink / raw)
  To: grub-devel

Hi my name is Anthony Cunningham and I have recently joined this list.

I'd had some ideas for features for Grub and the wiki mentions putting
them on this list in case they exist, or others may be working on
something similar.

One idea is that after the timeout a random entry is chosen from the
boot menu, instead of default.  The use case I had in mind would be
where multiple distributions are installed and the user would let a
random one boot as an incentive to learn to work with that
distributions package manager, destop environment etc.
the entry could be like :
random  //any random entry
random (4,5,8)  //random of 4, 5 or 8
random not (3,5,9) //random , except these..for not choosing windows
or rescue partitions etc.

Also another feature I thought of (when may exist) is a per entry
splashscreen setting, and moving up and down with the arrow keys would
change the background splashscreen.
I think this would be a nice feature to show OS specific splashscreens
Windows, Red Hat, FreeBSD etc.


Anthony



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

* Re: Random selections and changing splash screen
  2009-01-28 13:01 Random selections and changing splash screen Antóin Óg Ó Cuinneagáin
@ 2009-01-28 15:09 ` Colin D Bennett
  2009-01-28 16:39   ` Pavel Roskin
  2009-02-07 22:05   ` Robert Millan
  0 siblings, 2 replies; 4+ messages in thread
From: Colin D Bennett @ 2009-01-28 15:09 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: anthony.cunningham

[-- Attachment #1: Type: text/plain, Size: 3829 bytes --]

On Wed, 28 Jan 2009 13:01:52 +0000
Antóin Óg Ó Cuinneagáin <anthony.cunningham@gmail.com> wrote:

> Hi my name is Anthony Cunningham and I have recently joined this list.
> 
> I'd had some ideas for features for Grub and the wiki mentions putting
> them on this list in case they exist, or others may be working on
> something similar.
> 
> One idea is that after the timeout a random entry is chosen from the
> boot menu, instead of default.  The use case I had in mind would be
> where multiple distributions are installed and the user would let a
> random one boot as an incentive to learn to work with that
> distributions package manager, destop environment etc.
> the entry could be like :
> random  //any random entry
> random (4,5,8)  //random of 4, 5 or 8
> random not (3,5,9) //random , except these..for not choosing windows
> or rescue partitions etc.

Hi Anthony,

That's an interesting idea.  It wouldn't be too hard to implement, I'm
sure.  Another implementation that might be cleaner than specifying the
indices of the items to select from would be to use the 'class'
attribute of menu items which has recently been added.

The 'class' attribute works similarly to the way the HTML/CSS class
attribute functions:  Each menu entry has a set of zero or more classes
(which are simply character strings) which characterize the entry.  The
reason I added the 'class' attribute initially was to support showing
an icon for each menu entry, where the most appropriate icon is chosen
(i.e., if 'Ubuntu Linux 8.10' is an entry with classes { 'ubuntu',
'linux', 'os' }, then an icon called 'ubuntu.png' is first looked for,
then if that is not found, 'linux.png' is searched for, etc.).

We could use the 'class' attribute to identify which items you want to
randomly select from.  For instance, suppose you want to choose a
random entry from all the free operating systems installed.  Then you
could add a class 'free-os' to the classes for each Linux, BSD, and
other free OS menu entry.  The 'random boot' command could then be
specified as:
  random   // Any random entry
  random --class=free-os    // Any free operating system
  random --class=linux --exclude-class=rescue
  // ^ Any Linux distribution, but not rescue entries.

I really try to avoid using indices to refer to entries in the grub.cfg
since that makes it brittle to change (if you add/move/delete an entry,
some of your index references may need to be changed, and it's up to
you to figure out which ones).

> Also another feature I thought of (when may exist) is a per entry
> splashscreen setting, and moving up and down with the arrow keys would
> change the background splashscreen.
> I think this would be a nice feature to show OS specific splashscreens
> Windows, Red Hat, FreeBSD etc.
> 
> Anthony

By the 'splashscreen', do you mean the background image behind the GRUB
menu?  So, as you press the arrow keys up and down on the GRUB menu to
select an entry to boot, the background image is changing depending on
the highlighted menu entry?

This is definitely possible, and it could be done on a theme-by-theme
basis (this would be, IMO, a great place to use Lua scripting in
the theme[1]). If the background-switching feature really seems useful,
I can take a look at adding it to my gfxmenu branch sometime, which is
in the final stages of preparation for merging into mainline GRUB.

Regards,
Colin

[1] Lua support is *not* currently planned for inclusion into GRUB, but
    I did do a very successful 'spike' experiment which allows themes to
    include Lua code that can use the GRUB graphics API.  I'd still
    like to continue down the path of adding Lua support at some point,
    because I think the value is high and the effort required is low.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: Random selections and changing splash screen
  2009-01-28 15:09 ` Colin D Bennett
@ 2009-01-28 16:39   ` Pavel Roskin
  2009-02-07 22:05   ` Robert Millan
  1 sibling, 0 replies; 4+ messages in thread
From: Pavel Roskin @ 2009-01-28 16:39 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: anthony.cunningham

On Wed, 2009-01-28 at 07:09 -0800, Colin D Bennett wrote:

> I really try to avoid using indices to refer to entries in the grub.cfg
> since that makes it brittle to change (if you add/move/delete an entry,
> some of your index references may need to be changed, and it's up to
> you to figure out which ones).

I believe "random" would be a useless feature.  An absolute majority of
users want their systems to be predictable.  Maybe desktop themes can
change randomly, but changing the OS randomly could be a big annoyance.

It's not a coincidence that random number generators are mostly used by
security applications to foil external attacks.  Using randomness in the
bootloader would be akin to treating the user as an enemy.

If any computer vendors want that, they have enough resources to
implement it themselves.  And then they will be blamed, no matter how
well they do it.

> > Also another feature I thought of (when may exist) is a per entry
> > splashscreen setting, and moving up and down with the arrow keys would
> > change the background splashscreen.
> > I think this would be a nice feature to show OS specific splashscreens
> > Windows, Red Hat, FreeBSD etc.
> > 
> > Anthony
> 
> By the 'splashscreen', do you mean the background image behind the GRUB
> menu?  So, as you press the arrow keys up and down on the GRUB menu to
> select an entry to boot, the background image is changing depending on
> the highlighted menu entry?
> 
> This is definitely possible, and it could be done on a theme-by-theme
> basis (this would be, IMO, a great place to use Lua scripting in
> the theme[1]). If the background-switching feature really seems useful,
> I can take a look at adding it to my gfxmenu branch sometime, which is
> in the final stages of preparation for merging into mainline GRUB.

For greater flexibility, we could support images that don't occupy the
whole screen, but rather display on top of the main background.  We
could have images for active and inactive entries.  This way, for
example, memtest86 could show its logo instead of the text, and if it's
selected, the logo would become brighter.  The image for the active
entry should be shown on top, in case it overlaps with other entries.

Disclaimer: I'm not an expert in such things and I'm not going to code
it.

-- 
Regards,
Pavel Roskin



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

* Re: Random selections and changing splash screen
  2009-01-28 15:09 ` Colin D Bennett
  2009-01-28 16:39   ` Pavel Roskin
@ 2009-02-07 22:05   ` Robert Millan
  1 sibling, 0 replies; 4+ messages in thread
From: Robert Millan @ 2009-02-07 22:05 UTC (permalink / raw)
  To: The development of GRUB 2; +Cc: anthony.cunningham

On Wed, Jan 28, 2009 at 07:09:05AM -0800, Colin D Bennett wrote:
>   random   // Any random entry
>   random --class=free-os    // Any free operating system
>   random --class=linux --exclude-class=rescue
>   // ^ Any Linux distribution, but not rescue entries.

This looks very ad-hoc.  Is it possible we could just provide a facility to
obtain entropy (e.g. random --min 0 --max 3) and let scripting do the rest?

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



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

end of thread, other threads:[~2009-02-07 22:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-28 13:01 Random selections and changing splash screen Antóin Óg Ó Cuinneagáin
2009-01-28 15:09 ` Colin D Bennett
2009-01-28 16:39   ` Pavel Roskin
2009-02-07 22:05   ` Robert Millan

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.