Compile a x86_64 EFI .img

857 views
Skip to first unread message

Eric Beier

unread,
Nov 4, 2015, 9:05:32 PM11/4/15
to Android-x86
Hello guys,

I've followed the instructions to build an android-x86_64 iso on this page: http://www.android-x86.org/getsourcecode
Unfortunately the description there doesn't say how to build an EFI img for example like the "android-x86_64-5.1-rc1.img". 
This image has a boot/efi/grub folder with grub.cfg and 2 .efi files.

My way to build the iso:
. build/envsetup.sh
lunch $TARGET_PRODUCT-$TARGET_BUILD_VARIANT (I've tried lunch android_x86-userdebug and lunch android_x86-eng)
m -j4 iso_img

Thank you for your attention!

Greetings, Eric.

György Pejović

unread,
Nov 5, 2015, 12:14:04 AM11/5/15
to Android-x86
$ . build/envsetup.sh
$ lunch android_x86-eng
$ make efi_img

Mauro Rossi

unread,
Nov 5, 2015, 5:05:00 PM11/5/15
to Android-x86
For 64bit target:

lunch android_x86_64-eng

M.

Eric Beier

unread,
Nov 5, 2015, 8:42:16 PM11/5/15
to Android-x86
Thank you, i'll try it ^^

Mario Holzinger

unread,
Nov 11, 2015, 4:46:21 AM11/11/15
to Android-x86
Is there really nothing more required to build from source?

after a few hours compiling I got always errors (sorry can not post them at the moment)

normally I build x86 images that can be compiled without issues, but when changing to x86_64 the build process fails (no modifications on the source code at all)

maybe ther are different packages required for x64??

Building on my Microsoft Surface Pro 2 with Ubuntu 15,10 and a 3.16 kernel that is the most stable at the moment (4.2 looks also good)

Mauro Rossi

unread,
Nov 11, 2015, 8:01:31 AM11/11/15
to Android-x86
x86_64 target build may stop due to libwebchromium.so Errore cause by lack of memory/swap.

A practical way to avoid that is to have at least 4Gb RAM and 4Gb swap,

and building with just one thread: make -j1

M.

Povilas Staniulis

unread,
Nov 11, 2015, 9:30:26 AM11/11/15
to andro...@googlegroups.com
Or upgrade RAM to at least 8GB if possible (and affordable).
Using swap is possible but will slow down the build process significantly.

Dmitry Sutyagin

unread,
Nov 11, 2015, 1:21:04 PM11/11/15
to Android-x86
I'm currently trying to build x64 iso img and I have hit an error during mesa android_platform.c compilation:
Log says "sync/sync.h" not found. I have run "find" and I have found that the following file is present: system/core/libsync/include/sync/sync.h
I have re-started the build with the same command `m -j4 iso_img` and it continues. Does this mean that this error may be ignored and was just something random? Or if build fails do I need to "make clean" before restarting, otherwise my resulting image will be broken?

Dmitry Sutyagin

unread,
Nov 11, 2015, 2:28:55 PM11/11/15
to Android-x86
No, looks like it's a persistent error:

target  C: libGLES_mesa_32 <= external/mesa/src/egl/drivers/dri2/platform_android.c
Symlink: out/target/product/x86_64/system/lib/firmware/libertas/sd8688.bin -> ../mrvl/sd8688.bin
external/mesa/src/egl/drivers/dri2/platform_android.c:34:23: fatal error: sync/sync.h: No such file or directory
 #include <sync/sync.h>
                       ^
compilation terminated.
build/core/binary.mk:700: recipe for target 'out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libGLES_mesa_intermediates/drivers/dri2/platform_android.o' failed
make: *** [out/target/product/x86_64/obj_x86/SHARED_LIBRARIES/libGLES_mesa_intermediates/drivers/dri2/platform_android.o] Error 1

Any advice on how to fix this is appreciated.

Mauro Rossi

unread,
Nov 11, 2015, 4:03:36 PM11/11/15
to Android-x86


I'm currently trying to build x64 iso img and I have hit an error during mesa android_platform.c compilation:

Hi Dmitry, do you mean that your are building with mesa version 10.3.0 at the link you posted?
If so it will be easier to use a version that is lollipop-x86 compatible and tested for x86_64 target.
 
Log says "sync/sync.h" not found. I have run "find" and I have found that the following file is present: system/core/libsync/include/sync/sync.h
I have re-started the build with the same command `m -j4 iso_img` and it continues. Does this mean that this error may be ignored and was just something random? Or if build fails do I need to "make clean" before restarting, otherwise my resulting image will be broken?

That error happened with old versions,  please use android-x86 group search function for "sync/sync.h",
you'll need to add a line to LOCAL_C_INCLUDES in Android.mk of the module that failed to build, the post found with the search function explains everything.
M.

Dmitry Sutyagin

unread,
Nov 12, 2015, 1:33:43 AM11/12/15
to Android-x86
Hi Mauro,

No, this source link I have provided just because this is the first I have found. I did a normal 'repo init' and 'repo sync' and did not edit the source afterwards.
Thanks for the suggestion, I am now looking at this variable.

Is this a necessary step for everyone? If so, why is this change not in the repo yet? Or is it just me for some reason?

Here is how Android.mk looks like for mesa egl:

$:grep -A 3 LOCAL_C_INCLUDES ./external/mesa/src/egl/Android.mk
LOCAL_C_INCLUDES := \
        $(MESA_TOP)/src/egl/main \
        $(MESA_TOP)/src/egl/drivers/dri2 \


So looks like mesa egl expects sync/sync.sh to be either in "main" folder, or in "drivers/dri2", and does not look outside itself? Should I add $(MESA_TOP)/../../system/core/libsync/include ?


What is interesting is that it says 32bit target. Again, I use the repo which comes from repo-init ... -b lollipop-x86 and repo sync, no changes. I have set lunch lollipop_x86_64-eng.
BUT I build with "m -j4 iso_img". Is this a total failure of mine?

Mauro Rossi

unread,
Nov 12, 2015, 2:24:10 AM11/12/15
to Android-x86
> I have set lunch lollipop_x86_64-eng.

Hi,
that may induce the problem, you can see by using lunch[enter] command


utente@utente-desktop:~/lollipop-x86$ lunch

You're building on Linux

Lunch menu... pick a combo:
     1. aosp_arm-eng
     2. aosp_arm64-eng
     3. aosp_mips-eng
     4. aosp_mips64-eng
     5. aosp_x86-eng
     6. aosp_x86_64-eng
     7. android_x86_64-eng
     8. android_x86_64-userdebug
     9. android_x86_64-user
     10. android_x86-eng
     11. android_x86-userdebug
     12. android_x86-user

Which would you like? [aosp_arm-eng]


that the correct target is:

lunch android_x86_64-eng

M.

Dmitry Sutyagin

unread,
Nov 12, 2015, 2:42:43 AM11/12/15
to andro...@googlegroups.com
Mauro,

That was a typo in my message, of course I used android_x86_64-eng, not lollipop... Sorry. I have now installed unzip and bc for which I saw "not found" messages in logs (though this did not fail the build), and now building with efi_img instead of iso_img. Will report back if the build fails again. I have not changed Android.mk in mesa egl yet.

--
You received this message because you are subscribed to a topic in the Google Groups "Android-x86" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-x86/jfxwin-4hRA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.

Dmitry Sutyagin

unread,
Nov 12, 2015, 1:08:44 PM11/12/15
to Android-x86
omg, 12+ hours of building now, still running. I wonder how far I am from the finish? "out" folder is 38Gb in size now...
To unsubscribe from this group and all its topics, send an email to android-x86+unsubscribe@googlegroups.com.

Dmitry Sutyagin

unread,
Nov 13, 2015, 8:24:54 AM11/13/15
to Android-x86
My build has finally succeeded, and indeed it was important to specify "efi_img" instead of "iso_img" - looks like "iso_img" triggers building of 32bit stuff even though the target is _64, so on 64bit machine it will require additional dependencies / operations. Thanks everyone for help.

Dmitry Sutyagin

unread,
Nov 13, 2015, 8:36:45 AM11/13/15
to Android-x86
One more question - if there is an update in the repo, I do repo sync, do I have to completely wipe "out" folder and build from scratch again or the build system will detect changes and build only modules which have changed and I do not need to delete the "out" folder?

Chih-Wei Huang

unread,
Nov 13, 2015, 11:33:24 AM11/13/15
to Android-x86
2015-11-13 21:24 GMT+08:00 Dmitry Sutyagin <f3fl...@gmail.com>:
> My build has finally succeeded, and indeed it was important to specify
> "efi_img" instead of "iso_img" - looks like "iso_img" triggers building of
> 32bit stuff even though the target is _64, so on 64bit machine it will
> require additional dependencies / operations. Thanks everyone for help.

I don't think so.
Please build iso_img for x86_64 again
and report errors if any.

Chih-Wei Huang

unread,
Nov 13, 2015, 11:34:18 AM11/13/15
to Android-x86
2015-11-13 21:36 GMT+08:00 Dmitry Sutyagin <f3fl...@gmail.com>:
> One more question - if there is an update in the repo, I do repo sync, do I
> have to completely wipe "out" folder and build from scratch again or the
> build system will detect changes and build only modules which have changed
> and I do not need to delete the "out" folder?

The makefiles are designed to handle incremental build,
i.e., build updated parts only, of course.

Sometime the incremental build may fail.
In this case it's considered a bug of the makefiles.
Please report such an error if you encounter.

Dmitry Sutyagin

unread,
Nov 15, 2015, 8:54:41 AM11/15/15
to Android-x86
It was my mistake - after a few failed attempts I decided to remove "out" folder and did not realize I have to re-run "lunch" - seems that target had changed to default arm-v7a or smth like that which introduced these other issues. now that I've re-run lunch I am able to compile iso_img without issues.
Reply all
Reply to author
Forward
0 new messages