--- mcore-src/trunk/mcore-tools/daemon/include/hwdetection.global.class 2011/02/06 23:46:42 1306 +++ mcore-src/trunk/mcore-tools/daemon/include/hwdetection.global.class 2011/02/06 23:47:09 1307 @@ -1,3 +1,4 @@ +#!/bin/bash # $Id$ provide hwdetection @@ -76,22 +77,8 @@ { local item="$1" local modules - - # being little tricky here :) - # does following: - # grep: - # -> 'Driver Modules: "via82cxxx", "ide_cd"' - # cut: - # -> ' "via82cxxx", "ide_cd"' - # sed1: - # -> ' modules="via82cxxx", "ide_cd"' - # sed2: - # -> ' modules="via82cxxx ide_cd"' - # then evaluate -> eval modules="via82cxxx ide_cd" - # and we get a variable $modules with all mods - #eval $(hwinfo --"${item}" | grep "Driver Modules:" | cut -d: -f2 | sed -e "s:\":modules=\":" -e "s:\",\ \":\ :") - local i + for i in $(hwinfo --"${item}" | grep "Driver Modules:" | cut -d: -f2 ) do eval $(echo "${i}" | sed -e "s:\":modules=\"\${modules}\ :" -e "s:,:\ :") @@ -143,6 +130,20 @@ remove_duplicates "${modules}" } +get_evdev_device_path() +{ + local device="$1" + local path + + case ${device} in + mouse|keyboard) true;; + *) die "unkown device";; + esac + + path="$(hwinfo --${device} | grep 'Device Files:' | sed 's:.*\(/dev/input/event[0-5]\).*:\1:')" + echo "${path}" +} + # get_netcard_driver_modules device # e.g. get_netcard_driver_modules eth0 get_netcard_driver_modules() @@ -229,12 +230,12 @@ local modules # enabled framebuffer modules as default local framebuffer=1 + local uvesafb_config="/etc/modprobe.d/uvesafb.conf" # very basic getops for i in $* do case $1 in - #--root|-r) shift; root="$1" ;; --initrd|-i) shift; initrd="$1" ;; --config|-c) shift; config="$1" ;; --kernelversion|-v) shift; kernel="$1" ;; @@ -250,6 +251,7 @@ if [[ ! -z ${INSTALL_ROOT} ]] then config="${INSTALL_ROOT}/${config}" + uvesafb_config="${INSTALL_ROOT}/${uvesafb_config}" chroot="chrooted" fi @@ -268,7 +270,31 @@ modules+=" sg_mod sg loop sr_mod sd_mod ide-cd ide-cd_mod ide-disk" # add generic framebuffer modules - [[ ${framebuffer} = 1 ]] && modules+=" uvesafb" + if [[ ${framebuffer} = 1 ]] + then + modules+=" uvesafb" + + # setup modprobe conf too + [[ ! -d $(dirname ${uvesafb_config}) ]] && install -d $(dirname ${uvesafb_config}) + cat > ${uvesafb_config} << EOF +# This file sets the parameters for uvesafb module. +# The following format should be used: +# options uvesafb mode_option=x[-][@] scroll= ... +# +# For more details see: +# http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/fb/uvesafb.txt +# +EOF + # fix a issues with virtualbox and 'ywrap' + if [[ ! -z $(hwinfo --bios | grep -i virtualbox) ]] + then + # use redraw on virtualbox + echo "options uvesafb mode_option=1024x768-32@60 scroll=redraw" >> ${uvesafb_config} + else + # default config 1024x768 and 60 HZ + echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" >> ${uvesafb_config} + fi + fi # remove all duplicate modules modules="$(remove_duplicates ${modules})"