-@@ -470,12 +470,15 @@
- * my diddling with the .opk file size below isn't going to cut it.
- * 3) return a proper error code instead of 1
- */
-- int comp_size, blocks_available;
-+ int comp_size, blocks_available = -1;
- char *root_dir;
-
- if (!conf->force_space && pkg->installed_size != NULL) {
- root_dir = pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir;
-- blocks_available = get_available_blocks(root_dir);
-+ if (conf->overlay_root != NULL)
-+ blocks_available = get_available_blocks(conf->overlay_root);
-+ if (blocks_available < 0)
-+ blocks_available = get_available_blocks(root_dir);
-
- comp_size = strtoul(pkg->installed_size, NULL, 0);
- /* round up a blocks count without doing fancy-but-slow casting jazz */
---- a/libopkg/opkg_utils.c
-+++ b/libopkg/opkg_utils.c
-@@ -31,10 +31,8 @@