Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Kory Maincent <kory.maincent@bootlin.com>
Cc: thomas.petazzoni@bootlin.com, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v3 5/7] support/testing/infra/emulator.py: update encoding when calling qemu
Date: Sat, 2 Oct 2021 22:28:05 +0200	[thread overview]
Message-ID: <20211002202805.GX1504958@scaer> (raw)
In-Reply-To: <20210930202810.GP1504958@scaer>

Köry, All,

On 2021-09-30 22:28 +0200, Yann E. MORIN spake thusly:
> On 2021-09-23 17:57 +0200, Kory Maincent spake thusly:
> > With UTF-8 got issue with wrong character returned by Qemu when using EFI
> > BIOS. This breaks the test process with the following error. Update to
> > ISO-8859-1 encoding to avoid it.
> I am always skeptical about switching away from UTF-8. Rather, I'd like
> to undersand why that is the case.
[--SNIP--]
> 0xda in iso8859-15 is Ú (LATIN CAPITAL LETTER U WITH ACUTE). This is a
> weird character to see... And his is the first byte... Is edk2 just
> spitting actual binary?

It's not the first byte; and it's not edk2, but grub2:

    00000150  6d 1b 5b 34 30 6d 1b 5b  30 32 3b 33 30 48 47 4e  |m.[40m.[02;30HGN|
    00000160  55 20 47 52 55 42 20 20  76 65 72 73 69 6f 6e 20  |U GRUB  version |
    00000170  32 2e 30 34 0a 0d 0a 0d  1b 5b 30 34 3b 30 32 48  |2.04.....[04;02H|
    00000180  da c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 c4 c4 c4  |................|
    00000190  c4 c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 c4 c4 c4  |................|
    000001a0  c4 c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 c4 c4 c4  |................|
    000001b0  c4 c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 c4 c4 c4  |................|
    000001c0  c4 c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 bf 1b 5b  |...............[|
    000001d0  30 35 3b 30 32 48 b3 1b  5b 30 35 3b 37 39 48 b3  |05;02H..[05;79H.|

So, what is this "da c4...c4 bf" sequence? It looks a bit more obvious
when looking at the folowing lines:

    000001d0  30 35 3b 30 32 48 b3 1b  5b 30 35 3b 37 39 48 b3  |05;02H..[05;79H.|
    000001e0  1b 5b 30 36 3b 30 32 48  b3 1b 5b 30 36 3b 37 39  |.[06;02H..[06;79|
    000001f0  48 b3 1b 5b 30 37 3b 30  32 48 b3 1b 5b 30 37 3b  |H..[07;02H..[07;|
    00000200  37 39 48 b3 1b 5b 30 38  3b 30 32 48 b3 1b 5b 30  |79H..[08;02H..[0|
    00000210  38 3b 37 39 48 b3 1b 5b  30 39 3b 30 32 48 b3 1b  |8;79H..[09;02H..|
    00000220  5b 30 39 3b 37 39 48 b3  1b 5b 31 30 3b 30 32 48  |[09;79H..[10;02H|
    00000230  b3 1b 5b 31 30 3b 37 39  48 b3 1b 5b 31 31 3b 30  |..[10;79H..[11;0|
    00000240  32 48 b3 1b 5b 31 31 3b  37 39 48 b3 1b 5b 31 32  |2H..[11;79H..[12|
    00000250  3b 30 32 48 b3 1b 5b 31  32 3b 37 39 48 b3 1b 5b  |;02H..[12;79H..[|
    00000260  31 33 3b 30 32 48 b3 1b  5b 31 33 3b 37 39 48 b3  |13;02H..[13;79H.|
    00000270  1b 5b 31 34 3b 30 32 48  b3 1b 5b 31 34 3b 37 39  |.[14;02H..[14;79|
    00000280  48 b3 1b 5b 31 35 3b 30  32 48 b3 1b 5b 31 35 3b  |H..[15;02H..[15;|
    00000290  37 39 48 b3 1b 5b 31 36  3b 30 32 48 b3 1b 5b 31  |79H..[16;02H..[1|
    000002a0  36 3b 37 39 48 b3 1b 5b  31 37 3b 30 32 48 b3 1b  |6;79H..[17;02H..|
    000002b0  5b 31 37 3b 37 39 48 b3  1b 5b 31 38 3b 30 32 48  |[17;79H..[18;02H|
    000002c0  c0 c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 c4 c4 c4  |................|
    000002d0  c4 c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 c4 c4 c4  |................|
    000002e0  c4 c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 c4 c4 c4  |................|
    000002f0  c4 c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 c4 c4 c4  |................|
    00000300  c4 c4 c4 c4 c4 c4 c4 c4  c4 c4 c4 c4 c4 d9 1b 5b  |...............[|
    00000310  31 39 3b 30 32 48 1b 5b  32 30 3b 30 32 48 20 20  |19;02H.[20;02H  |

OK, so there are a lot of ANSI Escape Sequences, which are CSI commands:

    1b 5b 30 35 3b 37 39 48     - ESC [ 05 ; 79 H

This is CSI for "Cursor Position", i.e. move sursor to row 5, column 79.
OK, it is drawing a box! da is top-left corner, c4 is horizontal line,
bf is top-right corner, b3 is vertical line, c0 id lower-left corner,
and d9 is lower-right corner.

This is definitely not ISO-8859-15; it is CP437 [0]:
    https://en.wikipedia.org/wiki/Code_page_437

So, the solution to switch over to iso-8859-15 is not the proper
solution. We don't want to switch to CP437 either!

What I suggest, instead, is that we tell pexpect.spawn to just fix any
non-decodable character, by passing the parameter:
    codec_errors='replace'

At least, it makes the two EFI run-test succeed!

If that is OK, I can do that when applying, and fix the commit log
accordingly.

Regards,
Yann E. MORIN.

[0] Oh boy, does that bring fond memories... ;-)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2021-10-02 20:28 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 15:57 [Buildroot] [PATCH v3 0/7] Add support for ISO9660 image compatible with Legacy and EFI BIOS Kory Maincent
2021-09-23 15:57 ` [Buildroot] [PATCH v3 1/7] board, boot, package: remove usage of startup.nsh in EFI partition Kory Maincent
2021-09-23 20:06   ` Yann E. MORIN
2021-09-24 20:28     ` Erico Nunes
2021-09-27 19:28       ` Yann E. MORIN
2021-09-27 19:27   ` Yann E. MORIN
2021-09-23 15:57 ` [Buildroot] [PATCH v3 2/7] boot/grub2: add support to build multiple Grub2 configurations in the same build Kory Maincent
2021-09-27 19:42   ` Yann E. MORIN
2021-10-06 18:11   ` Yann E. MORIN
2021-10-07  8:23     ` Köry Maincent
2021-10-07  9:53       ` Yann E. MORIN
2021-10-07 12:43         ` Köry Maincent
2021-10-07 16:29           ` Yann E. MORIN
2021-10-08  8:20             ` Köry Maincent
2021-10-11 10:27             ` Köry Maincent
2021-10-14 20:02               ` Yann E. MORIN
2021-10-14 20:27                 ` Yann E. MORIN
2021-10-14 20:48                 ` Adam Duskett
2021-10-14 21:02                 ` Yann E. MORIN
2021-10-15  9:19                 ` Köry Maincent
2021-10-15  9:28                   ` Thomas Petazzoni
2021-10-15 20:50                 ` Yann E. MORIN
2021-10-19 16:30                   ` Adam Duskett
2021-10-20 15:58                     ` Köry Maincent
2021-09-23 15:57 ` [Buildroot] [PATCH v3 3/7] fs/iso9660: add support to Grub EFI bootloader in the image Kory Maincent
2021-09-27 20:43   ` Yann E. MORIN
2021-09-28  5:35     ` Yann E. MORIN
2021-09-23 15:57 ` [Buildroot] [PATCH v3 4/7] fs/iso9660: add support for hybrid image using Grub bootloader on BIOS and EFI Kory Maincent
2021-09-27 21:05   ` Yann E. MORIN
2021-09-29  8:23     ` Köry Maincent
2021-09-29 21:26   ` Yann E. MORIN
2021-09-30  9:12     ` Köry Maincent
2021-09-23 15:57 ` [Buildroot] [PATCH v3 5/7] support/testing/infra/emulator.py: update encoding when calling qemu Kory Maincent
2021-09-30 20:28   ` Yann E. MORIN
2021-10-02 20:28     ` Yann E. MORIN [this message]
2021-10-03  9:09       ` Thomas Petazzoni
2021-10-03 12:47   ` Yann E. MORIN
2021-10-04  7:47     ` Köry Maincent
2021-10-06 14:59     ` Peter Korsgaard
2021-09-23 15:57 ` [Buildroot] [PATCH v3 6/7] boot/edk2: add support to i386 architecture Kory Maincent
2021-09-30 19:51   ` Yann E. MORIN
2021-10-03 12:49   ` Yann E. MORIN
2021-10-04 10:22     ` Köry Maincent
2021-09-23 15:57 ` [Buildroot] [PATCH v3 7/7] support/testing/tests/fs/test_iso9660.py: add support to test using EFI BIOS Kory Maincent
2021-10-03 12:50   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211002202805.GX1504958@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=kory.maincent@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox