From a99048f0b1bd95f1d9b78030041e6e5ac178309c Mon Sep 17 00:00:00 2001 From: Remy MARTIN Date: Fri, 10 Nov 2023 10:34:42 +0200 Subject: [PATCH] Set grub timeouts to 0 to workaround reboot getting stuck if spurious input is received on serial --- .../devices/muxpi/muxpi.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py b/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py index 1d0ea719..0380b0aa 100644 --- a/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py +++ b/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py @@ -322,6 +322,20 @@ def create_user(self, image_type): ) cmd = f"sudo cp {remote_tmp}/user-data {ci_path}" self._run_control(cmd) + + # Set grub timeouts to 0 to workaround reboot getting stuck + # if spurious input is received on serial + cmd = ( + "sudo sed -i 's/timeout=[0-9]*/timeout=0/g' " + f"{base}/boot/grub/grub.cfg" + ) + self._run_control(cmd) + cmd = ( + f"grep -rl 'GRUB_TIMEOUT=' {base}/etc/default/ | xargs " + "sudo sed -i 's/GRUB_TIMEOUT=[0-9]*/GRUB_TIMEOUT=0/g'" + ) + self._run_control(cmd) + self._configure_sudo() return if image_type == "pi-desktop":