Enters chroot with proper bind mounts. Like arch-chroot for Arch.
Sets up mounts, runs your command, cleans up on exit.
Beta. Works for standard installations.
# After recstrap
recstrap /mnt
# Enter chroot (interactive shell)
recchroot /mnt
# Run single command
recchroot /mnt passwd
# Run bootloader install
recchroot /mnt bootctl install- Bind mounts
/proc,/sys,/dev,/run - Bind mounts
/sys/firmware/efi/efivars(if UEFI) - Copies
/etc/resolv.conffor DNS - Runs
chroot <target> <command> - Unmounts everything on exit
- Run installation commands automatically
- Configure the system
- Install bootloader, set passwords, create users
- Any other installation step
| Code | Error |
|---|---|
| 1 | Target does not exist |
| 2 | Not a directory |
| 3 | Can't create mount point |
| 4 | Mount failed |
| 5 | Unmount failed (warning) |
| 6 | Command failed |
| 7 | Not root |
| 8 | Protected path |
Cannot chroot into:
/, /bin, /boot, /dev, /etc, /home, /lib, /lib64, /opt, /proc, /root, /run, /sbin, /srv, /sys, /tmp, /usr, /var
- Linux (uses Linux mount syscalls)
- Root privileges
- Valid Linux filesystem at target
cargo build --releaseMIT