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 Answers1

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.

Seamus
  • 21,900
  • 3
  • 33
  • 70
  • 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. – Wolkenarchitekt Jan 03 '24 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 Jan 03 '24 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 – Wolkenarchitekt Jan 07 '24 at 09:26