Openwrt build issues


When i am trying to build openwrt for IPQ4019 chip set below prerequisite error is listed while running the below commands

git clone
cd openwrt
git checkout openwrt-18.06.2
git checkout openwrt-18.06
./scripts/feeds update -a


/home/openwrt/include/ recipe for target '/home/openwrt/staging_dir/host/bin/mkhash' failed
Prerequisite check failed. Use FORCE=1 to override.
/home/openwrt/include/ recipe for target 'staging_dir/host/.prereq-build' failed
make: *** [staging_dir/host/.prereq-build] Error 1

Please let me know how to resolve the above issue.

Thanks & Regards

Prerequisite check failed

> which mkhash

what guide did you follow?

I followed below link to build openwrt

How to check which mkhash?

I think prerequisite error would stem from the fact that your build environment lacks something. Maybe an essential software is missing from the system. What system are you running? What packages have you installed before?

I am using Debian GNU/Linux 9.8 (stretch) OS. I have installed below dependency packages

sudo apt install subversion g++ zlib1g-dev build-essential git python time
sudo apt install libncurses5-dev gawk gettext unzip file libssl-dev wget
sudo apt install libelf-dev
sudo apt install build-essential libncurses5-dev python unzip

mkhash, I believe, is built from source by the build system. As such, I suspect that the "real" error occurs earlier in your build.

I didn't see ./scripts/feeds install -a in your process, though that should be "optional" and probably not the root cause.

A parallel build can cause problems with a fresh or significantly updated build tree. I didn't see if you were executing make -jN. Most of those parallel "start-up" issues can be mitigated with make -jN clean download world

The latest "official" list of dependencies for Debian I have is from

Some of that list, like buildbot-slave, probably aren't required for stand-alone builders. I don't think subversion is required, except perhaps for some "optional" packages that I don't use.

[GNU] time is no longer required, at least on master (I don't build 18.06, so can't confirm).

1 Like

I had the same issue, I didn't figure out why mkhash wasn't built automatically, but I could build it manually:

~/openwrt$ cc -O2 -Itools/include -o staging_dir/bin/mkhash scripts/mkhash.c 
~/openwrt$ staging_dir/bin/mkhash 
Usage: staging_dir/bin/mkhash <hash type> [<file>...]
Supported hash types: md5, sha256```
1 Like