Magellan Linux

Diff of /tags/mkinitrd-6_5_2/mkinitrd.in

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

revision 901 by niro, Wed Aug 5 19:20:53 2009 UTC revision 1140 by niro, Thu Aug 19 12:24:23 2010 UTC
# Line 53  force="" Line 53  force=""
53  verbose=""  verbose=""
54  img_vers=""  img_vers=""
55  builtins=""  builtins=""
56  modulefile=/etc/modules.conf  modulefile="/etc/modules.conf"
57    modprobeconf="/etc/modprobe.d/*"
58  rc=0  rc=0
59    
60  IMAGESIZE=4000  IMAGESIZE=4000
# Line 472  fi Line 473  fi
473  ####### get modules ##########  ####### get modules ##########
474    
475  echo "Creating ${IMAGE_TYPE} initrd image"  echo "Creating ${IMAGE_TYPE} initrd image"
 modulefile=/etc/modprobe.conf  
476    
477  for n in ${PREMODS}  for n in ${PREMODS}
478  do  do
# Line 487  then Line 487  then
487   for fs in / /boot   for fs in / /boot
488   do   do
489   esc=$(echo ${fs} | sed 's,/,\\/,g')   esc=$(echo ${fs} | sed 's,/,\\/,g')
490   dev=$(mount | awk "/ on ${esc} / { print \$1 }" | sed 's/[0-9]*$//' | cut -d/ -f3)   dev=$(mount | awk "/ on ${esc} / { print \$1 }" | sed 's/[0-9]*$//')
491   if [ "$(echo ${dev} | cut -c1-2)" = sd ]   if [ "$(echo ${dev} | cut -c6-7)" = sd ]
492   then   then
493   if [ $(which kudzu 2>/dev/null) ]   if [ $(which hwinfo 2>/dev/null) ]
494   then   then
495   host=$(kudzu --probe -b scsi |   if [[ -n $(hwinfo --disk --only ${dev} | grep 'Driver Modules' | grep 'usb[_|-]storage') ]]
  gawk '/^device: '${dev}'/,/^host:/ { if (/^host/) { print $2; exit; } }')  
  if [ -d /proc/scsi/usb-storage-${host} -o -f /proc/scsi/usb-storage/${host} ]  
496   then   then
497   needusb=1   needusb=1
498   fi   fi
# Line 768  do Line 766  do
766   module=$(echo ${MODULE} | sed "s|.*/||" | sed "s/.k\?o$//")   module=$(echo ${MODULE} | sed "s|.*/||" | sed "s/.k\?o$//")
767   fullmodule=$(echo ${MODULE} | sed "s|.*/||")   fullmodule=$(echo ${MODULE} | sed "s|.*/||")
768    
769   options=$(sed -n -e "s/^options[     ][      ]*${module}[      ][      ]*//p" ${modulefile} 2>/dev/null)   options=$(sed -n -e "s/^options[     ][      ]*${module}[      ][      ]*//p" ${modprobeconf} 2>/dev/null)
770    
771   if [ -n "${options}" ]   if [ -n "${options}" ]
772   then   then

Legend:
Removed from v.901  
changed lines
  Added in v.1140