Coder Social home page Coder Social logo

syvaidya / linux-amlogic-toolkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from natinusala/linux-amlogic-toolkit

8.0 3.0 5.0 3.37 MB

Allows to unpack and repack AMLogic images for Android 7 without the Customization Tool

Shell 20.93% Makefile 2.30% C 72.00% Python 3.93% Roff 0.84%

linux-amlogic-toolkit's Introduction

Linux AMLogic Toolkit

Allows to unpack and repack AMLogic Android images on Linux systems without using the Customization Tool - works for Android 9.

Features

  • Unpack and repack any image
  • Mount and edit system, vendor, product and odm partitions
  • Unpack and repack logo partition (for bootup and upgrading logos)
  • Unpack and repack boot image and initrd ramdisk
  • Unpack and repack recovery image
  • Flash the image directly to a device without repacking it (faster than using the USB Burning Tool)
  • Works for Android 9
  • No need to unpack the image each time you want to use the tool

Dependencies

  • zlib1g-dev for simg2img and img2simg
  • libblkid-dev for abootimg (unpacking and repacking boot image)
  • the i386 packages if needed (for the logo unpacking / repacking binary)

How to use it

  • Clone or download this repository
  • Install the dependencies
  • Move to the directory of the repository, and stay there
  • (first time, or after a cleanup) Run ./bin/build to build the required tools
  • (when editing a new image file) Run ./bin/unpack input.img to unpack input.img
  • The result is :
    • output/image : raw image files (PARTITION files)
    • output/system : system partition files
    • output/vendor : vendor partition files
    • output/product : product partition files
    • output/odm : odm partition files
    • output/logo : logo partition files
    • output/boot : boot partition files
    • output/recovery : recovery partition files
  • From now on you can edit the files of the output directory
    • Note that those files will be overwritten when repacking :
      • output/image/system.PARTITION
      • output/image/vendor.PARTITION
      • output/image/product.PARTITION
      • output/image/odm.PARTITION
      • output/image/logo.PARTITION
      • output/image/boot.PARTITION
      • output/image/recovery.PARTITION
      • output/boot/initrd.img if using ./bin/extract_initrd
    • If you happen to loose the output/system (or vendor, product, odm) mounting point (after a reboot for instance), just run ./bin/remount to mount those again
    • On the other hand, you can unmount the partitions using ./bin/unmount
    • If you want to extract the initrd ramdisk, use the ./bin/extract_initrd and ./bin/recreate_initrd scripts (output in output/initrd)
  • Be careful :
    • Don't break everything by chmod'ing the whole output/system folder, because it will be replicated in the image and it won't boot !
    • Don't rename the files in output/boot.img
    • If you extract and recreate the initrd ramdisk, its size will change and it will most likely break the boot image. To fix this, edit the bootimg.cfg file in output/boot to replicate the change in size (you can repack the image, let it fail and read the logs to see the new size).
  • When you have finished editing the files, run ./bin/repack output.img to repack the image to output.img
  • Additionally, you can use ./bin/flash to flash the image to a device through USB (you will need the udev rule, see https://github.com/Stane1983/aml-linux-usb-burn)
    • The device type (gxl) is hardcoded into the flashing script, edit it if you're not using S905, S905X or S919
  • Done !

Troubleshooting

Credits

linux-amlogic-toolkit's People

Contributors

natinusala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.