summaryrefslogtreecommitdiffstats
path: root/sys-utils/losetup.c
diff options
context:
space:
mode:
authorKarel Zak2012-01-09 23:27:53 +0100
committerKarel Zak2012-01-09 23:28:50 +0100
commit916bf85e621bb01d58279a014088376c80050a74 (patch)
tree0571e873b22ea4eda45d03801d4e073bc0a8a1a3 /sys-utils/losetup.c
parentloopdev: improve debug messages (diff)
downloadkernel-qcow2-util-linux-916bf85e621bb01d58279a014088376c80050a74.tar.gz
kernel-qcow2-util-linux-916bf85e621bb01d58279a014088376c80050a74.tar.xz
kernel-qcow2-util-linux-916bf85e621bb01d58279a014088376c80050a74.zip
losetup: add --partscan option
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/losetup.c')
-rw-r--r--sys-utils/losetup.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index 35c1c919d..7e80ee513 100644
--- a/sys-utils/losetup.c
+++ b/sys-utils/losetup.c
@@ -206,6 +206,7 @@ static void usage(FILE *out)
" -o, --offset <num> start at offset <num> into file\n"
" --sizelimit <num> device limited to <num> bytes of the file\n"
" -p, --pass-fd <num> read passphrase from file descriptor <num>\n"
+ " -P, --partscan create partitioned loop device\n"
" -r, --read-only setup read-only loop device\n"
" --show print device name after setup (with -f)\n"
" -v, --verbose verbose mode\n"), out);
@@ -243,6 +244,7 @@ int main(int argc, char **argv)
{ "offset", 1, 0, 'o' },
{ "sizelimit", 1, 0, OPT_SIZELIMIT },
{ "pass-fd", 1, 0, 'p' },
+ { "partscan", 0, 0, 'P' },
{ "read-only", 0, 0, 'r' },
{ "show", 0, 0, OPT_SHOW },
{ "verbose", 0, 0, 'v' },
@@ -257,7 +259,7 @@ int main(int argc, char **argv)
loopcxt_init(&lc, 0);
loopcxt_enable_debug(&lc, getenv("LOOPDEV_DEBUG") ? TRUE : FALSE);
- while ((c = getopt_long(argc, argv, "ac:d:De:E:fhj:o:p:rvV",
+ while ((c = getopt_long(argc, argv, "ac:d:De:E:fhj:o:p:PrvV",
longopts, NULL)) != -1) {
if (act && strchr("acdDfj", c))
@@ -307,6 +309,9 @@ int main(int argc, char **argv)
passfd = strtol_or_err(optarg,
_("invalid passphrase file descriptor"));
break;
+ case 'P':
+ lo_flags |= LO_FLAGS_PARTSCAN;
+ break;
case OPT_SHOW:
showdev = 1;
break;