Loading modules at boot-time.

2,638 views
Skip to first unread message

o0110o

unread,
Jan 5, 2010, 10:07:38 PM1/5/10
to Android Linux Kernel Development
How do I load certain modules at boot-time when there is no /etc/
modules.conf?
I apologize in advance for my inexperience, and I would greatly
appreciate some help.

Thanks, Jared

Chew Esmero

unread,
Jan 6, 2010, 8:15:54 PM1/6/10
to Android Linux Kernel Development
Modify init.rc and add "insmod <path_of_driver>/<name_of_driver>.ko"
without the "".
Usually modules are copied to system/lib/modules/...
Hope this can help.

o0110o

unread,
Jan 6, 2010, 10:11:15 PM1/6/10
to Android Linux Kernel Development
Thanks for your response. I'm working with Android-x86 1.6 (donut)
source, and I've found several versions of init.rc located in the sub-
folders. Could you point me in the right direction please :)

zhang derrick

unread,
Jan 7, 2010, 7:55:43 AM1/7/10
to android...@googlegroups.com
there are two files for .rc file, one is default file named init.rc in android/system/core/rootdir/init.rc and
another is used for hardware in android/system/core/rootdir/etc/init.XXXX.rc , XXXX instead of HW code, such as
qcom, goldfish, it's according to you phone HW.

Derrick.

2010/1/7 o0110o <g.sys.is@gmail.com>

Chew Esmero

unread,
Jan 7, 2010, 8:45:20 PM1/7/10
to Android Linux Kernel Development
I'm not sure with the x86 source code. I'm using donut source for
devphone right now and the init.rc I modified is the one in system/
core/rootdir/init.rc (which is working). Try modifying that file.

Yi Sun

unread,
Jan 7, 2010, 8:57:35 PM1/7/10
to android...@googlegroups.com, Android Linux Kernel Development
If you are using android-x86 the you don't need to change init.rc.
Take a look at the autodetect script in the newinstaller directory.
For quicker answer on android-x86, please send question to android-x86
discussion group.
Yi

o0110o

unread,
Jan 7, 2010, 10:25:30 PM1/7/10
to Android Linux Kernel Development
Will try out your suggestions A.S.A.P.
Thanks everybody!

On Jan 7, 10:57 pm, Yi Sun <beyo...@gmail.com> wrote:
> If you are using android-x86 the you don't need to change init.rc.  
> Take a look at the autodetect script in the newinstaller directory.  
> For quicker answer on android-x86, please send question to android-x86  
> discussion group.
> Yi
>

Yi Sun

unread,
Jan 7, 2010, 11:38:31 PM1/7/10
to android...@googlegroups.com
here is the path of the script and I'm assuming you have already
changed the configuration file to build your module
bootable/newinstaller/initrd/scripts/0-auto-detect

--
Android-x86
http://www.android-x86.org

o0110o

unread,
Jan 8, 2010, 8:23:05 AM1/8/10
to Android Linux Kernel Development
Here is an example of a modules.conf I had lying around:

"# /etc/modules: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line. Comments begin with
# a "#", and everything on the line after them are ignored.

loop
input
usbkbd
usbmouse
joydev
sunrpc
lockd........."


and here is an example of bootable/newinstaller/initrd/scripts/0-auto-
detect:

"# By Chih-Wei Huang <cwh...@linux.org.tw>
# Last updated 2009/08/14
#
# License: GNU Public License
# We explicitely grant the right to use the scripts
# with Android-x86 project.
#

# An auto detect function provided by kinneko
auto_detect()
{
tmp=/tmp/dev2mod
echo 'dev2mod() { while read dev; do case $dev in' > $tmp
sort -r /lib/modules/`uname -r`/modules.alias | \
sed -n 's/^alias *\([^ ]*\) *\(.*\)/\1)modprobe \2;;/p' >> $tmp
echo 'esac; done; }' >> $tmp
source $tmp
cat /sys/bus/*/devices/*/modalias | dev2mod
}

# FB0DEV: framebuffer driver
# LANDEV: lan driver
# WIFDEV: wifi driver
# SNDDEV: sound driver
# CAMDEV: camera driver
# PREDEV: any module the drivers depend on but can't be loaded
automatically
# EXTMOD: any other module

asus_info()
{
# common for all Eee PC models
[ -c /dev/fb0 ] || FB0DEV=i915
EXTMOD=eeepc-laptop
PREDEV=snd-hda-codec-realtek
SNDDEV=snd-hda-intel
CAMDEV=uvcvideo

board=`cat /sys/class/dmi/id/product_name`
# assume Eee PC models
case "$board" in
700|701|702|900)
LANDEV=atl2
WIFDEV=ath5k
;;
701SD|900SD)
LANDEV=atl1e
WIFDEV=rtl8187se
;;
900A|904HD|1000HD)
LANDEV=atl1e
WIFDEV=ath5k
;;
901|1000|1000H)
LANDEV=atl1e
WIFDEV=rt2860sta
;;
ET1602*)
FB0DEV=
UVESA_MODE=${UVESA_MODE:-1366x768}
LANDEV=r8169
WIFDEV=rt2860sta
;;
T91)
FB0DEV=
UVESA_MODE=${UVESA_MODE:-1024x600}
LANDEV=atl1e
WIFDEV=ath9k
;;
A6VM*)
EXTMOD=asus-laptop
LANDEV=skge
WIFDEV=ipw2200
;;
*)
LANDEV=atl1e
WIFDEV=ath9k
;;
esac
}

samsung_info()
{
[ -c /dev/fb0 ] || FB0DEV=i915
EXTMOD=hso
PREDEV=snd-hda-codec-realtek mii rfkill
SNDDEV=snd-hda-intel
CAMDEV=gspca_vc032x
WIFDEV=ath5k
LANDEV=b44
}
......"


The 2 of these files look somewhat foreign from each other to me lol.
I would like to know how to incorporate the first example into the
second example. It's nice to see people help out the way you all do on
here. BTW I can provide more complete examples if you request them. :)

Jared

Reply all
Reply to author
Forward
0 new messages