summaryrefslogtreecommitdiff
path: root/fdisks/sfdisk.c
AgeCommit message (Collapse)AuthorFilesLines
2013-09-17sfdisk: fix y/n mismatchKarel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16fdisk: remove common.hKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16libfdisk: move mbr code to the libraryKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-07-09sfdisk: assigned value is never read [clang-analyzer]Sami Kerola1-1/+1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-09sfdisk: make unhiding as complete as possibleSami Kerola1-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>
2013-07-01sfdisk: fix typoKarel Zak1-1/+1
Reported-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-07-01sfdisk: clean up unhide codeKarel Zak1-6/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-07-01sfdisk: replace my_warn() with warnx()Sami Kerola1-119/+104
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>
2013-07-01sfdisk: use program_invocation_short_name to determine program nameSami Kerola1-7/+2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-01sfdisk: clean up usage() functionsSami Kerola1-21/+18
Includes removal of unhide usage function, which was never implemented. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-01sfdisk: use libc error printing function, and symbolic exit valuesSami Kerola1-77/+43
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>
2013-05-20sfdisk: don't call BLKRRPART for non-block devicesKarel Zak1-4/+6
Reported-by: Bertrand Jacquin <beber@meleeweb.net> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-26sfdisk: check writing to a file descriptor was successfulSami Kerola1-7/+23
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09various: fix variable and function declarations [smatch scan]Sami Kerola1-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>
2013-01-25textual: use UTIL_LINUX_VERSION everywhereKarel Zak1-2/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-10sfdisk: fix aliasing warningsMike Frysinger1-4/+6
Compiles down to the same code. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-09-27fdisk: add GPT supportDavidlohr Bueso1-25/+0
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>
2012-09-27fdisk: move partition types to label specific partKarel Zak1-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>
2012-09-21sfdisk: Fix format specifiers for size_tThierry Reding1-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>
2012-09-07mark expected fallthrough for static analysersKarel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-09fix buffer overrun in some calls to sscanfKarel Zak1-1/+1
Reported-by: Sergei Antonov <saproj@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-26build-sys: rename fdisk -> fdisks/, convert to moduleKarel Zak1-0/+3242
Signed-off-by: Karel Zak <kzak@redhat.com>