OSDN Git Service
Jim Meyering [Wed, 26 May 2010 09:30:02 +0000 (11:30 +0200)]
build: update gnulib submodule to latest
Jim Meyering [Wed, 26 May 2010 09:43:09 +0000 (11:43 +0200)]
maint: remove useless definitions
* libparted/fs/xfs/platform_defs.h [__sparc__] (O_DIRECT):
Remove now-unneeded definition.
* parted/table.c (wchar_t): Remove definition.
* parted/strlist.c (wchar_t): Likewise.
* .x-sc_prohibit_always-defined_macros: New file.
Exempt two files from this syntax-check rule.
* Makefile.am (EXTRA_DIST): Add it here.
Jim Meyering [Wed, 26 May 2010 09:32:56 +0000 (11:32 +0200)]
maint: update helper scripts
* tests/help-version: Update from coreutils.
* bootstrap: Update from gnulib.
* tests/init.sh: Likewise.
Jim Meyering [Wed, 26 May 2010 09:29:56 +0000 (11:29 +0200)]
build: use gettext-0.17
* configure.ac: Use gettext-0.17.
* bootstrap.conf (gnulib_modules): Use gettext-h, not gettext.
since the latter drags in a depedency on gettext 0.18.
Jim Meyering [Tue, 25 May 2010 13:42:35 +0000 (15:42 +0200)]
fix typo in comment
Jim Meyering [Mon, 10 May 2010 11:00:20 +0000 (13:00 +0200)]
libparted: fail (don't just warn) upon failure to inform kernel of...
partition change(s).
* libparted/arch/linux.c (_disk_sync_part_table): Throw an error, not
merely a warning. When this fails, it indicates that the kernel has
not been informed, and that must translate to an error, since doing
otherwise would violate the contract of ped_disk_commit_to_os.
Suggested by Hans De Goede.
Jim Meyering [Thu, 6 May 2010 16:37:21 +0000 (18:37 +0200)]
tests: make the new many-partitions test fail if it takes "too long"
* tests/t9040-many-partitions.sh: Fail if creating 60 partitions
takes more than a minute.
Jim Meyering [Thu, 6 May 2010 13:20:00 +0000 (15:20 +0200)]
maint: use latest bootstrap script from gnulib
* bootstrap: Sync from gnulib.
Hans de Goede [Thu, 6 May 2010 13:09:35 +0000 (15:09 +0200)]
gpt: recognize microsoft recovery GUID
Microsoft advices creating recovery partitions with a GUID of
de94bba4-06d1-4d40-a16a-
bfd50179d6ac, see:
http://technet.microsoft.com/en-us/library/
dd744301%28WS.10%29.aspx
This patch makes parted recognize this guid (using the DIAG flag).
* libparted/labels/gpt.c (PARTITION_MSFT_RECOVERY, GPTPartitionData,
_parse_part_entry, gpt_partition_new, gpt_partition_set_system,
gpt_partition_set_flag, gpt_partition_get_flag,
gpt_partition_is_flag_available): Support microsoft recovery GUID.
* NEWS (New features): Add it.
Hans de Goede [Thu, 6 May 2010 08:25:35 +0000 (10:25 +0200)]
msdos: recognize id 27 as a diagnostics (recovery) partition type
msdos partitiontable partition id 27 is recommended by microsoft for
use as id for recovery partitions, see:
http://technet.microsoft.com/en-us/library/
dd744364%28WS.10%29.aspx
http://bugzilla.redhat.com/show_bug.cgi?id=534066
* libparted/labels/dos.c (PARTITION_MSFT_RECOVERY): Define.
(raw_part_parse): Recognize id 27
(msdos_partition_set_system): Recognize id 27
Jim Meyering [Thu, 6 May 2010 12:11:33 +0000 (14:11 +0200)]
tests: add one: create 60 partitions on a scsi device
* tests/t9040-many-partitions.sh: New test.
* tests/Makefile.am (TESTS): Add it.
(TESTS_ENVIRONMENT): Export AWK to test scripts.
Inspired by the report of a many-partition test
taking far longer on RHEL5 than on RHEL4 in
http://bugzilla.redhat.com/589117
Jim Meyering [Wed, 5 May 2010 16:42:26 +0000 (18:42 +0200)]
doc: update NEWS
* NEWS (Bug fixes): Mention the ext2 2TiB FS-creation bug.
Jim Meyering [Wed, 5 May 2010 16:25:38 +0000 (18:25 +0200)]
build: update gnulib submodule to latest
Martin Poole [Wed, 5 May 2010 16:24:22 +0000 (18:24 +0200)]
ext2: don't overflow when creating a partition of size 2TiB or larger
Without this patch, mkpartfs would succeed in creating an ext2
partition, but the resulting partition would fail a mkfs.ext2 -f check.
* libparted/fs/ext2/parted_io.c (do_read): Avoid overflow 32-bit
sector count overflow for a partition of size 2TiB or larger.
(do_write): Likewise.
See http://bugzilla.redhat.com/584057#c16 a reproducer.
Hans de Goede [Wed, 28 Apr 2010 17:14:36 +0000 (19:14 +0200)]
_device_unregister: check for unregistering the same device twice
_device_unregister() can get called 2 times for the same device if
a libparted user explictly removes the device from the cache using
ped_device_cache_remove(), it gets called and it then becomes the
user's responsibility to free the PedDevice by calling
ped_device_destroy(). ped_device_destroy() will then call
_device_unregister() a second time with the same device, so if the
device is not found in the list, do nothing.
* libparted/device.c(_device_unregister): Check for unregistering
the same device twice.
Reported by Jan Stodola in <http://bugzilla.redhat.com/568346>.
Jim Meyering [Fri, 30 Apr 2010 13:59:14 +0000 (15:59 +0200)]
tests: avoid root-only/XFS limit test failure on 32-bit system
* tests/t4100-msdos-partition-limits.sh: Due to an inherent XFS
limitation on 32-bit systems, this test would fail a set-up
file creation step for simulated sector sizes of 4K and up.
Skip this test in those cases.
Upon dd failure, propagate its diagnostic to output, to make this
sort of problem easier to diagnose.
* tests/t4100-dvh-partition-limits.sh: Likewise.
Jim Meyering [Fri, 30 Apr 2010 10:28:16 +0000 (12:28 +0200)]
libparted: avoid race in informing the kernel of partition table changes
When sync'ing a partition table change using the latest
code, sometimes we'd get an unwarranted failure like this:
Warning: Partition(s) 1 on /dev/sdd have been written, but we
have been unable to inform the kernel of the change, probably because
it/they are in use. As a result, the old partition(s) will remain in
use. You should reboot now before making further changes.
To be precise, when running the partition-resizing root-only test
in a loop:
for i in $(seq 240); do make -C tests check VERBOSE=yes \
TESTS=t3000-resize-fs.sh >& log.$i && printf . || echo $i $?; done
I would typically see about 50% of them fail on a Fedora 13 system.
It was obvious that this was due to a race condition when I found that
modifying that tests' parted...resize invocation to go via strace changed
the timing enough to make the test pass every time.
The fix is to retry the partition-removal step upon any EBUSY failure,
currently for up to 1 second (retrying up to 100 times, sleeping 10ms
after each failure).
* libparted/arch/linux.c (_disk_sync_part_table): Allocate "ok" using
calloc, now that its initial values matter.
Retry each removal upon EBUSY-failure.
* bootstrap.conf (gnulib_modules): Use gnulib's usleep module.
Jim Meyering [Fri, 30 Apr 2010 10:01:08 +0000 (12:01 +0200)]
libparted: variable renaming, minor "goto" reorg
* libparted/arch/linux.c (_disk_sync_part_table): Rename local array:
s/rets/ok/, for readability.
Use only a single label, "cleanup:", rather than two: free_rets
and free_errnums.
Jim Meyering [Fri, 30 Apr 2010 09:45:51 +0000 (11:45 +0200)]
libparted: remove now-worse-than-useless _kernel_reread_part_table
Now that we're using BLKPG properly, there's no point in using the
less-functional BLKRRPART ioctl to make the kernel reread the partition
table.
More importantly, this function would fail when any partition is in
use, in spite of our having carefully vetted them via BLKPG ioctls.
* libparted/arch/linux.c (_kernel_reread_part_table): Remove function.
(linux_disk_commit): Don't call it.
Jim Meyering [Thu, 29 Apr 2010 17:02:07 +0000 (19:02 +0200)]
tests: correct a root-only test
* tests/t2310-dos-extended-2-sector-min-offset.sh: Don't hard-code
"/dev/sdd5" in expected output.
Jim Meyering [Thu, 29 Apr 2010 14:02:40 +0000 (16:02 +0200)]
maint: avoid code duplication
* libparted/labels/dos.c (clear_flags): New function.
Factored (5 times) out of ...
(msdos_partition_set_flag): ...here. Use the new function.
Hans de Goede [Mon, 19 Apr 2010 11:55:32 +0000 (13:55 +0200)]
dos: add a partition flag for diagnostics / recovery partitions
msdos partition tables can contain diagnostics partitions (often used
nowadays as system recovery partitions). For some users of libparted
(i.e., anaconda) it is useful to know if a dos partition is a regular
partition or a diagnostic partition. For example, see
<http://bugzilla.redhat.com/534066>.
* include/parted/disk.h(_PedPartitionFlag): Add PED_PARTITION_DIAG
* libparted/disk.c(ped_partition_flag_get_name): Add PED_PARTITION_DIAG
* libparted/labels/dos.c: Add support for PED_PARTITION_DIAG flag
* doc/parted.texi (set): Document it.
Jim Meyering [Wed, 28 Apr 2010 20:50:35 +0000 (22:50 +0200)]
tests: distribute new file, init.sh
* tests/Makefile.am (EXTRA_DIST): Add init.sh.
Jim Meyering [Wed, 28 Apr 2010 17:27:16 +0000 (19:27 +0200)]
tests: add help-version test (from coreutils)
* tests/help-version: New file
* tests/Makefile.am (TESTS_ENVIRONMENT): Pass built_programs and VERSION
to test scripts -- both are required by help-version.
(TESTS): Add help-version.
Jim Meyering [Wed, 28 Apr 2010 20:26:41 +0000 (22:26 +0200)]
ui: make --help tell where to report bugs
* parted/ui.c (help_msg): Tell where to report bugs.
Jim Meyering [Wed, 28 Apr 2010 20:18:51 +0000 (22:18 +0200)]
tests: use gnulib's init.sh
* tests/init.sh: New file, from gnulib.
Jim Meyering [Wed, 28 Apr 2010 17:42:44 +0000 (19:42 +0200)]
tests: rename generated init.sh to old-init.sh
* tests/Makefile.am (old-init.sh): Rename from init.sh.
* libparted/tests/Makefile.am: Likewise.
* tests/test-lib.sh: Rename sole use.
* .gitignore: Rename here, too.
Jim Meyering [Wed, 28 Apr 2010 16:35:27 +0000 (18:35 +0200)]
build: update gnulib submodule to latest
Jim Meyering [Wed, 28 Apr 2010 17:20:21 +0000 (19:20 +0200)]
tests: improved portability
* tests/test-lib.sh: Don't use test's -a option.
Jim Meyering [Wed, 28 Apr 2010 17:16:49 +0000 (19:16 +0200)]
maint: remove empty lines at end of file
This lets one more "syntax-check" test pass.
Run this command:
git ls-files|grep -v gnulib|xargs perl -pi -0777 -e 's/\n\n+$/\n/'
Jim Meyering [Wed, 28 Apr 2010 17:14:17 +0000 (19:14 +0200)]
maint: pass newer "make syntax-check" tests from gnulib
* cfg.mk (local-checks-to-skip): Add these, to pass "make syntax-check"
sc_error_message_uppercase, sc_error_message_period.
* libparted/fs/ext2/ext2.h: Remove "#if HAVE_INTTYPES_H" guard.
Jim Meyering [Wed, 21 Apr 2010 12:00:26 +0000 (14:00 +0200)]
tests: test all boolean flags
* tests/t3310-flags.sh: New test, suggested by Hans De Goede.
* tests/Makefile.am (TESTS): Add it.
Jim Meyering [Tue, 27 Apr 2010 10:19:45 +0000 (12:19 +0200)]
doc: use a valid http:.../AUTHORS URL
* debug/clearfat/clearfat.c (AUTHORS): Point to the git repo.
* parted/parted.c (AUTHORS): Likewise.
* partprobe/partprobe.c (AUTHORS): Likewise.
* parted/parted.c: Include "version.h".
(_version): Use Version, not VERSION.
Jim Meyering [Mon, 26 Apr 2010 16:44:40 +0000 (18:44 +0200)]
ui: get version number from a separately-compiled file
* parted/Makefile.am (version.c, version.h): Generate.
(parted_LDADD): Add libver.a.
(noinst_LIBRARIES, nodist_libver_a_SOURCES): Define.
(BUILT_SOURCES): Initialize and append.
(MAINTAINERCLEANFILES): Update.
* parted/parted.c: Include "version.h".
(_version): Use the new global variable, Version, not VERSION.
Jim Meyering [Fri, 23 Apr 2010 18:11:23 +0000 (20:11 +0200)]
libparted: _disk_sync_part_table: allow interactive ignore
* libparted/arch/linux.c (_disk_sync_part_table): Change diagnostic
so that it makes it clear what failed. Let an interactive "ignore"
cause the function to succeed.
Jim Meyering [Sun, 18 Apr 2010 09:15:45 +0000 (11:15 +0200)]
tests: remove partition explicitly before mklabel, to avoid new failure
* tests/t3000-resize-fs.sh: Before, mklabel was sufficient to clear
the partition table in preparation for the next iteration in this test.
However, with recent BLKRRPART/BLKPG changes that "mklabel" would evoke
a warning. Remove the sole partition to avoid that.
Jim Meyering [Mon, 12 Apr 2010 10:08:16 +0000 (12:08 +0200)]
libparted: linux_disk_commit: don't ignore _disk_sync_part_table failure
* libparted/arch/linux.c (linux_disk_commit):
When calling _disk_sync_part_table, always return its result.
Jim Meyering [Mon, 12 Apr 2010 10:06:30 +0000 (12:06 +0200)]
libparted: _disk_sync_part_table: always return 0 upon failure
* libparted/arch/linux.c (_disk_sync_part_table):
Return 0 (not 1) upon failure.
Colin Watson [Mon, 29 Mar 2010 13:40:54 +0000 (14:40 +0100)]
dos: always allow at least two sectors for extended boot record
Unless specifically told otherwise, the Linux kernel considers extended
boot records to be two sectors long, in order to "leave room for LILO".
When using anything other than cylinder alignment, libparted was only
allowing one sector in the minimum extended partition geometry, which in
some situations (e.g. following Phillip Susi's patch to reintroduce
BLKPG) could confuse the kernel into thinking that the EBR and the first
logical partition overlapped.
* libparted/labels/dos.c (_get_min_extended_part_geom): Allow at least
two sectors for the extended boot record.
Jim Meyering [Tue, 30 Mar 2010 09:57:35 +0000 (11:57 +0200)]
tests: test for new 2-sector minimum ext-logical-separation
* tests/t2310-dos-extended-2-sector-min-offset.sh: New file.
* tests/Makefile.am (TESTS): Add it.
Jim Meyering [Tue, 30 Mar 2010 14:50:59 +0000 (16:50 +0200)]
dos: accommodate very small devices (useful for testing)
* libparted/labels/dos.c (_primary_constraint): Don't pass a negative
"device_length" to ped_geometry_init when the underlying device
has fewer sectors than a "cylinder".
Jim Meyering [Mon, 12 Apr 2010 08:13:18 +0000 (10:13 +0200)]
libparted: allocate storage for diagnostic only when needed
* libparted/arch/linux.c (_disk_sync_part_table): Rename local:
s/parts/bad_part_list/
Allocate space for it only if needed.
Use malloc rather than ped_malloc.
Move decl of FD down to first use.
Jim Meyering [Mon, 12 Apr 2010 07:55:38 +0000 (09:55 +0200)]
libparted: adjust code formatting
Jim Meyering [Thu, 15 Apr 2010 11:45:44 +0000 (13:45 +0200)]
libparted: reword a diagnostic
Phillip Susi [Fri, 9 Apr 2010 19:22:20 +0000 (15:22 -0400)]
libparted: improve BLKPG error checking
This patch cleans up the BLKPG code that the previous patch put back
to perform proper error checking and in the event that some partitions
are in use, they can not be modified in the running kernel using BLKPG.
Warn the user that this is the case and advise them to reboot, just like
we do when BLKRRPART fails for the same reason, unless the partition in
question is unchanged.
Phillip Susi [Tue, 30 Mar 2010 19:04:43 +0000 (15:04 -0400)]
libparted: reenable use of BLKPG ioctls
This patch effectively reverses commit
1d8f9bec which removed the code
using the new BLKPG ioctls instead of the old BLKRRPART ioctl to update
the in-kernel partition table. The reason for this is because BLKRRPART
fails if any partition on the disk is in use, but the BLKPG ioctls allow
you to manipulate the other partitions on the disk without requiring a
reboot. Also BLKRRPART requires that the kernel understand the
partition table on the disk, which may not always be the case.
Hans de Goede [Fri, 23 Apr 2010 11:08:43 +0000 (13:08 +0200)]
linux: detect dm_task_run failure
We were checking for a return value of < 0 for dm_task_run errors, but
dm_task_run returns 0 on error (and 1 on success). Thanks to Joe Jin
for spotting this, see Red Hat bug 582907.
* libparted/arch/linux.c(_dm_remove_map_name, _dm_is_part,
_dm_remove_parts, _dm_add_partition): dm_task_run returns 0 on error.
Jim Meyering [Tue, 20 Apr 2010 16:30:20 +0000 (18:30 +0200)]
tests: test for palo and prep interaction
* tests/t3300-palo-prep.sh: New file.
* tests/Makefile.am (TESTS): Add it.
Hans de Goede [Mon, 19 Apr 2010 11:55:33 +0000 (13:55 +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.
Jim Meyering [Tue, 20 Apr 2010 16:21:40 +0000 (18:21 +0200)]
tests: remove unnecessary (duplicate) local var assignment
* tests/t9021-maxima.sh: Remove duplicate ss=$sector_size_.
Colin Watson [Tue, 20 Apr 2010 12:01:33 +0000 (13:01 +0100)]
maint: make PED_ASSERT and PED_DEBUG if-safe
Constructions such as:
if (foo)
PED_DEBUG (0, "foo");
else
PED_DEBUG (0, "not foo");
did not compile reliably, depending on the configuration. Make this
work.
* include/parted/debug.h [DEBUG && __GNUC__ && !__JSFTRACE__]
(PED_DEBUG): Remove trailing semicolon.
[!DEBUG] (PED_ASSERT): Use do-while rather than while.
[!DEBUG] (PED_DEBUG): Likewise.
Jim Meyering [Sat, 17 Apr 2010 15:39:26 +0000 (17:39 +0200)]
doc: add HACKING
* HACKING: New file. Copied from coreutils, with s/coreutils/parted/
and a few minor edits.
Petr Uzel [Fri, 16 Apr 2010 08:01:08 +0000 (10:01 +0200)]
.gitignore: ignore index files generated by ctags and cscope
Petr Uzel [Fri, 16 Apr 2010 08:01:29 +0000 (10:01 +0200)]
libparted: add support for Linux software RAID arrays (mdraid)
Recognize MD devices, so "parted -s /dev/md0 print" now prints
"Model: Linux Software RAID Array (md)" instead of
"Model: Unknown (unknown)".
* include/parted/device.h (PedDeviceType): Add PED_DEVICE_MD.
* libparted/arch/linux.c (MD_MAJOR): New define.
* libparted/arch/linux.c (_device_probe_type): Recognize MD array.
* libparted/arch/linux.c (linux_new): Handle MD array.
* parted/parted.c(do_print): Add "md" to the list of available
transports.
* NEWS (New features): Mention it.
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.
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.
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.
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.
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.
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>.
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'.
Jim Meyering [Tue, 30 Mar 2010 10:13:11 +0000 (12:13 +0200)]
build: update gnulib submodule to latest
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.
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.
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.
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).
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.
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.
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.
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
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.
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_.
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.
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.
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.
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.
Jim Meyering [Fri, 26 Feb 2010 14:25:29 +0000 (15:25 +0100)]
version 2.2
* NEWS: Record release date.
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.
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.
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.
Jim Meyering [Thu, 25 Feb 2010 17:32:58 +0000 (18:32 +0100)]
build: update gnulib submodule to latest
* bootstrap: Copy from gnulib.
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.
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.
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.
Jim Meyering [Tue, 23 Feb 2010 17:51:16 +0000 (18:51 +0100)]
build: update gnulib submodule to latest
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.
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.
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):
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.