raidautorun.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. //config:config RAIDAUTORUN
  10. //config: bool "raidautorun (1.4 kb)"
  11. //config: default y
  12. //config: select PLATFORM_LINUX
  13. //config: help
  14. //config: raidautorun tells the kernel md driver to
  15. //config: search and start RAID arrays.
  16. //applet:IF_RAIDAUTORUN(APPLET_NOEXEC(raidautorun, raidautorun, BB_DIR_SBIN, BB_SUID_DROP, raidautorun))
  17. //kbuild:lib-$(CONFIG_RAIDAUTORUN) += raidautorun.o
  18. //usage:#define raidautorun_trivial_usage
  19. //usage: "DEVICE"
  20. //usage:#define raidautorun_full_usage "\n\n"
  21. //usage: "Tell the kernel to automatically search and start RAID arrays"
  22. //usage:
  23. //usage:#define raidautorun_example_usage
  24. //usage: "$ raidautorun /dev/md0"
  25. #include "libbb.h"
  26. #include <linux/major.h>
  27. #include <linux/raid/md_u.h>
  28. int raidautorun_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
  29. int raidautorun_main(int argc UNUSED_PARAM, char **argv)
  30. {
  31. xioctl(xopen(single_argv(argv), O_RDONLY), RAID_AUTORUN, NULL);
  32. return EXIT_SUCCESS;
  33. }