Skip to content

skip_chrooted regression in 258 affects arch-chroot, pacstrap, archinstall, etc

Description:

After systemd 258 was released, archinstall started failing when running commands like /usr/bin/arch-chroot /mnt systemctl enable systemd-zram-setup@zram0.service.

I compared the output of archinstall with systemd 257.9 and 258 and noticed that various pacman hooks that used to be skipped are now being executed.

v257.9:

( 8/15) Reloading device manager configuration...
  Skipped: Running in chroot.

v258:

( 8/15) Reloading device manager configuration...
LNXSYSTM:00: Failed to write 'change' to '/sys/devices/LNXSYSTM:00/uevent': Read-only file system

Skipping no longer seems to work because the exit code of systemd-detect-virt --chroot is now different inside of arch-chroot.

v257.9:

# systemd-detect-virt
container-other
# systemd-detect-virt --chroot
# echo $?
0

v258:

# systemd-detect-virt
container-other
# systemd-detect-virt --chroot
# echo $?
1

Additional info:

I ran these tests with KVM + QEMU.

  • package version(s): systemd 258-1
  • config and/or log files:
  • link to upstream bug report, if any:

Steps to reproduce:

  1. Run systemd-detect-virt --chroot inside arch-chroot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information