From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +JZYGKDYkWNyWQEAbAwnHQ (envelope-from ) for ; Thu, 08 Dec 2022 13:29:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cPcbGKDYkWNtlQAAauVa8A (envelope-from ) for ; Thu, 08 Dec 2022 13:29:20 +0100 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 ECA4E3E05B for ; Thu, 8 Dec 2022 13:29:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3G1Q-0002iO-Sr; Thu, 08 Dec 2022 07:29:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3G1O-0002dh-Tm for bug-guix@gnu.org; Thu, 08 Dec 2022 07:29:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3G1O-0006Hm-LN for bug-guix@gnu.org; Thu, 08 Dec 2022 07:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3G1O-0000AH-6c for bug-guix@gnu.org; Thu, 08 Dec 2022 07:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#59823: [1.4.0rc1] Installer fails to identify installation device on Ventoy-made images Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 08 Dec 2022 12:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59823 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: "So'n Typ im Internet" Cc: 59823@debbugs.gnu.org, Josselin Poiret Received: via spool by 59823-submit@debbugs.gnu.org id=B59823.1670502510624 (code B ref 59823); Thu, 08 Dec 2022 12:29:02 +0000 Received: (at 59823) by debbugs.gnu.org; 8 Dec 2022 12:28:30 +0000 Received: from localhost ([127.0.0.1]:56511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3G0r-0000A0-Tr for submit@debbugs.gnu.org; Thu, 08 Dec 2022 07:28:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3G0p-00009r-1c for 59823@debbugs.gnu.org; Thu, 08 Dec 2022 07:28:28 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3G0j-00069T-FU; Thu, 08 Dec 2022 07:28:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=yZbChZO0t7slnhQTX8e+B4WlrReNfteKYVxqQGIvl/I=; b=FvnJQ9zm6ikpgaEWMbUX TKyx6Q1n+rV3H4OfMoKSuSYQXxy7cKjetT6CizvuEi4sUd2T3vAmsRMd58o2T/LRpmhw3QUI/k2PO sbEOTAoUumuvRZdG9AYHCyy+pPjtFRSbMcOcEAgKTN+MBbe/xVuEEUCtKXVEx7OtdN1MxXfU2SCIm OO1FQwiYH6rKyeagBKkUP4PjSgXyMGvCDRzGfXbv+Ysflk5HMhj/i6U7RlFpSuSuwfZM5VsNGYoJr 8A8AgMuaxc0dEPUt/xUTEjvxXkYumqQcXv7i7XJlxMwDkW/3HqSyUlkHHu5nfMyaEKeWnDF6h6Btd SFSGQQ8cI+zP1w==; Received: from 2a02-8429-81d2-3d01-94c9-8097-ea5c-2774.rev.sfr.net ([2a02:8429:81d2:3d01:94c9:8097:ea5c:2774] helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3G0j-0007Cp-0y; Thu, 08 Dec 2022 07:28:21 -0500 From: Mathieu Othacehe References: <87tu2a8drd.fsf@gnu.org> <87lenj8srr.fsf@gnu.org> <87y1rj6xb0.fsf@gnu.org> Date: Thu, 08 Dec 2022 13:28:19 +0100 In-Reply-To: <87y1rj6xb0.fsf@gnu.org> (Mathieu Othacehe's message of "Wed, 07 Dec 2022 16:36:03 +0100") Message-ID: <877cz213mk.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670502560; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=yZbChZO0t7slnhQTX8e+B4WlrReNfteKYVxqQGIvl/I=; b=YSLNYVpUKU3Z07Co1sww3EXsaSt1WJKD2AJ8JomXkD6GxLzdQEvEu1lFTKgxZ0kq1oqNAh AkKD99z6siq9zZYW4EZvSR72Qo/qjf6muc27QY2MMJUURpN9gcniLl5j0JBpBaGTDfKbvF bcY2Wg8NAinZ4sTA9bajlOXbmCN9Hpc/m4mfqrA2oD1GmULFbkWFOElAcDIRqTUTEcU8G7 TyUGi268QAPoAtoLTGbJjjOW9cJiKmAmxpCU10dfFdONegQR9UOAmNM/Or1KQtbAQM2qXb 0tQmxtwVwvfbYyb2UR9Kl+n1p2FGziT5leUAkj8YU0N1Rq4K/aC6IobFwsyIyQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670502560; a=rsa-sha256; cv=none; b=kJmg3p9TAmNtfROVnf5Oz0tsdkSMqaQZscQDM0yjZ5ctsoYQw2lr21Db6U8OwIa8SZe+YG QZV1qm3pWsR2U6HdDzPIVvnzsF+3+Ifg+H6lQ7v+fPY/ibX48dKfkAwzoZW7ae3hQ8TTQd HfjHEtyqU+OJWH8XwtvIujQNLksN3+Iae5sTYAHGxMI/SR1hTh2BkAAD9kXGz6FtMcNdFe bfkiOybJX9A+DxHpDUrOcCr3KdYo/zhUXKkaOZ7PZuIBF9AUU0Xpg8P4GdTkpDWvnb02jr DEjCXpOTsC14TCTXsnGNaI9GvJQMM9GuKgzlDDNOurDLNdxmdJjNFSZ1lFu7hA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=FvnJQ9zm; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.86 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=FvnJQ9zm; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: ECA4E3E05B X-Spam-Score: -3.86 X-Migadu-Scanner: scn1.migadu.com X-TUID: C3PCwz+Wm6dX --=-=-= Content-Type: text/plain Hello, The attached patch fixes it for me. We could maybe use libdevmapper instead of the plain "dmsetup" call but that's not critical in my opinion. Thanks, Mathieu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-installer-Detect-mapped-installation-devices.patch >From 0afda5b3ed32e73bece9db96ab970d83f9f2e74b Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Thu, 8 Dec 2022 13:24:02 +0100 Subject: [PATCH 1/1] installer: Detect mapped installation devices. Fixes: * gnu/installer/parted.scm (mapped-device?, mapped-device->parent-partition-path): New procedures. (eligible-devices): Detect mapped installation devices using the new procedures. --- gnu/installer/parted.scm | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 82375d29e3..058f2a8dab 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -379,12 +379,45 @@ (define (installer-root-partition-path) (define %min-device-size (* 2 GIBIBYTE-SIZE)) ;2GiB +(define (mapped-device? device) + "Return #true if DEVICE is a mapped device, false otherwise." + (string-prefix? "/dev/dm-" device)) + +(define (mapped-device->parent-partition-path device) + "Return the parent partition path of the mapped DEVICE." + (let* ((command `("dmsetup" "deps" ,device "-o" "devname")) + (parent #f) + (handler + (lambda (input) + (let ((result + (string-match "\\(([^\\)]+)\\)" + (get-string-all input)))) + (and result + (set! parent + (format #f "/dev/~a" + (match:substring result 1)))))))) + (run-external-command-with-handler handler command) + parent)) + (define (eligible-devices) "Return all the available devices except the install device and the devices which are smaller than %MIN-DEVICE-SIZE." (define the-installer-root-partition-path - (installer-root-partition-path)) + (let ((root-path + (installer-root-partition-path))) + (cond + ((mapped-device? root-path) + ;; If the partition is a mapped device (/dev/dm-X), locate the parent + ;; partition. It is the case when Ventoy is used to host the + ;; installation image. + (let ((parent-path + (mapped-device->parent-partition-path root-path))) + (installer-log-line "mapped device ~a -> ~a" + parent-path root-path) + parent-path)) + (else + root-path)))) (define (small-device? device) (let ((length (device-length device)) -- 2.38.1 --=-=-=--