Bug 28073

Summary: Render rEFInd more in Mageia color
Product: Mageia Reporter: papoteur <yvesbrungard>
Component: RPM PackagesAssignee: Martin Whitaker <mageia>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Normal CC: davidwhodgins, mageia, maurice77, ouaurelien, tmb
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: refind-0.12.0-1.mga8.src.rpm CVE:
Status comment:

Description papoteur 2021-01-12 21:54:03 CET
rEFInd comes with default look, not specific to Mageia.
We can at least have the Mageia's background.
This can be do:
- adding the image background in /boot/EFI/EFI/Boot/
- in /boot/EFI/EFI/Boot/refind.conf, add
 banner <image.name.png>
 banner_scale fillscreen 

It's all.
Comment 1 Thomas Backlund 2021-01-12 22:33:30 CET
Martin, this is something along the lines we briefly mailed about...

We could reuse mga-bg-res code for initial image matching

CC: (none) => mageia, tmb

Comment 2 Martin Whitaker 2021-01-12 23:54:17 CET
mga-bg-res appears to be broken on my M8 systems when run as root:

# /usr/libexec/mga-bg-res
mmap /dev/zero: Operation not permitted

# bash -x /usr/libexec/mga-bg-res
+ bgpath=/usr/share/mga/backgrounds
+ theme=Mageia-Default
++ readlink /usr/share/mga/backgrounds/default.png
+ curlink=/usr/share/mga/backgrounds/Mageia-Default-1600x1200.png
+ '[' -e /usr/sbin/monitor-edid -a -z '' ']'
++ exec /usr/sbin/monitor-edid
++ grep -m 1 ModeLine
mmap /dev/zero: Operation not permitted
+ res=
++ expr '' : '.*"\(.*\)".*'
+ res=
+ '[' -z ']'
+ res=1600x1200
+ '[' /usr/share/mga/backgrounds/Mageia-Default-1600x1200.png = /usr/share/mga/backgrounds/Mageia-Default-1600x1200.png ']'
+ exit 0

(which as it is automatically run by mga-bg-res.service, is a bad thing)
Comment 3 Thomas Backlund 2021-01-13 00:07:49 CET
ah, of course...
the mmap issue comes from kernel security hardening with STRICT_DEVMEM

if one boots with iommu=relaxed it would probably still work...
Comment 4 Thomas Backlund 2021-01-13 00:08:58 CET
that would be iomem=relaxed ...
Comment 5 Thomas Backlund 2021-01-13 13:18:41 CET
one quick fix first step could be to simply default the background color to something that matches the Mageia theme and then as a second step later on figure out how to do the resolution mapping later.

or we set the full hd image as default and use theme scaling/stretching, but that could get ugly on ultrawide screens...
Comment 6 Martin Whitaker 2021-01-13 14:12:51 CET
I am more comfortable with changing the default colour scheme than with using the Mageia background. rEFInd, by its nature, is not tied to any one OS installation, which is why I've avoided any branding and take care not to reinstall or upgrade what's in the ESP unless the user explicitly enables that.

There's also the issue that some people (me!) set their monitors up to use 1:1 pixel mapping, so the resolution/aspect ratio they need is the resolution/aspect ratio of the EFI frame buffer, not of the monitor.

For Mageia 9 I could look at adding an option in drakboot for the user to select a different background image, with the Mageia background available as a default option.
Comment 7 Aurelien Oudelet 2021-01-13 14:53:23 CET
Thanks all for your advices.
Assigned this correctly to Martin, package maintainer.

CC: (none) => ouaurelien
Source RPM: (none) => refind-0.12.0-1.mga8.src.rpm
Assignee: bugsquad => mageia

Comment 8 Thomas Backlund 2021-01-13 14:54:06 CET
(In reply to Martin Whitaker from comment #6)
> I am more comfortable with changing the default colour scheme than with
> using the Mageia background. rEFInd, by its nature, is not tied to any one
> OS installation, which is why I've avoided any branding and take care not to
> reinstall or upgrade what's in the ESP unless the user explicitly enables
> that.
> 

Yeah, lets start there for now.
We can figure out the rest for Mageia 9.
Comment 9 Martin Whitaker 2021-01-13 19:17:23 CET
Try refind-0.12.0-2.mga8. If you already have refind installed, you'll need to run refind-install to update the files in the ESP, then copy the banner line from refind.conf-sample to your existing refind.conf.

The background colour is the official Mageia dark blue. I had to change the Mageia icon to be a white cauldron to stop it vanishing.
Comment 10 Thomas Backlund 2021-01-13 19:40:27 CET
Nice,

that color scheme is better and is way nicer to the eyes... :)

I wonder if one could/should replace the refind logo with the Mageia one (or atleast add it in configs so users simply can un-comment it) for easy "branding"
Comment 11 papoteur 2021-01-13 22:56:03 CET
@ Martin
I will try it.
@ TMB
This is the banner itself, and void around it is filled with the color of the top left pixel. It merits a try.
Comment 12 papoteur 2021-01-16 18:34:24 CET
(In reply to Martin Whitaker from comment #9)
> Try refind-0.12.0-2.mga8. If you already have refind installed, you'll need
> to run refind-install to update the files in the ESP, then copy the banner
> line from refind.conf-sample to your existing refind.conf.
> 
> The background colour is the official Mageia dark blue. I had to change the
> Mageia icon to be a white cauldron to stop it vanishing.

Hi Martin,
I don't see any configuration for banner in /boot/EFI/EFI/Boot/refind.conf-sample.
What do you mean with the banner line?
Comment 13 Thomas Backlund 2021-01-16 18:41:54 CET
it's in boot:

 l -1 /boot/EFI/EFI/refind/refind.conf*
/boot/EFI/EFI/refind/refind.conf*
/boot/EFI/EFI/refind/refind.conf-sample*

if you diff conf and conf-sample you see the difference
Comment 14 Dave Hodgins 2021-01-16 19:11:47 CET
Replied to the bug report by mistake, to the dev ml with ...
On my system, line 95 of /boot/EFI/EFI/Boot/refind.conf is now
banner icons/dark-blue-banner.png
 
And it's working. Much easier on the eyes when turning on the system in a dark
room.

CC: (none) => davidwhodgins

Comment 15 Maurice Batey 2021-01-16 19:52:00 CET
(In reply to Dave Hodgins from comment #14)

> On my system, line 95 of /boot/EFI/EFI/Boot/refind.conf is now
> banner icons/dark-blue-banner.png

Isn't there a danger that a subsequent update of rEFInd will 'lose' your personal .png file?

Unless rEFInd's policy has changed since I set it up here, one needs to hide such a .png file in a personal subdirectory as defined in refind.conf by e.g.:

    icons_dir myicons

CC: (none) => maurice

Comment 16 Dave Hodgins 2021-01-16 20:43:54 CET
No. The refind rpm package does not contain any /boot files. They are
copied to /boot only when the command refind-install is run.

According to the man page, the .conf file is only created if one does not
already exist.
Comment 17 Dave Hodgins 2021-01-16 20:44:44 CET
Closing as fixed.

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 18 Thomas Backlund 2021-01-16 20:46:51 CET
question in comment 10 is not decided on yet:

I wonder if one could/should replace the refind logo with the Mageia one (or atleast add it in configs so users simply can un-comment it) for easy "branding"

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 19 papoteur 2021-01-16 22:11:51 CET
The logo which can be added could be:
https://wiki.mageia.org/en/File:Logo_mageia_official_dark.png
I tried the 320px, it's a little small.
I don't know if this logo is already packaged.

Status: REOPENED => NEW

Comment 20 Martin Whitaker 2021-01-16 22:53:17 CET
I am against branding. We don't make any significant changes to rEFInd, so why should we claim it as our own?

As I've mentioned before, rEFInd is specifically designed to be an independent boot manager, not tied to any one OS. The Mageia refind package is just a convenient way to install it; it works just the same if you install it from a different OS.

You anyway get a Mageia cauldron in the boot menu, and get full Mageia branding when you choose to boot Mageia.
Comment 21 Martin Whitaker 2021-01-16 23:25:30 CET
(In reply to Maurice Batey from comment #15)
> (In reply to Dave Hodgins from comment #14)
> 
> > On my system, line 95 of /boot/EFI/EFI/Boot/refind.conf is now
> > banner icons/dark-blue-banner.png
> 
> Isn't there a danger that a subsequent update of rEFInd will 'lose' your
> personal .png file?

This is the .png file now provided as part of the Mageia refind package, so if you update using the Mageia package, then no. But yes, if you update from another source (although it won't be permanently lost, just moved to the icons-backup directory).

I admit I took a shortcut here to avoid changing the refind_install script this close to Mageia 8 release - I intend to improve it for Mageia 9.
Comment 22 Thomas Backlund 2021-01-17 00:05:44 CET
(In reply to Martin Whitaker from comment #20)
> I am against branding. We don't make any significant changes to rEFInd, so
> why should we claim it as our own?
> 


It's not about "claim it as our own"...


It's about making it easier for endusers to switch to a theming that matches from start to end...

And many users wants to show of their favorite distro logo everywhere :)

But I dont care that much as the switched background color mkes it way better than before anyhow....

so close this if you want...
Comment 23 papoteur 2021-01-17 12:31:06 CET
(In reply to Martin Whitaker from comment #6)
> 
> For Mageia 9 I could look at adding an option in drakboot for the user to
> select a different background image, with the Mageia background available as
> a default option.

We can leeave the report opened for that.
Comment 24 Martin Whitaker 2021-01-17 13:36:46 CET
Indeed, I am happy to make it easy for users to theme it the way they want, but can't do that yet because we are in strings freeze.
Comment 25 Maurice Batey 2021-01-17 18:02:11 CET
(In reply to Maurice Batey from comment #15)

> Unless rEFInd's policy has changed since I set it up here, one needs to hide
> such a .png file in a personal subdirectory as defined in refind.conf by
> e.g.:
> 
>     icons_dir myicons

Actually, I have 3 .png files in that subdirectory, which will all  appear on my 
rEFInd boot menu:

      os_mageia61.png  os_mageia7.png  os_mageia8.png

   [The images are of Gimp-modified Mageia-like icons - see example in Dropbox below.]

 - but of course some extra linkage is needed to get them to correspond to the related installs and boot the right one when selected.

  The extra linkage is provided via the above sub-strings "mageia61", 
"mageia7", and "mageia8" by an automatic look-up in the /boot directory of Linux 
installs discovered by rEFInd for a *partition label* beginning with one of 
those sub strings, and if found that install is then booted.

Example: My Mageia-7 install has a partition label "Mageia7-root", so if the 
Mageia7 icon on the boot menu is clicked the system boots Mageia7.

   N.B. I don't use any Linux .efi boot files, or GRUB at all.

Here is a pic of my current rEFInd boot menu:

    https://www.dropbox.com/s/g71qzxt6h89vhes/mab-refind-menu.JPG?dl=0

and this is my refind.conf file:

    timeout 20
    dont_scan_dirs EFI/tmp EFI/mageia
    showtools memtest reboot shutdown gdisk about
    default_selection 1
    icons_dir myicons

Been happily using this system for years...
Comment 26 Martin Whitaker 2022-10-23 19:50:31 CEST
drakboot and the installer now allow the user to choose between

  - the default rEFInd banner dark blue background
  - the default Mageia background
  - a custom image file (manually installed somewhere in the ESP)

So closing as fixed.

Status: NEW => RESOLVED
Resolution: (none) => FIXED