Skip to content

Commit 6ad3014

Browse files
author
b1tchysam
authored
Merge pull request #18 from RandomCoderOrg/revamp-v2.5
Revamp v2.5
2 parents fcbcdef + 8747076 commit 6ad3014

File tree

67 files changed

+13850
-694
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+13850
-694
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# [Choice] Ubuntu version (use hirsuite or bionic on local arm64/Apple Silicon): hirsute, focal, bionic
2+
ARG VARIANT=jammy
3+
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}
4+
5+
ENV DEVCONTAINER true
6+
7+
# [Optional] Uncomment this section to install additional OS packages.
8+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9+
&& apt-get -y install tar fonts-firacode

.devcontainer/devcontainer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "fs-manager-udroid Dev Container v1",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
// Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic
6+
// Use hirsute or bionic on local arm64/Apple Silicon.
7+
"args": { "VARIANT": "jammy" }
8+
},
9+
10+
// Set *default* container specific settings.json values on container create.
11+
"settings": {
12+
"files.eol": "\n"
13+
},
14+
15+
16+
// Add the IDs of extensions you want installed when the container is created.
17+
"extensions": [
18+
"tabnine.tabnine-vscode",
19+
"lizebang.bash-extension-pack",
20+
"shakram02.bash-beautify"
21+
],
22+
23+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
24+
// "forwardPorts": [],
25+
26+
// Use 'postCreateCommand' to run commands after the container is created.
27+
// "postCreateCommand": "uname -a",
28+
29+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
30+
"remoteUser": "vscode"
31+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**.tmp
2+
tmp

.shellcheckrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
disable=SC2086
2+
disable=SC2046
3+
disable=SC2068

CONTRIBUTING.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# The contribution guidelines
2+
3+
Hey!, Thanks for contributing to this project. if you are in this step that means you're probably want to contribute to this project or just exploring :).
4+
5+
This page will guide you through the project structure and basic rules ( that keep project structure clean and understandable )
6+
7+
> this repo main script is referenced as **udroid** in this page.
8+
9+
## Directories
10+
11+
```cmd
12+
.
13+
├── CODE_OF_CONDUCT.md
14+
├── CONTRIBUTING.md
15+
├── dist.json
16+
├── etc
17+
├── install.sh
18+
├── LICENSE
19+
├── README.md
20+
├── targ.map
21+
├── udroid
22+
└── version
23+
```
24+
25+
All mainline code related to udroid will be stored in **udroid** directory. and the rest of em are either archiving or documentation. on expanding the **udroid** directory you'll two direcotries **src** and **test**.
26+
27+
> By name src for the source code & test for the test code.
28+
29+
## How udroid works
30+
31+
udroid in this repo is a script to manage things like installing, login of a tarball.
32+
33+
the main script is in `udroid/src/udroid.sh`. which will be executed when user executes `udroid` in terminal.
34+
35+
Basic things udroid supposed to handle are:
36+
37+
1. **install**: to dowload & install the linux tarball
38+
2. **login**: to login to the linux filesystem by chaning root with the help of `proot`
39+
3. **remove**: to remove the linux tarball installation
40+
41+
> if you ever tried `proot-distro` you'll get the idea of how udroid works.
42+
> Additional functionality will like **backup** and **restore** need more work (If you have any ideas feel free to suggest us!).
43+
44+
## Dev FAQ?
45+
46+
### How this sript differ from `proot-distro`?
47+
48+
> the main for this project is to provide a simple script to install and use linux distros on android. and the main difference is that udroid is a single script which is easy to understand and modify. from the developer point of view now we can ship new feature faster without patching things to work specially with `proot-distro`. with this users can be able to install custom linux distro with ease.
49+
50+
### What languages are used in this project?
51+
52+
> the main script is written in `bash` and the test script (some of em) is written in `python` & `bash` (because it's easy to write test in python).
53+
54+
### What to contribute?
55+
56+
> you can contribute by writing documentation, writing diffrent test cases, new features, creating issues about bugs. even a typo fix is a contribution. You can ping us on discord if you have any questions.
57+
58+
### is the project accept Hacktoberfest PRs?
59+
60+
> Yes, we accept Hacktoberfest PRs. but we'll only accept PRs that are related to the project. if you have any questions ping us on discord.
61+
62+
### How can I contribute?
63+
64+
for starters, you can follow the basic GitHub guide [here](https://docs.github.com/en/get-started/quickstart/hello-world).
65+
66+
When submitting a pull request make sure to add a good title and description to it. using images is encouraged too
67+
68+
Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this:
69+
70+
```cmd
71+
$ git commit -m "A summary of the commit
72+
>
73+
> A paragraph describing what changed and its impact."
74+
```
75+
76+
## Coding conventions
77+
78+
Start reading our code and you'll get the hang of it. We optimize for readability:
79+
80+
- use 4-6 spaces for intending to bash
81+
- strictly use `lf` for line ending
82+
- check the code with `shellcheck` or `pylint` before commiting.
83+
- follow directory rules in all cases ( images should go in directories named similar to `assets` or `img` )
84+
- use code beautification tools for better look and readability
85+
- This is open-source software. Consider the people who will read your code, and make it look nice for them. It's sort of like driving a car: Perhaps you love doing donuts when you're alone, but with passengers, the goal is to make the ride as smooth as possible.

README.md

Lines changed: 116 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,120 @@
11
# fs-manager-udroid
2+
23
A tool manage common things with ubuntu-on-android
34
& some scripts and linux apps
45

5-
[![CodeFactor](https://www.codefactor.io/repository/github/randomcoderorg/fs-manager-udroid/badge)](https://www.codefactor.io/repository/github/randomcoderorg/fs-manager-udroid)
6-
<!--
7-
## Target to V01
8-
- [X] upgrade system
9-
- [X] launch shorcuts vncserver and others ( [0530e7965907002c614e70c6f8a398c6b9d13fd8](https://github.com/RandomCoderOrg/fs-manager-udroid/commit/0530e7965907002c614e70c6f8a398c6b9d13fd8) to [5a4ee56e9219988b24204e8b49787a8f7ed3b8ef](https://github.com/RandomCoderOrg/fs-manager-udroid/commit/5a4ee56e9219988b24204e8b49787a8f7ed3b8ef) )
10-
-->
6+
## Manual installation
7+
8+
```bash
9+
git clone https://github.com/RandomCoderOrg/fs-manager-udroid.git
10+
cd fs-manager-udroid
11+
bash install.sh
12+
```
13+
14+
## Usage
15+
16+
```cmd
17+
udroid <option> [<options>] [<suite>]:[<varient>]
18+
19+
options:
20+
install, -i [<options>] <suite>:<varient> install a distro
21+
remove, --remove <suite>:<varient> remove a distro
22+
list, --list [options] list distros
23+
login, --login <suite>:<varient> login to a distro
24+
upgrade, --upgrade upgrade udroid scripts
25+
help, --help show this help message and exit
26+
--update-cache update cache from remote
27+
--clear-cache clear downloaded cache
28+
```
29+
30+
three main arguments `install`, `login`, `remove`
31+
32+
### install ( `-i` )
33+
34+
```bash
35+
udroid -i jammy:raw
36+
```
37+
38+
install argument takes a strings of two words seperated by `:` left side is suite name and right is varient name
39+
40+
More Avalible examples
41+
42+
```bash
43+
udroid -i impish:raw
44+
udroid -i impish:xfce
45+
udroid -i impish:mate
46+
```
47+
48+
```bash
49+
udroid -i focal:xfce4
50+
```
51+
52+
###### help
53+
54+
```cmd
55+
udroid [ install| -i ] [<options>] [<suite>]:[<varient>]
56+
installs udroid distros
57+
options:
58+
-h, --help show this help message and exit
59+
--no-verify-integrity do not verify integrity of filesystem
60+
61+
example:
62+
udroid install jammy:raw
63+
udroid install --install jammy:raw
64+
```
65+
66+
> `--install` with no extra options install best picked distro ( deprecated )
67+
68+
### login (`login`)
69+
70+
```bash
71+
udroid --login jammy:raw
72+
# or
73+
udroid login jammy:raw # same as above
74+
```
75+
76+
###### help
77+
```cmd
78+
udroid [ login| --login ] [<options>] <suite>:<varient> <cmd>
79+
login to a suite
80+
81+
options:
82+
-h, --help: show this help message and exit
83+
--user: Allows the user to specify the login user for the filesystem.
84+
--name: Allows the user to specify a custom name for the filesystem to install
85+
--bind or -b: Allows the user to specify extra mount points for the filesystem.
86+
--isolated: Creates an isolated environment for the filesystem.
87+
--fix-low-ports: Fixes low ports for the filesystem.
88+
--no-shared-tmp: Disables shared tmp for the filesystem.
89+
--no-link2symlink: Disables link2symlink for the filesystem.
90+
--no-sysvipc: Disables sysvipc for the filesystem.
91+
--no-fake-root-id: Disables fake root id for the filesystem.
92+
--no-cap-last-cap: Disables cap last cap fix mount for the filesystem.(only per session)
93+
--no-kill-on-exit: Disables kill on exit for the filesystem.
94+
95+
<cmd>:
96+
command to run in the filesystem and exit
97+
```
98+
99+
### remove (`remove`)
100+
101+
```bash
102+
udroid remove jammy:raw
103+
```
104+
105+
###### help
106+
107+
```cmd
108+
udroid [ remove| --remove ] <distro>
109+
removes udroid distros
110+
example:
111+
udroid remove jammy:raw
112+
udroid remove --remove jammy:raw
113+
```
114+
115+
> Download cache is ignored
116+
117+
118+
## Contributing
119+
120+
for now there is no guide for contributing. try to look at code and make a pull request if you have any corrections or improvements ( 💟 )

TODO

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- make install echo's a little less verbose by default
2+
- show install size & download size during install ( need to cache sizes in conf )
3+
- [ OPT ] make a deb package for udroid
4+

docs/adding_extra_mounts.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Adding shared folders
2+
3+
In case you want to bind directories directly from host's file system to proot container as shared folders, you can use this.
4+
5+
## How to apply
6+
7+
You can use the traditional `proot-distro` method to use `--bind` argument with paths to bind in syntax `<path in host>:<path to bind in container>` before the name of the distribution. Or custom configuration file named `udroid_proot_mounts` in container root ( at `\`) with paths to bind in format `<path in host>:<path to bind in container>`
8+
9+
### By using argument
10+
11+
In case of binding directly while launching udroid. For adding multiple bindings you can use `--bind` over and over again
12+
13+
```bash
14+
udroid -l --bind /sdcard:/sdcard jammy:raw
15+
```
16+
17+
> Note the way `--bind` is used before the name of the distribution `jammy:raw`
18+
>
19+
20+
### By creating config file
21+
22+
Those binds are written in a file named `udroid_proot_mounts` in the root of the container (at `\`).
23+
24+
> Note that for some udroid builds there may be pre-defined custom mounts points in `udroid_proot_mounts` file. If you want to add your own mounts, you should add them to the end of the file. ( carefull while using redirections to overwrite the file, you may lose the pre-defined mounts )
25+
26+
If adding new binds, you can put directory names with paths like this in `udroid_proot_mounts`
27+
```bash
28+
/sdcard:/sdcard
29+
/sdcard/Music:/root/ext_music
30+
```
31+
32+
### Note
33+
Due to android limitations, you cannot get external sdcard paths working like this for non-rooted devices.

docs/audio output.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Audio Output
2+
3+
Audio output is handled by pulseaudio from container to termux pulseaudio openSL ES sink througth tcp.
4+
5+
termux pulse audio initalization is done in scripts with `PULSE_SERVER` environment variable set to `127.0.0.1` and with `module-native-protocol-tcp` module loaded in termux pulseaudio.
6+
7+
#### example
8+
9+
```bash
10+
# in termux
11+
pulseaudio --start \
12+
--load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" \
13+
--exit-idle-time=-1
14+
# in proot container
15+
export PULSE_SERVER=127.0.0.1
16+
17+
```
18+
19+
20+
## limitations
21+
22+
> sending audio packets througth tcp with vnc will cause audio lag.
23+
>
24+
> _for now there is no solution for this._

0 commit comments

Comments
 (0)