summaryrefslogtreecommitdiffstats
path: root/fdisks/sfdisk.c
Commit message (Collapse)AuthorAgeFilesLines
* build-sys: ove fdisks to disk-utilsKarel Zak2014-03-111-3230/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: merge partname.cKarel Zak2014-03-111-1/+44
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: fix y/n mismatchKarel Zak2013-09-171-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: remove common.hKarel Zak2013-09-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: move mbr code to the libraryKarel Zak2013-09-161-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: assigned value is never read [clang-analyzer]Sami Kerola2013-07-091-1/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sfdisk: make unhiding as complete as possibleSami Kerola2013-07-091-1/+2
| | | | | | | | | | | | It is unlikely anyone will ever need this, but I like idea commands being complete. The partition id's that can be unhide after this change are; Hidden HPFS/NTFS Hidden W95 FAT32 Hidden W95 FAT32 (LBA) Hidden W95 FAT16 (LBA) Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sfdisk: fix typoKarel Zak2013-07-011-1/+1
| | | | | Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: clean up unhide codeKarel Zak2013-07-011-6/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: replace my_warn() with warnx()Sami Kerola2013-07-011-119/+104Star
| | | | | | | | | | | | | This change adds program name in front of error messages. Often that helps user to know which command sent message, when the command is executed as part of script. Unfortunately the prefixing can break scripts, as someone might have wrote automation which expects output in the format it has always been. In programmer terms, the change has an ABI change, which some may find annoying. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sfdisk: use program_invocation_short_name to determine program nameSami Kerola2013-07-011-7/+2Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sfdisk: clean up usage() functionsSami Kerola2013-07-011-21/+18Star
| | | | | | Includes removal of unhide usage function, which was never implemented. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sfdisk: use libc error printing function, and symbolic exit valuesSami Kerola2013-07-011-77/+43Star
| | | | | | | | The commit removes all references to perror(), and replaces them with either warn() or err(). References: http://marc.info/?l=util-linux-ng&m=137060043804592&w=2 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sfdisk: don't call BLKRRPART for non-block devicesKarel Zak2013-05-201-4/+6
| | | | | Reported-by: Bertrand Jacquin <beber@meleeweb.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: check writing to a file descriptor was successfulSami Kerola2013-04-261-7/+23
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* various: fix variable and function declarations [smatch scan]Sami Kerola2013-04-091-4/+4
| | | | | | | | | | | | | | | | | disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code fdisks/sfdisk.c:982:5: warning: mixing declarations and code fdisks/sfdisk.c:1254:5: warning: mixing declarations and code fdisks/sfdisk.c:1564:5: warning: mixing declarations and code lib/mbsalign.c:279:7: warning: mixing declarations and code libblkid/src/devname.c:378:17: warning: mixing declarations and code libfdisk/src/alignment.c:219:9: warning: mixing declarations and code term-utils/wall.c:111:9: warning: mixing declarations and code text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks' text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line' text-utils/rev.c:105:9: warning: mixing declarations and code text-utils/tailf.c:245:9: warning: mixing declarations and code Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: use UTIL_LINUX_VERSION everywhereKarel Zak2013-01-251-2/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: fix aliasing warningsMike Frysinger2012-10-101-4/+6
| | | | | | Compiles down to the same code. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* fdisk: add GPT supportDavidlohr Bueso2012-09-271-25/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows fdisk to handle GUID partition tables, based on the latest UEFI specifications version 2.3.1, from June 27th, 2012. The following operations are supported: - Probing (detects both protective and hybrid MBRs) - Writing to disk - Listing used partitions - Adding partitions - Deleting partitions - Data integrity verifications (for both headers and partitions). A few considerations: - Currently we do not fix invalid primary headers -- we just abort! - Header checksums are updated upon every change (ie: add/delete partitions), this allows us to mathematically verify the changes on-the-fly, and not only when writing to disk, like most other related tools do. - We are extremly picky when writing to disk, any error aborts the opeartion. - When creating a new partition, the following GUIDs are available: http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs For test cases, the gpt.img from libblkid tests, scsi_debug and my own hard drive (/dev/sda) were used. For the image, all operations were tested successfully, and for /dev/sda all except write, which was not tested - hey, I'm not suicidal! [kzak@redhat.com: - add get/set partition type functions - use unified on strings based table for partition types - add partition type to table list function] Tested-and-reviewed-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: move partition types to label specific partKarel Zak2012-09-271-1/+10
| | | | | | | | | | - move MBR partition types to dos_part_types.h - make dos_part_types.h independent on datetypes to keep it useful in all fdisks - add struct fdisk_parrtype - move label specific partition types to context->label Signed-off-by: Karel Zak <kzak@redhat.com>
* sfdisk: Fix format specifiers for size_tThierry Reding2012-09-211-2/+2
| | | | | | | The proper specifier for size_t is %zu. %lu will work fine on 64-bit architectures but not on 32-bit. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
* mark expected fallthrough for static analysersKarel Zak2012-09-071-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fix buffer overrun in some calls to sscanfKarel Zak2012-07-091-1/+1
| | | | | Reported-by: Sergei Antonov <saproj@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: rename fdisk -> fdisks/, convert to moduleKarel Zak2012-06-261-0/+3242
Signed-off-by: Karel Zak <kzak@redhat.com>