Welcome! Log In Create A New Profile

Advanced

New install on NSA325

Posted by Shadowhawke 
New install on NSA325
November 17, 2020 05:22PM
I have been at this for a few days now, trying to follow the instructions at Linux Kernel 5.9.3 Kirkwood package and Debian rootfs. I have created the USB stick as described on the page there, but when I put the competed stick into my nsa325, it still boots to the stock firmware.

My uboot version:
U-Boot 1.1.4 (Sep 16 2011 - 17:51:53) Marvell version: 3.5.9

I did make the uImage with dts as described in the document.

I also unfortunately don't quite understand the uboot upgrade process described at 2017.07 U-Boot Kirkwood - GoFlexNet, GoFlexHome, PogoE02, Dockstar, iConnect, NetgearStora, PogoV4/Mobile, Sheevaplug, NSA325, NSA320, NSA310S, NSA320S, NSA310, HP T5325, Dreamplug which from what I am looking at would seem to solve my issue?

Any help would be appreciated, and I thank you all for the hard work that goes into a project like this.

Jeff
Re: New install on NSA325
November 17, 2020 09:25PM
Shadowhawke,

> I also unfortunately don't quite understand the
> uboot upgrade process described at
> 2017.07
> U-Boot Kirkwood - GoFlexNet, GoFlexHome, PogoE02,
> Dockstar, iConnect, NetgearStora, PogoV4/Mobile,
> Sheevaplug, NSA325, NSA320, NSA310S, NSA320S,
> NSA310, HP T5325, Dreamplug
which from what
> I am looking at would seem to solve my issue?

For this box. Yes, you want to install the new u-boot image in uboot.2017.07-tld-1.nsa325.bodhi.tar while inside stock OS.

That will automatically boot the rootfs Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 on USB.

Note: you cannot boot back to stock after you installed the new u-boot. So you have to make the decision whether to go full Debian or stay with stock OS.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: New install on NSA325
November 17, 2020 10:07PM
I intend it to be debian from here on out, so that is not an issue. However, I am not following how to do the upgrade in the stock firmware. If you, or someone else, could break down a step by step procedure for doing it in the stock firmware, I would deeply appreciate it.
Re: New install on NSA325
November 18, 2020 03:34AM
Well, I made some progress.

I figured out how to flash uboot, and made the backups of mtd0 and the current environment as suggested in the thread. However, now I get an error. The full log is attached, but the detail is below. Getting closer, but your help would be appreciated. I have attached the full boot log in case something relevant is missing from this.

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:42:03 -0700)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
*** Warning - bad CRC, using default environment

--- SNIP ---

[    9.327512][   T15] usb 1-1.2: new high-speed USB device number 3 using orion-ehci
[    9.335136][    T1]   0802      2147459328 sda2 7c3dec53-02
[    9.335138][    T1]
[    9.342970][    T1] 0810      2930266584 sdb
[    9.342973][    T1]  driver: sd
[    9.350536][    T1] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    9.359540][    T1] CPU: 0 PID: 1 Comm: swapper Not tainted 5.2.9-kirkwood-tld-1 #1
[    9.367225][    T1] Hardware name: Marvell Kirkwood (Flattened Device Tree)
[    9.374234][    T1] [<c010f6ac>] (unwind_backtrace) from [<c010bb00>] (show_stack+0x10/0x14)
[    9.382718][    T1] [<c010bb00>] (show_stack) from [<c0119fa0>] (panic+0xe0/0x30c)
[    9.390329][    T1] [<c0119fa0>] (panic) from [<c0e01628>] (mount_block_root+0x1bc/0x2a4)
[    9.398546][    T1] [<c0e01628>] (mount_block_root) from [<c0e017f8>] (mount_root+0xe8/0x154)
[    9.407110][    T1] [<c0e017f8>] (mount_root) from [<c0e019b0>] (prepare_namespace+0x14c/0x18c)
[    9.415847][    T1] [<c0e019b0>] (prepare_namespace) from [<c0e011c8>] (kernel_init_freeable+0x270/0x2dc)
[    9.425458][    T1] [<c0e011c8>] (kernel_init_freeable) from [<c09dcee0>] (kernel_init+0x8/0x10c)
[    9.434368][    T1] [<c09dcee0>] (kernel_init) from [<c01010e0>] (ret_from_fork+0x14/0x34)
[    9.442663][    T1] Exception stack(0xdf48bfb0 to 0xdf48bff8)
[    9.448428][    T1] bfa0:                                     00000000 00000000 00000000 00000000
[    9.457342][    T1] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    9.466252][    T1] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    9.473602][    T1] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---


======
Moderator edit: please use code tags (Formatted code button on the right) to post log.



Edited 1 time(s). Last edit at 11/18/2020 04:00PM by bodhi.
Attachments:
open | download - nsa325-log.txt (24.4 KB)
Re: New install on NSA325
November 18, 2020 04:13PM
Shadowhawke,

1. You did not do Step 8 during u-boot installation:

8. Flashing default u-boot envs image (if you are upgrading from 2016.05-tld-1 u-boot, you can skip this step 8).

It is important to populate with the correct envs. However, currently the u-boot internal envs are good enough to allow you to boot the kernel successfully.

2. The error you have at the end was the kernel could not mount the rootfs.

This was because you did Step 4 during rootfs creation:

Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Do not do this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

And you are running with latest u-boot. This step should be done only if you are booting with stock u-boot.

=====

Mount the rootfs on another Linux box , and reverse rootfs instruction Step 4.

Assumng it is mounted at /media/sdb1

cd /media/sdb1/boot
cp -a uImage uImage.nsa325_with_dtb
cp -a uImage.orig uImage
sync

And then unmount the rootfs, bring it back to the NSA325 and boot with it.

After you have booted successfully into Debian, you can proceed to do u-boot installation Step 8 through 11. If you are not sure about something in each step, you can post the questions here. It is OK to post as many posts as you might have some questions along each step.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: New install on NSA325
November 18, 2020 05:16PM
Thank you for your help! It is now booting properly, and I installed the environment. I think all is well. Are there any other sanity checks you may suggest?
Re: New install on NSA325
November 18, 2020 07:15PM
> Thank you for your help! It is now booting
> properly, and I installed the environment. I think
> all is well. Are there any other sanity checks you
> may suggest?

The best sanity check is to post the serial console log (from u-boot banner to the Debian login prompt). That way I can just read the log and see if anything is out of the ordinary.

The next thing to do to make the system fully functional is creating a swap file on the USB rootfs. This swap file should be >= 4x time RAM size. And later after you formatted and use a SATA HDD in the slot, the swap file should be on that HDD.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: New install on NSA325
November 18, 2020 07:32PM
Thank you for all your help.

I have attached the boot log. Once this is completed, I did have questions of what kind of raid I should be using. LVM? mdadm? btrfs? are there any ptifalls given the small amount of ram involved with any of these? or the unique kernel setup?
Attachments:
open | download - nsa325 boot log.txt (27.5 KB)
Re: New install on NSA325
November 18, 2020 11:03PM
Shadowhawke,

> I have attached the boot log.

It looks perfect!

> Once this is
> completed, I did have questions of what kind of
> raid I should be using. LVM? mdadm? btrfs? are
> there any ptifalls given the small amount of ram
> involved with any of these? or the unique kernel
> setup?

Usually people use mdadm on small NAS such as this box. You can find example/tutorial in the Wiki thread.

Quote

RAID

Making a RAID1 rootfs
Booting btrfs RAID 1 rootfs on Kirkwood boxes

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: New install on NSA325
November 18, 2020 11:05PM
Oh, one more question...do I need to remake the uImage whenever there is a change to the initramfs? Make that two questions. Would you have a sample uEnv.txt for the NSA325 while I start learning the uboot stuff? Thank you again so much for the help. This is fantastic.
Re: New install on NSA325
November 18, 2020 11:13PM
Adding a third question:

The raid 1 wiki entry mentions a thread about "Start with booting a SINGLE disk as normal from bodhi's kernel/rootfs thread, the second disk with the same partitions as the first, but empty." Is this another wiki article that I am not seeing?

Thanks in advance.
Re: New install on NSA325
November 19, 2020 06:41PM
Quote

do I need to remake the uImage whenever there is a change to the initramfs?

Not needed. The initramfs only affects uInitrd.


Quote

Would you have a sample uEnv.txt for the NSA325 while I start learning the uboot stuff?

The best sample for uEnv.txt is the one you've already downloaded (in the u-boot envs tarball):
uboot.2016.05-tld-1.environment (the content of the default envs in text format)

uboot.2016.05-tld-1.environment contains the entire envs settings that were used in creating the envs image:
uboot.2016.05-tld-1.environment.img (the default envs image to be flashed)

So the idea is you can copy this file to uEnv.txt, and remove the envs that you don't want to reset on the fly. And just have the one you are interested in playing with.

BTW, bootcmd is one of the envs you cannot change using uEnv.txt.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: New install on NSA325
November 19, 2020 11:00PM
Quote

Adding a third question:

The raid 1 wiki entry mentions a thread about "Start with booting a SINGLE disk as normal from bodhi's kernel/rootfs thread, the second disk with the same partitions as the first, but empty." Is this another wiki article that I am not seeing?

No other Wiki entry is needed regarding the above statement. I am not sure what your question is?

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