Date: Thu, 4 Jul 2019 12:40:39 +0000 (UTC) From: Leandro Lupori <luporl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r349724 - stable/12/stand/ofw/libofw Message-ID: <201907041240.x64CedlO005635@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luporl Date: Thu Jul 4 12:40:38 2019 New Revision: 349724 URL: https://svnweb.freebsd.org/changeset/base/349724 Log: MFC r349188 [PPC] Fix loader input with newer QEMU versions At least since version 4.0.0, QEMU became bug-compatible with PowerVM's vty, by inserting a \0 after every \r. As this confuses loader's interpreter and as a \0 coming from the console doesn't seem reasonable, it's now being filtered at OFW console input. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20676 Modified: stable/12/stand/ofw/libofw/ofw_console.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/ofw/libofw/ofw_console.c ============================================================================== --- stable/12/stand/ofw/libofw/ofw_console.c Thu Jul 4 12:31:24 2019 (r349723) +++ stable/12/stand/ofw/libofw/ofw_console.c Thu Jul 4 12:40:38 2019 (r349724) @@ -97,7 +97,11 @@ ofw_cons_getchar() return l; } - if (OF_read(stdin, &ch, 1) > 0) + /* At least since version 4.0.0, QEMU became bug-compatible + * with PowerVM's vty, by inserting a \0 after every \r. + * As this confuses loader's interpreter and as a \0 coming + * from the console doesn't seem reasonable, it's filtered here. */ + if (OF_read(stdin, &ch, 1) > 0 && ch != '\0') return (ch); return (-1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907041240.x64CedlO005635>