cross installing freebsd?

Alfred Perlstein alfred at freebsd.org
Mon Dec 8 05:48:54 UTC 2014


On Dec 7, 2014, at 8:35 PM, Garrett Cooper wrote:

> On Dec 6, 2014, at 17:32, Alfred Perlstein <alfred at freebsd.org> wrote:
> 
>> Hey folks,
>> 
>> In order to make installation of a new world/kernel on my i386 soekris a LOT faster/easier I've taken to doing builds on an amd64 host and then "cross-installing"
>> 
>> Steps are as follows:
>> 
>> On amd64 host:
>> /usr/trees/freebsd.git % env TARGET=i386 make -j8 buildworld && env TARGET=i386 make -j8 buildkernel
>> 
>> On i386 host:
>> mount spigot:/usr/trees /usr/trees
>> mount spigot:/usr/obj /usr/obj
>> cd /usr/trees/freebsd.git
>> # install kernel:
>> env MAKEOBJDIRPREFIX=/usr/obj/i386.i386 CC=/usr/bin/cc \
>> INSTALL=/usr/bin/install \
>> make installkernel
>> # install world:
>> env MAKEOBJDIRPREFIX=/usr/obj/i386.i386 CC=/usr/bin/cc \
>> INSTALL=/usr/bin/install STRIPBIN=/usr/bin/strip \
>> MAKEWHATIS=/usr/bin/makewhatis \
>> make installworld
>> 
>> Seems to work nicely.
>> 
>> Any objections if I add something like this target as "cross-installworld" and "cross-installkernel" to top level Makefile?
> 
> Hi Alfred,
> 	Reading your examples...
> 	1. I’m wondering if we should formalize CROSS_BUILD_TESTING in Makefile.inc1:
> 
> 188 .if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING)
> 189 OBJTREE=        ${MAKEOBJDIRPREFIX}
> 190 .else
> 191 OBJTREE=        ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
> 192 .endif
> 
> 	2. MAKEWHATIS seems like it should be added to ITOOLS. Do you agree?
> 	3. Seems like strip should be added to ITOOLS if CROSS_BUILD_TESTING is defined (or at the very least LOCAL_ITOOLS).
> 	4. Why did you need to explicitly define the path to INSTALL?
> Thanks!

To be honest I have a gist as to what you're saying but I think the build is suffering from shibboleth-itis.  Meaning it's not serviceable unless you're intimately familiar with it…

I *guess* that ITOOLS or maybe LOCAL_ITOOLS means programs needed to installworld/installkernel?

If so, then yes, makewhatis needs to be added to that.

As far as everything else written:
no idea what "CROSS_BUILD_TESTING" means, it's not documented anywhere I can see in the makefile.

I can't decode if there will be a target that "just works" for doing a cross-install, will there be?  What will it be named and how will people invoke it?

Can we have cross-installworld and cross-installkernel targets please?

-Alfred


More information about the freebsd-hackers mailing list