Magellan Linux

Diff of /trunk/magellan-initscripts/etc/rc.d/init.d/hwdetect

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by niro, Mon Dec 13 23:30:33 2004 UTC revision 71 by niro, Tue Mar 15 19:07:56 2005 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    # $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/hwdetect,v 1.3 2005-03-15 19:07:56 niro Exp $
3    
4  # note: must be startet before /etc/rc.d/init.d/modules !!!  # note: must be startet before /etc/rc.d/init.d/modules !!!
5    
# Line 32  write_x11_config() { Line 33  write_x11_config() {
33   exit 1   exit 1
34   ;;   ;;
35   esac   esac
36    
37   #got we vnc support ?   #got we vnc support ?
38   if [ -f /usr/X11R6/lib/modules/vnc.so ]   if [ -f /usr/X11R6/lib/modules/vnc.so ]
39   then   then
# Line 40  write_x11_config() { Line 41  write_x11_config() {
41   else   else
42   HAS_VNC="no"   HAS_VNC="no"
43   fi   fi
44    
45    
46   #show which server we use   #show which server we use
47   echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server "   echo -en ${COLOREDSTAR}"Using '${xserver}' as x11-server "
48    
49   #show if we have vnc   #show if we have vnc
50   if [ "${HAS_VNC}" = "yes" ]   if [ "${HAS_VNC}" = "yes" ]
51   then   then
# Line 52  write_x11_config() { Line 53  write_x11_config() {
53   else   else
54   echo "..."   echo "..."
55   fi   fi
56    
57   #create a new clear xfconfig file   #create a new clear xfconfig file
58   echo '# Generated with hwdetect, part of Magellan-Linux initscripts.' > ${xfconfig}   echo '# Generated with hwdetect, part of Magellan-Linux initscripts.' > ${xfconfig}
59   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
60    
61   #write modules   #write modules
62   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
63   echo 'Section "Module"' >> ${xfconfig}   echo 'Section "Module"' >> ${xfconfig}
# Line 70  write_x11_config() { Line 71  write_x11_config() {
71   echo '#    Load        "xtt"' >> ${xfconfig}   echo '#    Load        "xtt"' >> ${xfconfig}
72   echo '#    Load       "glx"' >> ${xfconfig}   echo '#    Load       "glx"' >> ${xfconfig}
73   echo '    Load       "dri"' >> ${xfconfig}   echo '    Load       "dri"' >> ${xfconfig}
74    
75   [ "${HAS_VNC}" = "yes" ] && echo '    Load       "vnc"' >> ${xfconfig}   [ "${HAS_VNC}" = "yes" ] && echo '    Load       "vnc"' >> ${xfconfig}
76    
77   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
78    
79    
80   #fonts   #fonts
81   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
82   echo 'Section "Files"' >> ${xfconfig}   echo 'Section "Files"' >> ${xfconfig}
83   echo '    RgbPath "/usr/X11R6/lib/X11/rgb"' >> ${xfconfig}   echo '    RgbPath "/usr/X11R6/lib/X11/rgb"' >> ${xfconfig}
84    
85   case ${xserver} in   case ${xserver} in
86   Xorg)   Xorg)
87   echo '    FontPath   "/usr/share/fonts/local/"' >> ${xfconfig}   echo '    FontPath   "/usr/share/fonts/local/"' >> ${xfconfig}
# Line 109  write_x11_config() { Line 110  write_x11_config() {
110   echo '    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"' >> ${xfconfig}   echo '    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"' >> ${xfconfig}
111   ;;   ;;
112   esac   esac
113    
114   echo '#    ModulePath "/usr/X11R6/lib/modules"' >> ${xfconfig}   echo '#    ModulePath "/usr/X11R6/lib/modules"' >> ${xfconfig}
115   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
116    
117    
118   #server flags   #server flags
119   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
120   echo 'Section "ServerFlags"' >> ${xfconfig}   echo 'Section "ServerFlags"' >> ${xfconfig}
# Line 121  write_x11_config() { Line 122  write_x11_config() {
122   echo '#    Option "DontZap"' >> ${xfconfig}   echo '#    Option "DontZap"' >> ${xfconfig}
123   echo '#    Option "Dont Zoom"' >> ${xfconfig}   echo '#    Option "Dont Zoom"' >> ${xfconfig}
124   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
125    
126    
127   #keyboard   #keyboard
128   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
129   echo 'Section "InputDevice"' >> ${xfconfig}   echo 'Section "InputDevice"' >> ${xfconfig}
130   echo '    Identifier "Keyboard1"' >> ${xfconfig}   echo '    Identifier "Keyboard1"' >> ${xfconfig}
131    
132   case ${xserver} in   case ${xserver} in
133   Xorg)   Xorg)
134   echo '    Driver "kbd"' >> ${xfconfig}   echo '    Driver "kbd"' >> ${xfconfig}
# Line 136  write_x11_config() { Line 137  write_x11_config() {
137   echo '    Driver "Keyboard"' >> ${xfconfig}   echo '    Driver "Keyboard"' >> ${xfconfig}
138   ;;   ;;
139   esac   esac
140    
141   echo '    Option "AutoRepeat" "500 30"' >> ${xfconfig}   echo '    Option "AutoRepeat" "500 30"' >> ${xfconfig}
142   echo '#    Option "Xleds"      "1 2 3"' >> ${xfconfig}   echo '#    Option "Xleds"      "1 2 3"' >> ${xfconfig}
143    
144   case ${xserver} in   case ${xserver} in
145   Xorg)   Xorg)
146   echo '    Option "XkbRules" "xorg"' >> ${xfconfig}   echo '    Option "XkbRules" "xorg"' >> ${xfconfig}
# Line 148  write_x11_config() { Line 149  write_x11_config() {
149   echo '    Option "XkbRules" "xfree86"' >> ${xfconfig}   echo '    Option "XkbRules" "xfree86"' >> ${xfconfig}
150   ;;   ;;
151   esac   esac
152    
153   echo '    Option "XkbModel" "pc104"' >> ${xfconfig}   echo '    Option "XkbModel" "pc104"' >> ${xfconfig}
154   echo '    Option "XkbLayout" "de"' >> ${xfconfig}   echo '    Option "XkbLayout" "de"' >> ${xfconfig}
155   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
156    
157    
158   #mouse   #mouse
159   #to be safe   #to be safe
160   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE   local MOUSETYPE XMOUSETYPE FULLNAME DEVICE
161   #get config   #get config
162   [ -f /etc/sysconfig/hwsetup/mouse ] && source /etc/sysconfig/hwsetup/mouse   [ -f /etc/sysconfig/hwsetup/mouse ] && source /etc/sysconfig/hwsetup/mouse
163    
164   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
165   echo 'Section "InputDevice"' >> ${xfconfig}   echo 'Section "InputDevice"' >> ${xfconfig}
166   echo '    Identifier "Mouse1"' >> ${xfconfig}   echo '    Identifier "Mouse1"' >> ${xfconfig}
167   echo '    Driver "mouse"' >> ${xfconfig}   echo '    Driver "mouse"' >> ${xfconfig}
168    
169   if [ -n "${XMOUSETYPE}" ]   if [ -n "${XMOUSETYPE}" ]
170   then   then
171   echo "    Option \"Protocol\"    \"${XMOUSETYPE}\"" >> ${xfconfig}   echo "    Option \"Protocol\"    \"${XMOUSETYPE}\"" >> ${xfconfig}
172   else   else
173   echo '    Option "Protocol"    "PS/2"' >> ${xfconfig}   echo '    Option "Protocol"    "PS/2"' >> ${xfconfig}
174   fi   fi
175    
176   if [ -n "${DEVICE}" ]   if [ -n "${DEVICE}" ]
177   then   then
178   #show what we got   #show what we got
179   echo -e ${COLOREDSTAR}"Mouse (${MOUSE_FULLNAME} found at ${MOUSE_DEVICE}"   echo -e ${COLOREDSTAR}"Mouse (${MOUSE_FULLNAME} found at ${MOUSE_DEVICE}"
180    
181   #is there any mouse module than try to load it   #is there any mouse module than try to load it
182   if [ "${MOUSETYPE}" = "ps2" ]   if [ "${MOUSETYPE}" = "ps2" ]
183   then   then
# Line 186  write_x11_config() { Line 187  write_x11_config() {
187   echo -e ${COLOREDSTAR}"Loading kernel-module 'psmouse' ..."   echo -e ${COLOREDSTAR}"Loading kernel-module 'psmouse' ..."
188   echo "psmouse" >> /etc/modules.autoload.d/kernel-$(kernel_major_version)   echo "psmouse" >> /etc/modules.autoload.d/kernel-$(kernel_major_version)
189   fi   fi
190    
191   #kernel 2.4   #kernel 2.4
192   #if [ -f /lib/modules/$(uname -r)/kernel/drivers/input/mouse/psmouse.ko ]   #if [ -f /lib/modules/$(uname -r)/kernel/drivers/input/mouse/psmouse.ko ]
193   #then   #then
# Line 200  write_x11_config() { Line 201  write_x11_config() {
201   echo -e ${COLOREDSTAR}"Loading kernel-module 'sermouse' ..."   echo -e ${COLOREDSTAR}"Loading kernel-module 'sermouse' ..."
202   echo "sermouse" >> /etc/modules.autoload.d/kernel-$(kernel_major_version)   echo "sermouse" >> /etc/modules.autoload.d/kernel-$(kernel_major_version)
203   fi   fi
204    
205   #kernel 2.4   #kernel 2.4
206   #if [ -f /lib/modules/$(uname -r)/kernel/drivers/input/mouse/psmouse.ko ]   #if [ -f /lib/modules/$(uname -r)/kernel/drivers/input/mouse/psmouse.ko ]
207   #then   #then
# Line 212  write_x11_config() { Line 213  write_x11_config() {
213   else   else
214   echo '    Option "Device"      "/dev/mouse"' >> ${xfconfig}   echo '    Option "Device"      "/dev/mouse"' >> ${xfconfig}
215   fi   fi
216    
217   echo '    Option "Resolution" "1200"' >> ${xfconfig}   echo '    Option "Resolution" "1200"' >> ${xfconfig}
218    
219   [ "${XMOUSETYPE}" = "IMPS/2" ] && echo '    Option "ZAxisMapping" "4 5"' >> ${xfconfig}   [ "${XMOUSETYPE}" = "IMPS/2" ] && echo '    Option "ZAxisMapping" "4 5"' >> ${xfconfig}
220    
221   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
222    
223   #to be safe   #to be safe
224   unset MOUSETYPE XMOUSETYPE FULLNAME DEVICE   unset MOUSETYPE XMOUSETYPE FULLNAME DEVICE
225    
226    
227   #vnc keyboard && mouse   #vnc keyboard && mouse
228   if [ "${HAS_VNC}" = "yes" ]   if [ "${HAS_VNC}" = "yes" ]
229   then   then
# Line 239  write_x11_config() { Line 240  write_x11_config() {
240   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
241   fi   fi
242    
243    
244   #monitor   #monitor
245   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
246  # echo 'Section "Monitor"' >> ${xfconfig}  # echo 'Section "Monitor"' >> ${xfconfig}
# Line 262  write_x11_config() { Line 263  write_x11_config() {
263   echo '    Option      "DPMS"' >> ${xfconfig}   echo '    Option      "DPMS"' >> ${xfconfig}
264   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
265   fi   fi
266    
267   #vga   #vga
268   #to be safe   #to be safe
269   local XSERVER XMODULE XDESC   local XSERVER XMODULE XDESC
270    
271   #get config   #get config
272   [ -f /etc/sysconfig/hwsetup/xserver ] && source /etc/sysconfig/hwsetup/xserver   [ -f /etc/sysconfig/hwsetup/xserver ] && source /etc/sysconfig/hwsetup/xserver
273    
274   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
275   echo 'Section "Device"' >> ${xfconfig}   echo 'Section "Device"' >> ${xfconfig}
276   echo '    Identifier  "vga0"' >> ${xfconfig}   echo '    Identifier  "vga0"' >> ${xfconfig}
277    
278   if [ -n "${XMODULE}" ]   if [ -n "${XMODULE}" ]
279   then   then
280   # vmware module has some probs with fb consoles   # vmware module has some probs with fb consoles
# Line 311  write_x11_config() { Line 312  write_x11_config() {
312   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
313   #to be safe   #to be safe
314   unset XSERVER XMODULE XDESC   unset XSERVER XMODULE XDESC
315    
316    
317   #screens   #screens
318   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
319   echo 'Section "Screen"' >> ${xfconfig}   echo 'Section "Screen"' >> ${xfconfig}
# Line 337  write_x11_config() { Line 338  write_x11_config() {
338   echo '        ViewPort    0 0' >> ${xfconfig}   echo '        ViewPort    0 0' >> ${xfconfig}
339   echo '    EndSubsection' >> ${xfconfig}   echo '    EndSubsection' >> ${xfconfig}
340   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
341    
342    
343   #server layout   #server layout
344   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
345   echo 'Section "ServerLayout"' >> ${xfconfig}   echo 'Section "ServerLayout"' >> ${xfconfig}
# Line 355  write_x11_config() { Line 356  write_x11_config() {
356   fi   fi
357    
358   echo 'EndSection' >> ${xfconfig}   echo 'EndSection' >> ${xfconfig}
359    
360    
361   #dri (here disabled, use default of xserver)   #dri (here disabled, use default of xserver)
362   echo '' >> ${xfconfig}   echo '' >> ${xfconfig}
363   echo '# Section "DRI"' >> ${xfconfig}   echo '# Section "DRI"' >> ${xfconfig}
# Line 447  case $1 in Line 448  case $1 in
448   restart)   restart)
449   $0 start   $0 start
450   ;;   ;;
451        
452   *)   *)
453   echo "Usage: $0 {start|restart}"   echo "Usage: $0 {start|restart}"
454   exit 1   exit 1

Legend:
Removed from v.11  
changed lines
  Added in v.71