blob: c6d8e6235478c3264bcde71d452b7d795b63f8d3
1 | /* vi: set sw=4 ts=4: */ |
2 | /* |
3 | * raidautorun implementation for busybox |
4 | * |
5 | * Copyright (C) 2006 Bernhard Reutner-Fischer |
6 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
8 | * |
9 | */ |
10 | //config:config RAIDAUTORUN |
11 | //config: bool "raidautorun" |
12 | //config: default y |
13 | //config: select PLATFORM_LINUX |
14 | //config: help |
15 | //config: raidautorun tells the kernel md driver to |
16 | //config: search and start RAID arrays. |
17 | |
18 | //applet:IF_RAIDAUTORUN(APPLET(raidautorun, BB_DIR_SBIN, BB_SUID_DROP)) |
19 | |
20 | //kbuild:lib-$(CONFIG_RAIDAUTORUN) += raidautorun.o |
21 | |
22 | //usage:#define raidautorun_trivial_usage |
23 | //usage: "DEVICE" |
24 | //usage:#define raidautorun_full_usage "\n\n" |
25 | //usage: "Tell the kernel to automatically search and start RAID arrays" |
26 | //usage: |
27 | //usage:#define raidautorun_example_usage |
28 | //usage: "$ raidautorun /dev/md0" |
29 | |
30 | #include "libbb.h" |
31 | |
32 | #include <linux/major.h> |
33 | #include <linux/raid/md_u.h> |
34 | |
35 | int raidautorun_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
36 | int raidautorun_main(int argc UNUSED_PARAM, char **argv) |
37 | { |
38 | xioctl(xopen(single_argv(argv), O_RDONLY), RAID_AUTORUN, NULL); |
39 | return EXIT_SUCCESS; |
40 | } |
41 |