该楼层疑似违规已被系统折叠隐藏此楼查看此楼
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.