How to Crash TorizonCore's initramfs into a Shell on Purpose

I have a related post, but I thought it would be best to make this a separate topic @hfranco.tx .

I’d like to try flashing the default TorizonCore image to my Apalis i.MX8’s eMMC via TEZI, but have Torizon’s initramfs crash into a shell for me to poke around, instead of continuing with the bootup. This would allow me to manually find, and switch_root to a Torizon rootfs on a connected SSD.

I’ve successfully done this in the past with my own image by using

devtool modify initramfs-framework

and simply modifying the source file “rootfs” to include a

exec sh

somewhere in the script. (added benefit that I am still PID 1 in this case)
However, the same strategy gives me the following warnings when I attempt to run the devtool modify command in my Torizon build directory:

$ devtool modify initramfs-framework
NOTE: Starting bitbake server...
INFO: Creating workspace layer in /home/kinnard/Documents/Torizon/build-torizon/workspace
NOTE: Reconnecting to bitbake server...
NOTE: Retrying server connection (#1)...
WARNING: /home/kinnard/Documents/Torizon/build-torizon/conf/../../layers/meta-toradex-torizon/recipes-images/images/torizon-core-lite.bb: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
WARNING: /home/kinnard/Documents/Torizon/build-torizon/conf/../../layers/meta-toradex-torizon/recipes-images/images/torizon-core-podman.bb: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
WARNING: /home/kinnard/Documents/Torizon/build-torizon/conf/../../layers/meta-toradex-torizon/recipes-images/images/torizon-core-docker.bb: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
WARNING: /home/kinnard/Documents/Torizon/build-torizon/conf/../../layers/meta-security/recipes-security/images/security-test-image.bb: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
WARNING: /home/kinnard/Documents/Torizon/build-torizon/conf/../../layers/meta-security/recipes-security/images/security-build-image.bb: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
WARNING: /home/kinnard/Documents/Torizon/build-torizon/conf/../../layers/meta-security/recipes-security/images/security-server-image.bb: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
WARNING: /home/kinnard/Documents/Torizon/build-torizon/conf/../../layers/meta-security/recipes-security/images/security-client-image.bb: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
WARNING: /home/kinnard/Documents/Torizon/build-torizon/conf/../../layers/meta-security/recipes-core/images/dm-verity-image-initramfs.bb: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
etc... for pretty much every bb file. 

Any help would be appreciated, thanks!

*Edit: I’ve likewise not found a solution using the Torizon Builder Tool to accomplish the same task.

Greetings @jonk4m,

It’s actually not necessary to rebuild TorizonCore to get into the initramfs shell. Instead you can do the following in U-Boot:

Run the following commands in the U-Boot prompt to get a shell in initramfs:

setenv tdxargs plymouth.debug shell
boot

An alternative is setting the ramdisk init application:

setenv tdxargs rdinit=/bin/sh
boot

Either method should drop you inside the initramfs shell to poke around.

Best Regards,
Jeremias