2

My goal is to boot the Raspberry Pi into the console and auto-run a script. I looked at this question for help.

The Raspberry Pi does boot into the console and runs the desired script, but sadly the script fails after the second command resulting in the console not doing anything anymore. (the script did work with the GUI).

I can still type but the console doesn't respond to any commands. Is there a way to force the Raspberry Pi to reboot into GUI? Can I somehow use "recovery mode" for this?

Maarten Hartman
  • 247
  • 1
  • 3
  • 12
  • You should be able to mount the SD card in the recovery mode and change the boot up script to not execute that script. Then the Pi would boot normally. Would have to run sudo mount to do it. Have you tried that? – RPiAwesomeness Jan 10 '14 at 23:01
  • can't try it right now, but I think it won't work. The console won't respond to no commands after the custom startup script crashes. How can I make the console respond to my commands? Note: the script runs automatically on boot to console, can I abort the script it with ctrl + c or a other command? – Maarten Hartman Jan 11 '14 at 00:37
  • I meant in recovery/emergency mode. You could also pop the SD card into your PC and then comment out the line in the bashrc file that starts the offending script. You can also pull some of the logs off the Pi and post them online so we can view them. – RPiAwesomeness Jan 11 '14 at 01:46
  • You can get to the recovery mode by holding shift during the boot. Should keep your script from executing, allowing you to boot and fix the issue to an extent. Read this question: http://raspberrypi.stackexchange.com/questions/1416/what-is-the-difference-between-raspbian-kernels-in-official-image that explains the difference between the kernels. You can boot the emergency kernel by renaming kernel.img to kernel.img and kernel_emergency.img to kernel.img. Should work the same as holding shift. – RPiAwesomeness Jan 11 '14 at 01:49
  • okay I got a bit further. I can now boot into emergency and I can edit the config.txt file. How can I use the config file to boot into the GUI? Or what command can I use to boot into the GUI from emergency mode? Sudo and nano for example are all unavailable. – Maarten Hartman Jan 11 '14 at 20:41
  • Can you run raspi-config? – RPiAwesomeness Jan 11 '14 at 20:56
  • no :( only basic commands like cd and ls. And I can edit config.txt via the recovery mode, so that gives hope.. – Maarten Hartman Jan 11 '14 at 20:58
  • Pressing [ALT]+[F2] will open a separate console. Might help here. – Gerben Jan 12 '14 at 13:31

1 Answers1

3

OP decided in chat that it would be easier and take less time to simply re-flash and move files back on afterwards.

I'm just posting this until the OP creates a self-answer.

RPiAwesomeness
  • 3,001
  • 4
  • 30
  • 51