unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: 35428@debbugs.gnu.org
Subject: [bug#35428] [WIP v3] vm: Pass xorriso customizer.
Date: Thu, 25 Apr 2019 18:15:10 +0200	[thread overview]
Message-ID: <20190425161510.30475-1-dannym@scratchpost.org> (raw)
In-Reply-To: <20190425153141.29025-1-dannym@scratchpost.org>

* gnu/build/vm.scm (make-iso9660-image): Accept XORRISO.  Neutralize frontend.
* gnu/system/vm.scm (iso9660-image): Pass XORRISO.
* gnu/packages/cdrom.scm (xorriso)[arguments]<#:phases>[install-frontends]:
Add phase.
---
 gnu/build/vm.scm       | 11 +++++++++--
 gnu/packages/cdrom.scm |  9 +++++++++
 gnu/system/vm.scm      | 10 +++++++---
 3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 372cf63c68..00be231fb0 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -422,7 +422,8 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation."
             ;; Graft the configuration file onto the image.
             (string-append "boot/grub/grub.cfg=" config-file))))
 
-(define* (make-iso9660-image grub config-file os-drv target
+(define* (make-iso9660-image xorriso mkrescue-sed-mode
+                             grub config-file os-drv target
                              #:key (volume-id "Guix_image") (volume-uuid #f)
                              register-closures? (closures '()))
   "Given a GRUB package, creates an iso image as TARGET, using CONFIG-FILE as
@@ -430,6 +431,9 @@ GRUB configuration and OS-DRV as the stuff in it."
   (define grub-mkrescue
     (string-append grub "/bin/grub-mkrescue"))
 
+  (define grub-mkrescue-sed.sh
+    (string-append xorriso "/bin/grub-mkrescue-sed.sh"))
+
   (define target-store
     (string-append "/tmp/root" (%store-directory)))
 
@@ -482,9 +486,12 @@ GRUB configuration and OS-DRV as the stuff in it."
                               #x77777777)
                           16))
 
+  (setenv "MKRESCUE_SED_MODE" mkrescue-sed-mode)
   (let ((pipe
          (apply open-pipe* OPEN_WRITE
-                grub-mkrescue "-o" target
+                grub-mkrescue
+                (string-append "--xorriso=" grub-mkrescue-sed.sh)
+                "-o" target
                 (string-append "boot/grub/grub.cfg=" config-file)
                 "etc=/tmp/root/etc"
                 "var=/tmp/root/var"
diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm
index 2193a94f86..cd548e24ce 100644
--- a/gnu/packages/cdrom.scm
+++ b/gnu/packages/cdrom.scm
@@ -164,6 +164,15 @@ libcdio.")
               (base32
                "0aq6lvlwlkxz56l5sbvgycr6j5c82ch2bv6zrnc2345ibfpafgx9"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-frontends
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (out-bin (string-append out "/bin")))
+               (install-file "frontend/grub-mkrescue-sed.sh" out-bin)
+               #t))))))
     (inputs
      `(("acl" ,acl)
        ("readline" ,readline)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 92b03b01ad..187a0413e4 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -259,7 +259,8 @@ made available under the /xchg CIFS share."
                         bootcfg-drv
                         bootloader
                         register-closures?
-                        (inputs '()))
+                        (inputs '())
+                        (mkrescue-sed-mode "original"))
   "Return a bootable, stand-alone iso9660 image.
 
 INPUTS is a list of inputs (as for packages)."
@@ -301,7 +302,9 @@ INPUTS is a list of inputs (as for packages)."
                           inputs)))
 
              (set-path-environment-variable "PATH" '("bin" "sbin") inputs)
-             (make-iso9660-image #$(bootloader-package bootloader)
+             (make-iso9660-image #$xorriso
+                                 #$mkrescue-sed-mode
+                                 #$(bootloader-package bootloader)
                                  #$bootcfg-drv
                                  #$os
                                  "/xchg/guixsd.iso"
@@ -673,7 +676,8 @@ to USB sticks meant to be read-only."
                        #:bootloader (bootloader-configuration-bootloader
                                      (operating-system-bootloader os))
                        #:inputs `(("system" ,os)
-                                  ("bootcfg" ,bootcfg)))
+                                  ("bootcfg" ,bootcfg))
+                       #:mkrescue-sed-mode "original")
         (qemu-image #:name name
                     #:os os
                     #:bootcfg-drv bootcfg

  reply	other threads:[~2019-04-25 16:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25 15:23 [bug#35428] [WIP] vm: Pass xorriso customizer Danny Milosavljevic
2019-04-25 15:31 ` [bug#35428] [WIP v2] " Danny Milosavljevic
2019-04-25 16:15   ` Danny Milosavljevic [this message]
2019-04-25 16:18     ` [bug#35428] [WIP v4] " Danny Milosavljevic
2019-04-25 17:04       ` [bug#35428] [WIP v5] " Danny Milosavljevic
2019-04-25 18:39         ` [bug#35428] [WIP v6] " Danny Milosavljevic
2019-05-12 20:33           ` Danny Milosavljevic
2019-05-19 10:09           ` bug#35428: " 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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20190425161510.30475-1-dannym@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=35428@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 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).