From owner-freebsd-current@freebsd.org Sun May 22 21:18:10 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85919B4677D for ; Sun, 22 May 2016 21:18:10 +0000 (UTC) (envelope-from mmacy@nextbsd.org) Received: from sender163-mail.zoho.com (sender163-mail.zoho.com [74.201.84.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77E3B1E39; Sun, 22 May 2016 21:18:10 +0000 (UTC) (envelope-from mmacy@nextbsd.org) Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1463951887788818.7661604440858; Sun, 22 May 2016 14:18:07 -0700 (PDT) Date: Sun, 22 May 2016 14:18:07 -0700 From: Matthew Macy To: "Tim Kientzle" Cc: "K. Macy" , "FreeBSD current" Message-ID: <154da550d77.fb9ef0d4130957.4575849336840075088@nextbsd.org> In-Reply-To: <471497D9-2B97-42B4-9C59-EBABEEED77C9@kientzle.com> References: <9BC1A0E1-696D-4C00-B8C8-B57C4DB3A8EF@kientzle.com> <471497D9-2B97-42B4-9C59-EBABEEED77C9@kientzle.com> Subject: Re: pkg chroot issues? MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Priority: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2016 21:18:10 -0000 ---- On Sun, 22 May 2016 13:43:13 -0700 Tim Kientzle wrote ---- > > > On May 22, 2016, at 1:28 PM, K. Macy wrote: > > > > > > > > On Sunday, May 22, 2016, Tim Kientzle wrote: > > Crochet has some experimental hooks to install packages onto the system being built, but this seems to be hitting problems due to limitations in 'pkg -c'. In particular, it seems that pkg performs the chroot before it does any network lookups. This is a problem if the chroot is not a complete system environment (which it cannot be when you're building an image for another system). > > > > There's some further discussion on github: > > > > https://github.com/freebsd/crochet/issues/141 > > > > Any suggestions? > > > > Cheers, > > > > Tim > > > > > > Just like you need to mount devfs you should have a resolv.conf in your chroot first. Just copy it over before running pkg. This works for me in my image creation script. > > Sometimes the image does already have a resolv.conf, but if it does, it's for the target environment (where the image will ultimately be running) and may not be appropriate for the environment where the image is being built. Setting NAMESERVER to "10.0.1.1" crashed pkg for me. Maybe it's been fixed in the meantime. If a resolv.conf already exists I would just rename it before and then rename it back after the call to pkg -c. Cheers. -M