aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-20 19:39:48 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-20 19:39:48 +0000
commit568ed4ddbbee5b7a4029f7d8c16f74b4572f81c5 (patch)
tree757dd8f1e77e8b1838adb069b6009b934b90b92b
parent830293e36b928e0e8da6aeaaa3f07b662a2ad80c (diff)
downloadbusybox-w32-568ed4ddbbee5b7a4029f7d8c16f74b4572f81c5.tar.gz
busybox-w32-568ed4ddbbee5b7a4029f7d8c16f74b4572f81c5.tar.bz2
busybox-w32-568ed4ddbbee5b7a4029f7d8c16f74b4572f81c5.zip
raidautorun: new applet, by:
Thomas Jarosch (email?) and Bernhard Fischer <rep.nop@aon.at> git-svn-id: svn://busybox.net/trunk/busybox@16415 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--include/applets.h1
-rw-r--r--include/usage.h7
-rw-r--r--miscutils/Config.in7
-rw-r--r--miscutils/Kbuild1
-rw-r--r--miscutils/raidautorun.c23
5 files changed, 39 insertions, 0 deletions
diff --git a/include/applets.h b/include/applets.h
index 0c0209676..14f6156af 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -228,6 +228,7 @@ USE_PRINTENV(APPLET(printenv, _BB_DIR_BIN, _BB_SUID_NEVER))
228USE_PRINTF(APPLET(printf, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 228USE_PRINTF(APPLET(printf, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
229USE_PS(APPLET(ps, _BB_DIR_BIN, _BB_SUID_NEVER)) 229USE_PS(APPLET(ps, _BB_DIR_BIN, _BB_SUID_NEVER))
230USE_PWD(APPLET(pwd, _BB_DIR_BIN, _BB_SUID_NEVER)) 230USE_PWD(APPLET(pwd, _BB_DIR_BIN, _BB_SUID_NEVER))
231USE_RAIDAUTORUN(APPLET(raidautorun, _BB_DIR_SBIN, _BB_SUID_NEVER))
231USE_RDATE(APPLET(rdate, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) 232USE_RDATE(APPLET(rdate, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
232USE_READAHEAD(APPLET(readahead, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 233USE_READAHEAD(APPLET(readahead, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
233USE_READLINK(APPLET(readlink, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) 234USE_READLINK(APPLET(readlink, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
diff --git a/include/usage.h b/include/usage.h
index ffd00cfc8..f9597763e 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -2400,6 +2400,13 @@ USE_FEATURE_MDEV_CONFIG( \
2400 "$ pwd\n" \ 2400 "$ pwd\n" \
2401 "/root\n" 2401 "/root\n"
2402 2402
2403#define raidautorun_trivial_usage \
2404 "DEVICE"
2405#define raidautorun_full_usage \
2406 "Tells the kernel to automatically search and start RAID arrays"
2407#define raidautorun_example_usage \
2408 "$ raidautorun /dev/md0"
2409
2403#define rdate_trivial_usage \ 2410#define rdate_trivial_usage \
2404 "[-sp] HOST" 2411 "[-sp] HOST"
2405#define rdate_full_usage \ 2412#define rdate_full_usage \
diff --git a/miscutils/Config.in b/miscutils/Config.in
index 5d0ec8a42..e093924d7 100644
--- a/miscutils/Config.in
+++ b/miscutils/Config.in
@@ -284,6 +284,13 @@ config NMETER
284 help 284 help
285 nmeter prints various system parameters continuously. 285 nmeter prints various system parameters continuously.
286 286
287config RAIDAUTORUN
288 bool "raidautorun"
289 default n
290 help
291 raidautorun tells the kernel md driver to
292 search and start RAID arrays.
293
287config READAHEAD 294config READAHEAD
288 bool "readahead" 295 bool "readahead"
289 default n 296 default n
diff --git a/miscutils/Kbuild b/miscutils/Kbuild
index 3173e1dab..16c76fa38 100644
--- a/miscutils/Kbuild
+++ b/miscutils/Kbuild
@@ -19,6 +19,7 @@ lib-$(CONFIG_MAKEDEVS) += makedevs.o
19lib-$(CONFIG_MOUNTPOINT) += mountpoint.o 19lib-$(CONFIG_MOUNTPOINT) += mountpoint.o
20lib-$(CONFIG_MT) += mt.o 20lib-$(CONFIG_MT) += mt.o
21lib-$(CONFIG_NMETER) += nmeter.o 21lib-$(CONFIG_NMETER) += nmeter.o
22lib-$(CONFIG_RAIDAUTORUN) += raidautorun.o
22lib-$(CONFIG_READAHEAD) += readahead.o 23lib-$(CONFIG_READAHEAD) += readahead.o
23lib-$(CONFIG_RUNLEVEL) += runlevel.o 24lib-$(CONFIG_RUNLEVEL) += runlevel.o
24lib-$(CONFIG_RX) += rx.o 25lib-$(CONFIG_RX) += rx.o
diff --git a/miscutils/raidautorun.c b/miscutils/raidautorun.c
new file mode 100644
index 000000000..c25630494
--- /dev/null
+++ b/miscutils/raidautorun.c
@@ -0,0 +1,23 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * raidautorun implementation for busybox
4 *
5 * Copyright (C) 2006 Bernhard Fischer
6 *
7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
8 *
9 */
10
11#include "busybox.h"
12
13#include <linux/major.h>
14#include <linux/raid/md_u.h>
15
16int raidautorun_main(int argc, char **argv)
17{
18 if (ioctl(xopen(argv[1], O_RDONLY), RAID_AUTORUN, NULL) != 0) {
19 bb_perror_msg_and_die("ioctl");
20 }
21
22 return EXIT_SUCCESS;
23}