fdisk_common = i386_sys_types.c common.h gpt.c gpt.h \
$(top_srcdir)/lib/blkdev.c $(top_srcdir)/lib/wholedisk.c \
- $(top_srcdir)/lib/mbsalign.c
+ $(top_srcdir)/lib/mbsalign.c $(top_srcdir)/lib/strutils.c
if LINUX
fdisk_common += $(top_srcdir)/lib/linux_version.c
#include "wholedisk.h"
#include "pathnames.h"
#include "canonicalize.h"
+#include "strutils.h"
#include "fdisksunlabel.h"
#include "fdisksgilabel.h"
p->sys_ind = sysid;
set_start_sect(p, start - offset);
set_nr_sects(p, stop - start + 1);
+
+ if (!doext)
+ print_partition_size(i + 1, start, stop, sysid);
+
if (dos_compatible_flag && (start/(sectors*heads) > 1023))
start = heads*sectors*1024 - 1;
set_hsc(p->head, p->sector, p->cyl, start);
return start;
}
+void print_partition_size(int num, unsigned long long start, unsigned long long stop, int sysid)
+{
+ char *str = size_to_human_string(SIZE_SUFFIX_3LETTER | SIZE_SUFFIX_SPACE,
+ (stop - start + 1) * sector_size);
+ printf(_("Partition %d of type %s and of size %s is set\n"), num, partition_type(sysid), str);
+ free(str);
+}
+
static void
add_partition(int n, int sys) {
char mesg[256]; /* 48 does not suffice in Japanese */
extern int valid_part_table_flag(unsigned char *b);
extern unsigned int read_int(unsigned int low, unsigned int dflt,
unsigned int high, unsigned int base, char *mesg);
+extern void print_partition_size(int num, unsigned long long start, unsigned long long stop, int sysid);
extern unsigned char *MBRbuffer;
extern void zeroize_mbr_buffer(void);
set_changed(i);
if (sgi_gaps() < 0) /* rebuild freelist */
printf(_("Do You know, You got a partition overlap on the disk?\n"));
+ if (length)
+ print_partition_size(i + 1, start, start + length, sys);
}
static void
old[i].sysid = get_part_table(i)->sys_ind;
old[i].start = get_start_sect(get_part_table(i));
old[i].nsect = get_nr_sects(get_part_table(i));
- printf(_("Trying to keep parameters of partition %d.\n"), i);
if (debug)
printf(_("ID=%02x\tSTART=%d\tLENGTH=%d\n"),
old[i].sysid, old[i].start, old[i].nsect);
}
}
+ for (i = 0; i < 4; i++)
+ if (old[i].sysid) {
+ printf(_("Trying to keep parameters of partitions already set.\n"));
+ break;
+ }
+
zeroize_mbr_buffer();
sgilabel->magic = SSWAP32(SGI_LABEL_MAGIC);
sgilabel->boot_part = SSWAP16(0);
sunlabel->partitions[i].num_sectors =
SSWAP32(stop - start);
set_changed(i);
+ print_partition_size(i + 1, start, stop, sysid);
}
void sun_nolabel(void)
} else
ndiv = cylinders * 2 / 3;
+ /* Make sure print_partition_size() uses correct sysid names */
+ disklabel = SUN_LABEL;
+
set_sun_partition(0, 0, ndiv * heads * sectors,
SUN_TAG_LINUX_NATIVE);
set_sun_partition(1, ndiv * heads * sectors,