From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wKPONvVa+2LQRAAAbAwnHQ (envelope-from ) for ; Tue, 16 Aug 2022 10:53:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id IF/INfVa+2IFwgAAG6o9tA (envelope-from ) for ; Tue, 16 Aug 2022 10:53:09 +0200 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 A6C291D131 for ; Tue, 16 Aug 2022 10:53:09 +0200 (CEST) Received: from localhost ([::1]:34980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNsJw-0005Up-E5 for larch@yhetil.org; Tue, 16 Aug 2022 04:53:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNsJq-0005Sv-1C for bug-guix@gnu.org; Tue, 16 Aug 2022 04:53:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNsJp-0007OJ-P4 for bug-guix@gnu.org; Tue, 16 Aug 2022 04:53:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNsJp-0008Gs-Io for bug-guix@gnu.org; Tue, 16 Aug 2022 04:53:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#57232: [installer] ENTER in guided partitioner destroys partition table Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 16 Aug 2022 08:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57232 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Tobias Geerinckx-Rice Cc: 57232@debbugs.gnu.org Received: via spool by 57232-submit@debbugs.gnu.org id=B57232.166063992431727 (code B ref 57232); Tue, 16 Aug 2022 08:53:01 +0000 Received: (at 57232) by debbugs.gnu.org; 16 Aug 2022 08:52:04 +0000 Received: from localhost ([127.0.0.1]:44750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNsIr-0008FO-59 for submit@debbugs.gnu.org; Tue, 16 Aug 2022 04:52:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNsIk-0008F1-Vs for 57232@debbugs.gnu.org; Tue, 16 Aug 2022 04:51:59 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44846) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNsIc-0007Er-NQ; Tue, 16 Aug 2022 04:51:47 -0400 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=zIYfwgz9TokpwNrxDNkRKKAhEwGua+ZE0ut8aJPvaPI=; b=Xker4qaBWsfUK40nb5nZ GO0RPLTbi/jf9mXrUvb3wFYcju25OY1K8N+4FjAhPx5dDINGR4ogPvZkNm4/Vz8HO+89rTEQhjuLq vNv7DOGAhzCYH2LGaa/V/9ae5gAKC4joJg95PMDXg3ag9Wr2vQ4H5R4AW6uKAkrX2I0H5nHIyqmTj 6eR/WFWEBLWBSM8t2+W8kileBtXN8naWWxJr+eFjZzosDWIVv817dXjO0gwyr86vUmFZh5TIUNpuu LnrpXWufRkUuG3+0qI/Jl0eVuBis+dLyZaGUv4pzIBIbl9+PYDTBwtT7NSOrDmUfuxXBniD1bHqkM 4D+IwkUnawbLsA==; Received: from 2a02-8429-81d2-3d01-94c9-8097-ea5c-2775.rev.sfr.net ([2a02:8429:81d2:3d01:94c9:8097:ea5c:2775]:44026 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNsIb-0001WM-Sw; Tue, 16 Aug 2022 04:51:46 -0400 From: Mathieu Othacehe References: <87zgg5f6el.fsf@nckx> Date: Tue, 16 Aug 2022 10:51:43 +0200 In-Reply-To: <87zgg5f6el.fsf@nckx> (Tobias Geerinckx-Rice's message of "Tue, 16 Aug 2022 01:05:29 +0200") Message-ID: <87y1voefkw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660639989; 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=zIYfwgz9TokpwNrxDNkRKKAhEwGua+ZE0ut8aJPvaPI=; b=qO1w9BoOeCHBEXZ/4feBGjrs9EBZgrNimJ/uP5KBY6sdMTHfIzIHnRaTA/IqVrfBfAVals JdI/axsm518y2wXJML02PTILaME7uElgmfqBWQHbls844HWj6wbP+HTRfgTLdXLaAXbnEu AJszuD5IjljuP5KYnu1geI0r5AAc+PvtPE70DebLuNrcefSFiiBt8Y2+pujmp1HN9MdQ1N 3bnODXEJbxQhOdD6Q9PRpI4lLt8D3I5+77qK6Kh8U7X58YvQTRXUBEsE8rD8k3izI0WUYY Hdbe/RG3ZKYJmIXYlsPLyTSPbUEzC+U+i2+LdF3DYPocp71qbyztp1tRwHghIQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660639989; a=rsa-sha256; cv=none; b=VedPitenysdiHdD8aBBV9UJ/Y/+ETdZbRTROIdE7LZ8zfXAkZmWbpz1B13R32dMd4OKGzy Y6YRtiy7DxsiZg1mQ3LDxyZfdHryVHsnCP8auxTiKwDc3EpBYO/+wOPjV1Ly4jhGlSj9Wd AxhxaFV0jRG6cy/JYzOiIXl+koYtt8quaV7igZP0m9oKb+sBVjRivfBEKrUecP9IWwF5r9 sPxjxJgYQ75dQclvNzzqXI0+quii0asDEapFBzGF0GQ3w5MbgjBuhuTeEBL7ZLkUPEdqlx s4sKiBRyo1cK4aZhQ46io0izZ8l7nBa7AZSNwZ5Bq2GRswrTBLFrqdjCgzlQvw== 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=Xker4qaB; 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: -4.06 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=Xker4qaB; 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: A6C291D131 X-Spam-Score: -4.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: IiLlgbWXNyZi --=-=-= Content-Type: text/plain Hey Tobias, > What that does is immediately and without confirmation wipe the on-disc > partition table. And its back-up. Oops, glad you were able to recover, I was also bitten in the past. The attached patch adds an extra confirmation page before wiping everything, WDYT? Mathieu --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-installer-partition-Add-a-confirmation-page-before-f.patch Content-Transfer-Encoding: quoted-printable >From 4a9c1fb1fe7f9a65b2b7d1f9e4419b1d28a8082e Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 16 Aug 2022 10:49:07 +0200 Subject: [PATCH 1/1] installer: partition: Add a confirmation page before formatting. Fixes: . * gnu/installer/newt/partition.scm (run-label-confirmation-page): New procedure. (run-label-page): Call the above procedure before proceeding. --- gnu/installer/newt/partition.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/installer/newt/partition.scm b/gnu/installer/newt/partitio= n.scm index e7a97810ac..f11a644f92 100644 --- a/gnu/installer/newt/partition.scm +++ b/gnu/installer/newt/partition.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2018, 2019 Mathieu Othacehe +;;; Copyright =C2=A9 2018, 2019, 2022 Mathieu Othacehe ;;; Copyright =C2=A9 2019, 2020 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2020 Tobias Geerinckx-Rice ;;; @@ -92,6 +92,15 @@ (define (device-items) (device (car result))) device)) =20 +(define (run-label-confirmation-page callback) + (lambda (item) + (and (run-confirmation-page + (format #f (G_ "This will create a new ~a partition table, \ +all data on disk will be lost, are you sure you want to proceed?") item) + (G_ "Format disk?") + #:exit-button-procedure callback) + item))) + (define (run-label-page button-text button-callback) "Run a page asking the user to select a partition table label." ;; Force the GPT label if UEFI is supported. @@ -103,6 +112,8 @@ (define (run-label-page button-text button-callback) #:title (G_ "Partition table") #:listbox-items '("msdos" "gpt") #:listbox-item->text identity + #:listbox-callback-procedure + (run-label-confirmation-page button-callback) #:button-text button-text #:button-callback-procedure button-callback))) =20 --=20 2.37.1 --=-=-=--