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.
This commit is contained in:
parent
6cea61f2fa
commit
c77b92859f
2 changed files with 40 additions and 5 deletions
|
@ -161,6 +161,8 @@ deduplicates files common to CLOSURE and the rest of PREFIX."
|
||||||
references-graphs
|
references-graphs
|
||||||
(register-closures? #t)
|
(register-closures? #t)
|
||||||
system-directory
|
system-directory
|
||||||
|
(make-device-nodes
|
||||||
|
make-essential-device-nodes)
|
||||||
#:allow-other-keys)
|
#:allow-other-keys)
|
||||||
"Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to
|
"Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to
|
||||||
install the bootloader configuration.
|
install the bootloader configuration.
|
||||||
|
@ -172,6 +174,9 @@ of the directory of the 'system' derivation."
|
||||||
(populate-root-file-system system-directory root)
|
(populate-root-file-system system-directory root)
|
||||||
(populate-store references-graphs root)
|
(populate-store references-graphs root)
|
||||||
|
|
||||||
|
;; Populate /dev.
|
||||||
|
(make-device-nodes root)
|
||||||
|
|
||||||
(when register-closures?
|
(when register-closures?
|
||||||
(for-each (lambda (closure)
|
(for-each (lambda (closure)
|
||||||
(register-closure root
|
(register-closure root
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#:use-module (gnu packages genimage)
|
#:use-module (gnu packages genimage)
|
||||||
#:use-module (gnu packages guile)
|
#:use-module (gnu packages guile)
|
||||||
#:autoload (gnu packages gnupg) (guile-gcrypt)
|
#:autoload (gnu packages gnupg) (guile-gcrypt)
|
||||||
|
#:use-module (gnu packages hurd)
|
||||||
#:use-module (gnu packages linux)
|
#:use-module (gnu packages linux)
|
||||||
#:use-module (gnu packages mtools)
|
#:use-module (gnu packages mtools)
|
||||||
#:use-module ((srfi srfi-1) #:prefix srfi-1:)
|
#:use-module ((srfi srfi-1) #:prefix srfi-1:)
|
||||||
|
@ -54,6 +55,7 @@
|
||||||
#:export (esp-partition
|
#:export (esp-partition
|
||||||
root-partition
|
root-partition
|
||||||
|
|
||||||
|
hurd-disk-image
|
||||||
efi-disk-image
|
efi-disk-image
|
||||||
iso9660-image
|
iso9660-image
|
||||||
|
|
||||||
|
@ -91,6 +93,26 @@
|
||||||
(flags '(boot))
|
(flags '(boot))
|
||||||
(initializer (gexp initialize-root-partition))))
|
(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
|
(define efi-disk-image
|
||||||
(image
|
(image
|
||||||
(format 'disk-image)
|
(format 'disk-image)
|
||||||
|
@ -145,12 +167,14 @@
|
||||||
(with-imported-modules `(,@(source-module-closure
|
(with-imported-modules `(,@(source-module-closure
|
||||||
'((gnu build vm)
|
'((gnu build vm)
|
||||||
(gnu build image)
|
(gnu build image)
|
||||||
|
(gnu build linux-boot)
|
||||||
(guix store database))
|
(guix store database))
|
||||||
#:select? not-config?)
|
#:select? not-config?)
|
||||||
((guix config) => ,(make-config.scm)))
|
((guix config) => ,(make-config.scm)))
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (gnu build vm)
|
(use-modules (gnu build vm)
|
||||||
(gnu build image)
|
(gnu build image)
|
||||||
|
(gnu build linux-boot)
|
||||||
(guix store database)
|
(guix store database)
|
||||||
(guix build utils))
|
(guix build utils))
|
||||||
gexp* ...))))
|
gexp* ...))))
|
||||||
|
@ -525,10 +549,16 @@ image, depending on IMAGE format."
|
||||||
"Find and return an image that could match the given FILE-SYSTEM-TYPE. This
|
"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>
|
is useful to adapt to interfaces written before the addition of the <image>
|
||||||
record."
|
record."
|
||||||
|
(mlet %store-monad ((target (current-target-system)))
|
||||||
(mbegin %store-monad
|
(mbegin %store-monad
|
||||||
(return
|
(return
|
||||||
(match file-system-type
|
(match file-system-type
|
||||||
("iso9660" iso9660-image)
|
("iso9660" iso9660-image)
|
||||||
(_ efi-disk-image)))))
|
(_ (cond
|
||||||
|
((and target
|
||||||
|
(hurd-triplet? target))
|
||||||
|
hurd-disk-image)
|
||||||
|
(else
|
||||||
|
efi-disk-image))))))))
|
||||||
|
|
||||||
;;; image.scm ends here
|
;;; image.scm ends here
|
||||||
|
|
Reference in a new issue