Debian Squeeze on 'V' and 'X' Series (LS-WXL and others)

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 18:11, 27 April 2011 by Lsuser1985 (Talk | contribs) (Debootstrap)

Jump to: navigation, search


This is based on Debian Lenny on LS-CHLv2 and Open Stock Firmware LS-XHL and was published first here [1] by user benoqkuke.

What will you get?

You will not have to open your box (at least not unless you make a fatal mistake)!
You will have a Debian Squeeze userland and the stock Buffalo kernel of your already installed firmware.
So it is not a full replacement of Buffalos firmware, but mostly. ;-)
To have a "complete" Debian Squeeze installation one would need to replace the kernel also. But user benoqkuke hasn't managed to build his own kernel (newer than 2.6.31) yet. So stay tuned, if you want to have a more recent kernel also.

What you need beforehand

You have to be able to use the root account on the NAS.
You can use [2] CHL-v2/XHL 1.37 Mod 1 firmware to do that.


You need to install debootstrap.
To be able to do this, you need to download the package.
Log on as user root on your box and and execute this:

  dpkg -i debootstrap_1.0.28_all.deb

To install the new rootfs into a directory "debian-squeeze" execute this:

  mkdir debian-squeeze
  debootstrap --verbose --arch armel squeeze debian-squeeze

You may want to select a mirror nearby yourself.

When you see I: Base system installed successfully. the roots FS is almost ready.

Personalize the deboostrap

You need to have some other stuff to be able to boot off the boostrap.
Copy the initrd to the chroot environment:

  cp /boot/initrd.buffalo debian-squeeze/tmp

Chroot on Debian Squeeze:

  LANG=C chroot debian-squeeze /bin/bash

Copy kernel module to the /lib/module folder:

  cd /tmp
  dd if=initrd.buffalo of=initrd.gz ibs=64 skip=1
  gunzip initrd.gz
  mkdir INITRD
  mount -t ext2 -o loop initrd INITRD 
  cp -R INITRD/lib/modules/ /lib/modules/
  umount INITRD
  rmdir INITRD
  rm initrd*

Add missing devices:

  mount -t proc proc /proc
  cd /dev
  apt-get install makedev
  MAKEDEV generic
  umount /proc

Configure locale: Suggestion is to install at least the en_US.UTF-8 and your native language locale (e.g. it_IT.UTF-8, de_DE.UTF-8, etc).

  apt-get install locales
  dpkg-reconfigure locales

If apt-get complains that pts isn't accessible: ignore it or mount devpts (mount -t devpts devpts /dev/pts)
Editing /etc/fstab (with vi or nano):

  # /etc/fstab: static file system information.
  # file system    mount point   type    options                  dump pass
  /dev/sda2        /             xfs     defaults,noatime         0    1
  /dev/sda1        /boot         ext3    ro,nosuid,nodev          0    2
  /dev/sda5        none          swap    sw                       0    0
  /dev/sda6        /mnt/disk1    xfs     defaults,noatime         0    0
  proc             /proc         proc    defaults                 0    0
  devpts           /dev/pts      devpts  gid=4,mode=620 	   0    0
  tmpfs            /tmp          tmpfs   defaults                 0    0
  sysfs            /sys          sysfs   defaults                 0    0

Create disk1 in mnt:

  mkdir /mnt/disk1

Edit /etc/network/interfaces to match your LAN configuration.
If you use DHCP:

  # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
  # /usr/share/doc/ifupdown/examples for more information.
  # We always want the loopback interface.
  auto lo
  iface lo inet loopback
  auto eth1
  iface eth1 inet dhcp

If you have static IP:

  # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
  # /usr/share/doc/ifupdown/examples for more information.
  # We always want the loopback interface.
  auto lo
  iface lo inet loopback
  auto eth1
  iface eth1 inet static

Edit /etc/hostname


Edit /etc/hosts       localhost.localdomain localhost       NAS
  # The following lines are desirable for IPv6 capable hosts
  ::1 ip6-localhost ip6-loopback
  fe00::0 ip6-localnet
  ff00::0 ip6-mcastprefix
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  ff02::3 ip6-allhosts

Install sshd:

  apt-get install openssh-server

Change root password:

  passwd root

Check that root login is enable in /etc/sshd/sshd_config:

  PermitRootLogin yes

Prepare rootfs:

  cd debian-squeeze
  tar --numeric-owner -p -czf ../hddrootfs.buffalo.updated *

Move hddrootfs.buffalo.updated to a folder that you can access from you computer.
Download empty initrd from [3] to your lsupdater folder.
Copy hddrootfs.buffalo.updated to your lsupdater folder.
Remove initrd.img and hddrootfs.img from your lsupdater folder. (If you use 1.37mod1 kernel you just need to replace them when you copy these file)
Add debug options to lsupdate: open LSUpdater.ini and check that it look like that :

  Title = BUFFALO LinkStation Series Updater Ver.1.37 Mod1
  WaitReboot = 1200
  WaitFormat = 600
  WaitFileSend = 600
  ProductID = 0x00000011
  ProductID2 = 0x00000012
  ProductID3 = 0x00000014
  ProductID4 = 0x00003006
  ProductID5 = 0x00003007
  ProductID6 = 0x00000015
  ProductID7 = 0x00000016
  ProductID8 = 0x00003008
  Name = LinkStation
  VersionCheck = 0
  NoFormatting = 1
  debug = 1

Update your NAS, reboot.
Now you are on Debian Squeeze !
If you configured your nas before, some settings should be saved in a tgz file: /boot/conf_save.tgz
Install blstools:

  apt-get install smartmontools
  tar zxf blstools-0.2.0.tar.gz
  cd blstools-0.1.0
  sudo ./

Modify /etc/init.d/lsmonitor (the line where HDDTEMP is defined) to:

  # Retrieve HDD temp
       HDDTEMP=$(smartctl -d marvell /dev/sda --all -T permissive | awk '$1 == "194" {print $10}')