I've made a smallish (~40mb) Linux distro with NoCat, DJBDNS, HostAP,
Debian, and more. It works on the Soekris net4501, Soekris net4521,
Stylistic 1000, and more. One of it's biggest benefit is that it is a
read-only system, so you can unplug and reboot as much as you want
without fearing data loss. Comments, bug reports, requests, etc, are
welcome. --Terry
This is a somewhat minimal (more than 16 megs, less than 400 megs) Debian
stripped distro aimed for use in wireless embeded devices. It's biggest
advantage is that it mounts read-only. You don't have to worry as much
about wearing down the compact flash, and you don't have to worry about
doing proper shutdowns. Unplug and plug in as much as you want.
What it has installed:
Based on Debian GNU/Linux 3.0 (Woody)
Linux Kernel 2.4.19
HostAP - Stable Version 10-12-02 - PCMCIA and PCI
bridge-tools
djbdns caching dns server
elvis (tiny vi)
gnupg
iptables 1.2.6a
lynx
lilo
NoCatAuth, running as non-root, post 0.81 nighthly
ntpdate
openSSH server 3.4p1
openSSL 0.9.6 patched
pcmcia-cs (kernel module pcmcia)
Perl 5.6.1
ppp
pppoe
rsync
tcpdump
udhcpc - tiny dhcp client
udhcpd - tiny dhcp server
zebra 0.92a-5 (BGP, OSPF Routing Daemon)
What has it been tested to run on:
Soekris Net 4501 (PCI version)
Soekris Net 4521 (Dual PCMCIA Version)
Stylistic 1000 PCMCIA
Thinkpad T23 with mini-pci prism2 and Intel 10/100.
What compact flash do you use:
I use the SanDisk compact flash. They have better ide emulation.
I have also used Mr. Flash and it works well. I have heard of problems
with cheaper versions of compact flash being used. I have also use the
stylistic pcmcia hard drives in the stylistic and they work fine.
What was stripped:
remove a bunch of packages
/usr/share/man
/usr/share/doc
/usr/share/info
Perl POD stuff
Locales
Just went around deleting files that I thought it didn't need.
What is the root password:
It is blank. You have to set it. You can't ssh in with a blank
password. No I won't set a default password, you have to login and set it
up yourself. You can do this via a serial console cable or by doing
chroot /mnt/cf passwd
while the compact flash is mounted.
Where are the SSH server keys:
I don't distribute with the ssh server keys. That would defeat
the purpose of private unique ssh keys. look in /pebble.update.net4501
to see how I copy over the image. You can set them up by doing -
ssh-keygen -t rsa -f /mnt/cf/etc/ssh/ssh_host_rsa_key -N ''
ssh-keygen -t dsa -f /mnt/cf/etc/ssh/ssh_host_dsa_key -N ''
Why don't you just have it automatically generate the ssh on startup:
Two reasons. First it boots up as read-only so the ssh key would
only last until it reboots and then it would have to regenerate them.
Second, this runs on slower embedded systems and the boot time would be
unnecessarily slowed down by having to generate ssh keys every time.
Why is there no /etc/lilo.conf file:
I don't know what type of system you are running it up, so I
provided /etc/lilo-standard.conf and /etc/lilo-serial.conf for setting up
lilo when the compact flash is in another computer. Edit one of those to
make your own lilo.conf. The lilo-standard.conf is for a machine with a
vga console, such as the stylistic. The lilo-serial.conf is for a machine
with a serial console, such as the Soekris boards.
How do I do lilo on a compact flash card in my laptop:
chroot /mnt/cf lilo -C lilo-standard.conf
or lilo-pcmcia.conf. Check the conf files as it specifies the
device it writes to. It may be different on different computers. On my
thinkpad it is /dev/hde on my toughbook it is /dev/hdc
Why doesn't it fit on a 16 / 32 mb compact flash:
Because it's got perl, debian package management stuff, and
it wasn't built from the ground up with space in mind, and compact flash
is cheap. It doesn't use busybox or uLibc either. There are other small
distros out there, but nothing in between like this. You can use a boot
floppy distro and get it onto a very small compact flash, or netboot it if
you want.
How do I partition it, do I need swap space:
This is a read only distro, so no swap space is used.
Replace in the instructions below hde with whatever your compact
flash is.
Partition it as one big filesystem space.
fdisk /dev/hde
Use ext3 file system
mkfs.ext3 /dev/hde1
tune2fs -c 0 /dev/hde1
mount it
mount /dev/hde1 /mnt
untar it
tar jxvf /tmp/pebble.vXX.tar.bz2 /mnt
also look at
/pebble.update.soekris and /pebble.update.pcmcia
Why did you use ext3 on a read-only filesystem, you should have used ext2,
it is faster and you get more space:
The space savings are minimal for me, and I don't want to have to
fsck the system if I forget to remount the file system read-only before I
unplug it. You are welcome to change it to ext 2 for your system, just
make an ext2 file system and edit /etc/fstab
How do I get pcmcia to start automatically:
symlink /etc/init.d/pcmcia to /etc/rcS.d/S36pcmcia also take a
look at /
ln -s ../init.d/pcmcia /etc/rcS.d/S36pcmcia
Can I make changes and give them back to you:
Sure. Just tar up the different file and send them back if there
are lots of changes, email me first to find out the best method. I'll
integrate them into the distro. Changes to the documentation is also
welcome.
Can you add XXXXX package:
You are welcome todo it yourself.
"remount.rw ; apt-get update ; apt-get install XXXXX ; remount.ro"
How do I do security updates:
"remount.rw ; apt-get update ; apt-get upgrade ; remount.ro"
What are those commands remount.rw, etc:
These are shell scripts I created to make life easier
remountrw - remounts the file system read-write
remountro - remounts the file system read-only
fastboot - reboot fast if you have the system mount read-only
remove.docs - removes unnecessary doc files and apt-get info
What are the scripts you use to transfer the images to CF:
Take a look at:
/pebble.update.net4501
/pebble.update.net4520
/pebble.update.pcmcia
Where are these network settings for the PCI cards coming in from:
/etc/network/interfaces
Where the heck is nocat starting up:
/etc/inittab at the bottom
Why are you starting nocat in inittab:
To solve the problem of random nocat dies.
Where are the files stored that need to be read-write:
Initially they are stored on /ro, at boot time they are copied
over to a dynamic ram drive (limited to 10 megs) at /rw. Files are then
sym linked ot the /rw.
Who do I add a file to the ramdrive so it comes up every time I boot:
move the file to it's location in /ro
symlink the files original location to /rw
reboot
remount.rw
mv /var/readwrite.file /ro/var/readwrite.file
ln -s /rw/var/readwrite.file /var/readwrite.file
remount.ro
fastboot
What are some other system specific files:
/etc/inittab.pcmcia - no serial console getty
/etc/modules - modules for my t23 laptop where I do my dev work
/etc/modules.net4501 - modules needed for the soekris net4501
/etc/modules.net4521 - modules needed for the soekris net4521
/etc/modules.pcmcia - modules needed for stylistic 1000
/etc/modules.t23 - modules for my t23 laptop
/etc/network/interfaces.pcmcia
/etc/lilo-serial.conf - lilo configuration for serial console
(soekris)
/etc/lilo-standard.conf - lilo configuration for vga console
What is the serial port console set at:
9600 N 8 1
You may have to switch your Soekris bios to be the same if you
want to see it counting memory etc.
How long does it take to boot:
Less than 1 minute on my soekris net4501.
How did you do a read only file system:
I don't remember, there were a lot of steps. I found a web page
http://www.ultimeth.net/linux/ that gave some general instructions then
kept trying until it booted correctly. Take a look at /ro to see which
files and directories I moved. I symlinked their original locations.
Why did you call it pebble?
Because this distro should attempt to be small and simple, like
pebble (a small stone).
You should have used FreeBSD, it's sweet, I've got it down to 22 megs:
I don't want to have to compile binaries if I don't have to. Also
I want people to be able to update this distro themselves without having
to do cvsup and compliling binaries. That would take up to much space and
to much time on an embedded device. Once FreeBSD adds the apt-get update
functionality, I'll come visit.
Have you had any stability problems with it:
Nope, I have it running as my office AP, a net4501 with a Dlink
PCI 802.11b Prism2 card and 64mb SanDisk and it is very stable. The
current version of nocat has problems of dying, but is is circumvented by
placing the nocat startup in the inittab so it will automatically respawn.
When nocat fixes it's dying problems I will start it like a regular
daemon.
Thanks to Rob Flickenger for the pointers on how to make small embedded
style distros. Thanks to Adam Shand for pointers on making Debian
distros, Thanks to the guy who put a webpage out on the internet on how
todo a read-only file system. http://www.ultimeth.net/linux/
Contact info: Terry Schmidt < pebble-distro at nycwireless . net >