├── .github ├── ISSUE_TEMPLATE │ ├── 01-bug-report.yml │ ├── 02-feature-request.yml │ ├── 03-distribution-request.yml │ ├── 04-question.yml │ └── config.yml ├── dependabot.yml └── workflows │ └── build.yml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bootstrap-rootfs.sh ├── completions ├── proot-distro.bash └── proot-distro.fish ├── distro-build ├── adelie.sh ├── alpine.sh ├── archlinux.sh ├── artix.sh ├── chimera.sh ├── debian.sh ├── deepin.sh ├── fedora.sh ├── manjaro.sh ├── opensuse.sh ├── pardus.sh ├── rockylinux.sh ├── ubuntu.sh └── void.sh ├── distro-plugins ├── adelie.sh ├── alpine.sh ├── archlinux.sh ├── artix.sh ├── chimera.sh ├── debian.sh ├── deepin.sh ├── distro.sh.sample ├── fedora.sh ├── manjaro.sh ├── opensuse.sh ├── pardus.sh ├── rockylinux.sh ├── ubuntu.sh └── void.sh ├── install.sh └── proot-distro.sh /.github/ISSUE_TEMPLATE/01-bug-report.yml: -------------------------------------------------------------------------------- 1 | name: "Bug report" 2 | description: "Create a report to help us improve" 3 | title: "[Bug]: " 4 | labels: ["bug report"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | > [!IMPORTANT] 10 | > ### This is a bug tracker of the PRoot Distro - a Bash script utility for managing distribution rootfs for use with PRoot. 11 | > 12 | > ### **!!! DO NOT REPORT ISSUES ABOUT NETWORKING, CRASHES, BLACK SCREENS, BROKEN WINE AND SO ON. THEY WILL BE IGNORED !!! Only bugs related to `proot-distro` shell script implementation will be accepted.** 13 | - type: textarea 14 | attributes: 15 | label: Problem description 16 | description: | 17 | A clear and concise description of what the problem is. You may attach the logs, screenshots, screen video recording and whatever else that will help to understand the issue. 18 | 19 | **Reminding once more: do not report distribution bugs here such as black screens, package issues, desktop problems, etc. This bug tracker is solely about `proot-distro` script.** 20 | validations: 21 | required: true 22 | - type: textarea 23 | attributes: 24 | label: What steps will reproduce the bug? 25 | validations: 26 | required: true 27 | - type: textarea 28 | attributes: 29 | label: What is the expected behavior? 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/02-feature-request.yml: -------------------------------------------------------------------------------- 1 | name: "Feature request" 2 | description: "Request a new functionality" 3 | title: "[Feature]: " 4 | labels: [enhancement] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Check the [Functionality overview](https://github.com/termux/proot-distro#functionality-overview) section of readme document to ensure that new feature would not interfere with already existing ones. PRoot Distro has a blackbox-like design style and never supposed to be highly configurable. Requests for excessive functionality (that can be achieved through already existing) or plug-in format extensions that would allow significantly modifying runtime behavior would be rejected. 10 | 11 | To submit a request of a new feature, fill the form below. Be patient, do not expect that feature will get added immediately. 12 | - type: textarea 13 | attributes: 14 | label: Feature description 15 | description: A clear and concise description of a feature you would like to see in `proot-distro`. 16 | validations: 17 | required: true 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/03-distribution-request.yml: -------------------------------------------------------------------------------- 1 | name: "Distribution support request" 2 | description: "Request a new distribution" 3 | title: "[Distribution]: " 4 | labels: [enhancement] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | You may request a distribution that is not present in `proot-distro list`. Please note that non-standard distributions like "Gentoo Prefix" as well as distributions that assist hacking will be rejected. 10 | - type: textarea 11 | attributes: 12 | label: Description 13 | description: Tell us why this distribution should be added into PRoot-Distro support list. How it is different from already added ones such as Arch Linux or Debian? Pay attention that PRoot-Distro includes distributions only in the minimal configuration. You'll get a bare command line which mostly looks like same across all present distributions. All "fancy" configurations are discarded during rootfs packaging process. 14 | - type: input 15 | attributes: 16 | label: Home page URL 17 | validations: 18 | required: true 19 | - type: input 20 | attributes: 21 | label: Root file system archive URL 22 | - type: checkboxes 23 | attributes: 24 | label: Does 64bit ARM builds available (arm64, aarch64)? 25 | description: Distributions not supporting at least 64 bit ARM platforms are not eligible to be included. No exceptions here. 26 | options: 27 | - label: Yes, distribution provides 64 bit images. 28 | required: true 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/04-question.yml: -------------------------------------------------------------------------------- 1 | name: "Question" 2 | description: "Have questions about Proot-Distro? Ask us." 3 | title: "[General]: " 4 | labels: [question] 5 | body: 6 | - type: textarea 7 | attributes: 8 | label: Description 9 | validations: 10 | required: true 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: / 5 | schedule: 6 | interval: daily 7 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: "Build" 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - 'distro-build/**' 9 | pull_request: 10 | paths: 11 | - 'distro-build/**' 12 | workflow_dispatch: 13 | inputs: 14 | distributions: 15 | description: 'A space-seperated values what distribution shall be built' 16 | required: true 17 | 18 | jobs: 19 | build: 20 | # Ubuntu 22.04 has the up-to-date version of mmdebstrap 21 | runs-on: ubuntu-22.04 22 | steps: 23 | - name: Checkout Repository 24 | uses: actions/checkout@v4 25 | with: 26 | fetch-depth: 0 27 | - name: Gather distributions that is needed to be built 28 | run: | 29 | if [ "${{ github.event_name }}" != "workflow_dispatch" ]; then 30 | # gather files changed on the latest HEAD commit 31 | if [ "${{ github.event_name }}" == "pull_request" ]; then 32 | # process latest commit made from the PR through github.event.pull_request.head.sha context 33 | git diff-tree --no-commit-id --name-only ${{ github.event.pull_request.head.sha }} -r > ./files_changed.txt 34 | else 35 | git diff-tree --no-commit-id --name-only HEAD -r > ./files_changed.txt 36 | fi 37 | 38 | # check if files are changed or created are in distro-build directory 39 | if ! grep -q distro-build ./files_changed.txt; then 40 | echo "The latest commit does not have any distribution build script changed or added" 41 | exit 1 42 | fi 43 | 44 | # filter only files from distro-build directory only 45 | grep distro-build ./files_changed.txt | sed 's@\(distro-build/\|.sh\)@@g' > ./distributions.txt 46 | else 47 | echo "${{ github.event.inputs.distributions }}" > ./distributions.txt 48 | fi 49 | 50 | # Remove distro plugins to filter and upload built distributions and its plugins later on 51 | rm -rf ./distro-plugins/* 52 | - name: Install Needed Dependencies 53 | run: sudo apt-get update && sudo apt-get install -yq curl debian-archive-keyring jq mmdebstrap qemu-user-static binfmt-support 54 | - name: Build distribution rootfs 55 | run: | 56 | distros_to_be_built=$(cat ./distributions.txt) 57 | for d in ${distros_to_be_built}; do 58 | # check if a specified distribution build recipe exists in case for workflow dispatch inputs 59 | if [ ! -f ./distro-build/${d}.sh ]; then 60 | echo "Cannot build distribution ${d}: ./distro-build/${d}.sh: no such file exist" 61 | exit 2 62 | fi 63 | done 64 | ./bootstrap-rootfs.sh ${distros_to_be_built} 65 | # Upload Artifacts separately per architecture 66 | - name: Upload Artifacts (aarch64) 67 | uses: actions/upload-artifact@v4 68 | with: 69 | name: built-rootfs-aarch64 70 | path: rootfs/*aarch64*.tar.xz 71 | if-no-files-found: ignore 72 | - name: Upload Artifacts (arm) 73 | uses: actions/upload-artifact@v4 74 | with: 75 | name: built-rootfs-arm 76 | path: rootfs/*arm*.tar.xz 77 | if-no-files-found: ignore 78 | - name: Upload Artifacts (i686) 79 | uses: actions/upload-artifact@v4 80 | with: 81 | name: built-rootfs-i686 82 | path: rootfs/*i686*.tar.xz 83 | if-no-files-found: ignore 84 | - name: Upload Artifacts (riscv64) 85 | uses: actions/upload-artifact@v4 86 | with: 87 | name: built-rootfs-riscv64 88 | path: rootfs/*riscv64*.tar.xz 89 | if-no-files-found: ignore 90 | - name: Upload Artifacts (x86_64) 91 | uses: actions/upload-artifact@v4 92 | with: 93 | name: built-rootfs-x86_64 94 | path: rootfs/*x86_64*.tar.xz 95 | if-no-files-found: ignore 96 | # Upload distro plugins 97 | - name: Upload Artifacts (distro plugins) 98 | uses: actions/upload-artifact@v4 99 | with: 100 | name: distro-plugins 101 | path: distro-plugins/*.sh 102 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /rootfs/* 2 | *.swp 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Proot-Distro Contributor Guide 2 | 3 | Proot-Distro is yet another utility for installing Linux distributions on the 4 | non-rooted Android device. As the most of existing software projects, this 5 | utility created with aim to solve a specific range of tasks using the way 6 | preferred by its original author. 7 | 8 | This document describes the principles that you must take into account when 9 | contributing to the Proot-Distro project. 10 | 11 | ## Disclaimer 12 | 13 | DON'T expect: 14 | 15 | * That Proot-Distro will satisfy your needs 16 | 17 | * That Proot-Distro will work flawlessly on your device 18 | 19 | * That all your issues will be resolved by maintainers immediately 20 | 21 | * That all your submitted patches would be accepted 22 | 23 | * That maintainers will teach you how to use Linux distributions 24 | 25 | DON'T report bugs for: 26 | 27 | * Distributions 28 | 29 | * Restricted access to distribution hosting service 30 | 31 | * Lack of Internet access 32 | 33 | * Usage of mobile data plan and disk space 34 | 35 | DON'T ask for features such as: 36 | 37 | * Support for runtime platforms other than Termux 38 | 39 | * Classical Linux chroot and other things that require rooted device 40 | 41 | * Modified or pre-configured distributions 42 | 43 | * Distributions related to hacking: Kali Linux, Nethunter, Parrot OS, 44 | Black Arch, etc 45 | 46 | * Distribution init systems: systemd, openrc, etc 47 | 48 | * Additionally: *here goes all stuff that would require me to redesign 49 | Proot-Distro from scratch* 50 | 51 | *** 52 | 53 | ## Design insights 54 | 55 | ### 1. General information 56 | 57 | **1.1** Proot-Distro has a specific, well defined structure which makes it 58 | unique and separates from analogous projects. This structure expected to be 59 | followed during whole project lifetime. If you have ideas how to restructure 60 | the Proot-Distro, then please keep them in your own fork! Customizing sources 61 | for your own preferences is not welcome. 62 | 63 | Review the `proot-distro.sh` script to understand how it works and see key 64 | parts of the design. 65 | 66 | **1.2** Proot-Distro is written in Bash script language with using features 67 | which are not compatible with POSIX shell. The script itself is monolithic 68 | and is not supposed to be split on multiple parts. 69 | 70 | **1.3** Tabs must be used for indenting code blocks everywhere. 71 | 72 | **1.4** All features are split on functions. There are 3 types of functions: 73 | 74 | * Commands: implement specific features of Proot-Distro such as install, 75 | backup, login the distribution. These functions have following name scheme: 76 | `command_name()`. 77 | 78 | * Command help: supplementary functions implementing informational output 79 | describing usage of Proot-Distro commands. These functions are named as 80 | `command_name_help()` and are defined AFTER the commands. 81 | 82 | * Utility functions: reusable or very long pieces of code. 83 | 84 | **1.5** Each command function definition should begin with comment section. 85 | 86 | Comment sections logically separate functions on groups and provide a brief 87 | overview which part of Proot-Distro is implemented here. The comment must 88 | provide a description of how the function works. 89 | 90 | Utility functions are allowed to have a very brief description and command help 91 | functions. 92 | 93 | Command help functions should not have comments. They are self descriptive. 94 | 95 | **1.6** Code pieces that do non-obvious actions must be commented. 96 | 97 | **1.7** Functions are not allowed to define global variables. Use keyword 98 | `local` to define the local variables instead. 99 | 100 | **1.8** Global variables must be defined either at beginning of Proot-Distro 101 | script or at the entry point. 102 | 103 | **1.9** Use of getopt for options handling is considered as non-flexible and 104 | thus not allowed. 105 | 106 | **1.10** The checks for error conditions must be implemented. If error has been 107 | encountered, a message should be printed on stderr and further execution should 108 | be terminated. 109 | 110 | **1.11** If error was encountered inside function, exiting should be done using 111 | the command `return 1` to pass a status code to the caller. Use of `exit` 112 | command is not allowed unless used in script entry point. 113 | 114 | **1.12** User input in command functions must be validated during the command 115 | line arguments handling. 116 | 117 | **1.13** Use heredocs to write files, especially if their content is long. 118 | 119 | **1.14** Certain configuration such as plug-in directory path may be set only 120 | during installation of the Proot-Distro. Such configuration is treated as 121 | persistent and should not be changed by user. 122 | 123 | **1.15** Proot-Distro uses string place holders to define certain common values 124 | for some variables: 125 | 126 | * `@TERMUX_APP_PACKAGE@` - sets Termux app package (com.termux). 127 | 128 | * `@TERMUX_PREFIX@` - sets the installation prefix path. 129 | 130 | * `@TERMUX_HOME@` - sets the Termux home directory path. 131 | 132 | It is not allowed to hardcode the mentioned values instead of using the place 133 | holder. 134 | 135 | *** 136 | 137 | ### 2. Informational messages output 138 | 139 | **2.1** All informational messages are printed in specific format. 140 | 141 | **2.2** Use function `msg` to print messages. 142 | 143 | **2.3** Messages printed by help functions must fit in 76 columns. If the 144 | message is too long, split in on multiple lines. This is not relevant to 145 | errors and other informational messages. Pay extra attention to keep the 146 | message properly indented. 147 | 148 | **2.4** All messages printable by Proot-Distro script must support colored 149 | text through the escape sequences defined below by variables such as `${RED}` 150 | (red), `${BRED}` (bold red text), `${YELLOW}`, `${BYELLOW}`, etc. 151 | 152 | **2.5** Proot-Distro operation errors must have bold red color (`${BRED}`). 153 | The key information such as arguments caused an error should be encloded in 154 | quotes and highlighted by yellow color (`${YELLOW}`). 155 | 156 | **2.6** Messages should be terminated by `${RST}` which resets the text colors 157 | and other attributes. 158 | 159 | **2.7** Informational messages produced by Proot-Distro command steps must have 160 | the following format: 161 | 162 | ${BLUE}[${GREEN}*${BLUE}] ${CYAN}Message...${RST}" 163 | 164 | **2.8** If the step encountered a condition where an error should be printed, 165 | the following message format should be used instead: 166 | 167 | ${BLUE}[${RED}!${BLUE}] ${CYAN}Error or warning message.${RST} 168 | 169 | **2.9** Warnings about issues happened due to unexpected circumstances rather 170 | than due to failure of Proot-Distro actions should be printed in this format: 171 | 172 | ${BRED}Warning: message.${RST} 173 | 174 | Similarly to warnings, the error messages should have this format: 175 | 176 | ${BRED}Error: message.${RST} 177 | 178 | *** 179 | 180 | ### 3. Handling distributions 181 | 182 | **3.1** Proot-Distro script is intended to be distribution-agnostic. That means 183 | it treats all distributions equally and handles them in the same way despite 184 | the possible differences at level of distribition root file system package. 185 | 186 | **3.2** Support of specific distribution is enabled by using a plug-in. The 187 | plug-in is a Bash script that is sourced by Proot-Distro and has the following 188 | format: 189 | 190 | DISTRO_NAME="Example" 191 | DISTRO_COMMENT="Example distribution." 192 | 193 | TARBALL_STRIP_OPT=1 194 | 195 | TARBALL_URL['aarch64']="https://example.com/archive-aarch64.tar.gz" 196 | TARBALL_URL['arm']="https://example.com/archive-armv7.tar.gz" 197 | TARBALL_URL['i686']="https://example.com/archive-i386.tar.gz" 198 | TARBALL_URL['riscv64']="https://example.com/archive-riscv64.tar.gz" 199 | TARBALL_URL['x86_64']="https://example.com/archive-amd64.tar.gz" 200 | 201 | TARBALL_SHA256['aarch64']="0000000000000000000000000000000000000000000000000000000000000000" 202 | TARBALL_SHA256['arm']="0000000000000000000000000000000000000000000000000000000000000000" 203 | TARBALL_SHA256['i686']="0000000000000000000000000000000000000000000000000000000000000000" 204 | TARBALL_SHA256['riscv64']="0000000000000000000000000000000000000000000000000000000000000000" 205 | TARBALL_SHA256['x86_64']="0000000000000000000000000000000000000000000000000000000000000000" 206 | 207 | distro_setup() { 208 | run_proot_cmd touch /etc/hello-world 209 | run_proot_cmd bash -c "echo '127.0.0.1 hello-world' >> /etc/hosts" 210 | } 211 | 212 | **3.3** The variable `DISTRO_NAME` specifies a full name of distribution such 213 | as `Ubuntu` or `Debian (stable)`. This variable is mandatory. 214 | 215 | **3.4** The variable `TARBALL_URL` is a Bash associative array which contains 216 | URLs to distribution rootfs tarball for given CPU architectures. This variable 217 | is mandatory. The URL should start with proper protocol scheme. 218 | For example `https://`, `ftp://` or `file://`. 219 | 220 | **3.5** The variable `TARBALL_SHA256` is a Bash associative array which 221 | contains SHA-256 checksums of rootfs tarballs for given CPU architectures. 222 | This variable is mandatory. 223 | 224 | **3.6** Post-installation steps that may be required for some distributions 225 | are defined in `distro_setup()` function (optional). This function has access 226 | to all variables defined by Proot-Distro during the execution of 227 | `command_install()`. 228 | 229 | **3.7** Commands inside `distro_setup()` that are intended to be executed in 230 | distribution environment must be defined as arguments of the command 231 | `run_proot_cmd`. 232 | 233 | **3.8** Distributions must be adressed by their alias which in fact is a 234 | file name of plug-in except the extension part. 235 | 236 | **3.9** The alias files are located in `${TERMUX_PREFIX}/etc/proot-distro` and 237 | have extensions `.sh` or `.override.sh`. 238 | 239 | * `dist.sh` name format is used for standard plug-ins. 240 | 241 | * `dist2.override.sh` name is used to indicate that this is a renamed 242 | distribution created by command `rename` or by the option `--override-alias` 243 | of command `install`. 244 | 245 | **3.10** The alias for distribution must be unique and Proot-Distro should take 246 | care of that. User should not end with having two plug-ins for same alias, for 247 | example `ubuntu.sh` and `ubuntu.override.sh`. 248 | 249 | **3.11** The rootfs for distribution may be extracted only under PRoot session 250 | with active link2symlink extension. 251 | 252 | *** 253 | 254 | ### 4. Project versioning scheme: major.minor.patch 255 | 256 | **4.1** Major version should be incremented when breaking changes were 257 | released. Examples are deprecated features, changed locations of files, 258 | command line format changes. 259 | 260 | **4.2** Minor version is incremented for significant but non-breaking changes 261 | such as added new features or upgraded distributions. The minor version is set 262 | to 0 when major version was incremented. 263 | 264 | **4.3** Patch version is incremented for small changes such as bug fixes. It 265 | is set to 0 when major or minor versions were incremented. 266 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PRoot Distro 2 | 3 | A Bash script wrapper for utility [proot] for easy management of chroot-based 4 | Linux distribution installations. It does not require root or any special ROM, 5 | kernel, etc. Everything you need to get started is the latest version of 6 | [Termux] application. See [Installing](#installing) for details. 7 | 8 | *** 9 | 10 | ## Bundled distributions 11 | 12 | PRoot Distro provides a set of bare-minimum root file system tarballs for 13 | commonly used distributions. Each distribution guaranteed to support at least 14 | AArch64 (ARM64) CPUs. To reduce maintenance effort, we package only single 15 | version of distribution (stable, lts or rolling-release) with rare exceptions. 16 | 17 | Available distributions in format `proot-distro alias : description`: 18 | 19 | * `adelie`: Adelie Linux 20 | * `alpine`: Alpine Linux (edge) \-\-\- **Recommended for low disk space!** 21 | * `archlinux`: Arch Linux / Arch Linux 32 / Arch Linux ARM 22 | * `artix`: Artix Linux (AArch64 only) 23 | * `chimera`: Chimera Linux 24 | * `debian`: Debian (bookworm) 25 | * `deepin`: deepin (beige) 26 | * `fedora`: Fedora 42 (64bit only) 27 | * `manjaro`: Manjaro (AArch64 only) 28 | * `opensuse`: openSUSE (Tumbleweed) 29 | * `pardus`: Pardus (yirmiuc) 30 | * `rockylinux`: Rocky Linux (9.5) 31 | * `ubuntu`: Ubuntu (24.04) 32 | * `void`: Void Linux 33 | 34 | Everything is provided as-is. Root file system tarballs are generated from 35 | content provided by repositories of selected distributions with no modification 36 | from our side. 37 | 38 | Build is automated by [GitHub Actions](https://github.com/termux/proot-distro/actions): 39 | 40 | * Configuration: https://github.com/termux/proot-distro/blob/master/.github/workflows/build.yml 41 | * Rootfs packaging scripts: https://github.com/termux/proot-distro/tree/master/distro-build 42 | 43 | We don't develop packages for any of mentioned distributions, so bug reports 44 | about them will be ignored. Although in most cases of "bugs" you'll have to 45 | blame either Android OS or [proot] utility. 46 | 47 | PRoot Distro is only a wrapper (launcher) for [proot]. 48 | 49 | If you need a custom version, you will need to add it on your own. 50 | See [Adding distribution](#adding-distribution). 51 | 52 | ### Security 53 | 54 | **Users must upgrade packages after installing the distribution to ensure 55 | presence of all latest bug fixes and security patches.** 56 | 57 | Root file system archives for distributions from our catalog are updated 58 | on demand. Effectively that means newly installed distribution may be few 59 | months as outdated. 60 | 61 | Remember that `proot` (core of `proot-distro`) does not provide high grade 62 | isolation like `docker`, `firejail` and similar well-known utilities. 63 | 64 | ## Installing 65 | 66 | With package manager: 67 | ``` 68 | pkg install proot-distro 69 | ``` 70 | 71 | With git: 72 | ``` 73 | pkg install git file proot 74 | git clone https://github.com/termux/proot-distro 75 | cd proot-distro 76 | ./install.sh 77 | ``` 78 | 79 | Dependencies: bash, bzip2, coreutils, curl, file, findutils, gawk, gzip, 80 | ncurses-utils, proot, sed, tar, util-linux, xz-utils 81 | 82 | If you want command line auto complete, install the `bash-completion` package. 83 | 84 | ## Functionality overview 85 | 86 | PRoot Distro aims to provide all-in-one functionality for managing the 87 | installed distributions: installation, de-installation, backup, restore, login. 88 | Each action is defined through command. Each command accepts its unique set 89 | of options, specific to the task that it performs. 90 | 91 | Usage basics: 92 | ``` 93 | proot-distro 94 | ``` 95 | 96 | Alternative variant (v4.0.0+): 97 | ``` 98 | pd 99 | ``` 100 | 101 | Where `` is a proot-distro action command (see below to learn what 102 | is available) and `` is a list of options specific to given command. 103 | 104 | Example of installing the distribution: 105 | ``` 106 | proot-distro install debian 107 | ``` 108 | 109 | Some commands support aliases. For example, instead of 110 | ``` 111 | proot-distro list 112 | proot-distro install debian 113 | proot-distro login debian 114 | proot-distro remove debian 115 | ``` 116 | 117 | you can type this: 118 | ``` 119 | proot-distro ls 120 | proot-distro i debian 121 | proot-distro sh debian 122 | proot-distro rm debian 123 | ``` 124 | 125 | Information about supported aliases can be viewed in help for each command. 126 | 127 | Known distributions are defined through plug-in scripts, which define URLs 128 | from where root file system archive will be downloaded and set of checksums 129 | for integrity check. Plug-ins also can define a set of commands which would 130 | be executed during distribution installation. 131 | 132 | See [Adding distribution](#adding-distribution) to learn more how to add own 133 | distribution to PRoot Distro. 134 | 135 | ### Accessing built-in help 136 | 137 | Command: `help` 138 | 139 | This command will show the help information about `proot-distro` usage. 140 | * `proot-distro help` - main page. 141 | * `proot-distro --help` - view help for specific command. 142 | 143 | ### Backing up distribution 144 | 145 | Command: `backup` 146 | 147 | Aliases: `bak`, `bkp` 148 | 149 | Backup specified distribution and its plug-in into tar archive. The contents 150 | of backup can be either printed to stdout for further processing or written 151 | to a file. 152 | 153 | Compression is determined according to file extension, e.g.`.tar.gz` will lead 154 | to GZip compression and `.tar.xz` will lead to XZ. Piped backup data is always 155 | not compressed giving user freedom for further processing. 156 | 157 | Usage example: 158 | ``` 159 | proot-distro backup debian | xz | ssh example.com 'cat > /backups/pd-debian-backup.tar.xz' 160 | proot-distro backup --output backup.tar.gz debian 161 | ``` 162 | 163 | *This command is generic. All additional processing like encryption should be 164 | done by user through external commands.* 165 | 166 | ### Installing a distribution 167 | 168 | Command: `install` 169 | 170 | Aliases: `add`, `i`, `in`, `ins` 171 | 172 | Install a distribution specified by alias - a short name referring to the 173 | plug-in of chosen distribution. 174 | 175 | Usage example: 176 | ``` 177 | proot-distro install alpine 178 | ``` 179 | 180 | By default the installed distribution will have same alias as specified on 181 | command line. This means you will be unable to install multiple copies at 182 | same time. You can rename distribution during installation time by using 183 | option `--override-alias` which will create a copy of distribution plug-in. 184 | 185 | Usage example: 186 | ``` 187 | proot-distro install --override-alias alpine-test alpine 188 | proot-distro login alpine-test 189 | ``` 190 | 191 | Copied plug-in has following name format `.override.sh` and is stored 192 | in directory with others (`$PREFIX/etc/proot-distro`). 193 | 194 | It is possible to force specify a custom CPU architecture of distribution to 195 | install. To do this you need to set `DISTRO_ARCH` environment variable to 196 | one of these values: `aarch64`, `arm`, `i686`, `riscv64`, `x86_64`. Example: 197 | 198 | ``` 199 | DISTRO_ARCH=arm proot-distro install alpine 200 | ``` 201 | 202 | Typically if your host is 64bit, the 32bit version of distribution for same 203 | architecture should work seamlessly, but that's not guaranteed. Thus if you 204 | encounter an issue while using ARM version of the system on AArch64 host, 205 | this would be rather a bug of [proot](https://github.com/termux/proot) utility 206 | or incompatibility with CPU instructions supported by host. 207 | 208 | Usage of foreign architectures, like x86_64 target on AArch64 host, always 209 | would require QEMU user mode packages. 210 | 211 | Install all supported QEMU user mode packages with one command: 212 | 213 | ``` 214 | pkg install qemu-user-aarch64 qemu-user-arm qemu-user-i386 qemu-user-x86-64 215 | ``` 216 | 217 | `x86_64` target also supports a Blink user mode CPU emulator (experimental). 218 | See [below](#experimental-blink-emulator-support) for usage details. 219 | 220 | ### Listing distributions 221 | 222 | Command: `list` 223 | 224 | Aliases: `li`, `ls` 225 | 226 | Shows a list of available distributions, their aliases, installation status 227 | and comments. 228 | 229 | ### Start shell session 230 | 231 | Command: `login` 232 | 233 | Aliases: `sh` 234 | 235 | Execute a shell within the given distribution. Example: 236 | ``` 237 | proot-distro login debian 238 | ``` 239 | 240 | Execute a shell as specified user in the given distribution: 241 | ``` 242 | proot-distro login --user admin debian 243 | ``` 244 | 245 | You can run a custom command as well: 246 | ``` 247 | proot-distro login debian -- /usr/local/bin/mycommand --sample-option1 248 | ``` 249 | 250 | Argument `--` acts as terminator of `proot-distro login` options processing. 251 | All arguments behind it would not be treated as options of PRoot Distro. 252 | 253 | Login command supports these behavior modifying options: 254 | * `--user ` 255 | 256 | Use a custom login user instead of default `root`. You need to create the 257 | user via `useradd -U -m username` before using this option. 258 | 259 | * `--fix-low-ports` 260 | 261 | Force redirect low networking ports to a high number (2000 + port). Use 262 | this with software requiring low ports which are not possible without real 263 | root permissions. 264 | 265 | For example this option will redirect port 80 to something like 2080. 266 | 267 | * `--isolated` 268 | 269 | Do not mount host volumes inside proot environment. If this option was 270 | given, following mount points will not be accessible: 271 | 272 | * /apex (only Android 10+) 273 | * /data/dalvik-cache 274 | * /data/data/com.termux 275 | * /sdcard 276 | * /storage 277 | * /system 278 | * /vendor 279 | 280 | You will not be able to use Termux utilities inside proot environment. 281 | 282 | * `--termux-home` 283 | 284 | Mount Termux home directory as user home inside proot environment. 285 | 286 | This option takes priority over option `--isolated`. 287 | 288 | * `--shared-tmp` 289 | 290 | Share Termux temporary directory with proot environment. Takes priority 291 | over option `--isolated`. 292 | 293 | * `--bind path:path` 294 | 295 | Create a custom file system path binding. Option expects argument in the 296 | given format: 297 | ``` 298 | : 299 | ``` 300 | 301 | Takes priority over option `--isolated`. 302 | 303 | * `--no-link2symlink` 304 | 305 | Disable PRoot link2symlink extension. This will disable hard link emulation. 306 | You can use this option only if SELinux is disabled or is in permissive mode. 307 | 308 | * `--no-sysvipc` 309 | 310 | Disable PRoot System V IPC emulation. Try this option if you experience 311 | crashes. 312 | 313 | * `--no-kill-on-exit` 314 | 315 | Do not kill processes when shell session terminates. Typically will cause 316 | session to hang if you have any background processes running. 317 | 318 | * `--kernel` 319 | 320 | Set the kernel release and compatibility level to given value. 321 | 322 | * `--work-dir` 323 | 324 | Set the working directory to given value. By default the working directory 325 | is same as user home. 326 | 327 | ### Uninstall distribution 328 | 329 | Command: `remove` 330 | 331 | Aliases: `rm` 332 | 333 | This command completely deletes the installation of given system. Be careful 334 | as it does not ask for confirmation. Deleted data is irrecoverably lost. 335 | 336 | Usage example: 337 | ``` 338 | proot-distro remove debian 339 | ``` 340 | 341 | ### Rename distribution 342 | 343 | Command: `rename` 344 | 345 | Aliases: `mv` 346 | 347 | Rename the distribution by changing the alias name, renaming its plug-in and 348 | root file system directory. In case when default distribution is being renamed, 349 | a copy of plug-in will be created. 350 | 351 | Usage example: 352 | ``` 353 | proot-distro rename ubuntu ubuntu-test01 354 | ``` 355 | 356 | Only installed distribution can be renamed. 357 | 358 | ### Reinstall distribution 359 | 360 | Command: `reset` 361 | 362 | Aliases: \- 363 | 364 | Delete the specified distribution and install it again. This is a shortcut for 365 | ``` 366 | proot-distro remove && proot-distro install 367 | ``` 368 | 369 | Usage example: 370 | ``` 371 | proot-distro reset debian 372 | ``` 373 | 374 | Same as with command `remove`, deleted data is lost irrecoverably. Be careful. 375 | 376 | ### Restore from backup 377 | 378 | Command: `restore` 379 | 380 | Aliases: \- 381 | 382 | Restore the distribution from the given proot-distro backup (tar archive). 383 | 384 | Restore operation performs a complete rollback to the backup state as was in 385 | archive. Be careful as this command deletes previous data irrecoverably. 386 | 387 | Compression is determined automatically from file extension. Piped data 388 | must be always uncompressed before being supplied to `proot-distro`. 389 | 390 | Usage example: 391 | ``` 392 | ssh example.com 'cat /backups/pd-debian-backup.tar.xz' | xz -d | proot-distro restore 393 | proot-distro restore ./pd-debian-backup.tar.xz 394 | ``` 395 | 396 | ### Copy file to distribution or vice versa 397 | 398 | Command: `copy` 399 | 400 | Aliases: `cp` 401 | 402 | Copy a given file or directory from/to distribution. 403 | 404 | Usage example: 405 | ``` 406 | proot-distro copy ./localfile.txt ubuntu:/home/user/targetfile.txt 407 | ``` 408 | 409 | It is possible to move file rather than copying if option `--move` was passed. 410 | 411 | Globs are not supported. Source and destination paths may be specified only 412 | once. 413 | 414 | ### Clear downloads cache 415 | 416 | Command: `clear-cache` 417 | 418 | Aliases: `clear`, `cl` 419 | 420 | This will remove all cached root file system archives. 421 | 422 | ## Adding distribution 423 | 424 | Distribution is defined through the plug-in script that contains variables 425 | with metadata. A minimal one would look like this: 426 | ```.bash 427 | DISTRO_NAME="Debian" 428 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v1.10.1/debian-aarch64-pd-v1.10.1.tar.xz" 429 | TARBALL_SHA256['aarch64']="f34802fbb300b4d088a638c638683fd2bfc1c03f4b40fa4cb7d2113231401a21" 430 | ``` 431 | 432 | Script is stored in directory `$PREFIX/etc/proot-distro` and should be named 433 | like `.sh`, where `` is a desired name for referencing the 434 | distribution. For example, Debian plug-in will typically be named `debian.sh`. 435 | 436 | ### Plug-in variables reference 437 | 438 | `DISTRO_ARCH`: specifies which CPU architecture variant of distribution to 439 | install. 440 | 441 | Normally this variable is determined automatically, and you should not set it. 442 | Typical use case is to set a custom architecture to run the distribution under 443 | QEMU emulator (user mode). 444 | 445 | Supported architectures are: `aarch64`, `arm`, `i686`, `riscv64`, `x86_64`. 446 | 447 | `DISTRO_NAME`: a name of distribution, something like "Alpine Linux (3.14.1)". 448 | 449 | `DISTRO_COMMENT`: comments for current distribution. 450 | 451 | Normally this variable is not needed. Use it to notify user that something is 452 | not working or additional steps required to get started with this distribution. 453 | 454 | `TARBALL_STRIP_OPT`: how many leading path components should be stripped when 455 | extracting rootfs archive. The default value is 1 because all default rootfs 456 | tarballs store contents in a subdirectory. 457 | 458 | `TARBALL_URL`: a Bash associative array of root file system tarballs URLs. 459 | 460 | Should be defined at least for your CPU architecture. Valid architecture names 461 | are same as for `DISTRO_ARCH`. Should start with proper protocol scheme. 462 | For example, `https://`, `file://`, `ftp://` etc. to access local or remote file. 463 | 464 | `TARBALL_SHA256`: a Bash associative array of SHA-256 checksums for each rootfs 465 | variant. 466 | 467 | Must be defined for each tarball set in `TARBALL_URL`. 468 | 469 | ### Running additional installation steps 470 | 471 | Plug-in can be configured to execute specified commands after installing the 472 | distribution. This is done through function `distro_setup`. 473 | 474 | Example: 475 | ```.bash 476 | distro_setup() { 477 | run_proot_cmd apt update 478 | run_proot_cmd apt upgrade -yq 479 | } 480 | ``` 481 | 482 | `run_proot_cmd` is used when command should be executed inside the rootfs. 483 | 484 | ## Experimental Blink emulator support 485 | 486 | If user specified `DISTRO_ARCH` different from the current device architecture, 487 | a CPU emulation mode will be used. 488 | 489 | The default CPU emulation backend is QEMU user mode. However for `x86_64` 490 | target architecture user can enable use of Blink emulator. To use Blink 491 | as emulation backend user need to set an environment variable: 492 | ``` 493 | export PROOT_DISTRO_X64_EMULATOR=BLINK 494 | ``` 495 | 496 | `PROOT_DISTRO_X64_EMULATOR` accepts values only `QEMU` or `BLINK`. 497 | 498 | Install Blink emulator package with this command: 499 | ``` 500 | pkg install blink 501 | ``` 502 | 503 | Emulation mode doesn't guarantee stability. User can observe a weird behavior 504 | of programs and crashes. Some distributions may work while others may not. 505 | The performance also would be reduced due to emulator overhead. 506 | 507 | ## PRoot issues and differences from Chroot 508 | 509 | While PRoot is often referred as user space chroot implementation, it is much 510 | different from it both by implementation and features of work. Here is a list 511 | of most significant differences you should be aware of. 512 | 513 | 1. PRoot is slow and potentially unstable due to non-native execution 514 | 515 | Every process is hooked through `ptrace()`. This is done to be able 516 | translate file paths (emulate `chroot`), fake root user identity and 517 | workaround unsupported system calls. 518 | 519 | Such intrusion into execution flow usually works properly. However under 520 | certain cases user may observe "impossible" bugs such as crashes or 521 | strange program behavior, that are not reproducible on native Linux 522 | distribution setups (PC, Raspberry Pi). 523 | 524 | Using debugger tools such as gdb or strace could be problematic. 525 | 526 | **Important**: `proot-distro` may show higher performance degradation 527 | comparing to other proot environment setup scripts. Reason behind this 528 | is more extensive use of directory and file bindings. This is not a bug 529 | and is not planned to be "fixed". 530 | 531 | 2. PRoot cannot detach from the running process. 532 | 533 | Since PRoot controls the running processes via `ptrace()` it cannot detach 534 | from them. This means you can't start a daemon process (e.g. sshd) and close 535 | PRoot session. You will have to either kill process, wait until it finish or 536 | let proot kill it immediately on session close. 537 | 538 | 3. PRoot does not elevate privileges. 539 | 540 | Chroot also does not elevate privileges on its own. Just PRoot is configured 541 | to hijack user id as well, i.e. make it appear as `root`. So in reality your 542 | user name, id and privileges remain to be same as without PRoot but programs 543 | that do sanity check for current user will assume you are running as 544 | root user. 545 | 546 | Particularly, the fake root user makes it possible to use package manager 547 | in proot environment. 548 | 549 | 4. PRoot does not emulate privilege separation. 550 | 551 | Your root and non-root effectively are same. Files would appear as owned 552 | by your current user, which means both root and non-root user will be able 553 | to edit files of your `proot` distribution setup. 554 | 555 | Depending on your PRoot Distro use cases, this might be a security issue. 556 | 557 | 5. PRoot does not enable access to hardware and file system mounting. 558 | 559 | You won't be able read/write to devices such as partitions of internal 560 | and external drives, USB devices, Wi-Fi and Bluetooth dongles. 561 | 562 | Mounting file systems using FUSE also not possible: Android OS doesn't 563 | set world-writeable permissions on `/dev/fuse`, unlike standard Linux 564 | distributions. 565 | 566 | 6. Appimage, Flatpak and Snap do not work under PRoot. 567 | 568 | Self-sufficient application containers such as Appimage, Flatpak or Snap 569 | rely on file system mounting capabilities, FUSE and other features that 570 | not available without real root permissions. 571 | 572 | ## Mirrors 573 | 574 | I do not provide own rootfs archive hosting servers. Please do not ask for 575 | them unless you are willing to pay hosting costs. 576 | 577 | All files are published as GitHub releases. Latter means there is no effective 578 | way of mirroring all available rootfs tarballs, therefore no mirrors exist 579 | and `proot-distro` does not have a built-in method for swithing mirrors. 580 | 581 | In case if you are unable to download rootfs archive from GitHub, you have 582 | these choices: 583 | 584 | 1. Try to use GitHub proxy, something like `https://gh-proxy.ygxz.in/` 585 | 586 | 2. Build own rootfs tarball and use own server for hosting. For local files 587 | you can try specifying URL in format `file:///path/to/file.tar.gz`. 588 | 589 | Either of choices would require updating links and sha-256 checksums in files 590 | stored under `$PREFIX/etc/proot-distro`. 591 | 592 | ## Forking 593 | 594 | If you wish to use PRoot Distro or its part as a base for your own project, 595 | please make sure you comply with GNU GPL v3.0 license. 596 | 597 | Forks must be distributed under different name. 598 | 599 | [Termux]: 600 | [proot]: 601 | -------------------------------------------------------------------------------- /bootstrap-rootfs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## 3 | ## Script for making rootfs creation easier. 4 | ## 5 | 6 | set -e -u 7 | 8 | if [ "$(uname -o)" = "Android" ]; then 9 | echo "[!] This script cannot be executed on Android OS." 10 | exit 1 11 | fi 12 | 13 | for i in curl git jq mmdebstrap sudo tar xz; do 14 | if [ -z "$(command -v "$i")" ]; then 15 | echo "[!] '$i' is not installed." 16 | exit 1 17 | fi 18 | done 19 | 20 | # Where to put generated plug-ins. 21 | PLUGIN_DIR=$(dirname "$(realpath "$0")")/distro-plugins 22 | 23 | # Where to look for distribution build recipes 24 | BUILD_DIR=$(dirname "$(realpath "$0")")/distro-build 25 | 26 | # Where to put generated rootfs tarballs. 27 | ROOTFS_DIR=$(dirname "$(realpath "$0")")/rootfs 28 | 29 | # Working directory where chroots will be created. 30 | WORKDIR=/tmp/proot-distro-bootstrap 31 | 32 | # This is used to generate proot-distro plug-ins. 33 | TAB=$'\t' 34 | CURRENT_VERSION=$(git tag | sort -Vr | head -n1) 35 | if [ -z "$CURRENT_VERSION" ]; then 36 | echo "[!] Cannot detect the latest proot-distro version tag." 37 | exit 1 38 | fi 39 | 40 | # Usually all newly created tarballs are uploaded into GitHub release of 41 | # current proot-distro version. 42 | GIT_RELEASE_URL="https://github.com/termux/proot-distro/releases/download/${CURRENT_VERSION}" 43 | 44 | # Normalize architecture names. 45 | # Prefer aarch64, arm, i686, riscv64, x86_64 architecture names 46 | # just like used by termux-packages. 47 | translate_arch() { 48 | case "$1" in 49 | aarch64|arm64) echo "aarch64";; 50 | arm|armel|armhf|armhfp|armv7|armv7l|armv7a|armv8l) echo "arm";; 51 | 386|i386|i686|x86) echo "i686";; 52 | riscv64) echo "riscv64";; 53 | amd64|x86_64) echo "x86_64";; 54 | *) 55 | echo "translate_arch(): unknown arch '$1'" >&2 56 | exit 1 57 | ;; 58 | esac 59 | } 60 | 61 | # Common way to archive the rootfs. 62 | # Usage: archive_rootfs /path/to/rootfs.tar.xz rootfs-dir 63 | # rootfs-dir is relative to $WORKDIR 64 | archive_rootfs() { 65 | SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}" 66 | echo "SOURCE_DATE_EPOCH: ${SOURCE_DATE_EPOCH}" 67 | 68 | sudo rm -f "${1}.tmp" 69 | sudo tar \ 70 | --directory="$WORKDIR" \ 71 | --create \ 72 | --sort=name \ 73 | --hard-dereference \ 74 | --mtime="@${SOURCE_DATE_EPOCH}" \ 75 | --numeric-owner \ 76 | --preserve-permissions \ 77 | --acls \ 78 | --xattrs \ 79 | --xattrs-include='*' \ 80 | --xz \ 81 | --file="${1}.tmp" \ 82 | "$2" 83 | sudo chown $(id -un):$(id -gn) "${1}.tmp" 84 | mv "${1}.tmp" "${1}" 85 | } 86 | 87 | ############################################################################## 88 | 89 | # Reset workspace. This also deletes any previously made rootfs tarballs. 90 | sudo rm -rf "${WORKDIR:?}" 91 | mkdir -p "$ROOTFS_DIR" "$WORKDIR" 92 | cd "$WORKDIR" 93 | 94 | # Build distribution. if no argument is supplied then all distributions will be built 95 | if [ "$#" -gt 0 ]; then 96 | DISTRIBUTIONS="$*" 97 | else 98 | DISTRIBUTIONS="$(cd ${BUILD_DIR}; ls -1 *.sh | sed 's/.sh//')" 99 | fi 100 | 101 | # Loop over to build a specified distribution 102 | for distro in ${DISTRIBUTIONS}; do 103 | # Check distribution recipe that is about to built. if it doesn't exist. continue to next distribution 104 | if [ ! -f "${BUILD_DIR}/${distro}.sh" ]; then 105 | continue 106 | fi 107 | 108 | . "${BUILD_DIR}/${distro}.sh" 109 | printf "\n[*] Building ${dist_name:=$distro}...\n" 110 | 111 | # Bootstrap step 112 | # If the function does not exists, abort to indicate there's an error occured during build 113 | if ! declare -F bootstrap_distribution &> /dev/null; then 114 | echo "[!] Failure to build rootfs ${distro}, missing bootstrap_distribution function. aborting..." 115 | exit 1 116 | fi 117 | bootstrap_distribution 118 | 119 | # Plugin generation step 120 | if ! declare -F write_plugin &> /dev/null; then 121 | echo "[!] Failure to generate plugin for ${distro}, missing write_plugin function. aborting..." 122 | exit 1 123 | fi 124 | write_plugin 125 | 126 | # Cleanup variables and functions 127 | unset dist_name dist_version 128 | unset -f bootstrap_distribution write_plugin 129 | done 130 | -------------------------------------------------------------------------------- /completions/proot-distro.bash: -------------------------------------------------------------------------------- 1 | _ls_available_dists() { 2 | if [ ! -e "@TERMUX_PREFIX@/etc/proot-distro" ]; then 3 | return 4 | fi 5 | cd "@TERMUX_PREFIX@/etc/proot-distro" 6 | find . -mindepth 1 -maxdepth 1 -iname "*.sh" | cut -d/ -f2 | sed -E 's/(.*)\..*/\1/g' 7 | } 8 | 9 | _ls_installed_dists() { 10 | if [ ! -e "@TERMUX_PREFIX@/var/lib/proot-distro/installed-rootfs" ]; then 11 | return 12 | fi 13 | cd "@TERMUX_PREFIX@/var/lib/proot-distro/installed-rootfs" 14 | find . -mindepth 1 -maxdepth 1 -type d | cut -d/ -f2 15 | } 16 | 17 | _proot-distro() { 18 | local cur prev words cword 19 | _init_completion || return 20 | 21 | local pd_commands="help backup install list login remove rename reset restore clear-cache copy" 22 | local pd_available_dists=$(_ls_available_dists) 23 | local pd_installed_dists=$(_ls_installed_dists) 24 | 25 | if [ "$cword" == "1" ]; then 26 | COMPREPLY=($(compgen -W "$pd_commands" -- "$cur")) 27 | else 28 | case "${words[1]}" in 29 | backup|bak|bkp) 30 | if [ "$prev" = "--output" ]; then 31 | _filedir 32 | else 33 | COMPREPLY=($(compgen -W "${pd_installed_dists} --output" -- "$cur")) 34 | fi 35 | ;; 36 | install|i|in|ins|add) 37 | if [ "$prev" = "--override-alias" ]; then 38 | COMPREPLY=($(compgen -W "new-dist-name" -- "$cur")) 39 | else 40 | COMPREPLY=($(compgen -W "${pd_available_dists} --override-alias" -- "$cur")) 41 | fi 42 | ;; 43 | login|sh) 44 | if [ $prev = "--user" ]; then 45 | COMPREPLY=($(compgen -W "username" -- "$cur")) 46 | elif [ $prev = "--bind" ]; then 47 | COMPREPLY=($(compgen -W "/src:/dest" -- "$cur")) 48 | elif [ $prev = "--kernel" ]; then 49 | COMPREPLY=($(compgen -W "6.0.0-proot-distro" -- "$cur")) 50 | else 51 | COMPREPLY=($(compgen -W "${pd_installed_dists} --user --fix-low-ports --isolated --termux-home --shared-tmp --bind --no-link2symlink --no-sysvipc --no-kill-on-exit --kernel" -- "$cur")) 52 | fi 53 | ;; 54 | remove|rm) 55 | COMPREPLY=($(compgen -W "${pd_installed_dists}" -- "$cur")) 56 | ;; 57 | rename|mv) 58 | if [ "$prev" = "rename" ] || [ "$prev" = "mv" ]; then 59 | COMPREPLY=($(compgen -W "${pd_installed_dists}" -- "$cur")) 60 | else 61 | COMPREPLY=($(compgen -W "new-dist-name" -- "$cur")) 62 | fi 63 | ;; 64 | reset) 65 | COMPREPLY=($(compgen -W "${pd_installed_dists}" -- "$cur")) 66 | ;; 67 | restore) 68 | _filedir 69 | ;; 70 | copy|cp) 71 | _filedir 72 | ;; 73 | esac 74 | fi 75 | } 76 | 77 | complete -F _proot-distro proot-distro pd 78 | -------------------------------------------------------------------------------- /completions/proot-distro.fish: -------------------------------------------------------------------------------- 1 | # Completions for proot-distro 2 | # https://github.com/termux/proot-distro 3 | 4 | function __fish_pd_available_dists 5 | set -l pd_plugin_dir @TERMUX_PREFIX@/etc/proot-distro 6 | if not test -d $pd_plugin_dir 7 | return 8 | end 9 | path basename $pd_plugin_dir/*.sh | path change-extension "" 10 | end 11 | 12 | function __fish_pd_installed_dists 13 | set -l pd_rootfs_dir @TERMUX_PREFIX@/var/lib/proot-distro/installed-rootfs 14 | if not test -d $pd_rootfs_dir 15 | return 16 | end 17 | path basename $pd_rootfs_dir/*/ 18 | end 19 | 20 | set -l backup backup bak bkp 21 | set -l install install i in ins add 22 | set -l list list li ls 23 | set -l login login sh 24 | set -l remove remove rm 25 | set -l rename rename mv 26 | set -l clear_cache clear-cache clear cl 27 | set -l copy copy cp 28 | 29 | set -l __fish_pd_commands help $backup $install $list $login $remove $rename reset restore $clear_cache $copy 30 | 31 | complete -c proot-distro -f 32 | 33 | # Subcommands 34 | complete -c proot-distro -kf -n __fish_use_subcommand -a copy -d "Copy files from/to distribution" 35 | complete -c proot-distro -kf -n __fish_use_subcommand -a clear-cache -d "Clear cache of downloaded files" 36 | complete -c proot-distro -kf -n __fish_use_subcommand -a restore -d "Restore a specified distribution" 37 | complete -c proot-distro -kf -n __fish_use_subcommand -a reset -d "Reinstall a specified distribution" 38 | complete -c proot-distro -kf -n __fish_use_subcommand -a rename -d "Rename installed distribution" 39 | complete -c proot-distro -kf -n __fish_use_subcommand -a remove -d "Delete a specified distribution" 40 | complete -c proot-distro -kf -n __fish_use_subcommand -a login -d "Start a shell for the given distribution" 41 | complete -c proot-distro -kf -n __fish_use_subcommand -a list -d "List available distributions" 42 | complete -c proot-distro -kf -n __fish_use_subcommand -a install -d "Install a specified distribution" 43 | complete -c proot-distro -kf -n __fish_use_subcommand -a backup -d "Backup a specified distribution" 44 | complete -c proot-distro -kf -n __fish_use_subcommand -a help -d "Show help information" 45 | 46 | # Subcommand arguments 47 | complete -c proot-distro -F -n "__fish_seen_subcommand_from restore $copy" 48 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $backup $login $remove $rename reset" \ 49 | -n "not __fish_seen_subcommand_from (__fish_pd_installed_dists)" \ 50 | -a "(__fish_pd_installed_dists)" 51 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $install" \ 52 | -n "not __fish_seen_subcommand_from (__fish_pd_available_dists)" \ 53 | -a "(__fish_pd_available_dists)" 54 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $rename" \ 55 | -n "__fish_seen_subcommand_from (__fish_pd_installed_dists)" \ 56 | -n "not __fish_seen_subcommand_from new-dist-name" \ 57 | -a new-dist-name 58 | 59 | # Options 60 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $__fish_pd_commands" -l help -d "Show help information" 61 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $list $copy" -l verbose 62 | 63 | # Backup options 64 | complete -c proot-distro -Fr -n "__fish_seen_subcommand_from $backup" -l output -d "Write tarball to specified file" 65 | 66 | # Install options 67 | complete -c proot-distro -x -n "__fish_seen_subcommand_from $install" \ 68 | -l override-alias -a new-dist-name -d "Set a custom alias for installed distribution" 69 | 70 | # Login options 71 | complete -c proot-distro -x -n "__fish_seen_subcommand_from $login" -l user -a username -d "Login as specified user instead of root" 72 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $login" -l fix-low-ports -d "Force redirect low networking ports to a high number" 73 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $login" -l isolated -d "Do not mount host volumes inside proot environment" 74 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $login" -l termux-home -d "Mount Termux home directory as user home inside proot" 75 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $login" -l shared-tmp -d "Mount Termux temp directory to /tmp" 76 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $login" -l no-link2symlink -d "Disable PRoot link2symlink extension" 77 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $login" -l no-sysvipc -d "Disable PRoot System V IPC emulation" 78 | complete -c proot-distro -f -n "__fish_seen_subcommand_from $login" -l no-kill-on-exit -d "Do not kill processes when shell session terminates" 79 | complete -c proot-distro -x -n "__fish_seen_subcommand_from $login" -l kernel -a 6.0.0-proot-distro -d "Set the kernel release and compatibility level to value" 80 | complete -c proot-distro -Fr -n "__fish_seen_subcommand_from $login" -l bind -d "Create a custom file system path binding" 81 | complete -c proot-distro -Fr -n "__fish_seen_subcommand_from $login" -l work-dir -d "Set the working directory to given value" 82 | -------------------------------------------------------------------------------- /distro-build/adelie.sh: -------------------------------------------------------------------------------- 1 | dist_name="Adélie Linux" 2 | dist_version="1.0-beta6" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/adelie-*.tar.xz 6 | 7 | for arch in aarch64 armv7 x86_64; do 8 | curl --fail --location \ 9 | --output "${WORKDIR}/adelie-${dist_version}-${arch}.tar.xz" \ 10 | "https://distfiles.adelielinux.org/adelie/${dist_version}/iso/adelie-rootfs-mini-${arch}-${dist_version}-20241223.txz" 11 | 12 | sudo rm -rf "${WORKDIR}/adelie-$(translate_arch "$arch")" 13 | sudo mkdir -m 755 "${WORKDIR}/adelie-$(translate_arch "$arch")" 14 | sudo tar -Jxp --acls --xattrs --xattrs-include='*' \ 15 | -f "${WORKDIR}/adelie-${dist_version}-${arch}.tar.xz" \ 16 | -C "${WORKDIR}/adelie-$(translate_arch "$arch")" 17 | 18 | cat <<- EOF | sudo unshare -mpf bash -e - 19 | rm -f "${WORKDIR}/adelie-$(translate_arch "$arch")/etc/resolv.conf" 20 | echo "nameserver 1.1.1.1" > "${WORKDIR}/adelie-$(translate_arch "$arch")/etc/resolv.conf" 21 | mount --bind /dev "${WORKDIR}/adelie-$(translate_arch "$arch")/dev" 22 | mount --bind /proc "${WORKDIR}/adelie-$(translate_arch "$arch")/proc" 23 | mount --bind /sys "${WORKDIR}/adelie-$(translate_arch "$arch")/sys" 24 | chroot "${WORKDIR}/adelie-$(translate_arch "$arch")" apk upgrade 25 | EOF 26 | 27 | sudo rm -f "${WORKDIR:?}/adelie-$(translate_arch "$arch")"/var/cache/apk/* || true 28 | 29 | archive_rootfs "${ROOTFS_DIR}/adelie-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 30 | "adelie-$(translate_arch "$arch")" 31 | done 32 | } 33 | 34 | write_plugin() { 35 | cat <<- EOF > "${PLUGIN_DIR}/adelie.sh" 36 | # This is a default distribution plug-in. 37 | # Do not modify this file as your changes will be overwritten on next update. 38 | # If you want customize installation, please make a copy. 39 | DISTRO_NAME="Adélie Linux" 40 | DISTRO_COMMENT="Version '${dist_version}'." 41 | 42 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/adelie-aarch64-pd-${CURRENT_VERSION}.tar.xz" 43 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/adelie-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 44 | TARBALL_URL['arm']="${GIT_RELEASE_URL}/adelie-armv7-pd-${CURRENT_VERSION}.tar.xz" 45 | TARBALL_SHA256['arm']="$(sha256sum "${ROOTFS_DIR}/adelie-arm-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 46 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/adelie-x86_64-pd-${CURRENT_VERSION}.tar.xz" 47 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/adelie-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 48 | EOF 49 | } 50 | -------------------------------------------------------------------------------- /distro-build/alpine.sh: -------------------------------------------------------------------------------- 1 | dist_name="Alpine Linux" 2 | dist_version="3.21.3" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/alpine-*.tar.xz 6 | 7 | for arch in aarch64 armv7 riscv64 x86 x86_64; do 8 | curl --fail --location \ 9 | --output "${WORKDIR}/alpine-minirootfs-${dist_version}-${arch}.tar.gz" \ 10 | "https://dl-cdn.alpinelinux.org/alpine/v${dist_version:0:4}/releases/${arch}/alpine-minirootfs-${dist_version}-${arch}.tar.gz" 11 | curl --fail --location \ 12 | --output "${WORKDIR}/alpine-minirootfs-${dist_version}-${arch}.tar.gz.sha256" \ 13 | "https://dl-cdn.alpinelinux.org/alpine/v${dist_version:0:4}/releases/${arch}/alpine-minirootfs-${dist_version}-${arch}.tar.gz.sha256" 14 | sha256sum -c "${WORKDIR}/alpine-minirootfs-${dist_version}-${arch}.tar.gz.sha256" 15 | 16 | sudo rm -rf "${WORKDIR}/alpine-$(translate_arch "$arch")" 17 | sudo mkdir -m 755 "${WORKDIR}/alpine-$(translate_arch "$arch")" 18 | sudo tar -zxp --acls --xattrs --xattrs-include='*' \ 19 | -f "${WORKDIR}/alpine-minirootfs-${dist_version}-${arch}.tar.gz" \ 20 | -C "${WORKDIR}/alpine-$(translate_arch "$arch")" 21 | 22 | cat <<- EOF | sudo unshare -mpf bash -e - 23 | rm -f "${WORKDIR}/alpine-$(translate_arch "$arch")/etc/resolv.conf" 24 | echo "nameserver 1.1.1.1" > "${WORKDIR}/alpine-$(translate_arch "$arch")/etc/resolv.conf" 25 | mount --bind /dev "${WORKDIR}/alpine-$(translate_arch "$arch")/dev" 26 | mount --bind /proc "${WORKDIR}/alpine-$(translate_arch "$arch")/proc" 27 | mount --bind /sys "${WORKDIR}/alpine-$(translate_arch "$arch")/sys" 28 | echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" > "${WORKDIR}/alpine-$(translate_arch "$arch")/etc/apk/repositories" 29 | echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> "${WORKDIR}/alpine-$(translate_arch "$arch")/etc/apk/repositories" 30 | chroot "${WORKDIR}/alpine-$(translate_arch "$arch")" apk upgrade 31 | chroot "${WORKDIR}/alpine-$(translate_arch "$arch")" apk add shadow-login 32 | chroot "${WORKDIR}/alpine-$(translate_arch "$arch")" ln -sf /var/cache/apk /etc/apk/cache 33 | EOF 34 | 35 | sudo rm -f "${WORKDIR:?}/alpine-$(translate_arch "$arch")"/var/cache/apk/* || true 36 | 37 | archive_rootfs "${ROOTFS_DIR}/alpine-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 38 | "alpine-$(translate_arch "$arch")" 39 | done 40 | } 41 | 42 | write_plugin() { 43 | cat <<- EOF > "${PLUGIN_DIR}/alpine.sh" 44 | # This is a default distribution plug-in. 45 | # Do not modify this file as your changes will be overwritten on next update. 46 | # If you want customize installation, please make a copy. 47 | DISTRO_NAME="Alpine Linux" 48 | DISTRO_COMMENT="Rolling release branch (edge)." 49 | 50 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/alpine-aarch64-pd-${CURRENT_VERSION}.tar.xz" 51 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/alpine-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 52 | TARBALL_URL['arm']="${GIT_RELEASE_URL}/alpine-arm-pd-${CURRENT_VERSION}.tar.xz" 53 | TARBALL_SHA256['arm']="$(sha256sum "${ROOTFS_DIR}/alpine-arm-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 54 | TARBALL_URL['i686']="${GIT_RELEASE_URL}/alpine-i686-pd-${CURRENT_VERSION}.tar.xz" 55 | TARBALL_SHA256['i686']="$(sha256sum "${ROOTFS_DIR}/alpine-i686-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 56 | TARBALL_URL['riscv64']="${GIT_RELEASE_URL}/alpine-riscv64-pd-${CURRENT_VERSION}.tar.xz" 57 | TARBALL_SHA256['riscv64']="$(sha256sum "${ROOTFS_DIR}/alpine-riscv64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 58 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/alpine-x86_64-pd-${CURRENT_VERSION}.tar.xz" 59 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/alpine-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 60 | EOF 61 | } 62 | -------------------------------------------------------------------------------- /distro-build/archlinux.sh: -------------------------------------------------------------------------------- 1 | dist_name="Arch Linux" 2 | dist_version="2025.01.01" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/archlinux-*.tar.xz 6 | 7 | for arch in aarch64 armv7; do 8 | curl --fail --location \ 9 | --output "${WORKDIR}/archlinux-${arch}.tar.gz" \ 10 | "http://os.archlinuxarm.org/os/ArchLinuxARM-${arch}-latest.tar.gz" 11 | 12 | sudo rm -rf "${WORKDIR}/archlinux-$(translate_arch "$arch")" 13 | sudo mkdir -m 755 "${WORKDIR}/archlinux-$(translate_arch "$arch")" 14 | sudo tar -zxp --acls --xattrs --xattrs-include='*' \ 15 | -f "${WORKDIR}/archlinux-${arch}.tar.gz" \ 16 | -C "${WORKDIR}/archlinux-$(translate_arch "$arch")" 17 | 18 | cat <<- EOF | sudo unshare -mpf bash -e - 19 | rm -f "${WORKDIR}/archlinux-$(translate_arch "$arch")/etc/resolv.conf" 20 | echo "nameserver 1.1.1.1" > "${WORKDIR}/archlinux-$(translate_arch "$arch")/etc/resolv.conf" 21 | mount --bind "${WORKDIR}/archlinux-$(translate_arch "$arch")/" "${WORKDIR}/archlinux-$(translate_arch "$arch")/" 22 | mount --bind /dev "${WORKDIR}/archlinux-$(translate_arch "$arch")/dev" 23 | mount --bind /proc "${WORKDIR}/archlinux-$(translate_arch "$arch")/proc" 24 | mount --bind /sys "${WORKDIR}/archlinux-$(translate_arch "$arch")/sys" 25 | chroot "${WORKDIR}/archlinux-$(translate_arch "$arch")" pacman-key --init 26 | chroot "${WORKDIR}/archlinux-$(translate_arch "$arch")" pacman-key --populate archlinuxarm 27 | if [ "$arch" = "aarch64" ]; then 28 | chroot "${WORKDIR}/archlinux-$(translate_arch "$arch")" pacman -Rnsc --noconfirm linux-aarch64 29 | else 30 | chroot "${WORKDIR}/archlinux-$(translate_arch "$arch")" pacman -Rnsc --noconfirm linux-armv7 31 | fi 32 | chroot "${WORKDIR}/archlinux-$(translate_arch "$arch")" pacman -Syu --noconfirm 33 | sed -i 's/#DisableSandbox/DisableSandbox/' "${WORKDIR}/archlinux-$(translate_arch "$arch")/etc/pacman.conf" 34 | EOF 35 | 36 | sudo rm -f "${WORKDIR:?}/archlinux-$(translate_arch "$arch")"/var/cache/pacman/pkg/* || true 37 | 38 | archive_rootfs "${ROOTFS_DIR}/archlinux-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 39 | "archlinux-$(translate_arch "$arch")" 40 | done 41 | unset arch 42 | 43 | curl --fail --location \ 44 | --output "${WORKDIR}/archlinux-x86_64.tar.zst" \ 45 | "https://mirror.rackspace.com/archlinux/iso/${dist_version}/archlinux-bootstrap-${dist_version}-x86_64.tar.zst" 46 | 47 | sudo mkdir -m 755 "${WORKDIR}/archlinux-bootstrap" 48 | sudo tar -xp --strip-components=1 --acls --xattrs --xattrs-include='*' \ 49 | -f "${WORKDIR}/archlinux-x86_64.tar.zst" \ 50 | -C "${WORKDIR}/archlinux-bootstrap" 51 | 52 | cat <<- EOF | sudo unshare -mpf bash -e - 53 | rm -f "${WORKDIR}/archlinux-bootstrap/etc/resolv.conf" 54 | echo "nameserver 1.1.1.1" > "${WORKDIR}/archlinux-bootstrap/etc/resolv.conf" 55 | mount --bind "${WORKDIR}/archlinux-bootstrap/" "${WORKDIR}/archlinux-bootstrap/" 56 | mount --bind /dev "${WORKDIR}/archlinux-bootstrap/dev" 57 | mount --bind /proc "${WORKDIR}/archlinux-bootstrap/proc" 58 | mount --bind /sys "${WORKDIR}/archlinux-bootstrap/sys" 59 | mkdir "${WORKDIR}/archlinux-bootstrap/archlinux-i686" 60 | mkdir "${WORKDIR}/archlinux-bootstrap/archlinux-x86_64" 61 | echo 'Server = http://mirror.rackspace.com/archlinux/\$repo/os/\$arch' > \ 62 | "${WORKDIR}/archlinux-bootstrap/etc/pacman.d/mirrorlist" 63 | chroot "${WORKDIR}/archlinux-bootstrap" pacman-key --init 64 | chroot "${WORKDIR}/archlinux-bootstrap" pacman-key --populate 65 | chroot "${WORKDIR}/archlinux-bootstrap" pacstrap -K /archlinux-x86_64 base 66 | # chroot "${WORKDIR}/archlinux-bootstrap" pacman -Scc --noconfirm 67 | sed -i 's|Architecture = auto|Architecture = i686|' \ 68 | "${WORKDIR}/archlinux-bootstrap/etc/pacman.conf" 69 | sed -i 's|Required DatabaseOptional|Never|' \ 70 | "${WORKDIR}/archlinux-bootstrap/etc/pacman.conf" 71 | echo 'Server = https://de.mirror.archlinux32.org/\$arch/\$repo' > \ 72 | "${WORKDIR}/archlinux-bootstrap/etc/pacman.d/mirrorlist" 73 | chroot "${WORKDIR}/archlinux-bootstrap" pacstrap -K /archlinux-i686 base 74 | EOF 75 | sudo mv archlinux-bootstrap/archlinux-x86_64 ./ 76 | sudo mv archlinux-bootstrap/archlinux-i686 ./ 77 | 78 | for arch in i686 x86_64; do 79 | sudo rm -f "${WORKDIR:?}/archlinux-bootstrap/archlinux-${arch}"/var/cache/pacman/pkg/* || true 80 | sudo sed -i 's/#DisableSandbox/DisableSandbox/' "archlinux-${arch}/etc/pacman.conf" 81 | archive_rootfs "${ROOTFS_DIR}/archlinux-${arch}-pd-${CURRENT_VERSION}.tar.xz" \ 82 | "archlinux-${arch}" 83 | done 84 | unset arch 85 | } 86 | 87 | write_plugin() { 88 | cat <<- EOF > "${PLUGIN_DIR}/archlinux.sh" 89 | # This is a default distribution plug-in. 90 | # Do not modify this file as your changes will be overwritten on next update. 91 | # If you want customize installation, please make a copy. 92 | DISTRO_NAME="Arch Linux" 93 | DISTRO_COMMENT="ARM(64) devices use Arch Linux ARM, i686 uses Arch Linux 32. Both are independent projects. The original Arch usable only by x86_64 devices." 94 | 95 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/archlinux-aarch64-pd-${CURRENT_VERSION}.tar.xz" 96 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/archlinux-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 97 | TARBALL_URL['arm']="${GIT_RELEASE_URL}/archlinux-arm-pd-${CURRENT_VERSION}.tar.xz" 98 | TARBALL_SHA256['arm']="$(sha256sum "${ROOTFS_DIR}/archlinux-arm-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 99 | TARBALL_URL['i686']="${GIT_RELEASE_URL}/archlinux-i686-pd-${CURRENT_VERSION}.tar.xz" 100 | TARBALL_SHA256['i686']="$(sha256sum "${ROOTFS_DIR}/archlinux-i686-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 101 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/archlinux-x86_64-pd-${CURRENT_VERSION}.tar.xz" 102 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/archlinux-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 103 | 104 | distro_setup() { 105 | ${TAB}# Fix environment variables on login or su. 106 | ${TAB}local f 107 | ${TAB}for f in su su-l system-local-login system-remote-login; do 108 | ${TAB}${TAB}echo "session required pam_env.so readenv=1" >> ./etc/pam.d/"\${f}" 109 | ${TAB}done 110 | 111 | ${TAB}# Configure en_US.UTF-8 locale. 112 | ${TAB}sed -i -E 's/#[[:space:]]?(en_US.UTF-8[[:space:]]+UTF-8)/\1/g' ./etc/locale.gen 113 | ${TAB}run_proot_cmd locale-gen 114 | } 115 | EOF 116 | } 117 | -------------------------------------------------------------------------------- /distro-build/artix.sh: -------------------------------------------------------------------------------- 1 | dist_name="Artix Linux" 2 | dist_version="20241207" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/artix-*.tar.xz 6 | 7 | curl --fail --location \ 8 | --output "${WORKDIR}/artix-aarch64.tar.xz" \ 9 | "https://armtixlinux.org/images/armtix-runit-${dist_version}.tar.xz" 10 | 11 | sudo rm -rf "${WORKDIR}/artix-aarch64" 12 | sudo mkdir -m 755 "${WORKDIR}/artix-aarch64" 13 | sudo tar -Jxp --acls --xattrs --xattrs-include='*' \ 14 | -f "${WORKDIR}/artix-aarch64.tar.xz" \ 15 | -C "${WORKDIR}/artix-aarch64" 16 | 17 | cat <<- EOF | sudo unshare -mpf bash -e - 18 | rm -f "${WORKDIR}/artix-aarch64/etc/resolv.conf" 19 | echo "nameserver 1.1.1.1" > "${WORKDIR}/artix-aarch64/etc/resolv.conf" 20 | mount --bind "${WORKDIR}/artix-aarch64/" "${WORKDIR}/artix-aarch64/" 21 | mount --bind /dev "${WORKDIR}/artix-aarch64/dev" 22 | mount --bind /proc "${WORKDIR}/artix-aarch64/proc" 23 | mount --bind /sys "${WORKDIR}/artix-aarch64/sys" 24 | chroot "${WORKDIR}/artix-aarch64" pacman -Rnsc --noconfirm linux-aarch64 linux-aarch64-lts linux-firmware 25 | chroot "${WORKDIR}/artix-aarch64" pacman -Syu --noconfirm 26 | EOF 27 | 28 | sudo rm -f "${WORKDIR:?}/artix-aarch64"/var/cache/pacman/pkg/* || true 29 | 30 | archive_rootfs "${ROOTFS_DIR}/artix-aarch64-pd-${CURRENT_VERSION}.tar.xz" \ 31 | "artix-aarch64" 32 | } 33 | 34 | write_plugin() { 35 | cat <<- EOF > "${PLUGIN_DIR}/artix.sh" 36 | # This is a default distribution plug-in. 37 | # Do not modify this file as your changes will be overwritten on next update. 38 | # If you want customize installation, please make a copy. 39 | DISTRO_NAME="Artix Linux" 40 | 41 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/artix-aarch64-pd-${CURRENT_VERSION}.tar.xz" 42 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/artix-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 43 | 44 | distro_setup() { 45 | ${TAB}# Fix environment variables on login or su. 46 | ${TAB}local f 47 | ${TAB}for f in su su-l system-local-login system-remote-login; do 48 | ${TAB}${TAB}echo "session required pam_env.so readenv=1" >> ./etc/pam.d/"\${f}" 49 | ${TAB}done 50 | } 51 | EOF 52 | } 53 | -------------------------------------------------------------------------------- /distro-build/chimera.sh: -------------------------------------------------------------------------------- 1 | dist_name="Chimera Linux" 2 | dist_version="20241204" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/chimera-*.tar.xz 6 | 7 | for arch in aarch64 riscv64 x86_64; do 8 | curl --fail --location \ 9 | --output "${WORKDIR}/chimera-${dist_version}-${arch}.tar.gz" \ 10 | "https://repo.chimera-linux.org/live/${dist_version}/chimera-linux-${arch}-ROOTFS-${dist_version}-bootstrap.tar.gz" 11 | 12 | sudo rm -rf "${WORKDIR}/chimera-$(translate_arch "$arch")" 13 | sudo mkdir -m 755 "${WORKDIR}/chimera-$(translate_arch "$arch")" 14 | sudo tar -zxp --acls --xattrs --xattrs-include='*' \ 15 | -f "${WORKDIR}/chimera-${dist_version}-${arch}.tar.gz" \ 16 | -C "${WORKDIR}/chimera-$(translate_arch "$arch")" 17 | 18 | cat <<- EOF | sudo unshare -mpf bash -e - 19 | rm -f "${WORKDIR}/chimera-$(translate_arch "$arch")/etc/resolv.conf" 20 | echo "nameserver 1.1.1.1" > "${WORKDIR}/chimera-$(translate_arch "$arch")/etc/resolv.conf" 21 | mount --bind /dev "${WORKDIR}/chimera-$(translate_arch "$arch")/dev" 22 | mount --bind /proc "${WORKDIR}/chimera-$(translate_arch "$arch")/proc" 23 | mount --bind /sys "${WORKDIR}/chimera-$(translate_arch "$arch")/sys" 24 | chroot "${WORKDIR}/chimera-$(translate_arch "$arch")" apk upgrade 25 | EOF 26 | 27 | sudo rm -f "${WORKDIR:?}/chimera-$(translate_arch "$arch")"/var/cache/apk/* || true 28 | 29 | archive_rootfs "${ROOTFS_DIR}/chimera-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 30 | "chimera-$(translate_arch "$arch")" 31 | done 32 | } 33 | 34 | write_plugin() { 35 | cat <<- EOF > "${PLUGIN_DIR}/chimera.sh" 36 | # This is a default distribution plug-in. 37 | # Do not modify this file as your changes will be overwritten on next update. 38 | # If you want customize installation, please make a copy. 39 | DISTRO_NAME="Chimera Linux" 40 | DISTRO_COMMENT="Version '${dist_version}'." 41 | 42 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/chimera-aarch64-pd-${CURRENT_VERSION}.tar.xz" 43 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/chimera-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 44 | TARBALL_URL['riscv64']="${GIT_RELEASE_URL}/chimera-riscv64-pd-${CURRENT_VERSION}.tar.xz" 45 | TARBALL_SHA256['riscv64']="$(sha256sum "${ROOTFS_DIR}/chimera-riscv64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 46 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/chimera-x86_64-pd-${CURRENT_VERSION}.tar.xz" 47 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/chimera-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 48 | EOF 49 | } 50 | -------------------------------------------------------------------------------- /distro-build/debian.sh: -------------------------------------------------------------------------------- 1 | dist_name="Debian" 2 | 3 | # Put only current stable version here! 4 | dist_version="bookworm" 5 | 6 | bootstrap_distribution() { 7 | sudo rm -f "${ROOTFS_DIR}"/debian-"${dist_version}"-*.tar.xz 8 | 9 | for arch in arm64 armhf i386 amd64; do 10 | sudo rm -rf "${WORKDIR}/debian-${dist_version}-$(translate_arch "$arch")" 11 | sudo mmdebstrap \ 12 | --architectures=${arch} \ 13 | --variant=minbase \ 14 | --components="main,contrib" \ 15 | --include="ca-certificates,locales" \ 16 | --format=directory \ 17 | "${dist_version}" \ 18 | "${WORKDIR}/debian-${dist_version}-$(translate_arch "$arch")" 19 | archive_rootfs "${ROOTFS_DIR}/debian-${dist_version}-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 20 | "debian-${dist_version}-$(translate_arch "$arch")" 21 | done 22 | unset arch 23 | } 24 | 25 | write_plugin() { 26 | cat <<- EOF > "${PLUGIN_DIR}/debian.sh" 27 | # This is a default distribution plug-in. 28 | # Do not modify this file as your changes will be overwritten on next update. 29 | # If you want customize installation, please make a copy. 30 | DISTRO_NAME="Debian (${dist_version})" 31 | DISTRO_COMMENT="Stable release." 32 | 33 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/debian-${dist_version}-aarch64-pd-${CURRENT_VERSION}.tar.xz" 34 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/debian-${dist_version}-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 35 | TARBALL_URL['arm']="${GIT_RELEASE_URL}/debian-${dist_version}-arm-pd-${CURRENT_VERSION}.tar.xz" 36 | TARBALL_SHA256['arm']="$(sha256sum "${ROOTFS_DIR}/debian-${dist_version}-arm-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 37 | TARBALL_URL['i686']="${GIT_RELEASE_URL}/debian-${dist_version}-i686-pd-${CURRENT_VERSION}.tar.xz" 38 | TARBALL_SHA256['i686']="$(sha256sum "${ROOTFS_DIR}/debian-${dist_version}-i686-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 39 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/debian-${dist_version}-x86_64-pd-${CURRENT_VERSION}.tar.xz" 40 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/debian-${dist_version}-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 41 | 42 | distro_setup() { 43 | ${TAB}# Configure en_US.UTF-8 locale. 44 | ${TAB}sed -i -E 's/#[[:space:]]?(en_US.UTF-8[[:space:]]+UTF-8)/\1/g' ./etc/locale.gen 45 | ${TAB}run_proot_cmd DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales 46 | } 47 | 48 | EOF 49 | } 50 | -------------------------------------------------------------------------------- /distro-build/deepin.sh: -------------------------------------------------------------------------------- 1 | dist_name="deepin" 2 | dist_version="beige" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/deepin-*.tar.xz 6 | 7 | for arch in amd64 arm64; do 8 | sudo rm -rf "${WORKDIR}/deepin-$(translate_arch "$arch")" 9 | sudo mkdir -m 755 "${WORKDIR}/deepin-$(translate_arch "$arch")" 10 | 11 | curl --fail --location \ 12 | --output "${WORKDIR}/deepin-keyring.gpg" \ 13 | "https://github.com/deepin-community/deepin-rootfs/raw/master/deepin.gpg" 14 | 15 | sudo mmdebstrap \ 16 | --hook-dir=/usr/share/mmdebstrap/hooks/merged-usr \ 17 | --keyring "${WORKDIR}/deepin-keyring.gpg" \ 18 | --architectures=${arch} \ 19 | --variant=minbase \ 20 | --components="main,commercial,community" \ 21 | --include="apt,base-files,ca-certificates,passwd,locales-all" \ 22 | --format=directory \ 23 | "${dist_version}" \ 24 | "${WORKDIR}/deepin-$(translate_arch "$arch")" \ 25 | "https://community-packages.deepin.com/${dist_version}/" 26 | 27 | cat <<- EOF | sudo unshare -mpf bash -e - 28 | rm -f "${WORKDIR}"/deepin-$(translate_arch "$arch")/etc/resolv.conf 29 | echo "nameserver 1.1.1.1" > "${WORKDIR}"/deepin-$(translate_arch "$arch")/etc/resolv.conf 30 | echo "en_US.UTF-8 UTF-8" > "${WORKDIR}"/deepin-$(translate_arch "$arch")/etc/locale.gen 31 | #echo "deb https://community-packages.deepin.com/${dist_version}/ ${dist_version} main commercial community" > ${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/sources.list 32 | #echo "deb-src https://community-packages.deepin.com/${dist_version}/ ${dist_version} main commercial community" >> ${WORKDIR}/deepin-$(translate_arch "$arch")/etc/apt/sources.list 33 | mount --bind "${WORKDIR}/deepin-$(translate_arch "$arch")/" "${WORKDIR}/deepin-$(translate_arch "$arch")/" 34 | mount --bind /dev "${WORKDIR}/deepin-$(translate_arch "$arch")/dev" 35 | mount --bind /proc "${WORKDIR}/deepin-$(translate_arch "$arch")/proc" 36 | mount --bind /sys "${WORKDIR}/deepin-$(translate_arch "$arch")/sys" 37 | # configure packages in 2 runs to avoid dependency issues related to base-files and bash. 38 | env DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot "${WORKDIR}/deepin-$(translate_arch "$arch")" dpkg --configure -a || true 39 | env DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot "${WORKDIR}/deepin-$(translate_arch "$arch")" dpkg --configure -a 40 | EOF 41 | 42 | archive_rootfs "${ROOTFS_DIR}/deepin-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 43 | "deepin-$(translate_arch "$arch")" 44 | done 45 | unset arch 46 | } 47 | 48 | write_plugin() { 49 | cat <<- EOF > "${PLUGIN_DIR}/deepin.sh" 50 | # This is a default distribution plug-in. 51 | # Do not modify this file as your changes will be overwritten on next update. 52 | # If you want customize installation, please make a copy. 53 | DISTRO_NAME="deepin" 54 | 55 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/deepin-aarch64-pd-${CURRENT_VERSION}.tar.xz" 56 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/deepin-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 57 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/deepin-x86_64-pd-${CURRENT_VERSION}.tar.xz" 58 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/deepin-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 59 | EOF 60 | } 61 | -------------------------------------------------------------------------------- /distro-build/fedora.sh: -------------------------------------------------------------------------------- 1 | dist_name="Fedora" 2 | dist_version="42-1.1" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/fedora-*.tar.xz 6 | 7 | for arch in aarch64 x86_64; do 8 | curl --fail --location \ 9 | --output "${WORKDIR}/Fedora-Container-Base-Generic.${arch}-${dist_version}.oci.tar.xz" \ 10 | "https://mirror.de.leaseweb.net/fedora/linux/releases/${dist_version%%-*}/Container/${arch}/images/Fedora-Container-Base-Generic-${dist_version}.${arch}.oci.tar.xz" 11 | sudo rm -rf "${WORKDIR}/fedora-tmp" "${WORKDIR}/fedora-$(translate_arch "$arch")" 12 | mkdir "${WORKDIR}/fedora-tmp" 13 | tar -C "${WORKDIR}/fedora-tmp" -Jxf "${WORKDIR}/Fedora-Container-Base-Generic.${arch}-${dist_version}.oci.tar.xz" 14 | oci_manifest=$(jq -r '.manifests[0].digest' "${WORKDIR}/fedora-tmp"/index.json | cut -d ':' -f 2) 15 | oci_layers=$(jq -r '.layers[].digest' "${WORKDIR}/fedora-tmp/blobs/sha256/${oci_manifest}" | cut -d ':' -f 2) 16 | 17 | sudo mkdir -m 755 "${WORKDIR}/fedora-$(translate_arch "$arch")" 18 | for layer in ${oci_layers}; do 19 | sudo tar -zxp --acls --xattrs --xattrs-include='*' \ 20 | -f "${WORKDIR}/fedora-tmp/blobs/sha256/${layer}" \ 21 | -C "${WORKDIR}/fedora-$(translate_arch "$arch")" 22 | done 23 | sudo rm -rf "${WORKDIR}/fedora-tmp" 24 | 25 | cat <<- EOF | sudo unshare -mpf bash -e - 26 | rm -f "${WORKDIR}/fedora-$(translate_arch "$arch")/etc/resolv.conf" 27 | echo "nameserver 1.1.1.1" > "${WORKDIR}/fedora-$(translate_arch "$arch")/etc/resolv.conf" 28 | echo "excludepkgs=*selinux*" >> "${WORKDIR}/fedora-$(translate_arch "$arch")/etc/dnf/dnf.conf" 29 | mount --bind /dev "${WORKDIR}/fedora-$(translate_arch "$arch")/dev" 30 | mount --bind /proc "${WORKDIR}/fedora-$(translate_arch "$arch")/proc" 31 | mount --bind /sys "${WORKDIR}/fedora-$(translate_arch "$arch")/sys" 32 | chroot "${WORKDIR}/fedora-$(translate_arch "$arch")" yum upgrade -y 33 | chroot "${WORKDIR}/fedora-$(translate_arch "$arch")" yum install -y passwd util-linux 34 | chroot "${WORKDIR}/fedora-$(translate_arch "$arch")" yum clean all 35 | chmod 4755 "${WORKDIR}/fedora-$(translate_arch "$arch")"/usr/bin/sudo 36 | EOF 37 | 38 | archive_rootfs "${ROOTFS_DIR}/fedora-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 39 | "fedora-$(translate_arch "$arch")" 40 | done 41 | unset arch 42 | } 43 | 44 | write_plugin() { 45 | cat <<- EOF > "${PLUGIN_DIR}/fedora.sh" 46 | # This is a default distribution plug-in. 47 | # Do not modify this file as your changes will be overwritten on next update. 48 | # If you want customize installation, please make a copy. 49 | DISTRO_NAME="Fedora" 50 | DISTRO_COMMENT="Version ${dist_version%%-*}." 51 | 52 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/fedora-aarch64-pd-${CURRENT_VERSION}.tar.xz" 53 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/fedora-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 54 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/fedora-x86_64-pd-${CURRENT_VERSION}.tar.xz" 55 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/fedora-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 56 | 57 | distro_setup() { 58 | ${TAB}# Fix environment variables on login or su. 59 | ${TAB}run_proot_cmd authselect opt-out 60 | ${TAB}echo "session required pam_env.so readenv=1" >> ./etc/pam.d/system-auth 61 | } 62 | EOF 63 | } 64 | -------------------------------------------------------------------------------- /distro-build/manjaro.sh: -------------------------------------------------------------------------------- 1 | dist_name="Manjaro" 2 | dist_version="20250106" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/manjaro-*.tar.xz 6 | 7 | curl --fail --location \ 8 | --output "${WORKDIR}/manjaro-aarch64.tar.xz" \ 9 | "https://github.com/manjaro-arm/rootfs/releases/download/${dist_version}/Manjaro-ARM-aarch64-latest.tar.gz" 10 | 11 | sudo rm -rf "${WORKDIR}/manjaro-aarch64" 12 | sudo mkdir -m 755 "${WORKDIR}/manjaro-aarch64" 13 | sudo tar -xp --acls --xattrs --xattrs-include='*' \ 14 | -f "${WORKDIR}/manjaro-aarch64.tar.xz" \ 15 | -C "${WORKDIR}/manjaro-aarch64" 16 | 17 | cat <<- EOF | sudo unshare -mpf bash -e - 18 | rm -f "${WORKDIR}/manjaro-aarch64/etc/resolv.conf" 19 | echo "nameserver 1.1.1.1" > "${WORKDIR}/manjaro-aarch64/etc/resolv.conf" 20 | mount --bind "${WORKDIR}/manjaro-aarch64/" "${WORKDIR}/manjaro-aarch64/" 21 | mount --bind /dev "${WORKDIR}/manjaro-aarch64/dev" 22 | mount --bind /proc "${WORKDIR}/manjaro-aarch64/proc" 23 | mount --bind /sys "${WORKDIR}/manjaro-aarch64/sys" 24 | chroot "${WORKDIR}/manjaro-aarch64" pacman-mirrors -a -P http -c poland 25 | chroot "${WORKDIR}/manjaro-aarch64" pacman-key --init 26 | chroot "${WORKDIR}/manjaro-aarch64" pacman-key --populate manjaro 27 | chroot "${WORKDIR}/manjaro-aarch64" pacman-key --populate archlinuxarm 28 | chroot "${WORKDIR}/manjaro-aarch64" pacman -Syu --noconfirm 29 | chroot "${WORKDIR}/manjaro-aarch64" pacman -S --noconfirm util-linux 30 | EOF 31 | 32 | sudo rm -f "${WORKDIR:?}"/manjaro-aarch64/var/cache/pacman/pkg/* || true 33 | 34 | archive_rootfs "${ROOTFS_DIR}/manjaro-aarch64-pd-${CURRENT_VERSION}.tar.xz" \ 35 | "manjaro-aarch64" 36 | } 37 | 38 | write_plugin() { 39 | cat <<- EOF > "${PLUGIN_DIR}/manjaro.sh" 40 | # This is a default distribution plug-in. 41 | # Do not modify this file as your changes will be overwritten on next update. 42 | # If you want customize installation, please make a copy. 43 | DISTRO_NAME="Manjaro" 44 | DISTRO_COMMENT="Manjaro ARM64 port." 45 | 46 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/manjaro-aarch64-pd-${CURRENT_VERSION}.tar.xz" 47 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/manjaro-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 48 | 49 | distro_setup() { 50 | ${TAB}# Fix environment variables on login or su. 51 | ${TAB}local f 52 | ${TAB}for f in su su-l system-local-login system-remote-login; do 53 | ${TAB}${TAB}echo "session required pam_env.so readenv=1" >> ./etc/pam.d/"\${f}" 54 | ${TAB}done 55 | } 56 | EOF 57 | } 58 | -------------------------------------------------------------------------------- /distro-build/opensuse.sh: -------------------------------------------------------------------------------- 1 | dist_name="openSUSE" 2 | 3 | bootstrap_distribution() { 4 | sudo rm -f "${ROOTFS_DIR}"/opensuse-*.tar.xz 5 | 6 | opensuse_manifest=$(docker manifest inspect opensuse/tumbleweed:latest) 7 | for arch in arm64 arm 386 amd64; do 8 | if [ "$arch" = "arm" ]; then 9 | digest=$( 10 | echo "$opensuse_manifest" | \ 11 | jq -r ".manifests[]" | \ 12 | jq -r "select(.platform.architecture == \"${arch}\")" | \ 13 | jq -r "select(.platform.variant == \"v7\")" | \ 14 | jq -r ".digest" 15 | ) 16 | else 17 | digest=$( 18 | echo "$opensuse_manifest" | \ 19 | jq -r ".manifests[]" | \ 20 | jq -r "select(.platform.architecture == \"${arch}\")" | \ 21 | jq -r ".digest" 22 | ) 23 | fi 24 | 25 | docker pull "opensuse/tumbleweed@${digest}" 26 | docker export --output "${WORKDIR}/opensuse-dump-${arch}.tar" \ 27 | $(docker create "opensuse/tumbleweed@${digest}") 28 | 29 | sudo rm -rf "${WORKDIR}/opensuse-$(translate_arch "$arch")" 30 | sudo mkdir -m 755 "${WORKDIR}/opensuse-$(translate_arch "$arch")" 31 | sudo tar -xpf "${WORKDIR}/opensuse-dump-${arch}.tar" \ 32 | -C "${WORKDIR}/opensuse-$(translate_arch "$arch")" 33 | 34 | cat <<- EOF | sudo unshare -mpf bash -e - 35 | rm -f "${WORKDIR}/opensuse-$(translate_arch "$arch")/etc/resolv.conf" 36 | echo "nameserver 1.1.1.1" > "${WORKDIR}/opensuse-$(translate_arch "$arch")/etc/resolv.conf" 37 | sed -i -E 's/^(rpm\.install\.excludedocs)/# \1/g' "${WORKDIR}/opensuse-$(translate_arch "$arch")/etc/zypp/zypp.conf" 38 | mount --bind /dev "${WORKDIR}/opensuse-$(translate_arch "$arch")/dev" 39 | mount --bind /proc "${WORKDIR}/opensuse-$(translate_arch "$arch")/proc" 40 | mount --bind /sys "${WORKDIR}/opensuse-$(translate_arch "$arch")/sys" 41 | chroot "${WORKDIR}/opensuse-$(translate_arch "$arch")" zypper removerepo repo-openh264 42 | chroot "${WORKDIR}/opensuse-$(translate_arch "$arch")" zypper dup --no-confirm 43 | chroot "${WORKDIR}/opensuse-$(translate_arch "$arch")" rpm -qa --qf '%{NAME} ' | xargs -n 1 | grep -Pv '(filesystem|gpg-pubkey)' > /tmp/opensuse-pkgs.txt 44 | cat /tmp/opensuse-pkgs.txt | xargs chroot "${WORKDIR}/opensuse-$(translate_arch "$arch")" zypper install --no-confirm --force 45 | chroot "${WORKDIR}/opensuse-$(translate_arch "$arch")" zypper install --no-confirm util-linux 46 | EOF 47 | sudo rm -f /tmp/opensuse-pkgs.txt 48 | 49 | archive_rootfs "${ROOTFS_DIR}/opensuse-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 50 | "opensuse-$(translate_arch "$arch")" 51 | done 52 | unset opensuse_manifest 53 | } 54 | 55 | write_plugin() { 56 | cat <<- EOF > "${PLUGIN_DIR}/opensuse.sh" 57 | # This is a default distribution plug-in. 58 | # Do not modify this file as your changes will be overwritten on next update. 59 | # If you want customize installation, please make a copy. 60 | DISTRO_NAME="OpenSUSE" 61 | DISTRO_COMMENT="Rolling release (Tumbleweed)." 62 | 63 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/opensuse-aarch64-pd-${CURRENT_VERSION}.tar.xz" 64 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/opensuse-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 65 | TARBALL_URL['arm']="${GIT_RELEASE_URL}/opensuse-arm-pd-${CURRENT_VERSION}.tar.xz" 66 | TARBALL_SHA256['arm']="$(sha256sum "${ROOTFS_DIR}/opensuse-arm-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 67 | TARBALL_URL['i686']="${GIT_RELEASE_URL}/opensuse-i686-pd-${CURRENT_VERSION}.tar.xz" 68 | TARBALL_SHA256['i686']="$(sha256sum "${ROOTFS_DIR}/opensuse-i686-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 69 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/opensuse-x86_64-pd-${CURRENT_VERSION}.tar.xz" 70 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/opensuse-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 71 | 72 | distro_setup() { 73 | ${TAB}# Lock package filesystem to remove issues regarding zypper dup 74 | ${TAB}run_proot_cmd zypper al filesystem 75 | } 76 | EOF 77 | } 78 | -------------------------------------------------------------------------------- /distro-build/pardus.sh: -------------------------------------------------------------------------------- 1 | dist_name="Pardus" 2 | dist_version="yirmiuc" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/pardus-*.tar.xz 6 | 7 | curl -LO https://depo.pardus.org.tr/pardus/pool/main/p/pardus-archive-keyring/pardus-archive-keyring_2021.1_all.deb 8 | sudo dpkg -i pardus-archive-keyring_2021.1_all.deb 9 | rm pardus-archive-keyring_2021.1_all.deb 10 | 11 | for arch in arm64 i386 amd64; do 12 | sudo rm -rf "${WORKDIR}/pardus-$(translate_arch "$arch")" 13 | sudo mmdebstrap \ 14 | --architectures=${arch} \ 15 | --variant=minbase \ 16 | --components="main,contrib,non-free" \ 17 | --include="ca-certificates,libsystemd0,pardus-archive-keyring,systemd-sysv" \ 18 | --format=directory \ 19 | "${dist_version}-deb" \ 20 | "${WORKDIR}/pardus-$(translate_arch "$arch")" \ 21 | "deb http://depo.pardus.org.tr/pardus yirmiuc main contrib non-free non-free-firmware" \ 22 | "deb http://depo.pardus.org.tr/pardus yirmiuc-deb main contrib non-free non-free-firmware" \ 23 | "deb http://depo.pardus.org.tr/guvenlik yirmiuc-deb main contrib non-free non-free-firmware" 24 | archive_rootfs "${ROOTFS_DIR}/pardus-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 25 | "pardus-$(translate_arch "$arch")" 26 | done 27 | unset arch 28 | } 29 | 30 | write_plugin() { 31 | cat <<- EOF > "${PLUGIN_DIR}/pardus.sh" 32 | # This is a default distribution plug-in. 33 | # Do not modify this file as your changes will be overwritten on next update. 34 | # If you want customize installation, please make a copy. 35 | DISTRO_NAME="Pardus" 36 | DISTRO_COMMENT="Version '${dist_version}'." 37 | 38 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/pardus-aarch64-pd-${CURRENT_VERSION}.tar.xz" 39 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/pardus-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 40 | TARBALL_URL['i686']="${GIT_RELEASE_URL}/pardus-i686-pd-${CURRENT_VERSION}.tar.xz" 41 | TARBALL_SHA256['i686']="$(sha256sum "${ROOTFS_DIR}/pardus-i686-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 42 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/pardus-x86_64-pd-${CURRENT_VERSION}.tar.xz" 43 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/pardus-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 44 | EOF 45 | } 46 | -------------------------------------------------------------------------------- /distro-build/rockylinux.sh: -------------------------------------------------------------------------------- 1 | dist_name="Rocky Linux" 2 | dist_version="9.5" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/rocky-*.tar.xz 6 | 7 | for arch in aarch64 x86_64; do 8 | curl --fail --location --output "${WORKDIR}/Rocky-Container-Minimal.${arch}-${dist_version}.tar.xz" "https://download.rockylinux.org/pub/rocky/${dist_version%%.*}/images/${arch}/Rocky-${dist_version%%.*}-Container-Minimal.latest.${arch}.tar.xz" 9 | sudo rm -rf "${WORKDIR}/rocky-tmp" "${WORKDIR}/rocky-$(translate_arch "$arch")" 10 | mkdir "${WORKDIR}/rocky-tmp" 11 | tar -C "${WORKDIR}/rocky-tmp" -Jxf "${WORKDIR}/Rocky-Container-Minimal.${arch}-${dist_version}.tar.xz" --acls --xattrs --xattrs-include='*' 12 | 13 | sudo mkdir -m 755 "${WORKDIR}/rocky-$(translate_arch "$arch")" 14 | sudo mv "${WORKDIR}/rocky-tmp"/* "${WORKDIR}/rocky-$(translate_arch "$arch")" 15 | sudo rm -rf "${WORKDIR}/rocky-tmp" 16 | 17 | cat <<- EOF | sudo unshare -mpf bash -e - 18 | rm -f "${WORKDIR}/rocky-$(translate_arch "$arch")/etc/resolv.conf" 19 | echo "nameserver 1.1.1.1" > "${WORKDIR}/rocky-$(translate_arch "$arch")/etc/resolv.conf" 20 | mount --bind /dev "${WORKDIR}/rocky-$(translate_arch "$arch")/dev" 21 | mount --bind /proc "${WORKDIR}/rocky-$(translate_arch "$arch")/proc" 22 | mount --bind /sys "${WORKDIR}/rocky-$(translate_arch "$arch")/sys" 23 | chroot "${WORKDIR}/rocky-$(translate_arch "$arch")" microdnf upgrade -y 24 | chroot "${WORKDIR}/rocky-$(translate_arch "$arch")" microdnf clean all -y 25 | EOF 26 | 27 | archive_rootfs "${ROOTFS_DIR}/rocky-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" "rocky-$(translate_arch "$arch")" 28 | done 29 | unset arch 30 | } 31 | 32 | write_plugin() { 33 | cat <<- EOF > "${PLUGIN_DIR}/rockylinux.sh" 34 | # This is a default distribution plug-in. 35 | # Do not modify this file as your changes will be overwritten on next update. 36 | # If you want customize installation, please make a copy. 37 | DISTRO_NAME="Rocky Linux" 38 | DISTRO_COMMENT="Version ${dist_version}" 39 | 40 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/rocky-aarch64-pd-${CURRENT_VERSION}.tar.xz" 41 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/rocky-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 42 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/rocky-x86_64-pd-${CURRENT_VERSION}.tar.xz" 43 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/rocky-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 44 | EOF 45 | } 46 | -------------------------------------------------------------------------------- /distro-build/ubuntu.sh: -------------------------------------------------------------------------------- 1 | dist_name="Ubuntu" 2 | 3 | # Must contain current LTS version. 4 | # After changing, update the DISTRO_NAME below. 5 | dist_version="noble" 6 | 7 | bootstrap_distribution() { 8 | sudo rm -f "${ROOTFS_DIR}"/ubuntu-"${dist_version}"-*.tar.xz 9 | 10 | for arch in arm64 armhf amd64; do 11 | sudo rm -rf "${WORKDIR}/ubuntu-${dist_version}-$(translate_arch "$arch")" 12 | sudo mmdebstrap \ 13 | --architectures=${arch} \ 14 | --variant=apt \ 15 | --components="main,universe,multiverse" \ 16 | --include="locales,passwd,software-properties-common" \ 17 | --format=directory \ 18 | "${dist_version}" \ 19 | "${WORKDIR}/ubuntu-${dist_version}-$(translate_arch "$arch")" 20 | archive_rootfs "${ROOTFS_DIR}/ubuntu-${dist_version}-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 21 | "ubuntu-${dist_version}-$(translate_arch "$arch")" 22 | done 23 | unset arch 24 | } 25 | 26 | write_plugin() { 27 | cat <<- EOF > "${PLUGIN_DIR}/ubuntu.sh" 28 | # This is a default distribution plug-in. 29 | # Do not modify this file as your changes will be overwritten on next update. 30 | # If you want customize installation, please make a copy. 31 | DISTRO_NAME="Ubuntu (24.04)" 32 | DISTRO_COMMENT="LTS release (${dist_version})." 33 | 34 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/ubuntu-${dist_version}-aarch64-pd-${CURRENT_VERSION}.tar.xz" 35 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/ubuntu-${dist_version}-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 36 | TARBALL_URL['arm']="${GIT_RELEASE_URL}/ubuntu-${dist_version}-arm-pd-${CURRENT_VERSION}.tar.xz" 37 | TARBALL_SHA256['arm']="$(sha256sum "${ROOTFS_DIR}/ubuntu-${dist_version}-arm-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 38 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/ubuntu-${dist_version}-x86_64-pd-${CURRENT_VERSION}.tar.xz" 39 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/ubuntu-${dist_version}-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 40 | 41 | distro_setup() { 42 | ${TAB}# Configure en_US.UTF-8 locale. 43 | ${TAB}sed -i -E 's/#[[:space:]]?(en_US.UTF-8[[:space:]]+UTF-8)/\1/g' ./etc/locale.gen 44 | ${TAB}run_proot_cmd DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales 45 | 46 | ${TAB}# Configure Firefox PPA. 47 | ${TAB}echo "Configuring PPA repository for Firefox..." 48 | ${TAB}run_proot_cmd add-apt-repository --yes --no-update ppa:mozillateam/firefox-next || true 49 | ${TAB}cat <<- CONFIG_EOF > ./etc/apt/preferences.d/pin-mozilla-ppa 50 | ${TAB}Package: * 51 | ${TAB}Pin: release o=LP-PPA-mozillateam-firefox-next 52 | ${TAB}Pin-Priority: 9999 53 | ${TAB}CONFIG_EOF 54 | 55 | ${TAB}# Configure Thunderbird PPA. 56 | ${TAB}echo "Configuring PPA repository for Thunderbird..." 57 | ${TAB}run_proot_cmd add-apt-repository --yes --no-update ppa:mozillateam/thunderbird-next || true 58 | ${TAB}cat <<- CONFIG_EOF > ./etc/apt/preferences.d/pin-thunderbird-ppa 59 | ${TAB}Package: * 60 | ${TAB}Pin: release o=LP-PPA-mozillateam-thunderbird-next 61 | ${TAB}Pin-Priority: 9999 62 | ${TAB}CONFIG_EOF 63 | } 64 | EOF 65 | } 66 | -------------------------------------------------------------------------------- /distro-build/void.sh: -------------------------------------------------------------------------------- 1 | dist_name="Void Linux" 2 | dist_version="20250202" 3 | 4 | bootstrap_distribution() { 5 | sudo rm -f "${ROOTFS_DIR}"/void-*.tar.xz 6 | 7 | for arch in aarch64 armv7l i686 x86_64; do 8 | curl --fail --location \ 9 | --output "${WORKDIR}/void-${arch}.tar.xz" \ 10 | "https://repo-default.voidlinux.org/live/${dist_version}/void-${arch}-ROOTFS-${dist_version}.tar.xz" 11 | 12 | sudo rm -rf "${WORKDIR}/void-$(translate_arch "$arch")" 13 | sudo mkdir -m 755 "${WORKDIR}/void-$(translate_arch "$arch")" 14 | sudo tar -Jxp --acls --xattrs --xattrs-include='*' \ 15 | -f "${WORKDIR}/void-${arch}.tar.xz" \ 16 | -C "${WORKDIR}/void-$(translate_arch "$arch")" 17 | 18 | cat <<- EOF | sudo unshare -mpf bash -e - 19 | rm -f "${WORKDIR}/void-$(translate_arch "$arch")/etc/resolv.conf" 20 | echo "nameserver 1.1.1.1" > "${WORKDIR}/void-$(translate_arch "$arch")/etc/resolv.conf" 21 | mount --bind /dev "${WORKDIR}/void-$(translate_arch "$arch")/dev" 22 | mount --bind /proc "${WORKDIR}/void-$(translate_arch "$arch")/proc" 23 | mount --bind /sys "${WORKDIR}/void-$(translate_arch "$arch")/sys" 24 | chroot "${WORKDIR}/void-$(translate_arch "$arch")" env SSL_NO_VERIFY_PEER=1 xbps-install -Suy xbps 25 | chroot "${WORKDIR}/void-$(translate_arch "$arch")" env SSL_NO_VERIFY_PEER=1 xbps-install -uy 26 | chroot "${WORKDIR}/void-$(translate_arch "$arch")" env SSL_NO_VERIFY_PEER=1 xbps-install -y base-minimal 27 | #chroot "${WORKDIR}/void-$(translate_arch "$arch")" xbps-remove -y base-voidstrap 28 | chroot "${WORKDIR}/void-$(translate_arch "$arch")" xbps-reconfigure -fa 29 | EOF 30 | 31 | sudo rm -f "${WORKDIR}/void-$(translate_arch "$arch")"/var/cache/xbps/* || true 32 | 33 | archive_rootfs "${ROOTFS_DIR}/void-$(translate_arch "$arch")-pd-${CURRENT_VERSION}.tar.xz" \ 34 | "void-$(translate_arch "$arch")" 35 | done 36 | } 37 | 38 | write_plugin() { 39 | cat <<- EOF > "${PLUGIN_DIR}/void.sh" 40 | # This is a default distribution plug-in. 41 | # Do not modify this file as your changes will be overwritten on next update. 42 | # If you want customize installation, please make a copy. 43 | DISTRO_NAME="Void Linux" 44 | 45 | TARBALL_URL['aarch64']="${GIT_RELEASE_URL}/void-aarch64-pd-${CURRENT_VERSION}.tar.xz" 46 | TARBALL_SHA256['aarch64']="$(sha256sum "${ROOTFS_DIR}/void-aarch64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 47 | TARBALL_URL['arm']="${GIT_RELEASE_URL}/void-arm-pd-${CURRENT_VERSION}.tar.xz" 48 | TARBALL_SHA256['arm']="$(sha256sum "${ROOTFS_DIR}/void-arm-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 49 | TARBALL_URL['i686']="${GIT_RELEASE_URL}/void-i686-pd-${CURRENT_VERSION}.tar.xz" 50 | TARBALL_SHA256['i686']="$(sha256sum "${ROOTFS_DIR}/void-i686-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 51 | TARBALL_URL['x86_64']="${GIT_RELEASE_URL}/void-x86_64-pd-${CURRENT_VERSION}.tar.xz" 52 | TARBALL_SHA256['x86_64']="$(sha256sum "${ROOTFS_DIR}/void-x86_64-pd-${CURRENT_VERSION}.tar.xz" | awk '{ print $1}')" 53 | 54 | distro_setup() { 55 | ${TAB}# Set default shell to bash. 56 | ${TAB}run_proot_cmd usermod --shell /bin/bash root 57 | ${TAB}# Fix issue where come CA certificates links may not be created. 58 | ${TAB}run_proot_cmd update-ca-certificates --fresh 59 | } 60 | EOF 61 | } 62 | -------------------------------------------------------------------------------- /distro-plugins/adelie.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Adélie Linux" 5 | DISTRO_COMMENT="Version '1.0-beta6'." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.19.0/adelie-aarch64-pd-v4.19.0.tar.xz" 8 | TARBALL_SHA256['aarch64']="b573ad9f6a3f6ef72d32a40378aed011ea5828e3f0a99ad9b7b0dabcb9f35028" 9 | TARBALL_URL['arm']="https://github.com/termux/proot-distro/releases/download/v4.19.0/adelie-arm-pd-v4.19.0.tar.xz" 10 | TARBALL_SHA256['arm']="14eefda8e688c54dd824f70a9f3afc11d292247447f6c236751d5afd5f297a9e" 11 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.19.0/adelie-x86_64-pd-v4.19.0.tar.xz" 12 | TARBALL_SHA256['x86_64']="c8a4318992f042c60e691c4fb775bd276a9159834b429104a270e39f6db9708a" 13 | -------------------------------------------------------------------------------- /distro-plugins/alpine.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Alpine Linux" 5 | DISTRO_COMMENT="Rolling release branch (edge)." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.21.0/alpine-aarch64-pd-v4.21.0.tar.xz" 8 | TARBALL_SHA256['aarch64']="140afac5b74f614c2b746bb8e2a312dbb1cc34650b8a5afbfcc424491f32cf4f" 9 | TARBALL_URL['arm']="https://github.com/termux/proot-distro/releases/download/v4.21.0/alpine-arm-pd-v4.21.0.tar.xz" 10 | TARBALL_SHA256['arm']="f6f960f1d6d24c380f2a073c6330639e266d6a8af8cb99727209c75dd5cddc62" 11 | TARBALL_URL['i686']="https://github.com/termux/proot-distro/releases/download/v4.21.0/alpine-i686-pd-v4.21.0.tar.xz" 12 | TARBALL_SHA256['i686']="3a0a76fc47770d8f656c45a4c76b8d36699baf2725eca6bcb732eff290dbf143" 13 | TARBALL_URL['riscv64']="https://github.com/termux/proot-distro/releases/download/v4.21.0/alpine-riscv64-pd-v4.21.0.tar.xz" 14 | TARBALL_SHA256['riscv64']="9ff51ce75cd840bf28f8b4b6123f96636f1876296a061efa3cd86cbb8c66c61a" 15 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.21.0/alpine-x86_64-pd-v4.21.0.tar.xz" 16 | TARBALL_SHA256['x86_64']="96c0b87a490edee795c3175d46d336cd9194cbf9609b57cc73c6c0bdd5375fb1" 17 | -------------------------------------------------------------------------------- /distro-plugins/archlinux.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Arch Linux" 5 | DISTRO_COMMENT="ARM(64) devices use Arch Linux ARM, i686 uses Arch Linux 32. Both are independent projects. The original Arch usable only by x86_64 devices." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.22.1/archlinux-aarch64-pd-v4.22.1.tar.xz" 8 | TARBALL_SHA256['aarch64']="b7e4cfb1414a281f90bfd39a503f72f38e03c31b356927972f797988fb48b5b1" 9 | TARBALL_URL['arm']="https://github.com/termux/proot-distro/releases/download/v4.22.1/archlinux-arm-pd-v4.22.1.tar.xz" 10 | TARBALL_SHA256['arm']="25ccafc3234bc9e0cd37ea240a4b6ec349464e88cf22e9db0d11a9f1a927d336" 11 | TARBALL_URL['i686']="https://github.com/termux/proot-distro/releases/download/v4.22.1/archlinux-i686-pd-v4.22.1.tar.xz" 12 | TARBALL_SHA256['i686']="eb9221cfb51b1f39da958b7a7ea6ea7ddfa66297d0cded18bb14591502a9d151" 13 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.22.1/archlinux-x86_64-pd-v4.22.1.tar.xz" 14 | TARBALL_SHA256['x86_64']="a0cf76c31c79e260766dee80657bd7683fa30dafe900952018264462c1728e17" 15 | 16 | distro_setup() { 17 | # Fix environment variables on login or su. 18 | local f 19 | for f in su su-l system-local-login system-remote-login; do 20 | echo "session required pam_env.so readenv=1" >> ./etc/pam.d/"${f}" 21 | done 22 | 23 | # Configure en_US.UTF-8 locale. 24 | sed -i -E 's/#[[:space:]]?(en_US.UTF-8[[:space:]]+UTF-8)/\1/g' ./etc/locale.gen 25 | run_proot_cmd locale-gen 26 | } 27 | -------------------------------------------------------------------------------- /distro-plugins/artix.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Artix Linux" 5 | 6 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.6.0/artix-aarch64-pd-v4.6.0.tar.xz" 7 | TARBALL_SHA256['aarch64']="7963559a4e7f610d80823cce60743704fae61a8fce42d2b86601ae3dd28ce292" 8 | 9 | distro_setup() { 10 | # Fix environment variables on login or su. 11 | local f 12 | for f in su su-l system-local-login system-remote-login; do 13 | echo "session required pam_env.so readenv=1" >> ./etc/pam.d/"${f}" 14 | done 15 | } 16 | -------------------------------------------------------------------------------- /distro-plugins/chimera.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Chimera Linux" 5 | DISTRO_COMMENT="Version '20241204'." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.17.3/chimera-aarch64-pd-v4.17.3.tar.xz" 8 | TARBALL_SHA256['aarch64']="e0fdd16e9e941db33179e15e0f28994a364dbca6f8e3b65ec037e24b9480aa84" 9 | TARBALL_URL['riscv64']="https://github.com/termux/proot-distro/releases/download/v4.17.3/chimera-riscv64-pd-v4.17.3.tar.xz" 10 | TARBALL_SHA256['riscv64']="2664534b873cd3072a5432251619e90b866ec4c96325ea6494c7aca396b4d97e" 11 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.17.3/chimera-x86_64-pd-v4.17.3.tar.xz" 12 | TARBALL_SHA256['x86_64']="e3f97eeea9f40084301ea0c6cdb666685173e1efaa4fabd4ba74b0d4ad37d83a" 13 | -------------------------------------------------------------------------------- /distro-plugins/debian.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Debian (bookworm)" 5 | DISTRO_COMMENT="Stable release." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.17.3/debian-bookworm-aarch64-pd-v4.17.3.tar.xz" 8 | TARBALL_SHA256['aarch64']="3a841a794ae5999b33e33b329582ed0379d4f54ca62c6ce5a8eb9cff5ef8900b" 9 | TARBALL_URL['arm']="https://github.com/termux/proot-distro/releases/download/v4.17.3/debian-bookworm-arm-pd-v4.17.3.tar.xz" 10 | TARBALL_SHA256['arm']="85861ab139d4042302796cf46a93a9efbcb4808c06f7a1ae5fb71812f4564424" 11 | TARBALL_URL['i686']="https://github.com/termux/proot-distro/releases/download/v4.17.3/debian-bookworm-i686-pd-v4.17.3.tar.xz" 12 | TARBALL_SHA256['i686']="1fb3a6b0ea679e3797b35984049abf22bfe3b6ab79e9bb98cdfc54994712e1e4" 13 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.17.3/debian-bookworm-x86_64-pd-v4.17.3.tar.xz" 14 | TARBALL_SHA256['x86_64']="675e534333adcbf369e97abda3088927651e5d91612ae5727c52ff2284f4b8c8" 15 | 16 | distro_setup() { 17 | # Configure en_US.UTF-8 locale. 18 | sed -i -E 's/#[[:space:]]?(en_US.UTF-8[[:space:]]+UTF-8)/\1/g' ./etc/locale.gen 19 | run_proot_cmd DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales 20 | } 21 | 22 | -------------------------------------------------------------------------------- /distro-plugins/deepin.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="deepin" 5 | 6 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.16.0/deepin-aarch64-pd-v4.16.0.tar.xz" 7 | TARBALL_SHA256['aarch64']="620eb208b75fe13705da3a2ef4bbb71eedae0ce90ad7fdca3566eba361c8d5f6" 8 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.16.0/deepin-x86_64-pd-v4.16.0.tar.xz" 9 | TARBALL_SHA256['x86_64']="fb96f654a4d5779bcf3b02f595d4e3480f02a9a7e6746ba87bba29238cf738b1" 10 | -------------------------------------------------------------------------------- /distro-plugins/distro.sh.sample: -------------------------------------------------------------------------------- 1 | # Do not modify this file. All changes will be discarded on the next 2 | # package update. 3 | 4 | # Default value is set by proot-distro script and is equal to the CPU 5 | # architecture of your device. You can set this to a custom value to 6 | # force use emulation mode (QEMU user). 7 | # Valid values are: aarch64, arm, i686, x86_64. 8 | #DISTRO_ARCH=aarch64 9 | 10 | # Name of distribution. 11 | DISTRO_NAME="Example" 12 | 13 | # Optional comment for distribution. 14 | DISTRO_COMMENT="An introduction to proot-distro plug-ins." 15 | 16 | # How much path components should be stripped when extracting rootfs tarball. 17 | # The default is "1" which means to omit the root component. 18 | TARBALL_STRIP_OPT=1 19 | 20 | # TARBALL_URL is a Bash associative array containing rootfs URLs for specified 21 | # CPU architectures. You must specify at least one. 22 | TARBALL_URL['aarch64']="https://example.com/archive.tar.gz" 23 | 24 | # SHA-256 checksum for the given tarball. You must specify checksum for each 25 | # defined tarball. 26 | TARBALL_SHA256['aarch64']="0000000000000000000000000000000000000000000000000000000000000000" 27 | 28 | # This function defines any additional steps that should be executed during 29 | # installation. You can use "run_proot_cmd" to execute a given command in 30 | # proot environment. 31 | distro_setup() { 32 | run_proot_cmd touch /etc/hello-world 33 | } 34 | -------------------------------------------------------------------------------- /distro-plugins/fedora.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Fedora" 5 | DISTRO_COMMENT="Version 42." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.24.0/fedora-aarch64-pd-v4.24.0.tar.xz" 8 | TARBALL_SHA256['aarch64']="48abf1d8b9cc7625d4212cc604ce3c113ea6d6d806de60b2c3f74c5b5452cd72" 9 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.24.0/fedora-x86_64-pd-v4.24.0.tar.xz" 10 | TARBALL_SHA256['x86_64']="105ffd9a7d989ac09ee3adb7c4f00b72a3cc997c1e3fd99599bf16578dd8e20c" 11 | 12 | distro_setup() { 13 | # Fix environment variables on login or su. 14 | run_proot_cmd authselect opt-out 15 | echo "session required pam_env.so readenv=1" >> ./etc/pam.d/system-auth 16 | } 17 | -------------------------------------------------------------------------------- /distro-plugins/manjaro.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Manjaro" 5 | DISTRO_COMMENT="Manjaro ARM64 port." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.18.0/manjaro-aarch64-pd-v4.18.0.tar.xz" 8 | TARBALL_SHA256['aarch64']="f0aa5f70a4ccfe00f658bf9adc4a18d8332e894591839adb990d913c9aa604b9" 9 | 10 | distro_setup() { 11 | # Fix environment variables on login or su. 12 | local f 13 | for f in su su-l system-local-login system-remote-login; do 14 | echo "session required pam_env.so readenv=1" >> ./etc/pam.d/"${f}" 15 | done 16 | } 17 | -------------------------------------------------------------------------------- /distro-plugins/opensuse.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="OpenSUSE" 5 | DISTRO_COMMENT="Rolling release (Tumbleweed)." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.21.0/opensuse-aarch64-pd-v4.21.0.tar.xz" 8 | TARBALL_SHA256['aarch64']="23cdd0ba0f85e261da2560e3fcf7ac19cd1bcf7afdc2144b694ea9229058fa2a" 9 | TARBALL_URL['arm']="https://github.com/termux/proot-distro/releases/download/v4.21.0/opensuse-arm-pd-v4.21.0.tar.xz" 10 | TARBALL_SHA256['arm']="a02caa5a17fd90399d5864772eb1317727abe0ffe5b088cf496e496e0f33fc76" 11 | TARBALL_URL['i686']="https://github.com/termux/proot-distro/releases/download/v4.21.0/opensuse-i686-pd-v4.21.0.tar.xz" 12 | TARBALL_SHA256['i686']="e7e2f24928bd44dd270cd503257697517b1284ae57ea18aa5a6f66cd1857d5fa" 13 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.21.0/opensuse-x86_64-pd-v4.21.0.tar.xz" 14 | TARBALL_SHA256['x86_64']="cfb70fe5acd74928f5573a59ac038eff91f1bd4c6a95cc00e69424e6f3ae89b3" 15 | 16 | distro_setup() { 17 | # Lock package filesystem to remove issues regarding zypper dup 18 | run_proot_cmd zypper al filesystem 19 | } 20 | -------------------------------------------------------------------------------- /distro-plugins/pardus.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Pardus" 5 | DISTRO_COMMENT="Version 'yirmiuc'." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.18.0/pardus-aarch64-pd-v4.18.0.tar.xz" 8 | TARBALL_SHA256['aarch64']="b4dccbb4a3f8263fdbae45a73c685bf27d9ab2819f17d4939c9988f759f88d3b" 9 | TARBALL_URL['i686']="https://github.com/termux/proot-distro/releases/download/v4.18.0/pardus-i686-pd-v4.18.0.tar.xz" 10 | TARBALL_SHA256['i686']="271fd6b6e80f840566bbf5dda0fca5f4d35b24e5c679d895bc4c35422c8bee06" 11 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.18.0/pardus-x86_64-pd-v4.18.0.tar.xz" 12 | TARBALL_SHA256['x86_64']="05fb46e45501d983774171c98423d46ae2f1a191332ba1b83eb33a99a5a828e2" 13 | -------------------------------------------------------------------------------- /distro-plugins/rockylinux.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Rocky Linux" 5 | DISTRO_COMMENT="Version 9.5" 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.20.0/rocky-aarch64-pd-v4.20.0.tar.xz" 8 | TARBALL_SHA256['aarch64']="687ba6987186e34db6330edba13f419c0afe3fea602cd9ce7a6a5dafa423740c" 9 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.20.0/rocky-x86_64-pd-v4.20.0.tar.xz" 10 | TARBALL_SHA256['x86_64']="b3fc30dd204f893cec3871d2077d3ac03eaf6504f803a298baba1b4bb23481a1" 11 | -------------------------------------------------------------------------------- /distro-plugins/ubuntu.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Ubuntu (24.04)" 5 | DISTRO_COMMENT="LTS release (noble)." 6 | 7 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.18.0/ubuntu-noble-aarch64-pd-v4.18.0.tar.xz" 8 | TARBALL_SHA256['aarch64']="91acaa786b8e2fbba56a9fd0f8a1188cee482b5c7baeed707b29ddaa9a294daa" 9 | TARBALL_URL['arm']="https://github.com/termux/proot-distro/releases/download/v4.18.0/ubuntu-noble-arm-pd-v4.18.0.tar.xz" 10 | TARBALL_SHA256['arm']="2afb7e1ff17983fa2cf4c57edeea6be427ffb0359d8628b24a147b4c8aa276d5" 11 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.18.0/ubuntu-noble-x86_64-pd-v4.18.0.tar.xz" 12 | TARBALL_SHA256['x86_64']="3a769bce23985effb504140d43b6ddd73dac9e261d1932894afa31de81e45414" 13 | 14 | distro_setup() { 15 | # Configure en_US.UTF-8 locale. 16 | sed -i -E 's/#[[:space:]]?(en_US.UTF-8[[:space:]]+UTF-8)/\1/g' ./etc/locale.gen 17 | run_proot_cmd DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales 18 | 19 | # Configure Firefox PPA. 20 | echo "Configuring PPA repository for Firefox..." 21 | run_proot_cmd add-apt-repository --yes --no-update ppa:mozillateam/firefox-next || true 22 | cat <<- CONFIG_EOF > ./etc/apt/preferences.d/pin-mozilla-ppa 23 | Package: * 24 | Pin: release o=LP-PPA-mozillateam-firefox-next 25 | Pin-Priority: 9999 26 | CONFIG_EOF 27 | 28 | # Configure Thunderbird PPA. 29 | echo "Configuring PPA repository for Thunderbird..." 30 | run_proot_cmd add-apt-repository --yes --no-update ppa:mozillateam/thunderbird-next || true 31 | cat <<- CONFIG_EOF > ./etc/apt/preferences.d/pin-thunderbird-ppa 32 | Package: * 33 | Pin: release o=LP-PPA-mozillateam-thunderbird-next 34 | Pin-Priority: 9999 35 | CONFIG_EOF 36 | } 37 | -------------------------------------------------------------------------------- /distro-plugins/void.sh: -------------------------------------------------------------------------------- 1 | # This is a default distribution plug-in. 2 | # Do not modify this file as your changes will be overwritten on next update. 3 | # If you want customize installation, please make a copy. 4 | DISTRO_NAME="Void Linux" 5 | 6 | TARBALL_URL['aarch64']="https://github.com/termux/proot-distro/releases/download/v4.22.1/void-aarch64-pd-v4.22.1.tar.xz" 7 | TARBALL_SHA256['aarch64']="4430ed51e4c68252ee968c6ea19b1e00333ee9e77f1bda690901632b76322139" 8 | TARBALL_URL['arm']="https://github.com/termux/proot-distro/releases/download/v4.22.1/void-arm-pd-v4.22.1.tar.xz" 9 | TARBALL_SHA256['arm']="03c3b23d44c5c1f913c00e28204c4566a83dbf451db4d91cfb14f366950f99c8" 10 | TARBALL_URL['i686']="https://github.com/termux/proot-distro/releases/download/v4.22.1/void-i686-pd-v4.22.1.tar.xz" 11 | TARBALL_SHA256['i686']="69903dd6ea907a17a3be43ef8163d8146227c557919058b9b014102a857f8dfa" 12 | TARBALL_URL['x86_64']="https://github.com/termux/proot-distro/releases/download/v4.22.1/void-x86_64-pd-v4.22.1.tar.xz" 13 | TARBALL_SHA256['x86_64']="c84e1927c584c7fa1f12662e572f6d1e2c653a4cb712faa1aaddc8e37ed46708" 14 | 15 | distro_setup() { 16 | # Set default shell to bash. 17 | run_proot_cmd usermod --shell /bin/bash root 18 | # Fix issue where come CA certificates links may not be created. 19 | run_proot_cmd update-ca-certificates --fresh 20 | } 21 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | : "${TERMUX_APP_PACKAGE:="com.termux"}" 4 | : "${TERMUX_PREFIX:="/data/data/${TERMUX_APP_PACKAGE}/files/usr"}" 5 | : "${TERMUX_ANDROID_HOME:="/data/data/${TERMUX_APP_PACKAGE}/files/home"}" 6 | 7 | echo "Installing $TERMUX_PREFIX/bin/proot-distro" 8 | install -d -m 700 "$TERMUX_PREFIX"/bin 9 | sed -e "s|@TERMUX_APP_PACKAGE@|$TERMUX_APP_PACKAGE|g" \ 10 | -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" \ 11 | -e "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|g" \ 12 | ./proot-distro.sh > "$TERMUX_PREFIX"/bin/proot-distro 13 | chmod 700 "$TERMUX_PREFIX"/bin/proot-distro 14 | 15 | echo "Symlinking $TERMUX_PREFIX/bin/proot-distro --> $TERMUX_PREFIX/bin/pd" 16 | ln -sfr "$TERMUX_PREFIX"/bin/proot-distro "$TERMUX_PREFIX"/bin/pd 17 | 18 | install -d -m 700 "$TERMUX_PREFIX"/etc/proot-distro 19 | for script in ./distro-plugins/*.sh*; do 20 | echo "Installing $TERMUX_PREFIX/etc/proot-distro/$(basename "$script")" 21 | install -Dm600 -t "$TERMUX_PREFIX"/etc/proot-distro/ "$script" 22 | done 23 | 24 | echo "Installing $TERMUX_PREFIX/share/bash-completion/completions/proot-distro" 25 | install -d -m 700 "$TERMUX_PREFIX"/share/bash-completion/completions 26 | sed -e "s|@TERMUX_APP_PACKAGE@|$TERMUX_APP_PACKAGE|g" \ 27 | -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" \ 28 | -e "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|g" \ 29 | ./completions/proot-distro.bash > "$TERMUX_PREFIX"/share/bash-completion/completions/proot-distro 30 | 31 | echo "Symlinking $TERMUX_PREFIX/share/bash-completion/completions/proot-distro --> $TERMUX_PREFIX/share/bash-completion/completions/pd" 32 | ln -sfr "$TERMUX_PREFIX"/share/bash-completion/completions/proot-distro "$TERMUX_PREFIX"/share/bash-completion/completions/pd 33 | 34 | echo "Installing $TERMUX_PREFIX/share/fish/vendor_completions.d/proot-distro.fish" 35 | install -d -m 700 "$TERMUX_PREFIX"/share/fish/vendor_completions.d 36 | sed -e "s|@TERMUX_APP_PACKAGE@|$TERMUX_APP_PACKAGE|g" \ 37 | -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" \ 38 | -e "s|@TERMUX_HOME@|$TERMUX_ANDROID_HOME|g" \ 39 | ./completions/proot-distro.fish > "$TERMUX_PREFIX"/share/fish/vendor_completions.d/proot-distro.fish 40 | 41 | echo "Installing $TERMUX_PREFIX/share/fish/vendor_completions.d/pd.fish" 42 | cat << EOF > "$TERMUX_PREFIX"/share/fish/vendor_completions.d/pd.fish 43 | # Completions for proot-distro 44 | # https://github.com/termux/proot-distro 45 | 46 | complete -c pd -w proot-distro 47 | EOF 48 | 49 | echo "Installing $TERMUX_PREFIX/share/doc/proot-distro/README.md" 50 | install -Dm600 README.md "$TERMUX_PREFIX"/share/doc/proot-distro/README.md 51 | --------------------------------------------------------------------------------