Commit graph

94 commits

Author SHA1 Message Date
Karel Zak
1a9889ad7f fdisk: (sgi) cleanu sgi_info stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:57 +02:00
Karel Zak
1653f0b0c2 libfdisk: make it possible to reset device properties
- remember user C/H/S and sector size
 - reset all device properties before create a new label (maybe the
   old setting has been affected by previous on-disk label)
 - always apply user setting after the reset
 - improve topology/geometry debug messages

Note that for fdisk "user C/H/S and sector size" means on command line
specified values. If you override the setting by c/h/s commands in
expert menu then the setting is applied to the current disk label
only. If you create a new disk label (e.g change MBR to GPT) then
fdisk will use the original setting.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:57 +02:00
Karel Zak
9f2809033e fdisk: move sun commands to sun menu callback
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:56 +02:00
Karel Zak
8e40a677bd fdisk: add functions to geometry menu
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:56 +02:00
Karel Zak
4170ae9cbd libfdisk: clean up sun geometry stuff
- move fdisk_sun_set_* functions to public API file
 - remove extra function to set ncyl -- this has to follow regular
   geo.cylinders
 - set alternative cylinders to zero (to be compatible with parted)
 - it seems that the previous code completely ignored relation between
   geo.cylinders, sunlabel->acyl and sunlabel->ncyl.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:56 +02:00
Karel Zak
b9e94cd7f8 fdisk: add GPT specific callback to menu
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:56 +02:00
Karel Zak
a410f8df0f fdisk: use new menu infrastructure to verify keys
- use generic function to ask for key
 - verify the key against the current menu
 - call menu callback if defined

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:56 +02:00
Karel Zak
74fcee985d fdisk: use remove read_int() usage from fdisk.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:56 +02:00
Karel Zak
287ce9ed6c fdisk: make internal command line case sensitive
Hey, this is Linux, year 2013...

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak
39f01b7b2b fdisk: use new menus
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak
67dac5c5a3 fdisk: (gpt) add t, v and x to menu
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak
ad3b5e74ba fdisk: revert add 'G' to create SGI label to the main menu
'G' does not make sense, fdisk menus are case insensitive. Yes...

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:55 +02:00
Karel Zak
414b6b0f90 fdisk: always allow 'p'rint command in expert menu
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:54 +02:00
Karel Zak
d87c7ce2bf fdisk: add asktype "string" and support UUID partition change
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:54 +02:00
Karel Zak
b4bfbaddfa libfdisk: (sun) move driver from fdisk to library
... and also add fdisk_info_new_partition()

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:54 +02:00
Karel Zak
b1b1a7b7e2 fdisk: (sun) consolidate 'p'rint output
* use label operation list()
 * use generic fdisk geometry output for sun
 * don't duplicate geometry information

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:53 +02:00
Karel Zak
a5c1b0fa20 libfdisk: add fdisk_context_enable_details()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:53 +02:00
Karel Zak
3c5fb4757f libfdisk: add list() label operation
... and use it for GPT

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-16 16:46:53 +02:00
Karel Zak
76b86412c6 fdisk: don't use ptes[] in generic code
... the array is MBR specific.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-06-12 17:39:09 +02:00
Karel Zak
76f17cf260 fdisk: fix list types
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-18 14:38:49 +02:00
Karel Zak
d23c661c47 fdisk: no more AIX "support"
The whole AIX support in fdisk has been limited to pretty poor AIX
magic string detection and warning that the AIX is unsupported. It's
too expensive to maintain such fdisk driver.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-12 11:37:33 +01:00
Karel Zak
b4fb2a6110 fdisk: (bsd) support non-nested version too
note that btrydev() should be unnecessary, regular list_table()
should be enough for all types.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 15:56:05 +01:00
Karel Zak
641a75ca99 fdisk: use fdisk_ask_partnum() everywhere
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:58 +01:00
Karel Zak
e09435aa53 fdisk: (bds) use nested partition table
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:58 +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
2b0bc17b64 fdisk: (sun) use fdisk_ prefix for label specific public functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:57 +01:00
Karel Zak
ec10aa6782 fdisk: remove global unit variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:57 +01:00
Karel Zak
bbc41eebda fdisk: sort menu
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:56 +01:00
Karel Zak
7375423cda fdisk: add 'G' to create SGI label to the main menu
For unknown reason you have to go to the expert menu to create SGI
label.  It's inconsistent behavior as we have all "create label"
operations in the main menu.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 13:00:56 +01:00
Karel Zak
416c43a9a5 fdisk: add callback for ask-numbers API
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
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
e3661531e6 fdisk: (dos) kill 'partitions' global variable
... and use size_t for partition numbers

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:31 +01:00
Karel Zak
e76d577627 fdisk: (dos) move 'toggle active' code to fdiskdoslabe.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:31 +01:00
Karel Zak
cc0c4e56aa fdisk: (dos) move dos specific code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:31 +01:00
Karel Zak
2b18633f51 fdisk: remove dead code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:31 +01:00
Karel Zak
5dfca6343b fdisk: (dos) move dos_list_table_expert() to fdiskdoslabe.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:30 +01:00
Karel Zak
71ee484e0b fdisk: (dos) move 'move begin' code to fdiskdoslabe.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:30 +01:00
Karel Zak
dfc96cbf1f fdisk: (dos) move fix order code to fdiskdoslabe.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:30 +01:00
Karel Zak
6d864a495c fdisk: (dos) move list table code to fdiskdoslabe.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:30 +01:00
Karel Zak
bddd84e7c5 fdisk: use libfdisk label->changed
The patch is huge because it's necessary to add a pointer context to
all read_<foo> functions.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 12:47:30 +01:00
Karel Zak
d6ab93f18a fdisk: (sun) remove nasty sunlabel macro
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
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
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
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
9475cc78ff libfdisk: add alignment code
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:40 +01:00
Karel Zak
512a430fe7 fdisk: (gpt) align newly created partitions
- default "First sector" has to be aligned
 - "Last sector" has to be aligned if specified by +<size><suffix> convention

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-04 17:54:15 +01:00