diff --git a/prepare.sh b/prepare.sh index cd2a5cd..6f45fa8 100755 --- a/prepare.sh +++ b/prepare.sh @@ -26,11 +26,6 @@ start_container () { lxc restore $CONTAINER_IMAGE $SNAPSHOT_NAME - mkdir -p $current_dir/cache - chmod 777 $current_dir/cache - lxc config device add "$CONTAINER_IMAGE" cache-folder disk path=/cache source="$current_dir/cache" - - lxc stop $CONTAINER_IMAGE || true lxc start $CONTAINER_IMAGE wait_container $CONTAINER_IMAGE diff --git a/rebuild_all.sh b/rebuild_all.sh index 93c399f..4e3a029 100755 --- a/rebuild_all.sh +++ b/rebuild_all.sh @@ -3,6 +3,9 @@ current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" source $current_dir/utils.sh # Get utils functions. +mkdir -p $current_dir/cache +chmod 777 $current_dir/cache + for debian_version in "bullseye" do rebuild_base_containers $debian_version "stable" "amd64" diff --git a/utils.sh b/utils.sh index d470dda..e70e5c3 100755 --- a/utils.sh +++ b/utils.sh @@ -189,6 +189,8 @@ rebuild_base_containers() lxc exec "$base_image_to_rebuild" -- /bin/bash -c "systemctl -q disable apt-daily.service" lxc exec "$base_image_to_rebuild" -- /bin/bash -c "systemctl -q disable apt-daily-upgrade.service" + lxc config device add "$base_image_to_rebuild" cache-folder disk path=/cache source="$current_dir/cache" + create_snapshot "$base_image_to_rebuild" "before-install" # Install YunoHost