(Discussion) Project Treble for all devices - Treble-Enabled Device Guides, News, & Discussion

Hey I was wondering what would the best method be to bring project treble support to all devices I know that vendor partitions and the partition table might defer based on manufacturer and I know that a script for every device is out of the question, but let's say I wanted to make a script for all OnePlus or all unlocked Moto devices since 2013 what would be the best method to do so and is anyone willing to help me in this project as I am rather new to coding

Project Trable only for android 8.0 because this is featured by google.

kanaan360 said:
Hey I was wondering what would the best method be to bring project treble support to all devices I know that vendor partitions and the partition table might defer based on manufacturer and I know that a script for every device is out of the question, but let's say I wanted to make a script for all OnePlus or all unlocked Moto devices since 2013 what would be the best method to do so and is anyone willing to help me in this project as I am rather new to coding
Click to expand...
Click to collapse
Repartitioning is the easiest part. Getting the vendor shim is the real work. You can't just copy hw libs to vendor and have it automatically work.
For repartitioning, safest to write a script for each device. Every partition table differs so a universal solution would be too prone to errors - and this is semi-hard brick territory (e.g. could require testpoint and EDL flash)

Related

[Q] Acer Iconia u-boot

Hi All,
Unfortunately as a new user I can't post this in the Dev forum. So I'll put it here for now and perhaps can move it later.
I'm wanting to tinker with uboot on the Iconia. Ideally what I'm hoping to achieve is;
A versatile and usable port of uboot to the iconia complete with documentation (both how to get/build as well as use) and binary files available for download.
1) uboot to replace the default bootloader or the existing kernel image in flash and have the uboot able to load the standard kernel image from the system partition.
2) To have uboot able to run an interactive shell, either over USB or on the local console with a USB keyboard.
3) A boot menu would be nice with control by builtin buttons.
For my build box I'm using the current Debian with GCC 4.1 available
Anyway, if any anyone can help at all please fell free to respond. It is my intention to update this thread as I go, documenting the journey and ultimately publishing the results with how to info.
Tonight I will edit this with a better outline (more verbose) of what I'm attempting to do and some info regarding what my build env is and what info I already have.
Hope to create something useful here for everyone.
Owen.
OK. I'm still checking things out... eppeP, did you get anywhere with the SBK? if not uboot will just have to replace the android kernel and maybe be patched so it can load it from the system partition instead. One guy (lost the thread) said he had to mod the patch to get it to complile, but didn't say how.
As far as a boot menu goes, I'm thinking of a script that will search the boot folder of all mountable volumes and present a menu, much like the Apple boot selector does. Still don't know if its possible though and is somewhat secondry issue anyhow.
Can anyone give info on uboot env storage. also I need to know the partition layout for the internal MMC (got a good idea already but need to be sure and whats the partition layout?)
Have you talked to sp3dev and sc3k? Ive been followng the native linux thread and i believe they are trying to do just that. They would be your best source of help i think
Thanx gh123man,
Yep, I've seen good & exiting posts from sp3dev, muromec and hexeh about this stuff. Unfortunately I can't post in the dev threads cause I'm new to xda forum.
I was kinda hoping they might spot this thread and respond
Sounds like fun, I might be interested in helping.
So far I've been looking into generating the SBK, decrypting BCT/EBT and are just about to start looking at the partition format (there seems to already be some code for this, so that should not take long to get an idea of). So I guess unless I find something more interesting, trying to pick apart the bootloader to get a better understanding of that part might come soon anyway.

Vendor.img info

I have seen allot of about vendor images in rom threads and Q&A
I figured allot of people dont even know what a vendor image is well its where the proprietary binaries sit now on their own partition called the vendor.img
they used to sit in /system but now have their own partition much like the bootloader and modems do. its use is to house the device specific files etc.
This was done for a multitude of reasons including legal/licensing issues .
heres a really good discussion on it i found very informative
https://plus.google.com/+JeanBaptisteQueru/posts/akHWypRNEn3
PS: you dont have to flash the newest vendor every time you flash a ROM :good::highfive:
on most devices you can flash it from twrp 3.0.0-1 and above by going where you normally do to flash a zip and selecting flash image and choosing vendor
Dreamlogix said:
I have seen allot of about vendor images in rom threads and Q&A
I figured allot of people dont even know what a vendor image is well its where the proprietary binaries sit now on their own partition called the vendor.img
they used to sit in /system but now have their own partition much like the bootloader and modems do. its use is to house the device specific files etc.
This was done for a multitude of reasons including legal/licensing issues .
heres a really good discussion on it i found very informative
https://plus.google.com/+JeanBaptisteQueru/posts/akHWypRNEn3
PS: you dont have to flash the newest vendor every time you flash a ROM :good::highfive:
on most devices you can flash it from twrp 3.0.0-1 and above by going where you normally do to flash a zip and selecting flash image and choosing vendor
Click to expand...
Click to collapse
I dont know why,but I cant open that link..error 404
Sent from my Nexus 9 using Tapatalk
"A step forward for the Android Open Source world
There's a hidden gem in Nexus 9, which was announced by a short sentence in the middle of a reply in a long mailing-list thread:
"No proprietary binaries are needed for Volantis. The proprietary vendor binaries are on a separate 'vendor' partition."
Until now, in Android devices, the proprietary device-specific files that live underneath Android itself were stored in the same /system partition as the Android files.
This made sense from the point of view of software architecture, but it had a major drawback in the Open Source world: in order to distribute a functional system image of Android, it was necessary to also distribute those proprietary device-specific files, since those files were aggregated into the same distribution medium.
Starting with Nexus S, those files had been somewhat available, with two caveats: not all files were available for all devices, and the files that were available were controlled by licenses that allowed the most common use cases but didn't give the same freedom that can be expected for Open Source components.
On Nexus 9, things are different: those proprietary device-specific files are stored in a separate partition. As a result, it is now practical to distribute functional versions of the Android system without having to distribute or copy those proprietary files. Therefore it becomes possible to enjoy the freedoms associated with Open Source in a broader range of situations, including (e.g.) commercial distribution.
While Android has always been distributed under Open Source licenses (i.e. in the world of lawyers), this brings it closer to the spirit of the Free Software definition in the real world (i.e. in the world of hackers).
This makes me happy, as this is the conclusion of a task that had been started 3 1/2 years ago with Galaxy Nexus, and in which I had been closely involved when I worked on AOSP. Chances are, this is probably also the last aspect of Android to get released in which I've been closely involved while at Google."
Maybe you can help me?
I tried flashing vendor.img from 5.11 after I upgraded to Marshmallow because SMS/MMS stopped working on my N9 LTE after the update. It still doesn't work on N either. Anyway, doing this restored my SMS/MMS but screwed up some other things making the tablet unreliable. Should I have wiped cache etc when I did this? Would it even help?
So I'm guessing the radio is now in vendor.img? Can I/should I extract and use that?
Last question, what are the advantages to updating the vendor.img in later updates? Does anything important get changed in it that might affect system performance (other than me SMS problem) like battery drain, or device efficiency?

Project Treble Question

I know our device is treble enabled, and an A device. I had stumbled across a tutorial here on xda before this had happened, where an xda member reallocated an unused 1.5gb partition to enable treble. If I follow this tutorial, will that allow the A/B partition and seamless updates?
godkingofcanada said:
I know our device is treble enabled, and an A device. I had stumbled across a tutorial here on xda before this had happened, where an xda member reallocated an unused 1.5gb partition to enable treble. If I follow this tutorial, will that allow the A/B partition and seamless updates?
Click to expand...
Click to collapse
Short Answer: No.
Long Answer: Treble is not the same as A/B partition layout. The tutorial that you've mentioned might (unofficially) enable Treble by reallocating some unused partition space and creating a separate /vendor partition using it, but I highly recommend you flashing the latest OxygenOS releases which officially enable Treble and create a separate /vendor partition needed for it.
A/B partition and seamless updates require each partition has two copies, so to speak, for example system_a and system_b, boot_a and boot_b, and so on. This is something that cannot be manually done using a tutorial for our device, and even though it is technically possible to repartition a phone, it is extremely risky and you risk hard-bricking your phone. Even if you are successful somehow, you will need a ROM that supports seamless updates, and there is no stock or custom ROM that has that for our device nor will there ever be a ROM like that in the future.
shadowstep said:
Short Answer: No.
Long Answer: Treble is not the same as A/B partition layout. The tutorial that you've mentioned might (unofficially) enable Treble by reallocating some unused partition space and creating a separate /vendor partition using it, but I highly recommend you flashing the latest OxygenOS releases which officially enable Treble and create a separate /vendor partition needed for it.
A/B partition and seamless updates require each partition has two copies, so to speak, for example system_a and system_b, boot_a and boot_b, and so on. This is something that cannot be manually done using a tutorial for our device, and even though it is technically possible to repartition a phone, it is extremely risky and you risk hard-bricking your phone. Even if you are successful somehow, you will need a ROM that supports seamless updates, and there is no stock or custom ROM that has that for our device nor will there ever be a ROM like that in the future.
Click to expand...
Click to collapse
What I ended up doing was grabbing the hydrogen os beta which is pie and then removing all the Chinese apps and installing a 48mb Google zip to get play store. Now I know for sure my hardware will fully work. At least until q comes out, because I will have to use treble or a custom ROM to upgrade I'm sure.

[ROM] [non-Android] postmarketOS for the HTC Desire Z

Hi there,
I have recently ported postmarketOS [1] to the HTC Desire Z. postmarketOS is a Linux distribution for mobile devices based on Alpine Linux and the primary platform for KDE's Plasma Mobile desktop.
Note that this work is nowhere near ready for productive use, at least not as a phone. It boots, the weston demo UI starts and you can ssh into it via USB or Wifi (use nmtui or nmcli to configure it), but that's pretty much it. I'm posting here in the hope that other developers might be interested in joining this effort. It might be useful as small server for personal use, perhaps to host a NextCloud instance or something like that.
For installation instructions, refer to the Installation Guide at [3] and the wiki page for the HTC Desire Z at [4]. It should be possible to run postmarketOS without installing anything at all on the phone (other than an unlocked bootloader) by installing onto a microSD card and booting via the `fastboot boot` command.
[1] https://postmarketos.org/
[3] https://wiki.postmarketos.org/wiki/Installation_guide
[4] https://wiki.postmarketos.org/wiki/HTC_Desire_Z_(htc-vision)
P. S. If you're wondering why I didn't put this in the developers' section where it belongs: It's because I'm not allowed to post there due to being a new member, and for the same reason I can't post proper links. In order to prevent spam, new users are required to spam 10 posts in order to be able to do perfectly legitimate things. How ironic :silly:
First of all, thank you for your time working this out and notifying us, I really appreciate all the people that keep my fine (but old) hardware usable.
I have 3 Desire-Z's (now running cyanogenmod), and would like to try PostMarketOS on one of them.
What is the state of the device? Can I use PostmarketOS to safely browse the web?
Do you have any specific instructions for the microSDcard installation? Is it just installing/running the pmbootstrap command on my linux machine with the correct sdcard device, insert the sdcard into my Desire Z and then starting it with volume-down button pressed, until the (in my case already unlocked) bootloeader menu appears and then running 'fastboot boot <what parameter goes here?>' from the connected linux computer?
Hi C-Base,
Thanks for your interest! I should mention again that this is pretty much a developer thing for now… But in case you want to get your hands dirty and maybe hack on the device a bit, here are my answers:
– What is the state of the device? Please refer to the wiki page, the state is documented there.
– Does it run a browser? I don't know, I've never tried, but I'd guess it wouldn't work. Even if it runs somehow, I'd guess it would probably be unusably slow because I haven't made the hardware graphics acceleration work yet
– Regarding sdcard installation: yes, you pretty much got it right! The last step would be to type "pmbootstrap flasher boot", which is essentially a wrapper for fastboot that will figure out the correct parameters for you. If that doesn't work, you can try "pmbootstrap export". That will copy a bootable image to /tmp/postmarketOS-export/boot.img-htc-vision. You should be able to boot that using "fastboot boot /tmp/postmarketOS-export/boot.img-htc-vision"
If you want to help out, there's a couple things you could do!
– document on the wiki page everything you feel would be helpful to anybody who wants to try this
– get graphics acceleration working with hybris. This is needed for Plasma mobile to run and shouldn't be too hard. You just need to make sure that the relevant hybris packages are installed (GLES, EGL, maybe others) and that the android drivers are in the right place (the relevant binaries should be in this repo: https://github.com/milaq/android_device_htc_vision).
One more thing: for all I know you'd be the first person other than myself to try this on a Desire Z, so definitely let me know if you can get it to boot! I've actually never tried the SD card installation, so it would be nice to hear if that works, and also if the on-screen keyboard (to type in the disk encryption password works).
mberndt said:
One more thing: for all I know you'd be the first person other than myself to try this on a Desire Z, so definitely let me know if you can get it to boot! I've actually never tried the SD card installation, so it would be nice to hear if that works, and also if the on-screen keyboard (to type in the disk encryption password works).
Click to expand...
Click to collapse
Hi!
I have pmOS running on my HTC Desire Z and SD card installation works just fine I haven't tested on-screen keyboard so I don't know does that work.
BTW, is there any change this gets mainlined sometime in the future?
Hey jyrithe,
I'm happy to hear that it works for you!
Regarding your question: the SoC is a Qualcomm MSM7230, and the mainline kernel doesn't currently support that. So somebody would have to port the relevant drivers etc. to a modern kernel. I think that this would require access to the serial console, and while that is documented for some Android phones (e. g. many recent Sony Xperia models), the Desire Z doesn't seem to be one of them – at least I haven't been able to find such documentation. I also haven't been able to find public documentation about the actual SoC, and I suspect one would have to figure out how the hardware works by reading the driver code. Given that this is also a rather old SoC at this point, I suspect it's not going to happen. I personally just don't have the time or the knowledge to be able to do this.
Here's a kernel tree that might be of interest though:
https://github.com/msm7x30/android_kernel_qcom_msm7x30
That one is based on Linux 4.4, so it's a much newer version than the 3.0.101 kernel that I used for the pmOS port. Based on the name it seems to support the SoC, but it doesn't include support for the specific board – one would have to write a devicetree file to make that work.
Hi I am trying to boot it up with the HTC Desire Z. I boot up nicely with the nice logo, but after that everything is black. I use "westron" in the pmbootstrap installation and I use android zip recovery way to do this, using with the cwm 6.0.5.
I hope you can help me. I love your energy into this project!!
Hi Dr.RR,
I haven't done any work on this device lately, and I don't plan to. The problem is that afaik there's really only one “useful” UI to run on postmarketOS, and it's KDE plasma mobile. But it's too large to fit on the system partition of this device, so it's impossible to install it until LVM support is in place (this allows to create a root file system that spans several flash partitions, i. e. system and userdata partitions). If you want to get your hands dirty, check this out: https://gitlab.com/postmarketOS/pmbootstrap/issues/60 . (sdcard installations aren't affected by this, but I currently don't have a spare).

is it possible to dual boot multi custom rom on mi 9t?

I googled a lot but not succeed to find a way to install several rom on my mi 9t phone, have we a way to do that?
any idea friends?
can anyone tell me is it possible or not please?
Hello m-Khadem,
the only tool I know who can do this is called DualBootPatcher.
This tool is no longer in development.
Here's why:
Due to recent changes in Android P, as well as upcoming changes in Android Q, DualBootPatcher is no longer being developed. These two releases change some fundamental assumptions that DBP makes about the host device.
With devices that ship with Android 9.0+, the system-as-root partition layout is mandatory. This means that the system partition includes everything that traditionally went in the boot image's ramdisk. DBP relies on being able to modify the ramdisk to add its binaries as well as some config files that specify the ROM ID and device specific information (eg. partitions). To switch between ROMs, DBP simply flashes the ROM's patched boot image.
With the system-as-root partition layout, most of the files could potentially live on the system partition, but the ROM ID must be stored in the boot image. With some devices, like Google Pixels, a ramdisk can be added back by including it in the boot image and patching the kernel image to ignore the skip_initramfs cmdline option. However, on other devices, like the Samsung Galaxy S10 series, the bootloader will always ignore the ramdisk section in the boot image. Storing the ROM ID in the cmdline field is also not feasible because many devices' bootloaders ignore the whole field.
With the Android Q preview builds, some devices, such as the Google Pixel 3 series, switched to using dm-linear for handling the partition layout of the read-only OS partitions (system, vendor, etc.). With this setup, a single GPT partition is split up and is mapped to device-mapper block devices by a userspace tool. With Android's /init, this is done via the liblp library, which parses the metadata on disk and configures dm-linear. DBP would have to implement something equivalent to this to be able to mount the Android partitions. It currently assumes that the kernel will provide a mountable block device after going throug the uevent device probing phase.
Neither of these changes are impossible to work around, but I have simply lost any interest in doing so. I have not used DBP on my primary devices for a couple of years now. Those interested in continuing development are free to fork the project. Any work that had been done for the 10.0.0 release has been pushed to the 10.0.0-staging branch.
All downloads have been moved to SourceForge at https://sourceforge.net/projects/dualbootpatcher/files/. I will work on splitting out some of the more useful parts of DBP, such as libmbbootimg (boot image parser) and libmbsystrace (syscall injection/modification library), so that they can be used in other projects, but DBP itself will no longer be developed.
Huge thanks to everyone who helped out with this project the past six years!
Click to expand...
Click to collapse
Source : Github
AlexCmb said:
Hello m-Khadem, the only tool I know who can do this is called DualBootPatcher. This tool is no longer in development. Here's why it's no longer possible (and why this is no longer possible at all)):
Source : Github
Click to expand...
Click to collapse
Dear Alex
Thanks for your reply, I saw this thread and unfortunately this solution will not work anymore

Categories

Resources