aboot: Don't do extlinux boot when selected recovery from menu#723
Merged
Merged
Conversation
Contributor
Author
|
Steps I used to reproduce the issue on my device:
|
Member
|
Thanks for fixing this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When I have an ext2 partition with
extlinux.confflashed into the virtualbootpartition (512k after lk2nd if I understand correctly), selecting "Recovery" in Fastboot menu still boots mainline for me, but it should boot device into recovery mode.(my device is using msm8952 platform)
it was annoying and as a workaround I always had to temporarily erase my
bootit seems like
extlinuxboot handlings is done by a function calledlk2nd_boot():lk2nd/lk2nd/boot/boot.c
Lines 66 to 74 in 1250da0
so if that function is called it would try to find a partition with
extlinux.confto boot unconditionallyI found
lk2nd_boot()is already guarded in another usage inaboot.c(seems that code path is for normal boot, i.e. when not entering Fastboot menu):lk2nd/app/aboot/aboot.c
Lines 5657 to 5658 in 1250da0
My understanding is: currently when ABOOT starts up it detects if volume key is held and sets
boot_into_recoveryflaglk2nd/app/aboot/aboot.c
Lines 5595 to 5596 in 1250da0
so
lk2nd_boot()is bypassed if should boot into recovery modeif I understand correctly when "Recovery" is selected from menu, it sets
boot_into_recoveryflag eventually callscmd_continue():lk2nd/lk2nd/device/menu/menu.c
Lines 126 to 132 in 1250da0
cmd_continue()also lives inaboot.cbut it seems to lack a check onboot_into_recovery:lk2nd/app/aboot/aboot.c
Lines 4674 to 4677 in 1250da0
this commit adds that missing check
(I know I can also just use key combinations to force a recovery boot but still)