summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-02-12 19:58:52 +0100
committerSteve Sakoman <steve@sakoman.com>2025-02-24 07:00:53 -0800
commit73aef33dfa39822cd7ea2f07b9939134c015729d (patch)
tree2c7bca77d4bd934aa567657653f084f5c54595a8
parent3b0b758d2e104358d79bd1a551858314c2fd92ac (diff)
downloadpoky-73aef33dfa39822cd7ea2f07b9939134c015729d.tar.gz
scritps/runqemu: Ensure we only have two serial ports
I have a theory that some of the console boot issues we're seeing are due to starting images with three serial ports yet only starting gettys on two of them. This means that occasionally, depending on the port numbering we may not get a login prompt on the console we expect it on. To fix this, change the runqemu code so that if serial ports are passed in on the commandline (as is the case in automated testing), we don't add any other GUI serial consoles. We do need to make sure we do have at least two serial ports since we don't want getty timeout warnings. (From OE-Core rev: 44e1279970d306b0da4fcc11f9e780915f481819) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1b0348535dce3b776efbcf26406b94730a51eb85) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rwxr-xr-xscripts/runqemu17
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 8a417a7c24..9f7827565e 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1408,6 +1408,19 @@ to your build configuration.
1408 for entry in self.get('SERIAL_CONSOLES').split(' '): 1408 for entry in self.get('SERIAL_CONSOLES').split(' '):
1409 self.kernel_cmdline_script += ' console=%s' %entry.split(';')[1] 1409 self.kernel_cmdline_script += ' console=%s' %entry.split(';')[1]
1410 1410
1411 # We always wants ttyS0 and ttyS1 in qemu machines (see SERIAL_CONSOLES).
1412 # If no serial or serialtcp options were specified, only ttyS0 is created
1413 # and sysvinit shows an error trying to enable ttyS1:
1414 # INIT: Id "S1" respawning too fast: disabled for 5 minutes
1415 serial_num = len(re.findall("-serial", self.qemu_opt))
1416
1417 # Assume if the user passed serial options, they know what they want
1418 # and pad to two devices
1419 if serial_num == 1:
1420 self.qemu_opt += " -serial null"
1421 elif serial_num >= 2:
1422 return
1423
1411 if self.serialstdio == True or self.nographic == True: 1424 if self.serialstdio == True or self.nographic == True:
1412 self.qemu_opt += " -serial mon:stdio" 1425 self.qemu_opt += " -serial mon:stdio"
1413 else: 1426 else:
@@ -1419,10 +1432,6 @@ to your build configuration.
1419 1432
1420 self.qemu_opt += " %s" % self.get("QB_SERIAL_OPT") 1433 self.qemu_opt += " %s" % self.get("QB_SERIAL_OPT")
1421 1434
1422 # We always wants ttyS0 and ttyS1 in qemu machines (see SERIAL_CONSOLES).
1423 # If no serial or serialtcp options were specified, only ttyS0 is created
1424 # and sysvinit shows an error trying to enable ttyS1:
1425 # INIT: Id "S1" respawning too fast: disabled for 5 minutes
1426 serial_num = len(re.findall("-serial", self.qemu_opt)) 1435 serial_num = len(re.findall("-serial", self.qemu_opt))
1427 if serial_num < 2: 1436 if serial_num < 2:
1428 self.qemu_opt += " -serial null" 1437 self.qemu_opt += " -serial null"