mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.7 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/kiss/mount_typo_features.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. It's pretty weird to mount a directory at a device
  20. - Alejandro
  21. And a implemented 'read-only' mount option is even nicer - as well
  22. as a remount possibility in rescue conditions ;-)
  23. - Rene Rebe <rene@exactcode.de>
  24. --- ./src/domount.c 1998-09-25 14:07:09.000000000 +0200
  25. +++ ./src/domount.c 2003-12-24 16:16:17.000000000 +0100
  26. @@ -2,27 +2,34 @@
  27. int domount (Stringstack s)
  28. {
  29. - register int
  30. - opt;
  31. - register char
  32. - *type = NULL;
  33. + int opt;
  34. + char *type = NULL;
  35. + int mount_opt = 0;
  36. - while ( (opt = getopt (s.nstr, s.str, "t:h")) != -1 )
  37. + while ( (opt = getopt (s.nstr, s.str, "t:hrR")) != -1 )
  38. switch (opt)
  39. {
  40. case 't':
  41. if (! (type = optarg))
  42. error ("missing type after \"-t\"");
  43. break;
  44. + case 'r':
  45. + mount_opt |= MS_RDONLY;
  46. + break;
  47. + case 'R':
  48. + mount_opt |= MS_REMOUNT;
  49. + break;
  50. default:
  51. case 'h':
  52. error ("Bad commandline.\n"
  53. "Usage: %s\n"
  54. - " or: %s [-t type] [-r] device directory\n"
  55. + " or: %s [-t type] [-r] [-R] device directory\n"
  56. "Where:\n"
  57. " -t type : mount as type, e.g. ext2, minix\n"
  58. " device : device to mount\n"
  59. " directory : mount point\n"
  60. + " -r : mount read-only\n"
  61. + " -R : remount\n"
  62. , progname, progname);
  63. }
  64. @@ -49,9 +56,9 @@
  65. if (! type)
  66. error ("need \"-t type\" specification");
  67. - if (mount (s.str [optind], s.str [optind + 1], type, 1, 0))
  68. - error ("problem mounting \"%s\" on \"%s\" (type \"%s\")",
  69. - s.str [optind + 1], s.str [optind], type);
  70. + if (mount (s.str [optind], s.str [optind + 1], type, mount_opt, 0))
  71. + error ("problem mounting \"%s\" on \"%s\" (type \"%s\", opts \"%x\")",
  72. + s.str [optind], s.str [optind + 1], type, mount_opt);
  73. if (! (mtab = fopen (MTAB, "a")) )
  74. return (warning ("\"%s\" not updated", MTAB));