home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / lib / partman / active_partition / 45reiserfs / choices next >
Encoding:
Text File  |  2006-08-30  |  1.4 KB  |  70 lines

  1. #!/bin/sh
  2.  
  3. . /usr/share/debconf/confmodule
  4.  
  5. set -e
  6.  
  7. dev=$1
  8. id=$2
  9. part=$dev/$id
  10.  
  11. cd $dev
  12.  
  13. [ -f $part/method -a -f $part/acting_filesystem ] || exit 0
  14.  
  15. filesystem=$(cat $part/acting_filesystem)
  16.  
  17. case "$filesystem" in
  18.     reiserfs)
  19.     :
  20.     ;;
  21.     *)
  22.     exit 0
  23.     ;;
  24. esac
  25.  
  26. choice_mountpoint () {
  27.     if [ -f $part/mountpoint ]; then
  28.     mp=$(cat $part/mountpoint)
  29.     else
  30.     db_metaget partman-basicfilesystems/text/no_mountpoint description
  31.     mp="$RET"
  32.     fi
  33.     db_metaget partman-reiserfs/text/specify_mountpoint description
  34.     RET=$(stralign -25 "$RET")
  35.     printf "mountpoint\t%s%s\n" "$RET" "$mp"
  36. }
  37.  
  38. choice_options () {
  39.     db_metaget partman-basicfilesystems/text/options description
  40.     RET=$(stralign -25 "$RET")
  41.     printf "options\t%s%.45s\n" "$RET" "$(get_mountoptions $dev $id)"
  42. }
  43.  
  44. choice_label () {
  45.     # allow to set label only if the partition is to be formatted
  46.     [ -f $part/format ] || return 0
  47.     [ ! -f $part/formatted \
  48.       -o $part/formatted -ot $part/method \
  49.       -o $part/formatted -ot $part/filesystem ] || return 0
  50.     case "$filesystem" in
  51.     reiserfs)
  52.         if [ -f $part/label ]; then
  53.         label=$(cat $part/label)
  54.         else
  55.         db_metaget partman-basicfilesystems/text/none description
  56.         label=$RET
  57.         fi
  58.         db_metaget partman-basicfilesystems/text/specify_label description
  59.         RET=$(stralign -25 "$RET")
  60.         printf "label\t%s%s\n" "$RET" "$label"
  61.         ;;
  62.     esac
  63. }
  64.  
  65. choice_mountpoint
  66.  
  67. choice_options
  68.  
  69. choice_label
  70.