fdisk: many significant improvements and fixes to Sun label handling
1) Properly describe the exact layout and fields of the sun disk
label. Several fields were incorrectly mentioned and others
wrongly sized.
2) Properly set the version, sane, and num_partitions fields.
Because we weren't doing this, programs such as Solaris's format
and the Solaris kernel itself refused to recognize our disk labels
as valid.
3) Move SSWAP*() macros into fdisksunlabel.c as there is no reason
for them to be exposed to the rest of fdisk.
4) Kill the sun_predefined_drives array hack and assosciated code.
Instead size the disk and figure out the geometry properly just
like the SGI and MSDOS partition handling do, by means of the
HD_GETGEO ioctl() and disksize().
5) If the disk label read is found to not have the proper values
set in version, sane, or num_partitions, fix them, recompute the
label checksum, dirty the disk label, and let the user know what
we did and that the fixed values will be written out if they 'w'.
This gives users an easy way to fix up disk labels created by
disk labelling programs which had this bug.
6) Create a sun_sys_getid() function so that fdisk.c does not need
to reference the sun disk label details directly, just like the
SGI code does.
Signed-off-by: David S. Miller <davem@davemloft.net>