OSDN Git Service

android-x86/external-parted.git
15 years agomake "mac" partition table support pass the 512-byte ./label tests
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!

15 years agofactor out the read_sector function
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.

15 years agofix >512-byte sector label/disk-test failure
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.

15 years agolinux.c: also set phys_sector_size. Must be the same.
Jim Meyering [Mon, 14 Jul 2008 12:07:58 +0000 (14:07 +0200)]
linux.c: also set phys_sector_size. Must be the same.

15 years agotests: Phew! finally make t5000-tags.sh work with >512-byte sectors
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*.

15 years agoDon't hard-code 512 for sector-size.
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.

15 years agotest basic GPT functionality 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.

15 years agotests: avoid test output mismatch for >512-byte sectors
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.

15 years agotests: make t5000-tags.sh less sensitive to >512-byte sector size
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

15 years agot7000-scripting.sh: adapt to work with >512-byte sectors
Jim Meyering [Fri, 11 Jul 2008 18:20:34 +0000 (20:20 +0200)]
t7000-scripting.sh: adapt to work with >512-byte sectors

15 years agolabel.c tests: don't skip dvh, now that it works; clean up
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

15 years agodvh: probe, read, clobber, write: adapt for >512-byte sectors
Jim Meyering [Fri, 11 Jul 2008 14:44:02 +0000 (16:44 +0200)]
dvh: probe, read, clobber, write: adapt for >512-byte sectors

15 years agobsd.c: use pt-tools
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.

15 years agothe beginnings of library partition-table tools
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.

15 years agoavoid dvh label-clone test failure
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).

15 years ago* libparted/labels/gpt.c (gpt_clobber): Plug a leak.
Jim Meyering [Fri, 11 Jul 2008 09:18:16 +0000 (11:18 +0200)]
* libparted/labels/gpt.c (gpt_clobber): Plug a leak.

15 years agoamiga: Avoid writing uninitialized 1.5KB after initial 512B.
Jim Meyering [Fri, 21 Dec 2007 14:39:09 +0000 (15:39 +0100)]
amiga: Avoid writing uninitialized 1.5KB after initial 512B.

15 years agodisable some file-system-related probe tests for sector size > 512
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.

15 years agoFix compile failures.
Jim Meyering [Wed, 4 Jul 2007 19:15:05 +0000 (21:15 +0200)]
Fix compile failures.

15 years agoAdd fat support for sector_size > 512.
Jim Meyering [Wed, 4 Jul 2007 19:03:07 +0000 (21:03 +0200)]
Add fat support for sector_size > 512.

15 years agoavoid compiler warnings
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.

15 years agoMake loop_probe and loop_clobber work with sector_size > 512, too.
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.

15 years agoStill working on making label support work.
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.

15 years ago(msdos_clobber): Plug the leak I just introduced.
Jim Meyering [Fri, 15 Jun 2007 09:13:35 +0000 (11:13 +0200)]
(msdos_clobber): Plug the leak I just introduced.

15 years agoMake "mklabel loop" work with >512 sector_size, even when...
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.

15 years agoMake "mklabel loop" 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.

15 years agoMake "mklabel msdos" 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.

15 years agoMake "mklabel bsd" 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.

15 years agoMake "mklabel mac" work with >512-byte sector_size.
Jim Meyering [Thu, 14 Jun 2007 10:48:50 +0000 (12:48 +0200)]
Make "mklabel mac" work with >512-byte sector_size.

15 years agoAdd a FIXME comment.
Jim Meyering [Thu, 14 Jun 2007 10:46:20 +0000 (12:46 +0200)]
Add a FIXME comment.

15 years agostart to make things work with 2048-byte sector size.
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.

15 years agoallow to simulate linux-file sector size via PARTED_SECTOR_SIZE envvar
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

15 years agopost-release administrivia
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.

15 years agoversion 1.9.0
Joel Granados Moreno [Thu, 23 Jul 2009 17:59:06 +0000 (19:59 +0200)]
version 1.9.0

* NEWS: Record release date.

15 years agoRevert "Point gnulib submodule to an existing object ref."
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.

15 years agoLittle fixes before the release.
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.

15 years agoPoint gnulib submodule to an existing object ref.
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.

15 years agoAutomate the release process.
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.

15 years agoDocument our release proceedure.
Joel Granados Moreno [Wed, 15 Jul 2009 10:03:48 +0000 (12:03 +0200)]
Document our release proceedure.

* README-release: New file.

15 years agoUpdate the NEWS file for the next release.
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.

15 years agobuild: update from gnulib, for fixed maint.mk
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.

15 years agobuild: avoid "make dist-hook" failure
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.

15 years agobuild: avoid automake warning
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.

15 years agobuild: adjust Makefiles
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.

15 years agoAvoid compilation failure on s390
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.

15 years agobuild: avoid configure-time syntax error
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.

15 years agoui: avoid NULL dereference on realloc failure
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.

15 years agoRationalise linux-swap fs names, and add a "linux-swap" alias
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.

15 years agotests: disable the taint-distcheck rule
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.

15 years agotests: better quoting to avoid failure with poorly-named src directory
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

15 years agobuild: update from gnulib
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.

15 years agotests: ensure that we preserve the first 446 byts of a GPT pmbr
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.

15 years agogpt: preserve first 446 bytes of the PMBR (protective MBR)
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.

15 years agobuild: update from gnulib
Jim Meyering [Wed, 17 Jun 2009 11:53:47 +0000 (13:53 +0200)]
build: update from gnulib

* gnulib: Update submodule to latest.

15 years agobuild: require autoconf-2.63 and automake-1.11
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.

15 years agolinux-swap: generate UUIDs for fresh swap spaces
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.

15 years agotests: simplify t6001-dm-ignoremd.sh
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.

15 years agotests: add mdadm specific functions
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.

15 years agodoc: improve mkpart description
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.

15 years agoparted-ui: ensure cmd-line buffer is empty before ped_exception_throw
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.

15 years agotests: verify that "md" devices are not listed
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.

15 years agolinux: skip "md" devices when probing
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.

15 years agofat: support 64KB clusters for FAT16
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

15 years agogpt: fix gpt_read to read all of the partition entries correctly
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.

15 years agoTweak distcheck.
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.

15 years agobuild: require automake-1.11 via bootstrap.conf, too
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/

15 years agodoc: sync README-hacking from coreutils
Jim Meyering [Wed, 3 Jun 2009 10:14:05 +0000 (12:14 +0200)]
doc: sync README-hacking from coreutils

* README-hacking: update

15 years agobuild: rename internal library: lib/libparted -> lib/libgnulib
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.

15 years agolibparted: link with gnulib
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.

15 years agotests: adjust t4100-msdos-starting-sector.sh
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.

15 years agoAdd test for msdos starting sector.
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.

15 years agoMake sure we always create msdos metadata parts.
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.

15 years agoImprove readability in linux.c
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.

15 years agoCorrectly name virtio devices.
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.

15 years agoMakefile.am: fail if ABI has changed
Otavio Salvador [Sun, 24 May 2009 00:01:07 +0000 (21:01 -0300)]
Makefile.am: fail if ABI has changed

15 years agoconfigure.ac: fix PED_MINOR_VERSION sed expression
Otavio Salvador [Sat, 23 May 2009 23:04:26 +0000 (20:04 -0300)]
configure.ac: fix PED_MINOR_VERSION sed expression

15 years agoadd build-aux to .gitignore
Otavio Salvador [Sat, 23 May 2009 22:58:56 +0000 (19:58 -0300)]
add build-aux to .gitignore

15 years agobuild: enable device mapper support by default
Joel Granados Moreno [Thu, 14 May 2009 17:06:53 +0000 (19:06 +0200)]
build: enable device mapper support by default

* configure.ac: Device mapper is ubiquitous enough: enable by default.
Adjust --help and diagnostics to reflect the new default.

15 years agoportability: don't perform pointer arithmetic on a "void *" pointer
Jim Meyering [Fri, 15 May 2009 14:29:37 +0000 (16:29 +0200)]
portability: don't perform pointer arithmetic on a "void *" pointer

* libparted/arch/linux.c (_dm_remove_parts) [ENABLE_DEVICE_MAPPER]:
Don't perform pointer arithmetic on a "void *" pointer.
Interpose a (char *) cast.

15 years agomaint: cfg.mk: remove now-unnecessary gnulib_dir definition
Jim Meyering [Fri, 15 May 2009 13:13:14 +0000 (15:13 +0200)]
maint: cfg.mk: remove now-unnecessary gnulib_dir definition

* cfg.mk (gnulib_dir): Remove definition, now that gnulib's
maint.mk provides the default we want.

15 years agobuild: require 1.10c (get it by building from automake.git)
Jim Meyering [Fri, 15 May 2009 13:12:19 +0000 (15:12 +0200)]
build: require 1.10c (get it by building from automake.git)

* bootstrap.conf (buildreq): Require 1.10c (1.11 is coming soon)
for our use of AM_SILENT_RULES.
* configure.ac (AM_INIT_AUTOMAKE): Require 1.10c, for our use of
AM_SILENT_RULES.  Reported by Joel Granados.

15 years agobuild: update from gnulib, for newer maint.mk and more
Jim Meyering [Fri, 15 May 2009 13:17:20 +0000 (15:17 +0200)]
build: update from gnulib, for newer maint.mk and more

* gnulib: Update submodule to latest.

15 years agobuild: use gnulib's vc-list-files module
Jim Meyering [Fri, 15 May 2009 13:33:49 +0000 (15:33 +0200)]
build: use gnulib's vc-list-files module

* bootstrap.conf (gnulib_modules): Add vc-list-files, so we pull
this file from gnulib.
* build-aux/vc-list-files: Remove now-outdated file.

15 years agobuild: accommodate maint.mk, now that it's pulled from gnulib
Jim Meyering [Sun, 26 Apr 2009 18:08:16 +0000 (20:08 +0200)]
build: accommodate maint.mk, now that it's pulled from gnulib

* dist-check.mk: New file, from coreutils.  Was part of maint.mk.
* cfg.mk (old_NEWS_hash): Include $(srcdir)/dist-check.mk.
Remove trailing "  -", to align with new check in maint.mk.
* Makefile.am (EXTRA_DIST): Add dist-check.mk.

15 years agobuild: use gnulib's dirname module
Jim Meyering [Sun, 26 Apr 2009 14:24:35 +0000 (16:24 +0200)]
build: use gnulib's dirname module

* bootstrap.conf (gnulib_modules): Add dirname.

15 years agobuild: make automake's silent-rules option the default
Jim Meyering [Sun, 26 Apr 2009 14:25:28 +0000 (16:25 +0200)]
build: make automake's silent-rules option the default

* configure.ac (AM_INIT_AUTOMAKE): Remove silent-rules.  Instead,...
(AM_SILENT_RULES): Use this, with it's undocumented [yes] argument.
Those who want verbose build output may configure with
--disable-silent-rules or use "make V=1".

15 years agobuild: stop using obsolete gnulib modules
Jim Meyering [Sun, 26 Apr 2009 14:21:51 +0000 (16:21 +0200)]
build: stop using obsolete gnulib modules

* bootstrap.conf (obsolete_gnulib_modules): Remove.
(gnulib_modules): Remove use.

15 years agobuild: use maint.mk from gnulib
Jim Meyering [Sun, 26 Apr 2009 14:20:02 +0000 (16:20 +0200)]
build: use maint.mk from gnulib

* maint.mk: Remove file.  Now it's generated.
* .gitignore: Ignore it.
* bootstrap.conf (gnulib_modules): Add maintainer-makefile.
* gnulib: Update submodule to latest.

15 years agomaint: use a git submodule for gnulib
Jim Meyering [Sat, 11 Apr 2009 20:38:50 +0000 (22:38 +0200)]
maint: use a git submodule for gnulib

* .gitmodules: New file, to track gnulib.
* gnulib: New file, created by running this:
git submodule add git://git.sv.gnu.org/gnulib.git gnulib

15 years agomaint: sync from coreutils
Jim Meyering [Fri, 10 Apr 2009 07:59:52 +0000 (09:59 +0200)]
maint: sync from coreutils

* maint.mk: Sync from coreutils.
* bootstrap: Likewise.

15 years agobuild-from-git: depend on automake-1.10b
Jim Meyering [Wed, 8 Apr 2009 20:40:23 +0000 (22:40 +0200)]
build-from-git: depend on automake-1.10b

* bootstrap.conf (buildreq): Note the automake-1.10b requirement.
* configure.ac (AM_INIT_AUTOMAKE): Enable new automake options:
dist-xz, color-tests, parallel-tests, silent-rules.

15 years agobootstrap.conf: require automake 1.10 since 1.10a is an alpha version
Otavio Salvador [Wed, 8 Apr 2009 18:03:28 +0000 (15:03 -0300)]
bootstrap.conf: require automake 1.10 since 1.10a is an alpha version

15 years ago* maint.mk: merge with latest from coreutils
Jim Meyering [Sat, 21 Mar 2009 16:37:31 +0000 (17:37 +0100)]
* maint.mk: merge with latest from coreutils

15 years agomaint: indent consistently
Jim Meyering [Sat, 21 Mar 2009 16:47:58 +0000 (17:47 +0100)]
maint: indent consistently

* doc/po4a.mk (updatepo): Replace TAB+8-spaces with two TABs.

15 years ago* bootstrap: sync from coreutils
Jim Meyering [Thu, 8 Jan 2009 13:04:06 +0000 (14:04 +0100)]
* bootstrap: sync from coreutils

15 years agobuild: enable "make syntax-check" rule to prohibit trailing spaces
Jim Meyering [Thu, 5 Mar 2009 19:45:19 +0000 (20:45 +0100)]
build: enable "make syntax-check" rule to prohibit trailing spaces

* cfg.mk (local-checks-to-skip): Remove sc_trailing_blank.

15 years agoremove all trailing blanks
Jim Meyering [Thu, 5 Mar 2009 18:22:39 +0000 (19:22 +0100)]
remove all trailing blanks

...by running these commands:
t=$'\t'
git grep -l "[ $t]\$"|xargs perl -pi -e 's/[ \t]+$//'

15 years agoportability: use last_component, not basename
Jim Meyering [Thu, 5 Mar 2009 17:49:55 +0000 (18:49 +0100)]
portability: use last_component, not basename

* libparted/arch/linux.c (read_device_sysfs_file): Use last_component
from gnulib's basename module, not the less-portable "basename" function.
(_device_get_partition_range): Likewise.
Reported by Karel Zak.
* debug/clearfat/Makefile.am (clearfat_LDADD): Link gnulib *after*
libparted, not before.
* partprobe/Makefile.am (partprobe_LDADD): Likewise.
* parted/Makefile.am (parted_LDADD): Likewise.

15 years agotest correctly for snprintf failure
Karel Zak [Thu, 5 Mar 2009 17:34:47 +0000 (18:34 +0100)]
test correctly for snprintf failure

* libparted/arch/linux.c (_device_get_partition_range): Correct
test for failed snprintf.

15 years agogpt: plug a memory leak in gpt_read()
Petr Uzel [Thu, 5 Mar 2009 15:52:20 +0000 (16:52 +0100)]
gpt: plug a memory leak in gpt_read()

* libparted/labels/gpt.c (gpt_read): Free local variable, "zeros".