diff --git a/parted-1.8.8-dospartrec.patch b/parted-1.8.8-dospartrec.patch new file mode 100644 index 0000000..e3e374f --- /dev/null +++ b/parted-1.8.8-dospartrec.patch @@ -0,0 +1,28 @@ +diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c +index e513a05..81d8600 100644 +--- a/libparted/labels/dos.c ++++ b/libparted/labels/dos.c +@@ -192,14 +192,16 @@ msdos_probe (const PedDevice *dev) + if (PED_LE16_TO_CPU (part_table->magic) != MSDOS_MAGIC) + goto probe_fail; + +- /* if this is a FAT fs, fail here. Note that the Smart Boot Manager +- * Loader (SBML) signature indicates a partition table, not a file +- * system. ++ /* If this is a FAT fs, fail here. Checking for the FAT signature ++ * has some false positives; instead, do what the Linux kernel does ++ * and ensure that each partition has a boot indicator that is ++ * either 0 or 0x80. + */ +- if ((!strncmp (part_table->boot_code + 0x36, "FAT", 3) +- && strncmp (part_table->boot_code + 0x40, "SBML", 4) != 0) +- || !strncmp (part_table->boot_code + 0x52, "FAT", 3)) +- goto probe_fail; ++ for (i = 0; i < 4; i++) { ++ if (part_table->partitions[i].boot_ind != 0 ++ && part_table->partitions[i].boot_ind != 0x80) ++ goto probe_fail; ++ } + + /* If this is a GPT disk, fail here */ + for (i = 0; i < 4; i++) { diff --git a/parted.spec b/parted.spec index a6d102e..a90e029 100644 --- a/parted.spec +++ b/parted.spec @@ -4,7 +4,7 @@ Summary: The GNU disk partition manipulation program Name: parted Version: 1.8.8 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ Group: Applications/System URL: http://www.gnu.org/software/parted @@ -17,6 +17,7 @@ Patch3: %{name}-1.8.8-manpage.patch Patch4: %{name}-1.8.8-gcc-4.3.patch Patch5: %{name}-1.8.8-nofixgpt.patch Patch6: %{name}-1.8.8-alpha.patch +Patch7: %{name}-1.8.8-dospartrec.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: e2fsprogs-devel @@ -60,6 +61,7 @@ Parted library, you need to install this package. %patch4 -p1 -b .gcc43 %patch5 -p1 -b .nofixgpt %patch6 -p1 -b .alpha +%patch7 -p1 -b .dospartrec %build %configure --enable-device-mapper --enable-selinux --disable-static @@ -117,6 +119,9 @@ fi %{_exec_prefix}/%{_lib}/pkgconfig/libparted.pc %changelog +* Thu May 29 2008 Joel Granados - 1.8.8-6 +- Do a better job at recognizing the dos partition. (#246423) + * Thu Apr 10 2008 David Cantrell - 1.8.8-5 - Allow RAID or LVM partition types on BSD disklabels. (jay.estabrook AT hp.com, #427114)