Can I install from FreeBSD ports?

Started by virtus, October 16, 2021, 07:28:17 AM

Previous topic - Next topic
October 16, 2021, 07:28:17 AM Last Edit: October 16, 2021, 07:30:24 AM by virtus
Hi. Nice to meet you.

First off, I want to say that I searched before asking. But it didn't help because searching for "ports" gets mixed up with TCP/IP ports in the search results, and because all matches I've found are rather old. I found one particular forum post that seems to imply that OpnSense used to work with ports but doesn't anymore. As a total newbie with FreeBSD and OpnSense, I decided to ask before I go ahead and format my computer and install OpnSense. I have it running as a VM for the time being just to get a first hand appraisal of it.

So I want something that is not in the Plugins or Packages list. But it's there in the FreeBSD ports.

https://cgit.freebsd.org/ports/tree/multimedia/motion

and

https://github.com/opnsense/ports/tree/master/multimedia/motion

Can I have it? Is it installable? Is that safe in the sense that it's not going to make a mess of my OpnSense installation? Is it going to work? Are there any pitfalls?

Thank you for your attention.

You can build it from the source tree. The only thing is that it may not survive updates but it should not break anything.

Thank you.
Can you please inform me what "build it from the source tree" means exactly? I mean, the procedure? I know a lot about Linux but nothing about FreeBSD except whatever I type in the terminal pretending it's Linux and it works by coincidence.

Cli: opnsense-code tools ports

Afterwards you will have a /usr/ports directory where you can run any Makefile using the make command.


https://github.com/opnsense/tools#readme

Quote from: fabian on October 16, 2021, 07:34:27 PM
The only thing is that it may not survive updates but it should not break anything.

Just to manage expectations correctly: it will break something eventually.

BTW, opnsense-code doesn't require "tools" parameter since a year or more. This is just fine:

# opnsense-code ports && cd /usr/ports/desired/software && make install


Cheers,
Franco

Thank you for the honesty. I really appreciate it.

It is a little off-putting though. Can I at least install the package I want and never update OpnSense again until my last day on Earth so that nothing breaks? Is that possible, or is there some kind of requirement to update OpnSense from time to time?

Hi,

Using opnsense-code mitigates most incompatibilities and is a lot better than installing FreeBSD package from their mirror which aren't as compatible.

The problem that building ports exposes is that dependencies might get built and added to the system that affect updates in the future as packages could start to conflict, are updated to incompatible versions, etc. Most of this is highly theoretical, but practice shows that dependency chains break in unforeseeable ways.

What can be done is attempting to run opnsense-code from time to time to update the ports tree and rebuild the software a well as regular updates -- updates as in "minor" updates.

Upgrades twice a year ("major" updates) are problematic because the underlying OS libraries provided change version numbers as well which could also break manual software inclusions.

If you do regular backups and are not afraid to redo the setup in the worst case I'd very much recommend opnense-code and ports building.


Cheers,
Franco

It's probably not a good idea to mix the purpose of your firewall and what seems to be a video camera tool on the same installation. While not impossible, mixing this stuff together means that neither will work as well as they would stand-alone.


Is it for home use? Then I can try to add it to community repo

I did use motion for a while in a freebsd jail. I liked it a lot. Until I struggled with motion detection on my cameras.
I created a new jail and used zoneminder from the binary package. I have kept that and made me realise the problem was with the camera setup. That opened my eyes to being more resources online for the ZM than Motion.
In both cases, on a different machine with freeBSD.
There is normally a lot of memory usage and IO on disk. It might be beneficial for the user to know how to limit that in *BSD or important services on a firewall could be the victims of memory starvation.

I use motion on several raspberry pis for streaming cams and doing motion detection (storing pics or vids). I would NEVER EVER consider to use it on my firewall/router....
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

Quote from: chemlud on October 19, 2021, 03:25:00 PM
I use motion on several raspberry pis for streaming cams and doing motion detection (storing pics or vids). I would NEVER EVER consider to use it on my firewall/router....

Again: why not?

Quote from: cookiemonster on October 19, 2021, 02:37:56 PM
I created a new jail and used zoneminder from the binary package.

I investigated ZoneMinder and didn't like it even before I installed it because in my Linux machine it requires 94 additional packages. 265 MB. In comparison with that, Motion is tiny and it is working pretty well in my Linux machine. There is a learning curve, but it's paid off. My problem now is I can't leave this machine running 24/7. But the firewall machine already is. So yes, the firewall machine would be the perfect new home for Motion in my case.

I don't know about the memory usage, but the IO on disk is not much if you calibrate it adequately and get rid of the false positives so it will ever store very few photos.

On the other hand, I'm also investigating the possibility of installing Motion in IPFire. OpnSense seems very difficult for my limited knowledge, IPFire is definitely easier. I appreciate the help anyway. OpnSense seems to be an excellent firewall, I just may not be adequately trained to use it.