all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: 27521@debbugs.gnu.org
Subject: [bug#27521] [PATCH v2] build: Add iso9660 system image generator.
Date: Thu, 29 Jun 2017 00:22:30 +0200	[thread overview]
Message-ID: <20170628222230.32348-1-dannym@scratchpost.org> (raw)
In-Reply-To: <20170628220303.31206-1-dannym@scratchpost.org>

* 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..82717a327 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 "/xchg/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.

  reply	other threads:[~2017-06-28 22:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28 22:03 [bug#27521] [PATCH] build: Add iso9660 system image generator Danny Milosavljevic
2017-06-28 22:22 ` Danny Milosavljevic [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170628222230.32348-1-dannym@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=27521@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.