Skip to content

Commit 2491936

Browse files
authored
Merge pull request #11 from lin1328/main
Fix two outstanding issues
2 parents afbbb9f + 9f720d9 commit 2491936

File tree

25 files changed

+30
-42
lines changed

25 files changed

+30
-42
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h2 align="center">Android Subsystem for GNU/Linux</h2>
22

3-
[![Repo size](https://img.shields.io/github/repo-size/lin1328/asl?logo=github&logoColor=white)](https://github.com/lin1328/asl)
3+
[![Repo size](https://img.shields.io/github/repo-size/Moe-hacker/asl?logo=github&logoColor=white)](https://github.com/Moe-hacker/asl)
44

55
<details>
66
<summary><strong>Currently Supported Systems</strong></summary>
@@ -37,7 +37,7 @@
3737
> - If there are any bugs, please report them. Compatibility with all devices is not guaranteed
3838
> - If you install the module twice, it will backup old container_dir and install a new container
3939
> - you can install multipe OS by changeing the module id and ssh port, but this action not supported officially
40-
## How to connect:
40+
## How to connect
4141
Use port 22, user root and password 123456 by default,
4242
but, please change the password once you connected to the container, and it's better to use ssh key instead of password login, note that please do not expose the ssh port to the pubnet.
4343
## About the Binary

action.sh

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MODDIR=${0%/*}
22
PORT=$(sed -n 's/^PORT=\(.*\)/\1/p' "$MODDIR/config.conf")
3-
PID=$("$MODDIR/bin/fuser" "$PORT/tcp" 2>/dev/null)
3+
PID=$(fuser "$PORT/tcp" 2>/dev/null)
44

55
BETA() {
66
local PREFIX=/data/user/0/com.termux/files/usr
@@ -43,13 +43,13 @@ BETA() {
4343
}
4444

4545
update_ssh() {
46-
local rootfs="/data/$(sed -n 's/^RURIMA_LXC_OS="\([^"]*\)"/\1/p' "$MODDIR/config.conf")"
46+
local rootfs=$(sed -n 's/^CONTAINER_DIR=\(.*\)$/\1/p' "$MODDIR/config.conf")
4747

4848
sleep 2
4949
if lsof | grep "$rootfs" | awk '{print $2}' | uniq | grep -q "sshd"; then
5050
sed -i 's|^description=.*|description=\[ running😉 \] Android Subsystem for GNU/Linux Powered by ruri|' "$MODDIR/module.prop"
5151
else
52-
sed -i 's|^description=.*|description=\[ running⚠️ \] Android Subsystem for GNU/Linux Powered by ruri|' "$MODDIR/module.prop"
52+
sed -i 's|^description=.*|description=\[ SSH exception⚠️ \] Android Subsystem for GNU/Linux Powered by ruri|' "$MODDIR/module.prop"
5353
fi
5454
}
5555

bate.sh

100755100644
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ echo
4141
echo "Welcome to Termux"
4242
echoRgb "欢迎使用 Android Subsystem for GNU/Linux" 4
4343

44-
for cmd in curl wget rsync; do
44+
for cmd in curl wget; do
4545
command -v "$cmd" >/dev/null 2>&1 || abort "! 依赖的命令 $cmd 未安装"
4646
done
4747

@@ -744,7 +744,7 @@ download_system_image() {
744744

745745
IFS=';' read -r distro version arch variant date path <<< "$version_info"
746746

747-
local download_url="${base_url}${path}/rootfs.tar.xz"
747+
local download_url="${base_url}${path}rootfs.tar.xz"
748748
local download_file="/data/local/tmp/${os_name}_${version}_rootfs.tar.xz"
749749

750750
mkdir -p "$target_dir" /data/local/tmp
@@ -925,7 +925,6 @@ delete_system() {
925925
rm -rf "$sys_path"
926926

927927
echo "系统 $os_name 删除成功"
928-
pause_func
929928
return 0
930929
}
931930

bin/ruri

-145 KB
Binary file not shown.

config.conf

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
# 本机连接ssh root@127.0.0.1 -p 22密码123456
2-
# 请根据你自己的网络环境选择是本机(127.0.0.1)、局域网(192.*.*.*)或公网(ipv4地址)来连接 SSH
3-
41
# Mirror
52
RURIMA_LXC_MIRROR=images.linuxcontainers.org
63
RURIMA_LXC_MIRROR_FALLBACK=mirrors.tuna.tsinghua.edu.cn/lxc-images
74

85
# OS to install
9-
# Make sure there is setup/${RURIMA_LXC_OS}.sh
6+
# Make sure there is ${RURIMA_LXC_OS} in setup/setup.sh
107
RURIMA_LXC_OS=ubuntu
118

129
# OS version to install
@@ -15,9 +12,6 @@ RURIMA_LXC_OS_VERSION=oracular
1512
PASSWORD=123456
1613
PORT=22
1714

18-
# OS dir to install
19-
# CONTAINER_DIR="/data/${RURIMA_LXC_OS}"
20-
2115

2216
# ruri config
2317

@@ -30,4 +24,6 @@ PRIVILEGED=false
3024
RUNTIME=false
3125

3226

33-
#
27+
# OS dir to install
28+
# The actual directory is the `CONTAINER_DIR` in `customize.sh`
29+
# CONTAINER_DIR=/data/${RURIMA_LXC_OS}

container_ctrl.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
#!/bin/sh
22

3-
init_setup() {
4-
MODDIR=${0%/*}
5-
export PATH="$MODDIR/bin:$PATH"
6-
. "$MODDIR/config.conf"
7-
}
3+
. "${0%/*}/config.conf"
84

95
ruriumount() {
10-
init_setup
116
fuser -k "$CONTAINER_DIR" >/dev/null 2>&1
127
ruri -U "$CONTAINER_DIR" >/dev/null 2>&1
138
umount -lvf "$CONTAINER_DIR" 2>/dev/null
@@ -22,11 +17,11 @@ ruriumount() {
2217
ruristart() {
2318
ruriumount
2419

25-
# The servicectl command is an open-source project. If you find it inconvenient to use, you can opt for other startup commands It is not mandatory
26-
# e.g. /usr/sbin/sshd
2720
case "$RURIMA_LXC_OS" in
2821
archlinux|centos|fedora)
2922
START_SERVICES="servicectl start sshd"
23+
# you can opt for other startup commands It is not mandatory
24+
# e.g. /usr/sbin/sshd
3025
;;
3126
debian|kali|ubuntu)
3227
START_SERVICES="service ssh start"

customize.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ bootinspect() {
2121
link_busybox() {
2222
local busybox_file=""
2323

24-
if [ -f "$MODPATH/bin/busybox" ]; then
25-
busybox_file="$MODPATH/bin/busybox"
24+
if [ -f "$MODPATH/system/xbin/busybox" ]; then
25+
busybox_file="$MODPATH/system/xbin/busybox"
2626
else
2727
for path in $BUSYBOX_PATHS; do
2828
if [ -f "$path" ]; then
@@ -33,12 +33,16 @@ link_busybox() {
3333
fi
3434

3535
if [ -n "$busybox_file" ]; then
36-
mkdir -p "$MODPATH/bin"
37-
# "$busybox_file" --install -s "$MODPATH/bin"
36+
mkdir -p "$MODPATH/system/xbin"
37+
# "$busybox_file" --install -s "$MODPATH/system/xbin"
3838
# This method creates links pointing to all commands of busybox, so it is not recommended. The following is an alternative approach for creating symbolic links pointing to the busybox file for specific commands
39-
for cmd in fuser inotifyd; do
40-
ln -s "$busybox_file" "$MODPATH/bin/$cmd"
39+
for cmd in fuser; do
40+
ln -s "$busybox_file" "$MODPATH/system/xbin/$cmd"
4141
done
42+
43+
if ! inotifyd --help >/dev/null 2>&1; then
44+
ln -sf "$busybox_file" "$MODPATH/system/xbin/inotifyd"
45+
fi
4246
else
4347
abort "- No available Busybox file found Please check your installation environment"
4448
fi
@@ -57,19 +61,15 @@ inotifyfile() {
5761
}
5862

5963
configuration() {
60-
set_perm_recursive "$MODPATH/bin" 0 0 0755 0755
64+
set_perm_recursive "$MODPATH/system/xbin" 0 0 0755 0755
6165
. "$MODPATH/config.conf"
6266

63-
BUSYBOX_PATHS="/data/adb/magisk/busybox
64-
/data/adb/ksu/bin/busybox
65-
/data/adb/ap/bin/busybox"
67+
BUSYBOX_PATHS="/data/adb/magisk/busybox /data/adb/ksu/bin/busybox /data/adb/ap/bin/busybox"
6668

6769
BASE_DIR="/data"
6870
CONTAINER_DIR="${BASE_DIR}/${RURIMA_LXC_OS}"
6971
echo "CONTAINER_DIR=${BASE_DIR}/${RURIMA_LXC_OS}" >> "$MODPATH/config.conf"
7072

71-
export PATH="$MODPATH/bin:$PATH"
72-
7373
CASE=$(sed -n '/case "\$LXC_OS"/,/^[[:space:]]*esac/p' "$MODPATH/setup/setup.sh")
7474
SUPPORT=$(echo "$CASE" | \
7575
sed -n 's/^[[:space:]]*\([a-zA-Z0-9|]*\))$/\1/p' | \

inotify.sh

100755100644
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ if command -v magisk >/dev/null 2>&1; then
88
fi
99
fi
1010

11-
export PATH="$MODULEDIR/bin:$PATH"
12-
1311
while [ $(getprop sys.boot_completed) != 1 ]; do
1412
sleep 2
1513
done
@@ -35,4 +33,4 @@ done
3533
) &
3634
pid=$!
3735

38-
sed -i "6c description=[ PID=$pid ] This container can be quickly controlled by enabling/disabling" "$MODULEDIR/module.prop"
36+
sed -i "6c description=[ PID=$pid ] This container can be quickly controlled by enabling/disabling" "$MODULEDIR/module.prop"

module.prop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id=asl
22
name=Android Subsystem for GNU/Linux
3-
version=v1.0.0
3+
version=v1.0.1
44
versionCode=202412
55
author=Moe-hacker & Lin1328
66
description=Android Subsystem for GNU/Linux Powered by ruri

setup/servicectl/servicectl

100755100644
File mode changed.

0 commit comments

Comments
 (0)