Hello Michael,

see my questions inline below.

Am Freitag, 12. April 2019, 09:49:18 CEST schrieb Michael Olbrich:
> On Thu, Apr 11, 2019 at 01:09:37PM +0200, Alexander Dahl wrote:
> > From: Ahmad Fatoum <a.fat...@pengutronix.de>
> > 
> > U-Boot can be configured via the environment to look for a boot script
> > in the rootfs. The boot script can then be used to customize the booting
> > process further.
> > 
> > Cc: Denis OSTERLAND <denis.osterl...@diehl.com>
> > Co-authored-by: Alexander Dahl <a...@thorsis.com>
> > Signed-off-by: Ahmad Fatoum <a.fat...@pengutronix.de>
> > Signed-off-by: Alexander Dahl <a...@thorsis.com>
> > ---
> > 
> > Notes:
> >     Changes from the original patch by Ahmad:
> >     
> >     * Added compile stage from patch adding precompiled U-Boot env, but
> >     
> >       changed compile command to '@$(call world/compile, <PKG>)' as
> >       suggested by Denis OSTERLAND. (That patch was not merged upstream.)
> >     
> >     * Changed default script filename to 'boot.scr.uimg', because this is
> >     
> >       one of the defaults in 'config_distro_bootcmd.h' in U-Boot. (Took me
> >       only half a day to find why the script was not found here.)
> >  
> >  platforms/u-boot.in | 18 ++++++++++++++++++
> >  rules/u-boot.make   | 32 ++++++++++++++++++++++++++++++++
> >  2 files changed, 50 insertions(+)
> > 
> > diff --git a/platforms/u-boot.in b/platforms/u-boot.in
> > index 5d04a3cbd..8af0c8271 100644
> > --- a/platforms/u-boot.in
> > +++ b/platforms/u-boot.in
> > @@ -71,6 +71,24 @@ config U_BOOT_CONFIG
> > 
> >  endif
> > 
> > +config U_BOOT_BOOT_SCRIPT
> > +   prompt "Compile U-Boot boot script"
> > +   bool
> > +   help
> > +     Use U-Boot's mkimage to compile a U-Boot boot script and install it
> > +     into the rootfs
> > +
> > +if U_BOOT_BOOT_SCRIPT
> > +
> > +config U_BOOT_BOOT_SCRIPT_ROOTFS_PATH
> > +   string
> > +   default "/boot/boot.scr.uimg"
> > +   prompt "Installation path"
> > +   help
> > +     Target rootfs path where the U-Boot script should be located
> > +
> > +endif
> > +
> > 
> >  comment "target install"
> >  
> >  config U_BOOT_INSTALL_SREC
> > 
> > diff --git a/rules/u-boot.make b/rules/u-boot.make
> > index 55d18b97d..277216af9 100644
> > --- a/rules/u-boot.make
> > +++ b/rules/u-boot.make
> > @@ -2,6 +2,7 @@
> > 
> >  #
> >  # Copyright (C) 2007 by Sascha Hauer
> >  #               2009, 2010 by Marc Kleine-Budde <m...@pengutronix.de>
> > 
> > +#               2018 by Ahmad Fatoum <a.fat...@pengutronix.de>
> > 
> >  #
> >  # See CREDITS for details about who has contributed to this project.
> >  #
> > 
> > @@ -34,6 +35,10 @@ endif
> > 
> >  # Prepare
> >  #
> >  ------------------------------------------------------------------------
> >  ----
> ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
> 
> > +U_BOOT_BOOT_SCRIPT_TXT := $(call ptx/in-platformconfigdir, uboot.scr)
> > +U_BOOT_BOOT_SCRIPT_BIN := $(call remove_quotes, \
> > +   $(PTXCONF_U_BOOT_BOOT_SCRIPT_ROOTFS_PATH))
> 
> $(STATEDIR)/u-boot.compile: $(U_BOOT_BOOT_SCRIPT_TXT)
> endif
> 
> While ptx/in-platformconfigdir is not as slow as ptx/get-alternative, it
> should still be avoided when not needed.
> 
> Add the dependency to ensure changes are propagated.

Makes sense.

> >  U_BOOT_WRAPPER_BLACKLIST := \
> >  
> >     TARGET_HARDEN_STACKCLASH \
> >     TARGET_HARDEN_RELRO \
> > 
> > @@ -82,6 +87,20 @@ $(STATEDIR)/u-boot.prepare:
> >  endif
> >  
> >  #
> >  ------------------------------------------------------------------------
> >  ----> 
> > +# Compile
> > +#
> > -------------------------------------------------------------------------
> > --- +
> > +$(STATEDIR)/u-boot.compile:
> > +   @$(call targetinfo)
> > +   @$(call world/compile, U_BOOT)
> > +ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
> > +   @$(U_BOOT_DIR)/tools/mkimage -T script -C none \
> > +           -d $(U_BOOT_BOOT_SCRIPT_TXT) \
> > +           $(U_BOOT_DIR)/uboot.scr
> 
> I don't mind the name, but you could use
> '$(notdir $(U_BOOT_BOOT_SCRIPT_TXT))' here and below.

Not sure what you mean here. 'mkimage' expects the [image data file] after 
option '-d', which is the input file not just a name. And what is 'below' 
supposed to mean here?

Alex

> 
> Michael
> 
> > +endif
> > +   @$(call touch)
> > +
> > +#
> > -------------------------------------------------------------------------
> > ---> 
> >  # Install
> >  #
> >  ------------------------------------------------------------------------
> >  ----> 
> > @@ -122,6 +141,19 @@ ifdef PTXCONF_U_BOOT_INSTALL_U_BOOT_WITH_SPL_PBL
> > 
> >     @install -v -D -m644 $(U_BOOT_DIR)/u-boot-with-spl-pbl.bin \
> >     
> >             $(IMAGEDIR)/u-boot-with-spl-pbl.bin
> >  
> >  endif
> > 
> > +
> > +ifdef PTXCONF_U_BOOT_BOOT_SCRIPT
> > +   @$(call install_init, u-boot)
> > +   @$(call install_fixup, u-boot, PRIORITY, optional)
> > +   @$(call install_fixup, u-boot, SECTION, base)
> > +   @$(call install_fixup, u-boot, AUTHOR, "Ahmad Fatoum
> > <a...@pengutronix.de>") +   @$(call install_fixup, u-boot, DESCRIPTION,
> > "U-Boot boot script") +
> > +   @$(call install_copy, u-boot, 0, 0, 0644, \
> > +           $(U_BOOT_DIR)/uboot.scr, $(U_BOOT_BOOT_SCRIPT_BIN))
> > +
> > +   @$(call install_finish, u-boot)
> > +endif
> > 
> >     @$(call touch)
> >  
> >  #
> >  ------------------------------------------------------------------------
> >  ----



_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to