X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/5e52855bff5a4ccadebaaf4b46adc5a62b5294db..5a304bac4e4bf4e03a75e4f79e1970395a5296b4:/package/opkg/patches/003-fs_overlay_support.patch diff --git a/package/opkg/patches/003-fs_overlay_support.patch b/package/opkg/patches/003-fs_overlay_support.patch index aa8b83ba6..63933bd97 100644 --- a/package/opkg/patches/003-fs_overlay_support.patch +++ b/package/opkg/patches/003-fs_overlay_support.patch @@ -6,8 +6,8 @@ Signed-off-by: Nicolas Thill --- a/libopkg/opkg_conf.c +++ b/libopkg/opkg_conf.c -@@ -58,6 +58,7 @@ - { "noaction", OPKG_OPT_TYPE_BOOL, &_conf.noaction }, +@@ -63,6 +63,7 @@ opkg_option_t options[] = { + { "download_only", OPKG_OPT_TYPE_BOOL, &_conf.download_only }, { "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 }, @@ -16,9 +16,9 @@ Signed-off-by: Nicolas Thill { "query-all", OPKG_OPT_TYPE_BOOL, &_conf.query_all }, --- a/libopkg/opkg_conf.h +++ b/libopkg/opkg_conf.h -@@ -74,6 +74,7 @@ +@@ -78,6 +78,7 @@ struct opkg_conf int check_signature; - int nodeps; /* do not follow dependences */ + int nodeps; /* do not follow dependencies */ char *offline_root; + char *overlay_root; int query_all; @@ -26,22 +26,35 @@ Signed-off-by: Nicolas Thill int noaction; --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c -@@ -189,13 +189,19 @@ +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include "pkg.h" + #include "pkg_hash.h" +@@ -192,13 +193,24 @@ static int verify_pkg_installable(pkg_t *pkg) { unsigned long kbs_available, pkg_size_kbs; - char *root_dir; + char *root_dir = NULL; ++ struct stat s; if (conf->force_space || pkg->installed_size == 0) return 0; - root_dir = pkg->dest ? pkg->dest->root_dir : - conf->default_dest->root_dir; -+ if( !pkg->dest || !strcmp(pkg->dest->name, "root") ) -+ root_dir = conf->overlay_root; -+ else -+ root_dir = pkg->dest->root_dir; ++ if( pkg->dest ) ++ { ++ if( !strcmp(pkg->dest->name, "root") && conf->overlay_root ++ && !stat(conf->overlay_root, &s) && (s.st_mode & S_IFDIR) ) ++ root_dir = conf->overlay_root; ++ else ++ root_dir = pkg->dest->root_dir; ++ } + + if( !root_dir ) + root_dir = conf->default_dest->root_dir;