From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: MIME-Version: 1.0 References: <20190903135311.5kclg2f5dmv6imqz@pengutronix.de> In-Reply-To: From: Jon Ringle Date: Sat, 7 Sep 2019 16:06:24 -0400 Message-ID: Subject: Re: [ptxdist] RPi3b+ boot sequence with DistroKit (barebox) List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de, jon@ringle.org Content-Type: multipart/mixed; boundary="===============1857409566==" Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: Roland Hieber Cc: ptxdist@pengutronix.com --===============1857409566== Content-Type: multipart/alternative; boundary="0000000000007e9aa30591fc1736" --0000000000007e9aa30591fc1736 Content-Type: text/plain; charset="UTF-8" On Sat, Sep 7, 2019 at 1:42 AM Jon Ringle wrote: > > On Tue, Sep 3, 2019 at 9:53 AM Roland Hieber 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)))" -Jon --0000000000007e9aa30591fc1736 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Sep 7, 2019 at 1:42 AM Jon Ringle= <jonringle@gmail.com> wro= te:

On Tue, Sep 3, 2019 at 9:5= 3 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 hav= ing is that there doesn't seem to be a way to tell genimage to create f= iles 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 cam= e up with:

IMAGE_RPI3_DATA :=3D \
=C2=A0 =C2= =A0 $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.bin) \
=C2=A0 =C2=A0 $(wildcard = $(IMAGE_RPI3_DATA_DIR)/*.elf) \
=C2=A0 =C2=A0 $(wildcard $(IMAGE_RPI3_DA= TA_DIR)/*.dat) \
=C2=A0 =C2=A0 $(wildcard $(IMAGE_RPI3_DATA_DIR)/*.dtb) = \
=C2=A0 =C2=A0 $(wildcard $(IMAGE_RPI3_DATA_DIR)/config.txt)
IMAGE_R= PI3_OVERLAYS_DATA :=3D \
=C2=A0 =C2=A0 $(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) ,$(cal= l squote, $(1)))
endef

define filespec
$(patsubst %,file $(cal= l squote,$(1)/$(notdir $(2))) { image=3D$(call squote, $(2)) },$(2))
end= ef

IMAGE_RPI3_ENV :=3D \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 FIRMWARE_RPI= 3=3D"$(call squote_and_comma,$(IMAGE_RPI3_DATA))" \
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 FIRMWARE_RPI3_OVERLAYS=3D"$(foreach file,$(IMAGE_RPI= 3_OVERLAYS_DATA),$(call filespec,overlays,$(file)))"
-Jon

--0000000000007e9aa30591fc1736-- --===============1857409566== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de --===============1857409566==--