getsolus / solbuild

The Solus package build system
https://getsol.us
Apache License 2.0
19 stars 12 forks source link

Write our own chroot support using syscall instead of calling `chroot` binary #66

Open joebonrichie opened 7 months ago

joebonrichie commented 7 months ago

Instead of calling out the to the chroot binary write our own chroot support using the syscall.

This should be able to handle stdin and spawn a bash binary.

The main benefit of this is that we can immediately chroot into the $workdir directory instead of /home/user/.

See https://github.com/getsolus/solbuild/commit/f6588495a07e1841893e1acd51a58e08c57b4587 as a starting point, the difference being it'll have to spawn bash and handle stdin.