Well, I have both good news and bad news. The good news first:
After all, it *DID* was an issue with Python version. Before, I followed the
instructions in Arch Linux wiki that should fix build issues due to the
coexistence of the two Python
versions:https://wiki.archlinux.org/index.php/python#Dealing_with_version_problem_in_build_scripts
However, it produced the same result, so I discarded a Python version issue.
After some walking in circles, I decided to try to compile edk2 standalone by
following the instructions here, using git to download the Source Code then
trying to make -C BaseTools:https://wiki.ubuntu.com/UEFI/EDK2
This also caused the same invalid syntax error. Being totally fresh Source
Code, at this point I started to really believe on the Python version issue,
due the fact that there should be no considerations for Arch Linux's Python 2/3
coexistence in the edk2 repository. What fixed this was quite rudimentary in a
less-than-elegant fashion: I simply deleted the /usr/bin/python file, then
replaced it with a copy of /usr/bin/python2. And finally, BaseTools builded.
I was looking around Makefiles looking what I will have to change to make edk2
aware that it should use python2 and not python. I think I found that: There is
an ovmf-svn package from Arch Linux User Repository that seems to be the latest
version of edk2 Source Code. This one has a PKGBUILD which a few lines that
replace python to python2 in a few places of edk2 Source Code. The reason of my
issue is that there is no patch to fix this in the Source Code that is
downloaded when pulled with --enable-ovmf with the xen package, which is fresh
and unchanged, so it by default uses Python 3 instead of 2. At least now I know
what I need to manually change.
The bad news is that it still fails to build with xen. Reason this time is:
GenFw: ERROR 3000: Invalid, Unsupported section alignment
This one seems to be a know error related to GCC 4.9 for all what I was able to
google. However, Arch Linux User Repository ovmf-svn package has two patchs
specifically to tackle this issue, so I suppose that it would build properly if
I were using that package. Problem is, Xen seems to require to be builded with
OVMF included in it, and I didn't found info claiming that I can simply
copypaste somewhere the OVMF binaries ready to use. So I need to apply this fix
myself, too.
Now I need to figure out how to pull a stunt that can both replace python to
python2 and fix GenFw error for GCC 4.9 in the source that xen pulls when I use
--enable-ovmf. And then, I will finally be able to make a happy build.
> Date: Tue, 2 Sep 2014 12:58:10 +0200
> From: [email protected]
> To: [email protected]
> Subject: Re: [edk2] Issues building OVMF from Xen with Arch Linux
>
> On 08/30/14 02:34, Zir Blazer wrote:
> > First of all, I want to say that I'm not developer and know very little
> > about programming, so if you need more info that what I'm currently
> > providing, please be as detailed as possible to tell me how to get you
> > it. I usually achieve some success when I follow guides, check wikis and
> > the like, when I have to go more far than that its a break point for me.
> >
> >
> > I'm trying to install Xen with Arch Linux as Dom0, using Nested
> > Virtualization for testing before moving to native. Xen supports UEFI
> > DomUs (VMs) if I use OVMF, which should be enabled when compiling, and I
> > decided to give that a try so I can have a cutting edge and full
> > featured system. As far that I know, this is done by using --enable-ovmf
> > option, which on Arch Linux xen package, I can include in the
> > ./configure line in PKGBUILD. So in this file:
> > https://aur.archlinux.org/packages/xe/xen/PKGBUILD
> >
> > I change this...
> >
> > build() {
> > export CFLAGS+='-Wall -Wstrict-prototypes -Wno-unused-local-typedefs
> > -Wno-sizeof-pointer-memaccess'
> > cd $pkgname-$pkgver/
> > ./autogen.sh
> > *./configure PYTHON=/usr/bin/python2 --prefix=/usr --localstatedir=/run*
> > make LANG=C PYTHON=python2 dist-{xen,tools,kernels}
> > unset CFLAGS
> > make LANG=C PYTHON=python2 dist-stubdom
> > }
> >
> > to this...
> >
> > *./configure PYTHON=/usr/bin/python2 --prefix=/usr --localstatedir=/run
> > --enable-ovmf*
> >
> >
> >
> > So far, using makepkg without adding OVMF builds with no issues. When I
> > use OVMF, it downloads some 150 MiB or so worth of data (A clone of your
> > Source Repository I suppose), and starts to build but fails. The point
> > where it fails and error message is IDENTICAL to this guy who posted in
> > xen-devel Mailing List:
> > http://lists.xen.org/archives/html/xen-devel/2014-07/msg02855.html
> >
> > What refuses to build is in this file:
> > https://github.com/tianocore/edk2/blob/master/BaseTools/Tests/TestTools.py
> >
> > Line 87 print description, '(base64 encoded):'
> >
> > It was suggested to him to try building with Python 2 instead of 3, or
> > to contact OVMF Mailing List. According to what I researched about Arch
> > Linux package management, python2 package is the older version which
> > should be compatible, and on the ./configure line it is specifically
> > stated to use it (It is also installed as prerequisite for Xen), so it
> > is using the correct Python version.
> >
> > After googling around for Python print syntaxis, I decided to remove the
> > double dot before the '. so now the line reads:
> > print description, '(base64 encoded)'
> > I tried building Xen again, it seemed to have more progress but also
> > failed, this time on this file:
> >
> > https://github.com/tianocore/edk2/blob/master/BaseTools/Source/Python/build/build.py
> >
> > Line 519 except BaseException, X:
> >
> > ...arguing invalid syntaxis if I recall correctly. After googling a bit
> > more, I decided to remove the comma and X and leave it just as except
> > BaseException: and instead, it failed to compile on...
> >
> > Line 1005 except WindowsError, X:
> >
> > I repeated the procedure of removing the comma and X in that line, 1099,
> > 2048 and 2055, which also had excepts with similar syntaxis. After doing
> > all that, now instead it errors out in...
> >
> > Line 20 import StringIO
> >
> > ...arguing that it can't be found, or something like that. At this point
> > I'm totally out of ideas because I don't have the knowledge to debug
> > this myself, so I request that someone can check if I'm doing something
> > wrong or there is an actual issue there (Which could be, considering
> > that the guy from the xen-devel Mailing List also had issues building).
> >
> > Also, I'm aware than there are binaries for QEMU, but I don't know if
> > they work out of the box or I actually need to compile Xen including
> > OVMF to support it. The people I saw asking for using UEFI on VMs with
> > Xen, were told to build as I did. Seems that some months ago it was
> > possible.
>
> I can "contribute" the following ideas:
> - You need to build with python2.
> - The steps you've already taken to use python2 instead of python3 are
> insufficient, apparently. You probably need to massage your ArchLinux
> environment so that python2 becomes the default.
>
> You'll have to dig in and see what exactly breaks. I don't use Xen nor
> ArchLinux.
>
> Thanks,
> Laszlo
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds. Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel