Welcome! Log In Create A New Profile

Advanced

Trouble with installing Debian on Zyxell NSA325 v2

Posted by nibbler 
Trouble with installing Debian on Zyxell NSA325 v2
June 19, 2016 12:41PM
Hi,

I have a Arch Linux installation on my NSA 325 (booting from the sata HD). The device has a stock Marvell U-Boot 1.1.4. Now I wanted to run Debian from USB, but I can't get it working.

First I set the device to boot from the USB with the "usb-debian-uboot.tar.gz". Then I installed the system following the instructions from here and using a single ext3 partition.

Trough the serial console I can see that the device tries to boot from the USB drive but it fails with:

USB:   scanning bus for devices... 3 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
1 Storage Device(s) found

** Unable to read "/uImage" from usb 0:1 **

** Unable to read "/uInitrd" from usb 0:1 **
## Booting image at 02000000 ...
Bad Magic Number

However, if I prepare the USB stick with two partitions (boot on ext2 and rootfs with ext4) and move the contents of the boot directory from rootfs into boot partition, the device does boot into Debian but now the rootfs is mounted read only.

Searching the forum didn't help so now clueless. I would appreciate any help, thanks in advance.
Re: Trouble with installing Debian on Zyxell NSA325 v2
June 19, 2016 03:03PM
nibbler ,

Quote

First I set the device to boot from the USB with the "usb-debian-uboot.tar.gz". Then I installed the system following the instructions from here and using a single ext3 partition.

Somewhere in this thread: http://forum.doozan.com/read.php?2,14351,page=1. You'll find the u-boot envs adjustment to boot with stock u-boot.

The errors in indicated that your u-boot envs were not set up properly.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Trouble with installing Debian on Zyxell NSA325 v2
June 20, 2016 05:25PM
Now I managed to get Debian up and running without touching the u-boot envs. I had to use a usb stick with two partition and the Debian-3.16.0-kirkwood-tld-2 rootfs. I don't understand why the newer rootfs packages don't boot and why I need two partitions? Also on a cold boot the hw-watchdog kicks in and the device keeps resetting itself. I have manually pause the start up and then boot manually. How do I prevent this?

Next I'd like to update the U-Boot, but I get an error with fw_printenv:

root@debian:~# fw_printenv 

Warning: Bad CRC, using default environment
bootargs=
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=3
baudrate=115200
stdin=serial,cros-ec-keyb
stdout=serial,lcd
stderr=serial,lcd
root@debian:~#

root@debian:~# cat /etc/fw_env.config 
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000

I'm guessing there is something wrong with my u-boot envs after all?
Attachments:
open | download - debian-boot.log (27.5 KB)
open | download - u-boot_envs.txt (2.5 KB)
Re: Trouble with installing Debian on Zyxell NSA325 v2
June 20, 2016 09:10PM
nibbler Wrote:
-------------------------------------------------------
> Now I managed to get Debian up and running without
> touching the u-boot envs. I had to use a usb stick
> with two partition and the
> Debian-3.16.0-kirkwood-tld-2 rootfs. I don't
> understand why the newer rootfs packages don't
> boot

The last kernel that kills the watchdog by itself is 3.16.0-kirkwood-tld-2.

> and why I need two partitions?

You don't need 2 partitions. One is better.

> Also on a cold
> boot the hw-watchdog kicks in and the device keeps
> resetting itself. I have manually pause the start
> up and then boot manually. How do I prevent this?
>

Either installing new u-boot, or stay with kernel 3.16.0-kirkwood-tld-2. However, kernel 3.16.0-kirkwood-tld-2 watchdog kill processing will not work 100% of the time.

> Next I'd like to update the U-Boot, but I get an
> error with fw_printenv:
> Warning: Bad CRC, using default environment

The envs was still stock envs, so this error is normal. Debian fw_printenv is for the new u-boot envs.

> root@debian:~# cat /etc/fw_env.config
> # MTD device name Device offset Env. size Flash
> sector size Number of sectors
> /dev/mtd0 0xc0000 0x20000 0x20000
> [/code]

This is the correct envs mtd definition in the Debian rootfs, that will be used with new u-boot.

> I'm guessing there is something wrong with my
> u-boot envs after all?

You are still using stock u-boot and the new rootfs does not have access its envs. Don't worry about fw_printenv. As long as you can list the current u-boot envs in stock kernel, or in serial console, then just save them to note somewhere (which you're already did). They are relevant only after you flash new u-boot default envs, and need to look at them to adjust things such as ethaddr and mtdparts. The new u-boot default envs will be good enough to boot into Debian, so these 2 variables can be adjusted later.

The NSA325 watchdog is so problematic that the only way to ensure that we can kill it, new u-boot must be installed. The kernel used to kill the watchdog, but it is not a 100% solution, so I've removed it in later kernel version.

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



Edited 2 time(s). Last edit at 06/20/2016 09:14PM by bodhi.
Re: Trouble with installing Debian on Zyxell NSA325 v2
June 21, 2016 12:33AM
Ok, thank you for the clarifications. It's hard to combine all the bits and pieces from various threads and posts.

Quote
bodhi
You don't need 2 partitions. One is better.

Yes I agree that one would be better. But I tried booting with a single ext2 and ext3 partition and it is a no go. The device complains about not finding the image.
Re: Trouble with installing Debian on Zyxell NSA325 v2
June 21, 2016 02:27AM
nibbler Wrote:
-------------------------------------------------------
> Ok, thank you for the clarifications. It's hard to
> combine all the bits and pieces from various
> threads and posts.
>
>
Quote
bodhi
> You don't need 2 partitions. One is better.
>
>
> Yes I agree that one would be better. But I tried
> booting with a single ext2 and ext3 partition and
> it is a no go. The device complains about not
> finding the image.

Of course, u-boot envs need to set up to boot with one or two partition. The old setup with stock u-boot uses 2 partitions.

If you have serial console then boot with UART first using kwboot as mentioned in the u-boot release thread. And then if it works, proceed to install new u-boot. After that everything is easy.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Trouble with installing Debian on Zyxell NSA325 v2
June 28, 2016 06:50AM
I updated the U-Boot and now running on Debian-4.4 from a single partition. Thank you bodhi for your tips and patience.

-nibbler
Re: Trouble with installing Debian on Zyxell NSA325 v2
June 28, 2016 11:42PM
Cool!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Trouble with installing Debian on Zyxell NSA325 v2
July 05, 2016 02:14PM
One more (stupid) question: how do I need to adjust my mtdparts?

fw_printenv mtdparts

mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)

cat /etc/fw_env.config

# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors
/dev/mtd0 0xc0000 0x20000 0x20000

cat /proc/mtd

dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "rootfs"
mtd3: 05b00000 00020000 "data"

-nibbler
Re: Trouble with installing Debian on Zyxell NSA325 v2
July 05, 2016 08:34PM
fw_setenv mtdparts 'mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)'

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