[Oreo 8.0]AOSP build for dora - Sony Xperia X Performance ROMs, Kernels, Recoverie

I have build Android Oreo (8.0) successfully for Xperia X Performance (f8131) from AOSP source.
Instructions:
extract android-oreo-161117.zip ,
Connect phone in fastboot mode (vol-up & power)
flash boot, system, userdata (and, optionally - recovery)
fastboot -S 256M flash boot boot.img
fastboot -S 256M flash system system.img
fastboot -S 256M flash userdata userdata.img
See second post for flashing oem partition.
Works: everything
Bugs: Unknown
Build from SE AOSP, kernel sources link: Sony kernel sources
Link for building from AOSP: Building from AOSP
Links:
android-oreo,Software binaries
XDA:DevDB Information
TheExplorer, ROM for the Sony Xperia X Performance
Contributors
NielDK, NielDK
ROM OS Version: 8.x Oreo
ROM Kernel: Linux 4.x
ROM Firmware Required: TWRP
Based On: AOSP
Version Information
Status: No Longer Updated
Current Stable Version: 20171116
Stable Release Date: 2017-10-13
Created 2017-10-12
Last Updated 2018-10-08

Workaround for flashing oem partition
Until Sony updates their Firmware to allow flashing of oem partition, this is a workaround to flash this partition thru TWRP recovery and using dd.
Download and unzip SW_binaries_for_Xperia_AOSP_O_MR0_4.4_v05_tone.zip from https://developer.sonymobile.com/open-devices/list-of-devices-and-resources/
Create a sparse oem.img from the downloaded binaries.
Code:
$ simg2img SW_binaries_for_Xperia_AOSP_O_MR0_4.4_v05_tone.zip oem.raw
Then flash the oem partition (workaround, until Sony updates stock image with oem partition writable)
Boot to TWRP recovery by powering off the phone completely, hold VOL-DOWN and POWER and wait for TWRP boot.
Or, fastboot boot twrp.img
Code:
$ adb root
$ adb push oem.raw /sdcard/
$ adb shell
# dd if=/sdcard/oem.raw of=/dev/block/mmcblk0p42

Changelogs
November 16th 2017
r_31 (android-oreo-161117)
November 5th security patches
November 9th 2017
r_17 (android-oreo-121109)
Removed Google search bar from Trebuchet Launcher

I don't have my f8132 with me right now, so I'll refine this in a few hours when I can check it rather than reciting from memory, but here's a solution to the OEM partition problem.
Note that this is potentially dangerous if you don't know what you're doing (although in the worst case you should be able to reflash stock firmware - just don't blame me if you brick your device).
* Make sure you've got TWRP on the device
* When the device stops during the boot sequence, connect via USB cable
* Run "adb root" (you'll need this to be able to read fstab files)
* Open an adb shell
* Determine the block device of the OEM partition (IIRC using "mount" will give you the LVM device not the actual block device, so you'll have to check by using "cat fstab.dora" or "cat fstab.tone")
* Grab the binaries for Oreo, unzip, and unsparse the image file
* Copy the unsparsed image file to an SD card, or push it to somewhere persistent on the device
* Reboot to TWRP, and open TWRP's terminal
* Run "dd if=[path to image] of=[block device of OEM partiton]"
* Reboot to system, and the device should boot Oreo.
Incidentally, when I built AOSP 8.0 myself I flashed the Nano Open GApps + Magisk 14.2 beta and it all worked.

Hendikins said:
I don't have my f8132 with me right now, so I'll refine this in a few hours when I can check it rather than reciting from memory, but here's a solution to the OEM partition problem.
Note that this is potentially dangerous if you don't know what you're doing (although in the worst case you should be able to reflash stock firmware - just don't blame me if you brick your device).
* Make sure you've got TWRP on the device
* When the device stops during the boot sequence, connect via USB cable
* Run "adb root" (you'll need this to be able to read fstab files)
* Open an adb shell
* Determine the block device of the OEM partition (IIRC using "mount" will give you the LVM device not the actual block device, so you'll have to check by using "cat fstab.dora" or "cat fstab.tone")
* Grab the binaries for Oreo, unzip, and unsparse the image file
* Copy the unsparsed image file to an SD card, or push it to somewhere persistent on the device
* Reboot to TWRP, and open TWRP's terminal
* Run "dd if=[path to image] of=[block device of OEM partiton]"
* Reboot to system, and the device should boot Oreo.
Incidentally, when I built AOSP 8.0 myself I flashed the Nano Open GApps + Magisk 14.2 beta and it all worked.
Click to expand...
Click to collapse
Thanks!
First post updated with instructions on how to do this

NielDK said:
First post updated with instructions on how to do this
Click to expand...
Click to collapse
Thanks! Saved me trimming that down now that I'm home *grin*.
Having picked up an XZ Premium recently I haven't tested much with AOSP on my F8132 (other than booting, wifi and camera), but Sony's "Current platform functionality" list should give a pretty good idea of what does and doesn't work with a stock build.

unlocked bootloader only ? : (

does it work on Dual model?

J.M.Siyath said:
does it work on Dual model?
Click to expand...
Click to collapse
I haven't tried NeilDK's build specifically, but I've built and run AOSP 8.0 from the same source on my F8132 (Xperia X Performance Dual).

jordanvachon said:
unlocked bootloader only ? : (
Click to expand...
Click to collapse
Yes, you cant flash custom ROMs on locked bootloader.

Hendikins said:
I haven't tried NeilDK's build specifically, but I've built and run AOSP 8.0 from the same source on my F8132 (Xperia X Performance Dual).
Click to expand...
Click to collapse
It will probably "work" but pretty sure no dualsim if you use this build.

Is this built directly from the Sony repos on github, or are there any additional patches involved?

jisoo said:
Is this built directly from the Sony repos on github, or are there any additional patches involved?
Click to expand...
Click to collapse
This is pure AOSP from sources, with october security patches.

NielDK said:
This is pure AOSP from sources, with october security patches.
Click to expand...
Click to collapse
Sorry, I meant to ask if the device trees and kernel are just the ones from the xperia github repo by Sony, or you had to patch them.
The reason I'm curious is that I am planning on doing personal build and would like to know if those repos are good enough to use for Oreo already, or need patching to get a properly working phone.

jisoo said:
Sorry, I meant to ask if the device trees and kernel are just the ones from the xperia github repo by Sony, or you had to patch them.
The reason I'm curious is that I am planning on doing personal build and would like to know if those repos are good enough to use for Oreo already, or need patching to get a properly working phone.
Click to expand...
Click to collapse
They are good to use

J.M.Siyath said:
does it work on Dual model?
Click to expand...
Click to collapse
It works but only have 32gb rom you can use
我從使用 Tapatalk 的 Xperia X Performance 發送

CrT乂雷神 said:
It works but only have 32gb rom you can use
我從使用 Tapatalk 的 Xperia X Performance 發送
Click to expand...
Click to collapse
Is it necessary to flash oem partition?

hanson2046 said:
Is it necessary to flash oem partition?
Click to expand...
Click to collapse
Yes, or it wont boot.

NielDK said:
Yes, or it wont boot.
Click to expand...
Click to collapse
ok,thank you.
But why not use the sony guide like this: fastboot flash oem SW_binaries_for_Xperia_AOSP_O_MR0_4.4_<release version>_<platform>.img
---------- Post added at 01:29 AM ---------- Previous post was at 01:24 AM ----------
NielDK said:
Until Sony updates their Firmware to allow flashing of oem partition, this is a workaround to flash this partition thru TWRP recovery and using dd.
Download and unzip SW_binaries_for_Xperia_AOSP_O_MR0_4.4_v02_tone.zip from https://developer.sonymobile.com/open-devices/list-of-devices-and-resources/
Create a sparse oem.img from the downloaded binaries.
Code:
$ simg2img SW_binaries_for_Xperia_AOSP_O_MR0_4.4_v02_tone.img oem.raw
Then flash the oem partition (workaround, until Sony updates stock image with oem partition writable)
Boot to TWRP recovery by powering off the phone completely, hold VOL-DOWN and POWER and wait for TWRP boot.
Or, fastboot boot twrp.img
Code:
$ adb root
$ adb push oem.raw /sdcard/
$ adb shell
# dd if=/sdcard/oem.raw of=/dev/block/mmcblk0p42
Click to expand...
Click to collapse
$ adb root
$ adb push oem.raw /sdcard/
$ adb shell
Is this three code running in fastboot?
dd if=/sdcard/oem.raw of=/dev/block/mmcblk0p42
this code running in twrp?

hanson2046 said:
ok,thank you.
But why not use the sony guide like this: fastboot flash oem SW_binaries_for_Xperia_AOSP_O_MR0_4.4_<release version>_<platform>.img
---------- Post added at 01:29 AM ---------- Previous post was at 01:24 AM ----------
$ adb root
$ adb push oem.raw /sdcard/
$ adb shell
Is this three code running in fastboot?
dd if=/sdcard/oem.raw of=/dev/block/mmcblk0p42
this code running in twrp?
Click to expand...
Click to collapse
Sony doesn’t atm allow fastboot to flash oem.
So, as a “hack” , we use dd to write to that partition, which we from TWRP can do.

Related

[KERNEL][3.0.31][OC, CIFS, TUN]intersectRaven's Kernel 07/31/2012 17:34

This is my personally compiled kernel for the Kindle Fire with a few optimizations.
Acknowledgments:
DooMLoRD - for helping greatly in my initial trials on how to create kernels for the Fire
g1011999 - for providing a working .config
paulobrien - insecure boot image
franciscofranco - for some of the ARM optimizations which I've missed since I stopped modding the N1
hashcode - the 3.0 kernel base
Features:
- compiled using Mjolnir
- CPU overclocking code from OMAPZOOM repositories
- ARM code optimizations
What doesn't work:
same bugs as Hashcode's
Download URL:
http://intersectraven.euroskank.com/kernels/
Latest Changes:
20120730_08XX:
- backported cleancache and zcache improvements from 3.4
20120709_1619:
- added further tweaks to interactive scheduler
- rebased experimental optimization to minimize chance of faulty merge
20120703_1041:
- rebased to hashcode's 3.0.31 kernel with support for the touchscreen filter
- added an experimental optimization which in theory should make the kernel a bit more responsive...at least in theory...
20120619_2251:
- numerous ARM optimizations (most from the 2.6 series)
- ported CM's changes to the interactive governor and low memory killer
- GPU driver is compiled into the kernel
20120601_1145:
- integrated latest BFQ release 4 for selection (not default) in SetCPU
20120513_1557:
- integrated shutdown fix from hashcode
20120512_2044:
- first 3.0 release with almost all my tweaks
20120216_1740:
- final fix for TUN without module (if it still doesn't work, going to module in next release)
- UTF8 support for file systems
- some optimizations
20120211_1219:
- minor update for fixing OpenVPN based VPNs
20120207_19XX:
- unification release (unified all my modifications with my Galaxy Nexus kernel and restarted from scratch)
- ARM optimizations
- OC without thermal control
- compiler optimizations
- CIFS and TUN enabled
- now based on 2.6.35.14
- now in zip version for easier flashing
***DEPRECATED***
Instructions (stock WiFi driver):
1.) Boot to fastboot
2.) Test first using fastboot boot command
Instructions (custom WiFi driver):
1.) Turn off WiFi.
2.) Use adb push command to push tiwlan_drv.ko to /sdcard/
3.) Using root explorer, rename tiwlan_drv.ko from /system/etc/wifi to tiwlan_drv.ko.bak.
4.) Usring root explorer, copy tiwlan_drv.ko from /sdcard/ to /system/etc/wifi. Make sure permissions are same with other files in directory together with owner and group being set to root.
5.) Reboot to fastboot and TEST FIRST using fastboot boot command
Detailed instructions are on the next post.
***DEPRECATED***
GitHub:
http://www.github.com/intersectRaven/kindle-kernel
Detailed Instructions:
Turn off your device's WiFi.
From your command prompt issue the ff. commands:
Code:
adb shell
su
idme bootmode 4002
reboot
This will cause your kindle to reboot to fastboot mode. Issue the ff. commands:
Code:
fastboot -i 0x1949 boot bootnew.img
This will cause the Kindle to boot TEMPORARILY to the new kernel which I assume you downloaded from me.
If it doesn't boot normally, you can turn off your Kindle by holding down the power button for at least 10 seconds then turn it on again.
This will boot your Kindle to fastboot mode again.
If the kernel didn't work:
Code:
fastboot -i 0x1949 oem idme bootmode 4000
fastboot -i 0x1949 reboot
This will reboot your Kindle back to normal.
If the kernel worked, here's how to flash it permanently:
Code:
fastboot -i 0x1949 flash boot bootnew.img
fastboot -i 0x1949 oem idme bootmode 4000
fastboot -i 0x1949 reboot
This should boot up with the new kernel.
Once you've booted up properly, issue the ff. commands to replace your stock WiFi driver with the new one.
Code:
adb push tiwlan_drv.ko /system/etc/wifi/
adb shell
su
cd /system/etc/wifi
chmod 644 tiwlan_drv.ko
Ensure that the permissions, owner and group settings for the new WiFi driver are correct by issuing:
Code:
ls -l
Turn on your WiFi.
Partition Backup Instructions:
From your command prompt, issue the ff. commands:
Code:
adb shell
su
This should give you superuser command prompt on your Kindle Fire. To confirm,
you should see a # as your command prompt. Next, issue the ff. commands to backup the smaller partitions to your sdcard. Make sure that the sdcard isn't mounted on your computer so that it is accessible to the Kindle Fire.
Code:
dd if=/dev/block/mmcblk0p1 of=/sdcard/xloader.bin
dd if=/dev/block/mmcblk0p2 of=/sdcard/bootloader.bin
dd if=/dev/block/mmcblk0p3 of=/sdcard/dkernel.bin
dd if=/dev/block/mmcblk0p4 of=/sdcard/dfs.bin
dd if=/dev/block/mmcblk0p5 of=/sdcard/recovery.bin
dd if=/dev/block/mmcblk0p6 of=/sdcard/backup.bin
dd if=/dev/block/mmcblk0p7 of=/sdcard/boot.bin
After executing those commands, you can now mount the sdcard through USB and copy those files to your HD for backup purposes. The remaining partitions through 8 - 11 can be backed up as well but I'll leave that to your own discretions. These partitions were chosen because they're either critical or unreplicable.
You can also use adb to pull the images above directly to your PC. Here're the commands to do so:
Code:
adb pull /dev/block/mmcblk0p1 xloader.bin
adb pull /dev/block/mmcblk0p2 bootloader.bin
adb pull /dev/block/mmcblk0p3 dkernel.bin
adb pull /dev/block/mmcblk0p4 dfs.bin
adb pull /dev/block/mmcblk0p5 recovery.bin
adb pull /dev/block/mmcblk0p6 backup.bin
adb pull /dev/block/mmcblk0p7 boot.bin
for stock only?
JackpotClavin said:
for stock only?
Click to expand...
Click to collapse
Yeah. There's still a couple of glitches though. Seems connecting USB crashes everything.
And wifi doesn't work?
Sent from my Kindle Fire using xda premium
Veritass said:
And wifi doesn't work?
Sent from my Kindle Fire using xda premium
Click to expand...
Click to collapse
Yup. That's why it's marked INCOMPLETE in the title.
Stock Wifi works now!
*a bit flaky though...drops every now and then...still fixing...
great work mate!!!
have u uploaded sources to git?
also can u please send link of correct toolchain to use?
Have you tried to compile the bluetooth module? I still believe that the Kindle has Bluetooth support
DooMLoRD said:
great work mate!!!
have u uploaded sources to git?
also can u please send link of correct toolchain to use?
Click to expand...
Click to collapse
I'm still thinking of how to quickly upload to git.
As for the toolchain, anything should work. I've fixed my source to use Mjolnir though since I need it for some planned compiler fixes I want to use.
N23 said:
Have you tried to compile the bluetooth module? I still believe that the Kindle has Bluetooth support
Click to expand...
Click to collapse
Not yet. I was quite busy with fixing the WiFi module loading (since it's a pain to build) so I haven't looked at that. Also, even if I enable it, there's no support in the stock ROM so we need CM7 (or 9) to work as well.
intersectRaven said:
I'm still thinking of how to quickly upload to git.
As for the toolchain, anything should work. I've fixed my source to use Mjolnir though since I need it for some planned compiler fixes I want to use.
Not yet. I was quite busy with fixing the WiFi module loading (since it's a pain to build) so I haven't looked at that. Also, even if I enable it, there's no support in the stock ROM so we need CM7 (or 9) to work as well.
Click to expand...
Click to collapse
no problems mate
btw seems one of the kernels i posted yesterday boots, atleast for one user :
http://forum.xda-developers.com/showthread.php?p=20130507#post20130507
regarding wifi, do u have any idea which model of TI chipset is there?
i have the following repo for patched TI modules for Xperia 2011 devices... give it a shot if it works for Kindle Fire...
https://github.com/DooMLoRD/Xperia-2011-TI-WLAN
DooMLoRD said:
no problems mate
btw seems one of the kernels i posted yesterday boots, atleast for one user :
http://forum.xda-developers.com/showthread.php?p=20130507#post20130507
regarding wifi, do u have any idea which model of TI chipset is there?
i have the following repo for patched TI modules for Xperia 2011 devices... give it a shot if it works for Kindle Fire...
https://github.com/DooMLoRD/Xperia-2011-TI-WLAN
Click to expand...
Click to collapse
Thanks for the info! I'll try that later. Fyi, I tried the one in Amazon's release and it didn't work but maybe I did something wrong. I am quite unfamiliar with compiling modules outside of the kernel tree.
*Seems you modified it heavily to prevent reliance in outside export commands.
intersectRaven said:
Thanks for the info! I'll try that later. Fyi, I tried the one in Amazon's release and it didn't work but maybe I did something wrong. I am quite unfamiliar with compiling modules outside of the kernel tree.
*Seems you modified it heavily to prevent reliance in outside export commands.
Click to expand...
Click to collapse
me too
hahahha... yes i had to got bored with long commands
just the msm_env.bash is changed...
DooMLoRD said:
me too
hahahha... yes i had to got bored with long commands
just the msm_env.bash is changed...
Click to expand...
Click to collapse
Forgot to mention that the WiFi is wl1283.
intersectRaven said:
Forgot to mention that the WiFi is wl1283.
Click to expand...
Click to collapse
On the Wifi chip, a quick look at Chipworks indicates that not only does the WL1283 have bluetooth, but also GPS. Providing that its wired up right inside, should we also be able to get GPS working as well? Or is it missing the GPS antenna to make it work?
jcatt said:
On the Wifi chip, a quick look at Chipworks indicates that not only does the WL1283 have bluetooth, but also GPS. Providing that its wired up right inside, should we also be able to get GPS working as well? Or is it missing the GPS antenna to make it work?
Click to expand...
Click to collapse
Might have to add the GPS antenna if anything, but bluetooth could be possible. We just dont know if it has to be enabled in software or if it cant due to the hardware
jcatt said:
On the Wifi chip, a quick look at Chipworks indicates that not only does the WL1283 have bluetooth, but also GPS. Providing that its wired up right inside, should we also be able to get GPS working as well? Or is it missing the GPS antenna to make it work?
Click to expand...
Click to collapse
interesting... the TI driver i have (for Xperia 2011 devices) is WL1273... i have talked to a developer friend and he told me that WL12xx drivers are unified so we can try those drivers too...
Downloading the source here in a bit, but I had a few questions.
Can you check the gpu config? I believe its 1.7 pvr driver but the 3d memory has been cut down a bit. I'm not sure if it'd be possible to move some of that back w/o affecting other optimizations in the kernel. The reason I ask, is that I know ICS/tablet apps would run better with a bit more dedicated 3d mem.
I noted that CM7 was having some audio issues, is the kernel using a stock SoC/Alsa config? Or did they do something odd?
Lastly, I applaud you guys for grinding this out, it's always best to start from the ground up. Great work!
Sent from my DROID3 using XDA App
Kernel updated! See OP for changes.

[TOOL]ADB + Fastboot v1.0.31 for OS X/4.3 [NOW Includes ADB & Fastboot][08-17-2013]

[TOOL]ADB + Fastboot v1.0.31 for OS X/4.3 [NOW Includes ADB & Fastboot][08-17-2013]
ADB & FASTBOOT FOR OS X​
There has been some confusion since I discuss using Fastboot in this post, but the zip only contained ADB. This is completely my fault and I apologize. Either way I've updated the .zip to include ADB & Fastboot.​UPDATED: 08/17/2013 - Added Fastboot to adb-1.0.31-mac.zip​
I've seen several people having issues on OS X trying to use ADB since the release of Android 4.3. In my case ADB recognized my device, but each time I ran adb devices my device would be reported as offline. I downloaded the SDK from Google several times and always ended up with ADB v1.0.29 (4.2.2).
This will should solve your OS X & ADB issues if you're running Android 4.3. This ONLY includes the ADB & Fastboot executable files and is for Mac OS X ONLY. I, like many others, do not need the full SDK. If you're not an app developer, like myself, this is all you need to have ADB working on your machine.
For any new OS X users I'll add a how to just so you don't have to go search for it else where:
How to setup ADB + Fastboot on OS X
Note: This is for not for developers. This only includes ADB & Fastboot and is not the full Android SDK
Step 1: Download the ZIP containing ADB & Fastboot
Step 2: Extract the ZIP to the directory of your choice
Step 3: Optional Create an environment variable
1. Open Terminal
2. Type cd to take you to your home directory.
Code:
cd
3. Type touch .profile to create a hidden file in your home directory named .profile
Code:
touch .profile
4. Type open -e .profile to open the file you just created in TextEdit
Code:
open -e .profile
5. In the file, add the following:
Code:
export PATH=${PATH}:/PathToDirectoryWhereYouExtractedTheZIP
6. Save the file and close TextEdit, quit Terminal, and relaunch the Terminal
Step 4: In Terminal type adb devices, you should see your phone's corresponding serial number Ex: HXM1005HNF012345 device
Code:
adb devices
Note: If you choose not to create an environment variable from Step 3 it effects two things:
1. You will need to cd to the directory containing ADB each time you want to run ADB.
2. When executing ADB commands you will need to add ./ in front of ADB. Ex: ./adb devices
Dropbox Download
Alternate Download
I've used a mac with with all three of me nexus devices so ime pretty familiar but..is anyone else having probs with fastboot trying to flash a system.img ...I kept getting a error everytime. Boot.img would go through but not system img...? Any help would be great. If not no worries...adb seems to work fine if u need to push something ... But this is the first device I couldn't use fastboot flash system with...??
Candy Painted
matthew0776 said:
I've used a mac with with all three of me nexus devices so ime pretty familiar but..is anyone else having probs with fastboot trying to flash a system.img ...I kept getting a error everytime. Boot.img would go through but not system img...? Any help would be great. If not no worries...adb seems to work fine if u need to push something ... But this is the first device I couldn't use fastboot flash system with...??
Candy Painted
Click to expand...
Click to collapse
Did you have ADB previously installed before download this .zip? This is not the full Android SDK, but the updated version of ADB and doesn't include fastboot.
wad3g said:
...and doesn't include fastboot.
Click to expand...
Click to collapse
Perhaps all references to fastboot should be deleted, right now this thread still says "adb + fastboot...". Thanks for providing it all the same. Save me the 400mb download
Chatperdu said:
Perhaps all references to fastboot should be deleted, right now this thread still says "adb + fastboot...". Thanks for providing it all the same. Save me the 400mb download
Click to expand...
Click to collapse
You're right. I can't believe that never crossed my mind, I guess I was assuming everyone previously had ADB on their machine.
Anyway, I've updated the download links and attachments so now everything includes ADB & Fastboot files. Hopefully this will clear up any confusing in the future and I apologize to all of you who had issues due to this.
wad3g said:
You're right. I can't believe that never crossed my mind, I guess I was assuming everyone previously had ADB on their machine.
Click to expand...
Click to collapse
I have a previous installation. I am assuming fastboot doesn't have to match the adb version. Will try it out soon. My previous solution is to boot into bootloader, than adb will find the device, an inefficient work around.
Chatperdu said:
I have a previous installation. I am assuming fastboot doesn't have to match the adb version. Will try it out soon. My previous solution is to boot into bootloader, than adb will find the device, an inefficient work around.
Click to expand...
Click to collapse
Yes a previous version of fastboot should work fine. I don't believe fastboot was updated. I still use the the fastboot version that came with 1.0.29.
i followed these instructions, including creating .profile, but still neither my nexus 4 or new nexus 7 running 4.3 are recognized. Nothing is listed when I do adb devices, just an emtpy list

[Q] Can I make a .img of the /userdata partition?

I'm currently working on setting up a number of 2013 N7 LTEs (in the several hundred range, with possibly more to follow) with a specific set of apps. I'd really like to reduce the actual human interaction involved to a minimum (USB debugging activation at the start if possible) so I've been looking at fastboot flashing. Is it at all possible to clone the /userdata partition on a Nexus 7 to a .img file?
I've tried using dd and cat from the adb shell, and those all fail as they tend to copy the masses of empty space into the clone. I've also tried generating zips of the applications & their data using ZIPme, but that means having to manually enter the recovery (which, if there is no alternative, I am willing to do). ZIPme seems to have an issue with KitKat though, so I do wonder if anyone knows of any alternatives?
Older versions of CWM used to be img based.
The imgs it generated were essentially flashable via fastboot as they're the same filesystem as the original partition that was nandroided.
It's a lot of work (if you're not already set up to compile recoveries), but you could try reenabling the no longer used img nandroid code in CWM
-----------------------------------
Will the users have any kind of store access? (play/amazon/whatever)
If you hand out the same /data images and also go though first setup for the users, they could all end up with the same android ID.
Settings.Secure | Android Developers: #ANDROID_ID
The docs state that it's generated per user, so if you force them to all do initial setup themselves this isnt an issue.
If you dont care that they all have the same ID then you can ignore it.
Interesting. Do you know when/at what version they moved from away from the flashable img files? I'm going to go digging but if you can give me a hint it would be very much appreciated
The end user is going to be sent straight into a kiosk app to prevent them from hacking about with the device, so luckily I won't need to worry about the Play issue!
It was around the jump from CWM 5.0 -> 6.0, they added .dup and removed .img.
I cant tell you if it's worth your time to actually build your own rec with it reenabled, just pointing out the fact CWM used to do it in the past.
Adb has a backup and restore option, try looking into that maybe
http://forum.xda-developers.com/galaxy-nexus/general/guide-phone-backup-unlock-root-t1420351
Hi
I'm too interested in backup up the nexus partitions in fastboot flashable .img(s) to clone multiple Nexus for museum application(around 40 tablets)
I successfully grab system.img, boot.img, recovery.img from a "master" pre-configured rooted Nexus with:
Code:
adb shell dd if=... > c:\backup\....img
But dumping the userdata partition give me a 13gb file (with unfortunately the unused space) that doesn't seem to work when flashing...
The cloned tablet don't keep user setting/apps :\
Here how I do it:
MASTER:
- Fastboot oem unlock
- Setup tablet(root, install CWM, install apps, change setting, setup WIFI, change home app)
- Reboot in recovery for adb:
Code:
adb shell dd if=/dev/block/platform/msm_sdcc.1/by-name/system > c:\backup\system.img
adb shell dd if=/dev/block/platform/msm_sdcc.1/by-name/recovery > c:\backup\recovery.img
adb shell dd if=/dev/block/platform/msm_sdcc.1/by-name/userdata > c:\backup\userdata.img
adb shell dd if=/dev/block/platform/msm_sdcc.1/by-name/boot > c:\backup\boot.img
CLONED:
Code:
fastboot oem unlock
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot format cache
fastboot oem lock
But like I said, it doesn't work, still get the initial setup( language selection/setup tablet) and lost wifi setting and apps...
Found this old article that used the now removed ability of CWM to backup in .img
http://aigarius.com/blog/2012/09/23/cloning-or-pre-configuring-a-batch-of-android-phones/
Any thoughts, suggestions will be greatly appreciated, thanks.

Sideloading Signed-OTA_Update.zip

My goal is to be able to build stock AOSP from source, sign the .img files with my personal keys, flash them to my devices via fastboot, re-lock the bootloader, and then apply updates via adb sideload (with locked bootloader). Verified boot is thus preserved on my device and I can update monthly with the latest security updates. Profit. I followed the procedure as described here:
https://source.android.com/devices/tech/ota/tools.html
https://source.android.com/devices/tech/ota/sign_builds.html
Distilling the instructions, results in this code:
Code:
. build/envsetup.sh
lunch aosp_bullhead-userdebug
make dist DIST_DIR=dist_output
ls -l dist_output/*target_files*
./build/tools/releasetools/sign_target_files_apks -o -d ~/.android-certs dist_output/*-target_files-*.zip signed-target_files.zip
./build/tools/releasetools/ota_from_target_files -k ~/.android-certs/releasekey signed-target_files.zip signed-ota_update.zip
I was successful in accomplishing my goal (stock AOSP, locked bootloader, updates via adb sideload) with my old Nexus 5 (hammerhead) following the code above. But I have been unsuccessful doing the same with my newer Nexus 5x (bullhead). After loading ~50% of the process via adb sideload, the result is:
RecoveryScreenshot
Any ideas on how to resolve the error? Any ideas what Status 6 means?
Thank you in advance.
Try this HowTo to solve this.
ulxerker said:
Try this HowTo to solve this.
Click to expand...
Click to collapse
Thanks for the advice. My system is Ubuntu so Notepad++ is not available as a text editor. And Gedit doesn't have the options referenced in the video to edit the updater-script.
Mawth said:
Thanks for the advice. My system is Ubuntu so Notepad++ is not available as a text editor. And Gedit doesn't have the options referenced in the video to edit the updater-script.
Click to expand...
Click to collapse
then try it without the spript and just "adb sideload" the ota.zip via twrp and pc command shell.
ulxerker said:
then try it without the spript and just "adb sideload" the ota.zip via twrp and pc command shell.
Click to expand...
Click to collapse
My bootloader is locked. I am trying to use the "stock" recovery that I signed with my keys to sideload the update. TWRP is therefore not an option.

[GUIDE] Revert, rollback, or downgrade Nvidia Shield TV Experience Upgrade +DATA LOSS

NOTICE: Several users have reported issues downgrading from v7.2.x, so it might require some additional experimentation to downgrade from that version.
-
Missing your screenshot or twitch streaming functionality? Hate the new launcher layout w/ its tiny one row of icons and its numerous rows of psychologically-aggressive suggestion imposition?
Well, now you can stop cursing at Nvidia, because they provided a way (albiet, a highly technical and mostly-undocumented way), to load any version of their OS that you choose.
I've seen others wanting to downgrade (including myself), so I've collected the relevant steps which I used to successfully revert to an earlier version. This guide assumes a bit of technical working knowledge, so I apologize if you are one of the 'normal' people that Nvidia has bulldozed over...
All the usual "don't blame me for bricked devices" caveats apply.... please be careful, know what each step does! research each step!
Best of luck...
0 - prereqs
make sure your PC & nvidia shield are both plugged into a UPS, b/c a power failure during a flashing operation is not very pleasant.
make sure you have (or do get) the adb & fastboot binaries ("commands") for your computer
make sure that you get all your userdata off the device, because it will be erased by this process
1 - using a web browser
register for an nvidia developer account (which you will have an opportunity to do if you attempt the next step)
download the 6.3 'developer os' rom for your particular model
https: //developer.nvidia.com/shield-developer-os-images (sorry, noob filter won't allow the real/clickable url)​
NB: The 6.3 developer rom for the 2017 console is missing the userdata.img, there are currently no reports (on this thread) if a different userimage (pre-6.3 or for the 2015 version) works on the 2017 console (testers welcome!).
NB: if the cost of being identified as a developer offends you (i.e. yielding a name, company, email, etc), then you can probably dig up a link to the roms in the comments or elsewhere on the xda forums.
2 - on the device
enable developer mode by clicking the 'build' entry in settings->info
enable usb debugging in settings->developer-options
plug it into your computer using the usb port furthest from the hdmi port
3 - in a terminal
unzip the downloaded rom & cd into the resulting directory
edit the 'flash-all.sh' script to add the following line just before the final reboot:
fastboot flash userdata userdata.img​
#(this will add even more wall-time to the flashing process, but will clobber the already-erased newer 7.0 user partition data with the old)
adb reboot bootloader
fastboot oem unlock && ./flash-all.sh
NB: Now confirm your willingness to lose all your data. On the 2015 'pro' version of the console, this is accomplished by pressing (or holding) the nvidia logo 'button'... AND WILL TAKE NEARLY TWO HOURS. Others use the x/y/a/b buttons on the game controller connected to the usb port nearest to the hdmi port.
[... time passes ...]
NB: the 7.0 to 6.3 was a clean backstep for me, but if you are going between other versions, I can see that this script might stall in the middle if the device does not come back up with adb services available... in which case you will need to enter fastboot manually using a hardware method.
4 - Break TegraOTA
You have now flushed the correct version onto your device, but we can't complete the setup process... if you were to try, the final step would immediately and automatically start downloading & applying the latest (7.0) experience update! Therefore, we must neuter the updater itself.
Still in the terminal:
adb root
adb remount
adb shell
# now these commands are run in the adb shell (technically on the phone through the PC terminal)
# the first path was the right one for me, but I'm putting here all the paths known to me in case you are using a different version
rm -rf /system/priv-app/TegraOTA
rm -rf /system/app/TegraOTA
rm -rf /system/app/TegraOTA.apk
sync
reboot
5 - you should now be able to setup and pain-stakingly reconfigure your nvidia shield to the way it was before you blindly trusted an OEM update without doing extensive research beforehand.
PS: if you fear that netflix or amazon-video will at some point stop working because of this process, you might wish to "fastboot oem lock" the device (knowing that an unlock will erase your user-data, but having the developer rom means you can always get root access via adb).
I hope you find this useful.
Thanks! I will be trying this tonight! I miss 6.3 and PLEX is BROKEN in 7.0!
Any idea if this can be done without needing a controller? My buddy has a shield TV but bought it used without a controller.
rossbeck said:
Thanks! I will be trying this tonight! I miss 6.3 and PLEX is BROKEN in 7.0!
Any idea if this can be done without needing a controller? My buddy has a shield TV but bought it used without a controller.
Click to expand...
Click to collapse
Plex is NOT broken in 7.0 i use it everyday.
Builtfordtough1 said:
Plex is NOT broken in 7.0 i use it everyday.
Click to expand...
Click to collapse
I use it every day too... and since Plex v6.13, files fail to play after 3 seconds unless you run them a 2nd time.
It's a known issue that everyone is having due an acknowledged bug in exoplayer2 with certain containers like mkv. Since 7.0/oreo has plex v6.14 baked in as a system app, it's impossible to downgrade to v6.12 to get rid of the issue until Plex fixes it... and they've known about it for 2 months now. Since quantity has been their focus over quality lately, I'm not holding my breath for a fix.
The solution is to downgrade to 6.3, manually install plex v6.12, and turn off app updates.... so that's my plan.
rossbeck said:
Any idea if this can be done without needing a controller? My buddy has a shield TV but bought it used without a controller.
Click to expand...
Click to collapse
I think it depends on the model. AFAIK, the newer 2017 ones need a controller (or possibly a USB keyboard) to confirm the userdata partition wipe.
Osndok said:
I think it depends on the model. AFAIK, the newer 2017 ones need a controller (or possibly a USB keyboard) to confirm the userdata partition wipe.
Click to expand...
Click to collapse
Ahhh, good call. I'll have him try a usb keyboard.
doesnt work for me... i have a nvidia shield tv 2015. i tried with flash-all.bat
and im stuck after reboot. is there any other way?
crazyscow said:
doesnt work for me... i have a nvidia shield tv 2015. i tried with flash-all.bat
and im stuck after reboot. is there any other way?
Click to expand...
Click to collapse
What command did the script stop at? and how 'stuck' are you (i.e. can you get to fastboot?).
I imagine that if you started with the wrong rom, it would likely fail to boot.
thanks for the fast reply, i just manually installed it without the bat file
I went manually into the fastboot mode by unplugging the power pressing the power button and plugging it back in until fastboot mode comes.
then i typed
fastboot flash staging blob
fastboot flash boot boot.img
wait until the sound on windows comes then - adb devices
adb reboot bootloader
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot reboot
and then it booted
crazyscow said:
thanks for the fast reply, i just manually installed it without the bat file
I went manually into the fastboot mode by unplugging the power pressing the power button and plugging it back in until fastboot mode comes.
then i typed
fastboot flash staging blob
fastboot flash boot boot.img
wait until the sound on windows comes then - adb devices
adb reboot bootloader
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot reboot
and then it booted
Click to expand...
Click to collapse
How did you get past the forced update? I was able to flash 6.3, but it forces the update during setup and I don't have ADB access yet because usb debugging isn't turned on. Can't disable the OTA updates without it!
Basically I've successfully flashed 6.3 and am sitting at a working fastboot prompt. Not sure what to do from here.
rossbeck said:
How did you get past the forced update? I was able to flash 6.3, but it forces the update during setup and I don't have ADB access yet because usb debugging isn't turned on. Can't disable the OTA updates without it!
Basically I've successfully flashed 6.3 and am sitting at a working fastboot prompt. Not sure what to do from here.
Click to expand...
Click to collapse
Disabling the OTA update is step four, if ADB does not work, I would guess that you forgot to flash userdata.img in the previous step(s).
Osndok said:
Disabling the OTA update is step four, if ADB does not work, I would guess that you forgot to flash userdata.img in the previous step(s).
Click to expand...
Click to collapse
So you did what to get userdata.img? Created it in TWRP or something? It's not included with the recovery images... and this basically bypasses the OOBE/setup stuff?
Thanks man
rossbeck said:
you did what to get userdata.img? ... It's not included with the recovery images... and this basically bypasses the OOBE/setup stuff?
Click to expand...
Click to collapse
userdata.img is inside the ZIP from the nvidia developer website, as can be seen here:
Code:
$ jar tf nv-recovery-image-shield-atv-pro-6.3.0-dev_rooted.zip | grep user
nv-recovery-image-shield-atv-pro-6.3.0-dev_rooted/userdata.img
rossbeck said:
[the userdata.img] basically bypasses the OOBE/setup stuff?
Click to expand...
Click to collapse
No... not really. The userdata.img from the developer pack both (1) matches the 6.3 version (doesn't have any of the newer, potentially incompatible entries), and (2) has developer-mode & adb enabled by default.
So in addition to it probably just working better, flashing the userdata will let you get adb access, and thus break the OTA, and thus complete the setup w/o the update.
I thought it would boot up, but im still stuck on the android loading screen!
Ill try to reflash the rom again tonight.
update:
I got it to work now, without update having to update to 7.0.2
Code:
adb reboot bootloader
fastboot flash staging blob
fastboot flash boot boot.img
fastboot reboot
//waiting for nvidia logo and the Windows PC to make the connection noise
//otherwise you can check by typing
adb devices
// if it shows something then continue
adb reboot bootloader
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash vendor vendor.img
fastboot flash userdata userdata.img
fastboot reboot
once it booted it up, i went thru the procedure of setting it up with my network and google account, then the window pop-up "downloading version 7.0.2" then i followed the guide in the first post
Code:
adb root
adb remount
adb shell
# now these commands are run in the adb shell (technically on the phone through the PC terminal)
# the first path was the right one for me, but I'm putting here all the paths known to me in case you are using a different version
rm -rf /system/priv-app/TegraOTA
rm -rf /system/app/TegraOTA
rm -rf /system/app/TegraOTA.apk
sync
reboot
after that it booted up into android 7 with not OTA update notification.
thank you!
hello, thanks for the contribution, but when decompressing the image of developer 6.3 of shield tv 2017 I do not know where to get the file userdata.img, could you give me where to get it?
lohengrim93 said:
when decompressing the image of developer 6.3 of shield tv 2017 I do not know where to get the file userdata.img, could you give me where to get it?
Click to expand...
Click to collapse
As I said in #13, I found the userdata.img inside the archive from nvidia (the 2015 "pro" version to be exact), and I don't know why it is missing from (at least) the 6.3 archive for the 2017 device.
If you are feeling adventurous, you can try downloading either of the 2015 zips, and use its userdata.img... maybe the 16gb one?
I would be eager to know if that works for you, since I'm unsure if the userdata.img can be mixed between different versions of the console...
JUST BE VARY CAREFUL to not mix up your directories and start flashing the wrong blobs & boots... that would be a recipe for a brickin', methinks.
crazyscow said:
I got it to work now, without ... having to update to 7.0.2
... i followed the guide in the first post...
after that it booted up into android 7 [without] OTA update notification.
thank you!
Click to expand...
Click to collapse
I'm quite pleased to hear that it worked for you... (my first success report!).
Adb root
When I attempt to run the adb root command it just errors on me at the end, do I need to have the shield booted into setup for it to work?
Insatiablejimmy said:
When I attempt to run the adb root command it just errors on me at the end, do I need to have the shield booted into setup for it to work?
Click to expand...
Click to collapse
You forgot to include (or even describe) the actual error message, so I can only guess as to what is wrong.
However, since "adb root" is the linchpin of the developer rom, I would assume that you did not flash a developer rom (or as indicated above concerning the 2017 model) are missing the "userdata.img", which could also cause this behavior.

Categories

Resources