OpenHarmony开发者论坛

标题: Init启动失败data分区挂载不上,如何调试? [打印本页]

作者: 闲散鸿-Zdd    时间: 2024-7-4 16:53
标题: dayu200烧录失败无法开机,求救
dayu200烧录失败无法开机,求救
开机屏幕已经不亮了
作者: 润开鸿_闻飞    时间: 2024-7-4 22:32
从log上看/dev/block/platform/fe2e0000.mmc/by-name/userdata不存在,可以通过access("/dev/block/platform/fe2e0000.mmc/by-name/userdata", F_OK)判断是否存在,还可以通过添加以下代码先把shell打开,然后查看信息
execv("/bin/sh", NULL);

我之前调init时遇到问题总结的
https://forums.openharmony.cn/fo ... tid=2911&extra=
作者: 闲散鸿-Zdd    时间: 2024-7-5 10:13
回复 润开鸿_闻飞: 我的代码为什么没有base/startup/init/services/init/standard/main_early.c
作者: 闲散鸿-Zdd    时间: 2024-7-5 10:32
回复 润开鸿_闻飞: ramdisk里也有一个init,这个与system里的init有什么区别?我开着enable_ramdisk了,把ramdisk.img也打到boot_linux分区了。我现在没搞明白,ramdisk里的init和system的init是一个init吗。我感觉ramdisk的编译依赖不合适,如果要enable_ramdisk打到boot_linux.img里,那就要ramdisk.img先被编译。怎么单独编译ramdisk.img?
作者: 润开鸿_闻飞    时间: 2024-7-5 11:00
回复 闲散鸿-Zdd: 你是哪个分支?OpenHarmony-4.1-Release分支及以后才有,如果没有的话那就是base/startup/init/services/init/main.c文件的流程往下走然后在base/startup/init/services/init/standard/init.c的StartInitSecondStage函数中加execv("/bin/sh", NULL);
作者: 闲散鸿-Zdd    时间: 2024-7-5 11:11
回复 润开鸿_闻飞: 我这边是OpenHarmony-4.0-Release。在mount()动作前,通过access(source, F_OK)返回判断,节点/dev/block/mmcblk0p2->/dev/block/platform/fe2e0000.mmc/by-name/userdata存在。实际,mount后打印return返回的是-1。
作者: 润开鸿_闻飞    时间: 2024-7-5 14:32
回复 闲散鸿-Zdd: 再往下就是具体的问题定位了,我也不太清楚
作者: 润开鸿_闻飞    时间: 2024-7-5 14:47
回复 闲散鸿-Zdd: 我现在搞的产品也在这附近出现问题了,文件系统有时候能挂载上有时候不行
作者: 闲散鸿-Zdd    时间: 2024-7-5 15:39
回复 润开鸿_闻飞: [    5.674514] [pid=226][ueventd][INFO][ueventd_main.c:88]Ueventd started, trigger uevent
[    5.723296] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0->/dev/block/platform/fe2e0000.mmc/mmcblk0
[    5.723510] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p12->/dev/block/platform/fe2e0000.mmc/by-name/userdata
[    5.723526] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p12->/dev/block/by-name/userdata
[    5.723792] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p9->/dev/block/platform/fe2e0000.mmc/by-name/sys-prod
[    5.723806] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p9->/dev/block/by-name/sys-prod
[    5.724032] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p10->/dev/block/platform/fe2e0000.mmc/by-name/chip-prod
[    5.724064] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p10->/dev/block/by-name/chip-prod
[    5.724290] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p7->/dev/block/platform/fe2e0000.mmc/by-name/system
[    5.724303] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p7->/dev/block/by-name/system
[    5.724552] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p5->/dev/block/platform/fe2e0000.mmc/by-name/boot_linux
[    5.724564] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p5->/dev/block/by-name/boot_linux
[    5.724792] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0boot0->/dev/block/platform/fe2e0000.mmc/mmcblk0boot0
[    5.725218] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p3->/dev/block/platform/fe2e0000.mmc/by-name/bootctrl
[    5.725234] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p3->/dev/block/by-name/bootctrl
[    5.725463] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p1->/dev/block/platform/fe2e0000.mmc/by-name/uboot
[    5.725477] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p1->/dev/block/by-name/uboot
[    5.725815] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p11->/dev/block/platform/fe2e0000.mmc/by-name/updater
[    5.725829] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p11->/dev/block/by-name/updater
[    5.726103] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p8->/dev/block/platform/fe2e0000.mmc/by-name/vendor
[    5.726117] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p8->/dev/block/by-name/vendor
[    5.726358] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p6->/dev/block/platform/fe2e0000.mmc/by-name/ramdisk
[    5.726371] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p6->/dev/block/by-name/ramdisk
[    5.726607] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0boot1->/dev/block/platform/fe2e0000.mmc/mmcblk0boot1
[    5.727015] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p4->/dev/block/platform/fe2e0000.mmc/by-name/resource
[    5.727029] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p4->/dev/block/by-name/resource
[    5.727258] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p2->/dev/block/platform/fe2e0000.mmc/by-name/misc
[    5.727275] [pid=226][ueventd][INFO][ueventd_device_handler.c:85]symlink /dev/block/mmcblk0p2->/dev/block/by-name/misc
[    6.167679] [pid=1][BEGET][ERROR][fstab_mount.c:283]access /dev/block/platform/fe2e0000.mmc/by-name/sys-prod ok
[    6.174265] EXT4-fs (mmcblk0p9): mounted filesystem without journal. Opts: barrier=1
[    6.174360] [pid=1][BEGET][ERROR][fstab_mount.c:398]Mount device /dev/block/platform/fe2e0000.mmc/by-name/sys-prod to /sys_prod return, rc = 0
[    6.174369] [pid=1][BEGET][ERROR][fstab_mount.c:400]InitPostMount rc = 0
[    6.174381] [pid=1][BEGET][INFO][fstab_mount.c:412]Mount /dev/block/platform/fe2e0000.mmc/by-name/sys-prod to /sys_prod successful
[    6.174395] [pid=1][BEGET][ERROR][fstab_mount.c:364]Item deviceName: /dev/block/platform/fe2e0000.mmc/by-name/chip-prod fsManagerFlags: 2
[    6.174484] [pid=1][BEGET][ERROR][fstab_mount.c:283]access /dev/block/platform/fe2e0000.mmc/by-name/chip-prod ok
[    6.176079] EXT4-fs (mmcblk0p10): mounted filesystem without journal. Opts: barrier=1
[    6.176133] [pid=1][BEGET][ERROR][fstab_mount.c:398]Mount device /dev/block/platform/fe2e0000.mmc/by-name/chip-prod to /chip_prod return, rc = 0
[    6.176140] [pid=1][BEGET][ERROR][fstab_mount.c:400]InitPostMount rc = 0
[    6.176152] [pid=1][BEGET][INFO][fstab_mount.c:412]Mount /dev/block/platform/fe2e0000.mmc/by-name/chip-prod to /chip_prod successful
[    6.176164] [pid=1][BEGET][ERROR][fstab_mount.c:364]Item deviceName: /dev/block/platform/fe2e0000.mmc/by-name/userdata fsManagerFlags: 3
[    6.176201] [pid=1][BEGET][INFO][fstab.c:424]StoreFscryptPolicy:store fscrypt policy, 2:aes-256-cts:aes-256-xts
[    6.176340] [pid=1][BEGET][INFO][fstab_mount.c:81]Execute /system/bin/resize.f2fs begin
[    6.280558] [pid=1][BEGET][INFO][fstab_mount.c:94]Execute /system/bin/resize.f2fs end
[    6.280700] [pid=1][BEGET][INFO][fstab_mount.c:81]Execute /system/bin/fsck.f2fs begin
[    6.293583] [pid=1][BEGET][INFO][fstab_mount.c:94]Execute /system/bin/fsck.f2fs end
[    6.293799] [pid=1][BEGET][ERROR][fstab_mount.c:283]access /dev/block/platform/fe2e0000.mmc/by-name/userdata ok
[    6.294340] [pid=1][BEGET][ERROR][fstab_mount.c:289]Mount rc = -1, strerr: No such device
[    6.294357] [pid=1][BEGET][ERROR][fstab_mount.c:398]Mount device /dev/block/platform/fe2e0000.mmc/by-name/userdata to /data return, rc = -1
[    6.294370] [pid=1][BEGET][ERROR][fstab_mount.c:400]InitPostMount rc = -1
[    6.294385] [pid=1][BEGET][WARNING][fstab_mount.c:405]Mount /dev/block/platform/fe2e0000.mmc/by-name/userdata to /data failed, err = 19. Ignore failure
[    6.294399] [pid=1][BEGET][ERROR][fstab_mount.c:407]Zhangyd: enter console
[    6.294428] process 'init' launched '/bin/sh' with NULL argv: empty string added
[    6.306990] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
作者: 闲散鸿-Zdd    时间: 2024-7-5 15:42
回复 润开鸿_闻飞: 从最新log看,[fstab_mount.c:283]access /dev/block/platform/fe2e0000.mmc/by-name/userdata ok,但mount后就会出现Mount rc = -1, strerr: No such device。从上面看Ueventd已经symlink /dev/block/mmcblk0p12->/dev/block/platform/fe2e0000.mmc/by-name/userdata。现在可能就是mount里的问题
作者: 润开鸿_闻飞    时间: 2024-7-5 16:15
回复 闲散鸿-Zdd: 你是什么产品?,内核是不是在用gcc编译?




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5