Commit Graph

789 Commits

Author SHA1 Message Date
Karel Zak 01b207133e libfdisk: add support for nested contexts
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:57 +01:00
Karel Zak c6d69264d0 libfdisk: improve fdisk_ask_partnum()
.. to don't ask is there is only one choice.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:57 +01:00
Karel Zak 225592d4a3 libfdisk: add disk_partition_is_used()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:57 +01:00
Karel Zak fb1caca70a libfdisk: add fdisk_partition_toggle_flag()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:57 +01:00
Karel Zak cb7ce873a5 libfdisk: add info about display units to context
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:57 +01:00
Karel Zak ccf48af540 libfdisk: add Yes/No to Ask API
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:56 +01:00
Karel Zak 24fc19a11e libfdisk: add wrapper to ask for numbers
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:55 +01:00
Karel Zak 83df5feb98 fdisk: (gpt) use fdisk_{warn,warx,info} functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:55 +01:00
Karel Zak ab6ea0e8f2 libfdisk: add info, warn and wanx Ask API
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:55 +01:00
Karel Zak 4114da08d0 libfdisk: extend "ask" API, add support for offsets
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:55 +01:00
Karel Zak 7845ca8dc2 libfdisk: add "ask" interface
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:54 +01:00
Karel Zak 46667ba4a5 libfdisk: fix gpt status, don't use xcalloc() in library
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:54 +01:00
Karel Zak 58d62d2f7e libfdisk: add stuff for unit tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:54 +01:00
Karel Zak 251d908831 libfdisk: (gpt) fix compiler warnings [-Wformat]
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:54 +01:00
Karel Zak baa7cccc3a libfdisk: add FDISK_LABEL_FL_ADDPART_NOPARTNO
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:54 +01:00
Karel Zak 9ffeb235d6 fdisk: remove fdisk_label from API functions, add asserts, use size_t
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:54 +01:00
Karel Zak 62d50bbe03 libfdisk: (gpt) move code from fdisk to libfdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:56:21 +01:00
Karel Zak 47b8e7c002 libfdisk: add part_get_status operation
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:31 +01:00
Karel Zak fcf8880029 libfdisk: cleanup fdisk_get_partition_type() returns
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:31 +01:00
Karel Zak 2e3b40d3dd libfdisk: add label->changed flag
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:30 +01:00
Karel Zak 9fcd49d551 libfdisk: (gpt) introduce driver independent partitions counters
label->nparts_{max,cur} to later replace global variable partitions

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:29 +01:00
Karel Zak d71ef5a442 fdisk: (gpt) remove global variables, cleanup header verification
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:29 +01:00
Karel Zak 53b422ab16 libfdisk: move label identifier to label struct
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:29 +01:00
Karel Zak 8a95621d30 libfdisk: add fdisk_label to driver API
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:29 +01:00
Karel Zak 0559e742a9 libfdisk: improve label deinitialization
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:29 +01:00
Karel Zak 852ce62b42 libfdisk: kill dos_compatible_flag global variable
... move the variable to label private struct.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:29 +01:00
Karel Zak 4e0e82531a libfdisk: add fdisk_new_context(), reuse context
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:29 +01:00
Karel Zak 0c5d095e46 libfdisk: split label and label operations
Changes:

 - fdisk_label is a private label driver struct
 - generic header of the fdisk_label points to fdisk_label_operations
 - the private fdisk_label stuff is always allocated for all drivers
   during fdisk_context initialization

 - context->labels[] contains pointers to all supported labels (drivers)
 - context->label is a pointer to the currently used label

 This change allows to:

 - store label specific global settings (e.g. dos compatible mode,
   display units, ...) independently on the current label

 - add label specific function to the API

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:29 +01:00
Karel Zak 171372d37c libfdisk: cleanup the rest of fdisks/utils.c stuff
- remove obsolete code
 - move fdisk_{set,get}_partition_type() to label.c (this is label
   driver operation)

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:28 +01:00
Karel Zak f4be9e2b99 libfdisk: add context functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:46:37 +01:00
Karel Zak 7ce1097533 libfdisk: add probing function
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:41 +01:00
Karel Zak c578f9af72 libfdisk: add fdisk_reset_alignment()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:41 +01:00
Karel Zak aa42788d5f libfdisk: add topology and geometry functions
- rename __discovery_* to fdisk_discovery_*
 - rename fdisk_context_force_sector_size() to fdisk_override_sector_size()
 - rename fdisk_context_set_user_geometry() to fdisk_override_geometry()

 - remove non-default sector size warning

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:41 +01:00
Karel Zak 3eb78aa745 libfdisk: add firstsector utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:41 +01:00
Karel Zak 8adbcf0ce9 libfdisk: add generic label code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:40 +01:00
Karel Zak 9475cc78ff libfdisk: add alignment code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:40 +01:00
Karel Zak a5fe1b3f1d libfdisk: add parttype code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:40 +01:00
Karel Zak a8019843ab libfdisk: add basic structs
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:40 +01:00
Karel Zak d56a7c2330 libfdisk: add basic library files
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:40 +01:00