Skip to content

Commit 9fc630c

Browse files
[sonic_installer] temporary fix: don't migrate packages on aboot platforms (sonic-net#1607)
What I did Skip sonic package migration on aboot platform. How I did it Added a warning and skip the migration. How to verify it I changed AbootBootloader to OnieInstallerBootloader to test on my Onie device. I don't have Aboot device.
1 parent fde1d95 commit 9fc630c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

sonic_installer/main.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from swsscommon.swsscommon import SonicV2Connector
1313

1414
from .bootloader import get_bootloader
15+
from .bootloader.aboot import AbootBootloader
1516
from .common import (
1617
run_command, run_command_or_raise,
1718
IMAGE_PREFIX,
@@ -23,7 +24,7 @@
2324
from .exception import SonicRuntimeException
2425

2526
SYSLOG_IDENTIFIER = "sonic-installer"
26-
LOG_ERR = logger.Logger.LOG_PRIORITY_ERROR
27+
LOG_ERR = logger.Logger.LOG_PRIORITY_ERROR
2728
LOG_NOTICE = logger.Logger.LOG_PRIORITY_NOTICE
2829

2930
# Global Config object
@@ -140,7 +141,7 @@ def echo_and_log(msg, priority=LOG_NOTICE, fg=None):
140141
else:
141142
click.secho(msg, fg=fg)
142143
log.log(priority, msg, False)
143-
144+
144145

145146
# Function which validates whether a given URL specifies an existent file
146147
# on a reachable remote machine. Will abort the current operation if not
@@ -323,7 +324,7 @@ def migrate_sonic_packages(bootloader, binary_image_version):
323324

324325
with contextlib.ExitStack() as stack:
325326
def get_path(path):
326-
""" Closure to get path by entering
327+
""" Closure to get path by entering
327328
a context manager of bootloader.get_path_in_image """
328329

329330
return stack.enter_context(bootloader.get_path_in_image(new_image_dir, path))
@@ -433,6 +434,10 @@ def install(url, force, skip_migration=False, skip_package_migration=False):
433434

434435
update_sonic_environment(bootloader, binary_image_version)
435436

437+
if isinstance(bootloader, AbootBootloader) and not skip_package_migration:
438+
echo_and_log("Warning: SONiC package migration is not supported currenty on aboot platform due to https://github.com/Azure/sonic-buildimage/issues/7566.", LOG_ERR, fg="red")
439+
skip_package_migration = True
440+
436441
if not skip_package_migration:
437442
migrate_sonic_packages(bootloader, binary_image_version)
438443

0 commit comments

Comments
 (0)