NSA325V2 u-boot installation - Problem with permission denied
November 26, 2016 04:59PM
Hello!

I'm trying to install the newest U-Boot 2016.05.

Part "A. Flashing Instruction:" doesn't work for me ("flash_erase /dev/mtd0 0 4" results in an error message). A little bit of googling got me to a page on this forum stating, that my NSA325v2 is using stock boot environment parameter and I've to update them by using the update procedure described in section "B. Flashing default u-boot envs image"

Nevertheless, this doesn't work either, "/usr/sbin/flash_erase /dev/mtd0 0xc0000 1" gives me
root@debian:/media/test/envs# /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
flash_erase: error!: /dev/mtd0
             error 13 (Permission denied)

Any suggestions?

Maybe the following information can help you in finding the problem?

root@debian:/media/test/envs# uname -a
Linux debian 3.14.0-kirkwood-tld-1 #1 PREEMPT Tue Apr 1 22:54:58 PDT 2014 armv5tel GNU/Linux
root@debian:/media/test/envs# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "uboot"
mtd1: 00080000 00020000 "uboot_env"
mtd2: 00080000 00020000 "key_store"
mtd3: 00080000 00020000 "info"
mtd4: 00a00000 00020000 "etc"
mtd5: 00a00000 00020000 "kernel_1"
mtd6: 02fc0000 00020000 "rootfs1"
mtd7: 00a00000 00020000 "kernel_2"
mtd8: 02fc0000 00020000 "rootfs2"
root@debian:/media/test/envs# cat /proc/cmdline
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
root@debian:/media/test/envs# dmesg | grep nand
[    0.000000] Kernel command line: 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
[   20.299750] nand: device found, Manufacturer ID: 0x92, Chip ID: 0xf1
[   20.306133] nand: Eon NAND 128MiB 3,3V 8-bit
[   20.310436] nand: 128MiB, SLC, page size: 2048, OOB size: 64
[   20.390829] Creating 9 MTD partitions on "orion_nand":



Edited 1 time(s). Last edit at 11/26/2016 05:18PM by bodhi.
Re: NSA325V2 u-boot installation - Problem with permission denied
November 26, 2016 05:34PM
haarwurm,

> Linux debian 3.14.0-kirkwood-tld-1 #1 PREEMPT Tue

You are using an old kernel. This is a non-FDT kernel.

> "flash_erase /dev/mtd0 0 4" results in an
> error message

Post this error message.

> /usr/sbin/flash_erase /dev/mtd0 0xc0000 1
> flash_erase: error!: /dev/mtd0
> error 13 (Permission denied)[/code]

Is this permission denied msg was what you got with "flash_erase /dev/mtd0 0 4" ?

Suggestion:

I think you should upgrade your kernel to the latest (4.8.3) or some version >= 4.4.0 to make it easier to troubleshoot this. The info you've posted did not show that mtd0 was setup as RO (which is what caused "permission denied" error). And kernel 3.14 is too old for me to remember any thing special about nand_mtd driver in the code :)

Note that the correct mtd driver to use now is orion_nand. And I could not remember which kernel version was when the orion_nand driver is required. So running the later kernels, you will need to change nand_mtd to orion_nand in your bootargs

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) root=LABEL=rootfs loglevel=8

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



Edited 2 time(s). Last edit at 11/26/2016 05:41PM by bodhi.
Re: NSA325V2 u-boot installation - Problem with permission denied
November 29, 2016 04:39AM
After upgrading to kernel 4.4.0 I finally managed to install U-Boot 2016.05.

I got some problems, because the previously installed u-boot was so old, that the envs were installed in /dev/md1, the new envs are expected in /dev/md0. Because of this, I had to edit the /etc/fw_env.config.

After having succesfully installed U-boot 2016.05 the NAS didn't boot, I got some kernelpanic. This thread has the solution:

uImage needs to be restored back to the original.

cd /boot
mv uImage uImage.netgear
mv uImage.orig uImage

After doing this, my NSA325v2 finally boots U-boot 2016.05 and Debian 4.4.0.

Bodhi, again, thank you very much for your work and support!
Re: NSA325V2 u-boot installation - Problem with permission denied
November 29, 2016 02:48PM
> After doing this, my NSA325v2 finally boots U-boot
> 2016.05 and Debian 4.4.0.

Cool!

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