Changeset 1922 in MondoRescue for branches/2.2.6/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
Location:
branches/2.2.6/mindi
Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mindi/deplist.txt

    r1902 r1922  
    2525
    2626#-------------------------------- ESSENTIAL -----------------------------------
    27 fstab raidtab modules.conf conf.modules mondorestore modules.conf.local
     27fstab raidtab
     28/usr/sbin/mondorestore
    2829/etc/mdadm/mdadm.conf /etc/mdadm.conf
    2930/sbin/ldconfig
     
    3334bzip2 bunzip2 lzop
    3435ctrlaltdel
    35 # Do not remove as they need to be aligned with the kernel
    36 insmod lsmod
     36# Everything needed to handle modules correctly
     37insmod lsmod /sbin/modprobe
     38/etc/modprobe.d /etc/modprobe.conf /etc/modules.conf /etc/conf.modules /etc/modules.conf.local
     39
    3740hosts host.conf resolv.conf hosts.allow hosts.deny nsswitch.conf
    3841klogd sysklogd
     
    5962# gdb valgrind /usr/lib/valgrind
    6063
    61 #----------------- For all you LVM users out there, much love -----------------
    62 LVMFILES:
    63 lvmiopversion lvchange lvcreate lvdisplay lvextend lvmchange lvmcreate_initrd lvmdiskscan lvmsadc lvmsar lvreduce lvremove lvrename lvscan pvchange pvcreate pvdata pvdisplay pvmove pvscan vgcfgbackup vgcfgrestore vgchange vgck vgcreate vgdisplay vgexport vgextend vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgscan vgsplit liblvm lvm lvm-10 /etc/lvm/lvm.conf
    64 #------------------------------------------------------------------------------
    6564#
    6665# Proliant extended support if available
     
    6867conrep cpqacuxe hponcfg
    6968lshw
     69#----------------- For all you LVM users out there, much love -----------------
     70LVMFILES:
     71lvmiopversion lvchange lvcreate lvdisplay lvextend lvmchange lvmcreate_initrd lvmdiskscan lvmsadc lvmsar lvreduce lvremove lvrename lvscan pvchange pvcreate pvdata pvdisplay pvmove pvscan vgcfgbackup vgcfgrestore vgchange vgck vgcreate vgdisplay vgexport vgextend vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgscan vgsplit liblvm lvm lvm-10 /etc/lvm/lvm.conf
     72#------------------------------------------------------------------------------
  • 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
  • branches/2.2.6/mindi/rootfs/sbin/init

    r1910 r1922  
    7979    openvt 7 /bin/sh /sbin/wait-for-petris
    8080    openvt 8 /usr/bin/tail -f $LOGFILE
     81    # May avoid shell error messages
     82    chmod 666 /dev/tty* /dev/console
    8183}
    8284
     
    162164    fi
    163165    echo "Activating a potential USB Storage device"
    164     if [ -f usb-storage.ko ] || [ -f usb-storage.ko.gz ]; then
    165         if [ -e "/tmp/USE-UDEV" ] ; then
    166             modprobe -q usb-storage
    167         else
    168             insmod usb-storage.ko*
    169         fi
    170     fi
     166    modprobe -q usb-storage
    171167    for i in 1 2 3 4 5 6 7 8 9 10 ; do
    172168        sleep 1
     
    199195HowMuchFreeSpaceOnRamdisk() {
    200196   df -m -P | grep /dev/ram | head -n1 | tr -s '\t' ' ' | cut -d' ' -f4
    201 }
    202 
    203 
    204 
    205 InsertEssentialModules() {
    206 #   Load the VIA IDE module first thing if it exists (requires ide-core).
    207 #   This is to ensure that DMA is working for VIA chipsets with 2.6 kernels.
    208     for module in /ide-core.ko* /via82cxxx.ko*; do
    209         [ -f "$module" ] && MyInsmod $module > /dev/null 2> /dev/null
    210     done
    211 #   Then load the remaining modules in normal (i.e. arbitrary) order.
    212     for j in 1 2 3 4 5 ; do
    213         for i in `ls /*.*o* 2> /dev/null` ; do
    214             [ -f "$i" ] && MyInsmod $i > /dev/null 2> /dev/null
    215         done
    216     done
    217197}
    218198
     
    314294    fi
    315295    create_dev_makedev
    316     # May avoid shell error messages
    317     chmod 644 /dev/tty*
    318296    if [ -x /sbin/udevsettle ]; then
    319297        /sbin/udevsettle
     
    389367    return
    390368fi
    391 if [ -e "/tmp/USE-UDEV" ] ; then
    392     if [ -f uhcd_hci.ko ] || [ -f uhcd_hci.ko.gz ]; then
    393         modprobe -q uhcd_hci
    394     fi
    395     if [ -f usbhid.ko ] || [ -f usbhid.ko.gz ]; then
    396         modprobe -q usbhid
    397     fi
    398 else
    399     if [ -f uhcd_hci.ko ]; then
    400         insmod uhcd_hci.ko
    401     fi
    402     if [ -f usbhid.ko ]; then
    403         insmod usbcore.ko
    404         insmod usbhid.ko
    405     fi
    406 fi
     369modprobe -q uhcd_hci
     370modprobe -q usbhid
    407371}
    408372
     
    413377        LogIt "Scanning LVM's..." 1
    414378        if which lvm ; then
    415             MyInsmod dm-mod
    416             MyInsmod dm_mod
     379            modprobe -q dm-mod
     380            modprobe -q dm_mod
    417381            lvm vgscan --mknodes
    418382        else
     
    566530ModprobeAllModules() {
    567531
    568     for m in `find /lib/modules -name '*.ko*'`; do
     532    for m in `find /lib/modules -name '*\.ko*' -o -name '*\.o*'`; do
    569533        j=`basename $m | sed 's/\.ko.*$//'`
     534        j=`basename $m | sed 's/\.o.*$//'`
    570535        echo "$DENY_MODS" | grep -q "$j "
    571536        if [ $? -eq 0 ]; then
     
    584549    PKLVL=`cut -f1 /proc/sys/kernel/printk`
    585550    echo 0 > /proc/sys/kernel/printk
    586     if [ ! -e "/tmp/USE-UDEV" ] ; then
    587         echo "Inserting modules ..."
    588         insert-all-my-modules >> $LOGFILE 2>> $LOGFILE
    589         for i in $FORCE_MODS; do
    590             MyInsmod $i
    591         done
    592     else
    593         ModprobeAllModules
    594     fi
     551    ModprobeAllModules
    595552    echo $PKLVL > /proc/sys/kernel/printk
    596553}
     
    654611PKLVL=`cut -f1 /proc/sys/kernel/printk`
    655612echo 0 > /proc/sys/kernel/printk
    656 if [ ! -e "/tmp/USE-UDEV" ] ; then
    657     InsertEssentialModules
    658 else
    659     ModprobeAllModules
    660 fi
     613ModprobeAllModules
    661614echo $PKLVL > /proc/sys/kernel/printk
    662615
Note: See TracChangeset for help on using the changeset viewer.