home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / YaST2 / scrconf / etc_fstab.scr < prev    next >
Encoding:
Text File  |  2006-11-29  |  1.7 KB  |  68 lines

  1. /**
  2.  * File:
  3.  *   etc_fstab.scr
  4.  * Summary:
  5.  *   SCR Agent for reading/writing /etc/fstab
  6.  * Access:
  7.  *   read/write
  8.  * Authors:
  9.  *   Unknown <yast2-hacker@suse.de>
  10.  * See:
  11.  *   anyagent
  12.  *   libscr
  13.  *   man fstab
  14.  *   man mount
  15.  * Example:
  16.  *   Original /etc/fstab:
  17.  *     /dev/sda2       swap    swap    defaults 0 2
  18.  *     /dev/sda3       /       ext2    defaults 1 1
  19.  *     proc            /proc   proc    defaults 0 0
  20.  *     ...
  21.  **
  22.  *   Read(.etc.fstab)
  23.  *   ([$["file":"swap", "freq":0, "mntops":"defaults", "passno":2,
  24.  *       "spec":"/dev/sda2", "vfstype":"swap"],
  25.  *     $["file":"/", "freq":1, "mntops":"defaults", "passno":1,
  26.  *       "spec":"/dev/sda3", "vfstype":"ext2"],
  27.  *     $["file":"/proc", "freq":0, "mntops":"defaults", "passno":0,
  28.  *       "spec":"proc", "vfstype":"proc"],
  29.  *     ...
  30.  *   ])
  31.  **
  32.  *   Write(.etc.fstab, ([$["file":"/", "freq":1, "mntops":"defaults",
  33.  *                       "passno":1, "spec":"/dev/sda3",
  34.  *                       "vfstype":"ext2"]]))
  35.  *   (0)
  36.  *
  37.  * $Id: etc_fstab.scr 13018 2003-12-11 12:52:53Z jhumpol $
  38.  *
  39.  * Returns/Takes a <b>list of maps</b>. Each map (list-entry) corresponds
  40.  * with one file system.
  41.  * Keys for the maps are: "spec", "file", "vfstype", "mntops", "freq", "passno"
  42.  */
  43. .etc.fstab
  44.  
  45. `ag_anyagent(
  46.   `Description (
  47.       (`File("/etc/fstab")),    // real file name
  48.       "#\n",            // Comment
  49.       false,            // read-only
  50.       (`List (
  51.     `Tuple (
  52.       `spec (`String("^\t ")),
  53.       `Separator ("\t "),
  54.       `file (`String("^\t ")),
  55.       `Separator ("\t "),
  56.       `vfstype (`String("^\t ")),
  57.       `Separator ("\t "),
  58.       `mntops (`String("^ \t\n")),
  59.       `Optional(`Whitespace()),
  60.       `Optional(`freq (`Number())),
  61.       `Optional(`Whitespace()),
  62.       `Optional(`passno (`Number()))
  63.     ),
  64.     "\n"
  65.       ))
  66.     )
  67. )
  68.