- Linux Device Driver Development Cookbook
- Rodolfo Giometti
- 216字
- 2021-06-24 13:54:11
How to do it...
Now it's time to see how chroot works:
- Execute an ARM64 bash command by using our x86_64 host, as follows:
$ sudo chroot debian-stretch-arm64/ bash
bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
root@giometti-VirtualBox:/#
- Then, we can use each ARM64 command as we did on the ESPRESSObin; for example, to list files into the current directory; we can use the following:
# ls /
bin dev home media opt root sbin sys usr
boot etc lib mnt proc run srv tmp var
# cat /etc/hostname
espressobin
However, there are some traps; for instance, we completely miss the /proc and /sys directories and programs, which rely on them and will fail for sure:
# ls /{proc,sys}
/proc:
/sys:
# ps
Error: /proc must be mounted
To mount /proc at boot you need an /etc/fstab line like:
proc /proc proc defaults
In the meantime, run "mount proc /proc -t proc"
To resolve these problems, we can manually mount these missing directories before executing chroot, but this is quite annoying due to the fact that they are so many, so we can try using the schroot utility, which, in turn, can do all of these steps for us. Let's see how.
For detailed information regarding schroot, you can see its man pages with man schroot.
推薦閱讀
- Mastering ElasticSearch
- 每天5分鐘玩轉Kubernetes
- Hands-On DevOps with Vagrant
- SOA實踐者說
- WindowsServer2012Hyper-V虛擬化部署與管理指南
- Installing and Configuring Windows 10:70-698 Exam Guide
- 網絡操作系統管理與應用(第三版)
- Android物聯網開發細致入門與最佳實踐
- Linux設備驅動開發
- Learning BeagleBone
- Linux操作系統
- Linux網絡操作系統項目教程(RHEL 7.4/CentOS 7.4)(第3版)(微課版)
- 大學計算機應用基礎實踐教程(Windows 7+MS Office 2010)
- Web Penetration Testing with Kali Linux(Third Edition)
- Docker容器技術與應用