All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robbie Harwood <rharwood@redhat.com>
To: Zhang Boyang <zhangboyang.id@gmail.com>, grub-devel@gnu.org
Subject: Re: Fonts and theming and what to do in future with SB
Date: Wed, 30 Nov 2022 11:08:14 -0500	[thread overview]
Message-ID: <jlgzgc84e8h.fsf@redhat.com> (raw)
In-Reply-To: <51a85758-8d47-6287-7a8e-bc6f82a1f770@gmail.com>

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

Zhang Boyang <zhangboyang.id@gmail.com> writes:

> On 2022/11/30 02:35, Steve McIntyre wrote:
>
>> AFAIK Chris Coulson has a patch for the font loader to cause it to try
>> loading fonts from the embedded memdisk first. Is that the best
>> approach? If so, what fonts should we be embedding in the signed
>> image? It's a tradeoff between size and functionality, of course -
>> some people are happy with just "unicode" while others may want a
>> wider choice for added theming options. Is the size an issue for most
>> people?
>
> Personally I prefer to embed Unifont to GRUB. This can be done by 
> memdisk, or embed as code directly (like ASCII chars). For Unifont, this 
> will make GRUB about 2.5MB (+150%) fatter. This is sufficient for vast 
> majority of GRUB usecases.

My testing with Chris's patch and approach for unicode.pf2 (in Fedora)
adds just under a megabyte - presumably this is due to benefits from
xz-compressing it, minus overhead to add the modules required for
support to our builds.

Is your suggestion that we should officially remove support for other
fonts, then?

> It's also possible to embed only hashes of font files into GRUB
> (although not implemented yet). Therefore, distros can pre-generate a
> series of fonts files and add their hashes to GRUB bundle. End-users
> can choose their font in the pre-defined list from distros.

As you say, someone would have to implement this first :)  And if we were
to go this route, I think we'd want to do the same for background
images.

> For those who want to use fonts which not in the pre-defined list. The 
> last option would be disable secureboot or use MOK to sign their own 
> GRUB bundle.

"Disable secureboot in order to do this" is not a position I ever want
to take.  In a forced tradeoff between features and security, some users
will opt for features.  (And it's easier to just disable secureboot than
roll out one's own signing, unfortunately.)  So my preference is to keep
feature parity between SB and non-SB, even if that means dropping
customizability.

>> Or... Could/should we look at options to sign fonts separately? I've
>> heard suggestions to embed them into faked-up modules that we could
>> load with insmod, but of course we don't support signing modules yet
>> anyway... :-)
>
> It seems "shim" can process PE files only, so it's hard to implement 
> signature checking for other files (modules, fonts, etc.). A tradeoff 
> solution is to wrap PF2 font into a PE file, so they can be processed by 
> shim. A better solution would be add more functionality to "shim" to 
> allow it process more types of files.

I don't agree with making shim more complicated.

Be well,
--Robbie

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

  reply	other threads:[~2022-11-30 16:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 18:35 Fonts and theming and what to do in future with SB Steve McIntyre
2022-11-29 20:24 ` Robbie Harwood
2022-11-30  6:00   ` Michael Chang
2022-11-30 10:37 ` Zhang Boyang
2022-11-30 16:08   ` Robbie Harwood [this message]
2022-12-01  8:30     ` Zhang Boyang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jlgzgc84e8h.fsf@redhat.com \
    --to=rharwood@redhat.com \
    --cc=grub-devel@gnu.org \
    --cc=zhangboyang.id@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.