home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / lib / partman / active_partition / 45xfs / choices next >
Encoding:
Text File  |  2006-08-30  |  1.4 KB  |  74 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.     xfs)
  19.     :
  20.     ;;
  21.     *)
  22.     exit 0
  23.     ;;
  24. esac
  25.  
  26. choice_mountpoint () {
  27.     case "$filesystem" in
  28.     xfs)
  29.         if [ -f $part/mountpoint ]; then
  30.         mp=$(cat $part/mountpoint)
  31.         else
  32.         db_metaget partman-basicfilesystems/text/no_mountpoint description
  33.         mp="$RET"
  34.         fi
  35.         db_metaget partman-xfs/text/specify_mountpoint description
  36.         RET=$(stralign -25 "$RET")
  37.         printf "mountpoint\t%s%s\n" "$RET" "$mp"
  38.         ;;
  39.     esac
  40. }
  41.  
  42. choice_options () {
  43.     db_metaget partman-basicfilesystems/text/options description
  44.     RET=$(stralign -25 "$RET")
  45.     printf "options\t%s%.45s\n" "$RET" "$(get_mountoptions $dev $id)"
  46. }
  47.  
  48. choice_label () {
  49.     # allow to set label only if the partition is to be formatted
  50.     [ -f $part/format ] || return 0
  51.     [ ! -f $part/formatted \
  52.       -o $part/formatted -ot $part/method \
  53.       -o $part/formatted -ot $part/filesystem ] || return 0
  54.     case "$filesystem" in
  55.     xfs)
  56.         if [ -f $part/label ]; then
  57.         label=$(cat $part/label)
  58.         else
  59.         db_metaget partman-basicfilesystems/text/none description
  60.         label=$RET
  61.         fi
  62.         db_metaget partman-basicfilesystems/text/specify_label description
  63.         RET=$(stralign -25 "$RET")
  64.         printf "label\t%s%s\n" "$RET" "$label"
  65.         ;;
  66.     esac
  67. }
  68.  
  69. choice_mountpoint
  70.  
  71. choice_options
  72.  
  73. choice_label
  74.