Added two sanity checks:

.  partitions larger than the disk
	   (this happens when partitions are set to end earlier than they start
	   in part)
	.  zero-sized partitions (this confuses autopart later on)

autopart doesn't continue if this happens.
This commit is contained in:
Ben Gras 2005-08-22 09:54:31 +00:00
parent a01645b788
commit 0ab4039806

View file

@ -1794,6 +1794,16 @@ void regionize(void)
exit(1);
}
}
if(table[i].size > table[0].size) {
printf("\nSanity check failed on %s - partition is larger than disk.\n"
"Please use expert mode to correct it.\n", curdev->name);
exit(1);
}
if(table[i].size < 1) {
printf("\nSanity check failed on %s - zero-sized partition.\n"
"Please use expert mode to correct it.\n", curdev->name);
exit(1);
}
/* Remember used region. */
memcpy(&regions[nr_regions].used_part, &table[i], sizeof(table[i]));