From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:203:b4db::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oO6QCKcDymEcXAEAgWs5BA (envelope-from ) for ; Mon, 27 Dec 2021 19:19:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id aBPPBacDymHZKwAA9RJhRA (envelope-from ) for ; Mon, 27 Dec 2021 19:19:19 +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 787B01C2ED for ; Mon, 27 Dec 2021 19:19:18 +0100 (CET) Received: from localhost ([::1]:39084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1uab-000659-96 for larch@yhetil.org; Mon, 27 Dec 2021 13:19:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1uaM-00064t-R1 for bug-guix@gnu.org; Mon, 27 Dec 2021 13:19:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n1uaM-0003lj-I2 for bug-guix@gnu.org; Mon, 27 Dec 2021 13:19:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n1uaM-0003z3-Ar for bug-guix@gnu.org; Mon, 27 Dec 2021 13:19:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#52680: installer error Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 27 Dec 2021 18:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52680 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Josselin Poiret Received: via spool by 52680-submit@debbugs.gnu.org id=B52680.164062910515233 (code B ref 52680); Mon, 27 Dec 2021 18:19:02 +0000 Received: (at 52680) by debbugs.gnu.org; 27 Dec 2021 18:18:25 +0000 Received: from localhost ([127.0.0.1]:44239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1uZk-0003xd-QQ for submit@debbugs.gnu.org; Mon, 27 Dec 2021 13:18:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n1uZj-0003xM-Ah for 52680@debbugs.gnu.org; Mon, 27 Dec 2021 13:18:23 -0500 Received: from [2001:470:142:3::e] (port=35584 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 1n1uZe-0003bE-21; Mon, 27 Dec 2021 13:18:18 -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=glA0349Z8igb8aMffyTkfhCAzZeyKvr58s5pzHaxUmE=; b=YNei56LJO78l2t6LOHCG Rm8Ltli6r3O/StVDL3idRLSGmkmBLkC3+uwFiTMHvTLfx1U2YxTumQQKJu76i9kcxhrxByBuGnqT6 +/k8pnerawmG0l+/8BohsLNq3c9YHj6+uXjoFQ+rsrWOhU87d7qxwZX32RKdDEvWs0YnTg/KVtsEE vPx830MtDiRlzRvog+khOp4oFiBAG4SZ6mX8lcs/W5z4tbTGsqOasWeSyhd1+A5jFTDPYXK+JPk/E VOpM2CnpCnQRJk1DbxK7Q0sDOItQDYSgkJo+gxltznnWhYbSF6YNIxrk0lugfpGKyMmWYBVs+wynZ B4uvPUjYaUQsgw==; Received: from [2a01:cb18:832e:5f00:3563:417e:2a38:86d8] (port=48782 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1uZe-0003NR-3p; Mon, 27 Dec 2021 13:18:18 -0500 From: Mathieu Othacehe References: <878rw6xxpu.fsf@gnu.org> <878rw6tdwt.fsf@gnu.org> <87a6gm10cp.fsf@jpoiret.xyz> Date: Mon, 27 Dec 2021 19:18:15 +0100 In-Reply-To: <87a6gm10cp.fsf@jpoiret.xyz> (Josselin Poiret's message of "Mon, 27 Dec 2021 17:25:26 +0100") Message-ID: <871r1xewt4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.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: , Cc: Florian Hoertlehner , 52680@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" 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=1640629158; 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=BGPdSGKdkgrzVTrfsiGJNPW34f4jsOR1YFjzDMwc67M=; b=MbVRvAYkeJh5ELvIRLXAwTQJSKuRIVFcL0fuo37wqe2e/1em1uZA4b0aft5thBDTRrFG1r yTVdOQFi2yCoHtNde0Rq/Qjn1auaQJkCY4FU85qXIVPz2iH8g1c1L/ifaFqsvcsbuHfwg9 Vi52Dx7DhWKq8vce2Z9C9Z5WD4burqye1F6+7AWpjBOHfttgiAK6WEjwjwzPbshONBBoTq 3u047ExD0VIwdCkL8CabygYb8gl+U4un7LjGADWBLHcmVXgmz3I9d6Ah/liiB0sasMo4aP UpIiJqda/dibeF1ctkkkrLXdHOkmQGASN4q8dT9v4L6J3ls/42nc5YD8ZDcLMA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640629158; a=rsa-sha256; cv=none; b=Lpwthe0MRrs2STvwkwcmPsTiSqC6ot27IiY3FG4o52iW4nZ51iuFzMbHl1Jz75GFn690Ns Tq8k+LQ6CVFjRDQI7v+nlg5e+pCt2/CsYCd5ZuPM0JjRueRXi2zSMLkKpKhyMyZAGEhNnz OwTFchH/N39POyieBlfGOjfARuDiB6oog0MOLjJs9Xf4ghSxolYte1kASRtXgmO4dO+bHw oZ1h5k/8bahsq6G16qx+l0DErrtk78kLykletnCDlTZzxSLi9fB/qI4vHDUAycg3F7YCBg FZ1jc7ACIDW/rwhVPMKm70xAYJifxVCsFREAPPMfQ02DCM///dEcs07J6FvAoA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=YNei56LJ; 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.67 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=YNei56LJ; 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: 787B01C2ED X-Spam-Score: -3.67 X-Migadu-Scanner: scn1.migadu.com X-TUID: u2MyQxH853yt --=-=-= Content-Type: text/plain Hey, >> 1. We should hide vdb as it is an empty drive, maybe by requiring a >> minimal available space. Josselin, what do you think about it? > > Looks good to me. Here's an attached patch. It seems to work fine, but I am still running the system tests. WDYT? Thanks, Mathieu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-installer-Ignore-small-devices.patch >From d7cc04a71b477d8527b901a66704b28b4e618e04 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 27 Dec 2021 19:12:54 +0100 Subject: [PATCH 1/1] installer: Ignore small devices. Filter the devices that are smaller than 10GiB in the device selection list. * gnu/installer/parted.scm (%min-device-size): New variable. (non-install-devices): Rename it ... (eligible-devices): ... this way. Filter the install device as well as the small devices. * gnu/installer/newt/partition.scm (run-partitioning-page): Adapt it. --- gnu/installer/newt/partition.scm | 9 +++--- gnu/installer/parted.scm | 47 +++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partition.scm index 70c11ed8ad..ccc7686906 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -83,7 +83,8 @@ (define (device-items) devices)) (let* ((result (run-listbox-selection-page - #:info-text (G_ "Please select a disk.") + #:info-text (G_ "Please select a \ +disk. The installation device as well as the small devices are filtered.") #:title (G_ "Disk") #:listbox-items (device-items) #:listbox-item->text cdr @@ -792,13 +793,13 @@ (define (run-page devices) result-user-partitions))))) (init-parted) - (let* ((non-install-devices (non-install-devices)) - (user-partitions (run-page non-install-devices)) + (let* ((eligible-devices (eligible-devices)) + (user-partitions (run-page eligible-devices)) (user-partitions-with-pass (prompt-luks-passwords user-partitions)) (form (draw-formatting-page user-partitions))) ;; Make sure the disks are not in use before proceeding to formatting. - (free-parted non-install-devices) + (free-parted eligible-devices) (format-user-partitions user-partitions-with-pass) (syslog "formatted ~a user partitions~%" (length user-partitions-with-pass)) diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm index 289cd660fd..77902599d6 100644 --- a/gnu/installer/parted.scm +++ b/gnu/installer/parted.scm @@ -81,7 +81,7 @@ (define-module (gnu installer parted) with-delay-device-in-use? force-device-sync - non-install-devices + eligible-devices partition-user-type user-fs-type-name partition-filesystem-user-type @@ -356,28 +356,49 @@ (define (installer-root-partition-path) (and=> (uuid root) find-partition-by-uuid))))) -(define (non-install-devices) - "Return all the available devices, except the install device." +;; Minimal installation device size. +(define %min-device-size + (* 10 GIBIBYTE-SIZE)) ;10GiB + +(define (eligible-devices) + "Return all the available device except the install device and the devices +with are smaller than %MIN-DEVICE-SIZE." (define the-installer-root-partition-path (installer-root-partition-path)) + (define (small-device? device) + (let ((length (device-length device)) + (sector-size (device-sector-size device))) + (and (< (* length sector-size) %min-device-size) + (syslog "~a is not eligible because it is smaller than ~a.~%" + (device-path device) + (unit-format-custom-byte device + %min-device-size + UNIT-GIGABYTE))))) + ;; Read partition table of device and compare each path to the one ;; 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 - (any (lambda (partition) - (string=? the-installer-root-partition-path - (partition-get-path partition))) - (disk-partitions disk)))))) - - (remove installation-device? (devices))) + (and (or (string=? the-installer-root-partition-path + (device-path device)) + (let ((disk (disk-new device))) + (and disk + (any (lambda (partition) + (string=? the-installer-root-partition-path + (partition-get-path partition))) + (disk-partitions disk))))) + (syslog "~a is not eligible because it is the installation device.~%" + (device-path device)))) + + (remove + (lambda (device) + (or (installation-device? device) + (small-device? device))) + (devices))) ;; -- 2.34.0 --=-=-=--