Setting up GC-Linux with NBD-root

From gc-linux

Jump to: navigation, search

Contents

Files Needed

Working Environment

You'll need a PC to run the nbd (Network Block Device) server. Both Windows and Linux PCs work. This experimental release works, out of the box, on the following environment:

      Subnet: 192.168.0.0 255.255.255.0
 ----------+----------------------+--------
           |                      |
           |                      |
    +------+-------+       +------+-------+
    | nbd Server   |       | GameCube     |
    | 192.168.0.49 |       | 192.168.0.47 |
    +--------------+       +--------------+

You may need to perform some small changes if you are using different IP addresses.

You really don't need to change any of your IPs to run this release, unless:

  • you run a version of Windows older than Windows 2000 on your PC
  • you are using Windows on your PC and you are forced to use DHCP on the network interface connecting to your cube

In the rest of cases, simply adding the 192.168.0.49 IP address (without replacing your existing IP address) to the network interface that connects to your cube will work. You don't need to modify nor your existing PC address nor the IP address of the GameCube in PSO.

But... As people get into trouble doing this kind of things I've provided a second way for those of you hexedit lovers:

  1. Load zImage.nbdc6.dol in your favorite hexadecimal editor. (Like WinHex for Windows or GHex for Linux)
  2. Look for ip=192.168.000.047 and change it to ip=AAA.BBB.CCC.DDD where AAA.BBB.CCC.DDD is the IP address you want to give to your cube. You could also write ip=dhcp (pad with spaces) if you want to use DHCP, the resulting address will be printed on the screen.
  3. Look for nbdc_host=192.168.000.049 and change it to nbdc_host=AAA.BBB.CCC.EEE where AAA.BBB.CCC.EEE is the IP address of the PC where the nbd server runs.

Remember that the cube and the PC must reside on the same subnet.

Setting up the Server

Put these files on a directory where you have permissions.

zImage.nbdc6.dol
cube_roofs.rar
nbd-server         (Linux)
rootfs-nbd-server  (Linux)
nbdsrvr-0.2.zip    (Windows)
rootfs-nbdsrvr.bat (Windows)

Unpack the root filesystem image (1GB!).

 rar e cube_rootfs.rar

If running Linux you must make nbd-server and rootfs-nbd-server executable using chmod a+x before you can use them.

If running Windows extract nbdsrvr.exe from nbdsrvr-0.2.zip, and place it in the same directory as the other files.

Launch the nbd server.

 rootfs-nbdsrvr.bat (Windows)
 ./rootfs-nbd-server (Linux)

This assumes you are on the same directory as the nbd server executable and cube.rootfs. Also check that your firewall does not block connections to port 55321 on your PC from your GameCube

Using Debian's own NDB server

If you have problems running the server or shell script above, it is also possible to use Debian's own NDB server. Use apt-get to fetch nbd-server, then use this command:

 nbd-server 55321 /path/to/cube.rootfs

The apt-getted version requires an absolute path. Additionally when booting the cube, you may need to get the cube looking for the server before actually starting the server!

Booting Linux

Once completed the setup, you'll need to launch zImage.nbdc6.dol using psoload or your usual method to run code on the GameCube.

If you managed to setup an environment like the one described in the #Working Environment section, then you'll see a base Debian system booting.

Once you see the login prompt, you may use a Secure SHell client to connect to your GameCube (by default, login: root, password: cube). Linux users can use ssh while Windows users may fetch PuTTY from the net.


What to do once in

Well, you have now a small Linux system! These are just some quick examples:

To be able to access the Internet you might need this:

 # route add default gw AAA.BBB.CCC.FFF

Where AAA.BBB.CCC.FFF is the IP address of your internet router. If your PC acts as a router to the Internet, use your PC IP address and enable Internet Connection Sharing (Windows) or configure a masquerading router (Linux). If you were using DHCP this step might not be necessary.

Check if it works:

 # ping www.google.com

Play some music:

 # apt-get install mpg321
 # wget http://mp301.epitonic.com/streamed/files/reg/songs/mp3/Synapse-Stealing_Science.mp3
 # mpg321 Synapse-Stealing_Science.mp3 &

See how much resources are used:

 # top

Press q to exit

Look for some bonus:

 # cd
 # ls -la test*

This will reboot your GameCube and run the classic testdemo4.dol:

 # kexec testdemo4.dol

Quitting

You may use the reset button on your GameCube, or the usual commands to power off your Linux system (halt, reboot).

Do NOT just switch off your GameCube. ALWAYS SHUTDOWN CLEANLY YOUR GAMECUBE WHEN USING LINUX. Otherwise, you can corrupt the filesystem stored within the cube.rootfs. Remember that if you just want to reboot again to Linux or to a homebrew DOL, you may give a try to kexec (kexec --help).


http://www.gc-linux.org/down/isobel/nbd-root/

Personal tools