├── .conf
└── VERSIONID
├── .github
├── FUNDING.yml
└── workflows
│ ├── greetings.yml
│ ├── label.yml
│ └── stale.yml
├── .gitmodules
├── .gitpod.Dockerfile
├── .gitpod.yml
├── 404.md
├── CHANGE.log
├── CONTRIBUTORS.md
├── LICENSE
├── NOTICE.md
├── README.md
├── _config.yml
├── archlinuxconfig.bash
├── espritfunctions.bash
├── fbindsfunctions.bash
├── getimagefunctions.bash
├── initkeyfunctions.bash
├── knownconfigurations.bash
├── maintenanceroutines.bash
├── necessaryfunctions.bash
├── printoutstatements.bash
├── pullTermuxArchMods.bash
├── robots.txt
├── setupTermuxArch
├── setupTermuxArch.bash
├── setupTermuxArch.sh
├── setupTermuxArch.sha512
├── setupTermuxArch.tar.gz
├── sha512.sum
├── sitemap.txt
├── taprootuserland.bash
└── taqemualpinex86.bash
/.conf/VERSIONID:
--------------------------------------------------------------------------------
1 | 2.0.549
2 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | custom: https://paypal.me/SDRausty
2 |
--------------------------------------------------------------------------------
/.github/workflows/greetings.yml:
--------------------------------------------------------------------------------
1 | name: Greetings
2 |
3 | on: [pull_request, issues]
4 |
5 | jobs:
6 | greeting:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/first-interaction@v1
10 | with:
11 | repo-token: ${{ secrets.GITHUB_TOKEN }}
12 | issue-message: 'Thank you for contributing to make this project better😎 Please keep up and follow to solve this issue.'
13 | pr-message: 'Thank you for contributing to make this project better🎉'
14 |
--------------------------------------------------------------------------------
/.github/workflows/label.yml:
--------------------------------------------------------------------------------
1 | # This workflow will triage pull requests and apply a label based on the
2 | # paths that are modified in the pull request.
3 | #
4 | # To use this workflow, you will need to set up a .github/labeler.yml
5 | # file with configuration. For more information, see:
6 | # https://github.com/actions/labeler/blob/master/README.md
7 |
8 | name: Labeler
9 | on: [pull_request]
10 |
11 | jobs:
12 | label:
13 |
14 | runs-on: ubuntu-latest
15 |
16 | steps:
17 | - uses: actions/labeler@v4
18 | with:
19 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
20 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | name: Mark stale issues and pull requests
2 |
3 | on:
4 | schedule:
5 | - cron: "0 0 * * *"
6 |
7 | jobs:
8 | stale:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/stale@v1
14 | with:
15 | repo-token: ${{ secrets.GITHUB_TOKEN }}
16 | stale-issue-message: 'Stale issue message'
17 | stale-pr-message: 'Stale pull request message'
18 | stale-issue-label: 'no-issue-activity'
19 | stale-pr-label: 'no-pr-activity'
20 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "docs"]
2 | path = docs
3 | url = https://github.com/TermuxArch/docsTermuxArch
4 | [submodule "gen"]
5 | path = gen
6 | url = https://github.com/TermuxArch/genTermuxArch
7 | [submodule "scripts"]
8 | path = scripts
9 | url = https://github.com/TermuxArch/scripts.TermuxArch
10 | [submodule ".scripts/maintenance"]
11 | path = .scripts/maintenance
12 | url = https://github.com/shlibs/maintenance
13 |
--------------------------------------------------------------------------------
/.gitpod.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM gitpod/workspace-full-vnc
2 |
3 | USER gitpod
4 |
5 | # Install custom tools, runtime, etc. using apt-get
6 | # For example, the command below would install "bastet" - a command line tetris clone:
7 | #
8 | # RUN sudo apt-get -q update && # sudo apt-get install -yq bastet && # sudo rm -rf /var/lib/apt/lists/*
9 | #
10 | # More information: https://www.gitpod.io/docs/42_config_docker/
11 |
--------------------------------------------------------------------------------
/.gitpod.yml:
--------------------------------------------------------------------------------
1 | { image: { file: .gitpod.Dockerfile } }
2 |
--------------------------------------------------------------------------------
/404.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | permalink: /404.html
4 | title: "sdrausty.github.io 404 Page"
5 | ---
6 |
7 | You found the 404 page. Wow. Hopefully what you are looking for is right here!
8 |
9 | 👉 [Build APKs in Termux](../buildAPKs)
10 | 👉 [GitHub and Git Foundations](../pages/ggf)
11 | 👉 [How to Automate Git Processes.](../pages/htgp)
12 | 👉 [Is Your Smartphone Your Computer?](../pages/ysyc)
13 | 👉 [Main Page](./index)
14 | 👉 [Sitemap](../sitemap)
15 | 👉 [Termux IRC Chat Log](../logs/ircFreenodeTermuxWeechatlog)
16 | 👉 [TermuxArch](../TermuxArch)
17 | 👉 [TeX in Termux](../pages/tit)
18 | 👉 [What Do You Do with Termux?](../pages/tf)
19 | 👉 [au](../au)
20 | 👉 [repo](../repo)
21 |
22 | If what you are seeking is not here, please try these [repositories](https://github.com/sdrausty?tab=repositories) at Github.
23 |
24 | #### You can do [much more](https://sdrausty.github.io/pages/more.html) onDevice!
25 |
26 | #### When you press and momentarily hold the `volumeDown+power` buttons simultaneously on a smartphone, it takes a screenshot much like this one which shows the screen and the the source code for this page in [vim](http://www.vim.org/git.php) running on [Termux](https://sdrausty.github.io/pages/asac.html) on [Android.](https://source.android.com/)
27 |
28 | 
29 |
30 | #### This animation was created with [imagemagick](https://sdrausty.github.io/pages/im.html) in [Termux](https://sdrausty.github.io/pages/asac.html) on an Android smartphone.
31 |
32 | 
33 |
34 | If you're confused by this page try [this link,](http://tldp.org/) or you might want to try [this one.](https://www.debian.org/doc/) Post your what you have found at [the wiki,](https://github.com/sdrausty/sdrausty.github.io/wiki) [donate](https://sdrausty.github.io/pages/donate.md) and help [this website grow!](https://sdrausty.github.io/)
35 |
--------------------------------------------------------------------------------
/CHANGE.log:
--------------------------------------------------------------------------------
1 | Begin changelog.
2 | Sat Dec 9 2017
3 | 1.9M TermuxArch/
4 | 1.6M TermuxArch/.git
5 | Wed Jan 10 2018
6 | 4.9M TermuxArch/
7 | 4.5M TermuxArch/.git
8 | Computed on 20180117 branch master.
9 | 1.2M .git
10 | 1.9M .
11 | Computed on 20180129 branch master.
12 | 8.8M .git
13 | 11M .
14 | Computed on 20180204 branch master.
15 | 14M .git
16 | 16M .
17 | Computed on 20180719 branch master.
18 | 32.8M .git
19 | 38.5M .
20 | Computed on 20180919 branch master.
21 | 90.7M .git
22 | 96.2M .
23 | Computed on 20180919 branch master.
24 | 3.2M .git
25 | 8.7M .
26 | Computed on 20180920 branch master.
27 | 556.0K .git
28 | 808.0K .
29 | Computed on 20180920 branch master.
30 | 4.0M .git
31 | 11.3M .
32 | Computed on 20190603 branch master.
33 | Size in KB
34 | 3776 .git
35 | 4044 .
36 | Computed on 20190603 branch master.
37 | Size in KB
38 | 3780 .git
39 | 4048 .
40 | RESET: size
41 | Size in KB
42 | 388 .git
43 | 656 .
44 | Computed on 20190611 branch master.
45 | Size in KB
46 | 692 .git
47 | 1044 .
48 |
--------------------------------------------------------------------------------
/CONTRIBUTORS.md:
--------------------------------------------------------------------------------
1 | ##### -r--r--r-- [archsystemconfigs.sh](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/archlinuxconfig.sh)
2 |
3 | ##### -r--r--r-- [espritfunctions.sh](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/espritfunctions.sh)
4 |
5 | ##### -r--r--r-- [getimagefunctions.sh](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/getimagefunctions.sh)
6 |
7 | ##### -r--r--r-- [knownconfigurations.sh](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/knownconfigurations.sh)
8 |
9 | ##### -r--r--r-- [necessaryfunctions.sh](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/necessaryfunctions.sh)
10 |
11 | ##### -r--r--r-- [printoutstatements.sh](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/printoutstatements.sh)
12 |
13 | ##### -r--r--r-- [setupTermuxArch.sh](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/setupTermuxArch.sh)
14 |
15 | ##### -rw-rw-rw- [setupTermuxArch.tar.gz](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/setupTermuxArch.tar.gz)
16 |
17 | ##### -r--r--r-- [systemmaintenance.sh](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/maintenanceroutines.sh)
18 |
19 | ## Contributions have helped in the successful development of this script and project immensely. The following contributors have helped to refine [setupTermuxArch.sh](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/setupTermuxArch.tar.gz) 📲 __Thank you for contributing and collaborating!__
20 |
21 | [](https://gitter.im/termux) Termux developers welcome.
22 |
23 | #### Android smartphone screenshot 2018
24 | [](https://sdrausty.github.io/TermuxArch/docs/install)
25 |
26 | [AccountsDept](https://github.com/accountsdept) submitted issue [#49](https://github.com/sdrausty/TermuxArch/issues/49), "Every Mirror Returning 404". Result: TermuxArch instructions improved!
27 |
28 | [abicorios](https://github.com/abicorios) opened issue [#27](https://github.com/sdrausty/TermuxArch/issues/27), How to use Xorg in TermuxArch? Contributed important XServer XSDL information. Made [#95](https://github.com/sdrausty/TermuxArch/pull/95) that enchanced rapid code streamlining from newly arisen keyring errors that, at times, uninstalled entire Arch Linux in Termux PRoot installations.
29 |
30 | [BearChavez](https://github.com/BearChavez) submitted an issue. Result: TermuxArch improved!
31 |
32 | [Ben Shaji](https://github.com/bensh4) composed [#94]( https://github.com/sdrausty/TermuxArch/issues/94) that enchanced rapid code streamlining from newly arisen keyring errors that, at times, uninstalled entire Arch Linux in Termux PRoot installations.
33 |
34 | [FreshMosh](https://github.com/FreshMosh) supplied [#94]( https://github.com/sdrausty/TermuxArch/issues/94) including information that resolved newly arisen keyring errors manually that, at times, uninstalled entire Arch Linux in Termux PRoot installations.
35 |
36 | [brysgo](https://github.com/brysgo) helped debug Chromebook. Result: TermuxArch improved!
37 |
38 | [Codimiracle](https://github.com/Codimiracle) submitted and discussed issue [#46](https://github.com/sdrausty/TermuxArch/issues/46), "TermuxArch setup scripts has some error in Android x86_64(RemixOS 2.0.513) in Termux" and suggested solutions resolving this matter. Result: TermuxArch improved!
39 |
40 | [cb125](https://github.com/cb125) commented and contributed: `watch cat /proc/sys/kernel/random/entropy_avail` to resolve `pacman-key --populate archlinux` in issue #33. Result: addwe () created and TermuxArch improved!
41 |
42 | [cherryleafroad](https://github.com/cherryleafroad) opened and discussed issue [Ability for Scripts to Launch Commands for Arch Linux in Termux PRoot on Device #54](https://github.com/sdrausty/TermuxArch/issues/54) Result: TermuxArch improved, option `setupTermuxArch.sh refresh` added, user login and command options introduced to `startarch`! Opened and presented issue [Hush motd on login when using -c command #58](https://github.com/sdrausty/TermuxArch/issues/58) Result: TermuxArch improved!
43 |
44 | [cswl](https://github.com/cswl) suggested, "I dont have time to tinker around with TermuxArch... but could we make an stub package for linux-aarch64 and linux-firmware... since we're just using proot... I dont think we'd need the kernel and firmware... wasting space" Result: addtrim () created and TermuxArch improved!
45 |
46 | [Jezwin](https://github.com/Jezwin) submitted an issue. Result: TermuxArch improved!
47 |
48 | [David xu](https://github.com/xqdoo00o) contributed [Shared: NO such file or directory! #61](https://github.com/sdrausty/TermuxArch/issues/61). Result: TermuxArch improved!
49 |
50 | [developer787](https://github.com/developer787) submitted an issue. Result: TermuxArch improved!
51 |
52 | [EsdrasTarsis](https://github.com/EsdrasTarsis) contributed insightful comments regarding `pacman-key` https://github.com/sdrausty/TermuxArch/issues/28 Result: TermuxArch improved!
53 |
54 | [emoryy](https://github.com/emoryy) submitted https://github.com/sdrausty/TermuxArch/issues/64 Result cleanliness in git repository added: TermuxArch improved!
55 |
56 | [evg-zhabotinsky](https://github.com/evg-zhabotinsky) Contributed standard output terminal benchmark information. Result: `stdoutbench.sh` created.
57 |
58 | [fornwall](https://github.com/fornwall) contributed: Created Termux, Termux PRoot… Pushed wget v1.19.4 fixing wget v1.19.3 errors immediatly… Result: TermuxArch improved!
59 |
60 | [Dmitry Matveyev](https://github.com/greenfork) contributed key debug information to resolve issue [Declare error: value too great for base (error token is: 08) #60](https://github.com/sdrausty/TermuxArch/issues/60) Result: TermuxArch improved!
61 |
62 | [Hax4us](https://github.com/Hax4us) provided insight regarding open issues. Submitted pull request. Result: TermuxArch improved!
63 |
64 | [iantothecore](https://github.com/iantothecore) submitted an issue. Result: TermuxArch improved!
65 |
66 | [imdaveho](https://github.com/imdaveho) helped debug Chromebook. Result: TermuxArch improved!
67 |
68 | jlam: contributed `getprop ro.product.device` Chromebook detection, `getprop ro.product.cpu.abi`, polite KISS, program flow suggestions. Result: TermuxArch improved!
69 |
70 | [Kitsumi](https://github.com/Kitsumi) contributed issue [Declare error: value too great for base (error token is: 08) #60](https://github.com/sdrausty/TermuxArch/issues/60) Result: TermuxArch improved!
71 |
72 | [markfelt](https://github.com/markfelt) contributed [Succesfully Modified Stock 'makepkg'... #38](https://github.com/sdrausty/TermuxArch/issues/38) with instructions. Result: pending
73 |
74 | [michalbednarski](https://github.com/michalbednarski) contributed Termux PRoot, discussed PRoot, contributed: `pacman-key --init` && `echo disable-scdaemon > /etc/pacman.d/gnupg/gpg-agent.conf` which resolved `pacman-key --populate archlinux` issuses, `export PROOT_NO_SECCOMP=1` resolving Android 8 installation issues. Contributed kernel test and updated PRoot for Android 8. Contributed `pacman -R linux-aarch64 linux-firmware` easing free space concerns. Result: TermuxArch greatly improved!
75 |
76 | [mjskoneg](https://github.com/mjskoneg) submitted issues. Result: TermuxArch improved!
77 |
78 | [Neo-Oli](https://github.com/Neo-Oli) suggested `unset LD_PRELOAD` to resolve an issue when using `termux-exec`. Result: TermuxArch improved!
79 |
80 | [rootconfig27](https://github.com/rootconfig27) contributed to `printoutstatements.sh` with this [9cd505a](https://github.com/rootconfig27/TermuxArch/commit/5c5f1de746731b2f98dc11064fbfd7f8c9cd505a) commit.
81 |
82 | [Root-voidX](https://github.com/Root-voidX) contributed great discourse which resulted in instructions and diagnostic information about Arch Linux [#59](https://github.com/sdrausty/TermuxArch/issues/59) for GUI users and improvements for Android 8 user. Result: TermuxArch improved!
83 |
84 | [Soph1a7](https://github.com/Soph1a7) contributed to issues and submitted pull requests (locale-gen, printf, quiet, mirrors, `wget -A tar.gz -m -nd -np http://mirrors.evowise.com/archlinux/iso/latest`, et al ). Also provided numerous constructive suggestions. Result: TermuxArch greatly improved, and working with this project improved too!
85 |
86 | [smu](https://github.com/smu) submitted issues [#21](https://github.com/sdrausty/TermuxArch/issues/21) "`vi` Command Not Found" and [#24](https://github.com/sdrausty/TermuxArch/issues/24) "`sed` Command Not Found" which helped debug i686 Chromebook installation. Result: TermuxArch improved!
87 |
88 | [staymetal](https://github.com/staymetal) contributed: debugging wget v1.19.3 errors Result: TermuxArch improved!
89 |
90 | [Ublimjo](https://github.com/Ublimjo) submitted issue [#37](https://github.com/sdrausty/TermuxArch/issues/37), No such or file directory when setting Arch Linux up in Termux PRoot and commented. Result: [https://github.com/sdrausty/dfa](https://github.com/sdrausty/dfa) created and TermuxArch improved! TermuxArch space warnings added.
91 |
92 | [vishalbiswas](https://github.com/vishalbiswas) contributed: `export LD_PRELOAD=$PREFIX/lib/libtermux-exec.so`. Result: TermuxArch improved!
93 |
94 | [wulvyrn](https://github.com/wulvyrn) contributed: `pacman -S rng-tools`, `rngd -r /dev/urandom` to resolve `pacman-key --init` in issues #28, #33 and #46.
95 |
96 | Thank you for making this project work better and please contribute 🔆 See [Notice to Contributors](NOTICE) for information. See [PRoot](docs/PRoot) for more information about Linux on device with Termux.
97 |
98 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | Licensed under the Apache License, Version 2.0 (the "License");
178 | you may not use this file except in compliance with the License.
179 | You may obtain a copy of the License at
180 |
181 | http://www.apache.org/licenses/LICENSE-2.0
182 |
183 | Unless required by applicable law or agreed to in writing, software
184 | distributed under the License is distributed on an "AS IS" BASIS,
185 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
186 | See the License for the specific language governing permissions and
187 | limitations under the License.
188 |
--------------------------------------------------------------------------------
/NOTICE.md:
--------------------------------------------------------------------------------
1 | ##### -r--r--r-- [archsystemconfigs.bash](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/archlinuxconfig.bash)
2 |
3 | ##### -r--r--r-- [espritfunctions.bash](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/espritfunctions.bash)
4 |
5 | ##### -r--r--r-- [getimagefunctions.bash](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/getimagefunctions.bash)
6 |
7 | ##### -r--r--r-- [knownconfigurations.bash](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/knownconfigurations.bash)
8 |
9 | ##### -r--r--r-- [necessaryfunctions.bash](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/necessaryfunctions.bash)
10 |
11 | ##### -r--r--r-- [printoutstatements.bash](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/printoutstatements.bash)
12 |
13 | ##### -r--r--r-- [setupTermuxArch.bash](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/setupTermuxArch.bash)
14 |
15 | ##### -rw-rw-rw- [setupTermuxArch.tar.gz](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/setupTermuxArch.tar.gz)
16 |
17 | ##### -r--r--r-- [systemmaintenance.bash](https://raw.githubusercontent.com/sdrausty/TermuxArch/master/maintenanceroutines.bash)
18 |
19 | ## Contributions have helped in the successful development of this script and project immensely. This is a Notice to Contributors 📲 __Thank you for contributing and collaborating!__
20 |
21 | __Source code goals for this project are:__
22 | 1. That it work as desired and provide the ultimate user experience possible when executed,
23 | 2. Minimum lines and length possible while being obviously legible, clearly readable and understandable, all at the same time. It.bashould be a pleasure to read. This includes the documentation too.
24 |
25 | Contributions have helped in the successful development of this script and project immensely. Understanding the goals and workings of this project.bashall make interacting with this project all the more rewarding. If you are considering collaborating, help is wanted in:
26 | 1. Coding - Submit modifications in the `scripts/files` directory at [https://github.com/sdrausty/TermuxArch](https://github.com/sdrausty/TermuxArch) Run `/scripts/maintenance/makedownload.bash` to generate checksums and files,
27 | 2. Documentation - Submit modifications at [https://github.com/sdrausty/docsTermuxArch](https://github.com/sdrausty/docsTermuxArch),
28 | 3. Scree.bashots and Animations - Submit modifications at [https://github.com/sdrausty/imgsTermuxArch](https://github.com/sdrausty/imgsTermuxArch).
29 |
30 | These pages and projects can be altered to our desire. Please think of them as a wiki pages that you have access to change if you want. Thank you for contributing and collaborating to those who have helped improve this project.
31 |
32 | Additional information:
33 | * All Termux Arch related issues and pull requests.bashould be addressed through [https://github.com/sdrausty/TermuxArch](https://github.com/sdrausty/TermuxArch) for script changes,
34 | * All Termux Arch related issues and pull requests.bashould be delivered through [https://github.com/sdrausty/docsTermuxArch](https://github.com/sdrausty/docsTermuxArch) for documentation.
35 | * All Termux Arch related issues and pull requests.bashould be delivered through [https://github.com/sdrausty/imgsTermuxArch](https://github.com/sdrausty/imgsTermuxArch) for graphics and presentation medium.
36 |
37 | __To avoid "git bloat", these repositories are reset periodically!__ This is also one of the reasons why this project is distributed in these repositories. If you get a `fatal: refusing to merge unrelated histories` message while working with your current clone, save the important work from your current clone and reclone.
38 |
39 | To understand more about "git bloat", run `du -hs .git` on older more mature projects. Some might have a very large .git directory. A very large .git directory can impede working with a git repository, especially when utilizing a slow Internet connection. This is why this repository is periodically reset.
40 |
41 | * Comments are welcome at [https://github.com/sdrausty/TermuxArch/issues](https://github.com/sdrausty/TermuxArch/issues) ✍
42 |
43 | * Pull requests are welcome [https://github.com/sdrausty/TermuxArch/pulls](https://github.com/sdrausty/TermuxArch/pulls) ✍
44 |
45 | Thanks for making this project work; Please contribute 🔆 See [contributors](CONTRIBUTORS.md). See [PRoot](docs/PRoot) for more information about Linux on device with Termux.
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## [TermuxArch](https://github.com/SDRausty/TermuxArch/)
4 |
5 | ##### -r--r--r-- [setupTermuxArch](https://raw.githubusercontent.com/TermuxArch/TermuxArch/master/setupTermuxArch)
6 | ##### -rwxrwx--- [setupTermuxArch](https://TermuxArch.github.io/TermuxArch/setupTermuxArch)
7 |
8 | This Termux bash setup shell script will attempt to set Arch Linux up in your Termux environment. Please see [install](https://TermuxArch.github.io/docsTermuxArch/install) for options how to run [`setupTermuxArch`](https://raw.githubusercontent.com/TermuxArch/TermuxArch/master/setupTermuxArch) on device. You can use `bash setupTermuxArch` to install [Arch Linux](https://wiki.archlinux.org/) in a [Termux PRoot](https://github.com/termux/proot) container on your Android smartphone and tablet, and Chromebook too. When successfully completed, you will be experiencing the pleasure of the Linux command prompt in Arch Linux in Termux PRoot on Android, Chromebook and Fire OS on smartphone, tablet and wearable.
9 |
10 | #### Screenshot from an Android smartphone 2018
11 | [](https://TermuxArch.github.io/docsTermuxArch/install)
12 |
13 | * Comments are welcome at [https://github.com/TermuxArch/TermuxArch/issues](https://github.com/TermuxArch/TermuxArch/issues) ✍
14 |
15 | * Pull requests are welcome at [https://github.com/TermuxArch/TermuxArch/pulls](https://github.com/TermuxArch/TermuxArch/pulls) ✍
16 |
17 | Thank you for making this project work better and please contribute 🔆 [Contributors](CONTRIBUTORS.md) and [Notice to Contributors](NOTICE.md) have more information about this project.
18 |
19 | 
20 |
21 | [PRoot](https://termuxarch.github.io/docsTermuxArch/PRoot) has more information about Linux on device with Termux.
22 |
23 | Share https://wiki.termux.com/wiki/Development everwhere🌎🌍🌏🌐!
24 |
25 | Install Arch Linux into a Termux PRoot container with [`bash setupTermuxArch`](setupTermuxArch). After succesfull installation start the container with `startarch`.
26 |
27 | See https://TermuxArch.github.io/TermuxArch/docs/install for options how to run [`setupTermuxArch`](https://TermuxArch.github.io/TermuxArch/setupTermuxArch) on device.
28 |
29 | See https://TermuxArch.github.io/docsTermuxArch/startingArch for options how to start the Arch Linux container `startarch` on device.
30 |
31 | This repository uses submodules. To get all the pieces of this repository run the following code after cloning in the root directory of this repository:
32 |
33 | ```
34 | git submodule update --init --recursive
35 | ```
36 |
37 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------
/espritfunctions.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Copyright 2017-2022 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
3 | ## Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
4 | ## https://sdrausty.github.io/TermuxArch/README has info about this project.
5 | ## https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
6 | ################################################################################
7 |
8 | _MRCOUNTRIESx86_() {
9 | MRCOUNTRIESx86=("Belarus" "France" "Germany" "Greece" "Russia" "Switzerland" "United States")
10 | }
11 |
12 | _MRCOUNTRIESx86_64_() {
13 | MRCOUNTRIESx86_64=("Worldwide" "Australia" "Austria" "Bangladesh" "Belarus" "Belgium" "Bosnia and Herzegovina" "Brazil" "Bulgaria" "Canada" "Chile" "China" "Colombia" "Croatia" "Czechia" "Denmark" "Ecuador" "Finland" "France" "Georgia" "Germany" "Greece" "Hong Kong" "Hungary" "Iceland" "India" "Indonesia" "Iran" "Ireland" "Israel" "Italy" "Japan" "Kazakhstan" "Kenya" "Latvia" "Lithuania" "Luxembourg" "Moldova" "Netherlands" "New Caledonia" "New Zealand" "North Macedonia" "Norway" "Pakistan" "Paraguay" "Philippines" "Poland" "Portugal" "Romania" "Russia" "Serbia" "Singapore" "Slovakia" "Slovenia" "South Africa" "South Korea" "Spain" "Sweden" "Switzerland" "Taiwan" "Thailand" "Turkey" "Ukraine" "United Kingdom" "United States" "Vietnam")
14 | }
15 |
16 | _BLOOM_() { # Bloom = 'setupTermuxArch manual verbose'
17 | [[ -d "$HOME"/TermuxArchBloom ]] && _RMBLOOMQ_
18 | mkdir -p "$HOME"/TermuxArchBloom
19 | cp {LICENSE,archlinuxconfig.bash,espritfunctions.bash,fbindsfunctions.bash,getimagefunctions.bash,initkeyfunctions.bash,knownconfigurations.bash,maintenanceroutines.bash,necessaryfunctions.bash,setupTermuxArch,printoutstatements.bash} "$HOME"/TermuxArchBloom
20 | cd "$HOME"/TermuxArchBloom || exit 69
21 | printf "\\e[1;34m%s\\e[1;32m%s\\e[0m 📲\\n\\n" "TermuxArch Bloom option via " "setupTermuxArch bloom"
22 | ls -agl
23 | printf "\\n\\e[1;34m%s\\e[1;32m%s\\e[1;34m%s\\e[1;32m%s\\e[1;34m%s\\e[1;32m%s\\e[1;34m. " "Use " "cd ~/TermuxArchBloom" " to continue. Edit any of these files; Then use " "bash ${0##*/} [options]" " to run the files in " "~/TermuxArchBloom"
24 | if [ "$ELCR" = 0 ]
25 | then
26 | { [[ -d "$INSTALLDIR" ]] && [[ -d "$INSTALLDIR"/root/bin ]] && [[ -d "$INSTALLDIR"/var/binds ]] && [[ -f "$INSTALLDIR"/bin/we ]] && [[ -f "$INSTALLDIR"/usr/bin/env ]] ; } && printf "\\n\\e[0;33m%s\\e[1;33m%s\\e[0;32m%s.\\n\\n" "TermuxArch NOTICE! " "The root directory structure of ~/${INSTALLDIR##*/} appears correct; Cannot continue '${0##*/} $ARGS' to create the directory skeleton! " "Command '${0##*/} bloom customdir' can be appended with customdir. The command '${0##*/} bloom customdir' can continue building the skeleton structure. The commands '${0##*/} re[fresh]' will update the TermuxArch files in '~/${INSTALLDIR##*/}' to the most recent version. Commands '${0##*/} h[e[lp]]' and '$STARTBIN h[elp]' have more information" && exit
27 | ## Create ~/TermuxArchBloom directory and Arch Linux in Termux PRoot root directory skeleton.
28 | _PREPTERMUXARCH_
29 | _NAMESTARTARCH_
30 | _SPACEINFO_
31 | _PREPINSTALLDIR_
32 | tree 2>/dev/null || find . -type f -print | sed 's@.*/@@' | sort
33 | fi
34 | exit
35 | }
36 |
37 | _EDITFILES_() {
38 | if [[ "$USEREDIT" = "vi" ]]
39 | then
40 | sed -i -e 1,4d "$INSTALLDIR"/etc/pacman.d/mirrorlist
41 | sed -i '1i# # # # # # # # # # # # # # # # # # # # # # # # # # #\n# TermuxArch vi instructions: CTR+r is redo.\n# Use the hjkl keys to navigate. \n# Numbers are multipliers. The u is undelete/undo.\n# 17j then i opens edit mode for the Geo-IP mirror.\n# Enter the # hash/num/pounds symbol to comment it out: \n# Server = http://mirror.archlinuxarm.org/$arch/$repo.\n# Long tap KEYBOARD in the side pane to see ESC, CTR...\n# Tap ESC to return to command mode in vi.\n# CTRL+d and CTRL+b to find your local mirror.\n# / for search, N and n for next match.\n# Tap x to delete # to uncomment your local mirror.\n# Choose only one mirror. Use;x to save your work.\n# Comment out the Geo-IP mirror end G top gg\n# # # # # # # # # # # # # # # # # # # # # # # # # # #' "$INSTALLDIR"/etc/pacman.d/mirrorlist
42 | sed -i '1i# # # # # # # # # # # # # # # # # # # # # # # # # # #\n# TermuxArch vi instructions: CTR+r is redo.\n# Use the hjkl keys to navigate. \n# Numbers are multipliers. The u is undelete/undo.\n# Tap i for insert, ESC to return to command mode in vi.\n# Long tap KEYBOARD in the side pane to see ESC, CTR...\n# Tap x to delete # to uncomment your favorite language(s).\n# Enter the # hash/num/pounds symbol to comment out locales.\n# CTRL+d and CTRL+b for PGUP & PGDN.\n# top gg bottom G\n# / for search, N and n for next match.\n# Choose as many as you like. Use;x to save your work.\n# # # # # # # # # # # # # # # # # # # # # # # # # # #\n#' "$INSTALLDIR"/etc/locale.gen
43 | elif [[ "$USEREDIT" = "vim" ]]
44 | then
45 | sed -i -e 1,4d "$INSTALLDIR"/etc/pacman.d/mirrorlist
46 | sed -i '1i# # # # # # # # # # # # # # # # # # # # # # # # # # #\n# TermuxArch vim instructions: CTR+r is redo.\n# Use the hjkl keys to navigate. \n# Numbers are multipliers. The u is undelete/undo.\n# 17j then i opens edit mode for the Geo-IP mirror.\n# Enter the # hash/num/pounds symbol to comment it out: \n# Server = http://mirror.archlinuxarm.org/$arch/$repo.\n# Long tap KEYBOARD in the side pane to see ESC, CTR...\n# Tap ESC to return to command mode in vi.\n# CTRL+d and CTRL+b to find your local mirror.\n# / for search, N and n for next match.\n# Tap x to delete # to uncomment your local mirror.\n# Choose only one mirror. Use;x to save your work.\n# Please comment out only one Geo-IP mirror end G top gg\n# # # # # # # # # # # # # # # # # # # # # # # # # # #' "$INSTALLDIR"/etc/pacman.d/mirrorlist
47 | sed -i '1i# # # # # # # # # # # # # # # # # # # # # # # # # # #\n# TermuxArch vim instructions: CTR+r is redo.\n# Use the hjkl keys to navigate. \n# Numbers are multipliers. The u is undelete/undo.\n# Tap i for insert, ESC to return to command mode in vi.\n# Long tap KEYBOARD in the side pane to see ESC, CTR...\n# Tap x to delete # to uncomment your favorite language(s).\n# Enter the # hash/num/pounds symbol to comment out locales.\n# CTRL+d and CTRL+b for PGUP & PGDN.\n# top gg bottom G\n# / for search, N and n for next match.\n# Choose as many as you like. Use;x to save your work.\n# # # # # # # # # # # # # # # # # # # # # # # # # # #\n#' "$INSTALLDIR"/etc/locale.gen
48 | elif [[ "$USEREDIT" = "nvim" ]]
49 | then
50 | sed -i -e 1,4d "$INSTALLDIR"/etc/pacman.d/mirrorlist
51 | sed -i '1i# # # # # # # # # # # # # # # # # # # # # # # # # # #\n# TermuxArch neovim instructions: CTR+r is redo.\n# Use the hjkl keys to navigate. \n# Numbers are multipliers. The u is undelete/undo.\n# 17j then i opens edit mode for the Geo-IP mirror.\n# Enter the # hash/num/pounds symbol to comment it out: \n# Server = http://mirror.archlinuxarm.org/$arch/$repo.\n# Long tap KEYBOARD in the side pane to see ESC, CTR...\n# Tap ESC to return to command mode in vi.\n# CTRL+d and CTRL+b to find your local mirror.\n# / for search, N and n for next match.\n# Tap x to delete # to uncomment your local mirror.\n# Choose only one mirror. Use;x to save your work.\n# Comment out the Geo-IP mirror end G top gg\n# # # # # # # # # # # # # # # # # # # # # # # # # # #' "$INSTALLDIR"/etc/pacman.d/mirrorlist
52 | sed -i '1i# # # # # # # # # # # # # # # # # # # # # # # # # # #\n# TermuxArch neovim instructions: CTR+r is redo.\n# Use the hjkl keys to navigate. \n# Numbers are multipliers. The u is undelete/undo.\n# Tap i for insert, ESC to return to command mode in vi.\n# Long tap KEYBOARD in the side pane to see ESC, CTR...\n# Tap x to delete # to uncomment your favorite language(s).\n# Enter the # hash/num/pounds symbol to comment out locales.\n# CTRL+d and CTRL+b for PGUP & PGDN.\n# top gg bottom G\n# / for search, N and n for next match.\n# Choose as many as you like. Use;x to save your work.\n# # # # # # # # # # # # # # # # # # # # # # # # # # #\n#' "$INSTALLDIR"/etc/locale.gen
53 | else
54 | sed -i '1i# # # # # # # # # # # # # # # # # # # # # # # # # # #\n# TermuxArch edit instructions: Locate the Geo-IP mirror.\n# Enter the # hash/num/pounds symbol to comment it out: \n# Server = http://mirror.archlinuxarm.org/$arch/$repo.\n# Long tap KEYBOARD in the side pane to see ESC, CTR...\n# Choose only one mirror.\n# Delete # to uncomment your local mirror.\n# # # # # # # # # # # # # # # # # # # # # # # # # # #' "$INSTALLDIR"/etc/pacman.d/mirrorlist
55 | fi
56 | }
57 |
58 | _EDITORS_() {
59 | # populate array of all available Termux editors
60 | AEDS=("emacs" "joe" "jupp" "nano" "ne" "nvim" "micro" "vi" "vim" "zile")
61 | for OEAEDS in ${!AEDS[@]}
62 | do
63 | if [[ -e "$PREFIX/bin/${AEDS[$OEAEDS]}" ]] # if editor is found
64 | then # add editor to USEREDTR
65 | USEREDTR+=("${AEDS[$OEAEDS]}")
66 | fi
67 | done
68 | for i in "${!USEREDTR[@]}"
69 | do
70 | _EDQ_
71 | if [[ "$EINDEX" = 1 ]]
72 | then
73 | break
74 | fi
75 | done
76 | }
77 |
78 | _EDQ_() {
79 | printf "\\e[0;32m"
80 | for EDQINDEX in "${USEREDTR[@]}"
81 | do
82 | if [[ "$EDQINDEX" = "vi" ]]
83 | then
84 | _EDQ2_
85 | EINDEX=1
86 | break
87 | fi
88 | _EDQA_ "$USEREDTR"
89 | if [[ "$EINDEX" = 1 ]]
90 | then
91 | break
92 | fi
93 | done
94 | }
95 |
96 | _EDQA_() {
97 | USEREDIT="${USEREDTR[$i]}"
98 | EINDEX=1
99 | }
100 |
101 | _EDQAQUESTION_() {
102 | while true
103 | do
104 | printf "\\n"
105 | if [[ "$OPT" = BLOOM ]] || [[ "$OPT" = MANUAL ]]
106 | then
107 | printf "The following editor(s) %s\\b\\b are present. Would you like to use '\\e[1;32m%s\\e[0;32m' to edit '\\e[1;32msetupTermuxArchConfigs.bash\\e[0;32m'? " "$USEREDTR" "${USEREDTR[$i]}"
108 | read -n 1 -p "Answer yes or no [Y|n]. " yn
109 | else
110 | printf "Change the worldwide mirror to a mirror that is geographically nearby. Please choose only ONE active mirror in the mirrors file that you are about to edit. The following editor(s) \\b\\b are present. Would you like to use '\\e[1;32m%s\\e[0;32m' to edit the Arch Linux configuration files? " "$USEREDTR" "${USEREDTR[$i]}"
111 | read -n 1 -p "Answer yes or no [Y|n]. " yn
112 | fi
113 | if [[ "$YN" = [Yy]* ]] || [[ "$YN" = "" ]]
114 | then
115 | USEREDIT="${USEREDTR[$i]}"
116 | EINDEX=1
117 | break
118 | elif [[ "$YN" = [Nn]* ]]
119 | then
120 | break
121 | else
122 | printf "\\nYou answered \\e[1;36m%s\\e[1;32m.\\n" "$YN"
123 | printf "\\nAnswer yes or no [Y|n]. \\n"
124 | fi
125 | done
126 | }
127 |
128 | _EDQ2_() {
129 | while true
130 | do
131 | if [[ "$OPT" = BLOOM ]] || [[ "$OPT" = MANUAL ]]
132 | then
133 | printf "\\n\\e[1;34m Would you like to use \\e[1;32mnano\\e[1;34m or \\e[1;32mvi\\e[1;34m to edit \\e[1;32msetupTermuxArchConfigs.bash\\e[1;34m? "
134 | read -n 1 -p "Answer nano or vi [n|V]? " nv
135 | else
136 | printf "\\e[1;34m Change the worldwide mirror to a mirror that is geographically nearby. Choose only ONE active mirror in the mirror file that you are about to edit. Would you like to use \\e[1;32mnano\\e[1;34m or \\e[1;32mvi\\e[1;34m to edit the Arch Linux configuration files? "
137 | read -n 1 -p "Answer nano or vi [n|V]? " nv
138 | fi
139 | if [[ "$NV" = [Nn]* ]]
140 | then
141 | USEREDIT=nano
142 | _NANOIF_
143 | EINDEX=1
144 | break
145 | elif [[ "$NV" = [Vv]* ]] || [[ "$NV" = "" ]]
146 | then
147 | USEREDIT="vi"
148 | EINDEX=1
149 | break
150 | else
151 | printf "\\nYou answered \\e[36;1m%s\\e[1;32m.\\n\\nAnswer nano or vi [n|v]. \\n" "$NV"
152 | fi
153 | done
154 | printf "\\n"
155 | }
156 |
157 | _NANOIF_() {
158 | if [ ! -x "$PREFIX"/bin/nano ]
159 | then
160 | apt -o APT::Keep-Downloaded-Packages="true" install "nano" -y
161 | if [ ! -x "$PREFIX"/bin/nano ]
162 | then
163 | printf "\\n\\e[7;1;31m%s\\e[0;1;32m %s\\n\\n\\e[0m" "PREREQUISITE EXCEPTION!" "RUN ${0##*/} $ARGS AGAIN..."
164 | printf "\\e]2;%s %s\\007" "RUN ${0##*/} $ARGS" "AGAIN..."
165 | exit
166 | fi
167 | fi
168 | }
169 |
170 | _RMBLOOMQ_() {
171 | if [[ -d "$HOME"/TermuxArchBloom ]]
172 | then
173 | printf "\\n\\n\\e[0;33m%s\\e[1;33m%s\\e[0;33m%s\\e[1;30m%s\\e[0;33m%s\\n" "TermuxArch " "DIRECTORY NOTICE! ~/${INSTALLDIR##*}TermuxArchBloom " "directory detected; " "setupTermuxArch bloom" " will continue."
174 | while true
175 | do
176 | printf "\\n\\e[1;30m"
177 | read -n 1 -p "Refresh $HOME/TermuxArchBloom? [Y|n] " RBUANSWER
178 | if [[ "$RBUANSWER" = [Ee]* ]] || [[ "$RBUANSWER" = [Nn]* ]] || [[ "$RBUANSWER" = [Qq]* ]]
179 | then
180 | printf "\\n"
181 | exit $?
182 | elif [[ "$RBUANSWER" = [Yy]* ]] || [[ "$RBUANSWER" = "" ]]
183 | then
184 | printf "\\e[30m%s\\n" "Uninstalling $HOME/TermuxArchBloom..."
185 | if [[ -d "$HOME"/TermuxArchBloom ]]
186 | then
187 | rm -rf "$HOME"/TermuxArchBloom
188 | fi
189 | printf "%s\\n\\n" "Uninstalling $HOME/TermuxArchBloom done."
190 | break
191 | else
192 | printf "\\n%s\\e[33;1m%s\\e[30m.\\n\\nAnswer \\e[32mYes\\e[30m or \\e[1;31mNo\\e[30m. [\\e[32mY\\e[30m|\\e[1;31mn\\e[30m]\\n" "You answered " "$RBUANSWER"
193 | fi
194 | done
195 | fi
196 | }
197 |
198 | _TASPINNER_() { # print spinner; derivation based on https://github.com/ringohub/sh-spinner and https://github.com/vozdev/termux-setup
199 | INCREMNT=1
200 | if [[ -z "${1:-}" ]]
201 | then
202 | SPINNERL="⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"
203 | elif [[ "${1//-}" = clock ]]
204 | then
205 | SPINNERL="🕛🕐🕑🕓🕔🕕🕖🕗🕘🕙🕚"
206 | elif [[ "${1//-}" = moon ]]
207 | then
208 | SPINNERL="🌑🌒🌓🌔🌕🌖🌗🌘"
209 | fi
210 | SPINDLAY="0.$(shuf -i 4-8 -n 1)"
211 | printf "\\e[?25l"
212 | while :
213 | do
214 | printf " \\b\\b\\b%s\\b" "${SPINNERL:INCREMNT++%${#SPINNERL}:1}"
215 | sleep "$SPINDLAY"
216 | done
217 | }
218 |
219 | _TAMATRIX_() { # partial implemintation; print TermuxArch source code as matrix
220 | _DOTAMSTRIX_() {
221 | printf "\\e[?25l\\e[1;32m%s" "$(tr -d '\n' < "$0")"
222 | # split a string from file and print this split string
223 | for EMSTRING in "${TAMATARR[@]}"
224 | do
225 | printf "\\e[0;32m%s" "$EMSTRING"
226 | sleep 0.0"$(shuf -i 0-999 -n 1)"
227 | done
228 | }
229 | IFS=';' read -ra TAMATARR <<< "$(tr -d '\n' < "$0")"
230 | if [[ -n "${MATRIXLCR:-}" ]]
231 | then
232 | TAMATRIXENDLCR=0
233 | while :
234 | do
235 | _DOTAMSTRIX_
236 | done
237 | else
238 | _DOTAMSTRIX_
239 | fi
240 | cat "$0"
241 | _TAMATRIXEND_
242 | }
243 |
244 | _TAMATRIXEND_() { # print 'setupTermuxArch mat[rix]' ending
245 | . "$0" h
246 | tail -n 18 "$0"
247 | . "$0" help
248 | printf "\\e[1;32mPlease run 'bash %s' again at a later time. Also think about opening an issue and a pull request in order to enhance this feature; Thank you for using '%s', and please enjoy using Linux on device! " "${0##*/} $ARGS" "${0##*/} $ARGS"
249 | exit
250 | }
251 |
252 | _WAKELOCK_() {
253 | _PRINTWLA_
254 | am startservice --user 0 -a com.termux.service_wake_lock com.termux/com.termux.app.TermuxService > /dev/null || _PSGI1ESTRING_ "am startservice _WAKELOCK_ necessaryfunctions.bash ${0##/*}; Continuing..."
255 | _PRINTDONE_
256 | }
257 |
258 | _WAKEUNLOCK_() {
259 | _PRINTWLD_
260 | am startservice --user 0 -a com.termux.service_wake_unlock com.termux/com.termux.app.TermuxService > /dev/null || _PSGI1ESTRING_ "am startservice _WAKEUNLOCK_ necessaryfunctions.bash ${0##/*}; Continuing..."
261 | _PRINTDONE_
262 | }
263 | # espritfunctions.bash FE
264 |
--------------------------------------------------------------------------------
/fbindsfunctions.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Copyright 2017-2022 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
3 | ## Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
4 | ## https://sdrausty.github.io/TermuxArch/README has info about this project.
5 | ## https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
6 | ################################################################################
7 | _ADDinitfbinds_() {
8 | FBINDFUNCS=(
9 | _ADDfbindkvm_
10 | _ADDfbindprocpcidevices_
11 | _ADDfbindprocshmem_
12 | _ADDfbindprocuptime_
13 | _ADDfbindprocstat_
14 | _ADDfbindprocversion_
15 | _ADDbindprocloadavg_
16 | _ADDbindprocvmstat_
17 | _ADDfbindsysdevices_
18 | )
19 | for FBINDFUNC in "${FBINDFUNCS[@]}"
20 | do
21 | "$FBINDFUNC"
22 | done
23 | }
24 |
25 | _ADDfbindprocpcidevices_() {
26 | :>var/binds/fbindprocpcidevices
27 | }
28 |
29 | _ADDfbindprocshmem_() {
30 | printf "%s\\n" "------ Message Queues --------
31 | key msqid owner perms used-bytes messages
32 |
33 | ------ Shared Memory Segments --------
34 | key shmid owner perms bytes nattch status
35 |
36 | ------ Semaphore Arrays --------
37 | key semid owner perms nsems" > var/binds/fbindprocshmem
38 | }
39 |
40 | _ADDfbindprocstat_() {
41 | NESSOR="$(grep cessor /proc/cpuinfo)"
42 | NCESSOR="${NESSOR: -2}"
43 | if [ "$NCESSOR" -le 3 ]
44 | then
45 | _ADDfbindprocstat4_
46 | elif [ "$NCESSOR" -le 5 ]
47 | then
48 | _ADDfbindprocstat6_
49 | else
50 | _ADDfbindprocstat8_
51 | fi
52 | }
53 |
54 | _ADDfbindprocstat4_() {
55 | printf "%s\\n" "cpu 4232003 351921 6702657 254559583 519846 1828 215588 0 0 0
56 | cpu0 1595013 127789 2759942 61446568 310224 1132 92124 0 0 0
57 | cpu1 1348297 91900 1908179 63099166 110243 334 78861 0 0 0
58 | cpu2 780526 73446 1142504 64682755 61240 222 32586 0 0 0
59 | cpu3 508167 58786 892032 65331094 38139 140 12017 0 0 0
60 | intr 182663754 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23506963 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13479102 0 0 0 0 0 0 0 108 0 0 0 0 0 0 0 0 0 178219 72133 5 0 1486834 0 0 0 8586048 0 0 0 0 0 0 0 0 0 0 2254 0 0 0 0 29 3 7501 38210 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4610975 0 0 0 0 0 1 0 78471 0 0 0 0 0 0 0 0 0 0 0 0 0 0 305883 0 15420 0 3956500 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8937474 0 943938 0 0 0 0 0 0 0 0 0 0 0 0 12923 0 0 0 34931 5 0 2922124 848989 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12502497 0 0 3270275 0 0 0 0 0 0 0 0 0 0 0 1002881 0 0 0 0 0 0 17842 0 44011 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1975390 0 0 0 0 0 0 0 0 0 0 0 0 4968 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1340 2 762 0 0 0 50 42 0 27 82 0 0 0 0 14 28 0 0 0 0 14277 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1974794 0 142 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 367 81
61 | ctxt $(shuf -n 1 -i 465697-473465697)
62 | btime $BINDPROCUPTIM0
63 | processes $(shuf -n 1 -i 32-32768)
64 | procs_running 3
65 | procs_blocked 0
66 | softirq 71223290 12005 18257219 222294 2975533 4317 4317 7683319 19799901 40540 22223845" > var/binds/fbindprocstat
67 | }
68 |
69 | _ADDfbindprocstat6_() {
70 | printf "%s\\n" "cpu 148928556 146012 6648853 2086709554 4518337 0 1314039 293017 0 0
71 | cpu0 24948069 38092 1137251 347724817 1169568 0 30231 21138 0 0
72 | cpu1 16545576 29411 890111 356315677 971747 0 41593 115368 0 0
73 | cpu2 82009143 11955 2705377 286616379 473751 0 1239704 114343 0 0
74 | cpu3 9487436 29342 673090 364602319 631633 0 843 11690 0 0
75 | cpu4 6696319 23709 584149 367425424 501898 0 890 12546 0 0
76 | cpu5 9242011 13500 658872 364024935 769737 0 775 17929 0 0
77 | intr 3438098651 134 26 0 0 0 0 3 0 0 0 0 581717 74 0 0 3669554 0 0 0 0 0 0 0 0 0 150777509 19 0 843288252 7923 0 0 0 256 0 4 0 13323712 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
78 | ctxt $(shuf -n 1 -i 789017-1109789017)
79 | btime $BINDPROCUPTIM0
80 | processes $(shuf -n 1 -i 32-32768)
81 | procs_running 5
82 | procs_blocked 0
83 | softirq 3644958646 1 2007831497 2340 995352344 1834998 0 97563 249921452 0 389918451" > var/binds/fbindprocstat
84 | }
85 |
86 | _ADDfbindprocstat8_() {
87 | printf "%s\\n" "cpu 10278859 1073916 12849197 97940412 70467 2636 323477 0 0 0
88 | cpu0 573749 46423 332546 120133 32 79 5615 0 0 0
89 | cpu1 489409 40445 325756 64094 0 59 5227 0 0 0
90 | cpu2 385758 36997 257949 50488114 40123 39 4021 0 0 0
91 | cpu3 343254 34729 227718 47025740 30205 20 2566 0 0 0
92 | cpu4 3063160 288232 4291656 58418 27 940 146236 0 0 0
93 | cpu5 2418517 277690 3105779 60431 48 751 67052 0 0 0
94 | cpu6 1671400 189460 2302016 61521 23 402 49717 0 0 0
95 | cpu7 1333612 159940 2005777 61961 9 346 43043 0 0 0
96 | intr 607306752 0 0 113 0 109 0 0 26 0 0 4 0 0 0 0 0 0 0 0 0 67750564 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 51073258 0 0 0 0 0 0 0 160 0 0 0 0 0 0 0 0 0 51831 2 5 0 24598 0 0 0 15239501 0 0 0 0 0 0 0 0 0 0 1125885 0 0 0 0 5966 3216 120 2 0 0 5990 0 24741 0 37 0 0 0 0 0 0 0 0 0 0 0 0 15262980 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 42742 16829690 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 19844763 0 8873762 0 0 0 0 0 0 0 0 6 0 0 0 49937 0 0 0 2768306 5 0 3364052 3755518 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41435584 0 0 3939101 0 0 0 0 0 0 0 0 0 0 0 1894201 0 0 0 0 0 0 864195 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8961077 3996222 0 0 0 0 0 0 0 0 0 0 0 0 66386 0 0 0 0 0 0 87497 0 285431 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11217187 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3578 0 0 0 0 0 301 300 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 117 14 0 0 0 0 0 95 0 0 0 0 0 0 0 27 0 2394 0 0 0 0 62 0 0 0 0 0 857124 0 1 0 0 0 0 20 3990685 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5021 481 4
97 | ctxt $(shuf -n 1 -i 9697753-1589697753)
98 | btime $BINDPROCUPTIM0
99 | processes $(shuf -n 1 -i 64-4194304)
100 | procs_running 7
101 | procs_blocked 0
102 | softirq 204699421 2536598 39636497 522981 4632002 29263706 104522 6736991 41332715 232221 79701188" > var/binds/fbindprocstat
103 | }
104 |
105 | _ADDfbindprocuptime_() {
106 | INVNUM="$(shuf -n 1 -i 0-1)"
107 | DIVNUM="$(shuf -n 1 -i 0-1)"
108 | [ "$INVNUM" = 0 ] && ADDSUB="-" || ADDSUB="+"
109 | [ "$DIVNUM" = 0 ] && DIVISOR=" / 2" || DIVISOR=""
110 | BINDPROCUPTIM2="$(shuf -n 1 -i 10000-33333)"
111 | BINDPROCUPTIM0="$(((BINDPROCUPTIM2 * 3)$DIVISOR))"
112 | BINDPROCUPTIM1="$(shuf -n 1 -i 33-66)"
113 | BINDPROCUPTIM3="$((BINDPROCUPTIM1 $ADDSUB $(shuf -n 1 -i 0-33)))"
114 | printf "%s.%02d %s.%02d\\n" "$BINDPROCUPTIM0" "$BINDPROCUPTIM1" "$BINDPROCUPTIM2" "$BINDPROCUPTIM3" > var/binds/fbindprocuptime
115 | }
116 |
117 | _ADDfbindprocversion_() {
118 | printf "%s\\n" "Linux version $UNAMER (root@localhost) (gcc version $UNAMER (prerelease) (GCC) ) #1 SMP PREEMPT $(date +%a" "%b" "%d" "%X" UTC "%Y)" > var/binds/fbindprocversion
119 | }
120 |
121 | _ADDbindexample.prs_() {
122 | _CFLHDRS_ var/binds/bindexample.prs "# Before regenerating the start script with \`setupTermuxArch re[fresh]\`, first copy this file to another name such as \`fbinds.prs\`. Then add as many proot statements as you want; The init script will parse file \`fbinds.prs\` at refresh adding these proot options to \`$STARTBIN\`. The space before the last double quote is necessary. Examples are included for convenience:"
123 | printf "%s\\n" "## PRoot bind usage: PROOTSTMNT+=\"-b host_path:guest_path \"
124 | ## PROOTSTMNT+=\"-q $PREFIX/bin/${COMMS:-qemu-x86_64} \"
125 | ## PROOTSTMNT+=\"-b /proc:/proc \"
126 | ## [ -r /dev/shm ] || PROOTSTMNT+=\"-b $INSTALLDIR/tmp:/dev/shm \"
127 | ## ~/${INSTALLDIR##*/}$TMXRCHBNDR/bindexample.prs FE" >> var/binds/bindexample.prs
128 | }
129 |
130 | _ADDfbindkvm_() {
131 | :>var/binds/fbindkvm
132 | chmod 666 var/binds/fbindkvm
133 | }
134 |
135 | _ADDbindprocloadavg_() {
136 | printf "%s" "0.$(shuf -n 1 -i 48-64) 0.$(shuf -n 1 -i 32-48) 0.$(shuf -n 1 -i 24-32) 1/$(shuf -n 1 -i 128-1024) $(shuf -n 1 -i 333333-999999)
137 | " > var/binds/fbindprocloadavg
138 | }
139 |
140 | _ADDbindprocvmstat_() {
141 | printf "%s\\n" "nr_free_pages $(shuf -n 1 -i 9216-18432)
142 | nr_zone_inactive_anon 196744
143 | nr_zone_active_anon 301503
144 | nr_zone_inactive_file 2457066
145 | nr_zone_active_file 729742
146 | nr_zone_unevictable 164
147 | nr_zone_write_pending 8
148 | nr_mlock 34
149 | nr_page_table_pages 6925
150 | nr_kernel_stack 13216
151 | nr_bounce 0
152 | nr_zspages 0
153 | nr_free_cma 0
154 | numa_hit 672391199
155 | numa_miss 0
156 | numa_foreign 0
157 | numa_interleave 62816
158 | numa_local 672391199
159 | numa_other 0
160 | nr_inactive_anon 196744
161 | nr_active_anon 301503
162 | nr_inactive_file 2457066
163 | nr_active_file 729742
164 | nr_unevictable 164
165 | nr_slab_reclaimable 132891
166 | nr_slab_unreclaimable 38582
167 | nr_isolated_anon 0
168 | nr_isolated_file 0
169 | workingset_nodes 25623
170 | workingset_refault 46689297
171 | workingset_activate 4043141
172 | workingset_restore 413848
173 | workingset_nodereclaim 35082
174 | nr_anon_pages 599893
175 | nr_mapped 136339
176 | nr_file_pages 3086333
177 | nr_dirty 8
178 | nr_writeback 0
179 | nr_writeback_temp 0
180 | nr_shmem 13743
181 | nr_shmem_hugepages 0
182 | nr_shmem_pmdmapped 0
183 | nr_file_hugepages 0
184 | nr_file_pmdmapped 0
185 | nr_anon_transparent_hugepages 57
186 | nr_unstable 0
187 | nr_vmscan_write 57250
188 | nr_vmscan_immediate_reclaim 2673
189 | nr_dirtied 79585373
190 | nr_written 72662315
191 | nr_kernel_misc_reclaimable 0
192 | nr_dirty_threshold 657954
193 | nr_dirty_background_threshold 328575
194 | pgpgin 372097889
195 | pgpgout 296950969
196 | pswpin 14675
197 | pswpout 59294
198 | pgalloc_dma 4
199 | pgalloc_dma32 101793210
200 | pgalloc_normal 614157703
201 | pgalloc_movable 0
202 | allocstall_dma 0
203 | allocstall_dma32 0
204 | allocstall_normal 184
205 | allocstall_movable 239
206 | pgskip_dma 0
207 | pgskip_dma32 0
208 | pgskip_normal 0
209 | pgskip_movable 0
210 | pgfree 716918803
211 | pgactivate 68768195
212 | pgdeactivate 7278211
213 | pglazyfree 1398441
214 | pgfault 491284262
215 | pgmajfault 86567
216 | pglazyfreed 1000581
217 | pgrefill 7551461
218 | pgsteal_kswapd 130545619
219 | pgsteal_direct 205772
220 | pgscan_kswapd 131219641
221 | pgscan_direct 207173
222 | pgscan_direct_throttle 0
223 | zone_reclaim_failed 0
224 | pginodesteal 8055
225 | slabs_scanned 9977903
226 | kswapd_inodesteal 13337022
227 | kswapd_low_wmark_hit_quickly 33796
228 | kswapd_high_wmark_hit_quickly 3948
229 | pageoutrun 43580
230 | pgrotated 200299
231 | drop_pagecache 0
232 | drop_slab 0
233 | oom_kill 0
234 | numa_pte_updates 0
235 | numa_huge_pte_updates 0
236 | numa_hint_faults 0
237 | numa_hint_faults_local 0
238 | numa_pages_migrated 0
239 | pgmigrate_success 768502
240 | pgmigrate_fail 1670
241 | compact_migrate_scanned 1288646
242 | compact_free_scanned 44388226
243 | compact_isolated 1575815
244 | compact_stall 863
245 | compact_fail 392
246 | compact_success 471
247 | compact_daemon_wake 975
248 | compact_daemon_migrate_scanned 613634
249 | compact_daemon_free_scanned 26884944
250 | htlb_buddy_alloc_success 0
251 | htlb_buddy_alloc_fail 0
252 | unevictable_pgs_culled 258910
253 | unevictable_pgs_scanned 3690
254 | unevictable_pgs_rescued 200643
255 | unevictable_pgs_mlocked 199204
256 | unevictable_pgs_munlocked 199164
257 | unevictable_pgs_cleared 6
258 | unevictable_pgs_stranded 6
259 | thp_fault_alloc 10655
260 | thp_fault_fallback 130
261 | thp_collapse_alloc 655
262 | thp_collapse_alloc_failed 50
263 | thp_file_alloc 0
264 | thp_file_mapped 0
265 | thp_split_page 612
266 | thp_split_page_failed 0
267 | thp_deferred_split_page 11238
268 | thp_split_pmd 632
269 | thp_split_pud 0
270 | thp_zero_page_alloc 2
271 | thp_zero_page_alloc_failed 0
272 | thp_swpout 4
273 | thp_swpout_fallback 0
274 | balloon_inflate 0
275 | balloon_deflate 0
276 | balloon_migrate 0
277 | swap_ra 9661
278 | swap_ra_hit 7872" > var/binds/fbindprocvmstat
279 | }
280 |
281 | _ADDfbindsysdevices_() {
282 | :>var/binds/fbindsysdevices
283 | chmod 666 var/binds/fbindsysdevices
284 | }
285 | # fbindsfunctions.bash FE
286 |
--------------------------------------------------------------------------------
/getimagefunctions.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Copyright 2017-2022 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
3 | ## Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
4 | ## https://sdrausty.github.io/TermuxArch/README has info about this project.
5 | ## https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
6 | ################################################################################
7 | _FTCHIT_() {
8 | _PRINT_DOWNLOADING_FTCHIT_
9 | if [[ "$DM" = aria2 ]]
10 | then
11 | aria2c --continue -Z http://"$CMIRROR/$RPATH/$IFILE".md5 http://"$CMIRROR/$RPATH/$IFILE"
12 | elif [[ "$DM" = axel ]]
13 | then
14 | axel -a --no-clobber http://"$CMIRROR/$RPATH/$IFILE".md5 ||:
15 | axel -a --no-clobber http://"$CMIRROR/$RPATH/$IFILE" ||:
16 | elif [[ "$DM" = lftp ]]
17 | then
18 | lftpget -c http://"$CMIRROR/$RPATH/$IFILE".md5 http://"$CMIRROR/$RPATH/$IFILE"
19 | elif [[ "$DM" = wget ]]
20 | then
21 | wget "$DMVERBOSE" --continue --show-progress -N http://"$CMIRROR/$RPATH/$IFILE".md5 http://"$CMIRROR/$RPATH/$IFILE"
22 | else
23 | curl "$DMVERBOSE" -C - --fail --retry 4 -OL {"http://$CMIRROR/$RPATH/$IFILE.md5,http://$CMIRROR/$RPATH/$IFILE"}
24 | fi
25 | }
26 |
27 | _FTCHSTND_() {
28 | FSTND=1
29 | _PRINTCONTACTING_
30 | if [[ "$DM" = aria2 ]]
31 | then
32 | aria2c http://"$CMIRROR" 1>"$TMPDIR/global2localmirror"
33 | NLCMIRROR="$(grep Redirecting "$TMPDIR/global2localmirror" | awk {'print $8'})"
34 | _PRINTDONE_
35 | _PRINTDOWNLOADINGFTCH_
36 | aria2c --continue -m 4 -Z "$NLCMIRROR/$RPATH/$IFILE".md5 "$NLCMIRROR/$RPATH/$IFILE"
37 | elif [[ "$DM" = axel ]]
38 | then
39 | axel -vv http://"$CMIRROR" 1 > "$TMPDIR/global2localmirror"
40 | NLCMIRR="$(grep downloading "$TMPDIR/global2localmirror" | awk {'print $5'})"
41 | NLCMIRROR="${NLCMIRR::-3}"
42 | _PRINTDONE_
43 | _PRINTDOWNLOADINGFTCH_
44 | axel -a --no-clobber http://"$NLCMIRROR/$RPATH/$IFILE".md5 ||:
45 | axel -a --no-clobber http://"$NLCMIRROR/$RPATH/$IFILE" ||:
46 | elif [[ "$DM" = lftp ]]
47 | then
48 | lftp -e get http://"$CMIRROR" 2>&1 | tee>"$TMPDIR/global2localmirror"
49 | NLCMI="$(grep direct "$TMPDIR/global2localmirror" | awk {'print $5'})"
50 | NLCMIRR="${NLCMI//\`}"
51 | NLCMIRROR="${NLCMIRR//\'}"
52 | _PRINTDONE_
53 | _PRINTDOWNLOADINGFTCH_
54 | lftpget -c "$NLCMIRROR/$RPATH/$IFILE".md5 "$NLCMIRROR/$RPATH/$IFILE"
55 | elif [[ "$DM" = wget ]]
56 | then
57 | wget -v -O/dev/null "$CMIRROR" 2>"$TMPDIR/global2localmirror"
58 | NLCMIRROR="$(grep Location "$TMPDIR/global2localmirror" | awk {'print $2'})"
59 | _PRINTDONE_
60 | _PRINTDOWNLOADINGFTCH_
61 | wget "$DMVERBOSE" --continue --show-progress "$NLCMIRROR/$RPATH/$IFILE".md5 "$NLCMIRROR/$RPATH/$IFILE"
62 | else
63 | curl -v "$CMIRROR" &> "$TMPDIR/global2localmirror"
64 | NLCMIRROR="$(grep Location "$TMPDIR/global2localmirror" | awk {'print $3'})"
65 | NLCMIRROR="${NLCMIRROR%$'\r'}" # remove trailing carrage return: strip bash variable of non printing characters
66 | _PRINTDONE_
67 | _PRINTDOWNLOADINGFTCH_
68 | curl "$DMVERBOSE" -C - --fail --retry 4 -OL {"$NLCMIRROR/$RPATH/$IFILE.md5,$NLCMIRROR/$RPATH/$IFILE"}
69 | fi
70 | rm -f "$TMPDIR/global2localmirror"
71 | }
72 |
73 | _GETIMAGE_() {
74 | _PRINTDOWNLOADINGX86_
75 | if [[ "$DM" = aria2 ]]
76 | then
77 | aria2c http://"$CMIRROR/$RPATH/$IFILE".md5
78 | _ISX86_
79 | aria2c --continue http://"$CMIRROR/$RPATH/$IFILE"
80 | elif [[ "$DM" = axel ]]
81 | then
82 | axel -a --no-clobber http://"$CMIRROR/$RPATH/$IFILE".md5 ||:
83 | _ISX86_
84 | axel -a --no-clobber http://"$CMIRROR/$RPATH/$IFILE" ||:
85 | elif [[ "$DM" = lftp ]]
86 | then
87 | lftpget http://"$CMIRROR/$RPATH"/md5sums.txt || lftpget http://"$CMIRROR/$RPATH"/md5sums.txt
88 | _ISX86_
89 | lftpget -c http://"$CMIRROR/$RPATH/$IFILE" || lftpget -c http://"$CMIRROR/$RPATH/$IFILE"
90 | elif [[ "$DM" = wget ]]
91 | then
92 | wget "$DMVERBOSE" -N --show-progress http://"$CMIRROR/$RPATH/"md5sums.txt
93 | _ISX86_
94 | wget "$DMVERBOSE" --continue --show-progress http://"$CMIRROR/$RPATH/$IFILE"
95 | else
96 | curl "$DMVERBOSE" --fail --retry 4 -OL http://"$CMIRROR/$RPATH"/md5sums.txt
97 | _ISX86_
98 | curl "$DMVERBOSE" -C - --fail --retry 4 -OL http://"$CMIRROR/$RPATH/$IFILE"
99 | fi
100 | }
101 |
102 | _ISX86_() {
103 | if [[ "$CPUABI" = "$CPUABIX86" ]]
104 | then
105 | IFILE="$(grep i686 md5sums.txt | awk {'print $2'} ||:)"
106 | else
107 | IFILE="$(grep boot md5sums.txt | awk {'print $2'} ||:)"
108 | fi
109 | sed '2q;d' md5sums.txt > "$IFILE".md5 2>/dev/null ||:
110 | rm -f md5sums.txt
111 | rm -f \.md5
112 | _PRINTDOWNLOADINGX86TWO_
113 | }
114 | # getimagefunctions.bash FE
115 |
--------------------------------------------------------------------------------
/initkeyfunctions.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Copyright 2017-2022 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
3 | ## Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
4 | ## https://sdrausty.github.io/TermuxArch/README has info about this project.
5 | ## https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
6 | ################################################################################
7 | declare -a USRINITFILES # declare array for user init files
8 | USRINITFILES=(BASH_PROFILEFILE BASHRCFILE CSHRCFILE EMACSITFILE GITCONFIGFILE INITRCFILE INPUTRCFILE VIMRCFILE PROFILEFILE ZSHRCFILE)
9 | _ADDADDS_() {
10 | _ADDREADME_
11 | _ADDae_
12 | _ADDauser_
13 | printf '\e[0;32mGenerating dot files: \e[1;32mBEGUN…\n'
14 | _ADDbash_logout_
15 | _ADDbash_profile_
16 | _ADDbashrc_
17 | _ADDbindexample.prs_
18 | _ADDcams_
19 | _ADDcshrc_
20 | _ADDcdtd_
21 | _ADDcdth_
22 | _ADDcdtmp_
23 | _ADDch_
24 | _ADDchperms.cache+gnupg_
25 | _ADDcsystemctl_
26 | _ADDcolorizebashrc_
27 | _ADDes_
28 | _ADDexd_
29 | _ADDfibs_
30 | _ADDga_
31 | _ADDgcl_
32 | _ADDgclone_
33 | _ADDgcm_
34 | _ADDgitconfig_
35 | _ADDgp_
36 | _ADDgpl_
37 | _ADDgsu_
38 | _ADDgmu_
39 | _ADDhunf_
40 | _ADDhunw_
41 | _ADDinfo_
42 | _ADDinitfbinds_
43 | _ADDinitrc_
44 | _ADDinputrc_
45 | _ADDkeys_
46 | _ADDmakelibguestfs_
47 | _ADDmakeauraclegit_
48 | _ADDmakeaurto_
49 | _ADDmakeaurbauerbill_
50 | _ADDmakeaurfakeroottcp_
51 | _ADDmakeaurghcuphs_
52 | _ADDmakeaurhelpers_
53 | _ADDmakeaurjqgit_
54 | _ADDmakeaurpacaur_
55 | _ADDmakeaurpacaurgit_
56 | _ADDmakeaurpackagequery_
57 | _ADDmakeaurpakku_
58 | _ADDmakeaurpakkugit_
59 | _ADDmakeaurpakkugui_
60 | _ADDmakeaurpakkuguigit_
61 | _ADDmakeaurparu_
62 | _ADDmakeaurparubin_
63 | _ADDmakeaurparugit_
64 | _ADDmakeaurparuz_
65 | _ADDmakeaurpbget_
66 | _ADDmakeaurpikaur_
67 | _ADDmakeaurpikaurgit_
68 | _ADDmakeaurpipessh_
69 | _ADDmakeaurpkgbuilder_
70 | _ADDmakeaurpkgbuildergit_
71 | _ADDmakeaurpm2ml_
72 | _ADDmakeaurpowerpill_
73 | _ADDmakeaurpopularpackages_
74 | _ADDmakeaurpyinstaller_
75 | _ADDmakeaurpyinstallerhookscontrib_
76 | _ADDmakeaurpythonaltgraph_
77 | _ADDmakeaurpython3colorsysplus_
78 | _ADDmakeaurpython3memoizedb_
79 | _ADDmakeaurpython3xcgf_
80 | _ADDmakeaurpython3xcpf_
81 | _ADDmakeaurpython3aur_
82 | _ADDmakeaurpuyo_
83 | _ADDmakeaurrepoctl_
84 | _ADDmakeaurrepoctlgit_
85 | _ADDmakeaurrepofish_
86 | _ADDmakeaurrustup_
87 | _ADDmakeaurshellcheckbin_
88 | _ADDmakeaurshellcheckgit_
89 | _ADDmakeaurshellcheckgitstatic_
90 | _ADDmakeaurtrizen_
91 | _ADDmakeaurtrizengit_
92 | _ADDmakeaurutils_
93 | _ADDmakeaurutilsgit_
94 | _ADDmakeauryaah_
95 | _ADDmakeauryay_
96 | _ADDmakeaurzigzag_
97 | _ADDmakefakeroottcp_
98 | _ADDmakeksh_
99 | _ADDmakeyay_
100 | _ADDmemav_
101 | _ADDmemfree_
102 | _ADDmeminfo_
103 | _ADDmemmem_
104 | _ADDmemtot_
105 | _ADDopen4root_
106 | _ADDorcaconf_
107 | _ADDpatchmakepkg_
108 | _ADDpacmandblock_
109 | _ADDpc_
110 | _ADDpci_
111 | _ADDpinghelp_
112 | _ADDprofile_
113 | if [ -n "${VLORALCR:-}" ]
114 | then
115 | _ADDprofileetc_
116 | _ADDprofileusretc_
117 | fi
118 | _ADDresolvconf_
119 | _PREPMOTS_
120 | _ADDmota_
121 | _ADDmotd_
122 | _ADDmoto_
123 | _ADDstriphtmlcodefromfile_
124 | _ADDt_
125 | _ADDtlmgrinstaller_
126 | [ -f $TMXRCHBNDS/top ] || _ADDtop_
127 | _ADDthstartarch_
128 | _ADDtimings_
129 | # _ADDtools_
130 | _ADDtour_
131 | _ADDtrim_
132 | _ADDv_
133 | _ADDwe_
134 | _ADDyt_
135 | _ADDzshrc_
136 | }
137 | _ADDauser_() {
138 | _CFLHDR_ $TMXRCHBNDS/addauser "# add Arch Linux in TermuxArch PRoot QEMU user"
139 | cat >> $TMXRCHBNDS/addauser <<- EOM
140 | _HUSDIRC_() {
141 | if [ "\$UID" != 0 ]
142 | then
143 | WHOAMI="\$(whoami)"
144 | printf "\\\\e[1;31mUSAGE:\\\\e[1;37m %s\\\\e[1;31m: Exiting...\\\\e[0m\\\\n" "Script '\${0##*/}' should be run using the root account, not the '\$WHOAMI' account. Alternatively '\${0##*/}' can be used with the 'sudo' command, 'sudo \${0##*/} user'"
145 | exit 202
146 | fi
147 | if [ \$# = 0 ]
148 | then
149 | printf "\\\\e[1;31mUSAGE: \\\\e[1;37m'addauser username'\\\\e[1;32m: Exiting...\\\\n"
150 | exit 201
151 | fi
152 | if [[ -d "/home/\$1" ]]
153 | then
154 | printf "\\\\e[1;33mDirectory: \\\\e[1;37m'/home/%s exists'\\\\e[0;32m: Exiting...\\\\n" "\$1"
155 | else
156 | _FUNADDU_ "\$@"
157 | fi
158 | }
159 | _FUNADDU_() {
160 | command -v sudo 1>/dev/null || { "$TMXRCHBNDR"/pc sudo || "$TMXRCHBNDR"/pc sudo ; }
161 | printf "\\\\e[0;32m%s\\\\n\\\\e[1;32m" "Adding Arch Linux in TermuxArch PRoot QEMU user '\$1' and creating Arch Linux in TermuxArch PRoot QEMU user \$1's home directory in /home/\$1..."
162 | [ -f /etc/sudoers ] || :>/etc/sudoers
163 | sed -i "/# %wheel ALL=(ALL) NOPASSWD: ALL/ s/^# *//" /etc/sudoers
164 | sed -i "/# ALL ALL=(ALL) ALL/ s/^# *//" /etc/sudoers
165 | sed -i "s/# ALL ALL=(ALL) ALL/ALL ALL=(ALL) NOPASSWD: ALL/g" /etc/sudoers
166 | printf '%s\\n' "\$1 ALL=(ALL) ALL" >> /etc/sudoers
167 | grep -q 'ftp_proxy' /etc/sudoers || printf "%s\\\\n" 'Defaults env_keep += "ftp_proxy http_proxy https_proxy"' >> /etc/sudoers
168 | sed -i "s/required/sufficient/g" /etc/pam.d/su
169 | sed -i "s/^#auth/auth/g" /etc/pam.d/su
170 | useradd -k /root -m -s /bin/bash "\$1" -U
171 | usermod "\$1" -aG wheel
172 | chage -I -1 -m 0 -M -1 -E -1 "\$1"
173 | passwd -d "\$1"
174 | chmod 775 "/home/\$1"
175 | sed -i "s/\$1:x/\$1:/g" /etc/passwd
176 | printf "\\\\e[0;32m%s\\\\e[1;32m%s\\\\e[0;32m%s\\\\e[1;32m%s\\\\e[0;32m%s\\\\e[1;32m%s\\\\e[0;32m%s\\\\e[1;32m%s\\\\e[0;32m%s\\\\e[0m\\\\n" "Added Arch Linux in TermuxArch PRoot QEMU user " "'\$1'" " and configured user '\$1' for use with the Arch Linux command 'sudo'. Created Arch Linux user \$1's home directory in /home/\$1. To use this account run " "'$STARTBIN login \$1'" " from the shell in Termux. To add user accounts you can use " "'addauser \$1'" " in Arch Linux and " "'$STARTBIN c[ommand] addauser \$1'" " in a default Termux shell. Please do not nest proot in proot by using '$STARTBIN' in '$STARTBIN' as this is known to cause issues for users of PRoot."
177 | }
178 | _PMFSESTRING_() {
179 | printf "\\\\e[1;31m%s\\\\e[0;31m%s\\\\e[0;36m%s\\\\n\\\\n" "Signal generated in '\$1'; " "Cannot complete task; " "Continuing..."
180 | printf "\\\\e[1;34m%s\\\\e[0;34m%s\\\\e[1;34m%s\\\\e[0;34m%s\\\\e[1;34m%s\\\\e[0m\\\\n\\\\n" " If you find improvements for " "${0##*}" " and " "\${0##*}" " please open an issue and an accompanying pull request."
181 | }
182 | _HUSDIRC_ "\$@"
183 | ## $INSTALLDIR$TMXRCHBNDR/addauser FE
184 | EOM
185 | chmod 755 $TMXRCHBNDS/addauser
186 | }
187 |
188 | _ADDkeys_() {
189 | if [[ "$CPUABI" = "$CPUABIX86" ]]
190 | then # set customized commands for Arch Linux 32 architecture
191 | X86INT="_CURLDWND_() { { [ \"\${CURLDWNDVAR_:-}\" = 0 ] && curl -C - --insecure --fail --retry 4 -OL https://archive.archlinux32.org/packages/\"\$UPGDPAKG\".sig -OL https://archive.archlinux32.org/packages/\"\$UPGDPAKG\" ; } || { curl -C - --fail --retry 4 -OL https://archive.archlinux32.org/packages/\"\$UPGDPAKG\".sig -OL https://archive.archlinux32.org/packages/\"\$UPGDPAKG\" || { CURLDWNDVAR_=0 && printf '%s\\n' \"Running command 'curl --insecure'; Continuing...\" && curl -C - --insecure --fail --retry 4 -OL https://archive.archlinux32.org/packages/\"\$UPGDPAKG\".sig -OL https://archive.archlinux32.org/packages/\"\$UPGDPAKG\" ; } ; } ; }
192 |
193 | UPGDPKGS=(\"a/archlinux-keyring/archlinux-keyring-20191219-1.0-any.pkg.tar.xz\" \"a/archlinux32-keyring/archlinux32-keyring-20191230-1.0-any.pkg.tar.xz\" \"g/glibc/glibc-2.28-1.1-i686.pkg.tar.xz\" \"l/linux-api-headers/linux-api-headers-5.3.1-2.0-any.pkg.tar.xz\" \"l/libarchive/libarchive-3.3.3-1.0-i686.pkg.tar.xz\" \"o/openssl/openssl-1.1.1.d-2.0-i686.pkg.tar.xz\" \"p/pacman/pacman-5.2.1-1.4-i686.pkg.tar.xz\" \"z/zstd/zstd-1.4.4-1.0-i686.pkg.tar.xz\" \"/c/coreutils/coreutils-8.31-3.0-i686.pkg.tar.xz\" \"w/which/which-2.21-5.0-i686.pkg.tar.xz\" \"g/grep/grep-3.3-3.0-i686.pkg.tar.xz\" \"g/gzip/gzip-1.10-3.0-i686.pkg.tar.xz\" \"l/less/less-551-3.0-i686.pkg.tar.xz\" \"s/sed/sed-4.7-3.0-i686.pkg.tar.xz\" \"u/unzip/unzip-6.0-13.1-i686.pkg.tar.xz\")
194 |
195 | cp -f /usr/lib/{libcrypto.so.1.0.0,libssl.so.1.0.0} \"\$TMPDIR\"
196 | cd /var/cache/pacman/pkg/ || exit 196
197 | _DWLDFILE_() { { printf \"%s\\n\\n\" \"Downloading signature file and file '\${UPGDPAKG##*/}' from https://archive.archlinux32.org.\" && _CURLDWND_ && printf \"%s\\n\\n\" \"Finished downloading signature file and file '\${UPGDPAKG##*/}' from https://archive.archlinux32.org.\" ; } || _PRTERROR_ ; }
198 | if [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep1.lock ] && [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep2.lock ] && [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep3.lock ] && [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep4.lock ] && [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep5.lock ]
199 | then
200 | printf \"\\n%s\\n\" \"Downloading transition package and signature files from https://archive.archlinux32.org; DONE \"
201 | else
202 | printf \"%s\\n\" \"Downloading files: '\$(printf \"%s \" \"\${UPGDPKGS[@]##*/}\")' from https://archive.archlinux32.org.\"
203 | for UPGDPAKG in \${UPGDPKGS[@]}
204 | do
205 | if [[ -f /var/cache/pacman/pkg/\"\${UPGDPAKG##*/}\" ]]
206 | then
207 | printf \"%s\\n\" \"File '\${UPGDPAKG##*/}' is already downloaded.\"
208 | else
209 | _DWLDFILE_ || _DWLDFILE_
210 | fi
211 | done
212 | fi
213 |
214 | _PMUEOEP1_() {
215 | if [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep1.lock ]
216 | then
217 | printf \"\\n\\e[1;37m%s\\e[1;32m%s\\e[1;37m%s\\n\" \"[\$2/6] The command \" \"pacman -U \${UPGDPKGS[\$1]##*/} --needed --noconfirm\" \" has already been successfully run; Continuing...\"
218 | else
219 | printf \"\\n\\e[1;32m==> \\e[1;37m%s\\e[1;32m%s\\e[1;37m...\\n\" \"Running command \${0##*/} [\$2/6] $ARCHITEC ($CPUABI) architecture upgrade ; \" \"pacman -U \${UPGDPKGS[\$1]##*/} --needed --noconfirm\"
220 | pacman -U /var/cache/pacman/pkg/\"\${UPGDPKGS[\$1]##*/}\" --needed --noconfirm && :>/var/run/lock/"${INSTALLDIR##*/}"/kpmueoep1.lock
221 | fi
222 | }
223 |
224 | _PMUEOEP2_() { # depreciated
225 | if [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep2.lock ]
226 | then
227 | printf \"\\n\\e[1;37m%s\\e[1;32m%s\\e[1;37m%s\\n\" \"[\$3/6] The command \" \"pacman -U \${UPGDPKGS[\$1]##*/} \${UPGDPKGS[\$2]##*/} --needed --noconfirm\" \" has already been successfully run; Continuing...\"
228 | else
229 | printf \"\\n\\e[1;32m==> \\e[1;37m%s\\e[1;32m%s\\e[1;37m...\\n\" \"Running command \${0##*/} [\$3/6] $ARCHITEC ($CPUABI) architecture upgrade ; \" \"pacman -U \${UPGDPKGS[\$1]##*/} \${UPGDPKGS[\$2]##*/} --needed --noconfirm\"
230 | pacman -U /var/cache/pacman/pkg/\"\${UPGDPKGS[\$1]##*/}\" /var/cache/pacman/pkg/\"\${UPGDPKGS[\$2]##*/}\" --needed --noconfirm && :>/var/run/lock/"${INSTALLDIR##*/}"/kpmueoep2.lock
231 | fi
232 | }
233 |
234 | _PMUEOEP3_() {
235 | if [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep3.lock ]
236 | then
237 | printf \"\\n\\e[1;37m%s\\e[1;32m%s\\e[1;37m%s\\e[0m\\n\" \"[\$4/6] The command \" \"pacman -U \${UPGDPKGS[\$1]##*/} \${UPGDPKGS[\$2]##*/} \${UPGDPKGS[\$3]##*/} --needed --noconfirm\" \" has already been successfully run; Continuing...\"
238 | else
239 | printf \"\\n\\e[1;32m==> \\e[1;37m%s\\e[1;32m%s\\e[1;37m...\\n\" \"Running command \${0##*/} [\$4/6] $ARCHITEC ($CPUABI) architecture upgrade ; \" \"pacman -U \${UPGDPKGS[\$1]##*/} \${UPGDPKGS[\$2]##*/} \${UPGDPKGS[\$3]##*/} --needed --noconfirm\"
240 | pacman -U /var/cache/pacman/pkg/\"\${UPGDPKGS[\$1]##*/}\" /var/cache/pacman/pkg/\"\${UPGDPKGS[\$2]##*/}\" /var/cache/pacman/pkg/\"\${UPGDPKGS[\$3]##*/}\" --needed --noconfirm && :>/var/run/lock/"${INSTALLDIR##*/}"/kpmueoep3.lock
241 | fi
242 | }
243 |
244 | _PMUEOEP4_() {
245 | if [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep4.lock ]
246 | then
247 | printf \"\\n\\e[1;37m%s\\e[1;32m%s\\e[1;37m%s\\e[0m\\n\" \"[\$5/6] The command \" \"pacman -U \${UPGDPKGS[\$1]##*/} \${UPGDPKGS[\$2]##*/} \${UPGDPKGS[\$3]##*/} \${UPGDPKGS[\$4]##*/} --needed --noconfirm\" \" has already been successfully run; Continuing...\"
248 | else
249 | printf \"\\n\\e[1;32m==> \\e[1;37m%s\\e[1;32m%s\\e[1;37m...\\n\" \"Running command \${0##*/} [\$5/6] $ARCHITEC ($CPUABI) architecture upgrade ; \" \"pacman -U \${UPGDPKGS[\$1]##*/} \${UPGDPKGS[\$2]##*/} \${UPGDPKGS[\$3]##*/} \${UPGDPKGS[\$4]##*/} --needed --noconfirm\"
250 | pacman -U /var/cache/pacman/pkg/\"\${UPGDPKGS[\$1]##*/}\" /var/cache/pacman/pkg/\"\${UPGDPKGS[\$2]##*/}\" /var/cache/pacman/pkg/\"\${UPGDPKGS[\$3]##*/}\" /var/cache/pacman/pkg/\"\${UPGDPKGS[\$4]##*/}\" --needed --noconfirm && :>/var/run/lock/"${INSTALLDIR##*/}"/kpmueoep4.lock
251 | fi
252 | }
253 |
254 | _PMUEOEP5_() {
255 | if [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpmueoep5.lock ]
256 | then
257 | printf \"\\n\\e[1;37m%s\\e[1;32m%s\\e[1;37m%s\\e[0m\\n\" \"[\$6/6] The command \" \"pacman -U \${UPGDPKGS[\$1]##*/} \${UPGDPKGS[\$2]##*/} \${UPGDPKGS[\$3]##*/} \${UPGDPKGS[\$4]##*/} \${UPGDPKGS[\$5]##*/} --needed --noconfirm\" \" has already been successfully run; Continuing...\"
258 | else
259 | printf \"\\n\\e[1;32m==> \\e[1;37m%s\\e[1;32m%s\\e[0m...\\n\" \"Running command \${0##*/} [\$6/6] $ARCHITEC ($CPUABI) architecture upgrade ; \" \"pacman -U \${UPGDPKGS[\$1]##*/} \${UPGDPKGS[\$2]##*/} \${UPGDPKGS[\$3]##*/} \${UPGDPKGS[\$4]##*/} \${UPGDPKGS[\$5]##*/} --needed --noconfirm\"
260 | pacman -U /var/cache/pacman/pkg/\"\${UPGDPKGS[\$1]##*/}\" /var/cache/pacman/pkg/\"\${UPGDPKGS[\$2]##*/}\" /var/cache/pacman/pkg/\"\${UPGDPKGS[\$3]##*/}\" \"\${UPGDPKGS[\$4]##*/}\" \"\${UPGDPKGS[\$5]##*/}\" --needed --noconfirm && :>/var/run/lock/"${INSTALLDIR##*/}"/kpmueoep5.lock
261 | fi
262 | }
263 | [ -f /etc/pacman.conf ] || cp /etc/pacman.conf /var/backups/"${INSTALLDIR##*/}"/etc/pacman.conf."$SDATE".bkp
264 | { [ -x /system/bin/sed ] && /system/bin/sed -i '/^LocalFileSigLevel/s/.*/SigLevel = Never/' /etc/pacman.conf ; } || sed -i '/^LocalFileSigLevel/s/.*/SigLevel = Never/' /etc/pacman.conf
265 | _PMUEOEP1_ 1 1
266 | _KEYSGENMSG_
267 | printf \"\\e[1;32m==> \\e[1;37mRunning command %s \\e[1;32mpacman -Ss keyring --color=always\\e[1;37m...\\n\" \"\${0##*/}\"
268 | pacman -Ss keyring --color=always || _PRTERROR_
269 | _PMUEOEP5_ 9 10 11 12 13 2
270 | _PMUEOEP4_ 2 3 7 8 3
271 | _PMUEOEP3_ 4 5 6 4
272 | mv -f \"\$TMPDIR\"/{libcrypto.so.1.0.0,libssl.so.1.0.0} /usr/lib/
273 | sed -i '/^Architecture/s/.*/Architecture = i686/' /etc/pacman.conf
274 | sed -i '/^SigLevel/s/.*/SigLevel = Never/' /etc/pacman.conf
275 | sed -i 's/^HoldPkg/\#HoldPkg/g' /etc/pacman.conf
276 | if [ ! -f /var/run/lock/"${INSTALLDIR##*/}"/keyring.lock ]
277 | then
278 | printf \"\\n\\e[1;32m==> \\e[1;37m%s\\e[1;32m%s\\e[1;37m...\\n\" \"Running command \${0##*/} [5/6] $ARCHITEC ($CPUABI) architecture upgrade ; \" \"pacman -S archlinux-keyring archlinux32-keyring --needed --noconfirm\"
279 | _KEYSGENMSG_
280 | { { pacman -S archlinux-keyring archlinux32-keyring --needed --noconfirm || pacman -Sy archlinux-keyring archlinux32-keyring --needed --noconfirm ; } && sed -i '/^SigLevel/s/.*/SigLevel = Required DatabaseOptional/' /etc/pacman.conf && PACMANQ_=\"\$(pacman -Qo /usr/lib/libblkid.so)\" && { [[ \"\$(printf $\{PACMANQ_/libsutil-linux})\" == *libsutil-linux* ]] || pacman -Rdd libutil-linux --noconfirm || _PRTERROR_ ; } && :>/var/run/lock/"${INSTALLDIR##*/}"/keyring.lock ; }
281 | else
282 | printf \"\\n\\e[1;37m%s\\e[1;32m%s\\e[1;37m%s\\e[0m\\n\" \"[5/6] The command \" \"pacman -S archlinux-keyring archlinux32-keyring --needed --noconfirm\" \" has already been successfully run; Continuing...\"
283 | fi
284 | rm -f /etc/ssl/certs/ca-certificates.crt
285 | sed -i '/^LocalFileSigLevel/s/.*/SigLevel = Optional/' /etc/pacman.conf
286 | sed -i '/^SigLevel/s/.*/SigLevel = Optional/' /etc/pacman.conf
287 | printf \"\\n\\e[1;32m==> \\e[1;37m%s\\e[1;32m%s\\e[1;37m...\\n\" \"Running command \${0##*/} [6/6] $ARCHITEC ($CPUABI) architecture upgrade ; \" \"pacman -Su --needed --noconfirm ; Starting full system upgrade\"
288 | pacman -Sy || pacman -Sy || sudo pacman -Sy"
289 | X86IPT=" "
290 | X86INK=":"
291 | else # Arch Linux architectures armv7, aarch64 and x86_64 use these options
292 | X86INT=":"
293 | X86IPT="(1/2)"
294 | X86INK="[ \"\${#ARGS}\" = 0 ] || { printf \"\\\\n\\\\e[1;32m==> \\\\e[1;37mRunning command \\\\e[1;32mpacman -S %s --needed --noconfirm --color=always\\\\e[1;37m...\\\\n\" \"\$ARGS\" && pacman -S \$ARGS --needed --noconfirm --color=always || _PRTERROR_ ; }
295 | printf \"\\\\n\\\\e[1;32m(2/2) \\\\e[0;34mWhen \\\\e[1;37mGenerating pacman keyring master key\\\\e[0;34m appears on the screen, the installation process can be accelerated. The system desires a lot of entropy at this part of the install procedure. In order to generate some entropy quickly, play a multimedia file on this device. \\\\n\\\\nThe program \\\\e[1;32mpacman-key\\\\e[0;34m will want as much entropy as possible when generating keys. Entropy is also created through tapping, sliding, one, two and more fingers tapping with short and long taps. When \\\\e[1;37mAppending keys from archlinux.gpg\\\\e[0;34m appears on the screen, use any of these simple methods to accelerate the installation process if it is stalled. Put even simpler, just do something on device. Browsing files will create entropy on device. Slowly swiveling this device in space and time will accelerate the installation process. This method alone might not generate enough entropy (a measure of randomness in a closed system) for the process to complete quickly. The command \\\\e[1;32m~%s/bin/we\\\\e[0;34m can be used to generate and watch entropy on device in a new Termux session.\\\\n\\\\e[1;32m==> \\\\e[1;37mRunning command \\\\e[1;32mpacman-key --populate\\\\e[1;37m...\\\\n\" \"$DARCH\"
296 | { [ -f /var/run/lock/"${INSTALLDIR##*/}"/kpp.lock ] && printf '\\e[1;32m==> \\e[1;37mAlready populated with command \\e[1;32mpacman-key --populate\\e[1;37m...\\n' ; } || { printf '\\e[1;32m==> \\e[1;37mRunning command \\e[1;32mpacman-key --populate\\e[1;37m...\\n' && { $ECHOEXEC pacman-key --populate && :>/var/run/lock/"${INSTALLDIR##*/}"/kpp.lock ; } || _PRTERROR_ ; }
297 | printf \"\\\\e[1;32m==>\\\\e[1;37m Running command \\\\e[1;32mpacman -Ss keyring --color=always\\\\e[1;37m...\\\\n\"
298 | pacman -Ss keyring --color=always"
299 | fi
300 | _CFLHDR_ $TMXRCHBNDS/keys
301 | cat >> $TMXRCHBNDS/keys <<- EOM
302 | declare -a KEYRINGS
303 |
304 | _KEYSGENMSG_() {
305 | printf "\\\\n\\\\e[1;32m%s \\\\e[0;34mWhen \\\\e[1;37mGenerating pacman keyring master key\\\\e[0;34m appears on the screen, the installation process can be accelerated. The system desires a lot of entropy at this part of the install procedure. To generate as much entropy as possible quickly, watch and listen to a file on your device. \\\\n\\\\nThe program \\\\e[1;32mpacman-key\\\\e[0;34m will want as much entropy as possible when generating keys. Entropy is also created through tapping, sliding, one, two and more fingers tapping with short and long taps. When \\\\e[1;37mAppending keys from archlinux.gpg\\\\e[0;34m appears on the screen, use any of these simple methods to accelerate the installation process if it is stalled. Put even simpler, just do something on device. Browsing files will create entropy on device. Slowly swiveling this device in space and time will accelerate the installation process. This method alone might not generate enough entropy (a measure of randomness in a closed system) for the process to complete quickly. You can use \\\\e[1;32m~%s/bin/we\\\\e[0;34m in a new Termux session to generate and watch entropy on device.\\\\e[0m\\\\n" "$X86IPT" "$DARCH"
306 | }
307 |
308 | _GENEN_() {
309 | printf "\\\\e[0;32mGenerating entropy on device; \\\\e[1;32mPlease wait a moment... "
310 | GENENN=16
311 | for GNNT in \$(seq 1 \$GENENN)
312 | do
313 | nice -n 20 ls -alR /usr >/dev/null &
314 | nice -n 20 find /usr >/dev/null &
315 | nice -n 20 cat /dev/urandom >/dev/null &
316 | done
317 | }
318 |
319 | _PRINTTAIL_() {
320 | printf "\\\\n\\\\e[0;32m%s \\\\e[1;32m%s \\\\e[0;32m%s\\\\e[1;34m: \\\\e[1;32m%s\\\\e[0m 🏁 \\\\n\\\\n\\\\e[0m" "TermuxArch command" "\$STRNRG" "version \$VERSIONID" "DONE 📱"
321 | printf '\033]2; 🔑 TermuxArch %s: DONE 📱 \007' "'\$STRNRG'"
322 | }
323 |
324 | _PRTERROR_() {
325 | printf "\\n\\e[1;31merror: \\e[1;37m%s\\e[0m\\n\\n" "Please study the first lines of the error output and correct the error(s) and/or warning(s) and run '\$STRNRG' again."
326 | }
327 |
328 | _TRPET_() {
329 | printf "\\\\e[?25h\\\\e[0m"
330 | set +Eeuo pipefail
331 | _PRINTTAIL_ "\${KEYRINGS[@]}"
332 | }
333 | trap _TRPET_ EXIT
334 |
335 | ## keys begin ##################################################################
336 | KEYSUNAM_="\$(uname -m)"
337 | if [[ -z "\${1:-}" ]] || [[ "\$KEYSUNAM_" = aarch64 ]]
338 | then
339 | KEYRINGS[0]="archlinux-keyring"
340 | KEYRINGS[1]="archlinuxarm-keyring"
341 | KEYRINGS[2]="ca-certificates-utils"
342 | elif [[ "\$1" = x86 ]] || [[ "\$KEYSUNAM_" = x86 ]]
343 | then
344 | KEYRINGS[0]="archlinux-keyring"
345 | KEYRINGS[1]="archlinux32-keyring"
346 | KEYRINGS[2]="ca-certificates-utils"
347 | elif [[ "\$1" = x86_64 ]] || [[ "\$KEYSUNAM_" = x86_64 ]]
348 | then
349 | KEYRINGS[0]="archlinux-keyring"
350 | KEYRINGS[1]="ca-certificates-utils"
351 | else
352 | KEYRINGS=""
353 | fi
354 | ARGS="\${KEYRINGS[@]}"
355 | printf '\033]2; 🔑 TermuxArch %s 📲 \007' "'\$STRNRG'"
356 | printf "\\\\e[1;32m==> \\\\e[1;37mRunning command \\\\e[1;32m%s \\\\e[0;32m%s\\\\e[1;37m...\\\\n" "\$STRNRG" "version \$VERSIONID"
357 | _GENEN_ ; kill \$! &
358 | _KEYSGENMSG_
359 | _DOPSY_() {
360 | printf "\\\\n\\\\e[1;32m==> \\\\e[1;37mRunning command \\\\e[1;32mpacman -Sy\\\\e[1;37m...\\\\n"
361 | $ECHOEXEC $ECHOSYNC pacman -Sy || $ECHOEXEC $ECHOSYNC pacman -Sy || sudo $ECHOEXEC $ECHOSYNC pacman -Sy
362 | }
363 | _DOPSY_ || _DOPSY_ || _PRTERROR_
364 | _DOKPI_() {
365 | if [ ! -f "/run/lock/${INSTALLDIR##*/}/kpi.lock" ]
366 | then
367 | printf "\\\\e[1;32m==> \\\\e[1;37mRunning command \\\\e[1;32mpacman-key --init\\\\e[1;37m...\\\\n"
368 | { $ECHOEXEC pacman-key --init && :>"/run/lock/${INSTALLDIR##*/}/kpi.lock" ; } || _PRTERROR_
369 | else
370 | printf "\\\\e[1;32m==> \\\\e[1;37mAlready initialized with command \\\\e[1;32mpacman-key --init\\\\e[1;37m...\\\\n"
371 | fi
372 | }
373 | _DOKPI_ || _DOKPI_
374 | umask 000
375 | chmod 4777 /usr/bin/newuidmap
376 | chmod 755 /etc/pacman.d/gnupg
377 | umask 022
378 | _DOPP_() {
379 | { [ -f "/var/run/lock/${INSTALLDIR##*/}/kpp.lock" ] && printf "\\\\e[1;32m==> \\\\e[1;37mAlready populated with command \\\\e[1;32mpacman-key --populate\\\\e[1;37m...\\\\n" ; } || { printf "\\\\e[1;32m==> \\\\e[1;37mRunning command \\\\e[1;32mpacman-key --populate\\\\e[1;37m...\\\\n" && { $ECHOEXEC pacman-key --populate && :>"/var/run/lock/${INSTALLDIR##*/}/kpp.lock"; } || _PRTERROR_ ; }
380 | }
381 | _DOPP_ || _DOPP_
382 | printf "\\\\e[1;32m==> \\\\e[1;37mRunning command \\\\e[1;32mpacman -Ss keyring --color=always\\\\e[1;37m...\\\\n"
383 | pacman -Ss keyring --color=always || pacman -Ss keyring --color=always || _PRTERROR_
384 | $X86INT
385 | $X86INK
386 | ## $INSTALLDIR$TMXRCHBNDR/keys FE
387 | EOM
388 | chmod 755 $TMXRCHBNDS/keys
389 | }
390 |
391 | _ADDcshrc_() { :>root/.cshrc ; }
392 | _ADDinitrc_() { printf '%s\n' "" > root/.initrc ; }
393 | _ADDinputrc_() {
394 | INPUTRCFILE="$(printf '%s\n' "set bell-style none
395 | set colored-stats on
396 | set colored-completion-prefix on
397 | set completion-ignore-case on
398 | set completion-prefix-display-length 3
399 | set completion-query-items 32
400 | # set editing-mode vi
401 | set enable-keypad on
402 | set enable-meta-key on
403 | set expand-tilde off
404 | set horizontal-scroll-mode on
405 | set input-meta on
406 | set match-hidden-files off
407 | set mark-symlinked-directories on
408 | set output-meta on
409 | set print-completions-horizontally on
410 | set show-all-if-ambiguous on
411 | set show-all-if-unmodified on
412 | # set show-mode-in-prompt on
413 | set visible-stats on")"
414 | _COMPAREFILE_ "$INPUTRCFILE" ".inputrc" "root"
415 | }
416 |
417 | _ADDprofile_() {
418 | PROFILEFILE="$(printf '%s\n' "export TMPDIR=\"/tmp\"")"
419 | _COMPAREFILE_ "$PROFILEFILE" ".profile" "root"
420 | }
421 |
422 | _ADDzshrc_() { :>root/.zshrc ; }
423 |
424 | _COMPAREFILE_() { # compare and write file if differ
425 | _WRITENEWFILE_() { printf '%s\n' "$1" > "$3/$2" && printf '\e[0;32mFile \e[0;32m%s \e[0;32m%s.\n' "$3/$2" "${@: -1}" ; }
426 | if [ -f "$3/$2" ] # file exists
427 | then # compare
428 | if [[ "$1" != "$(<"$3"/"$2")" ]] # data differs
429 | then # write file
430 | _WRITENEWFILE_ "$@" "updated"
431 | else
432 | printf '\e[0;32mData in file \e[1;32m%s\e[0;32m is equal.\n' "$3/$2"
433 | fi
434 | else # write data to file if it does not exist
435 | _WRITENEWFILE_ "$@" "created"
436 | fi
437 | }
438 |
439 | _DOPROXY_() {
440 | [[ -f "$HOME"/.bash_profile ]] && grep -s "proxy" "$HOME"/.bash_profile | grep -s "export" >> root/bin/"$BINFNSTP" ||:
441 | [[ -f "$HOME"/.bashrc ]] && grep -s "proxy" "$HOME"/.bashrc | grep -s "export" >> root/bin/"$BINFNSTP" ||:
442 | [[ -f "$HOME"/.profile ]] && grep -s "proxy" "$HOME"/.profile | grep -s "export" >> root/bin/"$BINFNSTP" ||:
443 | }
444 |
445 | _MAKESTARTBIN_() {
446 | _CFLHDR_ "$STARTBIN"
447 | printf "%s\\n" "${FLHDRP[@]}" >> "$STARTBIN"
448 | cat >> "$STARTBIN" <<- EOM
449 | _CHCKUSER_() { [ -d "$INSTALLDIR/home/\$2" ] || _PRNTUSGE_ "\$@" ; }
450 | _COMMANDGNE_() { printf "\\e[1;48;5;138mTermuxArch %s\\e[0m " "\${SRPTNM^^} NOTICE: Please run '\${0##*/}' and 'bash \${0##*/}' from the BASH shell in native Termux: EXITING..." && exit 202 ; }
451 | if [ -w /root ]
452 | then
453 | _COMMANDGNE_
454 | fi
455 | _PRINTUSAGE_() {
456 | printf "\\n\\e[1;32m%s\\e[0;32m%s\\n\\n" "$STARTBIN" " starts Arch Linux in $TXPRQUON with PRoot QEMU root login. This account is reserved for system administration. Please use any system administrator account with care."
457 | printf "\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\n\\n" "$STARTBIN c[ommand] command" " runs an Arch Linux command from a Termux shell as PRoot QEMU root login. Quoting multiple commands can assit when passing multiple arguments; i.e. " "$STARTBIN c 'whoami ; cat -n /etc/pacman.d/mirrorlist'" ". Please pass commands through the system administrator account with caution."
458 | printf "\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\n\\n" "$STARTBIN e[login|user] user" " login as user. Uses alternate elogin and euser option to login as user. This option is preferred for working with programs that have already been installed, and for working with the 'cp' and 'git' commands. Please use " "$STARTBIN c 'addauser user'" " first to create this user and the user's home directory."
459 | printf "\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\n\\n" "$STARTBIN l[ogin]|u[ser] user" " login as user. This option is preferred when installing software from a user account with the 'sudo' command, and when using the 'makeaur*' commands. Please use 'addauser user' first to create this user and the user's home directory."
460 | printf "\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\n\\n" "$STARTBIN r[aw]" " construct the " "$STARTBIN " "proot statement from exec.../bin/. For example " "$STARTBIN r su " "will exec 'su' in Arch Linux. After installing the appropriate packages in Arch Linux, easy PRoot QEMU root shell access is possible with option raw:
461 |
462 | ~ $ $STARTBIN r bash
463 | ~ $ $STARTBIN r dash
464 | ~ $ $STARTBIN+x86 r csh
465 | ~ $ $STARTBIN+x86 r ksh
466 | ~ $ $STARTBIN+x864 r sh
467 | ~ $ $STARTBIN+x864 r zsh
468 |
469 | Command '${0##*/} qemu [options]' assists in installing alternate architectures. Variable PROOTSTMNT has more information about the PRoot QEMU init statement options 'grep -h PROOTSTMNT ~/TermuxArchBloom/* | grep \=' if you wish to modify the PRoot QEMU init statement extensively. The PRoot QEMU init statement can also be modified on-the-fly simply by using the /var/binds/ directory once logged into the Arch Linux in TermuxArch PRoot QEMU environment."
470 | printf "\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\n\\n\\e[0m" "$STARTBIN s[u] user command" " executes commands as Arch Linux user from a Termux shell. This option is preferred when installing software from a user account with the 'sudo' command, and when using the 'makeaur*' commands. Quoting multiple commands can assit when passing multiple arguments: " "$STARTBIN s user 'whoami ; cat -n /etc/pacman.d/mirrorlist'" ". Please use " "$STARTBIN c 'addauser user'" " first to create a login and the login's home directory."
471 | printf '\\033]2;%s\\007' "TermuxArch $STARTBIN $@ 📲; DONE 🏁"
472 | }
473 | _PRNTUSGE_() { _PRINTUSAGE_ && printf "\\e[0;33m%s\\e[0;32m%s\\e[1;31m%s\\e[0m" "It appears that user '\$2' does not exist in the Arch Linux in TermuxArch PRoot QEMU system! " "Command '\${0##*/} command 'addauser \$2'' can create user account '\$2' in the TermuxArch PRoot QEMU system. Command '\${0##*/} login \$2' can be run once more to login to the TermuxArch PRoot QEMU environment as user '\$2'." " EXITING… " ; exit 69 ; }
474 | ## [] Default Arch Linux in TermuxArch PRoot QEMU root login.
475 | if [[ -z "\${1:-}" ]]
476 | then
477 | printf '\\033]2;%s\\007' "TermuxArch $STARTBIN 📲"
478 | set +Eeuo pipefail
479 | EOM
480 | printf "%s\\n" "$PROOTSTMNT /bin/bash -l ||:" >> "$STARTBIN"
481 | cat >> "$STARTBIN" <<- EOM
482 | printf '\\033]2;%s\\007' "TermuxArch $STARTBIN 📲; DONE 🏁"
483 | set -Eeuo pipefail
484 | ## [? | help] Displays usage information.
485 | elif [[ "\${1//-}" = [?]* ]] || [[ "\${1//-}" = [Hh]* ]]
486 | then
487 | _PRINTUSAGE_
488 | elif [[ -z "\${2:-}" ]]
489 | then
490 | _PRINTUSAGE_
491 | printf "\\e[0;33m%s\\e[1;30m%s\\e[0;0m%s\\e[1;30m%s\\e[0;31m%s\\e[1;30m%s\\e[0m" "Please use at least one more argument to continue. The command '\${0##*/} help' has more information;" " Possible substitute command '" "\${0##*/} c 'addauser \$1'" "';" " Exiting" "... "
492 | ## [command ARGS] Execute a command in BASH as root.
493 | elif [[ "\${1//-}" = [Cc]* ]]
494 | then
495 | printf '\033]2; TermuxArch $STARTBIN command %s 📲\007' "\${@:2}"
496 | :>"$INSTALLDIR/root/.chushlogin"
497 | set +Eeuo pipefail
498 | EOM
499 | printf "%s\\n" "$PROOTSTMNT /bin/bash -lc \"\${@:2}\" ||:" >> "$STARTBIN"
500 | cat >> "$STARTBIN" <<- EOM
501 | printf '\033]2; TermuxArch $STARTBIN command %s 📲;DONE 🏁 \007' "\${@:2}"
502 | set -Eeuo pipefail
503 | rm -f "$INSTALLDIR/root/.chushlogin"
504 | ## [e[login|user] user] Login as user.
505 | elif [[ "\${1//-}" = e* ]]
506 | then
507 | _CHCKUSER_ "\$@"
508 | printf '\033]2; TermuxArch $STARTBIN elogin %s 📲\007' "\$2"
509 | set +Eeuo pipefail
510 | :>"$INSTALLDIR/var/lock/${INSTALLDIR##*/}/\$\$elock"
511 | if [ -f "$INSTALLDIR/var/lib/pacman/db.lck" ]
512 | then
513 | printf "%s" "File ~/${INSTALLDIR##*/}/var/lib/pacman/db.lck exists; The TermuxArch 'pacmandblock' command can be used to alter the lock state. Please use '$STARTBIN' and '$STARTBIN l[ogin] username' to install software in Arch Linux in TermuxArch PRoot QEMU: "
514 | else
515 | printf "%s" "Creating file ~/${INSTALLDIR##*/}/var/lib/pacman/db.lck; The TermuxArch 'pacmandblock' command can be used to alter the lock state. Please use '$STARTBIN' and '$STARTBIN l[ogin] username' to install software in the Arch Linux in TermuxArch PRoot QEMU environment: "
516 | :>"$INSTALLDIR/var/lib/pacman/db.lck"
517 | printf "%s\\n" "Continuing..."
518 | fi
519 | printf "%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n%s\\n" "if [ -f \"$INSTALLDIR/var/lock/${INSTALLDIR##*/}/\$\$elock\" ]" "then" "if [ -f \"$INSTALLDIR/var/lib/pacman/db.lck\" ]" "then" "printf \"%s\" \"Deleting file '~/${INSTALLDIR##*/}/var/lib/pacman/db.lck'. The TermuxArch 'pacmandblock' command can be used to alter the lock state. Please use '$STARTBIN' and '$STARTBIN l[ogin] username' to install software in the Arch Linux in TermuxArch PRoot QEMU environment: \"" "rm -f \"$INSTALLDIR/var/lib/pacman/db.lck\"" "printf \"%s\\\\n\" \"DONE\"" "fi" "rm -f \"$INSTALLDIR/var/lock/${INSTALLDIR##*}\$\$elock\"" "fi" "[ ! -f "$INSTALLDIR/home/\$2/.hushlogout" ] && [ ! -f "$INSTALLDIR/home/\$2/.chushlogout" ] && . /etc/moto" "h # write session history to file HOME/.historyfile" "## .bash_logout FE" > "$INSTALLDIR/home/\$2/.bash_logout"
520 | ## $INSTALLDIR$TMXRCHBNDR/keys FE
521 | EOM
522 | printf "%s\\n" "$PROOTSTMNTEU /bin/su - \"\$2\" ||:" >> "$STARTBIN"
523 | cat >> "$STARTBIN" <<- EOM
524 | printf '\033]2; TermuxArch $STARTBIN elogin %s 📲;DONE 🏁 \007' "\$2"
525 | set -Eeuo pipefail
526 | rm -f "$INSTALLDIR/home/\$2/.chushlogin"
527 | ## [l[ogin]|u[ser] user] Login as user.
528 | elif [[ "\${1//-}" = [Ll]* ]] || [[ "\${1//-}" = [Uu]* ]]
529 | then
530 | _CHCKUSER_ "\$@"
531 | printf '\033]2; TermuxArch $STARTBIN login %s 📲\007' "\$2"
532 | set +Eeuo pipefail
533 | EOM
534 | printf "%s\\n" "$PROOTSTMNTU /bin/su - \"\$2\" ||:" >> "$STARTBIN"
535 | cat >> "$STARTBIN" <<- EOM
536 | printf '\033]2; TermuxArch $STARTBIN login %s 📲;DONE 🏁 \007' "\$2"
537 | set -Eeuo pipefail
538 | ## [raw ARGS] Construct the '$STARTBIN' proot statement.
539 | elif [[ "\${1//-}" = [Rr]* ]]
540 | then
541 | printf '\033]2; TermuxArch $STARTBIN raw %s 📲\007' "\$@"
542 | set +Eeuo pipefail
543 | EOM
544 | printf "%s\\n" "$PROOTSTMNT /bin/\"\${@:2}\" ||:" >> "$STARTBIN"
545 | cat >> "$STARTBIN" <<- EOM
546 | printf '\033]2; TermuxArch $STARTBIN raw %s 📲;DONE 🏁 \007' "\$@"
547 | set -Eeuo pipefail
548 | ## [su user command] Login as user and execute command.
549 | elif [[ "\${1//-}" = [Ss]* ]]
550 | then
551 | _CHCKUSER_ "\$@"
552 | printf '\\033]2;%s\\007' "TermuxArch $STARTBIN su \$2 \${@:3} 📲"
553 | if [[ "\$2" = root ]]
554 | then
555 | printf "%s\\n" "Please use this command \"$STARTBIN c '\${@:3}'\" for the Arch Linux in TermuxArch PRoot QEMU \$2 user account; Exiting..."
556 | exit
557 | fi
558 | :>"$INSTALLDIR/home/\$2/.chushlogin"
559 | set +Eeuo pipefail
560 | EOM
561 | printf "%s\\n" "$PROOTSTMNTU /bin/su - \"\$2\" -c \"\${@:3}\" ||:" >> "$STARTBIN"
562 | cat >> "$STARTBIN" <<- EOM
563 | printf '\\033]2;%s\\007' "TermuxArch $STARTBIN su \$2 \${@:3} 📲; DONE 🏁"
564 | set -Eeuo pipefail
565 | rm -f "$INSTALLDIR/home/\$2/.chushlogin"
566 | else
567 | _PRINTUSAGE_
568 | fi
569 | ## $STARTBIN FE
570 | EOM
571 | chmod 700 "$STARTBIN"
572 | }
573 |
574 | _MAKEFINISHSETUP_() {
575 | _DOKEYS_() {
576 | if [[ "$CPUABI" = "$CPUABIX86" ]]
577 | then
578 | DOKYSKEY="$TMXRCHBNDR/keys x86"
579 | elif [[ "$CPUABI" = "$CPUABIX8664" ]]
580 | then
581 | DOKYSKEY="$TMXRCHBNDR/keys x86_64"
582 | else
583 | DOKYSKEY="$TMXRCHBNDR/keys"
584 | fi
585 | }
586 | _DOKYLGEN_() {
587 | DOKYSKEY=""
588 | LOCGEN=":"
589 | }
590 | _LOCALEGENPACNEW_() {
591 | if [ ! -f var/run/lock/"${INSTALLDIR##*/}"/locale.gen.pacnew.lock ]
592 | then
593 | if [ -f "${INSTALLDIR##*/}"etc/locale.gen.pacnew ]
594 | then
595 | cp -f etc/locale.gen var/backups/"${INSTALLDIR##*/}"/etc/locale.gen."$SDATE".bkp && cp -f etc/locale.gen.pacnew etc/locale.gen && :>var/run/lock/"${INSTALLDIR##*/}"/locale.gen.pacnew.lock
596 | fi
597 | fi
598 | }
599 | if [[ "${LCR:-}" -eq 5 ]] || [[ -z "${LCR:-}" ]] # LCR equals 5 or is undefined
600 | then
601 | _DOKEYS_
602 | _LOCALEGENPACNEW_
603 | LOCGEN="locale-gen || locale-gen"
604 | elif [[ "${LCR:-}" -eq 1 ]] || [[ "${LCR:-}" -eq 2 ]] || [[ "${LCR:-}" -eq 3 ]] || [[ "${LCR:-}" -eq 4 ]] # LCR equals 1 or 2 or 3 or 4
605 | then
606 | _DOKYLGEN_
607 | _LOCALEGENPACNEW_
608 | fi
609 | _CFLHDR_ "root/bin/$BINFNSTP"
610 | printf "%s\\n" "_PMFSESTRING_() {
611 | printf \"\\e[1;31m%s\\e[1;37m%s\\e[1;32m%s\\e[1;37m%s\\n\\n\" \"Signal generated in \" \"'\$1'\" \"; Cannot complete task; \" \"Continuing...\"
612 | printf \"\\e[1;34m%s\\e[0;34m%s\\e[1;34m%s\\e[0;34m%s\\e[1;34m%s\\n\\n\" \" If you find better resolves for \" \"setupTermuxArch\" \" and \" \"\$0\" \", please open an issue and accompanying pull request.\"
613 | }
614 | _PMGPSSTRING_() {
615 | printf \"\\n\\e[1;34m:: \\e[1;32m%s\\n\" \"Processing system for $NASVER $ARCTEVAR, and removing redundant packages for TermuxArch PRoot QEMU...\"
616 | }" >> root/bin/"$BINFNSTP"
617 | _DOPROXY_
618 | [ -d "$INSTALLDIR/run/lock/${INSTALLDIR##*/}" ] || mkdir -p "$INSTALLDIR/run/lock/${INSTALLDIR##*/}"
619 | printf "%s\\n" "$DOKYSKEY" >> root/bin/"$BINFNSTP"
620 | if [[ -z "${LCR:-}" ]] || [[ "${LCR:-}" -eq 5 ]]
621 | then
622 | if [[ "$CPUABI" = "$CPUABIX8664" ]]
623 | then
624 | printf "%s\\n" "pacman -Su keychain glibc grep gzip pacman-contrib sed sudo --needed --noconfirm --color=always || pacman -Su keychain glibc grep gzip pacman-contrib sed sudo --needed --noconfirm --color=always || _PMFSESTRING_ \"pacman -Su keychain glibc grep gzip sed sudo $BINFNSTP ${0##/*}\"" >> root/bin/"$BINFNSTP"
625 | elif [[ "$CPUABI" = "$CPUABIX86" ]]
626 | then
627 | printf "%s\\n" "pacman -Su keychain glibc pacman-contrib sed sudo --needed --noconfirm --color=always || pacman -Su keychain glibc sed sudo --needed --noconfirm --color=always || _PMFSESTRING_ \"pacman -Su keychain glibc pacman-contrib sed sudo $BINFNSTP ${0##/*}\"" >> root/bin/"$BINFNSTP"
628 | else
629 | printf "%s\\n" "pacman -Su keychain glibc pacman-contrib --needed --noconfirm --color=always || pacman -Su keychain glibc pacman -S pacman-contrib --needed --noconfirm --color=always || _PMFSESTRING_ \"pacman -Su keychain glibc $BINFNSTP ${0##/*}\"" >> root/bin/"$BINFNSTP"
630 | fi
631 | fi
632 | printf "%s\\n" "printf \"\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\n\" \"To generate locales in a preferred language, you can use the native Android menu commands \" \"Settings > System > Input & Language > Language \" \"in Android; Then run \" \"${0##*/} refresh\" \" for a full system refresh, which includes the locale generation function; For a quick refresh you can use \" \"${0##*/} r\" \". For a refresh with user directories \" \"${0##*/} re\" \" can be used.\"
633 | $LOCGEN || _PMFSESTRING_ \"LOCGEN $BINFNSTP ${0##/*}. Please run '$LOCGEN' again in the installed system.\"" >> root/bin/"$BINFNSTP"
634 | printf "%s\\n" "[ -d /home/user ] || printf \"\\n\\e[1;32m==> \\e[1;37mRunning TermuxArch command \\e[1;32maddauser user\\e[1;37m...\\n\"" >> root/bin/"$BINFNSTP"
635 | printf "%s\\n" "[ -d /home/user ] || "$TMXRCHBNDR"/addauser user || _PMFSESTRING_ \"addauser user $BINFNSTP ${0##/*}\"" >> root/bin/"$BINFNSTP"
636 | if [[ "${LCR:-}" -eq 3 ]] || [[ "${LCR:-}" -eq 4 ]]
637 | then
638 | printf "%s\\n" "locale-gen || locale-gen" >> root/bin/"$BINFNSTP"
639 | fi
640 | printf "%s\\n" "# $BINFNSTP FE" >> root/bin/"$BINFNSTP"
641 | chmod 700 root/bin/"$BINFNSTP"
642 | }
643 |
644 | _MAKESETUPBIN_() {
645 | _CFLHDR_ root/bin/setupbin.bash
646 | printf "%s\\n" "set +Eeuo pipefail" >> root/bin/setupbin.bash
647 | printf "%s\\n" "$PROOTSTMNT /root/bin/$BINFNSTP ||:" >> root/bin/setupbin.bash
648 | printf "%s\\n" "# setupbin.bash FE" >> root/bin/setupbin.bash
649 | chmod 700 root/bin/setupbin.bash
650 | }
651 |
652 | _SETLANGUAGE_() { ## Function _SETLANGUAGE_ uses device system settings to set locales. Generating locales in a preferred language should be simple if an exact language match was found. "Settings > System > Input & Language > Language" sets the system language in Android which can be migrated into this system with one of the refresh options; Command 'setupTermuxArch re' will attempt to update the TermuxArch system overlay with a quick refresh to the newest published version, and attempt to regenerate locales in your preferred language automatically.
653 | LANGIN=([0]="$(getprop user.language)")
654 | LANGIN+=([1]="$(getprop user.region)")
655 | LANGIN+=([2]="$(getprop persist.sys.country)")
656 | LANGIN+=([3]="$(getprop persist.sys.language)")
657 | LANGIN+=([4]="$(getprop persist.sys.locale)")
658 | LANGIN+=([5]="$(getprop ro.product.locale)")
659 | LANGIN+=([6]="$(getprop ro.product.locale.language)")
660 | LANGIN+=([7]="$(getprop ro.product.locale.region)")
661 | ULANGUAGE="${LANGIN[0]:-C}_${LANGIN[1]:-C}"
662 | for LANGSET in "${!LANGIN[@]}"
663 | do
664 | if [[ "${LANGIN[LANGSET]}" = *-* ]]
665 | then
666 | ULANGUAGE="${LANGIN[LANGSET]//-/_}"
667 | break
668 | fi
669 | done
670 | printf "\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[1;32m%s\\n" "Setting locales to " "Language " ">> $ULANGUAGE << " "Region" " Please wait a moment."
671 | }
672 |
673 | _SETLOCALE_() { ## Function _SETLOCALE_ uses device system settings to set locales. Generating locales in a preferred language should be simple if an exact language match was found. "Settings > System > Input & Language > Language" sets the system language in Android which can be migrated into this system with one of the refresh options; Command 'setupTermuxArch re' will attempt to update the TermuxArch system overlay with a quick refresh to the newest published version, and attempt to regenerate locales in your preferred language automatically.
674 | printf "%s\\n" "## File locale.conf was generated by ${0##*/} at ${FTIME//-}." > etc/locale.conf
675 | for LC_N in "${!LC_TYPE[@]}"
676 | do
677 | printf "%s\\n" "${LC_TYPE[LC_N]}=$ULANGUAGE.UTF-8" >> etc/locale.conf
678 | done
679 | set +e
680 | if grep "$ULANGUAGE"\\.UTF-8 etc/locale.gen 1>/dev/null
681 | then
682 | sed -i "/\\#$ULANGUAGE.UTF-8 UTF-8/{s/#//g;s/@/-at-/g;}" etc/locale.gen && printf "\\e[0;32mFound an exact match for language \\e[1;32m>> %s <<\\e[0;32m to continue locale configuration. Command \\e[1;32m%s refresh\\e[0;32m generates locales from device. Command \\e[1;32mlocale-gen\\e[0;32m generates locales." "$ULANGUAGE" "${0##*/}"
683 | else
684 | printf "\\e[0;33mCould not find an exact match for language \\e[1;33m>> %s <<\\e[0;33m in file /etc/locale.gen. Please edit files /etc/locale.conf, /etc/locale.gen and .profile. Then run the command \\e[1;33mlocale-gen\\e[0;33m to generate locales. " "$ULANGUAGE"
685 | fi
686 | }
687 | # initkeyfunctions.bash FE
688 |
--------------------------------------------------------------------------------
/knownconfigurations.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Copyright 2017-2022 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
3 | ## Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
4 | ## https://sdrausty.github.io/TermuxArch/README has info about this project.
5 | ## https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
6 | ################################################################################
7 | # Running 'setupTermuxArch manual' will create 'setupTermuxArchConfigs.bash' from this file in the working directory. Run 'setupTermuxArch' and file 'setupTermuxArchConfigs.bash' loads automatically once created, and file 'knownconfigurations.bash' is ignored at runtime; 'setupTermuxArch help' has additional information. The mirror (information at https://wiki.archlinux.org/index.php/Mirrors and https://archlinuxarm.org/about/mirrors) can be changed to a desired geographic location in 'setupTermuxArchConfigs.bash' to resolve download, 404 and checksum issues should these take place. User configurable variables are present in this file for your convenience:
8 | ## DM=aria2c ## uncomment to use this download tool
9 | ## DM=axel ## uncomment to use this download tool
10 | ## DM=curl ## uncomment to use this download tool
11 | ## DM=lftp ## uncomment to use this download tool
12 | ## DM=wget ## uncomment to use this download tool
13 | ## DMVERBOSE="-v" ## uncomment for verbose download tool output with curl and wget; For verbose output throughout runtime change this setting in file 'setupTermuxArch' also.
14 | ECHOEXEC="" ## insert 'echo' to suppress most 'pacman' instructions from 'keys' file during runtime
15 | ECHOSYNC="" ## insert 'echo' to only suppress 'pacman' syncing instructions from 'keys' file during runtime
16 | KEEP=0 ## change to 1 to delete downloaded image; Testing the installation process repeatedly can be made easier and lighter on your Internet bandwidth and SAR with 'KEEP=0' and this fragment of code 'mkdir ~/arch; cp ~/ArchLinux*.tar.gz* ~/arch/' and similar. The variable KEEP when set to 0 (true) will keep the downloaded image and md5 files instead of deleting them for possible reuse. The root file system image and md5 files can be saved and used again with subsequent installations.
17 | USECACHEDIR=0 ## set to 0 in order to use cache directory; This installation script uses a cache directory that can be used to cache all of the installation files in order to save wireless bandwidth upon subsequent reinstallation. Variable `KEEP=0` should also be set to 0 in order to keep the downloaded image file and md5 files. The downloaded image and md5 files can be moved to CACHEDIR from INSTALLDIR/var/cache/pacman/pkg with the command 'trim' in order to avoid redownloading files in order to reinstall the Arch Linux system in Termux PRoot QEMU.
18 | CACHLCTN="/storage/emulated/0" ## change to external sdcard path if desired.
19 | CACHEDIR="$CACHLCTN/Android/data/com.termux/files/cache/archlinux/$ARCTEVAR/"
20 | PREFIXDATAFILES="$CACHLCTN/Android/data/com.termux/"
21 | # KID=1 ## do not change, not user configurable; Used for testing, timing and development. For timing Arch Linux in PRoot, uncomment and then run script TermuxArch/scripts/frags/stdoutbench.sh in Arch Linux PRoot for timing Arch Linux in PRoot.
22 | ## If there are system image files available not listed here please open an issue and a pull request.
23 |
24 | _AARCH64ANDROID_() {
25 | IFILE="ArchLinuxARM-aarch64-latest.tar.gz"
26 | CMIRROR="os.archlinuxarm.org"
27 | RPATH="os"
28 | _MAKESYSTEM_
29 | }
30 |
31 | _AARCH64CHROME_() {
32 | IFILE="ArchLinuxARM-aarch64-chromebook-latest.tar.gz"
33 | CMIRROR="os.archlinuxarm.org"
34 | RPATH="os"
35 | _MAKESYSTEM_
36 | }
37 |
38 | _ARMV5L_() {
39 | IFILE="ArchLinuxARM-armv5-latest.tar.gz"
40 | CMIRROR="os.archlinuxarm.org"
41 | RPATH="os"
42 | _MAKESYSTEM_
43 | }
44 |
45 | _ARMV7ANDROID_() {
46 | IFILE="ArchLinuxARM-armv7-latest.tar.gz"
47 | CMIRROR="os.archlinuxarm.org"
48 | RPATH="os"
49 | _MAKESYSTEM_
50 | }
51 |
52 | _ARMV7CHROME_() {
53 | IFILE="ArchLinuxARM-armv7-chromebook-latest.tar.gz"
54 | CMIRROR="os.archlinuxarm.org"
55 | RPATH="os"
56 | _MAKESYSTEM_
57 | }
58 |
59 | ## Information at https://www.archlinux.org/news/phasing-out-i686-support/ and https://archlinux32.org/ regarding why i686 is currently frozen at release 2017.03.01-i686.
60 | ## UPDATE: These topics have the most current information about Arch Linux 32 [Implementing QEMU #25](https://github.com/TermuxArch/TermuxArch/issues/25) and [[SOLVED - Hurrah!] Upgrading from a truly ancient install.](https://bbs.archlinux32.org/viewtopic.php?id=2982)
61 | _I686_() { # IFILE is read from md5sums.txt
62 | CMIRROR="archive.archlinux.org"
63 | RPATH="iso/2017.03.01"
64 | _MAKESYSTEM_
65 | }
66 |
67 | _X86_64_() { # IFILE is read from md5sums.txt
68 | CMIRROR="mirror.rackspace.com"
69 | RPATH="archlinux/iso/latest"
70 | _MAKESYSTEM_
71 | }
72 |
73 | ## Appending to the PRoot statement can be accomplished on the fly by creating a .prs file in the var/binds directory. The format is straightforward, 'PROOTSTMNT+="option command "'. The space is required before the last double quote. Commands 'info proot' and 'man proot' have more information about what can be configured in a proot init statement. If more suitable configurations are found, share them at https://github.com/TermuxArch/TermuxArch/issues to improve TermuxArch. PRoot bind usage: PROOTSTMNT+="-b host_path:guest_path " The space before the last double quote is necessary.
74 |
75 | _PR00TSTRING_() { # construct the PRoot init statement
76 | [[ -z "${QEMUCR:-}" ]] && CPUABI="$(getprop ro.product.cpu.abi)" && SYSVER="$(getprop ro.build.version.release)" && NASVER="$(getprop net.bt.name ) $SYSVER" || [[ $QEMUCR="0" ]] && SYSVER="$(getprop ro.build.version.release)" && NASVER="$(getprop net.bt.name) $SYSVER $(getprop ro.product.cpu.abi)" || _PSGI1ESTRING_ "CPUABI knownconfigurations.bash ${0##*/}"
77 | PROOTSTMNT="exec proot "
78 | if [[ -z "${KID:-}" ]]
79 | then # command 'grep -w KID *h' shows variable KID usage
80 | PROOTSTMNT+="--kernel-release=$UNAMER "
81 | elif [[ "$KID" = 0 ]]
82 | then
83 | PROOTSTMNT+="--kernel-release=4.14.16 "
84 | else
85 | PROOTSTMNT+=""
86 | fi
87 | PROOTSTMNT+="--kill-on-exit --sysvipc --link2symlink -i \"\$2:wheel\" -0 -r $INSTALLDIR "
88 | if [[ "${QEMUCR:-}" == 0 ]]
89 | then
90 | PROOTSTMNT+="-q $PREFIX/bin/qemu-$ARCTEVAR "
91 | fi
92 | ## Function _PR00TSTRING_ which creates the PRoot init statement PROOTSTMNT uses associative arrays. Page https://www.gnu.org/software/bash/manual/html_node/Arrays.html has information about BASH arrays and is also available at https://www.gnu.org/software/bash/manual/ this link.
93 | declare -A PRSTARR # associative array
94 | # populate writable binds
95 | PRSTARR=([/dev/ashmem]=/dev/ashmem [/dev/kvm]=/dev/kvm [/dev/shm]=/dev/shm)
96 | for PRBIND in ${!PRSTARR[@]}
97 | do
98 | if [[ -w "$PRBIND" ]] # is writable
99 | then # add proot bind
100 | PROOTSTMNT+="-b $PRBIND:$PRBIND "
101 | fi
102 | done
103 | # populate readable binds
104 | PRSTARR=(["$EXTERNAL_STORAGE"]="$EXTERNAL_STORAGE" ["$HOME"]="$HOME" ["$PREFIX"]="$PREFIX" [/apex/]=/apex/ [/data/dalvik-cache/]=/data/dalvik-cache/ [/dev/]=/dev/ [/dev/urandom]=/dev/random [/linkerconfig/ld.config.txt]=/linkerconfig/ld.config.txt [/plat_property_contexts]=/plat_property_contexts [/property_contexts]=/property_contexts [/proc/]=/proc/ [/proc/self/fd]=/dev/fd [/proc/self/fd/0]=/dev/stdin [/proc/self/fd/1]=/dev/stdout [/proc/self/fd/2]=/dev/stderr [/proc/stat]=/proc/stat [/property_contexts]=/property_contexts [/storage/]=/storage/ [/system/]=/system/ [/vendor/]=/vendor/)
105 | for PRBIND in ${!PRSTARR[@]}
106 | do
107 | if [[ -r "$PRBIND" ]] # is readable
108 | then # add proot bind
109 | PROOTSTMNT+="-b $PRBIND:${PRSTARR[$PRBIND]} "
110 | fi
111 | done
112 | [[ "$SYSVER" -ge 10 ]] && PROOTSTMNT+="-b /apex -b /storage -b /sys -b /system -b /vendor "
113 | # populate NOT readable binds
114 | PRSTARR=([/dev/]=/dev/ [/dev/ashmem]="$INSTALLDIR/tmp" [/dev/kvm]="$INSTALLDIR/var/binds/fbindkvm" [/dev/shm]="$INSTALLDIR/tmp" [/proc/loadavg]="$INSTALLDIR/var/binds/fbindprocloadavg" [/proc/pcidevices]="$INSTALLDIR/var/binds/fbindprocpcidevices" [/proc/shmem]="$INSTALLDIR/var/binds/fbindprocshmem" [/proc/stat]="$INSTALLDIR/var/binds/fbindprocstat" [/proc/uptime]="$INSTALLDIR/var/binds/fbindprocuptime" [/proc/vmstat]="$INSTALLDIR/var/binds/fbindprocvmstat" [/proc/version]="$INSTALLDIR/var/binds/fbindprocversion" [/sys/devices]="$INSTALLDIR/var/binds/fbindsysdevices")
115 | for PRBIND in ${!PRSTARR[@]}
116 | do
117 | if [[ ! -r "$PRBIND" ]] # is not readable
118 | then # add proot bind
119 | PROOTSTMNT+="-b ${PRSTARR[$PRBIND]}:$PRBIND "
120 | fi
121 | done
122 | # file var/binds/fbindexample.prs has examples
123 | if [[ -n "$(ls -A "$INSTALLDIR"/var/binds/*.prs)" ]]
124 | then
125 | for PRSFILES in "$INSTALLDIR"/var/binds/*.prs
126 | do
127 | . "$PRSFILES"
128 | done
129 | fi
130 | PROOTSTMNT+="-b /data/data/com.termux/files/usr/tmp:/tmp -w /root /usr/bin/env -i HOME=/root TERM=\"$TERM\" TMPDIR=/tmp ANDROID_DATA=/data "
131 | PROOTSTMNTU="${PROOTSTMNT//HOME=\/root/HOME=\/home\/\$2}"
132 | PROOTSTMNTU="${PROOTSTMNTU//-0 }"
133 | PROOTSTMNTU="${PROOTSTMNTU//-w \/root/-w \/home\/\$2}" # PRoot user string with link2symlink option enabled
134 | PROOTSTMNTEU="${PROOTSTMNTU//--link2symlink }" # PRoot user string with link2symlink option disabled
135 | PROOTSTMNT="${PROOTSTMNT//-i \"\$2:wheel\" }" # PRoot root user string
136 | }
137 | _PR00TSTRING_
138 | ## printf "\\n%s\\n" "PROOTSTMNT string [root]:" && printf "%s\\n\\n" "${PROOTSTMNT:-}" && printf "%s\\n" "PROOTSTMNTC string [root command]:" && printf "%s\\n\\n" "${PROOTSTMNTU:-}" && printf "%s\\n" "PROOTSTMNTEU string [elogin]:" && printf "%s\\n\\n" "${PROOTSTMNTU:-}" && printf "%s\\n" "PROOTSTMNTU string [login]:" && printf "%s\\n\\n" "${PROOTSTMNTU:-}" && printf "%s\\n" "PROOTSTMNTPRTR string [raw]:" && printf "%s\\n\\n" "${PROOTSTMNT:-}" && printf "%s\\n" "PROOTSTMNTPSLC string [su login command]:" && printf "%s\\n\\n" "${PROOTSTMNT:-}" && exit
139 | ## The commands 'setupTermuxArch r[e[fresh]]' can be used to regenerate the start script to the newest version if there is a newer version published and can be customized as wanted. Command 'setupTermuxArch refresh' will refresh the installation globally, including executing 'keys' and 'locales-gen' and backup user configuration files that were initially created and are refreshed. The command 'setupTermuxArch re' will refresh the installation and update user configuration files and backup user configuration files that were initially created and are refreshed. Command 'setupTermuxArch r' will only refresh the installation and update the root user configuration files and backup root user configuration files that were initially created and are refreshed.
140 | # knownconfigurations.bash FE
141 |
--------------------------------------------------------------------------------
/maintenanceroutines.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Copyright 2017-2022 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
3 | ## Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
4 | ## https://sdrausty.github.io/TermuxArch/README has info about this project.
5 | ## https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
6 | ################################################################################
7 |
8 | _COPYIMAGE_() { # A systemimage.tar.gz file can be used: 'setupTermuxArch ./[path/]systemimage.tar.gz' and 'setupTermuxArch /absolutepath/systemimage.tar.gz'
9 | if [[ "$LCP" = "0" ]]
10 | then
11 | printf "%s\\n" "Copying $GFILE.md5 to $INSTALLDIR..."
12 | cp "$GFILE".md5 "$INSTALLDIR"
13 | printf "%s\\n" "Copying $GFILE to $INSTALLDIR..."
14 | cp "$GFILE" "$INSTALLDIR"
15 | elif [[ "$LCP" = "1" ]]
16 | then
17 | printf "%s\\n" "Copying $GFILE.md5 to $INSTALLDIR..."
18 | cp "$WDIR$GFILE".md5 "$INSTALLDIR"
19 | printf "%s\\n" "Copying $GFILE to $INSTALLDIR..."
20 | cp "$WDIR$GFILE" "$INSTALLDIR"
21 | fi
22 | GFILE="${GFILE##/*/}"
23 | IFILE="${GFILE##*/}"
24 | }
25 |
26 | _DOFUNLCR2_() {
27 | _BKPTHF_() { # backup file to backup file directory
28 | cp "$INSTALLDIR/home/$TALUSER/$DOFLNAME" "$BKPDIR/$DOFLNAME.$SDATE.bkp" && printf "\\e[0;32mFile '%s' backed up to '\\e[1;32m%s\\e[0;32m'. " "$INSTALLDIR/home/$TALUSER/$DOFLNAME" "$BKPDIR/$DOFLNAME.$SDATE.bkp"
29 | }
30 | _CPYFRT_() { # copy file from root login to user
31 | cp "$INSTALLDIR/root/$DOFLNAME" "$INSTALLDIR/home/$TALUSER/" && printf "\\e[0;32mFile '%s' copied to '\\e[1;32m%s\\e[0;32m'. " "${INSTALLDIR##*/}/root/$DOFLNAME" "${INSTALLDIR##*/}/home/$TALUSER/$DOFLNAME"
32 | }
33 | BKPDIR="$INSTALLDIR/var/backups/${INSTALLDIR##*/}/home/$TALUSER"
34 | [ -d "$BKPDIR" ] || mkdir -p "$BKPDIR"
35 | if [ "$TALUSER" != alarm ]
36 | then
37 | DOFLIST_=(.bash_logout .bash_profile .bashrc .cshrc .emacs .gitconfig .initrc .inputrc .vimrc .profile .zshrc)
38 | for DOFLNAME in "${DOFLIST_[@]}"
39 | do
40 | printf "\\n\\e[0;32mProcessing user \\e[1;32m%s\\e[0;32m file \\e[1;32m%s\\e[0;32m. " "$TALUSER" "$DOFLNAME"
41 | if [ -f "$INSTALLDIR/root/$DOFLNAME" ] && [ -f "$INSTALLDIR/home/$TALUSER/$DOFLNAME" ]
42 | then
43 | diff "$INSTALLDIR/root/$DOFLNAME" "$INSTALLDIR/home/$TALUSER/$DOFLNAME" 1>/dev/null || { _BKPTHF_ && _CPYFRT_ ; }
44 | elif [ -f "$INSTALLDIR/root/$DOFLNAME" ] && [ ! -f "$INSTALLDIR/home/$TALUSER/$DOFLNAME" ]
45 | then
46 | _CPYFRT_
47 | fi
48 | done
49 | fi
50 | }
51 |
52 | _DOTHRF_() { # do the root user files
53 | [ -f $1 ] && { printf "\\e[1;32m%s\\e[0;32m%s\\e[0m\\n" "==>" " cp $1 /var/backups/${INSTALLDIR##*/}/$1.$SDATE.bkp" && cp "$1" "$INSTALLDIR/var/backups/${INSTALLDIR##*/}/$1.$SDATE.bkp" ; } || printf "%s" "copy file '$1' if found; file not found; continuing; "
54 | }
55 |
56 | _FUNLCR2_() { # copy from root to home
57 | export FLCRVAR=($(ls home/))
58 | for TALUSER in "${FLCRVAR[@]}"
59 | do
60 | _DOFUNLCR2_
61 | done
62 | }
63 |
64 | _PPLCACHEDIR_() {
65 | printf '\e[0;32mPopulating from cache files: \e[1;32mBEGUN…\n\e[0;32mThe \e[1;32m%s\e[0;32m command can be used to populate the cache. The command \e[1;32m%s\e[0;32m will repopulate the installation package files from the cache directory and update the TermuxArch files to the newest published version.\n\e[1;32m' "'trim'" "'${0##*/} ref'"
66 |
67 | { [ -e "$CACHEDIR" ] && cd "$CACHEDIR" && printf '%s' "cd $CACHEDIR && " ; } || { cd "$PREFIXDATAFILES" && mkdir -p "$PREFIXDATAFILESUFIX" && cd "$CACHEDIR" && printf '%s\n' "cd $PREFIXDATAFILES && mkdir -p $PREFIXDATAFILESUFIX && cd $CACHEDIR && " ; } || exit 196
68 | cd "$INSTALLDIR" && printf '%s\n' "cd $INSTALLDIR" || exit 196
69 | find "$CACHEDIR" -type f -name "*tar.gz*" -exec ln -s {} \; 2>/dev/null
70 | [ -d "$INSTALLDIR"/var/cache/pacman/pkg ] || { mkdir -p "$INSTALLDIR"/var/cache/pacman/pkg && printf '%s' "mkdir -p $INSTALLDIR/var/cache/pacman/pkg && " ; }
71 | cd "$INSTALLDIR"/var/cache/pacman/pkg && printf '%s\n' "cd $INSTALLDIR/var/cache/pacman/pkg" || exit 196
72 | printf '%s\n' "find "$CACHEDIR$CACHEDIRSUFIX" -type f -exec ln -s {} \;" && find "$CACHEDIR$CACHEDIRSUFIX" -type f -exec ln -s {} \; 2>/dev/null
73 | cd "$INSTALLDIR" && printf '%s\n' "cd $INSTALLDIR" || exit 196
74 | printf '\e[0;32mPopulating from cache files: \e[1;32mDONE\n\n'
75 | }
76 |
77 | _DOUSECACHEDIR_() {
78 | if { [ "$USECACHEDIR" = 0 ] && [ -z "${LCR:-}" ] ; } || { [ "$USECACHEDIR" = 0 ] && [ "${LCR:-}" = 3 ] ; }
79 | then
80 | _PPLCACHEDIR_
81 | fi
82 | }
83 |
84 | _LOADIMAGE_() {
85 | _NAMESTARTARCH_
86 | _SPACEINFO_
87 | printf "\\n"
88 | _PREPINSTALLDIR_
89 | _COPYIMAGE_
90 | _MD5CHECK_
91 | _PRINTCU_
92 | rm -f "$INSTALLDIR"/*.tar.gz "$INSTALLDIR"/*.tar.gz.md5
93 | _PRINTDONE_
94 | _PRINTCONFIGUP_
95 | _TOUCHUPSYS_
96 | printf "\\n"
97 | _PRINTFOOTER_
98 | set +Eeuo pipefail
99 | "$INSTALLDIR/$STARTBIN" || _PRINTPROOTERROR_
100 | set -Eeuo pipefail
101 | _PRINTFOOTER2_
102 | _PRINTSTARTBIN_USAGE_
103 | exit
104 | }
105 |
106 | _FIXOWNER_() { # fix owner of INSTALLDIR/home/USER, PR by @petkar
107 | _DOFIXOWNER_() {
108 | printf "\\e[0;32m%s" "Adjusting ownership and permissions: BEGUN"
109 | FXARR="$(ls "$INSTALLDIR/home")"
110 | for TALUSER in ${FXARR[@]}
111 | do
112 | if [[ "$TALUSER" != alarm ]]
113 | then
114 | $STARTBIN c "chmod 777 $INSTALLDIR/home/$TALUSER"
115 | $STARTBIN c "chown -R $TALUSER:$TALUSER $INSTALLDIR/home/$TALUSER"
116 | fi
117 | done
118 | printf "\\e[0;32m%s\\e[0m\\n" ": DONE"
119 | }
120 | # _DOFIXOWNER_ || _PSGI1ESTRING_ "_DOFIXOWNER_ maintenanceroutines.bash ${0##*/}"
121 | }
122 |
123 | _REFRESHSYS_() { # refresh installation
124 | printf '\033]2; setupTermuxArch refresh 📲 \007'
125 | _NAMESTARTARCH_
126 | _SPACEINFO_
127 | _PREPINSTALLDIR_
128 | _DOUSECACHEDIR_
129 | _SETLOCALE_
130 | printf "\\n"
131 | printf "\\e[1;32m==> \\e[1;37m%s \\e[1;32m%s %s...\\n" "Running" "${0##*/}" "$ARGS"
132 | "$INSTALLDIR"/root/bin/setupbin.bash || _PRINTPROOTERROR_
133 | rm -f root/bin/finishsetup.bash
134 | rm -f root/bin/setupbin.bash
135 | printf "\\n\\e[1;32mFiles updated to the newest version %s:\\n\\e[0;32m" "$VERSIONID"
136 | ls "$INSTALLDIR/$STARTBIN" | cut -f7- -d /
137 | ls "$INSTALLDIR"/bin/we | cut -f7- -d /
138 | ls "$INSTALLDIR"/root/.bashrc | cut -f7- -d /
139 | ls "$INSTALLDIR"/root/.bash_profile | cut -f7- -d /
140 | ls "$INSTALLDIR"/root/.vimrc | cut -f7- -d /
141 | ls "$INSTALLDIR"/root/.gitconfig | cut -f7- -d /
142 | printf "\\n\\e[1;32m%s\\n\\e[0;32m" "Files updated to the newest version $VERSIONID in directory ~/${INSTALLDIR##*/}$TMXRCHBNDR/:"
143 | ls "$INSTALLDIR$TMXRCHBNDR/"
144 | if [[ "${LCR:-}" = 2 ]] || [[ "${LCR:-}" = 3 ]] || [[ "${LCR:-}" = 4 ]] || [[ "${LCR:-}" = 5 ]]
145 | then
146 | _FUNLCR2_
147 | _SHFUNCWRAP_
148 | else
149 | printf "\\n\\e[0;32mIn order to refresh user directories, please use '\\e[1;32m%s re[fresh]\\e[0;32m'. " "${0##*/}"
150 | fi
151 | printf "\\n"
152 | _PRINTFOOTER_
153 | set +Eeuo pipefail
154 | $STARTBIN || _PRINTPROOTERROR_
155 | set -Eeuo pipefail
156 | _PRINTFOOTER2_
157 | _PRINTSTARTBIN_USAGE_
158 | exit
159 | }
160 |
161 | _SHFUNC_ () {
162 | _SHFDFUNC_ () {
163 | SHFD="$(find "$RMDIR" -type d -printf '%03d %p\n' | sort -r -n -k 1 | cut -d" " -f 2)"
164 | for SHF1D in $SHFD
165 | do
166 | rmdir "$SHF1D" || printf "%s" "Cannot 'rmdir $SHF1D': Continuing..."
167 | done
168 | }
169 | printf "\n%s\n" "Script '${0##*/}' checking and fixing permissions in directory '$PWD': STARTED..."
170 | SDIRS="apex data host-rootfs sdcard storage system vendor"
171 | for SDIR in $SDIRS
172 | do
173 | RMDIR="$INSTALLDIR/$SDIR"
174 | [ -d "$RMDIR" ] && { chmod 755 "$RMDIR" ; printf "%s" "Deleting superfluous '$RMDIR' directory: " && { rmdir "$RMDIR" || _SHFDFUNC_ ; } && printf "%s\n" "Continuing..." ; }
175 | done
176 | PERRS="$(du "$INSTALLDIR" 2>&1 >/dev/null ||:)"
177 | PERRS="$(sed "s/du: cannot read directory '//g" <<< "$PERRS" | sed "s/': Permission denied//g")"
178 | [ -z "$PERRS" ] || { printf "%s" "Fixing permissions in '$INSTALLDIR': " && for PERR in $PERRS ; do chmod 777 "$PERR" ; done && printf "%s\n" "DONE" ; } || printf "%s" "Fixing permissions signal PERRS: Continuing..."
179 | printf "%s\n" "Script '${0##*/}' checking and fixing permissions: DONE"
180 | }
181 |
182 | _SHFUNCWRAP_ () {
183 | if [[ "${LCR:-}" -eq 3 ]] || [[ "${LCR:-}" -eq 4 ]] || [[ "${LCR:-}" -eq 5 ]]
184 | then
185 | _PREPPACMANCONF_
186 | FNDTMPROOT=($(find "$TMPDIR" -maxdepth 1 -type d -name "proot*"))
187 | if [ ${#FNDTMPROOT[@]} = 0 ]
188 | then
189 | _SHFUNC_ "$@"
190 | else
191 | if [ ${#FNDTMPROOT[@]} = 1 ]
192 | then
193 | printf "\\n\\e[0;34m%s" "Found ${#FNDTMPROOT[@]} open Termux PRoot QEMU session; Not checking for errors."
194 | else
195 | printf "\\n\\e[0;34m%s" "Found ${#FNDTMPROOT[@]} open Termux PRoot QEMU sessions; Not checking for errors."
196 | fi
197 | fi
198 | fi
199 | }
200 |
201 | _SPACEINFO_() {
202 | declare SPACEMESSAGE=""
203 | units="$(df "$INSTALLDIR" | awk 'FNR == 1 {print $2}')"
204 | if [[ "$units" = Size ]]
205 | then
206 | _SPACEINFOGSIZE_
207 | printf "$SPACEMESSAGE"
208 | elif [[ "$units" = 1K-blocks ]]
209 | then
210 | _SPACEINFOKSIZE_
211 | printf "$SPACEMESSAGE"
212 | fi
213 | }
214 |
215 | _SPACEINFOGSIZE_() {
216 | _USERSPACE_
217 | if [[ "$CPUABI" = "$CPUABIX86" ]] || [[ "$CPUABI" = "$CPUABIX8664" ]]
218 | then
219 | if [[ "$USRSPACE" = *G ]]
220 | then
221 | SPACEMESSAGE=""
222 | elif [[ "$USRSPACE" = *M ]]
223 | then
224 | USSPACE="${USRSPACE: : -1}"
225 | fi
226 | if [[ "$USSPACE" -lt "800" ]] && [[ "$CPUABI" = "$CPUABIX8664" ]]
227 | then
228 | SPACEMESSAGE="\\e[0;33mTermuxArch: \\e[1;33mFREE SPACE NOTICE! \\e[1;30mStart thinking about cleaning out some stuff please. \\e[33mThere is only $USRSPACE of free user space is available on this device. \\e[1;30mThe recommended minimum to install Arch Linux in Termux PRoot for x86_64 architecture is 800M of free user space.\\e[0m\\n"
229 | fi
230 | if [[ "$USSPACE" -lt "600" ]] && [[ "$CPUABI" = "$CPUABIX86" ]]
231 | then
232 | SPACEMESSAGE="\\e[0;33mTermuxArch: \\e[1;33mFREE SPACE NOTICE! \\e[1;30mStart thinking about cleaning out some stuff please. \\e[33mThere is only $USRSPACE of free user space is available on this device. \\e[1;30mThe recommended minimum to install Arch Linux in Termux PRoot for $CPUABI architecture is 600M of free user space.\\e[0m\\n"
233 | fi
234 | elif [[ "$USRSPACE" = *G ]]
235 | then
236 | USSPACE="${USRSPACE: : -1}"
237 | if [[ "$CPUABI" = "$CPUABI8" ]]
238 | then
239 | if [[ "$USSPACE" -le "1.5" ]]
240 | then
241 | SPACEMESSAGE="\\e[0;33mTermuxArch: \\e[1;33mFREE SPACE NOTICE! \\e[1;30mStart thinking about cleaning out some stuff please. \\e[33mThere is only $USRSPACE of free user space is available on this device. \\e[1;30mThe recommended minimum to install Arch Linux in Termux PRoot for aarch64 architecture is 1.5G of free user space.\\e[0m\\n"
242 | else
243 | SPACEMESSAGE=""
244 | fi
245 | elif [[ "$CPUABI" = "$CPUABI7" ]]
246 | then
247 | if [[ "$USSPACE" -le "1.23" ]]
248 | then
249 | SPACEMESSAGE="\\e[0;33mTermuxArch: \\e[1;33mFREE SPACE NOTICE! \\e[1;30mStart thinking about cleaning out some stuff please. \\e[33mThere is only $USRSPACE of free user space is available on this device. \\e[1;30mThe recommended minimum to install Arch Linux in Termux PRoot for armv7 architecture is 1.23G of free user space.\\e[0m\\n"
250 | else
251 | SPACEMESSAGE=""
252 | fi
253 | else
254 | SPACEMESSAGE=""
255 | fi
256 | else
257 | SPACEMESSAGE="\\e[0;33mTermuxArch: \\e[1;33mFREE SPACE NOTICE! \\e[1;30mStart thinking about cleaning out some stuff please. \\e[33mThere is only $USRSPACE of free user space is available on this device. \\e[1;30mThe recommended minimum to install Arch Linux in Termux PRoot is more than 1.5G for aarch64, more than 1.25G for armv7, 800M for x86_64 and 600M of free user space for x86 architecture.\\e[0m\\n"
258 | fi
259 | }
260 |
261 | _SPACEINFOKSIZE_() {
262 | _USERSPACE_
263 | if [[ "$CPUABI" = "$CPUABI8" ]]
264 | then
265 | if [[ "$USRSPACE" -lt "1500000" ]]
266 | then
267 | SPACEMESSAGE="\\e[0;33mTermuxArch: \\e[1;33mFREE SPACE NOTICE! \\e[1;30mStart thinking about cleaning out some stuff please. There is only \\e[33m$USRSPACE $units of free user space \\e[1;30mavailable on this device. The recommended minimum to install Arch Linux in Termux PRoot for aarch64 architecture is 1.5G of free user space.\\e[0m\\n"
268 | else
269 | SPACEMESSAGE=""
270 | fi
271 | elif [[ "$CPUABI" = "$CPUABI7" ]]
272 | then
273 | if [[ "$USRSPACE" -lt "1250000" ]]
274 | then
275 | SPACEMESSAGE="\\e[0;33mTermuxArch: \\e[1;33mFREE SPACE NOTICE! \\e[1;30mStart thinking about cleaning out some stuff please. There is only \\e[33m$USRSPACE $units of free user space \\e[1;30mavailable on this device. The recommended minimum to install Arch Linux in Termux PRoot for armv7 architecture is 1.25G of free user space.\\e[0m\\n"
276 | else
277 | SPACEMESSAGE=""
278 | fi
279 | elif [[ "$CPUABI" = "$CPUABIX8664" ]]
280 | then
281 | if [[ "$USRSPACE" -lt "800000" ]]
282 | then
283 | SPACEMESSAGE="\\e[0;33mTermuxArch: \\e[1;33mFREE SPACE NOTICE! \\e[1;30mStart thinking about cleaning out some stuff please. There is only \\e[33m$USRSPACE $units of free user space \\e[1;30mavailable on this device. The recommended minimum to install Arch Linux in Termux PRoot for x86_64 architecture is 800M of free user space.\\e[0m\\n"
284 | else
285 | SPACEMESSAGE=""
286 | fi
287 | elif [[ "$CPUABI" = "$CPUABIX86" ]] || [[ "$CPUABI" = "i386" ]]
288 | then
289 | if [[ "$USRSPACE" -lt "600000" ]]
290 | then
291 | SPACEMESSAGE="\\e[0;33mTermuxArch: \\e[1;33mFREE SPACE NOTICE! \\e[1;30mStart thinking about cleaning out some stuff please. There is only \\e[33m$USRSPACE $units of free user space \\e[1;30mavailable on this device. The recommended minimum to install Arch Linux in Termux PRoot for $CPUABI architecture is 600M of free user space.\\e[0m\\n"
292 | else
293 | SPACEMESSAGE=""
294 | fi
295 | fi
296 | }
297 |
298 | _SYSINFO_() {
299 | _NAMESTARTARCH_
300 | _SPACEINFO_
301 | printf "\\e[38;5;76m"
302 | printf "%s\\n" "Generating TermuxArch version $VERSIONID system information; Please wait..."
303 | _TASPINNER_ clock & _SYSTEMINFO_ ; kill $! || _PRINTERRORMSG_ "_SYSINFO_ _SYSTEMINFO_ ${0##*/} maintenanceroutines.bash"
304 | cat "${WDIR}setupTermuxArchSysInfo$STIME".log
305 | printf "\\n\\e[1mPlease share relevant system information along with an issue and pull request at https://github.com/TermuxArch/TermuxArch/issues and also include the input and output with information which may be quite important when planning issues at https://github.com/TermuxArch/TermuxArch/issues with the hope of improving this script, \'%s\'.\\n\\nIf you believe screenshots will help in a quicker resolution for an issue, also include them as well. Please include the input as well as the output, along with screenshots relrevant to Xserver on Android device, and similar.\\n\\n" "${0##*/}"
306 | exit
307 | }
308 |
309 | _SYSTEMINFO_ () {
310 | printf "%s\\n" "dpkg --print-architecture result:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
311 | dpkg --print-architecture >> "${WDIR}setupTermuxArchSysInfo$STIME".log
312 | printf "\\n%s\\n" "uname -a results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
313 | uname -a >> "${WDIR}setupTermuxArchSysInfo$STIME".log
314 | printf "\\n" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
315 | for n in 0 1 2 3 4 5
316 | do
317 | printf "%s\\n" "BASH_VERSINFO[$n] = ${BASH_VERSINFO[$n]}" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
318 | done
319 | printf "\\n%s\\n" "cat /proc/cpuinfo results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
320 | cat /proc/cpuinfo >> "${WDIR}setupTermuxArchSysInfo$STIME".log
321 | printf "\\n%s\\n" "getprop | grep product.cpu results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
322 | getprop | grep product.cpu >> "${WDIR}setupTermuxArchSysInfo$STIME".log
323 | printf "\\n%s\\n" "getprop | grep net. results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
324 | getprop | grep net\\. >> "${WDIR}setupTermuxArchSysInfo$STIME".log
325 | printf "\\nFurther getprop results:\\n" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
326 | printf "%s %s\\n" "[getprop gsm.sim.operator.iso-country]:" "[$(getprop gsm.sim.operator.iso-country)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
327 | printf "%s %s\\n" "[getprop persist.sys.locale]:" "[$(getprop persist.sys.locale)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
328 | printf "%s %s\\n" "[getprop ro.build.target_country]:" "[$(getprop ro.build.target_country)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
329 | printf "%s %s\\n" "[getprop ro.build.version.release]:" "[$SYSVER]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
330 | printf "%s %s\\n" "[getprop ro.build.version.preview_sdk]:" "[$(getprop ro.build.version.preview_sdk)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
331 | printf "%s %s\\n" "[getprop ro.build.version.sdk]:" "[$(getprop ro.build.version.sdk)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
332 | printf "%s %s\\n" "[getprop ro.com.google.clientidbase]:" "[$(getprop ro.com.google.clientidbase)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
333 | printf "%s %s\\n" "[getprop ro.com.google.clientidbase.am]:" "[$(getprop ro.com.google.clientidbase.am)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
334 | printf "%s %s\\n" "[getprop ro.com.google.clientidbase.ms]:" "[$(getprop ro.com.google.clientidbase.ms)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
335 | printf "%s %s\\n" "[getprop ro.product.device]:" "[$(getprop ro.product.device)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
336 | printf "%s %s\\n" "[getprop ro.product.first_api_level]:" "[$(getprop ro.product.first_api_level)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
337 | printf "%s %s\\n" "[getprop ro.product.locale]:" "[$(getprop ro.product.locale)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
338 | printf "%s %s\\n" "[getprop ro.product.manufacturer]:" "[$(getprop ro.product.manufacturer)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
339 | printf "%s %s\\n" "[getprop ro.product.model]:" "[$(getprop ro.product.model)]" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
340 | printf "\\n%s\\n" "Download directory information results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
341 | [[ -e /sdcard/Download ]] && printf "%s\\n" "/sdcard/Download exists" || printf "%s\\n" "/sdcard/Download not found" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
342 | [[ -e /storage/emulated/0/Download ]] && printf "%s\\n" "/storage/emulated/0/Download exists" || printf "%s\\n" "/storage/emulated/0/Download not found" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
343 | [[ -e "$HOME"/downloads ]] && printf "%s\\n" "$HOME/downloads exists" || printf "%s\\n" "~/downloads not found" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
344 | [[ -e "$HOME"/storage/downloads ]] && printf "%s\\n" "$HOME/storage/downloads exists" || printf "%s\\n" "$HOME/storage/downloads not found" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
345 | printf "\\n%s\\n" "Device information results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
346 | [[ -e /dev/ashmem ]] && printf "%s\\n" "/dev/ashmem exists" || printf "%s\\n" "/dev/ashmem does not exist" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
347 | [[ -r /dev/ashmem ]] && printf "%s\\n" "/dev/ashmem is readable" || printf "%s\\n" "/dev/ashmem is not readable" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
348 | [[ -w /dev/ashmem ]] && printf "%s\\n" "/dev/ashmem is writable" || printf "%s\\n" "/dev/ashmem is not writable" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
349 | printf "\\n%s" "Ascertaining system information; Please wait a moment "
350 | [[ -e /dev/shm ]] && printf "%s\\n" "/dev/shm exists" || printf "%s\\n" "/dev/shm does not exist" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
351 | [[ -r /dev/shm ]] && printf "%s\\n" "/dev/shm is readable" || printf "%s\\n" "/dev/shm is not readable" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
352 | [[ -e /proc/stat ]] && printf "%s\\n" "/proc/stat exits" || printf "%s\\n" "/proc/stat does not exit" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
353 | [[ -r /proc/stat ]] && printf "%s\\n" "/proc/stat is readable" || printf "%s\\n" "/proc/stat is not readable">> "${WDIR}setupTermuxArchSysInfo$STIME".log
354 | [[ -e /sys/ashmem ]] && printf "%s\\n" "/sys/ashmmem exists" || printf "%s\\n" "/sys/ashmmem does not exist" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
355 | [[ -r /sys/ashmmem ]] && printf "%s\\n" "/sys/ashmmem is readable" || printf "%s\\n" "/sys/ashmmem is not readable" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
356 | [[ -e /sys/shm ]] && printf "%s\\n" "/sys/shm exists" || printf "%s\\n" "/sys/shm does not exist" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
357 | [[ -r /sys/shm ]] && printf "%s\\n" "/sys/shm is readable" || printf "%s\\n" "/sys/shm is not readable" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
358 | printf "\\n%s\\n" "Disk report $USRSPACE on /data $(date)" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
359 | printf "\\n%s\\n" "df $INSTALLDIR results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
360 | df "$INSTALLDIR" >> "${WDIR}setupTermuxArchSysInfo$STIME".log ||:
361 | printf "\\n%s\\n" "df results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
362 | df >> "${WDIR}setupTermuxArchSysInfo$STIME".log ||:
363 | printf "\\n%s\\n" "du -hs $INSTALLDIR results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
364 | du -hs "$INSTALLDIR" >> "${WDIR}setupTermuxArchSysInfo$STIME".log ||:
365 | printf "\\n%s\\n" "ls -al $INSTALLDIR results:" >> "${WDIR}setupTermuxArchSysInfo$STIME".log
366 | ls -al "$INSTALLDIR" >> "${WDIR}setupTermuxArchSysInfo$STIME".log ||:
367 | printf "\\n%s\\n" "This file is found at '${WDIR}setupTermuxArchSysInfo$STIME.log'." >> "${WDIR}setupTermuxArchSysInfo$STIME".log
368 | printf "\\n%s\\e[0m\\n" "End 'setupTermuxArchSysInfo$STIME.log' version $VERSIONID system information." >> "${WDIR}setupTermuxArchSysInfo$STIME".log
369 | }
370 |
371 | _USERSPACE_() {
372 | USRSPACE="$(df "$INSTALLDIR" | awk 'FNR == 2 {print $4}')"
373 | if [[ "$USRSPACE" = "" ]]
374 | then
375 | USRSPACE="$(df "$INSTALLDIR" | awk 'FNR == 3 {print $3}')"
376 | fi
377 | }
378 | # maintenanceroutines.bash FE
379 |
--------------------------------------------------------------------------------
/necessaryfunctions.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Copyright 2017-2022 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
3 | ## Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
4 | ## https://sdrausty.github.io/TermuxArch/README has info about this project.
5 | ## https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
6 | ################################################################################
7 | _PRNT_ () { printf "%s\\n" "$1" ; } # print message with one trialing newline
8 | _PRT_ () { printf "%s" "$1" ; } # print message with no trialing newline
9 | _QEMUCFCK_() {
10 | if [[ -f "$INSTALLDIR/$STARTBIN" ]] && grep proot "$INSTALLDIR/$STARTBIN" | grep -m1 qemu 1>/dev/null
11 | then # set installed qemu architecture
12 | ARCTEVAR="$(grep proot "$INSTALLDIR/$STARTBIN" | grep -m1 qemu)"
13 | ARCTEVAR="$(cut -d" " -f1 <<< ${ARCTEVAR#*qemu-})"
14 | [ "${ARCTEVAR:-}" = x86 ] && ARCTEVAR="i386"
15 | for RCTFVR in ${ALLRCTFVR[@]}
16 | do
17 | if [ "$RCTFVR" = "${ARCTEVAR:-}" ]
18 | then
19 | INCOMM="qemu-user-${ARCTEVAR:-}" && QEMUCR=0
20 | break
21 | fi
22 | done
23 | fi
24 | [ -z ${ARCTEVAR:-} ] && ARCTEVAR="$CPUABI"
25 | CPUABIDD="$(getprop ro.product.cpu.abi)"
26 | printf "Detected architecture is %s; Install architecture is set to %s.\\n" "$CPUABIDD" "$ARCTEVAR"
27 | }
28 | _QEMUCFCK_
29 | BINFNSTP="finishsetup.bash"
30 | CACHEDIRSUFIX="var/cache/pacman/pkg/"
31 | LC_TYPE=("LANG" "LANGUAGE" "LC_ADDRESS" "LC_COLLATE" "LC_CTYPE" "LC_IDENTIFICATION" "LC_MEASUREMENT" "LC_MESSAGES" "LC_MONETARY" "LC_NAME" "LC_NUMERIC" "LC_PAPER" "LC_TELEPHONE" "LC_TIME")
32 | PREFIXDATAFILESUFIX="files/cache/archlinux/$ARCTEVAR/var/cache/pacman/pkg/"
33 | TXPRQUON="Termux PRoot with QEMU"
34 | TXPRQUON="Termux PRoot"
35 | UNAMER="$(uname -r)"
36 |
37 | _CALLSYSTEM_() {
38 | declare COUNTER=""
39 | if [[ "$CPUABI" = "$CPUABIX86" ]] || [[ "$CPUABI" = "$CPUABIX8664" ]]
40 | then
41 | _GETIMAGE_ ||:
42 | else
43 | if [[ "$CMIRROR" = "os.archlinuxarm.org" ]] || [[ "$CMIRROR" = "mirror.archlinuxarm.org" ]]
44 | then
45 | until _FTCHSTND_ ||:
46 | do
47 | _FTCHSTND_
48 | sleep 2
49 | printf "\\n"
50 | COUNTER=$((COUNTER + 1))
51 | if [[ "$COUNTER" = 9 ]]
52 | then
53 | _PRINTMAX_
54 | break
55 | fi
56 | done
57 | else
58 | _FTCHIT_
59 | fi
60 | fi
61 | }
62 |
63 | _COPYSTARTBIN2PATH_() {
64 | if [[ ":$PATH:" == *":$HOME/bin:"* ]] && [[ -d "$HOME"/bin ]]
65 | then
66 | BPATH="$HOME"/bin
67 | else
68 | BPATH="$PREFIX"/bin
69 | fi
70 | cp "$INSTALLDIR/$STARTBIN" "$BPATH"
71 | printf "\\n\\e[0;34m%s\\e[1;34m%s\\e[1;32m%s\\e[1;34m%s\\e[1;37m%s\\e[1;34m.\\e[0m\\n\\n" " 🕛 > 🕐 " "File " "$STARTBIN " "copied to " "$BPATH"
72 | }
73 |
74 | _DETECTSYSTEM_() {
75 | _PRINTDETECTEDSYSTEM_
76 | if [[ "$CPUABI" = "$CPUABI5" ]]
77 | then
78 | _ARMV5L_
79 | elif [[ "$CPUABI" = "$CPUABI7" ]]
80 | then
81 | _DETECTSYSTEM7_
82 | elif [[ "$CPUABI" = "$CPUABI8" ]]
83 | then
84 | _DETECTSYSTEM64_
85 | elif [[ "$CPUABI" = "$CPUABIX86" ]]
86 | then
87 | _I686_
88 | elif [[ "$CPUABI" = "$CPUABIX8664" ]]
89 | then
90 | _X86_64_
91 | else
92 | _PRINTMISMATCH_
93 | fi
94 | }
95 |
96 | _DETECTSYSTEM7_() {
97 | if [[ "$(getprop ro.product.device)" == *_cheets ]]
98 | then
99 | _ARMV7CHROME_
100 | else
101 | _ARMV7ANDROID_
102 | fi
103 | }
104 |
105 | _DETECTSYSTEM64_() {
106 | if [[ "$(getprop ro.product.device)" == *_cheets ]]
107 | then
108 | _AARCH64CHROME_
109 | else
110 | _AARCH64ANDROID_
111 | fi
112 | }
113 |
114 | _DOMIRROR_() { # partial implementaion: choose the corrrect mirror and test this mirror website
115 | _DOCEMIRROR_() {
116 | COUNTRYCODEISO="$(getprop gsm.operator.iso-country)"
117 | USERCOUNTRYCODE="${COUNTRYCODEISO%%[\ \,]*}"
118 | if [[ -z "${USERCOUNTRYCODE:-}" ]]
119 | then
120 | USERCOUNTRYCODE="$(getprop gsm.sim.operator.iso-country)"
121 | fi
122 | if [[ -z "${USERCOUNTRYCODE:-}" ]]
123 | then
124 | USERCOUNTRYCODE="us"
125 | fi
126 | printf "Copying file '%s' to file '%s'; " "$INSTALLDIR/etc/pacman.d/mirrorlist" "$INSTALLDIR/etc/pacman.d/mirrorlist.$STIME.termuxarchnew"
127 | cp "$INSTALLDIR/etc/pacman.d/mirrorlist" "$INSTALLDIR/etc/pacman.d/mirrorlist.$STIME.termuxarchnew"
128 | printf "DONE\\n"
129 | if [[ $USERCOUNTRYCODE == us ]]
130 | then
131 | USERCOUNTRYCODE="edu\/"
132 | fi
133 | CHSENMIR="$(grep -w http "$INSTALLDIR/etc/pacman.d/mirrorlist" | grep ^#S | grep "$USERCOUNTRYCODE" | awk 'sub(/^.{1}/,"")' | head -n 1)"
134 | printf "%s\\n" "$CHSENMIR" >> "$INSTALLDIR/etc/pacman.d/mirrorlist"
135 | printf "Choosing mirror '%s' in file '%s'; Continuing...\\n" "$CHSENMIR" "$INSTALLDIR/etc/pacman.d/mirrorlist"
136 | DOMIRLCR=0
137 | }
138 | if [[ -f "$INSTALLDIR/run/lock/${INSTALLDIR##*/}/domirror.lock" ]]
139 | then
140 | printf "Lockfile '%s' exists; Continuing..." "$INSTALLDIR/run/lock/${INSTALLDIR##*/}/domirror.lock"
141 | else
142 | if ! grep ^Server "$INSTALLDIR/etc/pacman.d/mirrorlist"
143 | then
144 | _DOCEMIRROR_
145 | fi
146 | fi
147 | }
148 |
149 | _MAINBLOCK_() {
150 | declare KID
151 | declare -i KERNEL_VERSION
152 | declare -i MAJOR_REVISION
153 | declare -- MINOR_REVISION
154 | declare -- TMPKERN
155 | export KID=1
156 | KERNEL_VERSION="$(awk -F'.' '{print $1}' <<< "$UNAMER")"
157 | MAJOR_REVISION="$(awk -F'.' '{print $2}' <<< "$UNAMER")"
158 | TMPKERN="$(awk -F'.' '{print $3}' <<< "$UNAMER")"
159 | MINOR_REVISION="$(sed 's/[^0-9]*//g' <<< "${TMPKERN:0:3}")"
160 | if [[ "$KERNEL_VERSION" -le 2 ]]
161 | then
162 | export KID=0
163 | else
164 | if [[ "$KERNEL_VERSION" -eq 3 ]]
165 | then
166 | if [[ "$MAJOR_REVISION" -lt 2 ]]
167 | then
168 | export KID=0
169 | else
170 | if [[ "$MAJOR_REVISION" -eq 2 ]] && [[ "$MINOR_REVISION" -eq 0 ]]
171 | then
172 | export KID=0
173 | fi
174 | fi
175 | fi
176 | fi
177 | _NAMESTARTARCH_
178 | _SPACEINFO_
179 | _PREPINSTALLDIR_
180 | _DETECTSYSTEM_
181 | _WAKEUNLOCK_
182 | _PRINTFOOTER_
183 | "$INSTALLDIR/$STARTBIN" || _PRINTPROOTERROR_
184 | _PRINTFOOTER2_
185 | _PRINTSTARTBIN_USAGE_
186 | exit
187 | }
188 |
189 | _MAKESYSTEM_() {
190 | _WAKELOCK_
191 | if [ "$USECACHEDIR" = 0 ] && [ -z "${LCR:-}" ]
192 | then
193 | if [ -d "$CACHEDIR" ]
194 | then
195 | _PPLCACHEDIR_
196 | else
197 | cd "$PREFIXDATAFILES" && { [ -d "$PREFIXDATAFILESUFIX" ] || mkdir -p "$PREFIXDATAFILESUFIX" ; } && printf '%s' "cd $PREFIXDATAFILES && mkdir -p $PREFIXDATAFILESUFIX && cd $CACHEDIR && " || printf '%s\n' "Please create cache directory '$CACHEDIR' in order to use the cache directory feature; Continuing..."
198 | CMMDVL="$INSTALLDIR" && { cd "$CMMDVL" && printf '%s\n\n' "cd $CMMDVL" ; } || exit 69
199 | fi
200 | fi
201 | _CALLSYSTEM_
202 | _MD5CHECK_
203 | if [ "$KEEP" = 0 ]
204 | then
205 | _PRINTKEEP_
206 | else
207 | _PRINTCU_
208 | rm -f "$INSTALLDIR"/*.tar.gz "$INSTALLDIR"/*.tar.gz.md5 ## When KEEP=0 files *.tar.gz and *.tar.gz.md5 will remain on the system.
209 | _PRINTDONE_
210 | fi
211 | _PRINTCONFIGUP_
212 | _TOUCHUPSYS_
213 | }
214 |
215 | _MD5CHECK_() {
216 | if md5sum -c --quiet "$IFILE".md5 2> /dev/null
217 | then
218 | _PRINTMD5SUCCESS_
219 | printf "\\e[0;32m"
220 | _TASPINNER_ clock & _PREPROOT_ ; kill $! || _PRINTERRORMSG_ "_PREPROOT_ _MD5CHECK_ ${0##*/} necessaryfunctions.bash"
221 | else
222 | if md5sum -c --quiet *.md5 2> /dev/null
223 | then
224 | _PRINTMD5SUCCESS_
225 | printf "\\e[0;32m"
226 | _TASPINNER_ clock & _PREPROOT_ ; kill $! || _PRINTERRORMSG_ "_PREPROOT_ _MD5CHECK_ ${0##*/} necessaryfunctions.bash"
227 | else
228 | { [[ "$KEEP" = 0 ]] && _PRINTKEEPEXIT_ ; exit 203 ; } || { _PRINTMD5ERROR_ && rm -f "$INSTALLDIR"/*.tar.gz "$INSTALLDIR"/*.tar.gz.md5 ; exit 205 ; }
229 | fi
230 | fi
231 | }
232 |
233 | TMXRCHBNDR="/usr/local/termuxarch/bin"
234 | TMXRCHBNDL="usr/local/termuxarch/lib"
235 | TMXRCHBNDS="usr/local/termuxarch/bin"
236 | _PREPROOTDIR_() {
237 | local DRARRLST=("etc" "home" "root/bin" "usr/bin" "$TMXRCHBNDL" "$TMXRCHBNDS" "usr/local/bin" "var/backups/${INSTALLDIR##*/}/etc" "var/backups/${INSTALLDIR##*/}/root" "var/binds")
238 | for ISDIR in ${DRARRLST[@]}
239 | do
240 | { [ -d "$ISDIR" ] || printf "\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[0m\\n" "Creating directory " "'/$ISDIR'" "." && mkdir -p "$ISDIR" ; } || printf "\\e[0;32m%s\\e[1;32m%s\\e[0;32m%s\\e[0m\\n" "Directory " "/$ISDIR" " exists. "
241 | done
242 | } # create directories from local varables plus an array of directory names
243 |
244 | _PREPINSTALLDIR_() {
245 | cd "$INSTALLDIR" || exit 196
246 | _PREPROOTDIR_
247 | _SETLANGUAGE_
248 | _ADDADDS_
249 | _DOMODdotfiles_
250 | printf '\e[0;32mGenerating dot files: \e[1;32mDONE\n'
251 | _MAKEFINISHSETUP_
252 | _MAKESETUPBIN_
253 | _MAKESTARTBIN_
254 | _COPYSTARTBIN2PATH_
255 | _FIXOWNER_
256 | }
257 |
258 | _PREPROOT_() {
259 | if [[ "$CPUABI" = "$CPUABIX86" ]] || [[ "$CPUABI" = "$CPUABIX8664" ]]
260 | then
261 | proot --link2symlink -0 bsdtar -p -xf "$IFILE" --strip-components 1 ||:
262 | else
263 | proot --link2symlink -0 bsdtar -p -xf "$IFILE" ||:
264 | fi
265 | }
266 |
267 | _RUNFINISHSETUP_() {
268 | _SEDUNCOM_() {
269 | sed -i "/\/mirror.archlinuxarm.org/ s/^# *//" "$INSTALLDIR/etc/pacman.d/mirrorlist" || _PSGI1ESTRING_ "sed -i _SEDUNCOM_ necessaryfunctions.bash ${0##*/}" # sed replace a character in a matched line in place
270 | }
271 | _ADDresolvconf_
272 | ALMLLOCN="$INSTALLDIR/etc/pacman.d/mirrorlist"
273 | cp "$ALMLLOCN" "$INSTALLDIR/var/backups/${INSTALLDIR##*/}/etc/mirrorlist.$SDATE.bkp" || _PSGI1ESTRING_ "cp _RUNFINISHSETUP_ necessaryfunctions.bash ${0##*/}"
274 | if [[ "$CPUABI" = "$CPUABIX86" ]]
275 | then
276 | AL32MRLT="https://git.archlinux32.org/packages/plain/core/pacman-mirrorlist/mirrorlist"
277 | printf "\\e[0m\\n%s\\n" "Updating ${ALMLLOCN##*/} from $AL32MRLT."
278 | curl --retry 4 "$AL32MRLT" -o "$ALMLLOCN" || curl --retry 4 "$AL32MRLT" -o "$ALMLLOCN"
279 | _DOMIRROR_
280 | elif [[ "$CPUABI" = "$CPUABIX8664" ]]
281 | then
282 | AL64MRLT="https://www.archlinux.org/mirrorlist/all/"
283 | printf "\\e[0m\\n%s\\n" "Updating ${ALMLLOCN##*/} from $AL64MRLT."
284 | curl -L --retry 4 "$AL64MRLT" -o "$ALMLLOCN"
285 | _DOMIRROR_
286 | fi
287 | printf "\\e[0m"
288 | if [[ "$FSTND" ]]
289 | then
290 | NMIR="$(awk -F'/' '{print $3}' <<< "$NLCMIRROR")"
291 | sed -i '/http\:\/\/mir/ s/^#*/# /' "$INSTALLDIR/etc/pacman.d/mirrorlist"
292 | # test if NMIR is in mirrorlist file
293 | if grep "$NMIR" "$INSTALLDIR/etc/pacman.d/mirrorlist"
294 | then
295 | printf "%s\\n" "Found server $NMIR in /etc/pacman.d/mirrorlist; Uncommenting $NMIR."
296 | sed -i "/$NMIR/ s/^# *//" "$INSTALLDIR/etc/pacman.d/mirrorlist" || _SEDUNCOM_ || _PSGI1ESTRING_ "sed -i _RUNFINISHSETUP_ necessaryfunctions.bash ${0##*/}"
297 | else
298 | printf "%s\\n" "Did not find server $NMIR in /etc/pacman.d/mirrorlist; Adding $NMIR to file /etc/pacman.d/mirrorlist."
299 | printf "%s\\n" "Server = $NLCMIRROR/\$arch/\$repo" >> "$INSTALLDIR/etc/pacman.d/mirrorlist"
300 | fi
301 | else
302 | if [[ -z "${DOMIRLCR:-}" ]]
303 | then
304 | DOMIRLCR=0
305 | if [[ -z "${USEREDIT:-}" ]] || [[ "$USEREDIT" = "" ]]
306 | then
307 | _EDITORS_
308 | else
309 | if [[ ! "$(sed 1q "$INSTALLDIR"/etc/pacman.d/mirrorlist)" = "# # # # # # # # # # # # # # # # # # # # # # # # # # #" ]]
310 | then
311 | _EDITFILES_
312 | fi
313 | fi
314 | "$USEREDIT" "$INSTALLDIR"/etc/pacman.d/mirrorlist
315 | fi
316 | fi
317 | "$INSTALLDIR"/root/bin/setupbin.bash || _PRINTPROOTERROR_
318 | }
319 |
320 | _TOUCHUPSYS_() {
321 | _ADDmotd_
322 | _PREPPACMANCONF_
323 | _SETLOCALE_
324 | _RUNFINISHSETUP_
325 | [ -f root/bin/"$BINFNSTP" ] && rm -f root/bin/"$BINFNSTP"
326 | [ -f root/bin/setupbin.bash ] && rm -f root/bin/setupbin.bash
327 | printf "\\n\\e[1;34m%s \\e[0m\\n\\n" "🕛 > 🕤 Arch Linux in Termux is installed and configured 📲 "
328 | printf "\\e]2;%s\\007" " 🕛 > 🕤 Arch Linux in Termux is installed and configured 📲"
329 | }
330 | # necessaryfunctions.bash FE
331 |
--------------------------------------------------------------------------------
/printoutstatements.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Copyright 2017-2022 by SDRausty. All rights reserved. 🌎 🌍 🌏 🌐 🗺
3 | ## Hosted sdrausty.github.io/TermuxArch courtesy https://pages.github.com
4 | ## https://sdrausty.github.io/TermuxArch/README has info about this project.
5 | ## https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help.
6 | ## printout statement subroutines for 'setupTermuxArch'
7 | ################################################################################
8 | FLHDR0[0]="#!/usr/bin/env bash"
9 | FLHDR0[1]="# Copyright 2017-2022 by SDRausty. All rights reserved, see LICENSE 🌎 🌍 🌏"
10 | FLHDR0[2]="# Hosting sdrausty.github.io/TermuxArch courtesy https://pages.github.com."
11 | FLHDR0[3]="# https://sdrausty.github.io/TermuxArch/README has info about this project."
12 | FLHDR0[4]="# https://sdrausty.github.io/TermuxArch/CONTRIBUTORS Thank you for your help."
13 | FLHDR1[0]="##############################################################################"
14 | FLHDR1[1]=""
15 | FLHDR1[2]="set -Eeuo pipefail"
16 | FLHDR1[3]="shopt -s extglob nullglob globstar"
17 | FLHDR1[4]="unset LD_PRELOAD"
18 | FLHDR1[5]="VERSIONID=2.0.548"
19 | FLHDR1[6]="SRPTNM=\"\${0##*/}\""
20 | FLHDRP[0]="## BEGIN #####################################################################"
21 | FLHDRP[1]=""
22 | TRPERROR[0]="_TRPERR_() { # run on script error"
23 | TRPERROR[1]=" local RV=\"\$?\""
24 | TRPERROR[2]=" printf \"\\\\e[?25h\\\\n\\\\e[1;48;5;138m %s\\\\e[0m\\\\n\\\\n\" \"TermuxArch \${SRPTNM^^} NOTICE: Generated script signal \${RV:-UNKNOWN} near or at line number \${1:-UNKNOWN} by '\${2:-UNKNOWNCOMMAND}'!\""
25 | TRPERROR[3]=" exit \"\$RV\""
26 | TRPERROR[4]="}"
27 | TRPERROR[5]=""
28 | TRPEXIT[0]="_TRPET_() { # run on exit"
29 | TRPEXIT[1]=" local RV=\"\$?\""
30 | TRPEXIT[2]=" printf \"\""
31 | TRPEXIT[3]=" if [[ \"\$RV\" = 0 ]]"
32 | TRPEXIT[4]=" then"
33 | TRPEXIT[5]=" printf \"\\\\e[0;32mTermuxArch command \\\\e[1;32m'%s'\\\\e[0;32m version %s\\\\e[1;34m: \\\\e[1;32mDONE 🏁\\\\e[0m\\\\n\" \"\$STRNRG\" \"\$VERSIONID\""
34 | TRPEXIT[6]=" printf \"\\\\e]2;%s\007\" \"\$STRNRG: DONE 🏁 \""
35 | TRPEXIT[7]=" else"
36 | TRPEXIT[8]=" printf \"\\\\e[0;32mTermuxArch command \\\\e[1;32m'%s'\\\\e[0;32m version %s\\\\e[0m [Exit Signal %s]\\\\e[1;34m: \\\\e[1;32mDONE 🏁\\\\e[0m\\\\n\" \"\$STRNRG\" \"\$VERSIONID\" \"\$RV\""
37 | TRPEXIT[9]=" printf \"\033]2;%s\007\" \"\$STRNRG [Exit Signal \$RV]: DONE 🏁 \""
38 | TRPEXIT[10]=" fi"
39 | TRPEXIT[11]=" printf \"\\e[?25h\\e[0m\""
40 | TRPEXIT[12]=" set +Eeuo pipefail"
41 | TRPEXIT[13]=" exit"
42 | TRPEXIT[14]="}"
43 | TRPEXIT[15]=""
44 | TRPSIGNAL[0]="_TRPSIG_() { # run on signal"
45 | TRPSIGNAL[1]=" local RV=\"\$?\""
46 | TRPSIGNAL[2]=" printf \"\\\\e[?25h\\\\e[1;7;38;5;0mTermuxArch \${SRPTNM^^} NOTICE: Signal %s received!\\\\e[0m\\\\n\" \"\$?\""
47 | TRPSIGNAL[3]=" exit \"\$RV\""
48 | TRPSIGNAL[4]="}"
49 | TRPQUIT[0]="_TRPQ_() { # run on quit"
50 | TRPQUIT[1]=" local RV=\"\$?\""
51 | TRPQUIT[2]=" printf \"\\\\e[?25h\\\\e[1;7;38;5;0mTermuxArch \${SRPTNM^^} NOTICE: Quit signal %s received!\\\\e[0m\\\\n\" \"\$?\""
52 | TRPQUIT[3]=" exit \"\$RV\""
53 | TRPQUIT[4]="}"
54 | TRAPS[0]="trap '_TRPERR_ \$LINENO \$BASH_COMMAND \$?' ERR"
55 | TRAPS[1]="trap _TRPET_ EXIT"
56 | TRAPS[2]="trap _TRPSIG_ HUP INT TERM"
57 | TRAPS[3]="trap _TRPQ_ QUIT"
58 | TRAPS[4]="ARGS=\"\${@%/}\""
59 | TRAPS[5]="{ [ -z \"\${ARGS:-}\" ] && STRNRG=\"\${0##*/}\" ; } || STRNRG=\"\${0##*/} \${ARGS:-}\""
60 | # TRAPS[6]="printf \"\\\\e[1;32m==> \\\\e[0mRunning TermuxArch command \\\\e[1;32m%s\\\\e[0;32m %s\\\\e[1;37m...\\\\n\" \"\$STRNRG\" \"version \$VERSIONID\""
61 |
62 | _CFLHD_() { # creates file header and inserts comments
63 | if [[ -z "${2:-}" ]]
64 | then
65 | printf "%s\\n" "${FLHDR0[1]}" > "$1"
66 | printf "%s\\n" "${FLHDR0[2]}" >> "$1"
67 | printf "%s\\n" "${FLHDR0[3]}" >> "$1"
68 | printf "%s\\n" "${FLHDR0[4]}" >> "$1"
69 | printf "%s\\n" "${FLHDR1[0]}" >> "$1"
70 | else
71 | printf "%s\\n" "${FLHDR0[1]}" > "$1"
72 | printf "%s\\n" "${FLHDR0[2]}" >> "$1"
73 | printf "%s\\n" "${FLHDR0[3]}" >> "$1"
74 | printf "%s\\n" "${FLHDR0[4]}" >> "$1"
75 | printf "%s\\n" "${@:2}" >> "$1"
76 | printf "%s\\n" "${FLHDR1[0]}" >> "$1"
77 | fi
78 | }
79 |
80 | _CFLHDR_() { # creates BASH script boilerplate, file header and inserts comments
81 | if [[ -z "${2:-}" ]]
82 | then
83 | printf "%s\\n" "${FLHDR0[@]}" > "$1"
84 | printf "%s\\n" "${FLHDR1[@]}" >> "$1"
85 | else
86 | printf "%s\\n" "${FLHDR0[@]}" > "$1"
87 | for LINENUMR in ${#@}
88 | do
89 | printf "%s\\n" "${@:LINENUMR}" >> "$1"
90 | done
91 | printf "%s\\n" "${FLHDR1[@]}" >> "$1"
92 | fi
93 | printf "%s\\n" "${TRPERROR[@]}" >> "$1"
94 | printf "%s\\n" "${TRPEXIT[@]}" >> "$1"
95 | printf "%s\\n" "${TRPSIGNAL[@]}" >> "$1"
96 | printf "%s\\n" "${TRPQUIT[@]}" >> "$1"
97 | printf "%s\\n" "${TRAPS[@]}" >> "$1"
98 | }
99 |
100 | _CFLHDRS_() { # creates file header and inserts comments
101 | if [[ -z "${2:-}" ]]
102 | then
103 | printf "%s\\n" "${FLHDR0[1]}" > "$1"
104 | printf "%s\\n" "${FLHDR0[2]}" >> "$1"
105 | printf "%s\\n" "${FLHDR0[3]}" >> "$1"
106 | printf "%s\\n" "${FLHDR0[4]}" >> "$1"
107 | printf "%s\\n" "${FLHDR1[0]}" >> "$1"
108 | else
109 | printf "%s\\n" "${FLHDR0[1]}" > "$1"
110 | printf "%s\\n" "${FLHDR0[2]}" >> "$1"
111 | printf "%s\\n" "${FLHDR0[3]}" >> "$1"
112 | printf "%s\\n" "${FLHDR0[4]}" >> "$1"
113 | printf "%s\\n" "${@:2}" >> "$1"
114 | printf "%s\\n" "${FLHDR1[0]}" >> "$1"
115 | fi
116 | }
117 |
118 | _PRINTCONTACTING_() {
119 | printf "\033]2; 🕛 > 🕞 Contacting https://%s...\007" "$CMIRROR"
120 | printf "\\e[0;34m 🕛 > 🕞 \\e[1;34mContacting worldwide mirror \\e[0;32m%s\\e[1;34m: " "http://$CMIRROR"
121 | }
122 |
123 | _PRINTCU_() {
124 | printf '\033]2; 🕛 > 🕙 Cleaning up installation files: \007'
125 | printf "\\n\\e[0;34m 🕛 > 🕙 \\e[1;34mCleaning up installation files: "
126 | }
127 |
128 | _PRINTDETECTEDSYSTEM_() {
129 | if [[ "$(getprop ro.product.device)" == *_cheets ]]
130 | then
131 | printf "\\e[1;34m%s\\n\\n\\e[0m" " 🕛 > 🕝 Detected $NASVER Chromebook operating system; Install architecture is set to $CPUABI."
132 | else
133 | printf "\\e[1;34m%s\\n\\n\\e[0m" " 🕛 > 🕝 Detected $NASVER operating system; Install architecture is set to $CPUABI."
134 | fi
135 | }
136 |
137 | _PRINTDONE_() {
138 | printf "\\e[1;32mDONE \\e[0m\\n\\n"
139 | }
140 |
141 | _PRINTWLA_() {
142 | printf '\033]2; 🕛 > 🕒 Activating termux-wake-lock: OK\007'
143 | printf "\\n\\e[0;34m 🕛 > 🕒 \\e[1;34mActivating termux-wake-lock: "
144 | }
145 |
146 | _PRINTWLD_() {
147 | printf '\033]2; 🕛 > 🕙 Releasing termux-wake-lock: OK\007'
148 | printf "\\e[0;34m 🕛 > 🕙 \\e[1;34mReleasing termux-wake-lock: "
149 | }
150 |
151 | _PRINTDOWNLOADINGX86_() {
152 | printf '\033]2; 🕛 > 🕞 Downloading the Arch Linux system image checksum... \007'
153 | printf "\\n\\e[0;34m 🕛 > 🕞 \\e[0;34mDownloading checksum from \\e[0;32mhttp://%s\\e[0;34m...\\n\\n\\e[0;32m" "$CMIRROR"
154 | }
155 |
156 | _PRINTDOWNLOADINGX86TWO_() {
157 | printf '\033]2; 🕛 > 🕓 Downloading the Arch Linux system image file... \007'
158 | printf "\\n\\e[0;34m 🕛 > 🕓 \\e[0;34mDownloading \\e[0;32m%s \\e[0;34mfrom \\e[0;32mhttp://%s\\e[0;34m... \\e[1;37mThis may take a long time pending connection.\\n\\n\\e[0;32m" "$IFILE" "$CMIRROR"
159 | }
160 |
161 | _PRINTDOWNLOADINGFTCH_() {
162 | printf "\033]2;%s\007" " 🕛 > 🕓 Downloading the checksum and Arch Linux system image files... "
163 | printf "\\e[0;34m 🕛 > 🕓 \\e[1;34mDownloading the checksum file and \\e[1;34m%s \\e[1;34mfrom the geographically local mirror \\e[1;32m%s\\e[1;34m. If contact with the local mirror is not successful, run \\e[1;32mbash \\e[0;32m%s\\e[1;34m again. Should the worldwide mirror not provide another geographically nearby server after a couple of attempts, use \\e[1;32mbash \\e[0;32m%s manual \\e[1;34mafter locating a local mirror from the Internet; The command \\e[1;32mbash \\e[0;32m%s help \\e[1;34mhas information about additional options. \\e[1;37mDownload of %s pending Internet connection...\\n\\n\\e[0;32m" "$IFILE" "${NLCMIRROR:-MIRROR NOT FOUND}" "${0##*/}" "${0##*/}" "${0##*/}" "$IFILE"
164 | }
165 |
166 | _PRINT_DOWNLOADING_FTCHIT_() {
167 | printf "\033]2;%s\007" " 🕛 > 🕓 Downloading the checksum and $IFILE files... "
168 | printf "\\e[0;34m 🕛 > 🕓 \\e[0;34mDownloading the checksum file and \\e[0;32m%s \\e[0;34m from \\e[0;32mhttp://%s\\e[0;34m... \\e[1;37mThis may take a long time pending connection.\\n\\n\\e[0;32m" "$IFILE" "$CMIRROR"
169 | }
170 |
171 | _PRINTCONFIGUP_() {
172 | printf "\033]2;%s\007" " 🕛 > 🕤 Arch Linux is installed! Configuring and updating Arch Linux 📲"
173 | printf "\\n\\e[0;34m 🕛 > 🕤 \\e[1;34mArch Linux in Termux PRoot QEMU is installed. Configuring and updating Arch Linux 📲 "
174 | }
175 |
176 | _PRINTMAX_() {
177 | printf "\033]2;%s\007" "Please run 'bash ${0##*/}' again."
178 | printf "\\n\\e[07;1m\\e[31;1m 🔆 TermuxArch NOTICE: Maximum amount of attempts exceeded.\\e[34;1m\\e[30;1m\\n\\nPlease run 'bash %s' again. See 'bash %s help' to resolve download errors. If this keeps repeating, copy 'knownconfigurations.bash' to 'setupTermuxArchConfigs.bash' with preferred mirror. After editing 'setupTermuxArchConfigs.bash', run 'bash %s' and 'setupTermuxArchConfigs.bash' loads automaticaly from the same directory. Change mirror to desired geographic location to resolve md5sum errors.\\n\\nUser configurable variables are in 'setupTermuxArchConfigs.bash'. To create this file from 'knownconfigurations.bash' in the working directory the command 'bash %s manual' can be used to create and edit 'setupTermuxArchConfigs.bash'.\\n\\nPlease run 'bash %s' again.\\n\\e[0;0m\\n" "${0##*/}" "${0##*/}" "${0##*/}" "${0##*/}" "${0##*/}"
179 | }
180 |
181 | _PRINTKEEPEXIT_() {
182 | printf "\\n\\e[0;34m 🕛 > 🕕 \\e[1;34mNot removing files after FAILED check of download integrity files with md5sum. \\e[37;1m%s \\e[1;33m" "Please run '${0##*/}' again to continue a partial download. Otherwise remove '$INSTALLDIR' and restart the installation from scratch if the download is complete and FAILED checking download integrity checksum error continues. You can set KEEP=1 in file 'setupTermuxArchConfigs.bash' by running '${0##*/} manual' to disable the keep download image file feature that is disabled by default as after downloading the root image file as it might no longer be needed by the end user execept for reinstalling the Arch Linux system and similar. The command 'bash ${0##*/} help' and the source code for TermuxArch have more information."
183 | }
184 |
185 | _PRINTKEEP_() {
186 | printf "\\n\\e[0;34m 🕛 > 🕗 \\e[1;34mNot removing files after checking download integrity with md5sum. \\n"
187 | }
188 |
189 | _PRINTMD5CHECK_() {
190 | printf "\\n\\e[0;34m 🕛 > 🕠 \\e[1;34mChecking download integrity with md5sum. \\e[37;1mThis may take a little while \\e[1;33m"
191 | }
192 |
193 | _PRINTMD5ERROR_() {
194 | printf "\033]2;%s\007" "Run 'bash ${0##*/}' again..."
195 | printf "\\n\\e[07;1m\\e[31;1m 🔆 TermuxArch SIGNAL md5sum mismatch! The download failed and was removed!\\e[30;1m Run 'bash %s' again. The command 'bash %s help' has more information. This kind of error can go away, just like magic. Waiting before executing %s again is recommended. There are numerous reasons for checksum errors. Proxies are one explaination. Mirroring and mirrors are another explaination for md5sum errors. An interrupted download is one more reason for an md5sum mismatch error.\\n If this keeps repeating, file 'knownconfigurations.bash' can be copied to file 'setupTermuxArchConfigs.bash' with command 'bash %s manual' in order to choose a preferred mirror. After editing 'setupTermuxArchConfigs.bash', command 'bash %s' loads file 'setupTermuxArchConfigs.bash' automaticaly from the same directory. Change mirror to desired geographic location to resolve md5sum errors.\\n User configurable variables are in 'setupTermuxArchConfigs.bash'. In order to create this file from 'knownconfigurations.bash' in the working directory, the command 'bash %s manual' can be used to create and edit 'setupTermuxArchConfigs.bash'.\\n\\n Please run command 'bash %s' again, or command 'bash %s manual' can be run which creates file '%sConfigs.bash' for editing.\\n\\e[0;0m\n" "${0##*/}" "${0##*/}" "${0##*/}" "${0##*/}" "${0##*/}" "${0##*/}" "${0##*/}" "${0##*/}" "${0##*/}"
196 | }
197 |
198 | _PRINTMD5SUCCESS_() {
199 | printf "\\e]2;%s\\007" " 🕛 > 🕡 Unpacking $IFILE..."
200 | printf "\\n\\n\\e[0;34m 🕛 > 🕔 \\e[1;34mSystem image file download integrity check: \\e[1;32mDONE\\n\\n\\e[0;34m 🕛 > 🕡 \\e[1;34mUnpacking %s into %s. The option to create Arch Linux system users is available through \\e[1;32maddauser\\e[1;34m. Arch Linux user login from Termux with \\e[1;32m%s \\e[1;34mis now implemented. Please see \\e[0;36mAbility for Scripts to Launch Commands for Arch Linux in Termux PRoot on Device\\e[1;34m https://github.com/sdrausty/TermuxArch/issues/54 for information how to use this option. \\n\\nWhile waiting, any of these commands can be used \\e[0;36mdf\\e[1;34m, \\e[0;36mdu -hs\\e[1;34m, \\e[0;36mps\\e[1;34m, \\e[0;36mtop\\e[1;34m and \\e[0;36mwatch\\e[1;34m in a new Termux session to watch the unpacking while this session completes. Use \\e[0;36mhelp man \\e[1;34mand \\e[0;36minfo man \\e[1;34mto learn more about your Linux system in the palm of your hand. See The Linux Documentation Project http://tldp.org to learn more about Linux and CLI (command line interface) commands.\\n\\nIf simply scrolling the screen up by scrolling up does produce the desired effect, this method can be employed. Long tap until the popup menu shows. Then scroll up without loosing touch with the screen and without touching the popup menu. \\e[1;37mUnpacking \\e[1;32m%s\\e[1;37m will take a long time; Please be patient \\e[0m" "$IFILE" "$INSTALLDIR" "$STARTBIN" "$IFILE"
201 | }
202 |
203 | _PRINTMISMATCH_() {
204 | printf "\033]2;%s\007" "Run 'bash ${0##*/}' again..."
205 | printf "\\n\\e[07;1m\\e[31;1m 🔆 TermuxArch NOTICE: Unknown configuration! Did not find an architecture and operating system match in 'knownconfigurations.bash'! \\e[36;1m\\nDetected %s architecture. There still is hope. Other images may be available at http://mirror.archlinuxarm.org/os/ and https://www.archlinux.org/mirrors/ to see if any match might the device. If there is a match found, then please \\e[37;1msubmit a pull request\\e[36;1m at https://github.com/TermuxArch/TermuxArch/pulls with script modifications. Alternatively, \\e[37;1ma modification can be submitted\\e[36;1m at https://github.com/TermuxArch/TermuxArch/issues if a new configuration match is found. Please include output from \\e[37;1m'uname -mo'\\e[36;1m on the device in order to expand autodetection for \\e[37;1m'%s'\\e[36;1m. The webpage at https://termuxarch.github.io/docsTermuxArch/Known_Configurations has more information.\\n\\n \\e[36;1mRun '%s purge' to remove the installation; Then please try '%s' again with new options...\\e[0m\\n" "$NASVER $CPUABI" "${0##*/}" "${0##*/}" "${0##*/}"
206 | exit
207 | }
208 |
209 | _PRINTFOOTER_() {
210 | printf "\033]2;%s\007" "Thank you for using '${0##*/}' to install Arch Linux in Termux PRoot QEMU 📲 "
211 | printf "\\e[0;34m 🕛 > 🕚 \\e[1;34mYou can use \\e[1;32m%s \\e[1;34mto launch Arch Linux in Termux PRoot QEMU. Alternatively, command \\e[1;32m~%s \\e[1;34mcan be run in a BASH shell to start Arch Linux in Termux PRoot QEMU in future sessions. See \\e[1;32m%s help \\e[1;34mfor usage information.\\e[0m\\n\\n" "$STARTBIN" "$PRINTROOTDIR/$STARTBIN" "$STARTBIN"
212 | printf "\\e[0;32m 🕛 = 🕛 \\e[1;34mThe command \\e[1;32mtour \\e[1;34mcan be used to run a very short tour in order to get to know the new Arch Linux in Termux PRoot QEMU environment a little bit better. If there was more than one error during the update procedure and you would like to refresh the installation, use \\e[1;32m%s refresh\\e[1;34m. This will update and recreate the configuration provided. The TermuxArch command \\e[1;32mkeys \\e[1;34mhelps install and generate Arch Linux keyring keys.\\n\\n" "${0##*/}"
213 | _PRINTFOOTER2_
214 | }
215 |
216 | _PRINTFOOTER2_() {
217 | _PRTARM_() {
218 | printf "\\e[1;34m%s\\e[0;32m%s\\e[1;34m%s\\e[0m\\n\\n" "The webpage " "https://archlinuxarm.org/forum" " has discussion forums available for the Arch Linux arm project regarding the Arch Linux $CPUABI computer architecture."
219 | }
220 | _PRTX86_() {
221 | printf "\\e[1;34m%s\\e[0;32m%s\\e[1;34m%s\\e[0;32m%s\\e[1;34m%s\\e[0m\\n\\n" "The website " "https://bbs.archlinux32.org/" " has Arch Linux 32 discussion forums. The website " "https://wiki.archlinux32.org/" " has information about the Arch Linux 32 project regarding the Arch Linux $CPUABI computer architecture."
222 | }
223 | _PRTX8664_() {
224 | printf "\\e[1;34m%s\\e[0;32m%s\\e[1;34m%s\\e[0;32m%s\\e[1;34m%s\\e[0m\\n\\n" "The website " "https://bbs.archlinux.org/" " has Arch Linux discussion forums for the Arch Linux project. The webpage " "https://wiki.archlinux.org/index.php/IRC_channel" " lists available Arch Linux IRC channels regarding the Arch Linux $CPUABI computer architecture."
225 | }
226 | printf "\\e[1;34m%s\\n\\n%s\\e[1;32m%s\\e[1;34m%s\\e[1;32m%s\\e[1;34m%s" "Arch Linux in Termux PRoot QEMU is installed in $INSTALLDIR. This project is in active development. Contributions to this project are welcome; See https://sdrausty.github.io/TermuxArch/CONTRIBUTORS for information. The documentation repository for TermuxArch https://sdrausty.github.io/TermuxArch/docs is a TermuxArch module that is located at https://github.com/sdrausty/docsTermuxArch. Pull requests and contributions through the issues pages are open to improve the ux (user experience) and this Termux PRoot QEMU installation script. " "The commands " "~$PRINTROOTDIR/$STARTBIN " "and " "$STARTBIN " "can be used in a BASH shell to launch Arch Linux in Termux PRoot QEMU for future sessions. For those new to *nix, http://tldp.org has *nix documentation. "
227 | if [[ "$CPUABI" = "$CPUABIX86" ]]
228 | then
229 | _PRTX86_
230 | elif [[ "$CPUABI" = "$CPUABIX8664" ]]
231 | then
232 | _PRTX8664_
233 | else
234 | _PRTARM_
235 | fi
236 | }
237 |
238 | _PRINTPROOTERROR_() {
239 | printf "\\e[0;34m%s\\n\\n" "1) IF ERROR 'env ... not found' IS FOUND, ensure that all the software is up to date. After updating, please reference these weblinks in order to find a resolution if updating Termux app and Termux packages and device software was unsuccessful:
240 | i) https://github.com/termux/proot/issues?q=\"env\"+\"not+found\"
241 | ii) https://github.com/termux/termux-packages/issues?q=\"not+found\"+\"proot\""
242 | printf "%s\\n\\n" "2) IF ERROR 'proot info: vpid 1: terminated with signal 4' IS FOUND, please create a 'qbind.prs' file by using 'bindexample.prs' as an example file located in directory '$INSTALLDIR/var/binds/'. In order to complete this PRoot QEMU configuration add a QEMU bind statement to variable PROOTSTMNT. Then run the '$STRNRG' command again after creating and editing the 'qbind.prs' file; i.e:
243 | \`\`\`
244 | cd $INSTALLDIR/var/binds/
245 | cp bindexample.prs bindq.prs
246 | \`\`\`
247 | Edit file bindq.prs and run command '$STRNRG' again."
248 | printf "%s\\n\\n\\e[0m" "3) IF ERROR 'proot info: vpid 1: terminated with signal 11' IS FOUND, please ensure that all software is up to date. After updating all the software, including device software was unsuccessful in resolving this signal, then please reference these weblinks in order to find a resolution if updating Termux app and Termux packages and device software was unsuccessful in resolving this signal:
249 | i) https://github.com/termux/proot/issues?q=\"proot info: vpid 1: terminated with signal 11\"
250 | ii) https://github.com/termux/termux-packages/issues?q=\"proot info: vpid 1: terminated with signal 11\""
251 | }
252 |
253 | _PRINTROOTDIRFUNCTION_() {
254 | declare -g PRINTROOTDIR
255 | PRINTROOTDIR="$(printf "%s" "${ROOTDIR%/}"|sed 's#//*#/#g')"
256 | }
257 | _PRINTROOTDIRFUNCTION_
258 | # printoutstatements.bash FE
259 |
--------------------------------------------------------------------------------
/pullTermuxArchMods.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## Copyright 2017-2022 (c) by TermuxArch, all rights reserved, see LICENSE 🌎 🌍 🌏 🌐 🗺
3 | ## https://termuxarch.github.io/TermuxArch courtesy host https://pages.github.com
4 | ## update git repository, then update modules
5 | ################################################################################
6 | set -Eeuo pipefail
7 |
8 | _SGSATRPERROR_() { # run on script error signal
9 | local RV="$?"
10 | printf "\\n%s\\n" "$RV"
11 | printf "\\e[?25h\\n\\e[1;48;5;138mBuildAPKs %s TermuxArch SIGNAL: Generated script error %s near or at line number %s by \`%s\`!\\e[0m\\n" "updateTermuxArch.bash" "${3:-VALUE}" "${1:-LINENO}" "${2:-BASH_COMMAND}"
12 | exit 179
13 | }
14 |
15 | _SGSATRPEXIT_() { # run on exit signal
16 | printf "\\e[?25h\\e[0m"
17 | set +Eeuo pipefail
18 | exit
19 | }
20 |
21 | _SGSATRPSIGNAL_() { # run on signal
22 | local RV="$?"
23 | printf "\\e[?25h\\e[1;7;38;5;0mTermuxArch %s NOTICE: Signal %s received!\\e[0m\\n" "${0##*/}" "$RV"
24 | exit 178
25 | }
26 |
27 | _SGSATRPQUIT_() { # run on quit signal
28 | local RV="$?"
29 | printf "\\e[?25h\\e[1;7;38;5;0mTermuxArch %s NOTICE: Quit signal %s received!\\e[0m\\n" "${0##*/}" "$RV"
30 | exit 177
31 | }
32 |
33 | trap '_SGSATRPERROR_ $LINENO $BASH_COMMAND $?' ERR
34 | trap _SGSATRPEXIT_ EXIT
35 | trap _SGSATRPSIGNAL_ HUP INT TERM
36 | trap _SGSATRPQUIT_ QUIT
37 |
38 | RDR="$PWD"
39 | _GSA_() { # git repository update modules
40 | WRDR="$1"
41 | { git submodule update --depth 1 --init --recursive --remote "$1" && _PRCS_ ; } || { git submodule add --depth 1 https://github.com/"$3"/"$2" "$1" && _PRCS_ ; } || _PESTRG_ "$1" update # the command ` git submodule help ` and the book https://git-scm.com/book/en/v2/Git-Tools-Submodules have more information about git submodules
42 | }
43 |
44 | _PESTRG_() {
45 | printf "\\n\\n%s\\n" "Cannot $2 module $1; Continuing..."
46 | }
47 |
48 | _PRCS_ () { # print checksums message and run sha512sum
49 | cd "$WRDR"
50 | if [[ -f sha512.sum ]]
51 | then
52 | _PRT_ "Checking checksums in directory $PWD with sha512sum: "
53 | sha512sum -c --quiet sha512.sum || printf "%s\\n" "sha512sum -c sha512.sum FAILED!"
54 | _PRNT_ "DONE"
55 | else
56 | printf "%s\\n" "No 'sha512.sum' file found in directory $PWD."
57 | fi
58 | cd "$RDR"
59 | sleep 0."$(shuf -i 24-72 -n 1)" # latency support
60 | }
61 |
62 | _PRT_ () { # print message with no trialing newline
63 | printf "%s" "$1"
64 | }
65 |
66 | _PRNT_ () { # print message with one trialing newline
67 | printf "%s\\n" "$1"
68 | }
69 |
70 | git pull || printf "\\n\\n%s\\n" "Cannot git pull; Continuing..."
71 | if grep '\.\/\.git\/' sha512.sum 1>/dev/null || grep '\.\/\.scripts\/maintenance\/' sha512.sum 1>/dev/null || grep '\.\/docs\/' sha512.sum 1>/dev/null || grep '\.\/gen\/' sha512.sum 1>/dev/null
72 | then
73 | sed -i '/\.\/\.git\//d' sha512.sum
74 | sed -i '/\.\/\.scripts\/maintenance\//d' sha512.sum
75 | sed -i '/\.\/docs\//d' sha512.sum
76 | sed -i '/\.\/gen\//d' sha512.sum
77 | fi
78 | sha512sum -c --quiet sha512.sum || _PRNT_ "TermuxArch NOTICE: Checking checksums in directory $PWD with sha512sum FAILED! "
79 | _GSA_ ".scripts/maintenance" maintenance shlibs || printf "\\n\\n%s\\n" "Cannot add or update module .scripts/maintenance; Continuing..."
80 | _GSA_ docs docsTermuxArch TermuxArch || printf "\\n\\n%s\\n" "Cannot add or update module docs; Continuing..."
81 | _GSA_ gen genTermuxArch TermuxArch || printf "\\n\\n%s\\n" "Cannot add or update module gen; Continuing..."
82 | _GSA_ scripts "scripts.TermuxArch" TermuxArch || printf "\\n\\n%s\\n" "Cannot add or update module scripts; Continuing..."
83 | # pullTermuxArchSubmodules.bash FE
84 |
--------------------------------------------------------------------------------
/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Allow: /
3 | Allow: /sitemap.txt
4 | Sitemap: https://TermuxArch.github.io/TermuxArch/sitemap.txt
5 |
6 |
--------------------------------------------------------------------------------
/setupTermuxArch.sha512:
--------------------------------------------------------------------------------
1 | 033731f69dea719816bbf73088a5615f4cbc8c26b011ac10a6d0abc03726014c7ab19fdf28f6706bfeb54f95847638388ef0a487cb2809477dc30da90f1e40a2 setupTermuxArch.tar.gz
2 |
--------------------------------------------------------------------------------
/setupTermuxArch.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SDRausty/TermuxArch/b5e460be3955cb5fc0272b194ea690c528ab14ce/setupTermuxArch.tar.gz
--------------------------------------------------------------------------------
/sha512.sum:
--------------------------------------------------------------------------------
1 | e67be29efdd034781f6ef5bc4114f56023ea7c927b94a22fa99595319c172268bdc545f7c2646e7d71c66b6736b90b244732f4f494c83fbacdf0f42a034569e4 ./.conf/VERSIONID
2 | 05a502a845e35bc0495a3a3006ae914785c48679dddd362bd98bd33c306ed2aa8fac57344b1b65955d41755c3967f3e991770764f6c2f14c6a52f3e52e00ef1c ./.github/FUNDING.yml
3 | c5b8dd6c602b3acea11ff4b6bd541cc77ebd44fa359ffd40f78785a16949a3a0f435c763c2dbc05327c071326e19c9951940e85ebd832ec1fad4feeb9dc97dac ./.github/workflows/greetings.yml
4 | cd90fd3ba3554fbae5c5cbe38142191c74a76a039288d37c10a6f247bdac47e84dfeb7f17055a9bf27cb19dd0d859cd5989307c037ab3847a98c916b4e811ef9 ./.github/workflows/label.yml
5 | 4d98975d2749318d41060484f8c60a4f4e47f5a1c136bfe90d5d23e604613d83f7e0c90e2c1a7eb6828f50c911e85100f62ea413f3e42fe7fd1216b5a8b0b568 ./.github/workflows/stale.yml
6 | cdc820ca2ff7cde63d4455320d34984cf370c60d3b230b4d7bdcbaf8dd5c913a060f02655b1628355ae4d6307a5fce2573573bbf48d60c9dabbb77f709c4fefd ./.gitmodules
7 | b9303b1c4ccd5cb151e65c243005e9bcf59182b02fb413d47a255672a85dc08adf323e754d1615f9ce5962e97b7824d2a78047cd56972c9109f3e7e5d1ab7a17 ./.gitpod.Dockerfile
8 | be4cf1b862e9843e359c08d8fbe90eff27e193a4f864b1937b3cad1fffecdf2374541eb21359fbe6b346e4bd1db4e223861878389f8e887f78ba06f53feb8eb7 ./.gitpod.yml
9 | 98943e78485ed91b32dcd723520fcda14d829f82c882697979e8366121a449467aae0cbd6171cd00b19f818bec26d1f6525161b9836080db80801dbcf4c337d2 ./404.md
10 | 8fa003af5524d81bfcd74663833f64bc00791a1ca7894f74bfaba8012736ed60beaf89ca932fd69a0fa3104e9a48944bc1a0b14634a41848688af6d409859024 ./CHANGE.log
11 | f2d9bb93b52e89f1dc7051f1cef5a640b3d115ffdc20a91dca0827ac9089f8ad6ec9f5484f27cba2137cd709b176e3b0d8d593fc20d09676beaf8c10e2f21604 ./CONTRIBUTORS.md
12 | 1fbd5bbe1d7a8fad9bcbfe3410fab3ebbd1e79bc728b301eeb78b956357d3d0cd5829e500879e5621eb531147f2c2fc0e4f76f313dd515892bec6010bd3a2a00 ./LICENSE
13 | f926dc402b414c955b3ae593d3b0a9dc4a20657a8075749c3774d2cf7b30d60da3ff7ba0e06bde4ab75f72b4fc8840aa2357d6383d00cb31d636f3589fb49012 ./NOTICE.md
14 | e21012fb1f59efa4b3e6e8d3a953a5304e5b8eac0deb3631b068b463d8bee1d616bf9f2c706b2b78444e2bfdf6ee24b7dea8f890be36a216df20f95f2bada174 ./README.md
15 | b6f3bc5d831d7de898d665ab0c3c97ae19cba1dad6276bbe6fccd8fa10fee1dba3d600e869b917bd29c6ecdb1cc72ca18421f0120254ca9d377a19f641f99928 ./archlinuxconfig.bash
16 | ca1b3f26dc0d74401c48c754cfcbf7f57cc79827d8e6f6c5fe585d6cd00ece8770672f85f60371526c3dcecade7d6f0bf4d4d9744f316603501479a200daafbe ./espritfunctions.bash
17 | 53ef82880f9e8e2ebb16ff2cfaf18dae7d4c866046979f41716de40c2c619529fb5f0d86364a7ab4ec0a6ab839446104d3ba0cbfc92c68ede87a09d456e7e386 ./getimagefunctions.bash
18 | b67fea23eb50e58f40e0e8183de2e1079ac98b1316478870b1cd6842fb80a758217e1bafbb1b5146af69795395078e07d3e79b0015fc24246be0d31700e3a396 ./knownconfigurations.bash
19 | b4447309fc2a1ac9b8aedab94ee2bb3dae8dda6dd9a8f9c6df5786d907040731fc152018b8a15a56df4a98a97a312db4dc72c48b862b0ef10654ddf09e470ccf ./maintenanceroutines.bash
20 | e262e693486af502d1cb81106ea745b9bc411f80b5726daaa0ae526f3e6e915f7f7780afbd45e3f769a174a3488e5acb5d4b1838a596b7f92ed1c84e5d4cdc5b ./necessaryfunctions.bash
21 | 5367a15b51fe4909ed5365c890f46992b9e42befc7f273ef47ff069cdc8e512f257fe61a200dd8e5ae7cfb3ccfb6bcbff3e092979c2272a60e5cd9730146a0be ./printoutstatements.bash
22 | 91f866372458ffb4399d0acbcdd8b24b161cd48d776020ea274b1ac6db46826519248d12574493a8b003af320df12d5c7baab331137d2e71d5deace6ca69146e ./pullTermuxArchMods.bash
23 | 6f8a50ec0f811b35515666ecf5131bc59391a32a4760dd9994c64b2209544532dac4160c61dc0a53622b6453d34e6061b810e7a64bdcc853cf795e10d21ba3b8 ./robots.txt
24 | efaab643329dc559d46a4f6b1f806e565871ee98a3a41e1a6371430ec1159b616a6586bcb7cab741269787a8cbf322b05a323f6dcd0c1af61b179091b0013cb6 ./setupTermuxArch
25 | efaab643329dc559d46a4f6b1f806e565871ee98a3a41e1a6371430ec1159b616a6586bcb7cab741269787a8cbf322b05a323f6dcd0c1af61b179091b0013cb6 ./setupTermuxArch.bash
26 | efaab643329dc559d46a4f6b1f806e565871ee98a3a41e1a6371430ec1159b616a6586bcb7cab741269787a8cbf322b05a323f6dcd0c1af61b179091b0013cb6 ./setupTermuxArch.sh
27 | 23bcbd684a6cde0ba85fb6e70bdf25401cb93463a37bb1f967b6912940c38287b57e254a728f9098b017e72ed5910468b5ee3558f3e7471ca7c6e0f102065b96 ./setupTermuxArch.sha512
28 | 033731f69dea719816bbf73088a5615f4cbc8c26b011ac10a6d0abc03726014c7ab19fdf28f6706bfeb54f95847638388ef0a487cb2809477dc30da90f1e40a2 ./setupTermuxArch.tar.gz
29 | 9ae12dac3a7ad11cc929036d608e0113595925c48f6f9bf65af299bf01e1b0dbf9eedaa118c53bf957ae909c52e322bf7431b95ca0cc8517924321c678346dcb ./sitemap.txt
30 | 48bf62b56bc0801ade1c8181f862461d5e86c3c91a1c44b12826ac919accf9f5375d61c5e04bf426f3911ea58fb1728227d541835df90ed7791ff45b204063ba ./taprootuserland.bash
31 | 48bf62b56bc0801ade1c8181f862461d5e86c3c91a1c44b12826ac919accf9f5375d61c5e04bf426f3911ea58fb1728227d541835df90ed7791ff45b204063ba ./taqemualpinex86.bash
32 | 1773309efeebea769538351fff26fc0be992317ec6e786974a508913133d7804b04c9cce580a3b5a9167b596bba12517e19b3973c2d698870c24e696623dcdf4 ./fbindsfunctions.bash
33 | 44e298a301832bcab98c4f8b2ab2f15881df951ce2e8a3bfb40628ec43c120d2e7655bc70cf4fb3b212102fa5ac67d3e4b2272e2f618dec620dc06bbd631c8ea ./initkeyfunctions.bash
34 | 315f14e2c62a56abf3b3d195a0f0f12c16fcfca61b6b8fcb887f925899df3435a31b412500dae8b9ebca1b437f4bfa9552383dd0f6bb2eaf3455fd61583a066d ./_config.yml
35 |
--------------------------------------------------------------------------------
/sitemap.txt:
--------------------------------------------------------------------------------
1 | https://TermuxArch.github.io/TermuxArch/CONTRIBUTORS.html
2 | https://TermuxArch.github.io/TermuxArch/docs/Architectures.html
3 | https://TermuxArch.github.io/TermuxArch/docs/blurb1.html
4 | https://TermuxArch.github.io/TermuxArch/docs/blurb2.html
5 | https://TermuxArch.github.io/TermuxArch/docs/blurb2s.html
6 | https://TermuxArch.github.io/TermuxArch/docs/blurb.html
7 | https://TermuxArch.github.io/TermuxArch/docs/Community.html
8 | https://TermuxArch.github.io/TermuxArch/docs/CONTRIBUTORS.html
9 | https://TermuxArch.github.io/TermuxArch/docs/FAQ.html
10 | https://TermuxArch.github.io/TermuxArch/docs/index.html
11 | https://TermuxArch.github.io/TermuxArch/docs/install.html
12 | https://TermuxArch.github.io/TermuxArch/docs/Known_Configurations.html
13 | https://TermuxArch.github.io/TermuxArch/docs/listofarchpackages.html
14 | https://TermuxArch.github.io/TermuxArch/docs/LICENSE
15 | https://TermuxArch.github.io/TermuxArch/docs/md5sums.html
16 | https://TermuxArch.github.io/TermuxArch/docs/mirrors.html
17 | https://TermuxArch.github.io/TermuxArch/docs/Notice-to-Contributors.html
18 | https://TermuxArch.github.io/TermuxArch/docs/PRoot.html
19 | https://TermuxArch.github.io/TermuxArch/docs/README.html
20 | https://TermuxArch.github.io/TermuxArch/docs/storage.html
21 | https://TermuxArch.github.io/TermuxArch/docs/Termux.html
22 | https://TermuxArch.github.io/TermuxArch/docs/wdih.html
23 | https://TermuxArch.github.io/TermuxArch/index.html
24 | https://TermuxArch.github.io/TermuxArch/LICENSE
25 | https://TermuxArch.github.io/TermuxArch/NOTICE.html
26 | https://TermuxArch.github.io/TermuxArch/README.html
27 | https://TermuxArch.github.io/TermuxArch/robots.txt
28 | https://TermuxArch.github.io/TermuxArch/scripts/debug/README.html
29 | https://TermuxArch.github.io/TermuxArch/scripts/frags/README.html
30 | https://TermuxArch.github.io/TermuxArch/sitemap.txt
31 |
--------------------------------------------------------------------------------
/taprootuserland.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## copyright 2020 (c) by SDRausty, all rights reserved, see LICENSE
3 | ## hosting termuxarch.github.io/TermuxArch courtesy pages.github.com
4 | ## contributors: github.com/WMCB-Tech github.com/JanuszChmiel thank you for helping
5 | ################################################################################
6 | set -eu
7 | _AU_() {
8 | if command -v au
9 | then
10 | au "$@"
11 | else
12 | printf "%s\\n" "Installing 'au'" && curl -OL "https://raw.githubusercontent.com/WAE/au/master/au" -o "$PREFIX/bin/au" && chmod 744 "$PREFIX/bin/au"
13 | au "$@"
14 | fi
15 | }
16 | _BKPPROOT_() {
17 | [ ! -d "$HOME/termux/proot/tmp" ] && mkdir -p "$HOME/termux/proot/tmp"
18 | if [ ! -f "$HOME/termux/proot/tmp/proot.bkp" ] && [ -f "$PREFIX/bin/proot" ]
19 | then
20 | cp "$PREFIX/bin/proot" "$HOME/termux/proot/tmp/proot.bkp" && printf "%s\\n" "Copied file '$PREFIX/bin/proot' to '$HOME/termux/proot/tmp/proot.bkp'."
21 | fi
22 | }
23 | _GITCLONETERMUXPROOT_ () {
24 | if [[ -z "${GITCLONETERMUXPROOTLCR:-}" ]]
25 | then
26 | printf "%s\\n" "Cloning 'https://github.com/termux/proot' with 'git --depth 1 --single-branch'."
27 | git clone --depth 1 "https://github.com/termux/proot" --single-branch
28 | else
29 | printf "%s\\n" "Cloning 'https://github.com/termux/proot' with 'git'."
30 | git clone "https://github.com/termux/proot"
31 | cd proot
32 | git reset --hard "$GITCLONETERMUXPROOTLCR"
33 | fi
34 | }
35 | _MAKEV1_() {
36 | if [ -f "$HOME/termux/proot/src/builttaprootuserland.lock" ]
37 | then
38 | printf "%s\\n" "Found file '$HOME/termux/proot/src/builttaprootuserland.lock' in directory '$HOME/termux/proot/src'; Please remove file '$HOME/termux/proot/src/builttaprootuserland.lock' to attempt to rebuild Termux PRoot with USERLAND support: Continuing..."
39 | else
40 | if ! grep DUSERLAND GNUmakefile
41 | then
42 | sed -ir 's/^CPPFLAGS.*/CPPFLAGS += -DUSERLAND -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I$(VPATH)/g' GNUmakefile
43 | fi
44 | _BKPPROOT_
45 | if ! ./proot -V
46 | then
47 | printf "%s\\n" "Running 'make clean && make V=1' in directory $(pwd)..."
48 | make clean && make V=1
49 | make install
50 | else
51 | make install
52 | fi
53 | fi
54 | }
55 | _DOTAPROOTUSERLAND_() {
56 | if [ ! -e "$HOME/termux/proot/src" ]
57 | then
58 | mkdir -p "$HOME/termux" && cd "$HOME/termux"
59 | _GITCLONETERMUXPROOT_ || (_AU_ git && _GITCLONETERMUXPROOT_)
60 | fi
61 | printf "%s\\n" "'cd $HOME/termux/proot/src'..." && cd "$HOME/termux/proot/src"
62 | _MAKEV1_ || ( _AU_ clang libtalloc make && _MAKEV1_ )
63 | command -v "$HOME/termux/proot/src/proot" && touch "$HOME/termux/proot/src/builttaprootuserland.lock"
64 | }
65 | ## begin ##
66 | if [[ -z "${1:-}" ]]
67 | then
68 | _DOTAPROOTUSERLAND_
69 | elif [[ "${1//-}" = [Rr][Ee][Vv]* ]] ## [rev[ert] build from commit:
70 | then
71 | GITCLONETERMUXPROOTLCR="bc3668f3238cee2011f9afa5a964b2dfc9dc523b"
72 | _DOTAPROOTUSERLAND_
73 | elif [[ "${1//-}" = [Rr][Ee]* ]] ## [re[vert] build from commit:
74 | then
75 | GITCLONETERMUXPROOTLCR="292fbc8a5406fdaf17b530444cd3dbaa92b1551d"
76 | _DOTAPROOTUSERLAND_
77 | elif [[ "${1//-}" = [Rr]* ]] ## [r[evert] from backup file:
78 | then
79 | if [ -f "$HOME/termux/proot/tmp/proot.bkp" ]
80 | then
81 | cp "$HOME/termux/proot/tmp/proot.bkp" "$PREFIX/bin/proot" && printf "%s\\n" "Copied file '$HOME/termux/proot/tmp/proot.bkp' to '$PREFIX/bin/proot'."
82 | fi
83 | else
84 | printf "%s\\n" "Please run '${0##*/}' with no options to apply the DUSERLAND patch and to build the latest version of Termux 'proot' on smartphone; You can also use the '${0##*/} r[e[v[ertPRootVersion]]]' options for DUSERLAND patching and building Termux 'proot' to one of two previously published source code versions."
85 | fi
86 | # taprootuserland.bash EOF
87 |
--------------------------------------------------------------------------------
/taqemualpinex86.bash:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | ## copyright 2020 (c) by SDRausty, all rights reserved, see LICENSE
3 | ## hosting termuxarch.github.io/TermuxArch courtesy pages.github.com
4 | ## contributors: github.com/WMCB-Tech github.com/JanuszChmiel thank you for helping
5 | ################################################################################
6 | set -eu
7 | _AU_() {
8 | if command -v au
9 | then
10 | au "$@"
11 | else
12 | printf "%s\\n" "Installing 'au'" && curl -OL "https://raw.githubusercontent.com/WAE/au/master/au" -o "$PREFIX/bin/au" && chmod 744 "$PREFIX/bin/au"
13 | au "$@"
14 | fi
15 | }
16 | _BKPPROOT_() {
17 | [ ! -d "$HOME/termux/proot/tmp" ] && mkdir -p "$HOME/termux/proot/tmp"
18 | if [ ! -f "$HOME/termux/proot/tmp/proot.bkp" ] && [ -f "$PREFIX/bin/proot" ]
19 | then
20 | cp "$PREFIX/bin/proot" "$HOME/termux/proot/tmp/proot.bkp" && printf "%s\\n" "Copied file '$PREFIX/bin/proot' to '$HOME/termux/proot/tmp/proot.bkp'."
21 | fi
22 | }
23 | _GITCLONETERMUXPROOT_ () {
24 | if [[ -z "${GITCLONETERMUXPROOTLCR:-}" ]]
25 | then
26 | printf "%s\\n" "Cloning 'https://github.com/termux/proot' with 'git --depth 1 --single-branch'."
27 | git clone --depth 1 "https://github.com/termux/proot" --single-branch
28 | else
29 | printf "%s\\n" "Cloning 'https://github.com/termux/proot' with 'git'."
30 | git clone "https://github.com/termux/proot"
31 | cd proot
32 | git reset --hard "$GITCLONETERMUXPROOTLCR"
33 | fi
34 | }
35 | _MAKEV1_() {
36 | if [ -f "$HOME/termux/proot/src/builttaprootuserland.lock" ]
37 | then
38 | printf "%s\\n" "Found file '$HOME/termux/proot/src/builttaprootuserland.lock' in directory '$HOME/termux/proot/src'; Please remove file '$HOME/termux/proot/src/builttaprootuserland.lock' to attempt to rebuild Termux PRoot with USERLAND support: Continuing..."
39 | else
40 | if ! grep DUSERLAND GNUmakefile
41 | then
42 | sed -ir 's/^CPPFLAGS.*/CPPFLAGS += -DUSERLAND -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I$(VPATH)/g' GNUmakefile
43 | fi
44 | _BKPPROOT_
45 | if ! ./proot -V
46 | then
47 | printf "%s\\n" "Running 'make clean && make V=1' in directory $(pwd)..."
48 | make clean && make V=1
49 | make install
50 | else
51 | make install
52 | fi
53 | fi
54 | }
55 | _DOTAPROOTUSERLAND_() {
56 | if [ ! -e "$HOME/termux/proot/src" ]
57 | then
58 | mkdir -p "$HOME/termux" && cd "$HOME/termux"
59 | _GITCLONETERMUXPROOT_ || (_AU_ git && _GITCLONETERMUXPROOT_)
60 | fi
61 | printf "%s\\n" "'cd $HOME/termux/proot/src'..." && cd "$HOME/termux/proot/src"
62 | _MAKEV1_ || ( _AU_ clang libtalloc make && _MAKEV1_ )
63 | command -v "$HOME/termux/proot/src/proot" && touch "$HOME/termux/proot/src/builttaprootuserland.lock"
64 | }
65 | ## begin ##
66 | if [[ -z "${1:-}" ]]
67 | then
68 | _DOTAPROOTUSERLAND_
69 | elif [[ "${1//-}" = [Rr][Ee][Vv]* ]] ## [rev[ert] build from commit:
70 | then
71 | GITCLONETERMUXPROOTLCR="bc3668f3238cee2011f9afa5a964b2dfc9dc523b"
72 | _DOTAPROOTUSERLAND_
73 | elif [[ "${1//-}" = [Rr][Ee]* ]] ## [re[vert] build from commit:
74 | then
75 | GITCLONETERMUXPROOTLCR="292fbc8a5406fdaf17b530444cd3dbaa92b1551d"
76 | _DOTAPROOTUSERLAND_
77 | elif [[ "${1//-}" = [Rr]* ]] ## [r[evert] from backup file:
78 | then
79 | if [ -f "$HOME/termux/proot/tmp/proot.bkp" ]
80 | then
81 | cp "$HOME/termux/proot/tmp/proot.bkp" "$PREFIX/bin/proot" && printf "%s\\n" "Copied file '$HOME/termux/proot/tmp/proot.bkp' to '$PREFIX/bin/proot'."
82 | fi
83 | else
84 | printf "%s\\n" "Please run '${0##*/}' with no options to apply the DUSERLAND patch and to build the latest version of Termux 'proot' on smartphone; You can also use the '${0##*/} r[e[v[ertPRootVersion]]]' options for DUSERLAND patching and building Termux 'proot' to one of two previously published source code versions."
85 | fi
86 | # taprootuserland.bash EOF
87 |
--------------------------------------------------------------------------------