From patchwork Fri Jun 23 04:44:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6954 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 (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4QnPlm52mKz3wjw for ; Fri, 23 Jun 2023 04:44:20 +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 (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4QnPlh3bP8zhP; Fri, 23 Jun 2023 04:44:16 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4QnPlh0m8wz2yp4; Fri, 23 Jun 2023 04:44:16 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4QnPlc6WVVz2xGx for ; Fri, 23 Jun 2023 04:44:12 +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 (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4QnPlZ06N8zdF; Fri, 23 Jun 2023 04:44:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1687495450; 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; bh=j7PyBvuNBRIzXWtEHbVFCAXbUpOR11kX3y+4a6M/uj0=; b=Ux9xCR1DuUqTznLs5t24VJUmQT8laKh8BuipBxr+/HCxuMEK4KRoD8cNpcrvCfI7KQn8Yb Ed+mFmtr3oCCBxqmPd+OvH9yeXpiPAMpzUUJ8EFcT4eRsAEqzdqKmzAU6FJ0WCOx0gbhZa Ngi+FbQbSQHKuAjQCMGrWfR/w/uZSFWdEUfuUYCWef565kMqfV/6HYrLVBv1lYBSo6ouX1 v1s6a22h8AItbLkjd//MBNYmz4HhY7a5e4zTBTZQBid1bPV56CC9muUbZykuSedsDLJjXJ TjzwL3RQW5S4+XjaQoPPHRSnxCNMKtyrTjByCUW4IRU8eK0IRipHxgpwdT444A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1687495450; 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; bh=j7PyBvuNBRIzXWtEHbVFCAXbUpOR11kX3y+4a6M/uj0=; b=0CmOhnCcBN0EwfOunG5NEA7lv2Qdu7gKouNxdLFdggYZCKcSaKqJpD+3yyvtqPjfbQ2fKS zOwbOtgZiv3gt0Dw== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] extrahd.cgi: Drop select for FS selection. Date: Fri, 23 Jun 2023 06:44:03 +0200 Message-Id: <20230623044403.4851-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: Michael Tremer --- 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 8f6a91a18..bb67b792d 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 -