OpenBlockS

Firmware Customization

This text explains how to customize the firmware for the 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 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:

RELEASE-20050914
ftp://ftp.plathome.co.jp/pub/OpenBlockS266/RELEASE-20050914/installation/zImage.initrd.treeboot-product

uname -rv result

2.4.26 #16 Wed Sep 14 20:231:33 JST 2005

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':

     1. Remote pathname : /pub/OpenBlockS266/RELEASE-20050914/binary

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

  #DESTDIR?=      /home/dest
  #RELEASEDIR?=   /home/release
  #RCS_LOCALID?=  ssdlinux
  SSDCVSTAG?=
  #SSDCVSDATE?=   20020420

  # alternate kernel config which instead of
  # mkdist/kernel/dot.config.* if required
  #KERNEL_CONFIG?=        /any_dir/my_kernel_config

  # OPENBLOCKS    'obs50','obs200','obs266' or 'none'
  OPENBLOCKS?=    obs266

  HAVE_CVS?=      no
  DEVELOPTOOLS?=  yes
  USE_PAM?=       yes
  USE_PCMCIA?=    yes
  USE_EXT3FS?=    yes
  IPV6?=          no

  SSDVERSION=0.3

  # MTA           'sendmail' or 'postfix'
  MTA?=           sendmail

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/

  linux-2.4.26.3-ppc-obs.patch.bz2
  linux-ppc-2.4.26.tar.bz2
  patch-2.4.26-prism54-1.2.bz2
  usagi-linux24-stable_20040104-2.4.26.diff.bz2

7. Decompress the kernel and apply patch files

# 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

Retrieve the file ftp://ftp.plathome.co.jp/pub/OpenBlockS266/RELEASE-20050914/installation/ramdisk.image-product.gz and put it into /usr/src/distrib/powerpc-obs2xx/product/initrd/

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:

# cd /usr/src/distrib/powerpc-obs2xx/product/initrd

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:

# ls /mnt/lib /mnt/usr/lib
/mnt/lib:
ld.so.1        libdl.so.2   libnss_dns.so    libnss_files.so.2  librt.so.1
libc.so.6      libm.so.6    libnss_dns.so.2  libpthread.so.0    libutil.so.1
libcrypt.so.1  libnsl.so.1  libnss_files.so  libresolv.so.2     modules
/mnt/usr/lib:
hotplug          libdb.so.4      libgcc_s.so.1     libshadow.so.0   libz.so.1
libblkid.so.1    libe2p.so.2     libncurses.so.5   libtermcap.so.2
libcom_err.so.2  libext2fs.so.2  libproc.so.3.2.7  libuuid.so.1

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:

# cd /usr/src/distrib/powerpc-obs2xx/product/initrd

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.

# cd /usr/src/distrib/powerpc-obs2xx/product/treeboot

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.