-
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
[install.sh] install different platform image should be blocked #13153
Conversation
- What I did 1. Check platform and asic before install the image, if the platform and asic version is different with running image, the install action should be blocked. 2. This commit can block wrong installation in ONIE and CLI env. - Why I did it Install different platform-asic image will make kernel can't be reload correctly. Steps to reproduce Bug 1. Install x86 image in CLI 2. Install arm64 image in CLI 3. Install x86 image in CLI 4. reboot 5. the kernel can't be loaded, user need to insatll image by ONIE to recover it - How to verify it EX: Install build arm64 image in x86 platform, the install operation will execute fail.
@qiluo-msft , can you help and assign someone review this? |
onie_running_arch=`cat $machine_conf_path | grep onie_arch | sed -n "s/^onie_arch=\(.*\)$/\1/p"` | ||
onie_running_switch_asic=`cat $machine_conf_path | grep onie_switch_asic | sed -n "s/^onie_switch_asic=\(.*\)$/\1/p"` | ||
|
||
# bcm aisc is broadcom |
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.
There is a similar feature #8814. Could you check if this is duplicated or partially overlapped? |
elif [ "$install_env" != "build" ]; then | ||
echo "cannot find machine.conf" | ||
exit 1 | ||
fi | ||
|
||
onie_running_arch=`cat $machine_conf_path | grep onie_arch | sed -n "s/^onie_arch=\(.*\)$/\1/p"` |
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.
elif [ "$install_env" != "build" ]; then | ||
echo "cannot find machine.conf" | ||
exit 1 | ||
fi | ||
|
||
onie_running_arch=`cat $machine_conf_path | grep onie_arch | sed -n "s/^onie_arch=\(.*\)$/\1/p"` | ||
onie_running_switch_asic=`cat $machine_conf_path | grep onie_switch_asic | sed -n "s/^onie_switch_asic=\(.*\)$/\1/p"` |
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.
onie_running_switch_asic=`cat $machine_conf_path | grep onie_switch_asic | sed -n "s/^onie_switch_asic=\(.*\)$/\1/p"` | ||
|
||
# bcm aisc is broadcom | ||
if [ "$onie_running_switch_asic" = "bcm" ]; then |
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.
for kvm image, its onie_switch_asic is 'qemu'.
I prefer to keep the original design. |
@inspurSDN I see you closed this issue. Is your original issue still open? You may create a Github issue. |
How I did it
Check platform and asic before install the image, if the platform and asic version is different with running image, the install action should be blocked.
This commit can block wrong installation in ONIE and CLI env.
Why I did it
Steps to reproduce Bug
How to verify it
EX: Install build arm64 image in x86 platform, the install operation will execute fail.
Which release branch to backport (provide reason below if selected)
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)