diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-02-19 15:59:06 -0500 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-03-17 23:09:14 -0400 |
| commit | 6794653e1b0fce8981eb179b9d4cab4a0c5f926f (patch) | |
| tree | 57b6a176ae787c114ff6c6269e48587d065021b4 /gnu/bootloader | |
| parent | aaffde38b54c978e2425fa88eea733dc80f87444 (diff) | |
bootloader: grub: Refactor eye-candy a bit.
* gnu/bootloader/grub.scm (eye-candy)[setup-gfxterm-body]: Define the GFXMODE
binding using AND-LET* instead of chained AND=>. Add a comment about
supporting graphical mode on other systems than x86. Generate configuration
string using FORMAT rather than STRING-APPEND.
Diffstat (limited to 'gnu/bootloader')
| -rw-r--r-- | gnu/bootloader/grub.scm | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 36a964e8f5a..28e6cb1f5f2 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #:use-module (ice-9 match) | 36 | #:use-module (ice-9 match) |
| 37 | #:use-module (ice-9 regex) | 37 | #:use-module (ice-9 regex) |
| 38 | #:use-module (srfi srfi-1) | 38 | #:use-module (srfi srfi-1) |
| 39 | #:use-module (srfi srfi-2) | ||
| 39 | #:export (grub-image | 40 | #:export (grub-image |
| 40 | grub-image? | 41 | grub-image? |
| 41 | grub-image-aspect-ratio | 42 | grub-image-aspect-ratio |
| @@ -149,24 +150,26 @@ STORE-MOUNT-POINT is its mount point; these are used to determine where the | |||
| 149 | background image and fonts must be searched for. SYSTEM must be the target | 150 | background image and fonts must be searched for. SYSTEM must be the target |
| 150 | system string---e.g., \"x86_64-linux\"." | 151 | system string---e.g., \"x86_64-linux\"." |
| 151 | (define setup-gfxterm-body | 152 | (define setup-gfxterm-body |
| 152 | ;; Intel and EFI systems need to be switched into graphics mode, whereas | 153 | (let ((gfxmode |
| 153 | ;; most other modern architectures have no other mode and therefore don't | 154 | (or (and-let* ((theme (bootloader-configuration-theme config)) |
| 154 | ;; need to be switched. | 155 | (gfxmode (grub-gfxmode theme))) |
| 155 | (if (string-match "^(x86_64|i[3-6]86)-" system) | 156 | (string-join gfxmode ";")) |
| 156 | (string-append | 157 | "auto"))) |
| 157 | " | 158 | |
| 158 | " | 159 | ;; Intel and EFI systems need to be switched into graphics mode, whereas |
| 159 | (let ((gfxmode (and=> | 160 | ;; most other modern architectures have no other mode and therefore |
| 160 | (and=> config bootloader-configuration-theme) | 161 | ;; don't need to be switched. |
| 161 | grub-gfxmode))) | 162 | |
| 162 | (if gfxmode | 163 | ;; XXX: Do we really need to restrict to x86 systems? We could imitate |
| 163 | (string-append "set gfxmode=" (string-join gfxmode ";")) | 164 | ;; what the GRUB default configuration does and decide based on whether |
| 164 | "# Leave 'gfxmode' to 'auto'.")) | 165 | ;; a user provided 'gfxterm' in the terminal-outputs field of their |
| 165 | " | 166 | ;; bootloader-configuration record. |
| 167 | (if (string-match "^(x86_64|i[3-6]86)-" system) | ||
| 168 | (format #f " | ||
| 169 | set gfxmode=~a | ||
| 166 | insmod all_video | 170 | insmod all_video |
| 167 | insmod gfxterm | 171 | insmod gfxterm~%" gfxmode) |
| 168 | ") | 172 | ""))) |
| 169 | "")) | ||
| 170 | 173 | ||
| 171 | (define (setup-gfxterm config font-file) | 174 | (define (setup-gfxterm config font-file) |
| 172 | (if (memq 'gfxterm (bootloader-configuration-terminal-outputs config)) | 175 | (if (memq 'gfxterm (bootloader-configuration-terminal-outputs config)) |
