I am trying to build openwrt image with scapy python library.
I am seeking help for the steps to do it correctly and avoid misleading errors.
now i am confused whether i should create a manifest file after installing the source code of scapy, or is there a way to include it in menuconfig.
You can install with pip into a venv to test out.
matplotlib package may be needed
matplotlib is optional for scapy: https://github.com/secdev/scapy/blob/97a49f32b99c2799d9e6a04969d2c66c231abd37/pyproject.toml#L59 otherwise you'd need all of numpy and a ton of other stuff that matplotlib depends on...
maybe it can be built in openwrt if anyone wants to pay for this package
I installed it using opkg. But what i am asking about is how can i build an openwrt image and include scapy in it as a package
Like add to imagebuilder or firmware-selector?
What tools did you use to build the ipk? If you added it as a package in the OpenWrt source build, then just set config to y
and build your image, it will be included.
I'm guessing it looks something like this (or just search for it in make menuconfig
and set it there).
CONFIG_PACKAGE_python3-scapy=y
I need to know how to make the ipk first actually. Or where to find it. I didn't find a .ipk file at scapy github. So i am asking how to build it.
Try grep on source tree, or luci software search, it is there in plain sight
I'm confused here. What did you install using opkg? (I thought you already had done the build and were asking about integrating it into the OpenWrt package feeds and the .config
???)
But, putting that aside, you create a package by writing a Makefile
that creates that package. Take a look at the various packages that already exist in the feed, here:
at first i wasn't aware that scapy is available in openwrt default packages.
and after using opkg install scapy
and it succeeded to install the package i realized that it is in the package repository. i was just experimenting things.
(https://openwrt.org/packages/pkgdata/scapy)
from make menuconfig
i succeeded to build the scapy as a .ipk by selecting before the scapy option under network category.
Now i am experimenting to build it as .ipk but with make file, I used the make file provided in the git hub repository but i end with errors. kindly find the make file below and the error as well.
the error says there is no rule to make target. which is confusing me as this is an unedited copy of the make file from the github repository.
i don't know what i am missing here?
The relative addressing in the make files can't find ../../lang...
as it is expecting your makefile to be in the package feeds in a specific location. If you move it under feeds/packages/somedir/somedir/Makefile
, then it will be in the level of the feeds and should build.