Setting Up tinybsd on Advantech PCM-5823 Embedded System

tinybsd on embedded system pcm-5823 I was able to get an Advantech PCM-5823 embedded PC board, discarded at my workplace. It needed some soldering to bring it to live, but otherwise it was nicely working mini-PC.

I used a tinybsd port from the FreeBSD ports collection to turn it into a tiny embedded system.

One note: I had challenges building the port because the PC I'm running this is an AMD64 architecture, and embedded PCM-5823 PC board is an i386 platform. So I used another, older, i386 box to make a tinybsd build. Later I read that you could make an i386 build on other (AMD64) architecture in FreeBSD, but I couldn't get it to work, so for now when I make tinybsd build I match the target platform.

If interested, config files used to build tinybsd available.

Here is a script I used to make a bootable tinybsd image for the PCM-5823 embedded PC:

# **********************************************************************
#	tinybsd setup on Advantech PCM-5823 embedded system
# **********************************************************************
# 12/27/2007

# -- Media Preparation:
# -- Using USB2Flah adapter
# -- Ensure a correct USB disk is on /dev/da1s1 !
# -- otherwise change da1s1 to proper disk.

fdisk -BI da1
bsdlabel -w /dev/da1s1 auto
bsdlabel -B /dev/da1s1

#-- Build an image
#  Using Sandisk 128mb flash geometry (confirmed on target OS):
/usr/src/tools/tools/tinybsd/tinybsd 249808 8 32 pcm pcm000.bin >pcm.out

# -- Copy image to media
dd if=/usr/src/tools/tools/tinybsd/tinybsd.bin of=/dev/da1s1

	# -- Optional tasks after image is built:

# -- If need to modify files on image

        #-- attach & mount created image as disk on /mnt
mdconfig -a -t vnode -f /usr/src/tools/tools/tinybsd/tinybsd.bin -u 0
mount /dev/md0a /mnt

        #-- copy/edit files, etc.
diskinfo
adduser

        #-- unmount & detach image disk
umount /mnt
mdconfig -d -u 0

Initializing first boot:
  1. boot (ro- mounted filesystem).
  2. edit (ne) /etc/fstab to mount filesystem as rw
  3. reboot - generates ssh keys, etc.
  4. set root password, create accounts, etc.
  5. edit fstab back to mout filesystem as ro, reboot
Afterwards, if you need add, delete, or modify files, set file system as read/write:
mount -u -o rw /
do your stuff, and then change it back to read-only mode:
mount -u -o ro /

 .