[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Wed Apr 21 12:23:12 UTC 2010


 libparted/labels/dos.c   |    2 +
 tests/Makefile.am        |    1 
 tests/t3300-palo-prep.sh |   51 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+)

New commits:
commit 3d452b02b9d5c8312c44a4d89ae9c5940aaa49ee
Author: Jim Meyering <meyering at redhat.com>
Date:   Tue Apr 20 18:30:20 2010 +0200

    tests: test for palo and prep interaction
    
    * tests/t3300-palo-prep.sh: New file.
    * tests/Makefile.am (TESTS): Add it.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 49829c5..c2d826c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -25,6 +25,7 @@ TESTS = \
   t2400-dos-hfs-partition-type.sh \
   t3000-resize-fs.sh \
   t3200-type-change.sh \
+  t3300-palo-prep.sh \
   t4000-sun-raid-type.sh \
   t4001-sun-vtoc.sh \
   t4100-msdos-partition-limits.sh \
diff --git a/tests/t3300-palo-prep.sh b/tests/t3300-palo-prep.sh
new file mode 100755
index 0000000..5ff40b3
--- /dev/null
+++ b/tests/t3300-palo-prep.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+# Ensure that palo and prep types work properly.
+
+# Copyright (C) 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+if test "$VERBOSE" = yes; then
+  set -x
+  parted --version
+fi
+
+: ${srcdir=.}
+. $srcdir/t-lib.sh
+ss=$sector_size_
+
+cat > exp <<EOF || framework_failure
+1:2048s:4095s:2048s:::palo;
+1:2048s:4095s:2048s:::prep;
+1:2048s:4095s:2048s:::palo;
+EOF
+
+fail=0
+dev=dev-file
+
+n_sectors=5000
+dd if=/dev/null of=$dev bs=$ss seek=$n_sectors || fail=1
+
+parted -m -s $dev mklabel msdos \
+  mkpart pri ext2 $((1*2048))s $((2*2048-1))s \
+  set 1 palo on u s print \
+  set 1 prep on u s print \
+  set 1 palo on u s print \
+    > out 2> err || fail=1
+
+grep -E '^1:2048s:4095s:2048s:::p...;$' out > k; mv k out
+
+compare out exp || fail=1
+
+Exit $fail

commit 5c63bf8930794b77d740654e128463d1fa81b79b
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Mon Apr 19 13:55:33 2010 +0200

    dos: fix prep / palo flag handling
    
    Setting the prep flag was not clearing the palo flag and vice versa
    * libparted/labels/dos.c (msdos_partition_set_flag): Fix prep / palo
    flag handling.

diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c
index 6fb4aef..752f186 100644
--- a/libparted/labels/dos.c
+++ b/libparted/labels/dos.c
@@ -1438,6 +1438,7 @@ msdos_partition_set_flag (PedPartition* part,
 			dos_data->hidden = 0;
 			dos_data->raid = 0;
 			dos_data->lvm = 0;
+			dos_data->prep = 0;
 		}
 		dos_data->palo = state;
 		return ped_partition_set_system (part, part->fs_type);
@@ -1447,6 +1448,7 @@ msdos_partition_set_flag (PedPartition* part,
 			dos_data->hidden = 0;
 			dos_data->raid = 0;
 			dos_data->lvm = 0;
+			dos_data->palo = 0;
 		}
 		dos_data->prep = state;
 		return ped_partition_set_system (part, part->fs_type);



More information about the Parted-commits mailing list