images/archlinux: run chroot in new PID namespace
gpg-agent remains after exit, and causes umount to fail.
Mirrors what was done in arch-chroot:
2be79c6259
This commit is contained in:
parent
2b0d4e25cb
commit
9668eb0856
|
@ -34,12 +34,14 @@ pacstrap -G root base base-devel git mercurial openssh mkinitcpio linux syslinux
|
|||
|
||||
run_root() {
|
||||
local cmd="$@"
|
||||
chroot $root /bin/bash -c "$cmd"
|
||||
# Run in a PID namespace to tear down processes remaining in the chroot on
|
||||
# exit (e.g. gpg-agent)
|
||||
unshare --fork --pid chroot $root /bin/bash -c "$cmd"
|
||||
}
|
||||
|
||||
run_normal() {
|
||||
local cmd="$@"
|
||||
chroot $root sudo -u build -g build \
|
||||
unshare --fork --pid chroot $root sudo -u build -g build \
|
||||
/bin/bash -c "cd /home/build && $cmd"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue