Re: [PATCH 02/22] filetype: Add code to detect i.MX image v1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 23, 2018 at 2:33 AM Roland Hieber <r.hieber@xxxxxxxxxxxxxx> wrote:
>
> On Tue, Aug 21, 2018 at 01:23:28PM -0700, Andrey Smirnov wrote:
> > On Tue, Aug 21, 2018 at 3:07 AM Roland Hieber <r.hieber@xxxxxxxxxxxxxx> wrote:
> > >
> > > Hello Andrey,
> > >
> > > On Mon, Aug 20, 2018 at 11:25:43PM -0700, Andrey Smirnov wrote:
> > > > Modify file_detect_type() and add code needed to be able to detect
> > > > i.MX boot images with v1 header.
> > > >
> > > > Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
> > > > ---
> > > >  common/filetype.c  | 7 +++++++
> > > >  include/filetype.h | 1 +
> > > >  2 files changed, 8 insertions(+)
> > > >
> > > > diff --git a/common/filetype.c b/common/filetype.c
> > > > index c5f2384a6..f68a83bec 100644
> > > > --- a/common/filetype.c
> > > > +++ b/common/filetype.c
> > > > @@ -29,6 +29,8 @@
> > > >  #include <image-sparse.h>
> > > >  #include <elf.h>
> > > >
> > > > +#include <../mach-imx/include/mach/imx-header.h>
> > >
> > > This fails at least on ARCH=sandbox:
> > >
> > >   common/filetype.c:32:10: fatal error: ../mach-imx/include/mach/imx-header.h: No such file or directory
> > >    #include <../mach-imx/include/mach/imx-header.h>
> > >             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > I guess it could be solved with an #ifdef ARCH_IMX.
> > >
> >
> > Good catch! I'll make sure to test against ARCH=sandbox when preparing
> > v2 of the set.
>
> An include path of the form <../mach-imx/> strikes me as a rather odd
> thing to have in code that should be machine-independent. Maybe it is
> better to isolate the respective symbols from imx-header.h into a
> generic header file that can live in the same path as e.g. <elf.h>. This
> way we could also be able to detect IMX images on ARCH=sandbox :)
>

I don't think that file is really machine independent. There's already
code to detect "filetype_mxs_bootstream", "filetype_socfpga_xload",
"filetype_kwbimage_v0", etc. which are as machine dependent as it
could be. It just those codepaths use magic numbers directly and don't
bother with any includes.

As for being able to detect IMX images on ARCH=sandbox, I was planning
on trying to resolve compilation issue (be it with adding a -I or
creating a shared header) without resorting to #ifdef ARCH_IMX a bunch
of code first and only doing that if I can find no other way of fixing
it.

Thanks,
Andrey Smirnov

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux