usb/ethernet adapter automount with ifconfig
I would like to automatically have ethernet automatically start running everytime I reset my embedded system.
My system is running a small patched 2.6.10 downloaded from kernel.org. It would be difficult to change versions, and I hope that isn't necessary.
Currently, everytime I reset my system I need to retype in the command
ifconfig eth0 inet 10.1.1.101
Only after setting up that IP address am I able to communicate over ethernet.
I tried to set up my rc2.d directory with a few links to init.d.
/etc/rc2.d # ls -last
1 drwxr-xr-x 2 6424 6424 1024 May 2 2008 .
0 lrwxrwxrwx 1 6424 6424 18 May 2 2008 S60ethipadd -> ../init.d/ethipadd
0 lrwxrwxrwx 1 6424 6424 18 May 2 2008 S50ethsetup -> ../init.d/ethsetup
0 lrwxrwxrwx 1 6424 6424 20 Jun 19 2006 S10makedev.sh -> ../init.d/makedev.sh
0 lrwxrwxrwx 1 6424 6424 15 Jun 19 2006 S45inetd -> ../init.d/inetd
2 drwxr-xr-x 24 6424 6424 2048 Jan 1 00:00 ..
Where the links ethsetup and ethipadd contain the two commands:
/etc/init.d # cat ethsetup
# Setup for ethernet connectivity via the usb/ethernet adapter
echo "Forced Mode Host Command"
echo > /sys/devices/platform/container-dev-1/forced_mode host
/etc/init.d # cat ethipadd
# Setup the IP address
echo "Need to setup the IP address after auto-detect"
ifconfig eth0 inet 10.1.1.101
The fiirst (forced_mode) script works, but the second (ifconfig) doesn't work. This stems from that fact that my single board computer does not have hardware for ethernet support. Instead, we rely on a usb/ethernet adapter. That adapter gets mounted after all the init.d/rc initialization scripts have completed. Does anybody know of a way to add the ifconfig command at the end of the automount process???
Here is output from the end of my boot up (problems start at SIOCSIFADDR):
NAND device: Manufacturer ID: 0x20, Chip ID: 0x35 (ST Micro NAND 32MiB 1,8V 8-bit)
Scanning device for bad blocks
Creating 1 MTD partitions on "NAND 32MiB 1,8V 8-bit":
0x01000000-0x01f00000 : "LPC3180 NAND PART 0"
CSLIP: code copyright 1989 Regents of the University of California
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
PPP BSD Compression module registered
mmc-lpc3180: mmc/sd driver running on platform=lpc3180
: MMCI rev 0 cfg 00 at 0x20098000 irq 15,13
JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc.
Installing knfsd (copyright (C) 1996 firstname.lastname@example.org).
running on [console=ttyS0,115200n8 root=/dev/ram initrd=0x80800000,12M]
Mounting SD/USB storage
No SD card or unknown filesystem
No USB storage or unknown filesystem
INIT: Entering runlevel: 2
Creating the the /var/dev/ttySA* links
Starting internet superserver: inetd.
Forced Mode Host ComError: otg FSM in unkownen state. Forceing to idle
ohci ohci1: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ohci ohci1: new USB bus registered, assigned bus number 2
Need to setup the IP address after auto-detect
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
usb 2-1: new full speed USB device using ohci and address 2
eth0: register usbnet at usb-lpc3180-1, ASIX AX8817x USB 2.0 Ethernet, 00:10:60:0a:b3:34
Cinco de Mayo - ARM Embedded Linux version 1.1-vfp
Saturday 05 May 2007 @ 14:00
(none) login: root
BusyBox v0.60.5 (2004.05.11-13:49+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
~ # ls