Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 8/9] boards/zynq: rename the DTB to be loaded by U-Boot
Date: Mon, 11 Dec 2017 22:37:48 +0100	[thread overview]
Message-ID: <87k1xtues3.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <1512855007-1834-9-git-send-email-luca@lucaceresoli.net> (Luca Ceresoli's message of "Sat, 9 Dec 2017 22:30:06 +0100")

>>>>> "Luca" == Luca Ceresoli <luca@lucaceresoli.net> writes:

 > We are about to introduce genimage support for the Zynq boards. For
 > all of them U-Boot loads the DTB from a file named "devicetree.dtb" so
 > we need to rename it on the SD card image.

 > We could use genimage itself to rename files while creating the
 > image. But this would require a different genimage.cfg for each board,
 > leading to duplicate code.

 > Instead let's create a "devicetree.dtb" symlink pointing to the dtb
 > listed in the configuration. Currently all the Zynq-based boards have
 > only one DTS configured, but if one had two or more of them, the
 > symlink would point to the first one.

 > Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
 > ---
 >  board/zynq/post-image.sh        | 11 +++++++++++
 >  configs/zynq_microzed_defconfig |  1 +
 >  configs/zynq_zc706_defconfig    |  1 +
 >  configs/zynq_zed_defconfig      |  1 +
 >  4 files changed, 14 insertions(+)
 >  create mode 100755 board/zynq/post-image.sh

 > diff --git a/board/zynq/post-image.sh b/board/zynq/post-image.sh
 > new file mode 100755
 > index 000000000000..449f4a23725a
 > --- /dev/null
 > +++ b/board/zynq/post-image.sh
 > @@ -0,0 +1,11 @@
 > +#!/bin/sh
 > +
 > +# By default U-Boot loads DTB from a file named "devicetree.dtb", so
 > +# let's use a symlink with that name that points to the *first*
 > +# devicetree listed in the config.
 > +
 > +FIRST_DT=$(sed -n \
 > +           's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9\-]*\).*"$/\1/p' \
 > +           ${BR2_CONFIG})
 > +
 > +ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/devicetree.dtb

I've added a check for the empty string (E.G. in case you are not
building a kernel / using this option) and committed, thanks.

-- 
Bye, Peter Korsgaard

  reply	other threads:[~2017-12-11 21:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-09 21:29 [Buildroot] [PATCH 0/9] zynq boards: use genimage and update kernel + u-boot Luca Ceresoli
2017-12-09 21:29 ` [Buildroot] [PATCH 1/9] support/scripts/genimage.sh: show usage when invoked incorrectly Luca Ceresoli
2017-12-11 19:14   ` Peter Korsgaard
2017-12-09 21:30 ` [Buildroot] [PATCH 2/9] zynq_zed: linux: bump to xilinx-v2017.3 (based on 4.9) Luca Ceresoli
2017-12-11 17:19   ` Alistair Francis
2017-12-11 19:16   ` Peter Korsgaard
2017-12-09 21:30 ` [Buildroot] [PATCH 3/9] zynq_zed: u-boot: bump to xilinx-v2017.3 Luca Ceresoli
2017-12-11 17:19   ` Alistair Francis
2017-12-11 19:17   ` Peter Korsgaard
2017-12-09 21:30 ` [Buildroot] [PATCH 4/9] zynq_microzed: linux: bump to xilinx-v2017.3 (based on 4.9) Luca Ceresoli
2017-12-11 17:19   ` Alistair Francis
2017-12-11 19:17   ` Peter Korsgaard
2017-12-09 21:30 ` [Buildroot] [PATCH 5/9] zynq_microzed: u-boot: bump to xilinx-v2017.3 Luca Ceresoli
2017-12-11 17:20   ` Alistair Francis
2017-12-11 19:17   ` Peter Korsgaard
2017-12-09 21:30 ` [Buildroot] [PATCH 6/9] zynq_zc706: linux: bump to xilinx-v2017.3 (based on 4.9) Luca Ceresoli
2017-12-11 17:20   ` Alistair Francis
2017-12-11 19:20   ` Peter Korsgaard
2017-12-09 21:30 ` [Buildroot] [PATCH 7/9] zynq_zc706: u-boot: bump to xilinx-v2017.3 Luca Ceresoli
2017-12-11 17:20   ` Alistair Francis
2017-12-11 19:20   ` Peter Korsgaard
2017-12-09 21:30 ` [Buildroot] [PATCH 8/9] boards/zynq: rename the DTB to be loaded by U-Boot Luca Ceresoli
2017-12-11 21:37   ` Peter Korsgaard [this message]
2017-12-09 21:30 ` [Buildroot] [PATCH 9/9] boards/zynq: use genimage to generate a bootable SD card image Luca Ceresoli
2017-12-11 21:40   ` Peter Korsgaard
2017-12-12  8:24     ` Luca Ceresoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k1xtues3.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox