From patchwork Tue Aug 1 15:48:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7056 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RFffx2SX7z3wpN for ; Tue, 1 Aug 2023 15:49:13 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RFffr5kh9zlG; Tue, 1 Aug 2023 15:49:08 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RFffr5Fdhz2yyR; Tue, 1 Aug 2023 15:49:08 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RFffq639wz2yJG for ; Tue, 1 Aug 2023 15:49:07 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4RFffl5t66z1kr; Tue, 1 Aug 2023 15:49:03 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1690904944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i0yRhrM6FixQQoAa3YN7gt5sKGYhGce6gTrXea5PlSI=; b=w9W4YpMX+X2XyGKM1NzPVWG5cNyegDjNne10USD1aFToik6WCDzpDaLet1Bi1CcUvy2+w3 hw7LGPfB1DrQ3vBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1690904944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i0yRhrM6FixQQoAa3YN7gt5sKGYhGce6gTrXea5PlSI=; b=tvSLNApXqc6RaBQkjE4Yi236PtbPspPSocbV62x5aYuGCm9E2t8V9kY9UrCEQhaHX2RjmA 32V9xi7GLhFo1KpTDCtblfS+X4UNvLlcCGKMpA8fXL81KW/NixHaOENyatud0VkNqmNsbb TKPDcWfML7d2JL74DnbscwJkL/wg+z1s/jTOkR1KiNj4EV/ZNZLCVurn2mRuJ/MwRyVkb/ gdoqDpUQ5L5FrX17Z6T20FEANIIUnzwIU+9+yzzUWI+JC7Cva+AJtKHlrg3ykUC5MqDYPA 6Lcx9dPH1FgAaFX6aa6FhOs7WgZbbIO5ewAjrAac7+UfL3aTBgtw4v9Dsq4rlA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCHv2 09/12] extrahd.cgi: Drop select for FS selection. Date: Tue, 1 Aug 2023 17:48:36 +0200 Message-Id: <20230801154839.2373-9-stefan.schantl@ipfire.org> In-Reply-To: <20230801154839.2373-1-stefan.schantl@ipfire.org> References: <20230801154839.2373-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" This feature does not have any benefit because the linux kernel knows best which filesystem a device/partition has. So there is no need for a user to specify this by-hand. This also prevents from choosing a wrong fs type and as a direct result in a not mountable device. Signed-off-by: Stefan Schantl Reviewed-by: Bernhard Bitsch --- html/cgi-bin/extrahd.cgi | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index 0b59a02f7..c621bd72f 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -45,16 +45,6 @@ my @valid_mount_dirs = ( "/mnt", ); -# Array which contains the supported file systems. -my @supported_filesystems = ( - "auto", - "ext3", - "ext4", - "xfs", - "vfat", - "ntfs-3g" -); - # Grab all available block devices. my @devices = &get_block_devices(); @@ -252,6 +242,9 @@ END # Convert into human-readable format. my $size = &General::formatBytes($bsize); + # Try to omit the used filesystem. + my $fs = $filesystems{$partition}; + # Get the mountpoint. my $mountpoint = $mountpoints{$partition}; @@ -279,11 +272,9 @@ END } elsif (&is_swap($partition)) { $disabled = "disabled"; $mountpoint = "swap"; + $fs = "swap"; } - # Omit the used filesystem. - my $fs = $filesystems{$partition}; - print < @@ -291,23 +282,7 @@ END /dev/$partition $Lang::tr{'size'} $size -