From unknown Sat Jun 21 03:30:46 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#35428 <35428@debbugs.gnu.org> To: bug#35428 <35428@debbugs.gnu.org> Subject: Status: [WIP] vm: Pass xorriso customizer. Reply-To: bug#35428 <35428@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:30:46 +0000 retitle 35428 [WIP] vm: Pass xorriso customizer. reassign 35428 guix-patches submitter 35428 Danny Milosavljevic severity 35428 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 11:23:22 2019 Received: (at submit) by debbugs.gnu.org; 25 Apr 2019 15:23:22 +0000 Received: from localhost ([127.0.0.1]:59136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJgDZ-00067p-W4 for submit@debbugs.gnu.org; Thu, 25 Apr 2019 11:23:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJgDX-00067c-MI for submit@debbugs.gnu.org; Thu, 25 Apr 2019 11:23:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:49920) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJgDS-00039S-JE for submit@debbugs.gnu.org; Thu, 25 Apr 2019 11:23:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJgDR-0002DA-GJ for guix-patches@gnu.org; Thu, 25 Apr 2019 11:23:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJgDQ-000370-Hr for guix-patches@gnu.org; Thu, 25 Apr 2019 11:23:13 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:45956) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJgDQ-00031o-9P for guix-patches@gnu.org; Thu, 25 Apr 2019 11:23:12 -0400 Received: from dayas.3.home (178.113.255.174.wireless.dyn.drei.com [178.113.255.174]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 792F83360169; Thu, 25 Apr 2019 17:23:09 +0200 (CEST) From: Danny Milosavljevic To: guix-patches@gnu.org Subject: [WIP] vm: Pass xorriso customizer. Date: Thu, 25 Apr 2019 17:23:06 +0200 Message-Id: <20190425152306.22872-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Tags: patch Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 85.13.145.193 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/build/vm.scm (make-iso9660-image): Accept XORRISO. * gnu/system/vm.scm (iso9660-image): Pass XORRISO. --- gnu/build/vm.scm | 9 +++++++-- gnu/system/vm.scm | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 372cf63c68..52dd44ac21 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -422,7 +422,7 @@ 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=3D" config-file)))) =20 -(define* (make-iso9660-image grub config-file os-drv target +(define* (make-iso9660-image xorriso 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-FI= LE as @@ -430,6 +430,9 @@ GRUB configuration and OS-DRV as the stuff in it." (define grub-mkrescue (string-append grub "/bin/grub-mkrescue")) =20 + (define grub-mkrescue-sed.sh + (string-append xorriso "/bin/grub-mkrescue-sed.sh")) + (define target-store (string-append "/tmp/root" (%store-directory))) =20 @@ -484,7 +487,9 @@ GRUB configuration and OS-DRV as the stuff in it." =20 (let ((pipe (apply open-pipe* OPEN_WRITE - grub-mkrescue "-o" target + grub-mkrescue + (string-append "--xorriso=3D" grub-mkrescue-sed.sh) + "-o" target (string-append "boot/grub/grub.cfg=3D" config-file) "etc=3D/tmp/root/etc" "var=3D/tmp/root/var" diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 92b03b01ad..8a1272aff9 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -301,7 +301,8 @@ INPUTS is a list of inputs (as for packages)." inputs))) =20 (set-path-environment-variable "PATH" '("bin" "sbin") input= s) - (make-iso9660-image #$(bootloader-package bootloader) + (make-iso9660-image #$xorriso + #$(bootloader-package bootloader) #$bootcfg-drv #$os "/xchg/guixsd.iso" From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 11:31:51 2019 Received: (at 35428) by debbugs.gnu.org; 25 Apr 2019 15:31:51 +0000 Received: from localhost ([127.0.0.1]:59146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJgLm-0006LP-Ue for submit@debbugs.gnu.org; Thu, 25 Apr 2019 11:31:51 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:45562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJgLk-0006LG-Qc for 35428@debbugs.gnu.org; Thu, 25 Apr 2019 11:31:49 -0400 Received: from dayas.3.home (178.113.255.174.wireless.dyn.drei.com [178.113.255.174]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 2858D3360099; Thu, 25 Apr 2019 17:31:45 +0200 (CEST) From: Danny Milosavljevic To: 35428@debbugs.gnu.org Subject: [WIP v2] vm: Pass xorriso customizer. Date: Thu, 25 Apr 2019 17:31:41 +0200 Message-Id: <20190425153141.29025-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190425152306.22872-1-dannym@scratchpost.org> References: <20190425152306.22872-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 35428 Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * 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 | 10 ++++++++-- gnu/packages/cdrom.scm | 9 +++++++++ gnu/system/vm.scm | 3 ++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 372cf63c68..5bcf67714a 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -422,7 +422,7 @@ 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 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 +430,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 +485,12 @@ GRUB configuration and OS-DRV as the stuff in it." #x77777777) 16)) + (setenv "MKRESCUE_SED_MODE" "original") (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..8a1272aff9 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -301,7 +301,8 @@ 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 + #$(bootloader-package bootloader) #$bootcfg-drv #$os "/xchg/guixsd.iso" From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 12:15:21 2019 Received: (at 35428) by debbugs.gnu.org; 25 Apr 2019 16:15:21 +0000 Received: from localhost ([127.0.0.1]:59177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJh1r-0007P7-U6 for submit@debbugs.gnu.org; Thu, 25 Apr 2019 12:15:20 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:49756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJh1p-0007Ox-1H for 35428@debbugs.gnu.org; Thu, 25 Apr 2019 12:15:18 -0400 Received: from dayas.3.home (178.113.255.174.wireless.dyn.drei.com [178.113.255.174]) by dd26836.kasserver.com (Postfix) with ESMTPSA id EA2A133606E0; Thu, 25 Apr 2019 18:15:14 +0200 (CEST) From: Danny Milosavljevic To: 35428@debbugs.gnu.org Subject: [WIP v3] vm: Pass xorriso customizer. Date: Thu, 25 Apr 2019 18:15:10 +0200 Message-Id: <20190425161510.30475-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190425153141.29025-1-dannym@scratchpost.org> References: <20190425153141.29025-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 35428 Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 12:18:25 2019 Received: (at 35428) by debbugs.gnu.org; 25 Apr 2019 16:18:25 +0000 Received: from localhost ([127.0.0.1]:59190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJh4q-0007Tu-Nk for submit@debbugs.gnu.org; Thu, 25 Apr 2019 12:18:25 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:49972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJh4n-0007Tk-A5 for 35428@debbugs.gnu.org; Thu, 25 Apr 2019 12:18:23 -0400 Received: from dayas.3.home (178.113.255.174.wireless.dyn.drei.com [178.113.255.174]) by dd26836.kasserver.com (Postfix) with ESMTPSA id B3F7433606E0; Thu, 25 Apr 2019 18:18:19 +0200 (CEST) From: Danny Milosavljevic To: 35428@debbugs.gnu.org Subject: [WIP v4] vm: Pass xorriso customizer. Date: Thu, 25 Apr 2019 18:18:14 +0200 Message-Id: <20190425161814.30651-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190425161510.30475-1-dannym@scratchpost.org> References: <20190425161510.30475-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 35428 Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/build/vm.scm (make-iso9660-image): Accept XORRISO, MKRESCUE-SED-MODE. * gnu/system/vm.scm (iso9660-image): Pass XORRISO, MKRESCUE-SED-MODE. * 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 13:04:26 2019 Received: (at 35428) by debbugs.gnu.org; 25 Apr 2019 17:04:27 +0000 Received: from localhost ([127.0.0.1]:59223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJhnK-00007R-Ux for submit@debbugs.gnu.org; Thu, 25 Apr 2019 13:04:26 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:53528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJhnJ-00007H-2t for 35428@debbugs.gnu.org; Thu, 25 Apr 2019 13:04:22 -0400 Received: from dayas.3.home (178.113.255.174.wireless.dyn.drei.com [178.113.255.174]) by dd26836.kasserver.com (Postfix) with ESMTPSA id E5AA73360099; Thu, 25 Apr 2019 19:04:14 +0200 (CEST) From: Danny Milosavljevic To: 35428@debbugs.gnu.org Subject: [WIP v5] vm: Pass xorriso customizer. Date: Thu, 25 Apr 2019 19:04:10 +0200 Message-Id: <20190425170410.6438-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190425161814.30651-1-dannym@scratchpost.org> References: <20190425161814.30651-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 35428 Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/build/vm.scm (make-iso9660-image): Accept XORRISO, MKRESCUE-SED-MODE. * gnu/system/vm.scm (iso9660-image): Pass XORRISO; accept MKRESCUE-SED-MODE. (system-disk-image): Pass MKRESCUE-SED-MODE. * gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch: New file. * gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch: New file. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/cdrom.scm (xorriso)[source]: Add patches. [arguments]<#:phases>[install-frontends]: Add phase. --- gnu/build/vm.scm | 15 ++- gnu/local.mk | 4 +- gnu/packages/cdrom.scm | 14 ++- .../patches/xorriso-no-mbr-in-inner-efi.patch | 47 ++++++++ ...riso-no-partition-table-in-inner-efi.patch | 107 ++++++++++++++++++ gnu/system/vm.scm | 10 +- 6 files changed, 190 insertions(+), 7 deletions(-) create mode 100644 gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch create mode 100644 gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 372cf63c68..9543389b83 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,16 @@ GRUB configuration and OS-DRV as the stuff in it." #x77777777) 16)) + (setenv "MKRESCUE_SED_MODE" mkrescue-sed-mode) + (setenv "MKRESCUE_SED_XORRISO" (string-append xorriso + "/bin/xorriso")) + (setenv "MKRESCUE_SED_IN_EFI_NO_PT" "yes") + (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/local.mk b/gnu/local.mk index 18427de8c7..149803f691 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1370,7 +1370,9 @@ dist_patch_DATA = \ %D%/packages/patches/xfce4-session-fix-xflock4.patch \ %D%/packages/patches/xfce4-settings-defaults.patch \ %D%/packages/patches/xinetd-fix-fd-leak.patch \ - %D%/packages/patches/xinetd-CVE-2013-4342.patch + %D%/packages/patches/xinetd-CVE-2013-4342.patch \ + %D%/packages/patches/xorriso-no-partition-table-in-inner-efi.patch \ + %D%/packages/patches/xorriso-no-mbr-in-inner-efi.patch MISC_DISTRO_FILES = \ %D%/packages/ld-wrapper.in diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm index 2193a94f86..5128f7ce4f 100644 --- a/gnu/packages/cdrom.scm +++ b/gnu/packages/cdrom.scm @@ -162,8 +162,20 @@ libcdio.") version ".tar.gz")) (sha256 (base32 - "0aq6lvlwlkxz56l5sbvgycr6j5c82ch2bv6zrnc2345ibfpafgx9")))) + "0aq6lvlwlkxz56l5sbvgycr6j5c82ch2bv6zrnc2345ibfpafgx9")) + (patches + (search-patches "xorriso-no-partition-table-in-inner-efi.patch" + "xorriso-no-mbr-in-inner-efi.patch")))) (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/packages/patches/xorriso-no-mbr-in-inner-efi.patch b/gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch new file mode 100644 index 0000000000..a43889d2c6 --- /dev/null +++ b/gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch @@ -0,0 +1,47 @@ +https://dev.lovelyhq.com/libburnia/libisoburn/commit/1eb51f44dadb8b6c5f87533ca357186cdc1ac625 +diff --git a/frontend/grub-mkrescue-sed.sh b/frontend/grub-mkrescue-sed.sh +index b3948c99..dcd9d696 100755 +--- a/frontend/grub-mkrescue-sed.sh ++++ b/frontend/grub-mkrescue-sed.sh +@@ -120,6 +120,7 @@ fi + # "yes" overwrites the MBR partition table area in the EFI boot image by zeros. + # Some EFI implementations get stuck when seeing in the EFI partition a + # partition table entry which begins at LBA 0. ++# "extra" not only zeros the partition table but also the MBR signature. + efi_zero_inner_pt=no + if test -n "$MKRESCUE_SED_IN_EFI_NO_PT" + then +@@ -192,24 +193,31 @@ then + find "$dir" + fi + +-if test "$efi_zero_inner_pt" = yes ++if test "$efi_zero_inner_pt" = yes -o "$efi_zero_inner_pt" = extra + then + did_dd=0 + if test -e "$dir"/efi.img + then ++ # Look for 0x55 0xAA in bytes 510 and 511 + magic=$(dd bs=1 skip=510 count=2 if="$dir"/efi.img 2>/dev/null | \ + od -c | head -1 | awk '{print $2 " " $3}') + if test "$magic" = "U 252" + then ++ echo "Performing actions for MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2 + dd if=/dev/zero bs=1 seek=446 count=64 conv=notrunc of="$dir"/efi.img + did_dd=1 ++ if test "$efi_zero_inner_pt" = extra ++ then ++ dd if=/dev/zero bs=1 seek=510 count=2 conv=notrunc of="$dir"/efi.img ++ fi ++ echo >&2 + fi + fi + if test "$did_dd" = 0 + then + echo >&2 + echo "$0 : NOTE : No EFI image found or no MBR signature in it." >&2 +- echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=yes" >&2 ++ echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2 + echo >&2 + fi + fi diff --git a/gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch b/gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch new file mode 100644 index 0000000000..a719ca1f89 --- /dev/null +++ b/gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch @@ -0,0 +1,107 @@ +https://dev.lovelyhq.com/libburnia/libisoburn/commit/3a2a3ba737a06162c22ace0ae09d33ba97aa2673 +diff --git a/frontend/grub-mkrescue-sed.sh b/frontend/grub-mkrescue-sed.sh +index d772ff22..b3948c99 100755 +--- a/frontend/grub-mkrescue-sed.sh ++++ b/frontend/grub-mkrescue-sed.sh +@@ -1,6 +1,6 @@ + #!/bin/sh + +-# Copyright (C) 2015 - 2016 ++# Copyright (C) 2015 - 2019 + # Thomas Schmitt , libburnia-project.org + # Provided under BSD license: Use, modify, and distribute as you like. + +@@ -117,6 +117,15 @@ fi + # command line.) + # Each argument must be a single word. No whitespace. No quotation marks. + ++# "yes" overwrites the MBR partition table area in the EFI boot image by zeros. ++# Some EFI implementations get stuck when seeing in the EFI partition a ++# partition table entry which begins at LBA 0. ++efi_zero_inner_pt=no ++if test -n "$MKRESCUE_SED_IN_EFI_NO_PT" ++then ++ efi_zero_inner_pt="$MKRESCUE_SED_IN_EFI_NO_PT" ++fi ++ + + # + # Do the work +@@ -183,12 +192,48 @@ then + find "$dir" + fi + ++if test "$efi_zero_inner_pt" = yes ++then ++ did_dd=0 ++ if test -e "$dir"/efi.img ++ then ++ magic=$(dd bs=1 skip=510 count=2 if="$dir"/efi.img 2>/dev/null | \ ++ od -c | head -1 | awk '{print $2 " " $3}') ++ if test "$magic" = "U 252" ++ then ++ dd if=/dev/zero bs=1 seek=446 count=64 conv=notrunc of="$dir"/efi.img ++ did_dd=1 ++ fi ++ fi ++ if test "$did_dd" = 0 ++ then ++ echo >&2 ++ echo "$0 : NOTE : No EFI image found or no MBR signature in it." >&2 ++ echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=yes" >&2 ++ echo >&2 ++ fi ++fi ++ + efi_tmp_name= ++if test x"$mode" = xmjg \ ++ -o x"$mode" = xmbr_only \ ++ -o x"$mode" = xgpt_appended \ ++ -o x"$mode" = xmbr_hfs ++then ++ # Move EFI partition image file out of the "$dir" tree, i.e. out of the ISO ++ efi_tmp_name=grub-mkrescue-sed-efi-img.$$ ++ if test -e "$dir"/efi.img ++ then ++ mv "$dir"/efi.img /tmp/$efi_tmp_name ++ elif test -e /tmp/$efi_tmp_name ++ then ++ rm /tmp/$efi_tmp_name ++ fi ++fi ++ + if test x"$mode" = xmjg + then + # Exchange arguments for the experimental GRUB2 mjg layout +- efi_tmp_name=grub-mkrescue-sed-efi-img.$$ +- mv "$dir"/efi.img /tmp/$efi_tmp_name + x=$(echo " $*" | sed \ + -e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition $partno 0xef \/tmp\/$efi_tmp_name/" \ + -e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_${partno}:all:: -no-emul-boot -isohybrid-gpt-basdat/" \ +@@ -207,8 +252,6 @@ then + elif test x"$mode" = xmbr_only + then + # Exchange arguments for no-HFS MBR-only layout +- efi_tmp_name=grub-mkrescue-sed-efi-img.$$ +- mv "$dir"/efi.img /tmp/$efi_tmp_name + x=$(echo " $*" | sed \ + -e "s/-efi-boot-part --efi-boot-image/$iso_mbr_part_type -no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name/" \ + -e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \ +@@ -228,8 +271,6 @@ then + elif test x"$mode" = xmbr_hfs + then + # Exchange arguments for MBR and HFS+ layout +- efi_tmp_name=grub-mkrescue-sed-efi-img.$$ +- mv "$dir"/efi.img /tmp/$efi_tmp_name + x=$(echo " $*" | sed \ + -e "s/-efi-boot-part --efi-boot-image/$iso_mbr_part_type -no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name/" \ + -e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \ +@@ -247,8 +288,6 @@ then + elif test x"$mode" = xgpt_appended + then + # Exchange arguments for no-HFS MBR-only layout +- efi_tmp_name=grub-mkrescue-sed-efi-img.$$ +- mv "$dir"/efi.img /tmp/$efi_tmp_name + x=$(echo " $*" | sed \ + -e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name -appended_part_as_gpt -partition_offset 16/" \ + -e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \ diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 92b03b01ad..e596b2ce70 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 "mbr_hfs") (qemu-image #:name name #:os os #:bootcfg-drv bootcfg From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 25 14:42:55 2019 Received: (at 35428) by debbugs.gnu.org; 25 Apr 2019 18:42:55 +0000 Received: from localhost ([127.0.0.1]:59340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJjKd-0002al-D8 for submit@debbugs.gnu.org; Thu, 25 Apr 2019 14:42:54 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:60722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJjKb-0002ac-EG for 35428@debbugs.gnu.org; Thu, 25 Apr 2019 14:42:50 -0400 Received: from dayas.3.home (178.113.255.174.wireless.dyn.drei.com [178.113.255.174]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 4ADB13360099; Thu, 25 Apr 2019 20:42:47 +0200 (CEST) From: Danny Milosavljevic To: 35428@debbugs.gnu.org Subject: [WIP v6] vm: Pass xorriso customizer. Date: Thu, 25 Apr 2019 20:39:44 +0200 Message-Id: <20190425183944.27492-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190425170410.6438-1-dannym@scratchpost.org> References: <20190425170410.6438-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 35428 Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/build/vm.scm (make-iso9660-image): Accept XORRISO, GRUB-MKRESCUE-ENVIRONMENT. * gnu/system/vm.scm (iso9660-image): Pass XORRISO; accept GRUB-MKRESCUE-ENVIRONMENT. (system-disk-image): Pass GRUB-MKRESCUE-ENVIRONMENT. * gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch: New file. * gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch: New file. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/cdrom.scm (xorriso)[source]: Add patches. [arguments]<#:phases>[install-frontends]: Add phase. --- gnu/build/vm.scm | 18 ++- gnu/local.mk | 4 +- gnu/packages/cdrom.scm | 14 ++- .../patches/xorriso-no-mbr-in-inner-efi.patch | 47 ++++++++ ...riso-no-partition-table-in-inner-efi.patch | 107 ++++++++++++++++++ gnu/system/vm.scm | 11 +- 6 files changed, 194 insertions(+), 7 deletions(-) create mode 100644 gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch create mode 100644 gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 372cf63c68..6d770d5057 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 grub-mkrescue-environment + 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,19 @@ GRUB configuration and OS-DRV as the stuff in it." #x77777777) 16)) + (setenv "MKRESCUE_SED_MODE" "original") + (setenv "MKRESCUE_SED_XORRISO" (string-append xorriso + "/bin/xorriso")) + (setenv "MKRESCUE_SED_IN_EFI_NO_PT" "yes") + (for-each (match-lambda + ((name . value) (setenv name value))) + grub-mkrescue-environment) + (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/local.mk b/gnu/local.mk index 18427de8c7..149803f691 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1370,7 +1370,9 @@ dist_patch_DATA = \ %D%/packages/patches/xfce4-session-fix-xflock4.patch \ %D%/packages/patches/xfce4-settings-defaults.patch \ %D%/packages/patches/xinetd-fix-fd-leak.patch \ - %D%/packages/patches/xinetd-CVE-2013-4342.patch + %D%/packages/patches/xinetd-CVE-2013-4342.patch \ + %D%/packages/patches/xorriso-no-partition-table-in-inner-efi.patch \ + %D%/packages/patches/xorriso-no-mbr-in-inner-efi.patch MISC_DISTRO_FILES = \ %D%/packages/ld-wrapper.in diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm index 2193a94f86..5128f7ce4f 100644 --- a/gnu/packages/cdrom.scm +++ b/gnu/packages/cdrom.scm @@ -162,8 +162,20 @@ libcdio.") version ".tar.gz")) (sha256 (base32 - "0aq6lvlwlkxz56l5sbvgycr6j5c82ch2bv6zrnc2345ibfpafgx9")))) + "0aq6lvlwlkxz56l5sbvgycr6j5c82ch2bv6zrnc2345ibfpafgx9")) + (patches + (search-patches "xorriso-no-partition-table-in-inner-efi.patch" + "xorriso-no-mbr-in-inner-efi.patch")))) (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/packages/patches/xorriso-no-mbr-in-inner-efi.patch b/gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch new file mode 100644 index 0000000000..a43889d2c6 --- /dev/null +++ b/gnu/packages/patches/xorriso-no-mbr-in-inner-efi.patch @@ -0,0 +1,47 @@ +https://dev.lovelyhq.com/libburnia/libisoburn/commit/1eb51f44dadb8b6c5f87533ca357186cdc1ac625 +diff --git a/frontend/grub-mkrescue-sed.sh b/frontend/grub-mkrescue-sed.sh +index b3948c99..dcd9d696 100755 +--- a/frontend/grub-mkrescue-sed.sh ++++ b/frontend/grub-mkrescue-sed.sh +@@ -120,6 +120,7 @@ fi + # "yes" overwrites the MBR partition table area in the EFI boot image by zeros. + # Some EFI implementations get stuck when seeing in the EFI partition a + # partition table entry which begins at LBA 0. ++# "extra" not only zeros the partition table but also the MBR signature. + efi_zero_inner_pt=no + if test -n "$MKRESCUE_SED_IN_EFI_NO_PT" + then +@@ -192,24 +193,31 @@ then + find "$dir" + fi + +-if test "$efi_zero_inner_pt" = yes ++if test "$efi_zero_inner_pt" = yes -o "$efi_zero_inner_pt" = extra + then + did_dd=0 + if test -e "$dir"/efi.img + then ++ # Look for 0x55 0xAA in bytes 510 and 511 + magic=$(dd bs=1 skip=510 count=2 if="$dir"/efi.img 2>/dev/null | \ + od -c | head -1 | awk '{print $2 " " $3}') + if test "$magic" = "U 252" + then ++ echo "Performing actions for MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2 + dd if=/dev/zero bs=1 seek=446 count=64 conv=notrunc of="$dir"/efi.img + did_dd=1 ++ if test "$efi_zero_inner_pt" = extra ++ then ++ dd if=/dev/zero bs=1 seek=510 count=2 conv=notrunc of="$dir"/efi.img ++ fi ++ echo >&2 + fi + fi + if test "$did_dd" = 0 + then + echo >&2 + echo "$0 : NOTE : No EFI image found or no MBR signature in it." >&2 +- echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=yes" >&2 ++ echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2 + echo >&2 + fi + fi diff --git a/gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch b/gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch new file mode 100644 index 0000000000..a719ca1f89 --- /dev/null +++ b/gnu/packages/patches/xorriso-no-partition-table-in-inner-efi.patch @@ -0,0 +1,107 @@ +https://dev.lovelyhq.com/libburnia/libisoburn/commit/3a2a3ba737a06162c22ace0ae09d33ba97aa2673 +diff --git a/frontend/grub-mkrescue-sed.sh b/frontend/grub-mkrescue-sed.sh +index d772ff22..b3948c99 100755 +--- a/frontend/grub-mkrescue-sed.sh ++++ b/frontend/grub-mkrescue-sed.sh +@@ -1,6 +1,6 @@ + #!/bin/sh + +-# Copyright (C) 2015 - 2016 ++# Copyright (C) 2015 - 2019 + # Thomas Schmitt , libburnia-project.org + # Provided under BSD license: Use, modify, and distribute as you like. + +@@ -117,6 +117,15 @@ fi + # command line.) + # Each argument must be a single word. No whitespace. No quotation marks. + ++# "yes" overwrites the MBR partition table area in the EFI boot image by zeros. ++# Some EFI implementations get stuck when seeing in the EFI partition a ++# partition table entry which begins at LBA 0. ++efi_zero_inner_pt=no ++if test -n "$MKRESCUE_SED_IN_EFI_NO_PT" ++then ++ efi_zero_inner_pt="$MKRESCUE_SED_IN_EFI_NO_PT" ++fi ++ + + # + # Do the work +@@ -183,12 +192,48 @@ then + find "$dir" + fi + ++if test "$efi_zero_inner_pt" = yes ++then ++ did_dd=0 ++ if test -e "$dir"/efi.img ++ then ++ magic=$(dd bs=1 skip=510 count=2 if="$dir"/efi.img 2>/dev/null | \ ++ od -c | head -1 | awk '{print $2 " " $3}') ++ if test "$magic" = "U 252" ++ then ++ dd if=/dev/zero bs=1 seek=446 count=64 conv=notrunc of="$dir"/efi.img ++ did_dd=1 ++ fi ++ fi ++ if test "$did_dd" = 0 ++ then ++ echo >&2 ++ echo "$0 : NOTE : No EFI image found or no MBR signature in it." >&2 ++ echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=yes" >&2 ++ echo >&2 ++ fi ++fi ++ + efi_tmp_name= ++if test x"$mode" = xmjg \ ++ -o x"$mode" = xmbr_only \ ++ -o x"$mode" = xgpt_appended \ ++ -o x"$mode" = xmbr_hfs ++then ++ # Move EFI partition image file out of the "$dir" tree, i.e. out of the ISO ++ efi_tmp_name=grub-mkrescue-sed-efi-img.$$ ++ if test -e "$dir"/efi.img ++ then ++ mv "$dir"/efi.img /tmp/$efi_tmp_name ++ elif test -e /tmp/$efi_tmp_name ++ then ++ rm /tmp/$efi_tmp_name ++ fi ++fi ++ + if test x"$mode" = xmjg + then + # Exchange arguments for the experimental GRUB2 mjg layout +- efi_tmp_name=grub-mkrescue-sed-efi-img.$$ +- mv "$dir"/efi.img /tmp/$efi_tmp_name + x=$(echo " $*" | sed \ + -e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition $partno 0xef \/tmp\/$efi_tmp_name/" \ + -e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_${partno}:all:: -no-emul-boot -isohybrid-gpt-basdat/" \ +@@ -207,8 +252,6 @@ then + elif test x"$mode" = xmbr_only + then + # Exchange arguments for no-HFS MBR-only layout +- efi_tmp_name=grub-mkrescue-sed-efi-img.$$ +- mv "$dir"/efi.img /tmp/$efi_tmp_name + x=$(echo " $*" | sed \ + -e "s/-efi-boot-part --efi-boot-image/$iso_mbr_part_type -no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name/" \ + -e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \ +@@ -228,8 +271,6 @@ then + elif test x"$mode" = xmbr_hfs + then + # Exchange arguments for MBR and HFS+ layout +- efi_tmp_name=grub-mkrescue-sed-efi-img.$$ +- mv "$dir"/efi.img /tmp/$efi_tmp_name + x=$(echo " $*" | sed \ + -e "s/-efi-boot-part --efi-boot-image/$iso_mbr_part_type -no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name/" \ + -e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \ +@@ -247,8 +288,6 @@ then + elif test x"$mode" = xgpt_appended + then + # Exchange arguments for no-HFS MBR-only layout +- efi_tmp_name=grub-mkrescue-sed-efi-img.$$ +- mv "$dir"/efi.img /tmp/$efi_tmp_name + x=$(echo " $*" | sed \ + -e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name -appended_part_as_gpt -partition_offset 16/" \ + -e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot/" \ diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 92b03b01ad..acfea12926 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 '()) + (grub-mkrescue-environment '())) "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 + '#$grub-mkrescue-environment + #$(bootloader-package bootloader) #$bootcfg-drv #$os "/xchg/guixsd.iso" @@ -673,7 +676,9 @@ to USB sticks meant to be read-only." #:bootloader (bootloader-configuration-bootloader (operating-system-bootloader os)) #:inputs `(("system" ,os) - ("bootcfg" ,bootcfg))) + ("bootcfg" ,bootcfg)) + #:grub-mkrescue-environment + '(("MKRESCUE_SED_MODE" . "mbr_hfs"))) (qemu-image #:name name #:os os #:bootcfg-drv bootcfg From debbugs-submit-bounces@debbugs.gnu.org Sun May 12 16:33:18 2019 Received: (at 35428) by debbugs.gnu.org; 12 May 2019 20:33:18 +0000 Received: from localhost ([127.0.0.1]:43434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPv9q-0003L7-DC for submit@debbugs.gnu.org; Sun, 12 May 2019 16:33:18 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:55132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPv9o-0003Kw-Fv for 35428@debbugs.gnu.org; Sun, 12 May 2019 16:33:17 -0400 Received: from localhost (unknown [185.17.13.127]) by dd26836.kasserver.com (Postfix) with ESMTPSA id B595A336076A for <35428@debbugs.gnu.org>; Sun, 12 May 2019 22:33:14 +0200 (CEST) Date: Sun, 12 May 2019 22:33:01 +0200 From: Danny Milosavljevic To: 35428@debbugs.gnu.org Subject: Re: [WIP v6] vm: Pass xorriso customizer. Message-ID: <20190512223254.5853bfda@scratchpost.org> In-Reply-To: <20190425183944.27492-1-dannym@scratchpost.org> References: <20190425170410.6438-1-dannym@scratchpost.org> <20190425183944.27492-1-dannym@scratchpost.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/JJFhrPuau3KtKub22B5I2uv"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 35428 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/JJFhrPuau3KtKub22B5I2uv Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Since this patch has seen successful testing on many machines, had input fr= om upstream and also provides a way to make our DVD images better, I'll push it to guix master in a week. If you don't want it to happen, or don't want it to happen before the guix 1.0.1 release, please speak up until then. --Sig_/JJFhrPuau3KtKub22B5I2uv Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlzYgv0ACgkQ5xo1VCww uqW1IwgApMAcahxy/fnNiRlipxRPNy1YJJxUb7IOUZ6t9csJqwbBwplyUdXXDhSd XFjIrMZCP3tRl6Ro4vv69VgtH0r9Q6MdZvVpCkhJclejjoJat7cvaCwt+5hs6D6G x5NHNj5fbhJx3GYx5Sr5bINJOCkmJcuYikXT79wgyINouTIw5eLNR1rLXGijj4Ky JK/wN69iJu48QDQ3B1cBTpszzZ9nxrfuS09IBHoaLORvWRTj7/xtN7CNxtc2/Sdw WoutYwwRIbouP/6floiqajWkTPQg0SdamTni40U2Vt2Zohfs7y41kW6GrAvvgvlZ MF8WGKVREoiBP7zYwIc0h/tDS7k2Gg== =1jjP -----END PGP SIGNATURE----- --Sig_/JJFhrPuau3KtKub22B5I2uv-- From debbugs-submit-bounces@debbugs.gnu.org Sun May 19 06:09:07 2019 Received: (at 35428-done) by debbugs.gnu.org; 19 May 2019 10:09:07 +0000 Received: from localhost ([127.0.0.1]:33854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSIkd-0003AS-3N for submit@debbugs.gnu.org; Sun, 19 May 2019 06:09:07 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:56990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSIkb-0003AH-6X for 35428-done@debbugs.gnu.org; Sun, 19 May 2019 06:09:05 -0400 Received: from localhost (unknown [185.17.13.127]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 72734336078D for <35428-done@debbugs.gnu.org>; Sun, 19 May 2019 12:09:03 +0200 (CEST) Date: Sun, 19 May 2019 12:09:01 +0200 From: Danny Milosavljevic To: 35428-done@debbugs.gnu.org Subject: Re: [WIP v6] vm: Pass xorriso customizer. Message-ID: <20190519120901.08cfc606@scratchpost.org> In-Reply-To: <20190425183944.27492-1-dannym@scratchpost.org> References: <20190425170410.6438-1-dannym@scratchpost.org> <20190425183944.27492-1-dannym@scratchpost.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/.gYGMe6v36M5f3C9dHb+V=J"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 35428-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/.gYGMe6v36M5f3C9dHb+V=J Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Pushed to guix master with changes to the commit message. Commit 1d86b05618a063378d7ffc89a9b4c33dd65a760c. --Sig_/.gYGMe6v36M5f3C9dHb+V=J Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlzhKz0ACgkQ5xo1VCww uqUv5QgAgUc8kFIUtxN+CcIJSJ/XfePDygzrx9NmzCrIJl0wHtWlOMlcovssTQHO NJgiiOBmYocvoajSaoHbzR/kyRsiTDZ0XKVO7D6T0oB6lKisp02GG+hosrlPLNBO qj9ukU8QtOBhp1A3oEvM5Q2M7KY0xCJSqdjjMK1CXA41m3hMfNwhAsi7GYdXgSJv vHu8kokn/8piBDS2WOmuabAwwIwtZHK6UPLbyrtYzExdoeycDH3nH5hRpP5coMEy 8y4GzWUXmci13xttxTYaDuVy5b71MLlxffxauQ6PbO614SAj1B0b3ciZSKHw2CuA ikBs0bE+G+KqHnaSIQI5yUchLy2thw== =oiHk -----END PGP SIGNATURE----- --Sig_/.gYGMe6v36M5f3C9dHb+V=J-- From unknown Sat Jun 21 03:30:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 16 Jun 2019 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator