Welcome! Log In Create A New Profile

Advanced

Problem with NSA325v2 and original bootloader

Posted by max2014 
Problem with NSA325v2 and original bootloader
July 28, 2017 08:36AM
Hello,
I used the following commands to boot my NSA325v2 from a USB device with a 3.14 rootfs:
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 \'run bootcmd_linux\'; saveenv; reset"
Commands and rootfs are from this german guide

Now I like to create a new USB device with the the bodhi rootfs, but the NAS325 is not starting.

I tried different things:
- extract rootfs only into one partition
- create a boot and rootfs partition (and copy the contents inside boot to boot partition)

I run all commands from the guide and adapted:
cat dts/kirkwood-nsa325.dtb  >> zImage.fdt

Maybe I need other boot parameter?
Can I adjust the parameters from the running debian system?

Thanks
Re: Problem with NSA325v2 and original bootloader
July 28, 2017 05:23PM
max2014,

> I tried different things:
> - extract rootfs only into one partition
> - create a boot and rootfs partition (and copy the
> contents inside boot to boot partition)

Were you root user while you created the rootfs? And a single partition is the correct approach. Don't use 2 partitions.

> Can I adjust the parameters from the running debia
> n system?

Yes. Please log in the 3.14 rootfs, and get the output of:

uname -a
cat /proc/mtd
mount
fw_printenv

Note that if you have serial console connected then it will be much easier to see the booting problem.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 2 time(s). Last edit at 07/28/2017 05:26PM by bodhi.
Re: Problem with NSA325v2 and original bootloader
August 05, 2017 08:06AM
Thank you bodhi. The comannds give me the following informations:

uname -a
Linux debian 3.14.0-kirkwood-tld-1 #1 PREEMPT Tue Apr 1 22:54:58 PDT 2014 armv5t           el GNU/Linux

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"

mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=63261,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,relatime,size=102504k,mode=755)
/dev/sdb2 on / type ext4 (rw,noatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
tmpfs on /var/log type tmpfs (rw,relatime,size=10240k)
tmpfs on /tmp type tmpfs (rw,relatime)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)

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
Re: Problem with NSA325v2 and original bootloader
August 05, 2017 05:39PM
max2014,

It looks like it should boot with the new rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2.

Quote

Updated 24 Jul 2017:

Basic Debian stretch Kirkwood rootfs for most Kirwood plugs:

The only thing I can think of is you have more than one drives plugged in? or the new roots drive have more than one partition in it. If you have more than one partition (even with only one USB drive) then the uboot envs need adjustment to select the partition with label rootfs.

If you'd like, post the log of the session how you created the new rootfs. I'll double check it for you.

=========

Note that if you have installed the new u-boot then it will handle all these issues automatically. However, I realize that sometime you just want to run new Debian, and keep booting stock at the same time. It is perfectly OK to keep stock u-boot in this scenario.

Booting stock NSA325 with new u-boot is an item on my TODO list, but I have not got around to work on it, it's a long prioritized list :)

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
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: