当前位置: 首页> 财经> 创投人物 > 广州市疫情防控最新消息_今日头条移动建站工具_免费做网站怎么做网站吗_什么是百度竞价排名

广州市疫情防控最新消息_今日头条移动建站工具_免费做网站怎么做网站吗_什么是百度竞价排名

时间:2025/7/11 14:50:31来源:https://blog.csdn.net/wanghe334/article/details/147128970 浏览次数:1次
广州市疫情防控最新消息_今日头条移动建站工具_免费做网站怎么做网站吗_什么是百度竞价排名

Chroot on Android

Content

  • Good to Mention
  • Choosing a rootfs
  • Extracting the rootfs
  • Making a script to launch the chroot environment
  • Troubleshooting
    • Fixing apt under debian based ditros
    • Fixing network issues

Good to Mention

  • You need a rooted phone for that
  • I’ve used here a Samsung S10+ phone running Lineage OS 19.1
  • If any damage happens to your phone, you are all responsible for it!

Choosing a rootfs

the rootfs architecture have to match with your device architecture too, to know what architecture your phone have run:

$ uname -maarch64

(e.g. aarch64, armv7l).

Extracting the rootfs

Any location under /data should be good (because it formatted as ext4)

e.g.

$ mkdir chroot #or anything else
$ sudo tar xfp /sdcard/Download/rootfs.tar.xz -C /data/ubuntu #to keep the files permissions

Making a script to launch the chroot environment

Use nano or any text editor you like for that:

$ nano run-chroot.sh

simple example:

#!/bin/sh# fix /dev mount options
mount -o remount,dev,suid /datamount --bind /dev /data/ubuntu/dev
mount --bind /sys /data/ubuntu/sys
mount --bind /proc /data/ubuntu/proc
mount --bind /dev/pts /data/ubuntu/dev/ptsexport PATH=/bin:/sbin:/usr/bin:/usr/sbin
export TERM=$TERM
export TMPDIR=/tmpchroot /data/ubuntu/ /bin/su - root

then change the file permissions to executable:

$ chmod +x run-chroot.sh

you have to run it as root:

$ sudo ./run-chroot.sh

Troubleshooting

Fixing apt under debian based ditros

usermod -g 3003 _apt

Fixing network issues

you have to add a DNS to resolv.conf:

echo "nameserver 8.8.8.8" > /etc/resolv.conf

then you need to add android root groups:

groupadd -g 3001 aid_bt
groupadd -g 3002 aid_bt_net
groupadd -g 3003 aid_inet
groupadd -g 3004 aid_net_raw
groupadd -g 3005 aid_admin

then add those groups to the user you using:

usermod -a -G aid_bt,aid_bt_net,aid_inet,aid_net_raw,aid_admin root
关键字:广州市疫情防控最新消息_今日头条移动建站工具_免费做网站怎么做网站吗_什么是百度竞价排名

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: