Skip to content

[grub]: Allow ONiE oneshot boot for FW update#3935

Merged
lguohan merged 1 commit intosonic-net:masterfrom
nazariig:master-grub
Jan 21, 2020
Merged

[grub]: Allow ONiE oneshot boot for FW update#3935
lguohan merged 1 commit intosonic-net:masterfrom
nazariig:master-grub

Conversation

@nazariig
Copy link
Copy Markdown
Collaborator

Signed-off-by: Nazarii Hnydyn nazariig@mellanox.com

This small improvement enables ONiE oneshoot boot for various firmware update operations
(BIOS, CPLD, etc.):
https://opencomputeproject.github.io/onie/design-spec/firmware_update.html

The new flow allows to avoid the certain types of issues:

root@sonic:/home/admin# sonic_installer list
Current: SONiC-OS-HEAD.140-fc36ca6e
Next: SONiC-OS-HEAD.140-fc36ca6e
Available:
SONiC-OS-HEAD.140-fc36ca6e
SONiC-OS-HEAD.5-386619ac
root@sonic:/home/admin# grub-editenv /host/grub/grubenv set next_entry=2
root@sonic:/home/admin# sonic_installer list
Traceback (most recent call last):
  File "/usr/bin/sonic_installer", line 12, in <module>
    sys.exit(cli())
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/sonic_installer/main.py", line 380, in list
    nextimage = get_next_image()
  File "/usr/lib/python2.7/dist-packages/sonic_installer/main.py", line 194, in get_next_image
    next_image = images[next_image_index]
IndexError: list index out of range

Example:

root@sonic:/home/admin# sonic_installer list
Current: SONiC-OS-HEAD.140-fc36ca6e
Next: SONiC-OS-HEAD.140-fc36ca6e
Available:
SONiC-OS-HEAD.140-fc36ca6e
SONiC-OS-HEAD.5-386619ac
root@sonic:/home/admin# grub-editenv /host/grub/grubenv set onie_entry=2
root@sonic:/home/admin# sonic_installer set_next_boot SONiC-OS-HEAD.5-386619ac
Command: grub-reboot --boot-directory=/host 1
root@sonic:/home/admin# grub-editenv /host/grub/grubenv list
saved_entry=0
next_entry=1
onie_entry=2
root@sonic:/home/admin# sonic_installer list
Current: SONiC-OS-HEAD.140-fc36ca6e
Next: SONiC-OS-HEAD.5-386619ac
Available:
SONiC-OS-HEAD.140-fc36ca6e
SONiC-OS-HEAD.5-386619ac

- What I did

  • Added ONiE oneshoot boot feature

- How I did it

  • Modified grub configuration

- How to verify it

  1. grub-editenv /host/grub/grubenv set onie_entry=<onie_entry_index>

- Description for the changelog

  • N/A

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

      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``

Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
@jleveque jleveque requested a review from sujinmkang December 23, 2019 19:03
@lguohan
Copy link
Copy Markdown
Collaborator

lguohan commented Dec 27, 2019

cannot find the onie_entry spec in the url provided above. can you point out the link to the onie_entry?

@lguohan lguohan changed the title [grub]: Allow ONiE oneshoot boot for FW update [grub]: Allow ONiE oneshot boot for FW update Dec 27, 2019
@nazariig
Copy link
Copy Markdown
Collaborator Author

nazariig commented Jan 2, 2020

cannot find the onie_entry spec in the url provided above. can you point out the link to the onie_entry?

There is no official spec for this naming convention. It's just a proposal to introduce a separate Grub environment variable to control oneshoot boot for FW update. This approach allows to avoid user accident modification of next boot partition.

@nazariig
Copy link
Copy Markdown
Collaborator Author

@lguohan please merge if no further concerns

@nazariig nazariig requested a review from lguohan January 15, 2020 18:02
@nazariig
Copy link
Copy Markdown
Collaborator Author

@lguohan kindly reminder - please have a look

@lguohan lguohan merged commit bcc4e55 into sonic-net:master Jan 21, 2020
abdosi pushed a commit that referenced this pull request Feb 24, 2020
Added ONiE oneshoot boot feature

Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
pphuchar pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Mar 9, 2020
Added ONiE oneshoot boot feature

Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 24, 2020
Added ONiE oneshoot boot feature

Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
mssonicbld added a commit that referenced this pull request Jun 26, 2025
…atically (#23103)

#### Why I did it
src/sonic-utilities
```
* 84c3cd8b - (HEAD -> 202411, origin/202411) [Arista] Add Arista-7050CX3-32S-C28S4 to generic_config_updater (#3935) (24 hours ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
dgsudharsan pushed a commit to dgsudharsan/sonic-buildimage that referenced this pull request Jul 1, 2025
…AD automatically (sonic-net#1295)

#### Why I did it
src/sonic-utilities
```
* e2a1eaed - (HEAD -> 202412, origin/202412) Merge pull request sonic-net#196 from mssonicbld/sonicbld/202412-merge (23 hours ago) [mssonicbld]
* ef0659eb - Merge branch '202411' of https://github.com/sonic-net/sonic-utilities into 202412 (23 hours ago) [Sonic Automation]
* 84c3cd8b - [Arista] Add Arista-7050CX3-32S-C28S4 to generic_config_updater (sonic-net#3935) (2 days ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
vmittal-msft pushed a commit to vmittal-msft/sonic-buildimage that referenced this pull request Oct 20, 2025
…AD automatically (sonic-net#1302)

#### Why I did it
src/sonic-utilities
```
* 5d641fed - (HEAD -> 202503, origin/202503) Merge pull request sonic-net#197 from mssonicbld/sonicbld/202503-merge (23 hours ago) [mssonicbld]
* 47727466 - Merge branch '202412' of https://github.com/Azure/sonic-utilities.msft into 202503 (23 hours ago) [Sonic Automation]
* e2a1eaed - (origin/202412) Merge pull request sonic-net#196 from mssonicbld/sonicbld/202412-merge (2 days ago) [mssonicbld]
* ef0659eb - Merge branch '202411' of https://github.com/sonic-net/sonic-utilities into 202412 (2 days ago) [Sonic Automation]
* 84c3cd8b - [Arista] Add Arista-7050CX3-32S-C28S4 to generic_config_updater (sonic-net#3935) (3 days ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
mssonicbld added a commit that referenced this pull request Nov 1, 2025
…lly (#24266)

#### Why I did it
src/sonic-swss
```
* 3ccfa62 - (HEAD -> master, origin/master, origin/HEAD) [orchagent] Add FEC frame loss ratio monitoring with predictive analytics (#3869) (3 days ago) [Apoorv Sachan]
* 2018ed3 - Add mock test for IPv4/IPv6 route add/delete (#3839) (3 days ago) [meghtony]
* 47df807 - [portsorch] Fixed port comparison logic executed every doTask for every port (#3821) (3 days ago) [Stepan Blyshchak]
* 0c60bdb - [ssw][ha] use endpoint IP to for tunnel term acl (#3897) (3 days ago) [Jing Zhang]
* 80c742c - [muxorch] Fix handling mux neighbors learned after route (#3937) (4 days ago) [Nikola Dancejic]
* bd47953 - [Vnetorch] Ecmp vnet local routes (#3935) (7 days ago) [Leyza]
* 5de5922 - [FC] Set FC delay in command line parameters (#3814) (8 days ago) [Stepan Blyshchak]
* 85a0615 - [ssw][ha] set `SAI_ENI_ATTR_IS_HA_FLOW_OWNER` & `SAI_ENI_ATTR_HA_SCOPE_ID` when creating eni (#3881) (11 days ago) [Jing Zhang]
* bc40a04 - Skip flush if ring buffer is not empty or thread is not in idle (#3895) (11 days ago) [Eddie Ruan]
* ab96400 - [trim]: Update log level severity to avoid errors during attribute/enum capabilities query (#3916) (2 weeks ago) [Nazarii Hnydyn]
* 582eed0 - [vs]: Fix trimming test cases: avoid config consolidation (#3939) (2 weeks ago) [Nazarii Hnydyn]
* 34b9f36 - [vs]: Fix trimming test cases: avoid NULL OID polling (#3943) (2 weeks ago) [Nazarii Hnydyn]
* 8b8918a - [ACL] Populate SAI tunnel term correctly (#3924) (2 weeks ago) [Vivek]
* fb56d6d - Maximum non-zero FEC histogram bin (#3919) (2 weeks ago) [Prince George]
* c87bf6c - [FC] Reduce sairedis calls by efficient caching (#3854) (3 weeks ago) [Vivek]
* 287461b - [vs]: Remove non-default objects on dynamic buffer model teardown (#3931) (3 weeks ago) [Nazarii Hnydyn]
* 36c598c - Make fpmsyncd capable of handling route replace semantics (#3872) (3 weeks ago) [venkit-nexthop]
```
#### How I did it
#### How to verify it
#### Description for the changelog
ashutosh-agrawal pushed a commit to AnantKishorSharma/sonic-buildimage that referenced this pull request Nov 30, 2025
…lly (sonic-net#24266)

#### Why I did it
src/sonic-swss
```
* 3ccfa62 - (HEAD -> master, origin/master, origin/HEAD) [orchagent] Add FEC frame loss ratio monitoring with predictive analytics (sonic-net#3869) (3 days ago) [Apoorv Sachan]
* 2018ed3 - Add mock test for IPv4/IPv6 route add/delete (sonic-net#3839) (3 days ago) [meghtony]
* 47df807 - [portsorch] Fixed port comparison logic executed every doTask for every port (sonic-net#3821) (3 days ago) [Stepan Blyshchak]
* 0c60bdb - [ssw][ha] use endpoint IP to for tunnel term acl (sonic-net#3897) (3 days ago) [Jing Zhang]
* 80c742c - [muxorch] Fix handling mux neighbors learned after route (sonic-net#3937) (4 days ago) [Nikola Dancejic]
* bd47953 - [Vnetorch] Ecmp vnet local routes (sonic-net#3935) (7 days ago) [Leyza]
* 5de5922 - [FC] Set FC delay in command line parameters (sonic-net#3814) (8 days ago) [Stepan Blyshchak]
* 85a0615 - [ssw][ha] set `SAI_ENI_ATTR_IS_HA_FLOW_OWNER` & `SAI_ENI_ATTR_HA_SCOPE_ID` when creating eni (sonic-net#3881) (11 days ago) [Jing Zhang]
* bc40a04 - Skip flush if ring buffer is not empty or thread is not in idle (sonic-net#3895) (11 days ago) [Eddie Ruan]
* ab96400 - [trim]: Update log level severity to avoid errors during attribute/enum capabilities query (sonic-net#3916) (2 weeks ago) [Nazarii Hnydyn]
* 582eed0 - [vs]: Fix trimming test cases: avoid config consolidation (sonic-net#3939) (2 weeks ago) [Nazarii Hnydyn]
* 34b9f36 - [vs]: Fix trimming test cases: avoid NULL OID polling (sonic-net#3943) (2 weeks ago) [Nazarii Hnydyn]
* 8b8918a - [ACL] Populate SAI tunnel term correctly (sonic-net#3924) (2 weeks ago) [Vivek]
* fb56d6d - Maximum non-zero FEC histogram bin (sonic-net#3919) (2 weeks ago) [Prince George]
* c87bf6c - [FC] Reduce sairedis calls by efficient caching (sonic-net#3854) (3 weeks ago) [Vivek]
* 287461b - [vs]: Remove non-default objects on dynamic buffer model teardown (sonic-net#3931) (3 weeks ago) [Nazarii Hnydyn]
* 36c598c - Make fpmsyncd capable of handling route replace semantics (sonic-net#3872) (3 weeks ago) [venkit-nexthop]
```
#### How I did it
#### How to verify it
#### Description for the changelog
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Dec 4, 2025
…lly (sonic-net#24266)

#### Why I did it
src/sonic-swss
```
* 3ccfa62 - (HEAD -> master, origin/master, origin/HEAD) [orchagent] Add FEC frame loss ratio monitoring with predictive analytics (sonic-net#3869) (3 days ago) [Apoorv Sachan]
* 2018ed3 - Add mock test for IPv4/IPv6 route add/delete (sonic-net#3839) (3 days ago) [meghtony]
* 47df807 - [portsorch] Fixed port comparison logic executed every doTask for every port (sonic-net#3821) (3 days ago) [Stepan Blyshchak]
* 0c60bdb - [ssw][ha] use endpoint IP to for tunnel term acl (sonic-net#3897) (3 days ago) [Jing Zhang]
* 80c742c - [muxorch] Fix handling mux neighbors learned after route (sonic-net#3937) (4 days ago) [Nikola Dancejic]
* bd47953 - [Vnetorch] Ecmp vnet local routes (sonic-net#3935) (7 days ago) [Leyza]
* 5de5922 - [FC] Set FC delay in command line parameters (sonic-net#3814) (8 days ago) [Stepan Blyshchak]
* 85a0615 - [ssw][ha] set `SAI_ENI_ATTR_IS_HA_FLOW_OWNER` & `SAI_ENI_ATTR_HA_SCOPE_ID` when creating eni (sonic-net#3881) (11 days ago) [Jing Zhang]
* bc40a04 - Skip flush if ring buffer is not empty or thread is not in idle (sonic-net#3895) (11 days ago) [Eddie Ruan]
* ab96400 - [trim]: Update log level severity to avoid errors during attribute/enum capabilities query (sonic-net#3916) (2 weeks ago) [Nazarii Hnydyn]
* 582eed0 - [vs]: Fix trimming test cases: avoid config consolidation (sonic-net#3939) (2 weeks ago) [Nazarii Hnydyn]
* 34b9f36 - [vs]: Fix trimming test cases: avoid NULL OID polling (sonic-net#3943) (2 weeks ago) [Nazarii Hnydyn]
* 8b8918a - [ACL] Populate SAI tunnel term correctly (sonic-net#3924) (2 weeks ago) [Vivek]
* fb56d6d - Maximum non-zero FEC histogram bin (sonic-net#3919) (2 weeks ago) [Prince George]
* c87bf6c - [FC] Reduce sairedis calls by efficient caching (sonic-net#3854) (3 weeks ago) [Vivek]
* 287461b - [vs]: Remove non-default objects on dynamic buffer model teardown (sonic-net#3931) (3 weeks ago) [Nazarii Hnydyn]
* 36c598c - Make fpmsyncd capable of handling route replace semantics (sonic-net#3872) (3 weeks ago) [venkit-nexthop]
```
#### How I did it
#### How to verify it
#### Description for the changelog

Signed-off-by: Feng Pan <fenpan@microsoft.com>
xwjiang-ms pushed a commit to xwjiang-ms/sonic-buildimage that referenced this pull request Dec 22, 2025
…lly (sonic-net#24266)

#### Why I did it
src/sonic-swss
```
* 3ccfa62 - (HEAD -> master, origin/master, origin/HEAD) [orchagent] Add FEC frame loss ratio monitoring with predictive analytics (sonic-net#3869) (3 days ago) [Apoorv Sachan]
* 2018ed3 - Add mock test for IPv4/IPv6 route add/delete (sonic-net#3839) (3 days ago) [meghtony]
* 47df807 - [portsorch] Fixed port comparison logic executed every doTask for every port (sonic-net#3821) (3 days ago) [Stepan Blyshchak]
* 0c60bdb - [ssw][ha] use endpoint IP to for tunnel term acl (sonic-net#3897) (3 days ago) [Jing Zhang]
* 80c742c - [muxorch] Fix handling mux neighbors learned after route (sonic-net#3937) (4 days ago) [Nikola Dancejic]
* bd47953 - [Vnetorch] Ecmp vnet local routes (sonic-net#3935) (7 days ago) [Leyza]
* 5de5922 - [FC] Set FC delay in command line parameters (sonic-net#3814) (8 days ago) [Stepan Blyshchak]
* 85a0615 - [ssw][ha] set `SAI_ENI_ATTR_IS_HA_FLOW_OWNER` & `SAI_ENI_ATTR_HA_SCOPE_ID` when creating eni (sonic-net#3881) (11 days ago) [Jing Zhang]
* bc40a04 - Skip flush if ring buffer is not empty or thread is not in idle (sonic-net#3895) (11 days ago) [Eddie Ruan]
* ab96400 - [trim]: Update log level severity to avoid errors during attribute/enum capabilities query (sonic-net#3916) (2 weeks ago) [Nazarii Hnydyn]
* 582eed0 - [vs]: Fix trimming test cases: avoid config consolidation (sonic-net#3939) (2 weeks ago) [Nazarii Hnydyn]
* 34b9f36 - [vs]: Fix trimming test cases: avoid NULL OID polling (sonic-net#3943) (2 weeks ago) [Nazarii Hnydyn]
* 8b8918a - [ACL] Populate SAI tunnel term correctly (sonic-net#3924) (2 weeks ago) [Vivek]
* fb56d6d - Maximum non-zero FEC histogram bin (sonic-net#3919) (2 weeks ago) [Prince George]
* c87bf6c - [FC] Reduce sairedis calls by efficient caching (sonic-net#3854) (3 weeks ago) [Vivek]
* 287461b - [vs]: Remove non-default objects on dynamic buffer model teardown (sonic-net#3931) (3 weeks ago) [Nazarii Hnydyn]
* 36c598c - Make fpmsyncd capable of handling route replace semantics (sonic-net#3872) (3 weeks ago) [venkit-nexthop]
```
#### How I did it
#### How to verify it
#### Description for the changelog

Signed-off-by: xiaweijiang <xiaweijiang@microsoft.com>
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.

7 participants