From patchwork Wed May 27 07:24:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22402 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6659127BBE4; Wed, 27 May 2020 08:25:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 6B0D927BBE1 for ; Wed, 27 May 2020 08:25:09 +0100 (BST) Received: from localhost ([::1]:60742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdqR2-0004zm-S1 for patchwork@mira.cbaines.net; Wed, 27 May 2020 03:25:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdqQw-0004zE-Nd for guix-patches@gnu.org; Wed, 27 May 2020 03:25:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdqQw-00019s-Du for guix-patches@gnu.org; Wed, 27 May 2020 03:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdqQw-0003hk-91 for guix-patches@gnu.org; Wed, 27 May 2020 03:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41560] [PATCH 1/8] bootloader: Add 'disk-image-installer'. References: <20200527072219.25576-1-othacehe@gnu.org> In-Reply-To: <20200527072219.25576-1-othacehe@gnu.org> Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 07:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41560@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 41560-submit@debbugs.gnu.org id=B41560.159056427814128 (code B ref 41560); Wed, 27 May 2020 07:25:02 +0000 Received: (at 41560) by debbugs.gnu.org; 27 May 2020 07:24:38 +0000 Received: from localhost ([127.0.0.1]:48073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQY-0003fi-0G for submit@debbugs.gnu.org; Wed, 27 May 2020 03:24:38 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:44209) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQV-0003fB-Qz for 41560@debbugs.gnu.org; Wed, 27 May 2020 03:24:36 -0400 Received: by mail-wr1-f48.google.com with SMTP id y17so14532536wrn.11 for <41560@debbugs.gnu.org>; Wed, 27 May 2020 00:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5S2+4M+/c3csQQztFclcjyx2E1AOmX0FPz6iYoz78Fw=; b=IUU5FctSnXjV5qeUlxdg1XVQhd18rr0KzVNn9aBTPjphOSSDOAaMwDamRXIeqlopCG D+D4IxIbdxlRWHXShHkyvApEPyz/Xhuz5f46mCvq2zMiiXkRsDOUAzkJy3KNsDbEE6SD E0BnOUYvqdUkEW2fJPNnTQ9KXGiiO0HdPxPqkmppdwNmIr4fdtYUIrK1rHnp7/O8aJjs 3Pt6usD9P8zTvxfmvA2U5/ageYRCYyRM3dhfnnmKMUmZgXWMJWBm85sz6jaWdnD+rzqR fDvyEatOKS4VL32KohcZ7dJJkz4tP9Hnqfagelxu/8o5FXaLS2U3CU72cb7fG5O+99s3 4aUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5S2+4M+/c3csQQztFclcjyx2E1AOmX0FPz6iYoz78Fw=; b=N9ezcKpvI7zdhUYBm6U3Mn4rtIcdJCqBT7fMALDLp2xzmrM2i7/JXaQPlbc2k7QoJA WFODhlC7kC3sQY1DqtyAW7fvfEzfVIuuODLquAb5oboSLOa6aXH3vw3u069eWcNM1Dvx PCW2p0doE8A1WJ0njsuFEM2UgaYtaoRVpMSepA0TBPSJO5Xwq2dxMyRSpBMDZxF58p/U 26L8deixMkQHrYVtUSVpwS11LpZnToIx0yxStWJ8R9aq5OlmIH2Yj949WS1AShExfgr1 cg9trDglLdF8Vl+eyS79TxvVL1dbDu+If0DA80U3OEOGsfsE5R49SyvL17CM23m62uuL HFEA== X-Gm-Message-State: AOAM532FPLQ/qzxuupTti7wVbNDX7HEaEr7zJFw6mJX4Efo9DuUS7gPj KoFun5K9Q2AkPyy6CBexm/6joDQ0ECs= X-Google-Smtp-Source: ABdhPJzSTRVR+Q+en/ZGk/e97RtRc0N4rumikUXCeTPL4qLx2OBQmr9faNEn0Jh+3M4x7UWop6rouQ== X-Received: by 2002:a5d:4f09:: with SMTP id c9mr5496824wru.3.1590564269174; Wed, 27 May 2020 00:24:29 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:e5a2:3f70:d249:6ce9]) by smtp.gmail.com with ESMTPSA id v28sm2002845wra.77.2020.05.27.00.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:24:28 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Wed, 27 May 2020 09:24:13 +0200 Message-Id: <20200527072420.26140-1-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/bootloader.scm ()[disk-image-installer]: New field, (bootloader-disk-image-installer): export it. * gnu/bootloader/grub.scm (install-grub-disk-image): New procedure ... (grub-bootloader): ... used as "disk-image-installer" here. (grub-efi-bootloader): set "disk-image-installer" to #f. * gnu/system/image.scm (root-partition?, find-root-partition): Move to "Helpers" section. (root-partition-index): New procedure. (system-disk-image): Honor disk-image-installer, and use it to install the bootloader directly on the disk-image, if supported. --- gnu/bootloader.scm | 5 ++++- gnu/bootloader/grub.scm | 45 ++++++++++++++++++++++++++++++++++++++++- gnu/system/image.scm | 33 +++++++++++++++++++++--------- 3 files changed, 71 insertions(+), 12 deletions(-) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index 01bdd4acaa..668caa7fc3 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 David Craven -;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2017, 2020 Mathieu Othacehe ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2019 Ludovic Courtès ;;; @@ -42,6 +42,7 @@ bootloader-name bootloader-package bootloader-installer + bootloader-disk-image-installer bootloader-configuration-file bootloader-configuration-file-generator @@ -125,6 +126,8 @@ record." (name bootloader-name) (package bootloader-package) (installer bootloader-installer) + (disk-image-installer bootloader-disk-image-installer + (default #f)) (configuration-file bootloader-configuration-file) (configuration-file-generator bootloader-configuration-file-generator)) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index bb40c551a7..74dc00480f 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2016 Chris Marusich ;;; Copyright © 2017 Leo Famulari -;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2017, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020 Maxim Cournoyer ;;; @@ -436,6 +436,47 @@ fi~%")))) "--boot-directory" install-dir device)))) +(define install-grub-disk-image + #~(lambda (bootloader root-index image) + ;; Install GRUB on the given IMAGE. The root partition index is + ;; ROOT-INDEX. + (let ((grub-mkimage + (string-append bootloader "/bin/grub-mkimage")) + (modules '("biosdisk" "part_msdos" "fat" "ext2")) + (grub-bios-setup + (string-append bootloader "/sbin/grub-bios-setup")) + (root-device (format #f "hd0,msdos~a" root-index)) + (boot-img (string-append bootloader "/lib/grub/i386-pc/boot.img")) + (device-map "device.map")) + + ;; Create a minimal, standalone Grub image that will be written + ;; directly in the MBR-GAP (space between the end of the MBR and the + ;; first partition). + (apply invoke grub-mkimage + "-O" "i386-pc" + "-o" "core.img" + "-p" (format #f "(~a)/boot/grub" root-device) + modules) + + ;; Create a device mapping file. + (call-with-output-file device-map + (lambda (port) + (format port "(hd0) ~a~%" image))) + + ;; Copy the default boot.img, that will be written on the MBR sector + ;; by GRUB-BIOS-SETUP. + (copy-file boot-img "boot.img") + + ;; Install both the "boot.img" and the "core.img" files on the given + ;; IMAGE. On boot, the MBR sector will execute the minimal Grub + ;; written in the MBR-GAP. Grub configuration and missing modules will + ;; be read from ROOT-DEVICE. + (invoke grub-bios-setup + "-m" device-map + "-r" root-device + "-d" "." + image)))) + (define install-grub-efi #~(lambda (bootloader efi-dir mount-point) ;; Install GRUB onto the EFI partition mounted at EFI-DIR, for the @@ -465,6 +506,7 @@ fi~%")))) (name 'grub) (package grub) (installer install-grub) + (disk-image-installer install-grub-disk-image) (configuration-file "/boot/grub/grub.cfg") (configuration-file-generator grub-configuration-file))) @@ -480,6 +522,7 @@ fi~%")))) (bootloader (inherit grub-bootloader) (installer install-grub-efi) + (disk-image-installer #f) (name 'grub-efi) (package grub-efi))) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index a1214dd20a..ffc746fcf5 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -147,6 +147,19 @@ (guix build utils)) gexp* ...)))) +(define (root-partition? partition) + "Return true if PARTITION is the root partition, false otherwise." + (member 'boot (partition-flags partition))) + +(define (find-root-partition image) + "Return the root partition of the given IMAGE." + (srfi-1:find root-partition? (image-partitions image))) + +(define (root-partition-index image) + "Return the index of the root partition of the given IMAGE." + (1+ (srfi-1:list-index identity + (map root-partition? (image-partitions image))))) + ;; ;; Disk image. @@ -276,9 +289,17 @@ image ~a { (let* ((substitutable? (image-substitutable? image)) (builder (with-imported-modules* - (let ((inputs '#+(list genimage coreutils findutils))) + (let ((inputs '#+(list genimage coreutils findutils)) + (bootloader-installer + #+(bootloader-disk-image-installer bootloader))) (set-path-environment-variable "PATH" '("bin" "sbin") inputs) - (genimage #$(image->genimage-cfg image) #$output)))) + (genimage #$(image->genimage-cfg image) #$output) + ;; Install the bootloader directly on the disk-image. + (when bootloader-installer + (bootloader-installer + #+(bootloader-package bootloader) + #$(root-partition-index image) + (string-append #$output "/" #$genimage-name)))))) (image-dir (computed-file "image-dir" builder))) (computed-file name #~(symlink @@ -371,14 +392,6 @@ used in the image. " ;; Image creation. ;; -(define (root-partition? partition) - "Return true if PARTITION is the root partition, false otherwise." - (member 'boot (partition-flags partition))) - -(define (find-root-partition image) - "Return the root partition of the given IMAGE." - (srfi-1:find root-partition? (image-partitions image))) - (define (image->root-file-system image) "Return the IMAGE root partition file-system type." (let ((format (image-format image))) From patchwork Wed May 27 07:24:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22401 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1534227BBE3; Wed, 27 May 2020 08:25:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id D998027BBE1 for ; Wed, 27 May 2020 08:25:08 +0100 (BST) Received: from localhost ([::1]:60734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdqR2-0004zT-DP for patchwork@mira.cbaines.net; Wed, 27 May 2020 03:25:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdqQw-0004z6-74 for guix-patches@gnu.org; Wed, 27 May 2020 03:25:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdqQv-00019a-UZ for guix-patches@gnu.org; Wed, 27 May 2020 03:25:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdqQv-0003hd-Q2 for guix-patches@gnu.org; Wed, 27 May 2020 03:25:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41560] [PATCH 2/8] bootloader: grub: Do not run grub-install when creating a disk-image. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 07:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41560@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 41560-submit@debbugs.gnu.org id=B41560.159056427814121 (code B ref 41560); Wed, 27 May 2020 07:25:01 +0000 Received: (at 41560) by debbugs.gnu.org; 27 May 2020 07:24:38 +0000 Received: from localhost ([127.0.0.1]:48071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQX-0003ff-Mv for submit@debbugs.gnu.org; Wed, 27 May 2020 03:24:37 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:43544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQV-0003fC-VQ for 41560@debbugs.gnu.org; Wed, 27 May 2020 03:24:36 -0400 Received: by mail-wr1-f48.google.com with SMTP id l10so173297wrr.10 for <41560@debbugs.gnu.org>; Wed, 27 May 2020 00:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BgTj7PTmxxefv/dBu9Fx+q0q6Iir2Cg10K89JY/ujwA=; b=FLGDEtMMh0pAHriIo9xFNavkF9EayV+Kj5pTc6XiDN7Z3TKHFxMbuy4/j9RYSLr7n3 eNhC+25BX1zJCaeU7WCX9Zerue+6QI8f0QqC7wSAwdRBvRJ9ClIXBYn+Zp0REnjR3N8z ZFhusmmCY6X4UHHovFuwf4Tp2yuE8rG+titvqtuRW2CX9vfeRf56fMp4Bpq53Ds2d77m j48Hckqtaqr4Az/ii/O4+jPbVMsEIKQEtNMbYMJ6srqHrt5A23RZxdX52mLrh7eBPhEi T3jeSdKaTDUch8x+IVYC6Kk0c/W5Q2AGC4QkFMLq6q7K6XGvWW88+XwcpTLIITeAko+E BcuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BgTj7PTmxxefv/dBu9Fx+q0q6Iir2Cg10K89JY/ujwA=; b=X14AInjEPReCiHikxCLkNCr+jCfbTMOoalWUUDFyAtDhXZI4LE6oDix9miCdvKfjNH 9GMra1+1U/vOWdCJAWLx20to9jMsGSZDJ4J99XnfQnlSusSZox9qUrHtd1oSHqFEzir7 jHCFa52cbNwMe2YarTTsN/9OoCjv1vq7JcmN0ETLgV7HQhOgjsyBiiWexOZdOgcel4d9 vSxAQDvzalnwSst9xMUEoC3q3n3B89uvphVHB+OQvhMsltX45yejr4L4EycvtnJL2OgV rfOjh6+6s24zpLEjRH/oj/Ga8lO6PcCrIfCrtWLnMSoA59VeZUtXu4ArZS3uum7bU6rD 5qrg== X-Gm-Message-State: AOAM533QqwbwVP2XjjkIgI56E4Q+AumBY84trC6BVJ4L7kYK89iKPKWu qPd889LMyrr6i7NgQDb0h/KgP0CBDsY= X-Google-Smtp-Source: ABdhPJw3dXOkQSbB7J9zb4VdQzt41EUBsPqIj4CVQCrPkV+BR9MzMhTvtD6HeDMP11ECZsYlh5DQLA== X-Received: by 2002:adf:f611:: with SMTP id t17mr12956979wrp.69.1590564270176; Wed, 27 May 2020 00:24:30 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:e5a2:3f70:d249:6ce9]) by smtp.gmail.com with ESMTPSA id v28sm2002845wra.77.2020.05.27.00.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:24:29 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Wed, 27 May 2020 09:24:14 +0200 Message-Id: <20200527072420.26140-2-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527072420.26140-1-othacehe@gnu.org> References: <20200527072420.26140-1-othacehe@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/bootloader/grub.scm (install-grub): When creating a disk-image, grub-install will fail because it lacks root permissions. In that case, do not run grub-install and only copy Grub modules to the /boot directory. --- gnu/bootloader/grub.scm | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 74dc00480f..29bec92196 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -423,18 +423,24 @@ fi~%")))) (define install-grub #~(lambda (bootloader device mount-point) - ;; Install GRUB on DEVICE which is mounted at MOUNT-POINT. (let ((grub (string-append bootloader "/sbin/grub-install")) (install-dir (string-append mount-point "/boot"))) - ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or - ;; root partition. - (setenv "GRUB_ENABLE_CRYPTODISK" "y") - - ;; Hide potentially confusing messages from the user, such as - ;; "Installing for i386-pc platform." - (invoke/quiet grub "--no-floppy" "--target=i386-pc" - "--boot-directory" install-dir - device)))) + ;; Install GRUB on DEVICE which is mounted at MOUNT-POINT. If device + ;; is #f we are creating a disk-image. + (if device + (begin + ;; Tell 'grub-install' that there might be a LUKS-encrypted + ;; /boot or root partition. + (setenv "GRUB_ENABLE_CRYPTODISK" "y") + + ;; Hide potentially confusing messages from the user, such as + ;; "Installing for i386-pc platform." + (invoke/quiet grub "--no-floppy" "--target=i386-pc" + "--boot-directory" install-dir + device)) + ;; When creating a disk-image, only install Grub modules. + (copy-recursively (string-append bootloader "/lib/") + install-dir))))) (define install-grub-disk-image #~(lambda (bootloader root-index image) From patchwork Wed May 27 07:24:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22406 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4C4FB27BBE3; Wed, 27 May 2020 08:25:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id D251527BBE1 for ; Wed, 27 May 2020 08:25:16 +0100 (BST) Received: from localhost ([::1]:33132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdqRA-0005Gz-DQ for patchwork@mira.cbaines.net; Wed, 27 May 2020 03:25:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdqQx-0004zK-2L for guix-patches@gnu.org; Wed, 27 May 2020 03:25:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36546) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdqQw-00019y-Q7 for guix-patches@gnu.org; Wed, 27 May 2020 03:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdqQw-0003hs-NE for guix-patches@gnu.org; Wed, 27 May 2020 03:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41560] [PATCH 3/8] bootloader: grub: Use inheritance to define grub-minimal-bootloader. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 07:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41560@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 41560-submit@debbugs.gnu.org id=B41560.159056428514169 (code B ref 41560); Wed, 27 May 2020 07:25:02 +0000 Received: (at 41560) by debbugs.gnu.org; 27 May 2020 07:24:45 +0000 Received: from localhost ([127.0.0.1]:48080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQe-0003gS-O4 for submit@debbugs.gnu.org; Wed, 27 May 2020 03:24:44 -0400 Received: from mail-wr1-f52.google.com ([209.85.221.52]:42105) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQX-0003fE-3W for 41560@debbugs.gnu.org; Wed, 27 May 2020 03:24:37 -0400 Received: by mail-wr1-f52.google.com with SMTP id s8so22880202wrt.9 for <41560@debbugs.gnu.org>; Wed, 27 May 2020 00:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b6gAbAXk7mSId+VcsNLp/kq0nzKzexZBANc9WFo4R6o=; b=l/qW2fJnKGaYN9AI5qQZEqqGyjb50jA+D0RJBJcs+cZFmq3WuY/Kir+ceVwd8lz3ai WZD0s5RUcAHuX2v6XgGLCtfmhE4j5OcRdEW6uls2bzWAetJnvT2J9GWYjX8l7bYXUkSQ dAtffbTtHyWuu53UX0TvovYMiCHzQ1CRlfLYGuZQ6y9adOx2N/JQPU15RtYU3jbDL7oF eX+0GNv3NIOW3K6WH3CLsAXXB7PeHX04ekqEjmvx7og9etI+OBzMDh2TwKVEM9uqy65A zrO8J/h6flWajgGM+/yo5oKKKkiyKUa6pWC3ZlDHAQ4lCvKktUS48B96SNbTJrlvKPZn qJyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b6gAbAXk7mSId+VcsNLp/kq0nzKzexZBANc9WFo4R6o=; b=r7mkhvUyJ+AlEyzCbjDN1hwIpqvEVQ686B2F4xJj5wr3v0BnjHCe5eISDtCq0TCy4J X4QEmUCu5GwHxIkV9H7R41rvkBQ+5rqM8cW0n4z9eY8JQ32sbMCJ6WI+zJKsMJJLlM4t vQJjbdRQjLBs1SNUiPIi1lz000SFxY1RhnXGc9MCVeVawzDGmWvnMemcRAxdj9fKAfK1 hKBJyRMxvo+AlaBACipJhne572fwZfecqOBQr7ReKU+paK3Np6W4drlpXSASX9JFq5WS z6VgoXuw+4vRoT6/18/2kLChnc5tvjR93B3ZBmvvf5GH+lbjjlQD/R+AIBZzETGaNWKa sD6A== X-Gm-Message-State: AOAM531sHFy5R5GzzLUrfX/slLDXvi67v7/WMtxpyZR7LAsROcP+8L0J L1uvdIt+m5vQ0PAuG79WOmyGbPokU0A= X-Google-Smtp-Source: ABdhPJxpQ2DFUQNIHL+sMUA2PiVin4LZrEfzT8dKLA1MZs+0ZXxUG2oouyKlkIzwdHibGgX11+LqaQ== X-Received: by 2002:adf:f207:: with SMTP id p7mr23569252wro.206.1590564271283; Wed, 27 May 2020 00:24:31 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:e5a2:3f70:d249:6ce9]) by smtp.gmail.com with ESMTPSA id v28sm2002845wra.77.2020.05.27.00.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:24:30 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Wed, 27 May 2020 09:24:15 +0200 Message-Id: <20200527072420.26140-3-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527072420.26140-1-othacehe@gnu.org> References: <20200527072420.26140-1-othacehe@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/bootloader/grub.scm (grub-minimal-bootloader): Inherit from grub-bootloader to avoid field redefinition. --- gnu/bootloader/grub.scm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 29bec92196..388f29d3a8 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -516,13 +516,10 @@ fi~%")))) (configuration-file "/boot/grub/grub.cfg") (configuration-file-generator grub-configuration-file))) -(define grub-minimal-bootloader +(define* grub-minimal-bootloader (bootloader - (name 'grub) - (package grub-minimal) - (installer install-grub) - (configuration-file "/boot/grub/grub.cfg") - (configuration-file-generator grub-configuration-file))) + (inherit grub-bootloader) + (package grub-minimal))) (define* grub-efi-bootloader (bootloader From patchwork Wed May 27 07:24:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22405 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A7DA227BBE3; Wed, 27 May 2020 08:25:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 519BA27BBE1 for ; Wed, 27 May 2020 08:25:16 +0100 (BST) Received: from localhost ([::1]:33080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdqR9-0005Ff-S4 for patchwork@mira.cbaines.net; Wed, 27 May 2020 03:25:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdqQx-0004zR-Gb for guix-patches@gnu.org; Wed, 27 May 2020 03:25:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36547) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdqQx-0001A2-7h for guix-patches@gnu.org; Wed, 27 May 2020 03:25:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdqQx-0003hz-54 for guix-patches@gnu.org; Wed, 27 May 2020 03:25:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41560] [PATCH 4/8] image: Add bootloader installation support. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 07:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41560@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 41560-submit@debbugs.gnu.org id=B41560.159056428814180 (code B ref 41560); Wed, 27 May 2020 07:25:03 +0000 Received: (at 41560) by debbugs.gnu.org; 27 May 2020 07:24:48 +0000 Received: from localhost ([127.0.0.1]:48082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQf-0003gU-0O for submit@debbugs.gnu.org; Wed, 27 May 2020 03:24:48 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:46857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQY-0003fH-Kq for 41560@debbugs.gnu.org; Wed, 27 May 2020 03:24:39 -0400 Received: by mail-wr1-f45.google.com with SMTP id x6so9314496wrm.13 for <41560@debbugs.gnu.org>; Wed, 27 May 2020 00:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3u6s9vKgGdEf0fP5fd97l00XZVvE5+/6SAPejDuI1Rk=; b=cXODQtjsQfOCTK3bUpmvdtBPnR02WIn5XN0tqrchie3bgAQW9F1gNUgHOr2eMv4m+U thVacMG1S2AVt63m5RFHoDkzr1/Sl5BOm6Cungbe36NQEny3xYfRUD9XZogNuWzzop1X 0mIG7dxfNrrnd07Kgo7UfQ1aaTNoVsIY/zBqekodTHhplyNh46trxpJiH1mfX6gCCfGa yhUOf4JguDF7XY9AUJJ/c9w55/VAkscVyqBzpPjDeL7wduKp0+PUdShQBbRMChEz5hYO 4RNiU7Zw0I3EdLmO7QkukqVMavpXZ9jpVHQhZrQA/3eNC7scmPjq7d4X+JR8E0/hroP6 RsyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3u6s9vKgGdEf0fP5fd97l00XZVvE5+/6SAPejDuI1Rk=; b=N4CqybXkb32eeUiSgrp7UVRUALovDVHi9EB9FI2w2JzL7ZMvCNfYsDXSfmjJJ+SwtF IPnQM0nAg+MjlcF9TpOyOSBk7FePpel4tSYCDJ5Pexd0IsqnAz56r2X+Nxh163MvrOQc KoyB+NpAG8E+SpldEUIiyS5sRob2cTwyas09AMmKRD9cAHhHG0kY/pMruqAe+nAxFWtP I8FkeD3A+HUR+y6ZFdCHe/gS7LiHAHIBXAc+DYwu6tirXPf+LwTo+x/wYXHYlGkvmO39 XrISi3sgBwrTy0SGAHPfeDdD/sdcCXgQFZVrQwv53ztU0DPk0xalYeno5xAsWWd8tDN4 m5hA== X-Gm-Message-State: AOAM533sJbyDSPLHMD04/Q69Gl+jsVoyX0aMPA/KttWcpYyzU71uk6q8 7/s9Myc50+WEDUDar37sWt5wEYy541w= X-Google-Smtp-Source: ABdhPJzGqsFpidDfKHAhDIVANe6lcklDbNCVjMJ1s/YGXVpqXNSjjAGAEuBIFHqGilZ6Xz3wiSPB5Q== X-Received: by 2002:adf:9f48:: with SMTP id f8mr23546478wrg.228.1590564272795; Wed, 27 May 2020 00:24:32 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:e5a2:3f70:d249:6ce9]) by smtp.gmail.com with ESMTPSA id v28sm2002845wra.77.2020.05.27.00.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:24:31 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Wed, 27 May 2020 09:24:16 +0200 Message-Id: <20200527072420.26140-4-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527072420.26140-1-othacehe@gnu.org> References: <20200527072420.26140-1-othacehe@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/build/image.scm (initialize-root-partition): Add bootloader-package and bootloader-installer arguments. Run the bootloader-installer if defined. * gnu/system/image.scm (system-disk-image): Adapt the partition initializer call accordingly. --- gnu/build/image.scm | 5 +++++ gnu/system/image.scm | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gnu/build/image.scm b/gnu/build/image.scm index b37ea9332a..49faeab466 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -155,6 +155,8 @@ deduplicates files common to CLOSURE and the rest of PREFIX." #:key bootcfg bootcfg-location + bootloader-package + bootloader-installer (deduplicate? #t) references-graphs (register-closures? #t) @@ -178,6 +180,9 @@ of the directory of the 'system' derivation." #:deduplicate? deduplicate?)) references-graphs)) + (when bootloader-installer + (display "installing bootloader...\n") + (bootloader-installer bootloader-package #f root)) (when bootcfg (install-boot-config bootcfg bootcfg-location root))) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index ffc746fcf5..6608991fdc 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -236,7 +236,9 @@ used in the image." #:deduplicate? #f #:system-directory #$os #:bootloader-package - #$(bootloader-package bootloader) + #+(bootloader-package bootloader) + #:bootloader-installer + #+(bootloader-installer bootloader) #:bootcfg #$bootcfg #:bootcfg-location #$(bootloader-configuration-file bootloader))))) From patchwork Wed May 27 07:24:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22407 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B36F227BBE3; Wed, 27 May 2020 08:25:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 636DA27BBE1 for ; Wed, 27 May 2020 08:25:22 +0100 (BST) Received: from localhost ([::1]:33762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdqRG-0005WX-06 for patchwork@mira.cbaines.net; Wed, 27 May 2020 03:25:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdqQx-0004zo-VD for guix-patches@gnu.org; Wed, 27 May 2020 03:25:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdqQx-0001AB-LY for guix-patches@gnu.org; Wed, 27 May 2020 03:25:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdqQx-0003i7-It for guix-patches@gnu.org; Wed, 27 May 2020 03:25:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41560] [PATCH 5/8] system: image: Correct genimage configuration file indentation. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 07:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41560@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 41560-submit@debbugs.gnu.org id=B41560.159056429014191 (code B ref 41560); Wed, 27 May 2020 07:25:03 +0000 Received: (at 41560) by debbugs.gnu.org; 27 May 2020 07:24:50 +0000 Received: from localhost ([127.0.0.1]:48084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQk-0003go-Ho for submit@debbugs.gnu.org; Wed, 27 May 2020 03:24:50 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:43552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQZ-0003fJ-UE for 41560@debbugs.gnu.org; Wed, 27 May 2020 03:24:40 -0400 Received: by mail-wr1-f50.google.com with SMTP id l10so173446wrr.10 for <41560@debbugs.gnu.org>; Wed, 27 May 2020 00:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lCaiU3oVhoaMI8IAJjGOm2w8TG7DFala0bFWrXuga3Y=; b=o46bl9K8y39s0bAMFzN/7egeewVhGzV1b5B4BOtYdg8z0o7SuharcCp/BzTKaHTuC9 ad/cIi7tQ/5hZLEvQYzHcPHeTDWI6ZaaB6aHltemUOrY27Pxy69XDLOKuYYJqhB1dJQj LUcD9yDXolC+qslRpZInwrQhRkCgSZ5ubIZwH+Sm4PU+8kjjgv3KHm1DfOCOZMVq3I+6 O5IG/0juWLlIWDW3NH8pO/MfwuLXmILEn3jMsewu6I146qyfrPhMJARAgESAjo6u2IJQ G/d8m3+LeHfp+piap1dpmfISUM3dxqZHHtZh1MkvG8xFVS2gUIgvD/6NbLb+0miW7/rW UoNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lCaiU3oVhoaMI8IAJjGOm2w8TG7DFala0bFWrXuga3Y=; b=rCHgiioDGeOeSIziuBg08amyeAb/Lvhcu3ERPxS8p7O3weOlQP00ZQuvaW6dI1R4mw Zq+9/PwoRnZoTwcK/D4tqeuXPgo9RsC4GWqCcn/u2x9FN6Xy/HBT89dXy/MV09ADJBqL WNztLq3ypBxIuwCw1WfjrfGwKylBNN1F0kSlhZn8zeN0QSh3CLTDXvezLPn+0m5zypH2 UdK/wo68O04IZvuctb//Ns7il71dZr2q//30zC7x0gZf14MXN6IISQDPX8SCXHc5LMF6 E7GVWe90jIqo9ROQPnPymgFl7S1si/8nQrpOn+mZO/qKNUg4WWQ1Wo7+QyF3PcR6Rz/w pv8w== X-Gm-Message-State: AOAM532oUf+Y9Zhe+zdgxgm7E+A8xVaZ/uo4xS0bL2KIb3R8cd23LdSa wu1E2j91vO2lhu98K39T17w3OHHmqMk= X-Google-Smtp-Source: ABdhPJzdw1wDYp/aQl2ADhXEw+TpUQS0iojbqNP1vhjqYkS79D0vc6vuZ/fKRsM6l/5dwS8h2yiYSw== X-Received: by 2002:a05:6000:1150:: with SMTP id d16mr23414840wrx.197.1590564273943; Wed, 27 May 2020 00:24:33 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:e5a2:3f70:d249:6ce9]) by smtp.gmail.com with ESMTPSA id v28sm2002845wra.77.2020.05.27.00.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:24:33 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Wed, 27 May 2020 09:24:17 +0200 Message-Id: <20200527072420.26140-5-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527072420.26140-1-othacehe@gnu.org> References: <20200527072420.26140-1-othacehe@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/system/image.scm (system-disk-image): Fix genimage configuration file indentation. --- gnu/system/image.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 6608991fdc..7ac998d861 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -262,10 +262,10 @@ used in the image." (image (partition-image partition)) (offset (partition-offset partition))) #~(format #f "~/partition ~a { - ~/~/partition-type = ~a - ~/~/image = \"~a\" - ~/~/offset = \"~a\" - ~/}" +~/~/partition-type = ~a +~/~/image = \"~a\" +~/~/offset = \"~a\" +~/}" #$label #$dos-type #$image From patchwork Wed May 27 07:24:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22408 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7AFA227BBE3; Wed, 27 May 2020 08:25:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id F2CA227BBE1 for ; Wed, 27 May 2020 08:25:27 +0100 (BST) Received: from localhost ([::1]:33974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdqRL-0005bl-Ip for patchwork@mira.cbaines.net; Wed, 27 May 2020 03:25:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdqQy-00050x-Gy for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36549) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdqQy-0001AN-66 for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdqQy-0003iG-1a for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41560] [PATCH 6/8] image: Use grub-efi to install the EFI bootloader. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 07:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41560@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 41560-submit@debbugs.gnu.org id=B41560.159056429114198 (code B ref 41560); Wed, 27 May 2020 07:25:03 +0000 Received: (at 41560) by debbugs.gnu.org; 27 May 2020 07:24:51 +0000 Received: from localhost ([127.0.0.1]:48086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQk-0003gq-QA for submit@debbugs.gnu.org; Wed, 27 May 2020 03:24:51 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:36799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQb-0003fM-C6 for 41560@debbugs.gnu.org; Wed, 27 May 2020 03:24:41 -0400 Received: by mail-wr1-f45.google.com with SMTP id q11so10789347wrp.3 for <41560@debbugs.gnu.org>; Wed, 27 May 2020 00:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ni5lXcHWJaLrQqDdGrXvrHB9x+BF6iJJ8ZFOTLyTxrY=; b=KV1of+KRWXhVyC/jRGu13Yj60RHD7rSyS/XcvLVKK7GbnyFoggYfY+qSMP7jqFm7mo CicOJTu192+wCDJb4f3Z3t5Xj5GQy9WIibqQO3MiIG45nqj6CzkNfdzbJKEtF87Ztz8P MdjM0APeGAyViL1otfrYCm4Rsr+lwaWf8wDQi5s0jP/iw7pMOe1idbFkgZwvze5VgwVL 7AiXEa4rvU7mCv4qw8TEDxiW5qmIDRES0wxcsc0NaRLPz4dVE3iEyUOHVVUZ3tzIJPCX 58t8c/Yn3uhrGjHQ2dLQ8SjDyv2XAtGgr8VyfjNCgAWWoz7vklwKf8JST1mcv9uZ0UAK HOMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ni5lXcHWJaLrQqDdGrXvrHB9x+BF6iJJ8ZFOTLyTxrY=; b=b93VfcSDlyiyE0joaCPt+rETC1DOkS2uuPezmX41reXugBU9RwSAJfLHHGRT+LHIie WZrfjz18RDtn4GzR19OfX2w/Vo4kNCqehUCHm8dXq3XbPrXEgwfzsDVQZMXNpvBidnaL 6xlmr/KUFtgpvUSYYteO1dD9y/nahf+b1MriolJ1GuJ/upjBHQ3XN7ZBgLq+BZKvFpHm S48zNNijL5UUSNcKn2K8leR+y4sAcm5o0Aw6zIzj6SeWC6crae/kHg8/Lh3ofuQ/oFUt LLdxt2Wp2QD7iFhTMuZvOVUMzKwK+oIuFhRjCTppNUac2SylP5Q7VYdj6z6qwOTrB27K TqKg== X-Gm-Message-State: AOAM532133pL4w4cjDviCI1+ESqimoxjxE+MKDOL86K1wqL4EtDAGeMK gLxml2oF7zyw+wAE18BfFhJYalT4bVc= X-Google-Smtp-Source: ABdhPJxrLznZh4TgpGso4ZcC5Cm7vPNhMYcSoDVi2aFiq/Yvt50t7GHNOs4yVcpQ4Hzgwry519nkfA== X-Received: by 2002:a5d:650f:: with SMTP id x15mr23371379wru.100.1590564275096; Wed, 27 May 2020 00:24:35 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:e5a2:3f70:d249:6ce9]) by smtp.gmail.com with ESMTPSA id v28sm2002845wra.77.2020.05.27.00.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:24:34 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Wed, 27 May 2020 09:24:18 +0200 Message-Id: <20200527072420.26140-6-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527072420.26140-1-othacehe@gnu.org> References: <20200527072420.26140-1-othacehe@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/utils.scm (target-intel?): New exported procedure. * gnu/build/image.scm (initialize-efi-partition): Rename bootloader-package argument to grub-efi. * gnu/system/image.scm (system-disk-image): Adapt accordingly to pass grub-efi package. Make sure that grub-efi is not built if we are not targeting an Intel system. --- gnu/build/image.scm | 4 ++-- gnu/system/image.scm | 4 ++++ guix/utils.scm | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gnu/build/image.scm b/gnu/build/image.scm index 49faeab466..a8594e202b 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -146,10 +146,10 @@ deduplicates files common to CLOSURE and the rest of PREFIX." (define* (initialize-efi-partition root #:key - bootloader-package + grub-efi #:allow-other-keys) "Install in ROOT directory, an EFI loader using BOOTLOADER-PACKAGE." - (install-efi-loader bootloader-package root)) + (install-efi-loader grub-efi root)) (define* (initialize-root-partition root #:key diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 7ac998d861..a706f872a8 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -235,6 +235,10 @@ used in the image." #:references-graphs '#$graph #:deduplicate? #f #:system-directory #$os + #:grub-efi #$(let-system (system target) + (and (target-intel? + (or target system)) + grub-efi)) #:bootloader-package #+(bootloader-package bootloader) #:bootloader-installer diff --git a/guix/utils.scm b/guix/utils.scm index d7b197fa44..fb3b233286 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -74,6 +74,7 @@ %current-target-system package-name->name+version target-mingw? + target-intel? target-arm32? target-aarch64? target-arm? @@ -490,6 +491,10 @@ a character other than '@'." (and target (string-suffix? "-mingw32" target))) +(define* (target-intel? #:optional (target (or (%current-target-system) + (%current-system)))) + (any (cut string-prefix? <> target) '("x86_64" "i686"))) + (define* (target-arm32? #:optional (target (or (%current-target-system) (%current-system)))) (string-prefix? "arm" target)) From patchwork Wed May 27 07:24:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22403 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0473027BBE3; Wed, 27 May 2020 08:25:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id C98B327BBE1 for ; Wed, 27 May 2020 08:25:11 +0100 (BST) Received: from localhost ([::1]:60874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdqR5-00053p-Aj for patchwork@mira.cbaines.net; Wed, 27 May 2020 03:25:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdqQy-00051m-UA for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdqQy-0001An-JK for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdqQy-0003iN-GL for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41560] [PATCH 7/8] system: image: Fix image-with-os. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 07:25:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41560@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 41560-submit@debbugs.gnu.org id=B41560.159056429114206 (code B ref 41560); Wed, 27 May 2020 07:25:04 +0000 Received: (at 41560) by debbugs.gnu.org; 27 May 2020 07:24:51 +0000 Received: from localhost ([127.0.0.1]:48088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQl-0003gx-4s for submit@debbugs.gnu.org; Wed, 27 May 2020 03:24:51 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:35373) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQc-0003fZ-B1 for 41560@debbugs.gnu.org; Wed, 27 May 2020 03:24:42 -0400 Received: by mail-wr1-f51.google.com with SMTP id x14so17558379wrp.2 for <41560@debbugs.gnu.org>; Wed, 27 May 2020 00:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tmHavA/iyYGOtQCIarJNHSwcrfGqzebBUjFLfQpN014=; b=lY7qKyuDN37FstEigpVwnUay8wXEraeZpzpv6vClwEOe+tqmYM1en+rDDca8KJKpUD iVn/yvUIRu9XSk3+odNw/3q/kc5jnkXNguoyWuviIVhts2EmfSb6EoGv9fDk0e9QGgZy rPmxmmEZyF+aQAoFxfUBn9Am4w7dBWTE40DmzQi7nzP69Nu3zo2j1JuOl+WR52Y8kR30 TsLenWfz/Ix2HsCXM8LMDrQ36g3h4XSE8FpgNCVg/muW4Q2fzTiYXDVUMQHOY8cDCj+u q4TLTysPCd2uSht8gaCd8ocRhmGcw81Fg0vdcffy1iwem9XA0t50jVb+pb7IMbyidPYq XhYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tmHavA/iyYGOtQCIarJNHSwcrfGqzebBUjFLfQpN014=; b=kO9eiez7U9yumPiqALaVHMkz4AEdgwsQtfzuhjr95KcxNgBb/yP4fbdpxls8J/nmDx GBiAk5ocCJ/z3ICdLBk5ZMwRk3PP+Rjrm7CpIIAXxPvGVxyugAVkqcCMGL3qzc2PrDM0 Tmp4W2wOKO3tNJ6Eh2reIT4g25HVm1AKRyZnFptG2aqPDeDjMvFV2pwqVzQTmkJJ2cPm LD4xUkznvzZsv1xKa8O9+k5bnTuMc6la+YSJer5EfDi3K+kLvcf0YeXdVsEg26+iUMNT 9G7hGpzTDFh4L8qCOyPZHUBm9nCUDvYk2xjWeeERNE8ElESOM7zviBkduSQdG73juIsL aWaA== X-Gm-Message-State: AOAM530gElQSr+t56M/qGy3orN2eB9w1uTieSdp2rFa8kQ40lyvtJ51X B/ob6gYfJsxyf7gJ912Or0/P/mVAc6I= X-Google-Smtp-Source: ABdhPJyaEA6/GuP7TGQHfUY/tnQPgh6rej67t7j83J4YawhyxffVfVQFWEgWrdgQMqN5dNmyWTh7lQ== X-Received: by 2002:a5d:460d:: with SMTP id t13mr24731211wrq.280.1590564276162; Wed, 27 May 2020 00:24:36 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:e5a2:3f70:d249:6ce9]) by smtp.gmail.com with ESMTPSA id v28sm2002845wra.77.2020.05.27.00.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:24:35 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Wed, 27 May 2020 09:24:19 +0200 Message-Id: <20200527072420.26140-7-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527072420.26140-1-othacehe@gnu.org> References: <20200527072420.26140-1-othacehe@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/system/image.scm (image-with-os): Do not reorder partitions, as we want them to be created according to definition order. --- gnu/system/image.scm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index a706f872a8..97124a4699 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -424,18 +424,18 @@ to OS. Also set the UUID and the size of the root partition." (string=? (file-system-mount-point fs) "/")) (operating-system-file-systems os))) - (let*-values (((partitions) (image-partitions base-image)) - ((root-partition other-partitions) - (srfi-1:partition root-partition? partitions))) - (image - (inherit base-image) - (operating-system os) - (partitions - (cons (partition - (inherit (car root-partition)) - (uuid (file-system-device root-file-system)) - (size (root-size base-image))) - other-partitions))))) + (image + (inherit base-image) + (operating-system os) + (partitions + (map (lambda (p) + (if (root-partition? p) + (partition + (inherit p) + (uuid (file-system-device root-file-system)) + (size (root-size base-image))) + p)) + (image-partitions base-image))))) (define (operating-system-for-image image) "Return an operating-system based on the one specified in IMAGE, but From patchwork Wed May 27 07:24:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 22404 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3083627BBE3; Wed, 27 May 2020 08:25:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id CE1F027BBE1 for ; Wed, 27 May 2020 08:25:14 +0100 (BST) Received: from localhost ([::1]:32888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jdqR8-0005Ai-Bu for patchwork@mira.cbaines.net; Wed, 27 May 2020 03:25:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jdqQz-00052W-AS for guix-patches@gnu.org; Wed, 27 May 2020 03:25:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jdqQz-0001Ax-0p for guix-patches@gnu.org; Wed, 27 May 2020 03:25:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jdqQy-0003iV-Ty for guix-patches@gnu.org; Wed, 27 May 2020 03:25:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41560] [PATCH 8/8] image: Do not use VM to create disk-images. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 May 2020 07:25:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 41560@debbugs.gnu.org Cc: Mathieu Othacehe Received: via spool by 41560-submit@debbugs.gnu.org id=B41560.159056429214212 (code B ref 41560); Wed, 27 May 2020 07:25:04 +0000 Received: (at 41560) by debbugs.gnu.org; 27 May 2020 07:24:52 +0000 Received: from localhost ([127.0.0.1]:48090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQl-0003h5-F7 for submit@debbugs.gnu.org; Wed, 27 May 2020 03:24:52 -0400 Received: from mail-wr1-f49.google.com ([209.85.221.49]:33650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jdqQd-0003fo-KT for 41560@debbugs.gnu.org; Wed, 27 May 2020 03:24:44 -0400 Received: by mail-wr1-f49.google.com with SMTP id l11so22988716wru.0 for <41560@debbugs.gnu.org>; Wed, 27 May 2020 00:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=paz5aa8d9pDTg5ShCsmQGGaRtrZCL9Oz/b4rpsYekrU=; b=aHnKPRAcwP7QEYC3LsrVcwM3Q3tC9QDXyYlRgspY3NmngtnBLoGcSADmBBYl0tM1Bo 188MrVB8CpoKpf3UT1JdlhuaVhEYlrtfPTtHgkJP3xf/wa0SEqlOIoQYAfWl0Y362W7o owGCivusEaPUZZvf+3vH2sC6cfwLNpWegBZEK5q6aBYcnMP/bpA5RlQjJ2Akg0uV7CGj dYkMrsfhrs/ZTjNxfor+NMN5UvmZqij7JKFdtCeEVsBUXeQAEL2Y7pXx5VNkk53D6HHs tlMKB/tv1PMSIZc24kfPRx14XywjAQWj4XQ+GtJ01oP9rp92FM2/60z5hgwdG2GaVPg9 vFVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=paz5aa8d9pDTg5ShCsmQGGaRtrZCL9Oz/b4rpsYekrU=; b=mZSu1Ixs1D+TtyMQII8YW2r7fkG+cB38db644VRUMdnOpF6dYS/pEWOrZo+0SCAoXE /02SIcK1OOx3z+PX+nzXmy54jR8SYJHcQTxJUrCX9VLEPKVwL8tI8tPfqG/NNYJB1BcI 50aeFyQWQJygEw9DMt45Fmfsokm0DbJGTkV6umIMWL6/mudT3jkS49jsDahr06n9j1As Zo7nM+KR71OgEz6cViTwoAWBmCpL4VCy5zDW5DtBprpUXysR55A8OwaqsfZs8Gr7rRo6 S57YixmZqgvdc8+Qxq7vTMcMBG5Tg9s8pg6TkRDX87NaTMAJGyzpkNo6/vp5SXTYPvIy gPiw== X-Gm-Message-State: AOAM532b7/rZCA/xiWN4H745gdnwhz+jHhBwA4AzZ+4UOvGTbvKU+Zqs i2kNlml8IQ9RBjaWoM7Wnimh1ZPNdK0= X-Google-Smtp-Source: ABdhPJygfTRDRxVXei9H20fMTP/hwvgBkmTbNuI9MU5xx6YDzt0bbQ+wJz/d6gq9Hb29kaGUWsGaPw== X-Received: by 2002:a5d:5006:: with SMTP id e6mr23345355wrt.170.1590564277420; Wed, 27 May 2020 00:24:37 -0700 (PDT) Received: from meru.fronius.com ([2a01:e0a:fa:a50:e5a2:3f70:d249:6ce9]) by smtp.gmail.com with ESMTPSA id v28sm2002845wra.77.2020.05.27.00.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 00:24:36 -0700 (PDT) From: Mathieu Othacehe X-Google-Original-From: Mathieu Othacehe Date: Wed, 27 May 2020 09:24:20 +0200 Message-Id: <20200527072420.26140-8-othacehe@gnu.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527072420.26140-1-othacehe@gnu.org> References: <20200527072420.26140-1-othacehe@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Now that installing Grub on raw disk-images is supported, we do not need to rely on (gnu system vm) module. * gnu/system/image.scm (make-system-image): Rename to ... (system-image): ... this, and remove the compatibility wrapper. (find-image): Turn to a monadic procedure. This will become useful when introducing Hurd support, to be able to detect the target system. * gnu/ci.scm (qemu-jobs): Use lower-object now that system-image returns a file-like object. * gnu/tests/install.scm (run-install): Ditto. * guix/scripts/system.scm (system-derivation-for-action): Add a 'base-image' argument, (perform-action): adapt accordingly. --- gnu/ci.scm | 20 +++++++++++--------- gnu/system/image.scm | 40 ++++++---------------------------------- gnu/tests/install.scm | 8 ++++---- guix/scripts/system.scm | 16 +++++++++------- 4 files changed, 30 insertions(+), 54 deletions(-) diff --git a/gnu/ci.scm b/gnu/ci.scm index b61181be51..fa67168e22 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -219,19 +219,21 @@ system.") (run-with-store store (mbegin %store-monad (set-guile-for-build (default-guile)) - (system-image - (image - (inherit efi-disk-image) - (size (* 1500 MiB)) - (operating-system installation-os)))))) + (lower-object + (system-image + (image + (inherit efi-disk-image) + (size (* 1500 MiB)) + (operating-system installation-os))))))) (->job 'iso9660-image (run-with-store store (mbegin %store-monad (set-guile-for-build (default-guile)) - (system-image - (image - (inherit iso9660-image) - (operating-system installation-os))))))) + (lower-object + (system-image + (image + (inherit iso9660-image) + (operating-system installation-os)))))))) '())) (define channel-build-system diff --git a/gnu/system/image.scm b/gnu/system/image.scm index 97124a4699..8bb8412f16 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -488,7 +488,7 @@ it can be used for bootloading." (type root-file-system-type)) file-systems-to-keep))))) -(define* (make-system-image image) +(define* (system-image image) "Return the derivation of IMAGE. It can be a raw disk-image or an ISO9660 image, depending on IMAGE format." (define substitutable? (image-substitutable? image)) @@ -521,38 +521,10 @@ image, depending on IMAGE format." "Find and return an image that could match the given FILE-SYSTEM-TYPE. This is useful to adapt to interfaces written before the addition of the record." - ;; XXX: Add support for system and target here, or in the caller. - (match file-system-type - ("iso9660" iso9660-image) - (_ efi-disk-image))) - -(define (system-image image) - "Wrap 'make-system-image' call, so that it is used only if the given IMAGE -is supported. Otherwise, fallback to image creation in a VM. This is -temporary and should be removed once 'make-system-image' is able to deal with -all types of images." - (define substitutable? (image-substitutable? image)) - (define volatile-root? (image-volatile-root? image)) - - (let* ((image-os (image-operating-system image)) - (image-root-filesystem-type (image->root-file-system image)) - (bootloader (bootloader-configuration-bootloader - (operating-system-bootloader image-os))) - (bootloader-name (bootloader-name bootloader)) - (size (image-size image)) - (format (image-format image))) - (mbegin %store-monad - (if (and (or (eq? bootloader-name 'grub) - (eq? bootloader-name 'extlinux)) - (eq? format 'disk-image)) - ;; Fallback to image creation in a VM when it is not yet supported - ;; by this module. - (system-disk-image-in-vm image-os - #:disk-image-size size - #:file-system-type image-root-filesystem-type - #:volatile? volatile-root? - #:substitutable? substitutable?) - (lower-object - (make-system-image image)))))) + (mbegin %store-monad + (return + (match file-system-type + ("iso9660" iso9660-image) + (_ efi-disk-image))))) ;;; image.scm ends here diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index cea26c8ef3..6bd8c7d3d2 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -228,18 +228,18 @@ packages defined in installation-os." (mlet* %store-monad ((_ (set-grafting #f)) (system (current-system)) (target (operating-system-derivation target-os)) + (base-image (find-image + installation-disk-image-file-system-type)) ;; Since the installation system has no network access, ;; we cheat a little bit by adding TARGET to its GC ;; roots. This way, we know 'guix system init' will ;; succeed. Also add guile-final, which is pulled in ;; through provenance.drv and may not always be present. - (image + (image -> (system-image (image - (inherit - (find-image - installation-disk-image-file-system-type)) + (inherit base-image) (size install-size) (operating-system (operating-system-with-gc-roots diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 3efd113ac8..3d7aa77cb7 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -670,7 +670,7 @@ checking this by themselves in their 'check' procedure." ;;; Action. ;;; -(define* (system-derivation-for-action os action +(define* (system-derivation-for-action os base-image action #:key image-size file-system-type full-boot? container-shared-network? mappings) @@ -694,11 +694,12 @@ checking this by themselves in their 'check' procedure." (* 70 (expt 2 20))) #:mappings mappings)) ((disk-image) - (system-image - (image - (inherit (find-image file-system-type)) - (size image-size) - (operating-system os)))) + (lower-object + (system-image + (image + (inherit base-image) + (size image-size) + (operating-system os))))) ((docker-image) (system-docker-image os #:shared-network? container-shared-network?)))) @@ -800,7 +801,8 @@ static checks." (check-initrd-modules os))) (mlet* %store-monad - ((sys (system-derivation-for-action os action + ((image (find-image file-system-type)) + (sys (system-derivation-for-action os image action #:file-system-type file-system-type #:image-size image-size #:full-boot? full-boot?