mac80211: fix patch naming
[openwrt.git] / package / opkg / patches / 003-fs_overlay_support.patch
1 This patch adds a new configuration option (overlay_root) specifying
2 what mount point opkg should check for available storage space.
3
4 Signed-off-by: Nicolas Thill <nico@openwrt.org>
5
6
7 --- a/libopkg/opkg_conf.c
8 +++ b/libopkg/opkg_conf.c
9 @@ -62,6 +62,7 @@
10 { "download_only", OPKG_OPT_TYPE_BOOL, &_conf.download_only },
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
19 @@ -76,6 +76,7 @@
20 int check_signature;
21 int nodeps; /* do not follow dependences */
22 char *offline_root;
23 + char *overlay_root;
24 int query_all;
25 int verbosity;
26 int noaction;
27 --- a/libopkg/opkg_install.c
28 +++ b/libopkg/opkg_install.c
29 @@ -189,13 +189,19 @@
30 verify_pkg_installable(pkg_t *pkg)
31 {
32 unsigned long kbs_available, pkg_size_kbs;
33 - char *root_dir;
34 + char *root_dir = NULL;
35
36 if (conf->force_space || pkg->installed_size == 0)
37 return 0;
38
39 - root_dir = pkg->dest ? pkg->dest->root_dir :
40 - conf->default_dest->root_dir;
41 + if( !pkg->dest || !strcmp(pkg->dest->name, "root") )
42 + root_dir = conf->overlay_root;
43 + else
44 + root_dir = pkg->dest->root_dir;
45 +
46 + if( !root_dir )
47 + root_dir = conf->default_dest->root_dir;
48 +
49 kbs_available = get_available_kbytes(root_dir);
50
51 pkg_size_kbs = (pkg->installed_size + 1023)/1024;
This page took 0.046404 seconds and 5 git commands to generate.