Centralizing /usr/src compilation

Erich Dollansky erichsfreebsdlist at alogt.com
Mon Oct 3 06:25:31 UTC 2016


Hi,

On Sun, 2 Oct 2016 20:20:06 -0300
Mario Lobo <lobo at bsd.com.br> wrote:

> On Sun, 2 Oct 2016 21:13:12 +0800
> Erich Dollansky <erichsfreebsdlist at alogt.com> wrote:
> 
> > On Sat, 1 Oct 2016 10:42:24 -0300
> > Mario Lobo <lobo at bsd.com.br> wrote:
> >   
> > > I hava a src master server (10.3.51.50) where I compile src and
> > > kernel. No CPUTYPE or compiler flags are set. On it, I issued 
> > > make buildworld and make buildkernel that proceed with no errors.
> > > I shared its /usr/src and /usr/obj via nfs.
> > > 
> > > Then, on a slave server, same version and arch as the master, it
> > > has this:
> > >     
> > do both machines have the same CPU? As you did not specify the CPU,
> > the CPU in the server was used as the target. If you have different
> > CPUs but want to use one kernel for all, it might will work if you
> > specify the type of CPU with the least capabilities you have or you
> > compile on that machine.
> > 
> > Erich
> >   
> > > 2>Illegal instruction (core dumped) Illegal instruction (core
> > > 2>dumped)    
> > 
> > Illegal instruction sounds like the target CPU does not know an
> > instruction. Of course, this could also be caused by something else.
> >   
> > > even bury my idea for good as non workable?    
> > 
> > It should work when you set the CPU type.
> > 
> > I also run a kernel compiled for an older Intel CPU on a newer Intel
> > CPU without problems. I never tried it the other way around.
> > 
> > Erich  
> 
> Hi Erich. Thanks for replying!
> 
> Actually, the "slave" server is a guest VM hosted on the "master"
> server.

this is then completely different. I do not know how virtualisation
works on FreeBSD and what a guest sees inside the virtual machine.

Have a very simple try. Compile FreeBSD inside the virtual machine and
check if you can distribute the binaries from one virtual machine to
another one.

I would use jails except in very strange situations when host and guest
are both running FreeBSD.
> 
> Like I said, the slave has the same FBSD version and arch (AMD64) as
> the "master". (I know ... the jail argument, but I still didn't
> master it enough to fell confident for production).
> 
> I did not specify any CPUTYPE because I assumed that if I didn't, it
> would compile for a GENERIC CPU, although I thought that through
> VT-x/AMD-V, the guests sees the same CPU as the host.

I do not know much about GENERIC as I hardly use it.
> 
> Which CPUTYPE should I set? I ask because there are other physical
> machines on the LAN with slightly different CPUs in which I want this
> to work also.

Just set none as the compiler uses then the type of CPU it is running
on.

Erich


More information about the freebsd-questions mailing list