guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: installer: Improve install device detection.


From: guix-commits
Subject: branch master updated: installer: Improve install device detection.
Date: Sat, 12 Jun 2021 12:43:50 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 154a4e0  installer: Improve install device detection.
154a4e0 is described below

commit 154a4e046281c28e39b5016e965d3d937a2ea4a1
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sat Jun 12 18:40:39 2021 +0200

    installer: Improve install device detection.
    
    * gnu/installer/parted.scm (non-install-devices): Improve the detection by
    assuming that any device with the ISO9660 label is the installation device.
---
 gnu/installer/parted.scm | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index 930f45a..6bb5e9e 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -24,7 +24,8 @@
   #:use-module (gnu installer newt page)
   #:use-module (gnu system uuid)
   #:use-module ((gnu build file-systems)
-                #:select (read-partition-uuid
+                #:select (find-partition-by-label
+                          read-partition-uuid
                           read-luks-partition-uuid))
   #:use-module ((gnu build linux-modules)
                 #:select (missing-modules))
@@ -338,14 +339,17 @@ fail. See rereadpt function in wipefs.c of util-linux for 
an explanation."
    (invoke "dmsetup" "remove_all")))
 
 (define (non-install-devices)
-  "Return all the available devices, except the busy one, allegedly the
-install device. DEVICE-IS-BUSY? is a parted call, checking if the device is
-mounted."
-  ;; FIXME: The install image uses an overlayfs so the install device does not
-  ;; appear as mounted and won't be considered as busy.
+  "Return all the available devices, except the install device."
+  ;; XXX: The install image uses an overlayfs so detecting the install device
+  ;; is not easy.  Assume that a given device is the installation device if it
+  ;; is reported as busy by parted or if its label is the ISO9660 image label.
   (remove (lambda (device)
-            (let ((file-name (device-path device)))
-              (device-is-busy? device)))
+            (let ((file-name (device-path device))
+                  (install-file-name
+                   (find-partition-by-label "GUIX_IMAGE")))
+              (or (device-is-busy? device)
+                  (and install-file-name
+                       (string=? file-name install-file-name)))))
           (devices)))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]