binman should create a list of output files

Simon Glass sjg at chromium.org
Mon Aug 23 19:25:38 CEST 2021


Hi Heiko,

On Mon, 23 Aug 2021 at 00:38, Heiko Thiery <heiko.thiery at gmail.com> wrote:
>
> Hi Simon,
>
> Am Fr., 20. Aug. 2021 um 20:22 Uhr schrieb Simon Glass <sjg at chromium.org>:
> >
> > Hi Heiko,
> >
> > On Fri, 20 Aug 2021 at 00:49, Heiko Thiery <heiko.thiery at gmail.com> wrote:
> > >
> > > Hi Simon,
> > >
> > > During the discussion on [1] I had the idea if binman could create a
> > > list of all output files, so that it is possible to do a real clean in
> > > the u-boot makefile.
> > >
> > > Currently there are not all binaries listed in the files list and
> > > especially during the port of some boards to binman we had some
> > > trouble due to fragments of old/previous builds.
> > >
> > > What do you think?
> >
> > Yes i like this. Perhaps something like:
> >
> > binman ls-files output   - to list output files
> >
> > We could also create a binman.filelist file in the target directory.
> >
> > The interesting question is how to implement it. It might be best to
> > add a new method to Entry() which returns a list of output filenames.
> > Then we can simply call all the entries recursively to get the list,
> > as we do with other things today.
> >
> > The other issue is temporary files, which are currently lumped into
> > the same output dir. One day I think we should distinguish between
> > output files that produce something useful and files that are just
> > there for debugging (e.g. the input file used for compression or
> > signing). The latter could go in a separate binman-working/ directory
> > inside the output dir, and could be removed wholesale.
>
>
> I tried to dig into the binman code. one possible point to remember
> the output files could be the tools function GetOutputFilename from
> patman. For this you could use a binman wrapper function that
> remembers the files. But this only works if the "output_files" would
> be saved when creating the image. a standalone binman option to list
> the output files doesn't work then. but this way you would have an
> automatic list with all (image and temporary) files.

Yes, I think that could work in the short term but I don't really
think it is worth it. We need a way to determine in advance what files
will be written, or determine it without actually writing.

For temp files, should we keep a list? Or would it be OK to put them
all in a subdir? At the moment we use tmpname so the filenames are
quite strange.

>
> Is it correct that the output files are created in BuildImage() and
> all other (like mkimage.*.mkimage) files are only the temporary ones?

For a narrow definition of output files, yes. I think that could work.
There is also the map file. We could have a thing in state.py to keep
a list of output files, perhaps. It should be possible to add an
option to dry run and not produce output, just the list.

Regards,
Simon


More information about the U-Boot mailing list