Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * depmod - generate modules.dep |
Bernhard Reutner-Fischer | 6c4dade | 2008-09-25 12:13:34 +0000 | [diff] [blame] | 4 | * Copyright (c) 2008 Bernhard Reutner-Fischer |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 5 | * Copyrihgt (c) 2008 Timo Teras <timo.teras@iki.fi> |
| 6 | * Copyright (c) 2008 Vladimir Dronnikov |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 7 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
Denys Vlasenko | b9f2d9f | 2011-01-18 13:58:01 +0100 | [diff] [blame] | 11 | //applet:IF_DEPMOD(APPLET(depmod, BB_DIR_SBIN, BB_SUID_DROP)) |
Denys Vlasenko | c15613c | 2010-10-15 11:29:02 +0200 | [diff] [blame] | 12 | |
Denys Vlasenko | 043b1e5 | 2009-09-06 12:47:55 +0200 | [diff] [blame] | 13 | #include "libbb.h" |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 14 | #include "modutils.h" |
Denys Vlasenko | 043b1e5 | 2009-09-06 12:47:55 +0200 | [diff] [blame] | 15 | #include <sys/utsname.h> /* uname() */ |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 16 | |
Bernhard Reutner-Fischer | cf18010 | 2008-05-26 15:12:01 +0000 | [diff] [blame] | 17 | /* |
| 18 | * Theory of operation: |
| 19 | * - iterate over all modules and record their full path |
| 20 | * - iterate over all modules looking for "depends=" entries |
| 21 | * for each depends, look through our list of full paths and emit if found |
| 22 | */ |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 23 | |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 24 | static int FAST_FUNC parse_module(const char *fname, struct stat *sb UNUSED_PARAM, |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 25 | void *data, int depth UNUSED_PARAM) |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 26 | { |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 27 | module_db *modules = data; |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 28 | char *image, *ptr; |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 29 | module_entry *e; |
| 30 | |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 31 | /* Arbitrary. Was sb->st_size, but that breaks .gz etc */ |
| 32 | size_t len = (64*1024*1024 - 4096); |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 33 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 34 | if (strrstr(fname, ".ko") == NULL) |
| 35 | return TRUE; |
Bernhard Reutner-Fischer | 634b022 | 2008-05-28 14:20:20 +0000 | [diff] [blame] | 36 | |
Denis Vlasenko | fc66892 | 2008-11-06 02:32:31 +0000 | [diff] [blame] | 37 | image = xmalloc_open_zipped_read_close(fname, &len); |
Bernhard Reutner-Fischer | c2741e1 | 2008-06-02 18:59:16 +0000 | [diff] [blame] | 38 | |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 39 | e = moddb_get_or_create(modules, bb_get_last_path_component_nostrip(fname)); |
| 40 | e->name = xstrdup(fname + 2); /* skip "./" */ |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 41 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 42 | for (ptr = image; ptr < image + len - 10; ptr++) { |
Denys Vlasenko | 8dff01d | 2015-03-12 17:48:34 +0100 | [diff] [blame] | 43 | if (is_prefixed_with(ptr, "depends=")) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 44 | char *u; |
| 45 | |
| 46 | ptr += 8; |
| 47 | for (u = ptr; *u; u++) |
| 48 | if (*u == '-') |
| 49 | *u = '_'; |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 50 | ptr += string_to_llist(ptr, &e->deps, ","); |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 51 | } else if (ENABLE_FEATURE_MODUTILS_ALIAS |
Denys Vlasenko | 8dff01d | 2015-03-12 17:48:34 +0100 | [diff] [blame] | 52 | && is_prefixed_with(ptr, "alias=") |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 53 | ) { |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 54 | llist_add_to(&e->aliases, xstrdup(ptr + 6)); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 55 | ptr += strlen(ptr); |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 56 | } else if (ENABLE_FEATURE_MODUTILS_SYMBOLS |
Denys Vlasenko | 8dff01d | 2015-03-12 17:48:34 +0100 | [diff] [blame] | 57 | && is_prefixed_with(ptr, "__ksymtab_") |
Denys Vlasenko | 16bda3b | 2009-05-18 13:08:04 +0200 | [diff] [blame] | 58 | ) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 59 | ptr += 10; |
Denys Vlasenko | 8dff01d | 2015-03-12 17:48:34 +0100 | [diff] [blame] | 60 | if (is_prefixed_with(ptr, "gpl") |
Denys Vlasenko | 6b9f163 | 2010-01-28 02:24:24 +0100 | [diff] [blame] | 61 | || strcmp(ptr, "strings") == 0 |
| 62 | ) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 63 | continue; |
Denys Vlasenko | 6b9f163 | 2010-01-28 02:24:24 +0100 | [diff] [blame] | 64 | } |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 65 | llist_add_to(&e->symbols, xstrdup(ptr)); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 66 | ptr += strlen(ptr); |
| 67 | } |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 68 | } |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 69 | free(image); |
| 70 | |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 71 | return TRUE; |
| 72 | } |
| 73 | |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 74 | static void order_dep_list(module_db *modules, module_entry *start, llist_t *add) |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 75 | { |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 76 | module_entry *m; |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 77 | llist_t *n; |
| 78 | |
| 79 | for (n = add; n != NULL; n = n->link) { |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 80 | m = moddb_get(modules, n->data); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 81 | if (m == NULL) |
| 82 | continue; |
| 83 | |
| 84 | /* unlink current entry */ |
| 85 | m->dnext->dprev = m->dprev; |
| 86 | m->dprev->dnext = m->dnext; |
| 87 | |
| 88 | /* and add it to tail */ |
| 89 | m->dnext = start; |
| 90 | m->dprev = start->dprev; |
| 91 | start->dprev->dnext = m; |
| 92 | start->dprev = m; |
| 93 | |
| 94 | /* recurse */ |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 95 | order_dep_list(modules, start, m->deps); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 96 | } |
| 97 | } |
| 98 | |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 99 | static void xfreopen_write(const char *file, FILE *f) |
| 100 | { |
| 101 | if (freopen(file, "w", f) == NULL) |
| 102 | bb_perror_msg_and_die("can't open '%s'", file); |
| 103 | } |
| 104 | |
Lauri Kasanen | 5a5db93 | 2012-02-19 16:33:37 +0100 | [diff] [blame] | 105 | //usage:#if !ENABLE_MODPROBE_SMALL |
| 106 | //usage:#define depmod_trivial_usage "[-n] [-b BASE] [VERSION] [MODFILES]..." |
| 107 | //usage:#define depmod_full_usage "\n\n" |
| 108 | //usage: "Generate modules.dep, alias, and symbols files" |
| 109 | //usage: "\n" |
| 110 | //usage: "\n -b BASE Use BASE/lib/modules/VERSION" |
| 111 | //usage: "\n -n Dry run: print files to stdout" |
| 112 | //usage:#endif |
| 113 | |
| 114 | /* Upstream usage: |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 115 | * [-aAenv] [-C FILE or DIR] [-b BASE] [-F System.map] [VERSION] [MODFILES]... |
| 116 | * -a --all |
| 117 | * Probe all modules. Default if no MODFILES. |
| 118 | * -A --quick |
| 119 | * Check modules.dep's mtime against module files' mtimes. |
| 120 | * -b --basedir BASE |
| 121 | * Use $BASE/lib/modules/VERSION |
| 122 | * -C --config FILE or DIR |
| 123 | * Path to /etc/depmod.conf or /etc/depmod.d/ |
| 124 | * -e --errsyms |
Lauri Kasanen | 5a5db93 | 2012-02-19 16:33:37 +0100 | [diff] [blame] | 125 | * When combined with the -F option, this reports any symbols |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 126 | * which are not supplied by other modules or kernel. |
| 127 | * -F --filesyms System.map |
| 128 | * -n --dry-run |
| 129 | * Print modules.dep etc to standard output |
| 130 | * -v --verbose |
| 131 | * Print to stdout all the symbols each module depends on |
| 132 | * and the module's file name which provides that symbol. |
| 133 | * -r No-op |
Pascal Bellard | cadf901 | 2010-10-18 00:51:16 +0200 | [diff] [blame] | 134 | * -u No-op |
| 135 | * -q No-op |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 136 | * |
Lauri Kasanen | 5a5db93 | 2012-02-19 16:33:37 +0100 | [diff] [blame] | 137 | * So far we only support: [-n] [-b BASE] [VERSION] [MODFILES]... |
| 138 | * Accepted but ignored: |
| 139 | * -aAe |
| 140 | * -F System.map |
| 141 | * -C FILE/DIR |
| 142 | * |
| 143 | * Not accepted: -v |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 144 | */ |
| 145 | enum { |
| 146 | //OPT_a = (1 << 0), /* All modules, ignore mods in argv */ |
| 147 | //OPT_A = (1 << 1), /* Only emit .ko that are newer than modules.dep file */ |
| 148 | OPT_b = (1 << 2), /* base directory when modules are in staging area */ |
| 149 | //OPT_e = (1 << 3), /* with -F, print unresolved symbols */ |
| 150 | //OPT_F = (1 << 4), /* System.map that contains the symbols */ |
| 151 | OPT_n = (1 << 5), /* dry-run, print to stdout only */ |
Pascal Bellard | cadf901 | 2010-10-18 00:51:16 +0200 | [diff] [blame] | 152 | OPT_r = (1 << 6), /* Compat dummy. Linux Makefile uses it */ |
| 153 | OPT_u = (1 << 7), /* -u,--unresolved-error: ignored */ |
| 154 | OPT_q = (1 << 8), /* -q,--quiet: ignored */ |
| 155 | OPT_C = (1 << 9), /* -C,--config etc_modules_conf: ignored */ |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 156 | }; |
| 157 | |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 158 | int depmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
Denis Vlasenko | a60f84e | 2008-07-05 09:18:54 +0000 | [diff] [blame] | 159 | int depmod_main(int argc UNUSED_PARAM, char **argv) |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 160 | { |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 161 | module_db modules; |
| 162 | module_entry *m, *dep; |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 163 | const char *moddir_base = "/"; |
| 164 | char *moddir, *version; |
| 165 | struct utsname uts; |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 166 | unsigned i; |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 167 | int tmp; |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 168 | |
Pascal Bellard | cadf901 | 2010-10-18 00:51:16 +0200 | [diff] [blame] | 169 | getopt32(argv, "aAb:eF:nruqC:", &moddir_base, NULL, NULL); |
Bernhard Reutner-Fischer | 6bb55cf | 2008-05-26 17:04:01 +0000 | [diff] [blame] | 170 | argv += optind; |
Bernhard Reutner-Fischer | c21d9c7 | 2008-05-28 10:35:51 +0000 | [diff] [blame] | 171 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 172 | /* goto modules location */ |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 173 | xchdir(moddir_base); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 174 | |
| 175 | /* If a version is provided, then that kernel version's module directory |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 176 | * is used, rather than the current kernel version (as returned by |
| 177 | * "uname -r"). */ |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 178 | if (*argv && sscanf(*argv, "%u.%u.%u", &tmp, &tmp, &tmp) == 3) { |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 179 | version = *argv++; |
Bernhard Reutner-Fischer | 1ea2568 | 2008-05-26 21:33:05 +0000 | [diff] [blame] | 180 | } else { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 181 | uname(&uts); |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 182 | version = uts.release; |
Bernhard Reutner-Fischer | 6bb55cf | 2008-05-26 17:04:01 +0000 | [diff] [blame] | 183 | } |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 184 | moddir = concat_path_file(&CONFIG_DEFAULT_MODULES_DIR[1], version); |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 185 | xchdir(moddir); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 186 | if (ENABLE_FEATURE_CLEAN_UP) |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 187 | free(moddir); |
Bernhard Reutner-Fischer | 6bb55cf | 2008-05-26 17:04:01 +0000 | [diff] [blame] | 188 | |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 189 | /* Scan modules */ |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 190 | memset(&modules, 0, sizeof(modules)); |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 191 | if (*argv) { |
| 192 | do { |
| 193 | parse_module(*argv, /*sb (unused):*/ NULL, &modules, 0); |
| 194 | } while (*++argv); |
| 195 | } else { |
| 196 | recursive_action(".", ACTION_RECURSE, |
Denys Vlasenko | 6967578 | 2013-01-14 01:34:48 +0100 | [diff] [blame] | 197 | parse_module, NULL, &modules, 0); |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 198 | } |
| 199 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 200 | /* Generate dependency and alias files */ |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 201 | if (!(option_mask32 & OPT_n)) |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 202 | xfreopen_write(CONFIG_DEFAULT_DEPMOD_FILE, stdout); |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 203 | |
| 204 | moddb_foreach_module(&modules, m, i) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 205 | printf("%s:", m->name); |
| 206 | |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 207 | order_dep_list(&modules, m, m->deps); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 208 | while (m->dnext != m) { |
| 209 | dep = m->dnext; |
| 210 | printf(" %s", dep->name); |
| 211 | |
| 212 | /* unlink current entry */ |
| 213 | dep->dnext->dprev = dep->dprev; |
| 214 | dep->dprev->dnext = dep->dnext; |
| 215 | dep->dnext = dep->dprev = dep; |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 216 | } |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 217 | bb_putchar('\n'); |
Bernhard Reutner-Fischer | c2741e1 | 2008-06-02 18:59:16 +0000 | [diff] [blame] | 218 | } |
| 219 | |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 220 | #if ENABLE_FEATURE_MODUTILS_ALIAS |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 221 | if (!(option_mask32 & OPT_n)) |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 222 | xfreopen_write("modules.alias", stdout); |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 223 | moddb_foreach_module(&modules, m, i) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 224 | while (m->aliases) { |
Denys Vlasenko | cc70b6f | 2015-01-24 22:30:30 +0100 | [diff] [blame] | 225 | /* |
| 226 | * Last word used to be a basename |
| 227 | * (filename with path and .ko.* stripped) |
| 228 | * at the time of module-init-tools 3.4. |
| 229 | * kmod v.12 uses module name, i.e., s/-/_/g. |
| 230 | */ |
Denys Vlasenko | 08364da | 2015-01-07 14:39:01 +0100 | [diff] [blame] | 231 | printf("alias %s %s\n", |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 232 | (char*)llist_pop(&m->aliases), |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 233 | m->modname); |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 234 | } |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 235 | } |
| 236 | #endif |
| 237 | #if ENABLE_FEATURE_MODUTILS_SYMBOLS |
Denys Vlasenko | 4cab7f3 | 2010-07-18 17:41:17 +0200 | [diff] [blame] | 238 | if (!(option_mask32 & OPT_n)) |
Denis Vlasenko | 3526115 | 2009-01-12 22:12:22 +0000 | [diff] [blame] | 239 | xfreopen_write("modules.symbols", stdout); |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 240 | moddb_foreach_module(&modules, m, i) { |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 241 | while (m->symbols) { |
Denys Vlasenko | 08364da | 2015-01-07 14:39:01 +0100 | [diff] [blame] | 242 | printf("alias symbol:%s %s\n", |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 243 | (char*)llist_pop(&m->symbols), |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 244 | m->modname); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 245 | } |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 246 | } |
Bernhard Reutner-Fischer | c2741e1 | 2008-06-02 18:59:16 +0000 | [diff] [blame] | 247 | #endif |
Bernhard Reutner-Fischer | beac1bd | 2008-06-02 13:28:47 +0000 | [diff] [blame] | 248 | |
Timo Teräs | 48dc80b | 2015-11-05 18:54:55 +0100 | [diff] [blame] | 249 | if (ENABLE_FEATURE_CLEAN_UP) |
| 250 | moddb_free(&modules); |
Denis Vlasenko | ba1315d | 2008-09-13 14:59:38 +0000 | [diff] [blame] | 251 | |
| 252 | return EXIT_SUCCESS; |
Bernhard Reutner-Fischer | 55e547e | 2008-05-26 12:01:49 +0000 | [diff] [blame] | 253 | } |