Hi, Community
I am having some difficulties understanding the steps for version updates and creating plugins, specifically how to create the Helloworld plugin. Additionally, I am not quite sure how the make command in OPNsense tools works. I have read the README and tried to follow the instructions, but I always encounter errors. Therefore, I would like to ask if anyone can kindly provide some advice.
Currently, I am unable to resolve this issue:
Installed pkg version '1.21' does not match required version '1.19'
*** Error code 1
Stop.
make: stopped in /usr/tools
root@freebsd:/usr/tools # pkg -v
1.21.3
root@freebsd:/usr/tools # uname -r
13.2-RELEASE
I have tried to downgrade pkg to version 1.19, but it seems unsuccessful.
Do you want to build the package of the hello world plugin from their source files?
For that you go to "/usr/plugins/devel/" and go into the helloworld folder and invoke "make package".
So, is my understanding of this document incorrect?
https://github.com/opnsense/tools
Because I thought I needed to set up a FreeBSD system and then install OPNsense tools according to the document.
According to your explanation, if I want to package a plugin, I just need to go to the plugin directory on the OPNsense system and run make package?
But if I want to package my own system, I follow the document and run make dvd in /usr/tools. The location will be in make print-IMAGESDIR. Is this correct?
Well you can use a freebsd system. But you can also just install an opnsense vm, install the build tools in it, and then use "make dvd" in there.
Quote from: hsing on July 05, 2024, 05:28:57 AM
Installed pkg version '1.21' does not match required version '1.19'
*** Error code 1
Stop.
make: stopped in /usr/tools
root@freebsd:/usr/tools # pkg -v
1.21.3
root@freebsd:/usr/tools # uname -r
13.2-RELEASE
This is the issue I encountered on the FreeBSD system, the incompatibility of the pkg version.
So if I run make dvd on the OPNsense system, should it be executed in the /usr/tools directory? Or, like with the plugins, should it be done under /usr/plugins/devel/?
I just tried to run make package in /usr/plugins/devel/helloworld. Initially, I saw a folder and two files (src/, Makefile, pkg-descr). After execution, an additional folder work/ appeared, and I noticed that there is always a src/ folder. If I want to create other plugins, should I also copy the plugin's files into the src/ directory?
You can remove pkg on freebsd and manually install the matching version.
But its easier just to use an OPNsense cause it has the matching pkg version needed.
To make the DVD you just do exactly the steps as they are explained in the opnsense/tools readme.
Going into /usr/plugins/devel/ is for when you want to build single plugins, you just copy them into a folder there, e.g. /usr/plugins/devel/caddy and then invoke "make package" to build the single plugin package. The src and work get created automatically.
OK, I think I should directly operate on OPNsense.
However, I don't quite understand the initial TL;DR in the documentation. When I run make dvd in /usr/tools, I encounter a lot of errors. If I need to specify the build, where should I set those parameters?
Sorry, I'm not very clear on the documentation...
Why would you "make dvd" if you only want to build a plugin? The "make dvd" command builds install media. You need the source of OPNsense, not only plugins, for that.
I want to understand how make works. It seems different from FreeBSD's port or pkg, so I want to try and see how it works.
Yes, but different make targets do different things. If you want to "make dvd" you need to setup your environment for a complete build of all of OPNsense, because that's what "make dvd" does.
Hi,
Last week, I attempted to follow the step "How to run individual or composite build steps." The initial steps for base and kernel went smoothly. However, when I reached the make ports step, it took a considerable amount of time. Is this normal?
Quote from: hsing on July 08, 2024, 04:36:41 AM
However, when I reached the make ports step, it took a considerable amount of time. Is this normal?
Yes.
Hi,
These past few days, I tried using make ports and successfully generated packages-24.1.9_72-amd64.tar. However, I noticed something: does make ports require an internet connection? Can anyone explain the reason for this? Isn't it supposed to package the system's own ports and those packages? Why does it need an internet connection? Is it to fetch updates?
The ports system consists of a tree of Makefiles that fetch and build third party tools which are not part of FreeBSD. The source code for these third party tools is downloaded from the Internet.
https://docs.freebsd.org/en/books/handbook/ports/
Understood, but I encountered an issue when running make plugins. The error message is as follows:
make[1]: "/usr/obj/usr/tools/config/24.1/amd64/usr/plugins/Mk/plugins.mk" line 75: Plugin variant 'zabbix7' does not exist
*** Error code 1
Does this error mean that I do not have the 'zabbix7' plugin?
When running make plugins, should it be executed under /usr/local, or should each plugin be copied to /usr/plugins/devel/ before execution? The issue mentioned above occurred because I ran make plugins under /usr/local.