guru3.net

A bunch of random stuff...
probably a lot of it outdated

Flexy - Linux on Neoware EON 3000 series

Just so you know, this is about getting a small linux distro setup and running on said hardware. It's accurate to the best of my knowledge but comes with no guarantee.

Note! It seems quite a bt of this has changed since I last did this. I'm not sure if most of this is still possible with Gentoo. It may be, but it probably won't be easy. I think the better recomendation at this point is to get a slightly larger flash card and go with a standard glibc setup.

The Hardware

The Neoware EON 3000(I/X) is a thin client produced by what is now part of HP. And it was made so long ago that technical documentation is non-existent on it. It consists of a Geode GX1 and CS5530 chipset. This includes builtin Cirrus Graphics, a RTL8139, CS5530 Audio, two usb 1.x ports, two serial ports, a parallel port, and the two ubiquitous PS/2 ports. It also has a shared PCI/ISA slot, a DOC (disk-on-chip) socket and a single IDE channel (slave/master). Two of them have a built-in speaker.

The models I have range came with 266-333Mhz cpus and 32-64mb PC100 laptop memory. There's also a 168-pin standard SDRAM slot, and both memory slots can be used at once. It seems that PC133 works as well if you haven't got any PC100. If you want to use a PCI card with the 168-pin SDRAM you'll need low-profile memory. As near as I can work out it's essentially a miniature standard PC that's completely fanless.

And that's a good thing.

Standard Software Information

The ones I have came with a thin 8/16MB Windows CE distribution, which frankly, is just "ew". Two were DOC and the third DOM, disk-on-module. But seeing how it's essentially PC hardware it runs linux just fine.

There are two ways to do things. Netboot or booting off the IDE. I've chosen to go the IDE route as I'm quite fond of moving things around, and that gives me more flexibility in picking up the box and putting it someplace else, or taking it with me someplace- it's small enough to do that. Specifically, netbooting of wireless as far as I know is pretty much impossible.

Once I decided taht, I got ahold of some CF<->IDE adapters and some 64MB cards. Which isn't a lot of space. However, it is just enough space for DSL, Damn Small Linux. However, when I tried it out, because of the low memory, while it does run, it was unbearably slow. I looked into hacking it but there's not a lot to go on and I'm pretty sure most people can't tell what libraries go where. I know I can't.

However, a friend pointed me in the direction of the Gentoo wiki and the embedded uClibc profile they've got directions for setting up and using to put gentoo on embedded devices. While the EON isn't strictly embedded, it shares a lot of features and when there's no space on your disk, embedded looks pretty good. As I happen to use Gentoo anyway I'm also familiar with the emerge/portage package management system and know the init system sort of stuff as well.

Creating a Linux for you

It's like linux from scratch, but easier, and not strictly from scratch. I can manage the miniature standard PC that's completely fanless.

kernel menuconfig, but the BusyBox one is another matter. Same for the uClibc one. Really, I've always had terribly luck with /linuxrc as well. This is where the name comes from. "Flexy" - Flexible right up until you've actually installed it. It's pretty easy to set everything up if you're ok with a text editor and a few configuration file sort of things. Helps if you know gentoo too.

The name isn't so important. What you do is, and the outcome is even better. A fully booting uncompressed linux that does at least what I want it to do. Which is to be a little bit of a thin client. Run X and use xdmcp to get onto my desktop. Of course, I'm dealing with 64MB of space. If you've got a larger CF, or have dared to stick a laptop harddrive or something in, you could run Ubuntu if you wanted.

If you've got that much space, I doubt this will be of much interest to you. Really, as it is pretty much PC hardware, there's not really any special tweaking going on. Everything is software side. Might be more interesting to people trying to fit some functional stuff into small ammounts of space.

The base system setup

Really, this isn't too challenging. I could put it together from directions at Embedded Gentoo and TinyGentoo. If you've never used gentoo before this can be a bit challenging though. The first thing you need is a development environment. I've been using VirtualBox with embedded gentoo installed in it. I believe that following the regular gentoo x86 handbook works just fine as long as you use a embedded gentoo stage. That would be in chapter 5, downloading a file along the lines of stageX-x86-uclibic-2006.1.tar.bz2 from your gentoo mirror. You may have to search around some of them to find it. I also recommend skipping step 5.d and not changing the CHOST/CFLAGS stuff. In step 6.b you need to make sure /etc/make.profile links to /usr/portage/profiles/uclibc/x86/2005.1/. Everything else should be the same roughly.

Once that's sorted and you have an environment, create an image of your CF card and get that into the virtual machine, and mount it. My CF reader comes as /dev/sdb on my desktop so I did dd if=/dev/sdb1 of=cf.img and then scped it into the virtual machine. I'm counting on that if you can understand what any of this says that you can work out how to do that. The goal is basically to get your CF formatted with ext2, and to have an image in the VM that you can work with.

After that's all been installed, in /etc/make.conf add USE="-alsa". Also edit /etc/portage/package.keywords to be something like

>=sys-apps/baselayout-2
=sys-apps/openrc-0.2.1-r2
>=sys-apps/coreutils-6.10
>=net-fs/nfs-utils-1.1.0
and then /etc/portage/package.use
net-misc/dropbear multicall
x11-base/kdrive xv
sys-apps/busybox make-symlinks
sys-apps/file -python
media-video/mplayer cpudetection custom-cflags esd mmx mp3 xv xvid
I'm not sure about all of these but that's what I've used.

Additionally you can install ccache as described in one of those wiki pages from before.

Now actual building can start. Mount you're image someplace, mount -o loop cf.img /mnt/flexy is what I've done. Now that you know that, you should have some idea as to why I'm now going to say that every emerge/ebuild command should have ROOT="/mnt/flexy" INSTALL_MASK="*.h HACKING.gz TODO.gz" prefixed to it. ROOT tells it where to install and INSTALL_MASK keeps it from copying space-wasting files. I'm not sure what the best format here is, but a list to get you going seems good.

emerge uclibc busybox
emerge baselayout util-linux dhcpcd wireless-tools dropbear

That's the important stuff I think. It's enough to get you to the basics. Which means you need a kernel now. I don't feel up to writing a guide on that, but basically (without ROOT) emerge linux-sources. cd /usr/src/linux-version and download the config and build if you're too lazy to do it yourself. Enjoy a nice long wait while it makes. Nothing funner than compiling in a virtual machine. While that's going you can create a tar archive of your /dev so that booting doesn't fail miserably as it did for me the first time. Then with the creation of some directories you can get things really cracking.

cd /
tar jcvpf dev.tar.bz2 /dev
cd /mnt/flexy
mkdir boot dev proc sys root
cp /usr/src/linux-version/arch/i386/boot/bzImage /mnt/fexy/boot
tar jxvpf /dev/tar.bz2 .

You'll also want to edit /etc/fstab. Pretty much just a line for /dev/hda1 being /. Also a root password is a good idea. chroot /mnt/flexy; passwd; exit is all that takes. A boot loader is slightly trickier. Grub is a good choice, but since it's just an image mounted, you'll have to go round about slightly. grub --root-directory=/mnt/flexy /dev/hda1. That'll put the files on the image in the right place but won't make the CF bootable. You'll have to install it again after that from your real distro. Grub configuration is next. A walk in the park really. vim /mnt/flexy/boot/grub/menu.lst. Nano if you prefer.

default 0
timeout 5

title=flexy2
	root (hd0,0)
	kernel /boot/bzImage root=/dev/hda1

With all that done theoretically you can unmount /mnt/flexy, scp cf.img back to your real system, write it to the CF, install grub on the CF, then plug it in your EON and boot it up. The one catch is the first time you boot it I recommend having rw as a kernel argument. Use on boot editing in grub to sort that out. After the initial boot that's no longer required.

During boot, you'll probably notice 50 billion errors pass by. Some we can get rid off. Some I haven't figured out the secret to, but they don't seem to do any harm. Login and run

rc-update del consolefont boot
rc-update del keymaps boot

Then you're done. Banzai.

Real Features

Things I've gotten to work:

Things I'm trying to get it to do/want it to do/testing:

Categorical failures:

How to add the real features

X11

X11 I've found is best provided with KDrive if you've got < 75MB more free space hanging about. If you're still going up the xorg creek, let me know how it works out. Back to KDrive, if you emerge it normally, it firstly, has about a million unnecessary dependencies, and secondly dies in the middle. Oops. Both can be fixed. ln -s /usr/src/linux /mnt/flexy/usr/src emerge --nodeps kdrive sorts out the first. The second is a bit more complex. Once it fails, you'll need to cd /var/tmp/portage/x11-base/kdrive-version/work/kdrive/xc/programs/Xserver/hw/kdrive/. I'm not sure of that path exactly, but it's close. Then edit vga.c so that asm/io.h is sys/io.h on line 32.

After that you'll need to manually get it to emerge so that it doesn't delete that change. ebuild /usr/portage/x11-base/kdrive/kdrive-version.ebuild merge. Don't forget ROOT=etc. This may be a bit dodgy, but it's roughly what you need to do. Entirely possible, but maybe not exactly for the faint hearted.

If you want more than just X, I searched through portage for the smallest terminal/wm client. I came to the conclusion of emerge mrxvt lwm. I'm sure fluxbox is possible, but it was more than what I wanted. Depends on you. Lots of options here.

Sound

If you want things for sound, good for you. Welcome back to old school OSS. At least for the hardware I have. Alsa? Out the window. It wouldn't work, as I mentioned above. That's OK. A lot of stuff still uses OSS anyway.

emerge mplayer aumix

When I ran this setup I already had KDrive installed. You may need to tweak the useflags some if you're doing this without it already installed. Esound would be good to emerge at this point as well. Maybe it'll work for you. No dice here yet.

Screen

ebuild /usr/portage/apps-misc/screen/screen-4.0.3.ebuild unpack
cd /var/tmp/portage/apps-misc/screen-4.0.3/work/screen-4.0.3/
patch -p1 < /screen.patch
ebuild /usr/portage/apps-misc/screen/screen-4.0.3.ebuild merge

Patch at the bottom.

NFS

You may or may not have problems installing it. There's a patch that I used but also had some problems with it missing out rpcgen. This is how I fixed it:

ebuild /usr/portage/net-fs/nfs-utils/nfs-utils-1.1.2.ebuild unpack
cd /var/tmp/portage/net-fs/nfs-utils-1.1.2/work/nfs-utils-1.1.2/
patch -p0 < /nfs-utils-1.1.0-uclibc.patch
ebuild /usr/portage/net-fs/nfs-utils/nfs-utils-1.1.2.ebuild compile
cd /var/tmp/portage/net-fs/nfs-utils-1.1.2/work/nfs-utils-1.1.2/tools/rpcgen
make
ebuild /usr/portage/net-fs/nfs-utils/nfs-utils-1.1.2.ebuild merge

Other Notes

Nearly the entire portage tree is at your disposable. I recommend keeping backups of your image in case something is too large. Somethings don't play happy with uClibc like screen/nfs. Good luck, google is your friend.

Also, if bash gets installed as a dependency of something, I recommend ln -s /bin/bash /bin/sh as it seems the busybox shell isn't compatible with absolutely everything in the init scripts

This is by no means finished. I've paid for these things and I'm going to keep playing with them as time allows. Hopefully I'll get to update this page every now and then and of course if you figure anything out or want some help you can get me on the freenode irc network, nick guru3.

Also, my apologies for the random spacing of pictures that have nothing to do with the current paragraph. I wanted to put some on and they had to go somewhere. Good Luck