# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../kiss/mount_typo_features.patch # Copyright (C) 2004 - 2005 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- It's pretty weird to mount a directory at a device - Alejandro And a implemented 'read-only' mount option is even nicer - as well as a remount possibility in rescue conditions ;-) - Rene Rebe --- ./src/domount.c 1998-09-25 14:07:09.000000000 +0200 +++ ./src/domount.c 2003-12-24 16:16:17.000000000 +0100 @@ -2,27 +2,34 @@ int domount (Stringstack s) { - register int - opt; - register char - *type = NULL; + int opt; + char *type = NULL; + int mount_opt = 0; - while ( (opt = getopt (s.nstr, s.str, "t:h")) != -1 ) + while ( (opt = getopt (s.nstr, s.str, "t:hrR")) != -1 ) switch (opt) { case 't': if (! (type = optarg)) error ("missing type after \"-t\""); break; + case 'r': + mount_opt |= MS_RDONLY; + break; + case 'R': + mount_opt |= MS_REMOUNT; + break; default: case 'h': error ("Bad commandline.\n" "Usage: %s\n" - " or: %s [-t type] [-r] device directory\n" + " or: %s [-t type] [-r] [-R] device directory\n" "Where:\n" " -t type : mount as type, e.g. ext2, minix\n" " device : device to mount\n" " directory : mount point\n" + " -r : mount read-only\n" + " -R : remount\n" , progname, progname); } @@ -49,9 +56,9 @@ if (! type) error ("need \"-t type\" specification"); - if (mount (s.str [optind], s.str [optind + 1], type, 1, 0)) - error ("problem mounting \"%s\" on \"%s\" (type \"%s\")", - s.str [optind + 1], s.str [optind], type); + if (mount (s.str [optind], s.str [optind + 1], type, mount_opt, 0)) + error ("problem mounting \"%s\" on \"%s\" (type \"%s\", opts \"%x\")", + s.str [optind], s.str [optind + 1], type, mount_opt); if (! (mtab = fopen (MTAB, "a")) ) return (warning ("\"%s\" not updated", MTAB));