summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/guix.texi26
-rw-r--r--gnu/bootloader.scm13
-rw-r--r--gnu/system/examples/bare-bones.tmpl2
-rw-r--r--gnu/system/examples/desktop.tmpl2
-rw-r--r--gnu/system/examples/lightweight-desktop.tmpl2
-rw-r--r--gnu/system/examples/vm-image.tmpl2
-rw-r--r--gnu/system/install.scm3
-rw-r--r--gnu/tests.scm2
-rw-r--r--gnu/tests/install.scm14
-rw-r--r--gnu/tests/nfs.scm2
-rw-r--r--guix/scripts/system.scm23
-rw-r--r--tests/system.scm4
12 files changed, 57 insertions, 38 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 77435d897b0..954ff90ff7b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -7964,9 +7964,13 @@ in particular:
7964 7964
7965@itemize 7965@itemize
7966@item 7966@item
7967Make sure the @code{grub-configuration} form refers to the device you 7967Make sure the @code{grub-configuration} form refers to the target you
7968want to install GRUB on. You also need to specify the @code{grub-efi} 7968want to install GRUB on. It should mention @code{grub-bootloader} if
7969package if you wish to use native UEFI boot. 7969you are installing GRUB in the legacy way, or @code{grub-efi-bootloader}
7970for newer UEFI systems. For legacy systems, the @code{target} field
7971names a device, like @code{/dev/sda}; for UEFI systems it names a path
7972to a mounted EFI partition, like @code{/boot/efi}, and do make sure the
7973path is actually mounted.
7970 7974
7971@item 7975@item
7972Be sure that your partition labels match the value of their respective 7976Be sure that your partition labels match the value of their respective
@@ -17192,11 +17196,15 @@ The bootloader to use, as a @code{bootloader} object. For now
17192Available bootloaders are described in @code{(gnu bootloader @dots{})} 17196Available bootloaders are described in @code{(gnu bootloader @dots{})}
17193modules. 17197modules.
17194 17198
17195@item @code{device} 17199@item @code{target}
17196This is a string denoting the boot device. It must be a device name 17200This is a string denoting the target onto which to install the
17197understood by the bootloader @command{installer} command, such as 17201bootloader. The exact interpretation depends on the bootloader in
17198@code{/dev/sda} or @code{(hd0)} (for GRUB, @pxref{Invoking grub-install,,, grub, 17202question; for @code{grub-bootloader}, for example, it should be a device
17199GNU GRUB Manual}). 17203name understood by the bootloader @command{installer} command, such as
17204@code{/dev/sda} or @code{(hd0)} (for GRUB, @pxref{Invoking
17205grub-install,,, grub, GNU GRUB Manual}). For
17206@code{grub-efi-bootloader}, it should be the path to a mounted EFI file
17207system.
17200 17208
17201@item @code{menu-entries} (default: @code{()}) 17209@item @code{menu-entries} (default: @code{()})
17202A possibly empty list of @code{menu-entry} objects (see below), denoting 17210A possibly empty list of @code{menu-entry} objects (see below), denoting
@@ -17448,7 +17456,7 @@ files, packages, and so on. It also creates other essential files
17448needed for the system to operate correctly---e.g., the @file{/etc}, 17456needed for the system to operate correctly---e.g., the @file{/etc},
17449@file{/var}, and @file{/run} directories, and the @file{/bin/sh} file. 17457@file{/var}, and @file{/run} directories, and the @file{/bin/sh} file.
17450 17458
17451This command also installs bootloader on the device specified in 17459This command also installs bootloader on the target specified in
17452@file{my-os-config}, unless the @option{--no-bootloader} option was 17460@file{my-os-config}, unless the @option{--no-bootloader} option was
17453passed. 17461passed.
17454 17462
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index e080b04568b..122e3508746 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -43,7 +43,7 @@
43 bootloader-configuration 43 bootloader-configuration
44 bootloader-configuration? 44 bootloader-configuration?
45 bootloader-configuration-bootloader 45 bootloader-configuration-bootloader
46 bootloader-configuration-device 46 bootloader-configuration-target
47 bootloader-configuration-menu-entries 47 bootloader-configuration-menu-entries
48 bootloader-configuration-default-entry 48 bootloader-configuration-default-entry
49 bootloader-configuration-timeout 49 bootloader-configuration-timeout
@@ -107,6 +107,8 @@
107 (bootloader bootloader-configuration-bootloader) ; <bootloader> 107 (bootloader bootloader-configuration-bootloader) ; <bootloader>
108 (device bootloader-configuration-device ; string 108 (device bootloader-configuration-device ; string
109 (default #f)) 109 (default #f))
110 (target %bootloader-configuration-target ; string
111 (default #f))
110 (menu-entries bootloader-configuration-menu-entries ; list of <boot-parameters> 112 (menu-entries bootloader-configuration-menu-entries ; list of <boot-parameters>
111 (default '())) 113 (default '()))
112 (default-entry bootloader-configuration-default-entry ; integer 114 (default-entry bootloader-configuration-default-entry ; integer
@@ -126,6 +128,15 @@
126 (additional-configuration bootloader-configuration-additional-configuration ; record 128 (additional-configuration bootloader-configuration-additional-configuration ; record
127 (default #f))) 129 (default #f)))
128 130
131(define (bootloader-configuration-target config)
132 (or (%bootloader-configuration-target config)
133 (let ((device (bootloader-configuration-device config)))
134 (when device
135 (issue-deprecation-warning
136 "The 'device' field of bootloader configurations is deprecated."
137 "Use 'target' instead."))
138 device)))
139
129 140
130;;; 141;;;
131;;; Bootloaders. 142;;; Bootloaders.
diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl
index a10ee6e7fed..459d2418854 100644
--- a/gnu/system/examples/bare-bones.tmpl
+++ b/gnu/system/examples/bare-bones.tmpl
@@ -14,7 +14,7 @@
14 ;; the label of the target root file system. 14 ;; the label of the target root file system.
15 (bootloader (bootloader-configuration 15 (bootloader (bootloader-configuration
16 (bootloader grub-bootloader) 16 (bootloader grub-bootloader)
17 (device "/dev/sdX"))) 17 (target "/dev/sdX")))
18 (file-systems (cons (file-system 18 (file-systems (cons (file-system
19 (device "my-root") 19 (device "my-root")
20 (title 'label) 20 (title 'label)
diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl
index 3cfbd9add6a..2131d1f18ff 100644
--- a/gnu/system/examples/desktop.tmpl
+++ b/gnu/system/examples/desktop.tmpl
@@ -15,7 +15,7 @@
15 ;; is the label of the target root file system. 15 ;; is the label of the target root file system.
16 (bootloader (bootloader-configuration 16 (bootloader (bootloader-configuration
17 (bootloader grub-bootloader) 17 (bootloader grub-bootloader)
18 (device "/dev/sdX"))) 18 (target "/dev/sdX")))
19 19
20 ;; Specify a mapped device for the encrypted root partition. 20 ;; Specify a mapped device for the encrypted root partition.
21 ;; The UUID is that returned by 'cryptsetup luksUUID'. 21 ;; 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 127ceb4dc5c..fb7cfebf6da 100644
--- a/gnu/system/examples/lightweight-desktop.tmpl
+++ b/gnu/system/examples/lightweight-desktop.tmpl
@@ -15,7 +15,7 @@
15 ;; Partition mounted on /boot/efi. 15 ;; Partition mounted on /boot/efi.
16 (bootloader (bootloader-configuration 16 (bootloader (bootloader-configuration
17 (bootloader grub-efi-bootloader) 17 (bootloader grub-efi-bootloader)
18 (device "/boot/efi"))) 18 (target "/boot/efi")))
19 19
20 ;; Assume the target root file system is labelled "my-root". 20 ;; Assume the target root file system is labelled "my-root".
21 (file-systems (cons* (file-system 21 (file-systems (cons* (file-system
diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl
index 57ac71c535c..056b439c5fc 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"))
26 26
27 ;; Assuming /dev/sdX is the target hard disk, and "my-root" is 27 ;; Assuming /dev/sdX is the target hard disk, and "my-root" is
28 ;; the label of the target root file system. 28 ;; the label of the target root file system.
29 (bootloader (grub-configuration (device "/dev/sda") 29 (bootloader (grub-configuration (target "/dev/sda")
30 (terminal-outputs '(console)))) 30 (terminal-outputs '(console))))
31 (file-systems (cons (file-system 31 (file-systems (cons (file-system
32 (device "my-root") 32 (device "my-root")
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 6837385dafa..7f6ffe9582a 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -299,8 +299,7 @@ Use Alt-F2 for documentation.
299 (host-name "gnu") 299 (host-name "gnu")
300 (timezone "Europe/Paris") 300 (timezone "Europe/Paris")
301 (locale "en_US.utf8") 301 (locale "en_US.utf8")
302 (bootloader (grub-configuration 302 (bootloader (grub-configuration (target "/dev/sda")))
303 (device "/dev/sda")))
304 (file-systems 303 (file-systems
305 ;; Note: the disk image build code overrides this root file system with 304 ;; Note: the disk image build code overrides this root file system with
306 ;; the appropriate one. 305 ;; the appropriate one.
diff --git a/gnu/tests.scm b/gnu/tests.scm
index 2886a982f46..97b9cc5107c 100644
--- a/gnu/tests.scm
+++ b/gnu/tests.scm
@@ -206,7 +206,7 @@ the system under test."
206 (timezone "Europe/Berlin") 206 (timezone "Europe/Berlin")
207 (locale "en_US.UTF-8") 207 (locale "en_US.UTF-8")
208 208
209 (bootloader (grub-configuration (device "/dev/sdX"))) 209 (bootloader (grub-configuration (target "/dev/sdX")))
210 (file-systems (cons (file-system 210 (file-systems (cons (file-system
211 (device "my-root") 211 (device "my-root")
212 (title 'label) 212 (title 'label)
diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm
index 22e4181ab1a..866bf885cea 100644
--- a/gnu/tests/install.scm
+++ b/gnu/tests/install.scm
@@ -59,7 +59,7 @@
59 (timezone "Europe/Paris") 59 (timezone "Europe/Paris")
60 (locale "en_US.UTF-8") 60 (locale "en_US.UTF-8")
61 61
62 (bootloader (grub-configuration (device "/dev/vdb"))) 62 (bootloader (grub-configuration (target "/dev/vdb")))
63 (kernel-arguments '("console=ttyS0")) 63 (kernel-arguments '("console=ttyS0"))
64 (file-systems (cons (file-system 64 (file-systems (cons (file-system
65 (device "my-root") 65 (device "my-root")
@@ -98,7 +98,7 @@
98 98
99 (bootloader (bootloader-configuration 99 (bootloader (bootloader-configuration
100 (bootloader extlinux-bootloader-gpt) 100 (bootloader extlinux-bootloader-gpt)
101 (device "/dev/vdb"))) 101 (target "/dev/vdb")))
102 (kernel-arguments '("console=ttyS0")) 102 (kernel-arguments '("console=ttyS0"))
103 (file-systems (cons (file-system 103 (file-systems (cons (file-system
104 (device "my-root") 104 (device "my-root")
@@ -326,7 +326,7 @@ per %test-installed-os, this test is expensive in terms of CPU and storage.")
326 (timezone "Europe/Paris") 326 (timezone "Europe/Paris")
327 (locale "en_US.utf8") 327 (locale "en_US.utf8")
328 328
329 (bootloader (grub-configuration (device "/dev/vdb"))) 329 (bootloader (grub-configuration (target "/dev/vdb")))
330 (kernel-arguments '("console=ttyS0")) 330 (kernel-arguments '("console=ttyS0"))
331 (file-systems (cons* (file-system 331 (file-systems (cons* (file-system
332 (device "my-root") 332 (device "my-root")
@@ -384,7 +384,7 @@ partition. In particular, home directories must be correctly created (see
384 (timezone "Europe/Paris") 384 (timezone "Europe/Paris")
385 (locale "en_US.UTF-8") 385 (locale "en_US.UTF-8")
386 386
387 (bootloader (grub-configuration (device "/dev/vdb"))) 387 (bootloader (grub-configuration (target "/dev/vdb")))
388 (kernel-arguments '("console=ttyS0")) 388 (kernel-arguments '("console=ttyS0"))
389 (file-systems (cons* (file-system 389 (file-systems (cons* (file-system
390 (device "root-fs") 390 (device "root-fs")
@@ -460,7 +460,7 @@ where /gnu lives on a separate partition.")
460 (timezone "Europe/Paris") 460 (timezone "Europe/Paris")
461 (locale "en_US.utf8") 461 (locale "en_US.utf8")
462 462
463 (bootloader (grub-configuration (device "/dev/vdb"))) 463 (bootloader (grub-configuration (target "/dev/vdb")))
464 (kernel-arguments '("console=ttyS0")) 464 (kernel-arguments '("console=ttyS0"))
465 (initrd (lambda (file-systems . rest) 465 (initrd (lambda (file-systems . rest)
466 ;; Add a kernel module for RAID-0 (aka. "stripe"). 466 ;; Add a kernel module for RAID-0 (aka. "stripe").
@@ -543,7 +543,7 @@ by 'mdadm'.")
543 (timezone "Europe/Paris") 543 (timezone "Europe/Paris")
544 (locale "en_US.UTF-8") 544 (locale "en_US.UTF-8")
545 545
546 (bootloader (grub-configuration (device "/dev/vdb"))) 546 (bootloader (grub-configuration (target "/dev/vdb")))
547 547
548 ;; Note: Do not pass "console=ttyS0" so we can use our passphrase prompt 548 ;; Note: Do not pass "console=ttyS0" so we can use our passphrase prompt
549 ;; detection logic in 'enter-luks-passphrase'. 549 ;; detection logic in 'enter-luks-passphrase'.
@@ -670,7 +670,7 @@ build (current-guix) and then store a couple of full system images.")
670 (timezone "Europe/Paris") 670 (timezone "Europe/Paris")
671 (locale "en_US.UTF-8") 671 (locale "en_US.UTF-8")
672 672
673 (bootloader (grub-configuration (device "/dev/vdb"))) 673 (bootloader (grub-configuration (target "/dev/vdb")))
674 (kernel-arguments '("console=ttyS0")) 674 (kernel-arguments '("console=ttyS0"))
675 (file-systems (cons (file-system 675 (file-systems (cons (file-system
676 (device "my-root") 676 (device "my-root")
diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm
index 2e666b2c081..889f578d018 100644
--- a/gnu/tests/nfs.scm
+++ b/gnu/tests/nfs.scm
@@ -41,7 +41,7 @@
41 (timezone "Europe/Berlin") 41 (timezone "Europe/Berlin")
42 (locale "en_US.UTF-8") 42 (locale "en_US.UTF-8")
43 43
44 (bootloader (grub-configuration (device "/dev/sdX"))) 44 (bootloader (grub-configuration (target "/dev/sdX")))
45 (file-systems %base-file-systems) 45 (file-systems %base-file-systems)
46 (users %base-user-accounts) 46 (users %base-user-accounts)
47 (packages (cons* 47 (packages (cons*
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 44d2c8f20c3..8793c40925b 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -612,17 +612,16 @@ and TARGET arguments."
612(define* (perform-action action os 612(define* (perform-action action os
613 #:key install-bootloader? 613 #:key install-bootloader?
614 dry-run? derivations-only? 614 dry-run? derivations-only?
615 use-substitutes? device target 615 use-substitutes? bootloader-target target
616 image-size file-system-type full-boot? 616 image-size file-system-type full-boot?
617 (mappings '()) 617 (mappings '())
618 (gc-root #f)) 618 (gc-root #f))
619 "Perform ACTION for OS. INSTALL-BOOTLOADER? specifies whether to install 619 "Perform ACTION for OS. INSTALL-BOOTLOADER? specifies whether to install
620bootloader; DEVICE is the target devices for bootloader; TARGET is the target 620bootloader; BOOTLOADER-TAGET is the target for the bootloader; TARGET is the
621root directory; IMAGE-SIZE is the size of the image to be built, for the 621target root directory; IMAGE-SIZE is the size of the image to be built, for
622'vm-image' and 'disk-image' actions. 622the 'vm-image' and 'disk-image' actions. The root filesystem is created as a
623The root filesystem is created as a FILE-SYSTEM-TYPE filesystem. 623FILE-SYSTEM-TYPE filesystem. FULL-BOOT? is used for the 'vm' action; it
624FULL-BOOT? is used for the 'vm' action; 624determines whether to boot directly to the kernel or to the bootloader.
625it determines whether to boot directly to the kernel or to the bootloader.
626 625
627When DERIVATIONS-ONLY? is true, print the derivation file name(s) without 626When DERIVATIONS-ONLY? is true, print the derivation file name(s) without
628building anything. 627building anything.
@@ -662,7 +661,7 @@ output when building a system derivation, such as a disk image."
662 (target (or target "/"))) 661 (target (or target "/")))
663 (bootloader-installer-derivation installer 662 (bootloader-installer-derivation installer
664 bootloader-package 663 bootloader-package
665 device target))) 664 bootloader-target target)))
666 665
667 ;; For 'init' and 'reconfigure', always build BOOTCFG, even if 666 ;; For 'init' and 'reconfigure', always build BOOTCFG, even if
668 ;; --no-bootloader is passed, because we then use it as a GC root. 667 ;; --no-bootloader is passed, because we then use it as a GC root.
@@ -895,8 +894,9 @@ resulting from command-line parsing."
895 (target (match args 894 (target (match args
896 ((first second) second) 895 ((first second) second)
897 (_ #f))) 896 (_ #f)))
898 (device (and bootloader? 897 (bootloader-target
899 (bootloader-configuration-device 898 (and bootloader?
899 (bootloader-configuration-target
900 (operating-system-bootloader os))))) 900 (operating-system-bootloader os)))))
901 901
902 (with-store store 902 (with-store store
@@ -929,7 +929,8 @@ resulting from command-line parsing."
929 (_ #f)) 929 (_ #f))
930 opts) 930 opts)
931 #:install-bootloader? bootloader? 931 #:install-bootloader? bootloader?
932 #:target target #:device device 932 #:target target
933 #:bootloader-target bootloader-target
933 #:gc-root (assoc-ref opts 'gc-root))))) 934 #:gc-root (assoc-ref opts 'gc-root)))))
934 #:system system)))) 935 #:system system))))
935 936
diff --git a/tests/system.scm b/tests/system.scm
index ca34409be98..a661544a5fe 100644
--- a/tests/system.scm
+++ b/tests/system.scm
@@ -36,7 +36,7 @@
36 (host-name "komputilo") 36 (host-name "komputilo")
37 (timezone "Europe/Berlin") 37 (timezone "Europe/Berlin")
38 (locale "en_US.utf8") 38 (locale "en_US.utf8")
39 (bootloader (grub-configuration (device "/dev/sdX"))) 39 (bootloader (grub-configuration (target "/dev/sdX")))
40 (file-systems (cons %root-fs %base-file-systems)) 40 (file-systems (cons %root-fs %base-file-systems))
41 41
42 (users %base-user-accounts))) 42 (users %base-user-accounts)))
@@ -51,7 +51,7 @@
51 (host-name "komputilo") 51 (host-name "komputilo")
52 (timezone "Europe/Berlin") 52 (timezone "Europe/Berlin")
53 (locale "en_US.utf8") 53 (locale "en_US.utf8")
54 (bootloader (grub-configuration (device "/dev/sdX"))) 54 (bootloader (grub-configuration (target "/dev/sdX")))
55 (mapped-devices (list %luks-device)) 55 (mapped-devices (list %luks-device))
56 (file-systems (cons (file-system 56 (file-systems (cons (file-system
57 (inherit %root-fs) 57 (inherit %root-fs)