Debian Squeeze/Wheezy on NSA-310

Marvell Kirkwood based
Post Reply
MrDelphi
Posts: 3
Joined: Fri Apr 20, 2012 9:50 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by MrDelphi » Fri Apr 20, 2012 10:36 pm

Hello,

first, thanks peeter and everyone involved; with this info I was able to install Debian Squeeze on my new NSA-310 without (ok, nearly, at least) trouble :)

One issue was that the Debian installer created a GUID partition table instead of an MBR, which NSA's U-Boot doesn't seem to like (wasn't able to mount /boot to read uImage).
Simple solution: installed gdisk from squeeze-backports, and converted the GPT to MBR.


A comment for setting the MAC address: instead of hard-coding the MAC in rc.local, you can use fw_printenv to read it from U-Boot environment (the original firmware does this, too):

Install package uboot-envtools, then copy /usr/share/doc/uboot-envtools/examples/fw_env.config to /etc/ and insert the line:

Code: Select all

/dev/mtd1               0x0000          0x20000         0x20000                 4
Comment out all other lines. Then, change the MAC fix command in rc.local to:

Code: Select all

ifdown eth0
/sbin/ifconfig eth0 hw ether `fw_printenv -n ethaddr`
ifup eth0
(peeter, feel free to add this to your first post if you like. btw., your tutorial says eth1 while I had to use eth0...?)


Finally, wake-on-lan doesn't work with the real MAC anymore, only with the "fake" MAC 00:00:00:00:00:30 (no matter if using fw_printenv like above, or the hardcoded MAC), see
viewtopic.php?p=24685#p24685.
Is it the same for you? Anybody knows a solution?

dieterm57
Posts: 8
Joined: Wed Mar 28, 2012 8:37 am

Re: Debian Squeeze/Wheezy on NSA-310

Post by dieterm57 » Wed May 02, 2012 8:00 am

Regarding WOL: can someone tell me how to shut the box down so that the ethernet card still is enabled?
I tried
poweroff
/sbin/shutdown -h now
but those two also disable the nic and the leds go black.
thanks

MrDelphi
Posts: 3
Joined: Fri Apr 20, 2012 9:50 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by MrDelphi » Wed May 02, 2012 10:28 am

I simply run "halt" on commandline, and WOL does work. However, the NIC LEDs are never lit on my NSA, even when it's running and network is up.

Have you tried WOL yet despite the dark LEDs?

Are you using Debian too, or the original firmware?

dieterm57
Posts: 8
Joined: Wed Mar 28, 2012 8:37 am

Re: Debian Squeeze/Wheezy on NSA-310

Post by dieterm57 » Wed May 02, 2012 4:38 pm

Thanks for your help, and yes I am using debian.
I noticed that it worked for WOL on my desktop, but not on my fritz!box with ether-wake.
The problem was that I had to set the -b flag in ether-wake to send the packet to the broadcast address and it worked.
But you were right. The LEDs are definitely dark.
thanks!!

osa
Posts: 26
Joined: Sun Nov 13, 2011 3:31 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by osa » Sun May 06, 2012 6:58 pm

Automatic Debian Installer
Please archive your files before going further! I'm not responsible for any errors or data loss!
If something goes wrong it could be nesessary to connect NAS to serial port or connect drive to PC

Download 2 files nsa310-ali.zip and linux.tgz
Extract content of nsa310-ali.zip to fat-formatted pendrive, copy linux.tgz to root of your pendrive.
Reboot your NSA with pendrive - it will do usb_key_func.sh trick to setup uboot and continue after reboot.
Second stage script - nsa310.sh will format your sda2 partition to ext4. If you want to save files on NAS please comment this line by adding # in line 35 of nsa310.sh

Code: Select all

#mkfs.ext4 /dev/sda2
Scripts will work with 4.40. If you use 4.22 please rename checksumfile.422 to checksumfile (I've not tried this!)

Recovery mode

I created recovery.sh script which will reset uboot to previous state. Please rename recovery.bak to recovery and reset NAS
After booting and setting uboot it will halt. It's good moment to unplug pendrive, otherwise it will install Linux again.

Scripts and my debootstrapped Debian shoud work, but are not hardly tested
After booting Debian it gets IP from dhcp and sshd is running (user: root, password:root)
Debian (squeeze) is running 2.6.32 kernel with debian and nsa patches
Edit: changed links to current version
Last edited by osa on Mon Jun 25, 2012 12:28 am, edited 4 times in total.

peeter123
Posts: 37
Joined: Sun Dec 04, 2011 12:38 am
Location: Enschede, the Netherlands

Re: Debian Squeeze/Wheezy on NSA-310

Post by peeter123 » Sat May 19, 2012 7:29 pm

I've updated my git with kernel 3.3.6: https://github.com/peeter123/NSA310-320-debian

m3cab
Posts: 84
Joined: Mon Apr 23, 2012 5:03 am

Re: Debian Squeeze/Wheezy on NSA-310

Post by m3cab » Thu Jun 07, 2012 11:51 am

hi, what are the advantages/ disadvantages of having Debian over the stock Zyxel Os?

sommersohn
Posts: 1
Joined: Tue Jun 12, 2012 7:34 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by sommersohn » Tue Jun 12, 2012 7:42 pm

Hey guys,

I have also sucessfully installed Debian on my nsa-310. :D :P
Thanks to everyone who made this thing possible.

One issue: The fan is running all times at full speed. Did anyone already found out how to slow it down? :?:
Slowing it down automatically in dependence of heat inside would be the best. But even slowing it down just a little bit would help, I think.

By the way: I am running kernel 3.2 together with Samba 3.5.6 and SWAT without any problems so far. :geek:

Best regards,
Michael

VeldMuijz
Posts: 9
Joined: Mon Jun 18, 2012 7:05 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by VeldMuijz » Mon Jun 18, 2012 7:36 pm

osa wrote:Automatic Debian Installer
Please archive your files before going further! I'm not responsible for any errors or data loss!
If something goes wrong it could be nesessary to connect NAS to serial port or connect drive to PC
Hi Osa, I will get my hands on a second hand (but free :)) Zyxel310 by tomorrow. As far as I know there is standard firmware on it.
What is the easiest way to get to know if I have 4.40 or 2.2 (this is talking about firmware I guess)?

This will work with an completely empty hardrive right? It will be cleared on install anyways?

I want to run Debian on it and the install is an automated one, but is it the netinstall? Or is it a more complete install?
Which packages are on it (if it isn't the netinstall)?

How willl the partioning go? /, /home, /var, /etc seperated or everthing on one partition?

Thanks in advance.

VeldMuijz
Posts: 9
Joined: Mon Jun 18, 2012 7:05 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by VeldMuijz » Wed Jun 20, 2012 9:28 am

Just wanted to point out this blogpost:
http://ixrv.blogspot.co.uk/2012/04/flas ... ebian.html

This is a complete guide, for the starter hackers amongst us (like me), to install debian on your 310 with the serial cable method.

osa
Posts: 26
Joined: Sun Nov 13, 2011 3:31 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by osa » Wed Jun 20, 2012 12:56 pm

Hi Osa, I will get my hands on a second hand (but free :)) Zyxel310 by tomorrow. As far as I know there is standard firmware on it.
What is the easiest way to get to know if I have 4.40 or 2.2 (this is talking about firmware I guess)?
Please run with standard firmware and check version.. and upgrade to 4.40 if needed. Also, please create data partition with OFW
This will work with an completely empty hardrive right? It will be cleared on install anyways?
OFW uses sda1 partition (small.. 500mb) for swap and other things and we will use it for kernel and initrd. My script will format sda2 (data partiton), but you can hash mkfs if you like in nsa310.sh.
I want to run Debian on it and the install is an automated one, but is it the netinstall? Or is it a more complete install?
Which packages are on it (if it isn't the netinstall)?
This is minimal debootstrapped squeeze with some tools like fw_setenv. If everything goes ok, you shoud'nt need serial cable.
How willl the partioning go? /, /home, /var, /etc seperated or everthing on one partition?
All files are extracted to sda2 partition.. but you can modify nsa310.sh to resize/create new partitions and mount them properly before extracting

A few people reported successfull install here, but some reported errors.. impossible to track without serial cable. Be patient while installing..some reboots will occur and after install nsa should halt/power-off

VeldMuijz
Posts: 9
Joined: Mon Jun 18, 2012 7:05 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by VeldMuijz » Wed Jun 20, 2012 1:34 pm

Also, please create data partition with OFW
Can you advise me a how to on this?
I don't know what OFW is. Is it a standard tool of the zyxel nsa310? :oops:

osa
Posts: 26
Joined: Sun Nov 13, 2011 3:31 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by osa » Wed Jun 20, 2012 1:39 pm

OFW - Official Firmware ;-)
I don't use any zyxel's firmware and can't remember where to set it, but it was easy

deramon
Posts: 4
Joined: Thu Mar 15, 2012 9:47 pm

Re: Debian Squeeze/Wheezy on NSA-310

Post by deramon » Wed Jun 20, 2012 3:49 pm

Hi,

as already mentioned, I posted a complete documentation, based on the information here, on the german site http://linuxwiki.de/ZYXEL%20NSA-310, including the installation of the Logitech Squeezebox Software and the software based player-emulation.

Now I wanted to add OpenVPN, but failed:

Code: Select all

Wed Jun 20 17:13:03 2012 Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)
Wed Jun 20 17:13:03 2012 Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Wed Jun 20 17:13:03 2012 Cannot allocate TUN/TAP dev dynamically
Did anybody compile a kernel featuring TUN/TAP devices?

Regards,

Ralf

peeter123
Posts: 37
Joined: Sun Dec 04, 2011 12:38 am
Location: Enschede, the Netherlands

Re: Debian Squeeze/Wheezy on NSA-310

Post by peeter123 » Thu Jun 21, 2012 9:27 pm

I'm working on kernel 3.4.3 with tun compiled in. Will upload config + uImage to git this weekend ;)

Post Reply