1 /* vi: set sw=4 ts=4: */
3 * Mini insmod implementation for busybox
5 * Copyright (C) 2008 Timo Teras <timo.teras@iki.fi>
7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
13 /* 2.6 style insmod has no options and required filename
14 * (not module name - .ko can't be omitted) */
16 //usage:#define insmod_trivial_usage
17 //usage: IF_FEATURE_2_4_MODULES("[OPTIONS] MODULE ")
18 //usage: IF_NOT_FEATURE_2_4_MODULES("FILE ")
19 //usage: "[symbol=value]..."
20 //usage:#define insmod_full_usage "\n\n"
21 //usage: "Load the specified kernel modules into the kernel"
22 //usage: IF_FEATURE_2_4_MODULES( "\n"
24 //usage: "\n -f Force module to load into the wrong kernel version"
25 //usage: "\n -k Make module autoclean-able"
26 //usage: "\n -v Verbose"
27 //usage: "\n -q Quiet"
28 //usage: "\n -L Lock: prevent simultaneous loads"
29 //usage: IF_FEATURE_INSMOD_LOAD_MAP(
30 //usage: "\n -m Output load map to stdout"
32 //usage: "\n -x Don't export externs"
35 int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
36 int insmod_main(int argc UNUSED_PARAM, char **argv)
42 * 2.6 style insmod has no options and required filename
43 * (not module name - .ko can't be omitted).
44 * 2.4 style insmod can take module name without .o
45 * and performs module search in default directories
49 IF_FEATURE_2_4_MODULES(
50 getopt32(argv, INSMOD_OPTS INSMOD_ARGS);
58 rc = bb_init_module(filename, parse_cmdline_module_options(argv));
60 bb_error_msg("can't insert '%s': %s", filename, moderror(rc));