All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	 Heiko Thiery <heiko.thiery@gmail.com>
Subject: Re: [PATCH v2 4/5] binman: Convert FIT entry type to a subclass of Section entry type
Date: Sun, 20 Feb 2022 21:40:03 -0700	[thread overview]
Message-ID: <CAPnjgZ2_ch5Hgjs6Z7AcQKUcv7r0oM6bJW47P_=DXFMSGT-R=w@mail.gmail.com> (raw)
In-Reply-To: <CAPnjgZ09fhtyQbjOooah2MDAiKaazq9-t44YD8v+soYnar+DcQ@mail.gmail.com>

Hi again,

On Sat, 19 Feb 2022 at 08:53, Simon Glass <sjg@chromium.org> wrote:
>
> Hi Alper,
>
> On Fri, 18 Feb 2022 at 10:34, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote:
> >
> > On 18/02/2022 19:50, Jan Kiszka wrote:
> > > On 15.02.22 18:06, Jan Kiszka wrote:
> > >> On 15.02.22 17:50, Jan Kiszka wrote:
> > >>> On 15.02.22 13:27, Alper Nebi Yasak wrote:
> > >>>> The AddMissingProperties() and SetCalculatedProperties() methods were
> > >>>> disabled for FIT as a fixup to this patch, that's why image-pos etc.
> > >>>> aren't available. See comments at [1] for some context.
> > >>>>
> > >>>> Hopefully my two patches [2][3] fix things, can you test with them?
> > >>>>
> > >>>> [1] "binman: Correct the error message for a bad hash algorithm"
> > >>>> https://patchwork.ozlabs.org/project/uboot/patch/20220208105941.1.I8f212a1150defebaf8b7b15a79f7a2fc62c276b2@changeid/
> > >>>>
> > >>>> [2] "binman: Skip processing "hash" subnodes of FIT subsections"
> > >>>> https://patchwork.ozlabs.org/project/uboot/patch/20220209190236.26479-1-alpernebiyasak@gmail.com/
> > >>>>
> > >>>
> > >>> This one helped, indeed.
> > >>>
> > >>
> > >> ...not completely:
> > >>
> > >> $ source/tools/binman/binman replace -i flash.bin -f fit@0x380000.fit
> > >> fit@0x380000binman: [Errno 13] Permission denied: '/.fit@0x380000.itb'
> > >>
> > >
> > > Ping.
> > >
> > > $ source/tools/binman/binman -D replace -i flash.bin -f fit@0x380000.fit fit@0x380000
> > > binman: [Errno 13] Permission denied: '/.fit@0x380000.itb'
> > >
> > > Traceback (most recent call last):
> > >   File "source/tools/binman/binman", line 141, in RunBinman
> > >     ret_code = control.Binman(args)
> > >   File "u-boot/tools/binman/control.py", line 644, in Binman
> > >     allow_resize=not args.fix_size, write_map=args.map)
> > >   File "u-boot/tools/binman/control.py", line 404, in ReplaceEntries
> > >     allow_resize=allow_resize, write_map=write_map)
> > >   File "u-boot/tools/binman/control.py", line 341, in WriteEntryToImage
> > >     AfterReplace(image, allow_resize=allow_resize, write_map=write_map)
> > >   File "u-boot/tools/binman/control.py", line 333, in AfterReplace
> > >     get_contents=False, allow_resize=allow_resize)
> > >   File "u-boot/tools/binman/control.py", line 560, in ProcessImage
> > >     image.PackEntries()
> > >   File "u-boot/tools/binman/image.py", line 155, in PackEntries
> > >     super().Pack(0)
> > >   File "u-boot/tools/binman/etype/section.py", line 385, in Pack
> > >     self._PackEntries()
> > >   File "u-boot/tools/binman/etype/section.py", line 403, in _PackEntries
> > >     offset = entry.Pack(offset)
> > >   File "u-boot/tools/binman/etype/section.py", line 390, in Pack
> > >     data = self.BuildSectionData(True)
> > >   File "u-boot/tools/binman/etype/fit.py", line 265, in BuildSectionData
> > >     tools.write_file(input_fname, data)
> > >   File "u-boot/tools/patman/tools.py", line 482, in write_file
> > >     with open(filename(fname), binary and 'wb' or 'w') as fd:
> > > PermissionError: [Errno 13] Permission denied: '/.fit@0x380000.itb'
> > >
> > > Something seems fairly broken here. That '/.' does not come from the
> > > output directory name, it's generated by Entry.GetUniqueName. Looks like
> > > this path should not been taken under these conditions.
> >
> > I can reproduce this and tried a few things, but more issues just kept
> > popping up (outside u-boot as well). I got it to a point where the
> > command re-packs the FIT and the image but quite wrongly. The offset and
> > image-pos properties get added in the FIT, and the image main-section
> > just concatenates all entries without regard to set offsets. I'll
> > need more time to work those out, then to add tests and send patches.
>
> I am going to try to merge my fit generator series today.
>
> One issue I notice is that the conversion to use entry_Section changes
> the contents of the self._fit_entries dict. Before it was keyed by
> relative path, but entry_section keys self._entries by node name.
>
> We may need to split it up. I will see if I can at least merge my
> series, which should not make things any worse, then see if I can come
> up with ideas.
>
> Thanks for the diff.

I did a bit more fiddling and pushed a tree to u-boot-dm/fit-working

It refactors the fit implementation to separate scanning from emitting
the tree and I think this might help quite a bit. I'll send out the
series when I get a chance in the next few days or so.

Regards,
Simon

[..]

  reply	other threads:[~2022-02-21  4:40 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 22:08 [PATCH v2 0/5] binman: Improvements to FIT entry type Alper Nebi Yasak
2022-02-07 22:08 ` [PATCH v2 1/5] binman: Fix subentry expansion for " Alper Nebi Yasak
2022-02-08 15:05   ` Simon Glass
2022-02-08 20:39   ` Simon Glass
2022-02-07 22:08 ` [PATCH v2 2/5] binman: Register and check bintools from FIT subentries Alper Nebi Yasak
2022-02-07 22:08 ` [PATCH v2 3/5] binman: Check missing bintools of Section subclasses Alper Nebi Yasak
2022-02-07 22:08 ` [PATCH v2 4/5] binman: Convert FIT entry type to a subclass of Section entry type Alper Nebi Yasak
2022-02-14  9:09   ` Jan Kiszka
2022-02-15 12:27     ` Alper Nebi Yasak
2022-02-15 16:50       ` Jan Kiszka
2022-02-15 17:06         ` Jan Kiszka
2022-02-18 16:50           ` Jan Kiszka
2022-02-18 17:34             ` Alper Nebi Yasak
2022-02-19 15:53               ` Simon Glass
2022-02-21  4:40                 ` Simon Glass [this message]
2022-02-22 18:58                   ` Alper Nebi Yasak
2022-02-23 22:59                     ` Simon Glass
2022-02-28 11:48                       ` Jan Kiszka
2022-02-28 13:51                         ` Alper Nebi Yasak
2022-02-28 13:56                         ` Simon Glass
2022-02-28 14:14                           ` Jan Kiszka
2022-02-07 22:08 ` [PATCH v2 5/5] binman: Update image positions of FIT subentries Alper Nebi Yasak
2022-02-08 20:43   ` Simon Glass
2022-02-23  2:35   ` Simon Glass
2022-02-08 20:39 ` [PATCH v2 4/5] binman: Convert FIT entry type to a subclass of Section entry type Simon Glass
2022-02-08 20:39 ` [PATCH v2 3/5] binman: Check missing bintools of Section subclasses Simon Glass
2022-02-08 20:39 ` [PATCH v2 2/5] binman: Register and check bintools from FIT subentries Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPnjgZ2_ch5Hgjs6Z7AcQKUcv7r0oM6bJW47P_=DXFMSGT-R=w@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=alpernebiyasak@gmail.com \
    --cc=heiko.thiery@gmail.com \
    --cc=jan.kiszka@siemens.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.