Contact me I can publish up to date packages of : kernel , I can share a image of ready to boot debian system (2GB image) without touching bootloader settings, this mean you can use both FirmWares …
built a new PachEd kernel and managed to boot it through tftp and it just mount my partition and start the system SsH etc
Get everything at : http://rzr.online.fr/q/orion5x (then ContacT me by email )
Next job will be to create RaiD and tune BootLoader if needed (seems not)
PatcH :
<RzR> which version should i target 1st ? <lyakh> RzR: if it's not a bug-fix, then 3.8 <lyakh> hi, timtimred :) <lyakh> …actually with 3.7-rc6 already out, 3.8 might be difficult, ARM maintainers prefer to only pick up patches until -rc5 / -rc6, so, might only go into 3.9…
This process was done using :
sudo apt-get install wget tftpd ssh sudo less busybox unp devio uboot-mkimage aptitude hddtemp
You need some blank disks : Warning do that on target disks not host :
# dd if=/dev/zero count=1 | tee /dev/sdb > /dev/sda
Some credits :
wget -p -r -l 1 http://d-i.debian.org/daily-images/armel/daily/orion5x/network-console/buffalo/lspro/
wget -c http://rzr.chez.com/www.rzr.online.fr/uri/http/d-i.debian.org/daily-images/armel/daily/orion5x/network-console/buffalo/lspro/uImage.buffalo wget -c http://rzr.chez.com/www.rzr.online.fr/uri/http/d-i.debian.org/daily-images/armel/daily/orion5x/network-console/buffalo/lspro/initrd.buffalo
Then copy files to :
ls -l /srv/tftp/*.buffalo -rw-r--r-- 1 root root 4754962 Nov 26 05:20 initrd.buffalo -rw-r--r-- 1 root root 1471112 Nov 26 05:20 uImage.buffalo
Configure your host
sudo cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback iface eth0 inet static address 192.168.11.1 netmask 255.255.255.0 network 192.168.11.0 # broadcast 134.158.129.255 # gateway 134.158.128.1
http://lists.debian.org/debian-arm/2009/01/msg00053.html :
With recent firmwares on the v2 hardware, LS will only boot from TFTP if harddisk boot fails, or if instructed to do so via serial cable.
On Target :
host:
sudo less -F /var/log/syslog
ifdown eth0 ; ifup eth0 busybox tftp -g -l /dev/stdout -r uImage.buffalo 192.168.11.1 | wc #| 5702 32768 1471112
ping 192.168.11.150 # will give some info icmp_seq=46
nas :
sudo less /var/log/syslog Nov 26 14:56:51 lap in.tftpd[18710]: connect from 192.168.11.150 (192.168.11.150) Nov 26 14:56:51 lap tftpd[18711]: tftpd: trying to get file: uImage.buffalo Nov 26 14:56:51 lap tftpd[18711]: tftpd: serving file from /srv/tftp Nov 26 14:56:53 lap in.tftpd[18714]: connect from 192.168.11.150 (192.168.11.150) Nov 26 14:56:53 lap tftpd[18715]: tftpd: trying to get file: initrd.buffalo Nov 26 14:56:53 lap tftpd[18715]: tftpd: serving file from /srv/tftp Nov 26 14:57:04 lap kernel: [ 6627.510231] atl1c 0000:01:00.0: atl1c: eth0 NIC Link is Down Nov 26 14:57:04 lap NetworkManager[1848]: <info> (eth0): carrier now OFF (device state 30)
Or :
Aug 08 12:24:16 lap.lan.rzr.cloudns.org atftpd[22487]: Serving uImage.buffalo to 192.168.11.150:1556 Aug 08 12:24:20 lap.lan.rzr.cloudns.org atftpd[22487]: Serving initrd.buffalo to 192.168.11.150:2407
Back on host :
# ifdown eth0 ; ifup eth0 ping -c 130 192.168.11.150 && ssh installer@192.168.11.150 # install
Open shell on target :
dmesg [ 0.000000] Linux version 3.1.0-1-orion5x (Debian 3.1.1-1) (ben@decadent.org.uk) (gcc version 4.6.2 (Debian 4.6.2-4) ) #1 Tue Nov 15 06:07:47 UTC 2011 [ 0.000000] CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a0053177 [ 0.000000] Machine: Buffalo Linkstation Pro/Live (...) [ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda2 rw initrd=0x00800040,15M panic=5 BOOTVER=1.13 tftpboot=yes (...) [ 0.000000] Memory: 128MB = 128MB total (...)
Dont select “Configure the network” but open a shell on target
On Host:
sudo grep 1 /proc/sys/net/ipv4/ip_forward || { echo 1 | tee /proc/sys/net/ipv4/ip_forward ; } sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE # @S
On Target :
rm ~/.ssh/known_hosts ; ssh installer@192.168.11.150 # install # open a shell wget -O- http://www.opendns.org || { wget -O- http://208.69.38.150/ && echo "nameserver 208.67.222.222" >> /etc/resolv.conf ; } # wget: bad address 'www.opendns.org' wget -O- http://208.69.38.150/ && wget -O- http://www.opendns.org && exit
Resume install
# Download Installer Componants : fdisk-udeb,mdcfg, nbd-modules-3.1.0-1-orion5x-di, openssh-client-udeb: parted-udeb:rescue-mode: lowmem:
UsB install seems not possible So I switch it off and plugin one spare blanked sata disk 40GB ( SP0411C SamSung ) : automatic repart create 3+1 partitions and used msdos/mbr part format (logical/extended)
parted /dev/sda -s unit b print Model: ATA SAMSUNG SP0411C (scsi) Disk /dev/sda: 40020664320B Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 1048576B 255852543B 254803968B primary ext2 boot 2 255852544B 39644561407B 39388708864B primary ext4 3 39645608960B 40019951615B 374342656B extended 5 39645609984B 40019951615B 374341632B logical linux-swap(v1)
ToDo: next time I will try with my 2 SatA Drives
#todo: raid format etc #todo: scp to hosts , check for passwd sshd etc
│ SCSI1 (0,0,0) (sda) - 1.0 TB ATA SAMSUNG HD103UJ │ │ > #1 primary 2.0 GB f ext3 /boot │ │ > #2 primary 64.0 GB f ext4 / │ │ > #5 logical 500.0 GB f ext4 │ │ > #6 logical 400.0 GB f ext4 │ │ > logical 33.2 GB FREE SPACE │ │ > #4 primary 999.3 MB f swap swap │ │ /sbin/parted /dev/sda -s unit chs print Model: ATA SAMSUNG HD103UJ (scsi) Disk /dev/sda: 121601,80,62 Sector size (logical/physical): 512B/512B BIOS cylinder,head,sector geometry: 121601,255,63. Each cylinder is 8225kB. Partition Table: msdos Number Start End Type File system Flags 1 0,32,32 243,27,39 primary ext3 boot 2 243,27,40 8023,249,33 primary ext4 3 8024,27,1 117442,193,62 extended 5 8024,27,3 68812,41,28 logical ext4 raid 6 68812,73,61 117442,193,62 logical ext4 raid 4 121479,187,52 121601,57,55 primary linux-swap(v1)
In other words i set :
“Partition disks” is over wait a bit
cat /proc/mdstat Personalities : [raid0] [raid1] md1 : active raid1 sda6[0] sdb6[1] 390623096 blocks super 1.2 [2/2] [UU] [=====>...............] resync = 28.7% (112349888/390623096) finish=76.9min speed=60241K/sec md0 : active raid0 sda5[0] sdb5[1] 976558080 blocks super 1.2 512k chunks unused devices: <none> mdadm --examine --brief --scan --verbose ARRAY /dev/md/0 level=raid0 metadata=1.2 num-devices=2 UUID=01c246d2:3e4b5720:42b9d45f:25233530 name=debian:0 devices=/dev/sdb5,/dev/sda5 ARRAY /dev/md/1 level=raid1 metadata=1.2 num-devices=2 UUID=007ad2d9:39521238:e845aee3:b672871a name=debian:1 devices=/dev/sdb6,/dev/sda6 cd /target/boot mkdir -p local cd local wget -p http://rzr.chez.com/www.rzr.online.fr/debian/initrd.img-3.1.1lsproduo-00009-g4d27e1c.initrd.buffalo wget -p -r -l 1 http://rzr.chez.com/www.rzr.online.fr/debian wget http://rzr.chez.com/www.rzr.online.fr/debian/linux-image-3.1.1lsproduo-00009-g4d27e1c_3.1.1lsproduo-00009-g4d27e1c-1_armel.deb
“Configure MD devices” seems to be stuck on :
12680 root 1724 S udpkg --configure --force-configure mdcfg 12681 root 1936 R {mdcfg.postinst} /bin/sh /var/lib/dpkg/info/mdcfg.postinst configure # #sh -x /var/lib/dpkg/info/mdcfg.postinst configure # kill -s INT 11070
So I log in again and Skipped previous MD steps that seem to be stuck …
It will take half an hour and ends by asking you if you want a kernel 2.6 or 3 …
I did opt for linux-image-orion5x (vmlinuz-3.1.0-1-orion5x) … then initramfs targeted
Follow other steps, package manager, “Select and install software”, tasksel ssh-server etc (default will install exim and nfs ) , it took like 1 whole hour
I skipped “Make the system bootable” to “Continue without boot loader”
You will need to boot manually with the /vmlinuz kernel on partition /dev/sda1 and root=/dev/sda2 passed as a kernel argument. │
Backup the whole fs if you want , you'll need to MounT it 1st
tar cvf - /target/boot | ssh root@192.168.11.1 " cat - >/tmp/target-boot.tar" ~ # df -h Filesystem Size Used Available Use% Mounted on none 12.3M 32.0K 12.2M 0% /run tmpfs 61.3M 0 61.3M 0% /dev /dev/sda2 36.1G 776.3M 33.5G 2% /target /dev/sda1 227.7M 5.1M 210.5M 2% /target/boot /dev/sda2 36.1G 776.3M 33.5G 2% /dev/.static/dev tmpfs 61.3M 0 61.3M 0% /target/dev
tail var/log/installer/syslog Nov 26 20:28:54 finish-install: info: Running /usr/lib/finish-install.d/20final-message Nov 26 20:29:40 finish-install: info: Running /usr/lib/finish-install.d/21micro-evtd Nov 26 20:29:40 finish-install: /usr/sbin/micro-evtd.command: Nov 26 20:29:40 finish-install: line 10: Nov 26 20:29:40 finish-install: syntax error: bad function name Nov 26 20:29:40 finish-install: Nov 26 20:29:40 finish-install: info: Running /usr/lib/finish-install.d/21qcontrol Nov 26 20:29:40 finish-install: info: Running /usr/lib/finish-install.d/30hw-detect Nov 26 20:29:40 finish-install: info: Running /usr/lib/finish-install.d/50config-target-network Nov 26 20:29:40 finish-install: info: Running /usr/lib/finish-install.d/55netcfg-network-manager Nov 26 20:29:41 finish-install: info: Running /usr/lib/finish-install.d/60cleanup Nov 26 20:29:41 finish-install: info: Running /usr/lib/finish-install.d/65partman-md Nov 26 20:29:42 finish-install: info: Running /usr/lib/finish-install.d/90base-installer Nov 26 20:29:42 finish-install: info: Running /usr/lib/finish-install.d/90console Nov 26 20:29:42 finish-install: Configuring init for serial console Nov 26 20:29:42 finish-install: info: Running /usr/lib/finish-install.d/94save-logs cat var/log/dmesg (Nothing has been logged yet.) cat var/log/boot (Nothing has been logged yet.) ls /target/boot
You can try to reboot now but it will fail to boot kernel, so you'll have to enter the installer again and install a custom kernel …
So let's mount and ChRoot before ReBooting
export SHELL=/bin/bash apt-get install screen avr-evtd hddtemp apt-get install git # ca-certificates{a} git git-man{a} less{a} libcurl3-gnutls{a} liberror-perl{a} libldap-2.4-2{a} librtmp0{a} libsasl2-2{a} libsasl2-modules{a} openssl{a} patch{a} rsync{a}
cat etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet static address 192.168.11.150 netmask 255.255.255.0 network 192.168.11.0 broadcast 192.168.11.255 gateway 192.168.11.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 192.168.11.1 dns-search example.org
Now install my custom kernel from : http://rzr.chez.com/www.rzr.online.fr/debian/ :
linux-headers-3.1.1lsproduo-00009-g4d27e1c_3.1.1lsproduo-00009-g4d27e1c-1_armel.deb linux-image-3.1.1lsproduo-00009-g4d27e1c_3.1.1lsproduo-00009-g4d27e1c-1_armel.deb linux-libc-dev_3.1.1lsproduo-00009-g4d27e1c-1_armel.deb
cat /proc/version ; dmesg Linux version 3.1.1lsproduo-00009-g4d27e1c (rzr@lap) (gcc version 4.4.5 (Debian 4.4.5-8) ) #1 PREEMPT Sat Dec 3 23:43:17 CET 2011 CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a0053177 CPU: VIVT data cache, VIVT instruction cache Machine: Buffalo Linkstation Pro Duo - Revision 2
See UBoot page
Now it will reboot and send a dhcp request
then click “Finishing the installation” , UTC it will reboot on a dhcp query
If it's ok you can create a backup image to be restored later using :
time dd if=/dev/sdc | tee /dev/sdb >/dev/sda
I checked it worked, only a few warnings …
EXT3-fs (sda2): error: couldn't mount because of unsupported optional features (240) EXT2-fs (sda2): error: couldn't mount because of unsupported optional features (240) EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null) XFS (sda5): bad magic number XFS (sda5): SB validate failed
lsmod Module Size Used by tun 14479 2 binfmt_misc 7265 1 fuse 68865 1 evbug 1995 0
root@debian:~# dmesg | grep Machine Machine: Buffalo Linkstation Pro Duo - Revision 2 cat /proc/linkstation/gpio/fan state: full echo slow > /proc/linkstation/gpio/fan ; sleep 2 echo fast > /proc/linkstation/gpio/fan ; sleep 2 echo full > /proc/linkstation/gpio/fan ; sleep 2 echo slow > /proc/linkstation/gpio/fan ; sleep 2 aptitude install micro-evtd aptitude install nfs-kernel-server samba cat /etc/exports #| / 192.168.11.1(rw,sync,no_root_squash) # UnSecure /etc/init.d/nfs-kernel-server restart
aptitude install smartmontools hddtemp
crontab -e */3 * * * * /root/local/bin/fanctrl.sh auto > /dev/null 2>&1 8acf08d01c02416fc841e820334d8905 /root/local/bin/fanctrl.sh head /root/local/bin/fanctrl.sh #!/bin/sh # if [ $# -ne 1 ]; then cat 2>&1 << EOF ############################################## fanctrl ------- purpose: adjusts Kurobox fan speed based on supplied argument author: Mathias Weiersmueller ( matti_at_weiersmuellerdotcom ) echo -n "\\\\" > /dev/ttyS1 bash: echo: write error: Input/output error
modprobe -v gpio-fan insmod /lib/modules/3.1.0-1-orion5x/kernel/drivers/hwmon/gpio-fan.ko
http://lxr.free-electrons.com/source/drivers/hwmon/gpio-fan.c
https://github.com/rzr/linux/commit/0bdbeb27a04b06786f236b8d0e3e8592fcd3684d
EvtD :
apt-get install micro-evtd Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: libaio1 Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: micro-evtd 0 upgraded, 1 newly installed, 0 to remove and 90 not upgraded. Need to get 31.6 kB of archives. After this operation, 101 kB of additional disk space will be used. Get:1 http://ftp.fr.debian.org/debian/ wheezy/main micro-evtd armel 3.4-2 [31.6 kB] Fetched 31.6 kB in 0s (99.0 kB/s) Selecting previously unselected package micro-evtd. (Reading database ... 98907 files and directories currently installed.) Unpacking micro-evtd (from .../micro-evtd_3.4-2_armel.deb) ... Processing triggers for man-db ... Setting up micro-evtd (3.4-2) ... micro-evtd error: device is not supported ... failed! invoke-rc.d: initscript micro-evtd, action "start" failed. dpkg: error processing micro-evtd (--configure): subprocess installed post-installation script returned error exit status 1 configured to not write apport reports Errors were encountered while processing: micro-evtd E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo aptitude install \ installation-report reportbug sudo samba aptitude \ mdadm testdisk xfsprogs ajaxterm aria2c tmux \ bitlbee bip smartmontools hddtemp micro-evtd nfs-kernel-server samba
cat /etc/network/interfaces auto lo iface lo inet loopback auto eth0 allow-hotplug eth0 iface eth0 inet dhcp up ip addr add 192.168.11.15/24 dev eth0 label eth0:1
Performances :
On InstalL :
I wish I can install to UsB to test , but it fails to see it
~ # dmesg | grep sd [ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda2 rw initrd=0x00800040,15M panic=5 BOOTVER=1.13 tftpboot=yes dmesg | grep usb [ 12.659698] usbcore: registered new interface driver usbfs [ 12.709550] usbcore: registered new interface driver hub [ 12.794599] usbcore: registered new device driver usb [ 13.000590] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [ 13.007454] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 13.014699] usb usb1: Product: Marvell Orion EHCI [ 13.019399] usb usb1: Manufacturer: Linux 3.1.0-1-orion5x ehci_hcd [ 13.025608] usb usb1: SerialNumber: orion-ehci.0 [ 13.270505] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 [ 13.277368] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 13.284623] usb usb2: Product: Marvell Orion EHCI [ 13.289331] usb usb2: Manufacturer: Linux 3.1.0-1-orion5x ehci_hcd [ 13.295541] usb usb2: SerialNumber: orion-ehci.1 [ 962.752591] usbcore: registered new interface driver usb-storage
# dmseg | tail [ 962.749543] Initializing USB Mass Storage driver... [ 962.752591] usbcore: registered new interface driver usb-storage [ 962.752627] USB Mass Storage support registered. [ 1009.920078] Btrfs loaded [ 1010.283622] JFS: nTxBlock = 981, nTxLock = 7851 [ 1011.856089] device-mapper: uevent: version 1.0.3 [ 1011.861104] device-mapper: ioctl: 4.21.0-ioctl (2011-07-06) initialised: dm-devel@redhat.com
cat /proc/version Linux version 3.1.0-1-orion5x (Debian 3.1.1-1) (ben@decadent.org.uk) (gcc version 4.6.2 (Debian 4.6.2-4) ) #1 Tue Nov 15 06:07:47 UTC 2011
Tried to hotplug one SatA disk but did not detected neither …
usb 2-1: new high speed USB device number 2 using orion-ehci usb 2-1: device descriptor read/64, error -71 usb 2-1: device descriptor read/64, error -71 usb 2-1: new high speed USB device number 3 using orion-ehci usb 2-1: device descriptor read/64, error -71 usb 2-1: device descriptor read/64, error -71 usb 2-1: new high speed USB device number 4 using orion-ehci usb 2-1: device not accepting address 4, error -71 usb 2-1: new high speed USB device number 5 using orion-ehci usb 2-1: device not accepting address 5, error -71 hub 2-0:1.0: unable to enumerate USB device on port 1
Skip that , but You can even try use to use host modules through tftp
cd /var/srv wget http://cdn.debian.net/debian/pool/main/l/linux-2.6/linux-image-3.1.0-1-orion5x_3.1.1-1_armel.deb dpkg-deb --extract linux-image-3.1.0-1-orion5x*.deb
l="lib/modules/3.1.0-1-orion5x/kernel/fs/mbcache.ko lib/modules/3.1.0-1-orion5x/kernel/fs/jbd/jbd.ko /lib/modules/3.1.0-1-orion5x/kernel/fs/ext3/ext3.ko " for f in $l ; do insmod $f ; done cd /mnt mount /dev/sda2 . l="dev dev/pts sys proc" for t in $l ; do mkdir -p ./$t && mount --bind /$t ./$t ; done chroot /mnt bin/bash export SHELL=/bin/bash mount -t devpts devpts /dev/pts aptitude install screen screen cat /etc/network/interfaces #| allow-hotplug eth0 #| iface eth0 inet static #| address 192.168.11.150
Error :
If used ext4 :
# mount: mounting /dev/sda2 on /mnt/ failed: Invalid argument # [ 578.613064] EXT3-fs (sda2): error: couldn't mount because of unsupported optional features (240) f="lib/modules/3.1.0-1-orion5x/kernel/fs/ext4/ext4.ko" # f=lib/modules/3.1.0-1-orion5x/kernel/fs/jbd2/jbd2.ko f=lib/modules/3.1.0-1-orion5x/kernel/lib/crc16.ko # f=lib/modules/3.1.0-1-orion5x/kernel/lib/crc-t10dif.ko d=$(dirname $f) mkdir -p $d busybox tftp -g -l $f -r $f 192.168.11.1 insmod $f
# [ 1528.686469] ext4: Unknown symbol crc16 (err 0) # insmod: error inserting 'lib/modules/3.1.0-1-orion5x/kernel/lib/crc16.ko': -1 Invalid module format
# chroot: can't execute '/bin/network-console': No such file or directory
sh-3.2# parted /dev/sda -s unit b print Model: SAMSUNG HD103UJ (scsi) Disk /dev/sda: 1000204886016B Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32256B 1028159999B 1028127744B primary ext3 2 1028160000B 6152509439B 5124349440B primary xfs 4 6152509440B 1000202273279B 994049763840B extended 5 6152541696B 7180669439B 1028127744B logical linux-swap 6 7180701696B 999190563839B 992009862144B logical xfs sh-3.2# parted /dev/sdb -s unit b print Model: SAMSUNG HD103UJ (scsi) Disk /dev/sdb: 1000204886016B Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32256B 1028159999B 1028127744B primary ext3 2 1028160000B 6152509439B 5124349440B primary xfs 4 6152509440B 1000202273279B 994049763840B extended 5 6152541696B 7180669439B 1028127744B logical linux-swap 6 7180701696B 999190563839B 992009862144B logical xfs
irc://irc.freenode.net/linkstationwiki