官术网_书友最值得收藏!

How to do it...

Now it's time to see how chroot works:

  1. 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:/#
  1. 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.
主站蜘蛛池模板: 平凉市| 攀枝花市| 宿迁市| 韶关市| 济宁市| 翁牛特旗| 永仁县| 林甸县| 汉川市| 汉中市| 大埔区| 刚察县| 西乌| 饶阳县| 繁峙县| 大连市| 尚志市| 舞阳县| 扎赉特旗| 方正县| 金山区| 克拉玛依市| 安平县| 澜沧| 岚皋县| 石景山区| 东阳市| 定州市| 比如县| 西林县| 嘉定区| 灵武市| 黄梅县| 丰台区| 开封市| 伊金霍洛旗| 台中市| 商洛市| 吉水县| 隆化县| 金溪县|