mnt $1 $2
elif [ “$1” == “-u” ] && [ -n “$2” ];
then
umnt $1 $2
else
echo “”
echo “Either 1’st, 2’nd or both parameters were missing”
echo “”
echo “1’st parameter can be one of these: -m(mount) OR -u(umount)”
echo “2’nd parameter is the full path of rootfs directory(with trailing ‘/’)”
echo “”
echo “For example: ch-mount -m /media/sdcard/”
echo “”
echo 1st parameter : ${1}
echo 2nd parameter : ${2}
fi
8。添加权限
脚本运行需要诸多权限
sudo chmod +x rootfs-mount.sh
9.挂载系统
sudo bash rootfs-mount.sh -m temp
9.1补充:若是加下来报错就输入下方代码,具体作用作者目前还不清楚,也是入门的记录教程
Get:4 http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease [88.7 kB]
0% [1 InRelease gpgv 242 kB]gpgv: Signature made Thu Apr 26 23:38:40 2018 UTC
gpgv: using RSA key 3B4FE6ACC0B21F32
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012)
autolinkftpmaster@ubuntu.comautolink
"
terminate called after throwing an instance of ‘std::runtime_error’
what(): random_device::random_device(const std::string&)
qemu: uncaught targ