Magellan Linux

Diff of /trunk/installer/hwdetection.sh

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

revision 572 by niro, Thu Sep 6 10:35:46 2007 UTC revision 576 by niro, Wed Sep 12 19:02:39 2007 UTC
# Line 5  Line 5 
5  # get_hwinfo $hw_item  # get_hwinfo $hw_item
6  get_hwinfo()  get_hwinfo()
7  {  {
8     local enable_desc="0"
9    
10     if [[ $1 = --with-description ]] || [[ $1 = -d ]]
11     then
12     enable_desc=1
13     shift
14     fi
15    
16   local item="$1"   local item="$1"
17   local all   local all
18   local i   local i
19    
20     # handle special items
21     case ${item} in
22     memory) get_hwinfo_memory; return ;;
23     smp) get_hwinfo_smp; return ;;
24     esac
25    
26   all=$(hwinfo --short --"${item}")   all=$(hwinfo --short --"${item}")
27    
28   declare -i i=0   declare -i i=0
# Line 17  get_hwinfo() Line 32  get_hwinfo()
32   (( i++ ))   (( i++ ))
33   [ ${i} -eq 1 ] && continue   [ ${i} -eq 1 ] && continue
34    
35   echo "${device};${description}"   if [[ ${enable_desc} = 1 ]]
36     then
37     echo "${device};${description}"
38     else
39     echo "${device}"
40     fi
41   done <<< "${all}"   done <<< "${all}"
42  }  }
43    
44    
45    # special memory case
46    get_hwinfo_memory()
47    {
48     local memory=$(hwinfo --memory  | grep "Memory Size" | cut -d: -f2 | sed "s:\ ::")
49     echo "${memory}"
50    }
51    
52    
53    # special smp case
54    get_hwinfo_smp()
55    {
56     local smp=$(hwinfo --smp  | grep "SMP support:" | cut -d: -f2 | sed "s:\ ::")
57     echo "${smp}"
58    }
59    
60    
61  # get_driver_modules $hw_item  # get_driver_modules $hw_item
62  get_driver_modules()  get_driver_modules()
63  {  {
# Line 44  get_driver_modules() Line 81  get_driver_modules()
81   local i   local i
82   for i in $(hwinfo --"${item}" | grep "Driver Modules:" | cut -d: -f2 )   for i in $(hwinfo --"${item}" | grep "Driver Modules:" | cut -d: -f2 )
83   do   do
84   eval $(echo "${i}" | sed -e "s:\":modules=\"\${modules}\ :" -e "s:\",\ \":\ :")   eval $(echo "${i}" | sed -e "s:\":modules=\"\${modules}\ :" -e "s:,:\ :")
85   done   done
86   echo "${modules}"   echo "${modules}"
87  }  }
# Line 65  remove_duplicates() Line 102  remove_duplicates()
102   done   done
103    
104   # remove all ':' and show the cleaned list   # remove all ':' and show the cleaned list
105   echo "${fixed_list}" | sed "s|:| |g"   # this way fixes double spaces also
106     for i in $(echo ${fixed_list} | sed "s|:| |g")
107     do
108     echo "${i}"
109     done
110  }  }
111    
112  get_x11_driver_modules()  get_x11_driver_modules()
# Line 147  create_initrd() Line 188  create_initrd()
188  #get_driver_modules all  #get_driver_modules all
189    
190  # network  # network
191  #get_hwinfo netcard  #get_hwinfo --with-description netcard
192  #get_driver_modules netcard  #get_driver_modules netcard
193    
194  #get_hwinfo disk  #get_hwinfo disk

Legend:
Removed from v.572  
changed lines
  Added in v.576