← Back to team overview

ubuntu-phone team mailing list archive

Ubuntu Touch on the emulator: current bugs & request for help

 

I've pushed a couple of patches to phablet-saucy & fix up repositories
such that it should be possible to compile the full target (the one
for emulation) and it does produce images that can be used with the
emulator.

The tree is not building the emulator itself at the moment, so I use
the one from the AOSP project build.

1) In phablet-saucy:
$ . ./build/envsetup.sh
$ lunch full-eng
$ make -j12

[1] This will use linux-goldfish kernel from the ubuntu archive which
needs some config changes, see
https://bugs.launchpad.net/ubuntu/+source/linux-goldfish/+bug/1222772

[2] At the time of writting linux-meta-goldfish was out of date, so I
locally patched the kernel make target to copy/unpack my deb from
~/Downloads/

[3] You may need to build using gcc-4.7, due to GL build-failures,
I've pushed one patch to resolve that, not sure if there are more
needed.

# This should give you: userdata-qemu.img system.img cache.img
system.img in the out/target/product/generic/

2) In AOSP, so similar to build the emulator
$ . ./build/envsetup.sh

    $ lunch full-eng
or
    $ lunch aosp_arm-eng

(depending on which AOSP checkout is used)

$ make -j12

This should give you the emulator binaries in out/host/linux-x86/bin/

Launch stock AOSP emulator to make sure that is works:
$ emulator

--------

[4] If emulator is failing with ubuntu android, you may need to apply
attached patch against external/qemu
[5] Also note that it seems like goldfish builds in the archive lack
yaffs2 support

---------

Combining our build and AOSP emulator:
./aosp/out/host/linux-x86/bin/emulator -system
./out/target/product/generic/system.img -ramdisk
./out/target/product/generic/ramdisk.img -data
./out/target/product/generic/userdata-qemu.img -kernel
../aosp/prebuilts/qemu-kernel/arm/kernel-qemu-armv7 -memory 2048
-sysdir / -qemu -show-kernel

Replace paths to emulator and/or kernels as appropriate and to
whichever you want to use (above uses self-compiled emulator &
precompiled stock AOSP kernel)

At this point initramfs fails to find and mount userdata partition.
(Well initramfs-tools-ubuntu-touch's script "touch"). On android
emulator the partitions are mounted as following:
/dev/block/mtdblock0 /system yaffs2 ro,seclabel,relatime 0 0
/dev/block/mtdblock1 /data yaffs2 rw,seclabel,nosuid,nodev,relatime 0 0
/dev/block/mtdblock2 /cache yaffs2 rw,seclabel,nosuid,nodev,relatime 0 0

Specifying
-qemu -append "systempart=/dev/block/mtdblock0 datapart=/dev/block/mtdblock1"

To pass systempart= and datapart= kernel boot parameters doesn't help,
as then initramfs is reporting that no such devices exist =/

Also it fails to spawn adbd nor provide interactive console to debug initramfs.

----------

How to help:

1) figure out why adbd is failing to spawn from ubuntu-touch initramfs
under the emulator. With adbd available it would be easier to debug
the rest of the problems.

2) figure out why partitions are failing to mount and/or how they are
suppose to be mounted under the emulator.

3) otherwise point-out where am I going wrong.


Regards,

Dmitrijs.

Attachment: external_qemu.patch
Description: Binary data


Follow ups