Changeset 1922 in MondoRescue for branches/2.2.6/mindi/mindi
- Timestamp:
- Apr 17, 2008, 12:32:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.6/mindi/mindi
r1919 r1922 1069 1069 1070 1070 1071 MakeModuleLoadingScript() {1072 local module fname params modpath kver outerloop i modpaths kver searchpath list_to_echo j1073 tmpmodprobe_flag=$11074 outfile=$21075 > $outfile || Die "Cannot create empty $outfile"1076 echo -en "#\041/bin/sh\n\n" >> $outfile1077 echo "echo -en \"Loading your modules...\"" >> $outfile1078 if [ "$YOUR_KERNEL_SUCKS" ] ; then1079 kver=$FAILSAFE_KVER1080 cd $MINDI_TMP1081 searchpath=lib/modules/$kver1082 else1083 ###1084 ### Sq-Modification ... Use kernelname for module search path if specified1085 ###1086 #kver=`uname -r`1087 if [ "${kernelname}" != "" ]1088 then1089 kver=${kernelname}1090 else1091 kver=`uname -r`1092 fi1093 ###1094 ### Sq-Modification end1095 ###1096 searchpath=/lib/modules/$kver1097 fi1098 1099 echo -en "for outerloop in 1 2 3 4 5 ; do\necho -en \".\"\n" >> $outfile1100 list_to_echo="$MODULES"1101 # Remove unwanted modules from list1102 for i in $DENY_MODS; do1103 list_to_echo=`echo ${list_to_echo} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '`1104 EXTRA_MODS=`echo ${EXTRA_MODS} | tr ' ' '\n' | grep -Ev "^${i}$" | tr '\n' ' '`1105 done1106 1107 # Make temporary modprobe.conf file if we are told so1108 if [ "$tmpmodprobe_flag" = "Y" ] ; then1109 infile="$MINDI_TMP/modprobe.conf.mindi"1110 find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat > $infile1111 else1112 infile="/etc/modules.conf"1113 fi1114 1115 for module in $list_to_echo $EXTRA_MODS ; do1116 params=`sed -n "s/^options \\+$module \\+//p" $infile`1117 modpaths=`FindSpecificModuleInPath $searchpath $module`1118 for i in $modpaths ; do1119 echo "MyInsmod $i $params > /dev/null 2> /dev/null" \1120 | tr '.' '#' \1121 | sed s/#o#gz/#o/ \1122 | sed s/#o#gz/#o/ \1123 | sed s/#ko#gz/#ko/ \1124 | sed s/#ko#gz/#ko/ \1125 | tr '#' '.' >> $outfile1126 echo -en "$i added to module list.\n" >> $LOGFILE1127 done1128 done1129 echo -en "done\n" >> $outfile1130 echo "echo \"Done.\"" >> $outfile1131 chmod +x $outfile1132 cd /1133 # Remove temporary modprobe.conf file if we have created one1134 if [ "$tmpmodprobe_flag" = "Y" ] ; then1135 rm -f $infile1136 fi1137 }1138 1139 1140 1071 MakeMountlist() { 1141 1072 local scratchdir mountlist all_partitions current_partition \ … … 2555 2486 cd $old_pwd 2556 2487 echo -en "..." 2557 MakeModuleLoadingScript $TMPMODPROBE_FLAG $mountpoint/sbin/insert-all-my-modules2558 echo -en "..."2559 2488 old_pwd=`pwd` 2560 2489 if [ "$YOUR_KERNEL_SUCKS" ] ; then … … 2722 2651 echo "-----------------------------" >> $LOGFILE 2723 2652 2724 if [ -e "/etc/conf.modules" ] && [ ! -e "/etc/modules.conf" ] ; then2725 LogIt "WARNING - Ancient distro detected." 12726 ln -sf /etc/conf.modules /etc/modules.conf2727 fi2728 2653 [ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat 2729 2654 … … 2760 2685 2761 2686 [ "`uname -r | grep "2.4.[0-6]" | grep -v "2.4.[0-9][0-9]"`" != "" ] && echo "WARNING! Your kernel may have buggy loopfs code. Consider upgrading to 2.4.7" 2762 # If we have a 2.6 kernel, the system uses module-init-tools which means that we2763 # may have the modprobe configuration spread out across multiple files in2764 # directory /etc/modprobe.d. If this is the case we concatenate these files into2765 # a temporary file for further processing. Otherwise we continue in the standard2766 # way. Note further that in case /etc/modprobe.d exists, we use it and ignore2767 # /etc/modprobe.conf which is exactly what module-init-tools does. The temporary2768 # modprobe.conf file is created in MakeModuleLoadingScript. AL041128.2769 if [ -d "/etc/modprobe.d" ] && [ "`uname -r | cut -c1-3`" = "2.6" ] ; then2770 TMPMODPROBE_FLAG="Y"2771 else2772 TMPMODPROBE_FLAG="N"2773 [ -e "/etc/modprobe.conf" ] && [ ! -e "/etc/modules.conf" ] && ln -sf /etc/modprobe.conf /etc/modules.conf2774 [ ! -e "/etc/modules.conf" ] && Die "/etc/modules.conf not found; you may have to create a softlink from /etc/conf.modules to /etc/modules.conf; of course, all good distros use modules.conf anyway..."2775 fi2776 2687 2777 2688 # Update the PATH variable if incomplete
Note:
See TracChangeset
for help on using the changeset viewer.