unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan <stefan-guix@vodafonemail.de>
To: "Ludovic Courtès" <ludo@gnu.org>,
	"Danny Milosavljevic" <dannym@scratchpost.org>,
	45225@debbugs.gnu.org
Subject: [bug#45225] [PATCH] gnu: grub: Use installed unicode font, fix loading when booting over TFTP.
Date: Mon, 28 Dec 2020 12:24:16 +0100	[thread overview]
Message-ID: <B4C7682B-58CF-4B67-A086-C0E8190AB779@vodafonemail.de> (raw)
In-Reply-To: <877dpa2c6t.fsf@gnu.org>

* gnu/bootloader/grub.scm (setup-gfxterm): Removed parameter font-file.
Refer to the installed font, not into the store.
(font-file): Removed obsolete function.
(install-grub): When populating a disk-image, install the unicode font, too.
---
 gnu/bootloader/grub.scm | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 29c81ae641..13ee695909 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -168,15 +168,14 @@ STORE-DEVICE designates the device holding the store, and STORE-MOUNT-POINT is
  its mount point; these are used to determine where the background image and
  fonts must be searched for.  STORE-DIRECTORY-PREFIX is a directory prefix to
  prepend to any store file name."
-  (define (setup-gfxterm config font-file)
+  (define (setup-gfxterm config)
      (if (memq 'gfxterm (bootloader-configuration-terminal-outputs config))
          #~(format #f "
-if loadfont ~a; then
+if loadfont unicode; then
    set gfxmode=~a
    insmod all_video
    insmod gfxterm
  fi~%"
-                  #+font-file
                    #$(string-join
                       (grub-theme-gfxmode (bootloader-theme config))
                       ";"))
@@ -188,13 +187,6 @@ fi~%"
        (string-append (symbol->string (assoc-ref colors 'fg)) "/"
                       (symbol->string (assoc-ref colors 'bg)))))
  
-  (define font-file
-    (let* ((bootloader (bootloader-configuration-bootloader config))
-           (grub (bootloader-package bootloader)))
-      (normalize-file (file-append grub "/share/grub/unicode.pf2")
-                      store-mount-point
-                      store-directory-prefix)))
-
    (define image
      (normalize-file (grub-background-image config)
                      store-mount-point
@@ -216,8 +208,8 @@ else
    set menu_color_normal=cyan/blue
    set menu_color_highlight=white/blue
  fi~%"
-                 #$(grub-root-search store-device font-file)
-                 #$(setup-gfxterm config font-file)
+                 #$(grub-root-search store-device image)
+                 #$(setup-gfxterm config)
                   #$(grub-setup-io config)
  
                   #$image
@@ -545,9 +537,13 @@ fi~%"))))
                (invoke/quiet grub "--no-floppy" "--target=i386-pc"
                              "--boot-directory" install-dir
                              device))
-            ;; When creating a disk-image, only install GRUB modules.
-            (copy-recursively (string-append bootloader "/lib/")
-                              install-dir)))))
+            ;; When creating a disk-image, only install a font and GRUB modules.
+            (let* ((fonts (string-append install-dir "/grub/fonts")))
+              (mkdir-p fonts)
+              (copy-file (string-append bootloader "/share/grub/unicode.pf2")
+                         (string-append fonts "/unicode.pf2"))
+              (copy-recursively (string-append bootloader "/lib/")
+                                install-dir))))))
  
  (define install-grub-disk-image
    #~(lambda (bootloader root-index image)
-- 
2.29.2





  parent reply	other threads:[~2020-12-28 11:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-13 17:25 [bug#45225] [PATCH] gnu: grub: Fix unicode font loading when booting over TFTP Stefan
2020-12-14 22:35 ` bug#45225: " Danny Milosavljevic
2020-12-19 20:29 ` [bug#45225] " Stefan
2020-12-21 14:50   ` Ludovic Courtès
2020-12-21 17:03     ` Stefan
2020-12-22 13:38       ` Ludovic Courtès
2020-12-22 15:21         ` Stefan
2021-01-17 15:51           ` Danny Milosavljevic
2021-01-17 15:57             ` Stefan
2020-12-28 11:24         ` Stefan [this message]
2021-01-07 16:37           ` [bug#45225] [PATCH] gnu: grub: Use installed unicode font, fix " Stefan
2021-01-17 14:13             ` Stefan

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=B4C7682B-58CF-4B67-A086-C0E8190AB779@vodafonemail.de \
    --to=stefan-guix@vodafonemail.de \
    --cc=45225@debbugs.gnu.org \
    --cc=dannym@scratchpost.org \
    --cc=ludo@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).