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

Support for OnePlus One #98

Merged
merged 9 commits into from
Mar 24, 2023

Conversation

MagicLike
Copy link
Member

Added a config for OnePlus One (bacon), based on the OnePlus 5 config by @SirRGB. But it is still untested... (Hopefully I have the time to test it in the next few days / week(s))

@MagicLike MagicLike changed the title WIP: Added config for OnePlus One WIP: Support for OnePlus One Mar 7, 2023
@tsterbak tsterbak added the device Request to add or improve a specific device. label Mar 8, 2023
@tsterbak tsterbak added this to the Release Beta 0.4.2 milestone Mar 8, 2023
Added OnePlus One to the list of officially supported devices
Another config is needed, because after installation of a custom ROM the device switches from device code "A0001" to "bacon".
@MagicLike MagicLike changed the title WIP: Support for OnePlus One Support for OnePlus One Mar 11, 2023
@MagicLike
Copy link
Member Author

@tsterbak I needed to add two config because of a change of the device code after install... (see 4b616ab)

@MagicLike MagicLike marked this pull request as ready for review March 11, 2023 20:48
@tsterbak tsterbak changed the base branch from main to dev March 11, 2023 21:26
@tsterbak
Copy link
Member

Looks good! It will be included in the next release! 🙂 Thanks a lot!

@tsterbak I needed to add two config because of a change of the device code after install... (see 4b616ab)

Yeah, this is currently a limitation. The detected code directly maps to the config files one-to-one, which is apparently an issue for some OnePlus devices (and also some Sony as far as I know). I'll try to address that in the next release by putting a list of device codes working with a config directly to the file. But it's perfectly fine as you did it now. 🙂

@MagicLike
Copy link
Member Author

MagicLike commented Mar 11, 2023

I got a weird issue: when I try to flash the recovery and open it, OAI / adb wait-for-recovery just gets stuck. But if I reboot into recovery manually it works perfectly fine and boots twrp... Where could be the issue?

@tsterbak
Copy link
Member

I got a weird issue: when I try to flash the recovery and open it, OAI / adb wait-for-recovery just gets stuck. But if I reboot into recovery manually it works perfectly fine and boots twrp... Where could be the issue?

Thats odd 🤔 Do you mean it doesn't boot TWRP or that it doesn't continue once it's booted and hangs at adb wait-for-recovery? Can you attach the log file for that run?

@MagicLike
Copy link
Member Author

I got a weird issue: when I try to flash the recovery and open it, OAI / adb wait-for-recovery just gets stuck. But if I reboot into recovery manually it works perfectly fine and boots twrp... Where could be the issue?

Thats odd thinking Do you mean it doesn't boot TWRP or that it doesn't continue once it's booted and hangs at adb wait-for-recovery? Can you attach the log file for that run?

Where is it saved? Or should I just copy the terminal output?

@tsterbak
Copy link
Member

Where is it saved? Or should I just copy the terminal output?

It's created in the same directory where you run the executable.

@MagicLike
Copy link
Member Author

Where is it saved? Or should I just copy the terminal output?

It's created in the same directory where you run the executable.

openandroidinstaller.log

(I replaced the paths with a *)

@tsterbak
Copy link
Member

Thank you :) It looks like everything worked fine 🤔 Does TWRP boot up at all? Sometimes it might be necessary to swipe right to make the recovery available for adb.

@MagicLike
Copy link
Member Author

Thank you :) It looks like everything worked fine thinking Does TWRP boot up at all? Sometimes it might be necessary to swipe right to make the recovery available for adb.

Nope, it stays in fastboot mode... But if I run adb reboot recover TWRP boots up normally.

@MagicLike
Copy link
Member Author

Could it be a problem, that the same TWRP version I try to flash is already flashed?

@MagicLike
Copy link
Member Author

Could it be a problem, that the same TWRP version I try to flash is already flashed?

Nope, it does not change anything and a magisk patched boot partition does not take a effect on it... (based on my testing)

@tsterbak
Copy link
Member

tsterbak commented Mar 12, 2023

Hm, interesting. Looks like it doesn't boot into recovery by itself.
Does it work in OAI when you press the hardware buttons like described under "Installing a custom recovery" step 6 here? https://wiki.lineageos.org/devices/bacon/install

@MagicLike
Copy link
Member Author

Hm, interesting. Looks like it doesn't boot into recovery by itself. Does it work in OAI when you press the hardware buttons like described under "Installing a custom recovery" step 6 here? https://wiki.lineageos.org/devices/bacon/install

Kinda, when I reboot into Recovery while it hangs on adb wait-for-recovery it runs fastboot reboot recovery and then says < waiting for any device >. Even if I reboot twice into recovery, nothing happens...

@MagicLike
Copy link
Member Author

Even if I go into fastboot manually and type fastboot reboot recovery it just boots into the normal system...

@MagicLike
Copy link
Member Author

OAI eventually accepted it, but after multiple reboots from fastboot, twrp and adb... (I think the problem is, that from fastboot it won't boot into recovery rn, but I can't imagine why)

@MagicLike
Copy link
Member Author

If I then click continue it throws an error;

[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.

@tsterbak
Copy link
Member

Hm, might actually be an issue in my code which leads to waiting for recovery to early. I will not be able to work on it since I'm travelling for the next two weeks, but then it will be high priority. If you are running the development version with python, you could try to remove line 375 and 376 in tooling.py and see if that helps.

@MagicLike
Copy link
Member Author

Hm, might actually be an issue in my code which leads to waiting for recovery to early. I will not be able to work on it since I'm travelling for the next two weeks, but then it will be high priority. If you are running the development version with python, you could try to remove line 375 and 376 in tooling.py and see if that helps.

Ok, that fixed one of the issues, but my device apparently does not boot into recovery when fastboot reboot recovery is executed, it just boots into the normal system...

@MagicLike
Copy link
Member Author

If nothing helps, I will try to lock and unlock the bootloader again, so the device completely reformats. Then I will try again...

@tsterbak
Copy link
Member

Hm, that might indicate, that TWRP wasn't flashed successfully or the TWRP image has issues. A thing that helps quite often is to try a different usb-cable and usb-port, as well as a different TWRP version if you have one available. But that might not help here, since you already got it working without OAI, right? 🤔

@MagicLike
Copy link
Member Author

Hm, that might indicate, that TWRP wasn't flashed successfully or the TWRP image has issues. A thing that helps quite often is to try a different usb-cable and usb-port, as well as a different TWRP version if you have one available.

I don't think, that that could be the issue - it worked before...

But that might not help here, since you already got it working without OAI, right?

Yup, when I do it manually it works fine... Maybe my boot partition is borked...

@MagicLike
Copy link
Member Author

Maybe my boot partition is borked...

Nope, not the problem...

@MagicLike
Copy link
Member Author

Ok uhm, I got another (maybe) weird behavior: Every time the system boots now, it says "Auf Werkseinstellung zurücksetzen" and reboots into reovery, but actually does not do anything...

@MagicLike
Copy link
Member Author

Somehow I got OAI to reinstall lineage OS now... Lets see if it helps.

@MagicLike
Copy link
Member Author

When I re-unlock the bootloader with the lineage recovery, it throws an error E: Invalid command argument

@MagicLike
Copy link
Member Author

I will just try and make a complete reformat of /system, /cache and /data...

@MagicLike
Copy link
Member Author

@tsterbak My guess is, that the bootloader of the OnePlus One uses old commands, which do not get recognized by the lineage recovery nor by TWRP... I will add a notice to the config... (It worked with the stock recovery, so bootloader is able to communicate with it. But the stock recovery image is no longer available...)

@tsterbak
Copy link
Member

Thank you for all the things you tried and your suggestions in the issues! :) some of the things will be added to the next release when I'm back from travelling.
Then I'll also be able to investigate this issue further and see if there is a solution for it. For the start, adding the notice like you did should suffice.

BTW, can you boot TWRP directly without flashing it with fastboot boot TWRP.img? Then this could be a shortcut solution.

Either way, thanks a lot :)

@MagicLike
Copy link
Member Author

BTW, can you boot TWRP directly without flashing it with fastboot boot TWRP.img? Then this could be a shortcut solution.

Yes I can - maybe that would be a general better solution to just boot TWRP instead of overwriting the stock recovery... (That would fix the issue with the bootloader not being able to communicate with the recovery)

@tsterbak
Copy link
Member

Great! You could test that with OAI by changing the command in line 372 in tooling.py to fastboot boot. Would be easy to add an alternative function for it, or maybe it should be done like this all the time, like for a/b-partitioned devices.

@MagicLike
Copy link
Member Author

MagicLike commented Mar 12, 2023

Great! You could test that with OAI by changing the command in line 372 in tooling.py to fastboot boot. Would be easy to add an alternative function for it, or maybe it should be done like this all the time, like for a/b-partitioned devices.

I modified the code a bit more and it works like a charm! Should I also implement that it is done always - regardless how it is formatted and open a PR?

Edit: I already opened a PR at #111

@MagicLike MagicLike marked this pull request as draft March 12, 2023 18:53
@MagicLike MagicLike marked this pull request as ready for review March 12, 2023 19:54
@MagicLike
Copy link
Member Author

BTW, can you boot TWRP directly without flashing it with fastboot boot TWRP.img? Then this could be a shortcut solution.

Yes I can - maybe that would be a general better solution to just boot TWRP instead of overwriting the stock recovery... (That would fix the issue with the bootloader not being able to communicate with the recovery)

I just tested it with stock recovery and new OS - worked completely fine, now the data wipe after fastboot oem unlock works too! 🎉

tsterbak added a commit that referenced this pull request Mar 24, 2023
OAI now only boots into TWRP instead of flashing and overwriting the
existing recovery, which can cause problems with the bootloader not
being able to communicate with the recovery.

related to
#98 (comment)
@tsterbak tsterbak changed the base branch from dev to release-0.4.2-beta March 24, 2023 17:23
@tsterbak tsterbak merged commit a49cae3 into openandroidinstaller-dev:release-0.4.2-beta Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device Request to add or improve a specific device.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants