Welcome! Log In Create A New Profile

Advanced

NSA 325 V2 Debian Is Possible!

Posted by Buttzy10169 
Greg
Re: NSA 325 V2 Debian Is Possible!
May 22, 2014 09:20AM
Hi, Does anyone else have the problem with booting after a power loss or a 'shutdown -h now'? My NSA325v2 reboots (at the time of ethernet initialisation or pretty soon after that) and does that until I restart to_stock and then back to_linux again. This is behaviour I've observed with bodhi's linux-3.14.0-kirkwood-tld-2 and tld-1 kernels. The issue does not seem to apply to Arch Linux with 3.14 kernel, but I of course prefer Debian. Thanks!
Re: NSA 325 V2 Debian Is Possible!
May 22, 2014 10:36AM
Greg,

I think I've read something similar on this:
http://archlinuxarm.org/forum/viewtopic.php?f=27&t=3851

Does it change behaviour if eth cable is plugged or not and if switch is 100Mbps or 1Gbps ?


Also, I derived my kernel config for my Debian install both from Bodhi's (for the patches) and from Arch's (for the config), trying to leave out all not strictly needed.
You may want to give it a try (it's the MACH one, not the FDT one):
https://github.com/davidedg/NAS-NSA325-mod/tree/master/kernel

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod



Edited 1 time(s). Last edit at 05/22/2014 03:34PM by davidedg.
Re: NSA 325 V2 Debian Is Possible!
May 22, 2014 03:31PM
Greg,

> Hi, Does anyone else have the problem with booting
> after a power loss or a 'shutdown -h now'? My
> NSA325v2 reboots (at the time of ethernet
> initialisation or pretty soon after that) and does
> that until I restart to_stock and then back
> to_linux again. This is behaviour I've observed
> with bodhi's linux-3.14.0-kirkwood-tld-2 and tld-1
> kernels. The issue does not seem to apply to Arch
> Linux with 3.14 kernel, but I of course prefer
> Debian. Thanks!

Do you have serial console connected?

-bodhi
===========================
Forum Wiki
bodhi's corner
Greg
Re: NSA 325 V2 Debian Is Possible!
May 22, 2014 05:31PM
Thanks very much, I will try to buld it later on. The issue is probably caused by the watchdog, reboots occured regardless of drivers / services enabled. I found that 3.12 kernel works fine. G
Greg
Re: NSA 325 V2 Debian Is Possible!
May 23, 2014 12:06PM
bodhi Wrote:

> > after a power loss or a 'shutdown -h now'? My
> > NSA325v2 reboots (at the time of ethernet

> Do you have serial console connected?

Yep. Is it any use (apart from accessing bootloader)? Thanks
Re: NSA 325 V2 Debian Is Possible!
May 23, 2014 01:31PM
You'd be able to watch what is actually happening/how much progress is occurring.
Greg
Re: NSA 325 V2 Debian Is Possible!
May 25, 2014 07:57AM
WarheadsSE Wrote:
-------------------------------------------------------
> You'd be able to watch what is actually
> happening/how much progress is occurring.

That as maybe. Tried disabling stuff, but reboots persisted. Is there any parameter I could add (to the bootloader command?) to see all kernel messages during the boot? I'd happily diagnose the issue. Cheers.
Re: NSA 325 V2 Debian Is Possible!
May 25, 2014 12:32PM
Not without a serial cable.
Re: NSA 325 V2 Debian Is Possible!
May 25, 2014 02:47PM
Greg,

Usually netconsole will give you lot of kernel messages, but not everything. So serial console is needed to troubleshoot problem like this. And also if you're running stock U-Boot, I don't recall if netconsole is availale either. The NSAxx series is quite easy to hook up serial console.

-bodhi
===========================
Forum Wiki
bodhi's corner
Greg
Re: NSA 325 V2 Debian Is Possible!
May 26, 2014 09:43AM
bodhi Wrote:

> Usually netconsole will give you lot of kernel
> messages, but not everything. So serial console is
> needed to troubleshoot problem like this. And also

If you mean the console connected through a ttl header inside the box, then yes I have it connected. I fail to notice any *interesting* messages before the reboot itself. It looks like the reboot always occurs after a certain time the box has been powered on for. If I disable most of services then it fully boots and allows to log in, although it still reboots in a short moment. As already mentioned, 3.12.0-kirkwood-tld-5 compiled by you does not suffer from this condition. Cheers.
Re: NSA 325 V2 Debian Is Possible!
May 26, 2014 04:22PM
Bodhi, did you miss anything with moving up to the 3.14 kernel? Because Greg is right, this has not been an issue on any of my Arch kernels, and I did all the magic for that damned MCU via PHY myself.
Re: NSA 325 V2 Debian Is Possible!
May 26, 2014 05:09PM
@WarheadsSE & Greg,

I'll have to look at the patch/config. I don't recall my patch set changed at all in the first release 3.14.0-kirkwood-tld-1. However, I've added quite a bit more in 3.14.0-kirkwood-tld-2 for pbg4's DVB patch and other minor things.

@Greg, did you try 3.14.0-kirkwood-tld-1 kernel? or just 3.14.0-kirkwood-tld-2?

Update:

Looks like I was wrong, there were more patch added between 3.12.0-kirkwood-tld-5 and 3.14.0-kirkwood-tld-1.

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



Edited 1 time(s). Last edit at 05/26/2014 05:45PM by bodhi.
Re: NSA 325 V2 Debian Is Possible!
May 26, 2014 06:12PM
@Greg,

Please try kernel 3.14.0-kirkwood-tld-1. Apparently, I've screwed up :) with kernel 3.14.0-kirkwood-tld-2 regarding the NSAxx sensors. Sorry about that, must have been a latenight :)

I'll release kernel 3.14.x-kirkwood-tld-3 when I have time to do it.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
May 27, 2014 01:43PM
bodhi Wrote:
-------------------------------------------------------
> Apparently, I've screwed up :) with kernel
> 3.14.0-kirkwood-tld-2 regarding the NSAxx sensors.

Bodhi, you sure? I tried a diff on the 2 files:
colordiff config-3.14-kirkwood-tld-1 config-3.14-kirkwood-tld-2
33c33
< CONFIG_LOCALVERSION="-tld-1"
---
> CONFIG_LOCALVERSION="-tld-2"
352a353
> CONFIG_MACH_NETGEAR_MS2110=y

and that's all.

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod
Re: NSA 325 V2 Debian Is Possible!
May 27, 2014 02:42PM
DavideDG,

I was not sure. But when I looked at my .config in the build directory, the Sensors NSAxx was removed (accidentally) somehow. So I just want to make sure that people who uses the NSAxx don't run into problem.

But you're right, the released kernel config was OK. I looked at what actually installed in /boot and saw the diff was exactly what you saw. But in any case, the changes from tld-1 to tld-2 were very specific (Netgear and DVB drivers), so I will just build version tld-3 with later minor version of 3.14.

Do you experience any of the problem that Greg is seeing?

Thanks for confirming that I did not messe up after all :)

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
May 27, 2014 02:58PM
bodhi Wrote:
-------------------------------------------------------

> Do you experience any of the problem that Greg is seeing?
Actually, I've never used your _compiled_ version, as my building system is quite different.
I can confirm, though, that the .config you provided generates fully functional 3.14.2 and 3.14.3 kernels, with no reboots whatsoever.

@Greg: if you're still experiencing this problem, I suggest you try recompile 3.14.3 using Bodhi's config (-tld1 or -tld2 should not make differ)

> Thanks for confirming that I did not messe up after all :)
Busy nights for all hardcore-nas-modders ;P me currently struggling with bluez on nas, what a nightmare!

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod
Greg
Re: NSA 325 V2 Debian Is Possible!
May 28, 2014 04:46AM
bodhi Wrote:

> @Greg, did you try 3.14.0-kirkwood-tld-1 kernel?
> or just 3.14.0-kirkwood-tld-2?

I've had the same problem with 3.14 tld-1 and tld-2 that's why I installed 3.12 (read somewhere it caused fewer issues). I will try compiling newer version, as suggested by davidedg, and share results, although I havent tried cross-compiling yet. I know it takes ages to build using this small ARM. Thanks for your feedback. G
Re: NSA 325 V2 Debian Is Possible!
May 28, 2014 09:20AM
Well, considering that the board bring up should be disabling the watchdog (via the PHY pre-init), and NOT the hwmon module, I would not expect a missing i2c module to cause reboots "via" the watchdog.
Re: NSA 325 V2 Debian Is Possible!
May 28, 2014 12:56PM
Greg Wrote:
-------------------------------------------------------
> although I havent tried cross-compiling
> yet. I know it takes ages to build using this
> small ARM. Thanks for your feedback. G

Greg, just a starter for CodeSourcery:

https://sourcery.mentor.com/GNUToolchain/doc16565/getting-started.pdf

Linux ia32 installer: https://sourcery.mentor.com/GNUToolchain/package11444/public/arm-none-eabi/arm-2013.05-23-arm-none-eabi.bin
Linux ia32 tar: https://sourcery.mentor.com/GNUToolchain/package11442/public/arm-none-eabi/arm-2013.05-23-arm-none-eabi-i686-pc-linux-gnu.tar.bz2


I took time to recompile v3.14.3 with tld-2, here's a tar with uImage and modules if you want a quick try:
It does not boot on mine (i think because of very different initramfs system), and I can't hook up serial right now, but if you want to try...

https://dl.dropboxusercontent.com/u/45458088/v3.14.3-bodhi-tld2.tar.bz2

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod
Re: NSA 325 V2 Debian Is Possible!
May 28, 2014 02:41PM
Davide & Greg,

Perhaps you can try to put my basic roofts Debian-3.14.0-kirkwood-tld-1 on a stick, and boot it to see if the problem is the same?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
May 28, 2014 02:54PM
Bodhi,

here are 2 serial bootlogs, 1 with eth cable and the other without, both working.

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod



Edited 2 time(s). Last edit at 05/29/2014 12:19PM by davidedg.
Attachments:
open | download - nsa325_serialbootlog_tld-1_eth-nocable.txt (25 KB)
open | download - nsa325_serialbootlog_tld-1_eth-up.txt (25.2 KB)
Re: NSA 325 V2 Debian Is Possible!
May 29, 2014 02:36PM
Thanks Davide,

I did not realize you've updated your post until now :) Was that with the basic rootfs?

Update:

I recognized that this was with the basic rootfs, Thanks!

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



Edited 3 time(s). Last edit at 05/29/2014 02:40PM by bodhi.
Re: NSA 325 V2 Debian Is Possible!
May 29, 2014 02:46PM
@Greg,

Perhaps something in your local network/serial confiuration that has indirectly caused this reboot issue, as davidedg mentioned above? the basic rootfs is working without this problem, therefore the kernel is working fine.

-bodhi
===========================
Forum Wiki
bodhi's corner
Greg
Re: NSA 325 V2 Debian Is Possible!
May 30, 2014 06:27AM
davidedg Wrote:

> [url=https://sourcery.mentor.com/GNUToolchain/doc1
> 6565/getting-started.pdf]https://sourcery.mentor.c
> om/GNUToolchain/doc16565/getting-started.pdf[/url]

Thanks for the guide. At the moment stuck with a stock Debian kernel, but will try to sort it out today.

6683075 bytes read
## Booting image at 02000000 ...
Image Name: Linux-3.14.4-rt5-tld-5
Created: 2014-05-30 10:59:07 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 6647544 Bytes = 6.3 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Re: NSA 325 V2 Debian Is Possible!
June 01, 2014 05:13AM
Hi, I managed to compile the "Linux debian 3.14.4-rt5-tld-1" kernel (and ramdisk) using bodhi's patch and config. It switches on and off awrite, also iSCSI target module added. I post a link if needed.

https://drive.google.com/folderview?id=0B2deHfk8TFf6U19OUmY2OUZpMWM&usp=sharing

Thank you all for the support and guides, helped me a lot.
G.
kao
Re: NSA 325 V2 Debian Is Possible!
June 10, 2014 01:43PM
Hi all,
after reading all 5 pages of this thread, and most of related threads, I still have one question - how hard it is to get Debian running on NSA325v2? Or, better yet - will I be able to do that? Is there some short summary of the steps I would need to take?

I'm currently using an old QNAP NAS and have installed Debian on it. So, I know how to do basic Linux tasks. I probably would be able to attach serial console should it be necessary. But I don't have skills to compile my own kernel or debug issues with hardware components on Linux.

Just as an example, the initial instructions in the first post "in uboot type resetenv then reset the device" confuse me. How would I do get "in uboot"? Maybe the question sounds silly to you, but I really can't figure it out by just reading this thread (haven't bought the actual device yet, as with stock firmware it won't fit my requirements).

Thanks for reading,
kao.
Re: NSA 325 V2 Debian Is Possible!
June 10, 2014 02:06PM
kao Wrote:
-------------------------------------------------------

> how hard it is to get Debian running on NSA325v2?
> Or, better yet - will I be able to do that?
Since you already installed Debian on QNAP NAS, I think you already know pretty much of the hard stuff.

> I probably would be able to attach serial console should it be necessary.

I definitely suggest to have one ready as it simplifies a lot the debug.
I personally bought mine from e*Bay, it's a PL2303 serial 3.3 ttl usb.

> But I don't have skills to compile my own kernel

Thanks to Bodhi, it's not really needed: he already set up both a working Kernel and RootFS.
I can report that ArchLinuxArm works, too... but I still prefer Debian :D

> Just as an example, the initial instructions in the first post "in uboot type resetenv then reset
> the device" confuse me. How would I do get "in uboot"?

U-Boot it's the boot loader program of many NAS/embedded devices.
It resides on NAS flash storage (usually on initial blocks)
There exist "stock" and "upstream" versions: stock are the ones customized by the Vendor - so there exist "Marvel U-boot", "Lacie U-boot", etc - while native are re/compiled version of upstream version which support a broader range of features (eg: scripting, reliable usb booting, etc).

So to get "in uboot" [console], you generally need a serial cable, while you may use also a network console (upstream has support for it, some stock versions, too - eg Lacie's).
U-boot "environment" describe how and where it should boot from (usb, ide, flash, etc).
You can change env. from within u-boot console itself, or from OS (but if you may brick it and end up needing a serial cable).


> (haven't bought the actual device yet, as with stock firmware it won't fit my requirements).

No doubts, but it surprises me that a QNAP user hungers for more... maybe I just overvalued those devices?

Bye!

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod
kao
Re: NSA 325 V2 Debian Is Possible!
June 11, 2014 04:31AM
@davidedg: Thanks for the response!

>it surprises me that a QNAP user hungers for more... maybe I just overvalued those devices?
It's a *really* old QNAP TS-109. It was an excellent device 7 years ago, but now I'm running out of disk space and 330MHz CPU just doesn't cut it anymore.

>Since you already installed Debian on QNAP NAS, I think you already know pretty much of the hard stuff.
In my opinion QNAP (and also DLink/Lacie) have more "non-Linux-hacker friendly" instructions on how to install Debian. This thread probably has all the necessary information, but it's quite overwhelming and confusing at first.

USB to TTL converter ordered, now I just need the NAS and lots of luck.. Fingers crossed!
Re: NSA 325 V2 Debian Is Possible!
June 11, 2014 10:07AM
@kao

I guess I know your situation pretty well. I was also rather skeptical of my skills and getting all this to work; just check my first post on page 4... And to be honest, the information in this thread is anything but easily accessible. In the this post, I'll try to outline the steps to get NSA325v2 to run Debian. In the end it's not as complicated as it first looks :)

DISCLAIMER - I already did this to my NSA325v2 a while ago so I couldn't confirm whether the procedure works as a "fresh install". However, I tried to recall everything I had problems with and cover them as well I could. Furthermore, I am by no means an expert with these things so I take no responsibility if you manage to break something due to an error in this "guide".

If anyone spots any errors in my post, please point it out so I can fix it, thanks :)


1. Prerequisites

The USB-to-UART adapter is a must. As I found out here the serial header on the NSA325v2 is a 3.3 volt one. This means you risk damaging it if you interface it with an adapter with 5 V logic levels. The only way to make sure an adapter is compatible is to check the datasheet of the main chip. Personally I bought one with the CP2102 chipset from Ebay.

My perception is that you cannot (or no easy way exists to) install a custom OS onto the SATA-drives if you want to have them configured as a RAID array. Therefore, you need a USB-drive from which Debian will boot. In this thread, there has been discussion about incompatibility of certain brands so I bought a SanDisk Cruzer Fit 16 GB as recommended.


2. Preparations

I - Serial connection
Open the casing and install the ribbon cable. You'll need some small Phillips screwdrivers. After undoing the two screws on the bottom side you'll need to carefully bend the larger half of the casing to slide it past the HDD rack. Disassembling the rest is quite straightforward.

In order to have access to the serial console even after reassembling the casing I routed the cables out of the back next to the USB ports. This required a bit of deforming the USB port shielding with pliers. If you have a longer cable I'd suggest using the other openings eg. the one for Kensington lock.

Pay attention to the header pinout. I assume at least RX, TX and GND have to be connected. I have 3V3 as well. RX and TX need to be cross-connected with each other - assuming the silkscreen on your USB adapter is correct. The first thing to check - if you see no output in the serial console - is this!

Ensure you have the necessary drivers installed for the adapter and some piece of software with which to communicate over the serial connection. At least the newer Linux kernels are likely to ship with drivers for any common USB-to-TTL chips but on Windows you probably have to find and install them yourself.

On Linux you can check if the system recognises your adapter by looking for something like 'ttyUSB0' in the '/dev' directory while plugging the device in and out.

Personally I use a program called 'screen' on a Debian desktop terminal emulator. I've read somewhere that on Windows, Putty should work after configuring the serial ports correctly.

II - USB drives
Follow the procedure described by Buttzy in the first post of this thread:

On your OS drive (in my case it's the Cruzer Fit) create two partitions of which the first must be ext2, flagged as bootable, and labelled "boot". It'll only hold the boot files so 100 MiB should be enough. The second, main partition must be labelled "rootfs" and can be formatted as whatever(?*) file system you want - I use ext4.

Download and extract Bodhi's latest rootfs (not kernel!) to the main partition according to the guidelines given in the corresponding thread. Then copy(?**) the contents of the '/boot' directory to the root of the first partition.

On a separate USB-stick (formatted as fat32) extract the files from 'usb-debian-uboot.tar.gz' aquired from the first post.


3. Box configuration

Insert the fat32-formatted USB drive into one of the USB-ports on the back*** of the NSA325.

Plug in your USB-TTL adapter and open the serial connection. Personally I do this on Linux by opening a terminal emulator and issuing
$ sudo screen /dev/ttyUSB0 115200
where /dev/ttyUSB0 is the adapter device file and 115200 is the baud rate of the connection.

Now power up the box and watch for a message like "Press any key to to stop auto-boot" in the serial console. As it appears press a key and you should get the U-boot command prompt denoted by "Marvell>>". In the prompt type as Buttzy instructs:
Marvell>> resetenv
Marvell>> reset

< The device resets itself. Press a key to get into the U-Boot prompt again. >

Marvell>> saveenv
Marvell>> reset

Let the device reboot normally. It should reboot itself once again and write the new U-Boot configuration to the NAND. After this point it searches for USB-partitions to boot from at start-up. In order to switch between stock and custom OS supply commands "run to_stock" or "run to_linux" correspondingly in the U-Boot command prompt.

If the USB-drive containing Debian isn't plugged to the box - as it shouldn't be - you'll see a "Bad magic number" error message in the serial console and the device will reset itself. To stop the reboot loop enter the U-Boot prompt and power down the box by removing the power supply. Remove the utility USB-drive and insert the one containing your OS. Re-plugging the power should cause the device to start and if everything goes right it should now boot Debian.

You can log in through the serial console with the default credentials. From here you should probably go for configuring the network interfaces and SSH so you can drop the serial connection.

Good luck!

* This probably depends on the file system support of U-Boot.

** I'm not sure if it's necessary to leave the files on the "rootfs" partition but at least copying seems to work for me.

*** As someone pointed out earlier, the USB3 port in the front panel won't work.



Edited 2 time(s). Last edit at 06/11/2014 10:12AM by SPuntte.
Re: NSA 325 V2 Debian Is Possible!
June 11, 2014 11:00AM
SPuntte Wrote:
-------------------------------------------------------
> My perception is that you cannot (or no easy way exists to) install a custom OS onto the
> SATA-drives if you want to have them configured as a RAID array.

Haven't really tried on NSA325 because I just own 1 drive, but it should work. I made it work on Lacie NS2MAX, though.
Only 3 requirements for this should be:
- Kernel configured with CONFIG_MD=y CONFIG_MD_AUTODETECT=n CONFIG_MD_RAID1=y
- Initramfs/Initrd able to initialize rootfs with mdadm
- If you also want boot partition on raid1, I found that you must initialize MD device with --metadata=0.90, otherwise U-Boot won't recognize the fs.


Also, how do you guys manage the FAN on the NSA325? I didn't check lately, is it automatic in the kernel module ?

--
DavideDG
My NAS userspace configs
My Zyxel NSA325 mod
My D-Link DNS325 mod
My Lacie NS2MAX mod



Edited 1 time(s). Last edit at 06/11/2014 11:05AM by davidedg.
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: