From f48a62126a8771be7e8784997cc26b008ab292df Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Thu, 28 Nov 2024 15:39:29 -0300 Subject: [PATCH] blueos_startup_update: add step for symlinking i2c3 to i2c4 on Pi5 --- .../blueos_startup_update/blueos_startup_update.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/tools/blueos_startup_update/blueos_startup_update.py b/core/tools/blueos_startup_update/blueos_startup_update.py index 537368738..305ed5501 100755 --- a/core/tools/blueos_startup_update/blueos_startup_update.py +++ b/core/tools/blueos_startup_update/blueos_startup_update.py @@ -245,6 +245,19 @@ def update_cgroups() -> bool: return True +def update_i2c4_symlink() -> bool: + logger.info("Running i2c4 symlink update..") + i2c4_symlink = "/dev/i2c-4" + i2c4_device = "/dev/i2c-3" + if os.path.exists(i2c4_symlink): + return False + if not os.path.exists(i2c4_device): + return False + command = f"sudo ln -s {i2c4_device} {i2c4_symlink}" + run_command(command, False) + return False # This patch doesn't require restart to take effect + + def update_dwc2() -> bool: logger.info("Running dwc2 update..") @@ -473,6 +486,7 @@ def main() -> int: [ update_cgroups, update_dwc2, + update_i2c4_symlink, ] ) if host_os == HostOs.Bookworm: