安卓手机chroot linux,在Android设备上安装 GNU/Linux Chroot 环境
該樓層疑似違規已被系統折疊?隱藏此樓查看此樓
3-安裝與配置系統
3-Install and Configure system
因為是chroot環境,系統不用啟動,所以過程比安裝ARCH(x86)更簡單。
Because it's chroot environment,the system needn't boot,so the course is easier than installing ARCH(x86).
先是掛載上鏡像:
First mount the image:
[code]
mount 鏡像 掛載目錄
mount IMAGE MOUNT-DIR
[/code]
然后解壓/解開下載的基本系統鏡像包檔案/文件到掛載目錄。修改配置文件(pacman.conf mirrorlist locale.gen)
Then,unpack the base-system image package to MOUNT-DIR.Modify the configuration files(pacman.conf mirrorlist locale.gen).
接著就是寫幾個腳本來方便使用它。
And,write several scripts to make using it convenient.
進入Android的Shell:
Enter Android's shell:
[code]
su
mount -o remount,rw /system
mkdir /system/mnt
#鏡像檔案/文件在Android上的掛載目錄
#The MOUNT-DIR of image file (on Android)
vi /system/xbin/arch
[/code]
寫入以下內容:
Write down these contents:
[code]
#!/system/bin/mksh
if ( mountpoint -q /system/mnt ) ;then
chroot /system/mnt/ /bin/bash
#若已經掛載就直接chroot
#If mounted,chroot directly.
else
mknod /dev/loop256 b 7 256
losetup /dev/loop256 /mnt/sdcard/鏡像
mount -t ext2 /dev/loop256 /system/mnt/
#掛載鏡像。記得把「鏡像」倆字改成你的鏡像路徑。
#Mount the image.Remember to change 鏡像(IMAGE) two words into your image path.
mount -o bind /dev /system/mnt/dev
mount -o bind /proc /system/mnt/proc
mount -o bind /sys /system/mnt/sys
#綁定chroot需要的目錄們(API檔案系統/文件系統)
#Bind directories that chroot need(API filesystems).
#當然,你也可以選擇綁上你的sd卡上的一些目錄
#Of course,you can bind some directory of your SDcard if you want.
chroot /system/mnt/ /bin/bash
#Chroot
fi
[/code]
測試下:
Take a test:
[code]
chmod +x /system/xbin/arch
arch
[/code]
看看行不行?
Check if it works.
總結
以上是生活随笔為你收集整理的安卓手机chroot linux,在Android设备上安装 GNU/Linux Chroot 环境的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux执行加密的shell,Linu
- 下一篇: linux下socket上限,[100分