From owner-freebsd-current@freebsd.org Fri Aug 30 17:42:27 2019 Return-Path: Delivered-To: freebsd-current@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 8ED43D465D for ; Fri, 30 Aug 2019 17:42:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 46KmyW1krgz4MHR for ; Fri, 30 Aug 2019 17:42:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 3AE5FD465C; Fri, 30 Aug 2019 17:42:27 +0000 (UTC) Delivered-To: current@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 3A9F3D465B for ; Fri, 30 Aug 2019 17:42:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46KmyW0mFrz4MHQ; Fri, 30 Aug 2019 17:42:27 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C2BCB82FF; Fri, 30 Aug 2019 17:42:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-wr1-f46.google.com with SMTP id t16so7787959wra.6; Fri, 30 Aug 2019 10:42:26 -0700 (PDT) X-Gm-Message-State: APjAAAUbNd90v6+wHXL0PzqRFdgd8Q1Om3YViQyHshIkOSA251U/IYN2 ResuoSYDmjHTPaSvllonp/DglJN5JvjQRs9zujw= X-Google-Smtp-Source: APXvYqzvJNHGkNOEkGx1N4CKNbrjMd9JeUcnRFdLQeGDYWbmv6oIuvHjvfldOEmRASu4ssM7+uKsIrSo+IdE2IQ4j7g= X-Received: by 2002:adf:f5c5:: with SMTP id k5mr15880513wrp.42.1567186945666; Fri, 30 Aug 2019 10:42:25 -0700 (PDT) MIME-Version: 1.0 References: <20190816120524.21b7fd19@ernst.home> In-Reply-To: From: Kyle Evans Date: Fri, 30 Aug 2019 12:42:13 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: problem with LOCAL_MODULES To: John Baldwin Cc: gljennjohn@gmail.com, current Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 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: Fri, 30 Aug 2019 17:42:27 -0000 On Fri, Aug 16, 2019 at 7:38 PM John Baldwin wrote: > > On 8/16/19 3:05 AM, Gary Jennejohn wrote: > > I tried to build a kernel today and it failed in modules-all even > > though I had LOCAL_MODULES="" in /etc/src.conf, as recommended by > > jhb. > > > > That's wrong. It has to be LOCAL_MODULES=, otherwise > > /sys/conf/kern.post.mk seems to conclude that there should be a > > module under /usr/local/sys/modules with the name "". > > I think this will permit both versions to work: > > Index: sys/conf/kern.post.mk > =================================================================== > --- kern.post.mk (revision 351151) > +++ kern.post.mk (working copy) > @@ -76,6 +76,7 @@ modules-${target}: > cd $S/modules; ${MKMODULESENV} ${MAKE} \ > ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} > .endif > +.if !empty(LOCAL_MODULES) > .for module in ${LOCAL_MODULES} > @${ECHODIR} "===> ${module} (${target:S/^reinstall$/install/:S/^clobber$/cleandir/})" > @cd ${LOCAL_MODULES_DIR}/${module}; ${MKMODULESENV} ${MAKE} \ > @@ -83,6 +84,7 @@ modules-${target}: > ${target:S/^reinstall$/install/:S/^clobber$/cleandir/} > .endfor > .endif > +.endif > .endfor > > # Handle ports (as defined by the user) that build kernel modules > I think I'd like to see this with !empty(LOCAL_MODULES) && EXISTS(${LOCAL_MODULES_DIR}) or maybe just the latter condition to prevent accidental foot-shooting... I was testing a problem with doing this stuff in a poudriere build for swills@ and set LOCAL_MODULES="" only to get an error because LOCAL_MODULES_DIR doesn't yet exist on the machine I was testing with -- which we can trivially avoid. Thanks, Kyle Evans