[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#27521] [PATCH] build: Add iso9660 system image generator.
From: |
Danny Milosavljevic |
Subject: |
[bug#27521] [PATCH] build: Add iso9660 system image generator. |
Date: |
Thu, 29 Jun 2017 00:03:03 +0200 |
* gnu/bootloader/grub.scm (install-grub-mkrescue-image): New variable.
(grub-mkrescue-bootloader): New variable. Export it.
* build-aux/hydra/gnu-system.scm (qemu-jobs): Add 'iso9660-image-in-usb-image .
---
build-aux/hydra/gnu-system.scm | 12 +++++++++++-
gnu/bootloader/grub.scm | 21 +++++++++++++++++++++
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/build-aux/hydra/gnu-system.scm b/build-aux/hydra/gnu-system.scm
index eeb7183a4..aa396df0c 100644
--- a/build-aux/hydra/gnu-system.scm
+++ b/build-aux/hydra/gnu-system.scm
@@ -162,7 +162,17 @@ system.")
(set-guile-for-build (default-guile))
(system-disk-image installation-os
#:disk-image-size
- (* 1024 MiB))))))
+ (* 1024 MiB)))))
+ (->job 'iso9660-image-in-usb-image
+ (run-with-store store
+ (mbegin %store-monad
+ (set-guile-for-build (default-guile))
+ ;; TODO extract /boot/boot.iso from the resulting image
and just retain that.
+ (system-disk-image (inherit installation-os
+ (bootloader
(bootloader-configuration
+ (bootloader
grub-mkrescue-bootloader))))
+ #:disk-image-size
+ (* 2048 MiB))))))
'()))
(define (system-test-jobs store system)
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index f1cc3324d..7a32d7f8d 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -54,6 +54,7 @@
grub-bootloader
grub-efi-bootloader
+ grub-mkrescue-bootloader
grub-configuration))
@@ -388,6 +389,20 @@ submenu \"GNU system, old configurations...\" {~%")
device))
(error "failed to install GRUB")))))
+(define install-grub-mkrescue-image
+ #~(lambda (bootloader device mount-point)
+ ;; Install an iso9660 image containing the entire system which is
mounted at MOUNT-POINT.
+ (let ((grub-mkrescue (string-append bootloader "/bin/grub-mkrescue"))
+ (installation-file (string-append mount-point "/boot/boot.iso")))
+ ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or
+ ;; root partition.
+ (setenv "GRUB_ENABLE_CRYPTODISK" "y")
+
+ (unless (zero? (system* grub-mkrescue "-o" installation-file "/" "--"
+ "-volid" "GUIXSD"
+ "-volume_date" "uuid" "2007010203040506"))
+ (error "failed to install grub-mkrescue's ISO9660 image")))))
+
;;;
@@ -408,6 +423,12 @@ submenu \"GNU system, old configurations...\" {~%")
(name 'grub-efi)
(package grub-efi)))
+(define* grub-mkrescue-bootloader
+ (bootloader
+ (inherit grub-bootloader)
+ (name 'grub-mkrescue)
+ (installer install-grub-mkrescue-image)))
+
;;;
;;; Compatibility macros.
- [bug#27521] [PATCH] build: Add iso9660 system image generator.,
Danny Milosavljevic <=