Welcome! Log In Create A New Profile

Advanced

Debian Linux on Zyxel NSA320S (success)

Posted by chrlee 
Debian Linux on Zyxel NSA320S (success)
February 10, 2015 03:58PM
I have successfully installed the Debian Wheezy to NSA320S.

The compiled kernel (3.19), config, patch, etc can be found at the bottom of the page.

http://www.madadmin.com/zyxel-nsa320s-es-debian-linux-4-resz/

(It is my Hungarian blog.)

Working:
  • sata ports
  • usb ports
  • gigabit ethernet
  • boot from usb, hdd or tftp
  • leds
  • buttons
  • HT1382 real time clock
  • correct power down
Re: Debian Linux on Zyxel NSA320S (success)
February 11, 2015 11:50AM
@chrlee,

Thanks for sharing! I will surely take a look at your patch. Is the NSA320S DTS different much from the NSA320 DTS?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Linux on Zyxel NSA320S (success)
February 11, 2015 12:21PM
The device trees are similar to each other, but the GPIO assignments are different on NSA320 and NSA320S boards, and NSA320S uses a different RTC chip.

chrlee
Jeremy
Re: Debian Linux on Zyxel NSA320S (success)
March 15, 2016 08:52AM
Hey Chrlee,

I am a complete noob when it comes to Linux/Debian, really any programming outside Matlab and Arduino. I have a USB to TTY cable and Putty. I cannot get the U-boot to come up when turning on the power. I am using the correct com port and 115200 for the baud rate. Do I have to install U-boot somehow?

I have tried to follow your blog post, but I know zero Hungarian and the translation via google is not very good.

Jeremy
Re: Debian Linux on Zyxel NSA320S (success)
March 15, 2016 12:01PM
Jeremy,

Install the kernel from here:
http://forum.doozan.com/read.php?2,12096

-bodhi
===========================
Forum Wiki
bodhi's corner
Jeremy
Re: Debian Linux on Zyxel NSA320S (success)
March 15, 2016 03:40PM
Bodhi,

Thanks for your response. I will be honest, that seems like a daunting task for an ME haha. I will work on this in the next few days; I do like a challenge.

Jeremy
Re: Debian Linux on Zyxel NSA320S (success)
March 22, 2016 02:52PM
The NSA320s still doesn't power off:

[  344.951742] ------------[ cut here ]------------
[  344.956358] WARNING: CPU: 0 PID: 1738 at drivers/power/reset/gpio-poweroff.c:45 SyS_reboot+0x14c/0x1f8()
[  344.965795] Modules linked in: ipv6 evdev orion_wdt marvell_cesa des_generic gpio_keys sg sd_mod uas usb_storage sata_mv libata fixed scsi_mod
[  344.978649] CPU: 0 PID: 1738 Comm: halt Not tainted 4.5.0-kirkwood-tld-1 #4
[  344.985573] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[  344.991841] [<c001680c>] (unwind_backtrace) from [<c0012a78>] (show_stack+0x10/0x14)
[  344.999559] [<c0012a78>] (show_stack) from [<c001eb14>] (warn_slowpath_common+0x88/0xb0)
[  345.007625] [<c001eb14>] (warn_slowpath_common) from [<c001ebcc>] (warn_slowpath_null+0x18/0x20)
[  345.016374] [<c001ebcc>] (warn_slowpath_null) from [<c003aa04>] (SyS_reboot+0x14c/0x1f8)
[  345.024436] [<c003aa04>] (SyS_reboot) from [<c000f060>] (ret_fast_syscall+0x0/0x38)
[  345.032057] ---[ end trace 36ca6c5fe926a98d ]---


and after a while ..

[  377.093612] usb 1-1-port1: cannot reset (err = -110)
[  378.093590] usb 1-1-port1: cannot reset (err = -110)
[  379.093594] usb 1-1-port1: cannot reset (err = -110)
[  380.103585] usb 1-1-port1: cannot reset (err = -110)
[  381.103597] usb 1-1-port1: cannot reset (err = -110)
[  381.108542] usb 1-1-port1: Cannot enable. Maybe the USB cable is bad?
[  382.113592] usb 1-1-port1: cannot disable (err = -110)
[  383.113592] usb 1-1-port1: cannot reset (err = -110)
[  384.113589] usb 1-1-port1: cannot reset (err = -110)
[  385.113592] usb 1-1-port1: cannot reset (err = -110)
[  386.113588] usb 1-1-port1: cannot reset (err = -110)
[  387.113595] usb 1-1-port1: cannot reset (err = -110)
[  387.118543] usb 1-1-port1: Cannot enable. Maybe the USB cable is bad?
...



Edited 1 time(s). Last edit at 03/22/2016 02:55PM by pengu.
Re: Debian Linux on Zyxel NSA320S (success)
March 22, 2016 05:08PM
Did it power off ok before?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Linux on Zyxel NSA320S (success)
March 22, 2016 06:41PM
bodhi Wrote:
-------------------------------------------------------
> Did it power off ok before?


no
Re: Debian Linux on Zyxel NSA320S (success)
May 16, 2016 06:42PM
with kernel 4.6, the LAN isn't working as seen with kernel 4.5
Re: Debian Linux on Zyxel NSA320S (success)
May 16, 2016 11:46PM
pengu Wrote:
-------------------------------------------------------
> with kernel 4.6, the LAN isn't working as seen
> with kernel 4.5

There is a regression with NSA310S/320S network. I'm investigating this.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Linux on Zyxel NSA320S (success)
May 17, 2016 12:08AM
There is a kernel code change that might have been the cause of our regression.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 05/17/2016 12:09AM by bodhi.
Re: Debian Linux on Zyxel NSA320S (success)
May 17, 2016 09:16PM
root@Nsa310s:~# uname -a
Linux Nsa310s 4.6.0-kirkwood-tld-1 #3 PREEMPT Mon May 16 22:49:40 PDT 2016 armv5tel GNU/Linux

root@Nsa310s:~# dmesg | grep 'eth' | grep link
[    2.843967] mv643xx_eth: Set the PHY to fix link down
[   23.713376] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   25.600179] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   25.610024] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

Try the attached DTB for your box. It will work with kernel 4.5 or 4.6.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 3 time(s). Last edit at 05/17/2016 09:28PM by bodhi.
Attachments:
open | download - kirkwood-nsa320s.dtb (13 KB)
open | download - kirkwood-nsa310s.dtb (13 KB)
Re: Debian Linux on Zyxel NSA320S (success)
June 18, 2016 01:08AM
Hi!

I have an NSA320S too and I am interested to install Debian on it. But I want to install the whole system to pendrive(s).

I found at @bodhi's nice forum some compatible kernels, but they are fdt based and we have got old u-boot binary on this nas, and I don't want to change that if it isn't important. So I think the manualy configure of the uImage is a better solution in my(/our) case, but I Cannot found any specific .config for this nas.

And one more question.... The kernel and the initrd Can be loaded from the pendrive. But Can I load the "FHS" too from a pendrive? Because now at the HDD the zyxel based system's fhs living...

Thanks a lot!
Re: Debian Linux on Zyxel NSA320S (success)
June 18, 2016 01:41AM
Create rootfs on USB drive following instruction from the kernel/rootfs thread: http://forum.doozan.com/read.php?2,12096. In section:

Quote

Updated 20 Feb 2016:

This Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 is to keep in sync with kernel Linux-4.4.0-kirkwood-tld-1.

To boot with stock u-boot, pay attention to section 4

Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Skip this step if you have installed my latest u-boot release.

Somewhere in this NSA310S thread you will find the u-boot envs setings that allow booting with stock u-boot.

It is best that you connect serial console to set it up. That way you will be able to test the settings before committing to NAND.

If not sure, post the commands you about to execute and I'll doublecheck it.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 2 time(s). Last edit at 06/18/2016 02:00AM by bodhi.
Re: Debian Linux on Zyxel NSA320S (success)
August 26, 2016 05:27AM
Hi!

Thanks for the detailed answer and sorry for my late reply...

One thing is not clear for me. If my u-boot not supports fdt and tld, I have to make an uImage manualy for the nas. That's okay, but how Can I do that? Where Can I download a kernel source tree, which compatible with my nas?
Re: Debian Linux on Zyxel NSA320S (success)
August 26, 2016 02:29PM
Mr Dini,

> I have to make an uImage
> manualy for the nas. That's okay, but how Can I do
> that? Where Can I download a kernel source tree,
> which compatible with my nas?

It is in the kernel/rootfs thread as I mentioned above.

Quote

Updated 20 Feb 2016:

This Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2........
/quote]

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Linux on Zyxel NSA320S (success)
August 27, 2016 06:55AM
Okay, but I Can't install deb packages at my nas's stock fw, because I haven't got dpkg package manager...

So I decided to build the uImage on a PC ubuntu 14.04 (x64). But when I try to install the linux-image-4.6.0-kirkwood-tld-1_1.0_armel.deb package, it says compatibility error... (x64 and armel)

I successfully created the uImage, but I Can't create the uInitrd with this command:

mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-4.6.0-kirkwood-tld-1 -d initrd.img-4.6.0-kirkwood-tld-1 uInitrd

Because there is no initrd.img-4.6.0-kirkwood-tld-1 or initramfs-4.6.0-kirkwood-tld-1. How Can I download/collect it?

Edit:

I found this: http://www.madadmin.com/zyxel-nsa320s-es-debian-linux-4-resz/

And I Could create the uInitrd too.

BTW: If I copy the uInitrd and the uImage to a pendrive and change the bootflags, I Can boot up the debian installer? If yes, Can I select the pendrive to install the debian on it? If no, what is needed?



Edited 2 time(s). Last edit at 08/27/2016 07:14AM by Mr Dini.
Re: Debian Linux on Zyxel NSA320S (success)
August 27, 2016 07:47AM
Mr Dini Wrote:
-------------------------------------------------------
> Okay, but I Can't install deb packages at my nas's
> stock fw, because I haven't got dpkg package
> manager...

Note that I posted "Debian 4.4 ...." above. It is a full Debian system rootfs that you tar to a USB drive and use it. No need to install .deb package. Scroll down and find :

Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 (20 Feb 2016)

And you can install new uboot here at the same time:

http://forum.doozan.com/read.php?3,12381

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 08/27/2016 07:48AM by bodhi.
Re: Debian Linux on Zyxel NSA320S (success)
August 27, 2016 07:54AM
And the 4.4.0 rootfs will work with 4.6.0 kernel? Because, as You read, the 320S ethernet fix is just come with the future releases...

Ps.: I don't want to upgrade u-boot from the stock, because the original fw will not work if I update it.



Edited 2 time(s). Last edit at 08/27/2016 08:34AM by Mr Dini.
Re: Debian Linux on Zyxel NSA320S (success)
August 27, 2016 03:08PM
Mr Dini,

> And the 4.4.0 rootfs will work with 4.6.0 kernel?
> Because, as You read, the 320S ethernet fix is
> just come with the future releases...

Of course. Rootfs 4.4.0 has the kernel 4.4.0 in it, and NSA320S Ethernet works since several versions back (in 4.5 it was broken).

If you want to be sure:

- Create rootf 4.4 on USB
- Copy the attached kirkwood-nsa320s.dtb (this is from kernel 4.6) to the /boot/dts to replace the old one (assuming the USB is mounted at /media/sdb1):

mv /media/sdb1/boot/dts/kirkwood-nsa320s.dtb /media/sdb1/boot/dts/kirkwood-nsa320s.dtb.4.4.0
cp -a kirkwood-nsa320s.dtb /media/sdb1/boot/dts/

After you got it booted, you can then upgrade the kernel to 4.6.

>
> Ps.: I don't want to upgrade u-boot from the
> stock, because the original fw will not work if I
> update it.

True. New u-boot will not boot stock OS. Stock u-boot can boot new Debian rootfs.

Do you have serial console connected? if you do then it is really safe to adjust stock u-boot envs to boot the new Debian 4.4 rootfs. If you don't, there is a risk in that if you mess up the envs, then you must connect serial console to fix it.

-bodhi
===========================
Forum Wiki
bodhi's corner
Attachments:
open | download - kirkwood-nsa320s.dtb (13 KB)
Re: Debian Linux on Zyxel NSA320S (success)
August 27, 2016 03:18PM
Many-many thanks! I am very thankful! :)

Certainly, I have serial cable and I Can use it.

I will try it tomorrow.
Re: Debian Linux on Zyxel NSA320S (success)
August 27, 2016 03:25PM
Mr Dini Wrote:
-------------------------------------------------------
> Many-many thanks! I am very thankful! :)
>
> Certainly, I have serial cable and I Can use it.
>
> I will try it tomorrow.

Ah. If you have serial console then you don't need ethernet to upgarde kernel to 4.6, either. In case you have problem with it, just login with serial console and upgrade kernel.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Linux on Zyxel NSA320S (success)
August 27, 2016 03:33PM
Okay!

Summa-summarum: I have an uImage generated with Your description, from the 4.6 tld archive (bz2). And an uInitrd from madadmin's article.

I will place theese two files to a pendrive's FAT16 part with boot label? And I will extract the rootfs to the second, rootfs labelled partition?

After it, I think, I just have to test a boot up with serial console and if everything is OK, I Can save the boot commands to bootflags.

Sorry for the question flood, but... Docendo discimus! ;)



Edited 1 time(s). Last edit at 08/27/2016 03:34PM by Mr Dini.
Re: Debian Linux on Zyxel NSA320S (success)
August 27, 2016 03:53PM
Mr Dini Wrote:
-------------------------------------------------------
> Okay!
>
> Summa-summarum: I have an uImage generated with
> Your description, from the 4.6 tld archive (bz2).
> And an uInitrd from madadmin's article.
>

No need for any of this.

> I will place theese two files to a pendrive's
> FAT16 part with boot label? And I will extract the
> rootfs to the second, rootfs labelled partition?
>

No.

Just create a single partition type Ext3. Extract the Debian 4.4 rootfs to it. Copy the new DTB as I described above. Append the DTB to uImage. And doing this while being root user (no sudo). That's it. You don't need to get any thing else.

All this is described in the rootfs thread.

> After it, I think, I just have to test a boot up
> with serial console and if everything is OK, I Can
> save the boot commands to bootflags.
>

Yes.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Linux on Zyxel NSA320S (success)
August 29, 2016 08:14AM
Hi!

I tried to boot up from USB, but it doesn't works...

Here is an output:

Marvell>> usb reset
(Re)start USB...
USB:   scanning bus for devices... 1 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found
Marvell>>

It is a pendrive with two partitions. Yes, You said, I just have one, but I have very old u-boot which not supports dtb's and the FDT...

So I created a pendrive with a Fat32 part, called boot, and a second one called rootfs. It is an ext3 partition. I have an uImage (i created from 4.4.0-bodhi) at the first partition and an extracted rootfs at the rootfs labelled partition.

But it Cannot see my USB which is connected to rear port. (i also tried all other ports, but the output is the same...)

2. I tried to load the uImage via tftp server, but the kernel Can't load the rootfs:

http://pastebin.com/nJzxQqUP

Thanks!
Re: Debian Linux on Zyxel NSA320S (success)
August 29, 2016 12:51PM
Mr Dini,

Ah! I remember something about USB power on this stock u-boot. I have to look for it.

And create one single Ext3 partition, as I mentioned above. Do not use 2 partitions. You don't need it. Stock u-boot will boot ext3 with the uImage that has DTB embedded inside it (step 4 in the kernel thread)

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Linux on Zyxel NSA320S (success)
August 29, 2016 01:03PM
Yes, I found that command:

mw.l f1010100 1361c000

Will try it tomorrow!

Regarding the two partitions... Okay, but in case, when I just have a rootfs, where the u-boot look for the uImage (kernel). I haven't got a non stop tftp server to download it every boot and my HDD is full of data...

Edit: Ah sorry, I had to read Your comment three times to understand, how did You thought that... Okay, that's a good idea! :) Sorry, my in-brain computer has only one core... :DDD

Many thanks!



Edited 2 time(s). Last edit at 08/29/2016 03:31PM by Mr Dini.
Re: Debian Linux on Zyxel NSA320S (success)
August 29, 2016 05:20PM
Mr Dini Wrote:
-------------------------------------------------------
> Yes, I found that command:
>
>
> mw.l f1010100 1361c000
>
>
> Will try it tomorrow!
>
> Regarding the two partitions... Okay, but in case,
> when I just have a rootfs, where the u-boot look
> for the uImage (kernel). I haven't got a non stop
> tftp server to download it every boot and my HDD
> is full of data...
>
> Edit: Ah sorry, I
> had to read Your comment three times to
> understand, how did You thought that... Okay,
> that's a good idea! :) Sorry, my in-brain computer
> has only one core... :DDD
>
> Many thanks!

One of those moments we all experienced :)

If you leave the HDD attached, remember to make a backup if there are data in it. While hacking, anything could happen!

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian Linux on Zyxel NSA320S (success)
August 30, 2016 05:35AM
Okay, now it's saying an another interesting error:

Marvell>> mw.l f1010100 1361c000                                                
Marvell>> usb reset                                                             
(Re)start USB...                                                                
USB:   scanning bus for devices...                                              
      USB device not responding, giving up (status=20)                          
2 USB Device(s) found                                                           
Waiting for storage device(s) to settle before scanning...                      
0 Storage Device(s) found                                                       
Marvell>>

Edit: With an another pendrive, it's working!!! :) Yahoo!



Edited 1 time(s). Last edit at 08/30/2016 06:12AM by Mr Dini.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: