From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1doSUd-00034Y-Hw for guix-patches@gnu.org; Sun, 03 Sep 2017 06:51:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1doSUY-0001kN-Uh for guix-patches@gnu.org; Sun, 03 Sep 2017 06:51:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:36164) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1doSUY-0001k5-RW for guix-patches@gnu.org; Sun, 03 Sep 2017 06:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1doSUY-0004Pl-J9 for guix-patches@gnu.org; Sun, 03 Sep 2017 06:51:02 -0400 Subject: [bug#28288] [PATCH 1/5] vm: Add support for registering closures to make-iso9660-image. References: <20170830071714.75f88e47@cbaines.net> In-Reply-To: <20170830071714.75f88e47@cbaines.net> Resent-Message-ID: From: Christopher Baines Date: Sun, 3 Sep 2017 11:50:37 +0100 Message-Id: <20170903105041.2925-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28288@debbugs.gnu.org This mimics the functionality in the root-partition-initializer used in creating the QEMU image. This helps when trying to run guix system init from the generated ISO image. * gnu/build/vm.scm (make-iso9660-image): Add support for registering closures. --- gnu/build/vm.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 727494ad9..606257d8c 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -366,12 +366,27 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation." (error "failed to create GRUB EFI image")))) (define* (make-iso9660-image grub config-file os-drv target - #:key (volume-id "GuixSD_image") (volume-uuid #f)) + #:key (volume-id "GuixSD_image") (volume-uuid #f) + register-closures? (closures '())) "Given a GRUB package, creates an iso image as TARGET, using CONFIG-FILE as GRUB configuration and OS-DRV as the stuff in it." - (let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue"))) + (let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue")) + (target-store (string-append "/tmp/root" (%store-directory)))) (mkdir-p "/tmp/root/var/run") (mkdir-p "/tmp/root/run") + + (mkdir-p target-store) + (mount (%store-directory) target-store "" MS_BIND) + + (when register-closures? + (display "registering closures...\n") + (for-each (lambda (closure) + (register-closure + "/tmp/root" + (string-append "/xchg/" closure) + #:deduplicate? #f)) + closures)) + (unless (zero? (apply system* `(,grub-mkrescue "-o" ,target ,(string-append "boot/grub/grub.cfg=" config-file) -- 2.14.1