Welcome! Log In Create A New Profile

Advanced

NSA 325 V2 Debian Is Possible!

Posted by Buttzy10169 
Re: NSA 325 V2 Debian Is Possible!
November 17, 2014 02:45PM
Addy,

What is the output of
cat /sys/class/leds/nsa325:green:sata1/trigger
cat /sys/class/leds/nsa325:green:sata2/trigger

And try this for testing the HDD access (if it is mounted as sdb1). See if the LED light will flicker.
ls -lR /media/sdb1

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



Edited 1 time(s). Last edit at 11/17/2014 02:48PM by bodhi.
Re: NSA 325 V2 Debian Is Possible!
November 22, 2014 11:45AM
Hello Bodhi,

that's the output.

cat /sys/class/leds/nsa325:green:sata1/trigger
[none] nand-disk timer oneshot ide-disk1 ide-disk2 heartbeat gpio default-on
cat /sys/class/leds/nsa325:green:sata2/trigger
[none] nand-disk timer oneshot ide-disk1 ide-disk2 heartbeat gpio default-on

ls -lR /media/647xxx (id)
-> nothing happens.
Re: NSA 325 V2 Debian Is Possible!
November 22, 2014 11:51AM
addy75,

At command line:

echo  ide-disk1 > /sys/class/leds/nsa325:green:sata1/trigger
echo  ide-disk2 > /sys/class/leds/nsa325:green:sata2/trigger

and try access the disk again.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
November 22, 2014 01:23PM
It works when i typ it in the cli.
Putting it in rc.local doesn't work.

Will it be possible (when it works) to make the led green, and red only when the drive is written on?
Maybe orange when it is on sleep-mode?



Edited 1 time(s). Last edit at 11/22/2014 02:10PM by addy75.
Re: NSA 325 V2 Debian Is Possible!
November 22, 2014 05:17PM
addy75,

> It works when i typ it in the cli.
> Putting it in rc.local doesn't work.
>

Well, something is wrong in your rc.local! If you post it here, I'll take a look.

> Will it be possible (when it works) to make the
> led green, and red only when the drive is written
> on?

Sure

/etc/rc.local
echo ide-disk1 > /sys/class/leds/nsa325:red:sata1/trigger 
echo ide-disk2 > /sys/class/leds/nsa325:red:sata2/trigger

> Maybe orange when it is on sleep-mode?

You're running out of color :) so just play with them, and see what's work.

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



Edited 2 time(s). Last edit at 11/22/2014 05:19PM by bodhi.
Re: NSA 325 V2 Debian Is Possible!
November 23, 2014 05:16AM
This is my rc.local

if [ -d /sys/class/leds/nsa325:green:sys ]; then
        echo default-on > /sys/class/leds/nsa325:green:sys/trigger
        echo none       > /sys/class/leds/nsa325:orange:sys/trigger
fi
if [ -d /sys/class/leds/nsa325:green:sata1 ]; then
   echo ide-disk1  > /sys/class/leds/nsa325:green:sata1/trigger
fi
if [ -d /sys/class/leds/nsa325:green:sata2 ]; then
   echo ide-disk2  > /sys/class/leds/nsa325:green:sata2/trigger
fi
exit 0
Re: NSA 325 V2 Debian Is Possible!
November 23, 2014 12:03PM
addy75,

Please post the entire content of /etc/rc.local:
cat /etc/rc.local

Sometime, if there were error that has stopped rc.local somewhere, then these statements could have been skipped. To see if there was no error in rc.local, log the end of its execution:

in /etc/rc.local
logger -s -i "End of rc.local"
exit 0

Then check it after the system has booted:
logread | grep "rc.local"

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
November 23, 2014 12:58PM
#!/bin/sh -e
# Initialize LED Triggers
if [ -d /sys/class/leds/nsa325:green:sys ]; then
        echo default-on > /sys/class/leds/nsa325:green:sys/trigger
        echo none       > /sys/class/leds/nsa325:orange:sys/trigger
fi
if [ -d /sys/class/leds/nsa325:green:sata1 ]; then
   echo ide-disk1  > /sys/class/leds/nsa325:green:sata1/trigger
fi
if [ -d /sys/class/leds/nsa325:green:sata2 ]; then
   echo ide-disk2  > /sys/class/leds/nsa325:green:sata2/trigger
fi
exit 0

logread doesn't exist. If i try to install busybox-rsyslogd (which i've read contains logread) the system wants to uninstall openmediavault....
Re: NSA 325 V2 Debian Is Possible!
November 23, 2014 01:33PM
> logread doesn't exist. If i try to install
> busybox-rsyslogd (which i've read contains
> logread) the system wants to uninstall
> openmediavault....

Try
logger -s -i "End of rc.local"
exit 0

and
cat /var/log/message

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
November 23, 2014 01:39PM
cat /var/log/message
-> Data or directory are not existing
Re: NSA 325 V2 Debian Is Possible!
November 23, 2014 02:33PM
addy75 Wrote:
-------------------------------------------------------
> cat /var/log/message
> -> Data or directory are not existing

Do some research on OMV: where is the log file?

-bodhi
===========================
Forum Wiki
bodhi's corner
bobafetthotmail
Re: NSA 325 V2 Debian Is Possible!
November 24, 2014 02:17AM
I'm half sure that just looking at dmesg would suffice, as the error to execute some commands in rc should be logged there.

Otherwise try the answer to the question here to set up a log file and then reboot http://askubuntu.com/questions/434242/where-is-log-file-from-rc-local
Re: NSA 325 V2 Debian Is Possible!
November 24, 2014 02:58PM
@ bodhi
I tried as discriped on the website writte.
exec 2> /tmp/rc.local.log      # send stderr from rc.local to a log file
exec 1>&2                      # send stdout to the same log file
set -x                         # tell sh to display commands before execution
After reboot no log was created.
So i started rc.local manually
->
+ [ -d /sys/class/leds/nsa325:green:sys ]
+ echo default-on
+ echo none
+ [ -d /sys/class/leds/nsa325:green:sata1 ]
+ echo ide-disk1
+ [ -d /sys/class/leds/nsa325:green:sata2 ]
+ echo ide-disk2
+ exit 0

....and the led starts blinking.
It seems that rc.local is not started during system start

@bobafetthotmail
Thank you a lot!
Re: NSA 325 V2 Debian Is Possible!
November 24, 2014 03:37PM
@addy75,

Make sure the permission is correct, does it own by root?

Like this
-rwxr-xr-x 1 root root 1338 Sep  1 00:52 /etc/rc.local

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
November 24, 2014 04:02PM
S H A M E on me :-(((((
rc.local was set to -r--r--r-- 1 root root....

Sorry bodhi for wasting your time...and thank you for your help.
Re: NSA 325 V2 Debian Is Possible!
November 24, 2014 04:42PM
@addy75,

:)) no problem. Sometime the more experience we have, the more we tend to overlook something that trivial :))

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
November 30, 2014 09:19AM
Just a question.
Is the front-usbport working with full USB3.0 speed or just with usb2.0 speed?
Re: NSA 325 V2 Debian Is Possible!
November 30, 2014 02:19PM
Booting USB 3.0 is not supported by u-boot. But it is working fully as USB 3.0 after you've booted into Debian.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA 325 V2 Debian Is Possible!
December 01, 2014 12:13PM
ok, thank you for the answer.
Is there any possibility to show the current transferspeed while copying / moving data from internal to external hdd?
Eddie87
Re: NSA 325 V2 Debian Is Possible!
December 26, 2014 04:04AM
Sorry if this has been asked before, are there issues with activating both SATA ports? I've read this thread and several others but can't seem to work out if this is an actual issue with Bodhi's 3.16 or 3.17 Debian packages, or whether it's just me.

I know people who installed ArchLinux on the NSA325 were having issues with power to the second sata port, the solution being to manually turn it on using gpio commands after boot. What's less clear is whether this issue is the same for Debian and am now confused :).

Do both hard drives work for you guys with Bodhi's 3.16 or 3.17 Debian packages using the NSA325 DTB file? I've tried both kernels but when using fdisk -l, it only seems to register 1 physical hard drive. My drives are only 500GB each so the size shouldn't be an issue and both drives are fully working (I've swapped them to check).

I've seen a lot of talk about LEDs for both SATA drives in this thread which makes me think that both drives are working for Debian and I'm doing something silly.
Re: NSA 325 V2 Debian Is Possible!
December 26, 2014 05:04AM
Eddie87 Wrote:
-------------------------------------------------------
> Sorry if this has been asked before, are there
> issues with activating both SATA ports? I've read
> this thread and several others but can't seem to
> work out if this is an actual issue with Bodhi's
> 3.16 or 3.17 Debian packages, or whether it's just
> me.
>
> I know people who installed ArchLinux on the
> NSA325 were having issues with power to the
> second sata port, the solution being to manually
> turn it on using gpio commands after boot. What's
> less clear is whether this issue is the same for
> Debian and am now confused :).
>
> Do both hard drives work for you guys with Bodhi's
> 3.16 or 3.17 Debian packages using the NSA325 DTB
> file? I've tried both kernels but when using fdisk
> -l, it only seems to register 1 physical hard
> drive. My drives are only 500GB each so the size
> shouldn't be an issue and both drives are fully
> working (I've swapped them to check).
>
> I've seen a lot of talk about LEDs for both SATA
> drives in this thread which makes me think that
> both drives are working for Debian and I'm doing
> something silly.

Eddie,

Both SATA should work. Are you running new u-boot or stock?

-bodhi
===========================
Forum Wiki
bodhi's corner
Eddie87
Re: NSA 325 V2 Debian Is Possible!
December 26, 2014 05:24AM
Thanks for the quick response, I haven't flashed a new uboot for fear of bricking the device so it must be stock.
Re: NSA 325 V2 Debian Is Possible!
December 26, 2014 01:44PM
Eddie,

If you have serial console, and can boot with UART, then risk of bricking is minimal. New u-boot has no problem with SATA using the same Kirkwood driver as other boxes do.

-bodhi
===========================
Forum Wiki
bodhi's corner
Eddie87
Re: NSA 325 V2 Debian Is Possible!
December 29, 2014 07:26AM
Hi Bodhi, finally had a chance to have a play with this after the Christmas festivities.

I've got UART booting to work with the test image as a failsafe and have got as far as checking for bad blocks on the NAND chip. I've received the following message: "Bad eraseblock 599 at 0x000004ae0000"

Am I right in thinking this is fine when it comes to flashing uboot?

Cheers
Re: NSA 325 V2 Debian Is Possible!
December 29, 2014 10:12AM
Eddie,

> I've got UART booting to work with the test image
> as a failsafe and have got as far as checking for
> bad blocks on the NAND chip. I've received the
> following message: "Bad eraseblock 599 at
> 0x000004ae0000"
>
> Am I right in thinking this is fine when it comes
> to flashing uboot?

Yes. It is fine to flash. BTW, it's good practice to dump mtd0 using nanddump to a file for back up purpose before flashing!

-bodhi
===========================
Forum Wiki
bodhi's corner
Eddie87
Re: NSA 325 V2 Debian Is Possible!
December 30, 2014 12:51PM
I've managed to upgrade the uboot to U-Boot 2013.10-tld-1 however I have the following error:

/bin/sh: can't access tty; job control turned off
(initramfs)"

I've tried both methods of booting neither being successful. When I don't change the 3.16.x uboot environment and instead make a new uImage from the kirkwood-nsa325.dtb file I can boot into linux off the usb stick. However, this only works when no hard drives are connected, if I connect a hard drive to the first sata port I get the above error. Once booted without a hard drive I can connect a single drive to the first sata port and access it. However, the second sata port is still disabled.

When I create a uImage and change the uboot environment as below I get loads of error messages about incorrect format for the image and it fails to boot (both with or without a hard drive attached). I initially thought this might be because the usb was ex3 so I tried reformating with ex2 and the same thing happens:

cd /boot
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-3.17.0-kirkwood-tld-1 -d /boot/vmlinuz-3.17.0-kirkwood-tld-1 /boot/uImage 
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-3.17.0-kirkwood-tld-1 -d /boot/initrd.img-3.17.0-kirkwood-tld-1 /boot/uInitrd

fw_setenv load_dtb 'ext2load usb 0:1 0x1c00000 /boot/dts/kirkwood-goflexnet.dtb'    
fw_setenv load_initrd 'ext2load usb 0:1 0x1100000 /boot/uInitrd'
fw_setenv load_uimage 'ext2load usb 0:1 0x800000 /boot/uImage'
fw_setenv usb_boot 'run load_dtb; run load_uimage; if run load_initrd; then bootm 0x800000 0x1100000 0x1c00000; else bootm 0x800000 - 0x1c00000; fi'

My uboot environment as it currently stands is:

arcNumber=4495
baudrate=115200
bootcmd=run bootcmd_uenv; run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; reset
bootcmd_mmc=run mmc_init; run set_bootargs_mmc; run mmc_boot
bootcmd_sata=run sata_init; run set_bootargs_sata; run sata_boot;
bootcmd_uenv=run uenv_load; if test $uenv_loaded -eq 1; then run uenv_import; fi
bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot;
bootdelay=10
console=ttyS0,115200
device=0:1
ethact=egiga0
ethaddr=b6:d0:5e:0f:a1:17
if_netconsole=ping $serverip
ipaddr=192.168.0.231
led_error=orange blinking
led_exit=green off
led_init=green blinking
machid=0x831
mainlineLinux=yes
mmc_boot=mw 0x800000 0 1; run mmc_load_uimage; if run mmc_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
mmc_init=mmc rescan
mmc_load_uimage=ext2load mmc $device 0x800000 /boot/uImage
mmc_load_uinitrd=ext2load mmc $device 0x1100000 /boot/uInitrd
mmc_root=/dev/mmcblk0p1
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
partition=nand0,2
preboot_nc=run if_netconsole start_netconsole
rootdelay=10
rootfstype=ext3
sata_boot=mw 0x800000 0 1; run sata_load_uimage; if run sata_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
sata_init=ide reset
sata_load_uimage=ext2load ide $device 0x800000 /boot/uImage
sata_load_uinitrd=ext2load ide $device 0x1100000 /boot/uInitrd
sata_root=/dev/sda1
serverip=192.168.0.220
set_bootargs_mmc=setenv bootargs console=$console root=$mmc_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_usb=setenv bootargs console=$console root=$usb_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
start_netconsole=setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=serial
stdin=serial
stdout=serial
uenv_import=echo importing envs ...; env import -t 0x810000
uenv_load=usb start; mmc rescan; ide reset; setenv uenv_loaded 0; for devtype in usb mmc ide; do for disknum in 0; do run uenv_read_disk; done; done
uenv_read=echo loading envs from $devtype $disknum ...; if load $devtype $disknum:1 0x810000 /boot/uEnv.txt; then setenv uenv_loaded 1; fi
uenv_read_disk=if test $devtype -eq mmc; then if $devtype part; then run uenv_read;  fi; else if $devtype part $disknum; then run uenv_read; fi;  fi
usb_boot=mw 0x800000 0 1; run usb_load_uimage; if run usb_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
usb_init=usb start
usb_load_uimage=ext2load usb $device 0x800000 /boot/uImage
usb_load_uinitrd=ext2load usb $device 0x1100000 /boot/uInitrd
usb_root=/dev/sda1

Any ideas what I'm doing wrong?
Re: NSA 325 V2 Debian Is Possible!
December 30, 2014 08:22PM
@Eddie, I'll take a look. If you have the serial console log then pls post it here.

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



Edited 1 time(s). Last edit at 12/30/2014 08:24PM by bodhi.
Re: NSA 325 V2 Debian Is Possible!
December 31, 2014 01:47AM
Eddie,

Quote


1. I've tried both methods of booting neither being successful. When I don't change the 3.16.x uboot environment and instead make a new uImage from the kirkwood-nsa325.dtb file I can boot into linux off the usb stick.

2. However, this only works when no hard drives are connected, if I connect a hard drive to the first sata port I get the above error. Once booted without a hard drive I can connect a single drive to the first sata port and access it. However, the second sata port is still disabled.

This is good news. The 1st is all that matters. The 2nd is the mounting rootfs problem when booting with multiple drives. Hence the error:

Quote

/bin/sh: can't access tty; job control turned off
(initramfs)"

To boot with multiple drive, you need to use the label for the rootfs on USB, and then set envs correctly to boot. See this thread:
http://forum.doozan.com/read.php?3,8044,8152#msg-8152

-bodhi
===========================
Forum Wiki
bodhi's corner
Eddie87
Re: NSA 325 V2 Debian Is Possible!
January 02, 2015 06:31PM
Hi Bodhi,

Thanks for this. I've managed to get the thing to boot version 3.16 of your rootfs. I tried the way you've outlined with 3.17 but had no luck. Out of frustration I tried several things, including some silly things such as erasing all the chip and starting from scratch. However it still won't work for whatever reason. This in itself might be down to me erasing all the chip, but I'm a bit of a newbie to this and you only learn from your mistakes so they tell me :D! (really I'm amazed I haven't bricked it by now to be honest!).

In the end I followed the guide found here for the NSA's little cousin, the NSA320: http://www.panticz.de/ZyXEL-NSA320

Basicially I've flashed the 3.16 uImage and uInitrd images onto the nand chip and have the rootfs on the usb stick. Not quite sure why this works, or if this is a sound thing to do, but no problems so far in regards to the 3.16 debian install. I would try again but I don't wish to break it. Maybe when I have some free time I'll see if I can figure out where I'm going wrong.

The main annoyance I have now is that despite flashing the most recent uboot version, there is still no recognition of the second hard drive slot (i.e. sata port 2). Again, I've swapped the drives and both work on sata port 1, so it's not a faulty drive. I'm starting to wonder if its a faulty slot however, unfortunately, having wiped the nand chip, I no longer have the stock OS to check if it appears within that (not that I actually intend on using the stock OS).

I'm using your 3.16 uImage, uInitrd and rootfs files and I can't see why saving the uImage and uInitrd images on the nand rather than the USB would change anything in regards to the sata ports. I have tried accessing the ide command in uboot and it lists 2 devices. However, again, I can only list files for the drive connected to the first sata port which makes me think it is a hardware issue.

Any thoughts other than what is this guy up to :D!?

Much appreciated,

Ed
Re: NSA 325 V2 Debian Is Possible!
January 02, 2015 06:51PM
Eddie,

You've gone on a wild goose chase :) what I said above about 1st item: if you can boot with USB, it's all that matters. The problem with booting multiple drives, and recognize both SATA ports, are trivial to solve.

Booting 3.16 and 3.17 are exactly the same, after the 3.17 uImage was embbeded with the NSA325 DTB. Even with stock u-boot.

Whether you put uImage and uInitrd on NAND, or on a USB stick, it will behave the same when mounting rootfs. Ie. u-boot envs for bootargs and root device must be defined properly so the kernel and rootfs are selected as you'd want.

What you should do to if you'd want to get back to the proper installation using my u-boot image and kernel build:

- Create the 3.16 rootfs on USB stick as described in the kernel thread.
- Power up and interrupt serial console
- List u-boot envs,
- go ahead and boot, capture the entire log and post here.

-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: