From 8ca7faa0bbc91f11a38295b2def649af75cc02cb Mon Sep 17 00:00:00 2001 From: Derek Smith Date: Sat, 18 Mar 2023 11:03:53 -0400 Subject: [PATCH] Add support for loading base jammy image from disk --- create_lxc_base.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/create_lxc_base.sh b/create_lxc_base.sh index f482879..f423478 100755 --- a/create_lxc_base.sh +++ b/create_lxc_base.sh @@ -10,7 +10,14 @@ if ! lxc image list --format csv --columns l | grep -q "$UBUNTU_BASE_IMAGE_NAME" # if the image doesn't exist, download it from Ubuntu's image server # TODO see if we can fetch this file from a more censorship-resistant source, e.g., ipfs # we don't really need to cache this locally since it gets continually updated upstream. + if [ -d "$SS_JAMMY_PATH" ]; then + lxc image import "$SS_JAMMY_PATH/meta-bf1a2627bdddbfb0a9bf1f8ae146fa794800c6c91281d3db88c8d762f58bd057.tar.xz" \ + "$SS_JAMMY_PATH/bf1a2627bdddbfb0a9bf1f8ae146fa794800c6c91281d3db88c8d762f58bd057.qcow2" \ + --alias "$UBUNTU_BASE_IMAGE_NAME" + else + # copy the image down from canonical. lxc image copy "images:$BASE_LXC_IMAGE" "$REMOTE_NAME": --alias "$UBUNTU_BASE_IMAGE_NAME" --public --vm --auto-update + fi fi # If the lxc VM does exist, then we will delete it (so we can start fresh)