raspberry-vanilla / android_local_manifest

144 stars 55 forks source link

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

Closed Marietto2008 closed 2 months ago

Marietto2008 commented 2 months ago

Hello bro.

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 <giometti@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 <Jason@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-devel@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 'benh@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'
[    0.844734] cfg80211: Loaded X.509 cert 'romain.perier@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 ?

KonstaT commented 2 months ago

This is not supported in any way at least and I can't find any reason why you would need to attempt something like this.

If you need to run AOSP in some sort of emulator, there's already an official supported way to achieve this. https://source.android.com/docs/setup/create/avd

Marietto2008 commented 1 month ago

I know but to be able to do it is very intriguing for me.

KonstaT commented 1 month ago

I know but to be able to do it is very intriguing for me.

Then I'm not going to spoil the fun from you figuring it out. ;)

Your cmdline looks very incorrect at least.

        -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"

On Android, rootfs is on ramdisk loaded by kernel from ramdisk.img vs. being on any partition. You probably can't have SELinux disabled and enabled at the same time either.

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

It's created at the point of making the flashable image. https://github.com/raspberry-vanilla/android_device_brcm_rpi4/blob/android-14.0/mkimg.sh#L64-L65

And yes, you need to have userdata partition to have any change of booting Android.

Marietto2008 commented 1 month ago

Hello.

I'm not able to find the file userdata.img,but from the messages that I get :

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/raspberry-vanilla# ./rpi4-mkimg.sh

Creating image file /mnt/zroot-133/_OS/Android/raspberry-vanilla/out/target/product/rpi4/RaspberryVanillaAOSP14-20240907-rpi4.img...
7168+0 records in
7168+0 records out
7516192768 bytes (7.5 GB, 7.0 GiB) copied, 1.4751 s, 5.1 GB/s
Creating partitions...

Welcome to fdisk (util-linux 2.39.3).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS (MBR) disklabel with disk identifier 0xce1e1fb2.

Comando (m per richiamare la guida): Created a new DOS (MBR) disklabel with disk identifier 0xfb3cd69c.

Comando (m per richiamare la guida): Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): Numero della partizione (1-4, default 1): First sector (2048-14680063, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-14680063, default 14680063): 
Created a new partition 1 of type 'Linux' and of size 128 MiB.

Comando (m per richiamare la guida): Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): Numero della partizione (2-4, default 2): First sector (264192-14680063, default 264192): Last sector, +/-sectors or +/-size{K,M,G,T,P} (264192-14680063, default 14680063): 
Created a new partition 2 of type 'Linux' and of size 2 GiB.

Comando (m per richiamare la guida): Partition type
   p   primary (2 primary, 0 extended, 2 free)
   e   extended (container for logical partitions)
Select (default p): Numero della partizione (3,4, default 3): First sector (4458496-14680063, default 4458496): Last sector, +/-sectors or +/-size{K,M,G,T,P} (4458496-14680063, default 14680063): 
Created a new partition 3 of type 'Linux' and of size 256 MiB.

Comando (m per richiamare la guida): Partition type
   p   primary (3 primary, 0 extended, 1 free)
   e   extended (container for logical partitions)
Select (default e): 
Selected partition 4
First sector (4982784-14680063, default 4982784): Last sector, +/-sectors or +/-size{K,M,G,T,P} (4982784-14680063, default 14680063): 
Created a new partition 4 of type 'Linux' and of size 4.6 GiB.

Comando (m per richiamare la guida): Numero della partizione (1-4, default 4): Hex code or alias (type L to list all): 
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Comando (m per richiamare la guida): Numero della partizione (1-4, default 4): 
The bootable flag on partition 1 is enabled now.

Comando (m per richiamare la guida): The partition table has been altered.
Syncing disks.

Image mounted as /dev/loop0
Copying boot...
128+0 records in
128+0 records out
134217728 bytes (134 MB, 128 MiB) copied, 1.16107 s, 116 MB/s
Copying system...
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 55.5621 s, 38.7 MB/s
Copying vendor...
256+0 records in
256+0 records out
268435456 bytes (268 MB, 256 MiB) copied, 5.36113 s, 50.1 MB/s
Creating userdata...
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: fatto                            
Creazione del file system con 1212160 4k blocchi e 303104 inode
Etichetta del file system=ce0805f8-43d1-4aa0-ad2c-be9ad72822a1
Backup del superblocco salvati nei blocchi: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: fatto                            
Scrittura delle tavole degli inode: fatto                            
Creating journal (16384 blocks): fatto
Scrittura delle informazioni dei super-blocchi e dell'accounting del file system: fatto

Done, created /mnt/zroot-133/_OS/Android/raspberry-vanilla/out/target/product/rpi4/RaspberryVanillaAOSP14-20240907-rpi4.img!

It seems that userdata.img could be called "RaspberryVanillaAOSP14-20240907-rpi4.img". Is it correct ? I don't see any userdata.img file inside the folder below :

Istantanea_2024-09-07_14-57-07

Marietto2008 commented 1 month ago

Your cmdline looks very incorrect at least.

-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 not VERY incorrect. I'm using that line when I boot Android 10 adapted by Antmicro on my Jetson Nano. You can see the qemu parameters that should be used going here at the end of the page :

https://github.com/antmicro/kvm-aosp-jetson-nano/blob/master/README_Jetson_Nano_BSP.md

At least for Android 10 it works perfectly. So,I imagine that for Android 14 it should be changed. How do you suggest to change it ?

KonstaT commented 1 month ago

It seems that userdata.img could be called "RaspberryVanillaAOSP14-20240907-rpi4.img". Is it correct ?

No. Flashable image that the mkimg.sh script creates, contains four partitions (boot, system, vendor, and userdata). I even linked the exact line where the userdata partition is created with mkfs.ext4.

Marietto2008 commented 1 month ago

--> I even linked the exact line where the userdata partition is created with mkfs.ext4.

It seems thats not enough to link "the exact line where the userdata partition is created with mkfs.ext4" if I don't have that file because it is NOT created by your script for some reason. If your script does not create userdata.img it means that we should at least understand the reasons. The better method is to divide the bigger task into smaller ones to understand where it fails.

Marietto2008 commented 1 month ago

Your script is broken. Something does not work :

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/raspberry-vanilla# fdisk -l

Disk /dev/loop0: 7 GiB, 7516192768 bytes, 14680064 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x07ee67c2

Dispositivo  Avvio   Start     Fine Settori  Size Id Tipo
/dev/loop0p1 *        2048   264191  262144  128M  c W95 FAT32 (LBA)
/dev/loop0p2        264192  4458495 4194304    2G 83 Linux
/dev/loop0p3       4458496  4982783  524288  256M 83 Linux
/dev/loop0p4       4982784 14680063 9697280  4.6G 83 Linux

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/raspberry-vanilla# ls /dev/mapper
control  loop0p1  loop0p2  loop0p3  loop0p4

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/raspberry-vanilla# sudo mkfs.ext4 /dev/mapper/loop0p4 -I 512 -L userdata

mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: fatto                            
Creazione del file system con 1212160 4k blocchi e 303104 inode
Etichetta del file system=f8ea2c6a-c914-4963-92ea-431dbd5fda4d
Backup del superblocco salvati nei blocchi: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: fatto                            
Scrittura delle tavole degli inode: fatto                            
Creating journal (16384 blocks): fatto
Scrittura delle informazioni dei super-blocchi e dell'accounting del file system: fatto

root@Z390-AORUS-PRO-DEST:/mnt/zroot-133/_OS/Android/raspberry-vanilla# ls userdata*
ls: impossibile accedere a 'userdata*': File or directory not found
KonstaT commented 1 month ago

If your script does not create userdata.img it means that we should at least understand the reasons.

FFS, it's not supposed to create any userdata.img, but an userdata partition within the flashable image. I understand perfectly what it does and why.

Your script is broken.

No, you just don't understand what it is supposed to do.

As mentioned earlier, what you're attempting is not supported in any shape or form so I don't have time/energy/interest to get into this any further.

If you need to run AOSP in an emulator, use the official Android emulator. https://source.android.com/docs/setup/create/avd

Marietto2008 commented 1 month ago

FFS, it's not supposed to create any userdata.img, but an userdata partition within the flashable image. I understand perfectly what it does and why.

So,maybe you don't emulate Android so often,because usually with qemu the userdata partition is declared with :

-drive index=2,if=none,id=userdata,file=userdata.img

But it's not a problem,because now that I've understood where you want it to be,I can still use it in qemu doing something like this :

dd if=/dev/mapper/loop0p4 of=userdata.img

If you need to run AOSP in an emulator, use the official Android emulator.

no. I want to emulate this version of Android.

Marietto2008 commented 1 month ago

One only last question,please. Can you tell me if the content of the userdata.img file that you see below,is correct ? thanks.

Istantanea_2024-09-08_18-15-30