diff options
author | Karel Zak | 2014-10-09 13:03:52 +0200 |
---|---|---|
committer | Karel Zak | 2014-10-09 13:03:52 +0200 |
commit | 8f48195846a83f309ef79a1185eb5df42e8b5451 (patch) | |
tree | 4b9324722fb5850f1d0aba3e7243ac4a4f712591 | |
parent | sfdisk: ask on EOF (diff) | |
download | kernel-qcow2-util-linux-8f48195846a83f309ef79a1185eb5df42e8b5451.tar.gz kernel-qcow2-util-linux-8f48195846a83f309ef79a1185eb5df42e8b5451.tar.xz kernel-qcow2-util-linux-8f48195846a83f309ef79a1185eb5df42e8b5451.zip |
libfdisk: cleanup script dump
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | libfdisk/src/script.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c index 1b0d2898f..556c032c9 100644 --- a/libfdisk/src/script.c +++ b/libfdisk/src/script.c @@ -394,7 +394,7 @@ int fdisk_script_write_file(struct fdisk_script *dp, FILE *f) if (devname) p = fdisk_partname(devname, pa->partno + 1); if (p) - fprintf(f, "%s : ", p); + fprintf(f, "%s :", p); else fprintf(f, "%zu :", pa->partno + 1); @@ -412,8 +412,14 @@ int fdisk_script_write_file(struct fdisk_script *dp, FILE *f) fprintf(f, ", uuid=%s", pa->uuid); if (pa->name && *pa->name) fprintf(f, ", name=\"%s\"", pa->name); - if (pa->attrs) - fprintf(f, ", attrs=\"%s\"", pa->attrs); + + /* for MBR attr=80 means bootable */ + if (pa->attrs) { + struct fdisk_label *lb = script_get_label(dp); + + if (!lb || fdisk_label_get_type(lb) != FDISK_DISKLABEL_DOS) + fprintf(f, ", attrs=\"%s\"", pa->attrs); + } if (pa->boot) fprintf(f, ", bootable"); fputc('\n', f); |