OpenSDE Packages Database (without history before r20070)
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.

80 lines
2.5 KiB

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