Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/4] board/raspberrypi: prepare the image files for the target
Date: Sat, 17 Oct 2015 13:45:19 +0200	[thread overview]
Message-ID: <20151017114519.GA3717@free.fr> (raw)
In-Reply-To: <1440273688-92868-2-git-send-email-benoit@wsystem.com>

Beno?t, All,

On 2015-08-22 22:01 +0200, Beno?t Th?baudeau spake thusly:
> Automate the preparation of the generated image files for the Raspberry
> Pi firmware:
>  - mark the kernel image as supporting Device Tree,
>  - place the marked kernel image and the DTBs into the rpi-firmware
>    folder.
> 
> The instructions in readme.txt are updated accordingly.
> 
> Signed-off-by: Beno?t Th?baudeau <benoit@wsystem.com>
> ---
>  board/raspberrypi/post-image.sh | 17 ++++++++
>  board/raspberrypi/readme.txt    | 90 ++++++++++++++++++-----------------------
>  configs/raspberrypi2_defconfig  |  2 +
>  configs/raspberrypi_defconfig   |  2 +
>  4 files changed, 60 insertions(+), 51 deletions(-)
>  create mode 100755 board/raspberrypi/post-image.sh
> 
> diff --git a/board/raspberrypi/post-image.sh b/board/raspberrypi/post-image.sh
> new file mode 100755
> index 0000000..db9c53c
> --- /dev/null
> +++ b/board/raspberrypi/post-image.sh
> @@ -0,0 +1,17 @@
> +#!/bin/bash -e
> +
> +RPI_FW_BIN_DIR="${BINARIES_DIR}/rpi-firmware"
> +KERNEL_IMG="${BINARIES_DIR}/zImage"
> +KERNEL_RPI_FW_IMG="${RPI_FW_BIN_DIR}/zImage"
> +
> +# A special marker must be appended to the kernel image so that the firmware of
> +# the Raspberry Pi knows that it supports Device Tree. Without this marker, the
> +# firmware passes the ATAGS boot data instead of the appropriate DTB to the
> +# kernel.
> +# The final kernel image must be in the rpi-firmware folder.
> +mkknlimg "${KERNEL_IMG}" "${KERNEL_RPI_FW_IMG}"
> +
> +# Move the DTBs where the firmware expects them to be, i.e. to the rpi-firmware
> +# folder.
> +find "${BINARIES_DIR}/" -maxdepth 1 -type f -name '*.dtb' -print0 | \
> +	xargs -0r mv -ft "${RPI_FW_BIN_DIR}/"

Why not simply:
    cp -l "${BINARIES_DIR}/"*.dtb "${RPI_FW_BIN_DIR}"

I'd prefer we keep the DTB files where they were installed, so the user
does not get confused.

> diff --git a/board/raspberrypi/readme.txt b/board/raspberrypi/readme.txt
> index cf95879..168fab5 100644
> --- a/board/raspberrypi/readme.txt
> +++ b/board/raspberrypi/readme.txt
[--SNIP--]
> @@ -61,77 +61,65 @@ Result of the build
>  After building, you should obtain this tree:
>  
>      output/images/
> -    +-- rootfs.tar                  [0]
> +    +-- rootfs.cpio                 [0]
> +    +-- rootfs.tar                  [1]
>      +-- rpi-firmware/
> +    |   +-- bcm2708-rpi-b.dtb       [2]
> +    |   +-- bcm2708-rpi-b-plus.dtb  [3]
> +    |   +-- bcm2709-rpi-2-b.dtb     [4]
>      |   +-- bootcode.bin
> +    |   +-- cmdline.txt             [5]
>      |   +-- config.txt
>      |   +-- fixup.dat
> -    |   `-- start.elf
> -    +-- bcm2708-rpi-b.dtb           [1]
> -    +-- bcm2708-rpi-b-plus.dtb      [1]
> -    +-- bcm2709-rpi-2-b.dtb         [1]

As I said above, I'd prefer the DTB files be left in their original
location, with the ones in rpi-firmware/ being only copies of, or
hard-links to, the originals.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2015-10-17 11:45 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 22:23 [Buildroot] rpi: image generation Benoît Thébaudeau
2015-08-20  7:59 ` Thomas Petazzoni
2015-08-20 14:30   ` Vivien Didelot
2015-08-22 20:01     ` [Buildroot] [PATCH 1/4] configs/raspberrypi: use EABIhf Benoît Thébaudeau
2015-08-22 20:01       ` [Buildroot] [PATCH 2/4] board/raspberrypi: prepare the image files for the target Benoît Thébaudeau
2015-10-17 11:45         ` Yann E. MORIN [this message]
2015-10-17 13:52           ` Benoît Thébaudeau
2015-08-22 20:01       ` [Buildroot] [PATCH 3/4] board/raspberrypi: generate a medium image Benoît Thébaudeau
2015-08-22 20:01       ` [Buildroot] [PATCH 4/4] board/raspberrypi: auto-expand rootfs on first boot Benoît Thébaudeau
2015-08-27  9:02         ` Benoît Thébaudeau
2015-08-27 21:22           ` Jérôme Pouiller
2015-08-28 10:36             ` Benoît Thébaudeau
2015-08-28 11:15               ` Benoît Thébaudeau
     [not found]         ` <4057940.fE2DsQZqLb@sagittea>
2015-08-31  9:11           ` Benoît Thébaudeau
2015-08-31 12:17         ` Floris Bos
2015-08-31 18:53           ` Benoît Thébaudeau
2015-08-31 13:25         ` Floris Bos
2015-08-31 19:05           ` Benoît Thébaudeau
2015-10-12 21:59       ` [Buildroot] [PATCH 1/4] configs/raspberrypi: use EABIhf Thomas Petazzoni
2015-10-12 23:17         ` Benoît Thébaudeau
2015-10-13  7:06           ` Arnout Vandecappelle
2015-10-15 20:11         ` Peter Korsgaard
2015-10-15 21:12           ` Peter Korsgaard
2015-10-25 15:19           ` [Buildroot] [PATCH] arch/arm: use EABIhf by default with VFP Benoît Thébaudeau
2015-10-25 18:53             ` Peter Korsgaard
2015-10-26  0:32               ` Thomas Petazzoni
2015-10-26  7:47                 ` Peter Korsgaard
2015-10-26  8:25                   ` Thomas Petazzoni
2015-10-26  8:51                     ` Peter Korsgaard
2015-10-25 18:55             ` Peter Korsgaard
2015-10-25 20:27               ` Benoît Thébaudeau
2015-10-25 20:40                 ` Peter Korsgaard
2015-10-25 20:52                   ` Benoît Thébaudeau
2015-10-25 21:30                     ` Yann E. MORIN

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=20151017114519.GA3717@free.fr \
    --to=yann.morin.1998@free.fr \
    --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