raidautorun: new applet, by:
authorDenis Vlasenko <vda.linux@googlemail.com>
Fri, 20 Oct 2006 19:39:48 +0000 (19:39 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Fri, 20 Oct 2006 19:39:48 +0000 (19:39 -0000)
Thomas Jarosch (email?) and
Bernhard Fischer <rep.nop@aon.at>

include/applets.h
include/usage.h
miscutils/Config.in
miscutils/Kbuild
miscutils/raidautorun.c [new file with mode: 0644]

index 0c02096765e6b891040821b40fb541e7f4ac86e9..14f6156af86af9812716aee2e87981569316eeb4 100644 (file)
@@ -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))
index ffd00cfc80363c5a3ff1dff44e7f3444886cb080..f9597763e788e8e65e70d1ece1faba82143652ca 100644 (file)
@@ -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 \
index 5d0ec8a424362e9c2c39a008bae4ab252e6eacec..e093924d7119d48d08315ccf477c31d9e1053070 100644 (file)
@@ -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
index 3173e1daba89aa9b9585230ebc320b0ad7f037b8..16c76fa383a5d7936fe66a5b4242762edc5112b4 100644 (file)
@@ -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 (file)
index 0000000..c256304
--- /dev/null
@@ -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;
+}