[Buildroot] init module i2c-dev automatically

Óscar Gómez Fuente oscargomezf at gmail.com
Tue Mar 15 15:20:35 UTC 2016


OK,

For example a /etc/init.d/S18loadmod script like this:
---
#!/bin/sh
#
# load modules
#

MODULES_PATH="/etc/modules"

case "$1" in
start)
echo "Loading modules in ${MODULES_PATH}..."
for line in $(cat ${MODULES_PATH});
do
[[ $line = \#* ]] && continue
modprobe $line;
done
;;
stop)
;;
restart|reload)
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

exit $?
---

Oscar Gomez Fuente

On 15 March 2016 at 16:05, Thomas Petazzoni <
thomas.petazzoni at free-electrons.com> wrote:

> Hello,
>
> On Tue, 15 Mar 2016 15:54:54 +0100, Óscar Gómez Fuente wrote:
>
> > I'm using buildroot with Init System  busybox and /dev management:
> Dynamic
> > using devtmpfs + eudev.
> >
> > How can I load the i2c-dev module automatically in the init?
> >
> > I'm trying to create the file /etc/modules with the line i2c-dev, but it
> > doesn't work.
>
> You need to create an init script that loads your module, or
> alternatively reads /etc/modules and loads the modules listed in this
> file. We don't have a mechanism that automatically loads such modules
> (real device drivers are loaded automatically by udev, but i2c-dev is
> kind of a special case).
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160315/d31642c3/attachment-0002.html>


More information about the buildroot mailing list