Difference between revisions of "LeapFrog Pollux Platform: Mount NFS Directory"

From eLinux.org
Jump to: navigation, search
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
This is a tutorial to setup a static IP address on your explorer, the explorer g_ether gadget and then use this to mount an NFS folder from your host PC on your explorer. doing this will enable you to test applications/scripts without having to copy anything to your explorer, its going to be fairly slow so your mileage may vary.
+
== Summary ==
 +
This is a tutorial to setup an NFS folder on your host PC for your explorer to boot from. NFS mounting of a directory will enable you to test applications and scripts without having to copy anything to your Leapster or LeapPad Explorer.
  
I'd like to thank Nirvous, NullMoogleCable, PhillKll, Claude, JKent, Jburks, GrizzlyAdams and anyone I may have forgotten for their help :)
+
== Prerequisites ==
 +
[[LeapFrog_Pollux_Platform:_Networking| Networking Setup]]
  
1. setup a network between the explorer and your host system
+
For Didj [[Didj_Enable_Networking| Enable Networking]] using the lf1000_ff_eth_defconfig file or manually adding NFS support.
  
You can start the explorer and have it default to a static IP address by simply holding down the brightness button at boot time. Simply edit /etc/init.d/networking, look for any place there is an IP address and replace it with yours, you should also change the bit after the slash to set your netmask), edit lines 32 and 41:
 
  
<code>
+
== Software Needed ==
  ifconfig usb0 192.168.0.111/24
+
Linux host PC
</code>
 
  
and make them look like this:
+
nfs-kernel-server
  
<code>
+
nfs-common
  ifconfig usb0 10.0.1.2 netmask 255.255.255.0
 
</code>
 
 
 
Now plug in a mini usb cable and Reboot and as soon as you see:
 
Emerald Base: Starting /etc/init.d/networking ...
 
Emerald Base: /etc/init.d/networking: Holding brightness: forcing static IP
 
  
on the console then it is safe to let go.
 
  
You can make this permanent so that you don't have to hold down brightness by removing the avahi flag:
+
== Configure Server and Client ==
 +
'' On Host ''
  
<code>
+
Make sure your programs are installed.
  rm /flags/avahi
+
sudo apt-get nfs-kernel-server nfs-common
</code>
 
  
now reboot and you will get your static IP address assigned
 
  
2. Configure the host
+
Configure the /etc/exports file to point to the folder(s) you would like to make available for NFS mounting. Be sure to specify the IP of your device, otherwise anyone can mount it.
 +
/home    10.0.0.2(rw,sync,no_root_squash)
  
Once this is done you need to configure the host:
 
  
I'm using ubuntu 10.04, it has a automatic configuration, I've set mine so that auto usb0 has the ipv4, method setting of 'local-link only' and in auto eth2 I have hardcoded the ip address to 10.0.1.1, netmask 255.255.255.0, gateway of 0.0.0.0
+
'' On Device ''
  
to setup the nfs stuff, follow this simple tutorial:
+
You'll need to edit /usr/bin/mountnfs, change:
 
+
  mount -o nolock `get-ip host`:/home/lfu/nfsroot/LF /LF
https://help.ubuntu.com/8.04/serverguide/C/network-file-system.html
+
to:
 +
  mount -o nolock 10.0.0.1:/home/ /mnt
  
3. Configure the explorer
+
Start the server and client:
  
then on the explorer you need to edit /usr/bin/mountnfs, change:
 
 
<code>
 
  mount -o nolock `get-ip host`:/home/lfu/nfsroot/LF /LF
 
</code>
 
 
to:
 
  
<code>
+
'' On Host ''
  mount -o nolock 10.0.1.1:/home/ /mnt
+
$ sudo /etc/init.d/nfs-kernel-server start
</code>
 
  
once you've done that, do:
 
  
<code>
+
''' For Leapster and LeapPad Explorers '''
  modprobe nfs
 
  mountnfs
 
  cd /mnt
 
  ls
 
</code>
 
  
and you should see the contents of your /home dir
+
'' On Device ''
 +
# modprobe nfs
 +
# mountnfs
 +
# cd /mnt
 +
# ls
  
4. things to note
 
  
obviously you can set whatever folder you like on the host as an nfs share and mount it to any folder you like on the explorer or make a new dir, just make sure you edit /etc/exports on the host and /usr/bin/mountnfs accordingly, so for instance if I want to use /home/didj then on the host machine I would edit /etc/exports and either edit the existing one or add the line:
+
''' For Network Enabled Didj '''
  
<code>
+
mount -o nolock 10.0.0.1:/home /mnt
  /home/didj    *(rw,sync,no_root_squash)
 
</code>
 
  
and edit /usr/bin/mountnfs, either add another line or edit the existing one:
 
  
<code>
+
At this point should see the contents of your /home dir
  mount -o nolock 10.0.0.1:home/didj /LF/test
 
</code>
 
  
you could quite easily at this stage make a /LF/test/bin folder, add that to your path environment variable and run any script/app you have made/compiled for the explorer without having to copy it to the first.
 
  
next up will be mounting a rootfs via NFS :)
+
[[Category:Didj]]
 +
[[Category:Leapster Explorer]]
 +
[[Category:LeapPad Explorer]]
 +
[[Category:LeapFrog Pollux Platform]]

Latest revision as of 00:37, 12 July 2011

Summary

This is a tutorial to setup an NFS folder on your host PC for your explorer to boot from. NFS mounting of a directory will enable you to test applications and scripts without having to copy anything to your Leapster or LeapPad Explorer.

Prerequisites

Networking Setup

For Didj Enable Networking using the lf1000_ff_eth_defconfig file or manually adding NFS support.


Software Needed

Linux host PC

nfs-kernel-server

nfs-common


Configure Server and Client

On Host

Make sure your programs are installed.

sudo apt-get nfs-kernel-server nfs-common


Configure the /etc/exports file to point to the folder(s) you would like to make available for NFS mounting. Be sure to specify the IP of your device, otherwise anyone can mount it.

/home    10.0.0.2(rw,sync,no_root_squash)


On Device

You'll need to edit /usr/bin/mountnfs, change:

 mount -o nolock `get-ip host`:/home/lfu/nfsroot/LF /LF

to:

 mount -o nolock 10.0.0.1:/home/ /mnt

Start the server and client:


On Host

$ sudo /etc/init.d/nfs-kernel-server start


For Leapster and LeapPad Explorers

On Device

# modprobe nfs
# mountnfs
# cd /mnt
# ls


For Network Enabled Didj

mount -o nolock 10.0.0.1:/home /mnt


At this point should see the contents of your /home dir