Hello Erich Alexm list

This part of the script comes from a time that insmod was not so flexible.
You could only insmod a modules if you gave the complete path.
The idea was that if a module has to be added which could be the case at new
setup, the modules would still be on the boot media  ( speak floppy here),
So you had to wait for the whole bootup /package load process, and then after
lots of packages failed because ne.o wasn't loaded, you could copy the module
to /lib/modules and things would run.
As I "remote controlled" my monitor less box, I had allways the trouble copying
those in , and I created this workaround. At that time, there wasn't the link
to /lib/modules/"kernelversion" in linuxrc. so modules on a cd were not found.

I think it is best to remove the whole bunch.
and replace modutils with

#!/bin/ash
grep ^[::alphanum..] /etc/modules | while read module args
do
        case "$module" in
                \#*|"") continue ;;
                        *)  insmod $module $args
        esac
        echo -n "$module - "
done

To copy modules from a bootdisk, there would be better a "setup.lrp" which
would do such things at first boot.

PS
The script could probably be even improved without the case
#!/bin/bash                                                               
grep ^[a-z0-9A-Z] /etc/modules |while read module args                    
do
 insmod $module $args 2>/dev/null                                         
 lsmod |grep -n -q  ^$module || \
     logger modutils module $module could not be loaded                   
done


Regards
Eric Wolzak
member of the bering Crew


> Alex
>
> At 15:11 29.12.2003 +0100, Alex Rhomberg wrote:
> >...
> >> It starts its search at /, which is probably fine to detect all
> >> sorts of modules in the directory tree.
> >
> >This obviously is the part that produces the original error message.
> >
> >Not looking everywhere for modules might break some setups things.
> >Unfortunately, busybox find provides neither -xdev nor -prune to avoid
> >looking in /proc. I suggest just throwing away find's stderr
> >
> >> # echo ip_conntrack_irc.o | cut -c-8
> >
> >> This IMHO does not enhance the chance to find the correct module and
> >should > be done away with.
> >
> >I agree. I propose
> >
> >    echo -n "$module - "
> >    MODTOLOAD=`find / -name $module.o 2>/dev/null | head -n 1`
> >    if [ ! "$MODTOLOAD" = "" ] ;then
> >      insmod $MODTOLOAD $args
> >    else
> >      echo "not found"
> >    fi
> >
> >Discussion:
> >- throw away error messages of find
>
> better log them somewhere....
>
> MODTOLOAD=`find / -name $module.o 2>/tmp/$0.log | head -n 1 ;`
> [ ! -z /tmp/$0.log ] && logger $0 `cat /tmp/$0log ;`
> rm -f /tmp/$0.log;
>
> >- why the sort? doesn't make sense to me at all.
>
> Agreed
>
> >- I prefer head -n 1 to sed -n 1p
>
> It is probably faster too...
>
> >- forget the search with 8.3
> >- error reporting
>
> see above
>
> Erich
>
> THINK
> Püntenstrasse 39
> 8143 Stallikon
> mailto:[EMAIL PROTECTED]
> PGP Fingerprint: BC9A 25BC 3954 3BC8 C024 8D8A B7D4 FF9D 05B8 0A16
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
> Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id 78&alloc_id371&opÀick
>
> _______________________________________________
> leaf-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/leaf-devel




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click

_______________________________________________
leaf-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to