Skip to content

[armhf][sonic-installer] Fix an issue of the sonic-installer install after the cleanup#12609

Merged
yxieca merged 1 commit intosonic-net:masterfrom
mlok-nokia:armhf-uboot-config
Dec 2, 2022
Merged

[armhf][sonic-installer] Fix an issue of the sonic-installer install after the cleanup#12609
yxieca merged 1 commit intosonic-net:masterfrom
mlok-nokia:armhf-uboot-config

Conversation

@mlok-nokia
Copy link
Contributor

@mlok-nokia mlok-nokia commented Nov 4, 2022

Why I did it

When using sonic-installer to set-default and cleanup image or install a third image as the following steps, issues ocur.

  1. (onie-nos-install ) Install first image A
  2. (sonic-installer) Install Image B and not reboot it
  3. (sonic-installer) set default to back to Image A
  4. sudo sonic-installer cleanup
    At this time, executing sonic-installer list will throw exception
  5. If install an image C, the current running image A been removed unexpected

How I did it

When install a image without rebooting, uboot setting is not able to identify which (sonic_version_ sonic_version_2) should be use for the next image installed or cleanup after the set default. Modified the platform.conf to use the current running image from /proc/cmdline to identify eother sonic_version_ or sonic_version_2 should be used for the new installation.

This PR work with sonic-net/sonic-utilities#2479

How to verify it

Using the following test case to verify it
Case 1:

  1. (onie-nos-install ) Install first image A (SONiC-OS-202012.0-dirty-20221104.031351)
  2. (sonic-installer) Install Image B (SONiC-OS-202205.0-dirty-20221104.050857) and not reboot it
  3. (sonic-installer) set default to back to Image A
  4. sudo sonic-installer cleanup
  5. execute sonic-installer list, it should list image A as expected
admin@sonic:~$ sudo sonic-installer list
Current: SONiC-OS-202012.0-dirty-20221104.031351
Next: SONiC-OS-202012.0-dirty-20221104.031351
Available: 
SONiC-OS-202012.0-dirty-20221104.031351

Case 2:
6) sonic-installer install an image C (SONIC-OS-202205.0-dirty-20221104.050348)
7) sonic-installer list. It should lis image as expected

admin@sonic:~$ sudo sonic-installer list
Current: SONiC-OS-202012.0-dirty-20221104.031351
Next: SONIC-OS-202205.0-dirty-20221104.050348
Available: 
SONiC-OS-202012.0-dirty-20221104.031351
SONIC-OS-202205.0-dirty-20221104.050348

Case 3:
8) reboot the system.
9) sonic-installer list

admin@sonic:~$ sudo sonic-installer list
Current: SONIC-OS-202205.0-dirty-20221104.050348
Next: SONIC-OS-202205.0-dirty-20221104.050348
Available: 
SONiC-OS-202012.0-dirty-20221104.031351
SONIC-OS-202205.0-dirty-20221104.050348

Case 4
10) sonic-installer install the image A.
11) it should be indicated that the image has been installed and just set to default.

admin@ixs-7215-pizza9:~$ sudo sonic-installer install /tmp/sonic-marvell-armhf.bin
New image will be installed, continue? [y/N]: y
Image SONiC-OS-202012.0-dirty-20221104.031351 is already installed. Setting it as default...
Command: /usr/bin/fw_setenv boot_next "run sonic_image_2"

Command: sync;sync;sync

Command: sleep 3

Done

case 5:
12 execute sonic-installer list

Current: SONIC-OS-202205.0-dirty-20221104.050348
Next: SONiC-OS-202012.0-dirty-20221104.031351
Available: 
SONiC-OS-202012.0-dirty-20221104.031351
SONIC-OS-202205.0-dirty-20221104.050348

Case 6:
13) reboot the device
14) and sonic-installer list

admin@sonic:~$ sudo sonic-installer list
Current: SONiC-OS-202012.0-dirty-20221104.031351
Next: SONiC-OS-202012.0-dirty-20221104.031351
Available: 
SONiC-OS-202012.0-dirty-20221104.031351
SONIC-OS-202205.0-dirty-20221104.050348

Case 7:
15) sonic-installer set-default to image C (SONIC-OS-202205.0-dirty-20221104.050348)
16) sonic-installer list

Current: SONiC-OS-202012.0-dirty-20221104.031351
Next: SONIC-OS-202205.0-dirty-20221104.050348
Available: 
SONiC-OS-202012.0-dirty-20221104.031351
SONIC-OS-202205.0-dirty-20221104.050348

Case 8:
17) reboot the device
18) sonic-installer list

Current: SONIC-OS-202205.0-dirty-20221104.050348
Next: SONIC-OS-202205.0-dirty-20221104.050348
Available: 
SONiC-OS-202012.0-dirty-20221104.031351
SONIC-OS-202205.0-dirty-20221104.050348

Case 9:
19) install image B (SONiC-OS-202205.0-dirty-20221104.050857)
20) sonic-installer list

Current: SONIC-OS-202205.0-dirty-20221104.050348
Next:  SONiC-OS-202205.0-dirty-20221104.050857
Available: 
SONiC-OS-202205.0-dirty-20221104.050857
SONIC-OS-202205.0-dirty-20221104.050348

Case 10:
21) reboot the device
22) sonic-installer list

Current: SONiC-OS-202205.0-dirty-20221104.050857
Next:  SONiC-OS-202205.0-dirty-20221104.050857
Available: 
SONiC-OS-202205.0-dirty-20221104.050857
SONIC-OS-202205.0-dirty-20221104.050348

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mlok-nokia mlok-nokia requested a review from lguohan as a code owner November 4, 2022 19:59
@mlok-nokia
Copy link
Contributor Author

@carl-nokia @jon-nokia Please review the platform.conf change for the armhf platform installation issue

@Blueve
Copy link
Contributor

Blueve commented Nov 7, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Blueve pushed a commit to sonic-net/sonic-utilities that referenced this pull request Nov 9, 2022
…set-default and cleanup (#2479)

What I did
sonic-installer list will throw a exception when install images as the following step

(onie-nos-install ) Install first image A
(sonic-installer) Install Image B and not reboot it
(sonic-installer) set default to back to Image A
sudo sonic-installer cleanup
At this time, executing sonic-installer list will throw exception

How I did it
Modify the get_next_image() in uboot.py to check and return index 1 when the images list contains two elements.
This PR should work with sonic-net/sonic-buildimage#12609

This PR is needed by branch 202012 and 2022o5

Signed-off-by: mlok <[email protected]>
@Blueve
Copy link
Contributor

Blueve commented Nov 9, 2022

Let's merge this PR after all sonic-utilites submodule advanced with new fix

yxieca pushed a commit to sonic-net/sonic-utilities that referenced this pull request Nov 10, 2022
…set-default and cleanup (#2479)

What I did
sonic-installer list will throw a exception when install images as the following step

(onie-nos-install ) Install first image A
(sonic-installer) Install Image B and not reboot it
(sonic-installer) set default to back to Image A
sudo sonic-installer cleanup
At this time, executing sonic-installer list will throw exception

How I did it
Modify the get_next_image() in uboot.py to check and return index 1 when the images list contains two elements.
This PR should work with sonic-net/sonic-buildimage#12609

This PR is needed by branch 202012 and 2022o5

Signed-off-by: mlok <[email protected]>
@yxieca
Copy link
Contributor

yxieca commented Nov 10, 2022

@Blueve I've cherry-picked the utilities PR to 202205. Are you going to move utilities submodule head for master then merge this PR?

@Blueve
Copy link
Contributor

Blueve commented Nov 11, 2022

Hi @mlok-nokia , can you help advance sonic-utilities submodule for master and internal branches? Then we can merge this PR and cherry-pick to 202205

mlok-nokia added a commit to mlok-nokia/sonic-utilities that referenced this pull request Nov 14, 2022
…set-default and cleanup (sonic-net#2479)

What I did
sonic-installer list will throw a exception when install images as the following step

(onie-nos-install ) Install first image A
(sonic-installer) Install Image B and not reboot it
(sonic-installer) set default to back to Image A
sudo sonic-installer cleanup
At this time, executing sonic-installer list will throw exception

How I did it
Modify the get_next_image() in uboot.py to check and return index 1 when the images list contains two elements.
This PR should work with sonic-net/sonic-buildimage#12609

This PR is needed by branch 202012 and 2022o5

Signed-off-by: mlok <[email protected]>
(cherry picked from commit d1ca2cd)
Blueve pushed a commit to sonic-net/sonic-utilities that referenced this pull request Nov 16, 2022
… of sonic-installer list after set-default and cleanup (#2479) (#2497)

What I did
sonic-installer list will throw a exception when install images as the following step

(onie-nos-install ) Install first image A
(sonic-installer) Install Image B and not reboot it
(sonic-installer) set default to back to Image A
sudo sonic-installer cleanup
At this time, executing sonic-installer list will throw exception

How I did it
Modify the get_next_image() in uboot.py to check and return index 1 when the images list contains two elements.
This PR should work with sonic-net/sonic-buildimage#12609

This PR is needed by branch 202012 and 2022o5

Signed-off-by: mlok <[email protected]>
(cherry picked from commit d1ca2cd)
@mlok-nokia
Copy link
Contributor Author

@Blueve I've cherry-picked the utilities PR to 202205. Are you going to i Jing, Misunderstood in the meeting. You want me to rebase the change to the latest. Then you can continue with merge without conflict.

@mlok-nokia mlok-nokia closed this Nov 17, 2022
@mlok-nokia
Copy link
Contributor Author

@Blueve I've cherry-picked the utilities PR to 202205. Are you going to move utilities submodule head for master then merge this PR?

Hi Ying, This PR have NO dependency with other PR in submodule sonic-utilities.

@mlok-nokia
Copy link
Contributor Author

mlok-nokia commented Nov 17, 2022

Hi @mlok-nokia , can you help advance sonic-utilities submodule for master and internal branches? Then we can merge this PR and cherry-pick to 202205

Hi Jing, This PR has NO dependency with other PR. They address different issues. Thanks.

@mlok-nokia mlok-nokia reopened this Nov 17, 2022
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
…set-default and cleanup (sonic-net#2479)

What I did
sonic-installer list will throw a exception when install images as the following step

(onie-nos-install ) Install first image A
(sonic-installer) Install Image B and not reboot it
(sonic-installer) set default to back to Image A
sudo sonic-installer cleanup
At this time, executing sonic-installer list will throw exception

How I did it
Modify the get_next_image() in uboot.py to check and return index 1 when the images list contains two elements.
This PR should work with sonic-net/sonic-buildimage#12609

This PR is needed by branch 202012 and 2022o5

Signed-off-by: mlok <[email protected]>
mdanish-kh pushed a commit to mdanish-kh/sonic-utilities that referenced this pull request Nov 23, 2022
…set-default and cleanup (sonic-net#2479)

What I did
sonic-installer list will throw a exception when install images as the following step

(onie-nos-install ) Install first image A
(sonic-installer) Install Image B and not reboot it
(sonic-installer) set default to back to Image A
sudo sonic-installer cleanup
At this time, executing sonic-installer list will throw exception

How I did it
Modify the get_next_image() in uboot.py to check and return index 1 when the images list contains two elements.
This PR should work with sonic-net/sonic-buildimage#12609

This PR is needed by branch 202012 and 2022o5

Signed-off-by: mlok <[email protected]>
@yxieca
Copy link
Contributor

yxieca commented Dec 2, 2022

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca yxieca merged commit 8bf7a8b into sonic-net:master Dec 2, 2022
mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Dec 7, 2022
…mage after sonic-installer clean (sonic-net#12609)

Signed-off-by: mlok <[email protected]>

Signed-off-by: mlok <[email protected]>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #12977

mssonicbld pushed a commit that referenced this pull request Dec 7, 2022
…mage after sonic-installer clean (#12609)

Signed-off-by: mlok <[email protected]>

Signed-off-by: mlok <[email protected]>
qiluo-msft pushed a commit that referenced this pull request Jan 12, 2023
…mage after sonic-installer clean (#12609)

Signed-off-by: mlok <[email protected]>

Signed-off-by: mlok <[email protected]>
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
…set-default and cleanup (#2479)

What I did
sonic-installer list will throw a exception when install images as the following step

(onie-nos-install ) Install first image A
(sonic-installer) Install Image B and not reboot it
(sonic-installer) set default to back to Image A
sudo sonic-installer cleanup
At this time, executing sonic-installer list will throw exception

How I did it
Modify the get_next_image() in uboot.py to check and return index 1 when the images list contains two elements.
This PR should work with sonic-net/sonic-buildimage#12609

This PR is needed by branch 202012 and 2022o5

Signed-off-by: mlok <[email protected]>
@mlok-nokia mlok-nokia deleted the armhf-uboot-config branch September 27, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants