BOA (FreeBSD) server on Raspberry Pi (B)

Currently WORKING !

attempt 1
attempt 3
attempt 5
attempt 7
attempt 9
attempt 2
attempt 4
attempt 6
attempt 8
website, design

Working on a making a server with a raspberry pi model B. I am using (currently) FreeBSD RELEASE 10, so far I have succeeded in booting the system, and navigating around a bit. I have discovered for instance that ee is available as well as vi without installing anything additional. I suceeded in using portsnap fetch, obviously with the ethernet running. This takes quite a while to do. The first time I booted the thing (I think this was with a FBSD 11 .img) I also succeeded in installing boa, very simple.

I am using boa and FreeBSD because I am thinking that they are both stable and secure, to a degree. I have been using FreeBSD off and on for experiments and learning for a few years.

SO, the details:

. The raspberry pi model B has a supervideo (RCA-type)
plug on it which can be used drive a television as a monitor.

. The FreeBSD img's that found all had ethernet capability.

. Unfortunately the problem that sticks is the
size of the screen, I had this issue before with a Debian installation but the
tool raspi-config was available and fixed it. So far I have not
found the same facility in FreeBSD

. The raspberry pi has two usb ports which are somewhat inconvenient to use if one is to add something bulky,
with this usecase though it should be fine.

. The power supply I am using is one for a cell phone, made by verizon, seems
to work fine

. The config.txt which is refered to multiple times is there
but does not seem to change the behavior with the text

After some trial and error I seem to be getting closer to working the setup with the '85 television and the raspberry pi. I have found the standards for NTSC and VGA. Wherein I think that I will find the answer... The framebuffer entries in the config.txt file seems to help with the placement, but I just came upon a config.txt which does not have any other entries aside from, disable_commandline_tags=1.11 I intend to try that next....
leaves the pi unusable,
4 color generation showing,
have to put the image on again.

After some more time I have sent another message to the *-arm list to query about problems. I have just written another image to the chip, which is FreeBSD-10.1-RELEASE-arm-armv6-RPI-B.img. The image starts fine and all is well... Ethernet is up, screen is fine although the text is still off the screen. I have tried telnet and ssh. Trying to login... enabled root login in /etc/ssh/sshd_config and ssh in /etc/rc.conf.local (new). Now though it takes a minute for the computer, this one, to reply, "
ssh root@raspberry-pi.local
ssh: Could not resolve hostname raspberry-pi.local: Name or service not known
" same with telnet.

Also I changed the hostname from what it was to "rapsberry-pi.local".

So, I have now realized that there is a 'local' rc.conf in /etc/, that I didn't realize (in this ?build?). So one should look at the rc.conf in /etc/defaults/rc.conf and determine the proper terms to add to the existing 'local' /etc/rc.conf. Also of interest is that inet.d has to run to have telnet. I am thinking that inet.d needs to run to enable the network presence of the computer. Just a guess though. In the /etc/inetd.conf file there is a list of services that one can enable, among them are ssh and telnet.

Have found out some new information; service -e will return the enabled services. The output from this command reports that sshd and inetd are running, telnet is not. When trying to start telnetd I get a message, that it cannot be found. I think it is not in /etc/rc.d/ or /usr/local/libexec/. There is no /usr/local/libexec directory. There is nothing in /etc/rc.d/. I do not know why ssh is not working or why I cannot find the machine using host, dig or ping.

So can ssh into computer now, thanks to discovering that if I allow the OpenSUSE machine to think its connected to the internet, then switch cables, it still works to the IP that is the Pi. Anyway more on that later...This Just In

Code overview

The kernel is loaded into memory at 0x8000 and starts running from that
location, at _start in start.s, which sets up a stack, turns on unaligned
memory accesses (it makes the memory routines simpler) and calls initsys().

initsys() sets up the memory management unit (MMU) and remaps the kernel to
0xf0000000, its data to 0xc0000000, and maps the physical memory and
peripherals to 0x80000000. It then jumps to main() at its new address.

main() further initialises memory, along with the led (GPIO16) and

If the framebuffer initialisation fails for any reason, an error code is
flashed on the LED in a permanent loop (long pause, 2 short flashes in quick
succession, then 8 bits. Short flash = 0, long flash = 1. Least significant
bit first. See framebuffer.c for the meaning of the errors).

The framebuffer is initialised using tag mailbox calls to VideoCore. First,
a call is made to read the physical framebuffer size, then a call is made to
set the size (physical and virtual) and depth (bits per pixel) and allocate
a framebuffer. Finally, the framebuffer's pitch (bytes per pixel line) is

It appears to be necessary to set the virtual size before allocating the
framebuffer, but reading the physical size of the framebuffer returns an
apparently sensible value (unless something silly has been set in
config.txt). On boot, the virtual size is set to 2x2. If a framebuffer is
allocated without reconfiguring the virtual size, the screen will consist of
four very large virtual pixels.  Coloured red, green, yellow and blue, they
produce the "rainbow" startup screen.

A very basic text console has been added. This uses the SAA5050 teletext
character set (taken from the datasheet:, partly because
it looks quite nice and is a neat link to the BBC Micro, and partly because
I already have the data from another project.

The SAA5050 character set isn't totally ideal.  The # [ { ^ } ] ` _ | and \
characters appear as other symbols (pound sign, left arrow, 1/4, up arrow,
3/4, right arrow, long dash, #, double vertical line and 1/2, respectively).

Having set up the framebuffer, the kernel then reads the ATAGs data set up
by the bootloader and displays it on screen. The ATAGs format is documented

The ATAGs code will display most of the tags defined on that page, even
where they are not obviously relevant to the Raspberry Pi. In practice, it
seems the bootloader only sets up a handful of tags. It is possible to
configure the bootloader to not set up ATAGs (disable_commandline_tags=1 in
config.txt), but doing so will change the kernel's load address, and it will
no longer work.

Next, the kernel uses the tag mailbox to get various bits of data from
Videocore to display on the screen, along with displaying the kernel code
and data addresses.

The kernel sets up interrupt vectors and enables the ARM timer
interrupt. This interrupt is used to flash the OK LED.

The kernel checks that it can't write to its own code area, before
attempting to jump to 0x02100000, which resuts in a prefetch abort. Finally,
in the prefetch abort routine, the kernel enters an infinite sleep loop.

Files overview:
	* Makefile		Controls the build process
	* linkscript		Controls the linker - defines what order
				code appears in the final kernel, and what
				address it should expect to be loaded
	* start.s		Assembly code to handle kernel entry point,
				set up a stack and jump to initsys()
	* initsys.c		Set up MMU, remap kernel addresses and jump
				to main()
	* barrier.h		Contains asm macros for data memory/sync
				barriers, and full cache flush
	* main.c		Contains main() and tag mailbox examples
	* atags.c		Read and display ATAGs
	* led.c			GPIO/OK LED control
	* mailbox.c		Read/write the mailboxes
	* framebuffer.c		Framebuffer initialisation and text console
	* teletext.h		SAA5050 character set
	* textutils.c		Couple of small routines to convert numbers
				into text
	* memutils.c		Routines to copy and clear memory areas
	* divby0.c		If a division function in libgcc.a (which
				might be called by a divide operation
				somewhere in the code) attempts to divide by
				zero, the function will call raise(), which
				is defined in this file
	* interrupts.c		Interrupt handling routines
	* memory.c		Memory management

found here

Found a nother reference u-boot-pi on git hub18. Eureka, got the proper settings for the TV, and they work. So now I am on to some other things. Although, I cannot watch the boot sequence before it gets to FreeBSD. The computer is in a useable state now. So the settings for config.txt are

### appears to work 12-14-14 ###


### above is edit  #####

And no other real modifications that are effecting the operation of the display...I think.

Well... not so fast; again I spent the morning on it, again not succeeding. Also I tried to do portsnap fetch and then portsnap extract, extract failed after a few hours with some sort of a low-level failure of hardware. I think its possible the Pi overheated...

Unfortunately this is very difficult problem to fix. It seems that there are multiple interfaces to the framebuffer. Hardware, linux, and FreeBSD. Or maybe the u-boot loader, FreeBSD loader and the hardware BIOS. I am working on a diagram that may help me to understand, I am to the point where I will use the reference I found about the boot sequence10.
Working start is:

diagram diagramII

Some new thoughts on the problem, look up overscan setting on raspeberry pi website, and the area of a TV...Looking at the description for config.txt from the website, yields some interesing info. The gpu_mem setting adjusts how much memory goes to RAM. probably should change that..Changing to 256, that is gpu_mem=256 in config.txt.

For Reference (from

GPU memory in megabytes. Sets the memory split between the CPU and GPU;
 the CPU gets the remaining memory. Minimum value is 16; maximum value 
is either 192 or 448 depending on whether you're using a 256MB or 512MB
 Pi. The default value is 64.

Setting gpu_mem to low values may automatically disable certain firmware
 features (as there are some things the GPU simply can't do with too
 little memory). So if a certain feature you're trying to use isn't
 working, try setting a larger GPU memory split.

Using gpu_mem_256 and gpu_mem_512 allows you to swap the same SD card
 between both 256MB and 512MB Pis without having to edit config.txt each time:

Maybe this will help (gpu_mem=256) with portsnap extract. Had been getting some sort of Timeout error, I think either the Pi was overheating or ran out of memory.
Trying again.
getting some sort of crash, increased memory, maybe its the image because I could do this before.

installing on a SanDisk, 4GB Micro SD HC
using a SanDisk Adaptor to put in the
Raspberry Pi Model B Revision 2.0 (512MB).
and a Targus High Speed SD/SDHC/MMC Micro SD/T-F Card Reader/writer
USB to write to the card,
from my openSUSE 13.2 (Harlequin) (x86_64) 64-bit
Gnome 3.14.1
I am using the Disks utility in Gnome to format the card
i using, Erase, Don't overwrite existing data(Quick) and
No Partitioning(Empty)
and then write it from xterm with dd.
using the commands,
sudo fdisk -l to discover/confirm what device the chip is,
yielding (on my machine)
 sudo fdisk -l
root's password:

Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 659329B0-471D-421C-877B-F48C42820365

Device        Start        End    Sectors  Size Type
/dev/sda1      2048       4095       2048    1M BIOS boot
/dev/sda2      4096    4225023    4220928    2G Microsoft basic data
/dev/sda3   4225024   88117247   83892224   40G EFI System
/dev/sda4  88117248 3907028991 3818911744  1.8T Microsoft basic data

Disk /dev/sdb: 930.9 GiB, 999501594624 bytes, 1952151552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0002ae3f

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1  *     2048 1952154539 1952152492 930.9G  7 HPFS/NTFS/exFAT

Disk /dev/sdc: 3.7 GiB, 3965190144 bytes, 7744512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
then sudo dd if=FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20140903-r270990.img of=/dev/*dev discovered in previous step*
 sudo dd if=FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20140903-r270990.img 
1953125+0 records in
1953125+0 records out
1000000000 bytes (1.0 GB) copied, 538.159 s, 1.9 MB/s

I will then login to the system and edit the config.txt to include at least the gpu_mem option,
commenting out the existing setting.
this is the ingredients at this point. setup

login photo of loading initial boot. Login
text off screen photo of text off edge. Login
saw, the manual entry for termcap, can set lines, and columns of console!

SO, what I need to do is, set the tty's file to reflect the change I want to make in the console. The console is more or less readable up to this point, and so to make it useable then I need to change the size of the console to accommodate the size that I have. Information about this can be found in the termcap manpage from what I can see. This page refers to the specifications "li" and "co" to define line and column respectively. There are loads of other settings but I am hoping this will do it. Just saw in the manual page that THESE SHOULD BE USED WHENEVER POSSIBLE: the number of lines on a screen "-n" where n is the number of lines. So my entry would probably be something like,

 # 60 line console for Raspberry Pi login  at   1200 baud 
     console "/usr/libexec/getty std.1200"   vt100-60   on	secure

where the 60 lines is denoted by the hyphen 60 addition to vt100 (type of terminal).
Another miracle, a fellow on the freebsd-arm list sent me a mail, with mention of overscan_scale=1, which will "caused the output of openFrameworks to respect the overscan_left, overscan_right, top and bottom settings with the use of an LCD display connected via composite.", according to RPiconfig at

config.txt for composite output, in this case, needs overscan_scale=1.
config.txt has now some other entries, like; overscan_left=40 while the remaining overscan_ settings are 0, gpu_mem=128 is increased from 16, framebuffer_width=720 and framebuffer_height=480 standard.
overscan positive values will receed towards the center of the screen.

/etc/rc.conf may not have been changed, although I think I may
have to put a IP address in there, to see the Pi from another computer.

Well, back at it. portsnap extract failed to succeed
some sort of error.
I am trying another img (newer) hoping that this is an problem that was fixed. FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20141222-r276066.img.bz2 is the new image from Today is the 26th of December 2014, the image is two days old. I have done a thorough format of the chip, 4GB SanDISK, overwriting the data with zero's, and no partitioning(empty). This is in Gnome using OpenSUSE as the OS.

OK OK, this is the last time.

Got an image from, funny thing, the "Get FreeBSD" section of the freebsd website. I have not been checking the md5 checksums but I think that may have something to do with the errors before. Wrote the image, don't really remember whether I formated first or not. To a 4GB chip/card using a adapter to usb, then used a adapter to insert into the pi.
The boot is successful. The new entries for config.txt are successful. Removing the framebuffer instructions, and only adding;


NOW I cannot extract the ports-tree. I run into an error. Also I have to give the Pi a IP address, I think to allow it to exist on the network. I did see some relevant comamnds about bridges, which I think this may be, effectively, but I was intending to have the Pi on a separate line from the xw.

So currently I have a working FreeBSD install which I need to do some configuration to. I need to read some stuff about security and the like. Basic configuration options for the networking system. Basic configuration for BOA. I have to see how I can get the server to stream effectively. I wonder if the stream is information that has to be on a per client basis. What I mean is does the stream have to exist for every client that requests data and is this a load on the host? If the host does not have to process the data, and it is just reading it from a list or something than maybe it is not as intense. ffserver does this and from what I saw HTML 5 does this. In either case I do not know how it does it, but that remains to be seen.

The homepage is not in HTML 5 currently. I think that the largest size video I should put on there without streaming is 20MB. Not too many either, maybe 4 or 5 20MB videos on the site and the remainder images.

Not so Fast. Had to do it again. So I have configured some stuff.
 *existing rc.conf*

ifconfig ue0="DHCP"

#Turn off a lot of standard stuff
#for more free memory
#devd is necessary for proper DHCP operation;
# don't disable unless you know how to run DHCP manually.
#On first boot, enlarge the root filesystem to fill the SD card

so the system keeps failing, need swap I think. At least I will try that. Found this, ( So it looks like I will try that.
**** existing fstab *
/dev/mmcsd0s1    /boot/msdos     msdosfs rw,noatime      0   0
/dev/mmcsd0s2a   /               ufs rw,noatime          1   1
md               /tmp            mfs rw,noatime -s30m    0   0
md               /var/log        mfs rw,noatime -s15m    0   0
md               /var/tmp        mfs rw,noatime -s5m     0   0

Of note is that the fifth field is the dump ?flag?.
fstab man page.To automatically add this swap partition on boot, add an entry to /etc/fstab: /dev/ada1s1b none swap sw 0 0, so thinking that it does not matter what order this file is read in I will just add it at the end. Have not seen any mention of commenting so I will not use that. Noticing that they do not specify size for the swap...OK, maybe not decided to take the swap-file route.

So after some experimentation, I have discovered that the entries (on this system, raspberry-pi: 512 RAM, FreeBSD 10 RELEASE, 4GB SD chip) in that handbook page do not seem to work! Fuck. Looks like I am going to spend another day at this.

Just changed a number of things, rc.conf "swapfile=/usr/swap0", changed the gpu_mem=16 (config.txt), deleted the entry in fstab. Looked repeatedly at the md mdconfig and swapon man pages. The gpu memory option I had set at 512, thinking that would help, but maybe that is the gpu, which is the cpu in arm or something. Well the building of boa seems to be chugging along, Oh yeah, I forgot the extraction of the portstree was not successful. I stopped doing that because It was not working. I should start with that.

ctrl c
/usr/ports/www/boa/make clean
portsnap extract

Starting at 10:02am..................
two hours later, failed.

So at this point I am thinking that I have to add swap space (files or partition), I have to be able to extract ports, maybe not, I have to be able to run make. I think that the issue is due to memory limits due to partitioning although it appears that maybe the firmware might fix the issue. I have tried to use swap file, that does not seem to work, error. I have tried to gpart create and add, not working, probably not using the proper command. I have tried using a larger card/chip. Found something:
md11 none swap sw,file=/swapfile 0 0
found in the examples of fstab manual page.

     # Device	     Mountpoint	     FStype  Options	     Dump    Pass#
     # UFS file	system.
     /dev/da0p2	     /		     ufs     rw		     1	     1
     # Swap space on a block device.
     /dev/da0p1	     none	     swap    sw		     0	     0
     # Swap space using	a block	device with GBDE/GELI encyption.
     # aalgo, ealgo, keylen, sectorsize	options	are available
     # for .eli	devices.
     /dev/da1p1.bde  none	     swap    sw		     0	     0
     /dev/da1p2.eli  none	     swap    sw		     0	     0
     # tmpfs.
     tmpfs	     /tmp	     tmpfs   rw,size=1g,mode=1777    0 0
     # UFS file	system on a swap-backed	md(4).	/dev/md10 is
     # automatically created.  If it is	"md", a	unit number
     # will be automatically selected.
     md10	     /scratch	     mfs     rw,-s1g	     0	     0
     # Swap space on a vnode-backed md(4).
     md11	     none	     swap    sw,file=/swapfile	     0 0
     # CDROM.  "noauto"	option is typically used because the
     # media is	removable.
     /dev/cd0	     /cdrom	     cd9660  ro,noauto	     0	     0
     # NFS-exported file system.  "serv" is an NFS server name
     # or IP address.
     serv:/export    /nfs	     nfs     rw,noinet6	     0	     0

After consulting the md and mdconfig man page I found the command which I used that seemed to do something not sure if it worked. mdconfig -f /swap where /swap is a file that I made following the instructions in the handbook, Creating a Swap File, under Adding Swap Space. At this point the command returned md3 after two previous entries existed, md1 and md2; for /tmp and /var/tmp, I think. Trying the portsnap extract again starting at 4:00 am.
attempt #2 of extract, well actually #3.
So I think I may have figured out how to add a file to use as swap, although I saw on stackexchange that writing to a SD may be bad for it (like RAM). warning: dd BAD, this is on my system the entries here seem to have worked, I will explain following the command sequence

dd if=/dev/zero of=/usr/swap0 bs=1m count=64
chmod 0600 /usr/swap0
mdconfig -f /usr/swap0
bsdlabel -w md4 auto
newfs md4a
mount /dev/md4a /mnt
df /mnt

dd in file is if out file is of, so dd if=/dev/zero is putting what is in /dev/zero into a file called /usr/swap0.----

chmod 0600 to change permissions* might not be right.-------

mdconfig, malloc disk configuration; -f, is file add /usr/swap0 as md file.---------

bsdlabel -w label memory disk automatically.
Have to fix the previous mistakes.Or not

Likely was encountering Lock Order Reversal I think.
Anyway could not do portsnap extract. Kernel Panic, Error 1, Frozen System.
Trying again with original Chip bought for this purpose: SanDisk 4GB (circle 4) Micro SD HC.
SanDisk 4GB
Writing this and will be writing (dd) that on a OpenSUSE machine with GNOME:hp xw6200. Have to extract the image which I cannot seem to figure out how to do with tar, will use archive mounter. Will use the disks utility to format the chip, (overwrite with zeros-slower), then dd to write the image. After I boot the system, I think I will attempt to portsnap fetch, portsnap extract, which should take until tonight if it works; currently 7am. Then fix the overscan issue after I get verification that I can use the system.

Archive Mounter
extract. Skipping CheckSUM.
Plug in chip, with adapter to USB.
Format, overwrite with zeros, no partitioning.
about 15 min, 4GB

 sudo fdisk -l
root's password:

Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 659329B0-471D-421C-877B-F48C42820365

Device        Start        End    Sectors  Size Type
/dev/sda1      2048       4095       2048    1M BIOS boot
/dev/sda2      4096    4225023    4220928    2G Microsoft basic data
/dev/sda3   4225024   88117247   83892224   40G EFI System
/dev/sda4  88117248 3907028991 3818911744  1.8T Microsoft basic data

Disk /dev/sdb: 930.9 GiB, 999501594624 bytes, 1952151552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0002ae3f

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1  *     2048 1952154539 1952152492 930.9G  7 HPFS/NTFS/exFAT

Disk /dev/sdc: 3.7 GiB, 3965190144 bytes, 7744512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

So /dev/sdc happens to be the 4GB chip.
using dd, about 15 minutes. 7:51am*
sudo dd if=FreeBSD-11.0-CURRENT-arm-armv6-RPI-B-20141222-r276066.img of=/dev/sdc
root's password:
1953125+0 records in
1953125+0 records out
1000000000 bytes (1.0 GB) copied, 273.783 s, 3.7 MB/s

new .img
format with disks,
 fdisk -l
root's password:

Disk /dev/sda: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 659329B0-471D-421C-877B-F48C42820365

Device        Start        End    Sectors  Size Type
/dev/sda1      2048       4095       2048    1M BIOS boot
/dev/sda2      4096    4225023    4220928    2G Microsoft basic data
/dev/sda3   4225024   88117247   83892224   40G EFI System
/dev/sda4  88117248 3907028991 3818911744  1.8T Microsoft basic data

Disk /dev/sdb: 930.9 GiB, 999501594624 bytes, 1952151552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0002ae3f

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1  *     2048 1952154539 1952152492 930.9G  7 HPFS/NTFS/exFAT

Disk /dev/sdc: 3.7 GiB, 3965190144 bytes, 7744512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
ito@xw62-work:~> sudo dd if=FreeBSD-11.0-CURRENT-arm-armv6-RPI-B.img 0f /dev/sdc 
dd: unrecognized operand ‘0f’
Try 'dd --help' for more information.
ito@xw62-work:~> sudo dd if=FreeBSD-11.0-CURRENT-arm-armv6-RPI-B.img of=/dev/sdc 
1953125+0 records in
1953125+0 records out
1000000000 bytes (1.0 GB) copied, 500.467 s, 2.0 MB/s

Raspberry Pi Model B 512

Extract failed somewhere late in, may have gotten www/ so might be able to build boa.
Not quite right though. Incidentally DRAM now reports 480 I think in the previous *10 attempts it was reporting 440 or something. Have to learn how to CHECKSUM. Looks like to do this you create a directory and then put only the two files in it and then issue md5sum -c...preliminary. It seems that I may have downloaded the files messy-like and the img is not right. < a name="extract-attempt_h2"> Maybe not, but then I just overwrote the image file so '. For what its worth, portsnap extract still fails:
mmcsd0: Error indicated: 1 Timeout
g_vfs_done():mmcsd0s2a[WRITE(offset=2946598560, length=16384mmcsd0: Error indicated: 1 Tim
]error = 5
panic: No b_bufobj 8xcc487t00
KIB: enter: panic
[ thread pid 12 tid 100007 ]
Stopped at         $d:     ldrb   r15, [r15, r15, ror r15]!

I have seen mention of the lack of fsck in this version/build/release, file. Maybe I have to enable it, don't know, might check. Though the original problem I think is not that the filesystem is messed up, it is something else. So why use fsck when the original problem exists. Waiting for the md5sum command to finish...

Trying another image from, this one FreeBSD-armv6-11.0-RPI-B-test22-r276645-20150104.img.gz, has a date of Jan 4 2015, although it says test. There is a README there which has some details. I am going to go through the stuff the fast way I think, that is partition quick and for MSDOS, using disks utility in GNOME. Then dd, incidentally I did not mention how dangerous dd is ( it can overwrite an entire disk if you allow it to ), which is of course what I am doing here although the wrong dev/ entry and it would/could be bad. What I am currently interested in is getting the thing to work, sort of a proof of concept.
This could be the wrong focus. I should probably decide to do it once and be done. I am inclined to think that this part of FreeBSD is experimental although I think, now, that it would not be on the website if it were. I think that is what Supportedmeans, that the community is willing to take responsibility for it. So that means that if I want it to work I should use a RELEASE version, I think. There is documentation about that I know. I guess one could say I am putting the cart before the horse. Well gonna give it a shot. Amazing, if you have no clue what you are doing, you will not get anywhere.:: Back to the "Production Release" and the forums.

So it looks like the extract command has gotten almost all the way, the only difference is that I left the computer alone after and while the fetch command completed. I checked fsck before and after this period and the filesystem checking seemed to have fixed something or other. At this point the ports tree has gotten to /usr/ports/www/ ... most of the way through. We will see. That is pretty much all I was hoping for. So it appears that the key is to allow FreeBSD to do its thing.

The make build command was executed in the /usr/ports/www/boa/ directory and the package pkg is being installed which I am hoping is neccesary to build and make boa. I am not sure what I will do next. I think I have to purchase a router, or bridge, or switch. Some things I want to do; adduser, which I intend to be the only access other than admin access (the TV, terminal), so that no-one is allowed remote access to the machine. I will have to do some research, I guess. Suffice it to say that I will not turn on root access to ssh. The user should be allowed to modify the directory in which html files are stored. That should be it.

Other things I may experiment with are the speed of the thing although with such a simple webpage I would hope that should not be neccessary. I have seen that ffserver will serve video (don't know if this is allowed via boa), and that html5 allows for streaming video. As I previously mentioned the size limit on the resident videos should be 20MB at least.

$ uname -a
FreeBSD raspberry-pi 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401:
 Wed Nov 12 04:42:19 UTC 2014  arm
 dmesg | less
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2014 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.1-RELEASE #0 r274401: Wed Nov 12 04:42:19 UTC 2014 arm
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
VT: init without driver.
CPU: ARM1176JZ-S rev 7 (ARM11J core)
 Supported features: ARM_ISA THUMB2 JAZELLE ARMv4 Security_Ext
 WB enabled LABT branch prediction enabled
  16KB/32B 4-way instruction cache
  16KB/32B 4-way write-back-locking-C data cache
real memory  = 536866816 (511 MB)
avail memory = 482893824 (460 MB)
random:  initialized
kbd0 at kbdmux0
simplebus0:  mem 0x20000000-0x20ffffff on ofwbus0
intc0:  mem 0xb200-0xb3ff on simplebus0
systimer0:  mem 0x3000-0x3fff irq 8,9,10,11 on simplebus0
Event timer "BCM2835 Event Timer 3" frequency 1000000 Hz quality 1000
Timecounter "BCM2835 Timecounter" frequency 1000000 Hz quality 1000
bcmwd0:  mem 0x10001c-0x100027 on simplebus0
gpio0:  mem 0x200000-0x2000af irq 57,59,58,60 on simplebus0
gpio0: read-only pins: 46,47,48,49,50,51,52,53.
gpio0: reserved pins: 48,49,50,51,52,53.
gpioc0:  on gpio0
gpiobus0:  on gpio0
gpioled0:  at pin(s) 16 on gpiobus0
iichb0:  mem 0x205000-0x20501f irq 61 on simplebus0
iicbus0:  on iichb0
iic0:  on iicbus0
iichb1:  mem 0x804000-0x80401f irq 61 on simplebus0
iicbus1:  on iichb1
iic1:  on iicbus1
spi0:  mem 0x204000-0x20401f irq 62 on simplebus0
spibus0:  on spi0
bcm_dma0:  mem 0x7000-0x7fff,0xe05000-0xe05fff irq 24,25,26,27,28,29,30,31,32,33,34,35,36 on simplebus0
mbox0:  mem 0xb880-0xb8bf irq 1 on simplebus0
sdhci_bcm0:  mem 0x300000-0x3000ff irq 70 on simplebus0
mmc0:  on sdhci_bcm0
uart0:  mem 0x201000-0x201fff irq 65 on simplebus0
uart0: console (115200,n,8,1)
dwcotg0:  mem 0x980000-0x99ffff irq 17 on simplebus0
usbus0 on dwcotg0
fb0:  on ofwbus0
simplebus1:  on ofwbus0
simplebus1: could not get ranges
device_attach: simplebus1 attach returned 6
Timecounters tick every 10.000 msec
usbus0: 480Mbps High Speed USB v2.0
ugen0.1:  at usbus0
uhub0:  on usbus0
uhub0: 1 port with 1 removable, self powered
ugen0.2:  at usbus0
uhub1:  on usbus0
uhub1: MTT enabled
mmcsd0: 4GB  at mmc0 25.0MHz/1bit/65535-block
fb0: 720x480(0x0@0,0) 16bpp
fb0: pitch 1440, base 0x5e006000, screen_size 691200
fbd0 on fb0
VT: initialize with new VT driver "fb".
random: unblocking device.
Root mount waiting for: usbus0
uhub1: 3 ports with 2 removable, self powered
ugen0.3:  at usbus0
smsc0:  on usbus0
smsc0: chip 0xec00, rev. 0002
miibus0:  on smsc0
ukphy0:  PHY 1 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0:  on smsc0
ue0: Ethernet address: b8:27:eb:20:0e:71
Root mount waiting for: usbus0
ugen0.4:  at usbus0
ukbd0:  on usbus0
kbd1 at ukbd0
Trying to mount root from ufs:/dev/mmcsd0s2a [rw,noatime]...
warning: no time-of-day clock registered, system time will not be set accurately
smsc0: chip 0xec00, rev. 0002
uhid0:  on usbus0

$ less /etc/rc.conf

# Turn off a lot of standard stuff
# for more free memory.
#devd is necessary for proper DHCP operation;
# don't disable unless you know how to run DHCP manually.
# On first boot, enlarge the root filesystem to fill the SD card




mount command*

$ mount
/dev/mmcsd0s2a on / (ufs, local, noatime, journaled soft-updates, nfsv4acls)
devfs on /dev (devfs, local)
/dev/mmcsd0s1 on /boot/msdos (msdosfs, local, noatime)
/dev/md0 on /tmp (ufs, local, noatime, soft-updates)
/dev/md1 on /var/log (ufs, local, noatime, soft-updates)
/dev/md2 on /var/tmp (ufs, local, noatime, soft-updates)

So at this point I have gotten the boa configuration finished and the website is being served.
I have to configure syslog to log messages so that I can see what is going on with the pi, and I am hoping that I can configure syslog to mail me reports.


syslog, syslogd and syslog.conf man pages are the primary sources of information in this case I think although maybe the wikipedia article would be helpful. Trial and error may work but I don't really want to waste time. One thing I have seen FreeBSD Diary entry, is that you need to use tabs not spaces in the configuration file. I am hoping that edit uses tabs as tabs. Other than that, the file, syslog.conf, accepts an apparently rich syntax. man syslog.conf yields information relevant I think:
 +o	 A vertical bar	(``|''), followed by a command to pipe the selected
	 messages to.  The command is passed to	sh(1) for evaluation, so usual
	 shell metacharacters or input/output redirection can occur.  (Note
	 however that redirecting stdio(3) buffered output from	the invoked
	 command can cause additional delays, or even lost output data in case
	 a logging subprocess exited with a signal.)  The command itself runs
	 with stdout and stderr	redirected to /dev/null.  Upon receipt of a
	 SIGHUP, syslogd(8) will close the pipe	to the process.	 If the
	 process did not exit voluntarily, it will be sent a SIGTERM signal
	 after a grace period of up to 60 seconds.

	 The command will only be started once data arrives that should	be
	 piped to it.  If it exited later, it will be restarted	as necessary.
	 So if it is desired that the subprocess should	get exactly one	line
	 of input only (which can be very resource-consuming if	there are a
	 lot of	messages flowing quickly), this	can be achieved	by exiting
	 after just one	line of	input.	If necessary, a	script wrapper can be
	 written to this effect.

	 Unless	the command is a full pipeline,	it is probably useful to start
	 the command with exec so that the invoking shell process does not
	 wait for the command to complete.  Warning: the process is started
	 under the UID invoking	syslogd(8), normally the superuser.

     Blank lines and lines whose first non-blank character is a	hash (``#'')
     character are ignored.  If	`#' is placed in the middle of the line, the
     `#' character and the rest	of the line after it is	ignored.  To prevent
     special meaning, the `#' character	may be escaped with `\'; in this case
     preceding `\' is removed and `#' is treated as an ordinary	character.

So, my first thought and my guess is that I should pipe to a mail command, something like mail and select the relevant log info in the syslog output with the configuration file.
--found this; RFC 3164 - The BSD Syslog Protocol, at ietf.
which is obsoleted by 5424*
...also cron may be the solution, to run a cron job to mail the log, but may need some sort of way of digesting the info.
Handbook: configuring cron, as well as the entry on configuring system logging
.. and 19, newsyslog, rotating logs. SO think I am going to use mutt mail. 20
... also 21

SO what I am thinking is:

         |- FILE ---> mail -- gnupg --> email@address        
syslog --|
         |- CONSOLE

In order to implement this I need to set up some configuration files. Like syslog.conf, a muttrc file, presumably a gnupg configuration file, and a cron configuration file. So to this end I have edited the sample file from the syslog.conf man page at;

#  need to check for proper formatting and syntax
#  syslog.conf
#  significant purpose# mailing log files.

###A configuration file might	appear as follows:

     # Log all kernel messages,	authentication messages	of
     # level notice or higher, and anything of level err or
     # higher to the console.
     # Don't log private authentication	messages!
     *.err;kern.*;auth.notice;authpriv.none;mail.crit	     /dev/console

#  log to file exact duplication of what is logged to console

     # Log all kernel messages,	authentication messages	of
     # level notice or higher, and anything of level err or
     # higher to the console.log FILE.
     # Don't log private authentication	messages!
     *.err;kern.*;auth.notice;authpriv.none;mail.crit	     /var/log/console.log


Above. This will log to the console, as well as a file, the log messages that are of the following catagories;
All kernel messages, Authentication messages of level notice or higher, Anything of level error or higher... Not private authentication messages.
I then think that I have to set up a crobjob that will mail this file, console.log to an email account. Below is a example cron configuration file:

     # use /bin/sh to run commands, overriding the default set by cron
     # mail any	output to `paul', no matter whose crontab this is
     # run five	minutes	after midnight,	every day
     5 0 * * *	     $HOME/bin/daily.job >> $HOME/tmp/out 2>&1
     # run at 2:15pm on	the first of every month -- output mailed to paul
     15	14 1 * *     $HOME/bin/monthly
     # run at 10 pm on weekdays, annoy Joe
     0 22 * * 1-5    mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
     23	0-23/2 * * * echo "run 23 minutes after	midn, 2am, 4am ..., everyday"
     5 4 * * sun     echo "run at 5 after 4 every sunday"

source: crontab(5)
Currently the raspberry pi (server) is offline, so I am not going to install mutt until I am ready with the rest of the thing. I think that I will link these files, for what they are worth, for completeness. So; Above we have a syslog.conf, which I think is suitable. That should be written to a file (proper permissions and tabs). I should write this on the server, so that it is in its native environment. So I am waiting on that. I wonder if the MAILTO environment variable in the cron configuration file above can be set to use mutt; I assume so. Although I don't know if these are temporary settings of the variable, that is, are they set only by the cron configuration file when used and set back after. In this case setting the env variable would result in no change unless set in the cron configuration file. I think that I am going to adapt the diagram I drew to reflect a better understanding of the process.

           |         muttrc
           |            |      gnupg
           |            |        |    crontab
           |            |        |       |

   logs --> console.log
           |            |        |       |
             attach console.log to 
             pending email

           |                     |       |
                            encrypt mail    
                         (setup privacy stuff)
           |                             |
                                console.log --mail--> my email
     additional --------------- (once a week... also should 
      configuration              make allowances for special cases)
      for special cases,
      separate alert log file

6.1 Command line options

Running mutt with no arguments will make Mutt attempt to read your spool mailbox
. However, it is possible to read other mailboxes and to send messages from the
 command line as well.

    -a      attach a file to a message
    -b      specify a blind carbon-copy (BCC) address
    -c      specify a carbon-copy (Cc) address
    -e      specify a config command to be run after initilization files are read
    -f      specify a mailbox to load
    -F      specify an alternate file to read initialization commands
    -h      print help on command line options
    -H      specify a draft file from which to read a header and body
    -i      specify a file to include in a message composition
    -m      specify a default mailbox type
    -n      do not read the system Muttrc
    -p      recall a postponed message
    -R      open mailbox in read-only mode
    -s      specify a subject (enclose in quotes if it contains spaces)
    -v      show version number and compile-time definitions
    -x      simulate the mailx(1) compose mode
    -y      show a menu containing the files specified by the mailboxes command
    -z      exit immediately if there are no messages in the mailbox
    -Z      open the first folder with new message,exit immediately if none

To read messages in a mailbox

mutt [ -nz ] [ -F muttrc ] [ -m type ] [ -f mailbox ]

To compose a new message

mutt [ -n ] [ -F muttrc ] [ -a file ] [ -c address ] [ -i filename ] [ -s subject ] address [ address ... ]

Mutt also supports a ``batch'' mode to send prepared messages. Simply redirect input from the file you wish to send. For example,

mutt -s "data set for run #2" < ~/run2.dat

This command will send a message to ``'' with a subject of
 ``data set for run #2''. In the body of the message will be the contents of the
 file ``~/run2.dat''.

Looks like mutt doesn't have the facility to actually route and send mail, for that I am looking for a MTA whereas mutt is a MUA, although there will likely already be one installed on the FreeBSD system I installed on the pi. The thing is that I don't think I need to compose a message to send the logs. I just need to send the logs. Maybe though, the logs may be too large to email the entire thing, other than as an attachment... Maybe I would need mutt anyway.

so what I am thinking is the command, with an existing log file would go something like this:

mutt -s server_logs -a logfile.log ***@***.com

the -s being to subject, enclose in quotes if it contains spaces, and the -a is the attachment (file) to send, then the address. This presumably could be triggered by cron in a predifined rotation. The entry (in crontab) should look something like this;

0 0 * * fri      mutt -s server_log -a /var/log/console.log

with being a actual name at an email provider. The entry should be executed to provide a log every friday at midnight, to the address listed, with the subject of "server_log". So the actual install of mutt on FreeBSD using ports has a nice curses (console view) interface, with many options. A second curses interface allows you to install encryption support. The install seems to be preceeding. I wonder if I have to install GNUpg first before mutt. OOPS pi crashed. probably should have turned off boa.
so I have tried to use mutt since the last entry.. Couple of things. One is a syntax idiosyncracy, the command, I think, should read as;
mutt -a attach.txt -s attachment--***
where the asterisk is the address and the - (hyphen) is necessary to space the arguments. Also after I installed sendmail which I believe is the facility to actually send and route the mail... I discovered that I could not send. I was getting returned mail about blah blah ... SMTP... blah blah. So today I searched for "freebsd smtp", on webcrawler. First result, SMTP authentication (FreeBSD Handbook), may have just straitened me out. IT WORKED!
..had to change the hostname so that its one that I own, and used a user rather than root. Not encrypted yet... but it worked. Now I have to either configure or use encryption to get what I want, and try a test with the logs. Ok set crontab to mail weekly, see how that goes.
cat /var/log/xferlog | sendmail ***
seems as though it works from the command line, into the crontab.

attempt 9

Working (aug 16 2016),
and hopefully successful attempt.
from here,

This time around I am going to try to follow the Handbook much more closely. With that in mind, today, I am on the 2.3. Pre-Installation Tasks section of the handbook.

I have purchased a new MicroSD card, as advised on the FreeBSD forum,
because I was having some problems with a kernel panic on the existing installation.
I am not sure this is the actual description of the problem, but to me the problem would be described in this way:
 I am using the computer to enter commands and
 the interface (Command Line) is overrun with
 information that does not allow me to type and 
 often ends in the computer crashing or otherwise
 becomming unuseable.  I then have to cycle the
 power and try again.
-- I have found that maybe having the Pi close to the TV may have caused problems, I moved it however am intent on having a clean fresh install. --

So in the Handbook I see that among the pre-installation tasks there is to obtain network information. This is something that I have to further understand and with this computer will be important. To this end I have drawn a simple diagaram and found some resources to help:

. I found a pamphlet in ICANN's website called ip-address-beginners-guide, here one thing that is mentioned is that - 192.168 - is used by commercial products for residential users which I believe is the case for the surfboard I have. 23

. a description of hostnames here 25

. further description of hostnames and other network (thorough) stuff here 24

. this may have some info that is useful.

Even though with this installation the system will boot directly into a running system (no bsdinstall, or installation) I will still need to configure those parameters. Looking around at the various documents regarding this release I see little official mentioned about this method of installation except here, under the FreeBSD/arm SD card images.

OK, so I don't have to reinstall. The TV, I think was causing interferance with the PI. The PI is now hanging under it and works fine. At this point I have read most of the HANDBOOK and have gotten to the APACHE configuration section. Recently my ethernet stopped working and I bought a new card, but in the interim it somehow fixed itself. Now I have two ethernet interfaces, so I think the workstation will no be assigned as the 'router' here. I am told by the *Provider that I only get two IP addresses, and that may be why I have been having trouble. Of course I wanted a static IP ( which to me means one address) so I am OK with that. I did read the section in the HANDBOOK about NAT (Network Address Translation) which led me to follow this road. TO, dnsmasq and iptables, although I think dnsmasq is what I am going to use. It is already on my opensuse system.

I do have to improve the configuration of the snaokwrx computer, namely the PI. I want to get the addressing sorted out first I think though

So now I have to implement a web design

To this end I have begun to explore CSS which I had avoided until now. I might add that I don't see the point but it is not my region of experience. Anyway here it goes.
So I have a working page written in HTML4, more or less which uses no style sheets and no CSS. I think I may make this page available to allow more people to view the content. This page works and the layout, I think, is what I will use with the new one, although I am hoping that the new one will be faster.
So, some basics that I have learned. For one the CSS can be included in the HTML document. A few examples of other properties I don't understand are float, margin, and the way these fit together. Just searched on google for "css spec div" and came up with a page on Visual Effects from the W3C. This may be what I am looking for because I have a design element in the page which I want to be placed half-way on the first page. this is the page I am looking at. After some trial and error I have had a good deal of trouble making the new page work. Here is a quick layout image to show how the first two pages should go together.
This is some quick notes I jotted.
So I have gotten a somewhat working page which still has problems with Internet Explorer. With the HTML implentation of the shockwave flash movie embedding. What I have now is
<video><object><embed src="shockwavemoviefile.swf"></embed></object></video>
more or less. When I look at the page with an older version of Internet Explorer I get the videos but with the more modern version I get INVALID SOURCE, with a black box to define the video.
Found what looks to be a useful resource for internet explorer, dev center.internet explorer:API. Cursory it looks like I fixed the implementation with,
<object data="shockwavemovie.swf" type="application/x-shockwaveflash" width="392" height="512"></object>

setting up a server
elinux RPI Hub
raspberry pi with FreeBSD
freebsd svn web
dave ish github
raspberry pi, well commented config.txt
elinux wiki Rpi Framebuffer
raspberry pi blog entry, this blog
github: raspberry
vt driver man page
Das U-Boot-- the Universal Boot Loader
raspberry pi,freebsd
|boot process readme.txt|

Raspberry Pi Wiki|Hub
tldp nag (contents)
the linux documentation project,
network administration guide
Cambridge computer lab: Baking Pi
Raspberry Compote:
blog about low level Pi stuff

man newsyslog
Using GnuPG
with mutt

ICANN resources, beginners guides
25, good simple description of hostnames

user: gonzoua,
project: u-boot-pi,
location: github,
reason: documentation

mail program

mutt: Command Line Options
the linux documentaion project, hostnames

extract attempt b1
install attempt 2 extract attempt 1
extract attempt b2
install attempt 8 extract attempt 2
extract attempt f1
install attempt 6 extract attempt 1