From owner-freebsd-current@FreeBSD.ORG Sat Apr 26 23:35:34 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62ACCF3F for ; Sat, 26 Apr 2014 23:35:34 +0000 (UTC) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 359CE11D4 for ; Sat, 26 Apr 2014 23:35:33 +0000 (UTC) Received: by mail-pb0-f49.google.com with SMTP id rr13so4471499pbb.36 for ; Sat, 26 Apr 2014 16:35:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=GpLYBin/C/4rp3rmdq4fZmZ6rp+qxGCVbU41RWuGNOI=; b=jVqa7MXcTf2BsLmQbkzJFo0BTbrIdfGKdDxKzbX7ux6sDzqbPte7FWkJ+jhwHXpzo6 OjFk/451jsTXOVuDez6cb0f3tduZ8lJxYDWajl4NE/EpBAfazAJTpgjEbdaPscW+zA92 t6x8whhAr42LglKpfdJqUlQMq6tatDHJHykqITRk/qHHiUEN7e+WkIY/DE5IJ8LGL7ku svp2EUUZVgOqa+dBXe6YHK51EjZvoMjdForlMB32jvpi3X2TFzTRASUIYZWIXVsZdfgy WFIiDYdMszRacbqm3JxusEgVR3gfkXl9qSot4JSjzJJxWv8m59e5kB8nBPzOODjK2e4L VIRw== X-Gm-Message-State: ALoCoQlTqNSVnXW4SFNEb9f08IDRChqzL3EFsxF0vZye2wOKq6/T2KMuNw7LDO0/9TrJFMFijXNq X-Received: by 10.68.237.33 with SMTP id uz1mr20032859pbc.76.1398555327012; Sat, 26 Apr 2014 16:35:27 -0700 (PDT) Received: from [10.64.25.6] (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id qx11sm63587359pab.35.2014.04.26.16.35.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 26 Apr 2014 16:35:26 -0700 (PDT) Sender: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: Stand-alone DTB build fails From: Warner Losh In-Reply-To: <535A77BB.1070600@arcserv.com> Date: Sat, 26 Apr 2014 17:35:24 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <535A77BB.1070600@arcserv.com> To: Ron Brown X-Mailer: Apple Mail (2.1874) Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 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: Sat, 26 Apr 2014 23:35:34 -0000 On Apr 25, 2014, at 8:56 AM, Ron Brown wrote: > The FreeBSD Wiki at https://wiki.freebsd.org/FlattenedDeviceTree = refers to > building a dtb in the following manner: >=20 > -- > On platforms capable of running loader(8) the default scenario is to = use > a stand-alone DTB file, which is handled by the loader and handed = over to > kernel at boot time. In this approach, a DTB should be created at = kernel > build time: >=20 > If FDT_DTS_FILE is specified in the kernel config file, the DTB is > compiled automatically as part of the buildkernel stage. The user = does > not have to perform any explicit steps. >=20 > If the default DTS file is not specified in the kernel config file, = the > DTB needs to be created separately by the user with the builddtb = target: >=20 > $ make builddtb FDT_DTS_FILE=3Dmpc8572ds.dts > -- >=20 > However, this fails with: > ERROR: Specified DTS File (zedboard.dts) does not exist! >=20 > This is because /usr/src/Makefile.inc1 uses the MACHINE environment > variable to find FDT_DTS_FILE: >=20 > Starting at line 1836: > if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${MACHINE}/${FDT_DTS_FILE} ]; = ... > echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ > exist!"; \ >=20 > MACHINE refers to the currently running system, however most of the = ARM > development is cross-compiled and the zedboard .dts resides in the = dts/arm > directory while MACHINE points if to the dts/amd64 directory. > Should Makefile.inc1 instead refer to TARGET or something similar? >=20 > if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${TARGET}/${FDT_DTS_FILE} ]; = =85 I just committed r264979: make_dtb.sh is designed to be used in a kernel build environment where MACHINE is defined to the target's value, not the host's value. However, in Makefile.inc1, it is still defined to be the host's value. Make the makedtb target work by expanding TARGET in the existance test, and passing MACHINE=3D$TARGET in the call to = make_dtb.sh which will fix the problem. At least it fixed the problem for me. Warner