Commit c49a11f0 authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

Merge branch 'partscan-race-condition' into 'master'

Workaround race condition in the partition scanning logic

Closes #114

See merge request archlinux/arch-boxes!126
parents bdfcc5d8 80a38fd7
Pipeline #1907 passed with stages
in 24 minutes and 17 seconds
......@@ -49,6 +49,8 @@ function setup_disk() {
"${IMAGE}"
LOOPDEV=$(losetup --find --partscan --show "${IMAGE}")
# Partscan is racy
until test -e "${LOOPDEV}p2"; do true; done
mkfs.btrfs "${LOOPDEV}p2"
mount -o compress-force=zstd "${LOOPDEV}p2" "${MOUNT}"
}
......@@ -101,6 +103,8 @@ function image_cleanup() {
# Mount image helper (loop device + mount)
function mount_image() {
LOOPDEV=$(losetup --find --partscan --show "${1:-${IMAGE}}")
# Partscan is racy
until test -e "${LOOPDEV}p2"; do true; done
mount -o compress-force=zstd "${LOOPDEV}p2" "${MOUNT}"
# Setup bind mount to package cache
mount --bind "/var/cache/pacman/pkg" "${MOUNT}/var/cache/pacman/pkg"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment