我在做 aosp14 移植,目前用 uboot2025.01-rc1,linux 5.10 现在能运行内核,内核能调用 android 的第一阶段 init ( bl 把 init_boot+vendor_boot 的 ramdisk 读取到内存后传递给内核,内核把 initramfs unpack 到 rootfs ),metadata 分区 16MB ,刷入了生成的空白 ext4 文件系统镜像。
第一阶段 init 可以运行,但是只能运行一部分,大概运行到
if (!fsm) {
fsm = CreateFirstStageMount(cmdline);
}
设备就会自动重启,cmdline 加了 init_fatal_panic=true 但是没任何 panic 还是 reboot 到 bootloader 。 如果 fstab 里不写 metadata 会跳过 metadata ,此时串口日志显示创建了几个逻辑分区给 system 、vendor 等,但是也会突然自动重启。
所有串口日志最后一条的下一条就是设备重启的日志:rk860-regulator 1-0042: rk860..... reset
等,无参考价值。
串口日志( fstab 有 metadata ):
[ 18.277402] Run /init as init process
[ 18.280593] init: init first stage started!
[ 18.280826] init: Unable to open /lib/modules, skipping module loading.
[ 18.281153] init: Copied ramdisk prop to /second_stage_resources/system/etc/ramdisk/build.prop
[ 18.281316] init: Using generic ramdisk copy of snapuserd /system/bin/snapuserd_ramdisk
[ 18.281417] init: hard linking /system/bin/snapuserd_ramdisk to /first_stage_ramdisk/system/bin/snapuserd succeeded
[ 18.281754] init: Switching root to '/first_stage_ramdisk'
[ 18.282159] init: [libfstab] Using Android DT directory /proc/device-tree/firmware/android/
[ 18.282286] init: [libfstab] ReadFstabFromDt(): failed to read fstab from dt
[ 18.355352] init: [libfs_mgr] superblock s_max_mnt_count:65535,/dev/block/by-name/metadata
[ 18.355625] EXT4-fs (mmcblk0p21): Ignoring removed nomblk_io_submit option
[ 18.357141] EXT4-fs (mmcblk0p21): mounted filesystem with ordered data mode. Opts: errors=remount-ro,nomblk_io_submit
[ 18.357185] init: [libfs_mgr] check_fs(): mount(/dev/block/by-name/metadata,/metadata,ext4)=0: Success
[ 18.361990] EXT4-fs (mmcblk0p21): mounted filesystem with ordered data mode. Opts: discard
串口日志(无 metadata 或挂载失败):
[ 18.276158] Run /init as init process
[ 18.279226] init: init first stage started!
[ 18.279431] init: Unable to open /lib/modules, skipping module loading.
[ 18.279750] init: Copied ramdisk prop to /second_stage_resources/system/etc/ramdisk/build.prop
[ 18.279911] init: Using generic ramdisk copy of snapuserd /system/bin/snapuserd_ramdisk
[ 18.280010] init: hard linking /system/bin/snapuserd_ramdisk to /first_stage_ramdisk/system/bin/snapuserd succeeded
[ 18.280335] init: Switching root to '/first_stage_ramdisk'
[ 18.280730] init: [libfstab] Using Android DT directory /proc/device-tree/firmware/android/
[ 18.280848] init: [libfstab] ReadFstabFromDt(): failed to read fstab from dt
[ 18.282054] init: Check Point2
[ 18.282082] init: Check Point3.22
[ 18.456015] usb 2-1.1: new full-speed USB device number 3 using ehci-platform
[ 18.557933] usb 2-1.1: New USB device found, idVendor=0bda, idProduct=b85b, bcdDevice= 0.00
[ 18.558009] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 18.558032] usb 2-1.1: Product: Bluetooth Radio
[ 18.558053] usb 2-1.1: Manufacturer: Realtek
[ 18.558073] usb 2-1.1: SerialNumber: 00e04c000001
[ 20.194029] rk_hdmirx fdee0000.hdmirx-controller: hdmirx_cancel_cpu_limit_freq freq qos nod add
[ 20.276050] rk-pcie fe170000.pcie: PCIe Link Fail, LTSSM is 0x3, hw_retries=0
[ 20.286057] rk-pcie fe150000.pcie: PCIe Link Fail, LTSSM is 0x0, hw_retries=0
[ 20.286119] rk-pcie fe150000.pcie: failed to initialize host
[ 22.602724] rk_pcie_establish_link: 232 callbacks suppressed
[ 22.602741] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 22.629398] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 22.656059] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 22.682736] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 22.709494] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 22.736063] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 22.762728] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 22.789396] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 22.816061] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 22.842733] rk-pcie fe170000.pcie: PCIe Linking... LTSSM is 0x3
[ 24.176058] rk-pcie fe170000.pcie: PCIe Link Fail, LTSSM is 0x3, hw_retries=1
[ 25.196063] rk-pcie fe170000.pcie: failed to initialize host
[ 38.369022] init: [libfs_mgr] Skipping mounting '/dev/block/bootdevice/by-name/metadata'
[ 38.369297] init: [libfs_mgr] Failed to open '/dev/block/bootdevice/by-name/metadata': No such file or directory
[ 38.369580] init: [libfs_mgr] __mount(source=/dev/block/bootdevice/by-name/metadata(missing),target=/metadata,type=ext4)=-1: No such file or directory
[ 38.374465] init: [libfs_mgr] Created logical partition odm_a on device /dev/block/dm-0
[ 38.374503] init: [libfs_mgr] Skipping zero-length logical partition: odm_b
[ 38.375365] init: [libfs_mgr] Created logical partition system_a on device /dev/block/dm-1
[ 38.375389] init: [libfs_mgr] Skipping zero-length logical partition: system_b
[ 38.376232] init: [libfs_mgr] Created logical partition system_ext_a on device /dev/block/dm-2
[ 38.376255] init: [libfs_mgr] Skipping zero-length logical partition: system_ext_b
[ 38.377209] init: [libfs_mgr] Created logical partition vendor_a on device /dev/block/dm-3
fstab 如下:
/dev/block/platform/ff0f0000.dwmmc/by-name/user /mnt/internal_sd vfat defaults defaults
/dev/block/mmcblk0p1 /mnt/external_sd vfat /dev/block/mmcblk0 defaults
# /dev/block/by-name/
system /system ext4 rw,barrier=1,discard wait,slotselect,logical,first_stage_mount,avb=vbmeta_system
system_ext /system_ext ext4 rw wait,slotselect,logical,first_stage_mount,avb=vbmeta_system
product /product ext4 rw wait,slotselect,logical,first_stage_mount
vendor /vendor ext4 rw wait,slotselect,logical,first_stage_mount
odm /odm ext4 ro wait,slotselect,logical,first_stage_mount
/dev/block/by-name/dtbo /dtbo emmc defaults slotselect,first_stage_mount,avb=vbmeta
/dev/block/by-name/boot /boot emmc defaults slotselect,first_stage_mount,avb=vbmeta
/dev/block/by-name/init_boot /init_boot emmc defaults slotselect,first_stage_mount,avb=vbmeta
/dev/block/by-name/vendor_boot /vendor_boot emmc defaults slotselect,first_stage_mount,avb=vbmeta
/dev/block/by-name/recovery /recovery emmc defaults slotselect,first_stage_mount,avb=vbmeta
/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,discard latemount,wait,check,formattable,reservedsize=128M
关键词: rockchip 、瑞芯微、rk3588 、rk3399 、安卓、android 、aosp 、开发板
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.