[OpenWrt-Devel] [PATCH v2] gemini: Support sysupgrade on DIR-685

Linus Walleij linus.walleij at linaro.org
Tue May 14 04:16:50 PDT 2019


On Tue, May 14, 2019 at 10:30 AM Petr Štetiar <ynezz at true.cz> wrote:

> Linus Walleij <linus.walleij at linaro.org> [2019-05-12 21:13:17]:

> > +REQUIRE_IMAGE_METADATA=1
>
> once you set this, you don't need to check for the image magic, do you? If so,
> please provide the reason for that.

The image magic is necessary for the boot loader to recognize
and boot the image. Since flashing an image without this magic
will brick the device, I feel it should be check as a "better safe
than sorry" measure, so we cannot under any circumstances
flash something that the router cannot boot.

Do you want me to add this to the commit message?

> Generated image is simply going to contain
> list of compatible boards in it's metadata JSON (comming from
> SUPPORTED_DEVICES variable) so I think, that this generic check should be
> enough.

In theory yes but in so many practical situations I have
muttered the words "that should not happen" and that is
why I feel it is better to have double safety checks.

> > +platform_find_part_size() {
> > +     local first dev size erasesize name
> > +     while read dev size erasesize name; do
> > +             name=${name#'"'}; name=${name%'"'}
> > +             [ "$name" = "$1" ] && {
> > +                     echo "$size"
> > +                     break
> > +             }
> > +     done < /proc/mtd
> > +}
>
> Why is this needed? I don't see it being used anywhere.

I'll drop it.

Yours,
Linus Walleij



More information about the openwrt-devel mailing list