home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 May / pcp151c.iso / misc / src / install / modutils / depmod / modprobe.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-06  |  15.8 KB  |  812 lines

  1. /* Copyright 1997 Free Software Foundation, Inc.
  2.    Contributed by Marcin Dalecki <dalecki@sub994.sub.uni-goettingen.de>
  3.  
  4.    This file is part of the Linux modutils.
  5.  
  6.    This program is free software; you can redistribute it and/or modify it
  7.    under the terms of the GNU General Public License as published by the
  8.    Free Software Foundation; either version 2 of the License, or (at your
  9.    option) any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful, but
  12.    WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.    General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software Foundation,
  18.    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  19.  
  20. #ident "$Id: modprobe.c,v 1.1.1.1 1998/01/06 20:51:07 ewt Exp $"
  21.  
  22. #include <stdio.h>
  23. #include <stdarg.h>
  24. #include <string.h>
  25. #include <errno.h>
  26. #include <stdlib.h>
  27. #include <ctype.h>
  28. #include <sys/param.h>
  29. #include <getopt.h>
  30. #include <sys/stat.h>
  31.  
  32. #include "module.h"
  33. #include "util.h"
  34.  
  35. #include "misc.h"
  36. #include "conf_file.h"
  37.  
  38. /*
  39.  * This is the actual modprobe specific part.
  40.  *
  41.  * The general convention throughout this file is that functions ALWAYS
  42.  * return 0 on success and some different value otherwise.
  43.  */
  44.  
  45. struct dep_node
  46.   {
  47.     struct dep_node *next;    /* modules */
  48.     struct dep_node *deps;    /* dependences */
  49.     char *name;
  50.   };
  51.  
  52. /*
  53.  * Command line flags
  54.  */
  55. static char flag_verbose = 0;
  56. static int flag_by_kerneld = 0;
  57.  
  58. #ifndef NO_COMPAT
  59. static int flag_new_syscalls = 0;
  60. #endif
  61.  
  62. /*
  63.  * Dependence information from the configuration file.
  64.  */
  65. static struct dep_node *file_deps = NULL;
  66.  
  67. static void
  68. verbose (const char *ctl,...)
  69. {
  70.   if (flag_verbose)
  71.     {
  72.       va_list list;
  73.       va_start (list, ctl);
  74.       vprintf (ctl, list);
  75.       va_end (list);
  76.       fflush (stdout);
  77.     }
  78. }
  79.  
  80. /*
  81.  * Free the memory associated with an dependency list
  82.  */
  83. static void
  84. deps_free (struct dep_node *node)
  85. {
  86.   if (!node)
  87.     return;
  88.  
  89.   free (node->name);
  90.   deps_free (node->next);
  91.   deps_free (node->deps);
  92.   free (node);
  93. }
  94.  
  95. static struct dep_node *
  96. dep_lookup (struct dep_node *a, const char *name)
  97. {
  98.   if (!a)
  99.     return NULL;
  100.  
  101.   if (strcmp (name, a->name) == 0)
  102.     return a;
  103.  
  104.   return dep_lookup (a->next, name);
  105. }
  106.  
  107. static struct dep_node *
  108. dep_add (struct dep_node *node, const char *name)
  109. {
  110.   struct dep_node *tmp = (struct dep_node *)
  111.   xmalloc (sizeof (struct dep_node));
  112.  
  113.   tmp->name = xstrdup (name);
  114.   tmp->deps = NULL;
  115.   tmp->next = node;
  116.  
  117.   return tmp;
  118. }
  119.  
  120. /*
  121.  *  Check if a given module is already in the kernel space.
  122.  */
  123.  
  124. #ifndef NO_COMPAT
  125.  
  126. static int
  127. old_in_kernel (char *mod)
  128. {
  129.   FILE *f;
  130.   char linebuf[256], *c;
  131.  
  132.   if (!(f = fopen ("/proc/modules", "r")))
  133.     error ("/proc/modules: %m");
  134.  
  135.   while (fgets (linebuf, 256, f))
  136.     {
  137.       c = strchr (linebuf, ' ');
  138.       if (!c)
  139.     error ("/proc/modules: Syntax error");
  140.       *c = 0;
  141.       if (!strcmp (mod, linebuf))
  142.     {
  143.       fclose (f);
  144.       c = strchr (c + 1, '\t');
  145.       if (!c || c[1] != '[')
  146.         return 1;
  147.       else
  148.         return 2;
  149.     }
  150.     }
  151.  
  152.   fclose (f);
  153.   return 0;
  154. }
  155.  
  156. #endif
  157.  
  158. static int
  159. new_in_kernel (char *mod)
  160. {
  161.   char *module_names, *m;
  162.   size_t bufsize, ret, nmod, i;
  163.  
  164.   /* Fetch the list of modules.  */
  165.  
  166.   module_names = xmalloc (bufsize = 1024);
  167. retry_mod_load:
  168.   if (query_module (NULL, QM_MODULES, module_names, bufsize, &ret))
  169.     {
  170.       if (errno == ENOSPC)
  171.     {
  172.       module_names = xrealloc (module_names, bufsize = ret);
  173.       goto retry_mod_load;
  174.     }
  175.       error ("QM_MODULES: %m");
  176.       return 0;
  177.     }
  178.   nmod = ret;
  179.  
  180.   for (i = 0, m = module_names; i < nmod; ++i, m += strlen (m) + 1)
  181.     if (!strcmp (m, mod))
  182.       {
  183.     free (mod);
  184.     free (module_names);
  185.     return 1;
  186.       }
  187.  
  188.   free (mod);
  189.   free (module_names);
  190.   return 0;
  191. }
  192.  
  193. static int
  194. in_kernel (char *mod)
  195. {
  196.   mod = strip_o (mod);
  197. #ifndef NO_COMPAT
  198.   if (!flag_new_syscalls)
  199.     return old_in_kernel (mod);
  200.   else
  201. #endif
  202.     return new_in_kernel (mod);
  203. }
  204.  
  205. /*
  206.  * Read the dependancy file.
  207.  */
  208. static int
  209. read_deps_file (const char *cfgfile)
  210. {
  211.   int line = 0;
  212.   char *buf;
  213.   char *end;
  214.   char *tmp;
  215.   char linebuf [8192];
  216.  
  217.   if (!(buf = read_and_preprocess_file (cfgfile)))
  218.     return 1;
  219.  
  220.   /*
  221.    * And now parse the buffer.
  222.    */
  223.   for (tmp = buf; (end = get_concat_line (tmp, &line)); tmp = end)
  224.     {
  225.       char *cp;
  226.  
  227.       if (!*tmp)        /* ignore blank lines */
  228.     continue;
  229.  
  230.       tmp = resolve_string (tmp, linebuf, sizeof (linebuf));
  231.  
  232.       if (!(cp = strchr (tmp, ':')))
  233.     {
  234.       free (buf);
  235.       error (":%d:parsing error in dependeny file\n", line);
  236.       return 1;        /* parsing error */
  237.     }
  238.       if ((cp > tmp) && *(cp - 1) == ' ')
  239.     *(cp - 1) = '\0';
  240.       *cp = '\0';
  241.  
  242.       /* name found */
  243.       file_deps = dep_add (file_deps, tmp);
  244.  
  245.       tmp = cp + 1;
  246.       while ((cp = strrchr (tmp, ' ')))
  247.     {
  248.       *cp = '\0';
  249.       file_deps->deps = dep_add (file_deps->deps, cp + 1);
  250.     }
  251.     }
  252.   free (buf);
  253.   return 0;
  254. }
  255.  
  256. static int
  257. exec_rmmod_cmd (char *mod)
  258. {
  259.   int ret = 0;
  260.   char *ex;
  261.   mod = strip_o (mod);
  262.  
  263.   if ((ex = find_assoc_cmd (PRE_REMOVE, mod)) != NULL)
  264.     if (system (ex))
  265.       lprintf ("pre-remove %s failed\n", mod);
  266.  
  267.   if ((ex = find_assoc_cmd (REMOVE, mod)) != NULL)
  268.     {
  269.       if ((ret = system (ex)))
  270.     lprintf ("remove %s failed\n", mod);
  271.     }
  272.   else if ((ret = delete_module (mod)) < 0)
  273.     {
  274.       ret = 1;
  275.       perror (mod);
  276.     }
  277.  
  278.   if (!ret && (ex = find_assoc_cmd (POST_REMOVE, mod)) != NULL)
  279.     {
  280.       if (system (ex) != 0)
  281.     lprintf ("post-remove %s failed\n", mod);
  282.     }
  283.  
  284.   free (mod);
  285.   return ret;
  286. }
  287.  
  288. /*
  289.  * Unload all sub-modules in reverse order.
  290.  */
  291. static int
  292. rm_sub_mods (struct dep_node *nod)
  293. {
  294.   int ret = 0;
  295.   if (nod != NULL)
  296.     if (!(ret = rm_sub_mods (nod->next)))
  297.       ret = exec_rmmod_cmd (nod->name);
  298.  
  299.   return ret;
  300. }
  301.  
  302. /*
  303.  * Return the options associated with a module.
  304.  * Return NULL if there are none.
  305.  */
  306. static char *
  307. any_options (char *mod)
  308. {
  309.   char *modname = strip_o (mod);
  310.   struct mod_option *opts;
  311.  
  312.   for (opts = mod_options; opts; opts = opts->next)
  313.     if (!strcmp (opts->module, modname))
  314.       return opts->args;
  315.  
  316.   return NULL;
  317. }
  318.  
  319. int
  320. may_unload(char *mod)
  321. {
  322.   char *modname = strip_o (mod);
  323.   struct mod_option *opts;
  324.  
  325.   for (opts = mod_options; opts; opts = opts->next)
  326.     if (!strcmp (opts->module, modname))
  327.       return opts->may_unload;
  328.  
  329.   return 1;
  330. }
  331.  
  332. /*
  333.  * Try to load a module and the sub-modules it needs.
  334.  */
  335. static int
  336. insmod (char *mod, struct dep_node **newin_kernel, char *options[])
  337. {
  338.   int err = 0;
  339.   struct dep_node *dep;
  340.   struct dep_node *nod;
  341.   char *load_cmd;
  342.   int cmd_len;
  343.   char *op;
  344.   char *ex;
  345.   int i;
  346.  
  347.   if (!mod)
  348.     return 0;
  349.  
  350.   if (in_kernel (mod))
  351.     return 0;
  352.  
  353.   if (!(nod = dep_lookup (file_deps, mod)))
  354.     {
  355.       lprintf ("no dependency information for module: \"%s\"", mod);
  356.       return 1;
  357.     }
  358.  
  359.   dep = nod->deps;
  360.   while (dep && !err)
  361.     {
  362.       err = insmod (dep->name, newin_kernel, NULL);
  363.       dep = dep->next;
  364.     }
  365.  
  366.   if (err)
  367.     {
  368.       rm_sub_mods (nod->deps);    /* revert everything */
  369.       return 1;
  370.     }
  371.  
  372.   /*
  373.    * First determine the length of the command we will use.
  374.    */
  375.   cmd_len = 64 + strlen (mod);
  376.   if (options && options[1] && strchr (options[1], '='))
  377.     for (i = 1; options[i]; ++i)
  378.       if (strchr (options[i], '='))
  379.     cmd_len += strlen (options[i]) + 2;
  380.       else
  381.     break;
  382.   else
  383.     {
  384.       if ((op = any_options (mod)))
  385.     cmd_len += strlen (op) + 2;
  386.       if (options && options[0] && (op = any_options (options[0])))
  387.     cmd_len += strlen (op) + 2;
  388.     }
  389.  
  390.   /*
  391.    * And now actually compose the command!
  392.    */
  393.   load_cmd = (char *) xmalloc (cmd_len);
  394.  
  395.   strcpy (load_cmd, "/sbin/insmod ");
  396.   if (flag_by_kerneld && may_unload(mod))
  397.     strcat (load_cmd, "-k ");
  398.   if (log)
  399.     strcat (load_cmd, "-s ");
  400.   if (insmod_opts)
  401.     {
  402.       strcat (load_cmd, insmod_opts);
  403.       strcat (load_cmd, " ");
  404.     }
  405.   strcat (load_cmd, mod);
  406.  
  407.   if (options && options[1] && strchr (options[1], '='))
  408.     for (i = 1; options[i]; ++i)
  409.       {
  410.     if (strchr (options[i], '='))
  411.       {
  412.         strcat (load_cmd, " ");
  413.         strcat (load_cmd, options[i]);
  414.       }
  415.     else
  416.       break;
  417.       }
  418.   else
  419.     {
  420.       if ((op = any_options (mod)))
  421.     {
  422.       strcat (load_cmd, " ");
  423.       strcat (load_cmd, op);
  424.     }
  425.       if (options && options[0] &&
  426.       (op = any_options (options[0])))
  427.     {
  428.       strcat (load_cmd, " ");
  429.       strcat (load_cmd, op);
  430.     }
  431.     }
  432.   verbose ("\r%s\n\t\t", load_cmd);
  433.  
  434.   if ((ex = find_assoc_cmd (PRE_INSTALL, mod)) != NULL)
  435.     if ((err = system (ex)) != 0)
  436.       lprintf ("pre-install %s failed\n", mod);
  437.  
  438.   if (!err)
  439.     {
  440.       if ((ex = find_assoc_cmd (INSTALL, mod)) != NULL)
  441.     err = system (ex);
  442.       else
  443.     err = system (load_cmd);
  444.     }
  445.  
  446.   if (!err && (ex = find_assoc_cmd (POST_INSTALL, mod)) != NULL)
  447.     if ((err = system (ex)) != 0)
  448.       lprintf ("post-install %s failed\n", mod);
  449.  
  450.   free (load_cmd);
  451.  
  452.   if (err)
  453.     {
  454.       rm_sub_mods (nod->deps);
  455.       return 1;
  456.     }
  457.  
  458.   *newin_kernel = dep_add (*newin_kernel, mod);
  459.  
  460.   return 0;
  461. }
  462.  
  463. /*
  464.  * Check if a module is referenced by something else
  465.  */
  466.  
  467. static int
  468. is_removable (char *mod)
  469. {
  470.   mod = strip_o (mod);
  471.  
  472. #ifndef NO_COMPAT
  473.   if (!flag_new_syscalls)
  474.     return (old_in_kernel (mod) == 1);
  475.   else
  476. #endif
  477.     {
  478.       size_t ret;
  479.  
  480.       if (!in_kernel (mod))
  481.     return 0;
  482.       query_module (mod, QM_REFS, NULL, 0, &ret);
  483.       return ret == 0;
  484.     }
  485. }
  486.  
  487. /*
  488.  * Unload a module and whichever modules where required by this module.
  489.  */
  490. static int
  491. unload (char *mod)
  492. {
  493.   int ret = 0;
  494.   struct mod_path *objs = NULL;
  495.   struct mod_path *tmp;
  496.  
  497.   /*
  498.    * Ignore if the module doesn't exist or it's used by someone else.
  499.    */
  500.  
  501.   if (!mod || !is_removable (mod))
  502.     return 0;
  503.  
  504.   /*
  505.    * If there is no information about a module in
  506.    * the dependancy file, we remove it without further checking.
  507.    */
  508.   if (!(objs = locate_mod_obj (mod, NULL)) || objs == (void *) (-1))
  509.     return delete_module (strip_o (mod));
  510.  
  511.   /*
  512.    * Otherwise we try to kill all instantations of it.
  513.    */
  514.   ret = 0;
  515.   for (tmp = objs; tmp; tmp = tmp->next)
  516.     if (in_kernel (tmp->path))
  517.       {
  518.     struct dep_node *nod;
  519.  
  520.     if (!(nod = dep_lookup (file_deps, tmp->path)))
  521.       lprintf ("no dependency information for module %s", mod);
  522.     else
  523.       {
  524.         struct dep_node *deps;
  525.  
  526.         ret = exec_rmmod_cmd (tmp->path);
  527.  
  528.         for (deps = nod->deps; deps; deps = deps->next)
  529.           unload (deps->name);
  530.       }
  531.       }
  532.  
  533.   while ((tmp = objs))
  534.     {
  535.       objs = objs->next;
  536.       free (tmp->path);
  537.       free (tmp);
  538.     }
  539.   return 0;
  540. }
  541.  
  542. /*
  543.  * Load modules specified on the command line
  544.  */
  545. static int
  546. load_from_list (char *list[], int n, char *type, int loadall)
  547. {
  548.   int ret = 1;
  549.   int i;
  550.  
  551.   for (i = 0; i < n; i++)
  552.     {
  553.       struct dep_node *kernel_deps = NULL;
  554.  
  555.       /*
  556.        * We can pass options to the module via modprobe's command line.
  557.        * It goes like this:
  558.        * /sbin/modprobe module opt1=value opt2=value [ othermodule ...]
  559.        * An option is a keyword followed by an equal sign and a value.
  560.        * No spaces are allowed in the sequence, unless it is quoted.
  561.        *
  562.        * The option list ends at the end of the list or at the
  563.        * first non-option argument (a module).
  564.        */
  565.       if (strchr (list[i], '=') == NULL)
  566.     {
  567.       struct mod_path *objs = NULL;
  568.       struct mod_path *tmp;
  569.  
  570.       objs = locate_mod_obj (list[i], type);
  571.       if (!objs)
  572.         lprintf ("can't locate module %s", list[i]);
  573.       else if (objs != (void *) (-1))
  574.         {
  575.           for (tmp = objs; tmp; tmp = tmp->next)
  576.         {
  577.           if (insmod (tmp->path, &kernel_deps, &list[i]) == 0)
  578.             {
  579.               ret = 0;
  580.               if (!loadall)    /* stop after fist success */
  581.             break;
  582.             }
  583.         }
  584.           while ((tmp = objs))
  585.         {
  586.           objs = objs->next;
  587.           free (tmp->path);
  588.           free (tmp);
  589.         }
  590.         }
  591.     }
  592.  
  593.       deps_free (kernel_deps);
  594.       kernel_deps = NULL;
  595.  
  596.       if (ret == 0 && !loadall)
  597.     break;
  598.     }
  599.  
  600.   return ret;
  601. }
  602.  
  603. /*
  604.  * Print all available modules matching "pattern" and of a certain type.
  605.  */
  606. static void
  607. print_list (const char *pattern, const char *type)
  608. {
  609.   struct mod_path *mods = NULL;
  610.   struct mod_path *tmp;
  611.  
  612.   mods = find_matching_mods (pattern, type, 1);
  613.   while ((tmp = mods))
  614.     {
  615.       printf ("%s\n", mods->path);
  616.       mods = mods->next;
  617.       free (tmp->path);
  618.       free (tmp);
  619.     }
  620. }
  621.  
  622. /*
  623.  * Print usage information and exit.
  624.  */
  625. static void
  626. usage (void)
  627. {
  628.   printf ("Usage: modprobe [-a] [ -t TYPE ] MODULE [opt=val ...] ...\n"
  629.       "       modprobe -c\n"
  630.       "Load MODULE_1 MODULE_2, and modules needed by them\n"
  631.       "with the specified options.\n\n"
  632.       "  -a, --all                  load all modules\n"
  633.       "  -c, --show-conf            show the current modules configuration and exit\n"
  634.       "  -d, --debug                run in debug mode\n"
  635.       "  -k, --kernel-daemon        only used by the kernel daemon\n"
  636.       "  -l, --list                 list currently available modules\n"
  637.       "  -r, --remove               unload modules from the kernel\n"
  638.   "  -s, --system-log           use the system logging for error reporting\n"
  639.       "  -t TYPE,\n"
  640.     "  -type TYPE                 restrict actions to modules of the TYPE\n"
  641.       "      --help                 display this help and exit\n"
  642.       "  -v, --verbose              run in verbose mode\n"
  643.     "  -V, --version              output version information and exit\n"
  644.       "\n"
  645.     );
  646. }
  647.  
  648. static void
  649. nothing (const char *str)
  650. {
  651.   lprintf ("argument missing for %s\n"
  652.      "Please specify at least one module or a wildcard like \\*.", str);
  653. }
  654.  
  655.  
  656. int
  657. main (int argc, char *argv[])
  658. {
  659.   int ret = 0;
  660.   char *type = NULL;        /* Search in all path[] */
  661.  
  662.   int flag_remove = 0;
  663.   int flag_list = 0;
  664.   int flag_load_all = 0;    /* Load only one module out of a list */
  665.  
  666.   int opt_tag;
  667.  
  668.   if (argc == 1)
  669.     {
  670.       usage ();
  671.       return 1;
  672.     }
  673.  
  674.   if (read_config_file (NULL))
  675.     return 1;
  676.  
  677.   if (read_deps_file (depfile))
  678.     return 1;
  679.  
  680.   /*
  681.    * Yes we are using getopts!
  682.    */
  683.   while (1)
  684.     {
  685.       static struct option long_opts[] =
  686.       {
  687.     {"all", 0, 0, 'a'},
  688.     {"show-conf", 0, 0, 'c'},
  689.     {"debug", 0, 0, 'd'},
  690.     {"kernel-daemon", 0, 0, 'k'},
  691.     {"list", 0, 0, 'l'},
  692.     {"remove", 0, 0, 'r'},
  693.     {"system-log", 0, 0, 's'},
  694.     {"type", 1, 0, 't'},
  695.     {"verbose", 0, 0, 'v'},
  696.     {"version", 0, 0, 'V'},
  697.     {"help", 0, 0, 'h'},
  698.     {0, 0, 0, 0}        /* Table end tag */
  699.       };
  700.       int opt_ind = 0;
  701.  
  702.       opt_tag = getopt_long (argc, argv, "acklrst:vV", long_opts,
  703.                  &opt_ind);
  704.       if (opt_tag == -1)
  705.     break;
  706.  
  707.       switch (opt_tag)
  708.     {
  709.     case 'a':
  710.       flag_load_all = 1;
  711.       break;
  712.  
  713.     case 'c':
  714.       if (argc != 2)
  715.         {            /* allow it only beeing used exclusive */
  716.           usage ();
  717.           exit (1);
  718.         }
  719.       print_active_config ();    /* show configuration */
  720.       exit (0);
  721.  
  722.     case 'd':
  723.       flag_debug = 1;
  724.       break;
  725.  
  726.     case 'k':
  727.       flag_by_kerneld = 1;    /* called by kernel daemon */
  728.       break;
  729.  
  730.     case 'l':
  731.       flag_list = 1;    /* list modules of certain kind */
  732.       break;
  733.  
  734.     case 'r':
  735.       flag_remove = 1;
  736.       break;
  737.  
  738.     case 's':
  739.       setsyslog ("modprobe");    /* use the syslog for reporting */
  740.       break;
  741.  
  742.     case 't':
  743.       type = xstrdup (optarg);
  744.       break;
  745.  
  746.     case 'v':
  747.       flag_verbose = 1;    /* give terse informations during run */
  748.       break;
  749.  
  750.     case '?':
  751.     case 'h':
  752.       usage ();
  753.       exit (opt_tag == 'h' ? 0 : 1);
  754.       break;
  755.  
  756.     case 'V':
  757.       puts ("modprobe (Linux modutils) " MODUTILS_VERSION);
  758.       if (argc != 2)
  759.         putchar ('\n');
  760.       break;
  761.  
  762.     default:
  763.       abort ();
  764.     }
  765.     }
  766.  
  767.   if (ret == -1)
  768.     return 1;
  769.  
  770.   /*
  771.    * Skip all automatically processed options.
  772.    */
  773.   argc -= optind;
  774.   argv += optind;
  775.  
  776.   /*
  777.    * argv now points to the first non-option argument
  778.    * argc is the remaining argument count
  779.    */
  780.  
  781. #ifndef NO_COMPAT
  782.   flag_new_syscalls = !query_module (NULL, 0, NULL, 0, NULL);
  783. #endif
  784.  
  785.   if (flag_remove)
  786.     {
  787.       if (argc > 0)
  788.     for (; argc > 0 && ret == 0; ++argv, --argc)
  789.       ret = unload (*argv);
  790.       else
  791.     nothing ("remove");
  792.     }
  793.   else if (flag_list)
  794.     {
  795.       if (argc > 0)
  796.     for (; argc > 0 && ret == 0; ++argv, --argc)
  797.       print_list (*argv, type);
  798.       else
  799.     print_list ("*", type);
  800.     }
  801.   else
  802.     {
  803.       if (argc > 0)
  804.     ret = load_from_list (argv, argc, type, flag_load_all);
  805.       else
  806.     nothing ("load");
  807.     }
  808.  
  809.   verbose ("\r");
  810.   return ret;
  811. }
  812.