Specify minimal size in bytes used to calculate partitions alignment. The
default is 1MiB and it's strongly recommended to use the default. Do not
modify this variable if you're not sure.
+.TP
+.B sector-size
+Specify sector size. This header is informative only and it is not used when
+sfdisk creates a new partition table, in this case the real device specific
+value is always used and sector size from the dump is ignored.
.RE
.sp
Note that it is only possible to use header lines before the first partition
struct fdisk_label *lb;
int rc;
char *p = NULL;
+ char buf[64];
if (!dp || (!cxt && !dp->cxt))
return -EINVAL;
if (!rc && fdisk_is_label(cxt, GPT)) {
struct fdisk_labelitem item = FDISK_LABELITEM_INIT;
- char buf[64];
/* first-lba */
rc = fdisk_get_disklabel_item(cxt, GPT_LABELITEM_FIRSTLBA, &item);
}
if (!rc && fdisk_get_grain_size(cxt) != 2048 * 512) {
- char buf[64];
-
snprintf(buf, sizeof(buf), "%lu", fdisk_get_grain_size(cxt));
rc = fdisk_script_set_header(dp, "grain", buf);
}
+ if (!rc) {
+ snprintf(buf, sizeof(buf), "%lu", fdisk_get_sector_size(cxt));
+ rc = fdisk_script_set_header(dp, "sector-size", buf);
+ }
DBG(SCRIPT, ul_debugobj(dp, "read context done [rc=%d]", rc));
return rc;
} else if (strcmp(name, "last-lba") == 0) {
name = "lastlba";
num = 1;
+ } else if (strcmp(name, "sector-size") == 0) {
+ name = "sectorsize";
+ num = 1;
} else if (strcmp(name, "label-id") == 0)
name = "id";