How to build mktplinkfw? [Solved]

Hi,

I'm trying to build mktplinkfw using WSL2 with an Ubuntu 20.04 LTS distribution, to install OpenWRT on my Ziggo Wifibooster device (which is TP Link Archer C7 v2 with alternative firmware).
I have tried following the instructions I could find, but I'm unable to obtains the sources in tools/firmware-utils.

This is what I've done:

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y build-essential git libncurses5-dev zlib1g-dev libpam-dev liblzma-dev libsnmp-dev libssl-dev
gawk flex quilt xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip subversion

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git checkout tags/v22.03.1 -b v22.03.1-branch

./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
make prereq

cd tools/firmware-utils
gcc -Os mktplinkfw.c mktplinkfw-lib.c md5.c -o mktplinkfw

which complains about missing source code files.

Running make (in an attempt to get the sources, as the Makefile hints at a git command):

cd tools/firmware-utils
make

leads to the error message:

  • Makefile:19: /cmake.mk: No such file or directory
    make: *** No rule to make target '/cmake.mk'. Stop.*

Could you help me out?

Thanks,
Joost

Instead:

  • do not change directory. All make commands are run from the buildroot root dir.
  • make tools/firmware-utils (and it will build the necessary cmake as part of the build process)

Thanks for your swift response.

Running make tools/firmware-utils no longer fails, but does not have the anticipated effect of downloading/installing the source code files in tools/firmware-utils/, even after the make command the directory remains empty.

How should I obtain the sources to build mktplinkfw?

Joost

I got one step closer to the solution by running

git clone https://git.openwrt.org/project/firmware-utils.git
cd  firmware-utils/src
gcc -Os mktplinkfw.c mktplinkfw-lib.c md5.c -o mktplinkfw

But now I'm getting linker errors that the functions inspect_fw_phexdec, inspect_fw_pmd5sum, inspect_fw_pstr and inspect_fw_phex are missing.

Could this be related to trying to build them out of tree?

Thanks for any support,
Joost

Item Problems compiling (mktplinkfw.c) on Fedora - For Developers - OpenWrt Forum appears to have solved the problem (removing the inline keyword in the header file and adding +#include <byteswap.h> in the source file).

Thanks for your attention nonetheless.
Joost

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.