What PKG_MIRROR_HASH or PKG_HASH means

I plan to provide pr for LEDE , but find PKG_MIRROR_HASH or PKG_HASH in all package's Makefile. what that means and how to get it?

  • PKG_HASH is SHA256 checksum used when you download the package as.tar.xz / .tar.gz as a pre-built archive file from upstream
  • PKG_MIRROR_HASH is also SHA256 and is used when you download the source with git protocol based on commit hash. As buildbot places the download sources to the server as .tar.xz, the next build can use the PKG_MIRROR_HASH to verify the package without calling upstream git server, and can re-use the source file instead of re-downloading it with git. (In practice you first once let the Make process to download the .tar.xz to your dl directory and then you can use that .tazr.xz to calculate the hash an place it to the Makefile.)

Note: PKG_HASH is the successor for PKG_MD5SUM that is being deprecated.

5 Likes

@hnyman thanks
I have submitted my PR, the following is address
https://github.com/openwrt/packages/pull/4012

but I did't use PKG_MIRROR_HASH in my package makefile, don't know whether it will be accepted or not.

Can you tell me how to calculate this hash for the latest unstable modem manager and libqmi? As this hash is apparently not the commit hash...

Or from where this libqmi-1.33.7.tar.xz file should be coming from that I need the hash for?

It is the SHA256 hash like explianed above. It is calculated from the downloaded source archive file. You can use e.g. "sha256sum" to calculate it.

1 Like