From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KKYgOdVVn2E3UwAAgWs5BA (envelope-from ) for ; Thu, 25 Nov 2021 10:22:29 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UHyzNNVVn2GSSgAAbx9fmQ (envelope-from ) for ; Thu, 25 Nov 2021 09:22:29 +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 3142F371EE for ; Thu, 25 Nov 2021 10:22:29 +0100 (CET) Received: from localhost ([::1]:37056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqAxY-0003wR-BT for larch@yhetil.org; Thu, 25 Nov 2021 04:22:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqAwA-0002YT-GS for guix-patches@gnu.org; Thu, 25 Nov 2021 04:21:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44186) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqAwA-00069g-7d for guix-patches@gnu.org; Thu, 25 Nov 2021 04:21:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mqAwA-00054p-1i for guix-patches@gnu.org; Thu, 25 Nov 2021 04:21:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51878] [PATCH] installer: Rework installation device detection Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Nov 2021 09:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51878 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Josselin Poiret Cc: 51878@debbugs.gnu.org Received: via spool by 51878-submit@debbugs.gnu.org id=B51878.163783203919465 (code B ref 51878); Thu, 25 Nov 2021 09:21:02 +0000 Received: (at 51878) by debbugs.gnu.org; 25 Nov 2021 09:20:39 +0000 Received: from localhost ([127.0.0.1]:55732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqAvm-00053t-Ty for submit@debbugs.gnu.org; Thu, 25 Nov 2021 04:20:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqAvl-00053h-Al for 51878@debbugs.gnu.org; Thu, 25 Nov 2021 04:20:37 -0500 Received: from [2001:470:142:3::e] (port=34398 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqAvg-0005sQ-2D; Thu, 25 Nov 2021 04:20:32 -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=ukUhF9WLIqOklJE95rClVLaOHT4Gn8Xg13nkWUYL9LI=; b=DJfuvI251KTyu4lt/Lti NEuHF7A/CCU8vBAZr2i+g1grPXg/s36wuCRRv8lGmwfa+c4uZI0lNepvaHryAcHpUa5+d6GzDdOWU 0Y1VwXhoEOcjFbaTUVnAl603JzyWcSq33co/AoDDyK6J4ZWIbfqq4tnpykQd6wg/rHkZoqxt+xXas hvq9ZKGzXSHMRJg6/k6nCH8gl94gXP8kJU8iEjTCBWRK/v+R2NQ6QhRmkWFJoEfUOCwhEPenOWLQK ouaP4uIQ783KApWzZeB1jXwnh2Q8Ie4rNogpytdAu5aVhPVx077XTLO+IABi8zq+uXJUehNNBfi1/ YgsAulYjt8varQ==; Received: from [2a01:e0a:19b:d9a0:45b5:a14a:5c75:5737] (port=46972 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqAvf-0001li-RR; Thu, 25 Nov 2021 04:20:32 -0500 From: Mathieu Othacehe References: <87lf1mhmgw.fsf@gnu.org> <20211123221909.11142-1-dev@jpoiret.xyz> Date: Thu, 25 Nov 2021 09:20:30 +0000 In-Reply-To: <20211123221909.11142-1-dev@jpoiret.xyz> (Josselin Poiret's message of "Tue, 23 Nov 2021 22:19:09 +0000") Message-ID: <87y25cmw0x.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637832149; 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=ukUhF9WLIqOklJE95rClVLaOHT4Gn8Xg13nkWUYL9LI=; b=VR3G4Lf57Mlm7C7tOoTpX1gJmSxxVdL2SnYl1s9t5g71svBU+Fh/D+jhgXJcjEseRflUX8 TRyYwGLkkqojAUR72BXcx9qmcgf3vLKG3NiL4zaS1x4gRwY8IsnmfnsROp8TiKXUbLPXl0 f9cGJu4ehOZtitZSWDnzxzGyYWHdrxCOQCbepxDfJ5HMEV9MpNgp8Mpi/BP5dsHVDNLldt vcsu5lG+/bXm6jOCZJpvJxbvdsZmmPWgjRkATUfSKzf8dX9Q0eG92lrtAPwCNoUtdn4Bli Zn8jY50zIbtqMGBPq88T9GhMzvTcpsSQgEVuiZdt7X1F9MjUlb+iL1OyJzuDdQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637832149; a=rsa-sha256; cv=none; b=lPqMeT+YuOSIrcSWazvSswta4zWsvcMBi+0mPEWwnlPtUKMcD8tJv2H7giB/2UI8/FfW1V uyC+UVDYONTvM5YmFKwdTg28j8kLfmS9Z2zuCQh5f1L1JTDeZQVJdvEPLv6bl4mnwJ7zIe qYnpYdmhQP3QyUG/9Kgf5T+vPE5Re0sRrja+YjnRsTZbxye8KQi8jc9UJx1XgWForXgeZS d9DY6IHVkllICr2h+vJEYBrznO/OAWf6D/3Q5JvUZxMeLJAErTE7Mvgg/KgmJmOU4ESyIi ///9feVS2OVyZGUoKu778JtgdpNLNgCQzLlh53nHOyD5tnlKJaGUVlkLIqFgPQ== 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=DJfuvI25; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.59 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=DJfuvI25; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 3142F371EE X-Spam-Score: -3.59 X-Migadu-Scanner: scn1.migadu.com X-TUID: OQGGK3QIYS7Z Hello Josselin, Thanks for the v2! > I didn't quite get your comment about filtering the `(devices)` list. > In both cases, we use `remove`, but here I've factored out the predicate > used for it. I was not very clear sorry about that. I meant something like that seems a little more concise: --8<---------------cut here---------------start------------->8--- diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 82b01d2ce1..ad7dd6bf91 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -366,19 +366,16 @@ (define the-installer-root-partition-path ;; we're booting from to determine if it is the installation ;; device. (define (installation-device? device) + ;; When using CDROM based installation, the root partition path may be the + ;; device path. (or (string=? the-installer-root-partition-path (device-path device)) (let ((disk (disk-new device))) (and disk - (let loop ((partition #f)) - (let ((next-partition (disk-next-partition disk - #:partition - partition))) - (and next-partition - (or (string=? the-installer-root-partition-path - (partition-get-path - next-partition)) - (loop next-partition))))))))) + (any (lambda (partition) + (string=? the-installer-root-partition-path + (partition-get-path partition))) + (disk-partitions disk)))))) (remove installation-device? (devices))) --8<---------------cut here---------------end--------------->8--- WDYT? Thanks, Mathieu