Created 02 01 2004 - Updated 07 05 2004
The EZ-PicoSETI-2 Page

This page is under contruction
Sorry for the errors - gibberish ...


What is EZ-PicoSETI-2?
Why did I create this page?
What can I do with this page?
I thought the Seti@Home project is soon to end.  Why are you doing this page?
What is EZ-PicoSETI based on?
What do I need to build a customized EZ-PicoSETI-2 floppy?
Why does thewall come with a driver floppy.  What does this mean?
What about configuration?  Can I edit configuration files and save them to floppy
What should I do before I start?
I'm ready to build a customized EZ-PicoSETI-2 floppy, I need a step by step
How do I edit/add files to be included with the distribution?
Add/edit files in the source
Add/edit files under a floppy PicoBSD distribution
Add/edit by mounting floppy/cdrom bootable image
I'd like to have multiple copies of thewall's sources.  What can I do?
How can I create an alternate PicoBSD distribution size
I need to add support for another device, what do I need to do?
I need help.  My compile has stopped with vnconfig: /dev/vn1: No such file or directory


What is EZ-PicoSETI-2?

EZ-PicoSETI-2 is a new and improved version of  EZ-PicoSETI.
It is based on information borowed from theWall, an excellent PicoBSD based firewall by Chuck Daemon


Why did I create this page?
My first Seti@home floppy project, EZ-SETI-LPR was based on a 1.72 MB floppy
Tony Staples of http://gadgetslab.dyndns.org/ called me to say he was having errors related to the floppy creation under Windohs 2000
I reaseached another Seti@home floppy project and discovered Paul Boehmer's excellent PicoSETI
With Paul's permission I posted my next Seti@home project, EZ-PicoSETI

I originally wanted to add DHCP to my EZ-PicoSETI page however I gave up after compilation errors
During my research, I then discovered theWall, Chuck Daemons excellent PisoBSD firewall distribution
Chuck's thewall make PicoBSD compiling very easy and configurable
With Chucks permission, I created the EZ-PicoSETI-2 page

With the information we learned, Tony Staples and I worked together to create his DaemonFARM, A PicoBSD based SETI farm.

Update, as of 05 02 2004, I havent officially linked to this page as I got kinda busy
I was recently approached by another individual who asked for help creating a NFS based Ez-PicoSETI farm
This opened up another great learning opportunity for me as I learrned to did deeper into the wonderfull world of PicoBSD


What can I do with this page?

You can use one of my ready to go floppy/CDROM images and start crunching SETI right now
or
You can use this information to create your own floppy/CDROM image


I thought the Seti@Home project is soon to end.  Why are you doing this page?

Good question.
For one, this information has been floating around in my head for too long and must be documented before its toast
Secondly, theWall helps takes the "Black Magic" out of PicoBSD enabling the user to easily create a customized PicoBSD's floppy
Examples could be a recovery floppy, mail server, DHCP server ...
I personally want to create a backup solution for my FreeBSD boxes (dump/restore over NFS) like I did for Solaris here


What is EZ-PicoSETI based on?

EZ-PicoSETI uses theWALL's configuration files under FreeBSD 4.5 Release
I'm working on 4.9 Release.  The dhclient source needs a slight amount of tweaking

What do I need to build a customized EZ-PicoSETI-2 floppy?
A i386 computer running FreeBSD 4.5 Release     (Use Google to search for FreeBSD/ISO-IMAGES-i386 4.5)
Sources for theWall (I used thewall.pc.dhcp.x.tgz)


Why does thewall come with a driver floppy.  What does this mean?
TheWall is really cool
*****It comes with a boot disk and a driver disk  (/bin/driver.flp)
You first boot with the boot disk
By default, its kernel is compiled with all ISA NIC device drivers enabled
There are no PCI NIC device drivers included in the kernel
At first boot, you can optionally enable/configure/disable the ISA NIC device drivers
Then you can optionally use the driver floppy, to load the desired PCI NIC device driver
The PCI NIC device driver is copied to the boot disk
From now on, you only need the boot disk


What about configuration?  Can I edit configuration files and save them to floppy

Yes.
The /etc directory containing the all important rc.conf can be edited and backed up to floppy
Run "update" to save any changes in /etc to the boot floppy,
Run "update autoboot" to disable prompting for new drivers


What should I do before I start?
Read
I know its fun to dive in without reading but these two pages are a must read
They are short, funny and informative
I'm assuming you have downloaded thewall's sources and decompressed them to your home directory (~)
~/thewall.pc.dhcp.x/EXAMPLE.DHCP
~/thewall.pc.dhcp.x/README

Consider these very detailed notes for browsing and reference
http://www.cse.ucsc.edu/~brucem/pico_notes.htm


I'm ready to build a customized EZ-PicoSETI-2 floppy, I need a step by step
First off, relax, this isnt all that hard.
It may be new to you but all it take is a little reading and you will be confident with FreeBSD
It is certainly worth the effort because in my opinion, FreeBSD is far superior to Linux in many ways
Netcraft reports the top 50 server uptimes are dominated by FreeBSD and BSD based boxes so something has to be right
"Take it a step at a time, and use your mind, and you can do anything that you want to do" (From Nick Jr's Blues Clues)

Also, this step by step uses the generic thewall sources with consideration of running a DHCP client, a NFS client and telnet
*****If you plan on building your own EZ-PicoSETI-2, You can get the required confiiguration files here


1. Install FreeBSD 4.5      (The FreeBSD
handbook is excellent for newbies)
I like to choose a miminal install, then CVSup the source and ports tree over the internet
You could also install any other package configuration the source and ports tree from CD if you wish tree


2. Use CVSup to update your sources and ports tree

Here is a CVSup page that should help


3. Optionally install some applications

Here's some handy application I use for file management. editing and browsing
Filerunner    Great file management tool
Glimmer      Amazing GUI editor
GFTP          Excellent FTP/SFTP client
These are all FreeBSD ports


4. Download and the sources for
theWall (I used thewall.pc.dhcp.x.tgz)


5. Decompress theWall sources into /usr/src/release/picobsd

#cp thewall-source.tar.gz /usr/src/release/picobsd
cd /usr/src/release/picobsd
tar zxvf thewall-source.tar.gz

6.
Apply 2 thewall patches to the sources
Dont be scared, this is fun
Chuck has 2 patches that should be applied to the FreeBSD sources
These patches are in thewall's patches directory (/whatever/thewall.pc.dhcp.x/patches)
The patches are called boot2.c.patch and userconfig.c.patch
Here is the way I applied the patches
Copy boot2.c.patch to /usr/src/sys/boot/i386/boot2
Copy userconfig.c.patch to /usr/src/sys/i386/i386
As root, CD to these directories and type the following
#patch boot2.c.patch boot2.c
and
#patch userconfig.c.patch userconfig.c
The userconfig.c patch should go without interaction
The boot2.c patch will probably go like this
Patching file boot2.c using Plan A...
Reversed (or previously applied) patch detected!  Assume -R [y]
That's normal and ok, just select y for yes
Way to go, you just patched some FreeBSD source code


7.  Edit the crunch.conf file

The crunch.conf file is a very important configuration file
It is located in /usr/src/release/picobsd/thewall.pc.dhcp.x
It determines what programs are linked together to form a single crunched binary
Under, Linux this same idea is called busybox
The most important part of the crunch.conf are the progs lines
Here are a few lines for example
progs sh test echo hostname ln login getty stty
progs inetd telnetd w msg kget reboot
The progams sh, test, echo ... will all be crunched into a single executable
This is great for space saving
If you plan to change your PicoBSD floppy distro, you must edit crunch.conf
If you plan on removing some programs, you may break some dependancies so do one at a time
(For example if I remember correctly, the DHCP client script needs the program less)
If your PicoBSD floppy compiles without errors, your crunch.conf is probably ok
Here is an example of my modified crunch.conf to include DHCP, Telnet and NFS
progs sh test echo hostname ln login getty stty
progs inetd telnetd w msg kget reboot
progs init ifconfig df sps ns vm cat
progs cp rm mknod chmod chown mkdir ls syslogd
progs sysctl route pwd_mkdb dev_mkdb
progs mount mount_nfs umount minigzip sed tar tail sleep
progs kill
progs dhclient ee
progs pwd less
progs passwd date
progs ping
progs kldstat kldload
progs ftp rmdir mv dialog

8. Edit the Kernel configuration file
The kernel configuration file is called PICOBSD.
It is also in /usr/src/release/picobsd/thewall.pc.dhcp.x
It is common practice to have the kernel config file in upper case
The PicoBSD kernel compile depends on this configration file
You could consider remarking out unwanted lines to reduce the final kernel size
By default, thewall takes care of NIC modules in an excellent way
The ISA modules are enabled by default and at boot time you can tweak the kernel to enable/configure/disable these modules
The PCI modules are not included in the kernel compile are on the driver disk
If you look at the PICOBSD file you will normally see all PCI modules are remarked
You can easily edit the PICOBSD file to tailor is specifically to your system
We wanted to use NFS so these settings were necessary
options        NFS
options        NFS_NOSERVER        #Network Filesystem

If you want to crunch SETI you must ensure these settings
#marker               def_sz  init    MFS_inodes      floppy_inodes
#PicoBSD           5120    init    4096            32768
options MD_ROOT_SIZE=5120      # same as def_sz
If you need more info, the FreeBSD handbook has some excellent coverage of the kernel configuration file

I have several EZ-PicoSETI distros now and each has their own unique crunch.conf and PICOBSD kernel config file
Here is  a chart outlining the different distro types with links to the source files for your reference.


9.  Build your distro
cd to your /usr/src/release/picobsd/thewall.pc.dhcp.x directory
As root type this
./thewall
Whatch it fly

10.  Create your floppy
Thewall's (picobsd) script will compile a kernel build the crunched binary and hopefully prompt you with a disk creation dialog box
Assuming this worked without error, you simply have to pop your floppy disk in the FreeBSD boxes drive and click ok
If your disk image doesnt copy over ok, don't worry the picobsd.bin file is still waiting for you
Try formatting your floppy using this
#fdformat /dev/fd0    Formats and verifies a 1.44 MB floppy
or
#fdformat /dev/fd0.1480    Formats and verifies a 1.48 MB floppy  -  The largest PicoBSD can create and boot from

After getting a disk to properly format and verify, cd to the build_dir-thewall.pc.dhcp.x directory
You floppy disk image picobsd.bin is there
Use this to copy the image to your floppy
dd if=picobsd.bin of=/dev/fd0 bs=1024
dd if=picobsd.bin of=/dev/fd0.1480 bs=1024  Use this for 1.48MB floppy images


I need help.  My compile has stopped with vnconfig: /dev/vn1: No such file or directory
I got this error as well, it's easy to fix
vnconfig is a tool to mount a file as a device
During the picobsd build process vnconfig is used
vnconfig assigns a vnode number
You can see the vnode number early in the build process
"vnode is 0"
If your picobsd build process stops because of space issues (It wont fit on your planned floppy size), the build script will stop before it has the chance to gracefully close out
Any future build attempts show this as a vnode number
"vnode is 1"

No problem, here's how to fix it

Type mount
You will probably see /dev/vn0c on /tmp/picobsd/xxxxxxxx
The device, /dev/vn0c is still mounted !!
Try this
umount /dev/vn0c
vnconfig -u /dev/vn0c

You will now need to adjust your crunch.conf and PICOBSD file so your build does fit onto your planned floppy size
After you fix your space issues, your compile should not get this error


How do I edit/add files to be included with the distribution?
I can think of at least 3 ways
1. Add/edit files in the source
2. Add/edit files under a floppy PicoBSD distribution
3. Add/edit by mounting your floppy or floppy/cdrom bootable image

Add/edit files in the source
Here's a basic breakdown of these files
floppy.tree/etc                   Contains files like rc.conf, sshd_config, dhclient-script ...
/floppy.tree/boot.config     Used optionally at boot time (boot -c) to give you access to the kernel configuration menu
*****floppy.tree/etc/kernel.conf is used at boot time to enable/disable some non-pci devices
mfs_tree/etc/rc                  A very important as during boot time it sources compressed files from the boot device
mfs_tree/modules              By default, typically contains mdbuss.ko, the mii buss kernel NIC module.  If you want to include a module, pop it here
mfs_tree/stand                   By default, empty

Add/edit files under a floppy PicoBSD distribution
Thewall comes with a script called update
The script can be used to backup the files in the /etc directory
After editing files under your distribution, type update
Update will automatically mount your floppy, delete etc.tgz, and create a new etc.tgz.
If you want to add a file you can try to use scp, ftp
You can also put your file on another floppy and do this
Remove picobsd floppy
Insert floppy with your file
#mount /dev/fd0 /mnt
cp/mnt/your-file /etc
umount /mnt
Reinsert your picobsd floppy and type update to save the changes

Please be aware of the size contraints of the floppy.


Add/edit by mounting floppy/cdrom bootable image
The picobsd distribution you download from or create yourself is a bootable disk image called picobsd.bin
Your FreeBSD box probably already has support for vn
This provides the ability to mount a file as a device
Here's how to do it
Lets assume your picobsd.bin file is in /usr/src/release/picobsd/seti-nfs-telnetd
#cd /usr/src/release/picobsd/seti-nfs-telnetd
#vnconfig -s labels -c vn0 picobsd.bin
#mount /dev/vn0c /mnt
#cd /mnt

Voila, you have mounted your picobsd distro.
You can move/decompress/edit to your hearts content
Just be aware of size contraints
After you are done, do this
#cd /
#umount /mnt
#vnconfig -u /dev/vn0c


I'd like to have multiple copies of thewall's sources.  What can I do?

It is often desirable to experiment with several copies of thewall
IE you may want to play with a NFS server version and at the same time a seti version
Since their are a couple of configuration files, its nice to avoid flipping back and forth
This is no problem, but thewall's compile script must be changed to reflect your new directory name
Here's how I do it
#cd /usr/src/release/picobsd/thewall.pc.dhcp.x     cd to thewall's root folder
#cp -rpv thewall.pc.dhcp.0.2 seti                            -r copy the directory and entire subtree, -p preserve, -v verbose to a new directory called seti
#cp -rpv thewall.pc.dhcp.0.2 nfs                             -r copy the directory and entire subtree, -p preserve, -v verbose to a new directory called nfs
Lastly, you must edit thewall's compile script to reflect the new root directory name
The file is called thewall
Look for THETYPE="thewall.pc.dhcp.x" and change it to "seti" or "nfs" accordingly




Distribution
Features Notes
EZ-PicoSETI-Telnetd-NFS NFS, Telnetd
Mount a NFS share and run the setiathome client over the network.  Administer the node with telnet
EZ-PicoSETI-SSHD-NFS NFS, SSHD
Mount a NFS share and run the setiathome client over the network.  Administer the node with SSHD
EZ-PicoSETI-CDROM NFS, SSHD, PCI NIC's in kernel, automated dhclient, setiathome client
Mount a NFS share and run the setiathome client over the network.  Administer the node with SSHD
Optionally run the setiathome client locally on the node.  PCI modules compiled in the kernel.  Dhclient mostly automatic


How can I create an alternate PicoBSD distribution size
When you normally create a PicoBSD distribution you will use something like this
./thewall                                       Builds a 1.44MB floppy image
./thewall --floppy_size 1480         Builds a 1.48MB floppy image

I wanted to create a 2.88 MB image destined to become a bootable CDROM
Unfortunately I got disklabel issues like this
disklabel: fd2880: unknown disk type
---> fail: Error <1> eroor code <floppy_disklabel>
Error while doing disklabel on floppy.img size 2880

The problem was the dislabel application was puking at a 2.88 MB disk image
I found the easiest way around this was to modify thewall's script to add this line
disklabel -BRr -b {$boot1} -s ${b2} vn${VNUM} /usr/src/release/picobsd/seti-cdrom/2880.txt
This used a previously created disklabel called 2880.txt.  It worked great


I need to add support for another device, what do I need to do?
You need to first add kernel support for your device in the PICOBSD file
Then you need to add the device
In your thewall sources, look for a file called config
It looks like this
MY_DEVS="std ttyd0 vty3 pty3 bpf0 bpf0 fd0 ad0 ad1"
To add CDROM support I needed to add acd0 to the config file before compiling


Things to still do on this page
Research this out - disklabel -Brw /dev/vn0c minimum2
I'm getting compile errors, (dhclient for example) how can I troubleshoot them?
How did I add sshd?  Step by step
dhclient source under freebsd4.9 a step by step in fixing the compile errors