-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Fix] grub: workaround for OTA failure/otaclient crashing if rootfs is not sda #258
Conversation
TODO: generate the keys/certs for test use on every test run. |
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'd like to ask one question.
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 a comment, please have a check!
otaclient/app/boot_control/_grub.py
Outdated
slot_name = dev_path.lstrip("/dev/") | ||
_dev_path_ma = self.DEV_PATH_PA.match(dev_path) | ||
assert _dev_path_ma and ( | ||
_pid := _dev_path_ma.group("partition_id") |
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.
Make sure that the operation with side-effects(=assignment) should not be used with the assert. assert can be removed by the option.
It is OK if _pid
is assigned out side of the assert expression.
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.
Updated at 74d4dd3.
otaclient/app/boot_control/_grub.py
Outdated
slot_name = dev_path.lstrip("/dev/") | ||
_dev_path_ma = self.DEV_PATH_PA.match(dev_path) | ||
assert _dev_path_ma and ( | ||
_pid := _dev_path_ma.group("partition_id") |
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.
same assignment in the assert expression.
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.
Updated at a92b60a.
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.
LGTM 👍
FYI: 2Mbps test has been passed. |
Commits from v3.6.0 to v3.6.1 * Bug fix 1. [Fix] grub: fix unintended behavior when updating grub_default #253 2. (Major) [Fix] grub: workaround for OTA failure/otaclient crashing if rootfs is not sda #258 * Refinement 1. [Chore] minor update and fix to tools.status_monitor #256 2. (Major) [Refinement] refine error handling, error report on status API now covers boot controller startup failure #259 * Chore 1. [Chore] minor update and fix to tools.status_monitor #256
Check issue reproduce and testing report for more details. |
Description
This PR applies a workaround to deal with otaclient crashing and OTA failed when rootfs device is not assigned name as
sda
.With this PR, the slot naming is decoupled with the actual device name, the slot name will be fixed to
sda<partition_id>
, and otaclient will search for ota-partition folder with the slot name.For example, if rootfs device is
nvme0n1
, andactive dev: nvme0n1p3
,standby dev: nvme0n1p4
, then the slot_id for active slot is stillsda3
, for standby slot is stillsda4
.WIth workaround implemented this PR, OTA will work if no matter when the rootfs device's name changed and what name is assigned to rootfs device.
Warning
Deprecation Warning: the current slot managing/detecting mechanism design is proved to be not so robust, with the inaccurate assumption that rootfs device will always be assigned name as
sda
.This PR is served as a quick workaround to make otaclient properly functioning if the above assumption is broken due to rootfs device is not name as
sda
. This PR doesn't mean to solve the problem fundamentally, but just for maintaining backward compatibility.Important
A new mechanism to managing/detecting slot will be introduced in the future to replace the current mechanism.
Check list
ota-partition.sda
doesn't impact otaclient's functionality.Check issue reproduce and testing report for more details.
Bug fix
Current behavior
ota-partition.sda*
presented,ota-partition.sdb*
,ota-partition.nvme0n1p*
, etc).Behaivor after fix
sda<partition_id>
,Related links & ticket
RT4-7472
TODO
(unrelated) the keys and certs for testing metadata are expired, in the future generate these keys and certs on every test.