[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
57/67: installer: parted: Do not call BLKRRPART on loop devices.
From: |
guix-commits |
Subject: |
57/67: installer: parted: Do not call BLKRRPART on loop devices. |
Date: |
Wed, 16 Jan 2019 19:00:44 -0500 (EST) |
civodul pushed a commit to branch wip-newt-installer
in repository guix.
commit d30e83fa12a8e16ddca47b80bb203af6e00ef960
Author: Mathieu Othacehe <address@hidden>
Date: Tue Jan 1 19:23:21 2019 +0100
installer: parted: Do not call BLKRRPART on loop devices.
* gnu/installer/parted.scm (with-delay-device-in-use?): Return immediately
if
the file-name passed as argument designates a loop device.
---
gnu/installer/parted.scm | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index ea62d6a..40054c0 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Mathieu Othacehe <address@hidden>
+;;; Copyright © 2018, 2019 Mathieu Othacehe <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -31,6 +31,7 @@
#:use-module (guix i18n)
#:use-module (parted)
#:use-module (ice-9 match)
+ #:use-module (ice-9 regex)
#:use-module (rnrs io ports)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
@@ -339,12 +340,14 @@ PARTED-OBJECT field equals PARTITION, return #f if not
found."
(define (with-delay-device-in-use? file-name)
"Call DEVICE-IN-USE? with a few retries, as the first re-read will often
fail. See rereadpt function in wipefs.c of util-linux for an explanation."
- (let loop ((try 4))
- (usleep 250000)
- (let ((in-use? (device-in-use? file-name)))
- (if (and in-use? (> try 0))
- (loop (- try 1))
- in-use?))))
+ ;; Kernel always return EINVAL for BLKRRPART on loopdevices.
+ (and (not (string-match "/dev/loop*" file-name))
+ (let loop ((try 4))
+ (usleep 250000)
+ (let ((in-use? (device-in-use? file-name)))
+ (if (and in-use? (> try 0))
+ (loop (- try 1))
+ in-use?)))))
(define* (force-device-sync device)
"Force a flushing of the given DEVICE."
- 24/67: installer: Add services page., (continued)
- 24/67: installer: Add services page., guix-commits, 2019/01/16
- 37/67: installer: locale: Make clear that the point is to select a glibc locale., guix-commits, 2019/01/16
- 26/67: installer: Add new pages., guix-commits, 2019/01/16
- 07/67: configure: Disable installer build by default., guix-commits, 2019/01/16
- 30/67: installer: Add user module., guix-commits, 2019/01/16
- 50/67: installer: partition: Fix typo., guix-commits, 2019/01/16
- 49/67: installer: partition: Fix swaping and use syscalls., guix-commits, 2019/01/16
- 53/67: file-systems: Add read-luks-partition-uuid., guix-commits, 2019/01/16
- 46/67: installer: Display an eventual backtrace in a page., guix-commits, 2019/01/16
- 22/67: installer: Add configuration formatter., guix-commits, 2019/01/16
- 57/67: installer: parted: Do not call BLKRRPART on loop devices.,
guix-commits <=
- 08/67: doc: Document the graphical installer., guix-commits, 2019/01/16
- 03/67: gnu: kmscon: Add runtime keymap update support., guix-commits, 2019/01/16
- 27/67: installer: Redirect to TTY3 root shell for unguided install., guix-commits, 2019/01/16
- 13/67: installer: Fix locale installation., guix-commits, 2019/01/16
- 29/67: installer: Fix comments., guix-commits, 2019/01/16
- 25/67: installer: Add hostname., guix-commits, 2019/01/16
- 32/67: installer: Reorder POTFILES.in, guix-commits, 2019/01/16
- 38/67: installer: locale: Set English as the default language., guix-commits, 2019/01/16
- 34/67: installer: Remove group selection in user page., guix-commits, 2019/01/16
- 40/67: installer: keymap: Do not fail on non-kmscon terminals., guix-commits, 2019/01/16