This patch allows to define a magic number to override the
hardware / software compatibility check. Any update package having
defined the magic number in the hardware-compatibility field of its
sw-description file will be installed even when the hw/sw compatibility check
is enabled.
To enable this option HW_COMPATIBILITY_MAGIC must be enabled and
HW_COMPATIBILITY_MAGIC_NUMBER must be set.
Signed-off-by: Isak Lichtenstein <
isak.lic...@kistler.com>
Index: git/core/util.c
===================================================================
--- git.orig/core/util.c 2014-08-25 15:15:46.365550653 +0200
+++ git/core/util.c 2014-08-25 15:17:19.913554429 +0200
@@ -204,8 +204,13 @@
TRACE("Hardware %s Revision: %s", hwrev.boardname, hwrev.revision);
LIST_FOREACH(hw, &cfg->hardware, next) {
printf("%s %s\n", hw->revision, hwrev.revision);
- if (hw && strlen(hw->revision) == strlen(hwrev.revision) &&
- (!strcmp(hw->revision, hwrev.revision)))
+ if ( hw &&
+ ( (!strcmp(hw->revision, hwrev.revision))
+#ifdef CONFIG_HW_COMPATIBILITY_MAGIC
+ || (!strcmp(hw->revision, CONFIG_HW_COMPATIBILITY_MAGIC_NUMBER))
+#endif
+ )
+ )
return 0;
}
Index: git/Config.in
===================================================================
--- git.orig/Config.in 2014-08-25 15:15:46.365550653 +0200
+++ git/Config.in 2014-08-25 15:15:46.849550673 +0200
@@ -27,20 +27,33 @@
default n
help
If enabled, check if the hardware revision
- supports the softwrae version. Detecting the hardware
+ supports the software version. Detecting the hardware
revision is very board specific, and it cannot be generalized.
For this reason, the software expects that the detected
version is written into a file by a previous software.
config HW_COMPATIBILITY_FILE
- string "File with detected hardare revisions"
+ string "File with detected hardware revisions"
depends on HW_COMPATIBILITY
default "/etc/hwrevision"
help
File where to read the detected hardware revsion
that must be compared with the software version.
- The file has simple entries (one per line) in the
- format of "major.minor".
+ The file has simple entries (one per line).
+
+config HW_COMPATIBILITY_MAGIC
+ bool "Allow a magic number to override hardware / software compatibility check"
+ depends on HW_COMPATIBILITY
+ default n
+ help
+ If enabled, SWupdate will allow update packages containing the defined magic number
+ in the hardware-compatibility field of its sw-description to be installed, in spite
+ the fact that it does not match the hardware compatibility string.
+
+config HW_COMPATIBILITY_MAGIC_NUMBER
+ string "Magic number to be used for overriding hardware / software compatibility check"
+ depends on HW_COMPATIBILITY_MAGIC
+ default "123456"
config LUA
bool "lua"