summaryrefslogtreecommitdiffstats
path: root/partx
Commit message (Collapse)AuthorAgeFilesLines
* partx: get partition number with sysfs libDavidlohr Bueso2011-07-212-17/+6Star
| | | | | | Now that we have this feature, there's no need to manually parse sysfs in partx. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* partx: remove unused headersDavidlohr Bueso2011-06-021-6/+0Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* This adds a second parameter to size_to_human_string() to return aFrancesco Cosoleto2011-05-261-1/+1
| | | | | | | | | | | | | | | string with a different format based on the following flags: SIZE_SUFFIX_1LETTER = "1K" SIZE_SUFFIX_3LETTER = "1KiB", SIZE_SUFFIX_SPACE = "1 KiB" or "1 K" [kzak@redhat.com: - rename flags to SIZE_SUFFIX_* format, - fix suffix[] buffer size - add 3 letter version to the test] Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: add --pairs to output in key="value" formatKarel Zak2011-05-101-14/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* addpart: multiplication on 512 deletedAnton V. Boyarshinov2011-05-051-2/+2
| | | | | Multiplication on 512 now placed in partx/kpartx.h in '<< 9' form. Double moutiplication causes an error.
* partx: trivial comment fixDavidlohr Bueso2011-04-061-1/+1
| | | | | | Replace atgv for argv Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* partx: add fallback for openat() to be usable on old systemsKarel Zak2011-03-292-3/+8
| | | | | Reported-by: "Gabor Z. Papp" <gzp@papp.hu> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: clean up partx MakefileKarel Zak2011-03-161-9/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [tt.c] use mbs_truncate() from mbsalign.cKarel Zak2011-03-111-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: improve clarity of some messages, gettextize two missed onesBenno Schulenberg2011-02-161-14/+13Star
| | | | | | | | [kzak@redhat.com: - use <disk> rather than <device> in error/verbose messages] Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: improve the wording of some error and usage messagesBenno Schulenberg2011-02-161-3/+3
| | | | | | | | | [kzak@redhat.com: - cleanup lscpu(1) usage text - use <disk> rather than <device> in partx(8) usage text] Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: fix three typos in message strings and improve consistencyBenno Schulenberg2011-02-161-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen2011-02-141-1/+0Star
| | | | | | | | Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* partx, lsblk: fix gettext callsKarel Zak2011-02-111-1/+1
| | | | | Reported-by: Peter Breitenlohner <peb@mppmu.mpg.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: normalize the punctuation of man page, and improve grammar here and thereBenno Schulenberg2011-02-081-39/+40
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* remaining util-linux-ng to util-linuxSami Kerola2011-01-231-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* partx: fix typo in partx.8Davidlohr Bueso2011-01-171-1/+1
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* docs: fix typos in man pagesKarel Zak2011-01-042-2/+2
| | | | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=664458 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=664294 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=664182 Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: fix authors section in man pageDavidlohr Bueso2010-12-311-1/+1
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* fix __noreturn__ usageKarel Zak2010-12-101-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: tiny change in usage()Karel Zak2010-12-091-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: cleanup and add columnsKarel Zak2010-12-091-13/+31
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* delpart: code consolidationKarel Zak2010-12-091-20/+4Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* addpart: code consolidationKarel Zak2010-12-091-21/+9Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: complete rewriteDavidlohr Bueso2010-12-0916-2084/+905Star
| | | | | | Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* remove -ng from some filesKarel Zak2010-12-012-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rename util-linux-ng back to util-linuxKarel Zak2010-11-303-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: integrate support for mac and sun partitions, based on kpartx.Davidlohr Bueso2010-10-085-7/+6Star
| | | | | | | | [kzak@redhat.com: - remove unnecessary members from struct slice, - fix gcc warnings] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: add sun partition table supportDavidlohr Bueso2010-10-081-0/+134
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* partx: add mac partition table supportDavidlohr Bueso2010-10-081-0/+74
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* build-sys: replace ../ with $top_srcdirKarel Zak2010-05-241-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* addpart: use atoll() for parsing command line argumentsThomas Fehr2010-05-131-2/+2
| | | | | | Addresses: http://bugzilla.novell.com/show_bug.cgi?id=603328 Signed-off-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: fix infinite loopKarel Zak2010-03-311-0/+2
| | | | | | | | | On Wed, Mar 24, 2010 at 04:39:35PM -0400, Phillip Susi wrote: > I noticed that running partx -d /dev/sda hangs so I looked into it > and it seems that it keeps trying to delete partitions forever. Reported-By: Phillip Susi <psusi@cfl.rr.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: do not add nonexistent partitionsPhillip Susi2010-03-311-0/+3
| | | | | | | | | This simple patch fixes partx -a to not add nonexistent zero length partitions for unused primary partition slots to to the kernel. This makes partx conform to the usual kernel behavior. Signed-off-by: Phillip Susi <psusi@cfl.rr.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: use c.hKarel Zak2009-10-161-3/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: work properly with 512 sectors (dos PT)Karel Zak2009-09-071-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx.8: formattingPeter Breitenlohner2009-08-171-1/+8
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* delpart.8: formattingPeter Breitenlohner2009-08-171-3/+4
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* addpart.8: formattingPeter Breitenlohner2009-08-171-5/+6
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* replace bcopy,bzero,index and rindexDaniel Mierswa2009-08-171-1/+1
| | | | | | | | | Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in POSIX.1-2008. Replaced with memmove,memset,strchr and strrchr. Signed-off-by: Daniel Mierswa <impulze@impulze.org>
* build-sys: rename to _execdirKarel Zak2009-07-041-1/+1
| | | | | | | | | | | | The variable name "usrlibexecdir" is very confusing (because we have /usr/libexec). The "exec" prefix is required for user-defined directories, see http://www.gnu.org/software/hello/manual/automake/The-Two-Parts-of-Install.html#The-Two-Parts-of-Install This patch renames all usr*execdir variables to usr*_execdir. Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: use ioctls from lib/blkdev.cKarel Zak2009-02-261-75/+13Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: (and partx) remove BLKGETLASTSECTKarel Zak2009-02-261-38/+1Star
| | | | | | This odd ioctl is unsupported in the current 2.4 and 2.6 mainline. Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: don't duplicate lib/blkdev.c codeKarel Zak2009-02-261-5/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: convert hard sector size to 512-byte sectorsKarel Zak2009-02-263-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The msdos PT depends on a sector size (BLKSSZGET), but partx(8) counts internally with 512-byte sectors only. The dos.c has to convert start and size to 512-byte sectors. sysfs (kernel uses 512-byte sectors only): # cat /sys/block/sdb/sdb1/{start,size} 256 16128 (note that 16128 * 512 = 8257536; 8Mb) old version: # partx /dev/sdb 1: 32- 2047 ( 2016 sectors, 1 MB) ^^^^ start, end and sectors are correct, but in 4KiB sectors The size in MB is completely wrong. new version: # partx -l /dev/sdb 1: 256- 16383 ( 16128 sectors, 8 MB) start, end and sectors are converted to 512-byte sectors. The size in MB is correct now. Note that this change is important, because "partx -a" counts the size of a new partition in 512-byte sectors for all PT formats (sun, gpt, ...). Signed-off-by: Karel Zak <kzak@redhat.com>
* addpart: 512-byte sectors in code, bytes in man-pageKarel Zak2009-02-261-2/+2
| | | | | | | | | The addpart.c code uses 512-byte sectors for partition start and length, but in the addpart.8 man page is "in bytes". The code (and this code is pretty old) is always right... the man page has to be fixed. Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: don't redeclare daddr_tmaximilian attems2008-09-161-2/+1Star
| | | | | | | | klibc porting fix, use proper include, nuke redefinition. solaris.c:8: error: redefinition of typedef ‘daddr_t’ /usr/lib/klibc/include/sys/types.h:29: error: previous declaration of ‘daddr_t’ was here Signed-off-by: maximilian attems <max@stro.at>
* build-sys: update .gitignore filesKarel Zak2008-04-141-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* partx: fix compiler warningsKarel Zak2008-03-205-7/+7
| | | | | | | dos.c:44: warning: pointer targets in assignment differ in signedness dos.c:93: warning: pointer targets in assignment differ in signedness Signed-off-by: Karel Zak <kzak@redhat.com>
* remove useless if-before-free tests.Jim Meyering2008-03-122-6/+4Star
| | | | | | | | | | | | | | | | E.g., in this example, the "if (p)" test is useless. if (p) free (p); I've been removing such tests systematically. Here's where I proposed it to the git folks, along with justification for why it's ok to perform this transformation, these days (no one uses SunOS4 anymore): http://thread.gmane.org/gmane.comp.version-control.git/74187 Signed-off-by: Jim Meyering <meyering@redhat.com>