OPNsense Forum

English Forums => Development and Code Review => Topic started by: eddy on August 28, 2020, 07:12:23 PM

Title: How to make changes to "core" and test them?
Post by: eddy on August 28, 2020, 07:12:23 PM
Apologies in advance for this newb first post but I feel a bit lost in this FreeBSD world...

I've successfully installed a FreeBSD-12.1 VM and followed the Setting up a build system (https://github.com/opnsense/tools#setting-up-a-build-system) steps. That all went fine.

Then I found a post in the forums that said to run something like:
make prefetch-packages,base,kernel VERSION=20.7.1
which also seemed to work.

Next I ran:
cd /usr/core
git checkout -b my-new-branch
and made a simple change (just as a test), added and committed it, but now I don't know what's next.

I saw something about needing to set COREBRANCH=my-new-branch?

So my questions:
Thanks for any help.
Title: Re: How to make changes to "core" and test them?
Post by: mimugmail on August 28, 2020, 07:22:51 PM
What exactly do you want to achieve? You can also edit on live system in /usr/local/opnsense or /usr/local/www.

If you want to build a dvd Just follow tools repo .. do changes to /use/core and make dvd in /usr/tools
Title: Re: How to make changes to "core" and test them?
Post by: eddy on August 28, 2020, 07:58:38 PM
My end-goal is to add a bit of new functionality and open a Pull Request. I believe all of my changes are restricted to the core repo.

I thought about "working on a live system", but figured it might be good to follow the "setting up a build system" steps, but as you can see, I didn't get very far.

Is "making a dvd" and then installing from that the only other way?
Title: Re: How to make changes to "core" and test them?
Post by: mimugmail on August 28, 2020, 08:04:23 PM
On a test OPN VM:

opnsense-code core
cd /usr/core

Do your changes there, then

make upgrade
Title: Re: How to make changes to "core" and test them?
Post by: eddy on August 28, 2020, 09:12:15 PM
Ah, thanks!

This approach does seem easier.  ;)

The only other thing I had to do was run:
opnsense-update -t opnsense-devel
before I could run make upgrade.

Thanks again!
Title: Re: How to make changes to "core" and test them?
Post by: burns1230 on June 24, 2021, 10:13:43 AM
Hi, everyone.
I'm going to build "core".
Even after editing the php file, the modified contents are not reflected.
What should I do?
Title: Re: How to make changes to "core" and test them?
Post by: Patrick M. Hausen on June 24, 2021, 10:23:00 AM
If you need a ready-made development platform, you can use this:

https://github.com/punktDe/vagrant-opnsense
Title: Re: How to make changes to "core" and test them?
Post by: franco on June 24, 2021, 03:54:48 PM
> Even after editing the php file, the modified contents are not reflected.

You need to commit your changes for core.git in order to be picked up by tools.git