Changeset 1922 in MondoRescue for branches/2.2.6/mindi/mindi


Ignore:
Timestamp:
Apr 17, 2008, 12:32:36 PM (16 years ago)
Author:
Bruno Cornec
Message:
  • MakeModuleLoadingScript (mindi), MyInsmod, InsertEssentialModules (init) removed
  • Simplification of modules handling when not using udev, which makes code cleaner and more common with the udev code.
  • Usage of modprobe systematically.
  • Do not mess with modules.conf anymore. Just use what is in deplist.txt
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mindi/mindi

    r1919 r1922  
    10691069
    10701070
    1071 MakeModuleLoadingScript() {
    1072     local module fname params modpath kver outerloop i modpaths kver searchpath list_to_echo j
    1073     tmpmodprobe_flag=$1
    1074     outfile=$2
    1075     > $outfile || Die "Cannot create empty $outfile"
    1076     echo -en "#\041/bin/sh\n\n" >> $outfile
    1077     echo "echo -en \"Loading your modules...\"" >> $outfile
    1078     if [ "$YOUR_KERNEL_SUCKS" ] ; then
    1079         kver=$FAILSAFE_KVER
    1080         cd $MINDI_TMP
    1081         searchpath=lib/modules/$kver
    1082     else
    1083 ###
    1084 ### Sq-Modification ... Use kernelname for module search path if specified
    1085 ###
    1086         #kver=`uname -r`
    1087         if [ "${kernelname}" != "" ]
    1088         then
    1089             kver=${kernelname}
    1090         else
    1091             kver=`uname -r`
    1092         fi
    1093 ###
    1094 ### Sq-Modification end
    1095 ###
    1096         searchpath=/lib/modules/$kver
    1097     fi
    1098    
    1099     echo -en "for outerloop in 1 2 3 4 5 ; do\necho -en \".\"\n" >> $outfile
    1100     list_to_echo="$MODULES"
    1101     # Remove unwanted modules from list
    1102     for i in $DENY_MODS; do
    1103         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     done
    1106 
    1107     # Make temporary modprobe.conf file if we are told so
    1108     if [ "$tmpmodprobe_flag" = "Y" ] ; then
    1109         infile="$MINDI_TMP/modprobe.conf.mindi"
    1110         find /etc/modprobe.d -maxdepth 1 -name "*" -xtype f -print0 | xargs -0 cat > $infile
    1111     else
    1112         infile="/etc/modules.conf"
    1113     fi
    1114 
    1115     for module in $list_to_echo $EXTRA_MODS ; do
    1116         params=`sed -n "s/^options \\+$module \\+//p" $infile`
    1117         modpaths=`FindSpecificModuleInPath $searchpath $module`
    1118         for i in $modpaths ; do
    1119             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 '#' '.' >> $outfile
    1126             echo -en "$i added to module list.\n" >> $LOGFILE
    1127         done
    1128     done
    1129     echo -en "done\n" >> $outfile
    1130     echo "echo \"Done.\"" >> $outfile
    1131     chmod +x $outfile
    1132     cd /
    1133     # Remove temporary modprobe.conf file if we have created one
    1134     if [ "$tmpmodprobe_flag" = "Y" ] ; then
    1135         rm -f $infile
    1136     fi
    1137 }
    1138 
    1139 
    11401071MakeMountlist() {
    11411072    local scratchdir mountlist all_partitions current_partition \
     
    25552486    cd $old_pwd
    25562487    echo -en "..."
    2557     MakeModuleLoadingScript $TMPMODPROBE_FLAG $mountpoint/sbin/insert-all-my-modules
    2558     echo -en "..."
    25592488    old_pwd=`pwd`
    25602489    if [ "$YOUR_KERNEL_SUCKS" ] ; then
     
    27222651echo "-----------------------------" >> $LOGFILE
    27232652
    2724 if [ -e "/etc/conf.modules" ] && [ ! -e "/etc/modules.conf" ] ; then
    2725     LogIt "WARNING - Ancient distro detected." 1
    2726     ln -sf /etc/conf.modules /etc/modules.conf
    2727 fi
    27282653[ -e "/sbin/mkdosfs" ] && [ ! -e "/sbin/mkfs.vfat" ] && ln -sf /sbin/mkdosfs /sbin/mkfs.vfat
    27292654
     
    27602685
    27612686[ "`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 we
    2763 # may have the modprobe configuration spread out across multiple files in
    2764 # directory /etc/modprobe.d. If this is the case we concatenate these files into
    2765 # a temporary file for further processing. Otherwise we continue in the standard
    2766 # way. Note further that in case /etc/modprobe.d exists, we use it and ignore
    2767 # /etc/modprobe.conf which is exactly what module-init-tools does. The temporary
    2768 # modprobe.conf file is created in MakeModuleLoadingScript. AL041128.
    2769 if [ -d "/etc/modprobe.d" ] && [ "`uname -r | cut -c1-3`" = "2.6" ] ; then
    2770     TMPMODPROBE_FLAG="Y"
    2771 else
    2772     TMPMODPROBE_FLAG="N"
    2773     [ -e "/etc/modprobe.conf" ] && [ ! -e "/etc/modules.conf" ] && ln -sf /etc/modprobe.conf /etc/modules.conf
    2774     [ ! -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 fi
    27762687
    27772688# Update the PATH variable if incomplete
Note: See TracChangeset for help on using the changeset viewer.