Discussion:
Guide: create a custom configuration and compile an Android-x86 kernel
(too old to reply)
Paul Lutus
2014-03-27 18:49:41 UTC
Permalink
A number of posts have reported failure or difficulties in recompiling a
kernel with a modified configuration, and the available documentation is
pretty terrible. So here's a basic guide to editing the default
configuration and recompiling. Some of the instructions assume a
Ubuntu/Kubuntu environment.

I came to this because I couldn't get Android-x86 to boot on a desktop
machine with the available kernel as configured. I knew I had to add some
SATA drivers to the existing configuration. I tried reading
http://www.android-x86.org/documents/customizekernel, unfortunately it
couldn't be more confusingly written if someone had set out to be as
confusing as possible to win a contest.

So, with the aim of allowing custom kernel configurations, here are the
clearest instructions I can manage:

1. Acquire the Android-x86 source here:
http://www.android-x86.org/getsourcecode . BTW it is huge, 12.8 gigabytes
at the time of writing.

2. Put the source in a directory, let's call it "source", that is a
subdirectory of a work directory, call that "work". So we have /work/source
(use your own preferred names).

3. Create directory /work/config that will be used to contain the custom
configuration, which must be segregated from the build tree and which you
will want to retain if it's successful.

4. Now make a copy of the default Android-x86 configuration into your
custom configuration directory:

FROM: /work/source/kernel/arch/x86/configs/android-x86_defconfig
TO: /work/config/.config

5. Remember this is a Ubuntu/Kubuntu example. To perform the configuration
below in the least painful way, you will probably need to install some
extra libraries/applications:

python-lunch
libqt4-core
libqt4-gui
qt4-default
gcc-multilib
distcc
ccache

6. These libraries are easily gotten:

# apt-get -y install python-lunch libqt4-core libqt4-gui qt4-default
gcc-multilib distcc ccache

7. If you want the compilation to finish in any finite amount of time, set
up distcc on every computer you can get your hands on and get networked --
separate topic, not covered here.

8. Now for the important part -- remember that we want to configure and
compile a custom kernel, not a complete Android system, but we need the
complete Android environment for this to be possible.

9. Enter the /work/source directory and issue these commands:

. build/envsetup.sh
export ARCH=x86
lunch android_x86-eng
make -C kernel O=/work/config/.config xconfig

10. The final command in the above list will launch a graphical
configuration dialog that will look more or less like this:
Loading Image... .

11. Make any changes you require, remembering there are some settings
essential to using the kernel with Android. In my case, I needed to add
some statically linked SATA drivers to support a desktop environment.

12. Save your changes and close the dialog.

13. Now to actually compile the modified kernel:

export ARCH=x86
export TARGET_PRODUCT=android_x86
export TARGET_KERNEL_CONFIG=/work/config/.config
make clean (optional, first time)
make kernel -j16 CC="distcc gcc" CXX="distcc g++" (if using distcc on
a populated network)
make kernel -j4 (if not using distcc, very slow)

14. Now copy the compiled kernel, which of course will have compiled
without error and in a finite amount of time:

FROM: /work/source/out/target/product/x86/kernel
TO: any chosen destination.

15. To deal with the issue of a system that the default Android-x86
installation code can't understand or install to:

a. Install Android-x86 on any convenient device that the installer does
recognize, like a USB stick.
b. Create a suitable partition on the target drive.
c. Copy the working installation from the source USB stick into the
newly created partition.
d. Overwrite the default kernel (located by default at
(device)/android-4.4-RC1/kernel) with the modified kernel compiled above.

16. To get grub2 to recognize and list the new partition in its menus,
create a configuration file named 45_android, containing:

#!/bin/sh
echo "$0: Android-4.4-RC1 (on /dev/sda4)" >&2
exec tail -n +4 $0

menuentry "Android android-4.4-RC1 Normal (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}

menuentry "Android android-4.4-RC1 Debug (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel pnp.debug=1 root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DEBUG=1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}

17. Change the above references to "/dev/sda4" and "hd0,4" to the actual
target partition on your system, examples: /dev/sda1 = hd0,1 , /dev/sdb3 =
hd1,3

18. Change the above resolution (1280x1024) to your desired resolution. I
have one laptop that supports Android-x86 at 1920x1080.

19. Copy the file 45_android into /etc/grub.d and make it executable.

20. Then, as root: update-grub

At this point you should be able to reboot into the modified Android-x86 on
a desktop or laptop.

I hope this clears up the confusion surrounding the issue of custom kernel
configurations.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
midi jari
2014-03-28 23:24:16 UTC
Permalink
Thank you for the Guide, but I have some issues that I couldn't fix even w/
recompiling kernel from scratch : I can't connect to WiFi (even though it
shouws me the hotspots and everything) and stuck in "Obtaining IP adresss"
for ever! I have an UEFI system and GRUB 2, I recompiled it for the
<efivar> problem (that seems to be corrected when removing the necessary
files from the source
https://groups.google.com/forum/#!topic/android-x86/GrPdnpa6XBM <-- See
here on the latest posts) but WiFi does work if I boot a USB key from
LegacyMode Instead of UEFI. What could that be?

(Can you send me the kernel you built? I want to test every single one
available :) )
Post by Paul Lutus
A number of posts have reported failure or difficulties in recompiling a
kernel with a modified configuration, and the available documentation is
pretty terrible. So here's a basic guide to editing the default
configuration and recompiling. Some of the instructions assume a
Ubuntu/Kubuntu environment.
I came to this because I couldn't get Android-x86 to boot on a desktop
machine with the available kernel as configured. I knew I had to add some
SATA drivers to the existing configuration. I tried reading
http://www.android-x86.org/documents/customizekernel, unfortunately it
couldn't be more confusingly written if someone had set out to be as
confusing as possible to win a contest.
So, with the aim of allowing custom kernel configurations, here are the
http://www.android-x86.org/getsourcecode . BTW it is huge, 12.8 gigabytes
at the time of writing.
2. Put the source in a directory, let's call it "source", that is a
subdirectory of a work directory, call that "work". So we have /work/source
(use your own preferred names).
3. Create directory /work/config that will be used to contain the custom
configuration, which must be segregated from the build tree and which you
will want to retain if it's successful.
4. Now make a copy of the default Android-x86 configuration into your
FROM: /work/source/kernel/arch/x86/configs/android-x86_defconfig
TO: /work/config/.config
5. Remember this is a Ubuntu/Kubuntu example. To perform the configuration
below in the least painful way, you will probably need to install some
python-lunch
libqt4-core
libqt4-gui
qt4-default
gcc-multilib
distcc
ccache
# apt-get -y install python-lunch libqt4-core libqt4-gui qt4-default
gcc-multilib distcc ccache
7. If you want the compilation to finish in any finite amount of time, set
up distcc on every computer you can get your hands on and get networked --
separate topic, not covered here.
8. Now for the important part -- remember that we want to configure and
compile a custom kernel, not a complete Android system, but we need the
complete Android environment for this to be possible.
. build/envsetup.sh
export ARCH=x86
lunch android_x86-eng
make -C kernel O=/work/config/.config xconfig
10. The final command in the above list will launch a graphical
https://i.imgur.com/8ROkrEy.png .
11. Make any changes you require, remembering there are some settings
essential to using the kernel with Android. In my case, I needed to add
some statically linked SATA drivers to support a desktop environment.
12. Save your changes and close the dialog.
export ARCH=x86
export TARGET_PRODUCT=android_x86
export TARGET_KERNEL_CONFIG=/work/config/.config
make clean (optional, first time)
make kernel -j16 CC="distcc gcc" CXX="distcc g++" (if using distcc on
a populated network)
make kernel -j4 (if not using distcc, very slow)
14. Now copy the compiled kernel, which of course will have compiled
FROM: /work/source/out/target/product/x86/kernel
TO: any chosen destination.
15. To deal with the issue of a system that the default Android-x86
a. Install Android-x86 on any convenient device that the installer
does recognize, like a USB stick.
b. Create a suitable partition on the target drive.
c. Copy the working installation from the source USB stick into the
newly created partition.
d. Overwrite the default kernel (located by default at
(device)/android-4.4-RC1/kernel) with the modified kernel compiled above.
16. To get grub2 to recognize and list the new partition in its menus,
#!/bin/sh
echo "$0: Android-4.4-RC1 (on /dev/sda4)" >&2
exec tail -n +4 $0
menuentry "Android android-4.4-RC1 Normal (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}
menuentry "Android android-4.4-RC1 Debug (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel pnp.debug=1 root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DEBUG=1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}
17. Change the above references to "/dev/sda4" and "hd0,4" to the actual
target partition on your system, examples: /dev/sda1 = hd0,1 , /dev/sdb3 =
hd1,3
18. Change the above resolution (1280x1024) to your desired resolution. I
have one laptop that supports Android-x86 at 1920x1080.
19. Copy the file 45_android into /etc/grub.d and make it executable.
20. Then, as root: update-grub
At this point you should be able to reboot into the modified Android-x86
on a desktop or laptop.
I hope this clears up the confusion surrounding the issue of custom kernel
configurations.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Paul Lutus
2014-03-29 22:21:14 UTC
Permalink
I can't connect to WiFi (even though it shouws me the hotspots and
everything) and stuck in "Obtaining IP adresss" for ever!

Well, if the local hotspots are listed but you're never assigned an
address, this might be a DHCP failure, or possibly a conflict between the
kernel's WiFi device driver and the actual hardware device in the machine.
Check to make sure that other local devices are assigned an address, and
that you're using the right password. Also check to see if the kernel WiFi
driver is really meant for the WiFi hardware on the host machine.

Another thing to check is to run the default OS for that machine, see if
you get hooked up, and find out which driver is being used. Then make sure
the same driver is made available to Android.

Another tactic is to run WireShark on a local machine and monitor the
traffic going between the Android machine and the WiFi router.
(Can you send me the kernel you built? I want to test every single one
available :) )

I think it would be more efficient if I send you the configuration I'm
using -- it weighs much less. :) It's attached. I have made very few
changes over the default configuration, only enough to make the kernel work
in a desktop machine with modern SATA drives.

Just position the attached configuration as explained in my first post, and
run the configuration dialog to see what's up.
WiFi does work if I boot a USB key from LegacyMode Instead of UEFI.
I assume you mean the USB device is running the default Android-x86
configuration, yes? If that's true, maybe check to see what changes you've
made and whether they might be interfering with the WiFi driver.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Andrews Magnoni
2014-03-30 06:16:33 UTC
Permalink
did you try to compile these experimental kernel:
https://android.googlesource.com/kernel/common.git/+archive/experimental/android-3.14.tar.gz

im getting errors.
Post by Paul Lutus
I can't connect to WiFi (even though it shouws me the hotspots and
everything) and stuck in "Obtaining IP adresss" for ever!
Well, if the local hotspots are listed but you're never assigned an
address, this might be a DHCP failure, or possibly a conflict between the
kernel's WiFi device driver and the actual hardware device in the machine.
Check to make sure that other local devices are assigned an address, and
that you're using the right password. Also check to see if the kernel WiFi
driver is really meant for the WiFi hardware on the host machine.
Another thing to check is to run the default OS for that machine, see if
you get hooked up, and find out which driver is being used. Then make sure
the same driver is made available to Android.
Another tactic is to run WireShark on a local machine and monitor the
traffic going between the Android machine and the WiFi router.
(Can you send me the kernel you built? I want to test every single one
available :) )
I think it would be more efficient if I send you the configuration I'm
using -- it weighs much less. :) It's attached. I have made very few
changes over the default configuration, only enough to make the kernel work
in a desktop machine with modern SATA drives.
Just position the attached configuration as explained in my first post,
and run the configuration dialog to see what's up.
WiFi does work if I boot a USB key from LegacyMode Instead of UEFI.
I assume you mean the USB device is running the default Android-x86
configuration, yes? If that's true, maybe check to see what changes you've
made and whether they might be interfering with the WiFi driver.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Paul Lutus
2014-03-30 06:17:26 UTC
Permalink
Dear group: I have turned my prior post into an article with more detail
and graphics: http://arachnoid.com/android/Android-x86
Vaidotas
2014-04-05 21:08:11 UTC
Permalink
Thanks for detailed description. But what should I do if I want to compile
a more recent kernel for Android-x86, like the one mentioned above,
3.14-experimental? I wasn't able to compile it due to errors. Is it
possible to create a new device configuration with different kernel version?
Post by Paul Lutus
Dear group: I have turned my prior post into an article with more detail
and graphics: http://arachnoid.com/android/Android-x86
I hope it helps people create their own kernels.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Joan R. Serra
2014-04-06 07:55:40 UTC
Permalink
Thanks for the article Paul !!
Post by Paul Lutus
Dear group: I have turned my prior post into an article with more detail
and graphics: http://arachnoid.com/android/Android-x86
I hope it helps people create their own kernels.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Andy Percept
2014-04-07 06:10:55 UTC
Permalink
Paul can you guide me for the issues i am facing in building the kernel

*Query Link *:
https://groups.google.com/d/msg/android-x86/Sv56Bu9WJu8/6f-l9YWj-DQJ
Post by Paul Lutus
Dear group: I have turned my prior post into an article with more detail
and graphics: http://arachnoid.com/android/Android-x86
I hope it helps people create their own kernels.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Andy Percept
2014-04-11 05:43:49 UTC
Permalink
Hi Paul,

I am tring to compile the source but i am getting following error

Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/lunch/runner.py", line 103, in run
lunch_master = master.run_master(config_file,
log_to_file=file_logging_enabled, log_dir=logging_dir, log_level=log_level)
File "/usr/lib/pymodules/python2.7/lunch/master.py", line 730, in
run_master
execute_config_file(lunch_master, config_file,
chmod_config_file=chmod_config_file)
File "/usr/lib/pymodules/python2.7/lunch/master.py", line 689, in
execute_config_file
execfile(config_file) # config is plain python using the globals
defined here. (the add_process function)
File "./config/.config/android-x86_defconfig", line 6, in <module>
CONFIG_X86_32=y
NameError: name 'y' is not defined


if i change the kernel =y to ='y' error is solved but
my terminal does not proceed forward it gets stuck in

***@ubuntu-desktop:/home/ubuntu/android/androidjb# lunch
./config/.config/andid-x86_defconfig

-- At this stage no error is fired, i kept if for more than 8 hours as it
is...

Thanks & Regards
Arun
Post by Paul Lutus
A number of posts have reported failure or difficulties in recompiling a
kernel with a modified configuration, and the available documentation is
pretty terrible. So here's a basic guide to editing the default
configuration and recompiling. Some of the instructions assume a
Ubuntu/Kubuntu environment.
I came to this because I couldn't get Android-x86 to boot on a desktop
machine with the available kernel as configured. I knew I had to add some
SATA drivers to the existing configuration. I tried reading
http://www.android-x86.org/documents/customizekernel, unfortunately it
couldn't be more confusingly written if someone had set out to be as
confusing as possible to win a contest.
So, with the aim of allowing custom kernel configurations, here are the
http://www.android-x86.org/getsourcecode . BTW it is huge, 12.8 gigabytes
at the time of writing.
2. Put the source in a directory, let's call it "source", that is a
subdirectory of a work directory, call that "work". So we have /work/source
(use your own preferred names).
3. Create directory /work/config that will be used to contain the custom
configuration, which must be segregated from the build tree and which you
will want to retain if it's successful.
4. Now make a copy of the default Android-x86 configuration into your
FROM: /work/source/kernel/arch/x86/configs/android-x86_defconfig
TO: /work/config/.config
5. Remember this is a Ubuntu/Kubuntu example. To perform the configuration
below in the least painful way, you will probably need to install some
python-lunch
libqt4-core
libqt4-gui
qt4-default
gcc-multilib
distcc
ccache
# apt-get -y install python-lunch libqt4-core libqt4-gui qt4-default
gcc-multilib distcc ccache
7. If you want the compilation to finish in any finite amount of time, set
up distcc on every computer you can get your hands on and get networked --
separate topic, not covered here.
8. Now for the important part -- remember that we want to configure and
compile a custom kernel, not a complete Android system, but we need the
complete Android environment for this to be possible.
. build/envsetup.sh
export ARCH=x86
lunch android_x86-eng
make -C kernel O=/work/config/.config xconfig
10. The final command in the above list will launch a graphical
https://i.imgur.com/8ROkrEy.png .
11. Make any changes you require, remembering there are some settings
essential to using the kernel with Android. In my case, I needed to add
some statically linked SATA drivers to support a desktop environment.
12. Save your changes and close the dialog.
export ARCH=x86
export TARGET_PRODUCT=android_x86
export TARGET_KERNEL_CONFIG=/work/config/.config
make clean (optional, first time)
make kernel -j16 CC="distcc gcc" CXX="distcc g++" (if using distcc on
a populated network)
make kernel -j4 (if not using distcc, very slow)
14. Now copy the compiled kernel, which of course will have compiled
FROM: /work/source/out/target/product/x86/kernel
TO: any chosen destination.
15. To deal with the issue of a system that the default Android-x86
a. Install Android-x86 on any convenient device that the installer
does recognize, like a USB stick.
b. Create a suitable partition on the target drive.
c. Copy the working installation from the source USB stick into the
newly created partition.
d. Overwrite the default kernel (located by default at
(device)/android-4.4-RC1/kernel) with the modified kernel compiled above.
16. To get grub2 to recognize and list the new partition in its menus,
#!/bin/sh
echo "$0: Android-4.4-RC1 (on /dev/sda4)" >&2
exec tail -n +4 $0
menuentry "Android android-4.4-RC1 Normal (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}
menuentry "Android android-4.4-RC1 Debug (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel pnp.debug=1 root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DEBUG=1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}
17. Change the above references to "/dev/sda4" and "hd0,4" to the actual
target partition on your system, examples: /dev/sda1 = hd0,1 , /dev/sdb3 =
hd1,3
18. Change the above resolution (1280x1024) to your desired resolution. I
have one laptop that supports Android-x86 at 1920x1080.
19. Copy the file 45_android into /etc/grub.d and make it executable.
20. Then, as root: update-grub
At this point you should be able to reboot into the modified Android-x86
on a desktop or laptop.
I hope this clears up the confusion surrounding the issue of custom kernel
configurations.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
michael colvin
2014-04-11 19:42:09 UTC
Permalink
Thanks for the guide. I just had just posted looking for that.
Post by Paul Lutus
A number of posts have reported failure or difficulties in recompiling a
kernel with a modified configuration, and the available documentation is
pretty terrible. So here's a basic guide to editing the default
configuration and recompiling. Some of the instructions assume a
Ubuntu/Kubuntu environment.
I came to this because I couldn't get Android-x86 to boot on a desktop
machine with the available kernel as configured. I knew I had to add some
SATA drivers to the existing configuration. I tried reading
http://www.android-x86.org/documents/customizekernel, unfortunately it
couldn't be more confusingly written if someone had set out to be as
confusing as possible to win a contest.
So, with the aim of allowing custom kernel configurations, here are the
http://www.android-x86.org/getsourcecode . BTW it is huge, 12.8 gigabytes
at the time of writing.
2. Put the source in a directory, let's call it "source", that is a
subdirectory of a work directory, call that "work". So we have /work/source
(use your own preferred names).
3. Create directory /work/config that will be used to contain the custom
configuration, which must be segregated from the build tree and which you
will want to retain if it's successful.
4. Now make a copy of the default Android-x86 configuration into your
FROM: /work/source/kernel/arch/x86/configs/android-x86_defconfig
TO: /work/config/.config
5. Remember this is a Ubuntu/Kubuntu example. To perform the configuration
below in the least painful way, you will probably need to install some
python-lunch
libqt4-core
libqt4-gui
qt4-default
gcc-multilib
distcc
ccache
# apt-get -y install python-lunch libqt4-core libqt4-gui qt4-default
gcc-multilib distcc ccache
7. If you want the compilation to finish in any finite amount of time, set
up distcc on every computer you can get your hands on and get networked --
separate topic, not covered here.
8. Now for the important part -- remember that we want to configure and
compile a custom kernel, not a complete Android system, but we need the
complete Android environment for this to be possible.
. build/envsetup.sh
export ARCH=x86
lunch android_x86-eng
make -C kernel O=/work/config/.config xconfig
10. The final command in the above list will launch a graphical
https://i.imgur.com/8ROkrEy.png .
11. Make any changes you require, remembering there are some settings
essential to using the kernel with Android. In my case, I needed to add
some statically linked SATA drivers to support a desktop environment.
12. Save your changes and close the dialog.
export ARCH=x86
export TARGET_PRODUCT=android_x86
export TARGET_KERNEL_CONFIG=/work/config/.config
make clean (optional, first time)
make kernel -j16 CC="distcc gcc" CXX="distcc g++" (if using distcc on
a populated network)
make kernel -j4 (if not using distcc, very slow)
14. Now copy the compiled kernel, which of course will have compiled
FROM: /work/source/out/target/product/x86/kernel
TO: any chosen destination.
15. To deal with the issue of a system that the default Android-x86
a. Install Android-x86 on any convenient device that the installer
does recognize, like a USB stick.
b. Create a suitable partition on the target drive.
c. Copy the working installation from the source USB stick into the
newly created partition.
d. Overwrite the default kernel (located by default at
(device)/android-4.4-RC1/kernel) with the modified kernel compiled above.
16. To get grub2 to recognize and list the new partition in its menus,
#!/bin/sh
echo "$0: Android-4.4-RC1 (on /dev/sda4)" >&2
exec tail -n +4 $0
menuentry "Android android-4.4-RC1 Normal (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}
menuentry "Android android-4.4-RC1 Debug (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel pnp.debug=1 root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DEBUG=1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}
17. Change the above references to "/dev/sda4" and "hd0,4" to the actual
target partition on your system, examples: /dev/sda1 = hd0,1 , /dev/sdb3 =
hd1,3
18. Change the above resolution (1280x1024) to your desired resolution. I
have one laptop that supports Android-x86 at 1920x1080.
19. Copy the file 45_android into /etc/grub.d and make it executable.
20. Then, as root: update-grub
At this point you should be able to reboot into the modified Android-x86
on a desktop or laptop.
I hope this clears up the confusion surrounding the issue of custom kernel
configurations.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
michael colvin
2014-04-14 20:05:32 UTC
Permalink
Thanks for the info.
Got it to build and now it works on my target machine.
Just had a question though. On the line "make -C kernel
O=/work/config/.config xconfig" I had to leave off the ".config". to make a
new one.
Also when I set the "export TARGET_KERNEL_CONFIG=/work/config/.config" it
ended up looking for the kernel in
"/home/michael/work/android-x86/kernel/arch/x86/configs/work/config/.config".
So I just renamed the .config to mikeconfig and added it to configs
directory.
Did I do something wrong so that it appended the directory instead of being
a absolute path?
Post by Paul Lutus
A number of posts have reported failure or difficulties in recompiling a
kernel with a modified configuration, and the available documentation is
pretty terrible. So here's a basic guide to editing the default
configuration and recompiling. Some of the instructions assume a
Ubuntu/Kubuntu environment.
I came to this because I couldn't get Android-x86 to boot on a desktop
machine with the available kernel as configured. I knew I had to add some
SATA drivers to the existing configuration. I tried reading
http://www.android-x86.org/documents/customizekernel, unfortunately it
couldn't be more confusingly written if someone had set out to be as
confusing as possible to win a contest.
So, with the aim of allowing custom kernel configurations, here are the
http://www.android-x86.org/getsourcecode . BTW it is huge, 12.8 gigabytes
at the time of writing.
2. Put the source in a directory, let's call it "source", that is a
subdirectory of a work directory, call that "work". So we have /work/source
(use your own preferred names).
3. Create directory /work/config that will be used to contain the custom
configuration, which must be segregated from the build tree and which you
will want to retain if it's successful.
4. Now make a copy of the default Android-x86 configuration into your
FROM: /work/source/kernel/arch/x86/configs/android-x86_defconfig
TO: /work/config/.config
5. Remember this is a Ubuntu/Kubuntu example. To perform the configuration
below in the least painful way, you will probably need to install some
python-lunch
libqt4-core
libqt4-gui
qt4-default
gcc-multilib
distcc
ccache
# apt-get -y install python-lunch libqt4-core libqt4-gui qt4-default
gcc-multilib distcc ccache
7. If you want the compilation to finish in any finite amount of time, set
up distcc on every computer you can get your hands on and get networked --
separate topic, not covered here.
8. Now for the important part -- remember that we want to configure and
compile a custom kernel, not a complete Android system, but we need the
complete Android environment for this to be possible.
. build/envsetup.sh
export ARCH=x86
lunch android_x86-eng
make -C kernel O=/work/config/.config xconfig
10. The final command in the above list will launch a graphical
https://i.imgur.com/8ROkrEy.png .
11. Make any changes you require, remembering there are some settings
essential to using the kernel with Android. In my case, I needed to add
some statically linked SATA drivers to support a desktop environment.
12. Save your changes and close the dialog.
export ARCH=x86
export TARGET_PRODUCT=android_x86
export TARGET_KERNEL_CONFIG=/work/config/.config
make clean (optional, first time)
make kernel -j16 CC="distcc gcc" CXX="distcc g++" (if using distcc on
a populated network)
make kernel -j4 (if not using distcc, very slow)
14. Now copy the compiled kernel, which of course will have compiled
FROM: /work/source/out/target/product/x86/kernel
TO: any chosen destination.
15. To deal with the issue of a system that the default Android-x86
a. Install Android-x86 on any convenient device that the installer
does recognize, like a USB stick.
b. Create a suitable partition on the target drive.
c. Copy the working installation from the source USB stick into the
newly created partition.
d. Overwrite the default kernel (located by default at
(device)/android-4.4-RC1/kernel) with the modified kernel compiled above.
16. To get grub2 to recognize and list the new partition in its menus,
#!/bin/sh
echo "$0: Android-4.4-RC1 (on /dev/sda4)" >&2
exec tail -n +4 $0
menuentry "Android android-4.4-RC1 Normal (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}
menuentry "Android android-4.4-RC1 Debug (on /dev/sda4)" {
set root=(hd0,4)
linux /android-4.4-RC1/kernel pnp.debug=1 root=/dev/ram0
androidboot.hardware=android_x86 acpi_sleep=s3_bios,s3_mode
SRC=/android-4.4-RC1 DEBUG=1 DPI=160 UVESA_MODE=1280x1024
initrd /android-4.4-RC1/initrd.img
}
17. Change the above references to "/dev/sda4" and "hd0,4" to the actual
target partition on your system, examples: /dev/sda1 = hd0,1 , /dev/sdb3 =
hd1,3
18. Change the above resolution (1280x1024) to your desired resolution. I
have one laptop that supports Android-x86 at 1920x1080.
19. Copy the file 45_android into /etc/grub.d and make it executable.
20. Then, as root: update-grub
At this point you should be able to reboot into the modified Android-x86
on a desktop or laptop.
I hope this clears up the confusion surrounding the issue of custom kernel
configurations.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Mauro Rossi
2014-05-03 09:49:11 UTC
Permalink
Hi Paul,

could you be so kind to provide the kernel you compiled?
I would like to try installing Android-x86 on a SATA HDD

Thanks
zoe vas
2014-05-06 11:57:59 UTC
Permalink
Hello,
I made an hierarchy of files as you mentioned .
I do

$ . build/envsetup.sh
$ export ARCH=x86
$ lunch android_x86-eng

$ make -C kernel O=/home/zoi/work/config/.config xconfig

But i get the following error Makefile:121: *** output directory
"/home/zoi/android-x86/config/.config" does not exist.
I checked the path many times and it is right.
Do you have any tip?

Thanks in advance,
Zoi Vasiliou
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Mauro Rossi
2014-05-16 11:45:03 UTC
Permalink
Hi, I have the same problem in Ubuntu 14.04; is the commando syntax correct or there is some space needed somewhere?
Mauro Rossi
2014-07-20 13:13:28 UTC
Permalink
Hi,

for people who may be interested,

the easiest way to modify kernel config after a stock kernel build is to
follow CHih-Wei instructions "custom kernel" and using xconfig as per Paul
suggestion.

When you'll have built the stock 3.10.40 kernel, you'll have .config file
in $OUT/obj/kernel folder, you can launch:

. build/envsetup.sh
export ARCH=x86
lunch android_x86-eng
make -C kernel O=$OUT/obj/kernel ARCH=x86 xconfig

[i.e. there is no need to specify the .config file, it is the default
filename for kernel config]

[now you can modify kernel config, for example I removed nvidia, riva,
radeon frame buffer modules due to incompatibility with nouveau drm and
radeon drm, then saved ]

cp $OUT/obj/kernel/.config [kitkat-x86]kernel/arch/x86/configs/my_defconfig


at this point, delete iso and kernel from $OUT directory and you can build
by simply issuing this command:

make iso_img TARGET_PRODUCT=android_x86 TARGET_KERNEL_CONFIG=my_defconfig

Thanks to Chih-Wei and Paul

Mauro
Post by Mauro Rossi
Hi, I have the same problem in Ubuntu 14.04; is the commando syntax
correct or there is some space needed somewhere?
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Mauro Rossi
2014-05-16 11:45:15 UTC
Permalink
Hi, I have the same problem in Ubuntu 14.04; is the commando syntax correct or there is some space needed somewhere?
Mauro Rossi
2014-05-16 11:45:20 UTC
Permalink
Hi, I have the same problem in Ubuntu 14.04; is the commando syntax correct or there is some space needed somewhere?
Mauro Rossi
2014-05-16 11:45:25 UTC
Permalink
Hi, I have the same problem in Ubuntu 14.04; is the commando syntax correct or there is some space needed somewhere?
Continue reading on narkive:
Loading...