summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/sgi.c
Commit message (Collapse)AuthorAgeFilesLines
* docs: fix typos [codespell]Sami Kerola2019-02-181-1/+1
| | | | | Reference: https://github.com/codespell-project/codespell Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libfdisk: Accept negative numbers for last sector inputAwal Garg2018-07-311-0/+1
| | | | | | | | [kzak@redhat.com: - add note to the man page - add '-' to the dialog query - cleanup functions names and libfdisk.sym] Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix compiler warnings [-Wcast-qual]Karel Zak2018-07-231-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix compiler warning [-Wunused-parameter]Karel Zak2018-05-031-3/+1Star
| | | | | Reported-by: L A Walsh <lkml@tlinx.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use memcpy() for non-terminated string [coverity scan]Karel Zak2017-05-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix NLS supportKarel Zak2017-04-251-1/+0Star
| | | | | | | | | | | | | | | | | | | The current libfdisk code uses gettext() to translate strings. It means it follows the default text domain (as set by textdomain(3) usually in the main program). This is useless for public shared library. We have call private bindtextdomain() and use dgettext() with private domain name to be independent on the main program. For this purpose include/nls.h supports UL_TEXTDOMAIN_EXPLICIT to use dgettext(). Note that libfdisk will continue to use util-linux.po, rather than keep the texts in the separate file. The nls.h has to be included only from fdiskP.h to be sure that nls.h works as expected for the library. Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: simplify if clauses [oclint]Sami Kerola2016-07-211-3/+2Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: Fix various typosSebastian Rasmussen2016-05-311-1/+1
| | | | | | | Fix various typos in error messages, warnings, debug strings, comments and names of static functions. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
* libfdisk: remove ifdef HDIO_GETGEORuediger Meier2016-03-071-2/+1Star
| | | | | | We don't use HDIO_GETGEO since e5b5a349. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libfdisk: remove impossible condition [smatch scan]Karel Zak2015-08-051-3/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add new API to read label specific dataKarel Zak2015-06-111-13/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | * removes list() label operation from internal API The list() has been based on fdisk_info() it was useless for anything else than print on stdout... * add a new get_item() label operation and fdisk_get_disklabel_item() public API The new API provides abstract and pretty simple way how to get label specific disk label information, for example fdisk_get_disklabel_item(cxt, GPT_LABELITEM_ENTRIESLBA, &iterm); return LBA of the array with GPT entries. Note that this patch does not implement public functions to get data from the @item object. * removes get_id() label operation -- it's subset of the new get_item() * the new internal API is also used to implement backwardly compatible fdisk_list_disklabel() and fdisk_get_disklabel_id() Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: support bootbits protection from (p)MBRKarel Zak2015-04-131-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: remove 'end' from struct fdisk_partitionKarel Zak2014-12-041-1/+0Star
| | | | | | This struct member duplicate "start+size". Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: rename sector_t to fdisk_sector_tKarel Zak2014-12-041-4/+4
| | | | | | .. just to avoid too generic names for public API. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add API docsKarel Zak2014-11-261-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add docs for SGI functionsKarel Zak2014-11-261-0/+26
|
* libfdisk: remove flags from fdisk_ask APIKarel Zak2014-11-211-4/+2Star
| | | | | | We don't use it for anything usable, lets kill this over-engineering. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add ref.counting to ask APIKarel Zak2014-11-211-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: make it possible to use zero for size and startKarel Zak2014-10-151-4/+4
| | | | | | | | | | | | | | | | The zero may be valid size and start of the partition. This patch introduces: fdisk_partition_has_start() fdisk_partition_has_size() fdisk_partition_unset_size() fdisk_partition_unset_start() to make it possible to work with zero. The feature is internally implemented by magic constant ((type) -1) for undefined sizes and offsets. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix sun and sgi to be usable from sfdiskKarel Zak2014-10-071-6/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sgi) add set_part() APIKarel Zak2014-10-071-32/+48
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: cleanup internal drivers' APIKarel Zak2014-10-071-2/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: return partno when add new partitionKarel Zak2014-10-071-2/+4
| | | | | | | * improve the way how sfdisk report results * the API change simplify applications Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: remove debug dump function, cleanup APIKarel Zak2014-08-221-3/+3
| | | | | | | The fdisk_dump_* prefix will be used for sfdisk-like functionality. The patch also add FDISK_ prefix to fdisk_get_unit() options. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: final parttype API cleanupKarel Zak2014-08-141-10/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: cleanup fdisk_is_label stuffKarel Zak2014-08-131-10/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: clean up API (context.c)Karel Zak2014-08-131-10/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: rename fdisk_column to fdisk_fieldKarel Zak2014-08-131-12/+12
| | | | | | .. to make the API and fdisk(s) code more readable. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: remove dependence on libsmartcolsKarel Zak2014-08-131-9/+8Star
| | | | | | It's application business to convert libfdisk_table to string. Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: fix some typos and inconsistencies in various messagesBenno Schulenberg2014-07-231-1/+1
| | | | | | | | Fixing plain typos, miswordings, inconsistent periods, some missing angular brackets, and a proper pluralization (even when it involves a constant, because for some languages the precise value matters). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk: make first sector buffer usage more robustKarel Zak2014-07-141-1/+5
| | | | | | | | | | | | $ ~/util-linux/fdisk -b 4096 xxx .. Segmentation fault The buffer has to be reinitialized always when we apply a new device properties (e.g. sector size). Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* Use libsmartcols in libfdisk and cfdiskOndrej Oprala2014-04-031-8/+10
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* libfdisk: remove fdisk_colon()Karel Zak2014-04-011-2/+2
| | | | | | | It was unnecessary overkill to have colorized "foo:" prefix in fdisk output. Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use new debug functionsKarel Zak2014-03-211-5/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sgi) cleanup, add infor about whole-disk partitionKarel Zak2014-03-111-43/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: clean up cylinder columnKarel Zak2014-03-111-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use fdisk_table to generate outputKarel Zak2014-03-111-8/+6Star
| | | | | | | | | | | * add generic fdisk_iter iterator * use fdisk_table to convert partition table to human readable output * clean up partition.c API (don't use reference to fdisk_context in fdisk_partition struct) * extern table.c API to use fdisk_iter iterator * remove old fdisk_list_partitions() Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use partition templateKarel Zak2014-03-111-64/+76
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sgi) remove get_partition_type()Karel Zak2014-03-111-38/+37Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sun) use new list() and get_part() APIKarel Zak2014-03-111-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sgi) use new list() and get_part() APIKarel Zak2014-03-111-60/+43Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: add struct fdisk_partitionKarel Zak2014-03-111-13/+6Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: (sgi) generate partname according to partition positionKarel Zak2013-11-191-4/+6
| | | | | | | | | | | | | | | | | | | The SGI drive currently counts only usable partitions, that's wrong as Linux kernel counts all partition to generate partition number. For example: Kernel: sdb 8:16 0 600M 0 disk ├─sdb9 8:25 0 2M 0 part └─sdb11 8:27 0 596.2M 0 part Fdisk: Pt# Device Info Start End Sectors Id System 9: /dev/sdb1 0 4095 4096 0 SGI volhdr 11: /dev/sdb2 0 1220939 1220940 6 SGI volume Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: fix printf stuffKarel Zak2013-10-231-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: equalize four error messages with already existing onesBenno Schulenberg2013-10-141-1/+1
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk/sgi: tweak and harmonize some message stringsBenno Schulenberg2013-10-081-26/+25Star
| | | | | | | | Using consistent capitals and lowercase, adding missing periods and a missing space, repositioning commas for clarity, improving grammar, and aligning substrings for esthetics. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk/sgi: tweak and harmonize some commentsBenno Schulenberg2013-10-081-23/+17Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* libfdisk/sgi: properly pluralize three messagesBenno Schulenberg2013-10-081-12/+20
| | | | | Reported-by: Petr Písař <petr.pisar@atlas.cz> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: fix misspelled words in -rc1Karel Zak2013-09-301-4/+4
| | | | | Reported-by: Rafael Ferreira <rafael.f.f1@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libfdisk: use context geometry in SGI and SUNKarel Zak2013-09-251-32/+23Star
| | | | | | | | * don't call HDIO_GETGEO ioctls in the drivers * use context geometry (so user can overwrite it by -C/H/S options) * use default geometry is ioctl does not return anything Signed-off-by: Karel Zak <kzak@redhat.com>