diff options
author | Karel Zak | 2007-03-22 20:54:07 +0100 |
---|---|---|
committer | Karel Zak | 2007-03-22 20:54:07 +0100 |
commit | faf142b65a685a43a51132bd24924163aa0c1a95 (patch) | |
tree | c10aa8235a6b4392e47f348e911eaaf17dc2d251 /mount/lomount.c | |
parent | losetup: add -a option to list all used loop devices (diff) | |
download | kernel-qcow2-util-linux-faf142b65a685a43a51132bd24924163aa0c1a95.tar.gz kernel-qcow2-util-linux-faf142b65a685a43a51132bd24924163aa0c1a95.tar.xz kernel-qcow2-util-linux-faf142b65a685a43a51132bd24924163aa0c1a95.zip |
losetup: add support read-only loops
This feature has been already supported by mount, but it wasn't accessible by
losetup command. Now you can use "losetup -r".
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/lomount.c')
-rw-r--r-- | mount/lomount.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mount/lomount.c b/mount/lomount.c index da1d2e427..88214f71c 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -443,7 +443,8 @@ usage(void) { " %1$s -d loop_device # delete\n" " %1$s -f # find unused\n" " %1$s -a # list all used\n" - " %1$s [-e encryption] [-o offset] {-f|loop_device} file # setup\n"), + " %1$s -r # read-only loop\n" + " %1$s [-e encryption] [-o offset] [-r] {-f|loop_device} file # setup\n"), progname); exit(1); } @@ -496,11 +497,14 @@ main(int argc, char **argv) { if ((p = strrchr(progname, '/')) != NULL) progname = p+1; - while ((c = getopt(argc, argv, "ade:E:fo:p:v")) != -1) { + while ((c = getopt(argc, argv, "ade:E:fo:p:vr")) != -1) { switch (c) { case 'a': all = 1; break; + case 'r': + ro = 1; + break; case 'd': delete = 1; break; |