mirror of
https://github.com/theupriser/steamify-cachyos-dev.git
synced 2026-10-05 12:45:56 +02:00
fix: vminstall.sh sets up the ISO's loop device under a lock (parallel installs collided)
This commit is contained in:
1 parent
7dd659dc09
commit
9d537406bb
1 file changed
+3
@@ -85,6 +85,8 @@ echo "ISO: $iso key: $VM_SSH_KEY"
|
|||||||
# --- The ISO's kernel and initramfs, to boot it with our parameters.
|
# --- The ISO's kernel and initramfs, to boot it with our parameters.
|
||||||
boot="$VM_DIR/iso-boot"
|
boot="$VM_DIR/iso-boot"
|
||||||
mkdir -p "$boot"
|
mkdir -p "$boot"
|
||||||
|
# One loop setup at a time: parallel installs (vmtest.sh --install) otherwise get "Device or resource busy".
|
||||||
|
exec 9> /tmp/vminstall-iso.lock; flock 9
|
||||||
if ! command -v udisksctl >/dev/null && [[ $EUID -eq 0 ]]; then
|
if ! command -v udisksctl >/dev/null && [[ $EUID -eq 0 ]]; then
|
||||||
# No udisks (the WSL box, as root): a plain loop device and mount.
|
# No udisks (the WSL box, as root): a plain loop device and mount.
|
||||||
loop="$(losetup -f -r -P --show "$iso")"
|
loop="$(losetup -f -r -P --show "$iso")"
|
||||||
@@ -109,6 +111,7 @@ install -m 644 "$mnt/arch/boot/x86_64/vmlinuz-linux-cachyos" "$mnt/arch/boot/x86
|
|||||||
search="$(grep -rhoE 'archisosearchuuid=[^ ]+' "$mnt/boot" "$mnt/EFI" 2>/dev/null | head -1)"
|
search="$(grep -rhoE 'archisosearchuuid=[^ ]+' "$mnt/boot" "$mnt/EFI" 2>/dev/null | head -1)"
|
||||||
[[ -n "$search" ]] || { echo "No archisosearchuuid in the ISO's boot menu." >&2; exit 1; }
|
[[ -n "$search" ]] || { echo "No archisosearchuuid in the ISO's boot menu." >&2; exit 1; }
|
||||||
cleanup_loop; trap - EXIT
|
cleanup_loop; trap - EXIT
|
||||||
|
flock -u 9; exec 9>&-
|
||||||
|
|
||||||
# --- What the live system fetches from the host.
|
# --- What the live system fetches from the host.
|
||||||
www="$VM_DIR/install-www"
|
www="$VM_DIR/install-www"
|
||||||
|
|||||||
Reference in new issue
Block a user