How to make changes to "core" and test them?

Started by eddy, August 28, 2020, 07:12:23 PM

Previous topic - Next topic
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 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:

  • How do I rebuild core so it picks up my change(s) (ideally without having to rebuild anything else)?
  • Once there's a new core, how do I go about testing the changes? Do I need to keep re-installing OPNsense from an image, or is there a more efficient way? (The files I'm changing are just .php and .inc files, in case that makes things easier?)
Thanks for any help.

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

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?

On a test OPN VM:

opnsense-code core
cd /usr/core

Do your changes there, then

make upgrade

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!

Hi, everyone.
I'm going to build "core".
Even after editing the php file, the modified contents are not reflected.
What should I do?

If you need a ready-made development platform, you can use this:

https://github.com/punktDe/vagrant-opnsense
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

> 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