qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.0 V3] tests/acpi-test: do not run iasl on


From: Laszlo Ersek
Subject: Re: [Qemu-devel] [PATCH for-2.0 V3] tests/acpi-test: do not run iasl on big endian machines
Date: Thu, 20 Mar 2014 23:26:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 03/20/14 23:06, Marcel Apfelbaum wrote:
> On Thu, 2014-03-20 at 22:57 +0100, Paolo Bonzini wrote:
>> Il 20/03/2014 22:14, Marcel Apfelbaum ha scritto:
>>> +# All known versions of iasl on BE machines are broken.
>>> +# TODO: add detection code once a non-broken version makes an appearance.
>>> +if ($iasl -h > /dev/null 2>&1) &&
>>> +   (lscpu | grep "Byte Order" | grep --quiet "Little Endian" ); then
>>
>> lscpu is not portable.
> I am open to suggestions...
> I'll try to come up with something else.

The printf and od utilities are portable. You can use printf to print a
character string, and use od to group that character string into
multibyte integers in the native byte order.

Example:

  X=$(printf '\336\255\276\357' | od -A n -t x4)

This sets X to " efbeadde" on little endian, and " deadbeef" on big endian.

Laszlo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]