OpenWrt Forum Archive

Topic: Just starting-A little input on which approach I should use would help

The content of this topic has been archived on 8 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all.  I've got an old Netgear WRT1000v2 that I want to experiment with.  That device will work on 15.05.1, but it needs some patches for the LEDs to work.  So what's my best/the right approach?  Do I:

1) DL & install 15.05.1 & then patch? (Is that possible?)  What's the diff between sysupgrade.bin & factory.img?
2) DL & compile/install r49076 (right when the patches were added & very close to r49022 / 15.05.1)
3) DL & compile/install something more recent?

Any pointers to HOWTO's for patching/compiling would also help.

I'll add that Netgear has an OpenWRT firmware for that device from 2013, though only the source is available for the latest (1.1.2.58): (I can't post links yet, so ...)
kb.netgear.com/2649/NETGEAR-Open-Source-Code-for-Programmers-GPL

I'm a little confused about this firmware.  As it's OpenWRT, is there some way to install it and then "opkg update && opkg dist-upgrade" (or whatever the OpenWRT vernacular is)?

(Last edited by diagon on 26 Jun 2017, 22:27)

diagon wrote:

That device will work on 15.05.1, but it needs some patches for the LEDs to work.

I'm not familiar with this router, but are you really sure you need patches? Perhaps you just need the suitable 'kmod-ledtrig-*' packages through OPKG to control the LEDs and then create the LED configuration in "System -> LED configuration" to your liking?

I do know one thing which may require a patch or a new kmod-ledtrig package, and that is the 'Internet' LED that some routers have. I've been planning to write a new kmod-ledtrig package for this purpose, but haven't got around to starting yet smile

diagon wrote:

1) DL & install 15.05.1 & then patch? (Is that possible?)

As far as I know, it is not possible to "patch a running system", so to speak. You can always get the sources and build an image yourself, but in this case you'd be replacing the existing installation with a new one instead of "patching it" smile

diagon wrote:

What's the diff between sysupgrade.bin & factory.img?

A sysupgrade.bin is intended for upgrading or downgrading from an existing OpenWRT installation to a newer or older version or variant. This is usually done from "System -> Backup/Flash Firmware" section, or using the 'sysupgrade' tool from command-line.

A factory.bin is intended for use with a router that has OEM-provided firmware installed. It is essentially an OpenWRT firmware that just contains some padding and magic numbers to make it compatible with whatever image format the OEM-provided firmware expects. A "disguise" would be a good word here. Factory.bin is an OpenWRT installation disguised to look like an OEM firmware, so the firmware that is already installed on the router will accept it without complaining.

diagon wrote:

2) DL & compile/install r49076 (right when the patches were added & very close to r49022 / 15.05.1)

If you use TRAC (dev.openwrt.org) to monitor these changes, then bear in mind that TRAC does not show everything. For example, if you look at the change history in the GitHub for Chaos Calmer (https://github.com/openwrt/openwrt/commits/chaos_calmer), you can see that the latest change shown in TRAC is not really _the_ latest change done to the branch. You can use text search to find the matching git commit.

diagon wrote:

3) DL & compile/install something more recent?

This is always an option, and it is what I did for my router. I downloaded the GitHub Chaos Calmer branch, built an image for my router and flashed it.

diagon wrote:

Any pointers to HOWTO's for patching/compiling would also help.

I first read through https://wiki.openwrt.org/doc/howto/buildroot.exigence and then created a 64-bit VM with Debian 8 to act as my build environment. After installing the listed dependencies and getting the sources, I followed https://wiki.openwrt.org/doc/howto/build to update the feeds and build it up. Since I already had a previous Chaos Calmer edition on my router, I used 'opkg list-installed' to get a list of packages that I'd need to tick from 'make menuconfig' to make my new image as close to original as possible.

diagon wrote:

I'm a little confused about this firmware.  As it's OpenWRT, is there some way to install it and then "opkg update && opkg dist-upgrade" (or whatever the OpenWRT vernacular is)?

There's no 'dist-upgrade' option. You upgrade an OpenWRT router to a newer or older version by using the 'sysupgrade.bin' images, like I explained above.

@Antec.  That was fantastically helpful, thanks!  One follow-up regarding the patches.

... are you really sure you need patches? Perhaps you just need the suitable 'kmod-ledtrig-*' packages through OPKG to control the LEDs and then create the LED configuration in "System -> LED configuration" to your liking?

I'm going by the tail end of this page: wiki.openwrt.org/toh/netgear/wnr1000 

I did find the kmod-ledtrig pkgs discussed (wiki.openwrt.org/doc/uci/system), but I'm not clear how to identify whether they cover the relevant capabilities for this router.  Would I just install "kmod-ledtrig-gpio_3.18.20-1_ar71xx.ipk", and then edit /sys/kernel/debug/gpio as described at the tail end of the wnr1000 page (first link)?

For the rest, I'll thank you for the links.  I'll point out that the index to the wiki is a bit broken.  So for example the page describing the build system:

OpenWrt Wiki » Welcome to OpenWrt » HOWTOs » OpenWrt build system – Installation

Is not linked to by the "HOWTOs" page, nor is the "HOWTOs" page linked to by the "Welcome to OpenWrt" page.

(Last edited by diagon on 27 Jun 2017, 18:00)

What about LEDE 17.1.2 all the leds mite of bin fixt.

What about LEDE 17.1.2 all the leds mite of bin fixt.

Well, that's not quite on point with my question, but I do see that there will be a merge soon.  Do we know when?  Should I just wait?

In the mean time, I'd still like to return to the question regarding "kmod-ledtrig-gpio_3.18.20-1_ar71xx.ipk".  Do I just install it and then edit /sys/kernel/debug/gpio as described at the tail end of the wnr1000 page?  (See my post above.)

(Last edited by diagon on 27 Jun 2017, 19:06)

diagon wrote:

I'm going by the tail end of this page: wiki.openwrt.org/toh/netgear/wnr1000

Based on this wiki, it should be enough if you obtain the latest commits from the Chaos Calmer branch in Github, and then build it.

diagon wrote:

I did find the kmod-ledtrig pkgs discussed (wiki.openwrt.org/doc/uci/system), but I'm not clear how to identify whether they cover the relevant capabilities for this router.  Would I just install "kmod-ledtrig-gpio_3.18.20-1_ar71xx.ipk", and then edit /sys/kernel/debug/gpio as described at the tail end of the wnr1000 page (first link)?

I can't say. Kmod-ledtrig-gpio is a module for driving the LEDs on your router based on GPIO events, such as pressing the "WPS" button, if your router has one. However, since only the sky is the limit on how the SoC's GPIO ports are configured on the PCB, it's really, really difficult to say if installing this module will help you.

LEDE is the new openwrt and then when the merge happens they will call lede openwrt. There is no need to stick with 15.1 when there is a new build out with updated kernel and many many bug fixes! There mite be some packages that will not work on 15.1 any more or have bin updated.

(Last edited by tapper on 27 Jun 2017, 21:28)

@tapper.  Alright, man.  Thanks.  As long as there's no major issue handling it when the transition comes, maybe I will go with LEDE.  It looks easier than compiling my own.

By the way, you don't happen to know if tproxy is compiled into the OpenWrt/LEDE kernel, do you?  I use sshuttle as a simple vpn, and forwarding UDP packets wants tproxy.

Sorry mate I don't know anything about tproxy.

The discussion might have continued from here.