diff --git a/_includes/templates/device_build.md b/_includes/templates/device_build.md index eeff4ecaf..6d4533ce7 100644 --- a/_includes/templates/device_build.md +++ b/_includes/templates/device_build.md @@ -71,12 +71,18 @@ This step requires to have a device already running the latest LineageOS, based {% include alerts/note.html content=extracting_blobs_from_zips %} Now ensure your {{ device.vendor }} {{ device.name }} is connected to your computer via the USB cable, with ADB and root enabled, and that you are in the -`~/android/lineage/device/{{ device.vendor_short }}/{{ device.codename }}` folder. Then run the `extract-files.sh` script: +`~/android/lineage/device/{{ device.vendor_short }}/{{ device.codename }}` folder. Then run either the `extract-files.sh` or `extract-files.py` script: ``` ./extract-files.sh ``` +Or, for the Python script: + +``` +./extract-files.py +``` + The blobs should be pulled into the `~/android/lineage/vendor/{{ device.vendor_short }}` folder. If you see "command not found" errors, `adb` may need to be placed in `~/bin`. diff --git a/pages/extracting_blobs_from_zips.md b/pages/extracting_blobs_from_zips.md index c01a36263..260348ab3 100644 --- a/pages/extracting_blobs_from_zips.md +++ b/pages/extracting_blobs_from_zips.md @@ -118,13 +118,18 @@ lpunpack super.img /output/dir You must also now mount any other image files that you have in their respective directories as shown above with `vendor.img`. -After you have mounted the image(s), move to the root directory of the sources of your device and run `extract-files.sh` as follows: +After you have mounted the image(s), move to the root directory of the sources of your device and run `extract-files.sh` or `extract-files.py` as follows: ``` ./extract-files.sh ~/android/system_dump/ ``` -This will tell `extract-files.sh` to get the files from the mounted system dump rather than from a connected device. +Or, for the Python script: +``` +./extract-files.py ~/android/system_dump/ +``` + +This will tell the extract-files script to get the files from the mounted system dump rather than from a connected device. Once you've extracted all the proprietary files, unmount the vendor dump if you mounted it earlier: @@ -160,12 +165,18 @@ unzip path/to/lineage-*.zip system/* ``` where `path/to/` is the path to the installable zip. -After you have extracted the `system` folder, move to the root directory of the sources of your device and run `extract-files.sh` as follows: +After you have extracted the `system` folder, move to the root directory of the sources of your device and run `extract-files.sh` or `extract-files.py` as follows: ``` ./extract-files.sh ~/android/system_dump/ ``` -This will tell `extract-files.sh` to get the files from the extracted system dump rather than from a connected device. + +Or, for the Python script: +``` +./extract-files.py ~/android/system_dump/ +``` + +This will tell the extract-files script to get the files from the extracted system dump rather than from a connected device. Once you've extracted all the proprietary files, you can delete the files that were extracted from the zip: @@ -221,13 +232,18 @@ sudo mount -o ro product.img system/product/ sudo mount -o ro system_ext.img system/system_ext/ ``` -Move to the root directory of the sources of your device and run `extract-files.sh` as follows: +Move to the root directory of the sources of your device and run `extract-files.sh` or `extract-files.py` as follows: ``` ./extract-files.sh ~/android/system_dump/ ``` -This will tell `extract-files.sh` to extract the proprietary blobs from the mounted system dump rather than a connected device. +Or, for the Python script: +``` +./extract-files.py ~/android/system_dump/ +``` + +This will tell extract-files script to extract the proprietary blobs from the mounted system dump rather than a connected device. Once it is done, unmount the system dump and remove the now unnecessary files: diff --git a/pages/internal/working_with_blobs.md b/pages/internal/working_with_blobs.md index 568930d40..29caef23d 100644 --- a/pages/internal/working_with_blobs.md +++ b/pages/internal/working_with_blobs.md @@ -12,7 +12,9 @@ tags: All devices should have a list of proprietary blobs in their device tree called ```proprietary-files.txt```. This list is used to create the vendor repository for building the device by extracting blobs from a device running the latest copy of LineageOS and/or from a system dump. Generally devices need only one list of blobs although you may encounter devices that have both ```proprietary-files.txt``` and ```proprietary-files-qc.txt``` (or more). There is no need to split the files and the reason for the split is largely historical at this point. -To start, copy the appropriate ```extract-files.sh``` and ```setup-makefiles.sh``` templates from ```tools/extract-utils/templates``` (```vendor/lineage/build/templates``` on LineageOS 17.1 and older) to your device tree and edit them to fill in the three required fields (device, vendor and copyright year). +For LineageOS 21 and below, copy the appropriate ```extract-files.sh``` and ```setup-makefiles.sh``` templates from ```tools/extract-utils/templates``` (```vendor/lineage/build/templates``` on LineageOS 17.1 and older) to your device tree and edit them to fill in the three required fields (device, vendor, and copyright year). + +Starting with LineageOS 22, you should use the Python extract utilities, which are faster and more versatile. Copy the ```extract-files.py``` and ```setup-makefiles.py``` templates from ```tools/extract-utils/templates``` to your device tree and edit them similarly to fill in the required fields. The contents of ```proprietary-files.txt``` is a list of blobs with optional comments (lines beginning with ```#```). Each blob line is of the form: