Install Debian GNU/Linux (sarge) on OpenBlockSS (2005/6/29)

[Japanese]

This page describes installation procedure of Debian GNU/Linux (sarge) on Plathome's OpenBlockSS. The following procedure flushes the entire contens in the internal flash memory and the harddisk. Before proceeding, make a backup copy of all important files.

1. Update OpenBlockSS firmware

First, obtain the latest firmware for OpenBlocks from Plathome's support page:

  http://www.plathome.co.jp/support/labo/obssr/

At the time of this writing, the latest firmware is zImage.initrd.treeboot-20041101-1:

  ftp://ftp.plathome.co.jp/pub/OpenBlockSS/zImage.initrd.treeboot-20041101-1

Detailed procedure for upgrading OpenBlockSS's firmware can be found in the user's manual:

  ftp://ftp.plathome.co.jp/pub/OpenBlockSS/pdf/userguide02.pdf

After update, boot from the internal flash memory. The default password for root is root.

2. Install the customized Linux distribution on harddisk

Create a partition for storing the customized Linux distribution on harddisk.

  # fdisk /dev/hda
  (create /dev/hda1 partition)
  # mke2fs /dev/hda1

It's better to use /dev/hda1 for installing the customized Linux distribution since the default kernel assumes /dev/hda1 for its boot device. The harddisk image of the customized Linux distribution can be found at

  ftp://openlab.plathome.co.jp/pub/OpenBlockSS/hdimage-20041101-1.tar.gz

Installation of the customized Linux distribution is simple.

  # ftp your-ftp-server
  (fetch hdimage-YYYMMXX.tar.gz)
  # mount /dev/hda1 /mnt
  # cd /mnt
  # tar xzpvf hdimage-YYYMMXX.tar.gz

Then, reboot from the harddisk

  # flashcfg c harddisk
  # shutdown -r now
3. Create partitions for root filesystem and swap

Crate partitions for the root filesystem and swap.

  # fdisk /dev/hda
  (create /dev/hda2 for root, and /dev/hda3 for swap)
  # mke2fs /dev/hda2
  # mkswap /dev/hda3
  # mount /dev/hda2 /mnt
4. Install base system of Debian GNU/Linux using debootstrap

debootstrap works fine for installing Deban GNU/Linux (sarge). But, it needs some tweaks since sarge is based on GLIBC 2.3 whereas the customized Linux distribution (hdimage-YYYMMXX.tar.gz) is based on GLIBC 2.2. The trick is using the latest version of debootstrap, but replacing /usr/lib/debootstrap/pkgdetails with an older one.

First, obtain the following two Debian archives.

  ftp://ring.asahi-net.or.jp/pub/linux/debian/debian/pool/main/d/debootstrap/debootstrap_0.2.45-0.2_powerpc.deb
  ftp://ring.asahi-net.or.jp/pub/linux/debian/debian/pool/main/d/debootstrap/debootstrap_0.1.17.7woody1_powerpc.deb

  # mkdir /mnt/sarge-inst
  # cd /mnt/sarge-inst
  # ar x debootstrap_0.1.17.7woody1_powerpc.deb
  # mv usr/lib/debootsrap/pkgdetails usr/lib/debootsrap/pkgdetails.old
  # ar x debootstrap_0.2.45-0.2_powerpc.deb
  # mv -f usr/lib/debootsrap/pkgdetails.old usr/lib/debootsrap/pkgdetails
  # ln -s /mnt/sarge-inst/usr/lib/debootsrap /usr/lib

Then, invoke debootstrap:

  # mkdir /mnt/sarge-root
  # cd /mnt
  # ./sarge-inst/usr/sbin/debootstrap sarge sarge-root http://ftp.jp.debian.org/debian/

The required time depends on your Internet access link. If this fails, check your network settings (/etc/resolv.conf, /etc/sysconfig/network, /etc/sysconfig/network-scripts/ifcfg-eth0).

5. Configure base system

Use chroot for configuring your Debian GNU/Linux base system.

  # chroot /mnt/sarge-root
  # umount /proc
  # mount -t proc
  # base-config

Perform minimal configuration for rebooting from Debian GNU/Linux. The following is a patch for my OpenBlockSS.

  --- /etc/network/interfaces.orig      2005-06-30 02:14:40.000000000 +0900
  +++ /etc/network/interfaces   2005-06-30 02:15:46.000000000 +0900
  @@ -1,2 +1,14 @@
   # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
   # /usr/share/doc/ifupdown/examples for more information.
  +
  +# The loopback network interface
  +auto lo
  +iface lo inet loopback
  +
  +auto eth0
  +iface eth0 inet static
  +     address 192.168.10.250
  +     netmask 255.255.255.0
  +     network 192.168.10.0
  +     broadcast 192.168.10.255
  +     gateway 192.168.10.1
  --- /etc/fstab.orig   2005-06-30 02:00:46.000000000 +0900
  +++ /etc/fstab        2005-06-30 02:28:46.000000000 +0900
  @@ -1 +1,3 @@
  -# UNCONFIGURED FSTAB FOR BASE SYSTEM
  +/dev/hda2    /       ext2    defaults,errors=remount-ro 0 1
  +/dev/hda3    none    swap    sw                         0 0
  +/proc                /proc   proc    defaults                   0 0
  --- /etc/hostname.orig        2005-06-30 02:16:07.000000000 +0900
  +++ /etc/hostname     2005-06-30 02:19:59.000000000 +0900
  @@ -0,0 +1 @@
  +obss
  --- /etc/hosts.orig   2005-06-30 02:16:25.000000000 +0900
  +++ /etc/hosts        2005-06-30 02:16:36.000000000 +0900
  @@ -0,0 +1,2 @@
  +127.0.0.1    localhost
  +192.168.10.250       obss
  --- /etc/inittab.orig 2005-06-30 02:24:26.000000000 +0900
  +++ /etc/inittab      2005-06-30 02:26:29.000000000 +0900
  @@ -30,15 +30,15 @@
   z6:6:respawn:/sbin/sulogin
   
   # What to do when CTRL-ALT-DEL is pressed.
  -ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
  +#ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
   
   # Action on special keypress (ALT-UpArrow).
   #kb::kbrequest:/bin/echo "Keyboard Request--edit /etc/inittab to let this work."
   
   # What to do when the power fails/returns.
  -pf::powerwait:/etc/init.d/powerfail start
  -pn::powerfailnow:/etc/init.d/powerfail now
  -po::powerokwait:/etc/init.d/powerfail stop
  +#pf::powerwait:/etc/init.d/powerfail start
  +#pn::powerfailnow:/etc/init.d/powerfail now
  +#po::powerokwait:/etc/init.d/powerfail stop
   
   # /sbin/getty invocations for the runlevels.
   #
  @@ -51,17 +51,17 @@
   # Note that on most Debian systems tty7 is used by the X Window System,
   # so if you want to add more getty's go ahead but skip tty7 if you run X.
   #
  -1:2345:respawn:/sbin/getty 38400 tty1
  -2:23:respawn:/sbin/getty 38400 tty2
  -3:23:respawn:/sbin/getty 38400 tty3
  -4:23:respawn:/sbin/getty 38400 tty4
  -5:23:respawn:/sbin/getty 38400 tty5
  -6:23:respawn:/sbin/getty 38400 tty6
  +#1:2345:respawn:/sbin/getty 38400 tty1
  +#2:23:respawn:/sbin/getty 38400 tty2
  +#3:23:respawn:/sbin/getty 38400 tty3
  +#4:23:respawn:/sbin/getty 38400 tty4
  +#5:23:respawn:/sbin/getty 38400 tty5
  +#6:23:respawn:/sbin/getty 38400 tty6
   
   # Example how to put a getty on a serial line (for a terminal)
   #
  -#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
  -#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
  +T0:2345:respawn:/sbin/getty -L ttyS0 9600 vt100
  +T1:12345:respawn:/sbin/getty -L ttyS1 9600 vt100
   
   # Example how to put a getty on a modem line.
   #
  --- /etc/securetty.orig       2005-06-30 02:29:18.000000000 +0900
  +++ /etc/securetty    2005-06-30 02:29:37.000000000 +0900
  @@ -4,6 +4,7 @@
   
   # for people with serial port consoles
   ttyS0
  +ttyS1
   
   # for devfs
   tts/0

Before rebooting, getty configuration (/etc/iniittab and /etc/securetty) must be changed. Otherwise, you will not be able to login via serial console. I strongly recommend to install telnetd and ssh at this point for ensuring your login via network.

  # apt-get install telnetd ssh
  # exit

Also, make a copy of /usr/sbin/{flashcfg,runled,pshd}:

  # cd /usr/sbin
  # cp -p flashcfg runled pshd /mnt/sarge-root/usr/local/sbin
  # chroot /mnt/sarge-root
  # cat <<EOF >/etc/init.d/local
  #! /bin/sh
  
  PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  NAME=local
  DESC="Local Configuration"
  
  set -e
  
  case "$1" in
    start)
          echo -n "Starting $DESC: "
          runled
          pshd
          echo ""
          ;;
    stop)
          echo -n "Stopping $DESC: "
          killall runled
          killall pshd
          echo ""
          ;;
    restart|force-reload)
          $0 stop
          $0 start
          ;;
    *)
          N=/etc/init.d/$NAME
          echo "Usage: $N {start|stop|restart|force-reload}" >&2
          exit 1
          ;;
  esac
  
  exit 0
  EOF
  # chmod +x /etc/init.d/local
  # update-rc.d -f local defaults 99
  # exit  
6. Reboot from newly-installed Debian GNU/Linux

Almost everyting has done. Chnage your Linux kerne's root device, and store it in the internal flash memory.

  # sed 's/hda1/hda2/' <zImage.initrd.treeboot-20041101-1 >zImage
  (this might fail; use binary editor instead)
  # flushcfg f zImage check
  # shutdown -r now

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 13:

=over without closing =back


Hiroyuki Ohsaki (ohsaki[atmark]lsnl.jp)