From 2af7a84a44750559d578033163c65829ae91c171 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Wed, 23 Mar 2022 13:00:46 +0200 Subject: 14584 unix: console property should only have one value Reviewed by: Joshua M. Clulow Reviewed by: C Fraire Reviewed by: Michael van der Westhuizen Approved by: Dan McDonald --- usr/src/uts/i86pc/os/fakebop.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'usr') diff --git a/usr/src/uts/i86pc/os/fakebop.c b/usr/src/uts/i86pc/os/fakebop.c index eb91d4a56a..07bc24971f 100644 --- a/usr/src/uts/i86pc/os/fakebop.c +++ b/usr/src/uts/i86pc/os/fakebop.c @@ -1448,6 +1448,30 @@ process_boot_environment(struct boot_modules *benv) continue; } + /* + * The loader allows multiple console devices to be specified + * as a comma-separated list, but the kernel does not yet + * support multiple console devices. If a list is provided, + * ignore all but the first entry: + */ + if (strcmp(name, "console") == 0) { + char propval[BP_MAX_STRLEN]; + + for (uint32_t i = 0; i < BP_MAX_STRLEN; i++) { + propval[i] = value[i]; + if (value[i] == ' ' || + value[i] == ',' || + value[i] == '\0') { + propval[i] = '\0'; + break; + } + + if (i + 1 == BP_MAX_STRLEN) + propval[i] = '\0'; + } + bsetprops(name, propval); + continue; + } if (name_is_blacklisted(name) == B_TRUE) continue; -- cgit v1.2.3