From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KD3GARiYkl8yYAAA0tVLHw (envelope-from ) for ; Fri, 23 Oct 2020 08:45:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wMOZNxeYkl80LgAAbx9fmQ (envelope-from ) for ; Fri, 23 Oct 2020 08:45:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3F1839402A8 for ; Fri, 23 Oct 2020 08:45:11 +0000 (UTC) Received: from localhost ([::1]:54374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVshB-0005JX-Ss for larch@yhetil.org; Fri, 23 Oct 2020 04:45:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVsh4-0005JJ-Lb for bug-guix@gnu.org; Fri, 23 Oct 2020 04:45:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43214) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVsh4-00035e-C1 for bug-guix@gnu.org; Fri, 23 Oct 2020 04:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kVsh4-0000QI-AD for bug-guix@gnu.org; Fri, 23 Oct 2020 04:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44101: Unable to use /dev/disk/by-id/ symlinks with u-boot and guix system reconfigure Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 23 Oct 2020 08:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44101 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Vagrant Cascadian Received: via spool by 44101-submit@debbugs.gnu.org id=B44101.16034426671565 (code B ref 44101); Fri, 23 Oct 2020 08:45:02 +0000 Received: (at 44101) by debbugs.gnu.org; 23 Oct 2020 08:44:27 +0000 Received: from localhost ([127.0.0.1]:54760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVsgU-0000P9-Ek for submit@debbugs.gnu.org; Fri, 23 Oct 2020 04:44:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVsgS-0000Ot-Kg for 44101@debbugs.gnu.org; Fri, 23 Oct 2020 04:44:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33374) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVsgM-0002nP-Ol; Fri, 23 Oct 2020 04:44:19 -0400 Received: from [2a01:e0a:19b:d9a0:50c1:4a69:300e:4531] (port=55512 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVsgM-0001Kl-18; Fri, 23 Oct 2020 04:44:18 -0400 From: Mathieu Othacehe References: <87a6wgrfnp.fsf@ponder> <87zh4ezo7k.fsf@gnu.org> <87k0vi9g6q.fsf@ponder> <875z71jr61.fsf@gnu.org> Date: Fri, 23 Oct 2020 10:44:16 +0200 In-Reply-To: <875z71jr61.fsf@gnu.org> (Mathieu Othacehe's message of "Fri, 23 Oct 2020 10:13:42 +0200") Message-ID: <87y2jxib6n.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 44101@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.51 X-TUID: W/yTVS6NDgV3 --=-=-= Content-Type: text/plain Hello, >> ice-9/boot-9.scm:1669:16: In procedure raise-exception: >> ERROR: >> 1. &i/o-filename: "/dev/disk/by-id/mmc-SDU64_0xbaf3002e" > > Thanks for testing. This is probably a regression in > "write-file-on-device" that fails to open this kind of files. I'll try > to reproduce it locally. This is because the O_EXCL flag was passed, which causes open to fail if the block device is mounted. The revised patch attached should fix it. Thanks, Mathieu --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-system-reconfigure-Use-the-disk-installer-if-provide.patch >From 780327ebb0db74ca4cc43d26ba7cf945d64c7d30 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Wed, 21 Oct 2020 10:42:50 +0200 Subject: [PATCH] system: reconfigure: Use the disk-installer if provided. --- gnu/build/bootloader.scm | 4 ++-- gnu/tests/reconfigure.scm | 4 +++- guix/scripts/system/reconfigure.scm | 12 +++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gnu/build/bootloader.scm b/gnu/build/bootloader.scm index 5ec839f902..06a2c3ab76 100644 --- a/gnu/build/bootloader.scm +++ b/gnu/build/bootloader.scm @@ -39,9 +39,9 @@ (let ((bv (get-bytevector-n input size))) (call-with-port (open-file-output-port device - (file-options no-truncate no-create) + (file-options no-truncate no-fail) (buffer-mode block) - (native-transcoder)) + (make-transcoder (latin-1-codec))) (lambda (output) (seek output offset SEEK_SET) (put-bytevector output bv))))))) diff --git a/gnu/tests/reconfigure.scm b/gnu/tests/reconfigure.scm index 928a210a94..52beeef447 100644 --- a/gnu/tests/reconfigure.scm +++ b/gnu/tests/reconfigure.scm @@ -260,7 +260,9 @@ bootloader's configuration file." ;; test suite, the bootloader installer script is omitted. 'grub-install' ;; would attempt to write directly to the virtual disk if the ;; installation script were run. - (test (install-bootloader-program #f #f bootcfg bootcfg-file #f "/"))))) + (test + (install-bootloader-program #f #f #f bootcfg bootcfg-file #f "/"))))) + (define %test-switch-to-system (system-test diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index d89caf80fc..b1982b20d2 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -204,7 +204,8 @@ services as defined by OS." ;;; Bootloader configuration. ;;; -(define (install-bootloader-program installer bootloader-package bootcfg +(define (install-bootloader-program installer disk-installer + bootloader-package bootcfg bootcfg-file device target) "Return an executable store item that, upon being evaluated, will install BOOTCFG to BOOTCFG-FILE, a target file name, on DEVICE, a file system device, @@ -246,10 +247,12 @@ BOOTLOADER-PACKAGE." ;; a broken installation. (switch-symlinks new-gc-root #$bootcfg) (install-boot-config #$bootcfg #$bootcfg-file #$target) - (when #$installer + (when (or #$installer #$disk-installer) (catch #t (lambda () - (#$installer #$bootloader-package #$device #$target)) + (if #$installer + (#$installer #$bootloader-package #$device #$target) + (#$disk-installer #$bootloader-package 0 #$device))) (lambda args (delete-file new-gc-root) (match args @@ -272,11 +275,14 @@ additional configurations specified by MENU-ENTRIES can be selected." (let* ((bootloader (bootloader-configuration-bootloader configuration)) (installer (and run-installer? (bootloader-installer bootloader))) + (disk-installer (and run-installer? + (bootloader-disk-image-installer bootloader))) (package (bootloader-package bootloader)) (device (bootloader-configuration-target configuration)) (bootcfg-file (bootloader-configuration-file bootloader))) (eval #~(parameterize ((current-warning-port (%make-void-port "w"))) (primitive-load #$(install-bootloader-program installer + disk-installer package bootcfg bootcfg-file -- 2.28.0 --=-=-=--