この質問は以前に要求されたことがあることを知っていますが、私の問題は解決されませんでした。
私はと/dev
をバインドして/proc
コピーしました。ただし、chrootはどのコマンドも実行できません。qemu-arm-static
/usr/bin
前日勤務中でした。だから今は何が壊れているのかわかりません。
それが何でも指している場合はstraceダンプ
execve("/usr/sbin/chroot", ["chroot", "target-rootfs", "bash"], [/* 27 vars */]) = 0
brk(NULL) = 0x2513000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=127309, ...}) = 0
mmap(NULL, 127309, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4c601e3000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\t\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4c601e2000
mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f4c5fc14000
mprotect(0x7f4c5fdd4000, 2097152, PROT_NONE) = 0
mmap(0x7f4c5ffd4000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7f4c5ffd4000
mmap(0x7f4c5ffda000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4c5ffda000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4c601e1000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4c601e0000
arch_prctl(ARCH_SET_FS, 0x7f4c601e1700) = 0
mprotect(0x7f4c5ffd4000, 16384, PROT_READ) = 0
mprotect(0x608000, 4096, PROT_READ) = 0
mprotect(0x7f4c60203000, 4096, PROT_READ) = 0
munmap(0x7f4c601e3000, 127309) = 0
brk(NULL) = 0x2513000
brk(0x2534000) = 0x2534000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2981280, ...}) = 0
mmap(NULL, 2981280, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4c5f93c000
close(3) = 0
getcwd("/home/YashB/mini_deb", 4096) = 21
lstat("/home/YashB/mini_deb/target-rootfs", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
chroot("target-rootfs") = 0
chdir("/") = 0
execve("/usr/local/sbin/bash", ["bash"], [/* 27 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/local/bin/bash", ["bash"], [/* 27 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/sbin/bash", ["bash"], [/* 27 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/bin/bash", ["bash"], [/* 27 vars */]) = -1 ENOENT (No such file or directory)
execve("/sbin/bash", ["bash"], [/* 27 vars */]) = -1 ENOENT (No such file or directory)
execve("/bin/bash", ["bash"], [/* 27 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/games/bash", ["bash"], [/* 27 vars */]) = -1 ENOENT (No such file or directory)
execve("/usr/local/games/bash", ["bash"], [/* 27 vars */]) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2492, ...}) = 0
read(3, "# Locale name alias data base.\n#"..., 4096) = 2492
read(3, "", 4096) = 0
close(3) = 0
open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/charset.alias", O_RDONLY|O_NOFOLLOW) = -1 ENOENT (No such file or directory)
write(2, "chroot: ", 8chroot: ) = 8
write(2, "failed to run command \342\200\230bash\342\200\231", 32failed to run command ‘bash’) = 32
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
) = 1
close(1) = 0
close(2) = 0
exit_group(127) = ?
+++ exited with 127 +++
答え1
私はそれを動作しています。私はとても愚かな間違いを犯しました。
qemu-arm-static
私が使うべきものの代わりに何かを使っているのでqemu-aarch64-static
、ちょっとめちゃくちゃです。
答え2
トレース出力には欠落しているファイルが表示されます。
そのため、トレースによって識別されたすべての欠落ファイルをインストールして再確認してください。完了するまでこの操作を繰り返します。
chroot()
ただそれを生成するだけですENOENT
。