Extract vendor files from device or system.img

I want build e for an unsupported device (oxygen). Now I need the vendor blobs and I have tried the LOS wiki https://wiki.lineageos.org/extracting_blobs_from_zips.html
but the mount of the extracted/created system.img doesn’t work on Ubuntu 18.04.

How can I extract the vdore file from my oxygen device ?

Hey,
Which error did you get ?
Did you tried from your phone (which version, Nougat? Oreo? Pie?)
from a LOS image ?
from a custom ?

If it comes from Ubuntu, did you tried from another Linux (Why not through a docker container)

Hi Superman,
I get this error on my Ubuntu VM:
mount: /home/ich/android/system_dump/system: Wrong file system type, invalid options, /dev/loop16 superblock corrupted, missing encoding page or other error.

I have used as it is described here with the LOS16.zip (pie) I have downloaded:
https://wiki.lineageos.org/extracting_blobs_from_zips.html
The way extracting from device from this wiki isn’t working, because no extract-files.sh is available.

I haven’t tried on other Linux and I wan’t use docker, because it’s big shit.
With docker i have no control. I can’t stop everytime repo sync, I don’t see in terminal what happens and, and and.
I have build via docker for 2 supported devices, but now I want build for a non supported device and I want see step by step what happens.

Not sure if this is what you are checking for but I can see a extract_files.sh in the /Android/vi-oreo/device/tissot/tissot$ location.


This is a folder I had created for vi-oreo source code.
If you check under device there should be a folder for your device. If not you need to create the folder. You should get the your device specific folders from Github. There will be 3 folders in the source which will need to be updated.
Device
Kernel
Vendor
Easiest way to get these folder is to get it from the device maintainers’s XDA page. The page where he/she has published the device ROM unofficial or official should have the device tree details. For e.g. for tissot the official build is here. Go the part mentioned as source code and he has given his github link.
There go back to his root folder. Here you will see the all the device tree for tissot :

Device

https://github.com/TheScarastic/android_device_xiaomi_tissot
https://github.com/TheScarastic/android_device_xiaomi_msm8953-common

Kernel
https://github.com/TheScarastic/android_kernel_xiaomi_msm8953

Vendor
https://github.com/TheScarastic/proprietary_vendor_xiaomi

git clone these to your PC and you have the device tree. Check the branch while downloading…CM-14.1, Lineage-15.1, Lineage-16 etc

Coming back to the extract-files.sh file inside your device folder. To get it to work on your phone with adb enabled browse to this device folder which has extract-files.sh and run the command
./extract-files.sh
and it should get a large number of files on to your system.
https://wiki.lineageos.org/devices/tissot/build#extract-proprietary-blobs

I assume you assured that the file is not corrupted? Via checksums?
Have you tried specifying the correct file system explicitly via -t option?

If you don’t know what file system is used inside the image, have you tried “-t auto” maybe?

@Manoj: I try to build for Xiaomi oxygen. I haven’t found any vendor files. Yesterday I have gotten a link to a git with vendor files, but in the moment I stop on the breakfast command. It always look in lineage gut for needed files but there is none. I have to check the manifest.xml how I can solve it.

@thilo : I have extact done what it’s in linenage wiki described. the -t option I haven’t tried.

That’s the way I have tried, but I can’t mount the new created system.img.

now I have added the device tree and vendor files for xiaomi oxygen from here https://github.com/MacTavishAO/proprietary_vendor_xiaomi-oxygen
https://github.com/MacTavishAO/android_device_xiaomi_oxygen

but when try ‘breakfast oxygen’ I get this error:
build/make/core/envsetup.mk:264: error: TARGET_ARCH not defined by board config: device/xiaomi/oxygen/BoardConfig.mk.
12:31:20 dumpvars failed with: exit status 1
Device oxygen not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Repository for oxygen not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
build/make/core/envsetup.mk:264: error: TARGET_ARCH not defined by board config: device/xiaomi/oxygen/BoardConfig.mk.
12:31:27 dumpvars failed with: exit status 1
build/make/core/envsetup.mk:264: error: TARGET_ARCH not defined by board config: device/xiaomi/oxygen/BoardConfig.mk.
12:31:32 dumpvars failed with: exit status 1

** Don’t have a product spec for: ‘lineage_oxygen’
** Do you have the right repo manifest?

build/make/core/envsetup.mk:264 shows this:
TARGET_OS := linux

TARGET_ARCH should be set by BoardConfig.mk and will be checked later

ifneq ($(filter %64,$(TARGET_ARCH)),)
TARGET_IS_64_BIT := true
endif

I have just edit the BoardConfig.mk

Architecture

TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := generic

and breakfast is working
and build is running. Let’s see what build log will show :slight_smile:

Are you building for Lineage 16.0?

Yes, at first I will try build plain LOS16 and when that will work, I will go further with building e

1 Like

now I’m totally confused. After changing something here and something there I get this error:
[100% 1/1] build bacon
FAILED: bacon
Why bacon ??? I’m building oxygen and not bacon ?!?!?!!?