source: trunk/package/opkg/patches/003-fs_overlay_support.patch @ 13710

Last change on this file since 13710 was 13710, checked in by nbd, 8 years ago

fix opkg overlay_root option for jffs2-only images

File size: 2.3 KB
  • libopkg/opkg_conf.c

    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 b int opkg_init_options_array(const opkg_c 
    6464          { "offline_root", OPKG_OPT_TYPE_STRING, &conf->offline_root }, 
    6565          { "offline_root_post_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_post_script_cmd }, 
    6666          { "offline_root_pre_script_cmd", OPKG_OPT_TYPE_STRING, &conf->offline_root_pre_script_cmd }, 
     67          { "overlay_root", OPKG_OPT_TYPE_STRING, &conf->overlay_root }, 
    6768          { "proxy_passwd", OPKG_OPT_TYPE_STRING, &conf->proxy_passwd }, 
    6869          { "proxy_user", OPKG_OPT_TYPE_STRING, &conf->proxy_user }, 
    6970          { "query-all", OPKG_OPT_TYPE_BOOL, &conf->query_all }, 
  • libopkg/opkg_conf.h

    a b struct opkg_conf 
    6767     char *offline_root; 
    6868     char *offline_root_pre_script_cmd; 
    6969     char *offline_root_post_script_cmd; 
     70     char *overlay_root; 
    7071     int query_all; 
    7172     int verbosity; 
    7273     int noaction; 
  • libopkg/opkg_install.c

    a b static int verify_pkg_installable(opkg_c 
    524524     *    my diddling with the .opk file size below isn't going to cut it. 
    525525     * 3) return a proper error code instead of 1 
    526526     */ 
    527      int comp_size, blocks_available; 
    528      
     527     int comp_size, blocks_available = -1; 
     528 
    529529     if (!conf->force_space && pkg->installed_size != NULL) { 
    530           blocks_available = get_available_blocks(conf->default_dest->root_dir); 
     530          if (conf->overlay_root != NULL) 
     531               blocks_available = get_available_blocks(conf->overlay_root); 
     532          if (blocks_available < 0) 
     533               blocks_available = get_available_blocks(conf->default_dest->root_dir); 
    531534 
    532535          comp_size = strtoul(pkg->installed_size, NULL, 0); 
    533536          /* round up a blocks count without doing fancy-but-slow casting jazz */  
  • libopkg/opkg_utils.c

    a b int get_available_blocks(char * filesyst 
    3030{ 
    3131     struct statfs sfs; 
    3232 
    33      if(statfs(filesystem, &sfs)){ 
    34           fprintf(stderr, "bad statfs\n"); 
    35           return 0; 
    36      } 
     33     if(statfs(filesystem, &sfs)) 
     34          return -1; 
    3735     /*    fprintf(stderr, "reported fs type %x\n", sfs.f_type); */ 
    3836     return ((sfs.f_bavail * sfs.f_bsize) / 1024); 
    3937} 
Note: See TracBrowser for help on using the repository browser.