mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 14:13:16 +00:00
608de32479
SVN-Revision: 18864
43 lines
1.4 KiB
Diff
43 lines
1.4 KiB
Diff
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>
|
|
|
|
|
|
--- a/libopkg/opkg_conf.c
|
|
+++ b/libopkg/opkg_conf.c
|
|
@@ -58,6 +58,7 @@
|
|
{ "noaction", OPKG_OPT_TYPE_BOOL, &_conf.noaction },
|
|
{ "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 },
|
|
--- a/libopkg/opkg_conf.h
|
|
+++ b/libopkg/opkg_conf.h
|
|
@@ -74,6 +74,7 @@
|
|
int check_signature;
|
|
int nodeps; /* do not follow dependences */
|
|
char *offline_root;
|
|
+ char *overlay_root;
|
|
int query_all;
|
|
int verbosity;
|
|
int noaction;
|
|
--- a/libopkg/opkg_install.c
|
|
+++ b/libopkg/opkg_install.c
|
|
@@ -194,8 +194,11 @@
|
|
if (conf->force_space || pkg->installed_size == 0)
|
|
return 0;
|
|
|
|
- root_dir = pkg->dest ? pkg->dest->root_dir :
|
|
- conf->default_dest->root_dir;
|
|
+ root_dir = pkg->dest
|
|
+ ? pkg->dest->root_dir
|
|
+ : conf->overlay_root
|
|
+ ? conf->overlay_root
|
|
+ : conf->default_dest->root_dir;
|
|
kbs_available = get_available_kbytes(root_dir);
|
|
|
|
pkg_size_kbs = (pkg->installed_size + 1023)/1024;
|