Building inside a jail, how to install on host (outside the jail)

When building inside a jail : " /usr/ports , make , make install" , the files get installed in the jail.
But how do i install it outside the jail, on the host ? [ What is the proper way, the good way ]
[PS: With a PREFIX you get deeper in the jail, but not outside ]
 
Generally you want to make a package make package.

Then you should be able to install these on the outside host.

You can also use pkg-create to create a package from an installed package (or port). However I don't like doing this after a while because any site specific tweaks to i.e config files also get added to the package.
 
Generally you want to make a package make package.

Then you should be able to install these on the outside host.
Would the packages actually live in the jail, not on the host? If so one would need to get them from the jail to the host.
I'm asking because I don't know what parts of a jail are visible to the host.
 
Would the packages actually live in the jail, not on the host? If so one would need to get them from the jail to the host.
I'm asking because I don't know what parts of a jail are visible to the host.
Indeed. The packages will be built into the default directory inside /usr/ports. But from the host, you should just be able to use something similar to:

# pkg add /myjails/buildjail/usr/ports/packages/All/mypackage-version.txz

One nice thing about jails is they are completely exposed to the host as a basic directory structure. No virtual disk image, no network filesystem, no unionfs, etc.
 
One nice thing about jails is they are completely exposed to the host as a basic directory structure. No virtual disk image, no network filesystem, no unionfs, etc.
Thanks. I've not mucked around with them (no real need to) I know that some of the Linux container solutions work that way ($WORK, it's always a pain to figure out the path).
 
Let's say i do in the jail:
Code:
cd /usr/ports/shells/mksh
make config
make
make package
Then i have a file:
Code:
/usr/ports/shells/mksh/mksh-59c.pkg
which i can install manually on the host as the jail-file-system is accessible from the host.

Problem are hundreds of dependencies.
For each dependency i have to manually "make package" and the build ".pkg" files are spread around (not in one directory)
 
The thing with make-recursive is that it will build some additional ports not required by the one you want to build.
 
Normally i use poudriere in a jail, which is a good building system. But now i want to compile trinity-desktop for which no "real port exists".
So i am currently for that one trying to fall back on making all dependencies using "synth" in the same jail.
As far it seems to work.
 
poudriere is very good to make a bulk list of packages and put those in "All" directory.
But you cannot use it when manual intervention is needed during the building process, like installing or deinstalling or patching a port.
 
The thing with make-recursive is that it will build some additional ports not required by the one you want to build.
Really? First I have heard of this. What sort of additional ports and why if you don't mind me asking?

I tend to use BATCH=1 to skip the many config options other than the ones I am interested in beforehand; if this changes anything.

Slightly related, I have always suspected there to be an issue with deterministic reproducible builds this way; for example because a clean PREFIX isn't ensured for *every* port; some annoying detection in build scripts might end up compiling slightly different binaries. The porters do their best to avoid (sometimes by forcing it to drag in every possible dependency!) this but it is impossible to guarantee.
 
Yes for some reason it does. I did a try for vim earlier to make sure. It did make a package for kuya, lutok, dejagnu, and an other I don't remeber. If you simply run make, it does not build them. I first saw this while running config-recursive.
 
When building inside a jail : " /usr/ports , make , make install" , the files get installed in the jail.
But how do i install it outside the jail, on the host ? [ What is the proper way, the good way ]
[PS: With a PREFIX you get deeper in the jail, but not outside ]
You couldn't find that kind of dangerous and destructive information on a (good) public forum like this so easily my friend. This is the kind of knowledge that careers are built on...
 
I've wrote for myself a Tcl script that creates a package repository on the machine it is running on (on updates it also deletes the old packages, uses sub-directories like the ports-tree does, serves the repository via HTTP etc.). Simple. Combined with portmaster I'm even not thinking of looking at poudriere ;)
 
poudriere is very good to make a bulk list of packages and put those in "All" directory.
But you cannot use it when manual intervention is needed during the building process, like installing or deinstalling or patching a port.
Why would you need to patch a port manually during a build?
 
Yes for some reason it does. I did a try for vim earlier to make sure. It did make a package for kuya, lutok, dejagnu, and an other I don't remeber. If you simply run make, it does not build them. I first saw this while running config-recursive.

When you use 'config-recursive' you have to run it repeatedly until it stops bringing-up option menus. I think if you do this before running 'package-recursive' it will work properly. You may end-up configuring ports that wont be built, but that's not a major problem. Recursive targets seem to have a problem picking-up dependency changes from option menus.
 
Back
Top