summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-20 19:39:48 +0000
committerDenis Vlasenko2006-10-20 19:39:48 +0000
commitc108ed549771d16a8335c1e72a7c6b3798395bac (patch)
tree757dd8f1e77e8b1838adb069b6009b934b90b92b
parent456fa6c0b17b2ff465a34db031f667b3fcd4bf2e (diff)
downloadbusybox-c108ed549771d16a8335c1e72a7c6b3798395bac.zip
busybox-c108ed549771d16a8335c1e72a7c6b3798395bac.tar.gz
raidautorun: new applet, by:
Thomas Jarosch (email?) and Bernhard Fischer <rep.nop@aon.at>
-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 0c02096..14f6156 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -228,6 +228,7 @@ USE_PRINTENV(APPLET(printenv, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PRINTF(APPLET(printf, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_PS(APPLET(ps, _BB_DIR_BIN, _BB_SUID_NEVER))
USE_PWD(APPLET(pwd, _BB_DIR_BIN, _BB_SUID_NEVER))
+USE_RAIDAUTORUN(APPLET(raidautorun, _BB_DIR_SBIN, _BB_SUID_NEVER))
USE_RDATE(APPLET(rdate, _BB_DIR_USR_SBIN, _BB_SUID_NEVER))
USE_READAHEAD(APPLET(readahead, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
USE_READLINK(APPLET(readlink, _BB_DIR_USR_BIN, _BB_SUID_NEVER))
diff --git a/include/usage.h b/include/usage.h
index ffd00cf..f959776 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -2400,6 +2400,13 @@ USE_FEATURE_MDEV_CONFIG( \
"$ pwd\n" \
"/root\n"
+#define raidautorun_trivial_usage \
+ "DEVICE"
+#define raidautorun_full_usage \
+ "Tells the kernel to automatically search and start RAID arrays"
+#define raidautorun_example_usage \
+ "$ raidautorun /dev/md0"
+
#define rdate_trivial_usage \
"[-sp] HOST"
#define rdate_full_usage \
diff --git a/miscutils/Config.in b/miscutils/Config.in
index 5d0ec8a..e093924 100644
--- a/miscutils/Config.in
+++ b/miscutils/Config.in
@@ -284,6 +284,13 @@ config NMETER
help
nmeter prints various system parameters continuously.
+config RAIDAUTORUN
+ bool "raidautorun"
+ default n
+ help
+ raidautorun tells the kernel md driver to
+ search and start RAID arrays.
+
config READAHEAD
bool "readahead"
default n
diff --git a/miscutils/Kbuild b/miscutils/Kbuild
index 3173e1d..16c76fa 100644
--- a/miscutils/Kbuild
+++ b/miscutils/Kbuild
@@ -19,6 +19,7 @@ lib-$(CONFIG_MAKEDEVS) += makedevs.o
lib-$(CONFIG_MOUNTPOINT) += mountpoint.o
lib-$(CONFIG_MT) += mt.o
lib-$(CONFIG_NMETER) += nmeter.o
+lib-$(CONFIG_RAIDAUTORUN) += raidautorun.o
lib-$(CONFIG_READAHEAD) += readahead.o
lib-$(CONFIG_RUNLEVEL) += runlevel.o
lib-$(CONFIG_RX) += rx.o
diff --git a/miscutils/raidautorun.c b/miscutils/raidautorun.c
new file mode 100644
index 0000000..c256304
--- /dev/null
+++ b/miscutils/raidautorun.c
@@ -0,0 +1,23 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * raidautorun implementation for busybox
+ *
+ * Copyright (C) 2006 Bernhard Fischer
+ *
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+ *
+ */
+
+#include "busybox.h"
+
+#include <linux/major.h>
+#include <linux/raid/md_u.h>
+
+int raidautorun_main(int argc, char **argv)
+{
+ if (ioctl(xopen(argv[1], O_RDONLY), RAID_AUTORUN, NULL) != 0) {
+ bb_perror_msg_and_die("ioctl");
+ }
+
+ return EXIT_SUCCESS;
+}