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

[A/B] Boot doesn't set current slot as bootable after successful boot #55

Closed
AndroPlus-org opened this issue May 24, 2018 · 5 comments
Closed
Labels
validation pending A potential fix has been commited, this needs to be validated with next release

Comments

@AndroPlus-org
Copy link

On A/B partition devices, system must mark current slot as "bootable" after successful boot.
Otherwise bootloader counts down slot-retry-count and it reboots in bootloader recovery mode when slot-retry-count became 0.
https://source.android.com/devices/tech/ota/ab/ab_implement

Currently slot is not marked as bootable even if the device boots successfully.
I tested on Sharp AQUOS S2 SS2 (arm64).

@AndroPlus-org
Copy link
Author

To workaround this issue, I added "PRODUCT_PACKAGES += bootctl" to device_phh_treble/generate.sh
and run "bootctl mark-boot-successful" in adb shell after booting.

@phhusson
Copy link
Owner

phhusson commented May 26, 2018

I don't get such a problem on Razer Phone, that's a bit weird.
For the moment I've added bootctl:
phhusson/device_phh_treble@6603eb0

Something as simple as on property:sys.boot_completed=1 bootctl mark-boot-successful in an init.rc should be enough I guess, but I want to check the behaviour on an A-only device first

@Jim-Bar
Copy link

Jim-Bar commented Jun 6, 2018

Tested on a Google Pixel (arm64, A/B):

on property:sys.boot_completed=1
    exec u:r:phhsu_daemon:s0 root -- /system/bin/bootctl mark-boot-successful

I put that into device/phh/treble/environ/init.treble-environ.rc.

The bootloader successfully marked the slot as bootable. Before first boot:

$ fastboot getvar all
(…)
(bootloader) slot-count:2
(bootloader) current-slot:a
(bootloader) slot-retry-count:b:0
(bootloader) slot-unbootable:b:no
(bootloader) slot-successful:b:no
(bootloader) slot-retry-count:a:3
(bootloader) slot-unbootable:a:no
(bootloader) slot-successful:a:no

After first boot:

$ fastboot getvar all
(…)
(bootloader) slot-count:2
(bootloader) current-slot:a
(bootloader) slot-retry-count:b:0
(bootloader) slot-unbootable:b:no
(bootloader) slot-successful:b:no
(bootloader) slot-retry-count:a:2
(bootloader) slot-unbootable:a:no
(bootloader) slot-successful:a:yes

@phhusson
Copy link
Owner

phhusson commented Jun 6, 2018

There I commited:
phhusson/device_phh_treble@b01b148
Not tested yet on either A or A/B

@phhusson phhusson added the validation pending A potential fix has been commited, this needs to be validated with next release label Jun 6, 2018
@Jim-Bar
Copy link

Jim-Bar commented Jun 7, 2018

Fetched, and tested on a Google Pixel XL (A/B): it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validation pending A potential fix has been commited, this needs to be validated with next release
Projects
None yet
Development

No branches or pull requests

3 participants