├── .github └── workflows │ └── generate_tree.yml └── README.md /.github/workflows/generate_tree.yml: -------------------------------------------------------------------------------- 1 | name: Auto LineageOS Tree Generator 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | DUMP_URL: 7 | description: 'Dump link' 8 | required: true 9 | default: '' 10 | DUMP_BRANCH: 11 | description: 'Dump branch' 12 | required: true 13 | default: '' 14 | DEVICE_BRAND: 15 | description: 'Device manufacturer' 16 | required: true 17 | default: '' 18 | CODENAME: 19 | description: 'Device codename' 20 | required: true 21 | default: '' 22 | GIT_NAME: 23 | description: 'GitHub account user name' 24 | required: true 25 | default: '' 26 | GIT_EMAIL: 27 | description: 'GitHub account email adress' 28 | required: true 29 | default: '' 30 | 31 | jobs: 32 | gen-tree: 33 | name: Create LineageOS compatible tree 34 | if: github.event.repository.owner.id == github.event.sender.id 35 | runs-on: ubuntu-latest 36 | env: 37 | GITHUB_TOKEN: ${{ secrets.LOS }} 38 | DU: ${{ github.event.inputs.DUMP_URL }} 39 | DB: ${{ github.event.inputs.DEVICE_BRAND}} 40 | DUB: ${{ github.event.inputs.DUMP_BRANCH }} 41 | CN: ${{ github.event.inputs.CODENAME }} 42 | GN: ${{ github.event.inputs.GIT_NAME }} 43 | GE: ${{ github.event.inputs.GIT_EMAIL }} 44 | 45 | permissions: 46 | contents: write 47 | steps: 48 | - name: Check Out 49 | if: check-out 50 | uses: actions/checkout@v4 51 | 52 | - name: Update and install required packages 53 | id: setting-up 54 | run: | 55 | sudo apt update 56 | sudo apt upgrade -y 57 | sudo apt install cpio python3 git -y 58 | 59 | - name: Setup GitHub CLI 60 | id: setup-gh 61 | run: | 62 | type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) 63 | curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ 64 | && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ 65 | && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ 66 | && sudo apt update \ 67 | && sudo apt install gh -y 68 | 69 | - name: Cloning ROM Dump 70 | id: clone-dump 71 | run: | 72 | cd /home 73 | sudo mkdir LOS-Generator 74 | sudo chmod 777 LOS-Generator 75 | cd LOS-Generator 76 | git clone ${{ env.DU }} -b ${{ env.DUB }} 77 | 78 | - name: Installing AOSPDTGEN 79 | id: setup-aosp-dtgen 80 | run: | 81 | pip3 install aospdtgen 82 | 83 | - name: Creating LineageOS Tree 84 | id: gen-dt 85 | run: | 86 | cd /home/LOS-Generator/* 87 | working_dump=$(pwd) 88 | python3 -m aospdtgen $working_dump 89 | echo "Successful!" 90 | mv $working_dump/output /home/LOS-Generator 91 | 92 | - name: Setting up Git 93 | id: setting-up-git 94 | run: | 95 | git config --global user.name "${{ env.GN }}" 96 | git config --global user.email "${{ env.GE }}" 97 | 98 | - name: Upload LineageOS Tree for GitHub 99 | id: upload-to-gh 100 | run: | 101 | cd /home/LOS-Generator/output 102 | git init 103 | git branch -M lineage-${{ env.CN }} 104 | git add . 105 | git commit -s -m "${{ env.CN }}: LineageOS compatible device tree" 106 | gh repo create lineage_device_${{ env.DB }}_${{ env.CN }} --public --description="LineageOS compatible device tree for ${{ env.CN }}." --source=. --remote=origin --push 107 | echo "Successful!" 108 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Auto LineageOS Tree Generator 2 | It allows you to create a LineageOS compatible device tree with GitHub actions and the ROM dump you have previously created. It uses AOSPDTGEN when creating the tree. 3 | 4 | ## Requirements 5 | - ROM dump 6 | - GitHub token (I will explain) 7 | - Small device information (for repository creation and naming). 8 | 9 | ## Instruction for use 10 | - Fork this repository. 11 | - Get your 'Personal access token' in Account Settings > Developer settings > Personal access token. Check all the boxes and use classic tokens. 12 | - Then go to repository Settings > Secrets and Variables > Action > New repository secret; create new secret. Write the following in the name section: In the `LOS` description section; Paste your `Personal access token`. And save it. 13 | - Action > All workflows > Extract Blobs > Run workflows > Fill in all requested information > And run. 14 | 15 | ## Notes 16 | - All partitions should be present in the ROM dump. Otherwise it won't work. 17 | - Report bugs. 18 | - Perform operations carefully. Especially `token` transactions. 19 | --------------------------------------------------------------------------------