From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 8 17:49:35 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4662AFD3 for ; Mon, 8 Dec 2014 17:49:35 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 31DE48C9 for ; Mon, 8 Dec 2014 17:49:35 +0000 (UTC) Received: from [10.0.1.20] (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id EE256341F850; Mon, 8 Dec 2014 09:49:34 -0800 (PST) Subject: Re: cross installing freebsd? Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=windows-1252 From: Alfred Perlstein In-Reply-To: Date: Mon, 8 Dec 2014 09:49:37 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <5483AE21.8090306@freebsd.org> <613884DA-F978-4D9F-9E37-D39581EFEA61@freebsd.org> <26F569E9-3E70-4CE7-810F-5427FF1C7EA0@gmail.com> To: Garrett Cooper X-Mailer: Apple Mail (2.1283) Cc: FreeBSD Hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2014 17:49:35 -0000 On Dec 8, 2014, at 9:47 AM, Alfred Perlstein wrote: >=20 > On Dec 8, 2014, at 2:04 AM, Garrett Cooper wrote: >=20 >> On Dec 7, 2014, at 21:48, Alfred Perlstein = wrote: >>=20 >>>> Hi Alfred, >>>> Reading your examples... >>>> 1. I=92m wondering if we should formalize CROSS_BUILD_TESTING in = Makefile.inc1: >>>>=20 >>>> 188 .if ${MACHINE} =3D=3D ${TARGET} && ${MACHINE_ARCH} =3D=3D = ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING) >>>> 189 OBJTREE=3D ${MAKEOBJDIRPREFIX} >>>> 190 .else >>>> 191 OBJTREE=3D ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} >>>> 192 .endif >>>>=20 >>>> 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! >>>=20 >>> 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=85 >>=20 >> Right. I didn=92t know about all of these magic things until I = started reading the Makefiles :). >>=20 >>> I *guess* that ITOOLS or maybe LOCAL_ITOOLS means programs needed to = installworld/installkernel? >>=20 >> Yes. Basically for things that can be replaced while make = installworld is run, or as Makefile.inc1 says=85 >>=20 >> "# Required install tools to be saved in a scratch dir for safety.=94 >>=20 >> All the libraries for the tools are backed up so if the tools get = replaced while make distributeworld/installworld is running, your system = won=92t be hosed (that=92s why make installworld works for me the = majority of the time, if cp gets replaced and ABI changes =97 not = always, but oftentimes). >>=20 >>> If so, then yes, makewhatis needs to be added to that. >>=20 >> Review opened for that issue: https://reviews.freebsd.org/D1280 >>=20 >>> As far as everything else written: >>> no idea what "CROSS_BUILD_TESTING" means, it's not documented = anywhere I can see in the makefile. >>=20 >> It=92s something that ru@ introduced (probably to do comparisons = between architectures). I haven=92t quite tracked down why make = tinderbox works with TARGET_ARCH/TARGET set to the host values, but I=92ll= probably figure it out soon. >>=20 >>> 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? >>>=20 >>=20 >>> Can we have cross-installworld and cross-installkernel targets = please? >>=20 >> Setting TARGET/TARGET_ARCH should be sufficient in an ideal world. = Jumping through hoops to do this with a myriad of variables which should = be automatically determined via sane defaults seems wrong/unusable=85 = there shouldn=92t be a reason for why we need to introduce autoconf = variable style hell for building/installing world, unless someone is = intentionally skating around sane defaults. >>=20 >> I think that creating more custom targets will only complicate/muddle = the build process, and create more potential for bugs like the one that = I just addressed with xdev. >=20 >=20 > I still don't see how I am supposed to do this: >=20 > ssh amd64_machine > export TARGET=3Di386 > cd /usr/trees/freebsd > make -j8 build world && make -j8 buildkernel >=20 > ssh i386box > mount amd64_machine:/usr/trees/freebsd /usr/trees/freebsd > mount amd64_machine:/usr/obj /usr/obj > cd /usr/trees/freebsd > make installkernel installworld >=20 > That last step "make installkernel installworld" will bomb out unless = I set those vars CC=3D/usr/bin/cc, MAKEWHATIS=3D/usr/bin/makewhatis, = STRIPBIN=3D/usr/bin/strip, INSTALL=3D/usr/bin/install all over the = place. Why is there not a target for this that just knows the right = things to set? >=20 I just re-read your original mail, if what you're saying is that on the = i386 box I need to set "TARGET_ARCH" or "TARGET" or "I_AM_A_DERP" vars = to something, then just say what those magic vars are so I can document = it please. gah! -Alfred=