From: Jan Janssen Date: Wed, 11 Aug 2021 12:59:46 +0000 (+0200) Subject: sd-boot: Allow on/off and t/f for booleans too X-Git-Tag: v250-rc1~835^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dba0c9832be08909bde250fec3eb521309c167cc;p=thirdparty%2Fsystemd.git sd-boot: Allow on/off and t/f for booleans too --- diff --git a/man/loader.conf.xml b/man/loader.conf.xml index 29315ceb174..4c0355800cd 100644 --- a/man/loader.conf.xml +++ b/man/loader.conf.xml @@ -41,8 +41,8 @@ a comment line. Empty and comment lines are ignored. Boolean arguments may be written as - yes/y/true/1 or - no/n/false/0. + yes/y/true/t/on/1 or + no/n/false/f/off/0. diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c index b2977546a80..0c28cab2467 100644 --- a/src/boot/efi/util.c +++ b/src/boot/efi/util.c @@ -75,7 +75,9 @@ EFI_STATUS parse_boolean(const CHAR8 *v, BOOLEAN *b) { if (strcmpa(v, (CHAR8 *)"1") == 0 || strcmpa(v, (CHAR8 *)"yes") == 0 || strcmpa(v, (CHAR8 *)"y") == 0 || - strcmpa(v, (CHAR8 *)"true") == 0) { + strcmpa(v, (CHAR8 *)"true") == 0 || + strcmpa(v, (CHAR8 *)"t") == 0 || + strcmpa(v, (CHAR8 *)"on") == 0) { *b = TRUE; return EFI_SUCCESS; } @@ -83,7 +85,9 @@ EFI_STATUS parse_boolean(const CHAR8 *v, BOOLEAN *b) { if (strcmpa(v, (CHAR8 *)"0") == 0 || strcmpa(v, (CHAR8 *)"no") == 0 || strcmpa(v, (CHAR8 *)"n") == 0 || - strcmpa(v, (CHAR8 *)"false") == 0) { + strcmpa(v, (CHAR8 *)"false") == 0 || + strcmpa(v, (CHAR8 *)"f") == 0 || + strcmpa(v, (CHAR8 *)"off") == 0) { *b = FALSE; return EFI_SUCCESS; }