backtrack arm启动脚本解析
启动脚本http://forum.xda-developers.com/showthread.php?t=1094237
perm=$(id|cut -b 5) if [ "$perm" != "0" ];then echo "This Script Needs Root! Type : su";exit;fi mount -o remount,rw /dev/block/mmcblk0p5 /system export kit=/sdcard/BT5 export bin=/system/bin export mnt=/data/local/mnt export stor=$mnt/root/storage export sdcard=$stor/sdcard export extsd=$stor/external_sd export usb=$stor/usb_storage mkdir -p $mnt export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH export TERM=linux export HOME=/root export USER=root if [ -b /dev/loop2 ]; then echo "Loop device exists" else busybox mknod /dev/loop2 b 7 0
#BusyBox 是一个集成了一百多个最常用linux命令和工具的软件
#mknod 命令的第一种形式只能由 root 用户或系统组成员执行。在第一种形式中,使用了b 或 c 标志。b 标志表示这个特殊文件是面向块的设备(磁盘、软盘或磁带)
fi
mount -o loop,rw,noatime -t ext2 $kit/bt5.img $mnt
#-o loop:option用来把一个文件当成硬盘分区挂接上系统 可读可写 echo "mounting storage devices in $stor..." mkdir -p $sdcard mkdir -p $extsd mkdir -p $usb busybox mount --bind /mnt/sdcard $sdcard
#在手机的shell中可以看见 sdcard已经被安卓 加载在/mnt里面 这里是把sdcard再映射到bt里面去 busybox mount --bind /mnt/external_sd $extsd busybox mount --bind /mnt/usb_storage $usb mount -t devpts devpts $mnt/dev/pts mount -t proc proc $mnt/proc mount -t sysfs sysfs $mnt/sys busybox sysctl -w net.ipv4.ip_forward=1 echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf echo "127.0.0.1 localhost bt5" > $mnt/etc/hosts busybox chroot $mnt /bin/bash echo "Shutting down BackTrack ARM for Iconia A500" umount $sdcard umount $extsd umount $usb umount $mnt/dev/pts umount $mnt/proc umount $mnt/sys umount $mnt