OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • How to make changes to "core" and test them?
« previous next »
  • Print
Pages: [1]

Author Topic: How to make changes to "core" and test them?  (Read 5774 times)

eddy

  • Newbie
  • *
  • Posts: 15
  • Karma: 4
    • View Profile
How to make changes to "core" and test them?
« 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 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.
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: How to make changes to "core" and test them?
« Reply #1 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
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

eddy

  • Newbie
  • *
  • Posts: 15
  • Karma: 4
    • View Profile
Re: How to make changes to "core" and test them?
« Reply #2 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?
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6767
  • Karma: 494
    • View Profile
Re: How to make changes to "core" and test them?
« Reply #3 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
Logged
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

eddy

  • Newbie
  • *
  • Posts: 15
  • Karma: 4
    • View Profile
Re: How to make changes to "core" and test them?
« Reply #4 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!
Logged

burns1230

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
    • View Profile
Re: How to make changes to "core" and test them?
« Reply #5 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?
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6923
  • Karma: 583
    • View Profile
Re: How to make changes to "core" and test them?
« Reply #6 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
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17704
  • Karma: 1617
    • View Profile
Re: How to make changes to "core" and test them?
« Reply #7 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
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • How to make changes to "core" and test them?
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2