From owner-freebsd-hackers@freebsd.org Sun Mar 8 06:11:06 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8FD025FB74; Sun, 8 Mar 2020 06:11:06 +0000 (UTC) (envelope-from ivlevsr@yandex.ru) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48ZrZb5SP0z4gMm; Sun, 8 Mar 2020 06:11:03 +0000 (UTC) (envelope-from ivlevsr@yandex.ru) Received: from forward100q.mail.yandex.net (forward100q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb97]) by forward102o.mail.yandex.net (Yandex) with ESMTP id EA9936680D8E; Sun, 8 Mar 2020 09:10:59 +0300 (MSK) Received: from mxback11q.mail.yandex.net (mxback11q.mail.yandex.net [IPv6:2a02:6b8:c0e:1b4:0:640:1f0c:10f2]) by forward100q.mail.yandex.net (Yandex) with ESMTP id E658F708000A; Sun, 8 Mar 2020 09:10:59 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback11q.mail.yandex.net (mxback/Yandex) with ESMTP id r6uByuhLwb-AxRSfvoO; Sun, 08 Mar 2020 09:10:59 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1583647859; bh=zVJrpxsIEZrrSqKKs4BoYgpT/z2LoCN7qD42UsM3aJQ=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=kjPkAVypLy9Er2vr64baVmUtb9euLMN7YzTJhZQKwDSw6+TLVlMJah+Ca0zlE6YRn amZuiPV9P5KPEHR9u0ve2h5c4XInHHlPtKBoK277AqGxHCib6j1InMUrYRgA/B/Av6 7XeyrMbNin6/vNvckqYuLn9v7Vo9kagGWtnWHwEM= Received: by vla1-19f0dde8b070.qloud-c.yandex.net with HTTP; Sun, 08 Mar 2020 09:10:59 +0300 From: Sergey Ivlev To: Ian Lepore , "freebsd-hackers@freebsd.org" , "freebsd-arm@FreeBSD.org" In-Reply-To: <76e66ea321b8d7480af75cfbd38fa55f5ac40afd.camel@freebsd.org> References: <2228511583493903@vla3-bebe75876e15.qloud-c.yandex.net> <76e66ea321b8d7480af75cfbd38fa55f5ac40afd.camel@freebsd.org> Subject: Re: Cross-building ports with release(7) MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 08 Mar 2020 11:10:59 +0500 Message-Id: <3580141583647357@vla1-2bebf6b1c06e.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 48ZrZb5SP0z4gMm X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yandex.ru header.s=mail header.b=kjPkAVyp; dmarc=pass (policy=none) header.from=yandex.ru; spf=pass (mx1.freebsd.org: domain of ivlevsr@yandex.ru designates 37.140.190.182 as permitted sender) smtp.mailfrom=ivlevsr@yandex.ru X-Spamd-Result: default: False [-3.09 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[yandex.ru:s=mail]; NEURAL_HAM_MEDIUM(-0.99)[-0.990,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:37.140.128.0/18:c]; FREEMAIL_FROM(0.00)[yandex.ru]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(0.00)[ip: (-9.89), ipnet: 37.140.128.0/18(-4.89), asn: 13238(-3.84), country: RU(0.01)]; DKIM_TRACE(0.00)[yandex.ru:+]; DMARC_POLICY_ALLOW(-0.50)[yandex.ru,none]; DWL_DNSWL_NONE(0.00)[yandex.ru.dwl.dnswl.org : 127.0.5.0]; IP_SCORE_FREEMAIL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yandex.ru]; ASN(0.00)[asn:13238, ipnet:37.140.128.0/18, country:RU]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[182.190.140.37.list.dnswl.org : 127.0.5.1] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2020 06:11:06 -0000 06.03.2020, 22:15, "Ian Lepore" : > On Fri, 2020-03-06 at 16:25 +0500, Sergey Ivlev wrote: >>  Hello! >> >>  I've successfully built FreeBSD 13.0-CURRENT (r358609) image for >>  ARMv7 on AMD64 host using release(7). >> >>  I wonder is it possible for AMD64 host to build/install ports into >>  the image? >> >>  I've defined arm_do_quirk function in my configuration file, where >>  I'm calling `make DESTDIR=${CHROOTDIR}/${DESTDIR} TARGET=arm >>  TARGET_ARCH=armv7 ... build install clean`. But it ended up with >>  error, of course, because that make(1) chroots into >>  ${CHROOTDIR}/${DESTDIR} and runs executables from there, but >>  ${CHROOTDIR}/${DESTDIR} is where **built target** located (i.e. where >>  files for ARMv7; ${CHROOTDIR}/${DESTDIR} is {my chrrot >>  dir}/usr/obj/usr/src/arm.armv7/release/{kernel name}). Altering the >>  PATH variable so it will specify ${CHROOTDIR} as the first entry, >>  doesn't help either -- I end up with the same ``exec format error'' >>  (env PATH="${CHROOTDIR}:${PATH}" make DESTDIR=...). >> >>  I had also tried to `chroot ${CHROOTDIR} make DESTDIR=${DESTDIR} >>  TARGET=arm TARGET_ARCH=armv7 ... build install clean`, but >>  mount_nullfs(8) failed under chroot(8). >> >>  Therefore, my question is: is it possible while building an image for >>  ARMv7 on AMD64 host with release(7) also building and installing >>  ports into the result image? >> >>  Thanks in advance! > > Cross-building ports is done with poudriere and qemu. There is some > info on setting it up in https://wiki.freebsd.org/QemuUserModeHowTo but > I think that's pretty out of date. There may be newer how-to info that > I'm not aware of. I'm going to CC the freebsd-arm@ list on this reply, > because the folks there probably know of better information resources > for all this. > > I also have no idea how to integrate poudriere-based building with > release(7) stuff. It may be a matter of building a local package repo > using poudriere, then configuring the release script stuff to use it. Thanks for reply! Let's suppose that I've built a local repository with packages targeting ARM (using poudriere and qemu). Is it possible than to use `pkg add -c {CHROOTDIR} arm_pkg_name` within arm_do_quirk function to install a package into the release?