Linux

Preparations

Backup your system. Chances are good that you might just brick it. In which case you're going to have a lot of work left over for you to turn it back into a functioning box.

Requirements

Gentoo's portage is written entirely in bash and in python. The MBWE uses GNU bash, version 3.1.17 so we're ready there. However Python is not installed by default. Fortunately others have been able to install python without problems.

Vital System Information

The dmesg output tells us what we need to know about the system.

<5>Linux version 2.6.17.14 (clarke@mccoy.oxsemi.com.asic.oxsemi.com) (gcc version 4.1.0) #1 PREEMPT Wed Jan 17 16:13:04 GMT 2007
<4>CPU: ARM926EJ-Sid(wb) [41069265] revision 5 (ARMv5TEJ)
<4>Machine: Oxsemi NAS
...
<5>Kernel command line: mem=32M console=ttyS0,115200 root=/dev/md1 netdev=0,0,0x0090A915,0x0486,eth0
...
<6>Memory: 32MB = 32MB total
...
<6>VIA Networking Velocity Family Gigabit Ethernet Adapter Driver Ver. 1.13
<6>Copyright (c) 2002, 2003 VIA Networking Technologies, Inc.
<6>Copyright (c) 2004 Red Hat Inc.
<4>PCI: enabling device 0000:00:07.0 (0140 -> 0143)
<6>eth0: VIA Networking Velocity Family Gigabit Ethernet Adapter

Solutions

I'm happy to have discovered an official arm port in progress. There is an effort already underway to port Gentoo to the ARM architecture. That means there will be external resources I can learn from along the way. Translation: I don't have to make all the mistakes first - someone else might have already done so.

More good news is that there is an arm use-flag. In brief that means that you can instruct Gentoo to build the system for the ARM processor.

Additionally some of the resources which might come in handy here would be:

Problems

The first problem I notice right away is that while there's an ARM5 chip inside the MBWE, there is was no ARM port for Gentoo. Normally you would install portage from a stage3 or compiled tarball. However that isn't going to work. In order to make Gentoo function on the mybook I'm going to have to work from the stage 1 or 2 tarball which is just sources.

Note that there are some useful conversations here and then here (the best link) in the Gentoo forums on converting other Linux distributions to Gentoo. The flaw in the procedure however is that there is no ARM port of portage.

Converting MBWE to a Gentoo System

Gentoo

So far the MBWE has proven to be a great and cheap NAS with room for expansion. The current method for adding programs demands installing from source, but tracking down dependencies is not always easy. What if we could gain the simplicity of the Gentoo Portage system? Is there an "easy" way to "Gentooize" my system so I can just emerge {program} and be done with tracing dependencies forever?

Starting with what I've learned thus far at http://mybookworld.wikidot.com/ I think there is quite a good possibility of doing so.
The first and most crucial step is to gain SSH access to your MBWE. After that we need to get the heart of Gentoo working, which is Portage.

Hacking the Western Digital My Book World Edition

The Mybook world edition is a great little NAS box that just needs a little help to become so much more. There are already a few communities springing up around the net to help improve it. One of those communities is found at http://mybookworld.wikidot.com. This is the community in which I'll spend time and post my successes. But right here is where I'll work and make mistakes.
The need arose to coordinate and collect some of the prebuilt binaries since, the small processor on the Mybook makes compiling some programs a rather lengthy process.
Below you'll find them.

Installing Gnu Screen on your Western Digital Mybook World Edition

There is a comment on Nanalegumene's site which says screen wouldn't work on the mybook so we should use dtach. I found dtach to be inadequate for my needs. So I decided to hack out a way to make it work.
About Screen

How To

Having gotten it working here's what I did (as root).

  1. mkdir /tmp/myfiles # Create a directory under /tmp called 'myfiles'
  2. cd /tmp/myfiles # Change to the directory in order to work there
  3. wget ftp://ftp.gnu.org/pub/gnu/screen/screen-4.0.2.tar.gz # grab the file
  4. tar -xvf screen-4.0.2.tar.gz # unpack the file
  5. cd /tmp/myfiles/screen-4.0.2 # change into the directory.
  6. ./configure # If you fail to include the "without" statement Time: 1m44.111s
  7. nano pty.c #now you have to edit the pty.c file using your favorite editor. You might have to use vi pty.c if you haven't installed nano. on line 38 it reads # include You have to comment that out by surrounding it with slash star as in: /* # include */. The reason being the make will fail because stropts.h is not included in your /sys directory. By examining the 38th line of pty.c we find that stropts.h is called when HAVE_SVR4_PTYS exists. I don't know how to counteract that another way besides removing that include. (source)