home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / lib / partman / active_partition / 65toggle_bootable / choices next >
Encoding:
Text File  |  2009-04-19  |  739 b   |  40 lines

  1. #!/bin/sh
  2.  
  3. . /lib/partman/lib/base.sh
  4.  
  5. dev=$1
  6. id=$2
  7.  
  8. cd $dev
  9.  
  10. valid_boot=no
  11. open_dialog VALID_FLAGS $id
  12. while { read_line flag; [ "$flag" ]; }; do
  13.     if [ "$flag" = boot ]; then
  14.         valid_boot=yes
  15.     fi
  16. done
  17. close_dialog
  18.  
  19. [ $valid_boot = yes ] || exit 0
  20.  
  21. bootable=no
  22. open_dialog GET_FLAGS $id
  23. while { read_line flag; [ "$flag" ]; }; do
  24.     if [ "$flag" = boot ]; then
  25.         bootable=yes
  26.     fi
  27. done
  28. close_dialog
  29.  
  30. db_metaget partman-partitioning/text/bootable description
  31. description="$RET"
  32.  
  33. if [ $bootable = yes ]; then
  34.     db_metaget partman-partitioning/text/on description
  35.     printf "unbootable\t%s\${!TAB}%s\n" "$description" "${RET}"
  36. else
  37.     db_metaget partman-partitioning/text/off description
  38.     printf "bootable\t%s\${!TAB}%s\n" "$description" "${RET}"
  39. fi
  40.