- remove all label specific partition type stuff from fdisk.c to
label files
- add new fdisk_set_partition_type() to API
Signed-off-by: Karel Zak <kzak@redhat.com>
- add flags to fdisk_parttype to store more information about the types
- function for conversion from code to fdisk_parttype
- function for conversion from string to fdisk_parttype
- function for conversion from user input to fdisk_parttype
- support for unknown complex types (e.g. unknown UUIDs)
Signed-off-by: Karel Zak <kzak@redhat.com>
- 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>
There is no reason for this to be global variable - it belongs
to the context.
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
... because it's not expected that fdisk_label will be exported by
API and accessible for applications (like fdisk.c). It's private
libfdisk stuff.
This reverts commit e781864260.
Note that +10MB is 100000 (10^N) and relative values (+<size>
convention) should be be aligned to the default grain (= 1 MiB).
Old version:
Last sector, +sectors or +size{K,M,G} (2048-2047999, default 2047999): +10MB
Partition 1 of type Linux and of size 9.5 MiB is set
...
/dev/loop0p1 2048 21578 9765+ 83 Linux
/dev/loop0p2 21579 43062 10742 83 Linux
New version:
Last sector, +sectors or +size{K,M,G} (2048-2047999, default 2047999): +10MB
Partition 1 of type Linux and of size 10 MiB is set
...
/dev/loop0p1 2048 22527 10240 83 Linux
/dev/loop0p2 22528 43007 10240 83 Linux
Addresses: http://thread.gmane.org/gmane.linux.kernel.device-mapper.dm-crypt/5913/focus=5929
Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The context structure is the fdisk API's main data type as it keeps all data
together. Add the label structure to it, so that the pt-specific operations can
be called from the context.
[kzak@redhat.com: - merge with latest changes
- don't allocate the label, use const pointer]
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* 2012wk28:
translation: unify file open error messages
translation: unify stat error messages
utmpdump: use help and version output macros
su: align with howto-usage-function
fdisk: make if clause easier to read
look: remove extra semicolon
utmpdump: remove unused variable
swapon: remove unused variables
lib/loopdev: minor bug fix: add missing semicolon
lib/pager: minor compiler warning fixes
libblkid: remove duplicate entries in symbols
This patch sets the initial layout for label specific operations. A
new fdisk_label structure is created that will hold all these ops,
like new, delete, write and probe, among others. For now only probing
is implemented. Once this design is established, a copy of the probed
label will be copied to the main context structure, where calling the
specific functions will save 'disklabel' checks. Debugging support is
added as well.
This patch passes regression tests and manually passes bsd, sun, dos
and sgi labels probes.
Reviewed-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Davidlohr Bueso <dave@gnu.org>