New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ramips: add support for Netgear R6220 #921

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
10 participants
@hqvv
Copy link

hqvv commented Mar 5, 2017

This patch adds support for the Netgear R6220, aka Netgear AC1200 and R6220-100NAS.

Specification:

  • SoC: MediaTek MT7621ST (880 MHz)
  • Falsh: 128 MiB (Macronix MX30LF1G08AA-TI)
  • RAM: 128 MiB (Nanya NT5CB64M16FP-DH)
  • Wireless: MediaTek MT7603EN b/g/n , MediaTek MT7612EN an+ac
  • LAN speed: 10/100/1000
  • LAN ports: 4
  • WAN speed: 10/100/1000
  • WAN ports: 1
  • Serial baud rate of Bootloader : 57600

Installation through telnet:

  • Copy kernel.bin and rootfs.bin to a USB flash disk, plug to usb port on the router.
  • Enable telnet with link: http://192.168.1.1/setup.cgi?todo=debug (login if required, default: admin password)
  • You will see "Debug Enabled!"
  • Telnet 192.168.1.1 and login with "root"
  • ls /mnt/shares/ to find out path of your USB disk. 'myUdisk' for example.
  • cd /mnt/shares/myUdisk
  • mtd_write write rootfs.bin Rootfs
  • mtd_write write kernel.bin Kernel
  • reboot

Signed-off-by: Hanqing Wong < hquu@outlook.com >

@heinzek
Copy link
Contributor

heinzek left a comment

Hello @hqvv,

Thank you for your contribution, please find my comments below, inline in code.

Your commit has also some formal issues. Please have a look at Contributor's Guide

  • missing prefix in commit title
  • missing commit message
  • missing SoB line

Please have a look at the another commits of the ramips target to have some examples on how to do it the right way. [sample](d48cc5e

Please use git merge -i HEAD~8 and squash all commits to one. Use git commit --amend to add changes to your commit. Use git push --force to overwrite your github repository/branch. The PR will afterwards update automatically. Please don't close this PR and open a new one.

@@ -291,6 +291,12 @@ px-4885)
set_wifi_led "$board:orange:wifi"
set_usb_led "$board:blue:storage"
;;
r6220)
ucidef_set_led_default "power" "power" "$board:green:power" "1"

This comment has been minimized.

@heinzek

heinzek Mar 5, 2017

Contributor

You set power led in diag.sh file. This entry is unnecessary.


};


This comment has been minimized.

@heinzek

heinzek Mar 5, 2017

Contributor

Please remove this one empty line.

reg = <0x4200000 0x3c00000>;
read-only;
};

This comment has been minimized.

@heinzek

heinzek Mar 5, 2017

Contributor

Please remove this one empty line.

IMAGE_SIZE := $(ralink_default_fw_size_32M)
KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
UBINIZE_OPTS := -E 5
IMAGE/sysupgrade.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)

This comment has been minimized.

@heinzek

heinzek Mar 5, 2017

Contributor

In file target/linux/ramips/base-files/lib/upgrade/platform.sh You set r6220 to use metadata images but Your sysupgrade image does not contain "append-metadata"

@heinzek

heinzek approved these changes Mar 6, 2017

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Mar 6, 2017

To install LEDE, you need replace the Bootloader with uboot via debug mode.

Why does the original bootloader needs to be replaced? I'm missing an explanation what doesn't work using the original bootloader.

I really don't like that the replacement bootloader needs to be downloaded from a 3rd party site. These sites tend to vanish and the whole board wouldn't work any longer with LEDE.

Same applies to the "go back to factory firmware". Would you please describe what is so special with this firmware and how a user could create this file on his own.

@@ -229,6 +229,7 @@ platform_check_image() {
}
return 0
;;
r6220|\

This comment has been minimized.

@mkresin

mkresin Mar 6, 2017

Contributor

wrong alphabetical order. r > h.

Further more, you have to add your board to platform_pre_upgrade to do the flash procedure for NAND based boards.


#include "mt7621.dtsi"

#include <dt-bindings/input/input.h>

This comment has been minimized.

@mkresin

mkresin Mar 6, 2017

Contributor

wrong alphabetical first gpio.h than input.h

IMAGE_SIZE := $(ralink_default_fw_size_32M)
KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
UBINIZE_OPTS := -E 5
IMAGE/sysupgrade.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)

This comment has been minimized.

@mkresin

mkresin Mar 6, 2017

Contributor

Your sysupgrade image looks like a factory image. Please use the following instead:

IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi | check-size $$$$(IMAGE_SIZE)
PAGESIZE := 2048
KERNEL_SIZE := 4194304
IMAGE_SIZE := $(ralink_default_fw_size_32M)
KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma

This comment has been minimized.

@mkresin

mkresin Mar 6, 2017

Contributor

Any specific reason why you need a padding with 64bytes offset? Or is it just copy/paste? If the padding with offset isn't required, drop this line to use the default from https://github.com/lede-project/source/blob/master/target/linux/ramips/image/Makefile#L38

};

partition@200000 {
label = "firmware";

This comment has been minimized.

@mkresin

mkresin Mar 6, 2017

Contributor

You partitioning is wrong. Boards using NAND (rootfs in ubi) require an partition named ubi.

Depending on whether your bootloader is able to boot a kernel directly from ubi or not, it might be required to add an extra kernel partition as well.

According to your existing image build code, the bootloader doesn't have ubi support and isn't able to boot an kernel from ubi. According to your KERNEL_SIZE variable you expect to have an kernel partition of 4194304 byte.

BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4194304
IMAGE_SIZE := $(ralink_default_fw_size_32M)

This comment has been minimized.

@mkresin

mkresin Mar 6, 2017

Contributor

Your factory or kernel + ubi partition in the DTS doesn't match the size defined in the ralink_default_fw_size_32M variable.

@hqvv

This comment has been minimized.

Copy link

hqvv commented Mar 6, 2017

Thanks for your comments.
I have changed the description and host the u-boot on github. (I dont have source codes and have no idea how to build it)

If I change dts to

 	partition@0 {
		label = "u-boot";
		reg = <0x0 0x100000>;
		read-only;
	};

	partition@100000 {
		label = "SC PID";
		reg = <0x100000 0x100000>;
		read-only;
	};

	partition {
		label = "firmware";
		reg = <0x200000 0x2000000>;
	};

	partition@200000 {
		label = "kernel";
		reg = <0x200000 0x400000>;
	};

	partition@600000 {
		label = "ubi";
		reg = <0x600000 0x1c00000>;
	};

	factory: partition@2e00000 {
		label = "factory";
		reg = <0x2e00000 0x100000>;
		read-only;
	};

and Makefile to

define Device/r6220
  DTS := R6220
  BLOCKSIZE := 128k
  PAGESIZE := 2048
  KERNEL_SIZE := 4194304
  IMAGE_SIZE := 33554432
  KERNEL := $(KERNEL_DTB) | uImage lzma
  UBINIZE_OPTS := -E 5
  IMAGES += factory.bin
  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  IMAGE/factory.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi | check-size $$$$(IMAGE_SIZE)
  DEVICE_TITLE := Netgear R6220
  DEVICE_PACKAGES := kmod-usb2 kmod-mt76
endef
TARGET_DEVICES += r6220

factory.bin may boot, but sysupgrade.bin wont.
It goes to uboot directly.
I got this boot-log with factory.bin.

Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.410000] 7 ofpart partitions found on MTD device MT7621-NAND
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.420000] Creating 7 MTD partitions on "MT7621-NAND":
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.420000] 0x000000000000-0x000000100000 : "u-boot"
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.430000] 0x000000100000-0x000000200000 : "SC PID"
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.440000] 0x000000200000-0x000002200000 : "firmware"
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.900000] 2 uimage-fw partitions found on MTD device firmware
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.900000] 0x000000200000-0x000000600000 : "kernel"
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.910000] 0x000000600000-0x000002200000 : "ubi"
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.920000] 0x000000200000-0x000000600000 : "kernel"
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.920000] 0x000000600000-0x000002200000 : "ubi"
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.930000] 0x000002e00000-0x000002f00000 : "factory"
Mon Mar  6 05:02:53 2017 kern.notice kernel: [    2.930000] 0x000004200000-0x000007e00000 : "reserved"
Mon Mar  6 05:02:53 2017 kern.warn kernel: [    2.940000] [mtk_nand] probe successfully!

This might be caused by the 3rd part u-boot, but due to limited experience and resource (no nand flash writer on hand) , I wont take risk to switch back to stock bootloader to test it.

And I notice there is a related commit for similar device 77da939

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Mar 7, 2017

I have changed the description and host the u-boot on github. (I dont have source codes and have no idea how to build it)

Please explain why the default u-boot has to be replaced. What doesn't work with the default u-boot. Replacing a bootloader is really risky since it is quite easy to brick a board this way. If possible I would like to prevent that step.

If I change dts to ... It goes to uboot directly.

Please drop the firmware partition from your dts. It is replaced by the kernel and the ubi partition. If it still doesn't work, provide a (serial) log from sysupgrade and the following reboot.

And I notice there is a related commit for similar device 77da939

That should never have been merged since it is wrong. With every update the ubi partition is completely recreated. But the header of the ubi partition has informations about how often each block has been written. That information is used by the ubi subsystem to prevent wear leveling.

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Mar 7, 2017

Please don't link to external pages for the hardware description. Add the informations to the commit message instead. Same issue as hosting the bootloader on an external site. These sites tend to vanish but the commit message is available as long as the code is available.

Please remove the references to the bootlogs from the commit message. Better paste the bootlog contents into a comment here.

@hqvv

This comment has been minimized.

Copy link

hqvv commented Mar 7, 2017

@mkresin Many thanks for your help.
It works after firmware partition removed.

bootlog-factory.txt
bootlog-lede.txt

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Mar 7, 2017

The custom bootloader isn't mentioned any longer in the commit message but still used according to bootlog-lede.txt.

I will ask you the 3rd time now: Please explain why the default bootloader has to be replaced. What does not work with the default bootloader.

I saw the output "Sercomm Boot" in the factory bootlog. We have already one device which has some special code to create a valid sercom image. No idea if it's the same header/footer on your board.

@hqvv

This comment has been minimized.

Copy link

hqvv commented Mar 7, 2017

The 3rd part u-boot comes with webui, no signature verification, and DHCP was used for fail safe during development.
It is not required after the latest commit.
It appeared in the bootlog-lede.txt only because it still exists in my router.
I have no idea about limitation of the default bootloader, as I dont know how to recover the device if I flashed broken image.

A boot-log with default bootloader and LEDE image is attached below for your reference.
bootlog-lede-factory-bootloader.txt

@hqvv

This comment has been minimized.

Copy link

hqvv commented Mar 7, 2017

It seems I still have problem with sysupgrade.bin
with IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
after reboot, the router keep rebooting.
If I update this firmware in luci flashops, it could be upload and flash. but after reboot, nothing changes...
Could successfully boot, but stay with the firmware before update.
bootlog-lede-sysupgrade-tar.txt
mt7621.mk:

define Device/r6220
  DTS := R6220
  BLOCKSIZE := 128k
  PAGESIZE := 2048
  KERNEL_SIZE := 4194304
  IMAGE_SIZE := 33554432
  KERNEL := $(KERNEL_DTB) | uImage lzma
  UBINIZE_OPTS := -E 5
  IMAGES += kernel.bin rootfs.bin
  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
  IMAGE/kernel.bin := append-kernel
  IMAGE/rootfs.bin := append-ubi
  DEVICE_TITLE := Netgear R6220
  DEVICE_PACKAGES := kmod-usb2 kmod-mt76
endef
TARGET_DEVICES += r6220

Everything goes well with
IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
bootlog-lede-append-kernel-append-ubi.txt

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Mar 8, 2017

First of all, thanks a lot for doing the full test cycle after changing something in your PR. That is how it should be.

It seems I still have problem with sysupgrade.bin
with IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
after reboot, the router keep rebooting.

Yes, because your board is still not in platform_pre_upgrade() of target/linux/ramips/base-files/li/upgrade/platform.sh. Therefore, the update routine for not NAND based boards is used and fails.

It appeared in the bootlog-lede.txt only because it still exists in my router.

Would you please check whether it is possible to interrupt the original bootloader to get an u-boot prompt. This would be really helpful in case something went wrong with flashing. Some bootloader provide an http webinterface or try to load a firmware via tftp in case the reset button is pressed during power on. Please check this as well. The fist LEDE installation might me easier this way.

Please provide a bootlog which proves that the LEDE image is working with the original bootloader.

@pepe2k pepe2k added the ramips label Mar 8, 2017

@mkresin

mkresin approved these changes Mar 8, 2017

@hqvv

This comment has been minimized.

Copy link

hqvv commented Mar 9, 2017

bootlog-R6220lede_defaultBootloader.txt
Boot-log of r6220 LEDE with default Bootloader (starts from sysupgrade.tar upgrading )

I have failed to interrupt the bootloader with Ctrl + c.
Hold reset and power-on may access to recovery mode, no dhcp and no webinterface available.
Which might requires tftp and a factory.img to used it. know nothing about the structure of the IMG file and not sure the IMG should be signed or not.
I dont want to brick my router, so I wont play with factory bootloader any further.
somebody else may help on this.

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Mar 9, 2017

Boot-log of r6220 LEDE with default Bootloader (starts from sysupgrade.tar upgrading )

The serial console does not work correct with the default bootloader. The output stops at:

[    2.260000] console [ttyS0] disabled

Would you please add the following to your dts similar like it is done in target/linux/ramips/dts/ArcherC50.dts

chosen {
	bootargs = "console=ttyS0,115200";
};

and provide a new bootlog.

@hqvv

This comment has been minimized.

Copy link

hqvv commented Mar 9, 2017

bootlog-R6220lede_defaultBootloader_57600.txt

Sorry... I had provided a wrong bootlog file by mistake.
The byterate of default bootloader is 57600, should I change DTS accordantly?

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Mar 10, 2017

The byterate of default bootloader is 57600, should I change DTS accordantly?

No if it is working out of the box nothing needs to be added to the DTS.

@mkresin mkresin removed the needs changes label Mar 10, 2017

@bobafetthotmail

This comment has been minimized.

Copy link
Contributor

bobafetthotmail commented Mar 10, 2017

The byterate of default bootloader is 57600, should I change DTS accordantly?

Can you add this information in the commit description? Not just here on github PR.

Name=到 的链接
Type=Link
URL=file:///home/hq/push/source/target/linux/ramips/dts/R6220.dts
Icon=audio-vnd.dts

This comment has been minimized.

@blogic

blogic Mar 11, 2017

Contributor

this file looks odd and should not be here

This comment has been minimized.

@hqvv

hqvv Mar 11, 2017

My mistake, I could be created by VS code automatically.

ramips: add support for Netgear R6220 …
This patch adds support for the Netgear R6220, aka Netgear AC1200 and R6220-100NAS.

Specification:
- SoC: MediaTek MT7621ST (880 MHz)
- Falsh: 128 MiB (Macronix MX30LF1G08AA-TI)
- RAM: 128 MiB (Nanya NT5CB64M16FP-DH)
- Wireless: MediaTek MT7603EN b/g/n , MediaTek MT7612EN an+ac
- LAN speed: 10/100/1000
- LAN ports: 4
- WAN speed: 10/100/1000
- WAN ports: 1
- Serial baud rate of Bootloader and factory firmware: 57600

Installation through telnet:
- Copy kernel.bin and rootfs.bin to a USB flash disk, plug to usb port on the router.
- Enable telnet with link: http://192.168.1.1/setup.cgi?todo=debug (login if required, default: admin password)
- You will see "Debug Enabled!"
- Telnet 192.168.1.1 and login with "root"
- ls /mnt/shares/ to find out path of your USB disk. 'myUdisk' for example.
- cd /mnt/shares/myUdisk
- mtd_write write rootfs.bin Rootfs
- mtd_write write kernel.bin Kernel
- reboot

Signed-off-by: Hanqing Wong <hquu@outlook.com>
@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Mar 11, 2017

I've merged your PR into my staging tree. I've applied the following changes to bring it finally to an end:

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index cf4f456..a90cf17 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -122,15 +122,14 @@ define Device/r6220
   DTS := R6220
   BLOCKSIZE := 128k
   PAGESIZE := 2048
-  KERNEL_SIZE := 4194304
+  KERNEL_SIZE := 4096k
   KERNEL := $(KERNEL_DTB) | uImage lzma
-  IMAGE_SIZE := 33554432
+  IMAGE_SIZE := 28672k
   UBINIZE_OPTS := -E 5
-  IMAGES := sysupgrade.tar kernel.bin rootfs.bin factory.bin
+  IMAGES := sysupgrade.tar kernel.bin rootfs.bin
   IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
   IMAGE/kernel.bin := append-kernel
-  IMAGE/rootfs.bin := append-ubi
-  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
+  IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
   DEVICE_TITLE := Netgear R6220
   DEVICE_PACKAGES := kmod-usb2 kmod-mt76
 endef
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 05ffbeb..7b12d97 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -229,11 +229,11 @@ platform_check_image() {
 		}
 		return 0
 		;;
-	hc5962)
+	hc5962|\
+	r6220)
 		# these boards use metadata images
 		return 0
 		;;
-	r6220|\
 	ubnt-erx)
 		nand_do_platform_check "$board" "$1"
 		return $?;

Which are:

  • dropped the factory.bin as it isn't required (no idea why you added it again)
  • use the kilo suffix for sizes
  • set the max image size according to the stock firmware bootlog (0x000000600000-0x000002200000 : "Rootfs" 2048K)
  • add a size check to teh rootfs.bin to make sure it doesn'T get bigger than the stock firmware rootfs partition
  • skip the nand_do_platform_check (we have meta-data and the image validation is done based on the meta-data, no need to do this extra check)

Please build an image from my staging tree, do the full test cycle and report the result here.

@mkresin mkresin closed this Mar 11, 2017

@hqvv

This comment has been minimized.

Copy link

hqvv commented Mar 12, 2017

@mkresin Thanks for your help, I am OK with these changes.
boot-log with new codes is attached for your reference. (started from factory firmware)
bootlog_lede_final.txt

I noticed that NMRP https://github.com/jclehner/nmrpflash could be used to recover to factory firmware if a broken image was flashed. (normal tftp is not working)
nmrpflash.exe -i net0 -a 192.168.1.1 -f R6220_V1.1.0.34_1.0.1.img
reboot router and wait for 5+ mins to complete.

NMRP.txt

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Mar 12, 2017

I'll add the recover to netgear firmware hint to the commit message.

But as already written, it shouldn't be that difficult to build a LEDE firmware image that can be flash via the webinterface or via nmrpflash. The R6220 firmware format looks quite similar to the one used by the Netgear DGN3500 according to binwalk.

@realopty

This comment has been minimized.

Copy link

realopty commented Apr 1, 2017

r6220_first_dmesg.txt
3.010000] mtk_soc_eth 1e100000.ethernet: generated random MAC address ca:cb:e5:40:42:af
[ 10.260000] mt7603e 0000:02:00.0: Invalid MAC address, using random address c6:c2:2e:ef:e0:94

anyone else seeing this issue?

@realopty

This comment has been minimized.

Copy link

realopty commented Apr 8, 2017

So the reason for the random MAC address bug is because the partitions don't load correctly, there for failure to read eeprom "factory" partition at the correct offsets. Here is an updated and correct DTS: https://pastebin.com/551B5TH9

but ive not had any success.

See: https://pastebin.com/3nSuUGj6

Can anyone explain why mtd10 factory shows up under mtd9?

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Apr 8, 2017

You should start to discribe what you are trying to do and what issue you are trying to fix. The factory partition in your dts is at the same position as with the existing dts (0x2E00000). So no change here.

According to the hexdump from the factory partition you have provided to nbd in IRC everything is fine. The 1st caldata is at 0x0, the 2nd caldata is at 0x8000 of the factory partition. Like it is defined in the dts. Have you done the hexdump from the netgear firmware or was it done running LEDE?

The bootlogs provided by @hqvv do not show a random mac issues. But might be that there are different revisions of the board with the caldata at different offset. Not sure yet.

@realopty

This comment has been minimized.

Copy link

realopty commented Apr 9, 2017

Issue: Random mac address on every boot. Kernel crashes at times. Wifi not usable. All because the data is not being correctly read from "factory" partition.

The hexdump given to nbd on IRC was done using the routers default firmware. After installing LEDE and doing a hexdump on the factory partition it returns contents of the partition@2f00000 {label = "SC Private Data";};

LEDE: first dmesg https://pastebin.com/RNzXCHX5
LEDE: partition info & hexdumps: https://pastebin.com/kFsU3Mr6
please see: https://forum.lede-project.org/t/lede-on-netgear-r6220/2791/2

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Apr 10, 2017

please see: https://forum.lede-project.org/t/lede-on-netgear-r6220/2791/2

This thread is about another issue and you hijacked the thread. But yes, I've noticed that according to bootlog the user has the same issue.

Would you please run the following command using the routers default firmware and post the output here:

for mtd in $(ls /sys/class/mtd/); do cat /sys/class/mtd/${mtd}/name; cat /sys/class/mtd/${mtd}/offset; cat /sys/class/mtd/${mtd}/size; done
@realopty

This comment has been minimized.

Copy link

realopty commented Apr 10, 2017

for mtd in $(ls /sys/class/mtd/); do cat /sys/class/mtd/${mtd}/name; cat /sys/

class/mtd/${mtd}/offset; cat /sys/class/mtd/${mtd}/size; done
Bootloader
cat: can't open '/sys/class/mtd/mtd0/offset': No such file or directory
1048576
cat: can't open '/sys/class/mtd/mtd0ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd0ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd0ro/size': No such file or directory
SC PID
cat: can't open '/sys/class/mtd/mtd1/offset': No such file or directory
1048576
Factory
cat: can't open '/sys/class/mtd/mtd10/offset': No such file or directory
1048576
cat: can't open '/sys/class/mtd/mtd10ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd10ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd10ro/size': No such file or directory
SC Private Data
cat: can't open '/sys/class/mtd/mtd11/offset': No such file or directory
1048576
cat: can't open '/sys/class/mtd/mtd11ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd11ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd11ro/size': No such file or directory
POT
cat: can't open '/sys/class/mtd/mtd12/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd12ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd12ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd12ro/size': No such file or directory
Traffic Meter
cat: can't open '/sys/class/mtd/mtd13/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd13ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd13ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd13ro/size': No such file or directory
DPF
cat: can't open '/sys/class/mtd/mtd14/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd14ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd14ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd14ro/size': No such file or directory
SC Nvram
cat: can't open '/sys/class/mtd/mtd15/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd15ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd15ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd15ro/size': No such file or directory
Ralink Nvram
cat: can't open '/sys/class/mtd/mtd16/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd16ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd16ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd16ro/size': No such file or directory
Ralink Reserved
cat: can't open '/sys/class/mtd/mtd17/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd17ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd17ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd17ro/size': No such file or directory
ML6
cat: can't open '/sys/class/mtd/mtd18/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd18ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd18ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd18ro/size': No such file or directory
Upgrade Flag
cat: can't open '/sys/class/mtd/mtd19/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd19ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd19ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd19ro/size': No such file or directory
cat: can't open '/sys/class/mtd/mtd1ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd1ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd1ro/size': No such file or directory
Kernel
cat: can't open '/sys/class/mtd/mtd2/offset': No such file or directory
4194304
Reserved Block3
cat: can't open '/sys/class/mtd/mtd20/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd20ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd20ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd20ro/size': No such file or directory
Reserved Block4
cat: can't open '/sys/class/mtd/mtd21/offset': No such file or directory
62914560
cat: can't open '/sys/class/mtd/mtd21ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd21ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd21ro/size': No such file or directory
cat: can't open '/sys/class/mtd/mtd2ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd2ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd2ro/size': No such file or directory
Rootfs
cat: can't open '/sys/class/mtd/mtd3/offset': No such file or directory
29360128
cat: can't open '/sys/class/mtd/mtd3ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd3ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd3ro/size': No such file or directory
English UI
cat: can't open '/sys/class/mtd/mtd4/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd4ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd4ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd4ro/size': No such file or directory
ML1
cat: can't open '/sys/class/mtd/mtd5/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd5ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd5ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd5ro/size': No such file or directory
ML2
cat: can't open '/sys/class/mtd/mtd6/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd6ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd6ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd6ro/size': No such file or directory
ML3
cat: can't open '/sys/class/mtd/mtd7/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd7ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd7ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd7ro/size': No such file or directory
ML4
cat: can't open '/sys/class/mtd/mtd8/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd8ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd8ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd8ro/size': No such file or directory
ML5
cat: can't open '/sys/class/mtd/mtd9/offset': No such file or directory
2097152
cat: can't open '/sys/class/mtd/mtd9ro/name': No such file or directory
cat: can't open '/sys/class/mtd/mtd9ro/offset': No such file or directory
cat: can't open '/sys/class/mtd/mtd9ro/size': No such file or directory

@mkresin

This comment has been minimized.

Copy link
Contributor

mkresin commented Apr 10, 2017

Okay mtd10 is your factory partition using the router default firmware. Unfortunately there doesn't seam to be support for the really interesting information "offset". Would you please check if there is anything similar to offset in /sys/class/mtd/mtd10/.

@topillar

This comment has been minimized.

Copy link

topillar commented Apr 12, 2017

why my mtd3 doesn't show as ubi?

cat /proc/mtd

dev: size erasesize name
mtd0: 00100000 00020000 "Bootloader"
mtd1: 00100000 00020000 "SC PID" 00100000
mtd2: 00400000 00020000 "Kernel" 00200000
mtd3: 01c00000 00020000 "Rootfs" 00600000
mtd4: 00200000 00020000 "English UI" 02200000
mtd5: 00200000 00020000 "ML1" 02400000
mtd6: 00200000 00020000 "ML2" 02600000
mtd7: 00200000 00020000 "ML3" 02800000
mtd8: 00200000 00020000 "ML4" 02a00000
mtd9: 00200000 00020000 "ML5" 02c00000
mtd10: 00100000 00020000 "Factory" 02e00000
mtd11: 00100000 00020000 "SC Private Data" 02f00000
mtd12: 00200000 00020000 "POT" 03000000
mtd13: 00200000 00020000 "Traffic Meter" 03200000
mtd14: 00200000 00020000 "DPF" 03400000
mtd15: 00200000 00020000 "SC Nvram" 03600000
mtd16: 00200000 00020000 "Ralink Nvram" 03800000
mtd17: 00200000 00020000 "Ralink Reserved" 03a00000
mtd18: 00200000 00020000 "ML6" 03c00000
mtd19: 00200000 00020000 "Upgrade Flag" 03e00000
mtd20: 00200000 00020000 "Reserved Block3" 04000000
mtd21: 03c00000 00020000 "Reserved Block4" 04200000

@dschaper

This comment has been minimized.

Copy link

dschaper commented Aug 15, 2017

I've just picked up one of these and if there's still any interest, I'm willing to help to the extent that I am able.

@mlasar

This comment has been minimized.

Copy link

mlasar commented Nov 29, 2017

Hello,
I have a problem. I want to install LEDE on Netgear R6220, but I have a problem.
I do by https://emersion.fr/blog/2017/installing-lede-on-a-netgear-r6220/ instraction, after “mtd_write write lede-ramips-mt7621-r6220-squashfs-rootfs.bin Rootfs” I got error:
Cound’t open mpd device: Rootfs
Can’t open device for writing!
What’s wrong?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment