[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/28: system: Add 'hurd' field to <boot-parameters>.
From: |
guix-commits |
Subject: |
12/28: system: Add 'hurd' field to <boot-parameters>. |
Date: |
Sat, 23 May 2020 05:27:59 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit ec1dfae81b81b77af8dfd4a012e5cb4f88a5b72f
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Sun May 10 13:18:18 2020 +0200
system: Add 'hurd' field to <boot-parameters>.
* gnu/system.scm (<boot-parameters>)[hurd]: New field.
(read-boot-parameters): Initialize it.
(operating-system-boot-parameters): Cater for the Hurd and initialize it;
avoid initrd in that case.
(operating-system-kernel-file): Cater for for Gnumach (the Hurd) besides
Linux.
(boot-parameters->menu-entry): Use it to support <hurd-menu-entry>.
---
gnu/system.scm | 51 +++++++++++++++++++++++++++++++++------------------
1 file changed, 33 insertions(+), 18 deletions(-)
diff --git a/gnu/system.scm b/gnu/system.scm
index dec620e..3704788 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -42,6 +42,7 @@
#:use-module (gnu packages guile)
#:use-module (gnu packages guile-xyz)
#:use-module (gnu packages admin)
+ #:use-module (gnu packages hurd)
#:use-module (gnu packages linux)
#:use-module (gnu packages pciutils)
#:use-module (gnu packages package-management)
@@ -142,6 +143,7 @@
boot-parameters-kernel
boot-parameters-kernel-arguments
boot-parameters-initrd
+ boot-parameters-hurd
read-boot-parameters
read-boot-parameters-file
boot-parameters->menu-entry
@@ -283,7 +285,8 @@ directly by the user."
(store-mount-point boot-parameters-store-mount-point)
(kernel boot-parameters-kernel)
(kernel-arguments boot-parameters-kernel-arguments)
- (initrd boot-parameters-initrd))
+ (initrd boot-parameters-initrd)
+ (hurd boot-parameters-hurd))
(define (ensure-not-/dev device)
"If DEVICE starts with a slash, return #f. This is meant to filter out
@@ -314,7 +317,7 @@ file system labels."
(match (read port)
(('boot-parameters ('version 0)
('label label) ('root-device root)
- ('kernel linux)
+ ('kernel kernel)
rest ...)
(boot-parameters
(label label)
@@ -330,12 +333,12 @@ file system labels."
((_ entries) (map sexp->menu-entry entries))
(#f '())))
- ;; In the past, we would store the directory name of the kernel instead
- ;; of the absolute file name of its image. Detect that and correct it.
- (kernel (if (string=? linux (direct-store-path linux))
- (string-append linux "/"
+ ;; In the past, we would store the directory name of linux instead of
+ ;; the absolute file name of its image. Detect that and correct it.
+ (kernel (if (string=? kernel (direct-store-path kernel))
+ (string-append kernel "/"
(system-linux-image-file-name))
- linux))
+ kernel))
(kernel-arguments
(match (assq 'kernel-arguments rest)
@@ -349,6 +352,8 @@ file system labels."
(('initrd (? string? file))
file)))
+ (hurd (assq 'hurd rest))
+
(store-device
;; Linux device names like "/dev/sda1" are not suitable GRUB device
;; identifiers, so we just filter them out.
@@ -386,14 +391,20 @@ The object has its kernel-arguments extended in order to
make it bootable."
(boot-parameters-kernel-arguments params))))))
(define (boot-parameters->menu-entry conf)
- (menu-entry
- (label (boot-parameters-label conf))
- (device (boot-parameters-store-device conf))
- (device-mount-point (boot-parameters-store-mount-point conf))
- (linux (boot-parameters-kernel conf))
- (linux-arguments (boot-parameters-kernel-arguments conf))
- (initrd (boot-parameters-initrd conf))))
-
+ (if (boot-parameters-hurd conf)
+ (hurd-menu-entry
+ (label (boot-parameters-label conf))
+ (device (boot-parameters-store-device conf))
+ (device-mount-point (boot-parameters-store-mount-point conf))
+ (mach (boot-parameters-kernel conf))
+ (hurd (boot-parameters-hurd conf)))
+ (menu-entry
+ (label (boot-parameters-label conf))
+ (device (boot-parameters-store-device conf))
+ (device-mount-point (boot-parameters-store-mount-point conf))
+ (linux (boot-parameters-kernel conf))
+ (linux-arguments (boot-parameters-kernel-arguments conf))
+ (initrd (boot-parameters-initrd conf)))))
;;;
@@ -485,8 +496,10 @@ from the initrd."
(define (operating-system-kernel-file os)
"Return an object representing the absolute file name of the kernel image of
OS."
- (file-append (operating-system-kernel os)
- "/" (system-linux-image-file-name)))
+ (if (operating-system-hurd os)
+ (file-append (operating-system-kernel os) "/boot/gnumach")
+ (file-append (operating-system-kernel os)
+ "/" (system-linux-image-file-name))))
(define (package-for-kernel target-kernel module-package)
"Return a package like MODULE-PACKAGE, adapted for TARGET-KERNEL, if
@@ -1136,7 +1149,8 @@ a list of <menu-entry>, to populate the \"old entries\"
menu."
"Return a monadic <boot-parameters> record that describes the boot
parameters of OS. When SYSTEM-KERNEL-ARGUMENTS? is true, add kernel arguments
such as '--root' and '--load' to <boot-parameters>."
- (let* ((initrd (operating-system-initrd-file os))
+ (let* ((initrd (and (hurd-target?)
+ (operating-system-initrd-file os)))
(store (operating-system-store-file-system os))
(bootloader (bootloader-configuration-bootloader
(operating-system-bootloader os)))
@@ -1151,6 +1165,7 @@ such as '--root' and '--load' to <boot-parameters>."
(operating-system-kernel-arguments os root-device)
(operating-system-user-kernel-arguments os)))
(initrd initrd)
+ (hurd (operating-system-hurd os))
(bootloader-name bootloader-name)
(bootloader-menu-entries
(bootloader-configuration-menu-entries (operating-system-bootloader os)))
- branch wip-hurd-vm created (now cd57c13), guix-commits, 2020/05/23
- 02/28: build: image: Add support for EXT2 and EXT3 file-systems., guix-commits, 2020/05/23
- 03/28: gnu: grub: Allow "grub-bios-setup" to operate on raw disk-images., guix-commits, 2020/05/23
- 06/28: system: vm: Do not register-closures when cross-building to the Hurd., guix-commits, 2020/05/23
- 01/28: image: Add partition offset support., guix-commits, 2020/05/23
- 13/28: bootloader: grub: Add support for '<hurd-menu-entry>'., guix-commits, 2020/05/23
- 12/28: system: Add 'hurd' field to <boot-parameters>.,
guix-commits <=
- 15/28: system: Use 'hurd' package in label., guix-commits, 2020/05/23
- 04/28: system: image: Fix disk-image cross-compilation., guix-commits, 2020/05/23
- 05/28: utils: Move 'reset-timestamps' out of database., guix-commits, 2020/05/23
- 07/28: system: vm: Build vm-image using native qemu, for the Hurd., guix-commits, 2020/05/23
- 08/28: system: vm: Add defaults for the Hurd., guix-commits, 2020/05/23
- 09/28: system: hurd: Add hurd-default-essential-services., guix-commits, 2020/05/23
- 10/28: system: Add 'hurd' field to <operating-system>., guix-commits, 2020/05/23
- 11/28: bootloader: Add `<hurd-menu-entry>'., guix-commits, 2020/05/23
- 17/28: services: hurd: Add `hurd-etc-service'., guix-commits, 2020/05/23
- 24/28: DRAFT: system: vm: Activate the Hurd., guix-commits, 2020/05/23