Linaro / meta-qcom

OpenEmbedded/Yocto Project BSP layer for Qualcomm based platforms
MIT License
61 stars 70 forks source link

Add qbootctl package #520

Closed superna9999 closed 11 months ago

superna9999 commented 1 year ago

Add qbootclt package to control the boot A/B slot flags.

lumag commented 1 year ago

Do we need to set boot successful flag?

superna9999 commented 1 year ago

If we flash the bootimage on recent platform with A/B enabled, if the boot isn't marked successful for N times, the boot will fail until fastboot set_active a is called, which can be unconvenient,

lumag commented 1 year ago

Could you please add a .service, calling qbootctl to mark it as successful?

superna9999 commented 1 year ago

Yep it was my next plan, but I'm unsure what would be the condition, the grub one doesn't see very good since it requires a login (https://github.com/rhboot/grub2/blob/7de33f4072abf5f14c4fdad6e566c58bdbf3b26e/docs/grub-boot-success.timer)

superna9999 commented 1 year ago

OK i"ll use the same as the systemd one https://github.com/endlessm/systemd/blob/master/units/systemd-bless-boot.service.in

lumag commented 1 year ago

boot-complete.target looks good.

superna9999 commented 1 year ago

Done

lumag commented 1 year ago

@superna9999 let me check that it doesn't break non-ufs hardware. I'll merge this afterwards.

superna9999 commented 1 year ago

Updated recipe to 0.1.2 release since master has some bugs

lumag commented 1 year ago

@superna9999 I tried enabling qbootctl, and it fails:


| ../git/qbootctl.cpp: In function 'int get_slot_info(slot_info*)':
| ../git/qbootctl.cpp:105:9: error: 'uint32_t' was not declared in this scope
|   105 |         uint32_t active_slot = impl->getActiveBootSlot();
|       |         ^~~~~~~~
| ../git/qbootctl.cpp:30:1: note: 'uint32_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
|    29 | #include "bootctrl.h"
|   +++ |+#include <cstdint>
|    30 |
| ../git/qbootctl.cpp:107:15: error: 'active_slot' was not declared in this scope
|   107 |         slots[active_slot].active = true;
|       |               ^~~~~~~~~~~
superna9999 commented 1 year ago

Indeed, it requires https://gitlab.com/sdm845-mainline/qbootctl/-/commit/df63d7c21c19a3e3afb41d029b97b9d068880484 for GCC13, adding it to the recipe.

superna9999 commented 1 year ago

Done, added the right fix

lumag commented 11 months ago

Validated and merged