* [PATCH] locate the qemu binary in the grub-shell test
@ 2010-02-20 14:28 Dustin Kirkland
2010-02-25 19:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 3+ messages in thread
From: Dustin Kirkland @ 2010-02-20 14:28 UTC (permalink / raw)
To: grub-devel; +Cc: Colin Watson, kirkland
[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]
The grub-shell test assumes that qemu-system-i386 will be the binary
used, and that it's available on the system. Actually, on amd64/x86_64
systems, the appropriate binary is qemu-system-x86_64. Furthermore, an
appropriate error should be thrown if neither executable is found.
2010-02-20 Dustin Kirkland <kirkland@canonical.com>
* tests/util/grub-shell.in: locate the appropriate qemu system
binary, and exit non-zero, with an error message, if none are
found
diff -Nur -x '*.orig' -x '*~' lucid/tests/util/grub-shell.in lucid.new/tests/util/grub-shell.in
--- lucid/tests/util/grub-shell.in 2010-02-20 07:58:35.062756000 -0600
+++ lucid.new/tests/util/grub-shell.in 2010-02-20 08:22:07.797858157 -0600
@@ -92,6 +92,18 @@
esac
done
+qemu=
+for i in qemu-system-i386 qemu-system-x86_64; do
+ if which ${i} >/dev/null; then
+ qemu=${i}
+ break
+ fi
+done
+if [ "x${qemu}" = x ]; then
+ echo "qemu is not installed" 1>&2
+ exit 1
+fi
+
if [ "x${source}" = x ] ; then
tmpfile=`mktemp`
while read; do
@@ -135,8 +147,7 @@
cp ${isofile} ${fdafile}
outfile=`mktemp`
-qemu-system-i386 ${qemuopts} -nographic -serial stdio -hda ${hdafile} -fda ${fdafile} -cdrom ${isofile} -boot ${bootdev} | tr -d "\r" >${outfile}
-
+${qemu} ${qemuopts} -nographic -serial stdio -hda ${hdafile} -fda ${fdafile} -cdrom ${isofile} -boot ${bootdev} | tr -d "\r" >${outfile}
cat $outfile
rm -f ${tmpfile} ${outfile} ${cfgfile} ${isofile} ${hdafile} ${fdafile}
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] locate the qemu binary in the grub-shell test
2010-02-20 14:28 [PATCH] locate the qemu binary in the grub-shell test Dustin Kirkland
@ 2010-02-25 19:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-25 22:43 ` Anthony Liguori
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2010-02-25 19:41 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1: Type: text/plain, Size: 2444 bytes --]
Dustin Kirkland wrote:
> The grub-shell test assumes that qemu-system-i386 will be the binary
> used, and that it's available on the system. Actually, on amd64/x86_64
> systems, the appropriate binary is qemu-system-x86_64.
Currently grub-shell supports only i386-pc target and the right qemu
architecture to test it with is system-i386. qemu-system-x86_64 is
appropriate only for amd64-specific tests (you can have a look at my
bootchecks branch). Architecture of build has nothing to do with
architecture of target: you can very well cross-compile for i386-pc from
mips. It's not any different than cross-compiling to i386-pc from x86_64
(the only difference is that you use biarch compiler)
> Furthermore, an
> appropriate error should be thrown if neither executable is found.
>
> 2010-02-20 Dustin Kirkland <kirkland@canonical.com>
>
> * tests/util/grub-shell.in: locate the appropriate qemu system
> binary, and exit non-zero, with an error message, if none are
> found
>
> diff -Nur -x '*.orig' -x '*~' lucid/tests/util/grub-shell.in lucid.new/tests/util/grub-shell.in
> --- lucid/tests/util/grub-shell.in 2010-02-20 07:58:35.062756000 -0600
> +++ lucid.new/tests/util/grub-shell.in 2010-02-20 08:22:07.797858157 -0600
> @@ -92,6 +92,18 @@
> esac
> done
>
> +qemu=
> +for i in qemu-system-i386 qemu-system-x86_64; do
> + if which ${i} >/dev/null; then
> + qemu=${i}
> + break
> + fi
> +done
> +if [ "x${qemu}" = x ]; then
> + echo "qemu is not installed" 1>&2
> + exit 1
> +fi
> +
> if [ "x${source}" = x ] ; then
> tmpfile=`mktemp`
> while read; do
> @@ -135,8 +147,7 @@
> cp ${isofile} ${fdafile}
>
> outfile=`mktemp`
> -qemu-system-i386 ${qemuopts} -nographic -serial stdio -hda ${hdafile} -fda ${fdafile} -cdrom ${isofile} -boot ${bootdev} | tr -d "\r" >${outfile}
> -
> +${qemu} ${qemuopts} -nographic -serial stdio -hda ${hdafile} -fda ${fdafile} -cdrom ${isofile} -boot ${bootdev} | tr -d "\r" >${outfile}
> cat $outfile
>
> rm -f ${tmpfile} ${outfile} ${cfgfile} ${isofile} ${hdafile} ${fdafile}
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] locate the qemu binary in the grub-shell test
2010-02-25 19:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2010-02-25 22:43 ` Anthony Liguori
0 siblings, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2010-02-25 22:43 UTC (permalink / raw)
To: grub-devel; +Cc: Vladimir 'φ-coder/phcoder' Serbinenko
On 02/25/2010 01:41 PM, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Dustin Kirkland wrote:
>> The grub-shell test assumes that qemu-system-i386 will be the binary
>> used, and that it's available on the system. Actually, on amd64/x86_64
>> systems, the appropriate binary is qemu-system-x86_64.
> Currently grub-shell supports only i386-pc target and the right qemu
> architecture to test it with is system-i386. qemu-system-x86_64 is
> appropriate only for amd64-specific tests (you can have a look at my
> bootchecks branch). Architecture of build has nothing to do with
> architecture of target: you can very well cross-compile for i386-pc from
> mips. It's not any different than cross-compiling to i386-pc from x86_64
> (the only difference is that you use biarch compiler)
Actually, there is no qemu-system-i386 (it's just qemu). But
'qemu-system-x86_64 -cpu qemu32' is absolutely identical to 'qemu' as
far as the guest is concerned.
The proper thing to do would be to try 'qemu qemu-system-i386
qemu-system-x86_64' and for the last one, append a -cpu qemu32.
Regards,
Anthony Liguori
>> Furthermore, an
>> appropriate error should be thrown if neither executable is found.
>>
>> 2010-02-20 Dustin Kirkland<kirkland@canonical.com>
>>
>> * tests/util/grub-shell.in: locate the appropriate qemu system
>> binary, and exit non-zero, with an error message, if none are
>> found
>>
>> diff -Nur -x '*.orig' -x '*~' lucid/tests/util/grub-shell.in lucid.new/tests/util/grub-shell.in
>> --- lucid/tests/util/grub-shell.in 2010-02-20 07:58:35.062756000 -0600
>> +++ lucid.new/tests/util/grub-shell.in 2010-02-20 08:22:07.797858157 -0600
>> @@ -92,6 +92,18 @@
>> esac
>> done
>>
>> +qemu=
>> +for i in qemu-system-i386 qemu-system-x86_64; do
>> + if which ${i}>/dev/null; then
>> + qemu=${i}
>> + break
>> + fi
>> +done
>> +if [ "x${qemu}" = x ]; then
>> + echo "qemu is not installed" 1>&2
>> + exit 1
>> +fi
>> +
>> if [ "x${source}" = x ] ; then
>> tmpfile=`mktemp`
>> while read; do
>> @@ -135,8 +147,7 @@
>> cp ${isofile} ${fdafile}
>>
>> outfile=`mktemp`
>> -qemu-system-i386 ${qemuopts} -nographic -serial stdio -hda ${hdafile} -fda ${fdafile} -cdrom ${isofile} -boot ${bootdev} | tr -d "\r">${outfile}
>> -
>> +${qemu} ${qemuopts} -nographic -serial stdio -hda ${hdafile} -fda ${fdafile} -cdrom ${isofile} -boot ${bootdev} | tr -d "\r">${outfile}
>> cat $outfile
>>
>> rm -f ${tmpfile} ${outfile} ${cfgfile} ${isofile} ${hdafile} ${fdafile}
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> http://lists.gnu.org/mailman/listinfo/grub-devel
>>
>
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-25 22:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-20 14:28 [PATCH] locate the qemu binary in the grub-shell test Dustin Kirkland
2010-02-25 19:41 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-25 22:43 ` Anthony Liguori
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.