Building OpenWrt with a Patch / Pull Request

This thread is request for some help regarding the use of github in conjunction with a pull request in OpenWrt, because github is not self-explaining and this project to complex.

It is possible to follow the steps for the build system

but it is not known what commands in github are needed to add a pull request?
This description does not show how to practically do it in this case.

What commands in github are needed to do the magic?

P.S. This branch is 11976 commits behind openwrt/openwrt:master at this time.
-> Able to merge. These branches can be automatically merged.

there's no guarantee the the PR from two years ago will survive, if you apply the 12k missing commits.

That's what to find out.

The goal should be to fetch a regular last version of OpenWrt 24.10.4 and to add the patches needed to get the 2.5 GHz WLAN working.

The exact question is what github commands must be executed to apply the patches?

in that case, check out the latest and greatest, as in the openwrt wiki link you posted, try to apply the patch on top of it ?

you don't need any github (web site) command at all, AFAIK.

The configuration / sources will not patch without a command to the build system.

Empfange Objekte: 100% (774304/774304), 273.06 MiB
...
$ git checkout openwrt-24.10
Branch 'openwrt-24.10' folgt nun Remote-Branch 'openwrt-24.10' von 'origin'.
Zu neuem Branch 'openwrt-24.10' gewechselt

Now missing some Prerequisites after

./scripts/feeds update -a
./scripts/feeds install -a

Execute under your local code repository path

git remote add openwrt	https://github.com/openwrt/openwrt.git
git fetch openwrt
git rebase openwrt/openwrt-24.10

If merging only one commit, then use cherry-pick
git cherry-pick [ 2.5 GHz WLAN commit-id]

2 Likes

Thanks - that's the expected answer for the question.

ath9k: experimental support for QCN5502 #9389 <- Is this the commit-id ?

git log can display all committed logs, for example 1db4155aa9 , the red box in the figure below is commit id
a0e49a47-f36e-444e-9b3a-3f9f9f197531

Setting up a compilation environment is also quite complex, and a simple and convenient Docker environment can be used for compilation.

Please refer to https://github.com/openwrt/openwrt/pull/20866/files

Thanks so far for helping an old blind man over the street.

Working in Debian 11 (bullseye).
All Prerequisites installed now and the above 2 scripts run through.
610,4 MB with 22548 files downloaded so far.

Now the commit-id is still a problem, because the right commit cannot be found.
There is only something like

commit 520c9917f8883766d47707cd560ffdaecc9b9dee
Author: Wenli Looi <wlooi@ucalgary.ca>
Date:   Sat Jul 1 17:46:15 2023 +0000

    ath79: add support for ASUS RT-AC59U / ZenWiFi CD6

but nothing can be found with "ath9k: experimental support for QCN5502".

Maybe the reason is that the patch from looi is based on version 23.05.1?
With git describe --tags the current release is v24.10.4-101-g96a67d2f2e

looi wants to merge 3 commits into openwrt:openwrt-23.05 from looi:qcn550x

I have already merged the code into the master branch for you. You can simply pull it down and compile it. I did not test whether the code can be compiled. Please try compiling it.

git clone -b qcn550x --depth 10 https://github.com/peterwillcn/openwrt

2 Likes

Thank you very much.
Maybe you will betray what must be done later on? :sweat_smile:

So far using make menuconfig only to choose ath9k.
Compiling OpenWrt now the first time ...
(at this time it's downloading the tools, toolchain, packages)
The result will follow ...

Remerged the code based on branch 24.10, please fetch and reset the code again.

git fetch
git reset --hard origin/qcn550x

1 Like

you need to refresh the patches for the kernel package mac80211 which is likely a lot of work which could also go into the upstreaming effort. This is not easy.

especially since it will require further adjustments to work with newer kernels.

Refreshing it to run with the latest openwrt-23.05 would be a lot more doable.

You need to work with quilt, too. (in order to refresh patches)

Quilt can take an arbitrary number of patches as input and condense them into a single patch.

That's why it's magic. :rofl:

Why people want always to use newer kernels on such small systems with so much different hardware?
It's clear that the drivers always must be patched to work on newer kernels ...

Thanks - this could be plan B for this router hardware.

O.K. the run has happened without an Error!
The path openwrt consists now 9.3 GB data with 546605 files in 50320 directories.

In ../openwrt/bin/targets/ath79/generic could be found

6,0M  4. Dez 16:51 openwrt-ath79-generic-8dev_carambola2-initramfs-kernel.bin
6,4M  4. Dez 16:51 openwrt-ath79-generic-8dev_carambola2-squashfs-sysupgrade.bin

Now the right output images must be choosen. :grinning_face_with_smiling_eyes:
It was the first time to build an OpenWrt image ...

Going into the configuration now again.
Hopefully the wanted results will follow ...

Thank you very much.
This has enabled the wanted solution.

A build for the own hardware ASUS RT-AC57U v2 / v3 could be done now.

 22M  4. Dez 17:24 openwrt-ath79-generic-asus_rt-ac59u-v2-initramfs-kernel.bin
3,6K  4. Dez 17:24 openwrt-ath79-generic-asus_rt-ac59u-v2.manifest
6,4M  4. Dez 17:24 openwrt-ath79-generic-asus_rt-ac59u-v2-squashfs-factory.bin
6,4M  4. Dez 17:24 openwrt-ath79-generic-asus_rt-ac59u-v2-squashfs-sysupgrade.bin

It will be flashed and tested.
When this works the other affected router models will follow and the compiled images will be published.

One last question so far:
Will the official packages be compatible with the result or is it needed that they must be compiled too?

After the flash the router booted and a login via ssh is possible.
But the Web-Interface is absent.

Now a new build basing on https://downloads.openwrt.org/releases/24.10.4/targets/ath79/generic/config.buildinfo is in work ...

opkg install luci or apk add luci

opkg is not used.
apk update
already fails (wget: Failed to send request: Operation not permitted).

That's the reason for asking:

How it can be seen in github what sources have been used?
Where is the download path for the packages defined?

This build needs the night to finish, was successful and has been not flashed so far.

 28M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_rt-ac59u-initramfs-kernel.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_rt-ac59u-squashfs-factory.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_rt-ac59u-squashfs-sysupgrade.bin
 28M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_rt-ac59u-v2-initramfs-kernel.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_rt-ac59u-v2-squashfs-factory.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_rt-ac59u-v2-squashfs-sysupgrade.bin
 28M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_zenwifi-cd6n-initramfs-kernel.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_zenwifi-cd6n-squashfs-factory.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_zenwifi-cd6n-squashfs-sysupgrade.bin
 28M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_zenwifi-cd6r-initramfs-kernel.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_zenwifi-cd6r-squashfs-factory.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-asus_zenwifi-cd6r-squashfs-sysupgrade.bin
 21K  5. Dez 02:37 openwrt-snapshot-r0-96f5608-ath79-generic.bom.cdx.json
5,1K  5. Dez 02:37 openwrt-snapshot-r0-96f5608-ath79-generic.manifest
7,3M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-netgear_ex7300-initramfs-kernel.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-netgear_ex7300-squashfs-factory.img
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-netgear_ex7300-squashfs-sysupgrade.bin
7,3M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-netgear_ex7300-v2-initramfs-kernel.bin
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-netgear_ex7300-v2-squashfs-factory.img
8,2M  5. Dez 02:12 openwrt-snapshot-r0-96f5608-ath79-generic-netgear_ex7300-v2-squashfs-sysupgrade.bin
7,3M  5. Dez 02:13 openwrt-snapshot-r0-96f5608-ath79-generic-tplink_archer-a9-v6-initramfs-kernel.bin
8,2M  5. Dez 02:13 openwrt-snapshot-r0-96f5608-ath79-generic-tplink_archer-a9-v6-squashfs-factory.bin
8,2M  5. Dez 02:13 openwrt-snapshot-r0-96f5608-ath79-generic-tplink_archer-a9-v6-squashfs-sysupgrade

The path openwrt consists now 14.7 GB data with 435667 files in 50052 directories.

Install luci, Web-Interface.

echo 'https://downloads.openwrt.org/snapshots/packages/mips_24kc/luci' >> /etc/apk/repositories.d/distfeeds.list
apk update && apk add luci