unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#27521] [PATCH] build: Add iso9660 system image generator.
@ 2017-06-28 22:03 Danny Milosavljevic
  2017-06-28 22:22 ` [bug#27521] [PATCH v2] " Danny Milosavljevic
                   ` (4 more replies)
  0 siblings, 5 replies; 27+ messages in thread
From: Danny Milosavljevic @ 2017-06-28 22:03 UTC (permalink / raw)
  To: 27521

* 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")))))
+
 \f
 
 ;;;
@@ -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)))
+
 \f
 ;;;
 ;;; Compatibility macros.

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-07-07 16:07 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-28 22:03 [bug#27521] [PATCH] build: Add iso9660 system image generator Danny Milosavljevic
2017-06-28 22:22 ` [bug#27521] [PATCH v2] " Danny Milosavljevic
2017-06-28 22:48 ` [bug#27521] [PATCH v3] " Danny Milosavljevic
2017-06-29  2:09 ` [bug#27521] [PATCH v4] " Danny Milosavljevic
2017-06-29 13:47   ` [bug#27521] [PATCH v5] " Danny Milosavljevic
2017-06-30 10:13     ` Danny Milosavljevic
2017-07-02 14:55     ` Ludovic Courtès
2017-07-02 18:37       ` Danny Milosavljevic
2017-07-02 20:09         ` Ludovic Courtès
2017-07-02 22:01           ` Danny Milosavljevic
2017-07-03  7:38             ` Ludovic Courtès
2017-07-03 10:31               ` Danny Milosavljevic
2017-07-03 11:49                 ` Ludovic Courtès
2017-07-03 10:34               ` [bug#27521] [PATCH] guix system: Add "--file-system-type" option Danny Milosavljevic
2017-07-03 11:56                 ` Ludovic Courtès
2017-07-03 13:14                   ` Danny Milosavljevic
2017-07-03 14:17                     ` Ludovic Courtès
2017-07-03 14:20                       ` Danny Milosavljevic
2017-07-03 15:31                         ` Ludovic Courtès
2017-07-03 14:42                 ` Danny Milosavljevic
2017-07-03 11:10               ` [bug#27521] [PATCH] build: Allow specifying volume-uuid with make-iso9660-image Danny Milosavljevic
2017-07-03 11:58                 ` Ludovic Courtès
2017-06-29  3:17 ` [bug#27521] [PATCH] linux-initrd: Add isofs if necessary Danny Milosavljevic
2017-07-02 14:56   ` Ludovic Courtès
2017-07-02 18:28     ` Danny Milosavljevic
2017-07-03 18:02 ` [bug#27521] [PATCH] guix system: Add file system label and uuid to iso9660-image Danny Milosavljevic
2017-07-07 16:06   ` Danny Milosavljevic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).