Re: [OpenWrt-Devel] WRT160NL new bootloader fix
Bernhard Loos írta: Hello This is the final patch with the uci-default script from Otto Solares. Would be nice, if somebody could commit this. Added in r20522-r20526 with some fixes. Thanks! -Gabor ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
Hello This is the final patch with the uci-default script from Otto Solares. Would be nice, if somebody could commit this. Bernhard wrt160nl-fixtrx.diff Description: Binary data ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
Seems a bit like overkill to me, but I guess that's not my call to make. Thanks for your patch and your tests. Bernhard 2010/3/24 Otto Solares so...@guug.org: On Wed, Mar 24, 2010 at 02:39:51PM +0100, Bernhard Loos wrote: After a suggestion from xMff, I dedicded to use a uci-defaults script, as this should fit the needs. Use it instead of the firstboot script in the original patch. I can't test it, as I don't have the device with me right now, but it's trivial. Based on others ar71xx uci-defaults scripts and yours I think the attached patch is a little better. Tested successfully with your original patch in both pure jffs2 and squashfs and it works fine. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
After a suggestion from xMff, I dedicded to use a uci-defaults script, as this should fit the needs. Use it instead of the firstboot script in the original patch. I can't test it, as I don't have the device with me right now, but it's trivial. Bernhard 2010/3/22 Otto Solares so...@guug.org: On Sat, Mar 20, 2010 at 06:14:08PM +0100, Jo-Philipp Wich wrote: I think the real issue is that the preinit hook used by the fix script is not executed on jffs2-only images. Exactly, this script is added to the switch2jffs hooks which aren't executed on a pure jffs2 image. It seems there are just 2 hooks: switch2jffs and jffs2reset, neither seems appropiate for this kind of scripts. It would be nice to have another independent of filesystems hook but I'm not a preinit expert as it seems to me a little overcomplicated, hopefully someone who knows can give the OP advice as his fix is necesary. Thank you! - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel fixtrx.diff Description: Binary data ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
On Wed, Mar 24, 2010 at 02:39:51PM +0100, Bernhard Loos wrote: After a suggestion from xMff, I dedicded to use a uci-defaults script, as this should fit the needs. Use it instead of the firstboot script in the original patch. I can't test it, as I don't have the device with me right now, but it's trivial. Based on others ar71xx uci-defaults scripts and yours I think the attached patch is a little better. Tested successfully with your original patch in both pure jffs2 and squashfs and it works fine. - Otto Index: target/linux/ar71xx/base-files/etc/uci-defaults/wrt160nl === --- target/linux/ar71xx/base-files/etc/uci-defaults/wrt160nl (revision 0) +++ target/linux/ar71xx/base-files/etc/uci-defaults/wrt160nl (revision 0) @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Copyright (C) 2010 OpenWrt.org +# + +. /lib/ar71xx.sh + +board=$(ar71xx_board_name) + +wrt160nl_fixtrx() { + mtd -o 32 fixtrx firmware +} + +if [ ${board} == wrt160nl ]; then + wrt160nl_fixtrx +fi Property changes on: target/linux/ar71xx/base-files/etc/uci-defaults/wrt160nl ___ Added: svn:executable + * ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
On Sat, Mar 20, 2010 at 01:38:58PM +0100, Matthias Buecher / Germany wrote: Is the script set to executable (+x) in the image? This is typical for scripts that are presebt but not running, and often overlooked. Scripts in /lib/firstboot are not executable as they are sourced and not executed directly so that's not the problem here. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
On Sat, Mar 20, 2010 at 06:14:08PM +0100, Jo-Philipp Wich wrote: I think the real issue is that the preinit hook used by the fix script is not executed on jffs2-only images. Exactly, this script is added to the switch2jffs hooks which aren't executed on a pure jffs2 image. It seems there are just 2 hooks: switch2jffs and jffs2reset, neither seems appropiate for this kind of scripts. It would be nice to have another independent of filesystems hook but I'm not a preinit expert as it seems to me a little overcomplicated, hopefully someone who knows can give the OP advice as his fix is necesary. Thank you! - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
Is the script set to executable (+x) in the image? This is typical for scripts that are presebt but not running, and often overlooked. Maddes On 20.03.2010 04:02, Otto Solares wrote: It works on squashfs but didn't on pure jffs2 which I pressume was our only environment difference. The logcat diff between jffs2 and squashfs seems to be: +user.info sysinit: Trying to fix trx header in firmware at 0x20... +user.info sysinit: New crc32: 0x407d9371, rewriting block +user.info sysinit: Done. +user.warn kernel: jffs2_scan_eraseblock(): End of filesystem marker found at 0x0 +user.warn kernel: jffs2_build_filesystem(): unlocking the mtd device... done. +user.warn kernel: jffs2_build_filesystem(): erasing all blocks after the end marker... done. +user.info sysinit: copying files ... done +user.info kernel: mini_fo: using base directory: / +user.info kernel: mini_fo: using storage directory: /jffs Obviously it's not running on pure jffs2 images but it seems to me a bug in the firstboot scripts unrelated to your patch... - Otto On Fri, Mar 19, 2010 at 08:12:24PM -0600, Otto Solares wrote: Rechecked and yes, I'm using your latest patch and at boot the file /lib/firstboot/25_fixtrx is there but next boot lose the firmware. BTW I'm just using pure jffs2 image, will test squashfs and let you know. - Otto On Sat, Mar 20, 2010 at 02:27:29AM +0100, Bernhard Loos wrote: Are you really sure, you used the second patch I posted and the firstboot script is included in the image? 2010/3/20 Otto Solares so...@guug.org: On Fri, Mar 19, 2010 at 06:34:03PM -0600, Otto Solares wrote: On Fri, Mar 19, 2010 at 11:25:40AM -0600, Otto Solares wrote: On Fri, Mar 19, 2010 at 04:53:34PM +0100, Bernhard Loos wrote: Does this happen directly after flashing or only after a reboot? After the first reboot. If openwrt does come up at least once, could you run mtd -o 32 fixtrx firmware and give me the output? Yes, it comes up once and for the next reboot/power-cycle it lose the firmware and waits for a TFTP firmware. I'm not near this new WRT160NL so I'll send you the output later. r...@openwrt:~# mtd -o 32 fixtrx firmware Trying to fix trx header in firmware at 0x20... New crc32: 0x73ea777a, rewriting block Done. FYI after this command it always boots fine now. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I think the real issue is that the preinit hook used by the fix script is not executed on jffs2-only images. ~ JoW -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkulAmAACgkQdputYINPTPPZwwCgkWvDJlE47VUOSF2AGUjo9ElL lHQAn1usY0FAEEODB2cpf83lv4VCHYNO =kHZX -END PGP SIGNATURE- ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
Does this happen directly after flashing or only after a reboot? If openwrt does come up at least once, could you run mtd -o 32 fixtrx firmware and give me the output? 2010/3/19 Otto Solares so...@guug.org: On Wed, Mar 17, 2010 at 05:34:33PM +0100, Bernhard Loos wrote: Hello I forgot to svn add the firstboot script, that actually calls mtd to fix the trx, sorry about that. Here is the complete patch again. Bernhard Hello Bernhard, FYI I try your patch on my newer WRT160NL but it lost again the new firmware on boot and just sits waiting for a TFTP put from the network. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
2010/3/19 W. Michael Petullo m...@flyn.org: The WRT160NL gets shipped with a new bootloader since some time, which actually checks the checksum in the trx image header. As the checksummed area includes the jffs2 start marker, this will blow up after first boot. This patch fixes this by adding a new funktion to mtd (fixtrx) which is called in firstboot. Nice patch. I was waiting for something like this since months. Some brcm63xx devices like Pirelli Alice Business Gate 2 Plus (1) and Alice Gate W2+ (2) has the same problem. Can this patch be extended to support this router's CFE bootloader? I'm a WRT160NL user, but I do not have this new hardware revision. However, I am working on some documentation that I hope will be applicable to the new hardware revision. Can anyone comment on when this should make it to subversion (I don't see the patch in Trac yet)? Could someone provide the symptoms of using the new hardware without this change? I understand this as the system will not boot the flash image. Is this correct? You can boot openwrt only once after flashing. On the second boot, the bootloader will throw a checksum mismatched error (if you have a serial cable attached to see it). Could anyone provide any different markings that identify the new hardware revision from older revisions? Not sure about serial numbers, the only but the bootloader version is different. Are the changes made transparent to the older hardware revision? That is, will a new build continue to work on the old hardware with no configuration change? It shouldn't affect older hardware. Thanks! -- Mike :wq ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
On Fri, Mar 19, 2010 at 04:53:34PM +0100, Bernhard Loos wrote: Does this happen directly after flashing or only after a reboot? After the first reboot. If openwrt does come up at least once, could you run mtd -o 32 fixtrx firmware and give me the output? Yes, it comes up once and for the next reboot/power-cycle it lose the firmware and waits for a TFTP firmware. I'm not near this new WRT160NL so I'll send you the output later. Thank you for looking into this! - Otto 2010/3/19 Otto Solares so...@guug.org: On Wed, Mar 17, 2010 at 05:34:33PM +0100, Bernhard Loos wrote: Hello I forgot to svn add the firstboot script, that actually calls mtd to fix the trx, sorry about that. Here is the complete patch again. Bernhard Hello Bernhard, FYI I try your patch on my newer WRT160NL but it lost again the new firmware on boot and just sits waiting for a TFTP put from the network. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
On Fri, Mar 19, 2010 at 11:25:40AM -0600, Otto Solares wrote: On Fri, Mar 19, 2010 at 04:53:34PM +0100, Bernhard Loos wrote: Does this happen directly after flashing or only after a reboot? After the first reboot. If openwrt does come up at least once, could you run mtd -o 32 fixtrx firmware and give me the output? Yes, it comes up once and for the next reboot/power-cycle it lose the firmware and waits for a TFTP firmware. I'm not near this new WRT160NL so I'll send you the output later. r...@openwrt:~# mtd -o 32 fixtrx firmware Trying to fix trx header in firmware at 0x20... New crc32: 0x73ea777a, rewriting block Done. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
On Fri, Mar 19, 2010 at 06:34:03PM -0600, Otto Solares wrote: On Fri, Mar 19, 2010 at 11:25:40AM -0600, Otto Solares wrote: On Fri, Mar 19, 2010 at 04:53:34PM +0100, Bernhard Loos wrote: Does this happen directly after flashing or only after a reboot? After the first reboot. If openwrt does come up at least once, could you run mtd -o 32 fixtrx firmware and give me the output? Yes, it comes up once and for the next reboot/power-cycle it lose the firmware and waits for a TFTP firmware. I'm not near this new WRT160NL so I'll send you the output later. r...@openwrt:~# mtd -o 32 fixtrx firmware Trying to fix trx header in firmware at 0x20... New crc32: 0x73ea777a, rewriting block Done. FYI after this command it always boots fine now. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
Rechecked and yes, I'm using your latest patch and at boot the file /lib/firstboot/25_fixtrx is there but next boot lose the firmware. BTW I'm just using pure jffs2 image, will test squashfs and let you know. - Otto On Sat, Mar 20, 2010 at 02:27:29AM +0100, Bernhard Loos wrote: Are you really sure, you used the second patch I posted and the firstboot script is included in the image? 2010/3/20 Otto Solares so...@guug.org: On Fri, Mar 19, 2010 at 06:34:03PM -0600, Otto Solares wrote: On Fri, Mar 19, 2010 at 11:25:40AM -0600, Otto Solares wrote: On Fri, Mar 19, 2010 at 04:53:34PM +0100, Bernhard Loos wrote: Does this happen directly after flashing or only after a reboot? After the first reboot. If openwrt does come up at least once, could you run mtd -o 32 fixtrx firmware and give me the output? Yes, it comes up once and for the next reboot/power-cycle it lose the firmware and waits for a TFTP firmware. I'm not near this new WRT160NL so I'll send you the output later. r...@openwrt:~# mtd -o 32 fixtrx firmware Trying to fix trx header in firmware at 0x20... New crc32: 0x73ea777a, rewriting block Done. FYI after this command it always boots fine now. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
It works on squashfs but didn't on pure jffs2 which I pressume was our only environment difference. The logcat diff between jffs2 and squashfs seems to be: +user.info sysinit: Trying to fix trx header in firmware at 0x20... +user.info sysinit: New crc32: 0x407d9371, rewriting block +user.info sysinit: Done. +user.warn kernel: jffs2_scan_eraseblock(): End of filesystem marker found at 0x0 +user.warn kernel: jffs2_build_filesystem(): unlocking the mtd device... done. +user.warn kernel: jffs2_build_filesystem(): erasing all blocks after the end marker... done. +user.info sysinit: copying files ... done +user.info kernel: mini_fo: using base directory: / +user.info kernel: mini_fo: using storage directory: /jffs Obviously it's not running on pure jffs2 images but it seems to me a bug in the firstboot scripts unrelated to your patch... - Otto On Fri, Mar 19, 2010 at 08:12:24PM -0600, Otto Solares wrote: Rechecked and yes, I'm using your latest patch and at boot the file /lib/firstboot/25_fixtrx is there but next boot lose the firmware. BTW I'm just using pure jffs2 image, will test squashfs and let you know. - Otto On Sat, Mar 20, 2010 at 02:27:29AM +0100, Bernhard Loos wrote: Are you really sure, you used the second patch I posted and the firstboot script is included in the image? 2010/3/20 Otto Solares so...@guug.org: On Fri, Mar 19, 2010 at 06:34:03PM -0600, Otto Solares wrote: On Fri, Mar 19, 2010 at 11:25:40AM -0600, Otto Solares wrote: On Fri, Mar 19, 2010 at 04:53:34PM +0100, Bernhard Loos wrote: Does this happen directly after flashing or only after a reboot? After the first reboot. If openwrt does come up at least once, could you run mtd -o 32 fixtrx firmware and give me the output? Yes, it comes up once and for the next reboot/power-cycle it lose the firmware and waits for a TFTP firmware. I'm not near this new WRT160NL so I'll send you the output later. r...@openwrt:~# mtd -o 32 fixtrx firmware Trying to fix trx header in firmware at 0x20... New crc32: 0x73ea777a, rewriting block Done. FYI after this command it always boots fine now. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
The WRT160NL gets shipped with a new bootloader since some time, which actually checks the checksum in the trx image header. As the checksummed area includes the jffs2 start marker, this will blow up after first boot. This patch fixes this by adding a new funktion to mtd (fixtrx) which is called in firstboot. Nice patch. I was waiting for something like this since months. Some brcm63xx devices like Pirelli Alice Business Gate 2 Plus (1) and Alice Gate W2+ (2) has the same problem. Can this patch be extended to support this router's CFE bootloader? I'm a WRT160NL user, but I do not have this new hardware revision. However, I am working on some documentation that I hope will be applicable to the new hardware revision. Can anyone comment on when this should make it to subversion (I don't see the patch in Trac yet)? Could someone provide the symptoms of using the new hardware without this change? I understand this as the system will not boot the flash image. Is this correct? Could anyone provide any different markings that identify the new hardware revision from older revisions? Are the changes made transparent to the older hardware revision? That is, will a new build continue to work on the old hardware with no configuration change? Thanks! -- Mike :wq ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
On Wed, Mar 17, 2010 at 05:34:33PM +0100, Bernhard Loos wrote: Hello I forgot to svn add the firstboot script, that actually calls mtd to fix the trx, sorry about that. Here is the complete patch again. Bernhard Hello Bernhard, FYI I try your patch on my newer WRT160NL but it lost again the new firmware on boot and just sits waiting for a TFTP put from the network. - Otto ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
I'm not sure about things like the flashlayout and the position of the trx header for those board, but it should be pretty easy to extend. You simply have to adapt the prinit script, the rest should be the same. 2010/3/16 Mattia Aracne arac...@hotmail.com: Hello The WRT160NL gets shipped with a new bootloader since some time, which actually checks the checksum in the trx image header. As the checksummed area includes the jffs2 start marker, this will blow up after first boot. This patch fixes this by adding a new funktion to mtd (fixtrx) which is called in firstboot. Nice patch. I was waiting for something like this since months. Some brcm63xx devices like Pirelli Alice Business Gate 2 Plus (1) and Alice Gate W2+ (2) has the same problem. Can this patch be extended to support this router's CFE bootloader? (1) https://forum.openwrt.org/viewtopic.php?id=21087 (2) https://lists.openwrt.org/pipermail/openwrt-devel/2010-March/006265.html ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] WRT160NL new bootloader fix
On Tue, Mar 16, 2010 at 12:21:14PM +0100, Bernhard Loos wrote: Hello The WRT160NL gets shipped with a new bootloader since some time, which actually checks the checksum in the trx image header. As the checksummed area includes the jffs2 start marker, this will blow up after first boot. This patch fixes this by adding a new funktion to mtd (fixtrx) which is called in firstboot. It also gets rid of the unneeded padding of 65kB. Bernhard Excellent! I just received a new WRT160NL with this new check thank you! - Otto PS. Your patch have ugly ^M ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel