Welcome! Log In Create A New Profile

Advanced

Bad Magic Number on Zyxel NAS325v2 with newest Debian Image

Posted by Hans Peter 
Bad Magic Number on Zyxel NAS325v2 with newest Debian Image
September 19, 2017 02:41PM
Hello,

I have a Zyxel NAS325v2 and want to install the latest Debian / Linux Kernel from https://forum.doozan.com/read.php?2,12096 on it. I have an UART and the original uboot from zyxel Fw 4.81 not the new one from here https://forum.doozan.com/read.php?3,12381.

I prepered my nas with the steps from https://micha.stoecker.me/p/DNVpwG47 and so I set the environment to:

fw_setenv arcNumber 4495
fw_setenv mainlineLinux yes
fw_setenv bootargs_stock 'console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=/dev/nfs rw init=/init'
fw_setenv bootargs_linux 'console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_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 \
fw_setenv bootcmd 'run to_linux'


With this instruction from Micha Stoecker I get a running Debian 7 without problems. After that success I tried the instruction from Doozan. I created an uImage with embedded DTB for booting with older u-boots and made a Image with the following command:

mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-4.12.1-kirkwood-tld-1 -d zImage.fdt  uImage

Image Name:   Linux-4.12.1-kirkwood-tld-1
Created:      Tue Sep 19 18:42:49 2017
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    3836076 Bytes = 3746.17 KiB = 3.66 MiB
Load Address: 00008000
Entry Point:  00008000


After that I plugged in the usb stick and the following error message was shown:

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 00008000 ...
Bad Magic Number



What is the problem? Has it something todo with the address, I've tried the 02000000, but the same error was shown with the new adress.


----

mod edit: use code tags



Edited 1 time(s). Last edit at 09/20/2017 12:56AM by bodhi.
Re: Bad Magic Number on Zyxel NAS325v2 with newest Debian Image
September 19, 2017 03:01PM
Hans Peter,

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'


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

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

Your envs point to the wrong location. Should be /boot/uImage and /boot/uInitrd.

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



Edited 1 time(s). Last edit at 09/20/2017 07:57AM by bodhi.
Re: Bad Magic Number on Zyxel NAS325v2 with newest Debian Image
September 20, 2017 12:35AM
Thanks for the hint.

In the screen session I entered the command below and the system started.

setenv bootargs $(bootargs_linux); mw.l f1010100 0020c000; usb reset; ext2load usb 0:1 $(loadaddr) /boot/uImage; ext2load usb 0:1 0x01100000 /boot/uInitrd; bootm $(loadaddr) 0x01100000


But then he is in an endless newstart loop with the following error message (see it on the attached picture).

What can I do?

-----
Mod edit: please use code tags



Edited 2 time(s). Last edit at 09/20/2017 12:57AM by bodhi.
Attachments:
open | download - Bildschirmfoto von »2017-09-20 07-29-19«.png (58.6 KB)
Re: Bad Magic Number on Zyxel NAS325v2 with newest Debian Image
September 20, 2017 01:01AM
Hans Peter,

Please repost the entire serial console log of what you just did above.

Excerpt is not good to understand the problem. You should post the log from the u-boot banner until it stops booting. And do not post image, just copy and paste (in code tags) what you see in serial console.

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

I think I am facing the same issue. I am also running the NSA 325v2 using the original uboot and DTB embedded into the kernel, and had issues running the latest kernels. I can confirm that version 4.10.9 still works, 4.11.3 and 4.12.8 hang during boot. @HansPeter, maybe you can try version 4.10.9? Unfortunately I do not have a serial console attached right now, maybe I will find some time for this later.

Please note that simply updating uboot is problematic on these boxes as this will make it impossible to boot the original firmware.

Best regards
Nilas
Re: Bad Magic Number on Zyxel NAS325v2 with newest Debian Image
September 24, 2017 02:52AM
Nilas,

> I think I am facing the same issue. I am also
> running the NSA 325v2 using the original uboot and
> DTB embedded into the kernel, and had issues
> running the latest kernels. I can confirm that
> version 4.10.9 still works, 4.11.3 and 4.12.8 hang
> during boot. @HansPeter, maybe you can try version
> 4.10.9? Unfortunately I do not have a serial
> console attached right now, maybe I will find some
> time for this later.

The problem is quite simple. With stock u-boot, the load addresss of uImage and uInitrd might need to change whenever the kernel size increases. That's the reason why older kernel works but newer kernel might be trouble to boot.

> Please note that simply updating uboot is
> problematic on these boxes as this will make it
> impossible to boot the original firmware.
>

It is also possible to boot stock OS from new u-boot, but it is a low priority for me, so I did not get around to do that.

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