mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: jon@ringle.org
Cc: ptxdist@pengutronix.de
Subject: Re: [ptxdist] RPi3b+ boot sequence with DistroKit (barebox)
Date: Mon, 9 Sep 2019 12:59:40 +0200	[thread overview]
Message-ID: <20190909105940.zhfu5r36trmvzpft@pengutronix.de> (raw)
In-Reply-To: <CAMwGMjzQsPyrdZDn15ZU-+TubL-ZM5U+L17AOp97eJqTheBhLw@mail.gmail.com>

On Sat, Sep 07, 2019 at 04:06:24PM -0400, Jon Ringle wrote:
> On Sat, Sep 7, 2019 at 1:42 AM Jon Ringle <jonringle@gmail.com> wrote:
> 
> >
> > On Tue, Sep 3, 2019 at 9:53 AM Roland Hieber <rhi@pengutronix.de> wrote:
> >
> >> On Sat, Aug 31, 2019 at 10:35:05PM -0400, Jon Ringle wrote:
> >> > B) If so, where should the overlays/ directory live...?
> >>
> >> If you put the DTBOs into configs/platform-v7a/rpi-firmware/overlays/,
> >> you can change configs/platform-v7a/rules/image-rpi3.make to pick them
> >> up when you add the files to IMAGE_RPI3_DATA (this works by passing the
> >> variable contents to genimage by replacing @FIRMWARE_RPI3@ in
> >> configs/platform-v7a/config/images/rpi3.config) (and accordingly for
> >> s/rpi3/rpi2/).
> >>
> >>
> > The problem I am having is that there doesn't seem to be a way to tell
> > genimage to create files in a subdirectory.
> > In the image there needs to be a subdir `overlays/`, but genimage is
> > putting all files in the root dir of the image.
> >
> >
> It was a pain in the ass to figure out how to get genimage to cooperate
> with putting the *.dtbo in the overlays/ dir in the image.
> This is what I came up with:
> 
> IMAGE_RPI3_DATA := \
>     $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.bin) \
>     $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.elf) \
>     $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.dat) \
>     $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.dtb) \
>     $(wildcard $(IMAGE_RPI3_DATA_DIR)/config.txt)
> IMAGE_RPI3_OVERLAYS_DATA := \
>     $(wildcard $(IMAGE_RPI3_DATA_DIR)/overlays/*.dtbo)
> 
> 
> #
> ----------------------------------------------------------------------------
> # Image
> #
> ----------------------------------------------------------------------------
> 
> define squote
> $(addsuffix $(ptx/def/squote),$(addprefix $(ptx/def/squote),$(1)))
> endef
> 
> define squote_and_comma
> $(subst $(ptx/def/space),$(comma) ,$(call squote, $(1)))
> endef
> 
> define filespec
> $(patsubst %,file $(call squote,$(1)/$(notdir $(2))) { image=$(call squote,
> $(2)) },$(2))
> endef
> 
> IMAGE_RPI3_ENV := \
>         FIRMWARE_RPI3="$(call squote_and_comma,$(IMAGE_RPI3_DATA))" \
>         FIRMWARE_RPI3_OVERLAYS="$(foreach
> file,$(IMAGE_RPI3_OVERLAYS_DATA),$(call filespec,overlays,$(file)))"

Ah yes, that's one solution. I remember I was running into the same
problem a few months back. My solution was rather to pack all firmware
files into a new tar.gz, let genimage create a new image for the RPi
boot partition from that tar.gz, and let genimage pick up that image in
the rpi[123].config. Sadly I didn't yet get around to integrating this
fully into the rest of DistroKit, so this one branch [1] is still lying
around in need of a feather duster...

[1]: https://git.pengutronix.de/cgit/rhi/DistroKit/log/?h=rhi/rpi-firmware-package

 - Roland

-- 
Roland Hieber                     | r.hieber@pengutronix.de     |
Pengutronix e.K.                  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

      parent reply	other threads:[~2019-09-09 10:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-01  2:35 Jon Ringle
2019-09-03 13:53 ` Roland Hieber
2019-09-07  5:42   ` Jon Ringle
2019-09-07 20:06     ` Jon Ringle
2019-09-09  6:15       ` Michael Olbrich
2019-09-09 10:59       ` Roland Hieber [this message]

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=20190909105940.zhfu5r36trmvzpft@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=jon@ringle.org \
    --cc=ptxdist@pengutronix.de \
    /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