diff options
author | Karel Zak | 2014-10-03 14:47:05 +0200 |
---|---|---|
committer | Karel Zak | 2014-10-07 14:55:33 +0200 |
commit | a8a4887bcd9def0bf912c41f8b314993565d10ad (patch) | |
tree | 625b54c278a001b273ca9e750406fbf39c98bb4f /libfdisk/src/sun.c | |
parent | fdisk: fix typo (diff) | |
download | kernel-qcow2-util-linux-a8a4887bcd9def0bf912c41f8b314993565d10ad.tar.gz kernel-qcow2-util-linux-a8a4887bcd9def0bf912c41f8b314993565d10ad.tar.xz kernel-qcow2-util-linux-a8a4887bcd9def0bf912c41f8b314993565d10ad.zip |
libfdisk: fix sun and sgi to be usable from sfdisk
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/sun.c')
-rw-r--r-- | libfdisk/src/sun.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libfdisk/src/sun.c b/libfdisk/src/sun.c index 48ab7dc1c..f9f1d472f 100644 --- a/libfdisk/src/sun.c +++ b/libfdisk/src/sun.c @@ -261,16 +261,19 @@ static int sun_create_disklabel(struct fdisk_context *cxt) } else ndiv = cxt->geom.cylinders * 2 / 3; - set_partition(cxt, 0, 0, ndiv * cxt->geom.heads * cxt->geom.sectors, + /* create the default layout only if no-script defined */ + if (!cxt->script) { + set_partition(cxt, 0, 0, ndiv * cxt->geom.heads * cxt->geom.sectors, SUN_TAG_LINUX_NATIVE); - set_partition(cxt, 1, ndiv * cxt->geom.heads * cxt->geom.sectors, + set_partition(cxt, 1, ndiv * cxt->geom.heads * cxt->geom.sectors, cxt->geom.cylinders * cxt->geom.heads * cxt->geom.sectors, SUN_TAG_LINUX_SWAP); - sunlabel->vtoc.infos[1].flags |= cpu_to_be16(SUN_FLAG_UNMNT); + sunlabel->vtoc.infos[1].flags |= cpu_to_be16(SUN_FLAG_UNMNT); - set_partition(cxt, 2, 0, + set_partition(cxt, 2, 0, cxt->geom.cylinders * cxt->geom.heads * cxt->geom.sectors, SUN_TAG_WHOLEDISK); + } { unsigned short *ush = (unsigned short *)sunlabel; |