OPNsense Forum

English Forums => Development and Code Review => Topic started by: mitra7 on May 20, 2017, 12:33:50 pm

Title: [SOLVED] Building from Source Issues
Post by: mitra7 on May 20, 2017, 12:33:50 pm
Hello,

I am trying building from source like it is described in here: https://github.com/opnsense/tools
I've got a Virtual Machine (VMWare) with FreeBSD 11, UFS File System, 30 GB Hard Drive and 4 GB of RAM.

I follow these steps:
Code: [Select]
# pkg install git
# cd /usr
# rm -rf src ports
# git clone https://github.com/opnsense/plugins
# git clone https://github.com/opnsense/ports
# git clone https://github.com/opnsense/tools
# git clone https://github.com/opnsense/core
# git clone https://github.com/opnsense/src
# cd tools

But when I do:

Code: [Select]
make dvd
After a while I get this error:

Quote
fatal: ambiguous argument 'stable/17.1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
*** Error code 128

Stop.
make: stopped in /usr/tools

Image Link: https://puu.sh/vVQcj/fd69d33c68.png

I was really needing some help as I got stuck always on the same step.

Thanks!
Title: Re: Building from Source Issues
Post by: franco on May 22, 2017, 08:08:26 am
The instructions seem incomplete now that we build from several branches and git-clone only pulls the master branch.

Try this:

# make update-tools,core,plugins,ports,src

And rerun the build. :)


Thanks,
Franco
Title: Re: Building from Source Issues
Post by: mitra7 on May 24, 2017, 08:12:24 pm
Now I can build dvd, vm, vga however when I run one of those (trying to install), when the system is booting it does not launch the configuration tool.

Code: [Select]
Warning: require_once(config.inc): failed to open stream: No such file or directory in /usr/local/etc/rc.bootup on line 52
Fatal error: require_once(): Failed opening required 'config.inc' (include_path='.:/usr/local/share/pear') in /usr/local/etc/rc.bootup on line 52

(https://puu.sh/w08Na/b25f5dd778.png)
Title: Re: Building from Source Issues
Post by: franco on May 24, 2017, 08:19:25 pm
Include path is not complete, looks like an artefact from our current rework. Building from 17.1.7 tag in core git should give you more luck...

# cd /usr/core
# git checkout stable/17.1
# git reset --hard 17.1.7
# cd /usr/tools
# make clean-images core-opnsense
# make <IMAGETYPE>

I'll get that fixed in core.git shortly. Thanks for reporting this.


Cheers,
Franco
Title: Re: Building from Source Issues
Post by: mitra7 on May 24, 2017, 08:53:25 pm
It worked! Thanks, you were very helpful!!  :D
Title: Re: Building from Source Issues
Post by: franco on May 25, 2017, 12:31:39 pm
Cool, glad to be of help. :)

stable/17.1 works again now with this commit: https://github.com/opnsense/core/commit/77667027e

If you want to build reliably, try to stay on the tagged versions. They indicate a general "roundness" of the process as much as traceability for what we put out as releases. Between tags there could always be problems, but that's what these times are for until the next release is ready.


Cheers,
Franco
Title: Re: [SOLVED] Building from Source Issues
Post by: iguanito on August 01, 2017, 06:16:16 pm
Hi there :)

I just installed OPNsense after my pfsense SG2440 borked an update yesterday :s
I was ready to make the switch so I installed FreeBSD 11 first, and used the bootstrap script found on github.
The same PHP error mentioned above occured - i.e. includepath is incomplete.

Solution:
I identified empty php.ini files in /usr/local/etc/ as well as the templates for dev and prod.
I copied the dev one into the php.ini and manually added the include path copied from:
 /usr/local/opnsense/service/templates/OPNsense/WebGui/php.ini, namely:


Code: [Select]
include_path = ".:/usr/local/etc/inc:/usr/local/www:/usr/local/opnsense/mvc:/usr/local/share/pear:/usr/local/opnsense/contrib"
and started the webserver manually using the rc script /usr/local/etc/rc.restart_webgui

I know the thread is solved, but I'm not sure how this happened. It does not seem to share the same cause as before.
Title: Re: [SOLVED] Building from Source Issues
Post by: franco on August 01, 2017, 06:30:26 pm
Hi iguanito,

Welcome. :D

The bug happens sporadically when the backend daemon cannot start. The template refresh is required on first boot (so is the background daemon, it goes both ways). After one boot and php.ini in place this shouldn't happen again.

We will either add an additional bootstrap php.ini for the first boot, or solve the issue of the startup itself.

We'll see, a bit of time to think about this for until 18.1 is out next year.


Cheers,
Franco