Message ID | 1543484217-17306-1-git-send-email-ynezz@true.cz |
---|---|
State | Superseded |
Delegated to: | Mathias Kresin |
Headers | show |
Series | [OpenWrt-Devel] ramips: upgrade: Enable checking of image metadata | expand |
29/11/2018 10:36, Petr Štetiar: > Checking metadata in image before flashing is nice for a good user > experience and bricking protection as well, so enable it by default for > all boards but the four legacy ones. > > Cc: Mathias Kresin <dev@kresin.me> > Signed-off-by: Petr Štetiar <ynezz@true.cz> > --- > target/linux/ramips/base-files/lib/upgrade/platform.sh | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh > index e28f066..9f36c47 100755 > --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh > +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh > @@ -4,6 +4,23 @@ > > PART_NAME=firmware > > +enable_image_metadata_check() { > + local board=$(board_name) > + > + case "$board" in > + all0239-3g|\ > + dcs-930|\ > + dcs-930l-b1|\ > + wl-341v3) > + REQUIRE_IMAGE_METADATA=0 > + ;; > + *) > + REQUIRE_IMAGE_METADATA=1 > + ;; > + esac > +} > +enable_image_metadata_check > + > platform_check_image() { > local board=$(board_name) > local magic="$(get_magic_long "$1")" > Hey Petr, I've just send a patch series which drops the remaining legacy images, enables the image metadata verification for all images and gets rid of the old image checks. As long as no one opposes, I would like to go with my patches. Mathias
Mathias Kresin <dev@kresin.me> [2018-11-30 12:47:52]: Hi, > I've just send a patch series which drops the remaining legacy images, > enables the image metadata verification for all images and gets rid of the > old image checks. thanks a lot for taking care of that! -- ynezz
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index e28f066..9f36c47 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -4,6 +4,23 @@ PART_NAME=firmware +enable_image_metadata_check() { + local board=$(board_name) + + case "$board" in + all0239-3g|\ + dcs-930|\ + dcs-930l-b1|\ + wl-341v3) + REQUIRE_IMAGE_METADATA=0 + ;; + *) + REQUIRE_IMAGE_METADATA=1 + ;; + esac +} +enable_image_metadata_check + platform_check_image() { local board=$(board_name) local magic="$(get_magic_long "$1")"
Checking metadata in image before flashing is nice for a good user experience and bricking protection as well, so enable it by default for all boards but the four legacy ones. Cc: Mathias Kresin <dev@kresin.me> Signed-off-by: Petr Štetiar <ynezz@true.cz> --- target/linux/ramips/base-files/lib/upgrade/platform.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)