summaryrefslogtreecommitdiffstats
path: root/fdisks/fdisk.c
diff options
context:
space:
mode:
authorKarel Zak2012-07-23 10:56:06 +0200
committerKarel Zak2012-07-23 10:56:06 +0200
commita71601af2769cc256341b85414065e13377671d7 (patch)
treeca984e880a6a086f2009e0e2fcc0d5a90c666f52 /fdisks/fdisk.c
parentfdisk: move user geometry setting from fdisk.c to API (diff)
downloadkernel-qcow2-util-linux-a71601af2769cc256341b85414065e13377671d7.tar.gz
kernel-qcow2-util-linux-a71601af2769cc256341b85414065e13377671d7.tar.xz
kernel-qcow2-util-linux-a71601af2769cc256341b85414065e13377671d7.zip
fdisk: get_boot() has to die (step I.)
- move generic stuff around "create disklabel" operation to API Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdisk.c')
-rw-r--r--fdisks/fdisk.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c
index a7787c6a2..e24dd3bf4 100644
--- a/fdisks/fdisk.c
+++ b/fdisks/fdisk.c
@@ -523,14 +523,6 @@ static int get_boot(struct fdisk_context *cxt, int try_only) {
if (disklabel == ANY_LABEL) {
if (try_only)
return -1;
-
- fprintf(stderr,
- _("Device does not contain a recognized partition table\n"));
-#ifdef __sparc__
- create_sunlabel(cxt);
-#else
- create_doslabel(cxt);
-#endif
}
return 0;
}
@@ -2072,7 +2064,12 @@ int main(int argc, char **argv)
cxt->sector_size, DEFAULT_SECTOR_SIZE);
gpt_warning(cxt->dev_path);
- get_boot(cxt, 0);
+
+ if (!fdisk_dev_has_disklabel(cxt)) {
+ fprintf(stderr,
+ _("Device does not contain a recognized partition table\n"));
+ fdisk_create_default_disklabel(cxt);
+ }
command_prompt(cxt);