[STORA] New rootfs installation
August 31, 2022 11:10AM
Hello here,

I'm a new user of this forum, i'm navigate easily in Linux but beginning in "kernel/rootfs/boot" idea.

I have follow this topic to unbrike à Netgear Stora MS2110 with poor stock version :
https://sigri44.github.io/OpenStora/wiki/index_How_to_install_Debian_Linux_on_NETGEAR_Stora.html

I can only have GPIO/Serial access (with ardruino + TTY), and i don't understand how to replace uBoot/rootfs, to have a recent access.

The topic i follow can give me a Stretch installation, but in repository step, it's failed because version is very deprecated.

In follow my hardware logs :
https://gist.github.com/Sigri44/3903ef9233b7125003ff45762a513613

And my installation logs :
https://gist.github.com/Sigri44/ccea2a11082fc1d55f1829d906f99d3b

I don't know what is my "uBoot" version, and i don't understand how to follow this installation topic :
https://forum.doozan.com/read.php?2,12096

Have fun !
Re: [STORA] New rootfs installation
August 31, 2022 03:40PM
Sigri,

1. Create the USB Debian rootfs using Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2

https://forum.doozan.com/read.php?2,12096

2. Dowload the u-boot tarball uboot.2017.07-tld-1.netgear_ms2110.bodhi.tar to this new USB rootfs:

https://forum.doozan.com/read.php?3,12381

3. Before flashing new u-boot, you need to use kwboot to run the new u-boot image over UART, to make sure you can recover from a bad flash.

https://forum.doozan.com/read.php?3,51739,51919#msg-51919

=====

Read those 3 instructions, make sure you understand all before installation. If you don't understand something, post the question.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: [STORA] New rootfs installation
September 01, 2022 10:25AM
Hey, thank you for reply !

Step 1 is done. Now in step two, i don't undestand how to unzip the *.kwb file to the /boot folder.

For the moment rootfs key is on my computer and not on NAS, and i don't know how to install/unzip this file into boot, because tuto use flashing method, or /rootfs method but need printenv, etc, and i think this command is only on the NAS.

Thx.

EDIT : FYI, actual uboot version :
https://gist.github.com/Sigri44/dee6f2099f53eac888ac0f6a9311b780

EDIT2 :
./kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.netgear_ms2110.mtd0.kwb

Result is
Sending boot message. Please reboot the target.../

But after rebooting, and press stop button to don't launch OS, no any result.

And if i don't press stop button, launch failed because usb boot don't find uImage and start is crashed.



Edited 2 time(s). Last edit at 09/01/2022 11:39AM by Sigri.
Re: [STORA] New rootfs installation
November 16, 2022 08:26AM
I try another method.

Step 1 > Done, apply netgear kirkwood image

Step 2 > All tutos say "use cat command", but only available if you boot into Debian OS. Btw you specify to copy uboot file INTO usb stick, but don't understand how to realize it ?

Bonus : I have see in another topic, usb stick is always need, but have you a topic to write debian os into flash memory, and don't need usb stick to boot in the future ?

Thank you.

Logs :
Marvell>> boot
(Re)start USB...
USB:   scanning bus for devices... 1 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
** Bad partition 1 **
** Bad partition 1 **
## Booting image at 00800000 ...
Bad Magic Number
stopping USB..

USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0, egiga1 [PRIME]
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
T T  ** ext2fs_devread() read error **

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

bootargs=console=ttyS0,115200 root=LABEL=root rootdelay=8
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial
load_uimage=ext2load usb 0:1 0x800000 /boot/uImage
load_uinitrd=ext2load usb 0:1 0x2100000 /boot/uInitrd
usb_boot=mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000
usb_bootcmd=run usb_set_bootargs; run usb_boot
bootcmd=usb reset; run usb_bootcmd; usb stop; reset



Edited 1 time(s). Last edit at 11/16/2022 08:31AM by Sigri.
Re: [STORA] New rootfs installation
November 16, 2022 02:09PM
Sigri,

> Step 1 > Done, apply netgear kirkwood image

You need to follow the instruction very closely. The USB rootfs must be created on a Linux box (such as Ubuntu, Raspery PI...), with you being root user. The rootfs you created is not good.

>
> Step 2 > All tutos say "use cat command", but only
> available if you boot into Debian OS.

It can be done on any Linux box.

> Btw you
> specify to copy uboot file INTO usb stick, but
> don't understand how to realize it ?

Use wget to download to some folder on the USB rootfs. For example, /boot folder.

====

Post the log of the session how you created the rootfs here (copy everything on the terminal and paste here).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: [STORA] New rootfs installation
November 16, 2022 03:06PM
Thank you Bodhi,

I already make Step1 with Kali root terminal

cd /media/root
tar -xjf Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2
mv /media/root/rootfs/* /media/root/

nano /media/root/etc/fstab
LABEL=rootfs    /               ext3    noatime,errors=remount-ro 0 1

cd /media/root/boot
cp -a zImage-5.13.6-kirkwood-tld-1  zImage.fdt
cat dts/kirkwood-netgear_stora_ms2000.dtb  >> zImage.fdt
mv uImage uImage.orig
apt-get install u-boot-tools
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.13.6-kirkwood-tld-1 -d zImage.fdt  uImage
sync

*I noticed the error that disturbed me, you say to do 'cat /etc/...' but it is 'cat /media/XXX/etc/...'
cat /media/root/etc/fw_env.config
 # MTD device name	Device offset	Env. size	Flash sector size	Number of sectors 
/dev/mtd0 0xc0000 0x20000 0x20000

cat /media/root/proc/mtd
>>>No such file or directory

fw_printenv ethaddr
>>>Configuration file wrong or corrupted

I think this following instruction can't work on my Kali OS, but directly on NAS box with USB stick, right ??
(Picture in attachment)
Attachments:
open | download - Capture d’écran 2022-11-16 à 22.04.47.png (347.6 KB)
Re: [STORA] New rootfs installation
November 16, 2022 05:02PM
Sigri,

> I already make Step1 with Kali root terminal

It is best that you post the real log of what you've done (not the list of the commands). That way I can spot any errors you've made easily.

Are you root at this point before doing anything further?

who ami

On Kali terminal, to become root:

su -


> cd /media/root
> tar -xjf
> Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2
> mv /media/root/rootfs/* /media/root/

You should not do the mv command avove.

>
> nano /media/root/etc/fstab
> LABEL=rootfs / ext3
> noatime,errors=remount-ro 0 1
>
> cd /media/root/boot
> cp -a zImage-5.13.6-kirkwood-tld-1 zImage.fdt
> cat dts/kirkwood-netgear_stora_ms2000.dtb >>
> zImage.fdt
> mv uImage uImage.orig
> apt-get install u-boot-tools
> mkimage -A arm -O linux -T kernel -C none -a
> 0x00008000 -e 0x00008000 -n
> Linux-5.13.6-kirkwood-tld-1 -d zImage.fdt uImage
> sync
>
> *I noticed the error that disturbed me, you say to
> do 'cat /etc/...' but it is 'cat
> /media/XXX/etc/...'
> cat /media/root/etc/fw_env.config
> # MTD device name Device offset Env. size Flash
> sector size Number of sectors
> /dev/mtd0 0xc0000 0x20000 0x20000

This below 2 commands only applicable if you are installing from inside stock OS.

> cat /media/root/proc/mtd
> >>>No such file or directory
>
> fw_printenv ethaddr
> >>>Configuration file wrong or corrupted
>

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