forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[installer]: Prevent filesystem corruption (sonic-net#7264)
This improvement reads current SONiC version directly from `/proc/cmdline`. it supports `grub/aboot/uboot` bootloaders. **Code snippet**: ```bash cat /proc/cmdline | sed -n 's/^.*loop=\/*image-\(\S\+\)\/.*$/\1/p' ``` **Description**: ``` -n don't print lines s substitute ^.* matches anything before the <image_version> loop= matches <loop> kernel parameter \/*image- matches <image_version> prefix \(\S\+\) matches <image_version> group and assigns it to \1 \/.*$ matches anything after the <image_version> \1 replace everything with <image_version> p print it ``` closes sonic-net#6267 #### Why I did it * To fix sonic-net#6267 #### How I did it * Fixed installer scripts #### How to verify it 1. Write invalid SONiC version to sonic_version.yml 2. Run SONiC-To-SONiC update
- Loading branch information
1 parent
7c7c015
commit 5ea0fe9
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters