Android 14 build for Raspberry Pi4 (arpi-13) not booting up

345 views
Skip to first unread message

Mario Marietto

unread,
Sep 1, 2024, 12:55:28 PM9/1/24
to Android-rpi
Hello to everyone.

I'm trying to emulate Android 14 for raspberry pi 4 on my PC,where I have installed Ubuntu 24.04 X64 bit using QEMU emulator version 9.0.93 (v9.1.0-rc3). This is the script that I ran :


nano start-rpi4 :


qemu-system-aarch64 \

-smp 4 \

-m 2048 \

-cpu cortex-a72 \

-M virt \

-device virtio-gpu-pci,xres=1024,yres=768 \

-display sdl,gl=on \

-device usb-ehci \

-device usb-kbd \

-device virtio-tablet-pci \

-usb \

-serial stdio \

-kernel /mnt/zroot-133/_OS/Android/boot/Image \

-initrd /mnt/zroot-133/_OS/Android/rpi4/ramdisk.img \

-drive index=0,if=none,id=system,file=/mnt/zroot-133/_OS/Android/rpi4/system.img \

-device virtio-blk-pci,drive=system \

-drive index=1,if=none,id=vendor,file=/mnt/zroot-133/_OS/Android/rpi4/vendor.img \

-device virtio-blk-pci,drive=vendor \

-append "console=ttyAMA0,38400 drm.debug=0x0 rootwait rootdelay=5 root=/dev/mmcblk1p2 androidboot.hardware=rpi4 androidboot.selinux=permissive security=selinux selinux=1 androidboot.qemu.hw.mainkeys=0 androidboot.lcd.density=160"


This is what happens when I run it :


root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android# ./start-rpi4

WARNING: Image format was not specified for '/mnt/zroot-133/_OS/Android/rpi4/system.img' and probing guessed raw.

Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.

Specify the 'raw' format explicitly to remove the restrictions.

WARNING: Image format was not specified for '/mnt/zroot-133/_OS/Android/rpi4/vendor.img' and probing guessed raw.

Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.

Specify the 'raw' format explicitly to remove the restrictions.

[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]

[ 0.000000] Linux version 6.1.93-ge066a024bf41-v8 (build-user@build-host) (Android (10087095, +pgo, +bolt, +lto, -mlgo, based on r487747c) clang version 17.0.2 (https://android.googlesource.com/toolchain/llvm-project d9f89f4d16663d5012e5c09495f3b30ece3d2362), LLD 17.0.2) #1 SMP PREEMPT Tue Aug 13 15:50:22 UTC 2024

[ 0.000000] random: crng init done

[ 0.000000] Machine model: linux,dummy-virt

[ 0.000000] efi: UEFI not found.

[ 0.000000] Zone ranges:

[ 0.000000] DMA [mem 0x0000000040000000-0x00000000bfffffff]

[ 0.000000] DMA32 empty

[ 0.000000] Normal empty

[ 0.000000] Movable zone start for each node

[ 0.000000] Early memory node ranges

[ 0.000000] node 0: [mem 0x0000000040000000-0x00000000bfffffff]

[ 0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x00000000bfffffff]

[ 0.000000] cma: Reserved 8 MiB at 0x00000000bd000000

[ 0.000000] psci: probing for conduit method from DT.

[ 0.000000] psci: PSCIv1.1 detected in firmware.

[ 0.000000] psci: Using standard PSCI v0.2 function IDs

[ 0.000000] psci: Trusted OS migration not required

[ 0.000000] psci: SMC Calling Convention v1.0

[ 0.000000] percpu: Embedded 30 pages/cpu s84392 r8192 d30296 u122880

[ 0.000000] Detected PIPT I-cache on CPU0

[ 0.000000] CPU features: detected: Spectre-v2

[ 0.000000] CPU features: detected: Spectre-v3a

[ 0.000000] CPU features: detected: Spectre-v4

[ 0.000000] CPU features: detected: Spectre-BHB

[ 0.000000] CPU features: kernel page table isolation forced ON by KASLR

[ 0.000000] CPU features: detected: Kernel page table isolation (KPTI)

[ 0.000000] CPU features: detected: ARM erratum 1742098

[ 0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923

[ 0.000000] alternatives: applying boot alternatives

[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 516096

[ 0.000000] Kernel command line: console=ttyAMA0,38400 drm.debug=0x0 rootwait rootdelay=5 root=/dev/mmcblk1p2 androidboot.hardware=rpi4 androidboot.selinux=permissive security=selinux selinux=1 androidboot.qemu.hw.mainkeys=0 androidboot.lcd.density=160 androidboot.serialno=10000000abcd1234 androidboot.btmacaddr=11:22:33:44:55:66

[ 0.000000] Unknown kernel command line parameters "selinux=1", will be passed to user space.

[ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)

[ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)

[ 0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off

[ 0.000000] Memory: 2011756K/2097152K available (18624K kernel code, 2334K rwdata, 7452K rodata, 1984K init, 1475K bss, 77204K reserved, 8192K cma-reserved)

[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1

[ 0.000000] ftrace: allocating 53317 entries in 209 pages

[ 0.000000] ftrace: allocated 209 pages with 4 groups

[ 0.000000] trace event string verifier disabled

[ 0.000000] rcu: Preemptible hierarchical RCU implementation.

[ 0.000000] rcu: RCU event tracing is enabled.

[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.

[ 0.000000] Trampoline variant of Tasks RCU enabled.

[ 0.000000] Rude variant of Tasks RCU enabled.

[ 0.000000] Tracing variant of Tasks RCU enabled.

[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.

[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4

[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0

[ 0.000000] Root IRQ handler: gic_handle_irq

[ 0.000000] GICv2m: range[mem 0x08020000-0x08020fff], SPI[80:143]

[ 0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.

[ 0.000000] arch_timer: cp15 timer(s) running at 62.50MHz (virt).

[ 0.000000] clocksource: arch_sys_counter: mask: 0x1ffffffffffffff max_cycles: 0x1cd42e208c, max_idle_ns: 881590405314 ns

[ 0.000060] sched_clock: 57 bits at 63MHz, resolution 16ns, wraps every 4398046511096ns

[ 0.003700] kfence: initialized - using 2097152 bytes for 255 objects at 0x(____ptrval____)-0x(____ptrval____)

[ 0.009463] Calibrating delay loop (skipped), value calculated using timer frequency.. 125.00 BogoMIPS (lpj=250000)

[ 0.009635] pid_max: default: 32768 minimum: 301

[ 0.010547] LSM: Security Framework initializing

[ 0.011591] SELinux: Initializing.

[ 0.015122] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)

[ 0.015172] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear)

[ 0.029518] cgroup: Disabling memory control group subsystem

[ 0.046575] cacheinfo: Unable to detect cache hierarchy for CPU 0

[ 0.054358] cblist_init_generic: Setting adjustable number of callback queues.

[ 0.054380] cblist_init_generic: Setting shift to 2 and lim to 1.

[ 0.054699] cblist_init_generic: Setting adjustable number of callback queues.

[ 0.054709] cblist_init_generic: Setting shift to 2 and lim to 1.

[ 0.055148] cblist_init_generic: Setting adjustable number of callback queues.

[ 0.055157] cblist_init_generic: Setting shift to 2 and lim to 1.

[ 0.056330] rcu: Hierarchical SRCU implementation.

[ 0.056365] rcu: Max phase no-delay instances is 1000.

[ 0.061394] EFI services will not be available.

[ 0.062525] smp: Bringing up secondary CPUs ...

[ 0.066434] Detected PIPT I-cache on CPU1

[ 0.067022] cacheinfo: Unable to detect cache hierarchy for CPU 1

[ 0.067385] CPU1: Booted secondary processor 0x0000000001 [0x410fd083]

[ 0.071967] Detected PIPT I-cache on CPU2

[ 0.072124] cacheinfo: Unable to detect cache hierarchy for CPU 2

[ 0.072415] CPU2: Booted secondary processor 0x0000000002 [0x410fd083]

[ 0.075048] Detected PIPT I-cache on CPU3

[ 0.075204] cacheinfo: Unable to detect cache hierarchy for CPU 3

[ 0.075508] CPU3: Booted secondary processor 0x0000000003 [0x410fd083]

[ 0.075944] smp: Brought up 1 node, 4 CPUs

[ 0.076016] SMP: Total of 4 processors activated.

[ 0.076078] CPU features: detected: 32-bit EL0 Support

[ 0.076099] CPU features: detected: 32-bit EL1 Support

[ 0.076154] CPU features: detected: CRC32 instructions

[ 0.079520] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching

[ 0.079812] CPU: All CPU(s) started at EL1

[ 0.080042] alternatives: applying system-wide alternatives

[ 0.099500] devtmpfs: initialized

[ 0.109428] Enabled cp15_barrier support

[ 0.109689] Enabled setend support

[ 0.110798] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns

[ 0.110923] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)

[ 0.114209] pinctrl core: initialized pinctrl subsystem

[ 0.124106] DMI not present or invalid.

[ 0.130866] NET: Registered PF_NETLINK/PF_ROUTE protocol family

[ 0.141559] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations

[ 0.142062] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations

[ 0.142361] audit: initializing netlink subsys (disabled)

[ 0.144149] audit: type=2000 audit(0.132:1): state=initialized audit_enabled=0 res=1

[ 0.146893] thermal_sys: Registered thermal governor 'step_wise'

[ 0.147215] cpuidle: using governor menu

[ 0.148169] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.

[ 0.148926] ASID allocator initialised with 32768 entries

[ 0.149844] Serial: AMBA PL011 UART driver

[ 0.172949] 9000000.pl011: ttyAMA0 at MMIO 0x9000000 (irq = 13, base_baud = 0) is a PL011 rev1

[ 0.189080] printk: console [ttyAMA0] enabled

[ 0.199766] KASLR enabled

[ 0.279332] iommu: Default domain type: Translated

[ 0.279491] iommu: DMA domain TLB invalidation policy: strict mode

[ 0.282283] SCSI subsystem initialized

[ 0.283564] usbcore: registered new interface driver usbfs

[ 0.284208] usbcore: registered new interface driver hub

[ 0.284548] usbcore: registered new device driver usb

[ 0.285786] mc: Linux media interface: v0.10

[ 0.286178] videodev: Linux video capture interface: v2.00

[ 0.287067] pps_core: LinuxPPS API ver. 1 registered

[ 0.287175] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giom...@linux.it>

[ 0.287464] PTP clock support registered

[ 0.290643] Advanced Linux Sound Architecture Driver Initialized.

[ 0.300247] Bluetooth: Core ver 2.22

[ 0.300630] NET: Registered PF_BLUETOOTH protocol family

[ 0.300750] Bluetooth: HCI device and connection manager initialized

[ 0.301080] Bluetooth: HCI socket layer initialized

[ 0.301246] Bluetooth: L2CAP socket layer initialized

[ 0.301537] Bluetooth: SCO socket layer initialized

[ 0.303927] vgaarb: loaded

[ 0.306907] clocksource: Switched to clocksource arch_sys_counter

[ 0.313530] VFS: Disk quotas dquot_6.6.0

[ 0.313827] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)

[ 0.314660] FS-Cache: Loaded

[ 0.315564] CacheFiles: Loaded

[ 0.321833] NET: Registered PF_INET protocol family

[ 0.324025] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)

[ 0.338110] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear)

[ 0.338540] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)

[ 0.339214] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear)

[ 0.339902] TCP bind hash table entries: 16384 (order: 7, 524288 bytes, linear)

[ 0.340744] TCP: Hash tables configured (established 16384 bind 16384)

[ 0.344575] MPTCP token hash table entries: 2048 (order: 3, 49152 bytes, linear)

[ 0.345409] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)

[ 0.346085] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)

[ 0.349357] NET: Registered PF_UNIX/PF_LOCAL protocol family

[ 0.353828] PCI: CLS 0 bytes, default 64

[ 0.358039] kvm [1]: HYP mode not available

[ 0.363666] Trying to unpack rootfs image as initramfs...

[ 0.512723] Freeing initrd memory: 1596K

[ 0.538992] Initialise system trusted keyrings

[ 0.542478] workingset: timestamp_bits=46 max_order=19 bucket_order=0

[ 0.566290] zbud: loaded

[ 0.579075] Key type cifs.idmap registered

[ 0.579776] fuse: init (API version 7.37)

[ 0.607812] Key type asymmetric registered

[ 0.608044] Asymmetric key parser 'x509' registered

[ 0.608469] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244)

[ 0.609562] io scheduler mq-deadline registered

[ 0.609717] io scheduler kyber registered

[ 0.620835] vc-mem: phys_addr:0x00000000 mem_base=0x00000000 mem_size:0x00000000(0 MiB)

[ 0.627566] cacheinfo: Unable to detect cache hierarchy for CPU 0

[ 0.660160] brd: module loaded

[ 0.676528] loop: module loaded

[ 0.679417] Loading iSCSI transport class v2.0-870.

[ 0.685871] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.

[ 0.686072] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Ja...@zx2c4.com>. All Rights Reserved.

[ 0.692740] tun: Universal TUN/TAP device driver, 1.6

[ 0.695062] usbcore: registered new interface driver brcmfmac

[ 0.695334] usbcore: registered new device driver r8152-cfgselector

[ 0.695635] usbcore: registered new interface driver r8152

[ 0.695927] usbcore: registered new interface driver lan78xx

[ 0.696203] usbcore: registered new interface driver asix

[ 0.696441] usbcore: registered new interface driver ax88179_178a

[ 0.696685] usbcore: registered new interface driver cdc_ether

[ 0.696916] usbcore: registered new interface driver smsc95xx

[ 0.697241] usbcore: registered new interface driver net1080

[ 0.697500] usbcore: registered new interface driver cdc_subset

[ 0.697744] usbcore: registered new interface driver zaurus

[ 0.698007] usbcore: registered new interface driver cdc_ncm

[ 0.698237] usbcore: registered new interface driver r8153_ecm

[ 0.699338] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)

[ 0.701258] usbcore: registered new interface driver cdc_acm

[ 0.701434] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

[ 0.701779] usbcore: registered new interface driver usblp

[ 0.702389] usbcore: registered new interface driver uas

[ 0.702815] usbcore: registered new interface driver usb-storage

[ 0.703447] usbcore: registered new interface driver cp210x

[ 0.703824] usbserial: USB Serial support registered for cp210x

[ 0.704115] usbcore: registered new interface driver pl2303

[ 0.704317] usbserial: USB Serial support registered for pl2303

[ 0.707263] mousedev: PS/2 mouse device common for all mice

[ 0.707565] usbcore: registered new interface driver xpad

[ 0.707813] usbcore: registered new interface driver usb_acecad

[ 0.708102] usbcore: registered new interface driver aiptek

[ 0.708338] usbcore: registered new interface driver hanwang

[ 0.708564] usbcore: registered new interface driver kbtab

[ 0.709043] usbcore: registered new interface driver usbtouchscreen

[ 0.710016] i2c_dev: i2c /dev entries driver

[ 0.712884] ir_imon_decoder: IR iMON protocol handler initialized

[ 0.713072] IR JVC protocol handler initialized

[ 0.713217] IR MCE Keyboard/mouse protocol handler initialized

[ 0.713385] IR NEC protocol handler initialized

[ 0.713533] IR RC5(x/sz) protocol handler initialized

[ 0.713700] IR RC6 protocol handler initialized

[ 0.713852] IR RCMM protocol handler initialized

[ 0.714007] IR SANYO protocol handler initialized

[ 0.714152] IR Sharp protocol handler initialized

[ 0.714305] IR Sony protocol handler initialized

[ 0.714455] IR XMP protocol handler initialized

[ 0.715087] usbcore: registered new interface driver uvcvideo

[ 0.716497] device-mapper: uevent: version 1.0.3

[ 0.717525] device-mapper: ioctl: 4.47.0-ioctl (2022-07-28) initialised: dm-d...@redhat.com

[ 0.718891] Bluetooth: HCI UART driver ver 2.3

[ 0.719124] Bluetooth: HCI UART protocol H4 registered

[ 0.719412] Bluetooth: HCI UART protocol Broadcom registered

[ 0.720306] sdhci: Secure Digital Host Controller Interface driver

[ 0.720422] sdhci: Copyright(c) Pierre Ossman

[ 0.720740] sdhci-pltfm: SDHCI platform and OF driver helper

[ 0.722315] ledtrig-cpu: registered to indicate activity on CPUs

[ 0.724047] hid: raw HID events driver (C) Jiri Kosina

[ 0.749801] usbcore: registered new interface driver usbhid

[ 0.749940] usbhid: USB HID core driver

[ 0.752310] ashmem: initialized

[ 0.753115] SPI driver st-accel-spi has no spi_device_id for st,lis302dl-spi

[ 0.753251] SPI driver st-accel-spi has no spi_device_id for st,lis3lv02dl-accel

[ 0.753392] SPI driver st-accel-spi has no spi_device_id for st,lis3dh-accel

[ 0.753511] SPI driver st-accel-spi has no spi_device_id for st,lsm330d-accel

[ 0.753642] SPI driver st-accel-spi has no spi_device_id for st,lsm330dl-accel

[ 0.753780] SPI driver st-accel-spi has no spi_device_id for st,lsm330dlc-accel

[ 0.753917] SPI driver st-accel-spi has no spi_device_id for st,lis331dlh-accel

[ 0.754059] SPI driver st-accel-spi has no spi_device_id for st,lsm330-accel

[ 0.754193] SPI driver st-accel-spi has no spi_device_id for st,lsm303agr-accel

[ 0.754329] SPI driver st-accel-spi has no spi_device_id for st,lis2dh12-accel

[ 0.754465] SPI driver st-accel-spi has no spi_device_id for st,lng2dm-accel

[ 0.754598] SPI driver st-accel-spi has no spi_device_id for st,h3lis331dl-accel

[ 0.754802] SPI driver st-accel-spi has no spi_device_id for st,lis331dl-accel

[ 0.755415] SPI driver st-magn-spi has no spi_device_id for st,lis3mdl-magn

[ 0.755553] SPI driver st-magn-spi has no spi_device_id for st,lsm303agr-magn

[ 0.755687] SPI driver st-magn-spi has no spi_device_id for st,lsm9ds1-magn

[ 0.755939] SPI driver bmp280 has no spi_device_id for bosch,bmp085

[ 0.759320] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available

[ 0.763207] usbcore: registered new interface driver snd-usb-audio

[ 0.768401] Mirror/redirect action on

[ 0.768755] netem: version 1.3

[ 0.768841] u32 classifier

[ 0.768907] input device check on

[ 0.768994] Actions configured

[ 0.776575] xt_time: kernel timezone is -0000

[ 0.776940] gre: GRE over IPv4 demultiplexor driver

[ 0.777057] IPv4 over IPsec tunneling driver

[ 0.780668] Initializing XFRM netlink socket

[ 0.780938] IPsec XFRM device driver

[ 0.782580] NET: Registered PF_INET6 protocol family

[ 0.791334] Segment Routing with IPv6

[ 0.791578] In-situ OAM (IOAM) with IPv6

[ 0.792435] mip6: Mobile IPv6

[ 0.795226] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver

[ 0.798377] NET: Registered PF_PACKET protocol family

[ 0.798607] NET: Registered PF_KEY protocol family

[ 0.798850] Key type dns_resolver registered

[ 0.801844] registered taskstats version 1

[ 0.802330] Loading compiled-in X.509 certificates

[ 0.804539] Key type .fscrypt registered

[ 0.804645] Key type fscrypt-provisioning registered

[ 0.811393] of_cfs_init

[ 0.811775] of_cfs_init: OK

[ 0.815157] cfg80211: Loading compiled-in X.509 certificates for regulatory database

[ 0.843897] cfg80211: Loaded X.509 cert 'be...@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'

[ 0.844734] cfg80211: Loaded X.509 cert 'romain...@gmail.com: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'

[ 0.845415] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'

[ 0.846032] cfg80211: Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'

[ 0.852746] clk: Disabling unused clocks

[ 0.853318] ALSA device list:

[ 0.853517] No soundcards found.

[ 0.857639] uart-pl011 9000000.pl011: no DMA platform data

[ 0.943546] Freeing unused kernel memory: 1984K

[ 0.947106] Run /init as init process

[ 1.041117] init: init first stage started!

[ 1.045113] init: Unable to open /lib/modules, skipping module loading.

[ 1.053491] init: Copied ramdisk prop to /second_stage_resources/system/etc/ramdisk/build.prop

[ 1.057040] init: [libfstab] Using Android DT directory /proc/device-tree/firmware/android/

[ 1.059013] init: [libfstab] ReadFstabFromDt(): failed to read fstab from dt

[ 1.085206] init: Failed to read vbmeta partitions.

[ 1.993668] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found in /sys, waiting for their uevent(s): mmcblk0p2, mmcblk0p3


The error that I get is interesting. It seems that some important file is missing inside the /sys folder of the system.img file ?


Let's see the content of that folder :


root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/rpi4# mkdir system-rw

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/rpi4# sudo mount system.img system-rw

mount: /mnt/zroot-133/_OS/Android/rpi4/system-rw: WARNING: source write-protected, mounted read-only.

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/rpi4# cd system-rw

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/rpi4/system-rw# ls

acct bugreports data etc lost+found oem sdcard system vendor

apex cache data_mirror init mnt postinstall second_stage_resources system_dlkm vendor_dlkm

bin config debug_ramdisk init.environ.rc odm proc storage system_ext

bootstrap-apex d dev linkerconfig odm_dlkm product sys tmp

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/rpi4/system-rw# cd sys

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/rpi4/system-rw/sys# ls

it's empty. Is normal ? In addition,following your instructions I see that the file userdata.img hasn't been produced. Is this also normal ?



Thanks.

Rodrigo Gobbi

unread,
Sep 2, 2024, 7:45:48 AM9/2/24
to Android-rpi
Hi!!! The "/sys" is a "dynamic fs" created at ram from the kernel, to export a lot of things...so most of the files only exists at runtime. Normally, the partitions from the block device have a symlink at /sys/<somethig>/<...> that points to /dev/ block node. It seems that there are no such files under /sys according to what init is looking for. You can double check this at init source code to check the exactly path but I'm guessing that you'll have to change the qemu arguments regarding the block device.

About userdata.img I think it's normal since in the old days, the image was a "empty sparsed image", that means, at the first flashing process, there isn't userdata information, we're just "flashing the partition" with empty data.
Tks!!!

Mario Marietto

unread,
Sep 2, 2024, 9:06:45 AM9/2/24
to Android-rpi
I tried in this way :

-hda /mnt/zroot-133/_OS/Android/_rpi4/system.img \
-hdb /mnt/zroot-133/_OS/Android/_rpi4/vendor.img \

but I've got the same error.

Rodrigo Gobbi

unread,
Sep 2, 2024, 9:50:37 AM9/2/24
to Android-rpi
Did you try a different approach, like this:

-drive if=sd,format=raw,file=/mnt/zroot-133/_OS/Android/rpi4/system.img \
-drive if=sd,format=raw,file=/mnt/zroot-133/_OS/Android/rpi4/vendor.img

I'm not sure if the syntax is correct but you need to configure the storage devices as a "eMMC" device, you can search for that concept and maybe mix the args. Your original description point to a "virtio-blk-pci" device rather a eMMC (i.e. mmcblk<index>p<partitionIndex>. Looking briefly, I could't find an example from the "symlink" that I've quoted before.

Regards!

Mario Marietto

unread,
Sep 2, 2024, 10:27:34 AM9/2/24
to Rodrigo Gobbi, Android-rpi
qemu-system-aarch64 \
       -smp 4 \
       -m 2048 \
       -cpu cortex-a72 \
       -M virt \
       -device virtio-gpu-pci,xres=1024,yres=768 \
       -display sdl,gl=on \
       -device usb-ehci \
       -device usb-kbd \
       -device virtio-tablet-pci \
       -usb \
       -serial stdio \
       -kernel /mnt/zroot-133/_OS/Android/rpi4/Image \
       -initrd /mnt/zroot-133/_OS/Android/rpi4/ramdisk.img \
       -device sdhci-pci,sd-spec-version=3 \
       -drive if=none,file=/mnt/zroot-133/_OS/Android/rpi4/boot.img,format=raw,id=MMC1 \
       -device sd-card,drive=MMC1 \
       -drive if=none,file=/mnt/zroot-133/_OS/Android/rpi4/system.img,format=raw,id=MMC2 \
       -device sd-card,drive=MMC2 \
       -drive if=none,file=/mnt/zroot-133/_OS/Android/rpi4/vendor.img,format=raw,id=MMC3 \
       -device sd-card,drive=MMC3 \
-append "console=ttyAMA0,38400 drm.debug=0x0 rootwait rootdelay=5 root=/dev/mmcblk0p2 androidboot.hardware=rpi4 androidboot.selinux=permissive security=selinux selinux=1 androidboot.qemu.hw.mainkeys=0 androidboot.lcd.density=160"

= same error :

[    1.111482] init: [libfstab] ReadFstabFromDt(): failed to read fstab from dt
[    1.149319] init: Failed to read vbmeta partitions.
[    2.046632] init: bool android::init::BlockDevInitializer::InitDevices(std::set<std::string>): partition(s) not found in /sys, waiting for their uevent(s): mmcblk0p2, mmcblk0p3


--
You received this message because you are subscribed to a topic in the Google Groups "Android-rpi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-rpi/MMGuLvxEOAc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-rpi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-rpi/7a95af5c-d2ec-4747-8dcf-832f0f1d628bn%40googlegroups.com.


--
Mario.

Rodrigo Gobbi

unread,
Sep 3, 2024, 7:34:14 AM9/3/24
to Mario Marietto, Android-rpi
Ok, so it doesn't work. I could also reproduce this too with my Android images.

I guess that it would be wise to check if the "std machine" from QEMU for rasp (-M raspi3b or raspi4b) is currently working and able to attach the block device inside it.  The rasp is at the official docs as the "SD/MMC host controller". I would do something like that, get the raspberry standard image (fs image) and try to see if the mmcblk from sdcard is properly attached.
Comproving the compatibility from QEMU, you can go back to the Android images and maybe mix the same args from the drive part and see how it goes.

Regards!!!!
--
Att,
Rodrigo Gobbi

Rodrigo Gobbi

unread,
Sep 23, 2024, 9:41:22 PM9/23/24
to Mario Marietto, Android-rpi
> Comproving the compatibility from QEMU, you can go back to the Android images and maybe mix the same args from the drive part and see how it goes.

Related to this I was doing some tests last week and the rpi4 target from QEMU is available from a specific version number of it.
Using that custom version, the "-sd" argument and increasing the rootdelay to a higher value, I could see that the MMC device was detected at kernel logs at rasp std image and the Android image (the init error from the first stage was gone). But, even with that, the boot for both systems doesn't complete.

At Android, I've faced a different new error, some failure at the "init second stage" regarding the other partitions. I think the reason for that is that the current support from qemu/mmc device only accepts one -sd image, so we can't attach more than one disk/partition using those arguments quoted here in this thread.

I think a possibility here is to create a -sd image with the whole content from the rpi4 (all the mmc content/partitions) and change the fstab from rp4 to match those adjustments.
The odds are not good because for rasp os, the system didn't boot because systemd was stucked at some services during initialization.


--
Att,
Rodrigo Gobbi

Mario Marietto

unread,
Sep 24, 2024, 9:30:55 AM9/24/24
to Rodrigo Gobbi, Android-rpi
I tried this on my Ubuntu 24.04 x64 bit :

qemu-system-aarch64 \ -machine raspi4b \ -smp 4 \ -m 2048 \ -dtb /mnt/zroot-133/_A_OS/Android/rpi4/dts/broadcom/bcm2711-rpi-4-b.dtb \ -kernel /mnt/zroot-133/_A_OS/Android/rpi4/Image \ -append 'androidboot.hardware=rpi4 console=ttyAMA1,38400 keep_bootcon earlycon=pl011,0x9000000 root=/dev/mmcblk1p2' \ -monitor telnet:127.0.0.1:5556,server,nowait \ -d guest_errors,unimp ==> bcm2835_property: unhandled tag 0x00000002 bcm2835_property: unhandled tag 0x00000003 bcm2838-gpio: bcm2838_gpio_write: not implemented for 4c bcm2838-gpio: bcm2838_gpio_write: not implemented for 58 bcm2838-gpio: bcm2838_gpio_write: not implemented for 64 bcm2838-gpio: bcm2838_gpio_write: not implemented for 70 bcm2838-gpio: bcm2838_gpio_write: not implemented for 7c bcm2838-gpio: bcm2838_gpio_write: not implemented for 88 bcm2838-gpio: bcm2838_gpio_read: not implemented for 40 bcm2838-gpio: bcm2838_gpio_write: not implemented for 50 bcm2838-gpio: bcm2838_gpio_write: not implemented for 5c bcm2838-gpio: bcm2838_gpio_write: not implemented for 68 bcm2838-gpio: bcm2838_gpio_write: not implemented for 74 bcm2838-gpio: bcm2838_gpio_write: not implemented for 80 bcm2838-gpio: bcm2838_gpio_write: not implemented for 8c bcm2838-gpio: bcm2838_gpio_read: not implemented for 44 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00040014 bcm2835_property: unhandled tag 0x00048013 bcm2835_property: unhandled tag 0x00048008 bcm2835_property: unhandled tag 0x00030030 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_property: unhandled tag 0x00030043 bcm2835_aux_write: unsupported attempt to enable SPI or disable UART: 0x0 bcm2838-asb: unimplemented device read (size 4, offset 0x20) bcm2835_aux_write: unsupported attempt to enable SPI or disable UART: 0x0 bcm2835_powermgt_write: RSTS bcm2835_powermgt_write: WDOG

I'm ignorant,but those errors don't seem caused by the (missing) sd card,but by the dtb file and by the code that's "under"
the parameter -machine raspi4b. It seems to me that the dtb file implements some calls that the parameter -machine raspi4b
cannot handle.
--
Mario.

Mario Marietto

unread,
Sep 25, 2024, 11:31:45 AM9/25/24
to Rodrigo Gobbi, Android-rpi
Hello.

I hope that the examples below will help you to understand where the problem is. In both the examples I've used the kernel of the Raspi OS,compiled by me. We talk about the kernel of Debian bookworm,lets forget Android for a moment. It works for sure. I've used the same parameters,except for the -machine one. So,this is the first one :

1) in this example I've used -machine virt-9.0 :

qemu-system-aarch64 -machine virt-9.0 \
    -cpu max \
    -smp 4 \
    -m 2G \
    -kernel /mnt/zroot-133/zroot-133/_A_OS/Linux/RaspiOS/Image \
    -append "root=/dev/vda2 rootfstype=ext4 rw panic=0 console=ttyAMA0" \

this is what it produces :


virt.jpg

2) in this example I've used -machine raspi4b for sure :

qemu-system-aarch64 -machine raspi4b \
   -cpu max \
   -smp 4 \
   -m 2G \
   -kernel /mnt/zroot-133/zroot-133/_A_OS/Linux/RaspiOS/Image \
   -append "root=/dev/vda2 rootfstype=ext4 rw panic=0 console=ttyAMA0" \
   -monitor telnet:127.0.0.1:5556,server,nowait \
   -d guest_errors,unimp

this is what happens : (black screen) :


raspi4b.jpg
Instead,adding the dtb file :

qemu-system-aarch64 -machine raspi4b \
   -cpu max \
   -smp 4 \
   -m 2G \
   -dtb /mnt/zroot-133/zroot-133/_A_OS/Android/aosp_14/cvd-host_package-x86_64/dts/broadcom/bcm2711-rpi-4-b.dtb \
   -kernel /mnt/zroot-133/zroot-133/_A_OS/Linux/RaspiOS/Image \
   -append "root=/dev/vda2 rootfstype=ext4 rw panic=0 console=ttyAMA1" \
   -monitor telnet:127.0.0.1:5556,server,nowait \
   -d guest_errors,unimp

Black screen and :

qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-pcie has been disabled!
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-rng200 has been disabled!
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-thermal has been disabled!
qemu-system-aarch64: warning: bcm2711 dtc: brcm,bcm2711-genet-v5 has been disabled!
bcm2838-gpio: bcm2838_gpio_write: not implemented for 4c
bcm2838-gpio: bcm2838_gpio_write: not implemented for 58
bcm2838-gpio: bcm2838_gpio_write: not implemented for 64
bcm2838-gpio: bcm2838_gpio_write: not implemented for 70
bcm2838-gpio: bcm2838_gpio_write: not implemented for 7c
bcm2838-gpio: bcm2838_gpio_write: not implemented for 88
bcm2838-gpio: bcm2838_gpio_read: not implemented for 40
bcm2838-gpio: bcm2838_gpio_write: not implemented for 50
bcm2838-gpio: bcm2838_gpio_write: not implemented for 5c
bcm2838-gpio: bcm2838_gpio_write: not implemented for 68
bcm2838-gpio: bcm2838_gpio_write: not implemented for 74
bcm2838-gpio: bcm2838_gpio_write: not implemented for 80
bcm2838-gpio: bcm2838_gpio_write: not implemented for 8c
bcm2838-gpio: bcm2838_gpio_read: not implemented for 44
bcm2835_aux_write: AUX_MU_MCR_REG unsupported
bcm2838-asb: unimplemented device read  (size 4, offset 0x20)
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030030
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
bcm2835_property: unhandled tag 0x00030043
--
Mario.

Rodrigo Gobbi

unread,
Sep 26, 2024, 7:31:47 AM9/26/24
to Android-rpi
I just quoted the "rasp os" before as a reference test regarding the purpose of the original post in this long thread, that was emulating the android from android-rpi repo with QEMU.

Besides that, I'm not a QEMU expert and I'm don't know the "virt-9.0" usage but DTB is the "device-tree blob" from the target device and it is a "input file" to the kernel, you need that in order to start the kernel in this case. Despite the previous logs you have pointed, I'm not sure if the virtualization execution from QEMU cares about the DTB file.

You pasted just a snipped from logs and considering that the QEMU line doesn't have a ROOTFS configured, kernel will crash in the end of the process while looking for the init process.

You are mixing some concepts, it's better to review them and read/study the QEMU documentation/source code.

Regards!
Reply all
Reply to author
Forward
0 new messages