Applying a Patch to OpenWRT from the beginning

Hello OpenWRT members.

I need to apply this patch https://lkml.org/lkml/2020/6/9/864
I have been reading https://openwrt.org/docs/guide-developer/build-system/use-patches-with-buildsystem#adding_or_editing_kernel_patches for the last hour. But I think something is missing.

I followed this https://github.com/openwrt/openwrt to get my environment ready. How can I get the source code files specific for my WRT1900ACS running OpenWRT 19.07.3? Then after doing so, shall I follow the above Wiki link for quilt?

I am really lost how to do this.

Thank you

You select target and device via make menuconfig, its doesn't hurt to do a full build first either (as you do need large parts of the toolchain to be present).

Ok. I get this. The patch includes changes to pppoe.c, but I cannot find this file? How do I get the source code related to that?

This patch is already in 19.07-SNAPSHOT, so if you build the latest 19.07 you will get it.

I am sorry if I am not following up well, but is it included into this snapshot provided here? https://openwrt.org/toh/views/toh_fwdownload?dataflt[Model*~]=WRT1900ACS

Checking here about how to build an openwrt image, how do I define the verison required? https://openwrt.org/docs/guide-developer/quickstart-build-images

No, it is not in the official 19.07.3, but if you are building from sources you can checkout openwrt-19.07 branch and just build it without having to apply any patches.

Alternatively, you can get the latest 19.07 from https://downloads.openwrt.org/releases/19.07-SNAPSHOT/targets/mvebu/cortexa9/ . Keep in mind: there is no LuCI in this build.

2.1 Clone repository
git clone https://git.openwrt.org/openwrt/openwrt.git -b openwrt-19.07 openwrt

The rest of the steps will be the same, but you still need to select all the right packages that you want including LuCI.

Okay. I see lots of bin files. Is this the correct one for the WRT1900ACSv2 (Shelby) [linksys_wrt1900acs-squashfs-sysupgrade.bin]

I can follow this https://openwrt.org/docs/guide-quick-start/developmentinstallation. But is the Luci the only package missing compare do sysupgrade full images? or all package are missing?

Looks like it, yes. But I do not use the router so I cannot guarantee anything. Make sure the name matches the name of the 19.07.3 file you would have downloaded.

Only you know what packages you installed. But as long as you can use ssh you can install LuCI and all the other packages you need. opkg list-installed will give you a list of installed packages and then you can compare the list before and after.

It matches. So I guess this is it.

I see. Well mo problem about any extra packages installed by me. I am talking about the basic packages that come with a new fresh images of installed openwrt by default like hostpad, pppoe service, dnsmasq, essential packages, etc...

That and ssh will be there. Your router should boot and bring up all interfaces. At least that is how it works on my Netgear R7800 :wink:

Glad to hear. So only luci is required to be installed via ssh. Netgear R7800 is really a solid router. I hope it is serving you well :smile: