-
Notifications
You must be signed in to change notification settings - Fork 413
Better support for A/B targets for lk1st and lk2nd #507
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
base: main
Are you sure you want to change the base?
Conversation
| #include <lk2nd/device/keys.h> | ||
| #include <lk2nd/util/minmax.h> | ||
| #include <lk2nd/version.h> | ||
|
|
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.
Let's not add extra churn, please keep the empty line as-is
| static void opt_edl(void) { reboot_device(EMERGENCY_DLOAD); } | ||
| static void opt_shutdown(void) { shutdown_device(); } | ||
| #if SLOTS_SUPPORTED | ||
| static void opt_switch_slot(void){ |
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.
| static void opt_switch_slot(void){ | |
| static void opt_switch_slot(void) | |
| { |
| #define fbcon_printfn(color, y, incr, x...) \ | ||
| do { \ | ||
| fbcon_printf(color, y, x); \ | ||
| } while(0) | ||
|
|
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.
Why not just call fbcon_printf directly?
| int current_active_slot = partition_find_active_slot(); | ||
| fbcon_printfn(SILVER, y, incr, false, " Active Slot: "); | ||
| fbcon_printf_ln(current_active_slot ? GREEN : RED, y, incr, false, " %s", current_active_slot ? "B" : "A"); | ||
| #endif |
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.
It's unclear to me why A/B should be color-coded, nor why B should be green/"good" and A should be red/"bad"
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.
It just looks cool, lol.
No color is good/bad for me it just looks cool as said but we can keep it silver if you like it more
| static inline bool partition_multislot_is_supported(void) | ||
| { | ||
| return target_is_emmc_boot() && _partition_multislot_is_supported(); | ||
| static inline bool partition_multislot_is_supported(void){ | ||
| #if SLOTS_SUPPORTED | ||
| return true; | ||
| #else | ||
| return false; | ||
| #endif | ||
| } | ||
|
|
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.
Do I understand correctly that SLOTS_SUPPORTED "forces" slots on instead of relying on caf lk's code that detects the presence of blah_a and blah_b? In this case, if this is just an lk2nd extension, please rename it to something like LK2ND_FORCE_AB_SLOTS and keep existing behavior if it's not enabled. Do I understand correctly that you need it due to dynamic partitions?
(...) thinking of this more I'm not sure how to integrate this into the menu nicely....
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 need to look into this again either the detection code was just plainly broken or didn't work for me it was some weeks ago I fixed the code.
Iirc it was badly ported over from edk2's aboot impl (probably taken from shift phone xbl)
|
|
||
| ifeq ($(ABOOT_STANDALONE), 1) | ||
| DEFINES += ABOOT_STANDALONE=1 | ||
| OBJS := $(filter-out $(LOCAL_DIR)/recovery.o, $(OBJS)) |
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.
Do we really need the recovery code?
Im pretty bored theese days and wanted to test A/B slots on my lumia 950XL
The phone can now use slotted partitions with vAB and dynamic partitions,
LK1ST can now display the current active slot and also switch the slot