Linux distro on NSA325

Install Arch Linux ARM on other devices.

Linux distro on NSA325

Postby astrakid » Tue Dec 25, 2012 1:14 pm

Hi
I recently got a NSA325 by Zyxel.
My goal is to have asterisk (including SpanDSP), MPD (including audio-usb-hardware), Nagios and Samba running. I don't need any RAID-capabilities, because i will do this via scheduled rsyncs.
My questions are the following:
1. Is it possible to run Linux (e.g. Archlinux) from a usb-drive? I would like to see the harddrives going to sleep, which wouldn't be possible, if Linux is located on the hdd?
2. do I need a serial cable only if an error occurs by installing uboot?
3. Can I reuse the script for NSA310/NSA320?

thanks in advance, merry christmas and kind regards,
astrakid
astrakid
 
Posts: 14
Joined: Tue Dec 25, 2012 1:05 pm

Re: Linux distro on NSA325

Postby prokrypt » Fri Dec 28, 2012 2:49 am

Hello astrakid! I shall attempt to answer your questions...

1) it would be possible to have the kernel on the hard drive, and root on usb. However, that shouldn't be required for the drive to sleep. If you tweak the system right (using tmpfs, moving frequently-accessed files to tmpfs, "preloading" files, etc...), hard disk access will be kept to a minimum. the NSA325 has a lot of memory, so that helps a lot too.

2) A serial cable is highly recommended. My first time ever using a serial console was with my Zyxel NSA325 & a failed Archlinux install--never needed it with my Pogoplug and headless Raspberry Pi. I didn't have a serial/TTL cable, so I wired up my Raspberry Pi to the NSA325 8-)

3) I used that NSA310/NSA320 script too. I replaced all instances of "ext3" with "ext4", since I figured out my stock firmware did not have mkfs.ext3. For some reason, the script didn't run automagically, so I telnet'd in and ran it manually (after fixing some path in the script). One thing I forgot though was to change "ro" to "rw" in the "fw_setenv bootargs_linux" line, and got myself a pretty flood of messages in my serial console along with no network/ssh (see
http://archlinuxarm.org/forum/viewtopic.php?t=4727&p=25829).

Oh, also: watch out for that watchdog timer. If yours has it, then you NEED a serial cable. Otherwise, after a cold boot you'll just get into a watchdog-induced boot-loop and have no way to get back to stock. When the watchdog resets the system, your hard drives will power-cycle too--I winced every time it happened to me :shock:
I sure hope someone can figure out this mv88f6281_wdt watchwoofy soon...
prokrypt
 
Posts: 31
Joined: Thu Dec 27, 2012 4:45 am

Re: Linux distro on NSA325

Postby astrakid » Fri Dec 28, 2012 8:50 am

hi,
thanks for your reply.

1) even if the hdd-access is minimized, it will resume from sleep everytime i will change something, and i am playing a lot. ;-) i still prefer having everything on a usb drive. is there no way to accomplish this?

2) is already ordered, but since i don't need the device in its current state i could already try a bit... ;) the cable should arrive in about 1,5 weeks.

3) that means: exchange ext3 by ext4, ro by rw and it should work? have ony to find out how to move everything to usb... ;)

so the watchdog timer is an open issue, right? can i check beforehand if the wdog exists on my nsa325? i guess it is visible in process list with the name as you wrote?

regards,
astrakid
astrakid
 
Posts: 14
Joined: Tue Dec 25, 2012 1:05 pm

Re: Linux distro on NSA325

Postby prokrypt » Fri Dec 28, 2012 6:24 pm

1) The closest you can get to "everything on a usb drive" at the moment is having the kernel on an internal hard drive, and root on usb. We'll be able to boot from usb when someone comes up with a u-boot that can do it. I may try this out myself later on tonight...

3) Yep, just those modifications should do it--just make sure you replace the ro on the correct line . If you're feeling adventurous (perhaps after receiving your serial cable first!), you might want to try changing the script to make root on your flash drive & set the appropriate boot arguments. Or perhaps I'll be successful in doing it first and post the modified script :P

Watchdog: I know of at least one other person here who has the problem, and found another via google. There is little information on this subject, so I'm not sure whether there was a hardware change, a software change utilizing old hardware, or perhaps it has always been there and nobody said anything about it...
This supposedly affects both the NSA320 and NSA325--Here's how I THINK you can find out: enable telnet on your NSA325 and log in, and run "dmesg | grep watchdog". You might see something like:
$this->bbcode_second_pass_code('', 'mv88f6281_wdt: Watchdog Timer timeout = 8 sec.
mv88f6281_wdt: HW Watchdog timeout = 15 sec.')
i THINK that's it because it doesn't appear in archlinuxarm's kernel. A search for this "mv88f6281_wdt" doesn't bring up much on google.
prokrypt
 
Posts: 31
Joined: Thu Dec 27, 2012 4:45 am

Re: Linux distro on NSA325

Postby astrakid » Fri Dec 28, 2012 7:13 pm

ok, regarding booting from usb i will wait for your experience... ;-)
watchdog is not existent on my device:
$this->bbcode_second_pass_code('', '
root@NSA325:~# dmesg | grep watchdog
root@NSA325:~# dmesg | grep watchdog
root@NSA325:~# ps -ef|grep -i watchdog
root@NSA325:~# ps -ef|grep -i wdog
root@NSA325:~# dmesg | grep dog
root@NSA325:~#
')

regards,
astrakid
astrakid
 
Posts: 14
Joined: Tue Dec 25, 2012 1:05 pm

Re: Linux distro on NSA325

Postby prokrypt » Fri Dec 28, 2012 8:34 pm

Awesome, no watchdog! Can you figure out what firmware you have? Mine came with 4.50(AAAJ.0)C0, but I upgraded it to 4.50(AAAJ.1)C1. Both of those had watchdogs. If you have an older firmware version, then better hold off on the upgrading, UNLESS it's for the sake of science to see if the watchdog is activated by software!

Edit: random stuff: ph33r my wireless Raspberry Pi serial adapter!~
Image
Last edited by prokrypt on Fri Dec 28, 2012 9:01 pm, edited 1 time in total.
prokrypt
 
Posts: 31
Joined: Thu Dec 27, 2012 4:45 am

Re: Linux distro on NSA325

Postby WarheadsSE » Fri Dec 28, 2012 8:52 pm

lolz
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Linux distro on NSA325

Postby prokrypt » Sat Dec 29, 2012 2:55 am

OH YEH
It's alive and booting (root, not kernel) from an old pogoplug's usb drive. Now time to figure out how I managed to do it, and perhaps prod that watchdog a bit. Woof!

Edit: well, that was fast. Figured out the watchdog in 2 minutes... or at least, I got it to activate and reboot the system. Time to see how to deactivate it! :P

Edit #2: Awesome. A kernel panic at shutdown!
$this->bbcode_second_pass_code('', '...
[ OK ] Reached target Shutdown.
Sending SIGTERM to remaining processes...
[ 52.795948] systemd-journald[76]: Received SIGTERM
Sending SIGKILL to remaining processes...
Unmounting file systems.
Unmounted /dev/mqueue.
Unmounted /sys/kernel/debug.
[ 52.999191] EXT4-fs (sda2): re-mounted. Opts: (null)
Disabling swaps.
Detaching loop devices.
Detaching DM devices.
[ 53.085010] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 53.126707] sd 0:0:0:0: [sda] Stopping disk
[ 53.226838] Power down.
[ 53.231469] Kernel panic - not syncing: Attempted to kill init!
[ 53.237466] [<c000d290>] (unwind_backtrace+0x0/0xe0) from [<c03c6d14>] (panic+0x58/0x198)
[ 53.245687] [<c03c6d14>] (panic+0x58/0x198) from [<c0021a48>] (do_exit+0x88/0x7a0)
[ 53.253317] [<c0021a48>] (do_exit+0x88/0x7a0) from [<c0032e40>] (sys_reboot+0x118/0x1d8)
[ 53.261459] [<c0032e40>] (sys_reboot+0x118/0x1d8) from [<c0008b40>] (ret_fast_syscall+0x0/0x2c)')

Edit #3: Ack! Wrong watchdog. It appears there is another meaner one.

Edit #4: I fail at watchdogs. Or I just give up too easily.

Edit #5: I'm going to try something really stupid: have the system boot stock kernel, then reboot into archlinuxarm kernel. This is how I'm going to attempt it: When system boots, check whether kernel is stock or archlinux. If stock, copy archlinux kernel into uImage and reboot, otherwise, copy stock kernel into uImage. Let's see if this will blow up on me...

Edit #6: Apparently, I fail at kernels too. How do I extract a kernel from an mtd device?
prokrypt
 
Posts: 31
Joined: Thu Dec 27, 2012 4:45 am

Re: Linux distro on NSA325

Postby astrakid » Sat Dec 29, 2012 7:41 am

hi,
firmware on my device:
You are currently using firmware version : NSA325_4.50(AAAJ.0)

There is a newer one available:
NSA325_4.50(AAAJ.1)

Shall I install it or better stay on the former one?

edit:
changelog: NSA325_4.50(AAAJ.1)C1 | 11/20in NSA325_4.50(AAAJ.1)C1 | 11/20in NSA325_4.50(AAAJ.1)C1 | 11/20/2012
Enhance image protect mechanism
=> maybe that is the watchdog...?


kind regards,
astrakid
astrakid
 
Posts: 14
Joined: Tue Dec 25, 2012 1:05 pm

Re: Linux distro on NSA325

Postby prokrypt » Sun Dec 30, 2012 1:14 am

$this->bbcode_second_pass_quote('astrakid', '
')changelog: NSA325_4.50(AAAJ.1)C1 | 11/20in NSA325_4.50(AAAJ.1)C1 | 11/20in NSA325_4.50(AAAJ.1)C1 | 11/20/2012
Enhance image protect mechanism
=> maybe that is the watchdog...?

Would you like to find out? :mrgreen:

Anyways, I seem to have made a big booboo somewhere...

$this->bbcode_second_pass_code('', 'NAND read: device 0 offset 0xc80000, size 0xa00000

reading NAND page at offset 0xc80000 failed
10485760 bytes read: ERROR
## Booting image at 02000000 ...
Bad Magic Number
')
Can't get tftpboot working. I'm so computer illiterate :cry:

Edit: welp, as least I'm learning. I extracted a kernel from firmware! Now I guess I'll have to copy it to a hard drive for booting, since uboot/tftp doesn't seem to be able to access ethernet.
prokrypt
 
Posts: 31
Joined: Thu Dec 27, 2012 4:45 am

Next

Return to [Please read announcement] Community-Supported Devices

Who is online

Users browsing this forum: No registered users and 5 guests