WearOS custom system.img porting on emulator round or square

258 views
Skip to first unread message

Imam Mohammad Bokhary

unread,
Jan 30, 2020, 11:24:42 AM1/30/20
to android-porting
Android Studio Version: 3.5.3

Emulator Version (Emulator--> Extended Controls--> Emulator Version): 29.3.4-6110076
HAXM / KVM Version: KVM - v12

Android SDK Tools: 26.1.1

Host Operating System: Linux 4.15.0-74-generic #83~16.04.1-Ubuntu x86_64 x86_64 x86_64 GNU/Linux

CPU Manufacturer: [Intel / AMD / Other] Intel® Core™ i7-7820X CPU @ 3.60GHz × 16

Steps to Reproduce Problem:
1. I downloaded android-9.0.0_r43 to port 'system.img' on emulator
2. After making images when I run the below command it's launch android emulator rather than wearos round or square avd configured emulator
emulator -verbose -show-kernel

3. It's not a big deal the skin design is but the images I built only 'system-qemu.img' is ported.
4. Even I tried with below command:
emulator -verbose -show-kernel -shell -system ./system.img

but not reflect the WearOS emulator.

5. When I run below command:
emulator -avd Wear_OS_Round_API_28_2 -verbose -show-kernel -shell -system ./system.img

it shows:
qemu: linux kernel too old to load a ram disk

Can anybody give me proper way to launch custom system.img to WearOS emulator?
Which configuration will I need to changed?


system_image_porting_crashed.log

Martin Brabham

unread,
Jan 30, 2020, 5:02:40 PM1/30/20
to imbok...@gmail.com, android-porting
Looks like an architecture problem.  Are you sure you have the correct system.img?  (e.g. x86 vs x86_64)


--
--
unsubscribe: android-porti...@googlegroups.com
website: http://groups.google.com/group/android-porting

---
You received this message because you are subscribed to the Google Groups "android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-porti...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/c0fa0cb3-f256-46c6-b646-2e21dda7300b%40googlegroups.com.


--


  •  Martin Brabham

  •  Software Engineer
  •  Android Bluetooth
  •  352.327.8280


Imam Mohammad Bokhary

unread,
Feb 3, 2020, 10:37:03 AM2/3/20
to android-porting
Correction: I make images for android-wear-9.0.0_r11(aosp_x86-eng)
and changes in config.ini
image.sysdir.1=/media/imam/Study/Projects/Android/WearOS/wearos/out/target/product/generic_x86/

then run below command:

emulator

emulator: argv[24] = "if=none,index=0,id=system,file=/media/imam/Study/Projects/Android/WearOS/wearos/out/target/product/generic_x86/system-qemu.img,read-only"

it's starting with android emulator rather than wearos emulator which uses system-qemu.img.

Now I run the command with below for system.img.

emulator -avd Wear_OS_Round_API_28_2 -verbose -show-kernel -shell -system /media/imam/Study/Projects/Android/WearOS/wearos/out/target/product/generic_x86/system.img

It's getting Kernel panic.

1.416855] Call Trace:
[    1.417125]  [<ffffffff9ff296bc>] dump_stack+0x61/0x7e
[    1.417681]  [<ffffffff9ff284de>] panic+0xd0/0x1ec
[    1.418222]  [<ffffffffa05554e1>] mount_block_root+0x28d/0x29c
[    1.418849]  [<ffffffffa055569d>] mount_root+0x67/0x6a
[    1.419405]  [<ffffffffa0555811>] prepare_namespace+0x171/0x19d
[    1.420064]  [<ffffffffa0555175>] kernel_init_freeable+0x18a/0x19f
[    1.420159]  [<ffffffff9ff2c5bd>] ? rest_init+0x82/0x82
[    1.420159]  [<ffffffff9ff2c5c6>] kernel_init+0x9/0xee
[    1.420159]  [<ffffffff9ff31835>] ret_from_fork+0x55/0x80
[    1.420159]  [<ffffffff9ff2c5bd>] ? rest_init+0x82/0x82
[    1.420159] Kernel Offset: 0x1f600000 from 0xffffffff80200000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[    1.420159] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,1)




So, anybody lead me to port system.img on WearOS emulator?

Imam Mohammad Bokhary

unread,
Feb 5, 2020, 12:09:30 PM2/5/20
to android-porting
Finaly I found the way to port the custom images to emulator with the below command:

lunch sdk_x86

make
-j8 sdk sdk_repo

then I configure avd config.ini file created with avdmanager for WearOS Square.

image.sysdir.1=/media/imam/Study/Projects/Android/WearOS/wearos/out/host/linux-x86/sdk/sdk_x86/android-sdk_eng.imam_linux-x86/system-images/android-9/x86

then run below command:

emulator -avd Wear_OS_Square_API_28 -verbose -show-kernel

1. It uses custom system.img and all other images. But it's booting the Vanilla Android rather than WearOS.
I uses core_tiny.mk rather than core.mk.
I found in sdk_x86.mk there is a call for sdk_phone_x86.mk

$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_phone_x86.mk)

So, I need to know which thing I need to configure for enable WearOS view?

2. I run the images on WearOS round AVD too, but the round circle is transparent(not showing anything). Check attachment.
How can be displayed it properly?


On Thursday, 30 January 2020 22:24:42 UTC+6, Imam Mohammad Bokhary wrote:
Screenshot from 2020-02-05 17-55-25.png

Imam Mohammad Bokhary

unread,
Feb 13, 2020, 6:20:26 PM2/13/20
to android-porting
After analyzing source code of android-wear-9.0.0_r11, I found system folder is identical and in framework there is no source code for watchface and wearos notification.
And even what I need to port is config file sdk_gwear_x86.mk is not available in build directory.

From Wikipedia I found: WearOS -> Open source with closed source components.
So, it's very clear to me now, WearOS source code is not opensource.

My question is: Why android-wear-9.0.0_r11 tag is open for public? Which is very much confusing.

If I'm wrong, then please let me know the current plan about WearOS.

Thanks.

On Thursday, 30 January 2020 22:24:42 UTC+6, Imam Mohammad Bokhary wrote:
Reply all
Reply to author
Forward
0 new messages