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:
OpenMicroServer
RELEASE-20070221 IPv4 version
ftp://ftp.plathome.co.jp/pub/OMS400/RELEASE-20070221/mipsel-obs1550/installation/zImage.initrd.treeboot-product
uname -rv result
2.6.16 #3 Wed Feb 21 23:39:41 JST 2007
OpenBlockS266
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
-
Example for assigning a fixed IP address to the port ETHER-0
# ifconfig eth0 192.168.252.254 # route add -net default gw 192.168.252.1
Add the following line to the file /etc/resolv.conf
nameserver 192.168.252.10Example for letting the DHCP server assign a dynamic IP to ETHER-0
# dhclient eth0
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':
-
OpenMicroServer
1. Remote pathname : /pub/OMS400/RELEASE-20070221/mipsel-obs1550/binaryOpenBlockS266
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
-
OpenMicroServer
There are no changes necessary. OpenBlockS266
#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
-
/root/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
BASH_ENV=$HOME/.bashrc
USERNAME="root"
export HOSTTYPE MACHTYPE SHELL
export USERNAME BASH_ENV
export PS1='[\u@\h \W]\$ '
/root/.bashrc# .bashrc # User specific aliases and functions
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/
-
OpenMicroServer
linux-2.6.16.38.patch.bz2 linux-mips-2.6.16.tar.bz2 usagi-linux26-stable-20050714-2.6.16.diff.bz2 mtd-snapshot-20060328.tar.bz2OpenBlockS266
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/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
-
OpenMicroServer
Retrieve the file ftp://ftp.plathome.co.jp/pub/OMS400/RELEASE-20070221/mipsel-obs1550/installation/ramdisk.image-product.gz and put it into /usr/src/distrib/mipsel-obs1550/product/initrd/ OpenBlockS266
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:
-
OpenMicroServer
# cd /usr/src/distrib/mipsel-obs1550/product/initrdOpenBlockS266
# 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:
-
OpenMicroServer
# ls /mnt/lib /mnt/usr/lib /mnt/lib/: firmware libdl.so.2 libnss_dns.so.2 libresolv.so.2 ld.so.1 libm.so.6 libnss_files.so librt.so.1 libc.so.6 libnsl.so.1 libnss_files.so.2 libutil.so.1 libcrypt.so.1 libnss_dns.so libpthread.so.0 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.1OpenBlockS266
# 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:
-
OpenMicroServer
# cd /usr/src/distrib/mipsel-obs1550/product/initrdOpenBlockS266
# 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.
-
OpenMicroServer
# cd /usr/src/distrib/mipsel-obs1550/product/treebootOpenBlockS266
# 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.