summaryrefslogtreecommitdiffstats
path: root/libfdisk/src/dos.c
diff options
context:
space:
mode:
authorKarel Zak2017-02-27 13:44:08 +0100
committerKarel Zak2017-02-27 13:44:08 +0100
commit168950e3ce10555fc70ef56451d3dd2d07893965 (patch)
tree2bcecf9f62b756b61d571b77335ad796cce560ab /libfdisk/src/dos.c
parentlibfdisk: add version to debug output (diff)
downloadkernel-qcow2-util-linux-168950e3ce10555fc70ef56451d3dd2d07893965.tar.gz
kernel-qcow2-util-linux-168950e3ce10555fc70ef56451d3dd2d07893965.tar.xz
kernel-qcow2-util-linux-168950e3ce10555fc70ef56451d3dd2d07893965.zip
libfdisk: (dos) add ID related debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/dos.c')
-rw-r--r--libfdisk/src/dos.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
index 69090706a..11946b38c 100644
--- a/libfdisk/src/dos.c
+++ b/libfdisk/src/dos.c
@@ -640,14 +640,19 @@ static int dos_create_disklabel(struct fdisk_context *cxt)
if (s) {
errno = 0;
id = strtol(s, &end, 16);
- if (!errno && end && s < end)
+ if (!errno && end && s < end) {
has_id = 1;
+ DBG(LABEL, ul_debug("DOS: re-use ID from script (0x%08x)", id));
+ } else
+ DBG(LABEL, ul_debug("DOS: failed to parse label=id '%s'", s));
}
}
/* random disk signature */
- if (!has_id)
+ if (!has_id) {
+ DBG(LABEL, ul_debug("DOS: generate new ID"));
random_get_bytes(&id, sizeof(id));
+ }
if (fdisk_has_protected_bootbits(cxt))
rc = fdisk_init_firstsector_buffer(cxt, 0, MBR_PT_BOOTBITS_SIZE);