-
Notifications
You must be signed in to change notification settings - Fork 420
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?
Changes from all commits
04a8db4
ac82c6a
ee09a21
892d267
d4188af
ae440a1
d791948
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,6 @@ | |||||||
| #include <lk2nd/device/keys.h> | ||||||||
| #include <lk2nd/util/minmax.h> | ||||||||
| #include <lk2nd/version.h> | ||||||||
|
|
||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||||
| #include "../device.h" | ||||||||
|
|
||||||||
| // Defined in app/aboot/aboot.c | ||||||||
|
|
@@ -127,6 +126,13 @@ static void opt_recoery(void) { reboot_device(RECOVERY_MODE); } | |||||||
| static void opt_bootloader(void) { reboot_device(FASTBOOT_MODE); } | ||||||||
| 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){ | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| int current_active_slot = partition_find_active_slot(); | ||||||||
| partition_switch_slots(current_active_slot, !current_active_slot, true); | ||||||||
| reboot_device(FASTBOOT_MODE); | ||||||||
| } | ||||||||
| #endif | ||||||||
|
|
||||||||
| static struct { | ||||||||
| char *name; | ||||||||
|
|
@@ -137,6 +143,9 @@ static struct { | |||||||
| { " Continue ", WHITE, opt_continue }, | ||||||||
| { " Recovery ", ORANGE, opt_recoery }, | ||||||||
| { "Bootloader", ORANGE, opt_bootloader }, | ||||||||
| #if SLOTS_SUPPORTED | ||||||||
| { "Switch Slot", RED, opt_switch_slot }, | ||||||||
| #endif | ||||||||
| { " EDL ", RED, opt_edl }, | ||||||||
| { " Shutdown ", RED, opt_shutdown }, | ||||||||
| }; | ||||||||
|
|
@@ -147,6 +156,11 @@ static struct { | |||||||
| y += incr; \ | ||||||||
| } while(0) | ||||||||
|
|
||||||||
| #define fbcon_printfn(color, y, incr, x...) \ | ||||||||
| do { \ | ||||||||
| fbcon_printf(color, y, x); \ | ||||||||
| } while(0) | ||||||||
|
|
||||||||
|
Comment on lines
+159
to
+163
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just call fbcon_printf directly? |
||||||||
| #define fbcon_puts_ln(color, y, incr, center, str) \ | ||||||||
| do { \ | ||||||||
| fbcon_puts(str, color, y, center); \ | ||||||||
|
|
@@ -228,6 +242,11 @@ void display_fastboot_menu(void) | |||||||
| if (lk2nd_dev.bootloader) | ||||||||
| fbcon_printf_ln(SILVER, y, incr, false, " Bootloader: %s", lk2nd_dev.bootloader); | ||||||||
| #endif | ||||||||
| #if SLOTS_SUPPORTED | ||||||||
| 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 | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||||
|
|
||||||||
| fbcon_printf_ln(armv8 ? GREEN : YELLOW, y, incr, false, " ARM64: %s", | ||||||||
| armv8 ? "available" : "unavailable"); | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,7 +79,11 @@ int partition_fill_partition_meta(char has_slot_pname[][MAX_GET_VAR_NAME_SIZE], | |
| char has_slot_reply[][MAX_RSP_SIZE], | ||
| int array_size); /* Fill partition slot info meta*/ | ||
|
|
||
| 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 | ||
| } | ||
|
|
||
|
Comment on lines
-82
to
+89
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do I understand correctly that (...) thinking of this more I'm not sure how to integrate this into the menu nicely....
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) |
||
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?