Terastation Boot

Aus MvOWiki
Wechseln zu: Navigation, Suche

Kernel 2.6 on Terastation HTGL[Bearbeiten]

Linux Kernels version 2.6.18 and newer ones are available for Terastation. There is an Open Source Project on Sourceforge where you can get kernel sources for a Terastation kernel version 2.6.22 and 2.6.23. At time of this writing kernels from these sources are the best available 2.6 kernels for Terastation.

All known Linux 2.6 kernels for Terastation HTGL are unstable. It is generally not recommended to use such a kernel in a production environment.

Considerations for Linux 2.6 kernel[Bearbeiten]

The original software installed on the Terastation from Buffalo is a Linux 2.4.20 kernel based on Montavista Linux 3.1. This software has some limitations. Maybe you came to this site because you see such limitations and are looking for a better software.

It is possible to install for instance a Debian Etch stable distribution on the Terastation. Unfortunately Debian Etch will not run stable on the Terastation. Just the Debian Packaging System (dpkg) which is the greatest improvement you could give to your Terastation is known to be able to crash all available 2.6 kernels on Terastation HTGL.

The Terastation is really slow. Its 266 !MHz !PowerPC processor does not have enough power for many tasks of a modern server system. So **do not expect to get a high performance server system when installing a 2.6 kernel**. The performance problem will not be fixed by installing a 2.6 kernel.

What you'll get[Bearbeiten]

Installing the kernel version 2.6 gives you some improvements and some limitations.

  • After installing a Debian Etch apt-get install <package> gives you access to nearly the whole world of open source software.
  • For software developing tasks simply you'll need such a software environment.
  • You can boot off other devices: USB stick, flash drives or even from NFS. So the hard disks can sleep while not being used.

What you'll loose[Bearbeiten]

  • Open Source: On Buffalo Open Source Site you get the source code for all open source software on your Teraststion. On the other hand just the so called Open Source Communities especially nas-central.org do not care about the GPL.
  • Stability: The Linux 2.4.20 kernel provided by Buffalo is really stable compared to the 2.6 kernels.
  • AVR support: There is a additional Atmel controller chip on TeraStation's main board. This chip contains an own firmware and is important for some important functionality like watchdog and fan controlling. The interface to this hardware is not covered by Linux 2.6 kernels. So all monitoring funtions have to be disabled after booting a 2.6 kernel.

Scripts for booting kernel 2.6[Bearbeiten]

The scripts of the initial ramdisk are changed as followed:

  • Mount the compact flash disk ``/dev/hdb1`` to ``/mnt/cf``.
  • Check if /mnt/cf/boot/BOOT26 exists? If not so then exit and continue to boot 2.4 kernel.
  • Delete this file to prevent any loops.
  • Execute /mnt/cf/boot/autoboot if it exists.

Script /usr/sbin/boot_kernel26 on initial ramdisk[Bearbeiten]

 #!/bin/sh
 
 ROOT26="/mnt/cf"
 LOGFILE="$ROOT26/boot/boot26.log"
 BOOTFLAG="$ROOT26/boot/BOOT26"
 
 # Mount the compact flash drive in local file system
 mount -o noatime,rw /dev/hdb1 $ROOT26
 
 # Boot message
 echo "\nBooting at `date`" >> $LOGFILE
 
 # look for boot flag
 [ -f $BOOTFLAG ] || exit 0
 echo "Flag to boot kernel 2.6 detected. Removing it." >> $LOGFILE
 rm -f $BOOTFLAG
 
 [ -x $ROOT26/boot/autoboot ] || exit 0
 echo "Booting now into Linux kernel 2.6..." >> $LOGFILE
 $ROOT26/boot/autoboot
 
 umount $ROOT26

Download ``_

Script ``/boot/autoboot`` on boot disk[Bearbeiten]


 #!/bin/sh
 #
 # /boot/autoboot
 # $Id: autoboot,v 1.1.1.1 2007-08-24 06:10:47 marko Exp $
 #
 # This script is run from the boot_kernel26 located on the kernels
 # initial ramdisk (initrd)
 #
 # Here are some hints for the environment when starting this script
 # - Kernel 2.4.20 (original version from Buffalo) is running
 # - root file system is the initial ramdisk (initrd)
 # - the future root file system with Debian Etch for kernel 2.6 is
 #   mounted to /mnt/cf
 
 BOOTDIR="/mnt/cf/boot"
 ROOTDEV="/dev/hdb1"
 KERNELBIN=vmlinux
 
 # check if there should be used another root file system
 if [ -f $BOOTDIR/ROOTDEV ]
 then
         ROOTDEV=`cat $BOOTDIR/ROOTDEV`
 
         # only one try if something goes wrong
         rm $BOOTDIR/ROOTDEV
 fi
 
 # should try a new kernel?
 if [ -f $BOOTDIR/NEXTBOOT ]
 then
         KERNELBIN=`cat $BOOTDIR/NEXTBOOT`
         rm $BOOTDIR/NEXTBOOT
 fi
 
 BOOTLOADERARGS=" cmdline=\"root=$ROOTDEV\" "
 echo "autoboot: booting $KERNELBIN from $ROOTDEV" >> $BOOTDIR/boot26.log
 
 sync
 $BOOTDIR/insmod -f $BOOTDIR/loader.o kernel=$BOOTDIR/$KERNELBIN $BOOTLOADERARGS 2>> $BOOTDIR/boot26.log

Download `autoboot.gz`_

The `loader.o`_ could be downloaded from here: http://www.von-oppen.com/download/loader.o. The kernel_ could be downloaded from here: http://www.von-oppen.com/download/vmlinux.

 .. _`loader.o`: http://www.von-oppen.com/download/loader.o
 .. _kernel: http://www.von-oppen.com/download/vmlinux
 .. _`boot_kernel26.gz`: http://www.von-oppen.com/download/ts/boot_kernel26.gz
 .. _`autoboot.gz`: http://www.von-oppen.com/download/ts/autoboot.gz

Contents of /boot[Bearbeiten]

 marko@ts1:/boot$ ll
 total 12220
 drwxr-xr-x  2 root root    4096 Aug 24 07:57 .
 drwxr-xr-x 22 root root    4096 Aug 22 19:48 ..
 -rw-r--r--  1 root root       0 Aug 22 23:51 BOOT26
 -rw-r--r--  1 root root   18011 Jun  1  2006 COPYING
 -rw-r--r--  1 root root  757006 Jun 14 08:45 System.map.2.6.21.5
 -rwxr-xr-x  1 root root     610 Aug 14 08:05 autoboot
 -rw-r--r--  1 root root   19080 Aug 22 23:50 boot26.log
 lrwxrwxrwx  1 root root      15 Aug 24 07:56 config -> config.2.6.22.4
 -rw-r--r--  1 root root   52706 Aug 14 00:10 config.2.6.22.2
 -rw-r--r--  1 root root   52706 Aug 16 17:52 config.2.6.22.3
 -rw-r--r--  1 root root   52706 Aug 21 22:40 config.2.6.22.4
 -rwxr-xr-x  1 root root  142920 Jun 16 00:28 insmod
 -rw-r--r--  1 root root    4862 Jun 15 14:57 loader.o
 lrwxrwxrwx  1 root root      16 Aug 21 22:39 vmlinux -> vmlinux.2.6.22.4
 -rwxr-xr-x  1 root root 4108422 Aug 14 07:53 vmlinux.2.6.21.5
 -rwxr-xr-x  1 root root 3768453 Aug 14 07:46 vmlinux.2.6.22.2
 -rwxr-xr-x  1 root root 3768453 Aug 20 21:32 vmlinux.2.6.22.3
 -rwxr-xr-x  1 root root 3768454 Aug 21 22:37 vmlinux.2.6.22.4