Re: [OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
2013.11.10. 11:58 keltezéssel, Stefan Agner írta: > Nevermind, the second time it worked: > > [2.71] UBI: attaching mtd8 to ubi0 > [2.74] UBI: EOF marker found, PEBs from 17 will be erased > [2.74] UBI: scanning is finished > [2.77] gluebi (pid 1): gluebi_resized: got update notification > for unknown UBI device 0 volume 1 > [2.78] UBI: volume 1 ("rootfs_data") re-sized from 1 to 146 LEBs > [2.79] UBI: attached mtd8 (name "ubiroot", size 23 MiB) to ubi0 > [2.80] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 > bytes > [2.81] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size > 2048 > [2.81] UBI: VID header offset: 2048 (aligned 2048), data offset: > 4096 > [2.82] UBI: good PEBs: 184, bad PEBs: 0, corrupted PEBs: 0 > [2.82] UBI: user volume: 2, internal volumes: 1, max. volumes > count: 128 > [2.83] UBI: max/mean erase counter: 1/0, WL threshold: 4096, > image sequence number: 1699075075 > [2.84] UBI: available PEBs: 0, total reserved PEBs: 184, PEBs > reserved for bad PEB handling: 20 > [2.85] UBI: background thread "ubi_bgt0d" started, PID 263 > [2.86] mtd: device 12 (rootfs) set to be root filesystem > [2.87] VFS: Mounted root (squashfs filesystem) readonly on > device 31:12. > > Probably because I made no make clean before building the new image with > those EOF marker? Yes, that was the reason. Without make clean, the required kernel patch has not been applied. -Gabor ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
Nevermind, the second time it worked: [2.71] UBI: attaching mtd8 to ubi0 [2.74] UBI: EOF marker found, PEBs from 17 will be erased [2.74] UBI: scanning is finished [2.77] gluebi (pid 1): gluebi_resized: got update notification for unknown UBI device 0 volume 1 [2.78] UBI: volume 1 ("rootfs_data") re-sized from 1 to 146 LEBs [2.79] UBI: attached mtd8 (name "ubiroot", size 23 MiB) to ubi0 [2.80] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes [2.81] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 [2.81] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096 [2.82] UBI: good PEBs: 184, bad PEBs: 0, corrupted PEBs: 0 [2.82] UBI: user volume: 2, internal volumes: 1, max. volumes count: 128 [2.83] UBI: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1699075075 [2.84] UBI: available PEBs: 0, total reserved PEBs: 184, PEBs reserved for bad PEB handling: 20 [2.85] UBI: background thread "ubi_bgt0d" started, PID 263 [2.86] mtd: device 12 (rootfs) set to be root filesystem [2.87] VFS: Mounted root (squashfs filesystem) readonly on device 31:12. Probably because I made no make clean before building the new image with those EOF marker? -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
> Weird. For me it was working only at the first boot after flashing the image, > but any modifications in the fs has been lost after subsequent reboots. Hm, might be I did not looked at that correctly. Altough, I installed some packages and I think they were still there after reboot... Just updated to latest master and flashed the image using Factory Reset (U-Boot TFTP-Server). The flashing worked fine, but I now get an error on bootup: [2.71] UBI: attaching mtd8 to ubi0 [2.79] UBI error: scan_peb: bad image sequence number 248591051 in PEB 63, expected 172450884 [2.80] Erase counter header dump: [2.81] magic 0x55424923 [2.81] version1 [2.81] ec 1 [2.82] vid_hdr_offset 2048 [2.82] data_offset4096 [2.82] image_seq 248591051 [2.83] hdr_crc0x98ac164 [2.83] erase counter header hexdump: [2.83] UBI error: ubi_attach_mtd_dev: failed to attach mtd8, error -22 [2.84] UBI error: ubi_init: cannot attach mtd8 [2.85] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6 It looks like there's a bug in the new EOF marker support. I looked into the code, I found this interesting comment just before the "bad image sequence" error message: /* * Make sure that all PEBs have the same image sequence number. * This allows us to detect situations when users flash UBI * images incorrectly, so that the flash has the new UBI image * and leftovers from the old one. This feature was added * relatively recently, and the sequence number was always * zero, because old UBI implementations always set it to zero. * For this reasons, we do not panic if some PEBs have zero * sequence number, while other PEBs have non-zero sequence * number. */ -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
Hi Stefan, <...> >> Correct. I had to modify ubox to make it work correctly with JFFS2 on >> emulated >> MTD devices. > On my device, when using ubox without any patchs, I get errors, but it > worked somehow... Weird. For me it was working only at the first boot after flashing the image, but any modifications in the fs has been lost after subsequent reboots. > I already tested UBIFS on the device by manually overlaying it, > technically things look good. But to support proper UBIFS instead of > JFFS2 we would need another bunch of changes to ubox and also quite a > lot of changes to the init scripts. What do you think, were to begin on > this matter? I have no idea, I did not look into that too deep yet. >> AFAIK the WAN port is not connected to the second ethernet interface, so we >> are >> using VLANs to separate that from the LAN ports. It is working, but >> currently it >> uses the same MAC address as the LAN interface. Additionally, this MAC >> address >> is a randomly genereated one. We should read the correct MAC from the flash >> and >> set the interface MAC addresses based on that. > You're right, its already configured correctly on eth0.2. Just tested > the WAN port, looks good on my device. > > Thanks for your great work! Having mainline OpenWRT on it, I really like > this device! ;) -Gabor ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
Hi Gabor Am 2013-11-06 10:14, schrieb Gabor Juhos: > I have applied both patches, although I did several modifications in those. Cool, thanks! Just compiled an image and flashed it, works fine on my device! >> By creating a file system manually I tested using UBIFS instead of JFFS2 >> as the overlaying file system, it seems to work. However, userspace >> utilities (ubox) need to be altered in order to support this properly. > > Correct. I had to modify ubox to make it work correctly with JFFS2 on emulated > MTD devices. On my device, when using ubox without any patchs, I get errors, but it worked somehow... I already tested UBIFS on the device by manually overlaying it, technically things look good. But to support proper UBIFS instead of JFFS2 we would need another bunch of changes to ubox and also quite a lot of changes to the init scripts. What do you think, were to begin on this matter? > AFAIK the WAN port is not connected to the second ethernet interface, so we > are > using VLANs to separate that from the LAN ports. It is working, but currently > it > uses the same MAC address as the LAN interface. Additionally, this MAC address > is a randomly genereated one. We should read the correct MAC from the flash > and > set the interface MAC addresses based on that. You're right, its already configured correctly on eth0.2. Just tested the WAN port, looks good on my device. Thanks for your great work! Having mainline OpenWRT on it, I really like this device! -- Stefan ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
Hi Stefan, Sorry for the dealy. > This replaces my patch sent in September. I rebased the changes to > master as of today. Also I altered the functionality; The image now uses > squashfs and JFFS2 on UBI (using GLUEBI) in order to provide proper NAND > support. Its not the final solution, but works right now out of the box > regarding user space utilites. Would be nice to see this initial support > upstream. I have applied both patches, although I did several modifications in those. > By creating a file system manually I tested using UBIFS instead of JFFS2 > as the overlaying file system, it seems to work. However, userspace > utilities (ubox) need to be altered in order to support this properly. Correct. I had to modify ubox to make it work correctly with JFFS2 on emulated MTD devices. > > Gabor, I also noticed that the WAN port on this device does not work > yet. I looked into the code, the platform code only registers one > ethernet device right now. Do you know whats missing there to make WAN > working? AFAIK the WAN port is not connected to the second ethernet interface, so we are using VLANs to separate that from the LAN ports. It is working, but currently it uses the same MAC address as the LAN interface. Additionally, this MAC address is a randomly genereated one. We should read the correct MAC from the flash and set the interface MAC addresses based on that. -Gabor ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/2] Initial NAND support for WNDR4300
Hi, This replaces my patch sent in September. I rebased the changes to master as of today. Also I altered the functionality; The image now uses squashfs and JFFS2 on UBI (using GLUEBI) in order to provide proper NAND support. Its not the final solution, but works right now out of the box regarding user space utilites. Would be nice to see this initial support upstream. By creating a file system manually I tested using UBIFS instead of JFFS2 as the overlaying file system, it seems to work. However, userspace utilities (ubox) need to be altered in order to support this properly. Gabor, I also noticed that the WAN port on this device does not work yet. I looked into the code, the platform code only registers one ethernet device right now. Do you know whats missing there to make WAN working? -- Stefan Stefan Agner (2): ar71xx: Add new subtarget nand for WNDR4300 ar71xx: Generate UBI image for WNDR4300 target/linux/ar71xx/Makefile | 2 +- target/linux/ar71xx/image/Makefile | 97 -- target/linux/ar71xx/image/ubinize.cfg| 29 +++ target/linux/ar71xx/nand/config-default | 119 +++ target/linux/ar71xx/nand/profiles/netgear.mk | 22 + target/linux/ar71xx/nand/target.mk | 8 ++ 6 files changed, 269 insertions(+), 8 deletions(-) create mode 100644 target/linux/ar71xx/image/ubinize.cfg create mode 100644 target/linux/ar71xx/nand/config-default create mode 100644 target/linux/ar71xx/nand/profiles/netgear.mk create mode 100644 target/linux/ar71xx/nand/target.mk -- 1.8.4.2 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel