From abf7613f8d34d7ed7bc59e7883d584625a4dd65c Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 9 Sep 2026 19:29:03 +0000 Subject: serial: T9269: test migration system 31 -> 32 for the console_type key Commit bc0b4178b already covers a missing GRUB configuration, where vars_read() returns an empty dict. A non-empty dict without console_type still raises KeyError: vars_read() drops variables written with an empty value, which grub.set_serial_console() produces for a flavor carrying no console data. --- src/migration-scripts/system/31-to-32 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/migration-scripts') diff --git a/src/migration-scripts/system/31-to-32 b/src/migration-scripts/system/31-to-32 index e92473835..89b604a7f 100644 --- a/src/migration-scripts/system/31-to-32 +++ b/src/migration-scripts/system/31-to-32 @@ -39,8 +39,9 @@ def migrate(config: ConfigTree) -> None: vars_file: str = f'{root_dir}/{CFG_VYOS_VARS}' vars_current: dict[str, str] = vars_read(vars_file) # A system without persistent GRUB storage - like VyOS running inside a - # container - has no boot console we could detect - if not vars_current: + # container - has no boot console we could detect. Neither has one whose + # GRUB vars carry no console_type, e.g. a flavor that bakes no console data + if 'console_type' not in vars_current: return # Check if VyOS installation uses serial boot console -- cgit v1.2.3