OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • [SOLVED] Use local ports tree instead or packages from mirror when building core
« previous next »
  • Print
Pages: [1]

Author Topic: [SOLVED] Use local ports tree instead or packages from mirror when building core  (Read 5997 times)

interfaSys

  • Full Member
  • ***
  • Posts: 165
  • Karma: 13
    • View Profile
    • interfaSys ltd
[SOLVED] Use local ports tree instead or packages from mirror when building core
« on: March 11, 2016, 11:02:17 am »
The current process to build and install core, as I understand it is as follows:

  • Update all ports
  • cd /usr/tools
  • Build ports missing from the packages "image" using "make ports"
  • make core

make core does this:
  • Unpack all packages, mix with compiled missing ports
  • Build core
  • Update contrib with files from packages?
  • Create new packages image


For people using `opnsense/ports` to compile all their ports, there are a few problems:

  • All missing ports have to be compiled again, although all those ports have been installed already
  • The rest of the packages used are vanilla packages which have not been compiled for the current architecture. It's only a problem is those files are actually used
  • If contrib is updated using vanilla packages, then it might introduce some changes compared to what is installed

If the only reason packages are downloaded and unpacked to build core is to update contrib, then only those packages should be used.
Those packages don't even need to be compiled, they're already installed and the needed files can be fetched from the filesystem. pkg info can tell the script if the version is what is expected.

Am I correct and the whole process can be simplified for people using the ports tree?
« Last Edit: March 11, 2016, 11:57:33 am by franco »
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13633
  • Karma: 1174
    • View Profile
Re: Use local ports tree instead or packages from mirror when building core
« Reply #1 on: March 11, 2016, 11:28:05 am »
Quote
Am I correct and the whole process can be simplified for people using the ports tree?

I am not sure I understand this question. Can you elaborate?

tools.git is for building from scratch, not for providing incremental updates of core for a running system. It does things the way it does in order to verify the full integrity of the build, so core e.g. depends on installing all the currently needed ports from the set and doing it in a totally clean jail to avoid taint.

I think what you are looking for is an in-place build of core.git which yields a package when run on OPNsense itself. Is this correct?

If so, there are quite a few possibilities for simplification... On your box, you can run this:

# pkg install git gettext-tools
# cd /usr/core
# make DESTDIR=/tmp/core-pkg FLAVOUR=OpenSSL install
# make DESTDIR=/tmp/core-pkg scripts
# make DESTDIR=/tmp/core-pkg manifest > /tmp/core-pkg/+MANIFEST
# make DESTDIR=/tmp/core-pkg plist > /tmp/core-pkg/plist
# pkg create -m /tmp/core-pkg -r /tmp/core-pkg -p /tmp/core-pkg/plist
# rm -r /tmp/core-pkg
# ls *.txz
# pkg add -f ...

:)
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13633
  • Karma: 1174
    • View Profile
Re: Use local ports tree instead or packages from mirror when building core
« Reply #2 on: March 11, 2016, 11:53:17 am »
I've added it as a simple target... FLAVOUR needs to be set if not OpenSSL and packages "git" and "gettext-tools" must be installed in order to create the package.

# make package

Also see: https://github.com/opnsense/core/commit/445504da33c16ca4253023e6a1fdebd517a3bb61
Logged

interfaSys

  • Full Member
  • ***
  • Posts: 165
  • Karma: 13
    • View Profile
    • interfaSys ltd
Re: Use local ports tree instead or packages from mirror when building core
« Reply #3 on: March 11, 2016, 11:53:53 am »
That worked perfectly, thanks.

So for each release, someone who wants to compile ports using the the opnsense ports tree would simply need to

  • update kernel+base with opnsense-update
  • cd /usr/ports; switch to tagged release; update all ports
  • cd /usr/core; switch to tagged release; run the script you've provided

Easier than using make-core in /usr/tools :)



Logged

interfaSys

  • Full Member
  • ***
  • Posts: 165
  • Karma: 13
    • View Profile
    • interfaSys ltd
Re: Use local ports tree instead or packages from mirror when building core
« Reply #4 on: March 11, 2016, 11:55:39 am »
And thanks for the new target, even easier for users than having to add a script.
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13633
  • Karma: 1174
    • View Profile
Re: [SOLVED] Use local ports tree instead or packages from mirror when building core
« Reply #5 on: March 11, 2016, 11:58:45 am »
Ok, now I see. Yes, your environment is now the native build environment for the core package and you don't have to jump through any other hoops. That makes perfect sense. Thanks for the explanations and prodding. :)
« Last Edit: March 11, 2016, 12:02:39 pm by franco »
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13633
  • Karma: 1174
    • View Profile
Re: [SOLVED] Use local ports tree instead or packages from mirror when building core
« Reply #6 on: March 12, 2016, 10:25:19 am »
There will also be an upgrade target, that should be as far as we could possibly go ;)

# make upgrade
Logged

interfaSys

  • Full Member
  • ***
  • Posts: 165
  • Karma: 13
    • View Profile
    • interfaSys ltd
Re: [SOLVED] Use local ports tree instead or packages from mirror when building core
« Reply #7 on: March 12, 2016, 10:44:24 am »
Awesome, thanks :)
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Development and Code Review (Moderator: fabian) »
  • [SOLVED] Use local ports tree instead or packages from mirror when building core
 

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