OSDN Git Service

android-x86/external-parted.git
14 years agotests: propagate recent improvements to copied-from code
Jim Meyering [Tue, 13 Apr 2010 19:17:50 +0000 (21:17 +0200)]
tests: propagate recent improvements to copied-from code

* tests/t1700-ext-probe.sh: Fix typo s/2>1/2>&1/ and use
a tighter regexp also in the preceding loop.
Noted by Colin Watson.

14 years agomaint: constify ped_device_get_constraint interface
Colin Watson [Mon, 12 Apr 2010 09:16:21 +0000 (10:16 +0100)]
maint: constify ped_device_get_constraint interface

* include/parted/device.h (ped_device_get_constraint): Constify "dev"
parameter.
* libparted/device.c (ped_device_get_constraint): Likewise.

14 years agolibparted: uninit_bg and flex_bg features should indicate ext4
Colin Watson [Mon, 12 Apr 2010 23:11:13 +0000 (00:11 +0100)]
libparted: uninit_bg and flex_bg features should indicate ext4

According to tune2fs(8), the uninit_bg and flex_bg features are only
supported by ext4, so libparted should treat their presence as
indicating ext4.  Reported by C de-Avillez in
https://bugs.launchpad.net/ubuntu/+source/parted/+bug/561599.

* libparted/fs/ext2/ext2_fs.h: Define EXT4_FEATURE_RO_COMPAT_GDT_CSUM
and EXT4_FEATURE_INCOMPAT_FLEX_BG.
* libparted/fs/ext2/interface.c (_ext2_generic_probe): Test for
EXT4_FEATURE_RO_COMPAT_GDT_CSUM and EXT4_FEATURE_INCOMPAT_FLEX_BG when
probing for ext4.
* tests/t1700-ext-probe.sh: Test for this.
* NEWS (Bug fixes): Mention this.

14 years agolibparted: fix diagnostics about exceeding partition limits
Colin Watson [Fri, 9 Apr 2010 12:22:27 +0000 (13:22 +0100)]
libparted: fix diagnostics about exceeding partition limits

* libparted/labels/pt-tools.c (ptt_partition_max_start_len): Use the
correct value in the diagnostics that print the upper bound on
partition size and largest starting sector number.  Before, each
would use UINT32_MAX.  Now each prints the partition-table-specific
limit.

14 years agolibparted: add test for /dev/mapper symlink issue
Hans de Goede [Tue, 6 Apr 2010 13:57:17 +0000 (15:57 +0200)]
libparted: add test for /dev/mapper symlink issue

Sometimes, libparted operates on device mapper files with a path of
/dev/mapper/foo.  With newer lvm versions /dev/mapper/foo is a symlink
to /dev/dm-#. However some storage administration programs (anaconda,
for example) may do the following:
1) Create a ped_device for /dev/mapper/foo
2) ped_get_device resolves the symlink to /dev/dm-#, and the path
   in the PedDevice struct points to /dev/dm-#
3) The program does some things to lvm, causing the symlink to
   point to a different /dev/dm-# node
4) The program does something with the PedDevice, which results
   in an operation on the wrong device

Newer libparted versions do not suffer from this problem, as they
do not canonicalize device names under /dev/mapper. This test checks
for this bug.

* libparted/tests/symlink.c: New test which tests for this issue.
* libparted/tests/t3000-symlink.sh: New file.
* libparted/tests/Makefile.am: Include the new files.  Run the new test.

14 years agolibparted: don't canonicalize /dev/mapper paths
Hans de Goede [Tue, 6 Apr 2010 13:57:18 +0000 (15:57 +0200)]
libparted: don't canonicalize /dev/mapper paths

Besides fixing the issue displayed by libparted/tests/symlink.c,
this has the added advantage that the output of parted p on one of these
devices now says:
"Disk /dev/mapper/BigVol2-lv_iscsi_disk2: 34.4GB"

Which is a lot more user friendly then the output before this patch:
"Disk /dev/dm-6: 34.4GB"

* libparted/device.c (ped_device_get): Don't canonicalize names
that start with "/dev/mapper/".
* NEWS (Bug fixes): Mention it.
Thanks to Ales Kozumplik for the analysis.
Details in <http://bugzilla.redhat.com/577824>.

14 years agodoc: add @dircategory to Info documentation
Colin Watson [Tue, 30 Mar 2010 09:55:42 +0000 (10:55 +0100)]
doc: add @dircategory to Info documentation

The Texinfo documentation says that Info files should use @dircategory,
and suggests consulting the Free Software Directory to select a category
name.  The directory places Parted under "System administration".

* doc/parted.texi: Add `@dircategory System administration'.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Tue, 30 Mar 2010 10:13:11 +0000 (12:13 +0200)]
build: update gnulib submodule to latest

14 years agotests: disable new texinfo-acronym syntax-check from gnulib
Jim Meyering [Tue, 30 Mar 2010 10:23:16 +0000 (12:23 +0200)]
tests: disable new texinfo-acronym syntax-check from gnulib

* cfg.mk (local-checks-to-skip): Add new sc_texinfo_acronym, to skip it.

14 years agomaint: avoid using test's -o and -a operators: they are not portable
Jim Meyering [Tue, 30 Mar 2010 10:22:10 +0000 (12:22 +0200)]
maint: avoid using test's -o and -a operators: they are not portable

* tests/lvm-utils.sh: Don't use test ... -o.
* configure.ac: Don't use test ... -a.

14 years agomaint: remove unneeded #include
Jim Meyering [Tue, 30 Mar 2010 10:19:06 +0000 (12:19 +0200)]
maint: remove unneeded #include

* libparted/disk.c: Don't include "intprops.h".  It was unused.

14 years agobuild: prepare for gnulib's updated lib-ignore
Jim Meyering [Tue, 30 Mar 2010 10:18:35 +0000 (12:18 +0200)]
build: prepare for gnulib's updated lib-ignore

* parted/Makefile.am (parted_LDFLAGS): Now that we're using
gnulib's newer lib-ignore, add $(IGNORE_UNUSED_LIBRARIES_CFLAGS).

14 years agotests: distribute a few more tests and documentation files
Colin Watson [Tue, 30 Mar 2010 09:59:26 +0000 (11:59 +0200)]
tests: distribute a few more tests and documentation files

* debug/test/Makefile.am (noinst_SCRIPTS): Add test_fs_hfs and
test_fs_hfsplus.
* libparted/fs/hfs/Makefile.am (EXTRA_DIST): Add DOC and HISTORY.
* tests/Makefile.am (TESTS): Add t3200-type-change.sh.

14 years agobuild: avoid warning from bootstrap about obsolete strdup module
Jim Meyering [Tue, 16 Mar 2010 11:38:42 +0000 (12:38 +0100)]
build: avoid warning from bootstrap about obsolete strdup module

* bootstrap.conf (gnulib_modules): Use the strdup-posix module,
rather than the "strdup" one.

14 years agotests: reenable a "bsd" partition table test
Jim Meyering [Thu, 11 Mar 2010 18:48:08 +0000 (19:48 +0100)]
tests: reenable a "bsd" partition table test

* libparted/tests/common.c (_implemented_disk_label): Remove "bsd" from
the list of not-implemented-yet partition table types, since it appears
to pass the tests.

14 years agolibparted: remove "HIGHLY EXPERIMENTAL" warning for >512B-sector devices
Jim Meyering [Thu, 11 Mar 2010 18:01:41 +0000 (19:01 +0100)]
libparted: remove "HIGHLY EXPERIMENTAL" warning for >512B-sector devices

* libparted/arch/linux.c (_device_set_sector_size): Remove the
"HIGHLY EXPERIMENTAL" warning, now that support for >512-byte sectors
seems to be usable.  Suggested by Colin Watson.
* NEWS (Changes in behavior): Note this

14 years agolibparted: msdos_partition_is_flag_available: fix hidden on extended
David Cantrell [Tue, 2 Mar 2010 08:58:18 +0000 (09:58 +0100)]
libparted: msdos_partition_is_flag_available: fix hidden on extended

Since the hidden flag cannot be set on extended partitions,
msdos_partition_is_flag_available() should return 0 for hidden on
extended partitions. Also change msdos_partition_get_flag()
to always return 0 for hidden on extended partitions.
* libparted/labels/dos.c (msdos_partition_is_flag_available):
Return 0 for hidden on extended partitions.
* libparted/labels/dos.c (msdos_partition_get_flag):
Always return 0 for hidden on extended partitions.
* NEWS (Bug fixes): Mention it.
Reported by Flóki Pálsson in http://bugzilla.redhat.com/567118
Patch forwarded by Hans De Goede.

14 years agotests: skip tests that require mkfs.hfs, when it is unavailable
Petr Uzel [Mon, 1 Mar 2010 16:04:51 +0000 (17:04 +0100)]
tests: skip tests that require mkfs.hfs, when it is unavailable

t3000-resize-fs.sh would fails if mkfs.hfs is not installed.
* tests/t-lib.sh (require_hfs_): New function.
* tests/t3000-resize-fs.sh: Use require_hfs_.

14 years agotests: convert more tests to the newer infrastructure
Jim Meyering [Fri, 26 Feb 2010 18:28:36 +0000 (19:28 +0100)]
tests: convert more tests to the newer infrastructure

* tests/t1700-ext-probe.sh: Convert from test-lib.sh to t-lib.sh.
* tests/t2200-dos-label-recog.sh: Likewise.
* tests/t2300-dos-label-extended-bootcode.sh: Likewise.

14 years agolibparted: don't export linux_get_*_alignment functions
Colin Watson [Fri, 26 Feb 2010 17:37:53 +0000 (17:37 +0000)]
libparted: don't export linux_get_*_alignment functions

These functions are only used in libparted/arch/linux.c or via
linux_dev_ops, so do not export them.

* libparted/arch/linux.c (linux_get_minimum_alignment): Declare static.
(linux_get_optimum_alignment): Likewise.

14 years agoAdd support for ATA over Ethernet (AoE) devices
Petr Uzel [Fri, 26 Feb 2010 16:59:24 +0000 (17:59 +0100)]
Add support for ATA over Ethernet (AoE) devices

Recognize AoE Devices, so "parted -s /dev/etherd/eX.Y" now
prints "Model: ATA over Ethernet Device (aoe)" instead of
"Model: Unknown (unknown)".

* include/parted/device.h(PedDeviceType): Add PED_DEVICE_AOE.
* libparted/arch/linux.c(AOE_MAJOR): New define.
* libparted/arch/linux.c(_device_probe_type): Recognize AoE devices.
* libparted/arch/linux.c(linux_new): Handle AoE devices.
* parted/parted.c(do_print): Add "aoe" to the list of available
transports.
* NEWS (New features): Mention it.

14 years agopost-release administrivia
Jim Meyering [Fri, 26 Feb 2010 14:29:58 +0000 (15:29 +0100)]
post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

14 years agoversion 2.2
Jim Meyering [Fri, 26 Feb 2010 14:25:29 +0000 (15:25 +0100)]
version 2.2

* NEWS: Record release date.

14 years agodos: set HFS/HFS+ partition identifier to proper value
Curtis Gedak [Fri, 26 Feb 2010 14:07:29 +0000 (15:07 +0100)]
dos: set HFS/HFS+ partition identifier to proper value

The correct value for an "hfs" partition identifier is 0xAF.
Previously the partition identifier was incorrectly set to 0x83.
* libparted/labels/dos.c (PARTITION_HFS): Define.
(msdos_partition_set_system): Use it.

14 years agotests: exercise today's HFS partition type fix
Jim Meyering [Fri, 26 Feb 2010 13:53:33 +0000 (14:53 +0100)]
tests: exercise today's HFS partition type fix

* tests/t2400-dos-hfs-partition-type.sh: New script.
* tests/Makefile.am: Add it.
* NEWS (Bug fixes): Mention it.

14 years agotests: gpt-pmbr: don't ignore stdout comparison result
Jim Meyering [Fri, 26 Feb 2010 13:47:52 +0000 (14:47 +0100)]
tests: gpt-pmbr: don't ignore stdout comparison result

* tests/t0202-gpt-pmbr.sh: Fail if we get unexpected output.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Thu, 25 Feb 2010 17:32:58 +0000 (18:32 +0100)]
build: update gnulib submodule to latest

* bootstrap: Copy from gnulib.

14 years agotests: convert t4001 to use the new framework
Jim Meyering [Thu, 25 Feb 2010 17:19:10 +0000 (18:19 +0100)]
tests: convert t4001 to use the new framework

* tests/t4001-sun-vtoc.sh: Convert.
* tests/Makefile.am (TESTS): Add it to the list.

14 years agosun: initialize basic partition table fields
Karel Zak [Fri, 19 Feb 2010 15:12:52 +0000 (16:12 +0100)]
sun: initialize basic partition table fields

libparted completely ignores basic fields (version, nparts and sanity)
in the sun VTOC, then for example fdisk prints warnings for such
partition table:

# fdisk -lu /dev/sdb
Detected sun disklabel with wrong version [0x00000000].
Detected sun disklabel with wrong sanity [0x00000000].
Detected sun disklabel with wrong num_partitions [0].

It seems that the current libparted sun support follows old Linux
kernel code, but the code was changed 3 years ago (see kernel commit
3961bae0ac030a70ae2e0578270203889021f1a1).

Note that the number of partitions (nparts) is optional for Linux
kernel, but fdisk(8) strictly requires SUN_DISK_MAXPARTITIONS (=8)
there. This patch sets nparts to SUN_DISK_MAXPARTITIONS rather then
use a real number of partitions.

* NEWS (Bug fixes): Mention it.
* libparted/labels/sun.c: Update from kernel.
* tests/t4001-sun-vtoc.sh: New file.  Test for this.

14 years agotests: wrap the dup-clobber test in a script, ...
Jim Meyering [Thu, 25 Feb 2010 14:05:46 +0000 (15:05 +0100)]
tests: wrap the dup-clobber test in a script, ...

so that its artifacts are created in the usual temporary subdir
* tests/Makefile.am (TESTS): Remove dup-clobber, and instead...
Add t0500-dup-clobber.sh.
* tests/t0500-dup-clobber.sh: New script.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Tue, 23 Feb 2010 17:51:16 +0000 (18:51 +0100)]
build: update gnulib submodule to latest

14 years agotests: test for the ped_disk_duplicate needs_clobber fix
Jim Meyering [Tue, 23 Feb 2010 16:26:48 +0000 (17:26 +0100)]
tests: test for the ped_disk_duplicate needs_clobber fix

* tests/dup-clobber.c: New file.
Exercise the fix in commit jabb411b, "libparted: copy the
needs_clobber value in ped_disk_duplicate()".
* tests/Makefile.am (TESTS, check_PROGRAMS): Add dup-clobber.

14 years agolibparted: copy the needs_clobber value in ped_disk_duplicate()
Hans de Goede [Thu, 18 Feb 2010 14:34:41 +0000 (15:34 +0100)]
libparted: copy the needs_clobber value in ped_disk_duplicate()

Most duplicate disk_ops use ped_disk_new_fresh, which sets needs_clobber
to 1. This would lead to clobbering the disk when committing a duplicate
disk even when the original disk was not made with ped_disk_new_fresh.
* libparted/disk.c (ped_disk_duplicate): Copy the needs_clobber member.
* NEWS (Bug fixes): Describe it.

14 years agolinux: add wait time and retries to kernel partition reread
Curtis Gedak [Mon, 22 Feb 2010 08:13:53 +0000 (09:13 +0100)]
linux: add wait time and retries to kernel partition reread

Occasionally when using parted with newer GNU/Linux kernels (2.6.31)
and udev (145), the kernel would fail to reread the partition table.
This could lead to problems with subsequent actions such as formatting
the partition.

Basically this patch increases the retry_count, and adds one sleep(1)
function call prior to the the last few ioctl() calls.

This patch might not be a perfect solution to this problem of "failure
to inform kernel of partition changes", but it does significantly
reduce the likelihood of encountering the problem.

Details on the testing results and procedures used can be found at
the following link:
https://bugzilla.gnome.org/show_bug.cgi?id=604298#c9

* libparted/arch/linux.c (_kernel_reread_part_table): Sleep for a
full second if retry_count makes it down to "3".  Start it at 9
rather than at 5.
* NEWS (Bug fixes):

14 years agomaint: remove now-unused <partition_table_type>_clobber functions
Jim Meyering [Sat, 20 Feb 2010 11:44:47 +0000 (12:44 +0100)]
maint: remove now-unused <partition_table_type>_clobber functions

All of these functions were rendered unused by commit 376b143045,
"ped_disk_clobber: change semantics" on 2009-11-13.
Also, Update each <...>_disk_ops "clobber:" member to be NULL.
* libparted/labels/aix.c (aix_clobber): Remove function.
* libparted/labels/bsd.c (bsd_clobber): Likewise.
* libparted/labels/dasd.c (dasd_clobber): Likewise.
* libparted/labels/dos.c (msdos_clobber): Likewise.
* libparted/labels/dvh.c (dvh_clobber): Likewise.
* libparted/labels/gpt.c (gpt_clobber): Likewise.
* libparted/labels/loop.c (loop_clobber): Likewise.
* libparted/labels/mac.c (_clobber_part_map, mac_clobber): Likewise.
* libparted/labels/pc98.c (pc98_clobber): Likewise.
* libparted/labels/rdb.c (amiga_clobber): Likewise.
* libparted/labels/sun.c (sun_clobber): Likewise.
Suggested by Hans De Goede.

14 years agodoc: update release procedure to account for soname version number
Jim Meyering [Sat, 13 Feb 2010 09:04:44 +0000 (10:04 +0100)]
doc: update release procedure to account for soname version number

* README-release: Add a step "0", and update step 3 to match reality.

14 years agolibparted: set the shared library version number manually
Jim Meyering [Sat, 13 Feb 2010 08:25:56 +0000 (09:25 +0100)]
libparted: set the shared library version number manually

* libparted/Makefile.am (CURRENT, REVISION, AGE): Define here.
(libparted_la_LDFLAGS): Use them, rather than using the
automatically-defined LT_-prefixed variables.
Stop using the "-release" option.
Hans De Goede pointed out that the build process was automatically
changing the shared library name.

14 years agogpt: clean-up wrt write_back (no semantic change)
Jim Meyering [Fri, 12 Feb 2010 13:59:04 +0000 (14:59 +0100)]
gpt: clean-up wrt write_back (no semantic change)

* libparted/labels/gpt.c (gpt_read): Initialize write_back to 0
once again, and set it to 1 on the sole path that requires that.

14 years agogpt: "read-only" operation could clobber the pMBR in another way
Jim Meyering [Wed, 10 Feb 2010 16:11:25 +0000 (17:11 +0100)]
gpt: "read-only" operation could clobber the pMBR in another way

A read-only operation like "parted $dev print" would overwrite $dev's
pMBR when exactly one of the primary and backup tables was corrupt.
* libparted/labels/gpt.c (gpt_read): Clear "write_back" in those
two cases.  Hans De Goede spotted this bug by inspection.
* NEWS (Bug fixes): Mention it.
* tests/t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh: New test.
* tests/Makefile.am (TESTS): Add
t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh.

14 years agotests: factor utility functions into "library"
Jim Meyering [Wed, 10 Feb 2010 16:09:49 +0000 (17:09 +0100)]
tests: factor utility functions into "library"

...since we're about to use them from a second test.
* tests/t-local.sh (peek_, poke_, gpt1_pte_name_offset_): New functions.
(gpt_corrupt_primary_table_, gpt_restore_primary_table_): New functions.
* tests/t0280-gpt-corrupt.sh: Remove local copies of those functions.
Use the new ones.

14 years agodasd: don't dereference a NULL pointer in dasd_read
Hans de Goede [Wed, 10 Feb 2010 13:13:01 +0000 (14:13 +0100)]
dasd: don't dereference a NULL pointer in dasd_read

* libparted/labels/dasd.c (dasd_read): Avoid NULL pointer dereference.

14 years agoparted: change default alignment to "optimal"
Hans de Goede [Wed, 10 Feb 2010 14:19:18 +0000 (15:19 +0100)]
parted: change default alignment to "optimal"

* NEWS (Changes in behavior): Mention it.
* parted/parted.c: Change --align default value to optimal.
* tests/t2100-mkswap.sh: Adjust for alignment changes where necessary.
* tests/t0220-gpt-msftres.sh: Likewise.
* tests/t0280-gpt-corrupt.sh: Likewise.
* tests/t2200-dos-label-recog.sh: Likewise.
* tests/t2300-dos-label-extended-bootcode.sh: Likewise.
* tests/t3000-resize-fs.sh: Likewise.
* tests/t4100-msdos-partition-limits.sh: Likewise.
* tests/t4100-msdos-starting-sector.sh: Likewise.
* tests/t5000-tags.sh: Likewise.
* tests/t8000-loop.sh: Likewise.
* tests/t9021-maxima.sh: Likewise.

14 years agoparted: change warnings when initial constrained mkpart fails
Hans de Goede [Wed, 10 Feb 2010 13:12:59 +0000 (14:12 +0100)]
parted: change warnings when initial constrained mkpart fails

In do_mkpart we first try to create a partition using a constraint
derived from the user input intersected with the devices alignment
needs. And if that fails we try again without any constraint.

However the warning given when this happens only takes into account
the user not getting what he asked for, while the alignment might be
a problem too (or even the only problem). So this patch adds a check
to see if the user really did not get what he asked before giving that
warning, and adds a new check + warning to see if the created partition
is properly aligned.
*parted/parted.c (do_mkpart,do_mkpartfs): change warnings when initial
constrained mkpart fails.

14 years agoparted: honor --align option also in mkpartfs, resize and print cmds
Hans de Goede [Sat, 30 Jan 2010 16:53:50 +0000 (17:53 +0100)]
parted: honor --align option also in mkpartfs, resize and print cmds

* parted/parted.c (do_mkpartfs,do_print,do_resize): Honor --align.

14 years agolinux: handle incomplete topology information
Hans de Goede [Sat, 30 Jan 2010 16:53:49 +0000 (17:53 +0100)]
linux: handle incomplete topology information

The topology information returned by libblkid is not always complete
(as the kernel does not always have complete information).
This patch makes the linux_get_*_alignment() alignment functions handle
this. The algorithm used for linux_get_optimum_alignment is:
1) Always use the reported aligment offset as offset
2a)If optimal io size is present in the topology info use that as grain
2b)If optimal io size is not present in topology info and aligment
   offset is 0 and minimum io size is a power of 2, use the device.c
   default optimal alignment (grain 1MiB).
2c) If neither 2a and 2b, use the minimum io size, or if that is not
   defined, use the physical sector size as grain (iow the minimum
   alignment).
The algorithm used for linux_get_minimum_alignment is:
1) Always use the reported aligment offset as offset
2) Use the minimum io size, or if that is not defined the physical
   sector size as grain.
* libparted/arch/linux.c (linux_get_*_alignment): Handle incomplete
topology information.

14 years agolibparted: Give device_get_*_alignment sane defaults
Hans de Goede [Sat, 30 Jan 2010 16:53:48 +0000 (17:53 +0100)]
libparted: Give device_get_*_alignment sane defaults

When the topology info is incomplete or non existent, return something
more sensible than NULL (which ends up being interpreted as
PedAlignmentAny in most cases). The default minimum alignment aligns to
physical sector size, the default optimal alignment is 1 MiB, which is
what vista and windows 7 do.
* libparted/device.c (device_get_*_alignment): Add default aligments.
* NEWS (New features): Mention it.

14 years agolinux: correct phys_sector_size setting
Hans de Goede [Sat, 30 Jan 2010 16:53:47 +0000 (17:53 +0100)]
linux: correct phys_sector_size setting

1) Use the logical sector size as physical sector size instead of 512
   when not compiled with libblkid support, this fixes problems
   with logical sector size > physical sector size.
2) blkid_topology_get_physical_sector_size() returns 0 when it fails
   to determine the physical sector size, handle this.
* libparted/arch/linux.c (_device_set_sector_size): Correct
phys_sector_size setting.
* NEWS (Bug fixes): Mention it.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Sun, 7 Feb 2010 19:22:53 +0000 (20:22 +0100)]
build: update gnulib submodule to latest

14 years agodoc: NEWS: mention the install-related bug fix
Jim Meyering [Tue, 9 Feb 2010 11:32:36 +0000 (12:32 +0100)]
doc: NEWS: mention the install-related bug fix

* NEWS (Bug fixes): Mention the fix.

14 years agogpt: read-only operation could clobber MBR part of hybrid GPT+MBR table
Jim Meyering [Sun, 7 Feb 2010 19:31:11 +0000 (20:31 +0100)]
gpt: read-only operation could clobber MBR part of hybrid GPT+MBR table

* libparted/labels/gpt.c (gpt_read): Fix a bug introduced by me in
commit 7f753b1b, "gpt: rewrite GPT header-reading code".
Set write_back=0 in one more code path.
* tests/Makefile.am (TESTS): Add t0205-gpt-list-clobbers-pmbr.sh.
* tests/t0205-gpt-list-clobbers-pmbr.sh: New test.
* NEWS (Bug fixes): Mention this.
Reported by aix27249 in
http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/250

14 years agodo not install the test programs disk and label
Peter Breitenlohner [Mon, 8 Feb 2010 13:01:13 +0000 (14:01 +0100)]
do not install the test programs disk and label

Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
14 years agoFix minor spelling errors
Otavio Salvador [Thu, 4 Feb 2010 16:16:33 +0000 (14:16 -0200)]
Fix minor spelling errors

This fixes minor spelling errors in the source code. Basically:

 s/informations/information/g
 s/prefered/preferred/g

14 years agotests: avoid another spurious test failure with newer xfsprogs
Jim Meyering [Thu, 4 Feb 2010 10:04:34 +0000 (11:04 +0100)]
tests: avoid another spurious test failure with newer xfsprogs

* tests/t4100-msdos-partition-limits.sh: Likewise.

14 years agotests: avoid spurious test failure with newer xfsprogs
Jim Meyering [Thu, 4 Feb 2010 09:30:16 +0000 (10:30 +0100)]
tests: avoid spurious test failure with newer xfsprogs

* tests/t4100-dvh-partition-limits.sh: Use mkfs.xfs' -f (force)
option.  It is required at least for xfsprogs-3.1.0.

14 years agobuild: fix check-other-sector_sizes
Hans de Goede [Sat, 30 Jan 2010 16:53:52 +0000 (17:53 +0100)]
build: fix check-other-sector_sizes

"make check-other-sector_sizes" was running tests of 512-byte sectors
four times, rather than simulating larger sector-sizes for the latter
three iterations.
* Makefile.am (ss-1024 ss-2048 ss-4096): Fix the typo (missing "subst").

14 years agotests: adjust t9021-maxima not to fail with 2048-byte sectors
Jim Meyering [Sun, 31 Jan 2010 14:52:02 +0000 (15:52 +0100)]
tests: adjust t9021-maxima not to fail with 2048-byte sectors

* tests/t9021-maxima.sh: At 10,000*512 bytes, the backing file
was too small to support a test simulating a sector size of 2048 bytes.
Use 10,000*$sector_size bytes instead.

14 years agobuild: avoid -Wshadow warnings
Jim Meyering [Sun, 31 Jan 2010 14:43:20 +0000 (15:43 +0100)]
build: avoid -Wshadow warnings

* parted/parted.c (do_print): Avoid two shadowing warnings.

14 years agolinux: remove PED_DEVICE_FILE check from _device_set_sector_size
Hans de Goede [Mon, 11 Jan 2010 10:59:27 +0000 (11:59 +0100)]
linux: remove PED_DEVICE_FILE check from _device_set_sector_size

_device_set_sector_size is never called for devices with a type of
PED_DEVICE_FILE.
* libparted/arch/linux.c (_device_set_sector_size): Remove
PED_DEVICE_FILE check.

14 years agolinux: remove unused blkpg.h header file
Hans de Goede [Mon, 11 Jan 2010 10:59:26 +0000 (11:59 +0100)]
linux: remove unused blkpg.h header file

* libparted/arch/linux.c: Don't include blkpg.h.
* libparted/arch/blkpg.h: Deleted.
* libparted/Makefile.am (libparted_la_SOURCES): Remove arch/blkpg.h.

14 years agolinux: use blkid_topology_get_physical_sector_size
Hans de Goede [Mon, 11 Jan 2010 10:59:25 +0000 (11:59 +0100)]
linux: use blkid_topology_get_physical_sector_size

The official 2.17 release of util-linux-ng, has added a function to
get the physical sector size.  Use that instead of getting the
minimum io size.
* libparted/arch/linux.c (_device_set_sector_size): Use
blkid_topology_get_physical_sector_size.

14 years agomaint: remove unreachable code
Jim Meyering [Mon, 18 Jan 2010 14:19:48 +0000 (15:19 +0100)]
maint: remove unreachable code

* parted/parted.c (do_print): Remove unreachable ped_disk_destroy call.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Fri, 15 Jan 2010 20:11:22 +0000 (21:11 +0100)]
build: update gnulib submodule to latest

14 years agodos: don't leak a constraint upon partition-add failure
Jim Meyering [Fri, 15 Jan 2010 19:14:38 +0000 (20:14 +0100)]
dos: don't leak a constraint upon partition-add failure

* libparted/labels/dos.c (read_table): Free constraint upon failure.

14 years agogpt: don't leak a constraint upon partition-add failure
Jim Meyering [Fri, 15 Jan 2010 18:53:36 +0000 (19:53 +0100)]
gpt: don't leak a constraint upon partition-add failure

* libparted/labels/gpt.c (gpt_read): Free constraint upon failure.

14 years agogpt: do not leak a GPT header on an error path
Jim Meyering [Fri, 15 Jan 2010 18:34:00 +0000 (19:34 +0100)]
gpt: do not leak a GPT header on an error path

* libparted/labels/gpt.c (gpt_write): Avoid a leak by freeing the
header buffer after pth_get_raw call where it's used, but before
checking whether that pth_get_raw call succeeded.
Avoid another leak in identical just 10 lines down.
Add "FIXME: caution..." comments to warn about the duplication.

14 years agolibparted: remove unreachable code
Jim Meyering [Fri, 15 Jan 2010 18:18:48 +0000 (19:18 +0100)]
libparted: remove unreachable code

* libparted/labels/gpt.c (gpt_write): Remove dead code.
* libparted/labels/bsd.c (bsd_partition_new): Likewise.
* libparted/disk.c (_ped_disk_alloc): Likewise.

14 years agolibparted: avoid double-free on an OOM failure path
Jim Meyering [Fri, 15 Jan 2010 17:56:37 +0000 (18:56 +0100)]
libparted: avoid double-free on an OOM failure path

* libparted/disk.c (ped_disk_check): Don't double-free "fs_size".

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Fri, 8 Jan 2010 10:00:46 +0000 (11:00 +0100)]
build: update gnulib submodule to latest

14 years agomaint: update old_NEWS_hash
Jim Meyering [Fri, 8 Jan 2010 10:16:42 +0000 (11:16 +0100)]
maint: update old_NEWS_hash

* cfg.mk (old_NEWS_hash): Update for GFDL license update.

14 years agomaint: update all GFDL licenses to version 1.3
Jim Meyering [Fri, 8 Jan 2010 09:53:12 +0000 (10:53 +0100)]
maint: update all GFDL licenses to version 1.3

* NEWS: Use 1.3, not 1.2.
* doc/API: Use 1.3, not 1.1.
* doc/FAT: Likewise.
* doc/USER.jp: Likewise.
* doc/fdl.texi: Likewise.
* doc/parted-pt_BR.texi: Likewise.
* doc/parted.texi: Likewise.

14 years agomaint: update all FSF copyright year lists to include 2010
Jim Meyering [Sun, 3 Jan 2010 17:53:36 +0000 (18:53 +0100)]
maint: update all FSF copyright year lists to include 2010

Run this command: make update-copyright

14 years agomaint: record update-copyright options for this package
Jim Meyering [Sun, 3 Jan 2010 17:52:44 +0000 (18:52 +0100)]
maint: record update-copyright options for this package

* cfg.mk: Next time, just run "make update-copyright".

14 years agomaint: newer gnulib; don't hard-code my GPG key ID
Jim Meyering [Thu, 31 Dec 2009 16:10:45 +0000 (17:10 +0100)]
maint: newer gnulib; don't hard-code my GPG key ID

* cfg.mk (gpg_key_ID): Remove definition, now that maint.mk automates it.
* gnulib: Update to latest.

14 years agomaint: make build-aux/gnu-web-doc-update work
Jim Meyering [Sun, 20 Dec 2009 14:06:13 +0000 (15:06 +0100)]
maint: make build-aux/gnu-web-doc-update work

* cfg.mk (manual_title): Define.
* doc/parted.texi (Concept index): Rename from "Index".
Remove @ifnotplaintext..@end around its menu entry.

14 years agopost-release administrivia
Jim Meyering [Sun, 20 Dec 2009 11:55:40 +0000 (12:55 +0100)]
post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

14 years agoversion 2.1
Jim Meyering [Sun, 20 Dec 2009 11:48:20 +0000 (12:48 +0100)]
version 2.1

* NEWS: Record release date.

14 years agodoc: NEWS: mention the flag-truncation fix
Jim Meyering [Sun, 20 Dec 2009 11:45:05 +0000 (12:45 +0100)]
doc: NEWS: mention the flag-truncation fix

* NEWS (Bug fixes): Mention it.

14 years agodos: honor cylinder alignment disk flag when allocating metadata
Hans de Goede [Thu, 17 Dec 2009 09:27:40 +0000 (10:27 +0100)]
dos: honor cylinder alignment disk flag when allocating metadata

* libparted/labels/dos.c (add_startend_metadata): Honor cylinder
alignment flag.

14 years agolibparted: push/pop update mode around ped_disk_set_flag
Hans de Goede [Thu, 17 Dec 2009 09:27:39 +0000 (10:27 +0100)]
libparted: push/pop update mode around ped_disk_set_flag

Disk flags can change how the metadata gets allocated, so push/pop
update mode around ops->disk_set_flag, so that the metadata gets
re-allocated.
* libparted/disk.c (ped_disk_set_flag): push/pop update mode.

14 years agolinux: fix use-after-free in devicemapper code
Hans de Goede [Fri, 18 Dec 2009 09:33:18 +0000 (10:33 +0100)]
linux: fix use-after-free in devicemapper code

* libparted/arch/linux.c (_dm_add_partition): Fix use of dm_task
information after freeing it.

14 years agoui: Do not truncate flag names when printing
Hans de Goede [Fri, 18 Dec 2009 09:33:17 +0000 (10:33 +0100)]
ui: Do not truncate flag names when printing

The partition_print_flags() function was truncating the flag names,
but these are translated strings, and thus can contain multibyte
characters. Truncating multibyte chars in a non multibyte aware way
is not good and was causing issues when printing tables in Russian:
http://bugzilla.redhat.com/show_bug.cgi?id=543029

Since the truncating does not seem to make sense at all this patch
simply removes it (it was likely an attempt to stay within 80 chars
when printing, but as one partition can have multiple flags set this
won't work)

* parted/parted.c (partition_print_flags): Don't truncate flag names.

14 years agolibparted: plug a leak in mac_write
Jim Meyering [Wed, 16 Dec 2009 17:20:23 +0000 (18:20 +0100)]
libparted: plug a leak in mac_write

* libparted/labels/mac.c (mac_write): Free mac_driverdata.

14 years agomaint: use "int", not "bool" for value returned by ped_device_write
Jim Meyering [Wed, 16 Dec 2009 17:02:58 +0000 (18:02 +0100)]
maint: use "int", not "bool" for value returned by ped_device_write

* libparted/labels/gpt.c (gpt_write): Correct type of local.
* libparted/labels/mac.c (mac_clobber): Likewise.
* libparted/labels/sun.c (sun_write): Likewise.

14 years agolibparted: plug a leak in mac's write_block_zero
Jim Meyering [Wed, 16 Dec 2009 17:00:38 +0000 (18:00 +0100)]
libparted: plug a leak in mac's write_block_zero

* libparted/labels/mac.c (write_block_zero): Don't leak a
1-sector-sized buffer.

14 years agodos: remove unreachable code
Jim Meyering [Wed, 16 Dec 2009 16:55:07 +0000 (17:55 +0100)]
dos: remove unreachable code

* libparted/labels/dos.c (msdos_partition_new): Remove dead code.

14 years agolibparted: plug a leak in gpt_probe
Jim Meyering [Wed, 16 Dec 2009 16:51:23 +0000 (17:51 +0100)]
libparted: plug a leak in gpt_probe

* libparted/labels/gpt.c (gpt_probe): Avoid a leak when dev->length
is one sector or smaller.

14 years agomaint: improve dist-check.mk rules
Jim Meyering [Mon, 14 Dec 2009 10:33:43 +0000 (11:33 +0100)]
maint: improve dist-check.mk rules

* dist-check.mk (null_AM_MAKEFLAGS): Remove LIBTOOL.  Adding it was
erroneous, since it is required when building from a distribution
tarball of a libtool-using project.  Reported by Ralf Wildenhues.
(my-distcheck): Reorganize to use a subshell and set -e, so that
failures propagate "out".  Without this change, setting LIBTOOL=false
would cause a failure that would then be ignored, probably due to a
problem in $(install-transform-check).

14 years agomaint: dist-check.mk adapt to parted-specific details
Jim Meyering [Mon, 14 Dec 2009 10:01:10 +0000 (11:01 +0100)]
maint: dist-check.mk adapt to parted-specific details

* dist-check.mk (built_programs): Use parted/, not src/.
(install-transform-check): Search sbin/, not /bin.
Expect man pages to be in man8/*.8.

14 years agomaint: sync dist-check.mk from coreutils
Jim Meyering [Sun, 13 Dec 2009 18:35:43 +0000 (19:35 +0100)]
maint: sync dist-check.mk from coreutils

* dist-check.mk: Sync from coreutils.
* gnulib: Update to latest.

14 years agomaint: sync dist-check.mk from coreutils
Jim Meyering [Sun, 13 Dec 2009 10:41:58 +0000 (11:41 +0100)]
maint: sync dist-check.mk from coreutils

* dist-check.mk: Sync from coreutils.
* gnulib: Update to latest.

14 years agobuild: distribute gperf-generated file, pt-limit.c
Jim Meyering [Sat, 12 Dec 2009 23:56:54 +0000 (00:56 +0100)]
build: distribute gperf-generated file, pt-limit.c

* libparted/labels/Makefile.am (EXTRA_DIST): Distribute the
gperf-generated file, pt-limit.c, so that people don't need to
run gperf at build-from-tarball time.

14 years agoui: mkpart: avoid double free
Jim Meyering [Sat, 12 Dec 2009 17:31:04 +0000 (18:31 +0100)]
ui: mkpart: avoid double free

* parted/parted.c (do_mkpart): This function frees "part_name"
immediately after the final use, but also upon e.g., ped_disk_commit
failure.  Set part_name to NULL after the first free, to make
the second a no-op after the first.

14 years agobuild: update spec: gperf is a new build-requirement
Jim Meyering [Sat, 12 Dec 2009 07:28:20 +0000 (08:28 +0100)]
build: update spec: gperf is a new build-requirement

* parted.spec.in (BuildRequires): Add gperf.
Reported by Jeff Darcy.

14 years agobuild: update gnulib submodule to latest
Jim Meyering [Fri, 11 Dec 2009 20:18:23 +0000 (21:18 +0100)]
build: update gnulib submodule to latest

14 years agotests: ensure that parted can partition a loop device
Jim Meyering [Fri, 11 Dec 2009 15:56:45 +0000 (16:56 +0100)]
tests: ensure that parted can partition a loop device

* tests/t8000-loop.sh: Reverse sense of tests, now that
partitioning a loop device succeeds again.
* NEWS (Bug fixes): Mention it.

14 years agolinux: treat loopback devices as files
Hans de Goede [Fri, 11 Dec 2009 10:24:52 +0000 (11:24 +0100)]
linux: treat loopback devices as files

We cannot do partition related ioctl's on loopback devices,
so treat them as files.
* libparted/arch/linux.c (LOOP_MAJOR): Define.
* libparted/arch/linux.c (_device_probe_type): Treat loopback
devices as files.
Reported by Josef Bacik in http://bugzilla.redhat.com/546622

14 years agolibparted: missing pop update mode in ped_disk_delete_all error path
Hans de Goede [Thu, 10 Dec 2009 11:43:18 +0000 (12:43 +0100)]
libparted: missing pop update mode in ped_disk_delete_all error path

* libparted/disk.c(ped_disk_delete_all): Add missing update mode pop
call in error path.

14 years agolibparted: make pop/push update mode propagate sanity check errors
Hans de Goede [Thu, 10 Dec 2009 11:43:17 +0000 (12:43 +0100)]
libparted: make pop/push update mode propagate sanity check errors

Sanity check errors indicate something is really really wrong, still
sometimes they happen, when they happen it helps a lot in debugging
them when the libparted caller immediately errors out at the first
moment, rather then slugging along until things crash somewere.
* libparted/disk.c(_disk_push_update_mode,_disk_pop_update_mode):
Change return value from void to int, and return 0 when the sanity
check calls fail.
* libparted/disk.c(*): Update all _disk_push_update_mode /
_disk_pop_update_mode callers to propagate the return value.

14 years agolibparted: add missing update mode pop in duplicate error path
Joel Granados Moreno [Thu, 10 Dec 2009 11:43:15 +0000 (12:43 +0100)]
libparted: add missing update mode pop in duplicate error path

* libparted/disk.c(ped_disk_duplicate): Add missing update mode
pop call in error path.

14 years agogpt: Add support for appletv partitions
Joel Granados Moreno [Thu, 10 Dec 2009 11:43:14 +0000 (12:43 +0100)]
gpt: Add support for appletv partitions

* include/parted/disk.h(PedPartitionFlag): Add
PED_PARTITION_APPLE_TV_RECOVERY.
* libparted/disk.c(ped_partition_flag_get_name): Handle
PED_PARTITION_APPLE_TV_RECOVERY.
* libparted/labels/gpt.c(PARTITION_APPLE_TV_RECOVERY_GUID):
New define.
* libparted/labels/gpt.c(GPTPartitionData): Add atvrecv member.
* libparted/labels/gpt.c(_parse_part_entry, gpt_partition_new,
gpt_partition_set_system, gpt_partition_set_flag,
gpt_partition_get_flag, gpt_partition_is_flag_available):
Handle atvrecv / PARTITION_APPLE_TV_RECOVERY_GUID.