aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-09-05 13:08:13 +0200
committerRafał Miłecki <rafal@milecki.pl>2019-09-12 14:30:18 +0200
commit78d0d13c8635615478de472b7430fd4f63015411 (patch)
treec25758eecc4791a059419e8d9e6bc082cc652384 /package/base-files/files
parent3dac34de2563be633d58c768c685ec70bc410c3f (diff)
downloadupstream-78d0d13c8635615478de472b7430fd4f63015411.tar.gz
upstream-78d0d13c8635615478de472b7430fd4f63015411.tar.bz2
upstream-78d0d13c8635615478de472b7430fd4f63015411.zip
base-files: validate firmware for compatibility with backup
This allows platform code to check if firmware image can be used with preserving a backup. It may be used e.g. when installing vendor firmwares that won't restore appended backup archive. Suggested-by: Luis Araneda <luaraneda@gmail.com> Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit 1c510fe2980cd787602786e82f44602549d607d4)
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/usr/libexec/validate_firmware_image7
1 files changed, 7 insertions, 0 deletions
diff --git a/package/base-files/files/usr/libexec/validate_firmware_image b/package/base-files/files/usr/libexec/validate_firmware_image
index a07796c9dc..f85fb9e4b4 100755
--- a/package/base-files/files/usr/libexec/validate_firmware_image
+++ b/package/base-files/files/usr/libexec/validate_firmware_image
@@ -8,6 +8,7 @@ include /lib/upgrade
VALID=1
FORCEABLE=1
+ALLOW_BACKUP=1
# Mark image as invalid but still possible to install
notify_firmware_invalid() {
@@ -20,6 +21,11 @@ notify_firmware_broken() {
FORCEABLE=0
}
+# Mark image as incompatible with preserving a backup
+notify_firmware_no_backup() {
+ ALLOW_BACKUP=0
+}
+
# Add result of validation test
notify_firmware_test_result() {
local old_ns
@@ -55,5 +61,6 @@ json_init
json_close_object
json_add_boolean valid "$VALID"
json_add_boolean forceable "$FORCEABLE"
+ json_add_boolean allow_backup "$ALLOW_BACKUP"
json_dump -i
json_set_namespace $old_ns