installer: add gpt support.

This commit is contained in:
Arne Fitzenreiter
2014-01-30 00:20:26 +01:00
parent 11a47ed33b
commit 4f26ff7f66
2 changed files with 9 additions and 1 deletions

View File

@@ -0,0 +1 @@
../packages/parted

View File

@@ -372,7 +372,14 @@ int main(int argc, char *argv[])
fclose(handle);
snprintf(commandstring, STRING_SIZE, "/sbin/sfdisk -L -uM %s < /tmp/partitiontable", hdparams.devnode_disk);
if (disk < 2097150) {
// <2TB use sfdisk and normal mbr
snprintf(commandstring, STRING_SIZE, "/sbin/sfdisk -L -uM %s < /tmp/partitiontable", hdparams.devnode_disk);
} else {
// >2TB use parted with gpt
snprintf(commandstring, STRING_SIZE, "/usr/sbin/parted -s %s mklabel gpt mkpart boot ext2 1M 64M mkpart swap linux-swap 64M 1000M mkpart root ext4 1000M 5000M mkpart var ext4 5000M 100%% disk_set pmbr_boot on", hdparams.devnode_disk);
}
if (runcommandwithstatus(commandstring, ctr[TR_PARTITIONING_DISK]))
{
errorbox(ctr[TR_UNABLE_TO_PARTITION]);