recovery-utils: relax command mode check

As a result of the dualboot support we may end up with two
'update-firmware' commands in the rootfs. To prevent file name clashing,
we may need to install the recovery-utils update-firmware as
update-firmware.recovery, and then the current command mode check would
fail.

Relax the check, by just looking at the first character.

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2022-11-17 12:14:45 +01:00
parent 9812149ca5
commit bbd58825c4
1 changed files with 2 additions and 2 deletions

View File

@ -87,8 +87,8 @@
"\n"
/* Check if application was called as update-firmware or encrypt-partitions */
#define IS_UPDATEFW(cmd) (!strcmp(cmd, CMD_UPDATEFW))
#define IS_ENCRYPT(cmd) (!strcmp(cmd, CMD_ENCRYPT))
#define IS_UPDATEFW(cmd) (cmd[0] == 'u')
#define IS_ENCRYPT(cmd) (cmd[0] == 'e')
/* Actual command name */
static char *cmd_name;