Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Thu Oct 02, 2014 3:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Thu Sep 10, 2009 8:33 am 
Offline
Newbie

Joined: Fri Aug 21, 2009 6:23 pm
Posts: 12
after three weeks of testing,
maybe prodigy7 and I can show you how to bring debian lenny (or squeeze) with a fresh kernel, raid for all partitions and an armel debian to your box...

please backup all your data from your linkstation pro duo! we are going to erase the harddisks completly!

also:
notice, that this is in early stage, but with some help here you'll get it.

i'll write this howto more or less from my memory, so please comment if there are any mistakes.
so first, how you get a lenny bootstrap on it? we'll boot with tftp a modified kernel and initrd:

so download kernel and initrd. unpack the kernel and maybe rename it to uImage.buffalo
notice: the initrd is not the best, we should make a better.
also notice: don't use this kernel or initrd at your real debian later. it's just a "buffalo-like" kernel and initrd by prodigy7


next we need the tftp kit. download the windows kit for your box here. unpack it and copy the kernel and initrd in this folder.

so, we got the tftp kit, the modified initrd and the modified kernel. you must add the following ip address to your tftp computer: 192.168.11.1/24 (24 means 255.255.255.0 subnet mask).
start the tftp-server!

so, how we get tftp working at the box?
a) get a serial console (you can get informations here). and press a key at the time uboot wants to tftp. after some time you'll be asked for rescue, console or harddisk boot. choose r for rescue mode.
b) my favourite: open the case and put the harddisks on another computer. erase the partition table in linux with dd if=/dev/zero of=/dev/sd[a/b] count=1 or with windows or whatever. after that, put the harddisks again in the linkstation pro duo and start the box. you will see a led flashing (i guess 5 or 6 times and then the sequence starts again). for my rev3 it's the middle led and if you press the reset button at the back shortly after the last led blink of the sequence, the box should do tftp. try a little bit, you should get it.

search at your local router in the dhcp lease for your box. use this ip to log in with telnet. User is root and password is password. finally you're at this box. now the fun begins:

step1: make all same partitions at both disks with fdisk: sd[a/b]1 should be around 50mb. sd[a/b]2 should be around 5gb. this is important! sd[a/b]1 is our boot partition and sd[a/b]2 holds the / with the operating system. use the other diskspace for swap and data partition. all, except the swap partition should be type fd (linux raid).

my partition table looks like this:
Code:
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           6       48163+  fd  Linux raid autodetect
/dev/sda2               7         615     4891792+  fd  Linux raid autodetect
/dev/sda4             616      121601   971820045    5  Extended
/dev/sda5             616         865     2008093+  82  Linux swap / Solaris
/dev/sda6             866      121601   969811888+  fd  Linux raid autodetect
so, remember do this at /dev/sdb, too!

step2: making raid
for my disks, i must write this:
Code:
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
mdadm --create --verbose /dev/md2 --level=1 --raid-devices=2 /dev/sda6 /dev/sdb6
as you see, i use raid1 (--level=1) for all partitions. you can also use raid0. notice that i'm not raiding a swap partition. it's better you left this off. linux manage two swap partitions by design. so you only need to add both swap partitions (/dev/sd[a/b]5 at my box) to /etc/fstab later.

step3 formatting the raids
you should choose ext2 and ext3 for your nas. if you use other filesystems, it's your job to get it to work (remember the xfs bugs for arm). notice: ignore /dev/md2 from now and format it if your system runs fine later. (i'm going to use ext4 for this).
Code:
mkfs.ext2 /dev/md0
mkfs.ext3 /dev/md1
mkswap /dev/sda5
mkswap /dev/sdb5


mounting the stuff:
Code:
mount -t ext2 /dev/md0 /mnt/array1
mount -t ext3 /dev/md1 /mnt/array2
swapon /dev/sda5
swapon /dev/sdb5


step4: debootstrapping lenny armel
notice: this step is not complete, but there's help in this thread. i'm going to fix it here.
we need to get the debootstrapping file. so how we get this to our box? we'll use proftpd. please modify the /etc/hosts file like this with vi:
Code:
127.0.0.1 localhost _none_
and start proftpd by typing "proftpd".
fire up your ftp client and move this file to /root.
back in the telnet console type the following:
Code:
cd / && tar xvzf  /root/data.tar.gz
debootstrap --verbose --arch armel --foreign lenny /mnt/array2 http://ftp.de.debian.org/debian
chroot /mnt/array2 /debootstrap/debootstrap --second-stage
mount -t proc none /mnt/array2/proc
mount -o bind /dev /mnt/array2/dev
chroot /mnt/array2 /bin/bash
now you should be in your new lenny.

step5: modify lenny
modify /etc/fstab like this
Code:
# /etc/fstab: static file system information.
# <file system> <mount point>   <type>  <options>               <dump>  <pass>
proc            /proc      proc    defaults                            0 0
/dev/sda5       swap       swap    defaults,pri=1                            0 0
/dev/sdb5       swap       swap    defaults,pri=1                    0 0
/dev/md0       /boot      ext2    defaults,noatime,errors=remount-ro  0 1
/dev/md1       /         ext3 defaults,noatime,errors=remount-ro        0 1

set hostname:
Code:
echo "linkstation_whatever" > /etc/hostname

add your hostname to 127.0.0.1 in /etc/hosts, too!

modify /etc/network/interfaces to suit your needs.
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.77.100
netmask 255.255.255.0
gateway 192.168.77.1


update the system with aptitdue update and get a recent version of udev.

step6: installing the kernel
notice: this kernel is precompiled by me. maybe you need other modifications. you can (and should) make our own kernel. here is my config and here is the kernel patch

USING MY PRECOMPILED KERNEL (2.6.30)
Code:
mount /boot
cd /boot
http://www.ahorn.todesmut.org/lsproduo/new/uImage.buffalo


or DO IT YOURSELF!
Code:
aptitude install kernel-package build-essential libncurses5-dev devio uboot-mkimage -y
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.1.tar.bz2
tar xfv linux*
ln -snf linux-2.6.31.1 linux
cd linux
wget http://www.ahorn.todesmut.org/lsproduo/new/lsproduo-2.6.31.1.patch
patch -p1 < lsproduo-2.6.31.1.patch
wget http://www.ahorn.todesmut.org/lsproduo/new/config
mv config .config
make zImage
devio > foo 'wl 0xe3a01c07,4' 'wl 0xe3811027,4'
cat foo arch/arm/boot/zImage > zImage.new
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'linux' -d zImage.new uImage.new
rm foo zImage.new
make modules
make modules_install
cp uImage.new /boot/uImage.buffalo


step7: get the boot env (i guess the initrd is the only needed file, but who cares)
you can do your own initrd. please share!
Code:
cd /boot
wget http://www.ahorn.todesmut.org/lsproduo/new/initrd.buffalo
wget http://www.ahorn.todesmut.org/lsproduo/new/boot_options
touch hddrootmode
wget http://www.ahorn.todesmut.org/lsproduo/new/linkstation_release
echo `date` > /boot/rootfs_ok


so finally, this should it be. please try this and comment if a some steps left or something is wrong.

_________________
LS Pro Duo (2.6.30.6, squeeze, armel)


Last edited by ahorn on Tue Sep 29, 2009 7:15 pm, edited 7 times in total.

Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 2:20 pm 
Offline
Regular Member

Joined: Mon Nov 07, 2005 4:37 pm
Posts: 205
Location: Germany
A short hint: Ahorn use the armel version of debian, not the arm version which is normally used. What is the difference between arm and armel? Read this (taken from http://wiki.debian.org/ArmEabiPort):

In a nutshell

EABI is the new "Embedded" ABI by ARM ltd. EABI is actually a family of ABI's and one of the "subABIs" is GNU EABI, for Linux. The effective changes for users are:

  • Floating point performance, with or without an FPU is very much faster, and mixing soft and hardfloat code is possible
  • Structure packing is not as painful as it used to be
  • More compatibility with various tools (in future - currently linux-elf is well supported)
  • A more efficient syscall convention
  • At present (with gcc-4.1.1) it works with ARMv4t, ARMv5t processors and above, but supporting ARMv4 (e.g., StrongARM) requires toolchain modifications. See "Thumb interworking" below.

Terminology

Strictly speaking, both the old and new ARM ABIs are subsets of the ARM EABI specification, but in everyday usage the term "EABI" is used to mean the new one described here and "OABI" or "old-ABI" to mean the old one. However, there are one or two programs that sometimes describe an old ABI binary as "EABI".

To add to the confusion, powerpc has also had an ABI called "EABI" for some, which has nothing to do with this one.

The difference - facts in benchmarks
nbench
Code:
TEST                : Iterations/sec.  : Iterations/sec.  :
                    : arm              : armel            :
--------------------:------------------:------------------:
NUMERIC SORT        :          98.201  :           98.16  :
STRING SORT         :          10.558  :          10.435  :
BITFIELD            :       3.373e+07  :       3.399e+07  :
FP EMULATION        :          11.957  :          20.891  :
FOURIER             :          9.3656  :          104.37  :
ASSIGNMENT          :          1.3758  :          1.5462  :
IDEA                :          222.72  :          247.62  :
HUFFMAN             :          9.8193  :          158.42  :
NEURAL NET          :       0.0096579  :         0.15147  :
LU DECOMPOSITION    :         0.24438  :         0.24438  :
==========================ORIGINAL BYTEMARK RESULTS==========================
INTEGER INDEX       : 2.944            : 4.893            :
FLOATING-POINT INDEX: 0.013            : 0.156            :
==============================LINUX DATA BELOW===============================
OS                  : Linux 2.6.30.5-p7r1
C compiler          : gcc version 4.3.2 (Debian 4.3.2-1.1)
libc                : libc-2.7.so
MEMORY INDEX        : 1.062            : 1.103            :
INTEGER INDEX       : 0.557            : 1.318            :
FLOATING-POINT INDEX: 0.007            : 0.086            :

netperf
Code:
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 87380  16384  16384    10.00     139.40
 87380  16384  16384    10.00     197.94

You see - it's a good decision, take armel! ;-)

_________________
LS2 (U-Boot + Freelink) | Kurobox (U-Boot + Deboostraped) | LS Pro Duo (Freelink)


Top
 Profile  
 
PostPosted: Sat Sep 12, 2009 5:50 pm 
Offline
Regular Member

Joined: Mon Nov 07, 2005 4:37 pm
Posts: 205
Location: Germany
Under http://download.prodigy7.de/files/packa ... ram.tar.gz an nvram version can be found which is be working unter debian (armel). So it's possible, getting and setting u-boot variables.

_________________
LS2 (U-Boot + Freelink) | Kurobox (U-Boot + Deboostraped) | LS Pro Duo (Freelink)


Top
 Profile  
 
PostPosted: Fri Sep 25, 2009 11:15 pm 
Offline
Newbie

Joined: Thu Jun 11, 2009 9:41 pm
Posts: 8
Very promising. Thank you for the great work.

I got to the telnet part quite easily. But what credentials am I supposed to use to log in? Do I need to use ACPcommander to reset the password?

;)


Top
 Profile  
 
PostPosted: Sat Sep 26, 2009 5:09 pm 
Offline
Site Admin
User avatar

Joined: Mon Aug 28, 2006 1:15 am
Posts: 2606
well done, nice work...

Now all I have to do is find a bricked Duo for cheap ...

_________________
LS1 (foonas, nfs, Tranmission & p910nd print server, Firefly for my Roku)
LS-HG500 (Lenny)
Various LS-Pros v1,v2 (unbricked w/ serial & jtag)
KuroPro, LS2 & KuroHG (foonas)
Working on davysweather.dyndns.org lately...

=> wooohooo!
wooohooo!
Unknown command 'wooohooo!' - try 'help'


Top
 Profile  
 
PostPosted: Sun Sep 27, 2009 6:41 pm 
Offline
Total Newbie

Joined: Sun Mar 22, 2009 8:49 pm
Posts: 3
frodeseverin wrote:
Very promising. Thank you for the great work.

I got to the telnet part quite easily. But what credentials am I supposed to use to log in? Do I need to use ACPcommander to reset the password?

;)

It's easy enough to guess: U root P password.

As far as the instructions go, the debootstrap tar is missing pkgdetails.c in /usr/lib/debootstrap/ which forces an error when using any debootstrap commands.
Code:
# debootstrap
E: No pkgdetails available; either install perl, or build pkgdetails.c from source


I cheated and instead of installing perl or compiling anything found a binary in this post on another forum: http://talk.maemo.org/showthread.php?t=16121

Also DNS and Hostname resolution is confusingly and completely borked.


Top
 Profile  
 
PostPosted: Mon Sep 28, 2009 6:42 am 
Offline
Newbie

Joined: Mon Sep 28, 2009 6:35 am
Posts: 8
I'm getting the following. DNS is borked, as mentioned above, so I used the IP address of one of the US mirrors and issued the following. Also, I followed the posted link for pkgdetails and put it in the proper place.

Is there a magic formula to make debootstrap work?
Code:
# debootstrap --verbose --arch armel lenny /mnt/array2 "http://204.152.191.39/debian"
I: Retrieving Release
E: Failed getting release file http://204.152.191.39/debian/dists/lenny/Release
#


I should note this is on a Buffalo Linkstation Quad. The kernel and initrd provided boot fine (via tftp), but I'm stuck at debootstrap.

Any hints would be greatly appreciated!


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 5:47 am 
Offline
Newbie

Joined: Mon Sep 28, 2009 6:35 am
Posts: 8
fdawg4l wrote:
Code:
# debootstrap --verbose --arch armel lenny /mnt/array2 "http://204.152.191.39/debian"
I: Retrieving Release
E: Failed getting release file http://204.152.191.39/debian/dists/lenny/Release
#



After a few more hours of digging, I found that debootstrap poops out a log and dumps it in the debootstrap directory in /mnt/array2. The log said wget wasn't installed.

I had to download wget, openssl, and zlib1g (libz) from the debian repos (remember to get the armel arch), unpack them, ftp them to /mnt/array2, link the appropriate files to their real destinations in /, then wget would work to get past that error. The reason for the symlinks is to avoid filling the root image (which is only a ~15MB mount).

It's still chugging, but I'll write back when things are finished.


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 6:00 am 
Offline
Newbie

Joined: Mon Sep 28, 2009 6:35 am
Posts: 8
Seems like I hit pay-dirt. Deborphan is running as it should, installing packages to /mnt/array2.

The packages I downloaded from the debian repositories to get wget to work are:
libssl0.9.8_0.9.8k-5_armel.deb
wget_1.11.4-2_armel.deb
zlib1g_1.2.3.3.dfsg-12_armel.deb

I unpacked them on my laptop (ar -x file.deb; tar -xvzf data.tar.gz), uploaded the relevant files to /mnt/array2 via ftp, then created sym links (ln -s) from the files in /mnt/array/ to their destinations in /.

wget run by itself should work after that. DNS is still borked, but at least deboostrap can work if provided with an IP.


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 6:01 am 
Offline
Newbie

Joined: Mon Sep 28, 2009 6:35 am
Posts: 8
Seems like I hit pay-dirt. Deborphan is running as it should, installing packages to /mnt/array2.

The packages I downloaded from the debian repositories to get wget to work are:
libssl0.9.8_0.9.8k-5_armel.deb
wget_1.11.4-2_armel.deb
zlib1g_1.2.3.3.dfsg-12_armel.deb

I unpacked them on my laptop (ar -x file.deb; tar -xvzf data.tar.gz), uploaded the relevant files to /mnt/array2 via ftp, then created sym links (ln -s) from the files in /mnt/array/ to their destinations in /.

wget run by itself should work after that. DNS is still borked, but at least deboostrap can work if provided with an IP.


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 6:13 am 
Offline
Newbie

Joined: Mon Sep 28, 2009 6:35 am
Posts: 8
fdawg4l wrote:

The packages I downloaded from the debian repositories to get wget to work are:
libssl0.9.8_0.9.8k-5_armel.deb
wget_1.11.4-2_armel.deb
zlib1g_1.2.3.3.dfsg-12_armel.deb


Add binutils to that list.
binutils_2.18.1~cvs20080103-7_armel.deb

ar was missing and is apparently required by deborphan (and likely dpkg).


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 6:57 am 
Offline
Newbie

Joined: Mon Sep 28, 2009 6:35 am
Posts: 8
Reboot...reboot...reboot...

I'm stuck in a boot-up reboot loop. This has something to do with a microcontroller. Anyone have any ideas?


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 3:40 pm 
Offline
Newbie

Joined: Fri Aug 21, 2009 6:23 pm
Posts: 12
fdawg4l wrote:
Reboot...reboot...reboot...

I'm stuck in a boot-up reboot loop. This has something to do with a microcontroller. Anyone have any ideas?

can you post some more informations about the reloop? is it kernel related?

_________________
LS Pro Duo (2.6.30.6, squeeze, armel)


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 4:08 pm 
Offline
Newbie

Joined: Mon Sep 28, 2009 6:35 am
Posts: 8
Unfortunately, I cannot. I remember reading somewhere on the wiki that these devices have microcontroller based watchdogs which reboot the device if a daemon/kernel module is not running. I assumed it had something to do with that.

I can tell you that the box powers up, disk is accessed, I can see blinking on the disc activity light, leading me to believe the kernel and initrd are being loaded and booted, then some 10 to 15 seconds later the machine turns off briefly then turns back on. I have a ping running the entire time and no replies are sent from the box.

This is a brand new linkstation quad so I have not violated its (warranty and) internals looking for a serial header. I'll see what I can do later today, but I'm thinking I may just return this box if installing linux is so hard and buy a NetGear already running debian (SPARC).

Will keep you posted. While I have you on the line, did you build the ramdisk you're distributing? If so, can you build busybox with all (if not most) options turned on? Particularly, sshd, wget, ar, ssh, scp, nc, dpkg, etc would make moving files and unpacking debs much easier.

If you need help with the above, please let me know and we can work something out.

Thanks for your help!


Top
 Profile  
 
PostPosted: Tue Sep 29, 2009 6:38 pm 
Offline
Newbie

Joined: Fri Aug 21, 2009 6:23 pm
Posts: 12
the linkstation pro duo has no microcontroller for watchdog. all is done in software. so there's no watchdog.

you say that you're using a quadstation. i don't know the difference in comparision to the pro duo. i guess you got a kernel crash and after 5 seconds the box is booting again because panic=5 at kernel args.

and yes, i did the initrd for myself, it's a current busybox, but not with ssh or telnet at autorun. so, if you can do it, modifiy the linuxrc script in the initrd that eth0 is 192.168.11.150/24 and telnet is autostarted.

_________________
LS Pro Duo (2.6.30.6, squeeze, armel)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Protected by Anti-Spam ACP
Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group