Home

Installing OpenBSD 3.9 on a Soekris 4801

2006/05/08

There are many ways to install OpenBSD 3.9 on a Soekris 4801. One can refer to flashdist and OpenSoekris. This is an alternate method. Why? Because it can be done. Flashdist and OpenSoekris aim at smaller distributions (~ 32MB) while using my way you get a more complete OpenBSD installation.

  1. Setup a DHCP server

    I use the ISC DHCP server. The relevant part in the dhcpd.conf is:

    host foo {
            hardware ethernet 00:00:24:XX:YY:ZZ;
            fixed-address foo.bar.tee.gr;
            filename "pxeboot";
    }
    

    The above configuration presupposes that your DHCP server is going to be used as a TFTP server also.

  2. Stuff to do on the TFTP server

    Assume that the tftp root directory is /tftpboot. Place on /tftpboot the file
    pxeboot that is found on the OpenBSD distribution.

    Also, place on /tftpboot the install kernel, bsd.rd.

    Next, mkdir /tftpboot/etc. Create a file named /tftpboot/etc/boot.conf with the following contents:

    set tty com0
    stty com0 9600
    boot bsd.rd
    
    

    If your 4801 console is setup to a different baud rate, either change this here, or on your 4801’s console. Refer to the Soekris BIOS documentation on how to do this.

    If your inetd/xinetd makes use of /etc/hosts.{allow,deny} then take care to allow foo.bar.tee.gr to access the tftp server.

  3. Netboot your Soekris 4801

    According to the Soekris documentation on the Soekris BIOS prompt you should type:

    boot f0
    

  4. Install OpenBSD 3.9

    This procedure is best covered by the OpenBSD documentation.

    What you need to remember is that you are installing on a Compact Flash. Therefore you do not need a swap partition. But OpenBSD does not install unless you have a swap partition. So you can create a swap
    partition with size of 1 (yes one):

    
    Initial label editor (enter '?' for help at any prompt)
    > p
    device: /dev/rwd0c
    type: ESDI
    disk: TOSHIBA THNCF25
    label:
    bytes/sector: 512
    sectors/track: 32
    tracks/cylinder: 16
    sectors/cylinder: 512
    cylinders: 978
    total sectors: 500736
    free sectors: 0
    rpm: 3600
    
    16 partitions:
    #             size        offset  fstype [fsize bsize  cpg]
      a:        500703            32  4.2BSD   2048 16384  578
      b:             1        500735    swap
      c:        500704            32  unused      0     0
    > w
    > q
    

    When you need to select what sets to install, you select only:

            [X] bsd
            [ ] bsd.rd
            [ ] bsd.mp
            [X] base39.tgz
            [X] etc39.tgz
            [ ] misc39.tgz
            [ ] comp39.tgz
            [ ] man39.tgz
            [ ] game39.tgz
            [ ] xbase39.tgz
            [ ] xetc39.tgz
            [ ] xshare39.tgz
            [ ] xfont39.tgz
            [ ] xserv39.tgz
    Set name? (or 'done') [bsd.mp] done
    

    Halt the system

  5. Configure the System

    Boot in single user mode. Interrupt the OpenBSD boot procedure (not the Soekris BIOS one) and type boot -s. When the system boots, perform the next steps:

    mount -o rw /
    mkdir /mfs
    

    Modify /etc/rc to execute the following script:

    # add a line after the rm -f /fastboot entry in /etc/rc to execute this
    # script: /usr/local/sbin/setup_mfs.sh
    #
    # This preassumes that you have moved /var/log to /var/log.template
    # and /var/mail to /var/mail.template
    #
    # /tmp -> /mfs/var/tmp
    # /var/tmp -> /mfs/var/tmp
    # /var/log -> /mfs/var/log
    # /var/run -> /mfs/var/run
    # /var/mail -> /mfs/mail
    #
    echo mfs: mounting /mfs...
    mount_mfs -s 16384 /dev/wd0b /mfs
    mkdir -p /mfs/var/run
    mkdir -p /mfs/var/tmp
    chmod 1777 /mfs/var/tmp
    cp -Rp /var/log.template /mfs/var/log
    cp -Rp /var/spool/mqueue /mfs/mqueue
    cp -Rp /var/spool/clientmqueue /mfs/clientmqueue
    cp -Rp /var/mail.template /mfs/mail
    #
    # EOF
    

    Do not create the symbolic links yet!

    chmod +x /usr/local/sbin/setup_mfs.sh
    

    Edit /etc/mail/sendmail.cf and /etc/mail/submit.cf and change the entries for clientmqueue and mqueue to point at /mfs/{clientmqueue,mqueue}

    Create all the symbolic links discussed above and reboot.

    After the first reboot, edit /etc/fstab to mount / as read-only:

    /dev/wd0a / ffs ro,noatime 1 1
    

    On a 256MB Compact Flash df -h shows:

    # df -h
    Filesystem     Size    Used   Avail Capacity  Mounted on
    /dev/wd0a      240M    136M   91.8M    60%    /
    mfs:28643      7.8M    112K    7.3M     1%    /mfs
    

Comments, flames and improvements are welcome.

P.S. What about the PC Engines WRAP?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: