Building AOSP with Vendor Image - Nexus 5X Q&A, Help & Troubleshooting

Hello, I am trying to build an AOSP 6.0 ROM. I downloaded the source, built the image, flashed, with corresponding vendor image (MMB29P) and it boots. However, the BT doesn't work at all. Is there something I'm missing, I've tried different orders of flashing, different vendor images, etc. I thought the vendor image was supposed to reduce complexity, but I'm sort of stuck. Do I need to somehow "extract" the files from the vendor image and add them to the build structure, or something else? I appeal to the makers of many ROMs!

I have exact same problem. I have tried building AOSP MMB29V and MTC19T and tried booting with vendor images from corresponding factory binaries. Bluetooth just doesn't turn on if I use system.img built from AOSP. It works fine with system.img from factory binaries. This is with Nexus 5X.
If anyone has a solution or a suggestion, please reply...

_gps_ said:
I have exact same problem. I have tried building AOSP MMB29V and MTC19T and tried booting with vendor images from corresponding factory binaries. Bluetooth just doesn't turn on if I use system.img built from AOSP. It works fine with system.img from factory binaries. This is with Nexus 5X.
If anyone has a solution or a suggestion, please reply...
Click to expand...
Click to collapse
You need to add the proprietary vendor files to /system as well, just like on older Nexuses. I know Google claimed all non-free files are in /vendor, but that is actually not true at all.

jisoo said:
You need to add the proprietary vendor files to /system as well, just like on older Nexuses. I know Google claimed all non-free files are in /vendor, but that is actually not true at all.
Click to expand...
Click to collapse
Thanks for reply Jisoo
Can you please guide me which files to copy to AOSP build tree? Did you mean I need to copy files to /vendor during build, or to /system?
If you meant /vendor, till Lollipop, vendor images *nexus binaries* were copied to <aosp-root>/vendor. But there are no nexus binaries for Nexus 5X, that could be copied to /vendor (at least not on https://developers.google.com/android/nexus/drivers). Should I extract from vendor.img?
Or if you meant /system, please guide which files. any pointers would be helpful. I dont think this is mentioned on any aosp official sites.

_gps_ said:
Thanks for reply Jisoo
Can you please guide me which files to copy to AOSP build tree? Did you mean I need to copy files to /vendor during build, or to /system?
If you meant /vendor, till Lollipop, vendor images *nexus binaries* were copied to <aosp-root>/vendor. But there are no nexus binaries for Nexus 5X, that could be copied to /vendor (at least not on https://developers.google.com/android/nexus/drivers). Should I extract from vendor.img?
Or if you meant /system, please guide which files. any pointers would be helpful. I dont think this is mentioned on any aosp official sites.
Click to expand...
Click to collapse
So there's 2 locations for non-free files in the new Nexus devices.
1. /vendor partition, which you would typically update with the vendor.img images direct from Google
2. non-free files in the /system partition, very similar to what you had in the older Nexus devices (and what are used in all non-Nexus CM-devices, for instance)
You can get these files from a few repos on github, like TheMuppets or PureNexus. If you prefer to extract the files themselves from a factory image, it's still useful to check what should be included by looking at the makefiles in these repos.
You'll also need to add the non-free files to your device tree somehow. The easy way (by pulling the whole non-free repo and including the makefiles from there) would mean including the following line in your device tree makefile (using bullhead as an example):
Code:
+$(call inherit-product-if-exists, vendor/lge/bullhead/device-vendor.mk)

Hello,
Does anyonw understand how we should extract the driver files from this link:
https://developers.google.com/android/nexus/drivers
I see 2 links for each devices:
1. "google's vendor"
2. list of devices (camera, gps...)
Do we need to run the *.sh file for both ? Does the *.sh file will download all the required driver files ?
What are actually these driver files ? Is it the HAL .so files ?
Thank you,
Ranchu

Related

[How to] Rom cooking

Original post:
Hello,
I am new to android but not to linux. I used to tweak my winmo phone rom.
I have backed up my device with nandroid. I just need some explanations:
- why isn't the radio extracted?
- how can I "extract" does .img files to modify and then rebuild them?
I found some informations of what the .img files contain here: ROM Partitions it should be the same for Hero
I have found some informations on how to push updates to the rom by looking at modaco updates. It seems quite simple to delete/copy files on the hero rom using an update-sript file. I am however curious about the RSA cert and if some files need to be signed.
Any information welcomed.
Regards
Click to expand...
Click to collapse
How to
Extract NAND image files
To extract .img files, I have found unyaffs from http://code.google.com/p/unyaffs/ I have compiled it under ubuntu 64 (attached). Unyaffs works on system.img but on no other .img file
To extract boot.img use attached extract-kernel.pl and extract-ramdisk.pl
# extract-kernel.pl boot.img
# extract-ramdisk.pl boot.img
Should work for recovery.img but haven't tried as custom recovery images on the forum are great.
Rebuild system.img
Seems you just need "to loopback mount an image on your linux box and format it with YAFFS".
But it is useless as because Hero's SPL does not allow flashing system.img directly. You should use an update.zip package for that. (read below)
Rebuild boot.img
After extracting your boot.img using attached extract-*.pl and tweaking it, in same folder run:
# mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
# mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Creating an update.zip package
Creating an update.zip package is quite easy in fact. For example, to add a (valid) test.apk package to your rom:
- create an empty folder <workdir>
- create folder structure for test.apk (<workdir>/system/app) and copy the test.apk
- create folder structure for update-script (<workdir>/META-INF/com/google/android)
- edit <workdir>/META-INF/com/google/android/update-script
- put in it:
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
show_progress 0.1 10
- compress the <workdir> content to zip (not the <workdir> folder itself)
Now you are going to sign the zip file. Download attached testsign.zip and copy it in your <SDK>/tools folder. Extract it here. It should create a sign subfolder with a testsign.jar file in it.
Then, from <workdir> folder, do:
java -classpath <SDK>/tools/sign/testsign.jar" testsign file.zip file-signed.zip
Ok, now your zip file is ready to be deployed using cyanogen recovery image.
To find more command to use in update-script, look at other's.
Modify .apk package
Seems it is easy to uncompress an .apk package (zip) an to modify files in it and then compress it. But after all: you must sign it like update.zip packages.
ODEX files
- What are those Odex files? Answer.
- How to get rid of them?
Odex files depend on framework they are made for. To deodex an odex file use that how to
Then you may create a classes.dex file by executing the smali program on the "out" folder. You then rename it to classes.dex and add it to the .apk.
- How to create them?
Use dexopt-wrapper on device.
Porting an other device's rom
Well, that part is easy
- extract the system.img
- extract boot.img
- replace boot.img-kernel with the one from your stock Hero rom one.
- rebuild boot.img
- build update.zip package (look someone's hero custom rom to see how to do it)
- sign and flash
It should run place and make calls but probably won't have Wifi, BT, trackball support. If you make those work: tell me, but I think we should wait to be able to compile a 2.6.29 kernel to have those.
Tools
Androsign script (linux)
I wrote that androsign script to quick sign zip files. Just put it in your <SDK>/tools folder, then chmod +x. If you have put the tools folder in your PATH, you can call it directly like this:
androsign /dev/folder1/folder2/update.zip (or any zip/apk file)
It will output an update-signed.zip (or app-signed.apk etc) in the same folder than original file was in.
Notes
Note1: thanks
Thanks to every guy that helped me found all that.
Note1: sharing
I searched for hours, so I am more than happy to share it to save someone's time. I am just disappointed than some people here do not have that spirit: I could have use those hours for development instead of research...
Note3: corrections
So, if you found anything incorrect, would like to supply more informations or want to correct my bad english: just PM me.
To find
- how to dump radio from device
- how to build a custom hero kernel (waiting for HTC sources)
To come
How to prepare your own kitchen and useful scripts (linux)
gecka said:
I am new to android but not to linux.
Click to expand...
Click to collapse
Same here. I do lots of tweeking on my linux machine, so i know quite a lot of linux. If there would be anyone to answer those questions by gecka, I might start tweeking the rom (maybe someday cook one up)
Best regards
Hello,
First post edited, but still some ignorances... Please share if you know anything.
Best regards
unpack and pack boot.img and recovery.img
First you need utilities such as mkbootfs and mkbootimg. maybe you can find them online (i can upload them later compiled for linux x86-64) but i suggest you download android source (http://source.android.com) and do a generic make. In this way you have these and other utilities(tools to pack system.img too, but if you haven't an engineering bootloader you can't flash it directly) in /out/host/... (it's better if you add this in your PATH)
To unpack and pack boot and recovery, read here:
http://forum.xda-developers.com/showthread.php?t=443994
or here:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
...or...
(I have attached extract-kernel and extract-ramdisk scripts from JF build environment) :
to unpack (boot.img or recovery.img, i'm writing the commands with boot.img):
Code:
extract-kernel boot.img
extract-ramdisk boot.img
at this point you have
boot.img-kernel
boot.img-ramdisk
to repack (boot.img or recovery.img):
For hero you need to specify the base address because it's different (0x19200000). For more information: http://forum.xda-developers.com/showthread.php?t=541522.
Code:
mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Useful resources for android modding are the dream forums (most of the concepts/hacks works for hero too):
http://forum.xda-developers.com/forumdisplay.php?f=448
(informative thread here: http://forum.xda-developers.com/showthread.php?t=519523)
note: mkbootimg with --base support is in donut and master (or find the patch on gerrit and apply it to cupcake)
First of all, the reason you cant unyaffs anything other than system.img is because they aren't YAFFS images. boot/recovery is kernel+initrd like in any normal linux bootimage scenario (see more below).
Tofind
- how to dump radio from device
Click to expand...
Click to collapse
Haven't gotten into that myself yet, but I know modaco posted an update.zip with radio image included on this very forum. Look for it.
- how to extract NAND images other than system.img
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=443994
- rebuild NAND images such as system.img
Click to expand...
Click to collapse
This isn't hard, just loopback mount an image on your linux box and format it with YAFFS.
Building a custom kernel and recovery binary
HTC hasn't yet released the changes they have made to the hero/dream/magic kernels, 32A board, so you can't just compile a kernel from the AOSP. I haven't tried it yet but this patch might work on hero too:
http://forum.xda-developers.com/showthread.php?t=548061
EDIT: HTC Sources for dream and magic at http://developer.htc.com
For building a custom recovery, it's better if you use cyanogen's recovery code, found in his git : github.com/cyanogen, because it already has menus for nandroid and other tools, but you can use the recovery code from AOSP too (cyanogen's one is a patched version with a lot more features, http://forum.xda-developers.com/showthread.php?t=523558). To make a custom recovery you need to change the recovery binary (because the press event of the hero trackball has a different keycode, 191), the kernel and the init scripts. Actually i don't remember what else I've changed to make cm's recovery working with hero (the recovery that we are actually using here), I'm at work now, but i'll check later and post more details, or you can just unpack the recovery and see the changes .
First post updated.
Nandroid only backs up the partitions in the main storage nand, but radio and spl are flashed to the radio's own nand flash. Whether it's possible to dump it or not I don't know, but honestly, I don't see why you'd want to. Radio images are available through RUU's and I don't think editing would be an easy task
jubeh said:
Nandroid only backs up the partitions in the main storage nand, but radio and spl are flashed to the radio's own nand flash. Whether it's possible to dump it or not I don't know, but honestly, I don't see why you'd want to. Radio images are available through RUU's and I don't think editing would be an easy task
Click to expand...
Click to collapse
Sometimes, new radio images appear on new phones. That is why I am looking on a way to extract it.
very useful thread.
Very nice tutorial, thank you!
could you please specify a bit more on how to clone from android's git and then build the mkbootimg and mkbootfs (just make, right)? I tried and I keep getting a "fatal:server dumped connection" error
Are we able to modify an official ROM (also for hero). Which shows up in RUU as INFOsignature checking... failed. Am I able to change the kernel and make it work?
jubeh said:
could you please specify a bit more on how to clone from android's git and then build the mkbootimg and mkbootfs (just make, right)? I tried and I keep getting a "fatal:server dumped connection" error
Click to expand...
Click to collapse
What command do you use?
In fact i won't be able to explain you better than that page: http://source.android.com/download
Following that how to, you'll be able to sync an android branch You can learn more about git, branches and more here (Repo and Git resources)
The sync is long (2.9Go). Then, to build mkbootimg and mkbootfs, you should do a generic build of android going to source folder and issuing the 'make' command.
All that will be part of my upcoming "How to prepare your own kitchen and useful scripts".
awsy44 said:
Are we able to modify an official ROM (also for hero). Which shows up in RUU as INFOsignature checking... failed. Am I able to change the kernel and make it work?
Click to expand...
Click to collapse
Well, to grep the system from a windows RUU exe file you should launch it and then look in your user temporary folder for a rom.zip file in a {uid} subfolder. It contains the system and boot img files.
You then need to make an update.zip package from them. Have a look to someone's hero custom rom and to it's update-script to see how it is achieved. My 'How to' gives you all you need to understand update.zip packages and to extract system.img.
If you are porting a Hero rom, no need to change the kernel.
Regards
Well, to grep the system from a windows RUU exe file you should launch it and then look in your user temporary folder for a rom.zip file in a {uid} subfolder. It contains the system and boot img files.
You then need to make an update.zip package from them. Have a look to someone's hero custom rom and to it's update-script to see how it is achieved. My 'How to' gives you all you need to understand update.zip packages and to extract system.img.
If you are porting a Hero rom, no need to change the kernel.
Regards
Click to expand...
Click to collapse
Thanks so much for this amazing information, however how do i stop getting hit with the infosignature failed error? is that the kernel or the hboot? it says 12 signature verify error.
Oh, I do have the source and I am running my own donut build on my dream with some of my spice, but the problem I was having was cloning that exact project (mkbootimg) from android.git.kernel.org using git, but when I read what you said, I remembered that when you make the build, it also compiles several tools and i overlooked checking the out folder for it, kind of dumb on my part since I had already pulled the fastboot tool from that build and added it to my own bin, i guess mkbootimg and mkbootfs should be there too, right?
i tried running androsign and got this error
Code:
[email protected]:~/android/dev/sdk/tools$ ./androsign META-INF.zip
Exception in thread "main" java.lang.NoClassDefFoundError: testsign
Failed!
[email protected]:~/android/dev/sdk/tools$
if i use a ROM of one device on an other different device, I think I must build a kernel on my own, is that correct?
but what config should I use? a config from my current running ROM? then I think I must make it suitable for new ROM, what options should I care about?
for example, if I want to run a AOSP 2.01 ROM ( system.img) on a Magic 32A device with SPL 1.76, and now I am running a SenseUI ROM which kernel is 2.6.27, I think I should build a 2.6.29 kernel from the git tree, and ensure it will work with camera/bt/wifi/trackball of my device properly first .
how can I make this step successful?
other hand, the dynamic lib files(.so) with the system.img can be incorrect. so, I may need to build them too for pairing with the kernel I built in previous step. I think applications will work properly because they only care about if the interfaces of kernel and lib is correct. for that, also there some config job (like build.prop, etc) to do, is there a list of all of these jobs? and what values can I refer to? the original ROM (Magic 32A SPL 1.76 working ROM here) ?
am I right? what should i do and what are in those steps? are there some doucments I can read from?
Thanks for the good summary. Just one question, where did testsign.jar come from? I'd like to get the source. Thanks!
JackZero said:
Thanks for the good summary. Just one question, where did testsign.jar come from? I'd like to get the source. Thanks!
Click to expand...
Click to collapse
Read this !
http://www.androiddevelopment.org/tag/apk/
;-)

[SOLVED] Missing proprietary blobs on m7

I'm currently running a home build of the 13.0 branch on my HTC One m7, and I'm now trying to build 14.1 for it. When extracting the proprietary blobs, extract-files.sh reports that it can't find the following files:
Code:
/system/etc/firmware/widevine.b00
/system/etc/firmware/widevine.b01
/system/etc/firmware/widevine.b02
/system/etc/firmware/widevine.b03
/system/etc/firmware/widevine.mdt
/system/vendor/lib/libuiblur.so
A quick ls /system/etc/firmware as root from the terminal on my phone reveals that, indeed, there are no files named "widevine.*" in that directory. I also do not have libuiblur.so.
If I stubbornly continue with brunch anyway, the build fails immediately because those files are missing. I figure there must be some way to obtain those files without flashing an existing 14.1 build, and indeed it looks like extract-files.sh is capable of grabbing them from an expanded ROM, so I downloaded and unpacked the latest official nightly. I figure system.new.dat is the system image, but I'm unable to mount it; dmesg reports
Code:
EXT4-fs (loop0): bad geometry: block count 475135 exceeds size of device (168078 blocks)
So basically, I'm still more or less at a loss on how to get those proprietary blobs, bar the overkill solution of flashing an existing build. Any help would be greatly appreciated!
Thanks in advance.
EDIT: after some more digging, I discovered that the system image is not something you can just mount right away; instead you can use sdat2img to convert it into a proper disk image that can be mounted. extract-files.sh can then grab the files from the mount point (note that you have to name the mount point 'system' and pass its parent directory to the script).
I wonder what you end up doing to fix it and if you ended using CM13 blobs for 14.1? Your answer will be appreciated to test some things in order to restart official support.

Bootloop after flashing AOSP 8.0.0 to Pixel XL.

Hello everyone. I have a problem.
I'm building AOSP 8.0.0_r11 for Pixel XL and when I flash the result zip I'm getting a bootloop.
How am I building?
1) Select java 1.8
2) cd AOSP_8.0
3) source build/ensetup.sh
4) lunch aosp_marlin-userdebug
5) make -j9 updatepackage
6) wait a couple of hours
7) PROFIT
I know the ROM needs vendor blobs, I have them downloaded, extracted and extracted from .sh files.
How does the bootloop look?
Power On->Message about unlocked bootloader->0.5 second of white screen with Android on it-> reboot->repeat.
How do I flash the ROM?
I tried:
1) fastboot update -w aosp_marlin-img-eng.user.zip
and
2) extracted everything from zip and fastboot flash --slot _a PARTITION IMG_FILE
What am I doing wrong? Did anyone have success in building AOSP for this phone?
Did you "make clobber" after installing the drivers? If not, run it then try your make command again.
Alternatively, try "make otapackage" instead of "updatepackage" and then flash it in fastboot.
Also, why are you using the -j9 parameter?
noidea24 said:
Did you "make clobber" after installing the drivers? If not, run it then try your make command again.
Alternatively, try "make otapackage" instead of "updatepackage" and then flash it in fastboot.
Also, why are you using the -j9 parameter?
Click to expand...
Click to collapse
I did "make clobber". It just removes the build directory like "make clean". And this step is redundant if you never built the system before (with or without binaries).
Why make -j9? Because it shows better performance than just make. I know the build system should get the cores number and set the number of build threads, but for some reasons it doesn't do it very well.
P.S. I tried to "make" without -j9 and it is MUCH slower than with -j9.
Are you using the most updated fastboot and adb and sure your computer's variables aren't using an older one also? That was my issue when flashing Oreo.
buru898 said:
Are you using the most updated fastboot and adb and sure your computer's variables aren't using an older one also? That was my issue when flashing Oreo.
Click to expand...
Click to collapse
I'm using those that come with Android Studio 2.3.3 updated to latest versions of all components. That's not the problem with slots support - everything flashes without errors.
Slavon-93 said:
Hello everyone. I have a problem.
I'm building AOSP 8.0.0_r11 for Pixel XL and when I flash the result zip I'm getting a bootloop.
How am I building?
1) Select java 1.8
2) cd AOSP_8.0
3) source build/ensetup.sh
4) lunch aosp_marlin-userdebug
5) make -j9 updatepackage
6) wait a couple of hours
7) PROFIT
I know the ROM needs vendor blobs, I have them downloaded, extracted and extracted from .sh files.
How does the bootloop look?
Power On->Message about unlocked bootloader->0.5 second of white screen with Android on it-> reboot->repeat.
How do I flash the ROM?
I tried:
1) fastboot update -w aosp_marlin-img-eng.user.zip
and
2) extracted everything from zip and fastboot flash --slot _a PARTITION IMG_FILE
What am I doing wrong? Did anyone have success in building AOSP for this phone?
Click to expand...
Click to collapse
More than those blobs are necessary. Look at a invisibleks marlin lineageos device tree to get an idea of what files need to extracted and put in vendor.
Make clobber also cleans out configuration files, in case some of them had been created before the drivers/binaries have been extracted. Speaking of binaries again, did you install the Qualcomm ones?
My build environment is a i7 3770, with 8gb ram, and two blues in raid 0. To get my build compiled correctly, I had to disable ninja and I used -j8.
******
Tomorrow, I'll run a update and build Oreo on my machine from a clean directory and I'll get back with times before end after ccache is filled.
npjohnson said:
More than those blobs are necessary. Look at a invisibleks marlin lineageos device tree to get an idea of what files need to extracted and put in vendor.
Click to expand...
Click to collapse
Well, I don't know about Pixel, but when I had some experience in building AOSP for Nexus 5, Nexus 6, Nexus 9, binaries from Google and Qualcomm were a required minimum to get system booted. And if I wanted to get rid of some errors in logcat, I had to add some additional libraries, but the system booted and worked.
noidea24 said:
Speaking of binaries again, did you install the Qualcomm ones?
Click to expand...
Click to collapse
Yes, of course. I went to google binaries section, selected marlin 8.0.0 and downloaded two .sh files - one from Google, and the other from Qualcomm. Then I extracted them and got a vendor forder which has google_devices/marlin and qcom/marlin folders inside.
I'm curious to know how your process to flash the rom zip works? I've been sitting on a rom build for days because I can't get Twrp to work properly. Also, if your worried about your blobs/vendors the repos are starting to show up on GitHub.
cjkacz said:
I'm curious to know how your process to flash the rom zip works? I've been sitting on a rom build for days because I can't get Twrp to work properly. Also, if your worried about your blobs/vendors the repos are starting to show up on GitHub.
Click to expand...
Click to collapse
I'm sorry if I misundestood the question. I don't undestand why you should need TWRP because you just get the sources, get the blobs, compile them and get a zip file which can be flashed with fastboot command. So, no TWRP in this process is needed. I still don't know how all these ROM creators make zips for flashing with TWRP...
So I was able to get AOSP booting using the basic steps and blobs provided from the script. Even was able to activate the always on display
Zavon said:
So I was able to get AOSP booting using the basic steps and blobs provided from the script. Even was able to activate the always on display
Click to expand...
Click to collapse
Can you, please, describe in details these things:
1) What Linux did you use for building?
2) What revision of AOSP 8.0.0 did you download?
3) What version of blobs did you use?
4) Did you just download the 2 blobs .sh files to the root of the sources and execute them?
5) What AOSP configuration did you choose for building? (I mean aosp_marlin-userdebug or aosp_marlin_svelte-userdebug or aosp-sailfish-userdebug)
6) What command did you use for building?
7) Did you use ccache?
8) Did you flash Google Factory image of Oreo before flashing AOSP?
9) What command did you use to flash?
Slavon-93 said:
Can you, please, describe in details these things:
1) What Linux did you use for building?
2) What revision of AOSP 8.0.0 did you download?
3) What version of blobs did you use?
4) Did you just download the 2 blobs .sh files to the root of the sources and execute them?
5) What AOSP configuration did you choose for building? (I mean aosp_marlin-userdebug or aosp_marlin_svelte-userdebug or aosp-sailfish-userdebug)
6) What command did you use for building?
7) Did you use ccache?
8) Did you flash Google Factory image of Oreo before flashing AOSP?
9) What command did you use to flash?
Click to expand...
Click to collapse
I'm using a base ubuntu vm I built with 2 cores and 8gb ram. I used r11 if memory serves correct. I used the scripts from google and extracted from the factory image. The configuration I used is 21 (marlin-userdebug). I just used make -j8. Could careless about an update zip. And the factory image was on before I flashed using fastboot.
Side note, I also have ElementalX and SuperSU installed. suhide was giving me issues and I just have to figure out the Gapps (I'm a cop so time is hard to come by). I also enabled always on display but just remembered to enable the burnin protection

How to unpack, mod, and repack the Samsung firmware?

I have tried to look up what it takes to unpack a T800_whatever.tar.md5, mod it, and then put it back together, and frankly I think none of the guides I have seen work. They're too outdated, and Samsung changed something. The whatever.tar.md5 file is no longer a tar archive with md5 sum attached to it, but it is now a tar archive, with some metadata, and md5 checksum attached.
The next issue is how to convert a sparse system.img back into non-sparse one after it was modified. One tool simg2img, which many recommend, doesn't seem to work, and another tool called make_ext4fs seems to be impossible to build from source because nobody has provided the damn instructions on how to build it. The typical open source Linux/Unix software in 99% of cases comes with makefiles and configurations scripts and (don't laugh) README files which make building software easy. But google's sources seems to have none of that. Some web sites suggest a specific gcc command to build it, but of course it won't work on _my_ specific Linux laptop (CentOS). I can't believe this stuff has to be so hard. This is just sloppy packaging and software distribution on google's part.
Akopps said:
I have tried to look up what it takes to unpack a T800_whatever.tar.md5, mod it, and then put it back together, and frankly I think none of the guides I have seen work. They're too outdated, and Samsung changed something. The whatever.tar.md5 file is no longer a tar archive with md5 sum attached to it, but it is now a tar archive, with some metadata, and md5 checksum attached.
The next issue is how to convert a sparse system.img back into non-sparse one after it was modified. One tool simg2img, which many recommend, doesn't seem to work, and another tool called make_ext4fs seems to be impossible to build from source because nobody has provided the damn instructions on how to build it. The typical open source Linux/Unix software in 99% of cases comes with makefiles and configurations scripts and (don't laugh) README files which make building software easy. But google's sources seems to have none of that. Some web sites suggest a specific gcc command to build it, but of course it won't work on _my_ specific Linux laptop (CentOS). I can't believe this stuff has to be so hard. This is just sloppy packaging and software distribution on google's part.
Click to expand...
Click to collapse
Simg2img works fine for me as does make_ext4fs.
I use these 2 binaries all the time and can unpack and repack system images no problem.
Either you're using the wrong versions or your syntax is wrong.
There's also a toolkit available somewhere that you can compile on Linux which will build all the necessary binaries.
However at the moment the name escapes me.
EDIT : here we go.
https://forum.xda-developers.com/showthread.php?t=2600364
linux meanwhile have a package for simg2img
Code:
sudo apt-get install android-tools-fsutils
sudo yum install android-tools
Here a complete guide. Tested on product.img.lz4 inside CSC tar.
samsung android 10 pack repack img.lz4
Procedure to modify a product.img.lz4 used by Samsung Android phones with Android 10
Procedure to modify a product.img.lz4 used by Samsung Android phones with Android 10 - samsung-android-pack-repack.sh
gist.github.com
make_ext4fs does not work on newer android versions. You must use latest img2simg to convert a raw img to sparse image (it works on android 10)
Akopps said:
I have tried to look up what it takes to unpack a T800_whatever.tar.md5, mod it, and then put it back together, and frankly I think none of the guides I have seen work. They're too outdated, and Samsung changed something. The whatever.tar.md5 file is no longer a tar archive with md5 sum attached to it, but it is now a tar archive, with some metadata, and md5 checksum attached.
The next issue is how to convert a sparse system.img back into non-sparse one after it was modified. One tool simg2img, which many recommend, doesn't seem to work, and another tool called make_ext4fs seems to be impossible to build from source because nobody has provided the damn instructions on how to build it. The typical open source Linux/Unix software in 99% of cases comes with makefiles and configurations scripts and (don't laugh) README files which make building software easy. But google's sources seems to have none of that. Some web sites suggest a specific gcc command to build it, but of course it won't work on _my_ specific Linux laptop (CentOS). I can't believe this stuff has to be so hard. This is just sloppy packaging and software distribution on google's part.
Click to expand...
Click to collapse
renzofilini said:
Here a complete guide. Tested on product.img.lz4 inside CSC tar.
samsung android 10 pack repack img.lz4
Procedure to modify a product.img.lz4 used by Samsung Android phones with Android 10
Procedure to modify a product.img.lz4 used by Samsung Android phones with Android 10 - samsung-android-pack-repack.sh
gist.github.com
Click to expand...
Click to collapse
Hi. Do I get it right that this won't affect the bootloader, thus the Knox bit?

How to build a vendor image?

I'm trying to create a working vendor.img, however so far unsuccessful.
It does create a flashable ROM just fine, however I'm stuck at the Samsung (init) bootscreen/logo (last_kmesg).
Is it possible? How do I need which files to extract? I'm now searching for reference from other sources.
Thanks!
were you able to progress in this?
poppopret_ said:
were you able to progress in this?
Click to expand...
Click to collapse
Yes, I was able to boot, everything worked except the camera and SELinux.
Unfortunately, I don't have a S9 anymore. However you may want to use the linked Github as reference.
francoism90 said:
Yes, I was able to boot, everything worked except the camera and SELinux.
Unfortunately, I don't have a S9 anymore. However you may want to use the linked Github as reference.
Click to expand...
Click to collapse
I'm working with pixel 4a. I had made changes to device.mk to remove some files from being copied to vendor under
PRODUCT_COPY_FILES but vendor.img provided by google gets copied as a whole ignoring these changes. Do you have any idea on how to edit/override or build vendor.img?
I also tried to use proprietary files provided here in vendor folder and included the mk file in aosp-sunfish.mk but every other images get built except vendor.img.
You need to set the following:
Code:
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_COPY_OUT_VENDOR := vendor
BOARD_VENDORIMAGE_PARTITION_SIZE := 679...
Otherwise, it will copy the files to /system/vendor (if I'm not mistaken).
I was able to generate vendor.img successfully, but after I flashed the images, phone gets stuck in google logo. How can this be debugged? Is there a way to retrieve logs?
I tried accessing it through adb but the device is not recognised by adb at this point.
@poppopret_ Are you using TWRP or LineageOS recovery? When booting back to your recovery, they can be used to get the last_kmesg log, which should hopefully provide you with debugging.
francoism90 said:
Yes, I was able to boot, everything worked except the camera and SELinux.
Unfortunately, I don't have a S9 anymore. However you may want to use the linked Github as reference.
Click to expand...
Click to collapse
sir can u please tell me the steps to create vendor.img
francoism90 said:
You need to set the following:
Code:
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_COPY_OUT_VENDOR := vendor
BOARD_VENDORIMAGE_PARTITION_SIZE := 679...
Otherwise, it will copy the files to /system/vendor (if I'm not mistaken).
Click to expand...
Click to collapse
where i write this

Categories

Resources