Commit 79439d86 authored by Mike Hibler's avatar Mike Hibler

Don't print meaningless messages about skipping sectors in imageunzip.

parent 34ff9a66
/*
* Copyright (c) 2000-2014 University of Utah and the Flux Group.
* Copyright (c) 2000-2015 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -323,14 +323,14 @@ parse_gpt(int fd, struct iz_slice *parttab, iz_lba *startp, iz_size *sizep,
if (losect > hdr->hdr_lba_start) {
size = losect - hdr->hdr_lba_start;
addskip(hdr->hdr_lba_start, size);
if (dowarn)
if (dowarn > 1)
warnx("GPT: Skipping %lu sectors at %lu",
size, hdr->hdr_lba_start);
}
if (hisect < hdr->hdr_lba_end + 1) {
size = hdr->hdr_lba_end + 1 - hisect;
addskip(hisect, size);
if (dowarn)
if (dowarn > 1)
warnx("GPT: Skipping %lu sectors at %lu",
size, hisect);
}
......
/*
* Copyright (c) 2000-2014 University of Utah and the Flux Group.
* Copyright (c) 2000-2015 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -960,13 +960,14 @@ read_image(int fd)
int gotbb = 0;
iz_lba dstart;
iz_size dsize;
int dowarn = debug ? 2 : 0;
#ifdef WITH_GPT
if (!gotbb && parse_gpt(fd, parttab, &dstart, &dsize, debug) == 0)
if (!gotbb && parse_gpt(fd, parttab, &dstart, &dsize, dowarn) == 0)
gotbb = 1;
#endif
#ifdef WITH_MBR
if (!gotbb && parse_mbr(fd, parttab, &dstart, &dsize, debug) == 0)
if (!gotbb && parse_mbr(fd, parttab, &dstart, &dsize, dowarn) == 0)
gotbb = 2;
#endif
......
/*
* Copyright (c) 2000-2014 University of Utah and the Flux Group.
* Copyright (c) 2000-2015 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -80,13 +80,13 @@ parse_mbr(int fd, struct iz_slice *parttab, iz_lba *startp, iz_size *sizep,
warnx("MBR: lowest partition start > %u! "
"Only saving first %u sectors.",
MAGIC_LOSECT, MAGIC_LOSECT);
if (dowarn)
if (dowarn > 1)
warnx("MBR: skipping %u sectors at %u",
losect - MAGIC_LOSECT, MAGIC_LOSECT);
}
if (hisect < dsize) {
addskip(hisect, dsize-hisect);
if (dowarn)
if (dowarn > 1)
warnx("MBR: skipping %lu sectors at %u",
(unsigned long)(dsize - hisect), hisect);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment