我在我的自定义initramfs目录中使用下面的命令创建了一个自定义initramfs : find。cpio
然后,我使用上面的cpio命令mkbootimg内核--ramdisk构建了一个自定义的引导。
Defconfig变量如下:
我还没有在defconfig中提供CONFIG_INITRAMFS_SOURCE变量。
内核命令行是:内核命令行: console=ttyMSM0,115200n8 androidboot.console=ttyMSM0 androidboot.configfs=true loop.max_part=7 androidboot.usbcontroller=a600000.dwc3 root=/dev/dm-0 rdinit=/init user_debug=31
在构建过程中,当我解压我的产品时,我可以看到我的initramfs。在解压缩initramfs时,我可以看到initamfs的内容。
当我用这个引导引导我的设备时,我得到以下日志:
[ 17.850396] sde: sde1 sde2 sde3 sde4 sde5 sde6 sde7 sde8 sde9 sde10 sde11 sde12 sde13 sde14 sde15 sde16 sde17 sde18 sde19 sde20 sde21 sde22 sde23 sde24 sde25 sde26 sde27 sde28 sde29 sde30 sde31 sde32 sde33 sde34 sde35 sde36 sde37 sde38 sde39 sde40 sde41 sde42 sde43 sde44 sde45 sde46 sde47 sde48 sde49 sde50 sde51 sde52 sde53 sde54 sde55 sde56
[ 17.853364] sd 0:0:0:7: [sdh] Write Protect is off
[ 17.854114] sdf: sdf1 sdf2 sdf3 sdf4 sdf5
[ 17.854573] sd 0:0:0:7: [sdh] Optimal transfer size 8192 bytes
[ 17.861410] sdg: sdg1 sdg2 sdg3 sdg4 sdg5 sdg6 sdg7 sdg8
[ 17.870417] sdh: sdh1 sdh2 sdh3 sdh4 sdh5 sdh6 sdh7 sdh8 sdh9 sdh10 sdh11 sdh12 sdh13 sdh14 sdh15 sdh16 sdh17 sdh18 sdh19 sdh20
[ 17.967128] sda: sda1 sda2 sda3 sda4 sda5 sda6 sda7 sda8 sda9 sda10
[ 17.995848] Freeing unused kernel memory: 7616K
[ 18.002632] Initramfs ---> Failed to execute /init (error -2)
[ 18.009114] Kernel panic - not syncing: Requested init /init failed (error -2).
[ 18.016482] CPU: 6 PID: 1 Comm: swapper/0 Not tainted 4.9.206+ #10
[ 18.022707] Hardware name: Qualcomm Technologies, Inc. sda845 v2.1 MTP (DT)
[ 18.029718] Call trace:
[ 18.032195] [<0000000011338cd0>] dump_backtrace+0x0/0x260
[ 18.037635] [<0000000085c2bec8>] show_stack+0x20/0x28
[ 18.042724] [<00000000d2899c10>] dump_stack+0xbc/0xf8
[ 18.047815] [<00000000bd9287e7>] panic+0x204/0x3f8
[ 18.052652] [<00000000b85fea6d>] kernel_init+0xa4/0x10c我不知道为什么内核不能读取我的/init文件
Note: my /init is a shell script of type
init: POSIX shell script, ASCII text executable.
All the binaries in initramfs are statically linked.发布于 2020-06-19 07:15:34
我找到了答案:它是sh和所有其他二进制文件的问题。它们不是为我的系统架构交叉编译的。现在,在交叉编译之后,脚本就可以工作了。
谢谢“伊恩·阿伯特”指出了这个问题
https://stackoverflow.com/questions/62429422
复制相似问题