How to Include the MT76

When using the build system, how do we make sure to use the latest versions of the MT drivers found at https://github.com/openwrt/mt76 ? Does this have to be in our feeds.conf.default somehow?

I see recent commits in the https://github.com/openwrt/mt76 site, but then when I do a git pull I do not see these modified files downloaded? What am I doing wrong?

1 Like

Change the PKG_SOURCE_VERSION in package/kernel/mt76/Makefile to the commit hash you want.

So if I look at the top of this make file I see the following code

include $(TOPDIR)/rules.mk

PKG_NAME:=mt76
PKG_RELEASE=2

PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=

PKG_SOURCE_URL:=https://github.com/openwrt/mt76
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2020-03-10
PKG_SOURCE_VERSION:=a94e43f277e22ce24237320ce92b1f185eff0b1e
PKG_MIRROR_HASH:=b922f2143e5af9fd1e4f86002fefa91f42c8959385be6cda0633cce4f85a8d42

PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_BUILD_PARALLEL:=1

It looks like the latests commit to this MT76 was 3 days ago https://github.com/openwrt/mt76/commit/9406eb1d110f96e78cf376c4ed9d5164af4075e1

So do I just replace PKG_SOURCE_VERSION:=a94e43f277e22ce24237320ce92b1f185eff0b1

with PKG_SOURCE_VERSION:=9406eb1d110f96e78cf376c4ed9d5164af4075e1

I notice the current on in the file has an "a" infront of the 94 numbers, but the latest commit doesn't. Do I put an a infront?

Correct.

Here it is explained in detail.

1 Like

I am still struggling with this. How do I verify that these files have been changed / its getting the latest once I change the PKG_SOURCE_VERSION:=9406eb1d110f96e78cf376c4ed9d5164af4075e1

Do I need to change anything on the PKG_MIRROR_HASH? I don't know where to find the PKG_MIRROR_HASH

After I edit and save this, do I just do a git pull to see the changes? Or a ./scripts/feeds update -a

If anyone could include step by step on what I can do to change this that would be awesome.

I am following up here. I still was not able to get this to work. I know where to find the date, but how do you get the correct PKG_SOURCE_VERSION and PKG_MIRROR_HASH? I can't find a PKG_MIRROR_HASH when I browse github?

PKG_SOURCE_VERSION is the git commit hash. PKG_MIRROR_HASH should be generated automatically by the build system when you build. (and you'll see what it should be when it compares it to what it has and fails)

Or. you can just add:

PKG_MIRROR_HASH:=skip

and avoid the hash mismatch the first time out..

1 Like

I download the repo:

https://github.com/openwrt/mt76/archive/master.tar.gz

upload that to:

https://www.fileformat.info/tool/hash.htm

copy/paste the SHA-256 hash to the make file

SHA-256 42ad541c29926be07b40a7a8f92df297e1dd1ca18684f14d2d06654ee657dd61

The issue with doing it that way, is that you are not compiling from source. @colton.conor is trying to do compile based on a specific checkout commit, which is where PKG_MIRROR_HASH comes from.

Also, if you are running Linux, you can just do a sha256sum on the file to get the hash, without uploading it anywhere, but again, for the OP, it won't work..