I’m trying to arch-chroot after performing a pacstrap and it is leading to a segmentation fault.
This is happening on pacstraps on mounted folders, loop devices and even micro SD cards.
The issue occurs on both arm and x64.
Here are the steps to reproduce. You need the arch-install-scripts package to run these commands. The package provides both pacstrap and arch-chroot commands.
mkdir -p MP
sudo mount --bind MP MP
sudo pacstrap -G MP base linux
sudo arch-chroot MP
Here is the error message. This didn’t happen a few weeks ago.
I’ve even tried downgrading arch-install-scripts, and the error still occurs. arch-chroot is still working on existing installs and chroots created via systemd-nspawn.
I’m looking for the reason this is occurring and any possible fixes.
arch-chroot() {
(( EUID == 0 )) || die 'This script must be run with root privileges'
[[ -d $chrootdir ]] || die "Can't create chroot on non-directory %s" "$chrootdir"
$setup "$chrootdir" || die "failed to setup chroot %s" "$chrootdir"
chroot_add_resolv_conf "$chrootdir" || die "failed to setup resolv.conf"
if ! mountpoint -q "$chrootdir"; then
warning "$chrootdir is not a mountpoint. This may have undesirable side effects."
fi
chroot_args=()
[[ $userspec ]] && chroot_args+=(--userspec "$userspec")
SHELL=/bin/bash $pid_unshare chroot "${chroot_args[@]}" -- "$chrootdir" "${args[@]}"
}
You can’t chroot directly into a folder. It causes issues with pacman etc, and also throws an error when you try to do so.
It’s to create a mount point from a folder.
I don’t think that’s the problem since I tried it on an external storage device (micro SD card) and loop device which doesn’t need that line.
I did the same a few hours ago and it didn’t work and @joekamprad tried it yesterday and had the same error.
Let me update and try again now.
(Same error)
Here is the output of strace arch-chroot MP. I don’t know how to interpret it: https://0x0.st/oY3l.txt
The error is also occurring on a fresh install in VBox VM I did on Saturday too.