#!/bin/bash # note: must be startet before /etc/rc.d/init.d/modules !!! #default xf86config write_default_xf86config(){ cat > /etc/X11/XF86Config << "EOF" Section "Module" Load "dbe" # Double buffer extension SubSection "extmod" Option "omit xfree86-dga" # don't initialise the DGA extension EndSubSection Load "type1" Load "speedo" Load "freetype" # Load "xtt" # Load "glx" #notebooks and sis card needs dri Load "dri" #vnc Load "vnc" EndSection Section "Files" RgbPath "/usr/X11R6/lib/X11/rgb" FontPath "/usr/X11R6/lib/X11/fonts/local/" FontPath "/usr/X11R6/lib/X11/fonts/misc/" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled" FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled" #prevents slow startup when disabled -> speedo, type1 #FontPath "/usr/X11R6/lib/X11/fonts/Speedo/" #FontPath "/usr/X11R6/lib/X11/fonts/Type1/" FontPath "/usr/X11R6/lib/X11/fonts/TrueType/" FontPath "/usr/X11R6/lib/X11/fonts/freefont/" FontPath "/usr/X11R6/lib/X11/fonts/75dpi/" FontPath "/usr/X11R6/lib/X11/fonts/100dpi/" # The module search path. The default path is shown here. # ModulePath "/usr/X11R6/lib/modules" EndSection Section "ServerFlags" # ctrl+alt+fn disabled; dont't allow to switch consoles # Option "DontVTSwitch" # ctrl+alt+backspace disabled; don't restart the xserver # Option "DontZap" # ctrl+alt+[+]/[-] disabled; don't allow to change resolution # Option "Dont Zoom" EndSection Section "InputDevice" Identifier "Keyboard1" Driver "Keyboard" Option "AutoRepeat" "500 30" # Option "Xleds" "1 2 3" Option "XkbRules" "xfree86" Option "XkbModel" "pc104" Option "XkbLayout" "de" EndSection Section "InputDevice" Identifier "Mouse1" Driver "mouse" Option "Protocol" "IMPS/2" Option "Device" "/dev/mouse" Option "Resolution" "1200" Option "ZAxisMapping" "4 5" EndSection #vnc Section "InputDevice" Identifier "vncKeyboard" Driver "rfbkeyb" EndSection #vnc Section "InputDevice" Identifier "vncMouse" Driver "rfbmouse" EndSection Section "Monitor" Identifier "mon0" HorizSync 28 - 96 VertRefresh 50-60 EndSection Section "Device" Identifier "vga0" Driver "vesa" #VideoRam 32768 # Insert Clocks lines here if appropriate # vnc options Option "rfbauth" "/root/.vnc/passwd" Option "rfbport" "5900" #Option "nevershared" Option "alwaysshared" Option "dontdisconnect" #Option "httpdir" "/usr/share/vnc/classes" #Option "httpport" "5800" Option "usevnc" EndSection Section "Screen" Identifier "Screen 1" Device "vga0" Monitor "mon0" DefaultDepth 16 Subsection "Display" Depth 8 Modes "1024x768" ViewPort 0 0 EndSubsection Subsection "Display" Depth 16 Modes "1024x768" ViewPort 0 0 EndSubsection Subsection "Display" Depth 24 Modes "1024x768" ViewPort 0 0 EndSubsection EndSection Section "ServerLayout" Identifier "Simple Layout" Screen "Screen 1" InputDevice "Mouse1" "CorePointer" InputDevice "Keyboard1" "CoreKeyboard" #vnc InputDevice "vncMouse" "ExtraPointer" InputDevice "vncKeyboard" "ExtraKeyboard" EndSection # Section "DRI" # Mode 0666 # EndSection EOF } run_hwdetection() { echo -e ${COLOREDSTAR}"Hardware Autodetection started ..." echo -e ${COLOREDSTAR}"Prozessor: $(cat /proc/cpuinfo |grep "model name" | sed -e 's:model\ name*.*\: ::')" #cleaning up old data-crap if [ -e /etc/sysconfig/hwsetup ] then echo -e ${COLOREDSTAR}"Cleaning up old data ..." rm -f /etc/sysconfig/hwsetup/* fi echo -en "${COLOREDSTAR}";hwsetup -p > /dev/null #clean up modules if [ -f /etc/modules.autoload ] then echo -e ${COLOREDSTAR}"Cleaning up /etc/modules.autoload ..." echo > /etc/modules.autoload evaluate_retval fi #load module for parallel printing if exists if [ -e /lib/modules/`uname -r`/kernel/drivers/char/lp.o ] then echo "lp" >> /etc/modules.autoload fi #get what hwsetup has found if [ -f /etc/sysconfig/hwsetup/knoppix ] then source /etc/sysconfig/hwsetup/knoppix fi #network setup (dhcp) #for i in $(cat /proc/net/dev|grep eth.|cut -d ':' -f1) #do # echo -e ${COLOREDSTAR}"Network ${i}: ${NETCARD_FULLNAME}" if [ -n "${NETCARD_DRIVER}" ] then echo -e ${COLOREDSTAR}"Network eth0: ${NETCARD_FULLNAME}" echo -e ${COLOREDSTAR}"Network module: ${NETCARD_DRIVER}" #net module echo "${NETCARD_DRIVER}" >> /etc/modules.autoload #eth0 settings echo "ONBOOT=\"yes\"" > /etc/conf.d/net.eth0 echo "NETWORKING=\"dhcp\"" >> /etc/conf.d/net.eth0 echo "DHCP_PROG=\"/sbin/dhcpcd\"" >> /etc/conf.d/net.eth0 echo "DHCP_STOP=\"-z\"" >> /etc/conf.d/net.eth0 evaluate_retval else #disable networking system-wide [ ! -d /var/state ] && install -d /var/state echo "SYSTEM_NO_NETWORK=true" > /var/state/network fi #done #sound setup if [ -n "${SOUND_DRIVER}" ] then echo -e ${COLOREDSTAR}"Sound (${SOUND_FULLNAME}) found" echo -e ${COLOREDSTAR}"Sound module: ${SOUND_DRIVER}" echo "${SOUND_DRIVER}" >> /etc/modules.autoload evaluate_retval fi #write default xfree-config echo -e ${COLOREDSTAR}"Writing default xfree-config ..." write_default_xf86config evaluate_retval #xserver setup if [ -n "${XDESC}" ] then echo -e ${COLOREDSTAR}"Video: ${XDESC}" echo -e ${COLOREDSTAR}"Video module: ${XMODULE}" #second check if an module really exists if [ -n "${XMODULE}" ] then echo -e ${COLOREDSTAR}"updating xfree-config ..." ( mv /etc/X11/XF86Config /etc/X11/XF86Config-orig && sed -e "s/Driver*.*\"vesa\"/Driver\ \"${XMODULE}\"/g" \ < /etc/X11/XF86Config-orig > /etc/X11/XF86Config && rm -f /etc/X11/XF86Config-orig ) evaluate_retval fi fi #mouse setup if [ -n "${MOUSE_DEVICE}" ] then echo -e ${COLOREDSTAR}"Mouse (${MOUSE_FULLNAME} found at ${MOUSE_DEVICE}" echo -e ${COLOREDSTAR}"updating xfree-config ..." ( source /etc/sysconfig/hwsetup/mouse && XMOUSETYPEFIXED=${XMOUSETYPE/\//\\/} && MOUSE_DEVICEFIXED="`echo "${MOUSE_DEVICE}"|cut -d '/' -f3`" && mv /etc/X11/XF86Config /etc/X11/XF86Config-orig && sed -e "s/Option\ \"Protocol\"*.*\"IMPS\/2\"/Option\ \"Protocol\"\ \"${XMOUSETYPEFIXED}\"/g" \ -e "s/Option\ \"Device\"*.*\"\/dev\/mouse\"/Option\ \"Device\"\ \"\/dev\/${MOUSE_DEVICEFIXED}\"/g" \ < /etc/X11/XF86Config-orig > /etc/X11/XF86Config && rm -f /etc/X11/XF86Config-orig ) evaluate_retval fi } ########### main part starts here ############## source /etc/sysconfig/rc source $rc_functions case $1 in start) #we wouldn't start hwdetection if settings where imported (alx-only) if [ ! -e /etc/alx-config/imported ] then run_hwdetection fi ;; restart) $0 start ;; *) echo "Usage: $0 {start|restart}" exit 1 ;; esac