OSDN Git Service
Jim Meyering [Fri, 12 Jun 2009 07:30:43 +0000 (09:30 +0200)]
tests: t0100-print.sh: adjust to work with arbitrary sector size
* tests/t0100-print.sh: Parameterize on $sector_size_.
Remove sed xform that hard-coded for 2048.
Jim Meyering [Fri, 12 Jun 2009 06:38:23 +0000 (08:38 +0200)]
tests: revamp t4100-starting-sector.sh to work with other sector sizes
* tests/t4100-msdos-starting-sector.sh: Adjust to work with arbitrary
PARTED_SECTOR_SIZE.
Jim Meyering [Thu, 11 Jun 2009 13:21:38 +0000 (15:21 +0200)]
tests: correct t2200-dos-label-recog.sh
* tests/t2200-dos-label-recog.sh: Concatenate output from successive
partition-creation commands, rather than letting output from the
second one clobber that of the first.
Joel Granados Moreno [Mon, 18 May 2009 15:37:44 +0000 (17:37 +0200)]
put the maximum sector checks in pt-tools.c
* libparted/labels/dos.c (msdos_partition_check): Use new
ptt_partition_max_start_len function to test for len and start maxs.
* libparted/labels/dvh.c (msdos_partition_check): Likewise.
* libparted/labels/pt-tools.c (ptt_partition_max_start_len):
New function.
* libparted/labels/pt-tools.h: Likewise.
* po/POTFILES.in: Add pt-tools.c to the translation list.
Joel Granados Moreno [Mon, 18 May 2009 15:37:43 +0000 (17:37 +0200)]
put partition-table-specific logic in the corresponding files
* include/parted/disk.h (struct _PedDiskOps) [partition_check]:
New member function.
* libparted/disk.c (_check_partition): Replace open-coded tests with
use of the new ->partition_check().
(_partition_max_start, _partition_max_len): Remove functions.
* libparted/labels/dvh.c (dvh_partition_check): New function.
* libparted/labels/dos.c (dos_partition_check): Likewise.
* libparted/labels/aix.c (aix_partition_check): New stub.
* libparted/labels/bsd.c (bsd_partition_check): Likewise.
* libparted/labels/gpt.c (gpt_partition_check): Likewise.
* libparted/labels/loop.c (loop_partition_check): Likewise.
* libparted/labels/mac.c (mac_partition_check): Likewise.
* libparted/labels/pc98.c (pc98_partition_check): Likewise.
* libparted/labels/rdb.c (rdb_partition_check): Likewise.
* libparted/labels/sun.c (sun_partition_check): Likewise.
Jim Meyering [Sat, 21 Mar 2009 17:45:13 +0000 (18:45 +0100)]
* .gitignore: Ignore more.
Jim Meyering [Sat, 21 Mar 2009 17:44:48 +0000 (18:44 +0100)]
tests: clean up partition-table-testing code
* libparted/tests/common.c (_implemented_disk_label): Record here
that sun and pc98 are not yet implemented...
* libparted/tests/label.c: ...rather than in 4 places in this file.
Jim Meyering [Sat, 21 Mar 2009 17:38:17 +0000 (18:38 +0100)]
tests: improve coverage in label tests
* libparted/tests/label.c (create_disk): Increase image size from
20MB to 80MB, so that tests with PARTED_SECTOR_SIZE=8192 don't
fail right away.
(START_TEST): Don't skip the "loop" type. It works now.
Jim Meyering [Mon, 16 Mar 2009 16:47:04 +0000 (17:47 +0100)]
tests: make t8000-loop.sh stop immediately upon failiure
* tests/t8000-loop.sh (immediate): ... to avoid cascading.
Jim Meyering [Thu, 12 Mar 2009 18:58:34 +0000 (19:58 +0100)]
tests: fix the final test failure on RHEL 5.3
* tests/t1700-ext-probe.sh (dev): Use mkfs.$type, not mkfs -t $type.
The latter doesn't work on RHEL5: a file system created with
"mkfs -F -t ext3" appears to be created as ext2.
Jim Meyering [Wed, 11 Mar 2009 19:40:20 +0000 (20:40 +0100)]
tests: skip xfs-requiring tests when mkfs.xfs is not installed
* tests/test-lib.sh (require_xfs_): New function.
* tests/t4100-dvh-partition-limits.sh: Use it.
* tests/t4100-msdos-partition-limits.sh: Likewise.
Jim Meyering [Wed, 11 Mar 2009 18:38:35 +0000 (19:38 +0100)]
tests: skip t7000-scripting.sh if configure without readline
Otherwise, that test would fail due to slight differences in output.
* tests/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
* tests/t7000-scripting.sh: Skip if configured without readline.
Jim Meyering [Wed, 11 Mar 2009 17:36:04 +0000 (18:36 +0100)]
tests: don't infloop for manual test invocation with unrecognized option
* tests/test-lib.sh: Diagnose an invalid option.
Jim Meyering [Wed, 11 Mar 2009 16:45:27 +0000 (17:45 +0100)]
tests: add one to exercise the dos/gpt seg-faulting bug
* tests/t0300-dos-on-gpt.sh: Test for this bug.
* tests/Makefile.am (TESTS): Add it to the list.
Jim Meyering [Wed, 11 Mar 2009 15:06:53 +0000 (16:06 +0100)]
gpt_clobber: avoid segfault when 512 < sector_size
* libparted/labels/gpt.c (gpt_clobber): Rewrite not to use a
fixed-size buffer assuming a 512-byte sector.
Eliminate entirely a buffer that is allocated (not long enough)
and zeroed-out solely so to help zero out a few sectors.
Instead, use the new ptt_clear_sectors function.
Jim Meyering [Tue, 10 Mar 2009 21:58:20 +0000 (22:58 +0100)]
ptt_clear_sectors: new function
* libparted/labels/pt-tools.c (ptt_clear_sectors): New function.
* libparted/labels/pt-tools.h: Declare.
Jim Meyering [Wed, 11 Mar 2009 11:46:55 +0000 (12:46 +0100)]
linux_write: use sector_size, not hard-coded 512
* libparted/arch/linux.c (linux_write): Use sector_size,
not a hard-coded 512, to find start of last sector.
Jim Meyering [Thu, 8 Jan 2009 12:05:23 +0000 (13:05 +0100)]
parted/ui.c: Include <config.h> before everything else
Jim Meyering [Mon, 28 Jul 2008 16:20:38 +0000 (18:20 +0200)]
* README-big-sector: New file.
Jim Meyering [Mon, 28 Jul 2008 12:34:46 +0000 (14:34 +0200)]
reenabling probe-related code exposed problems with amiga and bsd
* libparted/tests/common.c (_implemented_disk_label): Pretend they're
not implemented, so we skip them, temporarily.
Jim Meyering [Sat, 26 Jul 2008 19:16:57 +0000 (21:16 +0200)]
tests: re-enable "mac" tests
* libparted/tests/label.c: Remove "mac" exclusion.
Jim Meyering [Sat, 26 Jul 2008 19:15:05 +0000 (21:15 +0200)]
mac clone: avoid failed assertion for sector size > 512
* libparted/labels/mac.c (mac_duplicate): Do not assume that
the first sector of the partition-map partition is "1".
Running this: cd libparted/tests &&
PARTED_SECTOR_SIZE=1024 CK_FORK=no valgrind ./label
would result in a failed assertion:
ped_disk_remove_partition (...) at disk.c:1897
1897 PED_ASSERT (part->part_list == NULL, goto error);
At first glance, it looked like the free(part) in
mac_partition_destroy was the culprit. And removing that free
does indeed avoid the failed assertion. However, not only does
the name "mac_partition_destroy" imply/require the "free", but
all other *_partition_destroy functions free their PART parameter,
so removing this free statement cannot be the solution.
Another possibility is that mac_duplicate's use of
ped_disk_remove_partition is in error. Removing it appears
to solve the problem, but I don't know why that code is removing
the partition-map partition manually, so can't safely remove
such a thing.
The real problem is that with >512-byte sectors, the "1" in this
code from mac_duplicate is wrong:
partition_map = ped_disk_get_partition_by_sector (new_disk, 1);
PED_ASSERT (partition_map != NULL, return 0);
ped_disk_remove_partition (new_disk, partition_map);
E.g., with 1024-byte sectors, the desired partition-map
partition starts at sector 2, so the above gets the tiny
metadata partition in the gap. Calling ped_disk_remove_partition
to remove a metadata partition provokes some nasty corruption.
The desired first-sector number is old_mac_data->ghost_size, not "1".
Jim Meyering [Wed, 23 Jul 2008 16:54:23 +0000 (18:54 +0200)]
* libparted/labels/mac.c (mac_duplicate): Remove dead code.
Jim Meyering [Wed, 23 Jul 2008 16:05:50 +0000 (18:05 +0200)]
mac partitions pass all label+disk tests @1024 & @2048 sector size
* libparted/labels/mac.c (mac_read): Allow for variable sector size.
(_pad_raw_part): Likewise.
(get_pme): New convenience function, adapted to work for
variable sector size and factored out of 4 functions:
(_generate_raw_part): ...here,
(_generate_raw_freespace_part): ...here,
(_generate_empty_part): ...here,
(_get_first_empty_part_entry): ...and here.
Jim Meyering [Mon, 21 Jul 2008 20:15:02 +0000 (22:15 +0200)]
mac.c (_disk_analyse_ghost_size): allow >512-byte sector size
* libparted/labels/mac.c (_disk_analyse_ghost_size):
Jim Meyering [Mon, 21 Jul 2008 14:27:52 +0000 (16:27 +0200)]
mac.c: remove dead code
* libparted/labels/mac.c (mac_partition_new): Remove dead code.
Return "NULL", not "0".
Jim Meyering [Mon, 21 Jul 2008 13:36:18 +0000 (15:36 +0200)]
make "mac" partition table support pass the 512-byte ./label tests
* libparted/labels/mac.c (mac_probe, mac_clobber): FIX!
Jim Meyering [Tue, 15 Jul 2008 12:47:22 +0000 (14:47 +0200)]
factor out the read_sector function
* libparted/labels/pt-tools.c (ptt_read_sector): New function.
Factored out of...
* libparted/labels/aix.c (aix_probe, aix_clobber, read_sector):
* libparted/labels/bsd.c (bsd_probe, bsd_clobber, bsd_read)
(_probe_and_add_boot_code, read_sector):
* libparted/labels/dos.c (_, msdos_probe, msdos_clobber)
(read_table, msdos_write, msdos_disk_type, read_sector):
* libparted/labels/gpt.c (gpt_probe, gpt_disk_type, read_sector):
* libparted/labels/loop.c (loop_probe, loop_read, loop_disk_type)
(read_sector):
* libparted/labels/mac.c (_, mac_probe, mac_read)
(write_block_zero, mac_disk_type, read_sector):
* libparted/labels/pt-tools.h: Declare.
Jim Meyering [Tue, 15 Jul 2008 10:51:25 +0000 (12:51 +0200)]
fix >512-byte sector label/disk-test failure
* libparted/tests/disk.c: Include xstrtol.h.
(get_sector_size): New function: get sector size from the environment.
(create_disk): Use the new function to calculate a usable size,
rather than hard-coding the 512-byte-sector-specific size of 20MB.
* libparted/tests/common.c (_create_disk): Change meaning (and name)
of parameter to be size in bytes, not MiB.
Adjust callers.
* po/POTFILES.in: Add lib/xstrtol-error.c.
Jim Meyering [Mon, 14 Jul 2008 12:07:58 +0000 (14:07 +0200)]
linux.c: also set phys_sector_size. Must be the same.
Jim Meyering [Mon, 14 Jul 2008 12:01:13 +0000 (14:01 +0200)]
tests: Phew! finally make t5000-tags.sh work with >512-byte sectors
* tests/t5000-tags.sh: Many adjustments, along lines of t0200-gpt.
Also, be explicit: bios_boot_magic goes in 2nd *sector*.
Jim Meyering [Fri, 11 Jul 2008 21:41:55 +0000 (23:41 +0200)]
Don't hard-code 512 for sector-size.
We'd get the wrong value for dev->length.
* libparted/arch/linux.c (init_file): In computing dev->length,
divide by dev->sector_size (not 512) to compute number of sectors.
Define dev->sector_size earlier.
Jim Meyering [Fri, 11 Jul 2008 19:42:58 +0000 (21:42 +0200)]
test basic GPT functionality earlier
* tests/t0250-gpt.sh: New file.
* tests/Makefile.am (TESTS): Add it.
Jim Meyering [Fri, 11 Jul 2008 19:30:05 +0000 (21:30 +0200)]
tests: avoid test output mismatch for >512-byte sectors
* tests/test-lib.sh (normalize_part_diag_): New function.
(sector_size_): New variable.
* tests/t7000-scripting.sh: Use them.
Jim Meyering [Fri, 11 Jul 2008 19:29:42 +0000 (21:29 +0200)]
tests: make t5000-tags.sh less sensitive to >512-byte sector size
* tests/t5000-tags.sh: Use -m option and "unit s".
FIXME: But still fails when invoked via
PARTED_SECTOR_SIZE=2048 ./t5000-tags.sh --verbose --debug
Jim Meyering [Fri, 11 Jul 2008 18:20:34 +0000 (20:20 +0200)]
t7000-scripting.sh: adapt to work with >512-byte sectors
Jim Meyering [Fri, 11 Jul 2008 14:48:56 +0000 (16:48 +0200)]
label.c tests: don't skip dvh, now that it works; clean up
Jim Meyering [Fri, 11 Jul 2008 14:44:02 +0000 (16:44 +0200)]
dvh: probe, read, clobber, write: adapt for >512-byte sectors
Jim Meyering [Fri, 11 Jul 2008 14:36:11 +0000 (16:36 +0200)]
bsd.c: use pt-tools
* libparted/labels/bsd.c: Include pt-tools.h.
(bsd_write): Use ptt_write_sector.
Jim Meyering [Fri, 11 Jul 2008 14:34:50 +0000 (16:34 +0200)]
the beginnings of library partition-table tools
* libparted/labels/pt-tools.h: New file.
* libparted/labels/pt-tools.c: New file.
* libparted/labels/Makefile.am (liblabels_la_SOURCES): Add them.
Jim Meyering [Fri, 11 Jul 2008 10:27:17 +0000 (12:27 +0200)]
avoid dvh label-clone test failure
* libparted/labels/dvh.c (dvh_duplicate): Initialize with
ped_disk_new_fresh, not with _ped_disk_alloc. The former
sets disk->update_mode = 1, as required (and enforced via an
assertion in ped_disk_destroy).
Jim Meyering [Fri, 11 Jul 2008 09:18:16 +0000 (11:18 +0200)]
* libparted/labels/gpt.c (gpt_clobber): Plug a leak.
Jim Meyering [Fri, 21 Dec 2007 14:39:09 +0000 (15:39 +0100)]
amiga: Avoid writing uninitialized 1.5KB after initial 512B.
Jim Meyering [Tue, 18 Dec 2007 15:17:06 +0000 (16:17 +0100)]
disable some file-system-related probe tests for sector size > 512
These changes keep us from recognizing most file systems
when the sector size is larger than 512. However, for now (while
concentrating on getting partition table support right) that's not
a problem. Besides, the code we're avoiding would inevitably make
parted smash its stack.
* libparted/fs/linux_swap/linux_swap.c (_generic_swap_probe): Fail
the swap-file-system-recognizing test when sector size is not 512.
* libparted/filesys.c (ped_file_system_probe_specific): Fail all
fs-specific probe-related tests when sector size is not 512.
* libparted/fs/jfs/jfs.c (jfs_probe): For now, don't even try to
deal with larger sector size.
* libparted/label.c: Skip tests of problematic file system types.
* tests/t0100-print.sh: Print with units of sectors, and adjust
expected output accordingly.
* tests/t1000-mkpartfs.sh: Use a smaller test file.
Jim Meyering [Wed, 4 Jul 2007 19:15:05 +0000 (21:15 +0200)]
Fix compile failures.
Jim Meyering [Wed, 4 Jul 2007 19:03:07 +0000 (21:03 +0200)]
Add fat support for sector_size > 512.
Jim Meyering [Wed, 4 Jul 2007 18:50:18 +0000 (20:50 +0200)]
avoid compiler warnings
* libparted/fs/ext2/interface.c (_ext2_generic_probe): Likewise.
(_ext2_clobber): Likewise.
Jim Meyering [Fri, 15 Jun 2007 14:13:59 +0000 (16:13 +0200)]
Make loop_probe and loop_clobber work with sector_size > 512, too.
Jim Meyering [Fri, 15 Jun 2007 14:06:34 +0000 (16:06 +0200)]
Still working on making label support work.
* libparted/fs/ext2/interface.c (_ext2_generic_probe): The call to
ped_geometry_read_alloc would clobber the stack after SB whenever
block_size > 512. Instead, use new function, ped_geometry_read_alloc,
and adjust all uses of SB.
(_ext2_clobber): Likewise.
* libparted/cs/geom.c (ped_geometry_read_alloc): New function.
* include/parted/geom.h: Declare it.
Jim Meyering [Fri, 15 Jun 2007 09:13:35 +0000 (11:13 +0200)]
(msdos_clobber): Plug the leak I just introduced.
Jim Meyering [Fri, 15 Jun 2007 08:42:39 +0000 (10:42 +0200)]
Make "mklabel loop" work with >512 sector_size, even when...
there is an existing "msdos" label.
(msdos_clobber): Make it work with >512 sector_size.
Jim Meyering [Fri, 15 Jun 2007 08:08:16 +0000 (10:08 +0200)]
Make "mklabel loop" work with >512 sector_size.
Jim Meyering [Fri, 15 Jun 2007 07:12:04 +0000 (09:12 +0200)]
Make "mklabel msdos" work with >512 sector_size.
Jim Meyering [Fri, 15 Jun 2007 06:59:44 +0000 (08:59 +0200)]
Make "mklabel bsd" work with >512 sector_size.
Jim Meyering [Thu, 14 Jun 2007 10:48:50 +0000 (12:48 +0200)]
Make "mklabel mac" work with >512-byte sector_size.
Jim Meyering [Thu, 14 Jun 2007 10:46:20 +0000 (12:46 +0200)]
Add a FIXME comment.
Jim Meyering [Fri, 1 Jun 2007 17:10:56 +0000 (19:10 +0200)]
start to make things work with 2048-byte sector size.
Done so far: amiga, bsd, loop, gpt.
Fix leaks along the way.
remove unused label
Add a cast to avoid a warning.
Jim Meyering [Thu, 10 Jul 2008 20:42:36 +0000 (22:42 +0200)]
allow to simulate linux-file sector size via PARTED_SECTOR_SIZE envvar
Joel Granados Moreno [Thu, 23 Jul 2009 18:05:47 +0000 (20:05 +0200)]
post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
Joel Granados Moreno [Thu, 23 Jul 2009 17:59:06 +0000 (19:59 +0200)]
version 1.9.0
* NEWS: Record release date.
Jim Meyering [Thu, 23 Jul 2009 20:07:22 +0000 (22:07 +0200)]
Revert "Point gnulib submodule to an existing object ref."
This reverts commit
95486a979a8862df9f6f2129c2d9f35221340583.
The reverted change mistakenly backdated gnulib to July 14.
Joel Granados Moreno [Thu, 23 Jul 2009 17:15:19 +0000 (19:15 +0200)]
Little fixes before the release.
* README-release: Correct an error in step 5. In step 6 we mean
$VERSION.
* build-aux/parted-release (_do_release): Use '-F -' to make the NEWS
commit.
Joel Granados Moreno [Thu, 23 Jul 2009 10:38:14 +0000 (12:38 +0200)]
Point gnulib submodule to an existing object ref.
* gnulib: Update submodule to latest.
Joel Granados Moreno [Sun, 19 Jul 2009 13:16:04 +0000 (15:16 +0200)]
Automate the release process.
* build-aux/parted-release: New file. Automates the part of the release
process that takes place in the local repository.
Joel Granados Moreno [Wed, 15 Jul 2009 10:03:48 +0000 (12:03 +0200)]
Document our release proceedure.
* README-release: New file.
Joel Granados Moreno [Mon, 13 Jul 2009 16:01:48 +0000 (18:01 +0200)]
Update the NEWS file for the next release.
* NEWS : Describe some of the latest bugfixes and behavioral changes.
Jim Meyering [Thu, 23 Jul 2009 08:47:50 +0000 (10:47 +0200)]
build: update from gnulib, for fixed maint.mk
* gnulib: Update submodule to latest.
Jim Meyering [Wed, 22 Jul 2009 21:37:45 +0000 (23:37 +0200)]
build: avoid "make dist-hook" failure
* Makefile.am (dist-hook): Remove coreutils-specific rm-substitution.
Jim Meyering [Wed, 22 Jul 2009 18:18:52 +0000 (20:18 +0200)]
build: avoid automake warning
* libparted/Makefile.am (SUBDIRS_CHECK): Do not redefine.
Instead, append to existing value.
Jim Meyering [Sun, 19 Jul 2009 18:09:29 +0000 (20:09 +0200)]
build: adjust Makefiles
* libparted/Makefile.am (ARCH_SOURCE): Factor out duplication.
* libparted/labels/Makefile.am (partedincludedir): Split long line.
Otavio Salvador [Sun, 19 Jul 2009 12:03:59 +0000 (09:03 -0300)]
Avoid compilation failure on s390
To export LinuxSpecific stuff for labels, in this case fdasd, we now
provide arch/linux.h. This aids in avoiding code duplication.
* configure.ac: add BUILD_LINUX conditional.
* libparted/Makefile.am: conditionally use linux.h.
* libparted/arch/linux.c: move LinuxSpecific stuff to linux.h.
* libparted/arch/linux.h: New file.
* libparted/labels/Makefile.am: include from libparted as well.
* libparted/labels/dasd.c: use arch/linux.h and use dev->path for
error message.
* libparted/labels/fdasd.c: include linux.h and drop an unused
variable.
Jim Meyering [Thu, 16 Jul 2009 14:21:29 +0000 (16:21 +0200)]
build: avoid configure-time syntax error
Running ./configure on a system without devmapper devel libraries
would provoke this:
./configure: line 264: return: but: numeric argument required
./configure: line 24783: --enable-device-mapper: command not found
* configure.ac: Add quotes to most AC_MSG_ERROR uses, both around
the argument, and (when needed) around the macro use itself.
Jim Meyering [Fri, 26 Jun 2009 15:25:16 +0000 (17:25 +0200)]
ui: avoid NULL dereference on realloc failure
* parted/strlist.c (gettext_to_wchar) [ENABLE_NLS]: Use xrealloc,
so we never return NULL, which could then be dereferenced.
Colin Watson [Fri, 10 Jul 2009 11:42:14 +0000 (12:42 +0100)]
Rationalise linux-swap fs names, and add a "linux-swap" alias
* libparted/filesys.c (ped_file_system_alias_register,
ped_file_system_alias_unregister, ped_file_system_alias_get_next): New
functions.
(ped_file_system_type_get): Walk aliases as well.
* include/parted/filesys.h (struct _PedFileSystemAlias): New structure.
(ped_file_system_alias_register, ped_file_system_alias_unregister,
ped_file_system_alias_get_next): Add prototypes.
* parted/parted.c (_init_messages): Walk file system aliases as well as
types.
* parted/ui.c (init_fs_type_str): Likewise.
* libparted/fs/linux_swap/linux_swap.c (_swap_v1_type, _swap_v1_open,
_swap_v1_probe, _swap_v1_clobber, _swap_v1_ops): Rename to _swap_v0_type
etc. to match version number used in mkswap. Update all users.
(_swap_v2_type, _swap_v2_open, _swap_v2_probe, _swap_v2_clobber,
_swap_v2_ops): Rename to _swap_v1_type etc. to match version number used
in mkswap. Update all users.
(_swap_v0_type): Rename type from "linux-swap(old)" to "linux-swap(v0)".
(_swap_v1_type): Rename type from "linux-swap(new)" to "linux-swap(v1)".
(ped_file_system_linux_swap_init, ped_file_system_linux_swap_done):
Register/unregister a "linux-swap" alias for "linux-swap(v1)", and
deprecated aliases "linux-swap(old)" and "linux-swap(new)".
* libparted/labels/misc.h (is_linux_swap): Update comment.
* tests/t2100-mkswap.sh: Refer to "linux-swap(v1)" rather than
"linux-swap(new)". Test creation via the new alias.
Jim Meyering [Thu, 9 Jul 2009 17:36:46 +0000 (19:36 +0200)]
tests: disable the taint-distcheck rule
* dist-check.mk (taint-distcheck): Disable rule, since it
would trigger a bug in libtool-generated scripts.
Jim Meyering [Thu, 9 Jul 2009 17:07:01 +0000 (19:07 +0200)]
tests: better quoting to avoid failure with poorly-named src directory
* libparted/tests/Makefile.am (init.sh): Quote, in case
$(abs_top_srcdir) contains e.g., spaces.
* tests/Makefile.am (init.sh): Likewise.
* libparted/tests/t2000-disk.sh: Better quoting here, too.
* libparted/tests/t1000-label.sh: Likewise.
Reported by Joel Granados
Jim Meyering [Thu, 9 Jul 2009 16:07:28 +0000 (18:07 +0200)]
build: update from gnulib
* gnulib: Update submodule to latest.
* cfg.mk (local-checks-to-skip): Add sc_require_test_exit_idiom.
This skips a new-from-gnulib test that doesn't apply here.
Joel Granados Moreno [Wed, 3 Jun 2009 18:36:56 +0000 (20:36 +0200)]
tests: ensure that we preserve the first 446 byts of a GPT pmbr
* tests/t0202-gpt-pmbr.sh: Ensure that the first 446 bytes are
unchanged after creating a GPT partition.
Joel Granados Moreno [Wed, 3 Jun 2009 18:36:55 +0000 (20:36 +0200)]
gpt: preserve first 446 bytes of the PMBR (protective MBR)
* libparted/label/gpt.c (_write_pmbr): Make sure we read and preserve
the first 446 bytes of the device when we are creating the PMBR.
Jim Meyering [Wed, 17 Jun 2009 11:53:47 +0000 (13:53 +0200)]
build: update from gnulib
* gnulib: Update submodule to latest.
Jim Meyering [Wed, 17 Jun 2009 09:31:35 +0000 (11:31 +0200)]
build: require autoconf-2.63 and automake-1.11
* configure.ac (AC_PREREQ): Require 2.63, not 2.61.
(AM_INIT_AUTOMAKE): Require 1.11, not 1.10c.
Colin Watson [Tue, 16 Jun 2009 17:09:45 +0000 (18:09 +0100)]
linux-swap: generate UUIDs for fresh swap spaces
* libparted/fs/linux_swap/linux_swap.c: Generate a UUID when creating a
fresh swap space.
* tests/t2100-mkswap.sh: Test that two fresh swap spaces get different
UUIDs, and that 'check' preserves the swap UUID.
Joel Granados Moreno [Wed, 10 Jun 2009 17:05:53 +0000 (19:05 +0200)]
tests: simplify t6001-dm-ignoremd.sh
* tests/t6001-dm-ignoremd.sh (md_dev_create_): Use functions in
test-util.sh for mdadm commands. Move mddev_ to the top of the
file. Remove unneeded comment.
Joel Granados Moreno [Wed, 10 Jun 2009 17:05:54 +0000 (19:05 +0200)]
tests: add mdadm specific functions
* tests/test-lib.sh (require_mdadm_): New function.
(mdadm_create_linear_device_): New function.
Joel Granados Moreno [Wed, 10 Jun 2009 17:05:51 +0000 (19:05 +0200)]
doc: improve mkpart description
* doc/parted.texi: Make sure that part-type is portrayed as an
optional argument. Mention the "special behavior" that mkpart has
with specific disk label types.
Joel Granados Moreno [Wed, 10 Jun 2009 17:05:50 +0000 (19:05 +0200)]
parted-ui: ensure cmd-line buffer is empty before ped_exception_throw
When ped_exception_throw requires input from the user and there are
leftover strings in the command line, there is an "invalid token" error
from parted. This happens because the ped_exception expects some input
that is, most likely, different from the leftover string(s). To address
this, one must make sure that all the argument strings are parsed before
invoking any exception that requires input.
* parted/parted.c (do_mklabel): Call command_line_get_disk_type call
before the disk checks (_disk_warn_loss will call ped_exception_throw).
* tests/t0000-basic.sh: Adjust, now that the output need not include
the error message.
Joel Granados Moreno [Wed, 10 Jun 2009 17:05:49 +0000 (19:05 +0200)]
tests: verify that "md" devices are not listed
* tests/t6001-dm-ignored.sh: New test file.
* tests/Makefile.am (TESTS): Add it.
Joel Granados Moreno [Wed, 10 Jun 2009 17:05:48 +0000 (19:05 +0200)]
linux: skip "md" devices when probing
* libparted/arch/linux.c (_skip_entry) : Add "md" to the entries
array so all devices of type "/dev/md#" get ignored.
Joel Granados Moreno [Wed, 10 Jun 2009 17:05:47 +0000 (19:05 +0200)]
fat: support 64KB clusters for FAT16
* libparted/fs/fat/calc.c (fat_max_cluster_size): A 64KB cluster
size (128 sectors) for FAT16 is not common but is possible. Allow
the use of 128-sector clusters instead of outputting an error.
Fixes this:
http://parted.alioth.debian.org/cgi-bin/trac.cgi/ticket/207
Additional info here:
http://lists.alioth.debian.org/\
pipermail/parted-devel/2009-June/002882.html
Matthew S. Harris [Wed, 10 Jun 2009 17:05:46 +0000 (19:05 +0200)]
gpt: fix gpt_read to read all of the partition entries correctly
* libparted/labels/gpt.c (gpt_read): Use the SizeOfPartitionEntry
field value when reading the partition entries rather than assuming
that the entries are the same size as our struct.
(gpt_read): When reading the partition
entries, round up, not down, the number of sectors to read.
(_header_is_valid): Check that the SizeOfPartitionEntry is sane.
With minor adjustments by Joel Granados Moreno.
Joel Granados Moreno [Wed, 10 Jun 2009 17:05:55 +0000 (19:05 +0200)]
Tweak distcheck.
* dist-check.mk (install-transform-check): The binaries will be located
in /sbin instead of /bin.
Jim Meyering [Wed, 3 Jun 2009 10:28:01 +0000 (12:28 +0200)]
build: require automake-1.11 via bootstrap.conf, too
* bootstrap.conf (buildreq): s/1.10c/1.11/
Jim Meyering [Wed, 3 Jun 2009 10:14:05 +0000 (12:14 +0200)]
doc: sync README-hacking from coreutils
* README-hacking: update
Jim Meyering [Wed, 3 Jun 2009 09:54:32 +0000 (11:54 +0200)]
build: rename internal library: lib/libparted -> lib/libgnulib
* bootstrap.conf (gnulib_name): Define gnulib_name=libgnulib.
* libparted/Makefile.am (libparted_la_LIBADD): Update sole use.
Jim Meyering [Wed, 3 Jun 2009 08:29:36 +0000 (10:29 +0200)]
libparted: link with gnulib
* libparted/Makefile.am (libparted_la_LIBADD): Add
$(top_builddir)/lib/libparted.la to the list.
* partprobe/Makefile.am (partprobe_LDADD): Remove now-unneeded
$(top_builddir)/lib/libparted.la.
* libparted/tests/Makefile.am (LDADD): Remove now-unneeded
$(top_builddir)/lib/libparted.la.
* debug/clearfat/Makefile.am (clearfat_LDADD): Likewise.
* parted/Makefile.am (parted_LDADD): Likewise.
Otavio Salvador reported that linking with the resulting shared
library produced an unresolved reference to last_component.
Jim Meyering [Tue, 26 May 2009 12:36:18 +0000 (14:36 +0200)]
tests: adjust t4100-msdos-starting-sector.sh
* tests/t4100-msdos-starting-sector.sh: Use parted's -m option
when printing, and adjust expected output to match.
Filter out "Disk...:" part to avoid false-positive failures due
to mount-point- related differences.
Joel Granados Moreno [Wed, 13 May 2009 15:24:33 +0000 (17:24 +0200)]
Add test for msdos starting sector.
* tests/t4100-msdos-starting-sector.sh : Make sure we are consistent
when displaying starting sector for msdos lables.
Joel Andres Granados [Wed, 13 May 2009 15:24:32 +0000 (17:24 +0200)]
Make sure we always create msdos metadata parts.
Given a disk with no partition, parted did not create metadata
partitions for an msdos label. This led to inconsistencies when
reporting free space partition ranges. This patch addresses this issue.
* libparted/labels/dos.c (get_last_part): Remove function.
* libparted/labels/dos.c (get_start_first_nonfree_part): New function.
* libparted/labels/dos.c (get_end_last_nonfree_part): New function.
* libparted/lables/dos.c (add_startend_metadata): Add code that
handles disks no partitions. Add check that prevents the metadata
partitions from being greater than the device length. Add check
that prevents metadata partitions from overlapping in small devs.
Joel Granados Moreno [Wed, 13 May 2009 15:24:31 +0000 (17:24 +0200)]
Improve readability in linux.c
* libparted/arch/linux.c : Gather all the _is_major functions together.
change the name of readFD to _read_fd since its not used anywhere
else. Also rename the "_is_major_type" function to
"_major_type_in_device" as it better expresses what we do in said
function.
Joel Granados Moreno [Wed, 13 May 2009 15:24:30 +0000 (17:24 +0200)]
Correctly name virtio devices.
* include/parted/device.h (PedDeviceType): Add a new PED_DEVICE_VIRTBLK
type to the list.
* libparted/arch/linux.c (_is_dm_major): Modify this function so it
calls the new _is_major_type function with type "device-mapper".
* libparted/arch/linux.c (_is_major_type): Searches a major number
inside /proc/devices based on a "type" string.
* libparted/arch/linux.c (_is_virtblk_major): New function. Calls
_is_major_type with type "virtblk".
* libparted/arch/linux.c (_device_probe_type): Add a new
PED_DEVICE_VIRTBLK case to the probe possibilities.
* libparted/arch/linux.c (linux_new): Add a new PED_DEVICE_VIRTBLK case
to the possible device types.
* parted/parted.c (do_print): add the "virtblk" string to the transport
array.