diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-10-01 17:10:49 -0400 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-10-01 17:10:49 -0400 |
commit | 2e65e4834a226c570866f2e8976ed7f252b45cd1 (patch) | |
tree | 21d625bce8d03627680214df4a6622bf8eb79dc9 /gnu/bootloader.scm | |
parent | 9c68ecb24dd1660ce736cdcdea0422a73ec318a2 (diff) | |
parent | f1a3c11407b52004e523ec5de20d326c5661681f (diff) |
Merge remote-tracking branch 'origin/master' into staging
With resolved conflicts in:
gnu/packages/bittorrent.scm
gnu/packages/databases.scm
gnu/packages/geo.scm
gnu/packages/gnupg.scm
gnu/packages/gstreamer.scm
gnu/packages/gtk.scm
gnu/packages/linux.scm
gnu/packages/python-xyz.scm
gnu/packages/xorg.scm
guix/build/qt-utils.scm
Diffstat (limited to 'gnu/bootloader.scm')
-rw-r--r-- | gnu/bootloader.scm | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 6d7352ddd2..d1c72c0c85 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2017 David Craven <david@craven.ch> ;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> -;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2019, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; ;;; This file is part of GNU Guix. @@ -25,7 +25,10 @@ #:use-module (guix gexp) #:use-module (guix profiles) #:use-module (guix records) - #:use-module (guix ui) + #:use-module (guix deprecation) + #:use-module ((guix ui) #:select (warn-about-load-error)) + #:use-module (guix diagnostics) + #:use-module (guix i18n) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (menu-entry @@ -55,7 +58,8 @@ bootloader-configuration bootloader-configuration? bootloader-configuration-bootloader - bootloader-configuration-target + bootloader-configuration-target ;deprecated + bootloader-configuration-targets bootloader-configuration-menu-entries bootloader-configuration-default-entry bootloader-configuration-timeout @@ -179,12 +183,17 @@ record." ;; The <bootloader-configuration> record contains bootloader independant ;; configuration used to fill bootloader configuration file. +(define-syntax-rule (warn-target-field-deprecation value) + (%warn-target-field-deprecation value (current-source-location))) + (define-record-type* <bootloader-configuration> bootloader-configuration make-bootloader-configuration bootloader-configuration? (bootloader bootloader-configuration-bootloader) ;<bootloader> - (target bootloader-configuration-target ;string + (targets %bootloader-configuration-targets ;list of strings (default #f)) + (target %bootloader-configuration-target ;deprecated + (default #f) (sanitize warn-target-field-deprecation)) (menu-entries bootloader-configuration-menu-entries ;list of <menu-entry> (default '())) (default-entry bootloader-configuration-default-entry ;integer @@ -204,6 +213,26 @@ record." (serial-speed bootloader-configuration-serial-speed ;integer | #f (default #f))) +(define (%warn-target-field-deprecation value location) + (when value + (warning (source-properties->location location) + (G_ "the 'target' field is deprecated, please use 'targets' \ +instead~%"))) + value) + +(define-deprecated (bootloader-configuration-target config) + bootloader-configuration-targets + (%bootloader-configuration-target config)) + +(define (bootloader-configuration-targets config) + (or (%bootloader-configuration-targets config) + ;; TODO: Remove after the deprecated 'target' field is removed. + (list (%bootloader-configuration-target config)) + ;; XXX: At least the GRUB installer (see (gnu bootloader grub)) has this + ;; peculiar behavior of installing fonts and GRUB modules when DEVICE is #f, + ;; hence the default value of '(#f) rather than '(). + (list #f))) + ;;; ;;; Bootloaders. |