1 diff -urN busybox-1.00-pre2.org/include/applets.h busybox-1.00-pre2/include/applets.h
2 --- busybox-1.00-pre2.org/include/applets.h 2003-08-02 23:46:48.000000000 +0200
3 +++ busybox-1.00-pre2/include/applets.h 2003-08-03 00:32:31.000000000 +0200
6 APPLET(pwd, pwd_main, _BB_DIR_BIN, _BB_SUID_NEVER)
8 +#ifdef CONFIG_RAID_START
9 + APPLET(raid_start, raid_start_main, _BB_DIR_SBIN, _BB_SUID_NEVER)
12 APPLET(rdate, rdate_main, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)
14 diff -urN busybox-1.00-pre2.org/include/usage.h busybox-1.00-pre2/include/usage.h
15 --- busybox-1.00-pre2.org/include/usage.h 2003-08-02 23:46:48.000000000 +0200
16 +++ busybox-1.00-pre2/include/usage.h 2003-08-03 00:32:31.000000000 +0200
17 @@ -1924,6 +1924,12 @@
21 +#define raid_start_trivial_usage \
22 + "MD_DEVICE DISK_DEVICES..."
23 +#define raid_start_full_usage \
24 + "Start MD_DEVICE, taking superblock from DISK_DEVICES.\n" \
25 + "Example: raid_start /dev/md0 /dev/sdb /dev/sdc2"
27 #define rdate_trivial_usage \
29 #define rdate_full_usage \
30 diff -urN busybox-1.00-pre2.org/sysdeps/linux/defconfig busybox-1.00-pre2/sysdeps/linux/defconfig
31 --- busybox-1.00-pre2.org/sysdeps/linux/defconfig 2003-08-02 23:46:49.000000000 +0200
32 +++ busybox-1.00-pre2/sysdeps/linux/defconfig 2003-08-03 00:32:31.000000000 +0200
34 # CONFIG_FEATURE_USE_DEVPS_PATCH is not set
36 # CONFIG_FEATURE_MOUNT_FORCE is not set
40 # Common options for mount/umount
41 diff -urN busybox-1.00-pre2.org/util-linux/Config.in busybox-1.00-pre2/util-linux/Config.in
42 --- busybox-1.00-pre2.org/util-linux/Config.in 2003-08-02 23:46:49.000000000 +0200
43 +++ busybox-1.00-pre2/util-linux/Config.in 2003-08-03 00:32:31.000000000 +0200
45 NFS filesystems. Most people using BusyBox will also want to enable
48 +config CONFIG_RAID_START
52 + Enable support for RAID starting.
54 config CONFIG_NFSMOUNT
55 bool " Support mounting nfs file systems"
57 diff -urN busybox-1.00-pre2.org/util-linux/Makefile.in busybox-1.00-pre2/util-linux/Makefile.in
58 --- busybox-1.00-pre2.org/util-linux/Makefile.in 2003-08-02 23:46:49.000000000 +0200
59 +++ busybox-1.00-pre2/util-linux/Makefile.in 2003-08-03 00:32:31.000000000 +0200
61 UTILLINUX-$(CONFIG_MKSWAP) += mkswap.o
62 UTILLINUX-$(CONFIG_MORE) += more.o
63 UTILLINUX-$(CONFIG_MOUNT) += mount.o
64 +UTILLINUX-$(CONFIG_RAID_START) += raid_start.o
65 UTILLINUX-$(CONFIG_NFSMOUNT) += nfsmount.o
66 UTILLINUX-$(CONFIG_PIVOT_ROOT) += pivot_root.o
67 UTILLINUX-$(CONFIG_RDATE) += rdate.o
68 diff -urN busybox-1.00-pre2.org/util-linux/raid_start.c busybox-1.00-pre2/util-linux/raid_start.c
69 --- busybox-1.00-pre2.org/util-linux/raid_start.c 1970-01-01 01:00:00.000000000 +0100
70 +++ busybox-1.00-pre2/util-linux/raid_start.c 2003-08-03 00:34:47.000000000 +0200
72 +/* vi: set sw=4 ts=4: */
74 + * raid_start implementation for busybox
76 + * Copyright (C) 2003 by Michal Moskal <malekith@pld-linux.org>
78 + * This program is free software; you can redistribute it and/or modify
79 + * it under the terms of the GNU General Public License as published by
80 + * the Free Software Foundation; either version 2 of the License, or
81 + * (at your option) any later version.
83 + * This program is distributed in the hope that it will be useful,
84 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
85 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
86 + * General Public License for more details.
88 + * You should have received a copy of the GNU General Public License
89 + * along with this program; if not, write to the Free Software
90 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
94 +#include <sys/types.h>
95 +#include <sys/stat.h>
96 +#include <sys/ioctl.h>
100 +#include "busybox.h"
103 +#define START_ARRAY _IO (MD_MAJOR, 0x31)
105 +extern int raid_start_main(int argc, char **argv)
116 + fd_md = open(argv[1], O_RDWR, 0);
118 + bb_perror_msg_and_die("error opening raid device `%s'", argv[1]);
120 + for (i = 2; i < argc; i++) {
121 + if (stat(argv[i], &st)) {
122 + bb_perror_msg("error stating raid builing device `%s'", argv[i]);
126 + if (ioctl(fd_md, START_ARRAY, (unsigned long) st.st_rdev) == -1) {
127 + bb_perror_msg("error starting raid device `%s:%s'", argv[1], argv[i]);
139 +c-file-style: "linux"