[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
17/35: image: Add Hurd support.
From: |
guix-commits |
Subject: |
17/35: image: Add Hurd support. |
Date: |
Thu, 28 May 2020 13:03:31 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit d1aaea4c89be4a7406c0dc16708010561e0888f0
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sat May 23 19:10:44 2020 +0200
image: Add Hurd support.
* gnu/system/image.scm (hurd-disk-image): New exported variable,
(root-offset, root-label): new variables,
(esp-partition, root-partition): adapt accordingly,
(find-image): add Hurd support.
---
gnu/build/image.scm | 5 +++++
gnu/system/image.scm | 46 ++++++++++++++++++++++++++++++++++++++++------
2 files changed, 45 insertions(+), 6 deletions(-)
diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index a8594e2..70f1a61 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -161,6 +161,8 @@ deduplicates files common to CLOSURE and the rest of
PREFIX."
references-graphs
(register-closures? #t)
system-directory
+ (make-device-nodes
+ make-essential-device-nodes)
#:allow-other-keys)
"Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to
install the bootloader configuration.
@@ -172,6 +174,9 @@ of the directory of the 'system' derivation."
(populate-root-file-system system-directory root)
(populate-store references-graphs root)
+ ;; Populate /dev.
+ (make-device-nodes root)
+
(when register-closures?
(for-each (lambda (closure)
(register-closure root
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index 8bb8412..d406fc0 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -43,6 +43,7 @@
#:use-module (gnu packages genimage)
#:use-module (gnu packages guile)
#:autoload (gnu packages gnupg) (guile-gcrypt)
+ #:use-module (gnu packages hurd)
#:use-module (gnu packages linux)
#:use-module (gnu packages mtools)
#:use-module ((srfi srfi-1) #:prefix srfi-1:)
@@ -54,6 +55,7 @@
#:export (esp-partition
root-partition
+ hurd-disk-image
efi-disk-image
iso9660-image
@@ -65,9 +67,13 @@
;;; Images definitions.
;;;
+(define root-offset (* 512 2048))
+(define root-label "Guix_image")
+
(define esp-partition
(partition
(size (* 40 (expt 2 20)))
+ (offset root-offset)
(label "GNU-ESP") ;cosmetic only
;; Use "vfat" here since this property is used when mounting. The actual
;; FAT-ness is based on file system size (16 in this case).
@@ -78,11 +84,31 @@
(define root-partition
(partition
(size 'guess)
- (label "Guix_image")
+ (label root-label)
(file-system "ext4")
(flags '(boot))
(initializer (gexp initialize-root-partition))))
+(define hurd-initialize-root-partition
+ #~(lambda* (#:rest args)
+ (apply initialize-root-partition
+ (append args
+ (list #:make-device-nodes
+ make-hurd-device-nodes)))))
+
+(define hurd-disk-image
+ (image
+ (format 'disk-image)
+ (partitions
+ (list (partition
+ (size 'guess)
+ (offset root-offset)
+ (label root-label)
+ (file-system "ext2")
+ (file-system-options '("-o" "hurd" "-O" "ext_attr"))
+ (flags '(boot))
+ (initializer hurd-initialize-root-partition))))))
+
(define efi-disk-image
(image
(format 'disk-image)
@@ -137,12 +163,14 @@
(with-imported-modules `(,@(source-module-closure
'((gnu build vm)
(gnu build image)
+ (gnu build linux-boot)
(guix store database))
#:select? not-config?)
((guix config) => ,(make-config.scm)))
#~(begin
(use-modules (gnu build vm)
(gnu build image)
+ (gnu build linux-boot)
(guix store database)
(guix build utils))
gexp* ...))))
@@ -521,10 +549,16 @@ image, depending on IMAGE format."
"Find and return an image that could match the given FILE-SYSTEM-TYPE. This
is useful to adapt to interfaces written before the addition of the <image>
record."
- (mbegin %store-monad
- (return
- (match file-system-type
- ("iso9660" iso9660-image)
- (_ efi-disk-image)))))
+ (mlet %store-monad ((target (current-target-system)))
+ (mbegin %store-monad
+ (return
+ (match file-system-type
+ ("iso9660" iso9660-image)
+ (_ (cond
+ ((and target
+ (hurd-triplet? target))
+ hurd-disk-image)
+ (else
+ efi-disk-image))))))))
;;; image.scm ends here
- branch wip-hurd-vm created (now dbdce6e), guix-commits, 2020/05/28
- 01/35: system: 'system-linux-image-file-name' takes an optional parameter., guix-commits, 2020/05/28
- 02/35: vm: 'expression->derivation-in-linux-vm' always returns a native build., guix-commits, 2020/05/28
- 07/35: gnu: guile-static: Disable JIT on ARMv7., guix-commits, 2020/05/28
- 05/35: vm: <virtual-machine> compiler honors system and target., guix-commits, 2020/05/28
- 06/35: vm: Shared-store script runs that native QEMU and Bash., guix-commits, 2020/05/28
- 13/35: system: image: Correct genimage configuration file indentation., guix-commits, 2020/05/28
- 14/35: image: Use grub-efi to install the EFI bootloader., guix-commits, 2020/05/28
- 17/35: image: Add Hurd support.,
guix-commits <=
- 15/35: system: image: Fix image-with-os., guix-commits, 2020/05/28
- 18/35: linux-boot: Update 'make-hurd-device-nodes'., guix-commits, 2020/05/28
- 03/35: vm: 'qemu-image' uses the native partitioning tools and bootloader., guix-commits, 2020/05/28
- 08/35: gnu: hurd: Update to upstream Hurd-reserved xattr index., guix-commits, 2020/05/28
- 09/35: bootloader: Add 'disk-image-installer'., guix-commits, 2020/05/28
- 16/35: image: Do not use VM to create disk-images., guix-commits, 2020/05/28
- 21/35: system: Add 'hurd' field to <operating-system>., guix-commits, 2020/05/28
- 23/35: system: Add 'multiboot-modules' field to <boot-parameters>., guix-commits, 2020/05/28
- 25/35: system: Use 'hurd' package in label., guix-commits, 2020/05/28
- 26/35: system: examples: Add bare-hurd.tmpl., guix-commits, 2020/05/28