00-fsdev.sh: drop any reference to mdstart, no longer used nowadays

See Gentoo bug #494804
master
Fabio Erculiani 11 years ago
parent 9097998cad
commit 65d6d36332

@ -375,7 +375,6 @@ CONFIG_HEXDUMP=y
CONFIG_LOSETUP=y
CONFIG_MDADM=y
CONFIG_MDEV=y
CONFIG_MDSTART=y
# CONFIG_MKSWAP is not set
CONFIG_MORE=y
CONFIG_FEATURE_USE_TERMIOS=y

@ -117,7 +117,6 @@ _open_luks() {
[ -n "${luks_dev}" ] && \
luks_device="${luks_dev}" # otherwise hope...
setup_md_device "${luks_device}"
eval "${CRYPTSETUP_BIN} isLuks ${luks_device}" || {
bad_msg "${luks_device} does not contain a LUKS header"
dev_error=1

@ -152,35 +152,6 @@ media_find() {
[ -n "${result}" ] || bad_msg "Media not found"
}
setup_md_device() {
if ! is_mdev; then
# mdev requires manual device node creation, while udev doesn't
# make sure that all the udev events are complete
is_udev && udevadm settle
return 0
fi
local device=
[ -n "${1}" ] && device="${1}"
[ -z "${1}" ] && device="${REAL_ROOT}"
[ -z "${device}" ] && return 0
local md_dev=$(echo ${device} | sed -e \
's#\(luks:\)\?\(/dev/md\)[[:digit:]]\+#\2#')
if [ "${md_dev}" = "/dev/md" ]; then
good_msg 'Detected root as a md device. Setting up the device node...'
local md_number=$(echo ${device} | sed -e \
's#\(luks:\)\?/dev/md\([[:digit:]]\+\)#\2#')
if [ ! -e "/dev/md${md_number}" ]; then
mknod "/dev/md${md_number}" b 9 "${md_number}" >/dev/null 2>&1
[ $? -ne 0 ] && bad_msg "Creation of /dev/md${md_number} failed..."
fi
mdstart ${MDPART} "/dev/md${md_number}"
fi
}
start_md_volumes() {
good_msg "Starting md devices"
"${MDADM_BIN}" --assemble --scan
@ -215,11 +186,10 @@ start_volumes() {
bad_msg "dmraid failed to run, skipping raid assembly!"
fi
if [ "${USE_LVM_NORMAL}" = "1" ]; then
# make sure that all the devices had time to be configured
is_udev && udevadm settle
for dev in ${RAID_DEVICES}; do
setup_md_device "${dev}"
done
if [ "${USE_LVM_NORMAL}" = "1" ]; then
# This is needed for /sbin/lvm to accept the following logic
local cmds="#! /sbin/lvm"

@ -285,9 +285,6 @@ cd /
start_iscsi
# Setup md device nodes if they dont exist
setup_md_device
start_volumes
zfs_start_volumes

@ -468,7 +468,6 @@ CONFIG_MDEV=y
CONFIG_FEATURE_MDEV_CONF=y
CONFIG_FEATURE_MDEV_EXEC=y
CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
CONFIG_MDSTART=y
CONFIG_MKSWAP=y
# CONFIG_FEATURE_MKSWAP_V0 is not set
CONFIG_MORE=y

@ -1,130 +0,0 @@
From d1f76c9546758611bcadd6ad10fc0c4c1ceb14ee Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
Date: Sun, 10 Jun 2012 19:05:38 +0200
Subject: [PATCH] Port mdstart patch from busybox 1.19.3 to 1.20.1
---
include/applets.src.h | 1 +
util-linux/Config.src | 7 ++++++
util-linux/Kbuild.src | 1 +
util-linux/mdStart.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 75 insertions(+)
create mode 100644 util-linux/mdStart.c
diff --git a/include/applets.src.h b/include/applets.src.h
index 252a060..0b199bc 100644
--- a/include/applets.src.h
+++ b/include/applets.src.h
@@ -239,6 +239,7 @@ IF_MAKEMIME(APPLET(makemime, BB_DIR_BIN, BB_SUID_DROP))
IF_MAN(APPLET(man, BB_DIR_SBIN, BB_SUID_DROP))
IF_MATCHPATHCON(APPLET(matchpathcon, BB_DIR_USR_SBIN, BB_SUID_DROP))
IF_MD5SUM(APPLET_NOEXEC(md5sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, md5sum))
+IF_MDSTART(APPLET(mdstart, BB_DIR_SBIN, BB_SUID_DROP))
IF_MICROCOM(APPLET(microcom, BB_DIR_USR_BIN, BB_SUID_DROP))
IF_MKDIR(APPLET_NOFORK(mkdir, mkdir, BB_DIR_BIN, BB_SUID_DROP, mkdir))
IF_MKFS_VFAT(APPLET_ODDNAME(mkdosfs, mkfs_vfat, BB_DIR_SBIN, BB_SUID_DROP, mkfs_vfat))
diff --git a/util-linux/Config.src b/util-linux/Config.src
index 57a52ce..e07fe2b 100644
--- a/util-linux/Config.src
+++ b/util-linux/Config.src
@@ -404,6 +404,13 @@ config LSUSB
This version uses sysfs (/sys/bus/usb/devices) only.
+config MDSTART
+ bool "mdstart"
+ default n
+ help
+ Allows you to autostart /dev/md devices if using an initramfs to
+ boot.
+
config MKSWAP
bool "mkswap"
default y
diff --git a/util-linux/Kbuild.src b/util-linux/Kbuild.src
index 468fc6b..0bc9a9b 100644
--- a/util-linux/Kbuild.src
+++ b/util-linux/Kbuild.src
@@ -24,6 +24,7 @@ lib-$(CONFIG_HWCLOCK) += hwclock.o
lib-$(CONFIG_IPCRM) += ipcrm.o
lib-$(CONFIG_IPCS) += ipcs.o
lib-$(CONFIG_LOSETUP) += losetup.o
+lib-$(CONFIG_MDSTART) += mdStart.o
lib-$(CONFIG_LSPCI) += lspci.o
lib-$(CONFIG_LSUSB) += lsusb.o
lib-$(CONFIG_MKFS_EXT2) += mkfs_ext2.o
diff --git a/util-linux/mdStart.c b/util-linux/mdStart.c
new file mode 100644
index 0000000..0c55bab
--- /dev/null
+++ b/util-linux/mdStart.c
@@ -0,0 +1,66 @@
+/*
+ * 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
+ *
+ */
+
+//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;
+}
--
1.7.10.2
Loading…
Cancel
Save