Skip to contentSkip to conversation

Random selections and changing splash screen

DISCUSSION Antóin Óg Ó Cuinneagáin 4 participants 4 messages Jan 28, 2009 – Feb 7, 2009

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 6 lines · On Wed, 28 Jan 2009 13:01:52 +0000 Antóin Óg Ó Cuinneagáin…

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.

Quoted 10 lines

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).

Quoted 7 lines

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.

#2 lore raw
Quoted 4 lines · Colin D Bennett

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.

Quoted 13 lines
Quoted 7 lines

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?

Quoted 5 lines

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.

Signature · 2 lines
Regards,
Pavel Roskin
#3 lore raw
In reply to Colin D Bennett
Quoted 4 lines · Colin D Bennett

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?

Signature · 5 lines
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."