Package: release.debian.org Severity: normal X-Debbugs-Cc: gpar...@packages.debian.org Control: affects -1 + src:gparted User: release.debian....@packages.debian.org Usertags: unblock
Please unblock package gparted [ Reason ] To fix Bug #1105875: exfat progs incompatible. exfatprogs changed its output format, causing gparted to be able to parse it and so it gives an error saying that the partition can not be read. Upstream had already fixed it, so I cherry-picked the straightforward fix. [ Impact ] People using the exfat filesystem will get an error from gparted saying it can not be read. [ Tests ] I verified the error, then upgraded to the patched version and verified it worked correctly. [ Risks ] The change is trival; it's just the exact text that it expects to parse. [ Checklist ] [x] all changes are documented in the d/changelog [x] I reviewed all changes and I approve them [x] attach debdiff against the package in testing unblock gparted/1.6.0-2
diff -Nru gparted-1.6.0/debian/changelog gparted-1.6.0/debian/changelog --- gparted-1.6.0/debian/changelog 2024-05-24 11:20:27.000000000 -0400 +++ gparted-1.6.0/debian/changelog 2025-05-16 09:35:07.000000000 -0400 @@ -1,3 +1,9 @@ +gparted (1.6.0-2) unstable; urgency=medium + + * Cherry-pick upstream commit for exfatprogs fix (Closes: #1105875) + + -- Phillip Susi <ph...@thesusis.net> Fri, 16 May 2025 09:35:07 -0400 + gparted (1.6.0-1) unstable; urgency=medium * New upstream version 1.6.0 diff -Nru gparted-1.6.0/debian/patches/Read-exFAT-file-system-usage-only-from-exfatprogs-1.2.3-2.patch gparted-1.6.0/debian/patches/Read-exFAT-file-system-usage-only-from-exfatprogs-1.2.3-2.patch --- gparted-1.6.0/debian/patches/Read-exFAT-file-system-usage-only-from-exfatprogs-1.2.3-2.patch 1969-12-31 19:00:00.000000000 -0500 +++ gparted-1.6.0/debian/patches/Read-exFAT-file-system-usage-only-from-exfatprogs-1.2.3-2.patch 2025-05-16 08:50:20.000000000 -0400 @@ -0,0 +1,105 @@ +From: Mike Fleetwood <mike.fleetw...@googlemail.com> +Date: Fri, 2 Aug 2024 20:57:11 +0100 +Subject: Read exFAT file system usage only from exfatprogs >= 1.2.3 (#261) + +exFAT file system usage is no longer readable when exfatprogs 1.2.3, +released 2024-05-23 [1], and later is installed. This is because the +output from dump.exfat changed as a result of commit [2]. + +On Fedora 39 with exfatprogs 1.2.3 installed and exfatprogs 1.2.2 +compiled locally from git; old dump.exfat output: + # ~fedora/programming/c/exfatprogs/dump/dump.exfat /dev/sdb1 | egrep 'exfatprogs version|Volume Length\(sectors\):|Sector|Free Clusters:' + exfatprogs version : 1.2.2 + Volume Length(sectors): 524288 +>> Sector Size Bits: 9 +>> Sector per Cluster bits: 3 + Free Clusters: 65024 + +New dump.exfat output: + # dump.exfat /dev/sdb1 | egrep 'exfatprogs version|Volume Length\(sectors\):|Sector|Free Clusters:' + exfatprogs version : 1.2.3 + Volume Length(sectors): 524288 +>> Bytes per Sector: 512 +>> Sectors per Cluster: 8 + Free Clusters: 65024 + +Change the code to read exFAT usage only from dump.exfat 1.2.3 style +output. Don't parse older style output for now as that makes the code +simpler. + +[1] exfatprogs-1.2.3 version released + https://github.com/exfatprogs/exfatprogs/releases/tag/1.2.3 +[2] dump: Sector and Cluster units + https://github.com/exfatprogs/exfatprogs/commit/41863cb0f5b9fee0856ba4f948bc40dc4527b965 + +Closes #261 - Unable to read the contents of exfat file system with + exfatprogs >= 1.2.3 +--- + src/exfat.cc | 34 ++++++++++++++++------------------ + 1 file changed, 16 insertions(+), 18 deletions(-) + +diff --git a/src/exfat.cc b/src/exfat.cc +index 39edcdb..9b3c7a5 100644 +--- a/src/exfat.cc ++++ b/src/exfat.cc +@@ -87,12 +87,12 @@ void exfat::set_used_sectors(Partition& partition) + return; + } + +- // Example output (lines of interest only): +- // $ dump.exfat /dev/sdb1 ++ // Example output from exfatprogs >= 1.2.3 (lines of interest only): ++ // # dump.exfat /dev/sdb1 + // Volume Length(sectors): 524288 +- // Sector Size Bits: 9 +- // Sector per Cluster bits: 3 +- // Free Clusters: 23585 ++ // Bytes per Sector: 512 ++ // Sectors per Cluster: 8 ++ // Free Clusters: 65024 + // + // "exFAT file system specification" + // https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification +@@ -106,17 +106,17 @@ void exfat::set_used_sectors(Partition& partition) + if (index < output.length()) + sscanf(output.substr(index).c_str(), "Volume Length(sectors): %lld", &volume_length); + +- // FS sector size = 2^(bytes_per_sector_shift) +- long long bytes_per_sector_shift = -1; +- index = output.find("Sector Size Bits:"); ++ // FS sector size ++ long long bytes_per_sector = -1; ++ index = output.find("Bytes per Sector:"); + if (index < output.length()) +- sscanf(output.substr(index).c_str(), "Sector Size Bits: %lld", &bytes_per_sector_shift); ++ sscanf(output.substr(index).c_str(), "Bytes per Sector: %lld", &bytes_per_sector); + +- // Cluster size = sector_size * 2^(sectors_per_cluster_shift) +- long long sectors_per_cluster_shift = -1; +- index = output.find("Sector per Cluster bits:"); ++ // Cluster size in FS sectors ++ long long sectors_per_cluster = -1; ++ index = output.find("Sectors per Cluster:"); + if (index < output.length()) +- sscanf(output.substr(index).c_str(), "Sector per Cluster bits: %lld", §ors_per_cluster_shift); ++ sscanf(output.substr(index).c_str(), "Sectors per Cluster: %lld", §ors_per_cluster); + + // Free clusters + long long free_clusters = -1; +@@ -124,13 +124,11 @@ void exfat::set_used_sectors(Partition& partition) + if (index < output.length()) + sscanf(output.substr(index).c_str(), "Free Clusters: %lld", &free_clusters); + +- if ( volume_length > -1 && bytes_per_sector_shift > -1 && +- sectors_per_cluster_shift > -1 && free_clusters > -1 ) ++ if (volume_length > -1 && bytes_per_sector > -1 && sectors_per_cluster > -1 && free_clusters > -1) + { +- Byte_Value sector_size = 1 << bytes_per_sector_shift; +- Byte_Value cluster_size = sector_size * (1 << sectors_per_cluster_shift); ++ Byte_Value cluster_size = bytes_per_sector * sectors_per_cluster; ++ Sector fs_size = volume_length * bytes_per_sector / partition.sector_size; + Sector fs_free = free_clusters * cluster_size / partition.sector_size; +- Sector fs_size = volume_length * sector_size / partition.sector_size; + partition.set_sector_usage(fs_size, fs_free); + partition.fs_block_size = cluster_size; + } diff -Nru gparted-1.6.0/debian/patches/series gparted-1.6.0/debian/patches/series --- gparted-1.6.0/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 +++ gparted-1.6.0/debian/patches/series 2025-05-16 08:50:20.000000000 -0400 @@ -0,0 +1 @@ +Read-exFAT-file-system-usage-only-from-exfatprogs-1.2.3-2.patch