Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Creating an installable plugin
« previous
next »
Print
Pages: [
1
]
Author
Topic: Creating an installable plugin (Read 1255 times)
primroseN
Newbie
Posts: 6
Karma: 0
Creating an installable plugin
«
on:
February 13, 2024, 04:54:24 pm »
Hello all,
I'm an OPNsense newbie I apologize for my limited knowledge. I have been following the HelloWorld plugin development documentation and I appear to have hit a roadblock. When I run the make plugins command, the command runs for a notoriously long time -6+ hours( it is still running as I type this, which is my concern )
My query is 1)- Is this normal behavior or is it my architecture in question?
2) - Is there a way of simply building only the plugin I have created, as opposed to re-building all available plugins on the system?
I will greatly appreciate any help and guidance on how to make an installable plugin for OPNsense.
Logged
Maurice
Hero Member
Posts: 1213
Karma: 158
Re: Creating an installable plugin
«
Reply #1 on:
February 13, 2024, 10:41:28 pm »
1) Yes, running
make plugins
first builds all prerequisites, which can take a very long time.
2) Prefetch the base, kernel and packages sets so you don't have to build them yourself:
make prefetch-base,kernel,packages
Then build your plugin:
make plugins-<yourplugin>
Cheers
Maurice
Logged
OPNsense virtual machine images
OPNsense aarch64 firmware repository
Commercial support & engineering available. PM for details (en / de).
primroseN
Newbie
Posts: 6
Karma: 0
Re: Creating an installable plugin
«
Reply #2 on:
February 16, 2024, 07:21:31 pm »
Hey Maurice, sorry for the late response.
This has been very helpful. I have successfully packaged my plugin. Thank you
Cheers,
- Prim
Logged
primroseN
Newbie
Posts: 6
Karma: 0
Re: Creating an installable plugin
«
Reply #3 on:
February 20, 2024, 03:22:47 pm »
Hello,
I appear to have hit another snag. After successfully running make plugins-<my plugin> I can't seem to find the plugin anywhere on my system. I ran pkg update and that did not yield any results, as did rebooting the system.
In addition, upon doing some research, I realized I can't state the plugin dependencies in the Makefile. My plugin requires a couple of packages like gcc, mongodb. If I can't put these in the POST_INSTALL.pre/post file, how best can I handle installation of those dependencies?
Logged
franco
Administrator
Hero Member
Posts: 17656
Karma: 1610
Re: Creating an installable plugin
«
Reply #4 on:
February 20, 2024, 04:09:52 pm »
You're looking at a quite complex problem.
First of all, you need to add your dependencies to ports.conf.
Then in the plugin add your dependencies to PLUGIN_DEPENDS variable.
Now rebuild your plugin. It may require rebuilding the relevant ports for inclusion.
Now you have a proper plugin but it just lives as a package somewhere with a loose reference to its dependencies.
Do you want to put this on an image? Build it with ADDITIONS variable set.
Do you want to install it on the fly? Host the plugin package and its dependencies somewhere on a server, then install one by one (last one is the plugin):
# pkg add -f
https://xxx/yyy.pkg
If you want to build an online repository you will have to do more research, perhaps stripping down ports.conf and plugins.conf to only fit your plugin and the dependencies and once "make packages" finishes you can use the packages.tar file to extract on a server. Last step is point a repository configuration towards it on the system you want to install.
Due to lack of further details let's just stop here for now.
Cheers,
Franco
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Creating an installable plugin