0

I am working on a "GNU/Linux on Android" type of project that is based on Mikael Q. Kuisma's work here .

I built a tool that downloads a toolchain, compiles the kernel, archives the custom ramdisk, and finally bundles them into a boot image.

Expected result:

  • Kernel boots.
  • Ramdisk gets loaded and /init is executed using /sbin/busybox.

Actual result:

  • Kernel does boot.
  • The kernel never seems to reach /init, and hangs without panicking.

I've tried adding calls to /sbin/busybox poweroff in the /init script to see if it was actually reaching execution, nothing changed.

I identified a few points that seemed problematic, one being this:

[    3.880314] Warning: unable to open an initial console.
[    3.880429] Waiting for root device ... # Might be the problem.
[    4.882304] lct will vote for sdp current
[    4.882437] pmi632_charger: smblib_update_usb_type: lct v02 battery charge APSD=SDP PD=0
[    4.889933] msm-dwc3 7000000.ssusb: DWC3 exited from low power mode
[    5.520181] of_batterydata_get_best_profile: light_4000mAh found
[    8.760236] cfg_timer_func enter
[    8.760267] cfg_work_routine enter
# Nothing appears after this point...

I have included the source code for my build tool with the kernel log buffer in this git repository. You can find the defconfig I used for the kernel build here.

Any help would be appreciated. :)

Eralp Ç.
  • 41
  • 3
  • Did you populated `/dev/` with some `mknod` commands like */dev/console*, so that busybox could set *stdin*, *stdout* and *stderr*. This is why you can not see anything. – artless noise Jan 10 '22 at 03:38
  • In the answer [Can thumb be a _start](https://stackoverflow.com/questions/20369440/can-start-be-the-thumb-function/20379933?r=SearchResults&s=2|21.6486#20379933), you can modify/duplicate `exit()` to implement `write()` and print something. This is a program that is minimal. If you call `exit()`, you can see the message *init exited!*. But busybox should work if the devices are setup properly. Also see [How to populate dev](https://unix.stackexchange.com/questions/52713/how-to-populate-dev-directory-when-building-my-own-initrd), where devtmpfs is given as an answer. – artless noise Jan 10 '22 at 03:51
  • I'll try populating `/dev` and try my luck again. Thanks for the suggestion :) – Eralp Ç. Jan 10 '22 at 17:57

0 Answers0