Annotation of /tags/mkinitrd-6_1_12/busybox/modutils/insmod.c
Parent Directory
|
Revision Log
Revision 939 -
(hide annotations)
(download)
Tue Nov 17 21:24:51 2009 UTC (14 years, 7 months ago) by niro
File MIME type: text/plain
File size: 710 byte(s)
Tue Nov 17 21:24:51 2009 UTC (14 years, 7 months ago) by niro
File MIME type: text/plain
File size: 710 byte(s)
tagged 'mkinitrd-6_1_12'
1 | niro | 532 | /* vi: set sw=4 ts=4: */ |
2 | /* | ||
3 | * Mini insmod implementation for busybox | ||
4 | * | ||
5 | niro | 816 | * Copyright (C) 2008 Timo Teras <timo.teras@iki.fi> |
6 | niro | 532 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | ||
8 | */ | ||
9 | |||
10 | niro | 816 | #include "libbb.h" |
11 | #include "modutils.h" | ||
12 | niro | 532 | |
13 | niro | 816 | int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
14 | int insmod_main(int argc UNUSED_PARAM, char **argv) | ||
15 | niro | 532 | { |
16 | niro | 816 | char *filename; |
17 | int rc; | ||
18 | niro | 532 | |
19 | niro | 816 | USE_FEATURE_2_4_MODULES( |
20 | getopt32(argv, INSMOD_OPTS INSMOD_ARGS); | ||
21 | argv += optind-1; | ||
22 | ); | ||
23 | niro | 532 | |
24 | filename = *++argv; | ||
25 | if (!filename) | ||
26 | bb_show_usage(); | ||
27 | |||
28 | niro | 816 | rc = bb_init_module(filename, parse_cmdline_module_options(argv)); |
29 | if (rc) | ||
30 | bb_error_msg("cannot insert '%s': %s", filename, moderror(rc)); | ||
31 | niro | 532 | |
32 | niro | 816 | return rc; |
33 | niro | 532 | } |