Contents of /tags/mkinitrd-6_2_3/busybox/modutils/insmod.c
Parent Directory | Revision Log
Revision 1054 -
(show annotations)
(download)
Mon May 31 20:54:44 2010 UTC (14 years ago) by niro
File MIME type: text/plain
File size: 964 byte(s)
Mon May 31 20:54:44 2010 UTC (14 years ago) by niro
File MIME type: text/plain
File size: 964 byte(s)
tagged 'mkinitrd-6_2_3'
1 | /* vi: set sw=4 ts=4: */ |
2 | /* |
3 | * Mini insmod implementation for busybox |
4 | * |
5 | * Copyright (C) 2008 Timo Teras <timo.teras@iki.fi> |
6 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
8 | */ |
9 | |
10 | #include "libbb.h" |
11 | #include "modutils.h" |
12 | |
13 | int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
14 | int insmod_main(int argc UNUSED_PARAM, char **argv) |
15 | { |
16 | char *filename; |
17 | int rc; |
18 | |
19 | /* Compat note: |
20 | * 2.6 style insmod has no options and required filename |
21 | * (not module name - .ko can't be omitted). |
22 | * 2.4 style insmod can take module name without .o |
23 | * and performs module search in default directories |
24 | * or in $MODPATH. |
25 | */ |
26 | |
27 | IF_FEATURE_2_4_MODULES( |
28 | getopt32(argv, INSMOD_OPTS INSMOD_ARGS); |
29 | argv += optind - 1; |
30 | ); |
31 | |
32 | filename = *++argv; |
33 | if (!filename) |
34 | bb_show_usage(); |
35 | |
36 | rc = bb_init_module(filename, parse_cmdline_module_options(argv)); |
37 | if (rc) |
38 | bb_error_msg("can't insert '%s': %s", filename, moderror(rc)); |
39 | |
40 | return rc; |
41 | } |