diff options
Diffstat (limited to 'patches/busybox/1.26.0/busybox-1.26.0-mdstart.patch')
-rw-r--r-- | patches/busybox/1.26.0/busybox-1.26.0-mdstart.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/patches/busybox/1.26.0/busybox-1.26.0-mdstart.patch b/patches/busybox/1.26.0/busybox-1.26.0-mdstart.patch new file mode 100644 index 0000000..35057b6 --- /dev/null +++ b/patches/busybox/1.26.0/busybox-1.26.0-mdstart.patch @@ -0,0 +1,80 @@ +diff --git a/util-linux/mdStart.c b/util-linux/mdStart.c +--- util-linux/mdStart.c 1969-12-31 18:00:00.000000000 -0600 ++++ util-linux/mdStart.c 2017-01-01 18:25:14.582737879 -0600 +@@ -0,0 +1,76 @@ ++/* ++ * Linux 2.6(+) RAID Autostarter ++ * ++ * Copyright (C) 2005 by Tim Yamin <plasmaroo@gentoo.org> <plasm@roo.me.uk> ++ * Copyright (C) 2012 by Sebastian Pipping <sebastian@pipping.org> ++ * ++ * 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 ++ * ++ */ ++//config:config MDSTART ++//config: bool "mdstart" ++//config: default n ++//config: help ++//config: Allows you to autostart /dev/md devices if using an initramfs to ++//config: boot. ++ ++//applet:IF_MDSTART(APPLET(mdstart, BB_DIR_SBIN, BB_SUID_DROP)) ++ ++//kbuild:lib-$(CONFIG_MDSTART) += mdStart.o ++ ++//usage:#define mdstart_trivial_usage ++//usage: "[PARTITION] MD-NODE [[PARTITION] MD-NODE ...]" ++//usage: ++//usage:#define mdstart_full_usage "\n\n" ++//usage: "Run the RAID_AUTORUN ioctl on the given MD number" ++ ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <fcntl.h> ++#include <sys/ioctl.h> ++#include <linux/major.h> ++#include <linux/raid/md_u.h> ++ ++extern int ++mdstart_main(int argc, char *argv[]) ++{ ++ int i, fd, part = 0, retval = 0; ++ ++ if(argc < 2) ++ { ++ bb_show_usage(); ++ } ++ ++ for(i = 1; i < argc; i++) ++ { ++ if(sscanf(argv[i], "%d", &part) == 1) ++ continue; ++ ++ fd = open(argv[i], 0, 0); ++ if (fd >= 0) ++ { ++ ioctl(fd, RAID_AUTORUN, part); ++ close(fd); ++ } else ++ { ++ printf("Error: Failed to open %s!\n", argv[i]); ++ retval=1; ++ } ++ ++ part = 0; ++ } ++ ++ return retval; ++} |