Magellan Linux

Diff of /trunk/installer/include/hwdetection.sh

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

revision 1027 by niro, Sun May 30 17:49:14 2010 UTC revision 1476 by niro, Wed Aug 3 13:39:14 2011 UTC
# Line 75  get_driver_modules() Line 75  get_driver_modules()
75  {  {
76   local item="$1"   local item="$1"
77   local modules   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:\",\ \":\ :")  
   
78   local i   local i
79    
80   for i in $(hwinfo --"${item}" | grep "Driver Modules:" | cut -d: -f2 )   for i in $(hwinfo --"${item}" | grep "Driver Modules:" | cut -d: -f2 )
81   do   do
82   eval $(echo "${i}" | sed -e "s:\":modules=\"\${modules}\ :" -e "s:,:\ :")   eval $(echo "${i}" | sed -e "s:\":modules=\"\${modules}\ :" -e "s:,:\ :")
# Line 248  create_initrd() Line 234  create_initrd()
234   for i in $*   for i in $*
235   do   do
236   case $1 in   case $1 in
  #--root|-r) shift; root="$1" ;;  
237   --initrd|-i) shift; initrd="$1" ;;   --initrd|-i) shift; initrd="$1" ;;
238   --config|-c) shift; config="$1" ;;   --config|-c) shift; config="$1" ;;
239   --kernelversion|-v) shift; kernel="$1" ;;   --kernelversion|-v) shift; kernel="$1" ;;
# Line 279  create_initrd() Line 264  create_initrd()
264   modules+=" $(grep ide_disk /proc/modules | cut -d' ' -f4 | sed '/-/d;s:,:\ :g')"   modules+=" $(grep ide_disk /proc/modules | cut -d' ' -f4 | sed '/-/d;s:,:\ :g')"
265   fi   fi
266    
267     # check for usb-storage and add usb host drivers
268     if [[ ! -z $(echo ${modules} | grep usb[_-]storage) ]]
269     then
270     # add usb1, usb1.1, usb2 and ubs3 hosts
271     modules+=" uhci-hcd ohci-hcd ehci-hcd xhci-hcd"
272     fi
273    
274   # add some generic modules   # add some generic modules
275   modules+=" sg_mod sg loop sr_mod sd_mod ide-cd ide-cd_mod ide-disk"   modules+=" sg_mod sg loop sr_mod sd_mod ide-cd ide-cd_mod ide-disk"
276    
# Line 298  create_initrd() Line 290  create_initrd()
290  # http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/fb/uvesafb.txt  # http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/fb/uvesafb.txt
291  #  #
292  EOF  EOF
293   # default config 1024x768 and 60 HZ   # fix a issues with virtualbox and 'ywrap'
294   echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" >> ${uvesafb_config}   if [[ ! -z $(hwinfo --bios | grep -i virtualbox) ]]
295     then
296     # use redraw on virtualbox
297     echo "options uvesafb mode_option=1024x768-32@60 scroll=redraw" >> ${uvesafb_config}
298     else
299     # default config 1024x768 and 60 HZ
300     echo "options uvesafb mode_option=1024x768-32@60 scroll=ywrap" >> ${uvesafb_config}
301     fi
302   fi   fi
303    
304   # remove all duplicate modules   # remove all duplicate modules
# Line 327  chrooted() Line 326  chrooted()
326   umount ${INSTALL_ROOT}/proc   umount ${INSTALL_ROOT}/proc
327   umount ${INSTALL_ROOT}/sys   umount ${INSTALL_ROOT}/sys
328  }  }
   
 # special: memory (size), floppy (modprobe floppy), smp (support y/n)  
 #          sound (which module? -> eval $(hwinfo --sound | grep "Driver Modules:" | cut -d: -f2 | sed s:\":a=\":) )  
 #  
   
 # for i in cdrom cpu disk floppy gfxcard keyboard memory monitor mouse  
 # netcard pppoe scsi smp \  
 # sound wlan  
 # do  
 # echo -------- ${i}  
 # get_hwinfo ${i}  
 # echo -------------------------------------------------  
 # echo  
 # done  
   
 # get_driver_modules sound  
 # get_driver_modules wlan  
 # get_driver_modules cdrom  
 # get_driver_modules disk  
 # get_driver_modules gfxcard  
 # get_x11_driver_modules  
   
 # # get a modules list  
 # for i in sound wlan cdrom disk gfxcard  
 # do  
 # ALL_MODULES="${ALL_MODULES} $(get_driver_modules ${i})"  
 # done  
 # ALL_MODULES="${ALL_MODULES} $(get_x11_driver_modules)"  
 # # show a clean list  
 # for i in $(remove_duplicates ${ALL_MODULES})  
 # do  
 # echo ${i}  
 # done  
   
 #create_initrd /root/TEST/initrd  
 #get_driver_modules cdrom  
 #get_driver_modules disk  
 #get_driver_modules scsi  
 #get_driver_modules all  
   
 # network  
 #get_hwinfo --with-description netcard  
 #get_driver_modules netcard  
   
 #get_hwinfo disk  
 #get_hwinfo partition | grep /dev/hda  

Legend:
Removed from v.1027  
changed lines
  Added in v.1476