mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
The node container has no udev, so LOOP_CTL_GET_FREE hands out a minor whose /dev node never appears; it also cannot load kernel modules, so those nodes stay dead unless the host carries the loop driver. Materialize the nodes, verify one can actually be attached, and expose the host prerequisite as a bootstrap step instead of failing three hours in with a cryptsetup message. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
23 lines
769 B
Bash
Executable File
23 lines
769 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck shell=bash
|
|
#
|
|
# Load the kernel's loop driver so the swarm backup DR drill can attach its
|
|
# simulated LUKS 'USB'. The drill runs inside a node container that has no
|
|
# udev and cannot load modules itself: it materialises /dev/loopN with mknod,
|
|
# but those nodes are dead until the driver is present on the host. Without
|
|
# it cryptsetup aborts with "loop device with autoclear flag is required"
|
|
# roughly three hours into a swarm round.
|
|
#
|
|
# Use `make kernel-loop-load` rather than calling this script directly.
|
|
|
|
set -euo pipefail
|
|
|
|
modprobe loop
|
|
|
|
if [ ! -c /dev/loop-control ]; then
|
|
echo "FAILURE: /dev/loop-control absent after 'modprobe loop'" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "loop driver ready: $(losetup -a | wc -l) device(s) currently attached"
|