Difference between revisions of "Didj Enable Networking"
(→Kernel Configuration) |
(→Hardware Needed) |
||
(28 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | == | + | == Summary == |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
This how-to outlines the basic steps to enabling networking via the USB gadget Ethernet driver (g_ether) contained in the LF 2009 sources. | This how-to outlines the basic steps to enabling networking via the USB gadget Ethernet driver (g_ether) contained in the LF 2009 sources. | ||
Following the steps contained herein should result in a functioning Ethernet connection and the ability to telnet into the device via USB. | Following the steps contained herein should result in a functioning Ethernet connection and the ability to telnet into the device via USB. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
The version of g_ether we are using does '''not''' support Windows at this time (due to what seems to be a broken RNDIS implementation in this version of ether.c). | The version of g_ether we are using does '''not''' support Windows at this time (due to what seems to be a broken RNDIS implementation in this version of ether.c). | ||
Line 23: | Line 10: | ||
+ | == Software Needed == | ||
+ | [[LeapFrog_Pollux_Platform:_Source_Code#Didj| Source Code]] (Didj-Linux-4222-20090422-1236.tar.gz) | ||
− | |||
− | + | == Hardware Needed == | |
+ | [[LeapFrog_Pollux_Platform:_Console_Access| Console Access]] | ||
− | + | == Build Module == | |
+ | ==== Kernel Configuration ==== | ||
− | + | Out of the box, neither networking support nor the PTY devices used by busybox/telnetd are enabled in the stock Didj kernel. There are two ways to enable this. You can manually configure the kernel with make menuconfig, or use a configuration included in the Didj sources, lf1000_tt_eth_defconfig. | |
− | + | ''' Using alternate included config file ''' | |
− | + | More information on configuring [[LeapFrog_Pollux_Platform:_Kernel_Configuration#Using_Preexisting_Config| using preexisting config]] | |
− | + | '' On Host '' | |
+ | cd SOURCE_CODE/linux-2.6.20-lf1000 | ||
+ | $ make lf1000_ff_eth_defconfig | ||
− | + | Your config file is now loaded, and you are ready to proceed. | |
− | + | ''' Using make menuconfig ''' | |
− | + | More information on configuring [[LeapFrog_Pollux_Platform:_Kernel_Configuration#Make_Menuconfig| using make menuconfig]] | |
− | |||
− | |||
+ | '' On Host '' | ||
cd SOURCE_CODE/linux-2.6.20-lf1000 | cd SOURCE_CODE/linux-2.6.20-lf1000 | ||
− | make menuconfig | + | $ make menuconfig |
− | |||
When the menu system launches, enable the following: | When the menu system launches, enable the following: | ||
Line 69: | Line 59: | ||
## If its not already pre-set, set 'Maximum number of legacy PTY in use' at 256 | ## If its not already pre-set, set 'Maximum number of legacy PTY in use' at 256 | ||
# Exit all the way out of the menu application, making sure to save the changes when prompted. | # Exit all the way out of the menu application, making sure to save the changes when prompted. | ||
− | |||
− | + | Your config file is now set, and you are ready to proceed. | |
+ | |||
+ | ==== Building Kernel ==== | ||
+ | [[LeapFrog_Pollux_Platform:_Build_Environment| Set up your Build Environment]] and from inside the kernel directory linux-2.6-lf1000/ run. | ||
+ | $ ./install.sh | ||
− | + | If everything is set up properly, this should fail trying to create some folders, which is after its built the kernel, which is fine, look in your TFTP_PATH directory, and you should see your zImage, which can be used to boot from an SD card or UART for testing purposes. | |
− | + | [[Didj_Boot_From_UART]] | |
− | + | == Install and Configure == | |
− | + | These steps, except for creating the device, will need to be repeated on each boot. If you'd like to make the USB device an Ethernet device permanently, you'll want to look into modifying the start up scripts. | |
+ | |||
+ | ==== Configure PTY device ==== | ||
+ | Programs like telnetd and dropbear require these devices to be configured in order to run. | ||
− | + | If not already created, create the node and directory for PTS | |
− | + | '' On Didj '' | |
+ | # mkdir --mode=755 /dev/pts | ||
+ | # mknod -m=666 /dev/ptmx c 5 2 | ||
− | + | Mount PTS | |
− | |||
− | + | '' On Didj '' | |
− | + | # mount -t devpts none /dev/pts | |
− | == Installing g_ether.ko == | + | You can also add this line to /etc/fstab for it to always mount |
+ | none /dev/pts devpts defaults 0 0 | ||
+ | |||
+ | ==== Installing g_ether.ko ==== | ||
First, boot the device, connect the USB cable, and [[Didj_USB_Mounting| mount the device as a drive.]] | First, boot the device, connect the USB cable, and [[Didj_USB_Mounting| mount the device as a drive.]] | ||
Line 106: | Line 106: | ||
Then, mount /Didj on your Didj: | Then, mount /Didj on your Didj: | ||
− | On | + | '' On Didj '' |
− | + | # usbctl -d mass_storage -a disable | |
Mounting /dev/mtdblock9 on /Didj as rw | Mounting /dev/mtdblock9 on /Didj as rw | ||
remove the g_file_storage kernel module: | remove the g_file_storage kernel module: | ||
− | + | $ rmmod g_file_storage | |
− | $rmmod g_file_storage | ||
and install g_ether.ko: | and install g_ether.ko: | ||
− | + | # cd /Didj | |
− | + | # insmod ./g_ether.ko | |
− | |||
ether gadget: using random self ethernet address | ether gadget: using random self ethernet address | ||
usb0: Ethernet Gadget, version: May Day 2005 | usb0: Ethernet Gadget, version: May Day 2005 | ||
Line 126: | Line 124: | ||
ether gadget: set_interface ignored! | ether gadget: set_interface ignored! | ||
− | |||
+ | ==== Set up TCP/IP ==== | ||
With the USB cable still connected to your host, configure an IP address (make sure this is a different subnet from your existing LAN). | With the USB cable still connected to your host, configure an IP address (make sure this is a different subnet from your existing LAN). | ||
+ | To quickly get up and running, use the Temporary Device and Host setups. Later you can make more permanent configurations. Although you can only have one, either Mass Storage or Ethernet operational at any given time. | ||
− | + | [[LeapFrog_Pollux_Platform:_Networking| Networking Setup]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ==== Add User ==== | |
+ | For logging in from remote hosts, you'll need a user. This can cause issues with permissions and what you can do. Some programs may allow root login with some extra configuration. | ||
− | + | '' On Didj '' | |
+ | # touch /etc/group | ||
+ | # echo root:x:0:0:root:/root:/ > /etc/passwd | ||
+ | # mkdir /home | ||
+ | # adduser didj | ||
+ | (this will prompt you for a password, can leave blank by hitting return twice, and ignoring the warnings.) | ||
− | |||
[[Category:Didj]] | [[Category:Didj]] | ||
+ | [[Category:LeapFrog_Pollux_Platform]] |
Latest revision as of 02:17, 14 July 2011
Contents
Summary
This how-to outlines the basic steps to enabling networking via the USB gadget Ethernet driver (g_ether) contained in the LF 2009 sources.
Following the steps contained herein should result in a functioning Ethernet connection and the ability to telnet into the device via USB.
The version of g_ether we are using does not support Windows at this time (due to what seems to be a broken RNDIS implementation in this version of ether.c).
To-dos: Investigate and address enabling g_ether connectivity to hosts running recent linux kernels, Windows, OS X...
Software Needed
Source Code (Didj-Linux-4222-20090422-1236.tar.gz)
Hardware Needed
Build Module
Kernel Configuration
Out of the box, neither networking support nor the PTY devices used by busybox/telnetd are enabled in the stock Didj kernel. There are two ways to enable this. You can manually configure the kernel with make menuconfig, or use a configuration included in the Didj sources, lf1000_tt_eth_defconfig.
Using alternate included config file
More information on configuring using preexisting config
On Host
cd SOURCE_CODE/linux-2.6.20-lf1000 $ make lf1000_ff_eth_defconfig
Your config file is now loaded, and you are ready to proceed.
Using make menuconfig
More information on configuring using make menuconfig
On Host
cd SOURCE_CODE/linux-2.6.20-lf1000 $ make menuconfig
When the menu system launches, enable the following:
- Networking
- Select: Networking-> Networking Options-> TCP/IP Networking
- Make sure its selected if not hit Spacebar to select TCP/IP Networking.
- Exit back to the main menu.
- USB Ethernet support
- Select: Device Drivers-> USB Support-> USB Gadget Support
- Hit spacebar to select USB Gadget Support
- Select: Ethernet Gadget (with CDC Ethernet support)
- Hit Spacebar to configure it as a kernel module <M>. Note: RNDIS support is listed, but it is broken, so deselect it.
- Exit up to device drivers
- PTY device support (for telnetd)
- Select: Device Drivers->Character Drivers->Unix98 PTY Support
- Hit Spacebar to select <*>
- Select: Device Drivers->Character Drivers->Legacy (BSD) PTY Support
- Hit Spacebar to select
- If its not already pre-set, set 'Maximum number of legacy PTY in use' at 256
- Exit all the way out of the menu application, making sure to save the changes when prompted.
Your config file is now set, and you are ready to proceed.
Building Kernel
Set up your Build Environment and from inside the kernel directory linux-2.6-lf1000/ run.
$ ./install.sh
If everything is set up properly, this should fail trying to create some folders, which is after its built the kernel, which is fine, look in your TFTP_PATH directory, and you should see your zImage, which can be used to boot from an SD card or UART for testing purposes.
Install and Configure
These steps, except for creating the device, will need to be repeated on each boot. If you'd like to make the USB device an Ethernet device permanently, you'll want to look into modifying the start up scripts.
Configure PTY device
Programs like telnetd and dropbear require these devices to be configured in order to run.
If not already created, create the node and directory for PTS On Didj
# mkdir --mode=755 /dev/pts # mknod -m=666 /dev/ptmx c 5 2
Mount PTS
On Didj
# mount -t devpts none /dev/pts
You can also add this line to /etc/fstab for it to always mount
none /dev/pts devpts defaults 0 0
Installing g_ether.ko
First, boot the device, connect the USB cable, and mount the device as a drive.
You'll find g_ether.ko in your kernel sources directory tree:
SOURCE_CODE/linux-2.6.20-lf1000/drivers/usb/gadget/g_ether.ko
Copy this to your Didj.
Inserting the g_ether.ko kernel module
First, if its still connected, unmount the /Didj partition from your host.
Then, mount /Didj on your Didj:
On Didj
# usbctl -d mass_storage -a disable Mounting /dev/mtdblock9 on /Didj as rw
remove the g_file_storage kernel module:
$ rmmod g_file_storage
and install g_ether.ko:
# cd /Didj # insmod ./g_ether.ko ether gadget: using random self ethernet address usb0: Ethernet Gadget, version: May Day 2005 usb0: using lf1000_udc, OUT ep2-bulk IN ep1-bulk usb0: MAC 46:ac:79:6e:92:e2 usb0: high speed config #1: 100 mA, Ethernet Gadget, using CDC Ethernet Subset ether gadget: set_interface ignored!
Set up TCP/IP
With the USB cable still connected to your host, configure an IP address (make sure this is a different subnet from your existing LAN). To quickly get up and running, use the Temporary Device and Host setups. Later you can make more permanent configurations. Although you can only have one, either Mass Storage or Ethernet operational at any given time.
Add User
For logging in from remote hosts, you'll need a user. This can cause issues with permissions and what you can do. Some programs may allow root login with some extra configuration.
On Didj
# touch /etc/group # echo root:x:0:0:root:/root:/ > /etc/passwd # mkdir /home # adduser didj (this will prompt you for a password, can leave blank by hitting return twice, and ignoring the warnings.)