summaryrefslogtreecommitdiffstats
path: root/mount/mount.c
diff options
context:
space:
mode:
authormaximilian attems2008-07-25 09:29:25 +0200
committerKarel Zak2008-07-29 13:20:03 +0200
commit6a99c0b286384c98a012620a94fbc50a7c1adcbb (patch)
treea5ce0a838cec3707b30a9ec5d3f4261ca9082a70 /mount/mount.c
parentmount: add info about tz=UTC option for FAT to mount.8 (diff)
downloadkernel-qcow2-util-linux-6a99c0b286384c98a012620a94fbc50a7c1adcbb.tar.gz
kernel-qcow2-util-linux-6a99c0b286384c98a012620a94fbc50a7c1adcbb.tar.xz
kernel-qcow2-util-linux-6a99c0b286384c98a012620a94fbc50a7c1adcbb.zip
mount: add shortoptions for bind, move and rbind
Reserving uppercase letters for mount operations: --move | -M --bind | -B --rbind | -R Add lowercase for the most needed mount operation that happen in initramfs: mount -M /sys /root/sys Note, we still have shared-subtree operations (--make-{slave,private,...}) without short options. [kzak@redhat.com: minor change in mount.8] Signed-off-by: maximilian attems <max@stro.at> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/mount.c')
-rw-r--r--mount/mount.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/mount/mount.c b/mount/mount.c
index 8bf6154c5..39a9bd858 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -1671,10 +1671,10 @@ static struct option longopts[] = {
{ "test-opts", 1, 0, 'O' },
{ "pass-fd", 1, 0, 'p' },
{ "types", 1, 0, 't' },
- { "bind", 0, 0, 128 },
- { "move", 0, 0, 133 },
+ { "bind", 0, 0, 'B' },
+ { "move", 0, 0, 'M' },
{ "guess-fstype", 1, 0, 134 },
- { "rbind", 0, 0, 135 },
+ { "rbind", 0, 0, 'R' },
{ "make-shared", 0, 0, 136 },
{ "make-slave", 0, 0, 137 },
{ "make-private", 0, 0, 138 },
@@ -1861,12 +1861,15 @@ main(int argc, char *argv[]) {
initproctitle(argc, argv);
#endif
- while ((c = getopt_long (argc, argv, "afFhilL:no:O:p:rsU:vVwt:",
+ while ((c = getopt_long (argc, argv, "aBfFhilL:Mno:O:p:rRsU:vVwt:",
longopts, NULL)) != -1) {
switch (c) {
case 'a': /* mount everything in fstab */
++mount_all;
break;
+ case 'B': /* bind */
+ mounttype = MS_BIND;
+ break;
case 'f': /* fake: don't actually call mount(2) */
++fake;
break;
@@ -1885,6 +1888,9 @@ main(int argc, char *argv[]) {
case 'L':
label = optarg;
break;
+ case 'M': /* move */
+ mounttype = MS_MOVE;
+ break;
case 'n': /* do not write /etc/mtab */
++nomtab;
break;
@@ -1901,6 +1907,9 @@ main(int argc, char *argv[]) {
readonly = 1;
readwrite = 0;
break;
+ case 'R': /* rbind */
+ mounttype = (MS_BIND | MS_REC);
+ break;
case 's': /* allow sloppy mount options */
sloppy = 1;
break;
@@ -1923,12 +1932,6 @@ main(int argc, char *argv[]) {
case 0:
break;
- case 128: /* bind */
- mounttype = MS_BIND;
- break;
- case 133: /* move */
- mounttype = MS_MOVE;
- break;
case 134:
/* undocumented, may go away again:
call: mount --guess-fstype device
@@ -1940,9 +1943,6 @@ main(int argc, char *argv[]) {
printf("%s\n", fstype ? fstype : "unknown");
exit(fstype ? 0 : EX_FAIL);
}
- case 135:
- mounttype = (MS_BIND | MS_REC);
- break;
case 136:
mounttype = MS_SHARED;