OpenMicroServer™ / OpenBlockS™

Firmware Customization

This text explains how to customize the firmware for OpenMicroServer and OpenBlockS266. The firmware includes both a kernel image and a RAM disk image, so customization is separated into two parts, kernel image and RAM disk image.
The following explanation assumes you have outfitted the OpenMicroServer/OpenBlockS266 with a CompactFlash card of at least 1 GB. You can also use a HDD for the CompactFlash slot.

To start, connect the server to a network from where you have access to our ftp server ftp://ftp.plathome.co.jp/pub/.

1. Boot

Insert a 1 GB CF card into the server, and boot it from initrd. Use the command uname -rv to check the installed firmware. If you have the current production model, you should get the following results:

2. Installation

2.1. Network settings

2.2. Partition settings

Use fdisk to create a partition /dev/hda1 on the whole CF card.

2.3. sysinst

The installation is done via the sysinst command. On the `Select distributions' screen, make the following choices:

     0. Generic Kernel : yes
     1. Base           : yes
     2. System (/etc)  : yes
     3. Compiler       : yes
     4. Manuals        : no
     5. Contributions  : yes
     6. Source         : yes

On the `Setup for FTP download' screen, enter the following under `Remote pathname':

RELEASE-20070221 and RELEASE-20050914 are the firmware versions.

See the sysinst Howto on how to use the sysinst command.

3. Update the boot device and reboot

Change the boot device to the CF card, and reboot:

# flashcfg -c hda1
# reboot

Log in as root after the reboot.

4. Edit /etc/mk.conf

5. Edit /root/.bash_profile and /root/.bashrc

Log out once and log in again.

6. Obtain files

Get the following files from our ftp server ftp://ftp.plathome.co.jp/pub/ssdlinux/distfiles/ and put them in /usr/src/dist/distfiles/

7. Decompress the kernel and apply patch files

# cd /usr/src/mkdist/mtd	(OpenMicroServer only)
# bmake				(OpenMicroServer only)
# cd /usr/src/mkdist/kernel
# bmake

If you wish to apply patches to the kernel, in addition to the patches included in SSD/Linux, do it at this stage.

8. Compile the kernel

# cd /usr/src

To customize (configure) the kernel, run

# bmake -DBACKUP_CONFIG menuconfig

Use the following command to compile the kernel

# bmake build_kernel

At the end, bmake stops in the directory /usr/src/lib/modules/ with an error. This is because the source files are not decompressed. Ignore this error, as the compiling of the kernel continues anyway.

9. Customization of the RAM disk image

9.1. Obtain a RAM disk image

If it is not necessary to customize the RAM disk image, proceed to step 10.

9.2. Customization of the RAM disk image

Here, we change the shell to bash, and add the telnet command.

Change the directory to customize the RAM disk image:

Mount the RAM disk image.

# gzip -d ramdisk.image-product.gz
# losetup /dev/loop0 ramdisk.image-product
# mount -t ext2 /dev/loop0 /mnt

9.2.1. Add bash

Since it is enough to simply copy the bash shell, do the following:

# cd /mnt/bin
# rm sh bash
# cp /bin/bash .
# ln -s bash sh

Please don't forget the symbolic link /bin/sh

9.2.2. Adding telnet

Check the libraries linked by the telnet command.

# ldd /usr/bin/telnet
libncurses.so.5 => /usr/lib/libncurses.so.5 (0x0ff97000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x0feb0000)
libc.so.6 => /lib/libc.so.6 (0x0fd4d000)
libm.so.6 => /lib/libm.so.6 (0x0fcb8000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x0fc8b000)
/lib/ld.so.1 => /lib/ld.so.1 (0x30000000)

Check whether all libraries exist:

As the library /usr/lib/libstdc++.so.5 is missing, copy it here:

# cd /mnt/usr/bin
# cp /usr/bin/telnet .
# cd /mnt/usr/lib
# cp /usr/lib/libstdc++.so.5 .

Move back to the original directory:

Unmount the RAM disk image.

# umount /mnt
# losetup -d /dev/loop0
# gzip -9 ramdisk.image-product

10. Create the firmware

Change the directory to create the firmware.

Run bmake to create the firmware.

# bmake

A while later the operation is done, and the firmware is created in zImage.initrd.treeboot-product. In this example, we created a firmware where the shell is changed to bash and the telnet command is added.

Contact

For questions and support on the OpenMicroServer, contact us at support@plathome.com.