Downloading Android kernel for emulator

964 views
Skip to first unread message

Ninja Turtle

unread,
Apr 13, 2012, 4:36:38 AM4/13/12
to android...@googlegroups.com

Hi,

I am trying to download the kernel sources of android for emulator so that I can run iptables nat commands and play around.

I got the android 4.1 sources and compiled them. Now I am trying to download the kernel using: git clone git://android.git.kernel.org/kernel/common.git kernel

It returns the following error:

Initialized empty Git repository in /home/mydir/WORKING_DIRECTORY/kernel/.git/ android.git.kernel.org[0: 149.20.4.77]: errno=Connection refused fatal: unable to connect a socket (Connection refused)

Any idea?

I had downloaded the repo script to download the android sources, so then I tried adding

in manifest.xml under .repo and then I did:

repo sync

However, this again resulted in the same error as above.

Please help

mike digioia

unread,
Apr 13, 2012, 9:12:55 AM4/13/12
to android...@googlegroups.com
looks like your ip is being rejected for some reason. did you setup ssh?


patrick Immling

unread,
Apr 13, 2012, 10:55:36 AM4/13/12
to android...@googlegroups.com
Hi,

I finally downloaded from 
git clone http://android.googlesource.com/kernel/common.git

and got the sources

mark gross

unread,
Apr 13, 2012, 11:17:51 AM4/13/12
to android...@googlegroups.com

FWIW I don't hink the emulator kernel is in the common.git project.


aosp    https://android.googlesource.com/kernel/goldfish (fetch)  <-- I think its in here. and is the android-goldfish-2.6.29 branch.

<5>Linux version 2.6.29-g46b05b2 (vchtch...@vc-irv.irv.corp.google.com) (gcc version 4.4.3 (GCC) ) #28 Thu Nov 17 06:39:36 PST 2011

  android-goldfish-2.6.29 ef9c64a x86: vbox_defconfig: enable CONFIG_INPUT_MOUSE

--mark
create interesting things.

Ninja Turtle

unread,
Apr 13, 2012, 11:33:00 AM4/13/12
to android...@googlegroups.com
@Patrick: So, should I change the URL?

@mark: Can you please clarify the procedure?
And has anyone tried to run iptables on emulator?

mark gross

unread,
Apr 13, 2012, 11:40:47 AM4/13/12
to android...@googlegroups.com
????

git clone https://android.googlesource.com/kernel/goldfish
git checkout android-goldfish-2.6.29

um.. profit !?

BTW You may want to use the emulator to get the config file off the emulator to use as a starting point.

'adb pull /proc/config.gz .'
'gunzip config.gz'

--mark

Ninja Turtle

unread,
Apr 13, 2012, 12:23:27 PM4/13/12
to android...@googlegroups.com
Thanks Mark.

I successfully compiled the Goldfish kernel.
However I get a black screen when I start the emulator with:

emulator -kernel <path to zImage> -verbose

I also tried :

emulator  -partition-size 1024 -wipe-data -kernel <path to zImage> -verbose

but with little success.

Any idea?

mark gross

unread,
Apr 13, 2012, 12:56:19 PM4/13/12
to android...@googlegroups.com
no ideas. 

I'd start with dmesg and logcat from a console.

--makr

William W.-Y. Liang

unread,
Apr 13, 2012, 7:59:45 PM4/13/12
to android...@googlegroups.com

Hi, you have to specify the target images. One simple way is to set the environment variable ANDROID_TARGET_OUT to <mydroid>/out/target/product/generic/ before launching the emulator.

BRs,
William W.-Y. Liang
http://www.ntut.edu.tw/~wyliang
--- this mail was sent from my phone ---

Peter Teoh

unread,
Apr 13, 2012, 8:41:37 PM4/13/12
to android...@googlegroups.com
how about completely overwriting the original emulator's kernel image (with your new image), then start the emulator up via the normal way (which will comes with all the default input parameters)?
Regards,
Peter Teoh

Ninja Turtle

unread,
Apr 16, 2012, 3:35:04 AM4/16/12
to android...@googlegroups.com
Here is what I get when I start the emulator with 'verbose' option:

emulator -kernel msm-kernel/arch/arm/boot/zImage -verbose

emulator: found Android build root: /home/myhome/WORKING_DIRECTORY
emulator: found Android build out:  /home/myhome/WORKING_DIRECTORY/out/target/product/generic
emulator: Found target ABI=armeabi-v7a, architecture=arm
emulator: Found target API level: 14
emulator: using core hw config path: /home/myhome/WORKING_DIRECTORY/out/target/product/generic/hardware-qemu.ini
emulator: found skin-specific hardware.ini: /home/myhome/WORKING_DIRECTORY/development/tools/emulator/skins/HVGA/hardware.ini
emulator: autoconfig: -skin HVGA
emulator: autoconfig: -skindir /home/myhome/WORKING_DIRECTORY/development/tools/emulator/skins
emulator: keyset loaded from: /home/myhome/.android/default.keyset
emulator: trying to load skin file '/home/myhome/WORKING_DIRECTORY/development/tools/emulator/skins/HVGA/layout'
emulator: skin network speed: 'full'
emulator: skin network delay: 'none'
emulator: autoconfig: -ramdisk /home/myhome/WORKING_DIRECTORY/out/target/product/generic/ramdisk.img
emulator: autoconfig: -sysdir /home/myhome/WORKING_DIRECTORY/out/target/product/generic
emulator: Using initial system image: /home/myhome/WORKING_DIRECTORY/out/target/product/generic/system.img
emulator: WARNING: system partition size adjusted to match image file (163 MB > 66 MB)

emulator: autoconfig: -data /home/myhome/WORKING_DIRECTORY/out/target/product/generic/userdata-qemu.img
emulator: autoconfig: -initdata /home/myhome/WORKING_DIRECTORY/out/target/product/generic/userdata.img
emulator: Physical RAM size: 256MB

emulator: Found target ABI=armeabi-v7a
emulator: Auto-config: -qemu -cpu cortex-a8
Content of hardware configuration file:
  hw.cpu.arch = arm
  hw.cpu.model = cortex-a8
  hw.ramSize = 256
  hw.touchScreen = yes
  hw.mainKeys = yes
  hw.trackBall = yes
  hw.keyboard = yes
  hw.keyboard.lid = no
  hw.keyboard.charmap = qwerty2
  hw.dPad = yes
  hw.gsmModem = yes
  hw.camera = no
  hw.camera.maxHorizontalPixels = 640
  hw.camera.maxVerticalPixels = 480
  hw.gps = yes
  hw.battery = yes
  hw.accelerometer = yes
  hw.audioInput = yes
  hw.audioOutput = yes
  hw.sdCard = yes
  hw.sdCard.path =
  disk.cachePartition = yes
  disk.cachePartition.path =
  disk.cachePartition.size = 66m
  hw.lcd.width = 320
  hw.lcd.height = 480
  hw.lcd.depth = 16
  hw.lcd.density = 160
  hw.lcd.backlight = yes
  hw.gpu.enabled = no
  hw.fakeCamera = back
  hw.webcam.count = 6
  hw.webcam.0.name = webcam0
  hw.webcam.1.name = webcam1
  hw.webcam.2.name = webcam2
  hw.webcam.3.name = webcam3
  hw.webcam.4.name = webcam4
  hw.webcam.5.name = webcam5
  hw.webcam.0.direction = front
  hw.webcam.1.direction = back
  hw.webcam.2.direction = front
  hw.webcam.3.direction = front
  hw.webcam.4.direction = front
  hw.webcam.5.direction = front
  vm.heapSize = 48
  hw.sensors.proximity = yes
  kernel.path = msm-kernel/arch/arm/boot/zImage
  kernel.parameters =  android.checkjni=1
  disk.ramdisk.path = /home/myhome/WORKING_DIRECTORY/out/target/product/generic/ramdisk.img
  disk.systemPartition.initPath = /home/myhome/WORKING_DIRECTORY/out/target/product/generic/system.img
  disk.systemPartition.size = 163m
  disk.dataPartition.path = /home/myhome/WORKING_DIRECTORY/out/target/product/generic/userdata-qemu.img
  disk.dataPartition.size = 66m
  disk.snapStorage.path =
  avd.name = <build>
.
QEMU options list:
emulator: argv[00] = "/home/myhome/WORKING_DIRECTORY/out/host/linux-x86/bin/emulator-arm"
emulator: argv[01] = "-android-hw"
emulator: argv[02] = "/home/myhome/WORKING_DIRECTORY/out/target/product/generic/hardware-qemu.ini"
Concatenated QEMU options:
 /home/myhome/WORKING_DIRECTORY/out/host/linux-x86/bin/emulator-arm -android-hw /home/myhome/WORKING_DIRECTORY/out/target/product/generic/hardware-qemu.ini
emulator: registered 'boot-properties' qemud service
emulator: nand_add_dev: system,size=0xa300000,initfile=/home/myhome/WORKING_DIRECTORY/out/target/product/generic/system.img
emulator: mapping 'system' NAND image to /tmp/android-myhome/emulator-SfsG1g
emulator: rounding devsize up to a full eraseunit, now a311000

emulator: nand_add_dev: userdata,size=0x4200000,file=/home/myhome/WORKING_DIRECTORY/out/target/product/generic/userdata-qemu.img
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'dalvik.vm.heapsize' = '48m'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '160'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '1'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'back'
emulator: nand_add_dev: cache,size=0x4200000
emulator: mapping 'cache' NAND image to /tmp/android-myhome/emulator-2d0w7I
emulator: Kernel parameters: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=2
emulator: Trace file name is not set

emulator: autoconfig: -scale 1
emulator: can't connect to ADB server: Connection refused
emulator: ping program: /home/myhome/WORKING_DIRECTORY/out/host/linux-x86/bin/ddms
emulator: ping command: /home/myhome/WORKING_DIRECTORY/out/host/linux-x86/bin/ddms ping emulator 14.0


@Peter: Do you mean I replace the 'prebuilt' image with the zImage of the newly compiled kernel?

Ninja Turtle

unread,
Apr 16, 2012, 5:15:30 AM4/16/12
to android...@googlegroups.com
And oh, btw my system is a 32-bit Ubuntu 10.10.

Seems like a lot of people have this problem.

I just checked : http://groups.google.com/group/android-building/browse_thread/thread/1c7210375234571e?pli=1

However nothing concrete about the solution is discussed for the 32-bit :(

Ninja Turtle

unread,
Apr 17, 2012, 5:00:25 AM4/17/12
to android...@googlegroups.com
Is there no systematic procedure to enable net filter support and get iptables running on Android?

Request someone to please help. There is really no documentation on this- atleast I didn't come across anything other than

http://randomizedsort.blogspot.de/2011/03/porting-iptables-1410-to-android.html

And honestly, this seems an old post and I have all the latest android sources and kernel and even tried downgrading the existing 1.4.11iptables package to 1.4.10 as mentioned here. But the compilation throws several error which aren't easy to debug.

Really appreciate your help here.

Ninja Turtle

unread,
Apr 18, 2012, 11:08:19 AM4/18/12
to android...@googlegroups.com
Well, my CPU doesn't support Ubuntu for 64 bit CPU.

So is there no way to get Android running on an emulator with iptables and trying them on the adb shell?
Reply all
Reply to author
Forward
0 new messages