diff -urN busybox-1.00-pre2.org/include/applets.h busybox-1.00-pre2/include/applets.h --- busybox-1.00-pre2.org/include/applets.h 2003-08-02 23:46:48.000000000 +0200 +++ busybox-1.00-pre2/include/applets.h 2003-08-03 00:32:31.000000000 +0200 @@ -457,6 +457,9 @@ #ifdef CONFIG_PWD APPLET(pwd, pwd_main, _BB_DIR_BIN, _BB_SUID_NEVER) #endif +#ifdef CONFIG_RAID_START + APPLET(raid_start, raid_start_main, _BB_DIR_SBIN, _BB_SUID_NEVER) +#endif #ifdef CONFIG_RDATE APPLET(rdate, rdate_main, _BB_DIR_USR_SBIN, _BB_SUID_NEVER) #endif diff -urN busybox-1.00-pre2.org/sysdeps/linux/defconfig busybox-1.00-pre2/sysdeps/linux/defconfig --- busybox-1.00-pre2.org/sysdeps/linux/defconfig 2003-08-02 23:46:49.000000000 +0200 +++ busybox-1.00-pre2/sysdeps/linux/defconfig 2003-08-03 00:32:31.000000000 +0200 @@ -290,6 +290,7 @@ # CONFIG_FEATURE_USE_DEVPS_PATCH is not set CONFIG_UMOUNT=y # CONFIG_FEATURE_MOUNT_FORCE is not set +CONFIG_RAID_START=y # # Common options for mount/umount diff -urN busybox-1.00-pre2.org/util-linux/Config.in busybox-1.00-pre2/util-linux/Config.in --- busybox-1.00-pre2.org/util-linux/Config.in 2003-08-02 23:46:49.000000000 +0200 +++ busybox-1.00-pre2/util-linux/Config.in 2003-08-03 00:32:31.000000000 +0200 @@ -285,6 +285,12 @@ NFS filesystems. Most people using BusyBox will also want to enable the 'mount' utility. +config CONFIG_RAID_START + bool "raid_start" + default y + help + Enable support for RAID starting. + config CONFIG_NFSMOUNT bool " Support mounting nfs file systems" default n diff -urN busybox-1.00-pre2.org/util-linux/Makefile.in busybox-1.00-pre2/util-linux/Makefile.in --- busybox-1.00-pre2.org/util-linux/Makefile.in 2003-08-02 23:46:49.000000000 +0200 +++ busybox-1.00-pre2/util-linux/Makefile.in 2003-08-03 00:32:31.000000000 +0200 @@ -38,6 +38,7 @@ UTILLINUX-$(CONFIG_MKSWAP) += mkswap.o UTILLINUX-$(CONFIG_MORE) += more.o UTILLINUX-$(CONFIG_MOUNT) += mount.o +UTILLINUX-$(CONFIG_RAID_START) += raid_start.o UTILLINUX-$(CONFIG_NFSMOUNT) += nfsmount.o UTILLINUX-$(CONFIG_PIVOT_ROOT) += pivot_root.o UTILLINUX-$(CONFIG_RDATE) += rdate.o diff -urN busybox-1.00-pre2.org/util-linux/raid_start.c busybox-1.00-pre2/util-linux/raid_start.c --- busybox-1.00-pre2.org/util-linux/raid_start.c 1970-01-01 01:00:00.000000000 +0100 +++ busybox-1.00-pre2/util-linux/raid_start.c 2003-08-03 00:34:47.000000000 +0200 @@ -0,0 +1,72 @@ +/* vi: set sw=4 ts=4: */ +/* + * raid_start implementation for busybox + * + * Copyright (C) 2003 by Michal Moskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include +#include +#include +#include +#include + +#include "busybox.h" + +#define MD_MAJOR 9 +#define START_ARRAY _IO (MD_MAJOR, 0x31) + +extern int raid_start_main(int argc, char **argv) +{ + int fd_md; + int i; + struct stat st; + + if (argc < 3) { + bb_show_usage(); + return 0; + } + + fd_md = open(argv[1], O_RDWR, 0); + if (fd_md < 0) + bb_perror_msg_and_die("error opening raid device `%s'", argv[1]); + + for (i = 2; i < argc; i++) { + if (stat(argv[i], &st)) { + bb_perror_msg("error stating raid builing device `%s'", argv[i]); + continue; + } + + if (ioctl(fd_md, START_ARRAY, (unsigned long) st.st_rdev) == -1) { + bb_perror_msg("error starting raid device `%s:%s'", argv[1], argv[i]); + continue; + } + + return 0; + } + + return 1; +} + +/* +Local Variables: +c-file-style: "linux" +c-basic-offset: 4 +tab-width: 4 +End: +*/