From 045ebb3e58d74c75f39ce47380045d3cd00359c3 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 23 Aug 2017 21:48:58 +0200 Subject: gnu: bootloader: Deprecate "device" field in favor of "target". * gnu/bootloader.scm (): Deprecate "device" field in favor of "target" field. This is mostly a renaming but also a generalization to support UEFI targets being paths to a mounted partition instead of a device name. * gnu/system/examples/bare-bones.tmpl: * gnu/system/examples/desktop.tmpl: * gnu/system/examples/lightweight-desktop.tmpl: * gnu/system/examples/vm-image.tmpl: * gnu/system/install.scm: * gnu/tests.scm: * gnu/tests/install.scm: * gnu/tests/nfs.scm: * tests/system.scm: Adapt all invocations of bootloader-configuration. * guix/scripts/system.scm (perform-action): Rename device argument to bootloader-target. (process-action): Adapt caller. * doc/guix.texi (Proceeding with the Installation): * doc/guix.texi (Bootloader Configuration): Update documentation. --- gnu/bootloader.scm | 13 ++++++++++++- gnu/system/examples/bare-bones.tmpl | 2 +- gnu/system/examples/desktop.tmpl | 2 +- gnu/system/examples/lightweight-desktop.tmpl | 2 +- gnu/system/examples/vm-image.tmpl | 2 +- gnu/system/install.scm | 3 +-- gnu/tests.scm | 2 +- gnu/tests/install.scm | 14 +++++++------- gnu/tests/nfs.scm | 2 +- 9 files changed, 26 insertions(+), 16 deletions(-) (limited to 'gnu') diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index e080b04568..122e350874 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -43,7 +43,7 @@ (define-module (gnu bootloader) bootloader-configuration bootloader-configuration? bootloader-configuration-bootloader - bootloader-configuration-device + bootloader-configuration-target bootloader-configuration-menu-entries bootloader-configuration-default-entry bootloader-configuration-timeout @@ -107,6 +107,8 @@ (define-record-type* (bootloader bootloader-configuration-bootloader) ; (device bootloader-configuration-device ; string (default #f)) + (target %bootloader-configuration-target ; string + (default #f)) (menu-entries bootloader-configuration-menu-entries ; list of (default '())) (default-entry bootloader-configuration-default-entry ; integer @@ -126,6 +128,15 @@ (define-record-type* (additional-configuration bootloader-configuration-additional-configuration ; record (default #f))) +(define (bootloader-configuration-target config) + (or (%bootloader-configuration-target config) + (let ((device (bootloader-configuration-device config))) + (when device + (issue-deprecation-warning + "The 'device' field of bootloader configurations is deprecated." + "Use 'target' instead.")) + device))) + ;;; ;;; Bootloaders. diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl index a10ee6e7fe..459d241885 100644 --- a/gnu/system/examples/bare-bones.tmpl +++ b/gnu/system/examples/bare-bones.tmpl @@ -14,7 +14,7 @@ ;; the label of the target root file system. (bootloader (bootloader-configuration (bootloader grub-bootloader) - (device "/dev/sdX"))) + (target "/dev/sdX"))) (file-systems (cons (file-system (device "my-root") (title 'label) diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl index 3cfbd9add6..2131d1f18f 100644 --- a/gnu/system/examples/desktop.tmpl +++ b/gnu/system/examples/desktop.tmpl @@ -15,7 +15,7 @@ ;; is the label of the target root file system. (bootloader (bootloader-configuration (bootloader grub-bootloader) - (device "/dev/sdX"))) + (target "/dev/sdX"))) ;; Specify a mapped device for the encrypted root partition. ;; The UUID is that returned by 'cryptsetup luksUUID'. diff --git a/gnu/system/examples/lightweight-desktop.tmpl b/gnu/system/examples/lightweight-desktop.tmpl index 127ceb4dc5..fb7cfebf6d 100644 --- a/gnu/system/examples/lightweight-desktop.tmpl +++ b/gnu/system/examples/lightweight-desktop.tmpl @@ -15,7 +15,7 @@ ;; Partition mounted on /boot/efi. (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) - (device "/boot/efi"))) + (target "/boot/efi"))) ;; Assume the target root file system is labelled "my-root". (file-systems (cons* (file-system diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl index 57ac71c535..056b439c5f 100644 --- a/gnu/system/examples/vm-image.tmpl +++ b/gnu/system/examples/vm-image.tmpl @@ -26,7 +26,7 @@ partprobe, and then 2) resizing the filesystem with resize2fs.\n")) ;; Assuming /dev/sdX is the target hard disk, and "my-root" is ;; the label of the target root file system. - (bootloader (grub-configuration (device "/dev/sda") + (bootloader (grub-configuration (target "/dev/sda") (terminal-outputs '(console)))) (file-systems (cons (file-system (device "my-root") diff --git a/gnu/system/install.scm b/gnu/system/install.scm index 6837385daf..7f6ffe9582 100644 --- a/gnu/system/install.scm +++ b/gnu/system/install.scm @@ -299,8 +299,7 @@ (define installation-os (host-name "gnu") (timezone "Europe/Paris") (locale "en_US.utf8") - (bootloader (grub-configuration - (device "/dev/sda"))) + (bootloader (grub-configuration (target "/dev/sda"))) (file-systems ;; Note: the disk image build code overrides this root file system with ;; the appropriate one. diff --git a/gnu/tests.scm b/gnu/tests.scm index 2886a982f4..97b9cc5107 100644 --- a/gnu/tests.scm +++ b/gnu/tests.scm @@ -206,7 +206,7 @@ (define %simple-os (timezone "Europe/Berlin") (locale "en_US.UTF-8") - (bootloader (grub-configuration (device "/dev/sdX"))) + (bootloader (grub-configuration (target "/dev/sdX"))) (file-systems (cons (file-system (device "my-root") (title 'label) diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 22e4181ab1..866bf885ce 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -59,7 +59,7 @@ (define-os-with-source (%minimal-os %minimal-os-source) (timezone "Europe/Paris") (locale "en_US.UTF-8") - (bootloader (grub-configuration (device "/dev/vdb"))) + (bootloader (grub-configuration (target "/dev/vdb"))) (kernel-arguments '("console=ttyS0")) (file-systems (cons (file-system (device "my-root") @@ -98,7 +98,7 @@ (define-os-with-source (%minimal-extlinux-os (bootloader (bootloader-configuration (bootloader extlinux-bootloader-gpt) - (device "/dev/vdb"))) + (target "/dev/vdb"))) (kernel-arguments '("console=ttyS0")) (file-systems (cons (file-system (device "my-root") @@ -326,7 +326,7 @@ (define-os-with-source (%separate-home-os %separate-home-os-source) (timezone "Europe/Paris") (locale "en_US.utf8") - (bootloader (grub-configuration (device "/dev/vdb"))) + (bootloader (grub-configuration (target "/dev/vdb"))) (kernel-arguments '("console=ttyS0")) (file-systems (cons* (file-system (device "my-root") @@ -384,7 +384,7 @@ (define-os-with-source (%separate-store-os %separate-store-os-source) (timezone "Europe/Paris") (locale "en_US.UTF-8") - (bootloader (grub-configuration (device "/dev/vdb"))) + (bootloader (grub-configuration (target "/dev/vdb"))) (kernel-arguments '("console=ttyS0")) (file-systems (cons* (file-system (device "root-fs") @@ -460,7 +460,7 @@ (define-os-with-source (%raid-root-os %raid-root-os-source) (timezone "Europe/Paris") (locale "en_US.utf8") - (bootloader (grub-configuration (device "/dev/vdb"))) + (bootloader (grub-configuration (target "/dev/vdb"))) (kernel-arguments '("console=ttyS0")) (initrd (lambda (file-systems . rest) ;; Add a kernel module for RAID-0 (aka. "stripe"). @@ -543,7 +543,7 @@ (define-os-with-source (%encrypted-root-os %encrypted-root-os-source) (timezone "Europe/Paris") (locale "en_US.UTF-8") - (bootloader (grub-configuration (device "/dev/vdb"))) + (bootloader (grub-configuration (target "/dev/vdb"))) ;; Note: Do not pass "console=ttyS0" so we can use our passphrase prompt ;; detection logic in 'enter-luks-passphrase'. @@ -670,7 +670,7 @@ (define-os-with-source (%btrfs-root-os %btrfs-root-os-source) (timezone "Europe/Paris") (locale "en_US.UTF-8") - (bootloader (grub-configuration (device "/dev/vdb"))) + (bootloader (grub-configuration (target "/dev/vdb"))) (kernel-arguments '("console=ttyS0")) (file-systems (cons (file-system (device "my-root") diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm index 2e666b2c08..889f578d01 100644 --- a/gnu/tests/nfs.scm +++ b/gnu/tests/nfs.scm @@ -41,7 +41,7 @@ (define %base-os (timezone "Europe/Berlin") (locale "en_US.UTF-8") - (bootloader (grub-configuration (device "/dev/sdX"))) + (bootloader (grub-configuration (target "/dev/sdX"))) (file-systems %base-file-systems) (users %base-user-accounts) (packages (cons* -- cgit v1.2.3