Welcome! Log In Create A New Profile

Advanced

ZyXel NSA325 to run Debian?

Posted by SomeoneOnLine 
ZyXel NSA325 to run Debian?
November 20, 2013 04:49PM
Might be a dumb question but has anyone been able to get this little buger to run debian? I currently have archlinuxarm installed and running just fine but was hoping to at some point run debian squeez or weezy. :)

~SOL
Re: ZyXel NSA325 to run Debian?
November 20, 2013 06:18PM
If Arch works, Debian should work, too. I don't see a reason, why not.
Re: ZyXel NSA325 to run Debian?
November 20, 2013 06:23PM
Thats kinda what I thought. The part that I'm not sure of is how would I go about installing it? Are there any tutorials I could read and or follow?

Thanks,

~SOL
Re: ZyXel NSA325 to run Debian?
November 20, 2013 06:35PM
I don't know if there are any ready-to-use solutions yet. If not you could read up on debootstrap and its use. If Arch works you probably already have a kernel to use. So all you need is a rootfs.
Re: ZyXel NSA325 to run Debian?
November 20, 2013 06:46PM
Ok. I'll read up on debootstap. I have a ghost type image of my current arch install. Maybe I'll play around a bit.
Re: ZyXel NSA325 to run Debian?
November 21, 2013 12:47AM
@SOL,

If you can find where to get the patch, I'll build and release a new Debian kernel. I think WarheadsSE already solved some show-stopper problem for this box.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: ZyXel NSA325 to run Debian?
November 21, 2013 08:18PM
I got the Arch pach which includes NSA325 from their GITHub.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 11/21/2013 08:19PM by bodhi.
Re: ZyXel NSA325 to run Debian?
November 21, 2013 09:09PM
Thanks. I was just looking for that. Just got checked into my hotel and was gonna pull it up for you. Thanks for any and all help with this topic. ;)
Re: ZyXel NSA325 to run Debian?
November 21, 2013 11:03PM
SOL, I'll extract the patch and build it in the new kernel release and you can test it!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: ZyXel NSA325 to run Debian?
November 21, 2013 11:16PM
Thanks so much. I won't be back in town until after December 2nd. But I will definitely test and report. Thanks again for your efforts.

Regards,

~SOL
andi
Re: ZyXel NSA325 to run Debian?
November 23, 2013 06:29AM
hey,

bodhi, do you have finished the work on your kernel? just got my box from amazon and for now its just sitting aside from the dockstar and the goflex :-)

greets
andi
Re: ZyXel NSA325 to run Debian?
November 23, 2013 03:01PM
Andi,

I'm regression testing with other plugs, and will upload it today or tomorrow.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: ZyXel NSA325 to run Debian?
November 24, 2013 03:38PM
I've uploaded an update for Kirkwood linux-3.12 for testing: added supports for Zyxel NSA325 and NSA310.

For those who have the NSA325 and NSA310, and perhaps NSA320 also, please try this kernel and let me know if it works for you or there is any problem. If every thing goes well, I will update the main thread to include this deb package, along with the patch and headers.

This tarball contains the kernel deb package only.
linux-3.12.0-kirkwood-tld-2-bodhi.tar.bz2
md5:
ceb5d371aa3a039fab63e1e5d748180b

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 11/24/2013 05:36PM by bodhi.
Re: ZyXel NSA325 to run Debian?
November 25, 2013 11:24PM
Sorry for the noob question but how would one try the "Kirkwood linux-3.12 Kernel" with a debian rootfs? Do I need to get download a debian rootfs from somewhere then put the "Kirkwood linux-3.12 kernel in it some how?

~SOL
Re: ZyXel NSA325 to run Debian?
November 26, 2013 12:29AM
SOL,

See this thread for the latest Debian rootfs and instruction:
http://forum.doozan.com/read.php?2,12096

After you created the rootfs USB stick and booted into Debian, install this kernel (instruction also in that thread). The current rootfs has kernel linux-3.12.0-kirkwood-tld-1.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 11/26/2013 12:30AM by bodhi.
Re: ZyXel NSA325 to run Debian?
November 26, 2013 01:28AM
Since I already have archlinuxarm on my nsa325 Does that mean uboot environment is already set? I don't have a serial cable so I'm nervous to mess with uboot. Can I maybe extract rootfs to sdb then swap the 2 drives in the bays around?

~sol
Re: ZyXel NSA325 to run Debian?
November 26, 2013 02:49AM
Right! Don't mess with uBoot envs. Best if you print out uBoot envs while in Arch Linux so that we can check if they are set to boot both Debian and Arch.
fw_printenv

The uBoot bootcmd env might have been set to boot Arch only. So if that's the case, it will need to change to boot Debian. It's all depending on the current uBoot settings, so we need to verify that. If netconsole is supported in the installed uBoot then it is much easier. But serial console is the best tool to have while you are doing this.

You're right about the rootfs, it should be extracted to the spare drive, remove the Arch drive, and plug the new Debian rootfs in the same SATA slot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 11/26/2013 02:52AM by bodhi.
Re: ZyXel NSA325 to run Debian?
November 26, 2013 11:49AM
Below is my uboot_env. I think I got it all.

bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1)$
bootdelay=2
baudrate=115200
loads_echo=0
ipaddr=10.4.52.165
serverip=10.4.52.7
rootpath=/srv/ubuntu
netmask=255.255.255.0
nandEcc=1bit
MODEL_ID=AA03
PRODUCT_NAME=NSA-325
FEATURE_BIT=00
CONTRY_TYPE=FF
VENDOR_NAME=MitraStar Technology Corp.
run_diag=yes
ethaddr=FC:F5:28:0D:38:90
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
ethprime=egiga0
bootargs_root=root=/dev/nfs rw
bootargs_end=:::orion:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
lcd0_enable=0
lcd0_params=640x480-16@60
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev[0]:fxs,dev[1]:fxo
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
image_multi=yes
ethact=egiga0
arcNumber=4495
bootargs_stock=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(ro$
bootargs_linux=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(ro$
bootcmd_linux=setenv bootargs $(bootargs_linux); ide reset; ext2load ide 0:1 $(loadaddr) /uImage; bootm $(loadaddr)
bootcmd_stock=setenv bootargs $(bootargs_stock); nand read.e $(loadaddr) $(kernel_addr) 0xA00000; bootm $(loadadr)
to_stock=setenv mainlineLinux no; setenv bootcmd \'run bootcmd_stock\'; saveenv; reset
to_linux=setenv mainlineLinux yes; setenv bootcmd \'run bootcmd_linux\'; saveenv; reset
stdin=serial
stdout=serial
stderr=serial
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
disaMvPnp=no
enaAutoRecovery=yes
kernel_addr=0x4640000
pcieTune=no
pcieTune1=no
mainlineLinux=yes
bootcmd='run bootcmd_linux'
Re: ZyXel NSA325 to run Debian?
November 26, 2013 02:52PM
Just read up a little on netconsole. I like the idea. It looks like my uboot might support it. However it has the wrong IP for my network. Can I simply just change the ip to an IP I can run netcat on? If my nsa325 doesn't support net console is it difficult to make it support it?

~sol
Re: ZyXel NSA325 to run Debian?
November 27, 2013 01:11AM
SOL,

IIRC, WarheadsSE said the NSA325 stock uBoot does not support netconsole (it is very limited). You will need to have a newer uBoot such as Davy's NSA320 uBoot to provide that. However, I'm not 100% sure if it boots the NSA325 (but my guess is very probably it does).

Your best approach is to get serial console working. It is quite easy to do that for the NSA3xxx boxes, all the hard work you need to do is to buy a USB serial module converter. After you have serial console, then risk of bricking is very minimal.

So to summarize,
- this combination : serial console, my new rootfs : most likely boot Debian.
- this combination : serial console, Davy's uBoot, my rootfs : most likely boot Debian and give you netconsole and many more uBoot features (scripting…)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: ZyXel NSA325 to run Debian?
November 27, 2013 10:42AM
Thanks for the info. Good to know before I start messing around and brick my nsa325. I am trying to order a cable now. From what you can tell does my current uboot_env support booting debian in addition to archlinux?

~SOL
Re: ZyXel NSA325 to run Debian?
November 27, 2013 02:59PM
SOL,

No, currently your bootcmd boot Archlinux but not Debian.

This needs to be changed
bootcmd_linux=setenv bootargs $(bootargs_linux); ide reset; ext2load ide 0:1 $(loadaddr) /uImage; bootm $(loadaddr)
to something like this:
bootcmd_linux=setenv bootargs $(bootargs_linux); ide reset; ext2load ide 0:1 $(loadaddr2) /uInitrd; ext2load ide 0:1 $(loadaddr) /uImage; bootm $(loadaddr)  $(loadaddr2)

The safe way to play with these is to do it in serial console with either UART booting, or tftp (modify uBoot envs without commiting to NAND).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: ZyXel NSA325 to run Debian?
December 14, 2013 05:37PM
So I got my hands on a cp2102 usb uart cable but when I broke it open I noticed that the red wire is soldered to the 5v pin in the usb plug and the 3v has nothing on it. Will that fry the controller on my nsa325 if I use the 5v wire? My usb cable only has 4wires on it.

The cable I purchased is
USB 2.0 to TTL Uart 6Pin Module Serial Converter CP2102

Thanks

~sol



Edited 1 time(s). Last edit at 12/14/2013 06:08PM by SomeoneOnLine.
Re: ZyXel NSA325 to run Debian?
December 14, 2013 06:06PM
SomeoneOnLine Wrote:
-------------------------------------------------------
> So I got my hands on a cp2102 usb uart cable but
> when I broke it open I noticed that the red wire
> is soldered to the 5v pin in the usb plug. Will
> that fry the controller on my nsa325? My usb cable
> only has 4wires on it.
>
> Thanks
>
> ~sol

Don't connect power! The serial console only needs Tx, Rx, Gnd.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: ZyXel NSA325 to run Debian?
December 14, 2013 06:09PM
Sweet. Thats the answer I was hoping for. Thanks.

~SOL
Re: ZyXel NSA325 to run Debian?
December 15, 2013 04:03AM
bodhi Wrote:
-------------------------------------------------------
> SOL,
>
> No, currently your bootcmd boot Archlinux but not
> Debian.
>
> This needs to be changed
>
> bootcmd_linux=setenv bootargs $(bootargs_linux);
> ide reset; ext2load ide 0:1 $(loadaddr) /uImage;
> bootm $(loadaddr)
>
> to something like this:
>
> bootcmd_linux=setenv bootargs $(bootargs_linux);
> ide reset; ext2load ide 0:1 $(loadaddr2) /uInitrd;
> ext2load ide 0:1 $(loadaddr) /uImage; bootm
> $(loadaddr)  $(loadaddr2)
>
>
> The safe way to play with these is to do it in
> serial console with either UART booting, or tftp
> (modify uBoot envs without commiting to NAND).

OK so I have my cable working. Was a pain getting drivers for win8x64 to work. none the less I am able to use teraterm to get to the console and watch it boot arch etc..I can even interrupt uboot and run uboot env commands so I think my safety net is ready. :)

Now for the fun part. Somethings that are still a little unclear are,

WarheadsSE over at arch forums said something to the fact that usb booting is not supported or not supported yet. either way since its booting upto arch now just fine, how can I get it to boot to a prepaired ext3 usb disk using this post? I understand that I will need to change the "bootcmd_linux" as you mentioned. I wonder if I can modify and use WarheadsSE alarm usb install script to install and unpack your rootfs onto sdb while booted to alarm from sda? Thats 'kinda' what I was doing to repair alarm installs that I broke. Install ArchArm to SDB then swap drives and boot alarm. I kinda want to do something similar if not better but only with your debian rootfs.

After I have this whole process down I hope to write up a tut so that the next semi-noob doesnt ask all the same questions I have. :)

Thanks for the help and hard work you all have provided to the community. :)

~SOL
Re: ZyXel NSA325 to run Debian?
December 15, 2013 01:47PM
So I decided to take the plunge and try to tweak the archlinuxarm install script to unpack and install on sdb1/2 using the attached script. It starts the boot but sits at waiting for SDB2. I will post a screen dump of exactly what it says here in a bit. but should the attached debinstall.sh script when run from archlinixarm env then after unpack and install swap physical drive sda with sdb and boot?

Thanks,

~SOL
Attachments:
open | download - debinstall.sh (2.5 KB)
Re: ZyXel NSA325 to run Debian?
December 15, 2013 03:31PM
SOL,

See how Buttzy got it working with my rootfs Debian installed on HDD in the sticky thread here (should read a few posts before and the rest):
http://forum.doozan.com/read.php?2,12096,14406#msg-14406

I'd suggest you use serial console, and set uBoot envs using setenv, and test booting Debian. Don't do saveenv while you are in uBoot command line. After you've satisified that it works to your satisfaction, then while in Debian, set those envs for real. Don't try to test with a script!

The loadaddr2 needs a value, it could be any address that high enough for uBoot to work with. In the above linked post, Buttzy tried 0x01100000, which is a standard location we all use for other Kirwood plugs. It seems to work fine.

After you got it working, then you could modify WarheadsSE script to install Debian , if you'd like.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 12/15/2013 03:34PM by bodhi.
Re: ZyXel NSA325 to run Debian?
December 16, 2013 04:26PM
I'd just love it if I could get source material for the changes Davy's been making to uboots .. we could collaborate and make it work for all the works-for-both-distro devices.

Like getting the V4 to boot sata AND mmc, not one or the other.
Re: ZyXel NSA325 to run Debian?
December 17, 2013 12:21AM
@WarheadsSE,

Davy's uBoot is based on:
https://github.com/psch2/uboot-nsa320

He mentioned that in this thread:
http://forum.doozan.com/read.php?2,7806

I have not tried to compile it. Davy said he added some patch and turned on some scripting capability. But we don't have his patch, so getting Peter's Git source is still not quite exactly the same version that people have been installed.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: