Skip to content
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

ota: Update the OTA upgrade verfication from kv base to AVB #4

Conversation

JianyuWang0623
Copy link
Member

@JianyuWang0623 JianyuWang0623 commented Dec 29, 2024

Summary

  1. ota: The OTA diff upgrade does not need anti-downgrade
    • The OTA diff upgrade does not need anti-downgrade.
    • The OTA differential package is signed using private key, that means the package is legal, and the old and new version are with the plan.
  2. ota: Remove the deprecated ota.version.next and ota.version.current (KV base)
  3. ota: Update "version_check"(aka upgrade verifiation, anti-downgrade) to AVB (AVB base)
  4. ota: Remove the uncessary exist check for partitions in /dev
  5. ota: Remove the deprecated avb_verify -c upgrade verify (KV base)
  6. ota: Remove the skip_version_check option

Impact

frameworks/system/ota

Testing

  • Diff OTA
$ ./gen_ota_zip.py old_ota_imgs ota_imgs --debug --sign

$ cat ota.sh 
set +e
setprop ota.progress.current 30
setprop ota.progress.next 100
setprop ota.version.next `getprop ota.version.current`
if [ ! -e /ota/vela_ap.bin ]
then

    echo "generate vela_ap.bin"
    time "ddelta_apply /dev/ap /data/ota_tmp/ /ota/vela_ap.patch"
    if [ $? -ne 0 ]
    then
        echo "ddelta_apply vela_ap failed"
        setprop ota.progress.current -1
        exit
    fi

    setprop ota.progress.current 100

fi
  • Full OTA with upgrade verification
$ cat ota.sh 
set +e
setprop ota.progress.current 30
setprop ota.progress.next 100

avb_verify -U /ota/vela_ap.bin /dev/ap /etc/key.avb
if [ $? -ne 0 ]
then
    echo "check vela_ap.bin version failed!"
    setprop ota.progress.current -1
    exit
fi

echo "install vela_ap.bin"
time " dd if=/ota/vela_ap.bin of=/dev/ap bs=32768 verify"
if [ $? -ne 0 ]
then
    echo "dd vela_ap.bin failed"
    reboot
fi
setprop ota.progress.current 100

@JianyuWang0623 JianyuWang0623 changed the title ota: The OTA diff upgrade does not need anti-downgrade ota: Update the OTA upgrade verfication from kv base to AVB Dec 30, 2024
@JianyuWang0623 JianyuWang0623 force-pushed the br_wjy_ota_gen_sh_diff_not_need_antidown_241229 branch 3 times, most recently from eaa85d5 to 6f64910 Compare December 30, 2024 16:38
The OTA differential package is signed using private key, that means the package is legal, and the old and new version are with the plan.

Signed-off-by: wangjianyu3 <[email protected]>
As avb_verify before has already checked.

Signed-off-by: wangjianyu3 <[email protected]>
@JianyuWang0623 JianyuWang0623 force-pushed the br_wjy_ota_gen_sh_diff_not_need_antidown_241229 branch from 6f64910 to e78538a Compare December 31, 2024 03:52
@JianyuWang0623
Copy link
Member Author

JianyuWang0623 commented Dec 31, 2024

CI cherry-pick failed, tried, no idea.
@liujinye-sys Could you help analyze this problem?

CP_PR_RESULT: 
Auto-merging tools/gen_ota_zip.py
CONFLICT (content): Merge conflict in tools/gen_ota_zip.py
error: could not apply e78538a... ota: Remove the skip_version_check option
hint: After resolving the conflicts, mark them with
hint: git add/rm <pathspec>, then run
hint: git cherry-pick --continue.
hint: You can instead skip this commit with git cherry-pick --skip.
hint: To abort and get back to the state before git cherry-pick,
hint: run git cherry-pick --abort.
hint: Disable this message with git config advice.mergeConflict false
Recorded preimage for 'tools/gen_ota_zip.py'
CP_PR_CODE: 1

@zhangning21 zhangning21 reopened this Dec 31, 2024
@liujinye-sys
Copy link
Member

CI cherry-pick failed, tried, no idea. @liujinye-sys Could you help analyze this problem?

CP_PR_RESULT: 
Auto-merging tools/gen_ota_zip.py
CONFLICT (content): Merge conflict in tools/gen_ota_zip.py
error: could not apply e78538a... ota: Remove the skip_version_check option
hint: After resolving the conflicts, mark them with
hint: git add/rm <pathspec>, then run
hint: git cherry-pick --continue.
hint: You can instead skip this commit with git cherry-pick --skip.
hint: To abort and get back to the state before git cherry-pick,
hint: run git cherry-pick --abort.
hint: Disable this message with git config advice.mergeConflict false
Recorded preimage for 'tools/gen_ota_zip.py'
CP_PR_CODE: 1

This is a ci cherry pick bug that has been fixed

@xiaoxiang781216 xiaoxiang781216 merged commit 2495767 into open-vela:dev Dec 31, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants