This is my first attempt at trying to build a Wiki-like knowledge base on top of the Flutterby content management system.
This is a place for explanation, description and static links on a topic that's either too broad to be covered under a single link, or that you're just too lazy to find the real link to.
Entries are automatically generated.
For work, I needed to build an embedded system to monitor a stepper controller. Since we're not doing a gazillion of these, and since a Linux development environment is easy to work in, the slight additional cost of using a Via Eden board, with extra computing capacity, seemed like a reasonable thing to do. But we wanted it diskless, for less moving parts to break, and I wanted to know what every process running on the machine was, because I didn't want things writing log files to disks I didn't know were filling up, or things like that. This is how I configured that machine to run off of a small CompactFlash card.
Although the target system was built completely from scratch, the host systems used to create this installation were running the Debian distribution of Linux. A few files might be in paths specific to that installation.
Put the CompactFlash card on a computer running Linux. I have done this by either plugging it into a PCMCIA adapter, or by using the ACS ontrol CompactFlash to IDE adapter. Note that you can't "hot-plug" the latter, so the machine must be turned off, the CompactFlash card installed, and then booted. This makes the PCMCIA solution far preferable.
This is probably also easy with a USB card reader, I just haven't done it yet.
For the purposes of this note, we will assume that the card ends up at
/dev/hde. If it goes somewhere else
/dev/hdc is an obvious choice if it's the bus master in
the secondary IDE bus), replace all references with that.
Make sure the card isn't mounted. Some systems will attempt to automount the card. If it is, unmount that partition.
fdisk to delete the existing partitions, and create a
new partition. Change its type to "83", or "Linux". We're going to
create an "ext2" type filesystem on it. Write the new partition table
mkfs.ext2 /dev/hde1 to create a filesystem on the
partition you just created. Run
install-mbr /dev/hde to
install a new master boot record on the card.
mount -t ext2 /dev/hde1 /mnt/film
Note that you may have to manually specify the filesystem type, some automounters will mount anything not specified as FAT or VFAT.
Build the target filesystem on it. For my purposes, this meant:
lilo.conf file for your install. This is just like you'd normally configure a
lilo.conf except that you need to specify which disk to operate on:
And you need to explicitly tell it that this will be the first BIOS disk once it's installed:
Copy this into
Untar and configure the Linux kernel you'll be using. In the root level
./arch/i386/boot/install.sh I changed the last line to
/sbin/lilo -b /dev/hde -C /usr/src/viaeden/linux-2.4.19/arch/i386/boot/lilo.conf
And I copied
/mnt/film/etc/lilo.conf to that
lilo.conf location. Then you can
lilo -v 3 -r /mnt/film -C etc/lilo.conf
And the card should be bootable. Yes, there are steps in this that could be cleaned up.
/mnt/film/dev and create the devices. Most of
the critical stuff can be gotten with:
mknod psaux c 10 1
I used BusyBox to have the basic Un*x
utilities available. Yes, you could just as easily set up your program
/bin/init, but it's so handy for debugging to be
that it's hardly worth going further. There are some mechanisms for
installing it, I just did a
make and then a
./busybox-0.60.5/_install/* /mnt/film/ to install it.
I also talked to this machine via Ethernet, so installing
net-tools was in order. Find the distribution on the
'net, do a
./configure --prefix=/mnt/film, then
At this point it's time to make friends with
tells you what libraries an executable needs, and if your own
executables don't need extra libraries, the net-tools
will. Thus far I've found that:
cp /lib/libcrypt.so.1 /lib/libc.so.6 /lib/ld-linux.so.2 /mnt/film/lib/
is a good start. The only remaining thing is to get your
/etc/init.d/rcS script set up. Rather than a complex
"init" system, BusyBox just runs this
script at the end of the boot.
First, you want to mount the "proc" filesystem:
mount -t proc /proc
Next you want to remount the root filesystem as read-write. You'll probably pull this out before your system goes live, but it's nice to have some scratch as you play. However, even more importantly for scratch, you'll want some scratch disk for your applications to play with. I did a:
And then gziped
/dev/ram0 into a file that I
could install on the boot, like so:
gunzip < /sbin/diskimage.gz | dd of=/dev/ram0
mount /dev/ram0 /tmp
This way I didn't have to copy over all of the
The rest of my script is just devoted to configuring the ethernet
interface and starting the various daemons. A suggestion: If you don't
put a small editor on the box, you're kinda left with what you can do
echoes. I don't know
after a few tries
combinations become horribly annoying, so I found that using
backticks, as in:
ifconfig etho `cat /etc/ipaddress`
where the file
/etc/ipaddress has one line with the IP
address you want the config file to contain, makes a few things a lot
For daemons, I used webfs as a web server. I started with thttp, but I was communicating with my controller daemon via "fifo"s, and something about the CGI handling in that just hosed my sockets. webfs ran my CGIs fine.
by:Dan Lyke started: 2003-04-07 15:01:55.874692-07 updated: 2003-07-18 13:48:27.959161-07
Comments will probably be found at the Flutterby entry that pointed to this.
Connectivity provided by highertech.net , awesome bandwidth, well away from fault lines and other potential for natural disasters, reliable, and run by cool people.
Questions, comments, flames: contact Dan Lyke
Flutterby™ is a trademark claimed byDan Lyke for the web publications at www.flutterby.com and www.flutterby.net.