installing pro 2 image files from usb - Microsoft Surface

hi all
i have got the eu pro 2 image files downloaded but i dont klnow how to create a bootable USB stick with these files so i can boot from it on my pro and reinstall from scratch.
Any guides anywhere ???
thanks
paul

Haven't tried it with a recovery image specifically, but I've done this plenty with an install image. There are tools, but I do it semi-manually:
1. Locate suitable flashdrive whose contents you can erase (back them up if needed) and plug it in.
2. Run CMD or Powershell (as Administrator).
3. Run "diskpart" (all commands are given in quotes and should be typed without quotes) and accept the UAC prompt if needed.
4. In diskpart, type "list disk" to see the list of disks, then type "sel dis [#]" (replace [#] with the disk number for the flashdrive).
5. Type "lis par" to see all partitions on the disk (typically only one) then "del par [#]" for each one to delete them.
6. Type "create par primary" to create a new partition spanning the whole flashdrive, then "lis par" to make sure it's selected (star next to it).
7. Type "format quick" to create a file system on the new partition, then "assign" to give it a drive letter.
8. Type "active" to make the new partition the one the OS will attempt to boot from, when booting off that drive.
9. Assuming everything succeeded, you can now exit diskpart ("exit").
10. Either unpack (using a program like 7-Zip) or mount (Win8 can do this automatically, or there's lots of software for older Windows versions) the disk image.
11. Copy the entire contents of the disk image (you can just use Explorer for this part if you mounted it) to the flashdrive.
Congrats, you have a bootable flashdrive containing a Windows installation (or recovery) image.

GoodDayToDie said:
Haven't tried it with a recovery image specifically, but I've done this plenty with an install image. There are tools, but I do it semi-manually:
1. Locate suitable flashdrive whose contents you can erase (back them up if needed) and plug it in.
2. Run CMD or Powershell (as Administrator).
3. Run "diskpart" (all commands are given in quotes and should be typed without quotes) and accept the UAC prompt if needed.
4. In diskpart, type "list disk" to see the list of disks, then type "sel dis [#]" (replace [#] with the disk number for the flashdrive).
5. Type "lis par" to see all partitions on the disk (typically only one) then "del par [#]" for each one to delete them.
6. Type "create par primary" to create a new partition spanning the whole flashdrive, then "lis par" to make sure it's selected (star next to it).
7. Type "format quick" to create a file system on the new partition, then "assign" to give it a drive letter.
8. Type "active" to make the new partition the one the OS will attempt to boot from, when booting off that drive.
9. Assuming everything succeeded, you can now exit diskpart ("exit").
10. Either unpack (using a program like 7-Zip) or mount (Win8 can do this automatically, or there's lots of software for older Windows versions) the disk image.
11. Copy the entire contents of the disk image (you can just use Explorer for this part if you mounted it) to the flashdrive.
Congrats, you have a bootable flashdrive containing a Windows installation (or recovery) image.
Click to expand...
Click to collapse
I've been building windows deployment images for years and I build my boot drives similarly to how you describe. The problem I've had is in getting a uefi bootable drive which I can use to take a drive image before I deploy a new one. In the past I've used tools like Make PE3 to make some useful boot drives but i'm not having nay luck with the newer pe4 or getting an older pe3 image to boot.
Secure boot is off, windows detects the drive and lsit it in the boot menu it just doesn't boot. Any suggestions?

Will_nonya said:
I've been building windows deployment images for years and I build my boot drives similarly to how you describe. The problem I've had is in getting a uefi bootable drive which I can use to take a drive image before I deploy a new one. In the past I've used tools like Make PE3 to make some useful boot drives but i'm not having nay luck with the newer pe4 or getting an older pe3 image to boot.
Secure boot is off, windows detects the drive and lsit it in the boot menu it just doesn't boot. Any suggestions?
Click to expand...
Click to collapse
Try pressing VOL - (I think its -, might be +) as it boots with the flash drive plugged in

lopezk38 said:
Try pressing VOL - (I think its -, might be +) as it boots with the flash drive plugged in
Click to expand...
Click to collapse
Thanks friend but that is not the issue. I can initiate the boot from USB but none of the boot images I've used in the past or that I've create new successfully boot. This problem is limited just to the surface pro.

Related

Retrieve backup

I have just receieved my G1 back from HTC repair as the motherboard was fried..
i have just installed root and rc 9.
how do i recover my previous backups to get back to my original state as i have nandroid files saved on my sd card but am not sure how to open them
infernix said:
Originally Posted by trmacdonal
How to Restore your phone on a Windows PC using a Nandroid backup
I am going to assume you already have a Nandroid backup created on your SD card using JF 1.31's recovery Alt-B feature. The backup will create a folder called nandroid on your SD.
What you need:
The Android SDK:
Fastboot Windows Binary in this post:http://forum.xda-developers.com/showpost.php?p=3083753&postcount=1
From your Nandroid backup you need three files:
data.img
system.img
boot.img
Steps to restore your phone
1) Put the files Adb and AdbWinApi.dll from the tools folder in the Android SDK into C:\WINDOWS\System32 folder on your PC. Substitute the correct drive letter if windows is not installed on you C: drive
2) Put the Windows Fastboot.exe into the C:\WINDOWS\System32 folder on your PC
3) Create a folder on the C: drive of your PC called android. The path should be C:\Android.
4) Copy the Nandroid backup files data.img, system.img, and boot.img from your SD card to the folder called Android you created by mounting your SD card as removable disk.
5) Unplug the USB cord and power off your phone
6) Power up your phone by holding CAMERA+POWER, you should see three androids on skateboards. If you don't see this go install the Engineering boot loader
7) Plug the USB cord back into your phone and press back. The screen on your phone should say fastboot.
8) Make sure your pc is using the correct driver. Open the device manager on your pc. It is helpfull to have all other USB storage devices besides your phone unplugged for this part. Look for a USB Mass Storage device in the list of the USB devices. Right click on it and update the driver. Pick the option to browse for a driver on your pc. The driver is located in the Android SDK your downloaded in the folder called usb_driver. If this is done right you will now see a device called HTC Dream
9) Press start, go to run and type cmd (If you are on Vista just type cmd in the search box and hit enter). The command prompt will pop up.
10) Type cd C:\android
then enter the following commands:
fastboot flash system system.img
it will say Sending, then writing and say OKAY if it was successful
then type
fastboot flash userdata data.img
wait for the second OKAY and type
fastboot flash boot boot.img
wait for the second OKAY and type
fastboot reboot
Your phone should now be restored exactly as you had it when it was backed up.
Click to expand...
Click to collapse
Please try to search for your answer before posting to prevent multiple duplicate threads. Thanks.

Easy Revert From GPE

For people who converted over to GPE and are having a hard time installing most roms, I have a fairly easy fix for you. The problem is with the partition table. I specifically did this with 1032 falcon assuming you already have recovery installed.
1. You need mfastbootv2.zip from here: http://www.mediafire.com/download/14p0x9cb34s2kqj/mfastboot-v2.zip
2. You will also need gptfix.zip from here: http://forum.xda-developers.com/moto-g/general/fix-android-lollipop-ota-gpe-stuck-t2970842
3. Extract mfastbootv2.zip to a folder.
4. Extract gptfix.zip to the mfastbootv2 folder you just created.
5. Put your phone in bootloader mode by holding the power and down buttons for 5 seconds until you see the menu then hook your phone to your computer via usb.
6. Now open the folder you extracted gptfix.zip and mfastbootv2 to, hold shift on the keyboard, right click on a blank area in the folder and choose open command window here.
7. Now type "mfastboot flash partition gpt.bin" without quotes. Shouldn't take long. A second or two.
8. Once completed reboot to recovery and format data and system (may get some errors) then reboot recovery so twrp can create a folder to put your rom in.
9. With my phone hooked to the computer via usb, i mounted usb in twrp then copied my rom to the twrp folder using windows explorer and flashed a rom that would never flash before!
Hope this helps. I know this info was already talked about but i found it was split up and unclear.

Need help booting Windows 10 in MSDOS laptop

I had made a copy of ISO file of Windows Media file on a USB drive.
In my new MSDOS laptop, I inserted my pen drive and started installing Windows.
After installation black screen appeared and it again asked me to install windows.
I tried to install it again but while choosing the partition it showed me an error:
There was an error installing Windows​
I pressed the power button and the laptop switched off.
I turned it on but the same error persisted while installing the Windows.
Somewhere I found the option for System Recovery and clicked on it.
It showed an error something like:
The installation media could not be found in the external disk.
Contact your system administrator for a media file.
Error code:0xc000000f​
The error was quite longer than this but the main points were these.
And every time I am turning on my pc I find the above-given error.
I think I had done some mistake choosing the partition while installing the Windows 10 for the first time.
There were two partitions 1 and 2 and an unallocated space for more than 950GB.
I chose the unallocated space.
HP 15-BW096AU 2017 15.6-inch Laptop (A6-7310/4GB/1TB/DOS/Integrated Graphics)
Insert your USB drive again, reboot, choose "Advanced (options)", open a command line, then enter the following commands:
bootrec /fixboot (press Enter)
bootrec /fixmbr (press Enter)
Restart your PC, and try to install Windows again.
EDIT: see here for more info https://neosmart.net/wiki/0xc000000f-error-read-boot-configuration-data/
@moderators: it would be nice to be prompted to identify ourselves BEFORE we start to reply, instead of after, so as not to lose everything we've entered in the reply box...

Android X-86 Guide for multi-boot with Windows 10 (dont do what i did)

So it has been a hectic few days for me as I had alas managed to wipe my system reserved partition thinking that installing android x86 as multi-boot would actually boot windows for me. Wrong!!! My first poor encounter was the fact that when I had installed windows it had created the system reserved partition as ntfs... I had not realized this when attempting to install android x-86 as multi-boot. I will tell you the result, when booting it would appear to go to grub, however instead it just booted the first menu on the list without hesitation and gave no menu at all. To remedy this I had to use the windows 10 usb i had created for my initial install. I am still not sure how i managed to get it to boot the first time I think it may have just been dumb luck. When windows booted up i went to Disk Management (right click the windows menu and select from the drop down) where I then proceeded to delete the system reserved partition and reformat it fat32. At this point I was satisfied that android would point the out the windows boot, boy was I wrong. After installing Android x86 (_64 8.1 r3) I finally achieved the grub menu boot correctly. I also noted that when installing android x86 the only way it gave me option to add windows to grub was if i had installed without formatting first. (this can be done a few ways including just reinstalling much the same way you would dirty flash a rom on a phone) or you could use a tool to format the partition such as gparted or a linux live cd/usb. I suggest ext4. Oh wait my nightmare hadn't finished yet... Android x86 install had no problems at all (select partition to install(ext4)... do not format... install grub... yes to windows... yes read write... and then reboot) on reboot windows was in the grub menu and I selected it... oops there is no operating system!!! Well that is unsettling... ( I managed to get back into windows using the install media) and not so sure how. At this point i notice that my system reserved partition was now sda 3) So my next objective was to create a boot record for windows which could have been done easily from windows had I considered using bcdedit tool for windows. But since i knew that the partition was sda 3 I figured I could just point the grub menu to the correct drive... again wrong (there was still no boot mbr on that partition *sigh) Well I found that when i went into command line from the windows repair tool it would say I do not have permission to fixboot... wow nice job microsoft... after doing a bit more research I learned that the newer builds give this error when attempting to fix boot. I found a video on youtube which helped me alot but took quite a while to download the older working repair tool(installation media) but his video was fairly well put together. link here (https://www.youtube.com/watch?v=lRCyb7FzWFY). I followed his guide and this time with the repair tool that he shared in the description of his video, I was able to perform the fixboot (bootrec /fixboot) however one of his commands required the copying of bcd to the system reserved partition. The copy failed, however at this time running all the other bootrec commands seemed to go fine. So I exited command and went to the automatic startup repair, which to my surprise worked perfectly... (after a whopping 30 some hours of pulling my hair out of my head over this mess) And windows began to boot. At this point I gave my thanks to the poster of the video and shared my experience with his video in the comments below.) Now When windows booted up I downloaded the bcdedit tool. Personally I used the multi boot tool from this site (https://www.boyans.net/dual-boot-repair-windows-10.html) and selected repair mbr and boot record. This fixed my boot issue windows would boot normal at reset. However now my android was gone but thats okay.
At this point I just reinstalled the android x86 again over the same ext4 partition without formatting and added the windows to grub. This was perfect however when selecting windows did not boot. To fix this I had to edit the grub menu.lst and change the drive from hd(0,0) to hd(0,2) to point to the fat32 partition which had been somehow displaced to sda3. In order to do this I ran android in debug... when debug is running just hit enter and it give you a prompt... from prompt type without quotes "cd /mbr/grub" when the next prompt comes up you should be in the grub directory where the menu.lst is. Now type without quotes "vi menu.lst" this will take you into a text editor (note you can also change your monitors and resolution permanently in grub menu this way) using the arrow keys navigate to the line you want to edit, in my case the last entry which was windows entry when you get to where you need to edit hit the "i" key this will allow you to now enter and edit the text. After making changes hit "esc" to save changes type ":w!" then hit enter. To exit type ":q!" this will take you back to prompt. Now reboot your system and finally the results I had originally hoped for a multi-boot system with windows 10 and android. Now if you are attempting to do this and are looking for a guide to install I will make this just a little longer to make sure you dontt make the same mistakes I made.
1a) before you attempt to install a dual boot with grub... make sure your system reserved partition is fat32 if it is not you need to change it to fat32. as grub will not boot on ntfs partitions.
1b)you will need to have a blank partition, if you have spare room on the drive you can shrink your volume and create a new one. There are plenty of tools out there to format ext4 even from windows. Make sure you format it before installing. (if you are lazy like me you can format ext 4 from the installation, but there is a chance that you would need to reinstall again and choose not format to get the windows entry in grub)
1c)once your partitions looks the way you need and you have a working fat32 system reserved partition you are ready to move on. ( If you have to change a ntfs partition to fat32 I highly suggest you dont install anything until you have repaired the boot menu and tested it first to make sure it works)
2)create your install media... I prefer to use rufus as it is quick and easy, and I prefer the official android x86 as the 8.1 r3 is stable and works great, you can use whatever image you want though, lord knows i test newer versions as they come out. when you have rufus and the android x86 iso of your choice load rufus select your usb drive and select the iso with the browse button. then just hit start allow it to format and when it is done you can boot into your usb
3)To boot into your usb you may actually need to edit your bios and enable virtualization and make sure safeboot is not enabled, also you need a uefi system for x64 distros so if you have an older legacy bios you will need the x86 version instead or the system wont boot
4)When you finally get it to boot you will find the menu to use it as a live cd or install, select the install.
5a) You will now be asked where to install to. Pick the ext 4 partition you created for it.
5b) Now it will ask you to format choose do not format (again if you hadn't formatted the partition ext4 you may do it now, but you may have to reinstall and not format the next time to add windows to the grub menu)
6) You will now be asked to install grub answer yes, if you do not answer yes you wont be able to get back into your android partition again until you do.
7) Now it will tell you that it found a windows partition and asks you if you want to add an entry, select yes... if you do not you will have to make your own grub entry to get back into windows later or completely delete grub from the partition later.
8) Finally it will ask you if you want to make the system read write... select yes, if you select no i can not guarantee you will be able to install anything inside of the system.
10) The end... Installation finishes but do not click launch... instead click reboot. The reason for this is that I have noticed if you launch at the end of installation the grub somehow manages to disappear and you end up having to completely start over.
Enjoy your android x86 / windows multi-boot system.
make sure your system reserved partition is fat32
Click to expand...
Click to collapse
There is no system reserved partition on my laptop since I have a UEFI laptop.
Should I proceed ?

How To Guide How to extract boot.img from OnePlus 9 firmware packages to patch with Magisk & flash to your phone using Linux Mint 21.1

As a OnePlus 9 user who likes to root their phone mainly to allow Network Signal Guru to work (as well as a few other root things like AdAway) I had been trying to extract the boot.img the same way as I had done with a OnePlus 7T using Payload Dumper for Windows. However it looks like Payload Dumper has issues with extracting xx.img files (including boot.img) if the payload.bin file is bigger than 4.3 GB in size. So I've been looking to see if another method was possible that would work for our OnePlus 9 ROMs that are above this file size. As I use Linux Mint as my usual desktop OS & only fall back onto Windows for stuff that'll only run on that OS, I went to have a look to see if something could be done under Linux. Turns out there is an old thread elsewhere on XDA that almost nearly provides what is needed for this, and I thought I would gives details here that should work for the time of this post (March 2023).
This not only extracts the boot.img to patch in Magisk, but also extracts other xx.img files as well.
I'm using Linux Mint 21.1, but I'd assume that this will also work for similar Ubuntu builds or anything that is based on Debian.
Obligatory disclaimer: The following instructions I'm giving below have worked well for me several times in the past, however I am in no way responsible for screwing up or damaging your phone if you try and follow what I've written below. In extreme cases, a bad flash may require using the OnePlus MSM tool to completely reflash your phone. Back up anything important first before doing any of the following!​
1. You will need to ensure that you have downloaded packages to be able to do adb & fastboot from the command line. You can check by running the following commands - if it's already installed with the latest versions, the terminal interface will let you know...
Code:
sudo apt install adb
Code:
sudo apt install fastboot
2. You will need to go to your software manager in LM21.1 and install both Python 3 & the Python Protobuf compiler. Just search for "Python 3" & "Protobuf-compiler" in the software manager and the first option for each search is what you should need - if they are not installed, install them.
3. Create a read/writable directory that will hold your ROM that you've just downloaded & other files that I'll mention soon. I just use a folder calls "ROM" in my Downloads folder (e.g. /home/lawhec/Downloads/ROM ), but you can choose wherever you want that suits you.
4. If you have not done so already, make sure you have the FULL package of your OnePlus 9 ROM downloaded. As of right now (March 2023) it seems the best way is to download the package using the Oxygen Updater app which is available on Google Play - more info available at oxygenupdater.com - just download the ROM to your phone and transfer it on to your computer into the folder you've created for it.
5. Download and save the following two Python scripts/files ("Right click" & "Save Link As") into the folder you have just created for your ROM (all credit to Gregory Cyxx at github.com/cyxx )...
https://raw.githubusercontent.com/c...payload/master/extract_android_ota_payload.py
https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/update_metadata_pb2.py
6. Make sure in your file browser (Nemo in my case as it is the default for LM21.1 Cinammon, yours may differ) the window is open in the ROM folder that contains the two Python scripts above that you've just downloaded as well as a ROM package (ZIP file) you've downloaded (in my case from Oxygen Updater mentioned in step 3). Create a new folder for the extracted images to be written to - in my case I just call the folder "output" which is located at "/home/lawhec/Downloads/ROM/output" but again you can call it what you wish.
7. After you've created your output folder, in your ROM directory in the file manager window right-click on your mouse in a white or free space and select "Open in Terminal" - a command terminal will pop up defaulting to your directory.
8. In the command terminal, type the following command and press enter/return...
Code:
sudo python3 extract_android_ota_payload.py <<Your ROM.zip>> <<Your Output Directory>>
...for example, in my case the command would be either...
Code:
sudo python3 extract_android_ota_payload.py LE2113_11_F-75.zip output
...or for handiness you can type "sudo python3 extract_android_ota_payload.py " (remember to leave a space) and simply drag the ROM zip file to the command terminal, press space and then drag the output foler to the terminal line, which will look like in my case...
Code:
sudo python3 extract_android_ota_payload.py '/home/lawhec/Downloads/ROM/LE2113_11_F-75.zip' '/home/lawhec/Downloads/ROM/output'
...this will now run the python script you downloaded earlier that will begin extracting the ROM you've specified and will output all relevant xx.img files into your output folder, including the one we want, "boot.img" - there is no need to extract paylod.bin beforehand, the script will automatically do this for you. Once all xx.img files have been extracted the script will stop, depending on your computer this will take anything from 1-5 minutes, maybe longer on some very old or low spec'd computers - but just let it run its course. Once it is done you can then close the terminal window.
9. Now with the boot.img we've extracted, transfer this file on to your phone (the Downloads folder is usually a good choice). Now open Magisk and patch the boot.img file - once this has been completed, it'll generate a patched boot.img file named something like "magisk_patched-25200_12345.img" - copy and paste this patched boot image back on to your computer (into the folder you've been using will be fine here).
10. If your OnePlus 9 phone is connected to your computer via USB cable, disconnect it now. Then shutdown your phone into a power-off state then reboot it into fastboot mode - this can be done by holding down the volume up & down buttons, then holding down the power button and keep holding down all three buttons until you feel a vibration from your phone. Your OnePlus 9 should then boot into fastboot mode.
11. Now reconnect your OnePlus 9 to your computer via the USB cable and then open up a new display terminal (preferably by right-clicking in the file window of the directory where you saved your Magisk patched boot.img file). Enter the following...
Code:
fastboot devices
...you should then get a line featuring a block of numbers that should match the serial number that is displayed on your phone's display, followed by "fastboot", for example...
Code:
85f53405 fastboot
...if you get anything else, double check your connections at try again - if more than one device is displayed, disconnect the and try again to make sure that only one device is listed. It might also be the case that you don't have the proper drivers installed on your computer for your phone though in my case LM21.1 automatically recognises my phone, so I'm not of any direct help here I'm afraid for this, sorry.
12. Now you will be flashing your patched boot.img to your phone - this is where things can be a little nervous though as long as you do everything right nothing should really go wrong. Type the following into the command terminal, assuming you did so by opening a command terminal from the folder your Magisk Patched boot.img file is located...
Code:
fastboot flash boot <<Magisk Patched boot.img>>
...for example in my case the command line would be...
Code:
fastboot flash boot magisk_patched-25200_12345.img
...otherwise you will need to provide the location of where your patched boot.img is, so in this case...
Code:
fastboot flash boot '/home/lawhec/Downloads/ROM/magisk_patched-25200_12345.img'
...either way, your phone will now be in the process of getting its boot image replaced with the one patched by Magisk. This should take no more than a few seconds and that should be it done! You can then close the terminal window again.
13. Once you've patched the boot image, disconnect the phone from the USB cable to the computer and make sure that the screen on your mobile says "START" in green at the top, if it doesn't, use the volume keys to change this. Then just simply press the power button and your phone will now reboot, this can take a little bit longer than before as your phone's firmware has changed so give it time - (however if it takes longer than 10 minutes or so you might have a problem here) - once your home screen becomes available, give it a few seconds once you've entered before selecting the Magisk app. Once you've done this, Magisk should say that it is installed however to double check, use an app that requires root permissions either to work (e.g. Network Signal Guru) or to do additional things, like a simple root checker app that you can download from wherever you download your apps. If everything is good, then you've rooted your OnePlus 9!
Notes: This process will probably work for other firmware packages for various phones where the boot.img can be extracted to be patched by Magisk and then flashed via fastboot (assuming the bootloader is unlocked) which includes the OnePlus 7T's stock firmware, but I can give no guarantees for this. Once again, try at your own risk.​
I would suggest to boot the magisk patched image and then doing a direct install from the app instead of flashing it directly. This way you can use the "Restore images" feature in the Magisk app that can be useful when doing incremental update.
Thank You for thinking of Us Linux Users !
Attempted to update to LOS 20 via ADB, and now my touch screen will not work. All the remedies here require a Windows system for the MSM tool, which I do not have...
barguybrady said:
Thank You for thinking of Us Linux Users !
Attempted to update to LOS 20 via ADB, and now my touch screen will not work. All the remedies here require a Windows system for the MSM tool, which I do not have...
Click to expand...
Click to collapse
You have a computer you can install windows on another partition it's not like you don't have the ability to use msm
stez827 said:
You have a computer you can install windows on another partition it's not like you don't have the ability to use msm
Click to expand...
Click to collapse
no comment
barguybrady said:
Yup.
Just gonna spend another 4 or 5 hours prepping a drive to somehow install windows just to fix a phone.
Maybe - No....
Click to expand...
Click to collapse
It does not take that long as a Linux user who has had to install for that exact reason it took maybe an hour or 2
lawhec said:
As a OnePlus 9 user who likes to root their phone mainly to allow Network Signal Guru to work (as well as a few other root things like AdAway) I had been trying to extract the boot.img the same way as I had done with a OnePlus 7T using Payload Dumper for Windows. However it looks like Payload Dumper has issues with extracting xx.img files (including boot.img) if the payload.bin file is bigger than 4.3 GB in size. So I've been looking to see if another method was possible that would work for our OnePlus 9 ROMs that are above this file size. As I use Linux Mint as my usual desktop OS & only fall back onto Windows for stuff that'll only run on that OS, I went to have a look to see if something could be done under Linux. Turns out there is an old thread elsewhere on XDA that almost nearly provides what is needed for this, and I thought I would gives details here that should work for the time of this post (March 2023).
This not only extracts the boot.img to patch in Magisk, but also extracts other xx.img files as well.
I'm using Linux Mint 21.1, but I'd assume that this will also work for similar Ubuntu builds or anything that is based on Debian.
Obligatory disclaimer: The following instructions I'm giving below have worked well for me several times in the past, however I am in no way responsible for screwing up or damaging your phone if you try and follow what I've written below. In extreme cases, a bad flash may require using the OnePlus MSM tool to completely reflash your phone. Back up anything important first before doing any of the following!​
1. You will need to ensure that you have downloaded packages to be able to do adb & fastboot from the command line. You can check by running the following commands - if it's already installed with the latest versions, the terminal interface will let you know...
Code:
sudo apt install adb
Code:
sudo apt install fastboot
2. You will need to go to your software manager in LM21.1 and install both Python 3 & the Python Protobuf compiler. Just search for "Python 3" & "Protobuf-compiler" in the software manager and the first option for each search is what you should need - if they are not installed, install them.
3. Create a read/writable directory that will hold your ROM that you've just downloaded & other files that I'll mention soon. I just use a folder calls "ROM" in my Downloads folder (e.g. /home/lawhec/Downloads/ROM ), but you can choose wherever you want that suits you.
4. If you have not done so already, make sure you have the FULL package of your OnePlus 9 ROM downloaded. As of right now (March 2023) it seems the best way is to download the package using the Oxygen Updater app which is available on Google Play - more info available at oxygenupdater.com - just download the ROM to your phone and transfer it on to your computer into the folder you've created for it.
5. Download and save the following two Python scripts/files ("Right click" & "Save Link As") into the folder you have just created for your ROM (all credit to Gregory Cyxx at github.com/cyxx )...
https://raw.githubusercontent.com/c...payload/master/extract_android_ota_payload.py
https://raw.githubusercontent.com/cyxx/extract_android_ota_payload/master/update_metadata_pb2.py
6. Make sure in your file browser (Nemo in my case as it is the default for LM21.1 Cinammon, yours may differ) the window is open in the ROM folder that contains the two Python scripts above that you've just downloaded as well as a ROM package (ZIP file) you've downloaded (in my case from Oxygen Updater mentioned in step 3). Create a new folder for the extracted images to be written to - in my case I just call the folder "output" which is located at "/home/lawhec/Downloads/ROM/output" but again you can call it what you wish.
7. After you've created your output folder, in your ROM directory in the file manager window right-click on your mouse in a white or free space and select "Open in Terminal" - a command terminal will pop up defaulting to your directory.
8. In the command terminal, type the following command and press enter/return...
Code:
sudo python3 extract_android_ota_payload.py <<Your ROM.zip>> <<Your Output Directory>>
...for example, in my case the command would be either...
Code:
sudo python3 extract_android_ota_payload.py LE2113_11_F-75.zip output
...or for handiness you can type "sudo python3 extract_android_ota_payload.py " (remember to leave a space) and simply drag the ROM zip file to the command terminal, press space and then drag the output foler to the terminal line, which will look like in my case...
Code:
sudo python3 extract_android_ota_payload.py '/home/lawhec/Downloads/ROM/LE2113_11_F-75.zip' '/home/lawhec/Downloads/ROM/output'
...this will now run the python script you downloaded earlier that will begin extracting the ROM you've specified and will output all relevant xx.img files into your output folder, including the one we want, "boot.img" - there is no need to extract paylod.bin beforehand, the script will automatically do this for you. Once all xx.img files have been extracted the script will stop, depending on your computer this will take anything from 1-5 minutes, maybe longer on some very old or low spec'd computers - but just let it run its course. Once it is done you can then close the terminal window.
9. Now with the boot.img we've extracted, transfer this file on to your phone (the Downloads folder is usually a good choice). Now open Magisk and patch the boot.img file - once this has been completed, it'll generate a patched boot.img file named something like "magisk_patched-25200_12345.img" - copy and paste this patched boot image back on to your computer (into the folder you've been using will be fine here).
10. If your OnePlus 9 phone is connected to your computer via USB cable, disconnect it now. Then shutdown your phone into a power-off state then reboot it into fastboot mode - this can be done by holding down the volume up & down buttons, then holding down the power button and keep holding down all three buttons until you feel a vibration from your phone. Your OnePlus 9 should then boot into fastboot mode.
11. Now reconnect your OnePlus 9 to your computer via the USB cable and then open up a new display terminal (preferably by right-clicking in the file window of the directory where you saved your Magisk patched boot.img file). Enter the following...
Code:
fastboot devices
...you should then get a line featuring a block of numbers that should match the serial number that is displayed on your phone's display, followed by "fastboot", for example...
Code:
85f53405 fastboot
...if you get anything else, double check your connections at try again - if more than one device is displayed, disconnect the and try again to make sure that only one device is listed. It might also be the case that you don't have the proper drivers installed on your computer for your phone though in my case LM21.1 automatically recognises my phone, so I'm not of any direct help here I'm afraid for this, sorry.
12. Now you will be flashing your patched boot.img to your phone - this is where things can be a little nervous though as long as you do everything right nothing should really go wrong. Type the following into the command terminal, assuming you did so by opening a command terminal from the folder your Magisk Patched boot.img file is located...
Code:
fastboot flash boot <<Magisk Patched boot.img>>
...for example in my case the command line would be...
Code:
fastboot flash boot magisk_patched-25200_12345.img
...otherwise you will need to provide the location of where your patched boot.img is, so in this case...
Code:
fastboot flash boot '/home/lawhec/Downloads/ROM/magisk_patched-25200_12345.img'
...either way, your phone will now be in the process of getting its boot image replaced with the one patched by Magisk. This should take no more than a few seconds and that should be it done! You can then close the terminal window again.
13. Once you've patched the boot image, disconnect the phone from the USB cable to the computer and make sure that the screen on your mobile says "START" in green at the top, if it doesn't, use the volume keys to change this. Then just simply press the power button and your phone will now reboot, this can take a little bit longer than before as your phone's firmware has changed so give it time - (however if it takes longer than 10 minutes or so you might have a problem here) - once your home screen becomes available, give it a few seconds once you've entered before selecting the Magisk app. Once you've done this, Magisk should say that it is installed however to double check, use an app that requires root permissions either to work (e.g. Network Signal Guru) or to do additional things, like a simple root checker app that you can download from wherever you download your apps. If everything is good, then you've rooted your OnePlus 9!
Notes: This process will probably work for other firmware packages for various phones where the boot.img can be extracted to be patched by Magisk and then flashed via fastboot (assuming the bootloader is unlocked) which includes the OnePlus 7T's stock firmware, but I can give no guarantees for this. Once again, try at your own risk.​
Click to expand...
Click to collapse
If Using the t-Mobile Variant - LE2117 - we are Unable to Install any OTA Updates with OxygenUpdater, and are promptly warned of this limitation upon install. Nevertheless, I forged ahead and,
Following this Method, I downloaded a LE2115_11_F.17.zip, and proceeded to use your helpful .py scripts to extract the boot.img file, and Flash it - promptly sending me to a Qualcomm CrashDump mode.
Having a chance to MSM back to "stock" LE2117 - 11.2.2.2 LE54CB, I am wondering if I should just let the t-Mobile Update, through "Settings >> System >> System update" to Update the Stock ( bloated !? ) OS with all that are available,
Then attempt to Extract a boot.img and Magisk patch it ?
Any Advice?
TIA

Categories

Resources