Using initramfs shell
First up, you can modify the initrd environment to give yourself more programs if needed. Don't forget the shared libraries a program might need to run!
Boot the system and catch the Grub menu. If you can't catch it (because someone possibly set the wait to zero), hold down the left shift button during boot.
Press "e" to edit the kernel command line and add "break=" onto it, where is one of following:
- top - loaded functions and parsed command line to setup environment variables
- modules - just before modules are to be loaded
- premount - before prep work to be able to mount file systems
- mount - prior to loading the scripts needed to mount the root
- mountroot - just before the file systems are mounted onto /root
- bottom - before running the bottom scripts
- init - just about to run the real init
You can see exactly where these break points are called by extracting the initrd and reading /init. They are the "maybe_break" calls.
To exit the shell, just hit ctrl-d or type exit. The system will continue to boot as per normal, unless you've stuffed it while in there.
More info about using it here: https://wiki.debian.org/InitramfsDebug