diff mbox series

[OpenWrt-Devel] ramips: upgrade: Enable checking of image metadata

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

Commit Message

Petr Štetiar Nov. 29, 2018, 9:36 a.m. UTC
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(+)

Comments

Mathias Kresin Nov. 30, 2018, 11:47 a.m. UTC | #1
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
Petr Štetiar Nov. 30, 2018, 12:36 p.m. UTC | #2
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 mbox series

Patch

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")"