From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mout.kundenserver.de ([217.72.192.74]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iYCrj-0005ao-1t for ptxdist@pengutronix.de; Fri, 22 Nov 2019 18:37:07 +0100 Date: Fri, 22 Nov 2019 18:36:51 +0100 From: Alexander Dahl Message-ID: <20191122173650.i7ozhrjoz6mi6ywn@falbala.internal.home.lespocky.de> References: <20191122154232.4980-1-bruno.thomsen@gmail.com> MIME-Version: 1.0 In-Reply-To: <20191122154232.4980-1-bruno.thomsen@gmail.com> Subject: Re: [ptxdist] [PATCH v4] u-boot: generate environment image List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: multipart/mixed; boundary="===============1174035672==" Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Alexander Dahl , Denis OSTERLAND , Bruno Thomsen , bth@kamstrup.com --===============1174035672== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gcnrgwy776w4uasr" Content-Disposition: inline --gcnrgwy776w4uasr Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hei hei, I will test on Monday, but one short remark below. On Fri, Nov 22, 2019 at 04:42:32PM +0100, Bruno Thomsen wrote: > Add possiblity to generate a default or a custom environment > image. Image can be used during manufacturing to avoid bootloader > console usage and speed up first boot. Other image use-cases > include device development edition, device demonstration > mode, etc. >=20 > Custom environment image is generated from an user provided > config file with one 'var=3Dvalue' per line format. Input config > file name is configurable. >=20 > Cc: Denis OSTERLAND > Cc: Alexander Dahl > Signed-off-by: Bruno Thomsen > --- > v4: > - u-boot version limitation help. > - env image size is now Kconfig hex input > - custom env source file is now stored in platformconfigdir > - changes in custom env source file trigger rebuild > - use default mkenvimage pad > - cleanup of env images > - fix missing cleanup of imx dtb image Could you please move the missing cleanup to a separate patch? Installing that image was introduced in commit 58c48f349901988fb9bc63b7f2f9bbb30c6ef60d and I think this should be fixed apart from the env stuff. > v3: > - remove multiple env images support > - use static image names > - rebase patches on top of: u-boot: Build out-of-tree > v2: > - remove HOST_U_BOOT_TOOLS dependency > - configurable default env image name > - add custom env image generation option > - move all options to sub menu >=20 > platforms/u-boot.in | 61 +++++++++++++++++++++++++++++++++++++++++++++ > rules/u-boot.make | 31 ++++++++++++++++++++++- > 2 files changed, 91 insertions(+), 1 deletion(-) >=20 > diff --git a/platforms/u-boot.in b/platforms/u-boot.in > index 9bac4a758..e6585b508 100644 > --- a/platforms/u-boot.in > +++ b/platforms/u-boot.in > @@ -71,6 +71,67 @@ config U_BOOT_CONFIG > =20 > endif > =20 > +choice > + prompt "Generate environment image" > + default U_BOOT_NONE_ENV_IMAGE > + help > + U-Boot from version 2018.03 support out-of-tree environment > + image generation. > + > +config U_BOOT_NONE_ENV_IMAGE > + prompt "none" > + bool > + help > + Don't generate an U-Boot environment image. > + > +config U_BOOT_DEFAULT_ENV_IMAGE > + prompt "default" > + bool > + help > + Use U-Boot's mkenvimage to compile a default U-Boot environment > + image for use in e.g. device manufacturing or development. > + > +config U_BOOT_CUSTOM_ENV_IMAGE > + prompt "custom" > + bool > + help > + Use U-Boot's mkenvimage to compile a custom U-Boot environment > + image based on the text file in U_BOOT_CUSTOM_ENV_IMAGE_SOURCE > + for use in e.g. device manufacturing or development. > + > +endchoice > + > +config U_BOOT_CUSTOM_ENV_IMAGE_SOURCE > + prompt "Custom environment source" > + string > + default "custom_env.config" > + depends on U_BOOT_CUSTOM_ENV_IMAGE > + help > + Text file in platform config directory describing the custom > + environment. > + The file should have lines in the form var=3Dvalue, one per line. > + Blank lines and lines starting with a # are ignored. > + > +if !U_BOOT_NONE_ENV_IMAGE > + > +config U_BOOT_ENV_IMAGE_SIZE > + prompt "Environment image size" > + hex > + default 0x2000 > + help > + Enter the U-Boot environment size in hexadecimal for generation > + of image. A wrong size will typically cause crc error when used. > + Must match size defined in target config and "/etc/fw_env.config". > + > +config U_BOOT_ENV_IMAGE_REDUNDANT > + prompt "Environment image with redundant copy" > + bool > + help > + Use to generate a redundant environment in the image. > + Must match target config and "/etc/fw_env.config". > + > +endif > + > config U_BOOT_BOOT_SCRIPT > prompt "Compile U-Boot boot script" > bool > diff --git a/rules/u-boot.make b/rules/u-boot.make > index e3c2c2389..3d983378e 100644 > --- a/rules/u-boot.make > +++ b/rules/u-boot.make > @@ -43,6 +43,12 @@ U_BOOT_BOOT_SCRIPT_BIN :=3D $(call remove_quotes, \ > $(STATEDIR)/u-boot.compile: $(U_BOOT_BOOT_SCRIPT_TXT) > endif > =20 > +ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE > +U_BOOT_CUSTOM_ENV_SRC :=3D $(call ptx/in-platformconfigdir, \ > + $(PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE_SOURCE)) > +$(STATEDIR)/u-boot.compile: $(call remove_quotes, $(U_BOOT_CUSTOM_ENV_SR= C)) > +endif > + > U_BOOT_WRAPPER_BLACKLIST :=3D \ > $(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST) > =20 > @@ -100,6 +106,20 @@ ifdef PTXCONF_U_BOOT_BOOT_SCRIPT > @$(U_BOOT_BUILD_DIR)/tools/mkimage -T script -C none \ > -d $(U_BOOT_BOOT_SCRIPT_TXT) \ > $(U_BOOT_BUILD_DIR)/boot.scr.uimg > +endif > +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE > + $(U_BOOT_MAKE_ENV) $(U_BOOT_DIR)/scripts/get_default_envs.sh $(U_BOOT_B= UILD_DIR) | \ > + $(U_BOOT_BUILD_DIR)/tools/mkenvimage \ > + $(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \ > + -s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \ > + -o $(U_BOOT_BUILD_DIR)/u-boot-env.img - > +endif > +ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE > + $(U_BOOT_BUILD_DIR)/tools/mkenvimage \ > + $(call ptx/ifdef,PTXCONF_U_BOOT_ENV_IMAGE_REDUNDANT,-r,) \ > + -s $(PTXCONF_U_BOOT_ENV_IMAGE_SIZE) \ > + -o $(U_BOOT_BUILD_DIR)/u-boot-custom-env.img \ > + $(U_BOOT_CUSTOM_ENV_SRC) > endif > @$(call touch) > =20 > @@ -147,6 +167,14 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL > @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-with-spl-pbl.bin \ > $(IMAGEDIR)/u-boot-with-spl-pbl.bin > endif > +ifdef PTXCONF_U_BOOT_DEFAULT_ENV_IMAGE > + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-env.img \ > + $(IMAGEDIR)/u-boot-env.img > +endif > +ifdef PTXCONF_U_BOOT_CUSTOM_ENV_IMAGE > + @install -v -D -m644 $(U_BOOT_BUILD_DIR)/u-boot-custom-env.img \ > + $(IMAGEDIR)/u-boot-custom-env.img > +endif > =20 > ifdef PTXCONF_U_BOOT_BOOT_SCRIPT > @$(call install_init, u-boot) > @@ -171,7 +199,8 @@ $(STATEDIR)/u-boot.clean: > @$(call clean_pkg, U_BOOT) > @rm -vf $(IMAGEDIR)/u-boot.bin $(IMAGEDIR)/u-boot.srec $(IMAGEDIR)/u-bo= ot.elf > @rm -vf $(IMAGEDIR)/u-boot.img $(IMAGEDIR)/SPL $(IMAGEDIR)/MLO > - @rm -vf $(IMAGEDIR)/u-boot.imx > + @rm -vf $(IMAGEDIR)/u-boot.imx $(IMAGEDIR)/u-boot-dtb.imx This single change to a different patch please. > + @rm -vf $(IMAGEDIR)/u-boot-env.img $(IMAGEDIR)/u-boot-custom-env.img > @rm -vf $(IMAGEDIR)/u-boot-dtb.bin $(IMAGEDIR)/u-boot-with-spl-pbl.bin > =20 > # ----------------------------------------------------------------------= ------ > --=20 > 2.23.0 >=20 >=20 > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de A --=20 /"\ ASCII RIBBON | =BBWith the first link, the chain is forged. The first \ / CAMPAIGN | speech censured, the first thought forbidden, the X AGAINST | first freedom denied, chains us all irrevocably.=AB / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie) --gcnrgwy776w4uasr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEwo7muQJjlc+Prwj6NK3NAHIhXMYFAl3YHK4ACgkQNK3NAHIh XMZJ9w/8CqJg19xehwR1KsKyNGc4+4E4C0PMlW1tfRf5/DwWWDpJHPw1mbMGyiH9 JWJEkbv44pa1bVF0oVzNaQe0JoPohURMLpocqX1/GD4BPzgNsM0p9xWDF+2Dmqgl mkURxXeBbJllcwidsGL0c/7zvwscZtxeHckvAosJNuHGJbRUsU60CCaAgrGZPwDR iLynv7UBC8F9hD9SOUqrK1+17zwTcSPXlaM7iPcPgIzfm1luLPKyGQ8WM3zhT9Cw yjIvhQcoNCTDV306JSVk8lTye99GNzdbbGV4FCQVifpyF5LJafyYKDs2NWaF8dCK iblH1ZubSwZJYtEOYmogdU0Q+VuyxGaLITwayCn5F/6AVBA8LtYX4iWR3O0SCwNY JCvDEZUiHgjU3w/xE3mwDHTm08mIWsm+V8jwiABo2iN/RAE2TMghG5ZUQbzPBWoY S3EGgBVXlYg5iIoUKYG8iLWeb2D9TupV8vxrk9vxIV0mNWZ02ZbkUWbVc6JogWmZ ijmcwXOD/QlHRTYwcvgwtq1/Kh0uY5afJXO0hJodnCq3hpekiCW0gglu+Q3aJX4k g7VIlA3/4jZApIbbYQxPqu9j7VPS/f2o0LLy3gTJwvP1CxTezuuLOLZnwsbooUgh EVHcrt1g/2K2883ZkfKN2bgWK3DZjjK6zktl6yGYpclLuc2tICw= =/BaX -----END PGP SIGNATURE----- --gcnrgwy776w4uasr-- --===============1174035672== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de --===============1174035672==--