1

I'm running raspi-config on remote hosts non-interactively, using Ansible. Since there is no TTY attached, opening dialogs with whiptail will make the system get stuck.

Versions:

Debian: Bookworm

raspi-config: 20231216

As an example, when running raspi-config to configure the serial port:

sudo raspi-config nonint do_serial 0

...raspi-config will open a whiptail dialog:

enter image description here

Is it possible to prevent raspi-config from opening the dialog, so it can be non-interactively?

I had a look at the raspi-config source code but could not find anything related: https://github.com/RPi-Distro/raspi-config

1
  • what about line 6 of raspi-config?
    – jsotola
    Commented Jan 3 at 17:17

1 Answer 1

1

The option you need to invoke raspi-config in a non-interactive mode is:

sudo raspi-config nonint <command>

A list of commands is available in the "Official Documentation", and some caveats/warnings/etc re use of the non-interactive option.

However, there is no do_serial option listed; there are do_serial_hw and do_serial_cons options - but no do_serial. And so I suspect that the ncurses gui for raspi-config has been called because your chosen option doesn't exist.

3
  • As you see in my question I'm running the command with nonint already, but its still showing the dialog. When running the command remotely without a TTY, it will get stuck. Commented Jan 3 at 20:56
  • @Wolkenarchitekt: I am connected to my RPi 5 (running 'bookworm') via SSH. I enter this command, and it executes from the CLI without bringing up the ncurses GUI: sudo raspi-config nonint do_hostname raspberrypi5. Try that - just to validate the theory that I've advanced in the edit to my answer.
    – Seamus
    Commented Jan 3 at 22:44
  • Ok, looks like do_serial is kind of undocumented, and also does not consider nonint like the other documented commands. So its kind of a bug. Running commands with nonint still seems to be the answer somehow, so accepting Commented Jan 7 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.