Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
192 - 1
#! /bin/sh
2
set -e
3
 
4
# grub-mkconfig helper script.
5
# Copyright (C) 2006,2007,2008,2009,2010  Free Software Foundation, Inc.
6
#
7
# GRUB is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# GRUB is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
19
 
20
prefix=/usr
21
exec_prefix=/usr
22
bindir=/usr/bin
23
libdir=/usr/lib
24
. "/usr/share/grub/grub-mkconfig_lib"
25
 
26
export TEXTDOMAIN=grub
27
export TEXTDOMAINDIR=/usr/share/locale
28
 
29
X=80
30
Y=24
31
TERMINAL=ofconsole
32
 
33
argument () {
34
  opt=$1
35
  shift
36
 
37
  if test $# -eq 0; then
38
      echo "$0: option requires an argument -- '$opt'" 1>&2
39
      exit 1
40
  fi
41
  echo $1
42
}
43
 
44
check_terminfo () {
45
 
46
  while test $# -gt 0
47
  do
48
    option=$1
49
    shift
50
 
51
    case "$option" in
52
    terminfo | TERMINFO)
53
        ;;
54
 
55
    -g)
56
        NEWXY=`argument $option "$@"`
57
        NEWX=`echo $NEWXY | cut -d x -f 1`
58
        NEWY=`echo $NEWXY | cut -d x -f 2`
59
 
60
        if [ ${NEWX} -ge 80 ] ; then
61
          X=${NEWX}
62
        else
63
          echo "Warning: ${NEWX} is less than the minimum size of 80"
64
        fi
65
 
66
        if [ ${NEWY} -ge 24 ] ; then
67
          Y=${NEWY}
68
        else
69
          echo "Warning: ${NEWY} is less than the minimum size of 24"
70
        fi
71
 
72
        shift
73
        ;;
74
 
75
    *)
76
#       # accept console or ofconsole
77
#       if [ "$option" != "console" -a "$option" != "ofconsole" ] ; then
78
#         echo "Error: GRUB_TERMINFO unknown console: $option"
79
#         exit 1
80
#       fi
81
#       # perfer console
82
#       TERMINAL=console
83
        # accept ofconsole
84
        if [ "$option" != "ofconsole" ] ; then
85
          echo "Error: GRUB_TERMINFO unknown console: $option"
86
          exit 1
87
        fi
88
        # perfer console
89
        TERMINAL=ofconsole
90
        ;;
91
    esac
92
 
93
  done
94
 
95
}
96
 
97
if ! uname -m | grep -q ppc ; then
98
  exit 0
99
fi
100
 
101
if [ "x${GRUB_TERMINFO}" != "x" ] ; then
102
  F1=`echo ${GRUB_TERMINFO} | cut -d " " -f 1`
103
 
104
  if [ "${F1}" != "terminfo" ] ; then
105
    echo "Error: GRUB_TERMINFO is set to \"${GRUB_TERMINFO}\" The first word should be terminfo."
106
    exit 1
107
  fi
108
 
109
  check_terminfo ${GRUB_TERMINFO}
110
fi
111
 
112
cat << EOF
113
  terminfo -g ${X}x${Y} ${TERMINAL}
114
EOF