[android-building] Which QEMU/KVM command line would run mini_emulator (or other) builds ?
Hello everybody, Does anybody here know the correct KVM command to run one of the following builds (few lines below) ? I'm really stuck and I definitely need some help - also I'm pretty sure that it's just a matter of typing a command with the correct parameters into "append" (kernel parameters) and others things. But I didn't find the good ones. I'm struggling to run Android with QEMU/KVM, which is a little bit different compared to the official "emulator" command. I'm doing this, because I'm trying to learn how to run Android on generic/upstream kernel supported platforms (like Intel based laptop, or just QEMU/KVM). I've tried a lot of the available standard "lunch" choices from android-9.0.0_r35 branch, but it seems that only aosp_-eng are running out of the box with the emulator, but not with KVM/QEMU. I also captured what are the "QEMU" parameters used by the Emulator but lot of them aren't recognized by the standard QEMU/KVM version, and so it doesn't work. mini_emulator doesn't work with "emulator" but seems to go further than the others once started in KVM (but it freezes really quickly) - aosp_arm-eng - aosp_arm64-eng - aosp_mips-eng - aosp_mips64-eng - aosp_x86-eng - aosp_x86_64-eng - aosp_car_arm-userdebug - aosp_car_arm64-userdebug - aosp_car_x86-userdebug - aosp_car_x86_64-userdebug - mini_emulator_arm64-userdebug - m_e_arm-userdebug - m_e_mips64-eng - m_e_mips-userdebug - mini_emulator_x86_64-userdebug - mini_emulator_x86-userdebug - uml-userdebug - aosp_crosshatch-userdebug - aosp_blueline-userdebug - aosp_cf_x86_auto-userdebug - aosp_cf_x86_phone-userdebug - aosp_cf_x86_tablet-userdebug - aosp_cf_x86_tablet_3g-userdebug - aosp_cf_x86_tv-userdebug - aosp_cf_x86_wear-userdebug - aosp_cf_x86_64_auto-userdebug - aosp_cf_x86_64_phone-userdebug - aosp_cf_x86_64_tablet-userdebug - aosp_cf_x86_64_tablet_3g-userdebug - aosp_cf_x86_64_tv-userdebug - aosp_cf_x86_64_wear-userdebug - cf_x86_auto-userdebug - cf_x86_phone-userdebug - cf_x86_tablet-userdebug - cf_x86_tablet_3g-userdebug - cf_x86_tv-userdebug - cf_x86_wear-userdebug - cf_x86_64_phone-userdebug - cf_x86_64_tablet-userdebug - cf_x86_64_tablet_3g-userdebug - cf_x86_64_tv-userdebug - cf_x86_64_wear-userdebug - aosp_marlin-userdebug - aosp_marlin_svelte-userdebug - aosp_sailfish-userdebug - aosp_walleye-userdebug - aosp_walleye_test-userdebug - aosp_taimen-userdebug - hikey-userdebug - hikey64_only-userdebug - hikey960-userdebug Thank you in advance Julien ROBIN -- -- You received this message because you are subscribed to the "Android Building" mailing list. To post to this group, send email to android-building@googlegroups.com To unsubscribe from this group, send email to android-building+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-building?hl=en --- You received this message because you are subscribed to the Google Groups "Android Building" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-building] Re: android-9.0.0_r34 / aosp_x86_64-eng builds missing files, like /sepolicy - can't boot
While re-playing with official emulator - and taking a look at Android 10 by the way ;) I noticed that the ramdisk.img of the emulator does't contain /sepolicy file, and it looks like Emulator still succeeds to get it booting : so the missing files that makes QEMU-KVM to fail is not really missing, it can be avoided and work fine ? It tends to indicates that the standard generic build android-9.0.0_r34 / aosp_x86_64-eng is probably fine and can be booted in some way. But how... By running the emulator by command line, and adding a magic parameter, I got information about the way the Kernel and the others things are loaded by the emulator *./emulator -avd Eve_API_Q -show-kernel* For example : [0.00] Kernel command line: nopti qemu=1 no_timer_check androidboot. hardware=ranchu androidboot.serialno=EMULATOR28X0X23X0 clocksource=pit no-kvmclock console=ttyS0,38400 android.qemud=1 android.checkjni=1 qemu.gles=1 qemu. encrypt=1 qemu.opengles.version=131072 cma=288M@0-4G qemu.wifi=1 mac80211_hwsim.channels=2 androidboot.android_dt_dir=/proc/device-tree/ firmware/android/ skip_initramfs rootwait ro init=/init loop.max_part=7 dm="1 vroot none ro 1,0 5156696 verity 1 PARTUUID=1F043BE6-7A8C-43B6-8531-70B6C93CBBDC PARTUUID=1F043BE6-7A8C-43B6-8531-70B6C93CBBDC 4096 4096 644587 644587 sha1 926f02610018cd908ac13bfe96c403b304344292 02da5c0c5c30a948ae740375556f4bf37fc8a052 1 ignore_zero_blocks" androidboot.veritymode=enforcing androidboot.verifiedbootstate=orange root=/ dev/dm-0 ramoops.mem_address=0xff018000 ramoops.mem_size=0x1 memmap= 0x1$0xff018000 qemu.dalvik.vm.heapsize=384m mac80211_hwsim.mac_prefix= 5554 But it's really tough. I'll continue to check all that I can, but if some of you know how to do, or already done a "standard generic Android build" that works fine on standard supported hardware, and know what is mandatory to get it starting fine, you're welcome ! Le lundi 18 mars 2019 15:28:34 UTC+1, julien@gmail.com a écrit : > > Hi everybody, > > I'm on this subject for some times now, and I'm stuck. I'll first really > simply describe what I did, and "how" it doesn't work. > > *Building the most "generic" or "mainline" Android as possible > (android-9.0.0_r34 / aosp_x86_64-eng) :* > >- PATH=~/bin:$PATH >- repo init -u https://android.googlesource.com/platform/manifest -b >android-9.0.0_r34 >- repo sync >- source build/envsetup.sh >- lunch aosp_x86_64-eng >- make -j 8 > > *Running it on QEMU-KVM* > > I'm using the Kernel delivered inside the "out" folder, which is 4.4. I > successfully booted Debian with it on KVM (even if I just had command line > instead of graphic display, probably because of Xorg drivers of Debian). > It's able to see /dev/vdX disks but cannot see /dev/sdX disks. It has some > importance for the KVM parameters about disk mounting (drives parameters > are little bit longer) > > > > > *kvm -m 2048 -smp 4 * > > *-vga std * > > > > > > > > *-kernel kernel-ranchu -append "console=ttyS0 debug drm.debug=0x0 > androidboot.selinux=permissive androidboot.hardware=ranchu" -serial > mon:stdio -initrd ramdisk.img -drive > format=raw,index=0,if=none,id=system,file=system.img -device > virtio-blk-pci,drive=system -drive > format=raw,index=1,if=none,id=userdata,file=userdata.img -device > virtio-blk-pci,drive=userdata -drive > format=raw,index=2,if=none,id=cache,file=cache.img -device > virtio-blk-pci,drive=cache -drive > format=raw,index=3,if=none,id=vendor,file=vendor.img -device > virtio-blk-pci,drive=vendor* > > (in reality it's a bg command line so it's easier to see when I split > it). > > It makes volumes available this way : > >1. system beeing /dev/vda >2. userdata beeing /dev/vdb >3. cache beeing /dev/vdc >4. vendor beeing /dev/vdd > > *It cannot boot fine :* > It stops at failing to load the "/sepolicy" file that we are usually able > to find at the root of the ramdisk.img : this file is missing and it stops. > With or without the 4 drives it makes no difference, since the file is > missing from ramdisk.img, so I guess "mounting" would happen later. > > [1.163969] init: init first stage started! > [1.164537] init: Using Android DT directory > /proc/device-tree/firmware/android/ > [1.165485] init: First stage mount skipped (missing/incompatible fstab > in device tree) > [1.166509] init: Skipped setting INIT_AVB_VERSION (not in recovery > mode) > *[1.167318] init: Loading SELinux policy* > [1.167824] selinux: SELinux: Could not open /sepolicy: No such file > or directory > [1.167824] > [1.168978] init: Failed to load monolithic SELinux policy: No such > file or directory > [1.169934] init: Unable to load SELinux policy > [1.170490] init: Reboot start, reason: reboot, rebootTarget: bootloader > [1.171292] init[1]: segfault at 14 ip 00565e30 sp > 7ffcfd4651e0 error 4 in init[4000
[android-building] android-9.0.0_r34 / aosp_x86_64-eng builds missing files, like /sepolicy - can't boot
Hi everybody, I'm on this subject for some times now, and I'm stuck. I'll first really simply describe what I did, and "how" it doesn't work. *Building the most "generic" or "mainline" Android as possible (android-9.0.0_r34 / aosp_x86_64-eng) :* - PATH=~/bin:$PATH - repo init -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r34 - repo sync - source build/envsetup.sh - lunch aosp_x86_64-eng - make -j 8 *Running it on QEMU-KVM* I'm using the Kernel delivered inside the "out" folder, which is 4.4. I successfully booted Debian with it on KVM (even if I just had command line instead of graphic display, probably because of Xorg drivers of Debian). It's able to see /dev/vdX disks but cannot see /dev/sdX disks. It has some importance for the KVM parameters about disk mounting (drives parameters are little bit longer) *kvm -m 2048 -smp 4 * *-vga std * *-kernel kernel-ranchu -append "console=ttyS0 debug drm.debug=0x0 androidboot.selinux=permissive androidboot.hardware=ranchu" -serial mon:stdio -initrd ramdisk.img -drive format=raw,index=0,if=none,id=system,file=system.img -device virtio-blk-pci,drive=system -drive format=raw,index=1,if=none,id=userdata,file=userdata.img -device virtio-blk-pci,drive=userdata -drive format=raw,index=2,if=none,id=cache,file=cache.img -device virtio-blk-pci,drive=cache -drive format=raw,index=3,if=none,id=vendor,file=vendor.img -device virtio-blk-pci,drive=vendor* (in reality it's a bg command line so it's easier to see when I split it). It makes volumes available this way : 1. system beeing /dev/vda 2. userdata beeing /dev/vdb 3. cache beeing /dev/vdc 4. vendor beeing /dev/vdd *It cannot boot fine :* It stops at failing to load the "/sepolicy" file that we are usually able to find at the root of the ramdisk.img : this file is missing and it stops. With or without the 4 drives it makes no difference, since the file is missing from ramdisk.img, so I guess "mounting" would happen later. [1.163969] init: init first stage started! [1.164537] init: Using Android DT directory /proc/device-tree/firmware/android/ [1.165485] init: First stage mount skipped (missing/incompatible fstab in device tree) [1.166509] init: Skipped setting INIT_AVB_VERSION (not in recovery mode) *[1.167318] init: Loading SELinux policy* [1.167824] selinux: SELinux: Could not open /sepolicy: No such file or directory [1.167824] [1.168978] init: Failed to load monolithic SELinux policy: No such file or directory [1.169934] init: Unable to load SELinux policy [1.170490] init: Reboot start, reason: reboot, rebootTarget: bootloader [1.171292] init[1]: segfault at 14 ip 00565e30 sp 7ffcfd4651e0 error 4 in init[40+22a000] [1.172452] init: Reboot ending, jumping to kernel [1.173023] Unregister pv shared memory for cpu 0 [1.173024] Unregister pv shared memory for cpu 2 [1.173043] Unregister pv shared memory for cpu 3 [1.174913] Unregister pv shared memory for cpu 1 [1.176075] reboot: Restarting system with command 'bootloader' [1.176804] reboot: machine restart *What I already tried :* - aosp_cf_x86_64_tablet-userdebug - img files and Kernel, same problem - aosp_cf_x86_64_tv-userdebug - img files and Kernel,same problem - android-4.19 kernel (x86_64_defconfig with support of /dev/sdX but not /dev/vdX) - works fine with Debian but no change when booting Android - android-4.19 kernel (x86_64_defconfig edited for adding support of /dev/vdX too) - works fine with Debian but no change when booting Android *Do you know what I'm missing ?* >From https://source.android.com/setup/build/building we can read the following : *AOSP cannot be used from pure source code only and requires additional hardware-related proprietary libraries to run, such as for hardware graphics acceleration. See the sections below for download links and Device binaries for additional resources.* My understanding is that of course, for a real world device, specific drivers should probably be added. But for KVM / QEMU too ? At "lunch" command, hikey and google devices builds are complete and including the missing files, without adding any command. Also, for Sony devices, some commands are added between repo init and repo sync : - cd .repo - git clone https://github.com/sonyxperiadev/local_manifests - cd local_manifests - git checkout android-9.0.0_r34 - cd ../.. Is something like that mandatory for running on a standard KVM ? Or laptop/device on which every driver is included into the mainline kernel ? If so, is this a Google/Android thing, or Linaro ? Or something completely custom and unofficial ? (and where to find it) Thank you in advance ! For now, I'm completely stuck ;) Julien ROBIN -- -- You received this message because you are subscribed to the "Android Building"