Anlinux读取外部存储

Anlinux读取外部存储,以ubuntu arm版为例

###### 以下为安卓11以前的用法

其实anlinux的作者己经写此功能了,要结合temux与anlinux的wiki可得出结论。

一. termux终端下设置
1
$ termux-setup-storage

然后会在”~/“目录下生成storage目录,在根下生成/storage目录,请记住这两个目录

“~/storage/shared/“目录就是你的手机存储的别的App的目录;

“/storage” 就是你手机的扩外置TF卡的目录

二. 修改ubuntu启动文件,以支持外部存储
1
$ vim start-ubuntu.sh

大约在21行,

#command+=” b /sdcard”
请把注释去掉,改为
command+=” b /sdcard”
再增加一行:
command+=” b /storage”

三. 执行 ./start-ubuntu.sh进入ubuntu

在你的根目下有一个sdcard目录,”

1
2
3
4
root@localhost:~ $ cd /sdcard
root@localhost:/sdcard $ # 这个目录其实就是termux下的“~/storage/shared/"目录.
root@localhost:/sdcard $ cd /storage
root@localhost:/storage $ # /storage/0000-0000/ 这个目录其实就是外置SD-card的目录.
四. 安卓11后,发现termux下的/storage或Anlinux下的/storage竟然找不到文件啦,苍天啊!~

后来发现 进入/storage,啥也看不到。但是进入/storage/0000-0000/目录还在,TF又回来啦!