Welcome! Log In Create A New Profile

Advanced

NSA 325 V2 Debian Is Possible!

Posted by Buttzy10169 
Re: NSA 325 V2 Debian Is Possible!
February 17, 2015 05:49PM
Addy,

The kernel installation was successful. It has finished booting. The problem now is with the rootfs. To recover:

- Download and put the 3.17 rootfs on a USB thumb drive.
- Boot and interrupt serial console.
- Temporarily change u-boot env for bootcmd to boot USB first. If not sure how, please list your u-boot envs in serial console here. Don't save your envs.

After booting with USB,

- while in Debian, run e2fsck for your HDD rootfs to fix file system errors, if any.
- Make sure the HDD partition label is still hdd-root.
- Shutdown and remove the USB thumb, then boot back with HDD.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
February 20, 2015 12:31PM
Got it back working :)

Thank you
Maarten
Re: NSA 325 V2 Debian Is Possible!
March 08, 2015 04:35AM
I bought a new nsa325 v2 and followed Hans instructions and it worked.

Maarten

hans Wrote:
-------------------------------------------------------
> Hi, I recently got an nsa-325 so I thought I share
> my experience running debian on it.
> After reading and looking at all the excellent
> work from bodhi, buttzy and others I decided I go
> ahead
> without a serial cable, so I hope its useful:
>
> Procedure to run debian on nsa-325, no need for
> serial cable, no need to open the box,
> no need to interact with u-boot.
>
> # prepare usb stick to boot debian
> Prepare a USB Stick with rootfs / bootfs as from
> bodhi's thread
> I used a SanDisk Cruzer Fit 8GB USB stick which
> seems to be proven to work.
> - Create 2 partitions on the usb stick:
> one small (e.g. 100MB) ext2 filesystem named
> boot
> one ext4 filesystem named rootfs
> - expand the rootfs tar file from bodhi into
> rootfs, I used
> linux-3.16.0-kirkwood-tld-2-bodhi.tar.bz2,
> which I understood is the latest that works with
> stock u-boot, so no flash of u-boot needed.
> - copy files from rootfs /boot to boot filesystem
> - edit etc/fstab in rootfs and adapt filesystem
> type (ext4)
> # usb stick ready to boot debian
>
> # change u-boot env.vars so that debian will be
> booted from usb
> # we can do this from the userspace on nsa-325
> without relying on usb_key_func stuff
>
> telnet to nsa-325 box (I had stock firmware 4.71
> on it), user admin default password 1234
> su root (password 1234)
> execute following commands (put into a script and
> execute):
> (commands taken from usb-debian-uboot.tar.gz)
>
> #
> fw_setenv arcNumber 4495
> fw_setenv mainlineLinux yes
> fw_setenv bootargs_stock 'console=ttyS0,115200
> mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_en
> v),0x80000(key_store),0x80000(info),0xA00000(etc),
> 0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(ker
> nel_2),0x2FC0000(rootfs2) root=/dev/nfs rw
> init=/init'
> fw_setenv bootargs_linux 'console=ttyS0,115200
> mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_en
> v),0x80000(key_store),0x80000(info),0xA00000(etc),
> 0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(ker
> nel_2),0x2FC0000(rootfs2) root=LABEL=rootfs
> loglevel=8'
> fw_setenv bootcmd_linux 'setenv bootargs
> $(bootargs_linux); mw.l f1010100 0020c000; usb
> reset; ext2load usb 0:1 $(loadaddr) /uImage;
> ext2load usb 0:1 0x01100000 /uInitrd; bootm
> $(loadaddr) 0x01100000'
> fw_setenv bootcmd_stock 'setenv bootargs
> $(bootargs_stock); nand read.e $(loadaddr)
> $(kernel_addr) 0xA00000; bootm $(loadadr)'
> fw_setenv to_stock "setenv mainlineLinux no;
> setenv bootcmd \'run bootcmd_stock\'; saveenv;
> reset"
> fw_setenv to_linux "setenv mainlineLinux yes;
> setenv bootcmd \'run bootcmd_linux\'; saveenv;
> reset"
> fw_setenv bootcmd 'run to_linux'
> #
>
> # boot env vars now correctly setup in uboot-env
> flash block
> now (just to be on safe side), execute fw_printenv
> and doublecheck vars
>
> now plug the usb stick into nsa-325 (rear usb-1
> connector)
> reboot
>
> # nsa-325 should now boot into debian, using dhcp
>
> locate IP address on router, ssh to nsa-325 box
> with root and password root
> success :-)
>
> Of course for eventual troubleshooting the serial
> cable will be needed, but
> it looks like if sticking to instructions closely
> this is not mandatory for initial setup.
>
> hans
qwerkus
Re: NSA 325 V2 Debian Is Possible!
April 01, 2015 04:50PM
Just successfully booted jessie on my nsa325 v2 - works great! A few question though:
- How to change powermanagement ? My drives spin forever without any use.
- How to change fan speed ?
- Perhaps a good tutorial to setup samba for cross win/linux shares ?

Thank you so much for your work;
qwerkus
Re: NSA 325 V2 Debian Is Possible!
April 01, 2015 09:41PM
qwerkus Wrote:
-------------------------------------------------------
> Just successfully booted jessie on my nsa325 v2 -
> works great! A few question though:
> - How to change powermanagement ? My drives spin
> forever without any use.

If it is the main drive with rootfs on it, then it's not possible to put it to sleep. There is a way but it's ugly, and pointless for a rootfs drive.

> - How to change fan speed ?

We can't change the fan speed (hardware related).

> - Perhaps a good tutorial to setup samba for cross
> win/linux shares ?

I think Google will give the best instruction out there in the Internet!

-bodhi
===========================
Forum Wiki
bodhi's corner
qwerkus
Re: NSA 325 V2 Debian Is Possible!
April 02, 2015 02:02AM
Thank you for your quick reply. According to this site http://zyxel.nas-central.org/wiki/Fan_control_%28NSA325%29 the stock firmware has a deamon for hw monitoring stuff. Would it be possible to use it with your debian build ?
Re: NSA 325 V2 Debian Is Possible!
April 02, 2015 02:13AM
qwerkus Wrote:
-------------------------------------------------------
> Thank you for your quick reply. According to this
> site
> http://zyxel.nas-central.org/wiki/Fan_control_%28N
> SA325%29 the stock firmware has a deamon for hw
> monitoring stuff. Would it be possible to use it
> with your debian build ?

I saw that page before but have not tried it. I do plan to do that but have not got around to do so. It should work, since i2c is supported in the my kernel build. If you do try, let us know the result!

-bodhi
===========================
Forum Wiki
bodhi's corner
qwerkus
Re: NSA 325 V2 Debian Is Possible!
April 02, 2015 02:25AM
ok, will do. Is it possible to access the stock firmware with debian (locate the flash mem, an extract it to a mountable disk) ? This would help me a lot figuring out the hw deamon and also the stock mdadm settings - as I don't want to reformat my drives.
Re: NSA 325 V2 Debian Is Possible!
April 02, 2015 03:28AM
qwerkus Wrote:
-------------------------------------------------------
> ok, will do. Is it possible to access the stock
> firmware with debian (locate the flash mem, an
> extract it to a mountable disk) ? This would help
> me a lot figuring out the hw deamon and also the
> stock mdadm settings - as I don't want to reformat
> my drives.

You could either boot back to stock and copy the binary from there , or mount the rootfs mtd in Debian and copy it.

-bodhi
===========================
Forum Wiki
bodhi's corner
qwerkus
Re: NSA 325 V2 Debian Is Possible!
April 04, 2015 12:08PM
After some extensive testing, I decided to drop the zyxel app_wd. I don't know for sure what's wrong/not working, but since I moved to debian, and performed the latest package update, my NAS ist working BETTER than with the zyxel firmware. Fan control ist automatic (probably hardware controlled), and works very well. But mostly my drives are much quieter, and up to 27% faster since I dropped mdadm, and moved to a simple NFS/Samba solution. So thanks again Bodhi for your work, this thing now rocks.
I keep wondering myself though: why would a company like zyxel distribute a sofware that makes the NAS worse/slower than an out-of the box debian installation ?
Re: NSA 325 V2 Debian Is Possible!
April 04, 2015 03:19PM
qwerkus,

> I keep wondering myself though: why would a
> company like zyxel distribute a sofware that makes
> the NAS worse/slower than an out-of the box debian
> installation ?

Easy answer: business decision. Most of their software already exists, and the decision usually how to maximize profit and lower cost. So usually these NAS boxes get older kernel and boot loader, just good enough for the price they sell to normal consumers. But when we go under the hood, we can usually see how to make it perform to its potentials, software and hardware wise. Prime examples: the Pogo Pro/Classic with a hidden SATA port, and NSA325 running kernel Linux-2.6.31.8.

-bodhi
===========================
Forum Wiki
bodhi's corner
qwerkus
Re: NSA 325 V2 Debian Is Possible!
April 05, 2015 06:56AM
Anyone interested into Fan and Temperature monitoring, plus HDD usage, here is my startup script - works pretty well:

Fist you need i2c-tools:

# apt-get install i2c-tools

Than a custom little script that reads the 2 values we are interested in (fan/tempspeed):

#!/bin/bash
echo "Temperature" $(($(i2cget -y 0x0 0x0a 0x07))) "C"
echo "Fanspeed" $[60000/$(($(i2cget -y 0x0 0x0a 0x08)))] "RPM"
exit 0

I saved it under /usr/bin/hwmon, and added +x (exec) rights

chmod +x /usr/bin/hwmon

And finally put this in your .bashrc file:

echo "" # for spacing
date # because I like to montior systime
hwmon # our script!
echo "" 
df -h -x tmpfs -x udev # disk usage, minus def and swap
echo ""

An while we are at it, some nice prompt colors:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

Oh, and for fun, a nice /etc/motd (you can cp/paste)
		+-+-+-+-+-+-+-+-+-+-+-+-+
		|D|e|b|i|a|n| |Z|y|x|e|l|
		+-+-+-+-+-+-+-+-+-+-+-+-+

Et voila! Every time you ssh login to the zyxel box, you have all the infos you needed right there.
Re: NSA 325 V2 Debian Is Possible!
April 05, 2015 04:26PM
qwerkus,

Nicely done! thanks for sharing your script. Here is another fun one: Linux Logo.
http://forum.doozan.com/read.php?2,12096,15906#msg-15906

-bodhi
===========================
Forum Wiki
bodhi's corner
qwerkus
Re: NSA 325 V2 Debian Is Possible!
April 08, 2015 03:13AM
Hi Bodhi, are your instructions from page one of thie thread to enable the power button still working ? Would be nice to be able to shut down the device without having to log in!
Re: NSA 325 V2 Debian Is Possible!
April 08, 2015 04:00AM
qwerkus Wrote:
-------------------------------------------------------
> Hi Bodhi, are your instructions from page one of
> thie thread to enable the power button still
> working ? Would be nice to be able to shut down
> the device without having to log in!

It was not my instruction. Also, davidedg has instruction for esekeyd at his GitHub which I think is better approach.

BTW, the script above to monitor temp and fan speed should not be executed from ~/.bashrc, the better place is ~/.profile.

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



Edited 1 time(s). Last edit at 04/08/2015 04:15AM by bodhi.
qwerkus
Re: NSA 325 V2 Debian Is Possible!
April 09, 2015 01:56AM
Thank you very much: works like a charm. I'm experimenting with LEDs to play a custom sequence at shutdown :) Also, what's the difference between .profile and .bashrc ?
Re: NSA 325 V2 Debian Is Possible!
April 09, 2015 03:54AM
qwerkus Wrote:
-------------------------------------------------------
> Thank you very much: works like a charm. I'm
> experimenting with LEDs to play a custom sequence
> at shutdown :) Also, what's the difference between
> .profile and .bashrc ?

.bashrc with a lot of output will cause some problem when you connect with something that spawns a non-login shell and processes the output coming back, e.g. rsync. .profile is executed when a user logs in.

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



Edited 1 time(s). Last edit at 04/09/2015 03:55AM by bodhi.
qwerkus
Re: NSA 325 V2 Debian Is Possible!
April 30, 2015 08:40AM
Hi Bodhi; thank you for your work on kernel 4.0. Is there any point to upgrade for simple nfs/samba sharing ? Also, is hwmon now helpful on the nsa325v2 ?
Re: NSA 325 V2 Debian Is Possible!
April 30, 2015 09:08AM
Hi qwerkus,

There is no need to upgrade for nfs/samba, those were already in kernel 3.18.x or earlier. hwmon is not helpful on NSA325v2, it is not used (iirc I've checked this before).

Also, USB 3.0 is not working on 4.0.0-kirkwood-tld-1 (mainline kernel regression). I will release version 4.0.0-kirkwood-tld-2 soon that fixes this problem.

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



Edited 1 time(s). Last edit at 04/30/2015 09:09AM by bodhi.
Re: NSA 325 V2 Debian Is Possible!
May 01, 2015 12:59PM
Bodhi,

you are the best!
Re: NSA 325 V2 Debian Is Possible!
May 01, 2015 10:23PM
You're welcome addy! glad it works well for you.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
July 16, 2015 10:35AM
Hi happy nsa325 owners,

I'm having some troubles enabling netconsole
( http://forum.doozan.com/read.php?3,12381,22699#msg-22699 )

Is netconsole working for anyone with NSA325v2 and latest bodhi's u-boot (-tld-3) ?
If so, can you post some details about configuration (printenv, if connected to a switch or hub, etc.) ?

I'm just trying to confirm that it's not a problem with u-boot itself but with my cfg.

Thank you!

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod
qwerkus
Buzzer ?
July 19, 2015 10:45AM
Hi bodhi,

did you manage to used the device's buzzer (with beep or something else); I'm trying to setup a voip server, and it would be nice to have some kind of sound :)

Thank you for your work,

qwerkus
Re: Buzzer ?
July 19, 2015 02:04PM
Hi qwerkus,

No, I have not tried that.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Buzzer ?
July 19, 2015 03:54PM
Hi,

has anybody of the NSA325 owners here in this thread already used the kirkwood thermal monitor,
which is part of newer kernels since this patch:

http://www.spinics.net/lists/arm-kernel/msg211570.html

Once enabled (CONFIG_KIRKWOOD_THERMAL), the inclusion of kirkwood-6282.dtsi in the nsa325 dts file automatically provides the following information to describe how the SoC temperature sensor is supported (register, driver, status)

    thermal@10078 {
            compatible = "marvell,kirkwood-thermal";
            reg = <0x10078 0x4>;
            status = "okay";
    };

if this is working, there would be an alternative to get the temperature of the soc with i2cget commands
from the mcu,

after make menuconfig in the 4.1 source tree and setting CONFIG_KIRKWOOD_THERMAL=m the config
has some more entries, see below:

has anybody tested this already successfully?

best wishes pbg4

p.s. the temperature is in milliseconds according to this interesting blog (scroll down to 3.8 Temperature sensor ):

http://natisbad.org/NAS/

CONFIG_THERMAL=m
CONFIG_THERMAL_HWMON=y
CONFIG_THERMAL_OF=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set
# CONFIG_THERMAL_GOV_FAIR_SHARE is not set
CONFIG_THERMAL_GOV_STEP_WISE=y
# CONFIG_THERMAL_GOV_BANG_BANG is not set
# CONFIG_THERMAL_GOV_USER_SPACE is not set
# CONFIG_THERMAL_EMULATION is not set
CONFIG_KIRKWOOD_THERMAL=m



Edited 1 time(s). Last edit at 07/19/2015 03:55PM by pbg4.
Re: Buzzer ?
July 19, 2015 04:23PM
Hi pbg4,

> if this is working, there would be an alternative
> to get the temperature of the soc with i2cget
> commands
> from the mcu,

You meant this config will enable the kernel builtin thermal sensor? Instead of using i2cget commands like this:

echo "CPU Temperature" $(($(sudo /usr/sbin/i2cget -y 0x0 0x0a 0x07))) "C"

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Buzzer ?
July 20, 2015 02:00AM
Hi bodhi,

yes, exactly; and the internal temperature sensor than also has support from lm-sensors,..
in the links posted above someone also claimed that the internal thermal sensor of the 6282 soc is mentioned
in the public part of the datasheet,..

best wishes pbg4
Re: Buzzer ?
July 20, 2015 03:02AM
Hi pbg4,

On my iConnect, the current kernel (4.1.0-tld-1) lm63 module did not need CONFIG_KIRKWOOD_THERMAL to work correctly with lm-sensors (which I believe using sysfs since a few versions ago).

Jul 19 18:12:55 tldDebian daemon.info sensord: Chip: lm63-i2c-0-4c
Jul 19 18:12:55 tldDebian daemon.info sensord: Adapter: mv64xxx_i2c adapter
Jul 19 18:12:55 tldDebian daemon.info sensord:   temp1: 48.0 C
Jul 19 18:12:55 tldDebian daemon.info sensord:   temp2: 47.5 C (min = 0.0 C, max = 70.0 C)


> that the internal thermal sensor of the 6282 soc
> is mentioned
> in the public part of the datasheet,..

But this part about 6282 is interesting. I'll build 4.1.0-tld-2 with this and see if it'll work on the NSA325.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Buzzer ?
July 20, 2015 01:54PM
Hi bodhi,

yes, the lm63 module does not need CONFIG_KIRKWOOD_THERMAL to work with lm-sensors,
it is identified and connected over i2c, my email was meant primarily for owners of the NSA325, so they can test the internal thermal sensor of the 6282 soc,

on the iConnect all information comes from the lm63 temp sensors and its module attached via i2c,
at adress 0x4c,

but if you compare iConnect and NSA320 on the i2c bus 0 where the internal adresses reside,

0x51 is connected to the rtc on NSA320 and iConnect 0x4c for the lm63, both have in common adress
64, which I can not identify so far, perhaps there is also an internal sensor in the 6281 soc,
docs are not available so far, only under NDA,.. see below the i2c listings,

best wishes pbg4

NSA320 i2c:

root@debian-jessie:~# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

iConnect i2c:

root@iconnect:~# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --



Edited 2 time(s). Last edit at 07/20/2015 02:00PM by pbg4.
Re: Buzzer ?
July 20, 2015 03:07PM
pbg4.

Interesting! thanks for the info. I really not paying close attention to sensors at all (never have the needs).

And BTW the 6281 HW specs doc is available, the 6282 is still under NDA.

-bodhi
===========================
Forum Wiki
bodhi's corner
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: