Skip to content

Commit 324b170

Browse files
Merge pull request #26 from RandomCoderOrg/revamp-v2.5-login
Revamp v2.5 login
2 parents 7b0f3a9 + 27bc860 commit 324b170

File tree

11 files changed

+1578
-282
lines changed

11 files changed

+1578
-282
lines changed

.shellcheckrc

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

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.

install.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
#!/usr/bin/env bash
22

3+
DIE() { echo -e "${@}"; exit 1 ;:;}
4+
GWARN() { echo -e "\e[90m${*}\e[0m";:;}
5+
36
apt install -y jq wget proot pv
47
[[ ! -d udroid/src ]] && {
58
echo "udroid/src not found"
69
exit 1
710
}
811

12+
# Android version warinigs
13+
android_version_code=$(getprop ro.system.build.version.release)
14+
if (( $android_version_code >= 12 )); then
15+
sleep 1
16+
echo
17+
GWARN "[Warning]: Android version ${android_version_code} detected"
18+
GWARN "You many experience issues like crashing"
19+
echo
20+
sleep 2
21+
fi
22+
923
cd udroid/src || exit 1
1024

1125
bash install.sh

open_source.licenses

Lines changed: 701 additions & 0 deletions
Large diffs are not rendered by default.

udroid/src/help_udroid.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
help_login() {
4+
# TODO: Add help for login
5+
:
6+
}
7+
8+
help_list() {
9+
echo "udroid [ list| --list ] [options]"
10+
echo "options:"
11+
echo " -h, --help show this help message and exit"
12+
echo " --size show size of each distro"
13+
echo " --path <path> path to look for distros"
14+
echo " --list-installed show only installed distros"
15+
}
16+
17+
help_install() {
18+
echo "udroid [ install| --install ] <distro>"
19+
echo "installs udroid distros"
20+
echo "example:"
21+
echo " udroid install jammy:raw"
22+
echo " udroid install --install jammy:raw"
23+
}
24+
25+
help_remove() {
26+
echo "udroid [ remove| --remove ] <distro>"
27+
echo "removes udroid distros"
28+
echo "example:"
29+
echo " udroid remove jammy:raw"
30+
echo " udroid remove --remove jammy:raw"
31+
}

udroid/src/install.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
BIN="$PREFIX/bin"
44
INSTALL_DIR="${PREFIX}/etc/udroid"
55

6+
RTR="${PREFIX}/etc/udroid"
67
DEFAULT_ROOT="${PREFIX}/var/lib/udroid"
78
DEFAULT_FS_INSTALL_DIR="${DEFAULT_ROOT}/installed-filesystems"
89
DLCACHE="${DEFAULT_ROOT}/dlcache"
@@ -17,14 +18,14 @@ function install_symlinks() {
1718

1819
function create_dir() {
1920
local remove=$1; shift 1
20-
[[ -n $remove ]] && [[ -d $1 ]] && rm -rf $1
21+
[[ $remove == 0 ]] && [[ -d $1 ]] && rm -rf $1
2122
g_spin minidot "Creating directory \"$1\"..." mkdir -p $1
2223
}
2324

2425
create_dir 0 $INSTALL_DIR
25-
create_dir $DEFAULT_ROOT
26-
create_dir $DEFAULT_FS_INSTALL_DIR
27-
create_dir $DLCACHE
26+
create_dir 1 $DEFAULT_ROOT
27+
create_dir 1 $DEFAULT_FS_INSTALL_DIR
28+
create_dir 1 $DLCACHE
2829
create_dir 0 $RTCACHE
2930

3031
g_spin minidot "installing $(basename $(pwd))..." cp -rv ./* $INSTALL_DIR

0 commit comments

Comments
 (0)