1 This patch adds a new configuration option (overlay_root) specifying
2 what mount point opkg should check for available storage space.
4 Signed-off-by: Nicolas Thill <nico@openwrt.org>
7 --- a/libopkg/opkg_conf.c
8 +++ b/libopkg/opkg_conf.c
10 { "noaction", OPKG_OPT_TYPE_BOOL, &_conf.noaction },
11 { "nodeps", OPKG_OPT_TYPE_BOOL, &_conf.nodeps },
12 { "offline_root", OPKG_OPT_TYPE_STRING, &_conf.offline_root },
13 + { "overlay_root", OPKG_OPT_TYPE_STRING, &_conf.overlay_root },
14 { "proxy_passwd", OPKG_OPT_TYPE_STRING, &_conf.proxy_passwd },
15 { "proxy_user", OPKG_OPT_TYPE_STRING, &_conf.proxy_user },
16 { "query-all", OPKG_OPT_TYPE_BOOL, &_conf.query_all },
17 --- a/libopkg/opkg_conf.h
18 +++ b/libopkg/opkg_conf.h
21 int nodeps; /* do not follow dependences */
27 --- a/libopkg/opkg_install.c
28 +++ b/libopkg/opkg_install.c
30 if (conf->force_space || pkg->installed_size == 0)
33 - root_dir = pkg->dest ? pkg->dest->root_dir :
34 - conf->default_dest->root_dir;
35 + root_dir = pkg->dest
36 + ? pkg->dest->root_dir
37 + : conf->overlay_root
38 + ? conf->overlay_root
39 + : conf->default_dest->root_dir;
40 kbs_available = get_available_kbytes(root_dir);
42 pkg_size_kbs = (pkg->installed_size + 1023)/1024;