Skip to content
Snippets Groups Projects
Verified Commit 73086d57 authored by Kristian Klausen's avatar Kristian Klausen :tada:
Browse files

wrapper

parent e2cf2a59
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,11 @@ cleanup() {
rm -r "${tmpdir}"
}
arch-chroot() {
# Workaround https://github.com/archlinux/arch-install-scripts/issues/21
command arch-chroot "${1}" unshare --fork --pid "${@:2}"
}
tmpdir="$(mktemp --directory --tmpdir="/var/tmp")"
trap cleanup EXIT
......@@ -27,13 +32,8 @@ qemu-img convert -f qcow2 -O raw Arch-Linux-x86_64-basic.qcow2 Arch-Linux-x86_64
loopdev="$(losetup --find --partscan --show "${image}")"
mount --mkdir "${loopdev}p2" mnt
arch-chroot mnt bash -e <<'EOF'
pacman-key --init
pacman-key --populate
pid="$(pgrep gpg-agent)"
gpgconf --homedir /etc/pacman.d/gnupg --kill gpg-agent
tail --pid="${pid}" -f /dev/null
EOF
arch-chroot mnt pacman-key --init
arch-chroot mnt pacman-key --populate
# shellcheck disable=SC2016
printf 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' > mnt/etc/pacman.d/mirrorlist
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment