-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[platform] Add Support For Environment Variable File #5010
[platform] Add Support For Environment Variable File #5010
Conversation
5261f5f
to
9b03c94
Compare
platform/broadcom/sonic-platform-modules-dell/s6000/scripts/s6000_platform.sh
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please review some of my comments.
The changes are look good, I'd suggest to move all include operations to the first lines of the file. Like include first and than use the values here and there
there is a build failure, looks like related to your change. |
Looking into it this failure. |
This PR adds the ability to read environment file from /etc/sonic. the file contains immutable SONiC config attributes such as platform, hwsku, version, device_type. The aim is to minimize calls being made into sonic-cfggen during boot time. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
1. move sonic-environment relocation from union-mount to rc.local 2. remove SONIC_HOSTNAME envvar
c68086d
to
1ed0981
Compare
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} | ||
HWSKU=${HWSKU:-`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest using the same syntax for these variables. Either change former to 'DEVICE_METADATA["localhost"]["platform"]'
or change latter to DEVICE_METADATA.localhost.hwsku
PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} | ||
HWSKU=${HWSKU:-`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]'`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest using the same syntax for these variables. Either change former to 'DEVICE_METADATA["localhost"]["platform"]'
or change latter to DEVICE_METADATA.localhost.hwsku
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two minor suggested syntactical changes for pre-existing code. In the interest of getting this merged and not waiting for a new cycle of check builds, I'm approving this PR; we can clean up the syntax in a future PR.
* [platform] Add Support For Environment Variable This PR adds the ability to read environment file from /etc/sonic. the file contains immutable SONiC config attributes such as platform, hwsku, version, device_type. The aim is to minimize calls being made into sonic-cfggen during boot time. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
* [platform] Add Support For Environment Variable This PR adds the ability to read environment file from /etc/sonic. the file contains immutable SONiC config attributes such as platform, hwsku, version, device_type. The aim is to minimize calls being made into sonic-cfggen during boot time. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
This PR adds the ability to read environment file from /etc/sonic.
the file contains immutable SONiC config attributes such as platform,
hwsku, version, device_type. The aim is to minimize calls being made
into sonic-cfggen during boot time.
singed-off-by: Tamer Ahmed tamer.ahmed@microsoft.com
- Why I did it
Added ability to read environment var file
- How I did it
New code that detect presence of such file during bootstrapping an image, the file is then moved to /etc/sonic
- How to verify it
This is infra work and image should boot normally in the absence of such file.
- Description for the changelog