2008-12-15 15:11:12 +02:00
|
|
|
This patch adds a new configuration option (overlay_root) specifying
|
|
|
|
what mount point opkg should check for available storage space.
|
|
|
|
|
|
|
|
Signed-off-by: Nicolas Thill <nico@openwrt.org>
|
|
|
|
|
|
|
|
|
2008-12-21 21:52:14 +02:00
|
|
|
--- a/libopkg/opkg_conf.c
|
|
|
|
+++ b/libopkg/opkg_conf.c
|
2010-01-07 14:37:49 +02:00
|
|
|
@@ -62,6 +62,7 @@
|
|
|
|
{ "download_only", OPKG_OPT_TYPE_BOOL, &_conf.download_only },
|
2009-12-20 23:21:14 +02:00
|
|
|
{ "nodeps", OPKG_OPT_TYPE_BOOL, &_conf.nodeps },
|
|
|
|
{ "offline_root", OPKG_OPT_TYPE_STRING, &_conf.offline_root },
|
|
|
|
+ { "overlay_root", OPKG_OPT_TYPE_STRING, &_conf.overlay_root },
|
|
|
|
{ "proxy_passwd", OPKG_OPT_TYPE_STRING, &_conf.proxy_passwd },
|
|
|
|
{ "proxy_user", OPKG_OPT_TYPE_STRING, &_conf.proxy_user },
|
|
|
|
{ "query-all", OPKG_OPT_TYPE_BOOL, &_conf.query_all },
|
2008-12-21 21:52:14 +02:00
|
|
|
--- a/libopkg/opkg_conf.h
|
|
|
|
+++ b/libopkg/opkg_conf.h
|
2010-01-07 14:37:49 +02:00
|
|
|
@@ -76,6 +76,7 @@
|
2009-12-20 23:21:14 +02:00
|
|
|
int check_signature;
|
|
|
|
int nodeps; /* do not follow dependences */
|
|
|
|
char *offline_root;
|
2008-12-15 15:11:12 +02:00
|
|
|
+ char *overlay_root;
|
|
|
|
int query_all;
|
|
|
|
int verbosity;
|
|
|
|
int noaction;
|
2008-12-21 21:52:14 +02:00
|
|
|
--- a/libopkg/opkg_install.c
|
|
|
|
+++ b/libopkg/opkg_install.c
|
2009-12-22 13:46:49 +02:00
|
|
|
@@ -189,13 +189,19 @@
|
|
|
|
verify_pkg_installable(pkg_t *pkg)
|
|
|
|
{
|
|
|
|
unsigned long kbs_available, pkg_size_kbs;
|
|
|
|
- char *root_dir;
|
|
|
|
+ char *root_dir = NULL;
|
|
|
|
|
2009-12-20 23:21:14 +02:00
|
|
|
if (conf->force_space || pkg->installed_size == 0)
|
|
|
|
return 0;
|
2008-12-15 15:11:12 +02:00
|
|
|
|
2009-12-20 23:21:14 +02:00
|
|
|
- root_dir = pkg->dest ? pkg->dest->root_dir :
|
|
|
|
- conf->default_dest->root_dir;
|
2009-12-22 13:46:49 +02:00
|
|
|
+ if( !pkg->dest || !strcmp(pkg->dest->name, "root") )
|
|
|
|
+ root_dir = conf->overlay_root;
|
|
|
|
+ else
|
|
|
|
+ root_dir = pkg->dest->root_dir;
|
|
|
|
+
|
|
|
|
+ if( !root_dir )
|
|
|
|
+ root_dir = conf->default_dest->root_dir;
|
|
|
|
+
|
2009-12-20 23:21:14 +02:00
|
|
|
kbs_available = get_available_kbytes(root_dir);
|
2008-12-21 21:52:14 +02:00
|
|
|
|
2009-12-20 23:21:14 +02:00
|
|
|
pkg_size_kbs = (pkg->installed_size + 1023)/1024;
|