Running schroot doesn't find files

Schroot is a great tool to run a chroot including virtual filesystems (/proc, /dev, /sys, ...) with normal users. And using Qemu even allows for running something like a VM in a chroot. This is axactly what I try to do: build a set of docker images for aarch64 (Khadas Vim3 Pro) in this chroot.

But schroot fails to find binaries:

schroot -c aarch64-arch -v fails with

[...]
I: »99check setup-start ok« started
I: [Chroot aarch64-arch-18c26d9c-bae4-4157-b4a6-a3d1417ff26f] Login-Shell »/bin/zsh« started
F: Execution of »/bin/zsh« failed : File or directory not found
I: »99check setup-stop ok« started
[...]

The file exists. And even running a normal chroot fails. I can start /bin/zsh but it can't find any files with ls. Running Busybox works because it is linked statically. But running other commands fails because the binary is not found - or the dynamic libraries aren't found:

sudo arch-chroot root /usr/bin/qemu-aarch64-static /bin/sh

I don't think I am a noop. But it feels like this because I am out of options.

Who is willing to start a challange with me? Any help/support/hint is highly appreciated!

Posted Dec 26, 2021, 4:01 PM UTC

11
clevariusOP•

Running Qemu with -strace shows:

newfstatat(AT_FDCWD,"/home/michael/bin/pacman",0x00000055007ffe30,0) = -1 errno=2 (No such file or directory) 1 newfstatat(AT_FDCWD,"/usr/local/bin/pacman",0x00000055007ffe30,0) = -1 errno=2 (No such file or directory) 1 newfstatat(AT_FDCWD,"/usr/bin/pacman",0x00000055007ffe30,0) = 0 1 rt_sigprocmask(SIG_BLOCK,0x00000000004ffc50,0x00000055007fff40) = 0 1 rt_sigprocmask(SIG_BLOCK,0x00000000004ffc48,0x00000055007ffe80) = 0 1 clone(0x11,child_stack=0x0000000000000000,parent_tidptr=0x0000000000000000,tls=0x0000000000000008,child_tidptr=0x00000000000004ff) = 5 1 rt_sigprocmask(SIG_SETMASK,0x00000055007ffe80,NULL) = 0 1 rt_sigprocmask(SIG_SETMASK,0x00000055007fff40,NULL) = 0 1 setpgid(5,5) = 0 1 clone(0x11,child_stack=0x0000000000000000,parent_tidptr=0x0000000000000000,tls=0x0000000000000008,child_tidptr=0x00000000000004ff) = 0 5 gettid() = 5 5 rt_sigprocmask(SIG_SETMASK,0x00000055007ffe80,NULL) = 0 5 rt_sigprocmask(SIG_SETMASK,0x00000055007fff40,NULL) = 0 5 getpid() = 5 5 setpgid(0,5) = 0 5 ioctl(10,TIOCSPGRP,5) = 0 5 rt_sigaction(20,0x00000055007ffe10,NULL) = 0 5 rt_sigaction(SIGTTOU,0x00000055007ffe10,NULL) = 0 5 rt_sigaction(SIGINT,NULL,0x00000055007ffe30) = 0 5 rt_sigaction(SIGTERM,NULL,0x00000055007ffe30) = 0 5 rt_sigaction(SIGQUIT,0x00000055007ffe10,NULL) = 0 5 execve("/usr/bin/pacman",{"pacman",NULL}) = -1 errno=2 (No such file or directory) 5 execve("/bin/pacman",{"pacman",NULL}) = -1 errno=2 (No such file or directory) 5 execve("/usr/local/sbin/pacman",{"pacman",NULL}) = -1 errno=2 (No such file or directory) 5 execve("/usr/bin/site_perl/pacman",{"pacman",NULL}) = -1 errno=2 (No such file or directory) 5 execve("/usr/bin/vendor_perl/pacman",{"pacman",NULL}) = -1 errno=2 (No such file or directory) 5 execve("/usr/bin/core_perl/pacman",{"pacman",NULL}) = -1 errno=2 (No such file or directory) /bin/sh: 5 writev(2,0x55007ffb40,0x2) = 9 pacman: not found5 writev(2,0x55007ffc40,0x2) = 17

1