From 525ba822dcbaf125e30a58cd0af5747d660ff3fa Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 10 Jun 2014 17:25:04 +0100 Subject: Load btrfs kernel module when entering chroot Otherwise, weird errors occur when deploying to rawdisk: Error creating disk image2014-06-10 16:00:40 [devel-system-x86_64-generic][my-raw-disk-image][rawdisk.write]Failure to create disk image at /src/tmp/testdev.img ERROR: Command failed: mount -o loop /src/tmp/testdev.img /src/tmp/deployments/tmpQ7wXO1/tmp4lVDcu/tmpvHSzDE mount: mounting /dev/loop0 on /src/tmp/deployments/tmpQ7wXO1/tmp4lVDcu/tmpvHSzDE failed: Device or resource busy --- enter-baserock | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/enter-baserock b/enter-baserock index 4ce2b52..b4b73ff 100755 --- a/enter-baserock +++ b/enter-baserock @@ -39,6 +39,14 @@ fi cd / +if ! grep -q btrfs /proc/filesystems; then + echo "No btrfs support detected in kernel, attempting to load btrfs module" + if ! sudo -p "Password (to run 'modprobe -v btrfs'): " modprobe -v btrfs; then + echo "Loading module failed, looks like your kernel doesn't support Btrfs." + echo "Deploying systems to Btrfs disk images will not work correctly." + fi +fi + if test "x$SSH_AUTH_SOCK" != "x"; then echo "Forwarding SSH agent into chroot" TDIR=$(mktemp --tmpdir=/tmp -d) -- cgit v1.2.1